Subversion Repositories Applications.papyrus

Compare Revisions

No changes between revisions

Ignore whitespace Rev 1370 → Rev 1371

/tags/Racine_livraison_narmer/api/html/HTML_TableFragmenteur.php
New file
0,0 → 1,110
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: HTML_TableFragmenteur.php,v 1.2 2006-04-28 12:41:26 florian Exp $
/**
* Classe qui permet de créer des tables de résultat divisé en page
*
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.2 $
// +------------------------------------------------------------------------------------------------------+
*/
 
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
include_once PAP_CHEMIN_API_PEAR.'HTML/Table.php' ;
 
/**
* class HTML_Liste
*
*/
class HTML_TableFragmenteur extends HTML_Table
{
/*** Attributes: ***/
 
/**
*
* @access protected
*/
var $pager;
/**
*
* @access private
*/
var $_utilise_pager;
 
 
/**
*
*
* @param bool utilise_pager Si l'on souhaite que les résultats soient divisés en page, on passe true.
* @return HTML_Liste
* @access public
*/
function HTML_Liste( $utilise_pager = false)
{
HTML_Table::HTML_Table() ;
$this->_utilise_pager = $utilise_pager ;
} // end of member function HTML_Liste
 
/**
*
*
* @param Array label_entete Un tableau contenant les labels pour l'entête de la liste.
* @return void
* @access public
*/
function construireEntete( $label_entete )
{
$this->addRow ($label_entete, '', 'TH') ;
} // end of member function construitEntete
 
/**
*
*
* @param Array label_liste Un tableau à double dimension contenant les valeurs de la liste. du type
* 0 =>'label', 'label2',
* 1 => ...
* @return void
* @access public
*/
function construireListe( $label_liste )
{
for ($i = 0; $i < count ($label_liste) ; $i++) {
$this->addRow ($label_liste[$i]) ;
//var_dump ($label_liste[$i]) ;
}
}
} // end of HTML_Liste
 
 
?>
/tags/Racine_livraison_narmer/api/formulaire/formulaire.class.inc.php
New file
0,0 → 1,117
<?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$
/**
* Formulaire
*
* Classe générique pour créer des formulaires
*
*@package Formulaire
//Auteur original :
*@author Florian SCHMITT <florian@ecole-et-nature.org>
//Autres auteurs :
*@copyright Tela-Botanica 2000-2004
*@version $Revision$ $Date$
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
if (!function_exists('bugFixRequirePath')) {
function bugFixRequirePath($newPath) {
$stringPath = dirname(__FILE__);
if (strstr($stringPath,":")) $stringExplode = "\\";
else $stringExplode = "/";
$paths = explode($stringExplode,$stringPath);
$newPaths = explode("/",$newPath);
if (count($newPaths) > 0) {
for($i=0;$i<count($newPaths);$i++) {
if ($newPaths[$i] == "..") array_pop($paths);
}
for($i=0;$i<count($newPaths);$i++) {
if ($newPaths[$i] == "..") unset($newPaths[$i]);
}
reset($newPaths);
$stringNewPath = implode($stringExplode,$paths).$stringExplode.implode($stringExplode,$newPaths);
return $stringNewPath;
}
}
}
require_once bugFixRequirePath('../../../api/pear/HTML/QuickForm.php') ;
require_once bugFixRequirePath('../../../api/pear/HTML/QuickForm/html.php') ;
require_once bugFixRequirePath('../../../api/pear/HTML/QuickForm/textarea.php') ;
require_once 'formulaire.fonct.inc.php' ;
 
class HTML_formulaire extends HTML_Quickform {
/**
* Constructeur
*
* @param string formName Le nom du formulaire
* @param string method Méthode post ou get
* @param string action L'action du formulaire.
* @param int target La cible.
* @param Array attributes Les attributs HTML en plus.
* @param bool trackSubmit ??
* @return void
* @access public
*/
function HTML_formulaire( $formName, $action, $template_champs_formulaire, $method = "post", $target=NULL, $attributes=NULL, $trackSubmit=false ) {
HTML_Quickform::HTML_Quickform($formName, $method, $action, $target, $attributes, $trackSubmit) ;
$this->removeAttribute('name');
$squelette =& $this->defaultRenderer();
$squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'{content}'."\n".'</form>'."\n");
$squelette->setElementTemplate( '<p class="formulaire_element">'."\n".'<label>'."\n".
'{label}'."\n".
'<!-- BEGIN required --><span class="symbole_obligatoire">&nbsp;*</span><!-- END required -->&nbsp;:'."\n".
'</label>'."\n".
'{element}'."\n".
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
'</p>'."\n");
$squelette->setRequiredNoteTemplate("\n".'<p class="symbole_obligatoire">*&nbsp;:&nbsp;{requiredNote}</p>'."\n");
//Traduction de champs requis
$this->setRequiredNote('champs obligatoire') ;
$this->setJsWarnings('Erreur de saisie', 'Veuillez verifier vos informations saisies');
$tableau=formulaire_valeurs_template_champs($template_champs_formulaire);
for ($i=0; $i<count($tableau); $i++) {
$tableau[$i]['type']($this, $tableau[$i]['nom_bdd'], $tableau[$i]['label'],
$tableau[$i]['limite1'],
$tableau[$i]['limite2'], $tableau[$i]['defaut'], $tableau[$i]['table_source'],
$tableau[$i]['obligatoire']) ;
}
}
 
 
/**
*
*
* @return string
* @access public
*/
function toHTML( )
{
$res = HTML_QuickForm::toHTML() ;
return $res ;
} // end of member function toHTML
}
 
?>
/tags/Racine_livraison_narmer/api/formulaire/formulaire.fonct.inc.php
New file
0,0 → 1,434
<?php
function formulaire_valeurs_template_champs($valeur_template) {
//Parcours du template, pour mettre les champs du formulaire avec leurs valeurs specifiques
$tableau= array();
$nblignes=0;
$chaine = explode ("\n", $valeur_template);
array_pop($chaine);
foreach ($chaine as $ligne) {
$souschaine = explode ("***", $ligne) ;
$tableau[$nblignes]['type'] = trim($souschaine[0]) ;
if (isset($souschaine[1])) {$tableau[$nblignes]['nom_bdd'] = trim($souschaine[1]);}
else {$tableau[$nblignes]['nom_bdd'] ='';}
if (isset($souschaine[2])) $tableau[$nblignes]['label'] = trim($souschaine[2]);
else {$tableau[$nblignes]['label'] ='';}
if (isset($souschaine[3])) $tableau[$nblignes]['limite1'] = trim($souschaine[3]);
else {$tableau[$nblignes]['limite1'] ='';}
if (isset($souschaine[4])) $tableau[$nblignes]['limite2'] = trim($souschaine[4]);
else {$tableau[$nblignes]['limite2'] ='';}
if (isset($souschaine[5])) $tableau[$nblignes]['defaut'] = trim($souschaine[5]);
else {$tableau[$nblignes]['defaut'] ='';}
if (isset($souschaine[6])) $tableau[$nblignes]['table_source'] = trim($souschaine[6]);
else {$tableau[$nblignes]['table_source'] ='';}
if (isset($souschaine[7])) $tableau[$nblignes]['id_source'] = trim($souschaine[7]);
else {$tableau[$nblignes]['id_source'] ='';}
if (isset($souschaine[8])) $tableau[$nblignes]['obligatoire'] = trim($souschaine[8]);
else {$tableau[$nblignes]['obligatoire'] ='';}
if (isset($souschaine[9])) $tableau[$nblignes]['recherche'] = trim($souschaine[9]);
else {$tableau[$nblignes]['recherche'] ='';}
 
// traitement des cases à cocher, dans ce cas la, on a une table de jointure entre la table
// de liste et la table bazar_fiche (elle porte un nom du genre bazar_ont_***)
// dans le template, à la place d'un nom de champs dans 'nom_bdd', on a un nom de table
// et 2 noms de champs séparés par un virgule ex : bazar_ont_theme,bot_id_theme,bot_id_fiche
if (isset($tableau[$nblignes]['nom_bdd']) && preg_match('/,/', $tableau[$nblignes]['nom_bdd'])) {
$tableau_info_jointe = explode (',', $tableau[$nblignes]['nom_bdd']) ;
$tableau[$nblignes]['table_jointe'] = $tableau_info_jointe[0] ;
$tableau[$nblignes]['champs_id_fiche'] = $tableau_info_jointe[1] ;
$tableau[$nblignes]['champs_id_table_jointe'] = $tableau_info_jointe[2] ;
}
$nblignes++;
}
return $tableau;
}
 
/** liste() - Ajoute un élément de type liste au formulaire
*
* @param mixed L'objet QuickForm du formulaire
* @param int identifiant de la liste sur bazar_liste
* @param string label à afficher dans le formulaire
* @param string première restriction de la taille des champs du formulaire
* @param string deuxième restriction de la taille des champs du formulaire
* @param string valeur par défaut du formulaire
* @param string table source pour les valeurs de la liste
* @param string ce champs est il obligatoire? (required)
* @param boolean sommes nous dans le moteur de recherche?
* @return void
*/
function liste(&$formtemplate, $id_liste , $label, $limite1, $limite2, $defaut, $source, $obligatoire, $dans_moteur_de_recherche=0) {
$requete = 'SELECT * FROM bazar_liste_valeurs WHERE blv_ce_liste='.$id_liste.' AND blv_ce_i18n="'.$GLOBALS['_BAZAR_']['langue'].'"';
$resultat = & $GLOBALS['_BAZAR_']['db'] -> query($requete) ;
if (DB::isError ($resultat)) {
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
}
if ($dans_moteur_de_recherche==0) {
$select[0]=BAZ_CHOISIR;
}
else {
$select[0]=BAZ_INDIFFERENT;
}
while ($ligne = $resultat->fetchRow()) {
$select[$ligne[1]] = $ligne[2] ;
}
$option=array('style'=>'width: '.$limite1.'px;');
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/select.php';
$select= new HTML_QuickForm_select('liste'.$id_liste, $label, $select, $option);
$select->setSize($limite2);
$select->setMultiple(0);
$select->setSelected($defaut);
$formtemplate->addElement($select) ;
if (($dans_moteur_de_recherche==0) && isset($obligatoire) && ($obligatoire==1)) {
$formtemplate->addRule('liste'.$id_liste, BAZ_CHOISIR_OBLIGATOIRE.' '.$label , 'nonzero', '', 'client') ;
$formtemplate->addRule('liste'.$id_liste, $label.' obligatoire', 'required', '', 'client') ;}
}
 
 
/** checkbox() - Ajoute un élément de type checkbox au formulaire
*
* @param mixed L'objet QuickForm du formulaire
* @param int identifiant de la liste sur bazar_liste
* @param string label à afficher dans le formulaire
* @param string première restriction de la taille des champs du formulaire
* @param string deuxième restriction de la taille des champs du formulaire
* @param string valeur par défaut du formulaire
* @param string table source pour les valeurs de la liste
* @param string ce champs est il obligatoire? (required)
* @return void
*/
function checkbox(&$formtemplate, $id_liste , $label, $limite1, $limite2, $defaut, $source, $obligatoire, $dans_moteur_de_recherche=0) {
$requete = 'SELECT * FROM bazar_liste_valeurs WHERE blv_ce_liste='.$id_liste.' AND blv_ce_i18n="'.$GLOBALS['_BAZAR_']['langue'].'" ORDER BY blv_label';
$resultat = & $GLOBALS['_BAZAR_']['db'] -> query($requete) ;
if (DB::isError ($resultat)) {
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
}
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/checkbox.php' ;
$i=0;
if (isset($defaut)) $tab=split(', ', $defaut);
while ($ligne = $resultat->fetchRow()) {
if ($i==0) $labelchkbox=$label ; else $labelchkbox='&nbsp;';
$checkbox[$i]= & HTML_Quickform::createElement('checkbox', $ligne[1], $labelchkbox, $ligne[2],
array ('style'=>'display:inline;margin:2px;')) ;
foreach ($tab as $val) {
if ($ligne[1]==$val) $checkbox[$i]->setChecked(1);
}
$i++;
}
$squelette_checkbox =& $formtemplate->defaultRenderer();
$squelette_checkbox->setElementTemplate( '<tr><td colspan="2" style="text-align:left;">'."\n".'<fieldset class="bazar_fieldset">'."\n".'<legend>{label}'.
'<!-- BEGIN required --><span class="symbole_obligatoire">&nbsp;*</span><!-- END required -->'."\n".
'</legend>'."\n".'{element}'."\n".'</fieldset> '."\n".'</td></tr>'."\n", 'checkbox'.$id_liste);
$squelette_checkbox->setGroupElementTemplate( "\n".'<div class="bazar_checkbox">'."\n".'{element}'."\n".'</div>'."\n", 'checkbox'.$id_liste);
 
$formtemplate->addGroup($checkbox, 'checkbox'.$id_liste, $label, "\n");
if (($dans_moteur_de_recherche==0) && isset($obligatoire) && ($obligatoire==1)) {
$formtemplate->addGroupRule('checkbox'.$id_liste, $label.' obligatoire', 'required', null, 1, 'client');
}
}
 
 
/** listedatedeb() - Ajoute un élément de type date sous forme de liste au formulaire pour designer une date de début
*
* @param mixed L'objet QuickForm du formulaire
* @param string nom de la table dans la base de donnée
* @param string label à afficher dans le formulaire
* @param string première restriction de la taille des champs du formulaire
* @param string deuxième restriction de la taille des champs du formulaire
* @param string valeur par défaut du formulaire
* @param string table source pour les valeurs de la date
* @param string ce champs est il obligatoire? (required)
* @return void
*/
function listedatedeb(&$formtemplate, $nom_bdd , $label, $limite1, $limite2, $defaut, $source, $obligatoire, $dans_moteur_de_recherche=0) {
$optiondate = array('language' => BAZ_LANGUE_PAR_DEFAUT,
'minYear' => date('Y'),
'maxYear'=> (date('Y')+10),
'format' => 'd m Y',
'addEmptyOption' => BAZ_DATE_VIDE,
);
$formtemplate->addElement('date', $nom_bdd, $label, $optiondate) ;
//gestion des valeurs par défaut (date du jour)
if (isset($defaut) && $defaut!='') $formtemplate->setDefaults(array($nom_bdd => $defaut));
else {
$defauts=array($nom_bdd => array ('d'=>date('d'), 'm'=>date('m'), 'Y'=>date('Y')));
$formtemplate->setDefaults($defauts);
}
//gestion du champs obligatoire
if (($dans_moteur_de_recherche==0) && isset($obligatoire) && ($obligatoire==1)) {
$formtemplate->addRule($nom_bdd, $label.' obligatoire', 'required', '', 'client') ;
}
}
 
/** listedatefin() - Ajoute un élément de type date sous forme de liste au formulaire pour designer une date de fin
*
* @param mixed L'objet QuickForm du formulaire
* @param string nom de la table dans la base de donnée
* @param string label à afficher dans le formulaire
* @param string première restriction de la taille des champs du formulaire
* @param string deuxième restriction de la taille des champs du formulaire
* @param string valeur par défaut du formulaire
* @param string table source pour les valeurs de la date
* @param string ce champs est il obligatoire? (required)
* @return void
*/
function listedatefin(&$formtemplate, $nom_bdd , $label, $limite1, $limite2, $defaut, $source, $obligatoire, $dans_moteur_de_recherche=0) {
listedatedeb($formtemplate, $nom_bdd , $label, $limite1, $limite2, $defaut, $source, $obligatoire, $dans_moteur_de_recherche);
}
 
 
/** texte() - Ajoute un élément de type texte au formulaire
*
* @param mixed L'objet QuickForm du formulaire
* @param string nom de la table dans la base de donnée
* @param string label à afficher dans le formulaire
* @param string première restriction de la taille des champs du formulaire
* @param string deuxième restriction de la taille des champs du formulaire
* @param string valeur par défaut du formulaire
* @param string table source pour les valeurs du texte (inutile)
* @param string ce champs est il obligatoire? (required)
* @return void
*/
function texte(&$formtemplate, $nom_bdd , $label, $limite1, $limite2, $defaut, $source, $obligatoire, $dans_moteur_de_recherche=0) {
$option=array('size'=>$limite1,'maxlength'=>$limite2);
$formtemplate->addElement('text', $nom_bdd, $label, $option) ;
//gestion des valeurs par défaut
$defauts=array($nom_bdd=>$defaut);
$formtemplate->setDefaults($defauts);
$formtemplate->applyFilter($nom_bdd, 'addslashes') ;
//gestion du champs obligatoire
if (($dans_moteur_de_recherche==0) && isset($obligatoire) && ($obligatoire==1)) {
$formtemplate->addRule($nom_bdd, $label.' obligatoire', 'required', '', 'client') ;
}
}
 
 
/** textelong() - Ajoute un élément de type textearea au formulaire
*
* @param mixed L'objet QuickForm du formulaire
* @param string nom de la table dans la base de donnée
* @param string label à afficher dans le formulaire
* @param string taille des colonnes de l'élément
* @param string taille des lignes de l'élément
* @param string valeur par défaut du formulaire
* @param string table source pour les valeurs du texte (inutile)
* @param string ce champs est il obligatoire? (required)
* @return void
*/
function textelong(&$formtemplate, $nom_bdd , $label, $limite1, $limite2, $defaut, $source, $obligatoire, $dans_moteur_de_recherche=0) {
$formtexte= new HTML_QuickForm_textarea($nom_bdd, $label, array('style'=>'white-space: normal;'));
$formtexte->setCols($limite1);
$formtexte->setRows($limite2);
$formtemplate->addElement($formtexte) ;
//gestion des valeurs par défaut
$defauts=array($nom_bdd=>$defaut);
$formtemplate->setDefaults($defauts);
$formtemplate->applyFilter($nom_bdd, 'addslashes') ;
//gestion du champs obligatoire
if (($dans_moteur_de_recherche==0) && isset($obligatoire) && ($obligatoire==1)) {
$formtemplate->addRule($nom_bdd, $label.' obligatoire', 'required', '', 'client') ;
}
}
 
/** url() - Ajoute un élément de type url internet au formulaire
*
* @param mixed L'objet QuickForm du formulaire
* @param string numero du champs input du formulaire (pour le différencier d'autres champs du meme type dans ce formulaire)
* @param string label à afficher dans le formulaire
* @param string taille des colonnes de l'élément
* @param string taille des lignes de l'élément
* @param string valeur par défaut du formulaire
* @param string table source pour les valeurs du texte (inutile)
* @param string ce champs est il obligatoire? (required)
* @return void
*/
function url(&$formtemplate, $nom_bdd , $label, $limite1, $limite2, $defaut, $source, $obligatoire, $dans_moteur_de_recherche=0) {
//recherche des URLs deja entrees dans la base
$html_url= '';
if (isset($GLOBALS['_BAZAR_']["id_fiche"])) {
$requete = 'SELECT bu_id_url, bu_url, bu_descriptif_url FROM bazar_url WHERE bu_ce_fiche='.$GLOBALS['_BAZAR_']["id_fiche"];
$resultat = & $GLOBALS['_BAZAR_']['db'] -> query($requete) ;
if (DB::isError ($resultat)) {
die ($GLOBALS['_BAZAR_']['db']->getMessage().$GLOBALS['_BAZAR_']['db']->getDebugInfo()) ;
}
if ($resultat->numRows()>0) {
$html_url= '<tr>'."\n".'<td colspan="2">'."\n".'<strong>'.BAZ_LISTE_URL.'</strong>'."\n";
$tableAttr = array("class" => "bazar_table") ;
$table = new HTML_Table($tableAttr) ;
$entete = array (BAZ_LIEN , BAZ_SUPPRIMER) ;
$table->addRow($entete) ;
$table->setRowType(0, "th") ;
 
$lien_supprimer=$GLOBALS['_BAZAR_']['url'];
$lien_supprimer->addQueryString('action', $_GET['action']);
$lien_supprimer->addQueryString('id_fiche', $GLOBALS['_BAZAR_']["id_fiche"]);
$lien_supprimer->addQueryString('typeannonce', $_REQUEST['typeannonce']);
 
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
$lien_supprimer->addQueryString('id_url', $ligne->bu_id_url);
$table->addRow (array(
'<a href="'.$ligne->bu_url.'" target="_blank"> '.$ligne->bu_descriptif_url.'</a>', // col 1 : le lien
'<a href="'.$lien_supprimer->getURL().'" onclick="javascript:return confirm(\''.BAZ_CONFIRMATION_SUPPRESSION_LIEN.'\');" >'.BAZ_SUPPRIMER.'</a>'."\n")) ; // col 2 : supprimer
$lien_supprimer->removeQueryString('id_url');
}
$table->altRowAttributes(1, array("class" => "ligne_impaire"), array("class" => "ligne_paire"));
$table->updateColAttributes(1, array("align" => "center"));
$html_url.= $table->toHTML()."\n".'</td>'."\n".'</tr>'."\n" ;
}
}
$html ='<tr>'."\n".'<td colspan="2">'."\n".'<h4>'.$label.'</h4>'."\n".'</td>'."\n".'</tr>'."\n";
$formtemplate->addElement('html', $html) ;
if ($html_url!='') $formtemplate->addElement('html', $html_url) ;
$formtemplate->addElement('text', 'url_lien'.$nom_bdd, BAZ_URL_LIEN) ;
$formtemplate->addElement('text', 'url_texte'.$nom_bdd, BAZ_URL_TEXTE) ;
//gestion du champs obligatoire
if (($dans_moteur_de_recherche==0) && isset($obligatoire) && ($obligatoire==1)) {
$formtemplate->addRule('url_lien'.$nom_bdd, BAZ_URL_LIEN_REQUIS, 'required', '', 'client') ;
$formtemplate->addRule('url_texte'.$nom_bdd, BAZ_URL_TEXTE_REQUIS, 'required', '', 'client') ;
}
}
 
/** fichier() - Ajoute un élément de type fichier au formulaire
*
* @param mixed L'objet QuickForm du formulaire
* @param string numero du champs input du formulaire (pour le différencier d'autres champs du meme type dans ce formulaire)
* @param string label à afficher dans le formulaire
* @param string taille des colonnes de l'élément
* @param string taille des lignes de l'élément
* @param string valeur par défaut du formulaire
* @param string table source pour les valeurs du texte (inutile)
* @param string ce champs est il obligatoire? (required)
* @return void
*/
function fichier(&$formtemplate, $nom_bdd , $label, $limite1, $limite2, $defaut, $source, $obligatoire, $dans_moteur_de_recherche=0) {
//AJOUTER DES FICHIERS JOINTS
$html_fichier= '';
if (isset($GLOBALS['_BAZAR_']["id_fiche"])) {
$requete = 'SELECT * FROM bazar_fichier_joint WHERE bfj_ce_fiche='.$GLOBALS['_BAZAR_']["id_fiche"];
$resultat = & $GLOBALS['_BAZAR_']['db'] -> query($requete) ;
if (DB::isError ($resultat)) {
die ($GLOBALS['_BAZAR_']['db']->getMessage().$GLOBALS['_BAZAR_']['db']->getDebugInfo()) ;
}
 
if ($resultat->numRows()>0) {
$html_fichier = '<tr>'."\n".'<td colspan="2">'."\n".'<strong>'.BAZ_LISTE_FICHIERS_JOINTS.'</strong>'."\n";
$tableAttr = array("class" => "bazar_table") ;
$table = new HTML_Table($tableAttr) ;
$entete = array (BAZ_FICHIER , BAZ_SUPPRIMER) ;
$table->addRow($entete) ;
$table->setRowType(0, "th") ;
 
$lien_supprimer=$GLOBALS['_BAZAR_']['url'];
$lien_supprimer->addQueryString('action', $_GET['action']);
$lien_supprimer->addQueryString('id_fiche', $GLOBALS['_BAZAR_']["id_fiche"]);
$lien_supprimer->addQueryString('typeannonce', $_REQUEST['typeannonce']);
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
$lien_supprimer->addQueryString('id_fichier', $ligne->bfj_id_fichier);
$table->addRow(array('<a href="client/bazar/upload/'.$ligne->bfj_fichier.'"> '.$ligne->bfj_description.'</a>', // col 1 : le fichier et sa description
'<a href="'.$lien_supprimer->getURL().'" onclick="javascript:return confirm(\''.BAZ_CONFIRMATION_SUPPRESSION_FICHIER.'\');" >'.BAZ_SUPPRIMER.'</a>'."\n")) ; // col 2 : supprimer
$lien_supprimer->removeQueryString('id_fichier');
}
$table->altRowAttributes(1, array("class" => "ligne_impaire"), array("class" => "ligne_paire"));
$table->updateColAttributes(1, array("align" => "center"));
$html_fichier .= $table->toHTML()."\n".'</td>'."\n".'</tr>'."\n" ;
}
}
$html ='<tr>'."\n".'<td colspan="2">'."\n".'<h4>'.$label.'</h4>'."\n".'</td>'."\n".'</tr>'."\n";
$formtemplate->addElement('html', $html) ;
if ($html_fichier!='') $formtemplate->addElement('html', $html_fichier) ;
$formtemplate->addElement('text', 'texte_fichier'.$nom_bdd, BAZ_FICHIER_DESCRIPTION) ;
$formtemplate->addElement('file', 'fichier'.$nom_bdd, BAZ_FICHIER_JOINT) ;
$formtemplate->addRule('image', BAZ_IMAGE_VALIDE_REQUIS, '', '', 'client') ; //a completer pour checker l'image
$formtemplate->setMaxFileSize($limite1);
//gestion du champs obligatoire
if (($dans_moteur_de_recherche==0) && isset($obligatoire) && ($obligatoire==1)) {
$formtemplate->addRule('texte_fichier'.$nom_bdd, BAZ_FICHIER_LABEL_REQUIS, 'required', '', 'client') ;
$formtemplate->addRule('fichier'.$nom_bdd, BAZ_FICHIER_JOINT_REQUIS, 'required', '', 'client') ;
}
}
 
/** image() - Ajoute un élément de type image au formulaire
*
* @param mixed L'objet QuickForm du formulaire
* @param string numero du champs input du formulaire (pour le différencier d'autres champs du meme type dans ce formulaire)
* @param string label à afficher dans le formulaire
* @param string taille maximum du fichier colonnes de l'élément
* @param string taille des lignes de l'élément
* @param string valeur par défaut du formulaire
* @param string table source pour les valeurs du texte (inutile)
* @param string ce champs est il obligatoire? (required)
* @return void
*/
function image(&$formtemplate, $nom_bdd , $label, $limite1, $limite2, $defaut, $source, $obligatoire, $dans_moteur_de_recherche=0) {
//AJOUTER UNE IMAGE
$html_image= '';
if (isset($GLOBALS['_BAZAR_']["id_fiche"])) {
$requete = 'SELECT bf_url_image FROM bazar_fiche WHERE bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
$resultat = & $GLOBALS['_BAZAR_']['db'] -> query($requete) ;
if (DB::isError ($resultat)) {
die ($GLOBALS['_BAZAR_']['db']->getMessage().$GLOBALS['_BAZAR_']['db']->getDebugInfo()) ;
}
 
if ($resultat->numRows()>0) {
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
$image=$ligne->bf_url_image;
}
if ($image!=NULL) {
$lien_supprimer=$GLOBALS['_BAZAR_']['url'];
$lien_supprimer->addQueryString('action', $_GET['action']);
$lien_supprimer->addQueryString('id_fiche', $GLOBALS['_BAZAR_']["id_fiche"]);
$lien_supprimer->addQueryString('typeannonce', $_REQUEST['typeannonce']);
$lien_supprimer->addQueryString('image', 1);
$html_image = '<tr>'."\n".
'<td>'."\n".'<img src="client/bazar/upload/'.$image.'" alt="'.BAZ_TEXTE_IMG_ALTERNATIF.'" width="130" height="130" />'."\n".'</td>'."\n".
'<td>'."\n".'<a href="'.$lien_supprimer->getURL().'" onclick="javascript:return confirm(\''.BAZ_CONFIRMATION_SUPPRESSION_IMAGE.'\');" >'.BAZ_SUPPRIMER.'</a><br /><br />'."\n".
'<strong>'.BAZ_POUR_CHANGER_IMAGE.'</strong><br />'."\n".'</td>'."\n".'</tr>'."\n";
}
}
}
$html ='<tr>'."\n".'<td colspan="2">'."\n".'<h4>'.$label.'</h4>'."\n".'</td>'."\n".'</tr>'."\n";
$formtemplate->addElement('html', $html) ;
if ($html_image!='') $formtemplate->addElement('html', $html_image) ;
$formtemplate->addElement('file', 'image', BAZ_IMAGE) ;
//TODO: controler si c'est une image
$formtemplate->setMaxFileSize($limite1);
//gestion du champs obligatoire
if (($dans_moteur_de_recherche==0) && isset($obligatoire) && ($obligatoire==1)) {
$formtemplate->addRule('image', BAZ_IMAGE_VALIDE_REQUIS, 'required', '', 'client') ;
}
}
 
/** wikini() - Ajoute un wikini au formulaire
*
* @param mixed L'objet QuickForm du formulaire
* @param string numero du champs input du formulaire (pour le différencier d'autres champs du meme type dans ce formulaire)
* @param string label à afficher dans le formulaire
* @param string taille maximum du fichier colonnes de l'élément
* @param string taille des lignes de l'élément
* @param string valeur par défaut du formulaire
* @param string table source pour les valeurs du texte (inutile)
* @param string ce champs est il obligatoire? (required)
* @return void
*/
function wikini(&$formtemplate, $nom_bdd , $label, $limite1, $limite2, $defaut, $source, $obligatoire, $dans_moteur_de_recherche=0) {
return;
}
 
/** labelhtml() - Ajoute un élément de type textearea au formulaire
*
* @param mixed L'objet QuickForm du formulaire
* @param string nom de la table dans la base de donnée (pas utilisé)
* @param string label à afficher dans le formulaire
* @param string taille des colonnes de l'élément (pas utilisé)
* @param string taille des lignes de l'élément (pas utilisé)
* @param string valeur par défaut du formulaire (pas utilisé)
* @param string table source pour les valeurs du texte (pas utilisé)
* @param string ce champs est il obligatoire? (required) (pas utilisé)
* @return void
*/
function labelhtml(&$formtemplate, $nom_bdd , $label, $limite1, $limite2, $defaut, $source, $obligatoire, $dans_moteur_de_recherche=0) {
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/html.php';
$formhtml= new HTML_QuickForm_html('<p class="formulaire_element">'.$label.'</p>'."\n");
$formtemplate->addElement($formhtml) ;
}
 
 
?>
/tags/Racine_livraison_narmer/api/pear/HTML/Template/IT.php
New file
0,0 → 1,990
<?php
//
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2005 Ulf Wendel, Pierre-Alain Joye |
// +----------------------------------------------------------------------+
// | This source file is subject to the New BSD license, That is bundled |
// | with this package in the file LICENSE, and is available through |
// | the world-wide-web at |
// | http://www.opensource.org/licenses/bsd-license.php |
// | If you did not receive a copy of the new BSDlicense and are unable |
// | to obtain it through the world-wide-web, please send a note to |
// | pajoye@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Ulf Wendel <ulf.wendel@phpdoc.de> |
// | Pierre-Alain Joye <pajoye@php.net> |
// +----------------------------------------------------------------------+
//
// $Id$
//
 
require_once 'PEAR.php';
 
define('IT_OK', 1);
define('IT_ERROR', -1);
define('IT_TPL_NOT_FOUND', -2);
define('IT_BLOCK_NOT_FOUND', -3);
define('IT_BLOCK_DUPLICATE', -4);
define('IT_UNKNOWN_OPTION', -6);
/**
* Integrated Template - IT
*
* Well there's not much to say about it. I needed a template class that
* supports a single template file with multiple (nested) blocks inside and
* a simple block API.
*
* The Isotemplate API is somewhat tricky for a beginner although it is the best
* one you can build. template::parse() [phplib template = Isotemplate] requests
* you to name a source and a target where the current block gets parsed into.
* Source and target can be block names or even handler names. This API gives you
* a maximum of fexibility but you always have to know what you do which is
* quite unusual for php skripter like me.
*
* I noticed that I do not any control on which block gets parsed into which one.
* If all blocks are within one file, the script knows how they are nested and in
* which way you have to parse them. IT knows that inner1 is a child of block2, there's
* no need to tell him about this.
*
* <table border>
* <tr>
* <td colspan=2>
* __global__
* <p>
* (hidden and automatically added)
* </td>
* </tr>
* <tr>
* <td>block1</td>
* <td>
* <table border>
* <tr>
* <td colspan=2>block2</td>
* </tr>
* <tr>
* <td>inner1</td>
* <td>inner2</td>
* </tr>
* </table>
* </td>
* </tr>
* </table>
*
* To add content to block1 you simply type:
* <code>$tpl->setCurrentBlock("block1");</code>
* and repeat this as often as needed:
* <code>
* $tpl->setVariable(...);
* $tpl->parseCurrentBlock();
* </code>
*
* To add content to block2 you would type something like:
* <code>
* $tpl->setCurrentBlock("inner1");
* $tpl->setVariable(...);
* $tpl->parseCurrentBlock();
*
* $tpl->setVariable(...);
* $tpl->parseCurrentBlock();
*
* $tpl->parse("block1");
* </code>
*
* This will result in one repition of block1 which contains two repitions
* of inner1. inner2 will be removed if $removeEmptyBlock is set to true which is the default.
*
* Usage:
* <code>
* $tpl = new HTML_Template_IT( [string filerootdir] );
*
* // load a template or set it with setTemplate()
* $tpl->loadTemplatefile( string filename [, boolean removeUnknownVariables, boolean removeEmptyBlocks] )
*
* // set "global" Variables meaning variables not beeing within a (inner) block
* $tpl->setVariable( string variablename, mixed value );
*
* // like with the Isotemplates there's a second way to use setVariable()
* $tpl->setVariable( array ( string varname => mixed value ) );
*
* // Let's use any block, even a deeply nested one
* $tpl->setCurrentBlock( string blockname );
*
* // repeat this as often as you need it.
* $tpl->setVariable( array ( string varname => mixed value ) );
* $tpl->parseCurrentBlock();
*
* // get the parsed template or print it: $tpl->show()
* $tpl->get();
* </code>
*
* @author Ulf Wendel <uw@netuse.de>
* @version $Id$
* @access public
* @package HTML_Template_IT
*/
class HTML_Template_IT
{
/**
* Contains the error objects
* @var array
* @access public
* @see halt(), $printError, $haltOnError
*/
var $err = array();
 
/**
* Clear cache on get()?
* @var boolean
*/
var $clearCache = false;
 
/**
* First character of a variable placeholder ( _{_VARIABLE} ).
* @var string
* @access public
* @see $closingDelimiter, $blocknameRegExp, $variablenameRegExp
*/
var $openingDelimiter = '{';
 
/**
* Last character of a variable placeholder ( {VARIABLE_}_ ).
* @var string
* @access public
* @see $openingDelimiter, $blocknameRegExp, $variablenameRegExp
*/
var $closingDelimiter = '}';
 
/**
* RegExp matching a block in the template.
* Per default "sm" is used as the regexp modifier, "i" is missing.
* That means a case sensitive search is done.
* @var string
* @access public
* @see $variablenameRegExp, $openingDelimiter, $closingDelimiter
*/
var $blocknameRegExp = '[0-9A-Za-z_-]+';
 
/**
* RegExp matching a variable placeholder in the template.
* Per default "sm" is used as the regexp modifier, "i" is missing.
* That means a case sensitive search is done.
* @var string
* @access public
* @see $blocknameRegExp, $openingDelimiter, $closingDelimiter
*/
var $variablenameRegExp = '[0-9A-Za-z_-]+';
 
/**
* RegExp used to find variable placeholder, filled by the constructor.
* @var string Looks somewhat like @(delimiter varname delimiter)@
* @access public
* @see IntegratedTemplate()
*/
var $variablesRegExp = '';
 
/**
* RegExp used to strip unused variable placeholder.
* @brother $variablesRegExp
*/
var $removeVariablesRegExp = '';
 
/**
* Controls the handling of unknown variables, default is remove.
* @var boolean
* @access public
*/
var $removeUnknownVariables = true;
 
/**
* Controls the handling of empty blocks, default is remove.
* @var boolean
* @access public
*/
var $removeEmptyBlocks = true;
 
/**
* RegExp used to find blocks an their content, filled by the constructor.
* @var string
* @see IntegratedTemplate()
*/
var $blockRegExp = '';
 
/**
* Name of the current block.
* @var string
*/
var $currentBlock = '__global__';
 
/**
* Content of the template.
* @var string
*/
var $template = '';
 
/**
* Array of all blocks and their content.
*
* @var array
* @see findBlocks()
*/
var $blocklist = array();
 
/**
* Array with the parsed content of a block.
*
* @var array
*/
var $blockdata = array();
 
/**
* Array of variables in a block.
* @var array
*/
var $blockvariables = array();
 
/**
* Array of inner blocks of a block.
* @var array
*/
var $blockinner = array();
 
/**
* List of blocks to preverse even if they are "empty".
*
* This is something special. Sometimes you have blocks that
* should be preserved although they are empty (no placeholder replaced).
* Think of a shopping basket. If it's empty you have to drop a message to
* the user. If it's filled you have to show the contents of
* the shopping baseket. Now where do you place the message that the basket
* is empty? It's no good idea to place it in you applications as customers
* tend to like unecessary minor text changes. Having another template file
* for an empty basket means that it's very likely that one fine day
* the filled and empty basket templates have different layout. I decided
* to introduce blocks that to not contain any placeholder but only
* text such as the message "Your shopping basked is empty".
*
* Now if there is no replacement done in such a block the block will
* be recognized as "empty" and by default ($removeEmptyBlocks = true) be
* stripped off. To avoid thisyou can now call touchBlock() to avoid this.
*
* The array $touchedBlocks stores a list of touched block which must not
* be removed even if they are empty.
*
* @var array $touchedBlocks
* @see touchBlock(), $removeEmptyBlocks
*/
var $touchedBlocks = array();
 
/**
* List of blocks which should not be shown even if not "empty"
* @var array $_hiddenBlocks
* @see hideBlock(), $removeEmptyBlocks
*/
var $_hiddenBlocks = array();
 
/**
* Variable cache.
*
* Variables get cached before any replacement is done.
* Advantage: empty blocks can be removed automatically.
* Disadvantage: might take some more memory
*
* @var array
* @see setVariable(), $clearCacheOnParse
*/
var $variableCache = array();
 
/**
* Clear the variable cache on parse?
*
* If you're not an expert just leave the default false.
* True reduces memory consumption somewhat if you tend to
* add lots of values for unknown placeholder.
*
* @var boolean
*/
var $clearCacheOnParse = false;
 
/**
* Root directory for all file operations.
* The string gets prefixed to all filenames given.
* @var string
* @see HTML_Template_IT(), setRoot()
*/
var $fileRoot = '';
 
/**
* Internal flag indicating that a blockname was used multiple times.
* @var boolean
*/
var $flagBlocktrouble = false;
 
/**
* Flag indicating that the global block was parsed.
* @var boolean
*/
var $flagGlobalParsed = false;
 
/**
* EXPERIMENTAL! FIXME!
* Flag indication that a template gets cached.
*
* Complex templates require some times to be preparsed
* before the replacement can take place. Often I use
* one template file over and over again but I don't know
* before that I will use the same template file again.
* Now IT could notice this and skip the preparse.
*
* @var boolean
*/
var $flagCacheTemplatefile = true;
 
/**
* EXPERIMENTAL! FIXME!
*/
var $lastTemplatefile = '';
 
/**
* $_options['preserve_data'] Whether to substitute variables and remove
* empty placeholders in data passed through setVariable
* (see also bugs #20199, #21951).
* $_options['use_preg'] Whether to use preg_replace instead of
* str_replace in parse()
* (this is a backwards compatibility feature, see also bugs #21951, #20392)
*/
var $_options = array(
'preserve_data' => false,
'use_preg' => true
);
 
/**
* Builds some complex regular expressions and optinally sets the
* file root directory.
*
* Make sure that you call this constructor if you derive your template
* class from this one.
*
* @param string File root directory, prefix for all filenames
* given to the object.
* @see setRoot()
*/
function HTML_Template_IT($root = '', $options = null)
{
if (!is_null($options)) {
$this->setOptions($options);
}
$this->variablesRegExp = '@' . $this->openingDelimiter .
'(' . $this->variablenameRegExp . ')' .
$this->closingDelimiter . '@sm';
$this->removeVariablesRegExp = '@' . $this->openingDelimiter .
"\s*(" . $this->variablenameRegExp .
")\s*" . $this->closingDelimiter .'@sm';
 
$this->blockRegExp = '@<!--\s+BEGIN\s+(' . $this->blocknameRegExp .
')\s+-->(.*)<!--\s+END\s+\1\s+-->@sm';
 
$this->setRoot($root);
} // end constructor
 
 
/**
* Sets the option for the template class
*
* @access public
* @param string option name
* @param mixed option value
* @return mixed IT_OK on success, error object on failure
*/
function setOption($option, $value)
{
if (array_key_exists($option, $this->_options)) {
$this->_options[$option] = $value;
return IT_OK;
}
 
return PEAR::raiseError(
$this->errorMessage(IT_UNKNOWN_OPTION) . ": '{$option}'",
IT_UNKNOWN_OPTION
);
}
 
/**
* Sets the options for the template class
*
* @access public
* @param string options array of options
* default value:
* 'preserve_data' => false,
* 'use_preg' => true
* @param mixed option value
* @return mixed IT_OK on success, error object on failure
* @see $options
*/
function setOptions($options)
{
if (is_array($options)) {
foreach ($options as $option => $value) {
$error = $this->setOption($option, $value);
if (PEAR::isError($error)) {
return $error;
}
}
}
 
return IT_OK;
}
 
/**
* Print a certain block with all replacements done.
* @brother get()
*/
function show($block = '__global__')
{
print $this->get($block);
} // end func show
 
/**
* Returns a block with all replacements done.
*
* @param string name of the block
* @return string
* @throws PEAR_Error
* @access public
* @see show()
*/
function get($block = '__global__')
{
if ($block == '__global__' && !$this->flagGlobalParsed) {
$this->parse('__global__');
}
 
if (!isset($this->blocklist[$block])) {
$this->err[] = PEAR::raiseError(
$this->errorMessage(IT_BLOCK_NOT_FOUND) .
'"' . $block . "'",
IT_BLOCK_NOT_FOUND
);
return '';
}
 
if (isset($this->blockdata[$block])) {
$ret = $this->blockdata[$block];
if ($this->clearCache) {
unset($this->blockdata[$block]);
}
if ($this->_options['preserve_data']) {
$ret = str_replace(
$this->openingDelimiter .
'%preserved%' . $this->closingDelimiter,
$this->openingDelimiter,
$ret
);
}
return $ret;
}
 
return '';
} // end func get()
 
/**
* Parses the given block.
*
* @param string name of the block to be parsed
* @access public
* @see parseCurrentBlock()
* @throws PEAR_Error
*/
function parse($block = '__global__', $flag_recursion = false)
{
static $regs, $values;
 
if (!isset($this->blocklist[$block])) {
return PEAR::raiseError(
$this->errorMessage( IT_BLOCK_NOT_FOUND ) . '"' . $block . "'",
IT_BLOCK_NOT_FOUND
);
}
 
if ($block == '__global__') {
$this->flagGlobalParsed = true;
}
 
if (!$flag_recursion) {
$regs = array();
$values = array();
}
$outer = $this->blocklist[$block];
$empty = true;
 
if ($this->clearCacheOnParse) {
foreach ($this->variableCache as $name => $value) {
$regs[] = $this->openingDelimiter .
$name . $this->closingDelimiter;
$values[] = $value;
$empty = false;
}
$this->variableCache = array();
} else {
foreach ($this->blockvariables[$block] as $allowedvar => $v) {
 
if (isset($this->variableCache[$allowedvar])) {
$regs[] = $this->openingDelimiter .
$allowedvar . $this->closingDelimiter;
$values[] = $this->variableCache[$allowedvar];
unset($this->variableCache[$allowedvar]);
$empty = false;
}
}
}
 
if (isset($this->blockinner[$block])) {
foreach ($this->blockinner[$block] as $k => $innerblock) {
 
$this->parse($innerblock, true);
if ($this->blockdata[$innerblock] != '') {
$empty = false;
}
 
$placeholder = $this->openingDelimiter . "__" .
$innerblock . "__" . $this->closingDelimiter;
$outer = str_replace(
$placeholder,
$this->blockdata[$innerblock], $outer
);
$this->blockdata[$innerblock] = "";
}
 
}
 
if (!$flag_recursion && 0 != count($values)) {
if ($this->_options['use_preg']) {
$regs = array_map(array(
&$this, '_addPregDelimiters'),
$regs
);
$funcReplace = 'preg_replace';
} else {
$funcReplace = 'str_replace';
}
 
if ($this->_options['preserve_data']) {
$values = array_map(
array(&$this, '_preserveOpeningDelimiter'), $values
);
}
 
$outer = $funcReplace($regs, $values, $outer);
 
if ($this->removeUnknownVariables) {
$outer = preg_replace($this->removeVariablesRegExp, "", $outer);
}
}
 
if ($empty) {
if (!$this->removeEmptyBlocks) {
$this->blockdata[$block ].= $outer;
} else {
if (isset($this->touchedBlocks[$block])) {
$this->blockdata[$block] .= $outer;
unset($this->touchedBlocks[$block]);
}
}
} else {
$this->blockdata[$block] .= $outer;
}
 
return $empty;
} // end func parse
 
/**
* Parses the current block
* @see parse(), setCurrentBlock(), $currentBlock
* @access public
*/
function parseCurrentBlock()
{
return $this->parse($this->currentBlock);
} // end func parseCurrentBlock
 
/**
* Sets a variable value.
*
* The function can be used eighter like setVariable( "varname", "value")
* or with one array $variables["varname"] = "value"
* given setVariable($variables) quite like phplib templates set_var().
*
* @param mixed string with the variable name or an array
* %variables["varname"] = "value"
* @param string value of the variable or empty if $variable
* is an array.
* @param string prefix for variable names
* @access public
*/
function setVariable($variable, $value = '')
{
if (is_array($variable)) {
$this->variableCache = array_merge(
$this->variableCache, $variable
);
} else {
$this->variableCache[$variable] = $value;
}
} // end func setVariable
 
/**
* Sets the name of the current block that is the block where variables
* are added.
*
* @param string name of the block
* @return boolean false on failure, otherwise true
* @throws PEAR_Error
* @access public
*/
function setCurrentBlock($block = '__global__')
{
 
if (!isset($this->blocklist[$block])) {
return PEAR::raiseError(
$this->errorMessage( IT_BLOCK_NOT_FOUND ) .
'"' . $block . "'", IT_BLOCK_NOT_FOUND
);
}
 
$this->currentBlock = $block;
 
return true;
} // end func setCurrentBlock
 
/**
* Preserves an empty block even if removeEmptyBlocks is true.
*
* @param string name of the block
* @return boolean false on false, otherwise true
* @throws PEAR_Error
* @access public
* @see $removeEmptyBlocks
*/
function touchBlock($block)
{
if (!isset($this->blocklist[$block])) {
return PEAR::raiseError(
$this->errorMessage(IT_BLOCK_NOT_FOUND) .
'"' . $block . "'", IT_BLOCK_NOT_FOUND);
}
 
$this->touchedBlocks[$block] = true;
 
return true;
} // end func touchBlock
 
/**
* Clears all datafields of the object and rebuild the internal blocklist
*
* LoadTemplatefile() and setTemplate() automatically call this function
* when a new template is given. Don't use this function
* unless you know what you're doing.
*
* @access public
* @see free()
*/
function init()
{
$this->free();
$this->findBlocks($this->template);
// we don't need it any more
$this->template = '';
$this->buildBlockvariablelist();
} // end func init
 
/**
* Clears all datafields of the object.
*
* Don't use this function unless you know what you're doing.
*
* @access public
* @see init()
*/
function free()
{
$this->err = array();
 
$this->currentBlock = '__global__';
 
$this->variableCache = array();
$this->blocklookup = array();
$this->touchedBlocks = array();
 
$this->flagBlocktrouble = false;
$this->flagGlobalParsed = false;
} // end func free
 
/**
* Sets the template.
*
* You can eighter load a template file from disk with
* LoadTemplatefile() or set the template manually using this function.
*
* @param string template content
* @param boolean remove unknown/unused variables?
* @param boolean remove empty blocks?
* @see LoadTemplatefile(), $template
* @access public
*/
function setTemplate( $template, $removeUnknownVariables = true,
$removeEmptyBlocks = true)
{
$this->removeUnknownVariables = $removeUnknownVariables;
$this->removeEmptyBlocks = $removeEmptyBlocks;
 
if ($template == '' && $this->flagCacheTemplatefile) {
$this->variableCache = array();
$this->blockdata = array();
$this->touchedBlocks = array();
$this->currentBlock = '__global__';
} else {
$this->template = '<!-- BEGIN __global__ -->' . $template .
'<!-- END __global__ -->';
$this->init();
}
 
if ($this->flagBlocktrouble) {
return false;
}
 
return true;
} // end func setTemplate
 
/**
* Reads a template file from the disk.
*
* @param string name of the template file
* @param bool how to handle unknown variables.
* @param bool how to handle empty blocks.
* @access public
* @return boolean false on failure, otherwise true
* @see $template, setTemplate(), $removeUnknownVariables,
* $removeEmptyBlocks
*/
function loadTemplatefile( $filename,
$removeUnknownVariables = true,
$removeEmptyBlocks = true )
{
$template = '';
if (!$this->flagCacheTemplatefile ||
$this->lastTemplatefile != $filename
) {
$template = $this->getFile($filename);
}
$this->lastTemplatefile = $filename;
 
return $template != '' ?
$this->setTemplate(
$template,$removeUnknownVariables, $removeEmptyBlocks
) : false;
} // end func LoadTemplatefile
 
/**
* Sets the file root. The file root gets prefixed to all filenames passed
* to the object.
*
* Make sure that you override this function when using the class
* on windows.
*
* @param string
* @see IntegratedTemplate()
* @access public
*/
function setRoot($root)
{
if ($root != '' && substr($root, -1) != '/') {
$root .= '/';
}
 
$this->fileRoot = $root;
} // end func setRoot
 
/**
* Build a list of all variables within of a block
*/
function buildBlockvariablelist()
{
foreach ($this->blocklist as $name => $content) {
preg_match_all($this->variablesRegExp, $content, $regs);
 
if (count($regs[1]) != 0) {
foreach ($regs[1] as $k => $var) {
$this->blockvariables[$name][$var] = true;
}
} else {
$this->blockvariables[$name] = array();
}
}
} // end func buildBlockvariablelist
 
/**
* Returns a list of all global variables
*/
function getGlobalvariables()
{
$regs = array();
$values = array();
 
foreach ($this->blockvariables['__global__'] as $allowedvar => $v) {
if (isset($this->variableCache[$allowedvar])) {
$regs[] = '@' . $this->openingDelimiter .
$allowedvar . $this->closingDelimiter . '@';
$values[] = $this->variableCache[$allowedvar];
unset($this->variableCache[$allowedvar]);
}
}
 
return array($regs, $values);
} // end func getGlobalvariables
 
/**
* Recusively builds a list of all blocks within the template.
*
* @param string string that gets scanned
* @see $blocklist
*/
function findBlocks($string)
{
$blocklist = array();
 
if (preg_match_all($this->blockRegExp, $string, $regs, PREG_SET_ORDER)) {
foreach ($regs as $k => $match) {
$blockname = $match[1];
$blockcontent = $match[2];
 
if (isset($this->blocklist[$blockname])) {
$this->err[] = PEAR::raiseError(
$this->errorMessage(
IT_BLOCK_DUPLICATE, $blockname),
IT_BLOCK_DUPLICATE
);
$this->flagBlocktrouble = true;
}
 
$this->blocklist[$blockname] = $blockcontent;
$this->blockdata[$blockname] = "";
 
$blocklist[] = $blockname;
 
$inner = $this->findBlocks($blockcontent);
foreach ($inner as $k => $name) {
$pattern = sprintf(
'@<!--\s+BEGIN\s+%s\s+-->(.*)<!--\s+END\s+%s\s+-->@sm',
$name,
$name
);
 
$this->blocklist[$blockname] = preg_replace(
$pattern,
$this->openingDelimiter .
'__' . $name . '__' .
$this->closingDelimiter,
$this->blocklist[$blockname]
);
$this->blockinner[$blockname][] = $name;
$this->blockparents[$name] = $blockname;
}
}
}
 
return $blocklist;
} // end func findBlocks
 
/**
* Reads a file from disk and returns its content.
* @param string Filename
* @return string Filecontent
*/
function getFile($filename)
{
if ($filename{0} == '/' && substr($this->fileRoot, -1) == '/') {
$filename = substr($filename, 1);
}
 
$filename = $this->fileRoot . $filename;
 
if (!($fh = @fopen($filename, 'r'))) {
$this->err[] = PEAR::raiseError(
$this->errorMessage(IT_TPL_NOT_FOUND) .
': "' .$filename .'"',
IT_TPL_NOT_FOUND
);
return "";
}
 
$content = fread($fh, filesize($filename));
fclose($fh);
 
return preg_replace(
"#<!-- INCLUDE (.*) -->#ime", "\$this->getFile('\\1')", $content
);
} // end func getFile
 
/**
* Adds delimiters to a string, so it can be used as a pattern
* in preg_* functions
*
* @param string
* @return string
*/
function _addPregDelimiters($str)
{
return '@' . $str . '@';
}
 
/**
* Replaces an opening delimiter by a special string
*
* @param string
* @return string
*/
function _preserveOpeningDelimiter($str)
{
return (false === strpos($str, $this->openingDelimiter))?
$str:
str_replace(
$this->openingDelimiter,
$this->openingDelimiter .
'%preserved%' . $this->closingDelimiter,
$str
);
}
 
/**
* Return a textual error message for a IT error code
*
* @param integer $value error code
*
* @return string error message, or false if the error code was
* not recognized
*/
function errorMessage($value, $blockname = '')
{
static $errorMessages;
if (!isset($errorMessages)) {
$errorMessages = array(
IT_OK => '',
IT_ERROR => 'unknown error',
IT_TPL_NOT_FOUND => 'Cannot read the template file',
IT_BLOCK_NOT_FOUND => 'Cannot find this block',
IT_BLOCK_DUPLICATE => 'The name of a block must be'.
' uniquewithin a template.'.
' Found "' . $blockname . '" twice.'.
'Unpredictable results '.
'may appear.',
IT_UNKNOWN_OPTION => 'Unknown option'
);
}
 
if (PEAR::isError($value)) {
$value = $value->getCode();
}
 
return isset($errorMessages[$value]) ?
$errorMessages[$value] : $errorMessages[IT_ERROR];
}
} // end class IntegratedTemplate
?>
/tags/Racine_livraison_narmer/api/pear/HTML/Template/ITX.php
New file
0,0 → 1,809
<?php
//
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2005 Ulf Wendel, Pierre-Alain Joye |
// +----------------------------------------------------------------------+
// | This source file is subject to the New BSD license, That is bundled |
// | with this package in the file LICENSE, and is available through |
// | the world-wide-web at |
// | http://www.opensource.org/licenses/bsd-license.php |
// | If you did not receive a copy of the new BSD license and are unable |
// | to obtain it through the world-wide-web, please send a note to |
// | pajoye@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Ulf Wendel <ulf.wendel@phpdoc.de> |
// | Pierre-Alain Joye <pajoye@php.net> |
// +----------------------------------------------------------------------+
//
// $Id$
//
 
require_once 'HTML/Template/IT.php';
require_once 'HTML/Template/IT_Error.php';
 
/**
* Integrated Template Extension - ITX
*
* With this class you get the full power of the phplib template class.
* You may have one file with blocks in it but you have as well one main file
* and multiple files one for each block. This is quite usefull when you have
* user configurable websites. Using blocks not in the main template allows
* you to modify some parts of your layout easily.
*
* Note that you can replace an existing block and add new blocks at runtime.
* Adding new blocks means changing a variable placeholder to a block.
*
* @author Ulf Wendel <uw@netuse.de>
* @access public
* @version $Id$
* @package IT[X]
*/
class HTML_Template_ITX extends HTML_Template_IT
{
/**
* Array with all warnings.
* @var array
* @access public
* @see $printWarning, $haltOnWarning, warning()
*/
var $warn = array();
 
/**
* Print warnings?
* @var array
* @access public
* @see $haltOnWarning, $warn, warning()
*/
var $printWarning = false;
 
/**
* Call die() on warning?
* @var boolean
* @access public
* @see $warn, $printWarning, warning()
*/
var $haltOnWarning = false;
 
/**
* RegExp used to test for a valid blockname.
* @var string
*/
var $checkblocknameRegExp = '';
 
/**
* Functionnameprefix used when searching function calls in the template.
* @var string
*/
var $functionPrefix = 'func_';
 
/**
* Functionname RegExp.
* @var string
*/
var $functionnameRegExp = '[_a-zA-Z]+[A-Za-z_0-9]*';
 
/**
* RegExp used to grep function calls in the template.
*
* The variable gets set by the constructor.
*
* @var string
* @see HTML_Template_IT()
*/
var $functionRegExp = '';
 
/**
* List of functions found in the template.
*
* @var array
*/
var $functions = array();
 
/**
* List of callback functions specified by the user.
*
* @var array
*/
var $callback = array();
 
/**
* Builds some complex regexps and calls the constructor
* of the parent class.
*
* Make sure that you call this constructor if you derive your own
* template class from this one.
*
* @see HTML_Template_IT()
*/
function HTML_Template_ITX($root = '')
{
 
$this->checkblocknameRegExp = '@' . $this->blocknameRegExp . '@';
$this->functionRegExp = '@' . $this->functionPrefix . '(' .
$this->functionnameRegExp . ')\s*\(@sm';
 
$this->HTML_Template_IT($root);
} // end func constructor
 
function init()
{
$this->free();
$this->buildFunctionlist();
$this->findBlocks($this->template);
// we don't need it any more
$this->template = '';
$this->buildBlockvariablelist();
 
} // end func init
 
/**
* Replaces an existing block with new content.
*
* This function will replace a block of the template and all blocks
* contained in the replaced block and add a new block insted, means
* you can dynamically change your template.
*
* Note that changing the template structure violates one of the IT[X]
* development goals. I've tried to write a simple to use template engine
* supporting blocks. In contrast to other systems IT[X] analyses the way
* you've nested blocks and knows which block belongs into another block.
* The nesting information helps to make the API short and simple. Replacing
* blocks does not only mean that IT[X] has to update the nesting
* information (relatively time consumpting task) but you have to make sure
* that you do not get confused due to the template change itself.
*
* @param string Blockname
* @param string Blockcontent
* @param boolean true if the new block inherits the content
* of the old block
* @return boolean
* @throws IT_Error
* @see replaceBlockfile(), addBlock(), addBlockfile()
* @access public
*/
function replaceBlock($block, $template, $keep_content = false)
{
if (!isset($this->blocklist[$block])) {
return new IT_Error(
"The block "."'$block'".
" does not exist in the template and thus it can't be replaced.",
__FILE__, __LINE__
);
}
 
if ($template == '') {
return new IT_Error('No block content given.', __FILE__, __LINE__);
}
 
if ($keep_content) {
$blockdata = $this->blockdata[$block];
}
 
// remove all kinds of links to the block / data of the block
$this->removeBlockData($block);
 
$template = "<!-- BEGIN $block -->" . $template . "<!-- END $block -->";
$parents = $this->blockparents[$block];
$this->findBlocks($template);
$this->blockparents[$block] = $parents;
 
// KLUDGE: rebuild the list for all block - could be done faster
$this->buildBlockvariablelist();
 
if ($keep_content) {
$this->blockdata[$block] = $blockdata;
}
 
// old TODO - I'm not sure if we need this
// update caches
 
return true;
} // end func replaceBlock
 
/**
* Replaces an existing block with new content from a file.
*
* @brother replaceBlock()
* @param string Blockname
* @param string Name of the file that contains the blockcontent
* @param boolean true if the new block inherits the content of the old block
*/
function replaceBlockfile($block, $filename, $keep_content = false)
{
return $this->replaceBlock($block, $this->getFile($filename), $keep_content);
} // end func replaceBlockfile
 
/**
* Adds a block to the template changing a variable placeholder
* to a block placeholder.
*
* Add means "replace a variable placeholder by a new block".
* This is different to PHPLibs templates. The function loads a
* block, creates a handle for it and assigns it to a certain
* variable placeholder. To to the same with PHPLibs templates you would
* call set_file() to create the handle and parse() to assign the
* parsed block to a variable. By this PHPLibs templates assume
* that you tend to assign a block to more than one one placeholder.
* To assign a parsed block to more than only the placeholder you specify
* in this function you have to use a combination of getBlock()
* and setVariable().
*
* As no updates to cached data is necessary addBlock() and addBlockfile()
* are rather "cheap" meaning quick operations.
*
* The block content must not start with <!-- BEGIN blockname -->
* and end with <!-- END blockname --> this would cause overhead and
* produce an error.
*
* @param string Name of the variable placeholder, the name must be unique
* within the template.
* @param string Name of the block to be added
* @param string Content of the block
* @return boolean
* @throws IT_Error
* @see addBlockfile()
* @access public
*/
function addBlock($placeholder, $blockname, $template)
{
// Don't trust any user even if it's a programmer or yourself...
if ($placeholder == '') {
return new IT_Error('No variable placeholder given.',
__FILE__, __LINE__
);
} elseif ($blockname == '' ||
!preg_match($this->checkblocknameRegExp, $blockname)
) {
return new IT_Error("No or invalid blockname '$blockname' given.",
__FILE__, __LINE__
);
} elseif ($template == '') {
return new IT_Error('No block content given.', __FILE__, __LINE__);
} elseif (isset($this->blocklist[$blockname])) {
return new IT_Error('The block already exists.',
__FILE__, __LINE__
);
}
 
// find out where to insert the new block
$parents = $this->findPlaceholderBlocks($placeholder);
if (count($parents) == 0) {
 
return new IT_Error(
"The variable placeholder".
" '$placeholder' was not found in the template.",
__FILE__, __LINE__
);
 
} elseif (count($parents) > 1) {
 
reset($parents);
while (list($k, $parent) = each($parents)) {
$msg .= "$parent, ";
}
$msg = substr($parent, -2);
 
return new IT_Error("The variable placeholder "."'$placeholder'".
" must be unique, found in multiple blocks '$msg'.",
__FILE__, __LINE__
);
}
 
$template = "<!-- BEGIN $blockname -->" . $template . "<!-- END $blockname -->";
$this->findBlocks($template);
if ($this->flagBlocktrouble) {
return false; // findBlocks() already throws an exception
}
$this->blockinner[$parents[0]][] = $blockname;
$this->blocklist[$parents[0]] = preg_replace(
'@' . $this->openingDelimiter . $placeholder .
$this->closingDelimiter . '@',
 
$this->openingDelimiter . '__' . $blockname . '__' .
$this->closingDelimiter,
 
$this->blocklist[$parents[0]]
);
 
$this->deleteFromBlockvariablelist($parents[0], $placeholder);
$this->updateBlockvariablelist($blockname);
/*
// check if any inner blocks were found
if(is_array($this->blockinner[$blockname]) and count($this->blockinner[$blockname]) > 0) {
// loop through inner blocks, registering the variable placeholders in each
foreach($this->blockinner[$blockname] as $childBlock) {
$this->updateBlockvariablelist($childBlock);
}
}
*/
return true;
} // end func addBlock
 
/**
* Adds a block taken from a file to the template changing a variable
* placeholder to a block placeholder.
*
* @param string Name of the variable placeholder to be converted
* @param string Name of the block to be added
* @param string File that contains the block
* @brother addBlock()
*/
function addBlockfile($placeholder, $blockname, $filename)
{
return $this->addBlock($placeholder, $blockname, $this->getFile($filename));
} // end func addBlockfile
 
/**
* Returns the name of the (first) block that contains
* the specified placeholder.
*
* @param string Name of the placeholder you're searching
* @param string Name of the block to scan. If left out (default)
* all blocks are scanned.
* @return string Name of the (first) block that contains
* the specified placeholder.
* If the placeholder was not found or an error occured
* an empty string is returned.
* @throws IT_Error
* @access public
*/
function placeholderExists($placeholder, $block = '')
{
if ($placeholder == '') {
new IT_Error('No placeholder name given.', __FILE__, __LINE__);
return '';
}
 
if ($block != '' && !isset($this->blocklist[$block])) {
new IT_Error("Unknown block '$block'.", __FILE__, __LINE__);
return '';
}
 
// name of the block where the given placeholder was found
$found = '';
 
if ($block != '') {
if (is_array($variables = $this->blockvariables[$block])) {
// search the value in the list of blockvariables
reset($variables);
while (list($k, $variable) = each($variables)) {
if ($k == $placeholder) {
$found = $block;
break;
}
}
}
} else {
 
// search all blocks and return the name of the first block that
// contains the placeholder
reset($this->blockvariables);
while (list($blockname, $variables) = each($this->blockvariables)){
if (is_array($variables) && isset($variables[$placeholder])) {
$found = $blockname;
break;
}
}
}
 
return $found;
} // end func placeholderExists
 
/**
* Checks the list of function calls in the template and
* calls their callback function.
*
* @access public
*/
function performCallback()
{
reset($this->functions);
while (list($func_id, $function) = each($this->functions)) {
if (isset($this->callback[$function['name']])) {
if ($this->callback[$function['name']]['object'] != '') {
$this->variableCache['__function' . $func_id . '__'] =
call_user_func(
array(
&$GLOBALS[$this->callback[$function['name']]['object']],
$this->callback[$function['name']]['function']),
$function['args']
);
} else {
$this->variableCache['__function' . $func_id . '__'] =
call_user_func(
$this->callback[$function['name']]['function'],
$function['args']
);
}
}
}
 
} // end func performCallback
 
/**
* Returns a list of all function calls in the current template.
*
* @return array
* @access public
*/
function getFunctioncalls()
{
return $this->functions;
} // end func getFunctioncalls
 
/**
* Replaces a function call with the given replacement.
*
* @param int Function ID
* @param string Replacement
* @deprec
*/
function setFunctioncontent($functionID, $replacement)
{
$this->variableCache['__function' . $functionID . '__'] = $replacement;
} // end func setFunctioncontent
 
/**
* Sets a callback function.
*
* IT[X] templates (note the X) can contain simple function calls.
* "function call" means that the editor of the template can add
* special placeholder to the template like 'func_h1("embedded in h1")'.
* IT[X] will grab this function calls and allow you to define a callback
* function for them.
*
* This is an absolutely evil feature. If your application makes heavy
* use of such callbacks and you're even implementing if-then etc. on
* the level of a template engine you're reiventing the wheel... - that's
* actually how PHP came into life. Anyway, sometimes it's handy.
*
* Consider also using XML/XSLT or native PHP. And please do not push
* IT[X] any further into this direction of adding logics to the template
* engine.
*
* For those of you ready for the X in IT[X]:
*
* <?php
* ...
* function h_one($args) {
* return sprintf('<h1>%s</h1>', $args[0]);
* }
*
* ...
* $itx = new HTML_Template_ITX( ... );
* ...
* $itx->setCallbackFunction('h1', 'h_one');
* $itx->performCallback();
* ?>
*
* template:
* func_h1('H1 Headline');
*
* @param string Function name in the template
* @param string Name of the callback function
* @param string Name of the callback object
* @return boolean False on failure.
* @throws IT_Error
* @access public
*/
function
setCallbackFunction($tplfunction, $callbackfunction, $callbackobject = '')
{
if ($tplfunction == '' || $callbackfunction == '') {
return new IT_Error(
"No template function "."('$tplfunction')".
" and/or no callback function ('$callback') given.",
__FILE__, __LINE__
);
}
$this->callback[$tplfunction] = array(
'function' => $callbackfunction,
'object' => $callbackobject
);
 
return true;
} // end func setCallbackFunction
 
/**
* Sets the Callback function lookup table
*
* @param array function table
* array[templatefunction] =
* array(
* "function" => userfunction,
* "object" => userobject
* )
* @access public
*/
function setCallbackFuntiontable($functions)
{
$this->callback = $functions;
} // end func setCallbackFunctiontable
 
/**
* Recursively removes all data assiciated with a block, including all inner blocks
*
* @param string block to be removed
*/
function removeBlockData($block)
{
if (isset($this->blockinner[$block])) {
foreach ($this->blockinner[$block] as $k => $inner) {
$this->removeBlockData($inner);
}
 
unset($this->blockinner[$block]);
}
 
unset($this->blocklist[$block]);
unset($this->blockdata[$block]);
unset($this->blockvariables[$block]);
unset($this->touchedBlocks[$block]);
 
} // end func removeBlockinner
 
/**
* Returns a list of blocknames in the template.
*
* @return array [blockname => blockname]
* @access public
* @see blockExists()
*/
function getBlocklist()
{
$blocklist = array();
foreach ($this->blocklist as $block => $content) {
$blocklist[$block] = $block;
}
 
return $blocklist;
} // end func getBlocklist
 
/**
* Checks wheter a block exists.
*
* @param string
* @return boolean
* @access public
* @see getBlocklist()
*/
function blockExists($blockname)
{
return isset($this->blocklist[$blockname]);
} // end func blockExists
 
/**
* Returns a list of variables of a block.
*
* @param string Blockname
* @return array [varname => varname]
* @access public
* @see BlockvariableExists()
*/
function getBlockvariables($block)
{
if (!isset($this->blockvariables[$block])) {
return array();
}
 
$variables = array();
foreach ($this->blockvariables[$block] as $variable => $v) {
$variables[$variable] = $variable;
}
 
return $variables;
} // end func getBlockvariables
 
/**
* Checks wheter a block variable exists.
*
* @param string Blockname
* @param string Variablename
* @return boolean
* @access public
* @see getBlockvariables()
*/
function BlockvariableExists($block, $variable)
{
return isset($this->blockvariables[$block][$variable]);
} // end func BlockvariableExists
 
/**
* Builds a functionlist from the template.
*/
function buildFunctionlist()
{
$this->functions = array();
 
$template = $this->template;
$num = 0;
 
while (preg_match($this->functionRegExp, $template, $regs)) {
 
$pos = strpos($template, $regs[0]);
$template = substr($template, $pos + strlen($regs[0]));
 
$head = $this->getValue($template, ')');
$args = array();
 
$search = $regs[0] . $head . ')';
 
$replace = $this->openingDelimiter .
'__function' . $num . '__' .
$this->closingDelimiter;
 
$this->template = str_replace($search, $replace, $this->template);
$template = str_replace($search, $replace, $template);
 
while ($head != '' && $args2 = $this->getValue($head, ',')) {
$arg2 = trim($args2);
$args[] = ('"' == $arg2{0} || "'" == $arg2{0}) ?
substr($arg2, 1, -1) : $arg2;
if ($arg2 == $head) {
break;
}
$head = substr($head, strlen($arg2) + 1);
}
 
$this->functions[$num++] = array(
'name' => $regs[1],
'args' => $args
);
}
 
} // end func buildFunctionlist
 
function getValue($code, $delimiter) {
if ($code == '') {
return '';
}
 
if (!is_array($delimiter)) {
$delimiter = array( $delimiter => true );
}
 
$len = strlen($code);
$enclosed = false;
$enclosed_by = '';
 
if (isset($delimiter[$code[0]])) {
$i = 1;
} else {
for ($i = 0; $i < $len; ++$i) {
$char = $code[$i];
 
if (
($char == '"' || $char = "'") &&
($char == $enclosed_by || '' == $enclosed_by) &&
(0 == $i || ($i > 0 && '\\' != $code[$i - 1]))
) {
 
if (!$enclosed) {
$enclosed_by = $char;
} else {
$enclosed_by = "";
}
$enclosed = !$enclosed;
 
}
 
if (!$enclosed && isset($delimiter[$char])) {
break;
}
}
}
 
return substr($code, 0, $i);
} // end func getValue
 
/**
* Deletes one or many variables from the block variable list.
*
* @param string Blockname
* @param mixed Name of one variable or array of variables
* ( array ( name => true ) ) to be stripped.
*/
function deleteFromBlockvariablelist($block, $variables)
{
if (!is_array($variables)) {
$variables = array($variables => true);
}
 
reset($this->blockvariables[$block]);
while (list($varname, $val) = each($this->blockvariables[$block])) {
if (isset($variables[$varname])) {
unset($this->blockvariables[$block][$varname]);
}
}
} // end deleteFromBlockvariablelist
 
/**
* Updates the variable list of a block.
*
* @param string Blockname
*/
function updateBlockvariablelist($block)
{
preg_match_all( $this->variablesRegExp,
$this->blocklist[$block], $regs
);
 
if (count($regs[1]) != 0) {
foreach ($regs[1] as $k => $var) {
$this->blockvariables[$block][$var] = true;
}
} else {
$this->blockvariables[$block] = array();
}
 
// check if any inner blocks were found
if (isset($this->blockinner[$block]) &&
is_array($this->blockinner[$block]) &&
count($this->blockinner[$block]) > 0
) {
/*
* loop through inner blocks, registering the variable
* placeholders in each
*/
foreach ($this->blockinner[$block] as $childBlock) {
$this->updateBlockvariablelist($childBlock);
}
}
} // end func updateBlockvariablelist
 
/**
* Returns an array of blocknames where the given variable
* placeholder is used.
*
* @param string Variable placeholder
* @return array $parents parents[0..n] = blockname
*/
function findPlaceholderBlocks($variable)
{
$parents = array();
reset($this->blocklist);
while (list($blockname, $content) = each($this->blocklist)) {
reset($this->blockvariables[$blockname]);
while (
list($varname, $val) = each($this->blockvariables[$blockname]))
{
if ($variable == $varname) {
$parents[] = $blockname;
}
}
}
 
return $parents;
} // end func findPlaceholderBlocks
 
/**
* Handles warnings, saves them to $warn and prints them or
* calls die() depending on the flags
*
* @param string Warning
* @param string File where the warning occured
* @param int Linenumber where the warning occured
* @see $warn, $printWarning, $haltOnWarning
*/
function warning($message, $file = '', $line = 0)
{
$message = sprintf(
'HTML_Template_ITX Warning: %s [File: %s, Line: %d]',
$message,
$file,
$line
);
 
$this->warn[] = $message;
 
if ($this->printWarning) {
print $message;
}
 
if ($this->haltOnWarning) {
die($message);
}
} // end func warning
 
} // end class HTML_Template_ITX
?>
/tags/Racine_livraison_narmer/api/pear/HTML/Template/IT_Error.php
New file
0,0 → 1,51
<?php
//
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2005 Ulf Wendel, Pierre-Alain Joye |
// +----------------------------------------------------------------------+
// | This source file is subject to the New BSD license, That is bundled |
// | with this package in the file LICENSE, and is available through |
// | the world-wide-web at |
// | http://www.opensource.org/licenses/bsd-license.php |
// | If you did not receive a copy of the new BSD license and are unable |
// | to obtain it through the world-wide-web, please send a note to |
// | pajoye@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Ulf Wendel <ulf.wendel@phpdoc.de> |
// | Pierre-Alain Joye <pajoye@php.net> |
// +----------------------------------------------------------------------+
//
// $Id$
 
require_once "PEAR.php";
 
/**
* IT[X] Error class
*
* @package IT[X]
*/
class IT_Error extends PEAR_Error {
 
 
/**
* Prefix of all error messages.
*
* @var string
*/
var $error_message_prefix = "IntegratedTemplate Error: ";
/**
* Creates an cache error object.
*
* @param string error message
* @param string file where the error occured
* @param string linenumber where the error occured
*/
function IT_Error($msg, $file = __FILE__, $line = __LINE__) {
$this->PEAR_Error(sprintf("%s [%s on line %d].", $msg, $file, $line));
} // end func IT_Error
} // end class IT_Error
?>
/tags/Racine_livraison_narmer/api/pear/HTML/Table.php
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/pear/HTML/Table.php
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/pear/HTML/Common.php
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/pear/HTML/Common.php
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/element.php
New file
0,0 → 1,479
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Adam Daniel <adaniel1@eesus.jnj.com> |
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: element.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once('HTML/Common.php');
 
/**
* Base class for form elements
*
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version 1.3
* @since PHP4.04pl1
* @access public
* @abstract
*/
class HTML_QuickForm_element extends HTML_Common
{
// {{{ properties
 
/**
* Label of the field
* @var string
* @since 1.3
* @access private
*/
var $_label = '';
 
/**
* Form element type
* @var string
* @since 1.0
* @access private
*/
var $_type = '';
 
/**
* Flag to tell if element is frozen
* @var boolean
* @since 1.0
* @access private
*/
var $_flagFrozen = false;
 
/**
* Does the element support persistant data when frozen
* @var boolean
* @since 1.3
* @access private
*/
var $_persistantFreeze = false;
// }}}
// {{{ constructor
/**
* Class constructor
*
* @param string Name of the element
* @param mixed Label(s) for the element
* @param mixed Associative array of tag attributes or HTML attributes name="value" pairs
* @since 1.0
* @access public
* @return void
*/
function HTML_QuickForm_element($elementName=null, $elementLabel=null, $attributes=null)
{
HTML_Common::HTML_Common($attributes);
if (isset($elementName)) {
$this->setName($elementName);
}
if (isset($elementLabel)) {
$this->setLabel($elementLabel);
}
} //end constructor
// }}}
// {{{ apiVersion()
 
/**
* Returns the current API version
*
* @since 1.0
* @access public
* @return float
*/
function apiVersion()
{
return 2.0;
} // end func apiVersion
 
// }}}
// {{{ getType()
 
/**
* Returns element type
*
* @since 1.0
* @access public
* @return string
*/
function getType()
{
return $this->_type;
} // end func getType
 
// }}}
// {{{ setName()
 
/**
* Sets the input field name
*
* @param string $name Input field name attribute
* @since 1.0
* @access public
* @return void
*/
function setName($name)
{
// interface method
} //end func setName
// }}}
// {{{ getName()
 
/**
* Returns the element name
*
* @since 1.0
* @access public
* @return string
*/
function getName()
{
// interface method
} //end func getName
// }}}
// {{{ setValue()
 
/**
* Sets the value of the form element
*
* @param string $value Default value of the form element
* @since 1.0
* @access public
* @return void
*/
function setValue($value)
{
// interface
} // end func setValue
 
// }}}
// {{{ getValue()
 
/**
* Returns the value of the form element
*
* @since 1.0
* @access public
* @return mixed
*/
function getValue()
{
// interface
return null;
} // end func getValue
// }}}
// {{{ freeze()
 
/**
* Freeze the element so that only its value is returned
*
* @access public
* @return void
*/
function freeze()
{
$this->_flagFrozen = true;
} //end func freeze
 
// }}}
// {{{ unfreeze()
 
/**
* Unfreezes the element so that it becomes editable
*
* @access public
* @return void
* @since 3.2.4
*/
function unfreeze()
{
$this->_flagFrozen = false;
}
 
// }}}
// {{{ getFrozenHtml()
 
/**
* Returns the value of field without HTML tags
*
* @since 1.0
* @access public
* @return string
*/
function getFrozenHtml()
{
$value = $this->getValue();
return ('' != $value? htmlspecialchars($value): '&nbsp;') .
$this->_getPersistantData();
} //end func getFrozenHtml
// }}}
// {{{ _getPersistantData()
 
/**
* Used by getFrozenHtml() to pass the element's value if _persistantFreeze is on
*
* @access private
* @return string
*/
function _getPersistantData()
{
if (!$this->_persistantFreeze) {
return '';
} else {
$id = $this->getAttribute('id');
return '<input' . $this->_getAttrString(array(
'type' => 'hidden',
'name' => $this->getName(),
'value' => $this->getValue()
) + (isset($id)? array('id' => $id): array())) . ' />';
}
}
 
// }}}
// {{{ isFrozen()
 
/**
* Returns whether or not the element is frozen
*
* @since 1.3
* @access public
* @return bool
*/
function isFrozen()
{
return $this->_flagFrozen;
} // end func isFrozen
 
// }}}
// {{{ setPersistantFreeze()
 
/**
* Sets wether an element value should be kept in an hidden field
* when the element is frozen or not
*
* @param bool $persistant True if persistant value
* @since 2.0
* @access public
* @return void
*/
function setPersistantFreeze($persistant=false)
{
$this->_persistantFreeze = $persistant;
} //end func setPersistantFreeze
 
// }}}
// {{{ setLabel()
 
/**
* Sets display text for the element
*
* @param string $label Display text for the element
* @since 1.3
* @access public
* @return void
*/
function setLabel($label)
{
$this->_label = $label;
} //end func setLabel
 
// }}}
// {{{ getLabel()
 
/**
* Returns display text for the element
*
* @since 1.3
* @access public
* @return string
*/
function getLabel()
{
return $this->_label;
} //end func getLabel
 
// }}}
// {{{ _findValue()
 
/**
* Tries to find the element value from the values array
*
* @since 2.7
* @access private
* @return mixed
*/
function _findValue(&$values)
{
if (empty($values)) {
return null;
}
$elementName = $this->getName();
if (isset($values[$elementName])) {
return $values[$elementName];
} elseif (strpos($elementName, '[')) {
$myVar = "['" . str_replace(array(']', '['), array('', "']['"), $elementName) . "']";
return eval("return (isset(\$values$myVar)) ? \$values$myVar : null;");
} else {
return null;
}
} //end func _findValue
 
// }}}
// {{{ onQuickFormEvent()
 
/**
* Called by HTML_QuickForm whenever form event is made on this element
*
* @param string $event Name of event
* @param mixed $arg event arguments
* @param object $caller calling object
* @since 1.0
* @access public
* @return void
*/
function onQuickFormEvent($event, $arg, &$caller)
{
switch ($event) {
case 'createElement':
$className = get_class($this);
$this->$className($arg[0], $arg[1], $arg[2], $arg[3], $arg[4]);
break;
case 'addElement':
$this->onQuickFormEvent('createElement', $arg, $caller);
$this->onQuickFormEvent('updateValue', null, $caller);
break;
case 'updateValue':
// constant values override both default and submitted ones
// default values are overriden by submitted
$value = $this->_findValue($caller->_constantValues);
if (null === $value) {
$value = $this->_findValue($caller->_submitValues);
if (null === $value) {
$value = $this->_findValue($caller->_defaultValues);
}
}
if (null !== $value) {
$this->setValue($value);
}
break;
case 'setGroupValue':
$this->setValue($arg);
}
return true;
} // end func onQuickFormEvent
 
// }}}
// {{{ accept()
 
/**
* Accepts a renderer
*
* @param object An HTML_QuickForm_Renderer object
* @param bool Whether an element is required
* @param string An error message associated with an element
* @access public
* @return void
*/
function accept(&$renderer, $required=false, $error=null)
{
$renderer->renderElement($this, $required, $error);
} // end func accept
 
// }}}
// {{{ _generateId()
 
/**
* Automatically generates and assigns an 'id' attribute for the element.
*
* Currently used to ensure that labels work on radio buttons and
* checkboxes. Per idea of Alexander Radivanovich.
*
* @access private
* @return void
*/
function _generateId()
{
static $idx = 1;
 
if (!$this->getAttribute('id')) {
$this->updateAttributes(array('id' => 'qf_' . substr(md5(microtime() . $idx++), 0, 6)));
}
} // end func _generateId
 
// }}}
// {{{ exportValue()
 
/**
* Returns a 'safe' element's value
*
* @param array array of submitted values to search
* @param bool whether to return the value as associative array
* @access public
* @return mixed
*/
function exportValue(&$submitValues, $assoc = false)
{
$value = $this->_findValue($submitValues);
if (null === $value) {
$value = $this->getValue();
}
return $this->_prepareValue($value, $assoc);
}
// }}}
// {{{ _prepareValue()
 
/**
* Used by exportValue() to prepare the value for returning
*
* @param mixed the value found in exportValue()
* @param bool whether to return the value as associative array
* @access private
* @return mixed
*/
function _prepareValue($value, $assoc)
{
if (null === $value) {
return null;
} elseif (!$assoc) {
return $value;
} else {
$name = $this->getName();
if (!strpos($name, '[')) {
return array($name => $value);
} else {
$valueAry = array();
$myIndex = "['" . str_replace(array(']', '['), array('', "']['"), $name) . "']";
eval("\$valueAry$myIndex = \$value;");
return $valueAry;
}
}
}
// }}}
} // end class HTML_QuickForm_element
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/hidden.php
New file
0,0 → 1,87
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Adam Daniel <adaniel1@eesus.jnj.com> |
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: hidden.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once("HTML/QuickForm/input.php");
 
/**
* HTML class for a hidden type element
*
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version 1.0
* @since PHP4.04pl1
* @access public
*/
class HTML_QuickForm_hidden extends HTML_QuickForm_input
{
// {{{ constructor
 
/**
* Class constructor
*
* @param string $elementName (optional)Input field name attribute
* @param string $value (optional)Input field value
* @param mixed $attributes (optional)Either a typical HTML attribute string
* or an associative array
* @since 1.0
* @access public
* @return void
*/
function HTML_QuickForm_hidden($elementName=null, $value='', $attributes=null)
{
HTML_QuickForm_input::HTML_QuickForm_input($elementName, null, $attributes);
$this->setType('hidden');
$this->setValue($value);
} //end constructor
// }}}
// {{{ freeze()
 
/**
* Freeze the element so that only its value is returned
*
* @access public
* @return void
*/
function freeze()
{
return false;
} //end func freeze
 
// }}}
// {{{ accept()
 
/**
* Accepts a renderer
*
* @param object An HTML_QuickForm_Renderer object
* @access public
* @return void
*/
function accept(&$renderer)
{
$renderer->renderHidden($this);
} // end func accept
 
// }}}
 
} //end class HTML_QuickForm_hidden
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/hiddenselect.php
New file
0,0 → 1,107
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Adam Daniel <adaniel1@eesus.jnj.com> |
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: hiddenselect.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once('HTML/QuickForm/select.php');
 
/**
* This class takes the same arguments as a select element, but instead
* of creating a select ring it creates hidden elements for all values
* already selected with setDefault or setConstant. This is useful if
* you have a select ring that you don't want visible, but you need all
* selected values to be passed.
*
* @author Isaac Shepard <ishepard@bsiweb.com>
*
* @version 1.0
* @since 2.1
* @access public
*/
class HTML_QuickForm_hiddenselect extends HTML_QuickForm_select
{
// {{{ constructor
/**
* Class constructor
*
* @param string Select name attribute
* @param mixed Label(s) for the select (not used)
* @param mixed Data to be used to populate options
* @param mixed Either a typical HTML attribute string or an associative array (not used)
* @since 1.0
* @access public
* @return void
*/
function HTML_QuickForm_hiddenselect($elementName=null, $elementLabel=null, $options=null, $attributes=null)
{
HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;
$this->_type = 'hiddenselect';
if (isset($options)) {
$this->load($options);
}
} //end constructor
// }}}
// {{{ toHtml()
 
/**
* Returns the SELECT in HTML
*
* @since 1.0
* @access public
* @return string
* @throws
*/
function toHtml()
{
$tabs = $this->_getTabs();
$name = $this->getPrivateName();
$strHtml = '';
 
foreach ($this->_values as $key => $val) {
for ($i = 0, $optCount = count($this->_options); $i < $optCount; $i++) {
if ($val == $this->_options[$i]['attr']['value']) {
$strHtml .= $tabs . '<input' . $this->_getAttrString(array(
'type' => 'hidden',
'name' => $name,
'value' => $val
)) . " />\n" ;
}
}
}
 
return $strHtml;
} //end func toHtml
// }}}
// {{{ accept()
 
/**
* This is essentially a hidden element and should be rendered as one
*/
function accept(&$renderer)
{
$renderer->renderHidden($this);
}
 
// }}}
} //end class HTML_QuickForm_hiddenselect
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/group.php
New file
0,0 → 1,579
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Adam Daniel <adaniel1@eesus.jnj.com> |
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: group.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once("HTML/QuickForm/element.php");
 
/**
* HTML class for a form element group
*
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version 1.0
* @since PHP4.04pl1
* @access public
*/
class HTML_QuickForm_group extends HTML_QuickForm_element
{
// {{{ properties
/**
* Name of the element
* @var string
* @since 1.0
* @access private
*/
var $_name = '';
 
/**
* Array of grouped elements
* @var array
* @since 1.0
* @access private
*/
var $_elements = array();
 
/**
* String to separate elements
* @var mixed
* @since 2.5
* @access private
*/
var $_separator = null;
 
/**
* Required elements in this group
* @var array
* @since 2.5
* @access private
*/
var $_required = array();
 
/**
* Whether to change elements' names to $groupName[$elementName] or leave them as is
* @var bool
* @since 3.0
* @access private
*/
var $_appendName = true;
 
// }}}
// {{{ constructor
 
/**
* Class constructor
*
* @param string $elementName (optional)Group name
* @param array $elementLabel (optional)Group label
* @param array $elements (optional)Group elements
* @param mixed $separator (optional)Use a string for one separator,
* use an array to alternate the separators.
* @param bool $appendName (optional)whether to change elements' names to
* the form $groupName[$elementName] or leave
* them as is.
* @since 1.0
* @access public
* @return void
*/
function HTML_QuickForm_group($elementName=null, $elementLabel=null, $elements=null, $separator=null, $appendName = true)
{
$this->HTML_QuickForm_element($elementName, $elementLabel);
$this->_type = 'group';
if (isset($elements) && is_array($elements)) {
$this->setElements($elements);
}
if (isset($separator)) {
$this->_separator = $separator;
}
if (isset($appendName)) {
$this->_appendName = $appendName;
}
} //end constructor
// }}}
// {{{ setName()
 
/**
* Sets the group name
*
* @param string $name Group name
* @since 1.0
* @access public
* @return void
*/
function setName($name)
{
$this->_name = $name;
} //end func setName
// }}}
// {{{ getName()
 
/**
* Returns the group name
*
* @since 1.0
* @access public
* @return string
*/
function getName()
{
return $this->_name;
} //end func getName
 
// }}}
// {{{ setValue()
 
/**
* Sets values for group's elements
*
* @param mixed Values for group's elements
* @since 1.0
* @access public
* @return void
*/
function setValue($value)
{
$this->_createElementsIfNotExist();
foreach (array_keys($this->_elements) as $key) {
if (!$this->_appendName) {
$v = $this->_elements[$key]->_findValue($value);
if (null !== $v) {
$this->_elements[$key]->onQuickFormEvent('setGroupValue', $v, $this);
}
 
} else {
$elementName = $this->_elements[$key]->getName();
$index = strlen($elementName) ? $elementName : $key;
if (is_array($value)) {
if (isset($value[$index])) {
$this->_elements[$key]->onQuickFormEvent('setGroupValue', $value[$index], $this);
}
} elseif (isset($value)) {
$this->_elements[$key]->onQuickFormEvent('setGroupValue', $value, $this);
}
}
}
} //end func setValue
// }}}
// {{{ getValue()
 
/**
* Returns the value of the group
*
* @since 1.0
* @access public
* @return mixed
*/
function getValue()
{
$value = null;
foreach (array_keys($this->_elements) as $key) {
$element =& $this->_elements[$key];
switch ($element->getType()) {
case 'radio':
$v = $element->getChecked()? $element->getValue(): null;
break;
case 'checkbox':
$v = $element->getChecked()? true: null;
break;
default:
$v = $element->getValue();
}
if (null !== $v) {
$elementName = $element->getName();
if (is_null($elementName)) {
$value = $v;
} else {
if (!is_array($value)) {
$value = is_null($value)? array(): array($value);
}
if ('' === $elementName) {
$value[] = $v;
} else {
$value[$elementName] = $v;
}
}
}
}
return $value;
} // end func getValue
 
// }}}
// {{{ setElements()
 
/**
* Sets the grouped elements
*
* @param array $elements Array of elements
* @since 1.1
* @access public
* @return void
*/
function setElements($elements)
{
$this->_elements = array_values($elements);
if ($this->_flagFrozen) {
$this->freeze();
}
} // end func setElements
 
// }}}
// {{{ getElements()
 
/**
* Gets the grouped elements
*
* @since 2.4
* @access public
* @return array
*/
function &getElements()
{
$this->_createElementsIfNotExist();
return $this->_elements;
} // end func getElements
 
// }}}
// {{{ getGroupType()
 
/**
* Gets the group type based on its elements
* Will return 'mixed' if elements contained in the group
* are of different types.
*
* @access public
* @return string group elements type
*/
function getGroupType()
{
$this->_createElementsIfNotExist();
$prevType = '';
foreach (array_keys($this->_elements) as $key) {
$type = $this->_elements[$key]->getType();
if ($type != $prevType && $prevType != '') {
return 'mixed';
}
$prevType = $type;
}
return $type;
} // end func getGroupType
 
// }}}
// {{{ toHtml()
 
/**
* Returns Html for the group
*
* @since 1.0
* @access public
* @return string
*/
function toHtml()
{
include_once('HTML/QuickForm/Renderer/Default.php');
$renderer =& new HTML_QuickForm_Renderer_Default();
$renderer->setElementTemplate('{element}');
$this->accept($renderer);
return $renderer->toHtml();
} //end func toHtml
// }}}
// {{{ getElementName()
 
/**
* Returns the element name inside the group such as found in the html form
*
* @param mixed $index Element name or element index in the group
* @since 3.0
* @access public
* @return mixed string with element name, false if not found
*/
function getElementName($index)
{
$this->_createElementsIfNotExist();
$elementName = false;
if (is_int($index) && isset($this->_elements[$index])) {
$elementName = $this->_elements[$index]->getName();
if (isset($elementName) && $elementName == '') {
$elementName = $index;
}
if ($this->_appendName) {
if (is_null($elementName)) {
$elementName = $this->getName();
} else {
$elementName = $this->getName().'['.$elementName.']';
}
}
 
} elseif (is_string($index)) {
foreach (array_keys($this->_elements) as $key) {
$elementName = $this->_elements[$key]->getName();
if ($index == $elementName) {
if ($this->_appendName) {
$elementName = $this->getName().'['.$elementName.']';
}
break;
} elseif ($this->_appendName && $this->getName().'['.$elementName.']' == $index) {
break;
}
}
}
return $elementName;
} //end func getElementName
 
// }}}
// {{{ getFrozenHtml()
 
/**
* Returns the value of field without HTML tags
*
* @since 1.3
* @access public
* @return string
*/
function getFrozenHtml()
{
$flags = array();
$this->_createElementsIfNotExist();
foreach (array_keys($this->_elements) as $key) {
if (false === ($flags[$key] = $this->_elements[$key]->isFrozen())) {
$this->_elements[$key]->freeze();
}
}
$html = $this->toHtml();
foreach (array_keys($this->_elements) as $key) {
if (!$flags[$key]) {
$this->_elements[$key]->unfreeze();
}
}
return $html;
} //end func getFrozenHtml
 
// }}}
// {{{ onQuickFormEvent()
 
/**
* Called by HTML_QuickForm whenever form event is made on this element
*
* @param string $event Name of event
* @param mixed $arg event arguments
* @param object $caller calling object
* @since 1.0
* @access public
* @return void
*/
function onQuickFormEvent($event, $arg, &$caller)
{
switch ($event) {
case 'updateValue':
$this->_createElementsIfNotExist();
foreach (array_keys($this->_elements) as $key) {
if ($this->_appendName) {
$elementName = $this->_elements[$key]->getName();
if (is_null($elementName)) {
$this->_elements[$key]->setName($this->getName());
} elseif ('' === $elementName) {
$this->_elements[$key]->setName($this->getName() . '[' . $key . ']');
} else {
$this->_elements[$key]->setName($this->getName() . '[' . $elementName . ']');
}
}
$this->_elements[$key]->onQuickFormEvent('updateValue', $arg, $caller);
if ($this->_appendName) {
$this->_elements[$key]->setName($elementName);
}
}
break;
 
default:
parent::onQuickFormEvent($event, $arg, $caller);
}
return true;
} // end func onQuickFormEvent
 
// }}}
// {{{ accept()
 
/**
* Accepts a renderer
*
* @param object An HTML_QuickForm_Renderer object
* @param bool Whether a group is required
* @param string An error message associated with a group
* @access public
* @return void
*/
function accept(&$renderer, $required = false, $error = null)
{
$this->_createElementsIfNotExist();
$renderer->startGroup($this, $required, $error);
$name = $this->getName();
foreach (array_keys($this->_elements) as $key) {
$element =& $this->_elements[$key];
if ($this->_appendName) {
$elementName = $element->getName();
if (isset($elementName)) {
$element->setName($name . '['. (strlen($elementName)? $elementName: $key) .']');
} else {
$element->setName($name);
}
}
 
$required = !$element->isFrozen() && in_array($element->getName(), $this->_required);
 
$element->accept($renderer, $required);
 
// restore the element's name
if ($this->_appendName) {
$element->setName($elementName);
}
}
$renderer->finishGroup($this);
} // end func accept
 
// }}}
// {{{ exportValue()
 
/**
* As usual, to get the group's value we access its elements and call
* their exportValue() methods
*/
function exportValue(&$submitValues, $assoc = false)
{
$value = null;
foreach (array_keys($this->_elements) as $key) {
$elementName = $this->_elements[$key]->getName();
if ($this->_appendName) {
if (is_null($elementName)) {
$this->_elements[$key]->setName($this->getName());
} elseif ('' === $elementName) {
$this->_elements[$key]->setName($this->getName() . '[' . $key . ']');
} else {
$this->_elements[$key]->setName($this->getName() . '[' . $elementName . ']');
}
}
$v = $this->_elements[$key]->exportValue($submitValues, $assoc);
if ($this->_appendName) {
$this->_elements[$key]->setName($elementName);
}
if (null !== $v) {
// Make $value an array, we will use it like one
if (null === $value) {
$value = array();
}
if ($assoc) {
// just like HTML_QuickForm::exportValues()
$value = HTML_QuickForm::arrayMerge($value, $v);
} else {
// just like getValue(), but should work OK every time here
if (is_null($elementName)) {
$value = $v;
} elseif ('' === $elementName) {
$value[] = $v;
} else {
$value[$elementName] = $v;
}
}
}
}
// do not pass the value through _prepareValue, we took care of this already
return $value;
}
 
// }}}
// {{{ _createElements()
 
/**
* Creates the group's elements.
*
* This should be overriden by child classes that need to create their
* elements. The method will be called automatically when needed, calling
* it from the constructor is discouraged as the constructor is usually
* called _twice_ on element creation, first time with _no_ parameters.
*
* @access private
* @abstract
*/
function _createElements()
{
// abstract
}
 
// }}}
// {{{ _createElementsIfNotExist()
 
/**
* A wrapper around _createElements()
*
* This method calls _createElements() if the group's _elements array
* is empty. It also performs some updates, e.g. freezes the created
* elements if the group is already frozen.
*
* @access private
*/
function _createElementsIfNotExist()
{
if (empty($this->_elements)) {
$this->_createElements();
if ($this->_flagFrozen) {
$this->freeze();
}
}
}
 
// }}}
// {{{ freeze()
 
function freeze()
{
parent::freeze();
foreach (array_keys($this->_elements) as $key) {
$this->_elements[$key]->freeze();
}
}
 
// }}}
// {{{ unfreeze()
 
function unfreeze()
{
parent::unfreeze();
foreach (array_keys($this->_elements) as $key) {
$this->_elements[$key]->unfreeze();
}
}
 
// }}}
// {{{ setPersistantFreeze()
 
function setPersistantFreeze($persistant = false)
{
parent::setPersistantFreeze($persistant);
foreach (array_keys($this->_elements) as $key) {
$this->_elements[$key]->setPersistantFreeze($persistant);
}
}
 
// }}}
} //end class HTML_QuickForm_group
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/link.php
New file
0,0 → 1,192
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Adam Daniel <adaniel1@eesus.jnj.com> |
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
 
require_once 'HTML/QuickForm/static.php';
 
/**
* HTML class for a link type field
*
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version 1.0
* @since PHP4.04pl1
* @access public
*/
class HTML_QuickForm_link extends HTML_QuickForm_static
{
// {{{ properties
 
/**
* Link display text
* @var string
* @since 1.0
* @access private
*/
var $_text = "";
 
// }}}
// {{{ constructor
/**
* Class constructor
*
* @param string $elementLabel (optional)Link label
* @param string $href (optional)Link href
* @param string $text (optional)Link display text
* @param mixed $attributes (optional)Either a typical HTML attribute string
* or an associative array
* @since 1.0
* @access public
* @return void
* @throws
*/
function HTML_QuickForm_link($elementName=null, $elementLabel=null, $href=null, $text=null, $attributes=null)
{
HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = false;
$this->_type = 'link';
$this->setHref($href);
$this->_text = $text;
} //end constructor
// }}}
// {{{ setName()
 
/**
* Sets the input field name
*
* @param string $name Input field name attribute
* @since 1.0
* @access public
* @return void
* @throws
*/
function setName($name)
{
$this->updateAttributes(array('name'=>$name));
} //end func setName
// }}}
// {{{ getName()
 
/**
* Returns the element name
*
* @since 1.0
* @access public
* @return string
* @throws
*/
function getName()
{
return $this->getAttribute('name');
} //end func getName
 
// }}}
// {{{ setValue()
 
/**
* Sets value for textarea element
*
* @param string $value Value for password element
* @since 1.0
* @access public
* @return void
* @throws
*/
function setValue($value)
{
return;
} //end func setValue
// }}}
// {{{ getValue()
 
/**
* Returns the value of the form element
*
* @since 1.0
* @access public
* @return void
* @throws
*/
function getValue()
{
return;
} // end func getValue
 
// }}}
// {{{ setHref()
 
/**
* Sets the links href
*
* @param string $href
* @since 1.0
* @access public
* @return void
* @throws
*/
function setHref($href)
{
$this->updateAttributes(array('href'=>$href));
} // end func setHref
 
// }}}
// {{{ toHtml()
 
/**
* Returns the textarea element in HTML
*
* @since 1.0
* @access public
* @return string
* @throws
*/
function toHtml()
{
$tabs = $this->_getTabs();
$html = "$tabs<a".$this->_getAttrString($this->_attributes).">";
$html .= $this->_text;
$html .= "</a>";
return $html;
} //end func toHtml
// }}}
// {{{ getFrozenHtml()
 
/**
* Returns the value of field without HTML tags (in this case, value is changed to a mask)
*
* @since 1.0
* @access public
* @return string
* @throws
*/
function getFrozenHtml()
{
return;
} //end func getFrozenHtml
 
// }}}
 
} //end class HTML_QuickForm_textarea
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/radio.php
New file
0,0 → 1,244
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Adam Daniel <adaniel1@eesus.jnj.com> |
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: radio.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once('HTML/QuickForm/input.php');
 
/**
* HTML class for a radio type element
*
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version 1.1
* @since PHP4.04pl1
* @access public
*/
class HTML_QuickForm_radio extends HTML_QuickForm_input
{
// {{{ properties
 
/**
* Radio display text
* @var string
* @since 1.1
* @access private
*/
var $_text = '';
 
// }}}
// {{{ constructor
 
/**
* Class constructor
*
* @param string Input field name attribute
* @param mixed Label(s) for a field
* @param string Text to display near the radio
* @param string Input field value
* @param mixed Either a typical HTML attribute string or an associative array
* @since 1.0
* @access public
* @return void
*/
function HTML_QuickForm_radio($elementName=null, $elementLabel=null, $text=null, $value=null, $attributes=null)
{
$this->HTML_QuickForm_element($elementName, $elementLabel, $attributes);
if (isset($value)) {
$this->setValue($value);
}
$this->_persistantFreeze = true;
$this->setType('radio');
$this->_text = $text;
$this->_generateId();
} //end constructor
// }}}
// {{{ setChecked()
 
/**
* Sets whether radio button is checked
*
* @param bool $checked Whether the field is checked or not
* @since 1.0
* @access public
* @return void
*/
function setChecked($checked)
{
if (!$checked) {
$this->removeAttribute('checked');
} else {
$this->updateAttributes(array('checked'=>'checked'));
}
} //end func setChecked
 
// }}}
// {{{ getChecked()
 
/**
* Returns whether radio button is checked
*
* @since 1.0
* @access public
* @return string
*/
function getChecked()
{
return $this->getAttribute('checked');
} //end func getChecked
// }}}
// {{{ toHtml()
 
/**
* Returns the radio element in HTML
*
* @since 1.0
* @access public
* @return string
*/
function toHtml()
{
if (0 == strlen($this->_text)) {
$label = '';
} elseif ($this->_flagFrozen) {
$label = $this->_text;
} else {
$label = '<label for="' . $this->getAttribute('id') . '">' . $this->_text . '</label>';
}
return HTML_QuickForm_input::toHtml() . $label;
} //end func toHtml
// }}}
// {{{ getFrozenHtml()
 
/**
* Returns the value of field without HTML tags
*
* @since 1.0
* @access public
* @return string
*/
function getFrozenHtml()
{
if ($this->getChecked()) {
return '<tt>(x)</tt>' .
$this->_getPersistantData();
} else {
return '<tt>( )</tt>';
}
} //end func getFrozenHtml
 
// }}}
// {{{ setText()
 
/**
* Sets the radio text
*
* @param string $text Text to display near the radio button
* @since 1.1
* @access public
* @return void
*/
function setText($text)
{
$this->_text = $text;
} //end func setText
 
// }}}
// {{{ getText()
 
/**
* Returns the radio text
*
* @since 1.1
* @access public
* @return string
*/
function getText()
{
return $this->_text;
} //end func getText
 
// }}}
// {{{ onQuickFormEvent()
 
/**
* Called by HTML_QuickForm whenever form event is made on this element
*
* @param string $event Name of event
* @param mixed $arg event arguments
* @param object $caller calling object
* @since 1.0
* @access public
* @return void
*/
function onQuickFormEvent($event, $arg, &$caller)
{
switch ($event) {
case 'updateValue':
// constant values override both default and submitted ones
// default values are overriden by submitted
$value = $this->_findValue($caller->_constantValues);
if (null === $value) {
$value = $this->_findValue($caller->_submitValues);
if (null === $value) {
$value = $this->_findValue($caller->_defaultValues);
}
}
if ($value == $this->getValue()) {
$this->setChecked(true);
} else {
$this->setChecked(false);
}
break;
case 'setGroupValue':
if ($arg == $this->getValue()) {
$this->setChecked(true);
} else {
$this->setChecked(false);
}
break;
default:
parent::onQuickFormEvent($event, $arg, $caller);
}
return true;
} // end func onQuickFormLoad
 
// }}}
// {{{ exportValue()
 
/**
* Returns the value attribute if the radio is checked, null if it is not
*/
function exportValue(&$submitValues, $assoc = false)
{
$value = $this->_findValue($submitValues);
if (null === $value) {
$value = $this->getChecked()? $this->getValue(): null;
} elseif ($value != $this->getValue()) {
$value = null;
}
return $this->_prepareValue($value, $assoc);
}
// }}}
} //end class HTML_QuickForm_radio
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/input.php
New file
0,0 → 1,202
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Adam Daniel <adaniel1@eesus.jnj.com> |
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: input.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once("HTML/QuickForm/element.php");
 
/**
* Base class for input form elements
*
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version 1.0
* @since PHP4.04pl1
* @access public
* @abstract
*/
class HTML_QuickForm_input extends HTML_QuickForm_element
{
// {{{ constructor
 
/**
* Class constructor
*
* @param string Input field name attribute
* @param mixed Label(s) for the input field
* @param mixed Either a typical HTML attribute string or an associative array
* @since 1.0
* @access public
* @return void
*/
function HTML_QuickForm_input($elementName=null, $elementLabel=null, $attributes=null)
{
$this->HTML_QuickForm_element($elementName, $elementLabel, $attributes);
} //end constructor
 
// }}}
// {{{ setType()
 
/**
* Sets the element type
*
* @param string $type Element type
* @since 1.0
* @access public
* @return void
*/
function setType($type)
{
$this->_type = $type;
$this->updateAttributes(array('type'=>$type));
} // end func setType
// }}}
// {{{ setName()
 
/**
* Sets the input field name
*
* @param string $name Input field name attribute
* @since 1.0
* @access public
* @return void
*/
function setName($name)
{
$this->updateAttributes(array('name'=>$name));
} //end func setName
// }}}
// {{{ getName()
 
/**
* Returns the element name
*
* @since 1.0
* @access public
* @return string
*/
function getName()
{
return $this->getAttribute('name');
} //end func getName
// }}}
// {{{ setValue()
 
/**
* Sets the value of the form element
*
* @param string $value Default value of the form element
* @since 1.0
* @access public
* @return void
*/
function setValue($value)
{
$this->updateAttributes(array('value'=>$value));
} // end func setValue
 
// }}}
// {{{ getValue()
 
/**
* Returns the value of the form element
*
* @since 1.0
* @access public
* @return string
*/
function getValue()
{
return $this->getAttribute('value');
} // end func getValue
// }}}
// {{{ toHtml()
 
/**
* Returns the input field in HTML
*
* @since 1.0
* @access public
* @return string
*/
function toHtml()
{
if ($this->_flagFrozen) {
return $this->getFrozenHtml();
} else {
return $this->_getTabs() . '<input' . $this->_getAttrString($this->_attributes) . ' />';
}
} //end func toHtml
 
// }}}
// {{{ onQuickFormEvent()
 
/**
* Called by HTML_QuickForm whenever form event is made on this element
*
* @param string $event Name of event
* @param mixed $arg event arguments
* @param object $caller calling object
* @since 1.0
* @access public
* @return void
* @throws
*/
function onQuickFormEvent($event, $arg, &$caller)
{
// do not use submit values for button-type elements
$type = $this->getType();
if (('updateValue' != $event) ||
('submit' != $type && 'reset' != $type && 'image' != $type && 'button' != $type)) {
parent::onQuickFormEvent($event, $arg, $caller);
} else {
$value = $this->_findValue($caller->_constantValues);
if (null === $value) {
$value = $this->_findValue($caller->_defaultValues);
}
if (null !== $value) {
$this->setValue($value);
}
}
return true;
} // end func onQuickFormEvent
 
// }}}
// {{{ exportValue()
 
/**
* We don't need values from button-type elements (except submit) and files
*/
function exportValue(&$submitValues, $assoc = false)
{
$type = $this->getType();
if ('reset' == $type || 'image' == $type || 'button' == $type || 'file' == $type) {
return null;
} else {
return parent::exportValue($submitValues, $assoc);
}
}
// }}}
} // end class HTML_QuickForm_element
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/RuleRegistry.php
New file
0,0 → 1,333
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Adam Daniel <adaniel1@eesus.jnj.com> |
// | Alexey Borzov <borz_off@cs.msu.su> |
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: RuleRegistry.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
/**
* Registers rule objects and uses them for validation
*
*/
class HTML_QuickForm_RuleRegistry
{
/**
* Array containing references to used rules
* @var array
* @access private
*/
var $_rules = array();
 
 
/**
* Returns a singleton of HTML_QuickForm_RuleRegistry
*
* Usually, only one RuleRegistry object is needed, this is the reason
* why it is recommended to use this method to get the validation object.
*
* @access public
* @static
* @return object Reference to the HTML_QuickForm_RuleRegistry singleton
*/
function &singleton()
{
static $obj;
if (!isset($obj)) {
$obj = new HTML_QuickForm_RuleRegistry();
}
return $obj;
} // end func singleton
 
/**
* Registers a new validation rule
*
* In order to use a custom rule in your form, you need to register it
* first. For regular expressions, one can directly use the 'regex' type
* rule in addRule(), this is faster than registering the rule.
*
* Functions and methods can be registered. Use the 'function' type.
* When registering a method, specify the class name as second parameter.
*
* You can also register an HTML_QuickForm_Rule subclass with its own
* validate() method.
*
* @param string $ruleName Name of validation rule
* @param string $type Either: 'regex', 'function' or null
* @param string $data1 Name of function, regular expression or
* HTML_QuickForm_Rule object class name
* @param string $data2 Object parent of above function or HTML_QuickForm_Rule file path
* @access public
* @return void
*/
function registerRule($ruleName, $type, $data1, $data2 = null)
{
$type = strtolower($type);
if ($type == 'regex') {
// Regular expression
$rule =& $this->getRule('regex');
$rule->addData($ruleName, $data1);
$GLOBALS['_HTML_QuickForm_registered_rules'][$ruleName] = $GLOBALS['_HTML_QuickForm_registered_rules']['regex'];
 
} elseif ($type == 'function' || $type == 'callback') {
// Callback function
$rule =& $this->getRule('callback');
$rule->addData($ruleName, $data1, $data2, 'function' == $type);
$GLOBALS['_HTML_QuickForm_registered_rules'][$ruleName] = $GLOBALS['_HTML_QuickForm_registered_rules']['callback'];
 
} elseif (is_object($data1)) {
// An instance of HTML_QuickForm_Rule
$this->_rules[strtolower(get_class($data1))] = $data1;
$GLOBALS['_HTML_QuickForm_registered_rules'][$ruleName] = array(strtolower(get_class($data1)), null);
 
} else {
// Rule class name
$GLOBALS['_HTML_QuickForm_registered_rules'][$ruleName] = array(strtolower($data1), $data2);
}
} // end func registerRule
 
/**
* Returns a reference to the requested rule object
*
* @param string $ruleName Name of the requested rule
* @access public
* @return object
*/
function &getRule($ruleName)
{
list($class, $path) = $GLOBALS['_HTML_QuickForm_registered_rules'][$ruleName];
 
if (!isset($this->_rules[$class])) {
if (!empty($path)) {
include_once($path);
}
$this->_rules[$class] =& new $class();
}
$this->_rules[$class]->setName($ruleName);
return $this->_rules[$class];
} // end func getRule
 
/**
* Performs validation on the given values
*
* @param string $ruleName Name of the rule to be used
* @param mixed $values Can be a scalar or an array of values
* to be validated
* @param mixed $options Options used by the rule
* @param mixed $multiple Whether to validate an array of values altogether
* @access public
* @return mixed true if no error found, int of valid values (when an array of values is given) or false if error
*/
function validate($ruleName, $values, $options = null, $multiple = false)
{
$rule =& $this->getRule($ruleName);
 
if (is_array($values) && !$multiple) {
$result = 0;
foreach ($values as $value) {
if ($rule->validate($value, $options) === true) {
$result++;
}
}
return ($result == 0) ? false : $result;
} else {
return $rule->validate($values, $options);
}
} // end func validate
 
/**
* Returns the validation test in javascript code
*
* @param mixed Element(s) the rule applies to
* @param string Element name, in case $element is not array
* @param array Rule data
* @access public
* @return string JavaScript for the rule
*/
function getValidationScript(&$element, $elementName, $ruleData)
{
$reset = (isset($ruleData['reset'])) ? $ruleData['reset'] : false;
$rule =& $this->getRule($ruleData['type']);
if (!is_array($element)) {
list($jsValue, $jsReset) = $this->_getJsValue($element, $elementName, $reset, null);
} else {
$jsValue = " value = new Array();\n";
$jsReset = '';
for ($i = 0; $i < count($element); $i++) {
list($tmp_value, $tmp_reset) = $this->_getJsValue($element[$i], $element[$i]->getName(), $reset, $i);
$jsValue .= "\n" . $tmp_value;
$jsReset .= $tmp_reset;
}
}
$jsField = isset($ruleData['group'])? $ruleData['group']: $elementName;
list ($jsPrefix, $jsCheck) = $rule->getValidationScript($ruleData['format']);
if (!isset($ruleData['howmany'])) {
$js = $jsValue . "\n" . $jsPrefix .
" if (" . str_replace('{jsVar}', 'value', $jsCheck) . " && !errFlag['{$jsField}']) {\n" .
" errFlag['{$jsField}'] = true;\n" .
" _qfMsg = _qfMsg + '\\n - {$ruleData['message']}';\n" .
$jsReset .
" }\n";
} else {
$js = $jsValue . "\n" . $jsPrefix .
" var res = 0;\n" .
" for (var i = 0; i < value.length; i++) {\n" .
" if (!(" . str_replace('{jsVar}', 'value[i]', $jsCheck) . ")) {\n" .
" res++;\n" .
" }\n" .
" }\n" .
" if (res < {$ruleData['howmany']} && !errFlag['{$jsField}']) {\n" .
" errFlag['{$jsField}'] = true;\n" .
" _qfMsg = _qfMsg + '\\n - {$ruleData['message']}';\n" .
$jsReset .
" }\n";
}
return $js;
} // end func getValidationScript
 
 
/**
* Returns JavaScript to get and to reset the element's value
*
* @access private
* @param object HTML_QuickForm_element element being processed
* @param string element's name
* @param bool whether to generate JavaScript to reset the value
* @param integer value's index in the array (only used for multielement rules)
* @return array first item is value javascript, second is reset
*/
function _getJsValue(&$element, $elementName, $reset = false, $index = null)
{
$jsIndex = isset($index)? '[' . $index . ']': '';
$tmp_reset = $reset? " var field = frm.elements['$elementName'];\n": '';
if (is_a($element, 'html_quickform_group')) {
$value = " _qfGroups['{$elementName}'] = {";
$elements =& $element->getElements();
for ($i = 0, $count = count($elements); $i < $count; $i++) {
$append = ($elements[$i]->getType() == 'select' && $elements[$i]->getMultiple())? '[]': '';
$value .= "'" . $element->getElementName($i) . $append . "': true" .
($i < $count - 1? ', ': '');
}
$value .=
"};\n" .
" value{$jsIndex} = new Array();\n" .
" var valueIdx = 0;\n" .
" for (var i = 0; i < frm.elements.length; i++) {\n" .
" var _element = frm.elements[i];\n" .
" if (_element.name in _qfGroups['{$elementName}']) {\n" .
" switch (_element.type) {\n" .
" case 'checkbox':\n" .
" case 'radio':\n" .
" if (_element.checked) {\n" .
" value{$jsIndex}[valueIdx++] = _element.value;\n" .
" }\n" .
" break;\n" .
" case 'select-one':\n" .
" if (-1 != _element.selectedIndex) {\n" .
" value{$jsIndex}[valueIdx++] = _element.options[_element.selectedIndex].value;\n" .
" }\n" .
" break;\n" .
" case 'select-multiple':\n" .
" var tmpVal = new Array();\n" .
" var tmpIdx = 0;\n" .
" for (var j = 0; j < _element.options.length; j++) {\n" .
" if (_element.options[j].selected) {\n" .
" tmpVal[tmpIdx++] = _element.options[j].value;\n" .
" }\n" .
" }\n" .
" if (tmpIdx > 0) {\n" .
" value{$jsIndex}[valueIdx++] = tmpVal;\n" .
" }\n" .
" break;\n" .
" default:\n" .
" value{$jsIndex}[valueIdx++] = _element.value;\n" .
" }\n" .
" }\n" .
" }\n";
if ($reset) {
$tmp_reset =
" for (var i = 0; i < frm.elements.length; i++) {\n" .
" var _element = frm.elements[i];\n" .
" if (_element.name in _qfGroups['{$elementName}']) {\n" .
" switch (_element.type) {\n" .
" case 'checkbox':\n" .
" case 'radio':\n" .
" _element.checked = _element.defaultChecked;\n" .
" break;\n" .
" case 'select-one':\n" .
" case 'select-multiple:\n" .
" for (var j = 0; j < _element.options.length; j++) {\n" .
" _element.options[j].selected = _element.options[j].defaultSelected;\n" .
" }\n" .
" break;\n" .
" default:\n" .
" _element.value = _element.defaultValue;\n" .
" }\n" .
" }\n" .
" }\n";
}
 
} elseif ($element->getType() == 'select') {
if ($element->getMultiple()) {
$elementName .= '[]';
$value =
" value{$jsIndex} = new Array();\n" .
" var valueIdx = 0;\n" .
" for (var i = 0; i < frm.elements['{$elementName}'].options.length; i++) {\n" .
" if (frm.elements['{$elementName}'].options[i].selected) {\n" .
" value{$jsIndex}[valueIdx++] = frm.elements['{$elementName}'].options[i].value;\n" .
" }\n" .
" }\n";
} else {
$value = " value{$jsIndex} = frm.elements['{$elementName}'].selectedIndex == -1? '': frm.elements['{$elementName}'].options[frm.elements['{$elementName}'].selectedIndex].value;\n";
}
if ($reset) {
$tmp_reset .=
" for (var i = 0; i < field.options.length; i++) {\n" .
" field.options[i].selected = field.options[i].defaultSelected;\n" .
" }\n";
}
 
} elseif ($element->getType() == 'checkbox' && !is_a($element, 'html_quickform_advcheckbox')) {
$value = " if (frm.elements['$elementName'].checked) {\n" .
" value{$jsIndex} = '1';\n" .
" } else {\n" .
" value{$jsIndex} = '';\n" .
" }";
$tmp_reset .= ($reset) ? " field.checked = field.defaultChecked;\n" : '';
 
} elseif ($element->getType() == 'radio') {
$value = " value{$jsIndex} = '';\n" .
" for (var i = 0; i < frm.elements['$elementName'].length; i++) {\n" .
" if (frm.elements['$elementName'][i].checked) {\n" .
" value{$jsIndex} = frm.elements['$elementName'][i].value;\n" .
" }\n" .
" }";
if ($reset) {
$tmp_reset .= " for (var i = 0; i < field.length; i++) {\n" .
" field[i].checked = field[i].defaultChecked;\n" .
" }";
}
 
} else {
$value = " value{$jsIndex} = frm.elements['$elementName'].value;";
$tmp_reset .= ($reset) ? " field.value = field.defaultValue;\n" : '';
}
return array($value, $tmp_reset);
}
} // end class HTML_QuickForm_RuleRegistry
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/autocomplete.php
New file
0,0 → 1,249
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Matteo Di Giovinazzo <matteodg@infinito.it> |
// | |
// | For the JavaScript code thanks to Martin Honnen and |
// | Nicholas C. Zakas |
// | See: |
// | http://www.faqts.com/knowledge_base/view.phtml/aid/13562 |
// | and |
// | http://www.sitepoint.com/article/1220 |
// +----------------------------------------------------------------------+
//
// $Id: autocomplete.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
 
require_once("HTML/QuickForm/text.php");
 
 
/**
* Class to dynamically create an HTML input text element that
* at every keypressed javascript event, check in an array of options
* if there's a match and autocomplete the text in case of match.
*
* Ex:
* $autocomplete =& $form->addElement('autocomplete', 'fruit', 'Favourite fruit:');
* $options = array("Apple", "Orange", "Pear", "Strawberry");
* $autocomplete->setOptions($options);
*
* @author Matteo Di Giovinazzo <matteodg@infinito.it>
*/
class HTML_QuickForm_autocomplete extends HTML_QuickForm_text
{
// {{{ properties
 
/**
* Options for the autocomplete input text element
*
* @var array
* @access private
*/
var $_options = array();
 
/**
* "One-time" javascript (containing functions), see bug #4611
*
* @var string
* @access private
*/
var $_js = '';
 
// }}}
// {{{ constructor
 
/**
* Class constructor
*
* @param string $elementName (optional)Input field name attribute
* @param string $elementLabel (optional)Input field label in form
* @param array $options (optional)Autocomplete options
* @param mixed $attributes (optional)Either a typical HTML attribute string
* or an associative array. Date format is passed along the attributes.
* @access public
* @return void
*/
function HTML_QuickForm_autocomplete($elementName = null, $elementLabel = null, $options = null, $attributes = null)
{
$this->HTML_QuickForm_text($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;
$this->_type = 'autocomplete';
if (isset($options)) {
$this->setOptions($options);
}
} //end constructor
 
// }}}
// {{{ setOptions()
 
/**
* Sets the options for the autocomplete input text element
*
* @param array $options Array of options for the autocomplete input text element
* @access public
* @return void
*/
function setOptions($options)
{
$this->_options = array_values($options);
} // end func setOptions
 
// }}}
// {{{ toHtml()
 
/**
* Returns Html for the autocomplete input text element
*
* @access public
* @return string
*/
function toHtml()
{
// prevent problems with grouped elements
$arrayName = str_replace(array('[', ']'), array('__', ''), $this->getName()) . '_values';
 
$this->updateAttributes(array(
'onkeypress' => 'return autocomplete(this, event, ' . $arrayName . ');'
));
if ($this->_flagFrozen) {
$js = '';
} else {
$js = "<script type=\"text/javascript\">\n//<![CDATA[\n";
if (!defined('HTML_QUICKFORM_AUTOCOMPLETE_EXISTS')) {
$this->_js .= <<<EOS
 
/* begin javascript for autocomplete */
function setSelectionRange(input, selectionStart, selectionEnd) {
if (input.setSelectionRange) {
input.setSelectionRange(selectionStart, selectionEnd);
}
else if (input.createTextRange) {
var range = input.createTextRange();
range.collapse(true);
range.moveEnd("character", selectionEnd);
range.moveStart("character", selectionStart);
range.select();
}
input.focus();
}
 
function setCaretToPosition(input, position) {
setSelectionRange(input, position, position);
}
 
function replaceSelection (input, replaceString) {
var len = replaceString.length;
if (input.setSelectionRange) {
var selectionStart = input.selectionStart;
var selectionEnd = input.selectionEnd;
 
input.value = input.value.substring(0, selectionStart) + replaceString + input.value.substring(selectionEnd);
input.selectionStart = selectionStart + len;
input.selectionEnd = selectionStart + len;
}
else if (document.selection) {
var range = document.selection.createRange();
var saved_range = range.duplicate();
 
if (range.parentElement() == input) {
range.text = replaceString;
range.moveEnd("character", saved_range.selectionStart + len);
range.moveStart("character", saved_range.selectionStart + len);
range.select();
}
}
input.focus();
}
 
 
function autocompleteMatch (text, values) {
for (var i = 0; i < values.length; i++) {
if (values[i].toUpperCase().indexOf(text.toUpperCase()) == 0) {
return values[i];
}
}
 
return null;
}
 
function autocomplete(textbox, event, values) {
if (textbox.setSelectionRange || textbox.createTextRange) {
switch (event.keyCode) {
case 38: // up arrow
case 40: // down arrow
case 37: // left arrow
case 39: // right arrow
case 33: // page up
case 34: // page down
case 36: // home
case 35: // end
case 13: // enter
case 9: // tab
case 27: // esc
case 16: // shift
case 17: // ctrl
case 18: // alt
case 20: // caps lock
case 8: // backspace
case 46: // delete
return true;
break;
 
default:
var c = String.fromCharCode(
(event.charCode == undefined) ? event.keyCode : event.charCode
);
replaceSelection(textbox, c);
sMatch = autocompleteMatch(textbox.value, values);
var len = textbox.value.length;
if (sMatch != null) {
textbox.value = sMatch;
setSelectionRange(textbox, len, textbox.value.length);
}
return false;
}
}
else {
return true;
}
}
/* end javascript for autocomplete */
 
EOS;
define('HTML_QUICKFORM_AUTOCOMPLETE_EXISTS', true);
}
$jsEscape = array(
"\r" => '\r',
"\n" => '\n',
"\t" => '\t',
"'" => "\\'",
'"' => '\"',
'\\' => '\\\\'
);
 
$js .= $this->_js;
$js .= 'var ' . $arrayName . " = new Array();\n";
for ($i = 0; $i < count($this->_options); $i++) {
$js .= $arrayName . '[' . $i . "] = '" . strtr($this->_options[$i], $jsEscape) . "';\n";
}
$js .= "//]]>\n</script>";
}
return $js . parent::toHtml();
}// end func toHtml
 
// }}}
} // end class HTML_QuickForm_autocomplete
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/password.php
New file
0,0 → 1,108
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Adam Daniel <adaniel1@eesus.jnj.com> |
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: password.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once("HTML/QuickForm/input.php");
 
/**
* HTML class for a password type field
*
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version 1.1
* @since PHP4.04pl1
* @access public
*/
class HTML_QuickForm_password extends HTML_QuickForm_input
{
// {{{ constructor
 
/**
* Class constructor
*
* @param string $elementName (optional)Input field name attribute
* @param string $elementLabel (optional)Input field label
* @param mixed $attributes (optional)Either a typical HTML attribute string
* or an associative array
* @since 1.0
* @access public
* @return void
* @throws
*/
function HTML_QuickForm_password($elementName=null, $elementLabel=null, $attributes=null)
{
HTML_QuickForm_input::HTML_QuickForm_input($elementName, $elementLabel, $attributes);
$this->setType('password');
} //end constructor
// }}}
// {{{ setSize()
 
/**
* Sets size of password element
*
* @param string $size Size of password field
* @since 1.0
* @access public
* @return void
*/
function setSize($size)
{
$this->updateAttributes(array('size'=>$size));
} //end func setSize
 
// }}}
// {{{ setMaxlength()
 
/**
* Sets maxlength of password element
*
* @param string $maxlength Maximum length of password field
* @since 1.0
* @access public
* @return void
*/
function setMaxlength($maxlength)
{
$this->updateAttributes(array('maxlength'=>$maxlength));
} //end func setMaxlength
// }}}
// {{{ getFrozenHtml()
 
/**
* Returns the value of field without HTML tags (in this case, value is changed to a mask)
*
* @since 1.0
* @access public
* @return string
* @throws
*/
function getFrozenHtml()
{
$value = $this->getValue();
return ('' != $value? '**********': '&nbsp;') .
$this->_getPersistantData();
} //end func getFrozenHtml
 
// }}}
 
} //end class HTML_QuickForm_password
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/submit.php
New file
0,0 → 1,82
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Adam Daniel <adaniel1@eesus.jnj.com> |
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: submit.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once("HTML/QuickForm/input.php");
 
/**
* HTML class for a submit type element
*
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version 1.0
* @since PHP4.04pl1
* @access public
*/
class HTML_QuickForm_submit extends HTML_QuickForm_input
{
// {{{ constructor
 
/**
* Class constructor
*
* @param string Input field name attribute
* @param string Input field value
* @param mixed Either a typical HTML attribute string or an associative array
* @since 1.0
* @access public
* @return void
*/
function HTML_QuickForm_submit($elementName=null, $value=null, $attributes=null)
{
HTML_QuickForm_input::HTML_QuickForm_input($elementName, null, $attributes);
$this->setValue($value);
$this->setType('submit');
} //end constructor
// }}}
// {{{ freeze()
 
/**
* Freeze the element so that only its value is returned
*
* @access public
* @return void
*/
function freeze()
{
return false;
} //end func freeze
 
// }}}
// {{{ exportValue()
 
/**
* Only return the value if it is found within $submitValues (i.e. if
* this particular submit button was clicked)
*/
function exportValue(&$submitValues, $assoc = false)
{
return $this->_prepareValue($this->_findValue($submitValues), $assoc);
}
 
// }}}
} //end class HTML_QuickForm_submit
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/xbutton.php
New file
0,0 → 1,145
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Alexey Borzov <avb@php.net> |
// +----------------------------------------------------------------------+
//
// $Id: xbutton.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once 'HTML/QuickForm/element.php';
 
/**
* Class for HTML 4.0 <button> element
*
* @author Alexey Borzov <avb@php.net>
* @since 3.2.3
* @access public
*/
class HTML_QuickForm_xbutton extends HTML_QuickForm_element
{
/**
* Contents of the <button> tag
* @var string
* @access private
*/
var $_content;
 
/**
* Class constructor
*
* @param string Button name
* @param string Button content (HTML to add between <button></button> tags)
* @param mixed Either a typical HTML attribute string or an associative array
* @access public
*/
function HTML_QuickForm_xbutton($elementName = null, $elementContent = null, $attributes = null)
{
$this->HTML_QuickForm_element($elementName, null, $attributes);
$this->setContent($elementContent);
$this->setPersistantFreeze(false);
$this->_type = 'xbutton';
}
 
 
function toHtml()
{
return '<button' . $this->getAttributes(true) . '>' . $this->_content . '</button>';
}
 
 
function getFrozenHtml()
{
return $this->toHtml();
}
 
 
function freeze()
{
return false;
}
 
 
function setName($name)
{
$this->updateAttributes(array(
'name' => $name
));
}
 
 
function getName()
{
return $this->getAttribute('name');
}
 
 
function setValue($value)
{
$this->updateAttributes(array(
'value' => $value
));
}
 
 
function getValue()
{
return $this->getAttribute('value');
}
 
 
/**
* Sets the contents of the button element
*
* @param string Button content (HTML to add between <button></button> tags)
*/
function setContent($content)
{
$this->_content = $content;
}
 
 
function onQuickFormEvent($event, $arg, &$caller)
{
if ('updateValue' != $event) {
return parent::onQuickFormEvent($event, $arg, $caller);
} else {
$value = $this->_findValue($caller->_constantValues);
if (null === $value) {
$value = $this->_findValue($caller->_defaultValues);
}
if (null !== $value) {
$this->setValue($value);
}
}
return true;
}
 
 
/**
* Returns a 'safe' element's value
*
* The value is only returned if the button's type is "submit" and if this
* particlular button was clicked
*/
function exportValue(&$submitValues, $assoc = false)
{
if ('submit' == $this->getAttribute('type')) {
return $this->_prepareValue($this->_findValue($submitValues), $assoc);
} else {
return null;
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/html.php
New file
0,0 → 1,67
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Alexey Borzov <borz_off@cs.msu.su> |
// +----------------------------------------------------------------------+
//
// $Id: html.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once 'HTML/QuickForm/static.php';
 
/**
* A pseudo-element used for adding raw HTML to form
*
* Intended for use with the default renderer only, template-based
* ones may (and probably will) completely ignore this
*
* @author Alexey Borzov <borz_off@cs.msu.su>
* @access public
*/
class HTML_QuickForm_html extends HTML_QuickForm_static
{
// {{{ constructor
 
/**
* Class constructor
*
* @param string $text raw HTML to add
* @access public
* @return void
*/
function HTML_QuickForm_html($text = null)
{
$this->HTML_QuickForm_static(null, null, $text);
$this->_type = 'html';
}
 
// }}}
// {{{ accept()
 
/**
* Accepts a renderer
*
* @param object An HTML_QuickForm_Renderer object
* @access public
* @return void
*/
function accept(&$renderer)
{
$renderer->renderHtml($this);
} // end func accept
 
// }}}
 
} //end class HTML_QuickForm_header
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/Renderer.php
New file
0,0 → 1,150
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Alexey Borzov <borz_off@cs.msu.su> |
// +----------------------------------------------------------------------+
//
// $Id: Renderer.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
/**
* An abstract base class for QuickForm renderers
*
* The class implements a Visitor design pattern
*
* @abstract
* @author Alexey Borzov <borz_off@cs.msu.su>
*/
class HTML_QuickForm_Renderer
{
/**
* Constructor
*
* @access public
*/
function HTML_QuickForm_Renderer()
{
} // end constructor
 
/**
* Called when visiting a form, before processing any form elements
*
* @param object An HTML_QuickForm object being visited
* @access public
* @return void
* @abstract
*/
function startForm(&$form)
{
return;
} // end func startForm
 
/**
* Called when visiting a form, after processing all form elements
*
* @param object An HTML_QuickForm object being visited
* @access public
* @return void
* @abstract
*/
function finishForm(&$form)
{
return;
} // end func finishForm
 
/**
* Called when visiting a header element
*
* @param object An HTML_QuickForm_header element being visited
* @access public
* @return void
* @abstract
*/
function renderHeader(&$header)
{
return;
} // end func renderHeader
 
/**
* Called when visiting an element
*
* @param object An HTML_QuickForm_element object being visited
* @param bool Whether an element is required
* @param string An error message associated with an element
* @access public
* @return void
* @abstract
*/
function renderElement(&$element, $required, $error)
{
return;
} // end func renderElement
 
/**
* Called when visiting a hidden element
*
* @param object An HTML_QuickForm_hidden object being visited
* @access public
* @return void
* @abstract
*/
function renderHidden(&$element)
{
return;
} // end func renderHidden
 
/**
* Called when visiting a raw HTML/text pseudo-element
*
* Seems that this should not be used when using a template-based renderer
*
* @param object An HTML_QuickForm_html element being visited
* @access public
* @return void
* @abstract
*/
function renderHtml(&$data)
{
return;
} // end func renderHtml
 
/**
* Called when visiting a group, before processing any group elements
*
* @param object An HTML_QuickForm_group object being visited
* @param bool Whether a group is required
* @param string An error message associated with a group
* @access public
* @return void
* @abstract
*/
function startGroup(&$group, $required, $error)
{
return;
} // end func startGroup
 
/**
* Called when visiting a group, after processing all group elements
*
* @param object An HTML_QuickForm_group object being visited
* @access public
* @return void
* @abstract
*/
function finishGroup(&$group)
{
return;
} // end func finishGroup
} // end class HTML_QuickForm_Renderer
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/Rule.php
New file
0,0 → 1,67
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: Rule.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
class HTML_QuickForm_Rule
{
/**
* Name of the rule to use in validate method
*
* This property is used in more global rules like Callback and Regex
* to determine which callback and which regex is to be used for validation
*
* @var string
* @access public
*/
var $name;
 
/**
* Validates a value
*
* @access public
* @abstract
*/
function validate($value)
{
return true;
}
 
/**
* Sets the rule name
*
* @access public
*/
function setName($ruleName)
{
$this->name = $ruleName;
}
 
/**
* Returns the javascript test (the test should return true if the value is INVALID)
*
* @param mixed Options for the rule
* @access public
* @return array first element is code to setup validation, second is the check itself
*/
function getValidationScript($options = null)
{
return array('', '');
}
}
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/button.php
New file
0,0 → 1,73
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Adam Daniel <adaniel1@eesus.jnj.com> |
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: button.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once("HTML/QuickForm/input.php");
 
/**
* HTML class for a button type element
*
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version 1.1
* @since PHP4.04pl1
* @access public
*/
class HTML_QuickForm_button extends HTML_QuickForm_input
{
// {{{ constructor
 
/**
* Class constructor
*
* @param string $elementName (optional)Input field name attribute
* @param string $value (optional)Input field value
* @param mixed $attributes (optional)Either a typical HTML attribute string
* or an associative array
* @since 1.0
* @access public
* @return void
*/
function HTML_QuickForm_button($elementName=null, $value=null, $attributes=null)
{
HTML_QuickForm_input::HTML_QuickForm_input($elementName, null, $attributes);
$this->_persistantFreeze = false;
$this->setValue($value);
$this->setType('button');
} //end constructor
// }}}
// {{{ freeze()
 
/**
* Freeze the element so that only its value is returned
*
* @access public
* @return void
*/
function freeze()
{
return false;
} //end func freeze
 
// }}}
} //end class HTML_QuickForm_button
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/date.php
New file
0,0 → 1,484
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Alexey Borzov <avb@php.net> |
// | Adam Daniel <adaniel1@eesus.jnj.com> |
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: date.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once 'HTML/QuickForm/group.php';
require_once 'HTML/QuickForm/select.php';
 
/**
* Class for a group of elements used to input dates (and times).
*
* Inspired by original 'date' element but reimplemented as a subclass
* of HTML_QuickForm_group
*
* @author Alexey Borzov <avb@php.net>
* @access public
*/
class HTML_QuickForm_date extends HTML_QuickForm_group
{
// {{{ properties
 
/**
* Various options to control the element's display.
*
* Currently known options are
* 'language': date language
* 'format': Format of the date, based on PHP's date() function.
* The following characters are recognised in format string:
* D => Short names of days
* l => Long names of days
* d => Day numbers
* M => Short names of months
* F => Long names of months
* m => Month numbers
* Y => Four digit year
* y => Two digit year
* h => 12 hour format
* H => 23 hour format
* i => Minutes
* s => Seconds
* a => am/pm
* A => AM/PM
* 'minYear': Minimum year in year select
* 'maxYear': Maximum year in year select
* 'addEmptyOption': Should an empty option be added to the top of
* each select box?
* 'emptyOptionValue': The value passed by the empty option.
* 'emptyOptionText': The text displayed for the empty option.
* 'optionIncrement': Step to increase the option values by (works for 'i' and 's')
*
* @access private
* @var array
*/
var $_options = array(
'language' => 'en',
'format' => 'dMY',
'minYear' => 2001,
'maxYear' => 2010,
'addEmptyOption' => false,
'emptyOptionValue' => '',
'emptyOptionText' => '&nbsp;',
'optionIncrement' => array('i' => 1, 's' => 1)
);
 
/**
* These complement separators, they are appended to the resultant HTML
* @access private
* @var array
*/
var $_wrap = array('', '');
 
/**
* Options in different languages
*
* Note to potential translators: to avoid encoding problems please send
* your translations with "weird" letters encoded as HTML Unicode entities
*
* @access private
* @var array
*/
var $_locale = array(
'en' => array (
'weekdays_short'=> array ('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'),
'weekdays_long' => array ('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'),
'months_short' => array ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'),
'months_long' => array ('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December')
),
'de' => array (
'weekdays_short'=> array ('So', 'Mon', 'Di', 'Mi', 'Do', 'Fr', 'Sa'),
'weekdays_long' => array ('Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'),
'months_short' => array ('Jan', 'Feb', 'M&#xe4;rz', 'April', 'Mai', 'Juni', 'Juli', 'Aug', 'Sept', 'Okt', 'Nov', 'Dez'),
'months_long' => array ('Januar', 'Februar', 'M&#xe4;rz', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember')
),
'fr' => array (
'weekdays_short'=> array ('Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'),
'weekdays_long' => array ('Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi'),
'months_short' => array ('Jan', 'F&#xe9;v', 'Mar', 'Avr', 'Mai', 'Juin', 'Juil', 'Ao&#xfb;t', 'Sep', 'Oct', 'Nov', 'D&#xe9;c'),
'months_long' => array ('Janvier', 'F&#xe9;vrier', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Ao&#xfb;t', 'Septembre', 'Octobre', 'Novembre', 'D&#xe9;cembre')
),
'hu' => array (
'weekdays_short'=> array ('V', 'H', 'K', 'Sze', 'Cs', 'P', 'Szo'),
'weekdays_long' => array ('vas&#xe1;rnap', 'h&#xe9;tf&#x151;', 'kedd', 'szerda', 'cs&#xfc;t&#xf6;rt&#xf6;k', 'p&#xe9;ntek', 'szombat'),
'months_short' => array ('jan', 'feb', 'm&#xe1;rc', '&#xe1;pr', 'm&#xe1;j', 'j&#xfa;n', 'j&#xfa;l', 'aug', 'szept', 'okt', 'nov', 'dec'),
'months_long' => array ('janu&#xe1;r', 'febru&#xe1;r', 'm&#xe1;rcius', '&#xe1;prilis', 'm&#xe1;jus', 'j&#xfa;nius', 'j&#xfa;lius', 'augusztus', 'szeptember', 'okt&#xf3;ber', 'november', 'december')
),
'pl' => array (
'weekdays_short'=> array ('Nie', 'Pn', 'Wt', '&#x15a;r', 'Czw', 'Pt', 'Sob'),
'weekdays_long' => array ('Niedziela', 'Poniedzia&#x142;ek', 'Wtorek', '&#x15a;roda', 'Czwartek', 'Pi&#x105;tek', 'Sobota'),
'months_short' => array ('Sty', 'Lut', 'Mar', 'Kwi', 'Maj', 'Cze', 'Lip', 'Sie', 'Wrz', 'Pa&#x17a;', 'Lis', 'Gru'),
'months_long' => array ('Stycze&#x144;', 'Luty', 'Marzec', 'Kwiecie&#x144;', 'Maj', 'Czerwiec', 'Lipiec', 'Sierpie&#x144;', 'Wrzesie&#x144;', 'Pa&#x17a;dziernik', 'Listopad', 'Grudzie&#x144;')
),
'sl' => array (
'weekdays_short'=> array ('Ned', 'Pon', 'Tor', 'Sre', 'Cet', 'Pet', 'Sob'),
'weekdays_long' => array ('Nedelja', 'Ponedeljek', 'Torek', 'Sreda', 'Cetrtek', 'Petek', 'Sobota'),
'months_short' => array ('Jan', 'Feb', 'Mar', 'Apr', 'Maj', 'Jun', 'Jul', 'Avg', 'Sep', 'Okt', 'Nov', 'Dec'),
'months_long' => array ('Januar', 'Februar', 'Marec', 'April', 'Maj', 'Junij', 'Julij', 'Avgust', 'September', 'Oktober', 'November', 'December')
),
'ru' => array (
'weekdays_short'=> array ('&#x412;&#x441;', '&#x41f;&#x43d;', '&#x412;&#x442;', '&#x421;&#x440;', '&#x427;&#x442;', '&#x41f;&#x442;', '&#x421;&#x431;'),
'weekdays_long' => array ('&#x412;&#x43e;&#x441;&#x43a;&#x440;&#x435;&#x441;&#x435;&#x43d;&#x44c;&#x435;', '&#x41f;&#x43e;&#x43d;&#x435;&#x434;&#x435;&#x43b;&#x44c;&#x43d;&#x438;&#x43a;', '&#x412;&#x442;&#x43e;&#x440;&#x43d;&#x438;&#x43a;', '&#x421;&#x440;&#x435;&#x434;&#x430;', '&#x427;&#x435;&#x442;&#x432;&#x435;&#x440;&#x433;', '&#x41f;&#x44f;&#x442;&#x43d;&#x438;&#x446;&#x430;', '&#x421;&#x443;&#x431;&#x431;&#x43e;&#x442;&#x430;'),
'months_short' => array ('&#x42f;&#x43d;&#x432;', '&#x424;&#x435;&#x432;', '&#x41c;&#x430;&#x440;', '&#x410;&#x43f;&#x440;', '&#x41c;&#x430;&#x439;', '&#x418;&#x44e;&#x43d;', '&#x418;&#x44e;&#x43b;', '&#x410;&#x432;&#x433;', '&#x421;&#x435;&#x43d;', '&#x41e;&#x43a;&#x442;', '&#x41d;&#x43e;&#x44f;', '&#x414;&#x435;&#x43a;'),
'months_long' => array ('&#x42f;&#x43d;&#x432;&#x430;&#x440;&#x44c;', '&#x424;&#x435;&#x432;&#x440;&#x430;&#x43b;&#x44c;', '&#x41c;&#x430;&#x440;&#x442;', '&#x410;&#x43f;&#x440;&#x435;&#x43b;&#x44c;', '&#x41c;&#x430;&#x439;', '&#x418;&#x44e;&#x43d;&#x44c;', '&#x418;&#x44e;&#x43b;&#x44c;', '&#x410;&#x432;&#x433;&#x443;&#x441;&#x442;', '&#x421;&#x435;&#x43d;&#x442;&#x44f;&#x431;&#x440;&#x44c;', '&#x41e;&#x43a;&#x442;&#x44f;&#x431;&#x440;&#x44c;', '&#x41d;&#x43e;&#x44f;&#x431;&#x440;&#x44c;', '&#x414;&#x435;&#x43a;&#x430;&#x431;&#x440;&#x44c;')
),
'es' => array (
'weekdays_short'=> array ('Dom', 'Lun', 'Mar', 'Mi&#xe9;', 'Jue', 'Vie', 'S&#xe1;b'),
'weekdays_long' => array ('Domingo', 'Lunes', 'Martes', 'Mi&#xe9;rcoles', 'Jueves', 'Viernes', 'S&#xe1;bado'),
'months_short' => array ('Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'),
'months_long' => array ('Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre')
),
'da' => array (
'weekdays_short'=> array ('S&#xf8;n', 'Man', 'Tir', 'Ons', 'Tor', 'Fre', 'L&#xf8;r'),
'weekdays_long' => array ('S&#xf8;ndag', 'Mandag', 'Tirsdag', 'Onsdag', 'Torsdag', 'Fredag', 'L&#xf8;rdag'),
'months_short' => array ('Jan', 'Feb', 'Mar', 'Apr', 'Maj', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec'),
'months_long' => array ('Januar', 'Februar', 'Marts', 'April', 'Maj', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'December')
),
'is' => array (
'weekdays_short'=> array ('Sun', 'M&#xe1;n', '&#xde;ri', 'Mi&#xf0;', 'Fim', 'F&#xf6;s', 'Lau'),
'weekdays_long' => array ('Sunnudagur', 'M&#xe1;nudagur', '&#xde;ri&#xf0;judagur', 'Mi&#xf0;vikudagur', 'Fimmtudagur', 'F&#xf6;studagur', 'Laugardagur'),
'months_short' => array ('Jan', 'Feb', 'Mar', 'Apr', 'Ma&#xed;', 'J&#xfa;n', 'J&#xfa;l', '&#xc1;g&#xfa;', 'Sep', 'Okt', 'N&#xf3;v', 'Des'),
'months_long' => array ('Jan&#xfa;ar', 'Febr&#xfa;ar', 'Mars', 'Apr&#xed;l', 'Ma&#xed;', 'J&#xfa;n&#xed;', 'J&#xfa;l&#xed;', '&#xc1;g&#xfa;st', 'September', 'Okt&#xf3;ber', 'N&#xf3;vember', 'Desember')
),
'it' => array (
'weekdays_short'=> array ('Dom', 'Lun', 'Mar', 'Mer', 'Gio', 'Ven', 'Sab'),
'weekdays_long' => array ('Domenica', 'Luned&#xec;', 'Marted&#xec;', 'Mercoled&#xec;', 'Gioved&#xec;', 'Venerd&#xec;', 'Sabato'),
'months_short' => array ('Gen', 'Feb', 'Mar', 'Apr', 'Mag', 'Giu', 'Lug', 'Ago', 'Set', 'Ott', 'Nov', 'Dic'),
'months_long' => array ('Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre')
),
'sk' => array (
'weekdays_short'=> array ('Ned', 'Pon', 'Uto', 'Str', '&#x8a;tv', 'Pia', 'Sob'),
'weekdays_long' => array ('Nede&#x17e;a', 'Pondelok', 'Utorok', 'Streda', '&#x8a;tvrtok', 'Piatok', 'Sobota'),
'months_short' => array ('Jan', 'Feb', 'Mar', 'Apr', 'M&#xe1;j', 'J&#xfa;n', 'J&#xfa;l', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec'),
'months_long' => array ('Janu&#xe1;r', 'Febru&#xe1;r', 'Marec', 'Apr&#xed;l', 'M&#xe1;j', 'J&#xfa;n', 'J&#xfa;l', 'August', 'September', 'Okt&#xf3;ber', 'November', 'December')
),
'cs' => array (
'weekdays_short'=> array ('Ne', 'Po', '&#xda;t', 'St', '&#x10c;t', 'P&#xe1;', 'So'),
'weekdays_long' => array ('Ned&#x11b;le', 'Pond&#x11b;l&#xed;', '&#xda;ter&#xfd;', 'St&#x159;eda', '&#x10c;tvrtek', 'P&#xe1;tek', 'Sobota'),
'months_short' => array ('Led', '&#xda;no', 'B&#x159;e', 'Dub', 'Kv&#x11b;', '&#x10c;en', '&#x10c;ec', 'Srp', 'Z&#xe1;&#x159;', '&#x158;&#xed;j', 'Lis', 'Pro'),
'months_long' => array ('Leden', '&#xda;nor', 'B&#x159;ezen', 'Duben', 'Kv&#x11b;ten', '&#x10c;erven', '&#x10c;ervenec', 'Srpen', 'Z&#xe1;&#x159;&#xed;', '&#x158;&#xed;jen', 'Listopad', 'Prosinec')
),
'hy' => array (
'weekdays_short'=> array ('&#x53f;&#x580;&#x56f;', '&#x535;&#x580;&#x56f;', '&#x535;&#x580;&#x584;', '&#x549;&#x580;&#x584;', '&#x540;&#x576;&#x563;', '&#x548;&#x582;&#x580;', '&#x547;&#x562;&#x569;'),
'weekdays_long' => array ('&#x53f;&#x56b;&#x580;&#x561;&#x56f;&#x56b;', '&#x535;&#x580;&#x56f;&#x578;&#x582;&#x577;&#x561;&#x562;&#x569;&#x56b;', '&#x535;&#x580;&#x565;&#x584;&#x577;&#x561;&#x562;&#x569;&#x56b;', '&#x549;&#x578;&#x580;&#x565;&#x584;&#x577;&#x561;&#x562;&#x569;&#x56b;', '&#x540;&#x56b;&#x576;&#x563;&#x577;&#x561;&#x562;&#x569;&#x56b;', '&#x548;&#x582;&#x580;&#x562;&#x561;&#x569;', '&#x547;&#x561;&#x562;&#x561;&#x569;'),
'months_short' => array ('&#x540;&#x576;&#x57e;', '&#x553;&#x57f;&#x580;', '&#x544;&#x580;&#x57f;', '&#x531;&#x57a;&#x580;', '&#x544;&#x575;&#x57d;', '&#x540;&#x576;&#x57d;', '&#x540;&#x56c;&#x57d;', '&#x555;&#x563;&#x57d;', '&#x54d;&#x57a;&#x57f;', '&#x540;&#x56f;&#x57f;', '&#x546;&#x575;&#x574;', '&#x534;&#x56f;&#x57f;'),
'months_long' => array ('&#x540;&#x578;&#x582;&#x576;&#x57e;&#x561;&#x580;', '&#x553;&#x565;&#x57f;&#x580;&#x57e;&#x561;&#x580;', '&#x544;&#x561;&#x580;&#x57f;', '&#x531;&#x57a;&#x580;&#x56b;&#x56c;', '&#x544;&#x561;&#x575;&#x56b;&#x57d;', '&#x540;&#x578;&#x582;&#x576;&#x56b;&#x57d;', '&#x540;&#x578;&#x582;&#x56c;&#x56b;&#x57d;', '&#x555;&#x563;&#x578;&#x57d;&#x57f;&#x578;&#x57d;', '&#x54d;&#x565;&#x57a;&#x57f;&#x565;&#x574;&#x562;&#x565;&#x580;', '&#x540;&#x578;&#x56f;&#x57f;&#x565;&#x574;&#x562;&#x565;&#x580;', '&#x546;&#x578;&#x575;&#x565;&#x574;&#x562;&#x565;&#x580;', '&#x534;&#x565;&#x56f;&#x57f;&#x565;&#x574;&#x562;&#x565;&#x580;')
),
'nl' => array (
'weekdays_short'=> array ('Zo', 'Ma', 'Di', 'Wo', 'Do', 'Vr', 'Za'),
'weekdays_long' => array ('Zondag', 'Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrijdag', 'Zaterdag'),
'months_short' => array ('Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec'),
'months_long' => array ('Januari', 'Februari', 'Maart', 'April', 'Mei', 'Juni', 'Juli', 'Augustus', 'September', 'Oktober', 'November', 'December')
),
'et' => array (
'weekdays_short'=> array ('P', 'E', 'T', 'K', 'N', 'R', 'L'),
'weekdays_long' => array ('P&#xfc;hap&#xe4;ev', 'Esmasp&#xe4;ev', 'Teisip&#xe4;ev', 'Kolmap&#xe4;ev', 'Neljap&#xe4;ev', 'Reede', 'Laup&#xe4;ev'),
'months_short' => array ('Jaan', 'Veebr', 'M&#xe4;rts', 'Aprill', 'Mai', 'Juuni', 'Juuli', 'Aug', 'Sept', 'Okt', 'Nov', 'Dets'),
'months_long' => array ('Jaanuar', 'Veebruar', 'M&#xe4;rts', 'Aprill', 'Mai', 'Juuni', 'Juuli', 'August', 'September', 'Oktoober', 'November', 'Detsember')
),
'tr' => array (
'weekdays_short'=> array ('Paz', 'Pzt', 'Sal', '&#xc7;ar', 'Per', 'Cum', 'Cts'),
'weekdays_long' => array ('Pazar', 'Pazartesi', 'Sal&#x131;', '&#xc7;ar&#x15f;amba', 'Per&#x15f;embe', 'Cuma', 'Cumartesi'),
'months_short' => array ('Ock', '&#x15e;bt', 'Mrt', 'Nsn', 'Mys', 'Hzrn', 'Tmmz', 'A&#x11f;st', 'Eyl', 'Ekm', 'Ksm', 'Arlk'),
'months_long' => array ('Ocak', '&#x15e;ubat', 'Mart', 'Nisan', 'May&#x131;s', 'Haziran', 'Temmuz', 'A&#x11f;ustos', 'Eyl&#xfc;l', 'Ekim', 'Kas&#x131;m', 'Aral&#x131;k')
),
'no' => array (
'weekdays_short'=> array ('S&#xf8;n', 'Man', 'Tir', 'Ons', 'Tor', 'Fre', 'L&#xf8;r'),
'weekdays_long' => array ('S&#xf8;ndag', 'Mandag', 'Tirsdag', 'Onsdag', 'Torsdag', 'Fredag', 'L&#xf8;rdag'),
'months_short' => array ('Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Des'),
'months_long' => array ('Januar', 'Februar', 'Mars', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Desember')
),
'eo' => array (
'weekdays_short'=> array ('Dim', 'Lun', 'Mar', 'Mer', '&#x134;a&#x16D;', 'Ven', 'Sab'),
'weekdays_long' => array ('Diman&#x109;o', 'Lundo', 'Mardo', 'Merkredo', '&#x134;a&#x16D;do', 'Vendredo', 'Sabato'),
'months_short' => array ('Jan', 'Feb', 'Mar', 'Apr', 'Maj', 'Jun', 'Jul', 'A&#x16D;g', 'Sep', 'Okt', 'Nov', 'Dec'),
'months_long' => array ('Januaro', 'Februaro', 'Marto', 'Aprilo', 'Majo', 'Junio', 'Julio', 'A&#x16D;gusto', 'Septembro', 'Oktobro', 'Novembro', 'Decembro')
),
'ua' => array (
'weekdays_short'=> array('&#x41d;&#x434;&#x43b;', '&#x41f;&#x43d;&#x434;', '&#x412;&#x442;&#x440;', '&#x421;&#x440;&#x434;', '&#x427;&#x442;&#x432;', '&#x41f;&#x442;&#x43d;', '&#x421;&#x431;&#x442;'),
'weekdays_long' => array('&#x41d;&#x435;&#x434;&#x456;&#x43b;&#x44f;', '&#x41f;&#x43e;&#x43d;&#x435;&#x434;&#x456;&#x43b;&#x43e;&#x43a;', '&#x412;&#x456;&#x432;&#x442;&#x43e;&#x440;&#x43e;&#x43a;', '&#x421;&#x435;&#x440;&#x435;&#x434;&#x430;', '&#x427;&#x435;&#x442;&#x432;&#x435;&#x440;', '&#x41f;\'&#x44f;&#x442;&#x43d;&#x438;&#x446;&#x44f;', '&#x421;&#x443;&#x431;&#x43e;&#x442;&#x430;'),
'months_short' => array('&#x421;&#x456;&#x447;', '&#x41b;&#x44e;&#x442;', '&#x411;&#x435;&#x440;', '&#x41a;&#x432;&#x456;', '&#x422;&#x440;&#x430;', '&#x427;&#x435;&#x440;', '&#x41b;&#x438;&#x43f;', '&#x421;&#x435;&#x440;', '&#x412;&#x435;&#x440;', '&#x416;&#x43e;&#x432;', '&#x41b;&#x438;&#x441;', '&#x413;&#x440;&#x443;'),
'months_long' => array('&#x421;&#x456;&#x447;&#x435;&#x43d;&#x44c;', '&#x41b;&#x44e;&#x442;&#x438;&#x439;', '&#x411;&#x435;&#x440;&#x435;&#x437;&#x435;&#x43d;&#x44c;', '&#x41a;&#x432;&#x456;&#x442;&#x435;&#x43d;&#x44c;', '&#x422;&#x440;&#x430;&#x432;&#x435;&#x43d;&#x44c;', '&#x427;&#x435;&#x440;&#x432;&#x435;&#x43d;&#x44c;', '&#x41b;&#x438;&#x43f;&#x435;&#x43d;&#x44c;', '&#x421;&#x435;&#x440;&#x43f;&#x435;&#x43d;&#x44c;', '&#x412;&#x435;&#x440;&#x435;&#x441;&#x435;&#x43d;&#x44c;', '&#x416;&#x43e;&#x432;&#x442;&#x435;&#x43d;&#x44c;', '&#x41b;&#x438;&#x441;&#x442;&#x43e;&#x43f;&#x430;&#x434;', '&#x413;&#x440;&#x443;&#x434;&#x435;&#x43d;&#x44c;')
),
'ro' => array (
'weekdays_short'=> array ('Dum', 'Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sam'),
'weekdays_long' => array ('Duminica', 'Luni', 'Marti', 'Miercuri', 'Joi', 'Vineri', 'Sambata'),
'months_short' => array ('Ian', 'Feb', 'Mar', 'Apr', 'Mai', 'Iun', 'Iul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'),
'months_long' => array ('Ianuarie', 'Februarie', 'Martie', 'Aprilie', 'Mai', 'Iunie', 'Iulie', 'August', 'Septembrie', 'Octombrie', 'Noiembrie', 'Decembrie')
),
'he' => array (
'weekdays_short'=> array ('&#1512;&#1488;&#1513;&#1493;&#1503;', '&#1513;&#1504;&#1497;', '&#1513;&#1500;&#1497;&#1513;&#1497;', '&#1512;&#1489;&#1497;&#1506;&#1497;', '&#1495;&#1502;&#1497;&#1513;&#1497;', '&#1513;&#1497;&#1513;&#1497;', '&#1513;&#1489;&#1514;'),
'weekdays_long' => array ('&#1497;&#1493;&#1501; &#1512;&#1488;&#1513;&#1493;&#1503;', '&#1497;&#1493;&#1501; &#1513;&#1504;&#1497;', '&#1497;&#1493;&#1501; &#1513;&#1500;&#1497;&#1513;&#1497;', '&#1497;&#1493;&#1501; &#1512;&#1489;&#1497;&#1506;&#1497;', '&#1497;&#1493;&#1501; &#1495;&#1502;&#1497;&#1513;&#1497;', '&#1497;&#1493;&#1501; &#1513;&#1497;&#1513;&#1497;', '&#1513;&#1489;&#1514;'),
'months_short' => array ('&#1497;&#1504;&#1493;&#1488;&#1512;', '&#1508;&#1489;&#1512;&#1493;&#1488;&#1512;', '&#1502;&#1512;&#1509;', '&#1488;&#1508;&#1512;&#1497;&#1500;', '&#1502;&#1488;&#1497;', '&#1497;&#1493;&#1504;&#1497;', '&#1497;&#1493;&#1500;&#1497;', '&#1488;&#1493;&#1490;&#1493;&#1505;&#1496;', '&#1505;&#1508;&#1496;&#1502;&#1489;&#1512;', '&#1488;&#1493;&#1511;&#1496;&#1493;&#1489;&#1512;', '&#1504;&#1493;&#1489;&#1502;&#1489;&#1512;', '&#1491;&#1510;&#1502;&#1489;&#1512;'),
'months_long' => array ('&#1497;&#1504;&#1493;&#1488;&#1512;', '&#1508;&#1489;&#1512;&#1493;&#1488;&#1512;', '&#1502;&#1512;&#1509;', '&#1488;&#1508;&#1512;&#1497;&#1500;', '&#1502;&#1488;&#1497;', '&#1497;&#1493;&#1504;&#1497;', '&#1497;&#1493;&#1500;&#1497;', '&#1488;&#1493;&#1490;&#1493;&#1505;&#1496;', '&#1505;&#1508;&#1496;&#1502;&#1489;&#1512;', '&#1488;&#1493;&#1511;&#1496;&#1493;&#1489;&#1512;', '&#1504;&#1493;&#1489;&#1502;&#1489;&#1512;', '&#1491;&#1510;&#1502;&#1489;&#1512;')
),
'sv' => array (
'weekdays_short'=> array ('S&#xf6;n', 'M&#xe5;n', 'Tis', 'Ons', 'Tor', 'Fre', 'L&#xf6;r'),
'weekdays_long' => array ('S&#xf6;ndag', 'M&#xe5;ndag', 'Tisdag', 'Onsdag', 'Torsdag', 'Fredag', 'L&#xf6;rdag'),
'months_short' => array ('Jan', 'Feb', 'Mar', 'Apr', 'Maj', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec'),
'months_long' => array ('Januari', 'Februari', 'Mars', 'April', 'Maj', 'Juni', 'Juli', 'Augusti', 'September', 'Oktober', 'November', 'December')
),
'pt' => array (
'weekdays_short'=> array ('Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'S&aacute;b'),
'weekdays_long' => array ('Domingo', 'Segunda-feira', 'Ter&ccedil;a-feira', 'Quarta-feira', 'Quinta-feira', 'Sexta-feira', 'S&aacute;bado'),
'months_short' => array ('Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'),
'months_long' => array ('Janeiro', 'Fevereiro', 'Mar&ccedil;o', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro')
)
);
 
// }}}
// {{{ constructor
 
/**
* Class constructor
*
* @access public
* @param string Element's name
* @param mixed Label(s) for an element
* @param array Options to control the element's display
* @param mixed Either a typical HTML attribute string or an associative array
*/
function HTML_QuickForm_date($elementName = null, $elementLabel = null, $options = array(), $attributes = null)
{
$this->HTML_QuickForm_element($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;
$this->_appendName = true;
$this->_type = 'date';
// set the options, do not bother setting bogus ones
if (is_array($options)) {
foreach ($options as $name => $value) {
if ('language' == $name) {
$this->_options['language'] = isset($this->_locale[$value])? $value: 'en';
} elseif (isset($this->_options[$name])) {
if (is_array($value)) {
$this->_options[$name] = @array_merge($this->_options[$name], $value);
} else {
$this->_options[$name] = $value;
}
}
}
}
}
 
// }}}
// {{{ _createElements()
 
function _createElements()
{
$this->_separator = $this->_elements = array();
$separator = '';
$locale =& $this->_locale[$this->_options['language']];
$backslash = false;
for ($i = 0, $length = strlen($this->_options['format']); $i < $length; $i++) {
$sign = $this->_options['format']{$i};
if ($backslash) {
$backslash = false;
$separator .= $sign;
} else {
$loadSelect = true;
switch ($sign) {
case 'D':
// Sunday is 0 like with 'w' in date()
$options = $locale['weekdays_short'];
break;
case 'l':
$options = $locale['weekdays_long'];
break;
case 'd':
$options = $this->_createOptionList(1, 31);
break;
case 'M':
$options = $locale['months_short'];
array_unshift($options , '');
unset($options[0]);
break;
case 'm':
$options = $this->_createOptionList(1, 12);
break;
case 'F':
$options = $locale['months_long'];
array_unshift($options , '');
unset($options[0]);
break;
case 'Y':
$options = $this->_createOptionList(
$this->_options['minYear'],
$this->_options['maxYear'],
$this->_options['minYear'] > $this->_options['maxYear']? -1: 1
);
break;
case 'y':
$options = $this->_createOptionList(
$this->_options['minYear'],
$this->_options['maxYear'],
$this->_options['minYear'] > $this->_options['maxYear']? -1: 1
);
array_walk($options, create_function('&$v,$k','$v = substr($v,-2);'));
break;
case 'h':
$options = $this->_createOptionList(1, 12);
break;
case 'g':
$options = $this->_createOptionList(1, 12);
array_walk($options, create_function('&$v,$k', '$v = intval($v);'));
break;
case 'H':
$options = $this->_createOptionList(0, 23);
break;
case 'i':
$options = $this->_createOptionList(0, 59, $this->_options['optionIncrement']['i']);
break;
case 's':
$options = $this->_createOptionList(0, 59, $this->_options['optionIncrement']['s']);
break;
case 'a':
$options = array('am' => 'am', 'pm' => 'pm');
break;
case 'A':
$options = array('AM' => 'AM', 'PM' => 'PM');
break;
case 'W':
$options = $this->_createOptionList(1, 53);
break;
case '\\':
$backslash = true;
$loadSelect = false;
break;
default:
$separator .= (' ' == $sign? '&nbsp;': $sign);
$loadSelect = false;
}
if ($loadSelect) {
if (0 < count($this->_elements)) {
$this->_separator[] = $separator;
} else {
$this->_wrap[0] = $separator;
}
$separator = '';
// Should we add an empty option to the top of the select?
if (!is_array($this->_options['addEmptyOption']) && $this->_options['addEmptyOption'] ||
is_array($this->_options['addEmptyOption']) && !empty($this->_options['addEmptyOption'][$sign])) {
 
// Using '+' array operator to preserve the keys
if (is_array($this->_options['emptyOptionText']) && !empty($this->_options['emptyOptionText'][$sign])) {
$options = array($this->_options['emptyOptionValue'] => $this->_options['emptyOptionText'][$sign]) + $options;
} else {
$options = array($this->_options['emptyOptionValue'] => $this->_options['emptyOptionText']) + $options;
}
}
$this->_elements[] =& new HTML_QuickForm_select($sign, null, $options, $this->getAttributes());
}
}
}
$this->_wrap[1] = $separator . ($backslash? '\\': '');
}
 
// }}}
// {{{ _createOptionList()
 
/**
* Creates an option list containing the numbers from the start number to the end, inclusive
*
* @param int The start number
* @param int The end number
* @param int Increment by this value
* @access private
* @return array An array of numeric options.
*/
function _createOptionList($start, $end, $step = 1)
{
for ($i = $start, $options = array(); $start > $end? $i >= $end: $i <= $end; $i += $step) {
$options[$i] = sprintf('%02d', $i);
}
return $options;
}
 
// }}}
// {{{ setValue()
 
function setValue($value)
{
if (empty($value)) {
$value = array();
} elseif (is_scalar($value)) {
if (!is_numeric($value)) {
$value = strtotime($value);
}
// might be a unix epoch, then we fill all possible values
$arr = explode('-', date('w-d-n-Y-h-H-i-s-a-A-W', (int)$value));
$value = array(
'D' => $arr[0],
'l' => $arr[0],
'd' => $arr[1],
'M' => $arr[2],
'm' => $arr[2],
'F' => $arr[2],
'Y' => $arr[3],
'y' => $arr[3],
'h' => $arr[4],
'g' => $arr[4],
'H' => $arr[5],
'i' => $arr[6],
's' => $arr[7],
'a' => $arr[8],
'A' => $arr[9],
'W' => $arr[10]
);
}
parent::setValue($value);
}
 
// }}}
// {{{ toHtml()
 
function toHtml()
{
include_once('HTML/QuickForm/Renderer/Default.php');
$renderer =& new HTML_QuickForm_Renderer_Default();
$renderer->setElementTemplate('{element}');
parent::accept($renderer);
return $this->_wrap[0] . $renderer->toHtml() . $this->_wrap[1];
}
 
// }}}
// {{{ accept()
 
function accept(&$renderer, $required = false, $error = null)
{
$renderer->renderElement($this, $required, $error);
}
 
// }}}
// {{{ onQuickFormEvent()
 
function onQuickFormEvent($event, $arg, &$caller)
{
if ('updateValue' == $event) {
// we need to call setValue(), 'cause the default/constant value
// may be in fact a timestamp, not an array
return HTML_QuickForm_element::onQuickFormEvent($event, $arg, $caller);
} else {
return parent::onQuickFormEvent($event, $arg, $caller);
}
}
 
// }}}
}
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/textarea.php
New file
0,0 → 1,222
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Adam Daniel <adaniel1@eesus.jnj.com> |
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: textarea.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once("HTML/QuickForm/element.php");
 
/**
* HTML class for a textarea type field
*
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version 1.0
* @since PHP4.04pl1
* @access public
*/
class HTML_QuickForm_textarea extends HTML_QuickForm_element
{
// {{{ properties
 
/**
* Field value
* @var string
* @since 1.0
* @access private
*/
var $_value = null;
 
// }}}
// {{{ constructor
/**
* Class constructor
*
* @param string Input field name attribute
* @param mixed Label(s) for a field
* @param mixed Either a typical HTML attribute string or an associative array
* @since 1.0
* @access public
* @return void
*/
function HTML_QuickForm_textarea($elementName=null, $elementLabel=null, $attributes=null)
{
HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;
$this->_type = 'textarea';
} //end constructor
// }}}
// {{{ setName()
 
/**
* Sets the input field name
*
* @param string $name Input field name attribute
* @since 1.0
* @access public
* @return void
*/
function setName($name)
{
$this->updateAttributes(array('name'=>$name));
} //end func setName
// }}}
// {{{ getName()
 
/**
* Returns the element name
*
* @since 1.0
* @access public
* @return string
*/
function getName()
{
return $this->getAttribute('name');
} //end func getName
 
// }}}
// {{{ setValue()
 
/**
* Sets value for textarea element
*
* @param string $value Value for textarea element
* @since 1.0
* @access public
* @return void
*/
function setValue($value)
{
$this->_value = $value;
} //end func setValue
// }}}
// {{{ getValue()
 
/**
* Returns the value of the form element
*
* @since 1.0
* @access public
* @return string
*/
function getValue()
{
return $this->_value;
} // end func getValue
 
// }}}
// {{{ setWrap()
 
/**
* Sets wrap type for textarea element
*
* @param string $wrap Wrap type
* @since 1.0
* @access public
* @return void
*/
function setWrap($wrap)
{
$this->updateAttributes(array('wrap' => $wrap));
} //end func setWrap
// }}}
// {{{ setRows()
 
/**
* Sets height in rows for textarea element
*
* @param string $rows Height expressed in rows
* @since 1.0
* @access public
* @return void
*/
function setRows($rows)
{
$this->updateAttributes(array('rows' => $rows));
} //end func setRows
 
// }}}
// {{{ setCols()
 
/**
* Sets width in cols for textarea element
*
* @param string $cols Width expressed in cols
* @since 1.0
* @access public
* @return void
*/
function setCols($cols)
{
$this->updateAttributes(array('cols' => $cols));
} //end func setCols
 
// }}}
// {{{ toHtml()
 
/**
* Returns the textarea element in HTML
*
* @since 1.0
* @access public
* @return string
*/
function toHtml()
{
if ($this->_flagFrozen) {
return $this->getFrozenHtml();
} else {
return $this->_getTabs() .
'<textarea' . $this->_getAttrString($this->_attributes) . '>' .
// because we wrap the form later we don't want the text indented
preg_replace("/(\r\n|\n|\r)/", '&#010;', htmlspecialchars($this->_value)) .
'</textarea>';
}
} //end func toHtml
// }}}
// {{{ getFrozenHtml()
 
/**
* Returns the value of field without HTML tags (in this case, value is changed to a mask)
*
* @since 1.0
* @access public
* @return string
*/
function getFrozenHtml()
{
$value = htmlspecialchars($this->getValue());
if ($this->getAttribute('wrap') == 'off') {
$html = $this->_getTabs() . '<pre>' . $value."</pre>\n";
} else {
$html = nl2br($value)."\n";
}
return $html . $this->_getPersistantData();
} //end func getFrozenHtml
 
// }}}
 
} //end class HTML_QuickForm_textarea
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/file.php
New file
0,0 → 1,346
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Adam Daniel <adaniel1@eesus.jnj.com> |
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: file.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once("HTML/QuickForm/input.php");
 
// register file-related rules
if (class_exists('HTML_QuickForm')) {
HTML_QuickForm::registerRule('uploadedfile', 'callback', '_ruleIsUploadedFile', 'HTML_QuickForm_file');
HTML_QuickForm::registerRule('maxfilesize', 'callback', '_ruleCheckMaxFileSize', 'HTML_QuickForm_file');
HTML_QuickForm::registerRule('mimetype', 'callback', '_ruleCheckMimeType', 'HTML_QuickForm_file');
HTML_QuickForm::registerRule('filename', 'callback', '_ruleCheckFileName', 'HTML_QuickForm_file');
}
 
/**
* HTML class for a file type element
*
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version 1.0
* @since PHP4.04pl1
* @access public
*/
class HTML_QuickForm_file extends HTML_QuickForm_input
{
// {{{ properties
 
/**
* Uploaded file data, from $_FILES
* @var array
*/
var $_value = null;
 
// }}}
// {{{ constructor
 
/**
* Class constructor
*
* @param string Input field name attribute
* @param string Input field label
* @param mixed (optional)Either a typical HTML attribute string
* or an associative array
* @since 1.0
* @access public
*/
function HTML_QuickForm_file($elementName=null, $elementLabel=null, $attributes=null)
{
HTML_QuickForm_input::HTML_QuickForm_input($elementName, $elementLabel, $attributes);
$this->setType('file');
} //end constructor
// }}}
// {{{ setSize()
 
/**
* Sets size of file element
*
* @param int Size of file element
* @since 1.0
* @access public
*/
function setSize($size)
{
$this->updateAttributes(array('size' => $size));
} //end func setSize
// }}}
// {{{ getSize()
 
/**
* Returns size of file element
*
* @since 1.0
* @access public
* @return int
*/
function getSize()
{
return $this->getAttribute('size');
} //end func getSize
 
// }}}
// {{{ freeze()
 
/**
* Freeze the element so that only its value is returned
*
* @access public
* @return bool
*/
function freeze()
{
return false;
} //end func freeze
 
// }}}
// {{{ setValue()
 
/**
* Sets value for file element.
*
* Actually this does nothing. The function is defined here to override
* HTML_Quickform_input's behaviour of setting the 'value' attribute. As
* no sane user-agent uses <input type="file">'s value for anything
* (because of security implications) we implement file's value as a
* read-only property with a special meaning.
*
* @param mixed Value for file element
* @since 3.0
* @access public
*/
function setValue($value)
{
return null;
} //end func setValue
// }}}
// {{{ getValue()
 
/**
* Returns information about the uploaded file
*
* @since 3.0
* @access public
* @return array
*/
function getValue()
{
return $this->_value;
} // end func getValue
 
// }}}
// {{{ onQuickFormEvent()
 
/**
* Called by HTML_QuickForm whenever form event is made on this element
*
* @param string Name of event
* @param mixed event arguments
* @param object calling object
* @since 1.0
* @access public
* @return bool
*/
function onQuickFormEvent($event, $arg, &$caller)
{
switch ($event) {
case 'updateValue':
if ($caller->getAttribute('method') == 'get') {
return PEAR::raiseError('Cannot add a file upload field to a GET method form');
}
$this->_value = $this->_findValue();
$caller->updateAttributes(array('enctype' => 'multipart/form-data'));
$caller->setMaxFileSize();
break;
case 'addElement':
$this->onQuickFormEvent('createElement', $arg, $caller);
return $this->onQuickFormEvent('updateValue', null, $caller);
break;
case 'createElement':
$className = get_class($this);
$this->$className($arg[0], $arg[1], $arg[2]);
break;
}
return true;
} // end func onQuickFormEvent
 
// }}}
// {{{ moveUploadedFile()
 
/**
* Moves an uploaded file into the destination
*
* @param string Destination directory path
* @param string New file name
* @access public
*/
function moveUploadedFile($dest, $fileName = '')
{
if ($dest != '' && substr($dest, -1) != '/') {
$dest .= '/';
}
$fileName = ($fileName != '') ? $fileName : basename($this->_value['name']);
if (move_uploaded_file($this->_value['tmp_name'], $dest . $fileName)) {
return true;
} else {
return false;
}
} // end func moveUploadedFile
// }}}
// {{{ isUploadedFile()
 
/**
* Checks if the element contains an uploaded file
*
* @access public
* @return bool true if file has been uploaded, false otherwise
*/
function isUploadedFile()
{
return $this->_ruleIsUploadedFile($this->_value);
} // end func isUploadedFile
 
// }}}
// {{{ _ruleIsUploadedFile()
 
/**
* Checks if the given element contains an uploaded file
*
* @param array Uploaded file info (from $_FILES)
* @access private
* @return bool true if file has been uploaded, false otherwise
*/
function _ruleIsUploadedFile($elementValue)
{
if ((isset($elementValue['error']) && $elementValue['error'] == 0) ||
(!empty($elementValue['tmp_name']) && $elementValue['tmp_name'] != 'none')) {
return is_uploaded_file($elementValue['tmp_name']);
} else {
return false;
}
} // end func _ruleIsUploadedFile
// }}}
// {{{ _ruleCheckMaxFileSize()
 
/**
* Checks that the file does not exceed the max file size
*
* @param array Uploaded file info (from $_FILES)
* @param int Max file size
* @access private
* @return bool true if filesize is lower than maxsize, false otherwise
*/
function _ruleCheckMaxFileSize($elementValue, $maxSize)
{
if (!empty($elementValue['error']) &&
(UPLOAD_ERR_FORM_SIZE == $elementValue['error'] || UPLOAD_ERR_INI_SIZE == $elementValue['error'])) {
return false;
}
if (!HTML_QuickForm_file::_ruleIsUploadedFile($elementValue)) {
return true;
}
return ($maxSize >= @filesize($elementValue['tmp_name']));
} // end func _ruleCheckMaxFileSize
 
// }}}
// {{{ _ruleCheckMimeType()
 
/**
* Checks if the given element contains an uploaded file of the right mime type
*
* @param array Uploaded file info (from $_FILES)
* @param mixed Mime Type (can be an array of allowed types)
* @access private
* @return bool true if mimetype is correct, false otherwise
*/
function _ruleCheckMimeType($elementValue, $mimeType)
{
if (!HTML_QuickForm_file::_ruleIsUploadedFile($elementValue)) {
return true;
}
if (is_array($mimeType)) {
return in_array($elementValue['type'], $mimeType);
}
return $elementValue['type'] == $mimeType;
} // end func _ruleCheckMimeType
 
// }}}
// {{{ _ruleCheckFileName()
 
/**
* Checks if the given element contains an uploaded file of the filename regex
*
* @param array Uploaded file info (from $_FILES)
* @param string Regular expression
* @access private
* @return bool true if name matches regex, false otherwise
*/
function _ruleCheckFileName($elementValue, $regex)
{
if (!HTML_QuickForm_file::_ruleIsUploadedFile($elementValue)) {
return true;
}
return preg_match($regex, $elementValue['name']);
} // end func _ruleCheckFileName
// }}}
// {{{ _findValue()
 
/**
* Tries to find the element value from the values array
*
* Needs to be redefined here as $_FILES is populated differently from
* other arrays when element name is of the form foo[bar]
*
* @access private
* @return mixed
*/
function _findValue()
{
if (empty($_FILES)) {
return null;
}
$elementName = $this->getName();
if (isset($_FILES[$elementName])) {
return $_FILES[$elementName];
} elseif (false !== ($pos = strpos($elementName, '['))) {
$base = substr($elementName, 0, $pos);
$idx = "['" . str_replace(array(']', '['), array('', "']['"), substr($elementName, $pos + 1, -1)) . "']";
$props = array('name', 'type', 'size', 'tmp_name', 'error');
$code = "if (!isset(\$_FILES['{$base}']['name']{$idx})) {\n" .
" return null;\n" .
"} else {\n" .
" \$value = array();\n";
foreach ($props as $prop) {
$code .= " \$value['{$prop}'] = \$_FILES['{$base}']['{$prop}']{$idx};\n";
}
return eval($code . " return \$value;\n}\n");
} else {
return null;
}
}
 
// }}}
} // end class HTML_QuickForm_file
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/select.php
New file
0,0 → 1,604
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Adam Daniel <adaniel1@eesus.jnj.com> |
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: select.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once('HTML/QuickForm/element.php');
 
/**
* Class to dynamically create an HTML SELECT
*
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version 1.0
* @since PHP4.04pl1
* @access public
*/
class HTML_QuickForm_select extends HTML_QuickForm_element {
// {{{ properties
 
/**
* Contains the select options
*
* @var array
* @since 1.0
* @access private
*/
var $_options = array();
/**
* Default values of the SELECT
*
* @var string
* @since 1.0
* @access private
*/
var $_values = null;
 
// }}}
// {{{ constructor
/**
* Class constructor
*
* @param string Select name attribute
* @param mixed Label(s) for the select
* @param mixed Data to be used to populate options
* @param mixed Either a typical HTML attribute string or an associative array
* @since 1.0
* @access public
* @return void
*/
function HTML_QuickForm_select($elementName=null, $elementLabel=null, $options=null, $attributes=null)
{
HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;
$this->_type = 'select';
if (isset($options)) {
$this->load($options);
}
} //end constructor
// }}}
// {{{ apiVersion()
 
/**
* Returns the current API version
*
* @since 1.0
* @access public
* @return double
*/
function apiVersion()
{
return 2.3;
} //end func apiVersion
 
// }}}
// {{{ setSelected()
 
/**
* Sets the default values of the select box
*
* @param mixed $values Array or comma delimited string of selected values
* @since 1.0
* @access public
* @return void
*/
function setSelected($values)
{
if (is_string($values) && $this->getMultiple()) {
$values = split("[ ]?,[ ]?", $values);
}
if (is_array($values)) {
$this->_values = array_values($values);
} else {
$this->_values = array($values);
}
} //end func setSelected
// }}}
// {{{ getSelected()
 
/**
* Returns an array of the selected values
*
* @since 1.0
* @access public
* @return array of selected values
*/
function getSelected()
{
return $this->_values;
} // end func getSelected
 
// }}}
// {{{ setName()
 
/**
* Sets the input field name
*
* @param string $name Input field name attribute
* @since 1.0
* @access public
* @return void
*/
function setName($name)
{
$this->updateAttributes(array('name' => $name));
} //end func setName
// }}}
// {{{ getName()
 
/**
* Returns the element name
*
* @since 1.0
* @access public
* @return string
*/
function getName()
{
return $this->getAttribute('name');
} //end func getName
 
// }}}
// {{{ getPrivateName()
 
/**
* Returns the element name (possibly with brackets appended)
*
* @since 1.0
* @access public
* @return string
*/
function getPrivateName()
{
if ($this->getAttribute('multiple')) {
return $this->getName() . '[]';
} else {
return $this->getName();
}
} //end func getPrivateName
 
// }}}
// {{{ setValue()
 
/**
* Sets the value of the form element
*
* @param mixed $values Array or comma delimited string of selected values
* @since 1.0
* @access public
* @return void
*/
function setValue($value)
{
$this->setSelected($value);
} // end func setValue
 
// }}}
// {{{ getValue()
 
/**
* Returns an array of the selected values
*
* @since 1.0
* @access public
* @return array of selected values
*/
function getValue()
{
return $this->_values;
} // end func getValue
 
// }}}
// {{{ setSize()
 
/**
* Sets the select field size, only applies to 'multiple' selects
*
* @param int $size Size of select field
* @since 1.0
* @access public
* @return void
*/
function setSize($size)
{
$this->updateAttributes(array('size' => $size));
} //end func setSize
// }}}
// {{{ getSize()
 
/**
* Returns the select field size
*
* @since 1.0
* @access public
* @return int
*/
function getSize()
{
return $this->getAttribute('size');
} //end func getSize
 
// }}}
// {{{ setMultiple()
 
/**
* Sets the select mutiple attribute
*
* @param bool $multiple Whether the select supports multi-selections
* @since 1.2
* @access public
* @return void
*/
function setMultiple($multiple)
{
if ($multiple) {
$this->updateAttributes(array('multiple' => 'multiple'));
} else {
$this->removeAttribute('multiple');
}
} //end func setMultiple
// }}}
// {{{ getMultiple()
 
/**
* Returns the select mutiple attribute
*
* @since 1.2
* @access public
* @return bool true if multiple select, false otherwise
*/
function getMultiple()
{
return (bool)$this->getAttribute('multiple');
} //end func getMultiple
 
// }}}
// {{{ addOption()
 
/**
* Adds a new OPTION to the SELECT
*
* @param string $text Display text for the OPTION
* @param string $value Value for the OPTION
* @param mixed $attributes Either a typical HTML attribute string
* or an associative array
* @since 1.0
* @access public
* @return void
*/
function addOption($text, $value, $attributes=null)
{
if (null === $attributes) {
$attributes = array('value' => $value);
} else {
$attributes = $this->_parseAttributes($attributes);
if (isset($attributes['selected'])) {
// the 'selected' attribute will be set in toHtml()
$this->_removeAttr('selected', $attributes);
if (is_null($this->_values)) {
$this->_values = array($value);
} elseif (!in_array($value, $this->_values)) {
$this->_values[] = $value;
}
}
$this->_updateAttrArray($attributes, array('value' => $value));
}
$this->_options[] = array('text' => $text, 'attr' => $attributes);
} // end func addOption
// }}}
// {{{ loadArray()
 
/**
* Loads the options from an associative array
*
* @param array $arr Associative array of options
* @param mixed $values (optional) Array or comma delimited string of selected values
* @since 1.0
* @access public
* @return PEAR_Error on error or true
* @throws PEAR_Error
*/
function loadArray($arr, $values=null)
{
if (!is_array($arr)) {
return PEAR::raiseError('Argument 1 of HTML_Select::loadArray is not a valid array');
}
if (isset($values)) {
$this->setSelected($values);
}
foreach ($arr as $key => $val) {
// Warning: new API since release 2.3
$this->addOption($val, $key);
}
return true;
} // end func loadArray
 
// }}}
// {{{ loadDbResult()
 
/**
* Loads the options from DB_result object
*
* If no column names are specified the first two columns of the result are
* used as the text and value columns respectively
* @param object $result DB_result object
* @param string $textCol (optional) Name of column to display as the OPTION text
* @param string $valueCol (optional) Name of column to use as the OPTION value
* @param mixed $values (optional) Array or comma delimited string of selected values
* @since 1.0
* @access public
* @return PEAR_Error on error or true
* @throws PEAR_Error
*/
function loadDbResult(&$result, $textCol=null, $valueCol=null, $values=null)
{
if (!is_object($result) || !is_a($result, 'db_result')) {
return PEAR::raiseError('Argument 1 of HTML_Select::loadDbResult is not a valid DB_result');
}
if (isset($values)) {
$this->setValue($values);
}
$fetchMode = ($textCol && $valueCol) ? DB_FETCHMODE_ASSOC : DB_FETCHMODE_DEFAULT;
while (is_array($row = $result->fetchRow($fetchMode)) ) {
if ($fetchMode == DB_FETCHMODE_ASSOC) {
$this->addOption($row[$textCol], $row[$valueCol]);
} else {
$this->addOption($row[0], $row[1]);
}
}
return true;
} // end func loadDbResult
// }}}
// {{{ loadQuery()
 
/**
* Queries a database and loads the options from the results
*
* @param mixed $conn Either an existing DB connection or a valid dsn
* @param string $sql SQL query string
* @param string $textCol (optional) Name of column to display as the OPTION text
* @param string $valueCol (optional) Name of column to use as the OPTION value
* @param mixed $values (optional) Array or comma delimited string of selected values
* @since 1.1
* @access public
* @return void
* @throws PEAR_Error
*/
function loadQuery(&$conn, $sql, $textCol=null, $valueCol=null, $values=null)
{
if (is_string($conn)) {
require_once('DB.php');
$dbConn = &DB::connect($conn, true);
if (DB::isError($dbConn)) {
return $dbConn;
}
} elseif (is_subclass_of($conn, "db_common")) {
$dbConn = &$conn;
} else {
return PEAR::raiseError('Argument 1 of HTML_Select::loadQuery is not a valid type');
}
$result = $dbConn->query($sql);
if (DB::isError($result)) {
return $result;
}
$this->loadDbResult($result, $textCol, $valueCol, $values);
$result->free();
if (is_string($conn)) {
$dbConn->disconnect();
}
return true;
} // end func loadQuery
 
// }}}
// {{{ load()
 
/**
* Loads options from different types of data sources
*
* This method is a simulated overloaded method. The arguments, other than the
* first are optional and only mean something depending on the type of the first argument.
* If the first argument is an array then all arguments are passed in order to loadArray.
* If the first argument is a db_result then all arguments are passed in order to loadDbResult.
* If the first argument is a string or a DB connection then all arguments are
* passed in order to loadQuery.
* @param mixed $options Options source currently supports assoc array or DB_result
* @param mixed $param1 (optional) See function detail
* @param mixed $param2 (optional) See function detail
* @param mixed $param3 (optional) See function detail
* @param mixed $param4 (optional) See function detail
* @since 1.1
* @access public
* @return PEAR_Error on error or true
* @throws PEAR_Error
*/
function load(&$options, $param1=null, $param2=null, $param3=null, $param4=null)
{
switch (true) {
case is_array($options):
return $this->loadArray($options, $param1);
break;
case (is_a($options, 'db_result')):
return $this->loadDbResult($options, $param1, $param2, $param3);
break;
case (is_string($options) && !empty($options) ):
return $this->loadQuery($options, $param1, $param2, $param3, $param4);
break;
}
} // end func load
// }}}
// {{{ toHtml()
 
/**
* Returns the SELECT in HTML
*
* @since 1.0
* @access public
* @return string
*/
function toHtml()
{
if ($this->_flagFrozen) {
return $this->getFrozenHtml();
} else {
$tabs = $this->_getTabs();
$strHtml = '';
 
if ($this->getComment() != '') {
$strHtml .= $tabs . '<!-- ' . $this->getComment() . " //-->\n";
}
 
if (!$this->getMultiple()) {
$attrString = $this->_getAttrString($this->_attributes);
} else {
$myName = $this->getName();
$this->setName($myName . '[]');
$attrString = $this->_getAttrString($this->_attributes);
$this->setName($myName);
}
$strHtml .= $tabs . '<select' . $attrString . ">\n";
 
foreach ($this->_options as $option) {
if (is_array($this->_values) && in_array((string)$option['attr']['value'], $this->_values)) {
$this->_updateAttrArray($option['attr'], array('selected' => 'selected'));
}
$strHtml .= $tabs . "\t<option" . $this->_getAttrString($option['attr']) . '>' .
$option['text'] . "</option>\n";
}
 
return $strHtml . $tabs . '</select>';
}
} //end func toHtml
// }}}
// {{{ getFrozenHtml()
 
/**
* Returns the value of field without HTML tags
*
* @since 1.0
* @access public
* @return string
*/
function getFrozenHtml()
{
$value = array();
if (is_array($this->_values)) {
foreach ($this->_values as $key => $val) {
for ($i = 0, $optCount = count($this->_options); $i < $optCount; $i++) {
if ((string)$val == (string)$this->_options[$i]['attr']['value']) {
$value[$key] = $this->_options[$i]['text'];
break;
}
}
}
}
$html = empty($value)? '&nbsp;': join('<br />', $value);
if ($this->_persistantFreeze) {
$name = $this->getPrivateName();
// Only use id attribute if doing single hidden input
if (1 == count($value)) {
$id = $this->getAttribute('id');
$idAttr = isset($id)? array('id' => $id): array();
} else {
$idAttr = array();
}
foreach ($value as $key => $item) {
$html .= '<input' . $this->_getAttrString(array(
'type' => 'hidden',
'name' => $name,
'value' => $this->_values[$key]
) + $idAttr) . ' />';
}
}
return $html;
} //end func getFrozenHtml
 
// }}}
// {{{ exportValue()
 
/**
* We check the options and return only the values that _could_ have been
* selected. We also return a scalar value if select is not "multiple"
*/
function exportValue(&$submitValues, $assoc = false)
{
$value = $this->_findValue($submitValues);
if (is_null($value)) {
$value = $this->getValue();
} elseif(!is_array($value)) {
$value = array($value);
}
if (is_array($value) && !empty($this->_options)) {
$cleanValue = null;
foreach ($value as $v) {
for ($i = 0, $optCount = count($this->_options); $i < $optCount; $i++) {
if ($v == $this->_options[$i]['attr']['value']) {
$cleanValue[] = $v;
break;
}
}
}
} else {
$cleanValue = $value;
}
if (is_array($cleanValue) && !$this->getMultiple()) {
return $this->_prepareValue($cleanValue[0], $assoc);
} else {
return $this->_prepareValue($cleanValue, $assoc);
}
}
// }}}
// {{{ onQuickFormEvent()
 
function onQuickFormEvent($event, $arg, &$caller)
{
if ('updateValue' == $event) {
$value = $this->_findValue($caller->_constantValues);
if (null === $value) {
$value = $this->_findValue($caller->_submitValues);
// Fix for bug #4465
// XXX: should we push this to element::onQuickFormEvent()?
if (null === $value && !$caller->isSubmitted()) {
$value = $this->_findValue($caller->_defaultValues);
}
}
if (null !== $value) {
$this->setValue($value);
}
return true;
} else {
return parent::onQuickFormEvent($event, $arg, $caller);
}
}
 
// }}}
} //end class HTML_QuickForm_select
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/Renderer/ITDynamic.php
New file
0,0 → 1,287
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Alexey Borzov <borz_off@cs.msu.su> |
// +----------------------------------------------------------------------+
//
// $Id: ITDynamic.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once 'HTML/QuickForm/Renderer.php';
 
/**
* A concrete renderer for HTML_QuickForm, using Integrated Templates.
*
* This is a "dynamic" renderer, which means that concrete form look
* is defined at runtime. This also means that you can define
* <b>one</b> template file for <b>all</b> your forms. That template
* should contain a block for every element 'look' appearing in your
* forms and also some special blocks (consult the examples). If a
* special block is not set for an element, the renderer falls back to
* a default one.
*
* @author Alexey Borzov <borz_off@cs.msu.su>
* @access public
*/
class HTML_QuickForm_Renderer_ITDynamic extends HTML_QuickForm_Renderer
{
/**
* A template class (HTML_Template_ITX or HTML_Template_Sigma) instance
* @var object
*/
var $_tpl = null;
 
/**
* The errors that were not shown near concrete fields go here
* @var array
*/
var $_errors = array();
 
/**
* Show the block with required note?
* @var bool
*/
var $_showRequired = false;
 
/**
* A separator for group elements
* @var mixed
*/
var $_groupSeparator = null;
 
/**
* The current element index inside a group
* @var integer
*/
var $_groupElementIdx = 0;
 
/**
* Blocks to use for different elements
* @var array
*/
var $_elementBlocks = array();
 
/**
* Block to use for headers
* @var string
*/
var $_headerBlock = null;
 
 
/**
* Constructor
*
* @param object An HTML_Template_ITX/HTML_Template_Sigma object to use
*/
function HTML_QuickForm_Renderer_ITDynamic(&$tpl)
{
$this->HTML_QuickForm_Renderer();
$this->_tpl =& $tpl;
$this->_tpl->setCurrentBlock('qf_main_loop');
}
 
 
function finishForm(&$form)
{
// display errors above form
if (!empty($this->_errors) && $this->_tpl->blockExists('qf_error_loop')) {
foreach ($this->_errors as $error) {
$this->_tpl->setVariable('qf_error', $error);
$this->_tpl->parse('qf_error_loop');
}
}
// show required note
if ($this->_showRequired) {
$this->_tpl->setVariable('qf_required_note', $form->getRequiredNote());
}
// assign form attributes
$this->_tpl->setVariable('qf_attributes', $form->getAttributes(true));
// assign javascript validation rules
$this->_tpl->setVariable('qf_javascript', $form->getValidationScript());
}
 
function renderHeader(&$header)
{
$blockName = $this->_matchBlock($header);
if ('qf_header' == $blockName && isset($this->_headerBlock)) {
$blockName = $this->_headerBlock;
}
$this->_tpl->setVariable('qf_header', $header->toHtml());
$this->_tpl->parse($blockName);
$this->_tpl->parse('qf_main_loop');
}
 
 
function renderElement(&$element, $required, $error)
{
$blockName = $this->_matchBlock($element);
// are we inside a group?
if ('qf_main_loop' != $this->_tpl->currentBlock) {
if (0 != $this->_groupElementIdx && $this->_tpl->placeholderExists('qf_separator', $blockName)) {
if (is_array($this->_groupSeparator)) {
$this->_tpl->setVariable('qf_separator', $this->_groupSeparator[($this->_groupElementIdx - 1) % count($this->_groupSeparator)]);
} else {
$this->_tpl->setVariable('qf_separator', (string)$this->_groupSeparator);
}
}
$this->_groupElementIdx++;
 
} elseif(!empty($error)) {
// show the error message or keep it for later use
if ($this->_tpl->blockExists($blockName . '_error')) {
$this->_tpl->setVariable('qf_error', $error);
} else {
$this->_errors[] = $error;
}
}
// show an '*' near the required element
if ($required) {
$this->_showRequired = true;
if ($this->_tpl->blockExists($blockName . '_required')) {
$this->_tpl->touchBlock($blockName . '_required');
}
}
// Prepare multiple labels
$labels = $element->getLabel();
if (is_array($labels)) {
$mainLabel = array_shift($labels);
} else {
$mainLabel = $labels;
}
// render the element itself with its main label
$this->_tpl->setVariable('qf_element', $element->toHtml());
if ($this->_tpl->placeholderExists('qf_label', $blockName)) {
$this->_tpl->setVariable('qf_label', $mainLabel);
}
// render extra labels, if any
if (is_array($labels)) {
foreach($labels as $key => $label) {
$key = is_int($key)? $key + 2: $key;
if ($this->_tpl->blockExists($blockName . '_label_' . $key)) {
$this->_tpl->setVariable('qf_label_' . $key, $label);
}
}
}
$this->_tpl->parse($blockName);
$this->_tpl->parseCurrentBlock();
}
 
function renderHidden(&$element)
{
$this->_tpl->setVariable('qf_hidden', $element->toHtml());
$this->_tpl->parse('qf_hidden_loop');
}
 
 
function startGroup(&$group, $required, $error)
{
$blockName = $this->_matchBlock($group);
$this->_tpl->setCurrentBlock($blockName . '_loop');
$this->_groupElementIdx = 0;
$this->_groupSeparator = is_null($group->_separator)? '&nbsp;': $group->_separator;
// show an '*' near the required element
if ($required) {
$this->_showRequired = true;
if ($this->_tpl->blockExists($blockName . '_required')) {
$this->_tpl->touchBlock($blockName . '_required');
}
}
// show the error message or keep it for later use
if (!empty($error)) {
if ($this->_tpl->blockExists($blockName . '_error')) {
$this->_tpl->setVariable('qf_error', $error);
} else {
$this->_errors[] = $error;
}
}
$this->_tpl->setVariable('qf_group_label', $group->getLabel());
}
 
 
function finishGroup(&$group)
{
$this->_tpl->parse($this->_matchBlock($group));
$this->_tpl->setCurrentBlock('qf_main_loop');
$this->_tpl->parseCurrentBlock();
}
 
 
/**
* Returns the name of a block to use for element rendering
*
* If a name was not explicitly set via setElementBlock(), it tries
* the names '{prefix}_{element type}' and '{prefix}_{element}', where
* prefix is either 'qf' or the name of the current group's block
*
* @param object An HTML_QuickForm_element object
* @access private
* @return string block name
*/
function _matchBlock(&$element)
{
$name = $element->getName();
$type = $element->getType();
if (isset($this->_elementBlocks[$name]) && $this->_tpl->blockExists($this->_elementBlocks[$name])) {
if (('group' == $type) || ($this->_elementBlocks[$name] . '_loop' != $this->_tpl->currentBlock)) {
return $this->_elementBlocks[$name];
}
}
if ('group' != $type && 'qf_main_loop' != $this->_tpl->currentBlock) {
$prefix = substr($this->_tpl->currentBlock, 0, -5); // omit '_loop' postfix
} else {
$prefix = 'qf';
}
if ($this->_tpl->blockExists($prefix . '_' . $type)) {
return $prefix . '_' . $type;
} elseif ($this->_tpl->blockExists($prefix . '_' . $name)) {
return $prefix . '_' . $name;
} else {
return $prefix . '_element';
}
}
 
 
/**
* Sets the block to use for element rendering
*
* @param mixed element name or array ('element name' => 'block name')
* @param string block name if $elementName is not an array
* @access public
* @return void
*/
function setElementBlock($elementName, $blockName = null)
{
if (is_array($elementName)) {
$this->_elementBlocks = array_merge($this->_elementBlocks, $elementName);
} else {
$this->_elementBlocks[$elementName] = $blockName;
}
}
 
 
/**
* Sets the name of a block to use for header rendering
*
* @param string block name
* @access public
* @return void
*/
function setHeaderBlock($blockName)
{
$this->_headerBlock = $blockName;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/Renderer/QuickHtml.php
New file
0,0 → 1,203
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Jason Rust <jrust@rustyparts.com> |
// +----------------------------------------------------------------------+
//
// $Id: QuickHtml.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once('HTML/QuickForm/Renderer/Default.php');
 
/**
* A renderer that makes it quick and easy to create customized forms.
*
* This renderer has three main distinctives: an easy way to create
* custom-looking forms, the ability to separate the creation of form
* elements from their display, and being able to use QuickForm in
* widget-based template systems. See the online docs for more info.
* For a usage example see: docs/renderers/QuickHtml_example.php
*
* @access public
* @package QuickForm
*/
class HTML_QuickForm_Renderer_QuickHtml extends HTML_QuickForm_Renderer_Default {
// {{{ properties
 
/**
* The array of rendered elements
* @var array
*/
var $renderedElements = array();
 
// }}}
// {{{ constructor
/**
* Constructor
*
* @access public
* @return void
*/
function HTML_QuickForm_Renderer_QuickHtml()
{
$this->HTML_QuickForm_Renderer_Default();
// The default templates aren't used for this renderer
$this->clearAllTemplates();
} // end constructor
 
// }}}
// {{{ toHtml()
 
/**
* returns the HTML generated for the form
*
* @param string $data (optional) Any extra data to put before the end of the form
*
* @access public
* @return string
*/
function toHtml($data = '')
{
// Render any elements that haven't been rendered explicitly by elementToHtml()
foreach (array_keys($this->renderedElements) as $key) {
if (!$this->renderedElements[$key]['rendered']) {
$this->renderedElements[$key]['rendered'] = true;
$data .= $this->renderedElements[$key]['html'] . "\n";
}
}
 
// Insert the extra data and form elements at the end of the form
$this->_html = str_replace('</form>', $data . "\n</form>", $this->_html);
return $this->_html;
} // end func toHtml
 
// }}}
// {{{ elementToHtml()
 
/**
* Gets the html for an element and marks it as rendered.
*
* @param string $elementName The element name
* @param string $elementValue (optional) The value of the element. This is only useful
* for elements that have the same name (i.e. radio and checkbox), but
* different values
*
* @access public
* @return string The html for the QuickForm element
*/
function elementToHtml($elementName, $elementValue = null)
{
$elementKey = null;
// Find the key for the element
foreach ($this->renderedElements as $key => $data) {
if ($data['name'] == $elementName &&
// See if the value must match as well
(is_null($elementValue) ||
$data['value'] == $elementValue)) {
$elementKey = $key;
break;
}
}
 
if (is_null($elementKey)) {
$msg = is_null($elementValue) ? "Element $elementName does not exist." :
"Element $elementName with value of $elementValue does not exist.";
return PEAR::raiseError(null, QUICKFORM_UNREGISTERED_ELEMENT, null, E_USER_WARNING, $msg, 'HTML_QuickForm_Error', true);
} else {
if ($this->renderedElements[$elementKey]['rendered']) {
$msg = is_null($elementValue) ? "Element $elementName has already been rendered." :
"Element $elementName with value of $elementValue has already been rendered.";
return PEAR::raiseError(null, QUICKFORM_ERROR, null, E_USER_WARNING, $msg, 'HTML_QuickForm_Error', true);
} else {
$this->renderedElements[$elementKey]['rendered'] = true;
return $this->renderedElements[$elementKey]['html'];
}
}
} // end func elementToHtml
 
// }}}
// {{{ renderElement()
 
/**
* Gets the html for an element and adds it to the array by calling
* parent::renderElement()
*
* @param object An HTML_QuickForm_element object
* @param bool Whether an element is required
* @param string An error message associated with an element
*
* @access public
* @return mixed HTML string of element if $immediateRender is set, else we just add the
* html to the global _html string
*/
function renderElement(&$element, $required, $error)
{
$this->_html = '';
parent::renderElement($element, $required, $error);
if (!$this->_inGroup) {
$this->renderedElements[] = array(
'name' => $element->getName(),
'value' => $element->getValue(),
'html' => $this->_html,
'rendered' => false);
}
$this->_html = '';
} // end func renderElement
 
// }}}
// {{{ renderHidden()
 
/**
* Gets the html for a hidden element and adds it to the array.
*
* @param object An HTML_QuickForm_hidden object being visited
* @access public
* @return void
*/
function renderHidden(&$element)
{
$this->renderedElements[] = array(
'name' => $element->getName(),
'value' => $element->getValue(),
'html' => $element->toHtml(),
'rendered' => false);
} // end func renderHidden
// }}}
// {{{ finishGroup()
 
/**
* Gets the html for the group element and adds it to the array by calling
* parent::finishGroup()
*
* @param object An HTML_QuickForm_group object being visited
* @access public
* @return void
*/
function finishGroup(&$group)
{
$this->_html = '';
parent::finishGroup($group);
$this->renderedElements[] = array(
'name' => $group->getName(),
'value' => $group->getValue(),
'html' => $this->_html,
'rendered' => false);
$this->_html = '';
} // end func finishGroup
 
// }}}
} // end class HTML_QuickForm_Renderer_QuickHtml
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/Renderer/Default.php
New file
0,0 → 1,474
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Alexey Borzov <borz_off@cs.msu.su> |
// | Adam Daniel <adaniel1@eesus.jnj.com> |
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: Default.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once('HTML/QuickForm/Renderer.php');
 
/**
* A concrete renderer for HTML_QuickForm,
* based on QuickForm 2.x built-in one
*
* @access public
*/
class HTML_QuickForm_Renderer_Default extends HTML_QuickForm_Renderer
{
/**
* The HTML of the form
* @var string
* @access private
*/
var $_html;
 
/**
* Header Template string
* @var string
* @access private
*/
var $_headerTemplate =
"\n\t<tr>\n\t\t<td style=\"white-space: nowrap; background-color: #CCCCCC;\" align=\"left\" valign=\"top\" colspan=\"2\"><b>{header}</b></td>\n\t</tr>";
 
/**
* Element template string
* @var string
* @access private
*/
var $_elementTemplate =
"\n\t<tr>\n\t\t<td align=\"right\" valign=\"top\"><!-- BEGIN required --><span style=\"color: #ff0000\">*</span><!-- END required --><b>{label}</b></td>\n\t\t<td valign=\"top\" align=\"left\"><!-- BEGIN error --><span style=\"color: #ff0000\">{error}</span><br /><!-- END error -->\t{element}</td>\n\t</tr>";
 
/**
* Form template string
* @var string
* @access private
*/
var $_formTemplate =
"\n<form{attributes}>\n<div>\n{hidden}<table border=\"0\">\n{content}\n</table>\n</div>\n</form>";
 
/**
* Required Note template string
* @var string
* @access private
*/
var $_requiredNoteTemplate =
"\n\t<tr>\n\t\t<td></td>\n\t<td align=\"left\" valign=\"top\">{requiredNote}</td>\n\t</tr>";
 
/**
* Array containing the templates for customised elements
* @var array
* @access private
*/
var $_templates = array();
 
/**
* Array containing the templates for group wraps.
*
* These templates are wrapped around group elements and groups' own
* templates wrap around them. This is set by setGroupTemplate().
*
* @var array
* @access private
*/
var $_groupWraps = array();
 
/**
* Array containing the templates for elements within groups
* @var array
* @access private
*/
var $_groupTemplates = array();
 
/**
* True if we are inside a group
* @var bool
* @access private
*/
var $_inGroup = false;
 
/**
* Array with HTML generated for group elements
* @var array
* @access private
*/
var $_groupElements = array();
 
/**
* Template for an element inside a group
* @var string
* @access private
*/
var $_groupElementTemplate = '';
 
/**
* HTML that wraps around the group elements
* @var string
* @access private
*/
var $_groupWrap = '';
 
/**
* HTML for the current group
* @var string
* @access private
*/
var $_groupTemplate = '';
/**
* Collected HTML of the hidden fields
* @var string
* @access private
*/
var $_hiddenHtml = '';
 
/**
* Constructor
*
* @access public
*/
function HTML_QuickForm_Renderer_Default()
{
$this->HTML_QuickForm_Renderer();
} // end constructor
 
/**
* returns the HTML generated for the form
*
* @access public
* @return string
*/
function toHtml()
{
// _hiddenHtml is cleared in finishForm(), so this only matters when
// finishForm() was not called (e.g. group::toHtml(), bug #3511)
return $this->_hiddenHtml . $this->_html;
} // end func toHtml
/**
* Called when visiting a form, before processing any form elements
*
* @param object An HTML_QuickForm object being visited
* @access public
* @return void
*/
function startForm(&$form)
{
$this->_html = '';
$this->_hiddenHtml = '';
} // end func startForm
 
/**
* Called when visiting a form, after processing all form elements
* Adds required note, form attributes, validation javascript and form content.
*
* @param object An HTML_QuickForm object being visited
* @access public
* @return void
*/
function finishForm(&$form)
{
// add a required note, if one is needed
if (!empty($form->_required) && !$form->_freezeAll) {
$this->_html .= str_replace('{requiredNote}', $form->getRequiredNote(), $this->_requiredNoteTemplate);
}
// add form attributes and content
$html = str_replace('{attributes}', $form->getAttributes(true), $this->_formTemplate);
if (strpos($this->_formTemplate, '{hidden}')) {
$html = str_replace('{hidden}', $this->_hiddenHtml, $html);
} else {
$this->_html .= $this->_hiddenHtml;
}
$this->_hiddenHtml = '';
$this->_html = str_replace('{content}', $this->_html, $html);
// add a validation script
if ('' != ($script = $form->getValidationScript())) {
$this->_html = $script . "\n" . $this->_html;
}
} // end func finishForm
/**
* Called when visiting a header element
*
* @param object An HTML_QuickForm_header element being visited
* @access public
* @return void
*/
function renderHeader(&$header)
{
$name = $header->getName();
if (!empty($name) && isset($this->_templates[$name])) {
$this->_html .= str_replace('{header}', $header->toHtml(), $this->_templates[$name]);
} else {
$this->_html .= str_replace('{header}', $header->toHtml(), $this->_headerTemplate);
}
} // end func renderHeader
 
/**
* Helper method for renderElement
*
* @param string Element name
* @param mixed Element label (if using an array of labels, you should set the appropriate template)
* @param bool Whether an element is required
* @param string Error message associated with the element
* @access private
* @see renderElement()
* @return string Html for element
*/
function _prepareTemplate($name, $label, $required, $error)
{
if (is_array($label)) {
$nameLabel = array_shift($label);
} else {
$nameLabel = $label;
}
if (isset($this->_templates[$name])) {
$html = str_replace('{label}', $nameLabel, $this->_templates[$name]);
} else {
$html = str_replace('{label}', $nameLabel, $this->_elementTemplate);
}
if ($required) {
$html = str_replace('<!-- BEGIN required -->', '', $html);
$html = str_replace('<!-- END required -->', '', $html);
} else {
$html = preg_replace("/([ \t\n\r]*)?<!-- BEGIN required -->(\s|\S)*<!-- END required -->([ \t\n\r]*)?/i", '', $html);
}
if (isset($error)) {
$html = str_replace('{error}', $error, $html);
$html = str_replace('<!-- BEGIN error -->', '', $html);
$html = str_replace('<!-- END error -->', '', $html);
} else {
$html = preg_replace("/([ \t\n\r]*)?<!-- BEGIN error -->(\s|\S)*<!-- END error -->([ \t\n\r]*)?/i", '', $html);
}
if (is_array($label)) {
foreach($label as $key => $text) {
$key = is_int($key)? $key + 2: $key;
$html = str_replace("{label_{$key}}", $text, $html);
$html = str_replace("<!-- BEGIN label_{$key} -->", '', $html);
$html = str_replace("<!-- END label_{$key} -->", '', $html);
}
}
if (strpos($html, '{label_')) {
$html = preg_replace('/\s*<!-- BEGIN label_(\S+) -->.*<!-- END label_\1 -->\s*/i', '', $html);
}
return $html;
} // end func _prepareTemplate
 
/**
* Renders an element Html
* Called when visiting an element
*
* @param object An HTML_QuickForm_element object being visited
* @param bool Whether an element is required
* @param string An error message associated with an element
* @access public
* @return void
*/
function renderElement(&$element, $required, $error)
{
if (!$this->_inGroup) {
$html = $this->_prepareTemplate($element->getName(), $element->getLabel(), $required, $error);
$this->_html .= str_replace('{element}', $element->toHtml(), $html);
 
} elseif (!empty($this->_groupElementTemplate)) {
$html = str_replace('{label}', $element->getLabel(), $this->_groupElementTemplate);
if ($required) {
$html = str_replace('<!-- BEGIN required -->', '', $html);
$html = str_replace('<!-- END required -->', '', $html);
} else {
$html = preg_replace("/([ \t\n\r]*)?<!-- BEGIN required -->(\s|\S)*<!-- END required -->([ \t\n\r]*)?/i", '', $html);
}
$this->_groupElements[] = str_replace('{element}', $element->toHtml(), $html);
 
} else {
$this->_groupElements[] = $element->toHtml();
}
} // end func renderElement
/**
* Renders an hidden element
* Called when visiting a hidden element
*
* @param object An HTML_QuickForm_hidden object being visited
* @access public
* @return void
*/
function renderHidden(&$element)
{
$this->_hiddenHtml .= $element->toHtml() . "\n";
} // end func renderHidden
 
/**
* Called when visiting a raw HTML/text pseudo-element
*
* @param object An HTML_QuickForm_html element being visited
* @access public
* @return void
*/
function renderHtml(&$data)
{
$this->_html .= $data->toHtml();
} // end func renderHtml
 
/**
* Called when visiting a group, before processing any group elements
*
* @param object An HTML_QuickForm_group object being visited
* @param bool Whether a group is required
* @param string An error message associated with a group
* @access public
* @return void
*/
function startGroup(&$group, $required, $error)
{
$name = $group->getName();
$this->_groupTemplate = $this->_prepareTemplate($name, $group->getLabel(), $required, $error);
$this->_groupElementTemplate = empty($this->_groupTemplates[$name])? '': $this->_groupTemplates[$name];
$this->_groupWrap = empty($this->_groupWraps[$name])? '': $this->_groupWraps[$name];
$this->_groupElements = array();
$this->_inGroup = true;
} // end func startGroup
 
/**
* Called when visiting a group, after processing all group elements
*
* @param object An HTML_QuickForm_group object being visited
* @access public
* @return void
*/
function finishGroup(&$group)
{
$separator = $group->_separator;
if (is_array($separator)) {
$count = count($separator);
$html = '';
for ($i = 0; $i < count($this->_groupElements); $i++) {
$html .= (0 == $i? '': $separator[($i - 1) % $count]) . $this->_groupElements[$i];
}
} else {
if (is_null($separator)) {
$separator = '&nbsp;';
}
$html = implode((string)$separator, $this->_groupElements);
}
if (!empty($this->_groupWrap)) {
$html = str_replace('{content}', $html, $this->_groupWrap);
}
$this->_html .= str_replace('{element}', $html, $this->_groupTemplate);
$this->_inGroup = false;
} // end func finishGroup
 
/**
* Sets element template
*
* @param string The HTML surrounding an element
* @param string (optional) Name of the element to apply template for
* @access public
* @return void
*/
function setElementTemplate($html, $element = null)
{
if (is_null($element)) {
$this->_elementTemplate = $html;
} else {
$this->_templates[$element] = $html;
}
} // end func setElementTemplate
 
 
/**
* Sets template for a group wrapper
*
* This template is contained within a group-as-element template
* set via setTemplate() and contains group's element templates, set
* via setGroupElementTemplate()
*
* @param string The HTML surrounding group elements
* @param string Name of the group to apply template for
* @access public
* @return void
*/
function setGroupTemplate($html, $group)
{
$this->_groupWraps[$group] = $html;
} // end func setGroupTemplate
 
/**
* Sets element template for elements within a group
*
* @param string The HTML surrounding an element
* @param string Name of the group to apply template for
* @access public
* @return void
*/
function setGroupElementTemplate($html, $group)
{
$this->_groupTemplates[$group] = $html;
} // end func setGroupElementTemplate
 
/**
* Sets header template
*
* @param string The HTML surrounding the header
* @access public
* @return void
*/
function setHeaderTemplate($html)
{
$this->_headerTemplate = $html;
} // end func setHeaderTemplate
 
/**
* Sets form template
*
* @param string The HTML surrounding the form tags
* @access public
* @return void
*/
function setFormTemplate($html)
{
$this->_formTemplate = $html;
} // end func setFormTemplate
 
/**
* Sets the note indicating required fields template
*
* @param string The HTML surrounding the required note
* @access public
* @return void
*/
function setRequiredNoteTemplate($html)
{
$this->_requiredNoteTemplate = $html;
} // end func setRequiredNoteTemplate
 
/**
* Clears all the HTML out of the templates that surround notes, elements, etc.
* Useful when you want to use addData() to create a completely custom form look
*
* @access public
* @return void
*/
function clearAllTemplates()
{
$this->setElementTemplate('{element}');
$this->setFormTemplate("\n\t<form{attributes}>{content}\n\t</form>\n");
$this->setRequiredNoteTemplate('');
$this->_templates = array();
} // end func clearAllTemplates
} // end class HTML_QuickForm_Renderer_Default
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/Renderer/ITStatic.php
New file
0,0 → 1,490
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: ITStatic.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once('HTML/QuickForm/Renderer.php');
 
/**
* A static renderer for HTML_QuickForm compatible
* with HTML_Template_IT and HTML_Template_Sigma.
*
* As opposed to the dynamic renderer, this renderer needs
* every elements and labels in the form to be specified by
* placeholders at the position you want them to be displayed.
*
* @author Bertrand Mansion <bmansion@mamasam.com>
* @access public
*/
class HTML_QuickForm_Renderer_ITStatic extends HTML_QuickForm_Renderer
{
/**
* An HTML_Template_IT or some other API compatible Template instance
* @var object
*/
var $_tpl = null;
 
/**
* Rendered form name
* @var string
*/
var $_formName = 'form';
 
/**
* The errors that were not shown near concrete fields go here
* @var array
*/
var $_errors = array();
 
/**
* Show the block with required note?
* @var bool
*/
var $_showRequired = false;
 
/**
* Which group are we currently parsing ?
* @var string
*/
var $_inGroup;
 
/**
* Index of the element in its group
* @var int
*/
var $_elementIndex = 0;
 
/**
* If elements have been added with the same name
* @var array
*/
var $_duplicateElements = array();
 
/**
* How to handle the required tag for required fields
* @var string
*/
var $_required = '{label}<font size="1" color="red">*</font>';
 
/**
* How to handle error messages in form validation
* @var string
*/
var $_error = '<font color="red">{error}</font><br />{html}';
 
/**
* Collected HTML for hidden elements, if needed
* @var string
*/
var $_hidden = '';
 
/**
* Constructor
*
* @param object An HTML_Template_IT or other compatible Template object to use
*/
function HTML_QuickForm_Renderer_ITStatic(&$tpl)
{
$this->HTML_QuickForm_Renderer();
$this->_tpl =& $tpl;
} // end constructor
 
/**
* Called when visiting a form, before processing any form elements
*
* @param object An HTML_QuickForm object being visited
* @access public
* @return void
*/
function startForm(&$form)
{
$this->_formName = $form->getAttribute('id');
 
if (count($form->_duplicateIndex) > 0) {
// Take care of duplicate elements
foreach ($form->_duplicateIndex as $elementName => $indexes) {
$this->_duplicateElements[$elementName] = 0;
}
}
} // end func startForm
 
/**
* Called when visiting a form, after processing all form elements
*
* @param object An HTML_QuickForm object being visited
* @access public
* @return void
*/
function finishForm(&$form)
{
// display errors above form
if (!empty($this->_errors) && $this->_tpl->blockExists($this->_formName.'_error_loop')) {
foreach ($this->_errors as $error) {
$this->_tpl->setVariable($this->_formName.'_error', $error);
$this->_tpl->parse($this->_formName.'_error_loop');
}
}
// show required note
if ($this->_showRequired) {
$this->_tpl->setVariable($this->_formName.'_required_note', $form->getRequiredNote());
}
// add hidden elements, if collected
if (!empty($this->_hidden)) {
$this->_tpl->setVariable($this->_formName . '_hidden', $this->_hidden);
}
// assign form attributes
$this->_tpl->setVariable($this->_formName.'_attributes', $form->getAttributes(true));
// assign javascript validation rules
$this->_tpl->setVariable($this->_formName.'_javascript', $form->getValidationScript());
} // end func finishForm
 
/**
* Called when visiting a header element
*
* @param object An HTML_QuickForm_header element being visited
* @access public
* @return void
*/
function renderHeader(&$header)
{
$name = $header->getName();
$varName = $this->_formName.'_header';
 
// Find placeHolder
if (!empty($name) && $this->_tpl->placeHolderExists($this->_formName.'_header_'.$name)) {
$varName = $this->_formName.'_header_'.$name;
}
$this->_tpl->setVariable($varName, $header->toHtml());
} // end func renderHeader
 
/**
* Called when visiting an element
*
* @param object An HTML_QuickForm_element object being visited
* @param bool Whether an element is required
* @param string An error message associated with an element
* @access public
* @return void
*/
function renderElement(&$element, $required, $error)
{
$name = $element->getName();
 
// are we inside a group?
if (!empty($this->_inGroup)) {
$varName = $this->_formName.'_'.str_replace(array('[', ']'), '_', $name);
if (substr($varName, -2) == '__') {
// element name is of type : group[]
$varName = $this->_inGroup.'_'.$this->_elementIndex.'_';
$this->_elementIndex++;
}
if ($varName != $this->_inGroup) {
$varName .= '_' == substr($varName, -1)? '': '_';
// element name is of type : group[name]
$label = $element->getLabel();
$html = $element->toHtml();
 
if ($required && !$element->isFrozen()) {
$this->_renderRequired($label, $html);
$this->_showRequired = true;
}
if (!empty($label)) {
if (is_array($label)) {
foreach ($label as $key => $value) {
$this->_tpl->setVariable($varName.'label_'.$key, $value);
}
} else {
$this->_tpl->setVariable($varName.'label', $label);
}
}
$this->_tpl->setVariable($varName.'html', $html);
}
 
} else {
 
$name = str_replace(array('[', ']'), array('_', ''), $name);
 
if (isset($this->_duplicateElements[$name])) {
// Element is a duplicate
$varName = $this->_formName.'_'.$name.'_'.$this->_duplicateElements[$name];
$this->_duplicateElements[$name]++;
} else {
$varName = $this->_formName.'_'.$name;
}
 
$label = $element->getLabel();
$html = $element->toHtml();
 
if ($required) {
$this->_showRequired = true;
$this->_renderRequired($label, $html);
}
if (!empty($error)) {
$this->_renderError($label, $html, $error);
}
if (is_array($label)) {
foreach ($label as $key => $value) {
$this->_tpl->setVariable($varName.'_label_'.$key, $value);
}
} else {
$this->_tpl->setVariable($varName.'_label', $label);
}
$this->_tpl->setVariable($varName.'_html', $html);
}
} // end func renderElement
 
/**
* Called when visiting a hidden element
*
* @param object An HTML_QuickForm_hidden object being visited
* @access public
* @return void
*/
function renderHidden(&$element)
{
if ($this->_tpl->placeholderExists($this->_formName . '_hidden')) {
$this->_hidden .= $element->toHtml();
} else {
$name = $element->getName();
$name = str_replace(array('[', ']'), array('_', ''), $name);
$this->_tpl->setVariable($this->_formName.'_'.$name.'_html', $element->toHtml());
}
} // end func renderHidden
 
/**
* Called when visiting a group, before processing any group elements
*
* @param object An HTML_QuickForm_group object being visited
* @param bool Whether a group is required
* @param string An error message associated with a group
* @access public
* @return void
*/
function startGroup(&$group, $required, $error)
{
$name = $group->getName();
$varName = $this->_formName.'_'.$name;
 
$this->_elementIndex = 0;
 
$html = $this->_tpl->placeholderExists($varName.'_html') ? $group->toHtml() : '';
$label = $group->getLabel();
 
if ($required) {
$this->_renderRequired($label, $html);
}
if (!empty($error)) {
$this->_renderError($label, $html, $error);
}
if (!empty($html)) {
$this->_tpl->setVariable($varName.'_html', $html);
} else {
// Uses error blocks to set the special groups layout error
// <!-- BEGIN form_group_error -->{form_group_error}<!-- END form_group_error -->
if (!empty($error)) {
if ($this->_tpl->placeholderExists($varName.'_error')) {
if ($this->_tpl->blockExists($this->_formName . '_error_block')) {
$this->_tpl->setVariable($this->_formName . '_error', $error);
$error = $this->_getTplBlock($this->_formName . '_error_block');
} elseif (strpos($this->_error, '{html}') !== false || strpos($this->_error, '{label}') !== false) {
$error = str_replace('{error}', $error, $this->_error);
}
}
$this->_tpl->setVariable($varName . '_error', $error);
array_pop($this->_errors);
}
}
if (is_array($label)) {
foreach ($label as $key => $value) {
$this->_tpl->setVariable($varName.'_label_'.$key, $value);
}
} else {
$this->_tpl->setVariable($varName.'_label', $label);
}
$this->_inGroup = $varName;
} // end func startGroup
 
/**
* Called when visiting a group, after processing all group elements
*
* @param object An HTML_QuickForm_group object being visited
* @access public
* @return void
*/
function finishGroup(&$group)
{
$this->_inGroup = '';
} // end func finishGroup
 
/**
* Sets the way required elements are rendered
*
* You can use {label} or {html} placeholders to let the renderer know where
* where the element label or the element html are positionned according to the
* required tag. They will be replaced accordingly with the right value.
* For example:
* <font color="red">*</font>{label}
* will put a red star in front of the label if the element is required.
*
* @param string The required element template
* @access public
* @return void
*/
function setRequiredTemplate($template)
{
$this->_required = $template;
} // end func setRequiredTemplate
 
/**
* Sets the way elements with validation errors are rendered
*
* You can use {label} or {html} placeholders to let the renderer know where
* where the element label or the element html are positionned according to the
* error message. They will be replaced accordingly with the right value.
* The error message will replace the {error} place holder.
* For example:
* <font color="red">{error}</font><br />{html}
* will put the error message in red on top of the element html.
*
* If you want all error messages to be output in the main error block, do not specify
* {html} nor {label}.
*
* Groups can have special layouts. With this kind of groups, the renderer will need
* to know where to place the error message. In this case, use error blocks like:
* <!-- BEGIN form_group_error -->{form_group_error}<!-- END form_group_error -->
* where you want the error message to appear in the form.
*
* @param string The element error template
* @access public
* @return void
*/
function setErrorTemplate($template)
{
$this->_error = $template;
} // end func setErrorTemplate
 
/**
* Called when an element is required
*
* This method will add the required tag to the element label and/or the element html
* such as defined with the method setRequiredTemplate
*
* @param string The element label
* @param string The element html rendering
* @see setRequiredTemplate()
* @access private
* @return void
*/
function _renderRequired(&$label, &$html)
{
if ($this->_tpl->blockExists($tplBlock = $this->_formName . '_required_block')) {
if (!empty($label) && $this->_tpl->placeholderExists($this->_formName . '_label', $tplBlock)) {
$this->_tpl->setVariable($this->_formName . '_label', is_array($label)? $label[0]: $label);
if (is_array($label)) {
$label[0] = $this->_getTplBlock($tplBlock);
} else {
$label = $this->_getTplBlock($tplBlock);
}
}
if (!empty($html) && $this->_tpl->placeholderExists($this->_formName . '_html', $tplBlock)) {
$this->_tpl->setVariable($this->_formName . '_html', $html);
$html = $this->_getTplBlock($tplBlock);
}
} else {
if (!empty($label) && strpos($this->_required, '{label}') !== false) {
if (is_array($label)) {
$label[0] = str_replace('{label}', $label[0], $this->_required);
} else {
$label = str_replace('{label}', $label, $this->_required);
}
}
if (!empty($html) && strpos($this->_required, '{html}') !== false) {
$html = str_replace('{html}', $html, $this->_required);
}
}
} // end func _renderRequired
 
/**
* Called when an element has a validation error
*
* This method will add the error message to the element label or the element html
* such as defined with the method setErrorTemplate. If the error placeholder is not found
* in the template, the error will be displayed in the form error block.
*
* @param string The element label
* @param string The element html rendering
* @param string The element error
* @see setErrorTemplate()
* @access private
* @return void
*/
function _renderError(&$label, &$html, $error)
{
if ($this->_tpl->blockExists($tplBlock = $this->_formName . '_error_block')) {
$this->_tpl->setVariable($this->_formName . '_error', $error);
if (!empty($label) && $this->_tpl->placeholderExists($this->_formName . '_label', $tplBlock)) {
$this->_tpl->setVariable($this->_formName . '_label', is_array($label)? $label[0]: $label);
if (is_array($label)) {
$label[0] = $this->_getTplBlock($tplBlock);
} else {
$label = $this->_getTplBlock($tplBlock);
}
} elseif (!empty($html) && $this->_tpl->placeholderExists($this->_formName . '_html', $tplBlock)) {
$this->_tpl->setVariable($this->_formName . '_html', $html);
$html = $this->_getTplBlock($tplBlock);
}
// clean up after ourselves
$this->_tpl->setVariable($this->_formName . '_error', null);
} elseif (!empty($label) && strpos($this->_error, '{label}') !== false) {
if (is_array($label)) {
$label[0] = str_replace(array('{label}', '{error}'), array($label[0], $error), $this->_error);
} else {
$label = str_replace(array('{label}', '{error}'), array($label, $error), $this->_error);
}
} elseif (!empty($html) && strpos($this->_error, '{html}') !== false) {
$html = str_replace(array('{html}', '{error}'), array($html, $error), $this->_error);
} else {
$this->_errors[] = $error;
}
}// end func _renderError
 
 
/**
* Returns the block's contents
*
* The method is needed because ITX and Sigma implement clearing
* the block contents on get() a bit differently
*
* @param string Block name
* @return string Block contents
*/
function _getTplBlock($block)
{
$this->_tpl->parse($block);
if (is_a($this->_tpl, 'html_template_sigma')) {
$ret = $this->_tpl->get($block, true);
} else {
$oldClear = $this->_tpl->clearCache;
$this->_tpl->clearCache = true;
$ret = $this->_tpl->get($block);
$this->_tpl->clearCache = $oldClear;
}
return $ret;
}
} // end class HTML_QuickForm_Renderer_ITStatic
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/Renderer/Object.php
New file
0,0 → 1,432
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Ron McClain <ron@humaniq.com> |
// +----------------------------------------------------------------------+
//
// $Id: Object.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once('HTML/QuickForm/Renderer.php');
 
/**
* A concrete renderer for HTML_QuickForm, makes an object from form contents
*
* Based on HTML_Quickform_Renderer_Array code
*
* @access public
*/
class HTML_QuickForm_Renderer_Object extends HTML_QuickForm_Renderer
{
/**
* The object being generated
* @var object $_obj
*/
var $_obj= null;
 
/**
* Number of sections in the form (i.e. number of headers in it)
* @var integer $_sectionCount
*/
var $_sectionCount;
 
/**
* Current section number
* @var integer $_currentSection
*/
var $_currentSection;
 
/**
* Object representing current group
* @var object $_currentGroup
*/
var $_currentGroup = null;
 
/**
* Class of Element Objects
* @var object $_elementType
*/
var $_elementType = 'QuickFormElement';
 
/**
* Additional style information for different elements
* @var array $_elementStyles
*/
var $_elementStyles = array();
 
/**
* true: collect all hidden elements into string; false: process them as usual form elements
* @var bool $_collectHidden
*/
var $_collectHidden = false;
 
 
/**
* Constructor
*
* @param collecthidden bool true: collect all hidden elements
* @access public
*/
function HTML_QuickForm_Renderer_Object($collecthidden = false)
{
$this->HTML_QuickForm_Renderer();
$this->_collectHidden = $collecthidden;
$this->_obj = new QuickformForm;
}
 
/**
* Return the rendered Object
* @access public
*/
function toObject()
{
return $this->_obj;
}
 
/**
* Set the class of the form elements. Defaults to QuickformElement.
* @param type string Name of element class
* @access public
*/
function setElementType($type)
{
$this->_elementType = $type;
}
 
function startForm(&$form)
{
$this->_obj->frozen = $form->isFrozen();
$this->_obj->javascript = $form->getValidationScript();
$this->_obj->attributes = $form->getAttributes(true);
$this->_obj->requirednote = $form->getRequiredNote();
$this->_obj->errors = new StdClass;
 
if($this->_collectHidden) {
$this->_obj->hidden = '';
}
$this->_elementIdx = 1;
$this->_currentSection = null;
$this->_sectionCount = 0;
} // end func startForm
 
function renderHeader(&$header)
{
$hobj = new StdClass;
$hobj->header = $header->toHtml();
$this->_obj->sections[$this->_sectionCount] = $hobj;
$this->_currentSection = $this->_sectionCount++;
}
 
function renderElement(&$element, $required, $error)
{
$elObj = $this->_elementToObject($element, $required, $error);
if(!empty($error)) {
$name = $elObj->name;
$this->_obj->errors->$name = $error;
}
$this->_storeObject($elObj);
} // end func renderElement
 
function renderHidden(&$element)
{
if($this->_collectHidden) {
$this->_obj->hidden .= $element->toHtml() . "\n";
} else {
$this->renderElement($element, false, null);
}
} //end func renderHidden
 
function startGroup(&$group, $required, $error)
{
$this->_currentGroup = $this->_elementToObject($group, $required, $error);
if(!empty($error)) {
$name = $this->_currentGroup->name;
$this->_obj->errors->$name = $error;
}
} // end func startGroup
 
function finishGroup(&$group)
{
$this->_storeObject($this->_currentGroup);
$this->_currentGroup = null;
} // end func finishGroup
 
/**
* Creates an object representing an element
*
* @access private
* @param element object An HTML_QuickForm_element object
* @param required bool Whether an element is required
* @param error string Error associated with the element
* @return object
*/
function _elementToObject(&$element, $required, $error)
{
if($this->_elementType) {
$ret = new $this->_elementType;
}
$ret->name = $element->getName();
$ret->value = $element->getValue();
$ret->type = $element->getType();
$ret->frozen = $element->isFrozen();
$labels = $element->getLabel();
if (is_array($labels)) {
$ret->label = array_shift($labels);
foreach ($labels as $key => $label) {
$key = is_int($key)? $key + 2: $key;
$ret->{'label_' . $key} = $label;
}
} else {
$ret->label = $labels;
}
$ret->required = $required;
$ret->error = $error;
 
if(isset($this->_elementStyles[$ret->name])) {
$ret->style = $this->_elementStyles[$ret->name];
$ret->styleTemplate = "styles/". $ret->style .".html";
}
if($ret->type == 'group') {
$ret->separator = $element->_separator;
$ret->elements = array();
} else {
$ret->html = $element->toHtml();
}
return $ret;
}
 
/**
* Stores an object representation of an element in the form array
*
* @access private
* @param elObj object Object representation of an element
* @return void
*/
function _storeObject($elObj)
{
$name = $elObj->name;
if(is_object($this->_currentGroup) && $elObj->type != 'group') {
$this->_currentGroup->elements[] = $elObj;
} elseif (isset($this->_currentSection)) {
$this->_obj->sections[$this->_currentSection]->elements[] = $elObj;
} else {
$this->_obj->elements[] = $elObj;
}
}
 
function setElementStyle($elementName, $styleName = null)
{
if(is_array($elementName)) {
$this->_elementStyles = array_merge($this->_elementStyles, $elementName);
} else {
$this->_elementStyles[$elementName] = $styleName;
}
}
 
} // end class HTML_QuickForm_Renderer_Object
 
 
 
/**
* Convenience class for the form object passed to outputObject()
*
* Eg.
* {form.outputJavaScript():h}
* {form.outputHeader():h}
* <table>
* <tr>
* <td>{form.name.label:h}</td><td>{form.name.html:h}</td>
* </tr>
* </table>
* </form>
*/
class QuickformForm
{
/**
* Whether the form has been frozen
* @var boolean $frozen
*/
var $frozen;
 
/**
* Javascript for client-side validation
* @var string $javascript
*/
var $javascript;
 
/**
* Attributes for form tag
* @var string $attributes
*/
var $attributes;
 
/**
* Note about required elements
* @var string $requirednote
*/
var $requirednote;
 
/**
* Collected html of all hidden variables
* @var string $hidden
*/
var $hidden;
 
/**
* Set if there were validation errors.
* StdClass object with element names for keys and their
* error messages as values
* @var object $errors
*/
var $errors;
 
/**
* Array of QuickformElementObject elements. If there are headers in the form
* this will be empty and the elements will be in the
* separate sections
* @var array $elements
*/
var $elements;
 
/**
* Array of sections contained in the document
* @var array $sections
*/
var $sections;
 
/**
* Output &lt;form&gt; header
* {form.outputHeader():h}
* @return string &lt;form attributes&gt;
*/
function outputHeader()
{
return "<form " . $this->attributes . ">\n";
}
 
/**
* Output form javascript
* {form.outputJavaScript():h}
* @return string Javascript
*/
function outputJavaScript()
{
return $this->javascript;
}
} // end class QuickformForm
 
 
/**
* Convenience class describing a form element.
* The properties defined here will be available from
* your flexy templates by referencing
* {form.zip.label:h}, {form.zip.html:h}, etc.
*/
class QuickformElement
{
/**
* Element name
* @var string $name
*/
var $name;
 
/**
* Element value
* @var mixed $value
*/
var $value;
 
/**
* Type of element
* @var string $type
*/
var $type;
 
/**
* Whether the element is frozen
* @var boolean $frozen
*/
var $frozen;
 
/**
* Label for the element
* @var string $label
*/
var $label;
 
/**
* Whether element is required
* @var boolean $required
*/
var $required;
 
/**
* Error associated with the element
* @var string $error
*/
var $error;
 
/**
* Some information about element style
* @var string $style
*/
var $style;
 
/**
* HTML for the element
* @var string $html
*/
var $html;
 
/**
* If element is a group, the group separator
* @var mixed $separator
*/
var $separator;
 
/**
* If element is a group, an array of subelements
* @var array $elements
*/
var $elements;
 
function isType($type)
{
return ($this->type == $type);
}
 
function notFrozen()
{
return !$this->frozen;
}
 
function isButton()
{
return ($this->type == "submit" || $this->type == "reset");
}
 
 
/**
* XXX: why does it use Flexy when all other stuff here does not depend on it?
*/
function outputStyle()
{
ob_start();
HTML_Template_Flexy::staticQuickTemplate('styles/' . $this->style . '.html', $this);
$ret = ob_get_contents();
ob_end_clean();
return $ret;
}
} // end class QuickformElement
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/Renderer/Array.php
New file
0,0 → 1,319
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Alexey Borzov <borz_off@cs.msu.su> |
// | Adam Daniel <adaniel1@eesus.jnj.com> |
// | Bertrand Mansion <bmansion@mamasam.com> |
// | Thomas Schulz <ths@4bconsult.de> |
// +----------------------------------------------------------------------+
//
// $Id: Array.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once 'HTML/QuickForm/Renderer.php';
 
/**
* A concrete renderer for HTML_QuickForm, makes an array of form contents
*
* Based on old toArray() code.
*
* The form array structure is the following:
* array(
* 'frozen' => 'whether the form is frozen',
* 'javascript' => 'javascript for client-side validation',
* 'attributes' => 'attributes for <form> tag',
* 'requirednote => 'note about the required elements',
* // if we set the option to collect hidden elements
* 'hidden' => 'collected html of all hidden elements',
* // if there were some validation errors:
* 'errors' => array(
* '1st element name' => 'Error for the 1st element',
* ...
* 'nth element name' => 'Error for the nth element'
* ),
* // if there are no headers in the form:
* 'elements' => array(
* element_1,
* ...
* element_N
* )
* // if there are headers in the form:
* 'sections' => array(
* array(
* 'header' => 'Header text for the first header',
* 'name' => 'Header name for the first header',
* 'elements' => array(
* element_1,
* ...
* element_K1
* )
* ),
* ...
* array(
* 'header' => 'Header text for the Mth header',
* 'name' => 'Header name for the Mth header',
* 'elements' => array(
* element_1,
* ...
* element_KM
* )
* )
* )
* );
*
* where element_i is an array of the form:
* array(
* 'name' => 'element name',
* 'value' => 'element value',
* 'type' => 'type of the element',
* 'frozen' => 'whether element is frozen',
* 'label' => 'label for the element',
* 'required' => 'whether element is required',
* 'error' => 'error associated with the element',
* 'style' => 'some information about element style (e.g. for Smarty)',
* // if element is not a group
* 'html' => 'HTML for the element'
* // if element is a group
* 'separator' => 'separator for group elements',
* 'elements' => array(
* element_1,
* ...
* element_N
* )
* );
*
* @access public
*/
class HTML_QuickForm_Renderer_Array extends HTML_QuickForm_Renderer
{
/**
* An array being generated
* @var array
*/
var $_ary;
 
/**
* Number of sections in the form (i.e. number of headers in it)
* @var integer
*/
var $_sectionCount;
 
/**
* Current section number
* @var integer
*/
var $_currentSection;
 
/**
* Array representing current group
* @var array
*/
var $_currentGroup = null;
 
/**
* Additional style information for different elements
* @var array
*/
var $_elementStyles = array();
 
/**
* true: collect all hidden elements into string; false: process them as usual form elements
* @var bool
*/
var $_collectHidden = false;
 
/**
* true: render an array of labels to many labels, $key 0 named 'label', the rest "label_$key"
* false: leave labels as defined
* @var bool
*/
var $staticLabels = false;
 
/**
* Constructor
*
* @param bool true: collect all hidden elements into string; false: process them as usual form elements
* @param bool true: render an array of labels to many labels, $key 0 to 'label' and the oterh to "label_$key"
* @access public
*/
function HTML_QuickForm_Renderer_Array($collectHidden = false, $staticLabels = false)
{
$this->HTML_QuickForm_Renderer();
$this->_collectHidden = $collectHidden;
$this->_staticLabels = $staticLabels;
} // end constructor
 
 
/**
* Returns the resultant array
*
* @access public
* @return array
*/
function toArray()
{
return $this->_ary;
}
 
 
function startForm(&$form)
{
$this->_ary = array(
'frozen' => $form->isFrozen(),
'javascript' => $form->getValidationScript(),
'attributes' => $form->getAttributes(true),
'requirednote' => $form->getRequiredNote(),
'errors' => array()
);
if ($this->_collectHidden) {
$this->_ary['hidden'] = '';
}
$this->_elementIdx = 1;
$this->_currentSection = null;
$this->_sectionCount = 0;
} // end func startForm
 
 
function renderHeader(&$header)
{
$this->_ary['sections'][$this->_sectionCount] = array(
'header' => $header->toHtml(),
'name' => $header->getName()
);
$this->_currentSection = $this->_sectionCount++;
} // end func renderHeader
 
 
function renderElement(&$element, $required, $error)
{
$elAry = $this->_elementToArray($element, $required, $error);
if (!empty($error)) {
$this->_ary['errors'][$elAry['name']] = $error;
}
$this->_storeArray($elAry);
} // end func renderElement
 
 
function renderHidden(&$element)
{
if ($this->_collectHidden) {
$this->_ary['hidden'] .= $element->toHtml() . "\n";
} else {
$this->renderElement($element, false, null);
}
} // end func renderHidden
 
 
function startGroup(&$group, $required, $error)
{
$this->_currentGroup = $this->_elementToArray($group, $required, $error);
if (!empty($error)) {
$this->_ary['errors'][$this->_currentGroup['name']] = $error;
}
} // end func startGroup
 
 
function finishGroup(&$group)
{
$this->_storeArray($this->_currentGroup);
$this->_currentGroup = null;
} // end func finishGroup
 
 
/**
* Creates an array representing an element
*
* @access private
* @param object An HTML_QuickForm_element object
* @param bool Whether an element is required
* @param string Error associated with the element
* @return array
*/
function _elementToArray(&$element, $required, $error)
{
$ret = array(
'name' => $element->getName(),
'value' => $element->getValue(),
'type' => $element->getType(),
'frozen' => $element->isFrozen(),
'required' => $required,
'error' => $error
);
// render label(s)
$labels = $element->getLabel();
if (is_array($labels) && $this->_staticLabels) {
foreach($labels as $key => $label) {
$key = is_int($key)? $key + 1: $key;
if (1 === $key) {
$ret['label'] = $label;
} else {
$ret['label_' . $key] = $label;
}
}
} else {
$ret['label'] = $labels;
}
 
// set the style for the element
if (isset($this->_elementStyles[$ret['name']])) {
$ret['style'] = $this->_elementStyles[$ret['name']];
}
if ('group' == $ret['type']) {
$ret['separator'] = $element->_separator;
$ret['elements'] = array();
} else {
$ret['html'] = $element->toHtml();
}
return $ret;
}
 
 
/**
* Stores an array representation of an element in the form array
*
* @access private
* @param array Array representation of an element
* @return void
*/
function _storeArray($elAry)
{
// where should we put this element...
if (is_array($this->_currentGroup) && ('group' != $elAry['type'])) {
$this->_currentGroup['elements'][] = $elAry;
} elseif (isset($this->_currentSection)) {
$this->_ary['sections'][$this->_currentSection]['elements'][] = $elAry;
} else {
$this->_ary['elements'][] = $elAry;
}
}
 
 
/**
* Sets a style to use for element rendering
*
* @param mixed element name or array ('element name' => 'style name')
* @param string style name if $elementName is not an array
* @access public
* @return void
*/
function setElementStyle($elementName, $styleName = null)
{
if (is_array($elementName)) {
$this->_elementStyles = array_merge($this->_elementStyles, $elementName);
} else {
$this->_elementStyles[$elementName] = $styleName;
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/Renderer/ArraySmarty.php
New file
0,0 → 1,376
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Alexey Borzov <borz_off@cs.msu.su> |
// | Bertrand Mansion <bmansion@mamasam.com> |
// | Thomas Schulz <ths@4bconsult.de> |
// +----------------------------------------------------------------------+
//
// $Id: ArraySmarty.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once 'HTML/QuickForm/Renderer/Array.php';
 
/**
* A static renderer for HTML_QuickForm, makes an array of form content
* useful for an Smarty template
*
* Based on old toArray() code and ITStatic renderer.
*
* The form array structure is the following:
* Array (
* [frozen] => whether the complete form is frozen'
* [javascript] => javascript for client-side validation
* [attributes] => attributes for <form> tag
* [hidden] => html of all hidden elements
* [requirednote] => note about the required elements
* [errors] => Array
* (
* [1st_element_name] => Error for the 1st element
* ...
* [nth_element_name] => Error for the nth element
* )
*
* [header] => Array
* (
* [1st_header_name] => Header text for the 1st header
* ...
* [nth_header_name] => Header text for the nth header
* )
*
* [1st_element_name] => Array for the 1st element
* ...
* [nth_element_name] => Array for the nth element
*
* // where an element array has the form:
* (
* [name] => element name
* [value] => element value,
* [type] => type of the element
* [frozen] => whether element is frozen
* [label] => label for the element
* [required] => whether element is required
* // if element is not a group:
* [html] => HTML for the element
* // if element is a group:
* [separator] => separator for group elements
* [1st_gitem_name] => Array for the 1st element in group
* ...
* [nth_gitem_name] => Array for the nth element in group
* )
* )
*
* @access public
*/
class HTML_QuickForm_Renderer_ArraySmarty extends HTML_QuickForm_Renderer_Array
{
/**
* The Smarty template engine instance
* @var object
*/
var $_tpl = null;
 
/**
* Current element index
* @var integer
*/
var $_elementIdx = 0;
 
/**
* The current element index inside a group
* @var integer
*/
var $_groupElementIdx = 0;
 
/**
* How to handle the required tag for required fields
* @var string
* @see setRequiredTemplate()
*/
var $_required = '';
 
/**
* How to handle error messages in form validation
* @var string
* @see setErrorTemplate()
*/
var $_error = '';
 
/**
* Constructor
*
* @param object reference to the Smarty template engine instance
* @param bool true: render an array of labels to many labels, $key 0 to 'label' and the oterh to "label_$key"
* @access public
*/
function HTML_QuickForm_Renderer_ArraySmarty(&$tpl, $staticLabels = false)
{
$this->HTML_QuickForm_Renderer_Array(true, $staticLabels);
$this->_tpl =& $tpl;
} // end constructor
 
/**
* Called when visiting a header element
*
* @param object An HTML_QuickForm_header element being visited
* @access public
* @return void
*/
function renderHeader(&$header)
{
if ($name = $header->getName()) {
$this->_ary['header'][$name] = $header->toHtml();
} else {
$this->_ary['header'][$this->_sectionCount] = $header->toHtml();
}
$this->_currentSection = $this->_sectionCount++;
} // end func renderHeader
 
/**
* Called when visiting a group, before processing any group elements
*
* @param object An HTML_QuickForm_group object being visited
* @param bool Whether a group is required
* @param string An error message associated with a group
* @access public
* @return void
*/
function startGroup(&$group, $required, $error)
{
parent::startGroup($group, $required, $error);
$this->_groupElementIdx = 1;
} // end func startGroup
 
/**
* Creates an array representing an element containing
* the key for storing this
*
* @access private
* @param object An HTML_QuickForm_element object
* @param bool Whether an element is required
* @param string Error associated with the element
* @return array
*/
function _elementToArray(&$element, $required, $error)
{
$ret = parent::_elementToArray($element, $required, $error);
 
if ('group' == $ret['type']) {
$ret['html'] = $element->toHtml();
// we don't need the elements, see the array structure
unset($ret['elements']);
}
if (($required || $error) && !empty($this->_required)){
$this->_renderRequired($ret['label'], $ret['html'], $required, $error);
}
if ($error && !empty($this->_error)) {
$this->_renderError($ret['label'], $ret['html'], $error);
$ret['error'] = $error;
}
// create keys for elements grouped by native group or name
if (strstr($ret['name'], '[') or $this->_currentGroup) {
preg_match('/([^]]*)\\[([^]]*)\\]/', $ret['name'], $matches);
if (isset($matches[1])) {
$sKeysSub = substr_replace($ret['name'], '', 0, strlen($matches[1]));
$sKeysSub = str_replace(
array('[' , ']', '[\'\']'),
array('[\'', '\']', '[]' ),
$sKeysSub
);
$sKeys = '[\'' . $matches[1] . '\']' . $sKeysSub;
} else {
$sKeys = '[\'' . $ret['name'] . '\']';
}
// special handling for elements in native groups
if ($this->_currentGroup) {
// skip unnamed group items unless radios: no name -> no static access
// identification: have the same key string as the parent group
if ($this->_currentGroup['keys'] == $sKeys and 'radio' != $ret['type']) {
return false;
}
// reduce string of keys by remove leading group keys
if (0 === strpos($sKeys, $this->_currentGroup['keys'])) {
$sKeys = substr_replace($sKeys, '', 0, strlen($this->_currentGroup['keys']));
}
}
// element without a name
} elseif ($ret['name'] == '') {
$sKeys = '[\'element_' . $this->_elementIdx . '\']';
// other elements
} else {
$sKeys = '[\'' . $ret['name'] . '\']';
}
// for radios: add extra key from value
if ('radio' == $ret['type'] and substr($sKeys, -2) != '[]') {
$sKeys .= '[\'' . $ret['value'] . '\']';
}
$this->_elementIdx++;
$ret['keys'] = $sKeys;
return $ret;
} // end func _elementToArray
 
/**
* Stores an array representation of an element in the form array
*
* @access private
* @param array Array representation of an element
* @return void
*/
function _storeArray($elAry)
{
if ($elAry) {
$sKeys = $elAry['keys'];
unset($elAry['keys']);
// where should we put this element...
if (is_array($this->_currentGroup) && ('group' != $elAry['type'])) {
$toEval = '$this->_currentGroup' . $sKeys . ' = $elAry;';
} else {
$toEval = '$this->_ary' . $sKeys . ' = $elAry;';
}
eval($toEval);
}
return;
}
 
/**
* Called when an element is required
*
* This method will add the required tag to the element label and/or the element html
* such as defined with the method setRequiredTemplate.
*
* @param string The element label
* @param string The element html rendering
* @param boolean The element required
* @param string The element error
* @see setRequiredTemplate()
* @access private
* @return void
*/
function _renderRequired(&$label, &$html, &$required, &$error)
{
$this->_tpl->assign(array(
'label' => $label,
'html' => $html,
'required' => $required,
'error' => $error
));
if (!empty($label) && strpos($this->_required, $this->_tpl->left_delimiter . '$label') !== false) {
$label = $this->_tplFetch($this->_required);
}
if (!empty($html) && strpos($this->_required, $this->_tpl->left_delimiter . '$html') !== false) {
$html = $this->_tplFetch($this->_required);
}
$this->_tpl->clear_assign(array('label', 'html', 'required'));
} // end func _renderRequired
 
/**
* Called when an element has a validation error
*
* This method will add the error message to the element label or the element html
* such as defined with the method setErrorTemplate. If the error placeholder is not found
* in the template, the error will be displayed in the form error block.
*
* @param string The element label
* @param string The element html rendering
* @param string The element error
* @see setErrorTemplate()
* @access private
* @return void
*/
function _renderError(&$label, &$html, &$error)
{
$this->_tpl->assign(array('label' => '', 'html' => '', 'error' => $error));
$error = $this->_tplFetch($this->_error);
$this->_tpl->assign(array('label' => $label, 'html' => $html));
 
if (!empty($label) && strpos($this->_error, $this->_tpl->left_delimiter . '$label') !== false) {
$label = $this->_tplFetch($this->_error);
} elseif (!empty($html) && strpos($this->_error, $this->_tpl->left_delimiter . '$html') !== false) {
$html = $this->_tplFetch($this->_error);
}
$this->_tpl->clear_assign(array('label', 'html', 'error'));
} // end func _renderError
 
/**
* Process an template sourced in a string with Smarty
*
* Smarty has no core function to render a template given as a string.
* So we use the smarty eval plugin function to do this.
*
* @param string The template source
* @access private
* @return void
*/
function _tplFetch($tplSource)
{
if (!function_exists('smarty_function_eval')) {
require SMARTY_DIR . '/plugins/function.eval.php';
}
return smarty_function_eval(array('var' => $tplSource), $this->_tpl);
}// end func _tplFetch
 
/**
* Sets the way required elements are rendered
*
* You can use {$label} or {$html} placeholders to let the renderer know where
* where the element label or the element html are positionned according to the
* required tag. They will be replaced accordingly with the right value. You
* can use the full smarty syntax here, especially a custom modifier for I18N.
* For example:
* {if $required}<span style="color: red;">*</span>{/if}{$label|translate}
* will put a red star in front of the label if the element is required and
* translate the label.
*
*
* @param string The required element template
* @access public
* @return void
*/
function setRequiredTemplate($template)
{
$this->_required = $template;
} // end func setRequiredTemplate
 
/**
* Sets the way elements with validation errors are rendered
*
* You can use {$label} or {$html} placeholders to let the renderer know where
* where the element label or the element html are positionned according to the
* error message. They will be replaced accordingly with the right value.
* The error message will replace the {$error} placeholder.
* For example:
* {if $error}<span style="color: red;">{$error}</span>{/if}<br />{$html}
* will put the error message in red on top of the element html.
*
* If you want all error messages to be output in the main error block, use
* the {$form.errors} part of the rendered array that collects all raw error
* messages.
*
* If you want to place all error messages manually, do not specify {$html}
* nor {$label}.
*
* Groups can have special layouts. With this kind of groups, you have to
* place the formated error message manually. In this case, use {$form.group.error}
* where you want the formated error message to appear in the form.
*
* @param string The element error template
* @access public
* @return void
*/
function setErrorTemplate($template)
{
$this->_error = $template;
} // end func setErrorTemplate
}
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/Renderer/ObjectFlexy.php
New file
0,0 → 1,261
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Ron McClain <ron@humaniq.com> |
// +----------------------------------------------------------------------+
//
// $Id: ObjectFlexy.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once("HTML/QuickForm/Renderer/Object.php");
 
/**
* QuickForm renderer for Flexy template engine, static version.
*
* A static renderer for HTML_Quickform. Makes a QuickFormFlexyObject
* from the form content suitable for use with a Flexy template
*
* Usage:
* $form =& new HTML_QuickForm('form', 'POST');
* $template =& new HTML_Template_Flexy();
* $renderer =& new HTML_QuickForm_Renderer_ObjectFlexy(&$template);
* $renderer->setHtmlTemplate("html.html");
* $renderer->setLabelTemplate("label.html");
* $form->accept($renderer);
* $view = new StdClass;
* $view->form = $renderer->toObject();
* $template->compile("mytemplate.html");
*
* Based on the code for HTML_QuickForm_Renderer_ArraySmarty
*
* @see QuickFormFlexyObject
* @access public
*/
class HTML_QuickForm_Renderer_ObjectFlexy extends HTML_QuickForm_Renderer_Object
{
/**
* HTML_Template_Flexy instance
* @var object $_flexy
*/
var $_flexy;
 
/**
* Current element index
* @var integer $_elementIdx
*/
var $_elementIdx;
 
/**
* The current element index inside a group
* @var integer $_groupElementIdx
*/
var $_groupElementIdx = 0;
 
/**
* Name of template file for form html
* @var string $_html
* @see setRequiredTemplate()
*/
var $_html = '';
 
/**
* Name of template file for form labels
* @var string $label
* @see setErrorTemplate()
*/
var $label = '';
 
/**
* Class of the element objects, so you can add your own
* element methods
* @var string $_elementType
*/
var $_elementType = 'QuickformFlexyElement';
 
/**
* Constructor
*
* @param $flexy object HTML_Template_Flexy instance
* @public
*/
function HTML_QuickForm_Renderer_ObjectFlexy(&$flexy)
{
$this->HTML_QuickForm_Renderer_Object(true);
$this->_obj = new QuickformFlexyForm();
$this->_flexy =& $flexy;
} // end constructor
 
function renderHeader(&$header)
{
if($name = $header->getName()) {
$this->_obj->header->$name = $header->toHtml();
} else {
$this->_obj->header[$this->_sectionCount] = $header->toHtml();
}
$this->_currentSection = $this->_sectionCount++;
} // end func renderHeader
 
function startGroup(&$group, $required, $error)
{
parent::startGroup($group, $required, $error);
$this->_groupElementIdx = 1;
} //end func startGroup
 
/**
* Creates an object representing an element containing
* the key for storing this
*
* @access private
* @param element object An HTML_QuickForm_element object
* @param required bool Whether an element is required
* @param error string Error associated with the element
* @return object
*/
function _elementToObject(&$element, $required, $error)
{
$ret = parent::_elementToObject($element, $required, $error);
if($ret->type == 'group') {
$ret->html = $element->toHtml();
unset($ret->elements);
}
if(!empty($this->_label)) {
$this->_renderLabel($ret);
}
 
if(!empty($this->_html)) {
$this->_renderHtml($ret);
$ret->error = $error;
}
 
// Create an element key from the name
if (false !== ($pos = strpos($ret->name, '[')) || is_object($this->_currentGroup)) {
if (!$pos) {
$keys = '->{\'' . $ret->name . '\'}';
} else {
$keys = '->{\'' . str_replace(array('[', ']'), array('\'}->{\'', ''), $ret->name) . '\'}';
}
// special handling for elements in native groups
if (is_object($this->_currentGroup)) {
// skip unnamed group items unless radios: no name -> no static access
// identification: have the same key string as the parent group
if ($this->_currentGroup->keys == $keys && 'radio' != $ret->type) {
return false;
}
// reduce string of keys by remove leading group keys
if (0 === strpos($keys, $this->_currentGroup->keys)) {
$keys = substr_replace($keys, '', 0, strlen($this->_currentGroup->keys));
}
}
} elseif (0 == strlen($ret->name)) {
$keys = '->{\'element_' . $this->_elementIdx . '\'}';
} else {
$keys = '->{\'' . $ret->name . '\'}';
}
// for radios: add extra key from value
if ('radio' == $ret->type && '[]' != substr($keys, -2)) {
$keys .= '->{\'' . $ret->value . '\'}';
}
$ret->keys = $keys;
$this->_elementIdx++;
return $ret;
}
 
/**
* Stores an object representation of an element in the
* QuickformFormObject instance
*
* @access private
* @param elObj object Object representation of an element
* @return void
*/
function _storeObject($elObj)
{
if ($elObj) {
$keys = $elObj->keys;
unset($elObj->keys);
if(is_object($this->_currentGroup) && ('group' != $elObj->type)) {
$code = '$this->_currentGroup' . $keys . ' = $elObj;';
} else {
$code = '$this->_obj' . $keys . ' = $elObj;';
}
eval($code);
}
}
 
/**
* Set the filename of the template to render html elements.
* In your template, {html} is replaced by the unmodified html.
* If the element is required, {required} will be true.
* Eg.
* {if:error}
* <font color="red" size="1">{error:h}</font><br />
* {end:}
* {html:h}
*
* @access public
* @param template string Filename of template
* @return void
*/
function setHtmlTemplate($template)
{
$this->_html = $template;
}
 
/**
* Set the filename of the template to render form labels
* In your template, {label} is replaced by the unmodified label.
* {error} will be set to the error, if any. {required} will
* be true if this is a required field
* Eg.
* {if:required}
* <font color="orange" size="1">*</font>
* {end:}
* {label:h}
*
* @access public
* @param template string Filename of template
* @return void
*/
function setLabelTemplate($template)
{
$this->_label = $template;
}
 
function _renderLabel(&$ret)
{
$this->_flexy->compile($this->_label);
$ret->label = $this->_flexy->bufferedOutputObject($ret);
}
 
function _renderHtml(&$ret)
{
$this->_flexy->compile($this->_html);
$ret->html = $this->_flexy->bufferedOutputObject($ret);
}
} // end class HTML_QuickForm_Renderer_ObjectFlexy
 
/**
* Adds nothing to QuickformForm, left for backwards compatibility
*/
class QuickformFlexyForm extends QuickformForm
{
}
 
/**
* Adds nothing to QuickformElement, left for backwards compatibility
*/
class QuickformFlexyElement extends QuickformElement
{
}
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/Rule/Compare.php
New file
0,0 → 1,95
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Alexey Borzov <avb@php.net> |
// +----------------------------------------------------------------------+
//
// $Id: Compare.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once 'HTML/QuickForm/Rule.php';
 
/**
* Rule to compare two form fields
*
* The most common usage for this is to ensure that the password
* confirmation field matches the password field
*
* @access public
* @package HTML_QuickForm
* @version $Revision: 1.2 $
*/
class HTML_QuickForm_Rule_Compare extends HTML_QuickForm_Rule
{
/**
* Possible operators to use
* @var array
* @access private
*/
var $_operators = array(
'eq' => '==',
'neq' => '!=',
'gt' => '>',
'gte' => '>=',
'lt' => '<',
'lte' => '<='
);
 
 
/**
* Returns the operator to use for comparing the values
*
* @access private
* @param string operator name
* @return string operator to use for validation
*/
function _findOperator($name)
{
if (empty($name)) {
return '==';
} elseif (isset($this->_operators[$name])) {
return $this->_operators[$name];
} elseif (in_array($name, $this->_operators)) {
return $name;
} else {
return '==';
}
}
 
 
function validate($values, $operator = null)
{
$operator = $this->_findOperator($operator);
if ('==' != $operator && '!=' != $operator) {
$compareFn = create_function('$a, $b', 'return floatval($a) ' . $operator . ' floatval($b);');
} else {
$compareFn = create_function('$a, $b', 'return $a ' . $operator . ' $b;');
}
return $compareFn($values[0], $values[1]);
}
 
 
function getValidationScript($operator = null)
{
$operator = $this->_findOperator($operator);
if ('==' != $operator && '!=' != $operator) {
$check = "!(Number({jsVar}[0]) {$operator} Number({jsVar}[1]))";
} else {
$check = "!({jsVar}[0] {$operator} {jsVar}[1])";
}
return array('', "'' != {jsVar}[0] && {$check}");
}
}
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/Rule/Email.php
New file
0,0 → 1,61
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: Email.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once('HTML/QuickForm/Rule.php');
 
/**
* Email validation rule
* @version 1.0
*/
class HTML_QuickForm_Rule_Email extends HTML_QuickForm_Rule
{
var $regex = '/^((\"[^\"\f\n\r\t\v\b]+\")|([\w\!\#\$\%\&\'\*\+\-\~\/\^\`\|\{\}]+(\.[\w\!\#\$\%\&\'\*\+\-\~\/\^\`\|\{\}]+)*))@((\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))\])|(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))|((([A-Za-z0-9\-])+\.)+[A-Za-z\-]+))$/';
 
/**
* Validates an email address
*
* @param string $email Email address
* @param boolean $checkDomain True if dns check should be performed
* @access public
* @return boolean true if email is valid
*/
function validate($email, $checkDomain = false)
{
if (preg_match($this->regex, $email)) {
if ($checkDomain && function_exists('checkdnsrr')) {
$tokens = explode('@', $email);
if (checkdnsrr($tokens[1], 'MX') || checkdnsrr($tokens[1], 'A')) {
return true;
}
return false;
}
return true;
}
return false;
} // end func validate
 
 
function getValidationScript($options = null)
{
return array(" var regex = " . $this->regex . ";\n", "{jsVar} != '' && !regex.test({jsVar})");
} // end func getValidationScript
 
} // end class HTML_QuickForm_Rule_Email
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/Rule/Regex.php
New file
0,0 → 1,89
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: Regex.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once('HTML/QuickForm/Rule.php');
 
/**
* Validates values using regular expressions
* @version 1.0
*/
class HTML_QuickForm_Rule_Regex extends HTML_QuickForm_Rule
{
/**
* Array of regular expressions
*
* Array is in the format:
* $_data['rulename'] = 'pattern';
*
* @var array
* @access private
*/
var $_data = array(
'lettersonly' => '/^[a-zA-Z]+$/',
'alphanumeric' => '/^[a-zA-Z0-9]+$/',
'numeric' => '/(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/',
'nopunctuation' => '/^[^().\/\*\^\?#!@$%+=,\"\'><~\[\]{}]+$/',
'nonzero' => '/^-?[1-9][0-9]*/'
);
 
/**
* Validates a value using a regular expression
*
* @param string $value Value to be checked
* @param string $regex Regular expression
* @access public
* @return boolean true if value is valid
*/
function validate($value, $regex = null)
{
if (isset($this->_data[$this->name])) {
if (!preg_match($this->_data[$this->name], $value)) {
return false;
}
} else {
if (!preg_match($regex, $value)) {
return false;
}
}
return true;
} // end func validate
 
/**
* Adds new regular expressions to the list
*
* @param string $name Name of rule
* @param string $pattern Regular expression pattern
* @access public
*/
function addData($name, $pattern)
{
$this->_data[$name] = $pattern;
} // end func addData
 
 
function getValidationScript($options = null)
{
$regex = isset($this->_data[$this->name]) ? $this->_data[$this->name] : $options;
 
return array(" var regex = " . $regex . ";\n", "{jsVar} != '' && !regex.test({jsVar})");
} // end func getValidationScript
 
} // end class HTML_QuickForm_Rule_Regex
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/Rule/Callback.php
New file
0,0 → 1,113
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: Callback.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once('HTML/QuickForm/Rule.php');
 
/**
* Validates values using callback functions or methods
* @version 1.0
*/
class HTML_QuickForm_Rule_Callback extends HTML_QuickForm_Rule
{
/**
* Array of callbacks
*
* Array is in the format:
* $_data['rulename'] = array('functionname', 'classname');
* If the callback is not a method, then the class name is not set.
*
* @var array
* @access private
*/
var $_data = array();
 
/**
* Whether to use BC mode for specific rules
*
* Previous versions of QF passed element's name as a first parameter
* to validation functions, but not to validation methods. This behaviour
* is emulated if you are using 'function' as rule type when registering.
*
* @var array
* @access private
*/
var $_BCMode = array();
 
/**
* Validates a value using a callback
*
* @param string $value Value to be checked
* @param mixed $options Options for callback
* @access public
* @return boolean true if value is valid
*/
function validate($value, $options = null)
{
if (isset($this->_data[$this->name])) {
$callback = $this->_data[$this->name];
if (isset($callback[1])) {
return call_user_func(array($callback[1], $callback[0]), $value, $options);
} elseif ($this->_BCMode[$this->name]) {
return $callback[0]('', $value, $options);
} else {
return $callback[0]($value, $options);
}
} elseif (is_callable($options)) {
return call_user_func($options, $value);
} else {
return true;
}
} // end func validate
 
/**
* Adds new callbacks to the callbacks list
*
* @param string $name Name of rule
* @param string $callback Name of function or method
* @param string $class Name of class containing the method
* @param bool $BCMode Backwards compatibility mode
* @access public
*/
function addData($name, $callback, $class = null, $BCMode = false)
{
if (!empty($class)) {
$this->_data[$name] = array($callback, $class);
} else {
$this->_data[$name] = array($callback);
}
$this->_BCMode[$name] = $BCMode;
} // end func addData
 
 
function getValidationScript($options = null)
{
if (isset($this->_data[$this->name])) {
$callback = $this->_data[$this->name][0];
$params = ($this->_BCMode[$this->name]? "'', {jsVar}": '{jsVar}') .
(isset($options)? ", '{$options}'": '');
} else {
$callback = is_array($options)? $options[1]: $options;
$params = '{jsVar}';
}
return array('', "{jsVar} != '' && !{$callback}({$params})");
} // end func getValidationScript
 
} // end class HTML_QuickForm_Rule_Callback
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/Rule/Range.php
New file
0,0 → 1,64
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: Range.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once('HTML/QuickForm/Rule.php');
 
/**
* Validates values using range comparison
* @version 1.0
*/
class HTML_QuickForm_Rule_Range extends HTML_QuickForm_Rule
{
/**
* Validates a value using a range comparison
*
* @param string $value Value to be checked
* @param mixed $options Int for length, array for range
* @access public
* @return boolean true if value is valid
*/
function validate($value, $options)
{
$length = strlen($value);
switch ($this->name) {
case 'minlength': return ($length >= $options);
case 'maxlength': return ($length <= $options);
default: return ($length >= $options[0] && $length <= $options[1]);
}
} // end func validate
 
 
function getValidationScript($options = null)
{
switch ($this->name) {
case 'minlength':
$test = '{jsVar}.length < '.$options;
break;
case 'maxlength':
$test = '{jsVar}.length > '.$options;
break;
default:
$test = '({jsVar}.length < '.$options[0].' || {jsVar}.length > '.$options[1].')';
}
return array('', "{jsVar} != '' && {$test}");
} // end func getValidationScript
 
} // end class HTML_QuickForm_Rule_Range
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/Rule/Required.php
New file
0,0 → 1,52
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: Required.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once('HTML/QuickForm/Rule.php');
 
/**
* Required elements validation
* @version 1.0
*/
class HTML_QuickForm_Rule_Required extends HTML_QuickForm_Rule
{
/**
* Checks if an element is empty
*
* @param string $value Value to check
* @param mixed $options Not used yet
* @access public
* @return boolean true if value is not empty
*/
function validate($value, $options = null)
{
if ((string)$value == '') {
return false;
}
return true;
} // end func validate
 
 
function getValidationScript($options = null)
{
return array('', "{jsVar} == ''");
} // end func getValidationScript
 
} // end class HTML_QuickForm_Rule_Required
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/advcheckbox.php
New file
0,0 → 1,283
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Adam Daniel <adaniel1@eesus.jnj.com> |
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: advcheckbox.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once('HTML/QuickForm/checkbox.php');
 
/**
* HTML class for an advanced checkbox type field
*
* Basically this fixes a problem that HTML has had
* where checkboxes can only pass a single value (the
* value of the checkbox when checked). A value for when
* the checkbox is not checked cannot be passed, and
* furthermore the checkbox variable doesn't even exist if
* the checkbox was submitted unchecked.
*
* It works by creating a hidden field with the passed-in name
* and creating the checkbox with no name, but with a javascript
* onclick which sets the value of the hidden field.
*
* @author Jason Rust <jrust@php.net>
* @since 2.0
* @access public
*/
class HTML_QuickForm_advcheckbox extends HTML_QuickForm_checkbox
{
// {{{ properties
 
/**
* The values passed by the hidden elment
*
* @var array
* @access private
*/
var $_values = null;
 
/**
* The default value
*
* @var boolean
* @access private
*/
var $_currentValue = null;
 
// }}}
// {{{ constructor
 
/**
* Class constructor
*
* @param string $elementName (optional)Input field name attribute
* @param string $elementLabel (optional)Input field label
* @param string $text (optional)Text to put after the checkbox
* @param mixed $attributes (optional)Either a typical HTML attribute string
* or an associative array
* @param mixed $values (optional)Values to pass if checked or not checked
*
* @since 1.0
* @access public
* @return void
*/
function HTML_QuickForm_advcheckbox($elementName=null, $elementLabel=null, $text=null, $attributes=null, $values=null)
{
$this->HTML_QuickForm_checkbox($elementName, $elementLabel, $text, $attributes);
$this->setValues($values);
} //end constructor
// }}}
// {{{ getPrivateName()
 
/**
* Gets the pribate name for the element
*
* @param string $elementName The element name to make private
*
* @access public
* @return string
*/
function getPrivateName($elementName)
{
return '__'.$elementName;
}
 
// }}}
// {{{ getOnclickJs()
 
/**
* Create the javascript for the onclick event which will
* set the value of the hidden field
*
* @param string $elementName The element name
*
* @access public
* @return string
*/
function getOnclickJs($elementName)
{
$onclickJs = 'if (this.checked) { this.form[\''.$elementName.'\'].value=\''.addcslashes($this->_values[1], '\'').'\'; }';
$onclickJs .= 'else { this.form[\''.$elementName.'\'].value=\''.addcslashes($this->_values[0], '\'').'\'; }';
return $onclickJs;
}
 
// }}}
// {{{ setValues()
 
/**
* Sets the values used by the hidden element
*
* @param mixed $values The values, either a string or an array
*
* @access public
* @return void
*/
function setValues($values)
{
if (empty($values)) {
// give it default checkbox behavior
$this->_values = array('', 1);
} elseif (is_scalar($values)) {
// if it's string, then assume the value to
// be passed is for when the element is checked
$this->_values = array('', $values);
} else {
$this->_values = $values;
}
$this->setChecked($this->_currentValue == $this->_values[1]);
}
 
// }}}
// {{{ setValue()
 
/**
* Sets the element's value
*
* @param mixed Element's value
* @access public
*/
function setValue($value)
{
$this->setChecked(isset($this->_values[1]) && $value == $this->_values[1]);
$this->_currentValue = $value;
}
 
// }}}
// {{{ getValue()
 
/**
* Returns the element's value
*
* @access public
* @return mixed
*/
function getValue()
{
if (is_array($this->_values)) {
return $this->_values[$this->getChecked()? 1: 0];
} else {
return null;
}
}
 
// }}}
// {{{ toHtml()
 
/**
* Returns the checkbox element in HTML
* and the additional hidden element in HTML
*
* @access public
* @return string
*/
function toHtml()
{
if ($this->_flagFrozen) {
return parent::toHtml();
} else {
$oldName = $this->getName();
$oldJs = $this->getAttribute('onclick');
$this->updateAttributes(array(
'name' => $this->getPrivateName($oldName),
'onclick' => $this->getOnclickJs($oldName) . ' ' . $oldJs
));
$html = parent::toHtml() . '<input' .
$this->_getAttrString(array(
'type' => 'hidden',
'name' => $oldName,
'value' => $this->getValue()
)) . ' />';
// revert the name and JS, in case this method will be called once more
$this->updateAttributes(array(
'name' => $oldName,
'onclick' => $oldJs
));
return $html;
}
} //end func toHtml
// }}}
// {{{ getFrozenHtml()
 
/**
* Unlike checkbox, this has to append a hidden input in both
* checked and non-checked states
*/
function getFrozenHtml()
{
return ($this->getChecked()? '<tt>[x]</tt>': '<tt>[ ]</tt>') .
$this->_getPersistantData();
}
 
// }}}
// {{{ onQuickFormEvent()
 
/**
* Called by HTML_QuickForm whenever form event is made on this element
*
* @param string $event Name of event
* @param mixed $arg event arguments
* @param object $caller calling object
* @since 1.0
* @access public
* @return void
*/
function onQuickFormEvent($event, $arg, &$caller)
{
switch ($event) {
case 'updateValue':
// constant values override both default and submitted ones
// default values are overriden by submitted
$value = $this->_findValue($caller->_constantValues);
if (null === $value) {
$value = $this->_findValue($caller->_submitValues);
if (null === $value) {
$value = $this->_findValue($caller->_defaultValues);
}
}
if (null !== $value) {
$this->setValue($value);
}
break;
default:
parent::onQuickFormEvent($event, $arg, $caller);
}
return true;
} // end func onQuickFormLoad
 
// }}}
// {{{ exportValue()
 
/**
* This element has a value even if it is not checked, thus we override
* checkbox's behaviour here
*/
function exportValue(&$submitValues, $assoc)
{
$value = $this->_findValue($submitValues);
if (null === $value) {
$value = $this->getValue();
} elseif (is_array($this->_values) && ($value != $this->_values[0]) && ($value != $this->_values[1])) {
$value = null;
}
return $this->_prepareValue($value, $assoc);
}
// }}}
} //end class HTML_QuickForm_advcheckbox
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/reset.php
New file
0,0 → 1,72
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Adam Daniel <adaniel1@eesus.jnj.com> |
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: reset.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once("HTML/QuickForm/input.php");
 
/**
* HTML class for a reset type element
*
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version 1.1
* @since PHP4.04pl1
* @access public
*/
class HTML_QuickForm_reset extends HTML_QuickForm_input
{
// {{{ constructor
/**
* Class constructor
*
* @param string $elementName (optional)Input field name attribute
* @param string $value (optional)Input field value
* @param mixed $attributes (optional)Either a typical HTML attribute string
* or an associative array
* @since 1.0
* @access public
* @return void
*/
function HTML_QuickForm_reset($elementName=null, $value=null, $attributes=null)
{
HTML_QuickForm_input::HTML_QuickForm_input($elementName, null, $attributes);
$this->setValue($value);
$this->setType('reset');
} //end constructor
 
// }}}
// {{{ freeze()
 
/**
* Freeze the element so that only its value is returned
*
* @access public
* @return void
*/
function freeze()
{
return false;
} //end func freeze
 
// }}}
 
} //end class HTML_QuickForm_reset
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/image.php
New file
0,0 → 1,119
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Adam Daniel <adaniel1@eesus.jnj.com> |
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: image.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
require_once("HTML/QuickForm/input.php");
 
/**
* HTML class for a image type element
*
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version 1.0
* @since PHP4.04pl1
* @access public
*/
class HTML_QuickForm_image extends HTML_QuickForm_input
{
// {{{ constructor
 
/**
* Class constructor
*
* @param string $elementName (optional)Element name attribute
* @param string $src (optional)Image source
* @param mixed $attributes (optional)Either a typical HTML attribute string
* or an associative array
* @since 1.0
* @access public
* @return void
*/
function HTML_QuickForm_image($elementName=null, $src='', $attributes=null)
{
HTML_QuickForm_input::HTML_QuickForm_input($elementName, null, $attributes);
$this->setType('image');
$this->setSource($src);
} // end class constructor
 
// }}}
// {{{ setSource()
 
/**
* Sets source for image element
*
* @param string $src source for image element
* @since 1.0
* @access public
* @return void
*/
function setSource($src)
{
$this->updateAttributes(array('src' => $src));
} // end func setSource
 
// }}}
// {{{ setBorder()
 
/**
* Sets border size for image element
*
* @param string $border border for image element
* @since 1.0
* @access public
* @return void
*/
function setBorder($border)
{
$this->updateAttributes(array('border' => $border));
} // end func setBorder
 
// }}}
// {{{ setAlign()
 
/**
* Sets alignment for image element
*
* @param string $align alignment for image element
* @since 1.0
* @access public
* @return void
*/
function setAlign($align)
{
$this->updateAttributes(array('align' => $align));
} // end func setAlign
 
// }}}
// {{{ freeze()
 
/**
* Freeze the element so that only its value is returned
*
* @access public
* @return void
*/
function freeze()
{
return false;
} //end func freeze
 
// }}}
 
} // end class HTML_QuickForm_image
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/text.php
New file
0,0 → 1,91
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Adam Daniel <adaniel1@eesus.jnj.com> |
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: text.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once("HTML/QuickForm/input.php");
 
/**
* HTML class for a text field
*
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version 1.0
* @since PHP4.04pl1
* @access public
*/
class HTML_QuickForm_text extends HTML_QuickForm_input
{
// {{{ constructor
 
/**
* Class constructor
*
* @param string $elementName (optional)Input field name attribute
* @param string $elementLabel (optional)Input field label
* @param mixed $attributes (optional)Either a typical HTML attribute string
* or an associative array
* @since 1.0
* @access public
* @return void
*/
function HTML_QuickForm_text($elementName=null, $elementLabel=null, $attributes=null)
{
HTML_QuickForm_input::HTML_QuickForm_input($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;
$this->setType('text');
} //end constructor
// }}}
// {{{ setSize()
 
/**
* Sets size of text field
*
* @param string $size Size of text field
* @since 1.3
* @access public
* @return void
*/
function setSize($size)
{
$this->updateAttributes(array('size'=>$size));
} //end func setSize
 
// }}}
// {{{ setMaxlength()
 
/**
* Sets maxlength of text field
*
* @param string $maxlength Maximum length of text field
* @since 1.3
* @access public
* @return void
*/
function setMaxlength($maxlength)
{
$this->updateAttributes(array('maxlength'=>$maxlength));
} //end func setMaxlength
 
// }}}
} //end class HTML_QuickForm_text
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/checkbox.php
New file
0,0 → 1,268
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Adam Daniel <adaniel1@eesus.jnj.com> |
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: checkbox.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once("HTML/QuickForm/input.php");
 
/**
* HTML class for a checkbox type field
*
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version 1.1
* @since PHP4.04pl1
* @access public
*/
class HTML_QuickForm_checkbox extends HTML_QuickForm_input
{
// {{{ properties
 
/**
* Checkbox display text
* @var string
* @since 1.1
* @access private
*/
var $_text = '';
 
// }}}
// {{{ constructor
 
/**
* Class constructor
*
* @param string $elementName (optional)Input field name attribute
* @param string $elementLabel (optional)Input field value
* @param string $text (optional)Checkbox display text
* @param mixed $attributes (optional)Either a typical HTML attribute string
* or an associative array
* @since 1.0
* @access public
* @return void
*/
function HTML_QuickForm_checkbox($elementName=null, $elementLabel=null, $text='', $attributes=null)
{
HTML_QuickForm_input::HTML_QuickForm_input($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;
$this->_text = $text;
$this->setType('checkbox');
$this->updateAttributes(array('value'=>1));
$this->_generateId();
} //end constructor
// }}}
// {{{ setChecked()
 
/**
* Sets whether a checkbox is checked
*
* @param bool $checked Whether the field is checked or not
* @since 1.0
* @access public
* @return void
*/
function setChecked($checked)
{
if (!$checked) {
$this->removeAttribute('checked');
} else {
$this->updateAttributes(array('checked'=>'checked'));
}
} //end func setChecked
 
// }}}
// {{{ getChecked()
 
/**
* Returns whether a checkbox is checked
*
* @since 1.0
* @access public
* @return bool
*/
function getChecked()
{
return (bool)$this->getAttribute('checked');
} //end func getChecked
// }}}
// {{{ toHtml()
 
/**
* Returns the checkbox element in HTML
*
* @since 1.0
* @access public
* @return string
*/
function toHtml()
{
if (0 == strlen($this->_text)) {
$label = '';
} elseif ($this->_flagFrozen) {
$label = $this->_text;
} else {
$label = '<label for="' . $this->getAttribute('id') . '">' . $this->_text . '</label>';
}
return HTML_QuickForm_input::toHtml() . $label;
} //end func toHtml
// }}}
// {{{ getFrozenHtml()
 
/**
* Returns the value of field without HTML tags
*
* @since 1.0
* @access public
* @return string
*/
function getFrozenHtml()
{
if ($this->getChecked()) {
return '<tt>[x]</tt>' .
$this->_getPersistantData();
} else {
return '<tt>[ ]</tt>';
}
} //end func getFrozenHtml
 
// }}}
// {{{ setText()
 
/**
* Sets the checkbox text
*
* @param string $text
* @since 1.1
* @access public
* @return void
*/
function setText($text)
{
$this->_text = $text;
} //end func setText
 
// }}}
// {{{ getText()
 
/**
* Returns the checkbox text
*
* @since 1.1
* @access public
* @return string
*/
function getText()
{
return $this->_text;
} //end func getText
 
// }}}
// {{{ setValue()
 
/**
* Sets the value of the form element
*
* @param string $value Default value of the form element
* @since 1.0
* @access public
* @return void
*/
function setValue($value)
{
return $this->setChecked($value);
} // end func setValue
 
// }}}
// {{{ getValue()
 
/**
* Returns the value of the form element
*
* @since 1.0
* @access public
* @return bool
*/
function getValue()
{
return $this->getChecked();
} // end func getValue
 
// }}}
// {{{ onQuickFormEvent()
 
/**
* Called by HTML_QuickForm whenever form event is made on this element
*
* @param string $event Name of event
* @param mixed $arg event arguments
* @param object $caller calling object
* @since 1.0
* @access public
* @return void
*/
function onQuickFormEvent($event, $arg, &$caller)
{
switch ($event) {
case 'updateValue':
// constant values override both default and submitted ones
// default values are overriden by submitted
$value = $this->_findValue($caller->_constantValues);
if (null === $value) {
// if no boxes were checked, then there is no value in the array
// yet we don't want to display default value in this case
if ($caller->isSubmitted()) {
$value = $this->_findValue($caller->_submitValues);
} else {
$value = $this->_findValue($caller->_defaultValues);
}
}
if (null !== $value) {
$this->setChecked($value);
}
break;
case 'setGroupValue':
$this->setChecked($arg);
break;
default:
parent::onQuickFormEvent($event, $arg, $caller);
}
return true;
} // end func onQuickFormEvent
 
// }}}
// {{{ exportValue()
 
/**
* Return true if the checkbox is checked, null if it is not checked (getValue() returns false)
*/
function exportValue(&$submitValues, $assoc = false)
{
$value = $this->_findValue($submitValues);
if (null === $value) {
$value = $this->getChecked()? true: null;
}
return $this->_prepareValue($value, $assoc);
}
// }}}
} //end class HTML_QuickForm_checkbox
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/static.php
New file
0,0 → 1,193
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Adam Daniel <adaniel1@eesus.jnj.com> |
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: static.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once("HTML/QuickForm/element.php");
 
/**
* HTML class for static data
*
* @author Wojciech Gdela <eltehaem@poczta.onet.pl>
* @access public
*/
class HTML_QuickForm_static extends HTML_QuickForm_element {
// {{{ properties
 
/**
* Display text
* @var string
* @access private
*/
var $_text = null;
 
// }}}
// {{{ constructor
/**
* Class constructor
*
* @param string $elementLabel (optional)Label
* @param string $text (optional)Display text
* @access public
* @return void
*/
function HTML_QuickForm_static($elementName=null, $elementLabel=null, $text=null)
{
HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel);
$this->_persistantFreeze = false;
$this->_type = 'static';
$this->_text = $text;
} //end constructor
// }}}
// {{{ setName()
 
/**
* Sets the element name
*
* @param string $name Element name
* @access public
* @return void
*/
function setName($name)
{
$this->updateAttributes(array('name'=>$name));
} //end func setName
// }}}
// {{{ getName()
 
/**
* Returns the element name
*
* @access public
* @return string
*/
function getName()
{
return $this->getAttribute('name');
} //end func getName
 
// }}}
// {{{ setText()
 
/**
* Sets the text
*
* @param string $text
* @access public
* @return void
*/
function setText($text)
{
$this->_text = $text;
} // end func setText
 
// }}}
// {{{ setValue()
 
/**
* Sets the text (uses the standard setValue call to emulate a form element.
*
* @param string $text
* @access public
* @return void
*/
function setValue($text)
{
$this->setText($text);
} // end func setValue
 
// }}}
// {{{ toHtml()
 
/**
* Returns the static text element in HTML
*
* @access public
* @return string
*/
function toHtml()
{
return $this->_getTabs() . $this->_text;
} //end func toHtml
// }}}
// {{{ getFrozenHtml()
 
/**
* Returns the value of field without HTML tags
*
* @access public
* @return string
*/
function getFrozenHtml()
{
return $this->toHtml();
} //end func getFrozenHtml
 
// }}}
// {{{ onQuickFormEvent()
 
/**
* Called by HTML_QuickForm whenever form event is made on this element
*
* @param string $event Name of event
* @param mixed $arg event arguments
* @param object $caller calling object
* @since 1.0
* @access public
* @return void
* @throws
*/
function onQuickFormEvent($event, $arg, &$caller)
{
switch ($event) {
case 'updateValue':
// do NOT use submitted values for static elements
$value = $this->_findValue($caller->_constantValues);
if (null === $value) {
$value = $this->_findValue($caller->_defaultValues);
}
if (null !== $value) {
$this->setValue($value);
}
break;
default:
parent::onQuickFormEvent($event, $arg, $caller);
}
return true;
} // end func onQuickFormEvent
 
// }}}
// {{{ exportValue()
 
/**
* We override this here because we don't want any values from static elements
*/
function exportValue(&$submitValues, $assoc = false)
{
return null;
}
// }}}
} //end class HTML_QuickForm_static
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/hierselect.php
New file
0,0 → 1,565
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2004 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Herim Vasquez <vasquezh@iro.umontreal.ca> |
// | Bertrand Mansion <bmansion@mamasam.com> |
// | Alexey Borzov <avb@php.net>
// +----------------------------------------------------------------------+
//
// $Id: hierselect.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once('HTML/QuickForm/group.php');
require_once('HTML/QuickForm/select.php');
 
/**
* Class to dynamically create two or more HTML Select elements
* The first select changes the content of the second select and so on.
* This element is considered as a group. Selects will be named
* groupName[0], groupName[1], groupName[2]...
*
* @author Herim Vasquez <vasquezh@iro.umontreal.ca>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version 1.0
* @since PHP4.04pl1
* @access public
*/
class HTML_QuickForm_hierselect extends HTML_QuickForm_group
{
// {{{ properties
 
/**
* Options for all the select elements
*
* Format is a bit more complex as we need to know which options
* are related to the ones in the previous select:
*
* Ex:
* // first select
* $select1[0] = 'Pop';
* $select1[1] = 'Classical';
* $select1[2] = 'Funeral doom';
*
* // second select
* $select2[0][0] = 'Red Hot Chil Peppers';
* $select2[0][1] = 'The Pixies';
* $select2[1][0] = 'Wagner';
* $select2[1][1] = 'Strauss';
* $select2[2][0] = 'Pantheist';
* $select2[2][1] = 'Skepticism';
*
* // If only need two selects
* // - and using the depracated functions
* $sel =& $form->addElement('hierselect', 'cds', 'Choose CD:');
* $sel->setMainOptions($select1);
* $sel->setSecOptions($select2);
*
* // - and using the new setOptions function
* $sel =& $form->addElement('hierselect', 'cds', 'Choose CD:');
* $sel->setOptions(array($select1, $select2));
*
* // If you have a third select with prices for the cds
* $select3[0][0][0] = '15.00$';
* $select3[0][0][1] = '17.00$';
* etc
*
* // You can now use
* $sel =& $form->addElement('hierselect', 'cds', 'Choose CD:');
* $sel->setOptions(array($select1, $select2, $select3));
*
* @var array
* @access private
*/
var $_options = array();
/**
* Number of select elements on this group
*
* @var int
* @access private
*/
var $_nbElements = 0;
 
/**
* The javascript used to set and change the options
*
* @var string
* @access private
*/
var $_js = '';
 
// }}}
// {{{ constructor
 
/**
* Class constructor
*
* @param string $elementName (optional)Input field name attribute
* @param string $elementLabel (optional)Input field label in form
* @param mixed $attributes (optional)Either a typical HTML attribute string
* or an associative array. Date format is passed along the attributes.
* @param mixed $separator (optional)Use a string for one separator,
* use an array to alternate the separators.
* @access public
* @return void
*/
function HTML_QuickForm_hierselect($elementName=null, $elementLabel=null, $attributes=null, $separator=null)
{
$this->HTML_QuickForm_element($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;
if (isset($separator)) {
$this->_separator = $separator;
}
$this->_type = 'hierselect';
$this->_appendName = true;
} //end constructor
 
// }}}
// {{{ setOptions()
 
/**
* Initialize the array structure containing the options for each select element.
* Call the functions that actually do the magic.
*
* @param array $options Array of options defining each element
*
* @access public
* @return void
*/
function setOptions($options)
{
$this->_options = $options;
 
if (empty($this->_elements)) {
$this->_nbElements = count($this->_options);
$this->_createElements();
} else {
// setDefaults has probably been called before this function
// check if all elements have been created
$totalNbElements = count($this->_options);
for ($i = $this->_nbElements; $i < $totalNbElements; $i ++) {
$this->_elements[] =& new HTML_QuickForm_select($i, null, array(), $this->getAttributes());
$this->_nbElements++;
}
}
$this->_setOptions();
} // end func setMainOptions
 
// }}}
// {{{ setMainOptions()
/**
* Sets the options for the first select element. Deprecated. setOptions() should be used.
*
* @param array $array Options for the first select element
*
* @access public
* @return void
*/
function setMainOptions($array)
{
$this->_options[0] = $array;
 
if (empty($this->_elements)) {
$this->_nbElements = 2;
$this->_createElements();
}
} // end func setMainOptions
// }}}
// {{{ setSecOptions()
/**
* Sets the options for the second select element. Deprecated. setOptions() should be used.
* The main _options array is initialized and the _setOptions function is called.
*
* @param array $array Options for the second select element
*
* @access public
* @return void
*/
function setSecOptions($array)
{
$this->_options[1] = $array;
 
if (empty($this->_elements)) {
$this->_nbElements = 2;
$this->_createElements();
} else {
// setDefaults has probably been called before this function
// check if all elements have been created
$totalNbElements = 2;
for ($i = $this->_nbElements; $i < $totalNbElements; $i ++) {
$this->_elements[] =& new HTML_QuickForm_select($i, null, array(), $this->getAttributes());
$this->_nbElements++;
}
}
$this->_setOptions();
} // end func setSecOptions
// }}}
// {{{ _setOptions()
/**
* Sets the options for each select element
*
* @access private
* @return void
*/
function _setOptions()
{
$toLoad = '';
foreach (array_keys($this->_elements) AS $key) {
$array = eval("return isset(\$this->_options[{$key}]{$toLoad})? \$this->_options[{$key}]{$toLoad}: null;");
if (is_array($array)) {
$select =& $this->_elements[$key];
$select->_options = array();
$select->loadArray($array);
 
$value = is_array($v = $select->getValue()) ? $v[0] : key($array);
$toLoad .= '[\'' . str_replace(array('\\', '\''), array('\\\\', '\\\''), $value) . '\']';
}
}
} // end func _setOptions
// }}}
// {{{ setValue()
 
/**
* Sets values for group's elements
*
* @param array $value An array of 2 or more values, for the first,
* the second, the third etc. select
*
* @access public
* @return void
*/
function setValue($value)
{
$this->_nbElements = count($value);
parent::setValue($value);
$this->_setOptions();
} // end func setValue
// }}}
// {{{ _createElements()
 
/**
* Creates all the elements for the group
*
* @access private
* @return void
*/
function _createElements()
{
for ($i = 0; $i < $this->_nbElements; $i++) {
$this->_elements[] =& new HTML_QuickForm_select($i, null, array(), $this->getAttributes());
}
} // end func _createElements
 
// }}}
// {{{ toHtml()
 
function toHtml()
{
$this->_js = '';
if (!$this->_flagFrozen) {
// set the onchange attribute for each element except last
$keys = array_keys($this->_elements);
$onChange = array();
for ($i = 0; $i < count($keys) - 1; $i++) {
$select =& $this->_elements[$keys[$i]];
$onChange[$i] = $select->getAttribute('onchange');
$select->updateAttributes(
array('onchange' => '_hs_swapOptions(this.form, \'' . $this->_escapeString($this->getName()) . '\', ' . $keys[$i] . ');' . $onChange[$i])
);
}
// create the js function to call
if (!defined('HTML_QUICKFORM_HIERSELECT_EXISTS')) {
$this->_js .= <<<JAVASCRIPT
function _hs_findOptions(ary, keys)
{
var key = keys.shift();
if (!key in ary) {
return {};
} else if (0 == keys.length) {
return ary[key];
} else {
return _hs_findOptions(ary[key], keys);
}
}
 
function _hs_findSelect(form, groupName, selectIndex)
{
if (groupName+'['+ selectIndex +']' in form) {
return form[groupName+'['+ selectIndex +']'];
} else {
return form[groupName+'['+ selectIndex +'][]'];
}
}
 
function _hs_replaceOptions(ctl, optionList)
{
var j = 0;
ctl.options.length = 0;
for (i in optionList) {
ctl.options[j++] = new Option(optionList[i], i, false, false);
}
}
 
function _hs_setValue(ctl, value)
{
var testValue = {};
if (value instanceof Array) {
for (var i = 0; i < value.length; i++) {
testValue[value[i]] = true;
}
} else {
testValue[value] = true;
}
for (var i = 0; i < ctl.options.length; i++) {
if (ctl.options[i].value in testValue) {
ctl.options[i].selected = true;
}
}
}
 
function _hs_swapOptions(form, groupName, selectIndex)
{
var hsValue = [];
for (var i = 0; i <= selectIndex; i++) {
hsValue[i] = _hs_findSelect(form, groupName, i).value;
}
 
_hs_replaceOptions(_hs_findSelect(form, groupName, selectIndex + 1),
_hs_findOptions(_hs_options[groupName][selectIndex], hsValue));
if (selectIndex + 1 < _hs_options[groupName].length) {
_hs_swapOptions(form, groupName, selectIndex + 1);
}
}
 
function _hs_onReset(form, groupNames)
{
for (var i = 0; i < groupNames.length; i++) {
try {
for (var j = 0; j <= _hs_options[groupNames[i]].length; j++) {
_hs_setValue(_hs_findSelect(form, groupNames[i], j), _hs_defaults[groupNames[i]][j]);
if (j < _hs_options[groupNames[i]].length) {
_hs_replaceOptions(_hs_findSelect(form, groupNames[i], j + 1),
_hs_findOptions(_hs_options[groupNames[i]][j], _hs_defaults[groupNames[i]].slice(0, j + 1)));
}
}
} catch (e) {
if (!(e instanceof TypeError)) {
throw e;
}
}
}
}
 
function _hs_setupOnReset(form, groupNames)
{
setTimeout(function() { _hs_onReset(form, groupNames); }, 25);
}
 
function _hs_onReload()
{
var ctl;
for (var i = 0; i < document.forms.length; i++) {
for (var j in _hs_defaults) {
if (ctl = _hs_findSelect(document.forms[i], j, 0)) {
for (var k = 0; k < _hs_defaults[j].length; k++) {
_hs_setValue(_hs_findSelect(document.forms[i], j, k), _hs_defaults[j][k]);
}
}
}
}
 
if (_hs_prevOnload) {
_hs_prevOnload();
}
}
 
var _hs_prevOnload = null;
if (window.onload) {
_hs_prevOnload = window.onload;
}
window.onload = _hs_onReload;
 
var _hs_options = {};
var _hs_defaults = {};
 
JAVASCRIPT;
define('HTML_QUICKFORM_HIERSELECT_EXISTS', true);
}
// option lists
$jsParts = array();
for ($i = 1; $i < $this->_nbElements; $i++) {
$jsParts[] = $this->_convertArrayToJavascript($this->_options[$i]);
}
$this->_js .= "\n_hs_options['" . $this->_escapeString($this->getName()) . "'] = [\n" .
implode(",\n", $jsParts) .
"\n];\n";
// default value; if we don't actually have any values yet just use
// the first option (for single selects) or empty array (for multiple)
$values = array();
foreach (array_keys($this->_elements) as $key) {
if (is_array($v = $this->_elements[$key]->getValue())) {
$values[] = count($v) > 1? $v: $v[0];
} else {
// XXX: accessing the supposedly private _options array
$values[] = $this->_elements[$key]->getMultiple() || empty($this->_elements[$key]->_options[0])?
array():
$this->_elements[$key]->_options[0]['attr']['value'];
}
}
$this->_js .= "_hs_defaults['" . $this->_escapeString($this->getName()) . "'] = " .
$this->_convertArrayToJavascript($values, false) . ";\n";
}
include_once('HTML/QuickForm/Renderer/Default.php');
$renderer =& new HTML_QuickForm_Renderer_Default();
$renderer->setElementTemplate('{element}');
parent::accept($renderer);
 
if (!empty($onChange)) {
$keys = array_keys($this->_elements);
for ($i = 0; $i < count($keys) - 1; $i++) {
$this->_elements[$keys[$i]]->updateAttributes(array('onchange' => $onChange[$i]));
}
}
return (empty($this->_js)? '': "<script type=\"text/javascript\">\n//<![CDATA[\n" . $this->_js . "//]]>\n</script>") .
$renderer->toHtml();
} // end func toHtml
 
// }}}
// {{{ accept()
 
function accept(&$renderer, $required = false, $error = null)
{
$renderer->renderElement($this, $required, $error);
} // end func accept
 
// }}}
// {{{ onQuickFormEvent()
 
function onQuickFormEvent($event, $arg, &$caller)
{
if ('updateValue' == $event) {
// we need to call setValue() so that the secondary option
// matches the main option
return HTML_QuickForm_element::onQuickFormEvent($event, $arg, $caller);
} else {
$ret = parent::onQuickFormEvent($event, $arg, $caller);
// add onreset handler to form to properly reset hierselect (see bug #2970)
if ('addElement' == $event) {
$onReset = $caller->getAttribute('onreset');
if (strlen($onReset)) {
if (strpos($onReset, '_hs_setupOnReset')) {
$caller->updateAttributes(array('onreset' => str_replace('_hs_setupOnReset(this, [', "_hs_setupOnReset(this, ['" . $this->_escapeString($this->getName()) . "', ", $onReset)));
} else {
$caller->updateAttributes(array('onreset' => "var temp = function() { {$onReset} } ; if (!temp()) { return false; } ; if (typeof _hs_setupOnReset != 'undefined') { return _hs_setupOnReset(this, ['" . $this->_escapeString($this->getName()) . "']); } "));
}
} else {
$caller->updateAttributes(array('onreset' => "if (typeof _hs_setupOnReset != 'undefined') { return _hs_setupOnReset(this, ['" . $this->_escapeString($this->getName()) . "']); } "));
}
}
return $ret;
}
} // end func onQuickFormEvent
 
// }}}
// {{{ _convertArrayToJavascript()
 
/**
* Converts PHP array to its Javascript analog
*
* @access private
* @param array PHP array to convert
* @param bool Generate Javascript object literal (default, works like PHP's associative array) or array literal
* @return string Javascript representation of the value
*/
function _convertArrayToJavascript($array, $assoc = true)
{
if (!is_array($array)) {
return $this->_convertScalarToJavascript($array);
} else {
$items = array();
foreach ($array as $key => $val) {
$item = $assoc? "'" . $this->_escapeString($key) . "': ": '';
if (is_array($val)) {
$item .= $this->_convertArrayToJavascript($val, $assoc);
} else {
$item .= $this->_convertScalarToJavascript($val);
}
$items[] = $item;
}
}
$js = implode(', ', $items);
return $assoc? '{ ' . $js . ' }': '[' . $js . ']';
}
// }}}
// {{{ _convertScalarToJavascript()
 
/**
* Converts PHP's scalar value to its Javascript analog
*
* @access private
* @param mixed PHP value to convert
* @return string Javascript representation of the value
*/
function _convertScalarToJavascript($val)
{
if (is_bool($val)) {
return $val ? 'true' : 'false';
} elseif (is_int($val) || is_double($val)) {
return $val;
} elseif (is_string($val)) {
return "'" . $this->_escapeString($val) . "'";
} elseif (is_null($val)) {
return 'null';
} else {
// don't bother
return '{}';
}
}
 
// }}}
// {{{ _escapeString()
 
/**
* Quotes the string so that it can be used in Javascript string constants
*
* @access private
* @param string
* @return string
*/
function _escapeString($str)
{
return strtr($str,array(
"\r" => '\r',
"\n" => '\n',
"\t" => '\t',
"'" => "\\'",
'"' => '\"',
'\\' => '\\\\'
));
}
 
// }}}
} // end class HTML_QuickForm_hierselect
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm/header.php
New file
0,0 → 1,65
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Alexey Borzov <borz_off@cs.msu.su> |
// +----------------------------------------------------------------------+
//
// $Id: header.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
 
require_once 'HTML/QuickForm/static.php';
 
/**
* A pseudo-element used for adding headers to form
*
* @author Alexey Borzov <borz_off@cs.msu.su>
* @access public
*/
class HTML_QuickForm_header extends HTML_QuickForm_static
{
// {{{ constructor
 
/**
* Class constructor
*
* @param string $elementName Header name
* @param string $text Header text
* @access public
* @return void
*/
function HTML_QuickForm_header($elementName = null, $text = null)
{
$this->HTML_QuickForm_static($elementName, null, $text);
$this->_type = 'header';
}
 
// }}}
// {{{ accept()
 
/**
* Accepts a renderer
*
* @param object An HTML_QuickForm_Renderer object
* @access public
* @return void
*/
function accept(&$renderer)
{
$renderer->renderHeader($this);
} // end func accept
 
// }}}
 
} //end class HTML_QuickForm_header
?>
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm.php
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/pear/HTML/QuickForm.php
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render.php
New file
0,0 → 1,167
<?php
 
class Text_Wiki_Render {
/**
*
* Configuration options for this render rule.
*
* @access public
*
* @var string
*
*/
var $conf = array();
/**
*
* The name of this rule's format.
*
* @access public
*
* @var string
*
*/
var $format = null;
/**
*
* The name of this rule's token array elements.
*
* @access public
*
* @var string
*
*/
var $rule = null;
/**
*
* A reference to the calling Text_Wiki object.
*
* This is needed so that each rule has access to the same source
* text, token set, URLs, interwiki maps, page names, etc.
*
* @access public
*
* @var object
*/
var $wiki = null;
/**
*
* Constructor for this render format or rule.
*
* @access public
*
* @param object &$obj The calling "parent" Text_Wiki object.
*
*/
function Text_Wiki_Render(&$obj)
{
// keep a reference to the calling Text_Wiki object
$this->wiki =& $obj;
// get the config-key-name for this object,
// strip the Text_Wiki_Render_ part
// 01234567890123456
$tmp = get_class($this);
$tmp = substr($tmp, 17);
// split into pieces at the _ mark.
// first part is format, second part is rule.
$part = explode('_', $tmp);
$this->format = isset($part[0]) ? ucwords(strtolower($part[0])) : null;
$this->rule = isset($part[1]) ? ucwords(strtolower($part[1])) : null;
// is there a format but no rule?
// then this is the "main" render object, with
// pre() and post() methods.
if ($this->format && ! $this->rule &&
isset($this->wiki->formatConf[$this->format]) &&
is_array($this->wiki->formatConf[$this->format])) {
// this is a format render object
$this->conf = array_merge(
$this->conf,
$this->wiki->formatConf[$this->format]
);
}
// is there a format and a rule?
if ($this->format && $this->rule &&
isset($this->wiki->renderConf[$this->format][$this->rule]) &&
is_array($this->wiki->renderConf[$this->format][$this->rule])) {
// this is a rule render object
$this->conf = array_merge(
$this->conf,
$this->wiki->renderConf[$this->format][$this->rule]
);
}
}
/**
*
* Simple method to safely get configuration key values.
*
* @access public
*
* @param string $key The configuration key.
*
* @param mixed $default If the key does not exist, return this value
* instead.
*
* @return mixed The configuration key value (if it exists) or the
* default value (if not).
*
*/
function getConf($key, $default = null)
{
if (isset($this->conf[$key])) {
return $this->conf[$key];
} else {
return $default;
}
}
/**
*
* Simple method to wrap a configuration in an sprintf() format.
*
* @access public
*
* @param string $key The configuration key.
*
* @param string $format The sprintf() format string.
*
* @return mixed The formatted configuration key value (if it exists)
* or null (if it does not).
*
*/
function formatConf($format, $key)
{
if (isset($this->conf[$key])) {
return sprintf($format, $this->conf[$key]);
} else {
return null;
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Break.php
New file
0,0 → 1,54
<?php
// $Id: Break.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
 
 
/**
*
* This class implements a Text_Wiki_Parse to mark forced line breaks in the
* source text.
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_Break extends Text_Wiki_Parse {
/**
*
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = '/ _\n/';
/**
*
* Generates a replacement token for the matched text.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return string A delimited token to be used as a placeholder in
* the source text.
*
*/
function process(&$matches)
{
return $this->wiki->addToken($this->rule);
}
}
 
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Function.php
New file
0,0 → 1,115
<?php
 
// $Id: Function.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
 
class Text_Wiki_Parse_Function extends Text_Wiki_Parse {
 
var $regex = '/^(\<function\>)\n(.+)\n(\<\/function\>)(\s|$)/Umsi';
function process(&$matches)
{
// default options
$opts = array(
'name' => null,
'access' => null,
'return' => null,
'params' => array(),
'throws' => array()
);
// split apart the markup lines and loop through them
$lines = explode("\n", $matches[2]);
foreach ($lines as $line) {
// skip blank lines
if (trim($line) == '') {
continue;
}
// find the first ':' on the line; the left part is the
// type, the right part is the value. skip lines without
// a ':' on them.
$pos = strpos($line, ':');
if ($pos === false) {
continue;
}
// $type is the line type: name, access, return, param, throws
// 012345678901234
// name: something
$type = trim(substr($line, 0, $pos));
$val = trim(substr($line, $pos+1));
switch($type) {
case 'a':
case 'access':
$opts['access'] = $val;
break;
case 'n':
case 'name':
$opts['name'] = $val;
break;
case 'p':
case 'param':
$tmp = explode(',', $val);
$k = count($tmp);
if ($k == 1) {
$opts['params'][] = array(
'type' => $tmp[0],
'descr' => null,
'default' => null
);
} elseif ($k == 2) {
$opts['params'][] = array(
'type' => $tmp[0],
'descr' => $tmp[1],
'default' => null
);
} else {
$opts['params'][] = array(
'type' => $tmp[0],
'descr' => $tmp[1],
'default' => $tmp[2]
);
}
break;
case 'r':
case 'return':
case 'returns':
$opts['return'] = $val;
break;
case 't':
case 'throws':
$tmp = explode(',', $val);
$k = count($tmp);
if ($k == 1) {
$opts['throws'][] = array(
'type' => $tmp[0],
'descr' => null
);
} else {
$opts['throws'][] = array(
'type' => $tmp[0],
'descr' => $tmp[1]
);
}
break;
default:
$opts[$type] = $val;
break;
}
}
// add the token back in place
return $this->wiki->addToken($this->rule, $opts) . $matches[4];
}
}
 
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Toc.php
New file
0,0 → 1,112
<?php
// $Id: Toc.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
 
 
/**
*
* This class implements a Text_Wiki_Parse to find all heading tokens and
* build a table of contents. The [[toc]] tag gets replaced with a list
* of all the level-2 through level-6 headings.
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
 
class Text_Wiki_Parse_Toc extends Text_Wiki_Parse {
/**
*
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = "/\n\[\[toc( .*)?\]\]\n/m";
/**
*
* Generates a replacement for the matched text.
*
* Token options are:
*
* 'type' => ['list_start'|'list_end'|'item_start'|'item_end'|'target']
*
* 'level' => The heading level (1-6).
*
* 'count' => Which entry number this is in the list.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return string A token indicating the TOC collection point.
*
*/
function process(&$matches)
{
$count = 0;
if (isset($matches[1])) {
$attr = $this->getAttrs(trim($matches[1]));
} else {
$attr = array();
}
$output = $this->wiki->addToken(
$this->rule,
array(
'type' => 'list_start',
'level' => 0,
'attr' => $attr
)
);
foreach ($this->wiki->getTokens('Heading') as $key => $val) {
if ($val[1]['type'] != 'start') {
continue;
}
$options = array(
'type' => 'item_start',
'id' => $val[1]['id'],
'level' => $val[1]['level'],
'count' => $count ++
);
$output .= $this->wiki->addToken($this->rule, $options);
$output .= $val[1]['text'];
$output .= $this->wiki->addToken(
$this->rule,
array(
'type' => 'item_end',
'level' => $val[1]['level']
)
);
}
$output .= $this->wiki->addToken(
$this->rule, array(
'type' => 'list_end',
'level' => 0
)
);
return $output;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Table.php
New file
0,0 → 1,208
<?php
// $Id: Table.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
 
 
/**
*
* This class implements a Text_Wiki_Parse to find source text marked as a
* set of table rows, where a line start and ends with double-pipes (||)
* and uses double-pipes to separate table cells. The rows must be on
* sequential lines (no blank lines between them) -- a blank line
* indicates the beginning of a new table.
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_Table extends Text_Wiki_Parse {
/**
*
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = '/\n((\|\|).*)(\n)(?!(\|\|))/Us';
/**
*
* Generates a replacement for the matched text.
*
* Token options are:
*
* 'type' =>
* 'table_start' : the start of a bullet list
* 'table_end' : the end of a bullet list
* 'row_start' : the start of a number list
* 'row_end' : the end of a number list
* 'cell_start' : the start of item text (bullet or number)
* 'cell_end' : the end of item text (bullet or number)
*
* 'cols' => the number of columns in the table (for 'table_start')
*
* 'rows' => the number of rows in the table (for 'table_start')
*
* 'span' => column span (for 'cell_start')
*
* 'attr' => column attribute flag (for 'cell_start')
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A series of text and delimited tokens marking the different
* table elements and cell text.
*
*/
function process(&$matches)
{
// our eventual return value
$return = '';
// the number of columns in the table
$num_cols = 0;
// the number of rows in the table
$num_rows = 0;
// rows are separated by newlines in the matched text
$rows = explode("\n", $matches[1]);
// loop through each row
foreach ($rows as $row) {
// increase the row count
$num_rows ++;
// start a new row
$return .= $this->wiki->addToken(
$this->rule,
array('type' => 'row_start')
);
// cells are separated by double-pipes
$cell = explode("||", $row);
// get the number of cells (columns) in this row
$last = count($cell) - 1;
// is this more than the current column count?
// (we decrease by 1 because we never use cell zero)
if ($last - 1 > $num_cols) {
// increase the column count
$num_cols = $last - 1;
}
// by default, cells span only one column (their own)
$span = 1;
// ignore cell zero, and ignore the "last" cell; cell zero
// is before the first double-pipe, and the "last" cell is
// after the last double-pipe. both are always empty.
for ($i = 1; $i < $last; $i ++) {
// if there is no content at all, then it's an instance
// of two sets of || next to each other, indicating a
// span.
if ($cell[$i] == '') {
// add to the span and loop to the next cell
$span += 1;
continue;
} else {
// this cell has content.
// find any special "attr"ibute cell markers
if (substr($cell[$i], 0, 2) == '> ') {
// right-align
$attr = 'right';
$cell[$i] = substr($cell[$i], 2);
} elseif (substr($cell[$i], 0, 2) == '= ') {
// center-align
$attr = 'center';
$cell[$i] = substr($cell[$i], 2);
} elseif (substr($cell[$i], 0, 2) == '< ') {
// left-align
$attr = 'left';
$cell[$i] = substr($cell[$i], 2);
} elseif (substr($cell[$i], 0, 2) == '~ ') {
$attr = 'header';
$cell[$i] = substr($cell[$i], 2);
} else {
$attr = null;
}
// start a new cell...
$return .= $this->wiki->addToken(
$this->rule,
array (
'type' => 'cell_start',
'attr' => $attr,
'span' => $span
)
);
// ...add the content...
$return .= trim($cell[$i]);
// ...and end the cell.
$return .= $this->wiki->addToken(
$this->rule,
array (
'type' => 'cell_end',
'attr' => $attr,
'span' => $span
)
);
// reset the span.
$span = 1;
}
}
// end the row
$return .= $this->wiki->addToken(
$this->rule,
array('type' => 'row_end')
);
}
// wrap the return value in start and end tokens
$return =
$this->wiki->addToken(
$this->rule,
array(
'type' => 'table_start',
'rows' => $num_rows,
'cols' => $num_cols
)
)
. $return .
$this->wiki->addToken(
$this->rule,
array(
'type' => 'table_end'
)
);
// we're done!
return "\n$return\n\n";
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Raw.php
New file
0,0 → 1,55
<?php
// $Id: Raw.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
 
 
/**
*
* This class implements a Text_Wiki rule to find sections of the source
* text that are not to be processed by Text_Wiki. These blocks of "raw"
* text will be rendered as they were found.
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_Raw extends Text_Wiki_Parse {
/**
*
* The regular expression used to find source text matching this
* rule.
*
* @access public
*
* @var string
*
*/
var $regex = "/``(.*)``/U";
/**
*
* Generates a token entry for the matched text. Token options are:
*
* 'text' => The full matched text.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A delimited token number to be used as a placeholder in
* the source text.
*
*/
function process(&$matches)
{
$options = array('text' => $matches[1]);
return $this->wiki->addToken($this->rule, $options);
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Deflist.php
New file
0,0 → 1,104
<?php
// $Id: Deflist.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
 
 
/**
*
* This class implements a Text_Wiki_Parse to find source text marked as a
* definition list. In short, if a line starts with ':' then it is a
* definition list item; another ':' on the same lines indicates the end
* of the definition term and the beginning of the definition narrative.
* The list items must be on sequential lines (no blank lines between
* them) -- a blank line indicates the beginning of a new list.
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_Deflist extends Text_Wiki_Parse {
/**
*
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = '/\n((: ).*\n)(?!(: |\n))/Us';
/**
*
* Generates a replacement for the matched text. Token options are:
*
* 'type' =>
* 'list_start' : the start of a definition list
* 'list_end' : the end of a definition list
* 'term_start' : the start of a definition term
* 'term_end' : the end of a definition term
* 'narr_start' : the start of definition narrative
* 'narr_end' : the end of definition narrative
* 'unknown' : unknown type of definition portion
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A series of text and delimited tokens marking the different
* list text and list elements.
*
*/
function process(&$matches)
{
// the replacement text we will return to parse()
$return = '';
// the list of post-processing matches
$list = array();
// start the deflist
$options = array('type' => 'list_start');
$return .= $this->wiki->addToken($this->rule, $options);
// $matches[1] is the text matched as a list set by parse();
// create an array called $list that contains a new set of
// matches for the various definition-list elements.
preg_match_all(
'/^(: )(.*)?( : )(.*)?$/Ums',
$matches[1],
$list,
PREG_SET_ORDER
);
// add each term and narrative
foreach ($list as $key => $val) {
$return .= (
$this->wiki->addToken($this->rule, array('type' => 'term_start')) .
trim($val[2]) .
$this->wiki->addToken($this->rule, array('type' => 'term_end')) .
$this->wiki->addToken($this->rule, array('type' => 'narr_start')) .
trim($val[4]) .
$this->wiki->addToken($this->rule, array('type' => 'narr_end'))
);
}
// end the deflist
$options = array('type' => 'list_end');
$return .= $this->wiki->addToken($this->rule, $options);
// done!
return "\n" . $return . "\n\n";
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Horiz.php
New file
0,0 → 1,52
<?php
// $Id: Horiz.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
 
 
/**
*
* This class implements a Text_Wiki_Parse to find source text marked to
* be a horizontal rule, as defined by four dashed on their own line.
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_Horiz extends Text_Wiki_Parse {
/**
*
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = '/^([-]{4,})$/m';
/**
*
* Generates a replacement token for the matched text.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return string A token marking the horizontal rule.
*
*/
function process(&$matches)
{
return $this->wiki->addToken($this->rule);
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Prefilter.php
New file
0,0 → 1,62
<?php
// $Id: Prefilter.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
 
 
/**
*
* "Pre-filter" the source text.
*
* Convert DOS and Mac line endings to Unix, concat lines ending in a
* backslash \ with the next line, convert tabs to 4-spaces, add newlines
* to the top and end of the source text, compress 3 or more newlines to
* 2 newlines.
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_Prefilter extends Text_Wiki_Parse {
/**
*
* Simple parsing method.
*
* @access public
*
*/
function parse()
{
// convert DOS line endings
$this->wiki->source = str_replace("\r\n", "\n",
$this->wiki->source);
// convert Macintosh line endings
$this->wiki->source = str_replace("\r", "\n",
$this->wiki->source);
// concat lines ending in a backslash
$this->wiki->source = str_replace("\\\n", "",
$this->wiki->source);
// convert tabs to four-spaces
$this->wiki->source = str_replace("\t", " ",
$this->wiki->source);
// add extra newlines at the top and end; this
// seems to help many rules.
$this->wiki->source = "\n" . $this->wiki->source . "\n\n";
// finally, compress all instances of 3 or more newlines
// down to two newlines.
$find = "/\n{3,}/m";
$replace = "\n\n";
$this->wiki->source = preg_replace($find, $replace,
$this->wiki->source);
}
 
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Heading.php
New file
0,0 → 1,89
<?php
// $Id: Heading.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
 
 
/**
*
* This class implements a Text_Wiki_Parse to find source text marked to
* be a heading element, as defined by text on a line by itself prefixed
* with a number of plus signs (+). The heading text itself is left in
* the source, but is prefixed and suffixed with delimited tokens marking
* the start and end of the heading.
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_Heading extends Text_Wiki_Parse {
/**
*
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = '/^(\+{1,6}) (.*)/m';
var $conf = array(
'id_prefix' => 'toc'
);
/**
*
* Generates a replacement for the matched text. Token options are:
*
* 'type' => ['start'|'end'] The starting or ending point of the
* heading text. The text itself is left in the source.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return string A pair of delimited tokens to be used as a
* placeholder in the source text surrounding the heading text.
*
*/
function process(&$matches)
{
// keep a running count for header IDs. we use this later
// when constructing TOC entries, etc.
static $id;
if (! isset($id)) {
$id = 0;
}
$prefix = htmlspecialchars($this->getConf('id_prefix'));
$start = $this->wiki->addToken(
$this->rule,
array(
'type' => 'start',
'level' => strlen($matches[1]),
'text' => $matches[2],
'id' => $prefix . $id ++
)
);
$end = $this->wiki->addToken(
$this->rule,
array(
'type' => 'end',
'level' => strlen($matches[1])
)
);
return $start . $matches[2] . $end . "\n";
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Tighten.php
New file
0,0 → 1,32
<?php
// $Id: Tighten.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
 
 
/**
*
* The rule removes all remaining newlines.
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_Tighten extends Text_Wiki_Parse {
/**
*
* Apply tightening directly to the source text.
*
* @access public
*
*/
function parse()
{
$this->wiki->source = str_replace("\n", '',
$this->wiki->source);
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Html.php
New file
0,0 → 1,57
<?php
// $Id: Html.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
 
 
/**
*
* This class implements a Text_Wiki_Parse to find source text marked as
* HTML to be redndred as-is. The block start is marked by <html> on its
* own line, and the block end is marked by </html> on its own line.
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_Html extends Text_Wiki_Parse {
/**
*
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = '/^\<html\>\n(.+)\n\<\/html\>(\s|$)/Umsi';
/**
*
* Generates a replacement for the matched text. Token options are:
*
* 'text' => The text of the HTML to be rendered as-is.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A delimited token to be used as a placeholder in
* the source text, plus any text following the HTML block.
*
*/
function process(&$matches)
{
$options = array('text' => $matches[1]);
return $this->wiki->addToken($this->rule, $options) . $matches[2];
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Paragraph.php
New file
0,0 → 1,128
<?php
// $Id: Paragraph.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
 
 
/**
*
* This class implements a Text_Wiki rule to find sections of the source
* text that are paragraphs. A para is any line not starting with a token
* delimiter, followed by two newlines.
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_Paragraph extends Text_Wiki_Parse {
/**
*
* The regular expression used to find source text matching this
* rule.
*
* @access public
*
* @var string
*
*/
var $regex = "/^.*?\n\n/m";
var $conf = array(
'skip' => array(
'blockquote', // are we sure about this one?
'code',
'heading',
'horiz',
'deflist',
'table',
'list',
'toc'
)
);
/**
*
* Generates a token entry for the matched text. Token options are:
*
* 'start' => The starting point of the paragraph.
*
* 'end' => The ending point of the paragraph.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A delimited token number to be used as a placeholder in
* the source text.
*
*/
function process(&$matches)
{
$delim = $this->wiki->delim;
// was anything there?
if (trim($matches[0]) == '') {
return '';
}
// does the match start with a delimiter?
if (substr($matches[0], 0, 1) != $delim) {
// no.
$start = $this->wiki->addToken(
$this->rule, array('type' => 'start')
);
$end = $this->wiki->addToken(
$this->rule, array('type' => 'end')
);
return $start . trim($matches[0]) . $end;
}
// the line starts with a delimiter. read in the delimited
// token number, check the token, and see if we should
// skip it.
// loop starting at the second character (we already know
// the first is a delimiter) until we find another
// delimiter; the text between them is a token key number.
$key = '';
$len = strlen($matches[0]);
for ($i = 1; $i < $len; $i++) {
$char = $matches[0]{$i};
if ($char == $delim) {
break;
} else {
$key .= $char;
}
}
// look at the token and see if it's skippable (if we skip,
// it will not be marked as a paragraph)
$token_type = strtolower($this->wiki->tokens[$key][0]);
$skip = $this->getConf('skip', array());
if (in_array($token_type, $skip)) {
// this type of token should not have paragraphs applied to it.
// return the entire matched text.
return $matches[0];
} else {
$start = $this->wiki->addToken(
$this->rule, array('type' => 'start')
);
$end = $this->wiki->addToken(
$this->rule, array('type' => 'end')
);
return $start . trim($matches[0]) . $end;
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Italic.php
New file
0,0 → 1,67
<?php
// $Id: Italic.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
 
 
/**
*
* This class implements a Text_Wiki_Parse to find source text marked for
* emphasis (italics) as defined by text surrounded by two single-quotes.
* On parsing, the text itself is left in place, but the starting and ending
* instances of two single-quotes are replaced with tokens.
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_Italic extends Text_Wiki_Parse {
/**
*
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = "/''(()|[^'].*)''/U";
/**
*
* Generates a replacement for the matched text. Token options are:
*
* 'type' => ['start'|'end'] The starting or ending point of the
* emphasized text. The text itself is left in the source.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return string A pair of delimited tokens to be used as a
* placeholder in the source text surrounding the text to be
* emphasized.
*
*/
function process(&$matches)
{
$start = $this->wiki->addToken(
$this->rule, array('type' => 'start')
);
$end = $this->wiki->addToken(
$this->rule, array('type' => 'end')
);
return $start . $matches[1] . $end;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Interwiki.php
New file
0,0 → 1,120
<?php
// $Id: Interwiki.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
 
 
/**
*
* This class implements a Text_Wiki_Parse to find source text marked as
* an Interwiki link. See the regex for a detailed explanation of the
* text matching procedure; e.g., "InterWikiName:PageName".
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_Interwiki extends Text_Wiki_Parse {
var $regex = '([A-Za-z0-9_]+):([\/=&~#A-Za-z0-9_]+)';
/**
*
* Parser. We override the standard parser so we can
* find both described interwiki links and standalone links.
*
* @access public
*
* @return void
*
*/
function parse()
{
// described interwiki links
$tmp_regex = '/\[' . $this->regex . ' (.+?)\]/';
$this->wiki->source = preg_replace_callback(
$tmp_regex,
array(&$this, 'processDescr'),
$this->wiki->source
);
// standalone interwiki links
$tmp_regex = '/' . $this->regex . '/';
$this->wiki->source = preg_replace_callback(
$tmp_regex,
array(&$this, 'process'),
$this->wiki->source
);
}
/**
*
* Generates a replacement for the matched standalone interwiki text.
* Token options are:
*
* 'site' => The key name for the Text_Wiki interwiki array map,
* usually the name of the interwiki site.
*
* 'page' => The page on the target interwiki to link to.
*
* 'text' => The text to display as the link.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A delimited token to be used as a placeholder in
* the source text, plus any text priot to the match.
*
*/
function process(&$matches)
{
$options = array(
'site' => $matches[1],
'page' => $matches[2],
'text' => $matches[0]
);
return $this->wiki->addToken($this->rule, $options);
}
/**
*
* Generates a replacement for described interwiki links. Token
* options are:
*
* 'site' => The key name for the Text_Wiki interwiki array map,
* usually the name of the interwiki site.
*
* 'page' => The page on the target interwiki to link to.
*
* 'text' => The text to display as the link.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A delimited token to be used as a placeholder in
* the source text, plus any text priot to the match.
*
*/
function processDescr(&$matches)
{
$options = array(
'site' => $matches[1],
'page' => $matches[2],
'text' => $matches[3]
);
return $this->wiki->addToken($this->rule, $options);
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Blockquote.php
New file
0,0 → 1,163
<?php
 
/**
*
* Parse for block-quoted text.
*
* Find source text marked as a blockquote, identified by any number of
* greater-than signs '>' at the start of the line, followed by a space,
* and then the quote text; each '>' indicates an additional level of
* quoting.
*
* $Id: Blockquote.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_Blockquote extends Text_Wiki_Parse {
/**
*
* Regex for parsing the source text.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = '/\n((\>).*\n)(?!(\>))/Us';
/**
*
* Generates a replacement for the matched text.
*
* Token options are:
*
* 'type' =>
* 'start' : the start of a blockquote
* 'end' : the end of a blockquote
*
* 'level' => the indent level (0 for the first level, 1 for the
* second, etc)
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A series of text and delimited tokens marking the different
* list text and list elements.
*
*/
function process(&$matches)
{
// the replacement text we will return to parse()
$return = '';
// the list of post-processing matches
$list = array();
// $matches[1] is the text matched as a list set by parse();
// create an array called $list that contains a new set of
// matches for the various list-item elements.
preg_match_all(
'=^(\>+) (.*\n)=Ums',
$matches[1],
$list,
PREG_SET_ORDER
);
// a stack of starts and ends; we keep this so that we know what
// indent level we're at.
$stack = array();
// loop through each list-item element.
foreach ($list as $key => $val) {
// $val[0] is the full matched list-item line
// $val[1] is the number of initial '>' chars (indent level)
// $val[2] is the quote text
// we number levels starting at 1, not zero
$level = strlen($val[1]);
// get the text of the line
$text = $val[2];
// add a level to the list?
while ($level > count($stack)) {
// the current indent level is greater than the number
// of stack elements, so we must be starting a new
// level. push the new level onto the stack with a
// dummy value (boolean true)...
array_push($stack, true);
$return .= "\n";
// ...and add a start token to the return.
$return .= $this->wiki->addToken(
$this->rule,
array(
'type' => 'start',
'level' => $level - 1
)
);
$return .= "\n\n";
}
// remove a level?
while (count($stack) > $level) {
// as long as the stack count is greater than the
// current indent level, we need to end list types.
// continue adding end-list tokens until the stack count
// and the indent level are the same.
array_pop($stack);
$return .= "\n\n";
$return .= $this->wiki->addToken(
$this->rule,
array (
'type' => 'end',
'level' => count($stack)
)
);
$return .= "\n";
}
// add the line text.
$return .= $text;
}
// the last line may have been indented. go through the stack
// and create end-tokens until the stack is empty.
$return .= "\n";
while (count($stack) > 0) {
array_pop($stack);
$return .= $this->wiki->addToken(
$this->rule,
array (
'type' => 'end',
'level' => count($stack)
)
);
}
// we're done! send back the replacement text.
return "\n$return\n\n";
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Anchor.php
New file
0,0 → 1,67
<?php
 
/**
*
* This class implements a Text_Wiki_Parse to add an anchor target name
* in the wiki page.
*
* @author Manuel Holtgrewe <purestorm at ggnore dot net>
*
* @author Paul M. Jones <pmjones at ciaweb dot net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_Anchor extends Text_Wiki_Parse {
/**
*
* The regular expression used to find source text matching this
* rule.
*
* @access public
*
* @var string
*
*/
var $regex = '/(\[\[# )([-_A-Za-z0-9.]+?)( .+)?(\]\])/i';
/**
*
* Generates a token entry for the matched text. Token options are:
*
* 'text' => The full matched text, not including the <code></code> tags.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A delimited token number to be used as a placeholder in
* the source text.
*
*/
function process(&$matches) {
$name = $matches[2];
$text = $matches[3];
$start = $this->wiki->addToken(
$this->rule,
array('type' => 'start', 'name' => $name)
);
$end = $this->wiki->addToken(
$this->rule,
array('type' => 'end', 'name' => $name)
);
// done, place the script output directly in the source
return $start . trim($text) . $end;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/List.php
New file
0,0 → 1,230
<?php
// $Id: List.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
 
 
/**
*
* This class implements a Text_Wiki_Parse to find source text marked as
* a bulleted or numbered list. In short, if a line starts with '* ' then
* it is a bullet list item; if a line starts with '# ' then it is a
* number list item. Spaces in front of the * or # indicate an indented
* sub-list. The list items must be on sequential lines, and may be
* separated by blank lines to improve readability. Using a non-* non-#
* non-whitespace character at the beginning of a line ends the list.
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_List extends Text_Wiki_Parse {
/**
*
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = '/\n((\*|#) .*\n)(?! {0,}(\* |# |\n))/Us';
/**
*
* Generates a replacement for the matched text. Token options are:
*
* 'type' =>
* 'bullet_start' : the start of a bullet list
* 'bullet_end' : the end of a bullet list
* 'number_start' : the start of a number list
* 'number_end' : the end of a number list
* 'item_start' : the start of item text (bullet or number)
* 'item_end' : the end of item text (bullet or number)
* 'unknown' : unknown type of list or item
*
* 'level' => the indent level (0 for the first level, 1 for the
* second, etc)
*
* 'count' => the list item number at this level. not needed for
* xhtml, but very useful for PDF and RTF.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A series of text and delimited tokens marking the different
* list text and list elements.
*
*/
function process(&$matches)
{
// the replacement text we will return
$return = '';
// the list of post-processing matches
$list = array();
// a stack of list-start and list-end types; we keep this
// so that we know what kind of list we're working with
// (bullet or number) and what indent level we're at.
$stack = array();
// the item count is the number of list items for any
// given list-type on the stack
$itemcount = array();
// have we processed the very first list item?
$pastFirst = false;
// populate $list with this set of matches. $matches[1] is the
// text matched as a list set by parse().
preg_match_all(
'=^( {0,})(\*|#) (.*)$=Ums',
$matches[1],
$list,
PREG_SET_ORDER
);
// loop through each list-item element.
foreach ($list as $key => $val) {
// $val[0] is the full matched list-item line
// $val[1] is the number of initial spaces (indent level)
// $val[2] is the list item type (* or #)
// $val[3] is the list item text
// how many levels are we indented? (1 means the "root"
// list level, no indenting.)
$level = strlen($val[1]) + 1;
// get the list item type
if ($val[2] == '*') {
$type = 'bullet';
} elseif ($val[2] == '#') {
$type = 'number';
} else {
$type = 'unknown';
}
// get the text of the list item
$text = $val[3];
// add a level to the list?
if ($level > count($stack)) {
// the current indent level is greater than the
// number of stack elements, so we must be starting
// a new list. push the new list type onto the
// stack...
array_push($stack, $type);
// ...and add a list-start token to the return.
$return .= $this->wiki->addToken(
$this->rule,
array(
'type' => $type . '_list_start',
'level' => $level - 1
)
);
}
// remove a level from the list?
while (count($stack) > $level) {
// so we don't keep counting the stack, we set up a temp
// var for the count. -1 becuase we're going to pop the
// stack in the next command. $tmp will then equal the
// current level of indent.
$tmp = count($stack) - 1;
// as long as the stack count is greater than the
// current indent level, we need to end list types.
// continue adding end-list tokens until the stack count
// and the indent level are the same.
$return .= $this->wiki->addToken(
$this->rule,
array (
'type' => array_pop($stack) . '_list_end',
'level' => $tmp
)
);
// reset to the current (previous) list type so that
// the new list item matches the proper list type.
$type = $stack[$tmp - 1];
// reset the item count for the popped indent level
unset($itemcount[$tmp + 1]);
}
// add to the item count for this list (taking into account
// which level we are at).
if (! isset($itemcount[$level])) {
// first count
$itemcount[$level] = 0;
} else {
// increment count
$itemcount[$level]++;
}
// is this the very first item in the list?
if (! $pastFirst) {
$first = true;
$pastFirst = true;
} else {
$first = false;
}
// create a list-item starting token.
$start = $this->wiki->addToken(
$this->rule,
array(
'type' => $type . '_item_start',
'level' => $level,
'count' => $itemcount[$level],
'first' => $first
)
);
// create a list-item ending token.
$end = $this->wiki->addToken(
$this->rule,
array(
'type' => $type . '_item_end',
'level' => $level,
'count' => $itemcount[$level]
)
);
// add the starting token, list-item text, and ending token
// to the return.
$return .= $start . $val[3] . $end;
}
// the last list-item may have been indented. go through the
// list-type stack and create end-list tokens until the stack
// is empty.
while (count($stack) > 0) {
$return .= $this->wiki->addToken(
$this->rule,
array (
'type' => array_pop($stack) . '_list_end',
'level' => count($stack)
)
);
}
// we're done! send back the replacement text.
return "\n" . $return . "\n\n";
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Embed.php
New file
0,0 → 1,88
<?php
// $Id: Embed.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
 
 
/**
*
* This class implements a Text_Wiki_Parse to embed the contents of a URL
* inside the page at render-time. Typically used to get script output.
* This differs from the 'include' rule, which incorporates results at
* parse-time; 'embed' output does not get parsed by Text_Wiki, while
* 'include' ouput does.
*
* This rule is inherently not secure; it allows cross-site scripting to
* occur if the embedded output has <script> or other similar tags. Be
* careful.
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_Embed extends Text_Wiki_Parse {
var $conf = array(
'base' => '/path/to/scripts/'
);
var $file = null;
 
var $output = null;
 
var $vars = null;
 
 
/**
*
* The regular expression used to find source text matching this
* rule.
*
* @access public
*
* @var string
*
*/
var $regex = '/(\[\[embed )(.+?)( .+?)?(\]\])/i';
/**
*
* Generates a token entry for the matched text. Token options are:
*
* 'text' => The full matched text, not including the <code></code> tags.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A delimited token number to be used as a placeholder in
* the source text.
*
*/
function process(&$matches)
{
// save the file location
$this->file = $this->getConf('base', './') . $matches[2];
// extract attribs as variables in the local space
$this->vars = $this->getAttrs($matches[3]);
unset($this->vars['this']);
extract($this->vars);
// run the script
ob_start();
include($this->file);
$this->output = ob_get_contents();
ob_end_clean();
// done, place the script output directly in the source
return $this->wiki->addToken(
$this->rule,
array('text' => $this->output)
);
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Delimiter.php
New file
0,0 → 1,62
<?php
// $Id: Delimiter.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
 
 
/**
*
* This class implements a Text_Wiki_Parse to find instances of the delimiter
* character already embedded in the source text; it extracts them and replaces
* them with a delimited token, then renders them as the delimiter itself
* when the target format is XHTML.
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_Delimiter extends Text_Wiki_Parse {
/**
*
* Constructor. Overrides the Text_Wiki_Parse constructor so that we
* can set the $regex property dynamically (we need to include the
* Text_Wiki $delim character.
*
* @param object &$obj The calling "parent" Text_Wiki object.
*
* @param string $name The token name to use for this rule.
*
*/
function Text_Wiki_Parse_delimiter(&$obj)
{
parent::Text_Wiki_Parse($obj);
$this->regex = '/' . $this->wiki->delim . '/';
}
/**
*
* Generates a token entry for the matched text. Token options are:
*
* 'text' => The full matched text.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A delimited token number to be used as a placeholder in
* the source text.
*
*/
function process(&$matches)
{
return $this->wiki->addToken(
$this->rule,
array('text' => $this->wiki->delim)
);
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Bold.php
New file
0,0 → 1,61
<?php
// $Id: Bold.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
 
 
/**
*
* This class implements a Text_Wiki_Rule to find source text marked for
* strong emphasis (bold) as defined by text surrounded by three
* single-quotes. On parsing, the text itself is left in place, but the
* starting and ending instances of three single-quotes are replaced with
* tokens.
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_Bold extends Text_Wiki_Parse {
/**
*
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = "/'''(()|[^'].*)'''/U";
/**
*
* Generates a replacement for the matched text. Token options are:
*
* 'type' => ['start'|'end'] The starting or ending point of the
* emphasized text. The text itself is left in the source.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A pair of delimited tokens to be used as a placeholder in
* the source text surrounding the text to be emphasized.
*
*/
function process(&$matches)
{
$start = $this->wiki->addToken($this->rule, array('type' => 'start'));
$end = $this->wiki->addToken($this->rule, array('type' => 'end'));
return $start . $matches[1] . $end;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Wikilink.php
New file
0,0 → 1,158
<?php
 
/**
*
* Parse for links to wiki pages.
*
* Wiki page names are typically in StudlyCapsStyle made of
* WordsSmashedTogether.
*
* You can also create described links to pages in this style:
* [WikiPageName nice text link to use for display]
*
* The token options for this rule are:
*
* 'page' => the wiki page name.
*
* 'text' => the displayed link text.
*
* 'anchor' => a named anchor on the target wiki page.
*
* $Id: Wikilink.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_Wikilink extends Text_Wiki_Parse {
/**
*
* Constructor.
*
* We override the Text_Wiki_Parse constructor so we can
* explicitly comment each part of the $regex property.
*
* @access public
*
* @param object &$obj The calling "parent" Text_Wiki object.
*
*/
function Text_Wiki_Parse_Wikilink(&$obj)
{
parent::Text_Wiki_Parse($obj);
// allows numbers as "lowercase letters" in the regex
$this->regex =
"(!?" . // START WikiPage pattern (1)
"[A-Z]" . // 1 upper
"[A-Za-z0-9]*" . // 0+ alpha or digit
"[a-z0-9]+" . // 1+ lower or digit
"[A-Z]" . // 1 upper
"[A-Za-z0-9]*" . // 0+ or more alpha or digit
")" . // END WikiPage pattern (/1)
"((\#" . // START Anchor pattern (2)(3)
"[A-Za-z]" . // 1 alpha
"(" . // start sub pattern (4)
"[-A-Za-z0-9_:.]*" . // 0+ dash, alpha, digit, underscore, colon, dot
"[-A-Za-z0-9_]" . // 1 dash, alpha, digit, or underscore
")?)?)"; // end subpatterns (/4)(/3)(/2)
}
/**
*
* First parses for described links, then for standalone links.
*
* @access public
*
* @return void
*
*/
function parse()
{
// described wiki links
$tmp_regex = '/\[' . $this->regex . ' (.+?)\]/';
$this->wiki->source = preg_replace_callback(
$tmp_regex,
array(&$this, 'processDescr'),
$this->wiki->source
);
// standalone wiki links
$tmp_regex = '/(^|[^A-Za-z0-9\-_])' . $this->regex . '/';
$this->wiki->source = preg_replace_callback(
$tmp_regex,
array(&$this, 'process'),
$this->wiki->source
);
}
/**
*
* Generate a replacement for described links.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A delimited token to be used as a placeholder in
* the source text, plus any text priot to the match.
*
*/
function processDescr(&$matches)
{
// set the options
$options = array(
'page' => $matches[1],
'text' => $matches[5],
'anchor' => $matches[3]
);
// create and return the replacement token and preceding text
return $this->wiki->addToken($this->rule, $options); // . $matches[7];
}
/**
*
* Generate a replacement for standalone links.
*
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A delimited token to be used as a placeholder in
* the source text, plus any text prior to the match.
*
*/
function process(&$matches)
{
// when prefixed with !, it's explicitly not a wiki link.
// return everything as it was.
if ($matches[2]{0} == '!') {
return $matches[1] . substr($matches[2], 1) . $matches[3];
}
// set the options
$options = array(
'page' => $matches[2],
'text' => $matches[2] . $matches[3],
'anchor' => $matches[3]
);
// create and return the replacement token and preceding text
return $matches[1] . $this->wiki->addToken($this->rule, $options);
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Image.php
New file
0,0 → 1,76
<?php
// $Id: Image.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
 
 
/**
*
* This class implements a Text_Wiki_Parse to embed the contents of a URL
* inside the page. Typically used to get script output.
*
* This rule is inherently not secure; it allows cross-site scripting to
* occur if the embedded output has <script> or other similar tags. Be
* careful.
*
* In the future, we'll add a rule config options to set the base embed
* path so that it is limited to one directory.
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_Image extends Text_Wiki_Parse {
/**
*
* The regular expression used to find source text matching this
* rule.
*
* @access public
*
* @var string
*
*/
var $regex = '/(\[\[image )(.+?)(\]\])/i';
/**
*
* Generates a token entry for the matched text. Token options are:
*
* 'src' => The image source, typically a relative path name.
*
* 'opts' => Any macro options following the source.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A delimited token number to be used as a placeholder in
* the source text.
*
*/
function process(&$matches)
{
$pos = strpos($matches[2], ' ');
if ($pos === false) {
$options = array(
'src' => $matches[2],
'attr' => array());
} else {
// everything after the space is attribute arguments
$options = array(
'src' => substr($matches[2], 0, $pos),
'attr' => $this->getAttrs(substr($matches[2], $pos+1))
);
}
return $this->wiki->addToken($this->rule, $options);
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Tt.php
New file
0,0 → 1,69
<?php
 
/**
*
* Find source text marked for teletype (monospace).
*
* Defined by text surrounded by two curly braces. On parsing, the text
* itself is left in place, but the starting and ending instances of
* curly braces are replaced with tokens.
*
* Token options are:
*
* 'type' => ['start'|'end'] The starting or ending point of the
* teletype text. The text itself is left in the source.
*
*
* $Id: Tt.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_Tt extends Text_Wiki_Parse {
/**
*
* The regular expression used to parse the source text.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = "/{{({*?.*}*?)}}/U";
/**
*
* Generates a replacement for the matched text.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return string A pair of delimited tokens to be used as a
* placeholder in the source text surrounding the teletype text.
*
*/
function process(&$matches)
{
$start = $this->wiki->addToken(
$this->rule, array('type' => 'start')
);
$end = $this->wiki->addToken(
$this->rule, array('type' => 'end')
);
return $start . $matches[1] . $end;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Revise.php
New file
0,0 → 1,130
<?php
// $Id: Revise.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
 
 
/**
*
* This class implements a Text_Wiki_Parse to find source text marked for
* revision.
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_Revise extends Text_Wiki_Parse {
/**
*
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = "/\@\@({*?.*}*?)\@\@/U";
/**
*
* Config options.
*
* @access public
*
* @var array
*
*/
var $conf = array(
'delmark' => '---',
'insmark' => '+++'
);
/**
*
* Generates a replacement for the matched text. Token options are:
*
* 'type' => ['start'|'end'] The starting or ending point of the
* inserted text. The text itself is left in the source.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return string A pair of delimited tokens to be used as a
* placeholder in the source text surrounding the teletype text.
*
*/
function process(&$matches)
{
$output = '';
$src = $matches[1];
$delmark = $this->getConf('delmark'); // ---
$insmark = $this->getConf('insmark'); // +++
// '---' must be before '+++' (if they both appear)
$del = strpos($src, $delmark);
$ins = strpos($src, $insmark);
// if neither is found, return right away
if ($del === false && $ins === false) {
return $matches[0];
}
// handle text to be deleted
if ($del !== false) {
// move forward to the end of the deletion mark
$del += strlen($delmark);
if ($ins === false) {
// there is no insertion text following
$text = substr($src, $del);
} else {
// there is insertion text following,
// mitigate the length
$text = substr($src, $del, $ins - $del);
}
$output .= $this->wiki->addToken(
$this->rule, array('type' => 'del_start')
);
$output .= $text;
$output .= $this->wiki->addToken(
$this->rule, array('type' => 'del_end')
);
}
// handle text to be inserted
if ($ins !== false) {
// move forward to the end of the insert mark
$ins += strlen($insmark);
$text = substr($src, $ins);
$output .= $this->wiki->addToken(
$this->rule, array('type' => 'ins_start')
);
$output .= $text;
$output .= $this->wiki->addToken(
$this->rule, array('type' => 'ins_end')
);
}
return $output;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Freelink.php
New file
0,0 → 1,111
<?php
// $Id: Freelink.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
 
 
/**
*
* This class implements a Text_Wiki_Parse to find source text marked as a
* wiki freelink, and automatically create a link to that page.
*
* A freelink is any page name not conforming to the standard
* StudlyCapsStyle for a wiki page name. For example, a page normally
* named MyHomePage can be renamed and referred to as ((My Home Page)) --
* note the spaces in the page name. You can also make a "nice-looking"
* link without renaming the target page; e.g., ((MyHomePage|My Home
* Page)). Finally, you can use named anchors on the target page:
* ((MyHomePage|My Home Page#Section1)).
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_Freelink extends Text_Wiki_Parse {
/**
*
* Constructor. We override the Text_Wiki_Parse constructor so we can
* explicitly comment each part of the $regex property.
*
* @access public
*
* @param object &$obj The calling "parent" Text_Wiki object.
*
*/
function Text_Wiki_Parse_Freelink(&$obj)
{
parent::Text_Wiki_Parse($obj);
$this->regex =
'/' . // START regex
"\\(\\(" . // double open-parens
"(" . // START freelink page patter
"[-A-Za-z0-9 _+\\/.,;:!?'\"\\[\\]\\{\\}&\xc0-\xff]+" . // 1 or more of just about any character
")" . // END freelink page pattern
"(" . // START display-name
"\|" . // a pipe to start the display name
"[-A-Za-z0-9 _+\\/.,;:!?'\"\\[\\]\\{\\}&\xc0-\xff]+" . // 1 or more of just about any character
")?" . // END display-name pattern 0 or 1
"(" . // START pattern for named anchors
"\#" . // a hash mark
"[A-Za-z]" . // 1 alpha
"[-A-Za-z0-9_:.]*" . // 0 or more alpha, digit, underscore
")?" . // END named anchors pattern 0 or 1
"()\\)\\)" . // double close-parens
'/'; // END regex
}
/**
*
* Generates a replacement for the matched text. Token options are:
*
* 'page' => the wiki page name (e.g., HomePage).
*
* 'text' => alternative text to be displayed in place of the wiki
* page name.
*
* 'anchor' => a named anchor on the target wiki page
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A delimited token to be used as a placeholder in
* the source text, plus any text priot to the match.
*
*/
function process(&$matches)
{
// use nice variable names
$page = $matches[1];
$text = $matches[2];
// get rid of the leading # from the anchor, if any
$anchor = substr($matches[3], 1);
// is the page given a new text appearance?
if (trim($text) == '') {
// no
$text = $page;
} else {
// yes, strip the leading | character
$text = substr($text, 1);
}
// set the options
$options = array(
'page' => $page,
'text' => $text,
'anchor' => $anchor
);
// return a token placeholder
return $this->wiki->addToken($this->rule, $options);
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Newline.php
New file
0,0 → 1,57
<?php
// $Id: Newline.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
 
 
/**
*
* This class implements a Text_Wiki_Parse to mark implied line breaks in the
* source text, usually a single carriage return in the middle of a paragraph
* or block-quoted text.
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_Newline extends Text_Wiki_Parse {
/**
*
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = '/([^\n])\n([^\n])/m';
/**
*
* Generates a replacement token for the matched text.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return string A delimited token to be used as a placeholder in
* the source text.
*
*/
function process(&$matches)
{
return $matches[1] .
$this->wiki->addToken($this->rule) .
$matches[2];
}
}
 
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Url.php
New file
0,0 → 1,265
<?php
 
/**
*
* Parse for URLS in the source text.
*
* Various URL markings are supported: inline (the URL by itself),
* numbered or footnote reference (where the URL is enclosed in square brackets), and
* named reference (where the URL is enclosed in square brackets and has a
* name included inside the brackets). E.g.:
*
* inline -- http://example.com
* numbered -- [http://example.com]
* described -- [http://example.com Example Description]
*
* When rendering a URL token, this will convert URLs pointing to a .gif,
* .jpg, or .png image into an inline <img /> tag (for the 'xhtml'
* format).
*
* Token options are:
*
* 'type' => ['inline'|'footnote'|'descr'] the type of URL
*
* 'href' => the URL link href portion
*
* 'text' => the displayed text of the URL link
*
* $Id: Url.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_Url extends Text_Wiki_Parse {
/**
*
* Keeps a running count of numbered-reference URLs.
*
* @access public
*
* @var int
*
*/
var $footnoteCount = 0;
/**
*
* URL schemes recognized by this rule.
*
* @access public
*
* @var array
*
*/
var $conf = array(
'schemes' => array(
'http://',
'https://',
'ftp://',
'gopher://',
'news://',
'mailto:'
)
);
/**
*
* Constructor.
*
* We override the constructor so we can comment the regex nicely.
*
* @access public
*
*/
function Text_Wiki_Parse_Url(&$obj)
{
parent::Text_Wiki_Parse($obj);
// convert the list of recognized schemes to a regex-safe string,
// where the pattern delim is a slash
$tmp = array();
$list = $this->getConf('schemes', array());
foreach ($list as $val) {
$tmp[] = preg_quote($val, '/');
}
$schemes = implode('|', $tmp);
// build the regex
$this->regex =
"($schemes)" . // allowed schemes
"(" . // start pattern
"[^ \\/\"\'{$this->wiki->delim}]*\\/" . // no spaces, backslashes, slashes, double-quotes, single quotes, or delimiters;
")*" . // end pattern
"[^ \\t\\n\\/\"\'{$this->wiki->delim}]*" .
"[A-Za-z0-9\\/?=&~_]";
}
/**
*
* Find three different kinds of URLs in the source text.
*
* @access public
*
*/
function parse()
{
// -------------------------------------------------------------
//
// Described-reference (named) URLs.
//
// the regular expression for this kind of URL
$tmp_regex = '/\[(' . $this->regex . ') ([^\]]+)\]/';
// use a custom callback processing method to generate
// the replacement text for matches.
$this->wiki->source = preg_replace_callback(
$tmp_regex,
array(&$this, 'processDescr'),
$this->wiki->source
);
// -------------------------------------------------------------
//
// Numbered-reference (footnote-style) URLs.
//
// the regular expression for this kind of URL
$tmp_regex = '/\[(' . $this->regex . ')\]/U';
// use a custom callback processing method to generate
// the replacement text for matches.
$this->wiki->source = preg_replace_callback(
$tmp_regex,
array(&$this, 'processFootnote'),
$this->wiki->source
);
// -------------------------------------------------------------
//
// Normal inline URLs.
//
// the regular expression for this kind of URL
$tmp_regex = '/(^|[^A-Za-z])(' . $this->regex . ')(.*?)/';
// use the standard callback for inline URLs
$this->wiki->source = preg_replace_callback(
$tmp_regex,
array(&$this, 'process'),
$this->wiki->source
);
}
/**
*
* Process inline URLs.
*
* @param array &$matches
*
* @param array $matches An array of matches from the parse() method
* as generated by preg_replace_callback. $matches[0] is the full
* matched string, $matches[1] is the first matched pattern,
* $matches[2] is the second matched pattern, and so on.
*
* @return string The processed text replacement.
*
*/
function process(&$matches)
{
// set options
$options = array(
'type' => 'inline',
'href' => $matches[2],
'text' => $matches[2]
);
// tokenize
return $matches[1] . $this->wiki->addToken($this->rule, $options) . $matches[5];
}
/**
*
* Process numbered (footnote) URLs.
*
* Token options are:
* @param array &$matches
*
* @param array $matches An array of matches from the parse() method
* as generated by preg_replace_callback. $matches[0] is the full
* matched string, $matches[1] is the first matched pattern,
* $matches[2] is the second matched pattern, and so on.
*
* @return string The processed text replacement.
*
*/
function processFootnote(&$matches)
{
// keep a running count for footnotes
$this->footnoteCount++;
// set options
$options = array(
'type' => 'footnote',
'href' => $matches[1],
'text' => $this->footnoteCount
);
// tokenize
return $this->wiki->addToken($this->rule, $options);
}
/**
*
* Process described-reference (named-reference) URLs.
*
* Token options are:
* 'type' => ['inline'|'footnote'|'descr'] the type of URL
* 'href' => the URL link href portion
* 'text' => the displayed text of the URL link
*
* @param array &$matches
*
* @param array $matches An array of matches from the parse() method
* as generated by preg_replace_callback. $matches[0] is the full
* matched string, $matches[1] is the first matched pattern,
* $matches[2] is the second matched pattern, and so on.
*
* @return string The processed text replacement.
*
*/
function processDescr(&$matches)
{
// set options
$options = array(
'type' => 'descr',
'href' => $matches[1],
'text' => $matches[4]
);
// tokenize
return $this->wiki->addToken($this->rule, $options);
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Emphasis.php
New file
0,0 → 1,67
<?php
// $Id: Emphasis.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
 
 
/**
*
* This class implements a Text_Wiki_Parse to find source text marked for
* emphasis (italics) as defined by text surrounded by two single-quotes.
* On parsing, the text itself is left in place, but the starting and ending
* instances of two single-quotes are replaced with tokens.
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_emphasis extends Text_Wiki_Parse {
/**
*
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = "/\/\/(()|.*)\/\//U";
/**
*
* Generates a replacement for the matched text. Token options are:
*
* 'type' => ['start'|'end'] The starting or ending point of the
* emphasized text. The text itself is left in the source.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return string A pair of delimited tokens to be used as a
* placeholder in the source text surrounding the text to be
* emphasized.
*
*/
function process(&$matches)
{
$start = $this->wiki->addToken(
$this->rule, array('type' => 'start')
);
$end = $this->wiki->addToken(
$this->rule, array('type' => 'end')
);
return $start . $matches[1] . $end;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Code.php
New file
0,0 → 1,72
<?php
// $Id: Code.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
 
 
/**
*
* This class implements a Text_Wiki_Parse to find sections marked as code
* examples. Blocks are marked as the string <code> on a line by itself,
* followed by the inline code example, and terminated with the string
* </code> on a line by itself. The code example is run through the
* native PHP highlight_string() function to colorize it, then surrounded
* with <pre>...</pre> tags when rendered as XHTML.
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_Code extends Text_Wiki_Parse {
/**
*
* The regular expression used to find source text matching this
* rule.
*
* @access public
*
* @var string
*
*/
var $regex = '/^(\<code( .+)?\>)\n(.+)\n(\<\/code\>)(\s|$)/Umsi';
/**
*
* Generates a token entry for the matched text. Token options are:
*
* 'text' => The full matched text, not including the <code></code> tags.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A delimited token number to be used as a placeholder in
* the source text.
*
*/
function process(&$matches)
{
// are there additional attribute arguments?
$args = trim($matches[2]);
if ($args == '') {
$options = array(
'text' => $matches[3],
'attr' => array('type' => '')
);
} else {
$options = array(
'text' => $matches[3],
'attr' => $this->getAttrs($args)
);
}
return $this->wiki->addToken($this->rule, $options) . $matches[5];
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Strong.php
New file
0,0 → 1,67
<?php
// $Id: Strong.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
 
 
/**
*
* This class implements a Text_Wiki_Parse to find source text marked for
* strong emphasis (bold) as defined by text surrounded by three
* single-quotes. On parsing, the text itself is left in place, but the
* starting and ending instances of three single-quotes are replaced with
* tokens.
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_Strong extends Text_Wiki_Parse {
/**
*
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = "/\*\*(()|.*)\*\*/U";
/**
*
* Generates a replacement for the matched text. Token options are:
*
* 'type' => ['start'|'end'] The starting or ending point of the
* emphasized text. The text itself is left in the source.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A pair of delimited tokens to be used as a placeholder in
* the source text surrounding the text to be emphasized.
*
*/
function process(&$matches)
{
$start = $this->wiki->addToken(
$this->rule, array('type' => 'start')
);
$end = $this->wiki->addToken(
$this->rule, array('type' => 'end')
);
return $start . $matches[1] . $end;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Center.php
New file
0,0 → 1,60
<?php
// $Id: Center.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
 
 
/**
*
* This class implements a Text_Wiki_Parse to find lines marked for centering.
* The line must start with "= " (i.e., an equal-sign followed by a space).
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_Center extends Text_Wiki_Parse {
/**
*
* The regular expression used to find source text matching this
* rule.
*
* @access public
*
* @var string
*
*/
var $regex = '/\n\= (.*?)\n/';
/**
*
* Generates a token entry for the matched text.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A delimited token number to be used as a placeholder in
* the source text.
*
*/
function process(&$matches)
{
$start = $this->wiki->addToken(
$this->rule,
array('type' => 'start')
);
$end = $this->wiki->addToken(
$this->rule,
array('type' => 'end')
);
return "\n" . $start . $matches[1] . $end . "\n";
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Phplookup.php
New file
0,0 → 1,58
<?php
// $Id: Phplookup.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
 
 
/**
*
* Find source text marked for
* lookup in the PHP online manual.
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_Phplookup extends Text_Wiki_Parse {
/**
*
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = "/\[\[php (.+?)\]\]/";
/**
*
* Generates a replacement for the matched text. Token options are:
*
* 'type' => ['start'|'end'] The starting or ending point of the
* teletype text. The text itself is left in the source.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return string A pair of delimited tokens to be used as a
* placeholder in the source text surrounding the teletype text.
*
*/
function process(&$matches)
{
return $this->wiki->addToken(
$this->rule, array('text' => $matches[1])
);
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Colortext.php
New file
0,0 → 1,74
<?php
// $Id: Colortext.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
 
 
/**
*
* This class implements a Text_Wiki_Parse to find source text marked for
* coloring.
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_Colortext extends Text_Wiki_Parse {
/**
*
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = "/\#\#(.+?)\|(.+?)\#\#/";
/**
*
* Generates a replacement for the matched text. Token options are:
*
* 'type' => ['start'|'end'] The starting or ending point of the
* emphasized text. The text itself is left in the source.
*
* 'color' => the color indicator
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return string A pair of delimited tokens to be used as a
* placeholder in the source text surrounding the text to be
* emphasized.
*
*/
function process(&$matches)
{
$start = $this->wiki->addToken(
$this->rule,
array(
'type' => 'start',
'color' => $matches[1]
)
);
$end = $this->wiki->addToken(
$this->rule,
array(
'type' => 'end',
'color' => $matches[1]
)
);
return $start . $matches[2] . $end;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Include.php
New file
0,0 → 1,84
<?php
// $Id: Include.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
 
 
/**
*
* This class implements a Text_Wiki_Parse to include the results of a
* script directly into the source at parse-time; thus, the output of the
* script will be parsed by Text_Wiki. This differs from the 'embed'
* rule, which incorporates the results at render-time, meaning that the
* 'embed' content is not parsed by Text_Wiki.
*
* DANGER!
*
* This rule is inherently not secure; it allows cross-site scripting to
* occur if the embedded output has <script> or other similar tags. Be
* careful.
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_Include extends Text_Wiki_Parse {
var $conf = array(
'base' => '/path/to/scripts/'
);
var $file = null;
var $output = null;
var $vars = null;
 
/**
*
* The regular expression used to find source text matching this
* rule.
*
* @access public
*
* @var string
*
*/
var $regex = '/(\[\[include )(.+?)( .+?)?(\]\])/i';
/**
*
* Includes the results of the script directly into the source; the output
* will subsequently be parsed by the remaining Text_Wiki rules.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return The results of the included script.
*
*/
function process(&$matches)
{
// save the file location
$this->file = $this->getConf('base', './') . $matches[2];
 
// extract attribs as variables in the local space
$this->vars = $this->getAttrs($matches[3]);
unset($this->vars['this']);
extract($this->vars);
 
// run the script
ob_start();
include($this->file);
$this->output = ob_get_contents();
ob_end_clean();
// done, place the script output directly in the source
return $this->output;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse/Superscript.php
New file
0,0 → 1,67
<?php
// $Id: Superscript.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
 
 
/**
*
* This class implements a Text_Wiki_Parse to find source text marked for
* strong emphasis (bold) as defined by text surrounded by three
* single-quotes. On parsing, the text itself is left in place, but the
* starting and ending instances of three single-quotes are replaced with
* tokens.
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Parse_Superscript extends Text_Wiki_Parse {
/**
*
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = "/\^\^(()|.*)\^\^/U";
/**
*
* Generates a replacement for the matched text. Token options are:
*
* 'type' => ['start'|'end'] The starting or ending point of the
* emphasized text. The text itself is left in the source.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A pair of delimited tokens to be used as a placeholder in
* the source text surrounding the text to be emphasized.
*
*/
function process(&$matches)
{
$start = $this->wiki->addToken(
$this->rule, array('type' => 'start')
);
$end = $this->wiki->addToken(
$this->rule, array('type' => 'end')
);
return $start . $matches[1] . $end;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml.php
New file
0,0 → 1,33
<?php
 
class Text_Wiki_Render_Xhtml extends Text_Wiki_Render {
var $conf = array('translate' => HTML_ENTITIES);
function pre()
{
// attempt to translate HTML entities in the source before continuing.
$type = $this->getConf('translate', null);
// are we translating html?
if ($type) {
// yes! get the translation table.
$xlate = get_html_translation_table($type);
// remove the delimiter character it doesn't get translated
unset($xlate[$this->wiki->delim]);
// translate!
$this->wiki->source = strtr($this->wiki->source, $xlate);
}
}
function post()
{
return;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex.php
New file
0,0 → 1,90
<?php
 
/**
*
* Formats parsed Text_Wiki for LaTeX rendering.
*
* $Id: Latex.php,v 1.1 2005-01-20 19:44:30 jpm Exp $
*
* @author Jeremy Cowgar <jeremy@cowgar.com>
*
* @package Text_Wiki
*
* @todo [http://google.com] becomes 1 with a LaTeX footnote in subscript.
* This should be a normal LaTeX footnote associated with the
* previous word?
*
* @todo parse "..." to be ``...''
*
* @todo parse '...' to be `...'
*
* @todo move escape_latex to a static function, move escaping to the
* individual .php files they are associated with
*
* @todo allow the user to add conf items to do things like
* + A custom document header
* + Custom page headings
* + Include packages
* + Set Title, Author, Date
* + Include a title page
* + Not output Document Head/Foot (maybe combinding many pages?)
*
*/
 
class Text_Wiki_Render_Latex extends Text_Wiki_Render {
function escape_latex ($txt) {
$txt = str_replace("\\", "\\\\", $txt);
$txt = str_replace('#', '\#', $txt);
$txt = str_replace('$', '\$', $txt);
$txt = str_replace('%', '\%', $txt);
$txt = str_replace('^', '\^', $txt);
$txt = str_replace('&', '\&', $txt);
$txt = str_replace('_', '\_', $txt);
$txt = str_replace('{', '\{', $txt);
$txt = str_replace('}', '\}', $txt);
// Typeset things a bit prettier than normas
$txt = str_replace('~', '$\sim$', $txt);
$txt = str_replace('...', '\ldots', $txt);
 
return $txt;
}
 
function escape($tok, $ele) {
if (isset($tok[$ele])) {
$tok[$ele] = $this->escape_latex($tok[$ele]);
}
 
return $tok;
}
function pre()
{
foreach ($this->wiki->tokens as $k => $tok) {
if ($tok[0] == 'Code') {
continue;
}
 
$tok[1] = $this->escape($tok[1], 'text');
$tok[1] = $this->escape($tok[1], 'page');
$tok[1] = $this->escape($tok[1], 'href');
$this->wiki->tokens[$k] = $tok;
}
 
$this->wiki->source = $this->escape_latex($this->wiki->source);
 
return
"\\documentclass{article}\n".
"\\usepackage{ulem}\n".
"\\pagestyle{headings}\n".
"\\begin{document}\n";
}
function post()
{
return "\\end{document}\n";
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Tighten.php
New file
0,0 → 1,10
<?php
class Text_Wiki_Render_Plain_Tighten extends Text_Wiki_Render {
function token()
{
return '';
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Interwiki.php
New file
0,0 → 1,23
<?php
 
class Text_Wiki_Render_Plain_Interwiki extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return $options['text'];
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Paragraph.php
New file
0,0 → 1,31
<?php
 
class Text_Wiki_Render_Plain_Paragraph extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
extract($options); //type
if ($type == 'start') {
return '';
}
if ($type == 'end') {
return "\n\n";
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Emphasis.php
New file
0,0 → 1,23
<?php
 
class Text_Wiki_Render_Plain_Emphasis extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Code.php
New file
0,0 → 1,24
<?php
 
class Text_Wiki_Render_Plain_Code extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return "\n" . $options['text'] . "\n\n";
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Embed.php
New file
0,0 → 1,23
<?php
 
class Text_Wiki_Render_Plain_Embed extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return strip_tags($options['text']);
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Strong.php
New file
0,0 → 1,24
<?php
 
class Text_Wiki_Render_Plain_Strong extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Delimiter.php
New file
0,0 → 1,23
<?php
 
class Text_Wiki_Render_Plain_Delimiter extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Center.php
New file
0,0 → 1,23
<?php
 
class Text_Wiki_Render_Plain_Center extends Text_Wiki_Render {
 
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Image.php
New file
0,0 → 1,22
<?php
class Text_Wiki_Render_Plain_Image extends Text_Wiki_Render {
 
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Function.php
New file
0,0 → 1,39
<?php
 
// $Id: Function.php,v 1.1 2005-01-20 19:43:21 jpm Exp $
 
class Text_Wiki_Render_Plain_Function extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
extract($options); // access, return, name, params, throws
$output = "$access $return $name ( ";
foreach ($params as $key => $val) {
$output .= "{$val['type']} {$val['descr']} {$val['default']} ";
}
$output .= ') ';
foreach ($throws as $key => $val) {
$output .= "{$val['type']} {$val['descr']} ";
}
return $output;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Newline.php
New file
0,0 → 1,12
<?php
 
class Text_Wiki_Render_Plain_Newline extends Text_Wiki_Render {
function token($options)
{
return "\n";
}
}
 
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Url.php
New file
0,0 → 1,25
<?php
 
 
class Text_Wiki_Render_Plain_Url extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return $options['text'];
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Html.php
New file
0,0 → 1,24
<?php
 
class Text_Wiki_Render_Plain_Html extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return strip_tags($options['text']);
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Italic.php
New file
0,0 → 1,23
<?php
 
class Text_Wiki_Render_Plain_Italic extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Blockquote.php
New file
0,0 → 1,39
<?php
 
class Text_Wiki_Render_Plain_Blockquote extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
$type = $options['type'];
$level = $options['level'];
// set up indenting so that the results look nice; we do this
// in two steps to avoid str_pad mathematics. ;-)
$pad = str_pad('', $level + 1, "\t");
$pad = str_replace("\t", ' ', $pad);
// starting
if ($type == 'start') {
return "\n$pad";
}
// ending
if ($type == 'end') {
return "\n$pad";
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Anchor.php
New file
0,0 → 1,23
<?php
 
/**
*
* This class renders an anchor target name in XHTML.
*
* @author Manuel Holtgrewe <purestorm at ggnore dot net>
*
* @author Paul M. Jones <pmjones at ciaweb dot net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Render_Plain_Anchor extends Text_Wiki_Render {
function token($options)
{
return $options['name'];
}
}
 
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/List.php
New file
0,0 → 1,68
<?php
 
 
class Text_Wiki_Render_Plain_List extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* This rendering method is syntactically and semantically compliant
* with XHTML 1.1 in that sub-lists are part of the previous list item.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
// make nice variables (type, level, count)
extract($options);
// set up indenting so that the results look nice; we do this
// in two steps to avoid str_pad mathematics. ;-)
$pad = str_pad('', $level, "\t");
$pad = str_replace("\t", ' ', $pad);
switch ($type) {
case 'bullet_list_start':
break;
case 'bullet_list_end':
if ($level == 0) {
return "\n\n";
}
break;
case 'number_list_start':
break;
case 'number_list_end':
if ($level == 0) {
return "\n\n";
}
break;
case 'bullet_item_start':
case 'number_item_start':
return "\n$pad";
break;
case 'bullet_item_end':
case 'number_item_end':
default:
// ignore item endings and all other types.
// item endings are taken care of by the other types
// depending on their place in the list.
return;
break;
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Bold.php
New file
0,0 → 1,23
<?php
 
class Text_Wiki_Render_Plain_Bold extends Text_Wiki_Render {
 
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Wikilink.php
New file
0,0 → 1,24
<?php
 
class Text_Wiki_Render_Plain_Wikilink extends Text_Wiki_Render {
/**
*
* Renders a token into plain text.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return $options['text'];
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Phplookup.php
New file
0,0 → 1,25
<?php
 
class Text_Wiki_Render_Plain_Phplookup extends Text_Wiki_Render {
var $conf = array('target' => '_blank');
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return trim($options['text']);
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Superscript.php
New file
0,0 → 1,23
<?php
 
class Text_Wiki_Render_Plain_Superscript extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Include.php
New file
0,0 → 1,8
<?php
class Text_Wiki_Render_Plain_Include extends Text_Wiki_Render {
function token()
{
return '';
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Colortext.php
New file
0,0 → 1,23
<?php
 
class Text_Wiki_Render_Plain_Colortext extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Break.php
New file
0,0 → 1,24
<?php
 
class Text_Wiki_Render_Plain_Break extends Text_Wiki_Render {
 
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return "\n";
}
}
 
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Toc.php
New file
0,0 → 1,39
<?php
 
class Text_Wiki_Render_Plain_Toc extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
// type, count, level
extract($options);
if ($type == 'item_start') {
// build some indenting spaces for the text
$indent = ($level - 2) * 4;
$pad = str_pad('', $indent);
return $pad;
}
if ($type == 'item_end') {
return "\n";
}
}
 
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Tt.php
New file
0,0 → 1,24
<?php
 
class Text_Wiki_Render_Plain_tt extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Table.php
New file
0,0 → 1,57
<?php
 
class Text_Wiki_Render_Plain_Table extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
// make nice variable names (type, attr, span)
extract($options);
$pad = ' ';
switch ($type) {
case 'table_start':
return;
break;
case 'table_end':
return;
break;
case 'row_start':
return;
break;
case 'row_end':
return " ||\n";
break;
case 'cell_start':
return " || ";
break;
case 'cell_end':
return;
break;
default:
return '';
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Raw.php
New file
0,0 → 1,23
<?php
 
class Text_Wiki_Render_Plain_Raw extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return $options['text'];
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Deflist.php
New file
0,0 → 1,59
<?php
 
class Text_Wiki_Render_Plain_Deflist extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
$type = $options['type'];
$pad = " ";
switch ($type) {
case 'list_start':
return "\n";
break;
case 'list_end':
return "\n\n";
break;
case 'term_start':
// done!
return $pad;
break;
case 'term_end':
return "\n";
break;
case 'narr_start':
// done!
return $pad . $pad;
break;
case 'narr_end':
return "\n";
break;
default:
return '';
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Horiz.php
New file
0,0 → 1,23
<?php
 
class Text_Wiki_Render_Plain_Horiz extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return "\n";
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Prefilter.php
New file
0,0 → 1,40
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Paul M. Jones <pmjones@ciaweb.net> |
// +----------------------------------------------------------------------+
//
// $Id: Prefilter.php,v 1.1 2005-01-20 19:43:21 jpm Exp $
 
 
/**
*
* This class implements a Text_Wiki_Render_Xhtml to "pre-filter" source text so
* that line endings are consistently \n, lines ending in a backslash \
* are concatenated with the next line, and tabs are converted to spaces.
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Render_Plain_Prefilter extends Text_Wiki_Render {
function token()
{
return '';
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Revise.php
New file
0,0 → 1,24
<?php
 
class Text_Wiki_Render_Plain_Revise extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Heading.php
New file
0,0 → 1,14
<?php
 
class Text_Wiki_Render_Plain_Heading extends Text_Wiki_Render {
function token($options)
{
if ($options['type'] == 'end') {
return "\n\n";
} else {
return "\n";
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain/Freelink.php
New file
0,0 → 1,23
<?php
 
class Text_Wiki_Render_Plain_Freelink extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return $options['text'];
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Plain.php
New file
0,0 → 1,16
<?php
 
class Text_Wiki_Render_Plain extends Text_Wiki_Render {
function pre()
{
return;
}
function post()
{
return;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Center.php
New file
0,0 → 1,29
<?php
 
class Text_Wiki_Render_Xhtml_Center extends Text_Wiki_Render {
 
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
if ($options['type'] == 'start') {
return '<div style="text-align: center;">';
}
if ($options['type'] == 'end') {
return '</div>';
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Phplookup.php
New file
0,0 → 1,59
<?php
 
// $Id: Phplookup.php,v 1.1 2005-01-20 19:43:21 jpm Exp $
 
class Text_Wiki_Render_Xhtml_Phplookup extends Text_Wiki_Render {
var $conf = array(
'target' => '_blank',
'css' => null
);
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
$text = trim($options['text']);
$css = $this->formatConf(' class="%s"', 'css');
// start the html
$output = "<a$css";
// are we targeting another window?
$target = $this->getConf('target', '');
if ($target) {
// use a "popup" window. this is XHTML compliant, suggested by
// Aaron Kalin. uses the $target as the new window name.
$target = htmlspecialchars($target);
$output .= " onclick=\"window.open(this.href, '$target');";
$output .= " return false;\"";
}
// take off the final parens for functions
if (substr($text, -2) == '()') {
$q = substr($text, 0, -2);
} else {
$q = $text;
}
$q = htmlspecialchars($q);
$text = htmlspecialchars($text);
// finish and return
$output .= " href=\"http://php.net/$q\">$text</a>";
return $output;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Colortext.php
New file
0,0 → 1,56
<?php
 
class Text_Wiki_Render_Xhtml_Colortext extends Text_Wiki_Render {
var $colors = array(
'aqua',
'black',
'blue',
'fuchsia',
'gray',
'green',
'lime',
'maroon',
'navy',
'olive',
'purple',
'red',
'silver',
'teal',
'white',
'yellow'
);
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
$type = $options['type'];
$color = $options['color'];
if (! in_array($color, $this->colors)) {
$color = '#' . $color;
}
if ($type == 'start') {
return "<span style=\"color: $color;\">";
}
if ($options['type'] == 'end') {
return '</span>';
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Superscript.php
New file
0,0 → 1,34
<?php
 
class Text_Wiki_Render_Xhtml_Superscript extends Text_Wiki_Render {
var $conf = array(
'css' => null
);
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
if ($options['type'] == 'start') {
$css = $this->formatConf(' class="%s"', 'css');
return "<sup$css>";
}
if ($options['type'] == 'end') {
return '</sup>';
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Include.php
New file
0,0 → 1,8
<?php
class Text_Wiki_Render_Xhtml_Include extends Text_Wiki_Render {
function token()
{
return '';
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Break.php
New file
0,0 → 1,29
<?php
 
class Text_Wiki_Render_Xhtml_Break extends Text_Wiki_Render {
 
var $conf = array(
'css' => null
);
 
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
$css = $this->formatConf(' class="%s"', 'css');
return "<br$css />\n";
}
}
 
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Function.php
New file
0,0 → 1,87
<?php
 
// $Id: Function.php,v 1.1 2005-01-20 19:43:21 jpm Exp $
 
class Text_Wiki_Render_Xhtml_Function extends Text_Wiki_Render {
var $conf = array(
// list separator for params and throws
'list_sep' => ', ',
// the "main" format string
'format_main' => '%access %return <b>%name</b> ( %params ) %throws',
// the looped format string for required params
'format_param' => '%type <i>%descr</i>',
// the looped format string for params with default values
'format_paramd' => '[%type <i>%descr</i> default %default]',
// the looped format string for throws
'format_throws' => '<b>throws</b> %type <i>%descr</i>'
);
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
extract($options); // name, access, return, params, throws
// build the baseline output
$output = $this->conf['format_main'];
$output = str_replace('%access', htmlspecialchars($access), $output);
$output = str_replace('%return', htmlspecialchars($return), $output);
$output = str_replace('%name', htmlspecialchars($name), $output);
// build the set of params
$list = array();
foreach ($params as $key => $val) {
// is there a default value?
if ($val['default']) {
$tmp = $this->conf['format_paramd'];
} else {
$tmp = $this->conf['format_param'];
}
// add the param elements
$tmp = str_replace('%type', htmlspecialchars($val['type']), $tmp);
$tmp = str_replace('%descr', htmlspecialchars($val['descr']), $tmp);
$tmp = str_replace('%default', htmlspecialchars($val['default']), $tmp);
$list[] = $tmp;
}
// insert params into output
$tmp = implode($this->conf['list_sep'], $list);
$output = str_replace('%params', $tmp, $output);
// build the set of throws
$list = array();
foreach ($throws as $key => $val) {
$tmp = $this->conf['format_throws'];
$tmp = str_replace('%type', htmlspecialchars($val['type']), $tmp);
$tmp = str_replace('%descr', htmlspecialchars($val['descr']), $tmp);
$list[] = $tmp;
}
// insert throws into output
$tmp = implode($this->conf['list_sep'], $list);
$output = str_replace('%throws', $tmp, $output);
// close the div and return the output
$output .= '</div>';
return "\n$output\n\n";
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Toc.php
New file
0,0 → 1,80
<?php
 
// $Id: Toc.php,v 1.1 2005-01-20 19:43:21 jpm Exp $
 
class Text_Wiki_Render_Xhtml_Toc extends Text_Wiki_Render {
var $conf = array(
'css_list' => null,
'css_item' => null,
'title' => '<strong>Table of Contents</strong>',
'div_id' => 'toc'
);
var $min = 2;
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
// type, id, level, count, attr
extract($options);
switch ($type) {
case 'list_start':
$html = '<div';
$css = $this->getConf('css_list');
if ($css) {
$html .= " class=\"$css\"";
}
$div_id = $this->getConf('div_id');
if ($div_id) {
$html .= " id=\"$div_id\"";
}
$html .= '>';
$html .= $this->getConf('title');
return $html;
break;
case 'list_end':
return "</div>\n";
break;
case 'item_start':
$html = '<div';
$css = $this->getConf('css_item');
if ($css) {
$html .= " class=\"$css\"";
}
$pad = ($level - $this->min);
$html .= " style=\"margin-left: {$pad}em;\">";
$html .= "<a href=\"#$id\">";
return $html;
break;
case 'item_end':
return "</a></div>\n";
break;
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Table.php
New file
0,0 → 1,98
<?php
 
class Text_Wiki_Render_Xhtml_Table extends Text_Wiki_Render {
var $conf = array(
'css_table' => null,
'css_tr' => null,
'css_th' => null,
'css_td' => null
);
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
// make nice variable names (type, attr, span)
extract($options);
$pad = ' ';
switch ($type) {
case 'table_start':
$css = $this->formatConf(' class="%s"', 'css_table');
return "\n\n<table$css>\n";
break;
case 'table_end':
return "</table>\n\n";
break;
case 'row_start':
$css = $this->formatConf(' class="%s"', 'css_tr');
return "$pad<tr$css>\n";
break;
case 'row_end':
return "$pad</tr>\n";
break;
case 'cell_start':
// base html
$html = $pad . $pad;
// is this a TH or TD cell?
if ($attr == 'header') {
// start a header cell
$css = $this->formatConf(' class="%s"', 'css_th');
$html .= "<th$css";
} else {
// start a normal cell
$css = $this->formatConf(' class="%s"', 'css_td');
$html .= "<td$css";
}
// add the column span
if ($span > 1) {
$html .= " colspan=\"$span\"";
}
// add alignment
if ($attr != 'header' && $attr != '') {
$html .= " style=\"text-align: $attr;\"";
}
// done!
$html .= '>';
return $html;
break;
case 'cell_end':
if ($attr == 'header') {
return "</th>\n";
} else {
return "</td>\n";
}
break;
default:
return '';
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Raw.php
New file
0,0 → 1,23
<?php
 
class Text_Wiki_Render_Xhtml_Raw extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return $options['text'];
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Deflist.php
New file
0,0 → 1,64
<?php
 
class Text_Wiki_Render_Xhtml_Deflist extends Text_Wiki_Render {
var $conf = array(
'css_dl' => null,
'css_dt' => null,
'css_dd' => null
);
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
$type = $options['type'];
$pad = " ";
switch ($type) {
case 'list_start':
$css = $this->formatConf(' class="%s"', 'css_dl');
return "<dl$css>\n";
break;
case 'list_end':
return "</dl>\n\n";
break;
case 'term_start':
$css = $this->formatConf(' class="%s"', 'css_dt');
return $pad . "<dt$css>";
break;
case 'term_end':
return "</dt>\n";
break;
case 'narr_start':
$css = $this->formatConf(' class="%s"', 'css_dd');
return $pad . $pad . "<dd$css>";
break;
case 'narr_end':
return "</dd>\n";
break;
default:
return '';
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Horiz.php
New file
0,0 → 1,28
<?php
 
class Text_Wiki_Render_Xhtml_Horiz extends Text_Wiki_Render {
var $conf = array(
'css' => null
);
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
$css = $this->formatConf(' class="%s"', 'css');
return "<hr$css />\n";
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Prefilter.php
New file
0,0 → 1,40
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Paul M. Jones <pmjones@ciaweb.net> |
// +----------------------------------------------------------------------+
//
// $Id: Prefilter.php,v 1.1 2005-01-20 19:43:21 jpm Exp $
 
 
/**
*
* This class implements a Text_Wiki_Render_Xhtml to "pre-filter" source text so
* that line endings are consistently \n, lines ending in a backslash \
* are concatenated with the next line, and tabs are converted to spaces.
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Render_Xhtml_Prefilter extends Text_Wiki_Render {
function token()
{
return '';
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Heading.php
New file
0,0 → 1,29
<?php
 
class Text_Wiki_Render_Xhtml_Heading extends Text_Wiki_Render {
var $conf = array(
'css_h1' => null,
'css_h2' => null,
'css_h3' => null,
'css_h4' => null,
'css_h5' => null,
'css_h6' => null
);
function token($options)
{
// get nice variable names (id, type, level)
extract($options);
if ($type == 'start') {
$css = $this->formatConf(' class="%s"', "css_h$level");
return "<h$level$css id=\"$id\">";
}
if ($type == 'end') {
return "</h$level>\n";
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Tighten.php
New file
0,0 → 1,10
<?php
class Text_Wiki_Render_Xhtml_Tighten extends Text_Wiki_Render {
function token()
{
return '';
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Html.php
New file
0,0 → 1,24
<?php
 
class Text_Wiki_Render_Xhtml_Html extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return $options['text'];
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Interwiki.php
New file
0,0 → 1,74
<?php
 
class Text_Wiki_Render_Xhtml_Interwiki extends Text_Wiki_Render {
var $conf = array(
'sites' => array(
'MeatBall' => 'http://www.usemod.com/cgi-bin/mb.pl?%s',
'Advogato' => 'http://advogato.org/%s',
'Wiki' => 'http://c2.com/cgi/wiki?%s'
),
'target' => '_blank',
'css' => null
);
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
$site = $options['site'];
$page = $options['page'];
$text = $options['text'];
$css = $this->formatConf(' class="%s"', 'css');
if (isset($this->conf['sites'][$site])) {
$href = $this->conf['sites'][$site];
} else {
return $text;
}
// old form where page is at end,
// or new form with %s placeholder for sprintf()?
if (strpos($href, '%s') === false) {
// use the old form
$href = $href . $page;
} else {
// use the new form
$href = sprintf($href, $page);
}
// allow for alternative targets
$target = $this->getConf('target');
// build base link
$text = htmlspecialchars($text);
$output = "<a$css href=\"$href\"";
// are we targeting a specific window?
if ($target) {
// this is XHTML compliant, suggested by Aaron Kalin.
// code tip is actually from youngpup.net, and it
// uses the $target as the new window name.
$target = htmlspecialchars($target);
$output .= " onClick=\"window.open(this.href, '$target');";
$output .= " return false;\"";
}
$output .= ">$text</a>";
return $output;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Italic.php
New file
0,0 → 1,34
<?php
 
class Text_Wiki_Render_Xhtml_Italic extends Text_Wiki_Render {
var $conf = array(
'css' => null
);
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
if ($options['type'] == 'start') {
$css = $this->formatConf(' class="%s"', 'css');
return "<i$css>";
}
if ($options['type'] == 'end') {
return '</i>';
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Paragraph.php
New file
0,0 → 1,36
<?php
 
class Text_Wiki_Render_Xhtml_Paragraph extends Text_Wiki_Render {
var $conf = array(
'css' => null
);
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
extract($options); //type
if ($type == 'start') {
$css = $this->formatConf(' class="%s"', 'css');
return "<p$css>";
}
if ($type == 'end') {
return "</p>\n\n";
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Blockquote.php
New file
0,0 → 1,46
<?php
 
class Text_Wiki_Render_Xhtml_Blockquote extends Text_Wiki_Render {
var $conf = array(
'css' => null
);
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
$type = $options['type'];
$level = $options['level'];
// set up indenting so that the results look nice; we do this
// in two steps to avoid str_pad mathematics. ;-)
$pad = str_pad('', $level, "\t");
$pad = str_replace("\t", ' ', $pad);
// pick the css type
$css = $this->formatConf(' class="%s"', 'css');
// starting
if ($type == 'start') {
return "$pad<blockquote$css>";
}
// ending
if ($type == 'end') {
return $pad . "</blockquote>\n";
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Anchor.php
New file
0,0 → 1,37
<?php
 
/**
*
* This class renders an anchor target name in XHTML.
*
* @author Manuel Holtgrewe <purestorm at ggnore dot net>
*
* @author Paul M. Jones <pmjones at ciaweb dot net>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Render_Xhtml_Anchor extends Text_Wiki_Render {
var $conf = array(
'css' => null
);
function token($options)
{
extract($options); // $type, $name
if ($type == 'start') {
$css = $this->formatConf(' class="%s"', 'css');
$format = "<a$css id=\"%s\">'";
return sprintf($format ,$name);
}
if ($type == 'end') {
return '</a>';
}
}
}
 
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/List.php
New file
0,0 → 1,142
<?php
 
 
class Text_Wiki_Render_Xhtml_List extends Text_Wiki_Render {
var $conf = array(
'css_ol' => null,
'css_ol_li' => null,
'css_ul' => null,
'css_ul_li' => null
);
/**
*
* Renders a token into text matching the requested format.
*
* This rendering method is syntactically and semantically compliant
* with XHTML 1.1 in that sub-lists are part of the previous list item.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
// make nice variables (type, level, count)
extract($options);
// set up indenting so that the results look nice; we do this
// in two steps to avoid str_pad mathematics. ;-)
$pad = str_pad('', $level, "\t");
$pad = str_replace("\t", ' ', $pad);
switch ($type) {
case 'bullet_list_start':
// build the base HTML
$css = $this->formatConf(' class="%s"', 'css_ul');
$html = "<ul$css>";
// if this is the opening block for the list,
// put an extra newline in front of it so the
// output looks nice.
if ($level == 0) {
$html = "\n$html";
}
// done!
return $html;
break;
case 'bullet_list_end':
// build the base HTML
$html = "</li>\n$pad</ul>";
// if this is the closing block for the list,
// put extra newlines after it so the output
// looks nice.
if ($level == 0) {
$html .= "\n\n";
}
// done!
return $html;
break;
case 'number_list_start':
// build the base HTML
$css = $this->formatConf(' class="%s"', 'css_ol');
$html = "<ol$css>";
// if this is the opening block for the list,
// put an extra newline in front of it so the
// output looks nice.
if ($level == 0) {
$html = "\n$html";
}
// done!
return $html;
break;
case 'number_list_end':
// build the base HTML
$html = "</li>\n$pad</ol>";
// if this is the closing block for the list,
// put extra newlines after it so the output
// looks nice.
if ($level == 0) {
$html .= "\n\n";
}
// done!
return $html;
break;
case 'bullet_item_start':
case 'number_item_start':
// pick the proper CSS class
if ($type == 'bullet_item_start') {
$css = $this->formatConf(' class="%s"', 'css_ul_li');
} else {
$css = $this->formatConf(' class="%s"', 'css_ol_li');
}
// build the base HTML
$html = "\n$pad<li$css>";
// for the very first item in the list, do nothing.
// but for additional items, be sure to close the
// previous item.
if ($count > 0) {
$html = "</li>$html";
}
// done!
return $html;
break;
case 'bullet_item_end':
case 'number_item_end':
default:
// ignore item endings and all other types.
// item endings are taken care of by the other types
// depending on their place in the list.
return '';
break;
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Embed.php
New file
0,0 → 1,23
<?php
 
class Text_Wiki_Render_Xhtml_Embed extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return $options['text'];
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Delimiter.php
New file
0,0 → 1,23
<?php
 
class Text_Wiki_Render_Xhtml_Delimiter extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return $options['text'];
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Bold.php
New file
0,0 → 1,34
<?php
 
class Text_Wiki_Render_Xhtml_Bold extends Text_Wiki_Render {
 
var $conf = array(
'css' => null
);
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
if ($options['type'] == 'start') {
$css = $this->formatConf(' class="%s"', 'css');
return "<b$css>";
}
if ($options['type'] == 'end') {
return '</b>';
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Wikilink.php
New file
0,0 → 1,122
<?php
 
class Text_Wiki_Render_Xhtml_Wikilink extends Text_Wiki_Render {
var $conf = array(
'pages' => array(), // set to null or false to turn off page checks
'view_url' => 'http://example.com/index.php?page=%s',
'new_url' => 'http://example.com/new.php?page=%s',
'new_text' => '?',
'new_text_pos' => 'after', // 'before', 'after', or null/false
'css' => null,
'css_new' => null
);
/**
*
* Renders a token into XHTML.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
// make nice variable names (page, anchor, text)
extract($options);
// are we checking page existence?
$list =& $this->getConf('pages');
if (is_array($list)) {
// yes, check against the page list
$exists = in_array($page, $list);
} else {
// no, assume it exists
$exists = true;
}
// convert *after* checking against page names so as not to mess
// up what the user typed and what we're checking.
$page = htmlspecialchars($page);
$anchor = htmlspecialchars($anchor);
$text = htmlspecialchars($text);
// does the page exist?
if ($exists) {
// PAGE EXISTS.
// yes, link to the page view, but we have to build
// the HREF. we support both the old form where
// the page always comes at the end, and the new
// form that uses %s for sprintf()
$href = $this->getConf('view_url');
if (strpos($href, '%s') === false) {
// use the old form (page-at-end)
$href = $href . $page . $anchor;
} else {
// use the new form (sprintf format string)
$href = sprintf($href, $page . $anchor);
}
// get the CSS class and generate output
$css = $this->formatConf(' class="%s"', 'css');
$output = "<a$css href=\"$href\">$text</a>";
} else {
// PAGE DOES NOT EXIST.
// link to a create-page url, but only if new_url is set
$href = $this->getConf('new_url', null);
// set the proper HREF
if (! $href || trim($href) == '') {
// no useful href, return the text as it is
$output = $text;
} else {
// yes, link to the new-page href, but we have to build
// it. we support both the old form where
// the page always comes at the end, and the new
// form that uses sprintf()
if (strpos($href, '%s') === false) {
// use the old form
$href = $href . $page;
} else {
// use the new form
$href = sprintf($href, $page);
}
}
// get the appropriate CSS class and new-link text
$css = $this->formatConf(' class="%s"', 'css');
$new = $this->getConf('new_text');
// what kind of linking are we doing?
$pos = $this->getConf('new_text_pos');
if (! $pos || ! $new) {
// no position (or no new_text), use css only on the page name
$output = "<a$css href=\"$href\">$page</a>";
} elseif ($pos == 'before') {
// use the new_text BEFORE the page name
$output = "<a$css href=\"$href\">$new</a>$text";
} else {
// default, use the new_text link AFTER the page name
$output = "$text<a$css href=\"$href\">$new</a>";
}
}
return $output;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Image.php
New file
0,0 → 1,151
<?php
class Text_Wiki_Render_Xhtml_Image extends Text_Wiki_Render {
 
var $conf = array(
'base' => '/',
'css' => null,
'css_link' => null
);
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
// note the image source
$src = $options['src'];
// is the source a local file or URL?
if (strpos($src, '://') === false) {
// the source refers to a local file.
// add the URL base to it.
$src = $this->getConf('base', '/') . $src;
}
// stephane@metacites.net
// is the image clickable?
if (isset($options['attr']['link'])) {
// yes, the image is clickable.
// are we linked to a URL or a wiki page?
if (strpos($options['attr']['link'], '://')) {
// it's a URL
$href = $options['attr']['link'];
} else {
// it's a WikiPage; assume it exists.
/** @todo This needs to honor sprintf wikilinks (pmjones) */
/** @todo This needs to honor interwiki (pmjones) */
/** @todo This needs to honor freelinks (pmjones) */
$href = $this->wiki->getRenderConf('xhtml', 'wikilink', 'view_url') .
$options['attr']['link'];
}
} else {
// image is not clickable.
$href = null;
}
// unset so it won't show up as an attribute
unset($options['attr']['link']);
// stephane@metacites.net -- 25/07/2004
// we make up an align="center" value for the <img> tag.
if (isset($options['attr']['align']) &&
$options['attr']['align'] == 'center') {
// unset so it won't show up as an attribute
unset($options['attr']['align']);
// make sure we have a style attribute
if (! isset($options['attr']['style'])) {
// no style, set up a blank one
$options['attr']['style'] = '';
} else {
// style exists, add a space
$options['attr']['style'] .= ' ';
}
// add a "center" style to the existing style.
$options['attr']['style'] .=
'display: block; margin-left: auto; margin-right: auto;';
}
// stephane@metacites.net -- 25/07/2004
// try to guess width and height
if (! isset($options['attr']['width']) &&
! isset($options['attr']['height'])) {
// does the source refer to a local file or a URL?
if (strpos($src,'://')) {
// is a URL link
$imageFile = $src;
} else {
// is a local file
$imageFile = $_SERVER['DOCUMENT_ROOT'] . $src;
}
// attempt to get the image size
$imageSize = @getimagesize($imageFile);
if (is_array($imageSize)) {
$options['attr']['width'] = $imageSize[0];
$options['attr']['height'] = $imageSize[1];
}
}
// start the HTML output
$output = '<img src="' . htmlspecialchars($src) . '"';
// get the CSS class but don't add it yet
$css = $this->formatConf(' class="%s"', 'css');
// add the attributes to the output, and be sure to
// track whether or not we find an "alt" attribute
$alt = false;
foreach ($options['attr'] as $key => $val) {
// track the 'alt' attribute
if (strtolower($key) == 'alt') {
$alt = true;
}
// the 'class' attribute overrides the CSS class conf
if (strtolower($key) == 'class') {
$css = null;
}
$key = htmlspecialchars($key);
$val = htmlspecialchars($val);
$output .= " $key=\"$val\"";
}
// always add an "alt" attribute per Stephane Solliec
if (! $alt) {
$alt = htmlspecialchars(basename($options['src']));
$output .= " alt=\"$alt\"";
}
// end the image tag with the automatic CSS class (if any)
$output .= "$css />";
// was the image clickable?
if ($href) {
// yes, add the href and return
$href = htmlspecialchars($href);
$css = $this->formatConf(' class="%s"', 'css_link');
$output = "<a$css href=\"$href\">$output</a>";
}
return $output;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Tt.php
New file
0,0 → 1,35
<?php
 
class Text_Wiki_Render_Xhtml_tt extends Text_Wiki_Render {
var $conf = array(
'css' => null
);
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
if ($options['type'] == 'start') {
$css = $this->formatConf(' class="%s"', 'css');
return "<tt$css>";
}
if ($options['type'] == 'end') {
return '</tt>';
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Revise.php
New file
0,0 → 1,45
<?php
 
class Text_Wiki_Render_Xhtml_Revise extends Text_Wiki_Render {
var $conf = array(
'css_ins' => null,
'css_del' => null
);
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
if ($options['type'] == 'del_start') {
$css = $this->formatConf(' class="%s"', 'css_del');
return "<del$css>";
}
if ($options['type'] == 'del_end') {
return "</del>";
}
if ($options['type'] == 'ins_start') {
$css = $this->formatConf(' class="%s"', 'css_ins');
return "<ins$css>";
}
if ($options['type'] == 'ins_end') {
return "</ins>";
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Freelink.php
New file
0,0 → 1,9
<?php
 
require_once 'Text/Wiki/Render/Xhtml/Wikilink.php';
 
class Text_Wiki_Render_Xhtml_Freelink extends Text_Wiki_Render_Xhtml_Wikilink {
// renders identically to wikilinks, only the parsing is different :-)
}
 
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Newline.php
New file
0,0 → 1,12
<?php
 
class Text_Wiki_Render_Xhtml_Newline extends Text_Wiki_Render {
function token($options)
{
return "<br />\n";
}
}
 
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Url.php
New file
0,0 → 1,91
<?php
 
 
class Text_Wiki_Render_Xhtml_Url extends Text_Wiki_Render {
var $conf = array(
'target' => '_blank',
'images' => true,
'img_ext' => array('jpg', 'jpeg', 'gif', 'png'),
'css_inline' => null,
'css_footnote' => null,
'css_descr' => null,
'css_img' => null
);
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
// create local variables from the options array (text,
// href, type)
extract($options);
// find the rightmost dot and determine the filename
// extension.
$pos = strrpos($href, '.');
$ext = strtolower(substr($href, $pos + 1));
$href = htmlspecialchars($href);
// does the filename extension indicate an image file?
if ($this->getConf('images') &&
in_array($ext, $this->getConf('img_ext', array()))) {
// create alt text for the image
if (! isset($text) || $text == '') {
$text = basename($href);
$text = htmlspecialchars($text);
}
// generate an image tag
$css = $this->formatConf(' class="%s"', 'css_img');
$output = "<img$css src=\"$href\" alt=\"$text\" />";
} else {
// allow for alternative targets on non-anchor HREFs
if ($href{0} == '#') {
$target = '';
} else {
$target = $this->getConf('target');
}
// generate a regular link (not an image)
$text = htmlspecialchars($text);
$css = $this->formatConf(' class="%s"', "css_$type");
$output = "<a$css href=\"$href\"";
if ($target) {
// use a "popup" window. this is XHTML compliant, suggested by
// Aaron Kalin. uses the $target as the new window name.
$target = htmlspecialchars($target);
$output .= " onclick=\"window.open(this.href, '$target');";
$output .= " return false;\"";
}
// finish up output
$output .= ">$text</a>";
// make numbered references look like footnotes when no
// CSS class specified, make them superscript by default
if ($type == 'footnote' && ! $css) {
$output = '<sup>' . $output . '</sup>';
}
}
return $output;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Emphasis.php
New file
0,0 → 1,35
<?php
 
class Text_Wiki_Render_Xhtml_Emphasis extends Text_Wiki_Render {
var $conf = array(
'css' => null
);
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
if ($options['type'] == 'start') {
$css = $this->formatConf(' class="%s"', 'css');
return "<em$css>";
}
if ($options['type'] == 'end') {
return '</em>';
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Code.php
New file
0,0 → 1,102
<?php
 
class Text_Wiki_Render_Xhtml_Code extends Text_Wiki_Render {
var $conf = array(
'css' => null, // class for <pre>
'css_code' => null, // class for generic <code>
'css_php' => null, // class for PHP <code>
'css_html' => null // class for HTML <code>
);
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
$text = $options['text'];
$attr = $options['attr'];
$type = strtolower($attr['type']);
$css = $this->formatConf(' class="%s"', 'css');
$css_code = $this->formatConf(' class="%s"', 'css_code');
$css_php = $this->formatConf(' class="%s"', 'css_php');
$css_html = $this->formatConf(' class="%s"', 'css_html');
if ($type == 'php') {
// PHP code example:
// add the PHP tags
$text = "<?php\n" . $options['text'] . "\n?>"; // <?php
// convert tabs to four spaces
$text = str_replace("\t", " ", $text);
// colorize the code block (also converts HTML entities and adds
// <code>...</code> tags)
ob_start();
highlight_string($text);
$text = ob_get_contents();
ob_end_clean();
// replace <br /> tags with simple newlines.
// replace non-breaking space with simple spaces.
// translate HTML <font> and color to XHTML <span> and style.
// courtesy of research by A. Kalin :-).
$map = array(
'<br />' => "\n",
'&nbsp;' => ' ',
'<font' => '<span',
'</font>' => '</span>',
'color="' => 'style="color:'
);
$text = strtr($text, $map);
// get rid of the last newline inside the code block
// (becuase higlight_string puts one there)
if (substr($text, -8) == "\n</code>") {
$text = substr($text, 0, -8) . "</code>";
}
// replace all <code> tags with classed tags
if ($css_php) {
$text = str_replace('<code>', "<code$css_php>", $text);
}
// done
$text = "<pre$css>$text</pre>";
} elseif ($type == 'html' || $type == 'xhtml') {
// HTML code example:
// add <html> opening and closing tags,
// convert tabs to four spaces,
// convert entities.
$text = str_replace("\t", " ", $text);
$text = "<html>\n$text\n</html>";
$text = htmlentities($text);
$text = "<pre$css><code$css_html>$text</code></pre>";
} else {
// generic code example:
// convert tabs to four spaces,
// convert entities.
$text = str_replace("\t", " ", $text);
$text = htmlentities($text);
$text = "<pre$css><code$css_code>$text</code></pre>";
}
return "\n$text\n\n";
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Xhtml/Strong.php
New file
0,0 → 1,35
<?php
 
class Text_Wiki_Render_Xhtml_Strong extends Text_Wiki_Render {
var $conf = array(
'css' => null
);
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
if ($options['type'] == 'start') {
$css = $this->formatConf(' class="%s"', 'css');
return "<strong$css>";
}
if ($options['type'] == 'end') {
return '</strong>';
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Tt.php
New file
0,0 → 1,30
<?php
 
class Text_Wiki_Render_Latex_tt extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
if ($options['type'] == 'start') {
return '\texttt{';
}
if ($options['type'] == 'end') {
return '}';
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Revise.php
New file
0,0 → 1,38
<?php
 
class Text_Wiki_Render_Latex_Revise extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
if ($options['type'] == 'del_start') {
return '\sout{';
}
if ($options['type'] == 'del_end') {
return '}';
}
if ($options['type'] == 'ins_start') {
return '\underline{';
}
if ($options['type'] == 'ins_end') {
return '}';
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Freelink.php
New file
0,0 → 1,34
<?php
 
class Text_Wiki_Render_Latex_Freelink extends Text_Wiki_Render {
var $conf = array(
'pages' => array(),
'view_url' => 'http://example.com/index.php?page=%s',
'new_url' => 'http://example.com/new.php?page=%s',
'new_text' => '?'
);
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
// get nice variable names (page, text, anchor)
extract($options);
return "$text\\footnote\{$anchor} ";
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Newline.php
New file
0,0 → 1,12
<?php
 
class Text_Wiki_Render_Latex_Newline extends Text_Wiki_Render {
function token($options)
{
return "\n";
}
}
 
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Url.php
New file
0,0 → 1,35
<?php
 
 
class Text_Wiki_Render_Latex_Url extends Text_Wiki_Render {
var $conf = array(
'target' => false,
'images' => true,
'img_ext' => array('jpg', 'jpeg', 'gif', 'png')
);
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
// create local variables from the options array (text,
// href, type)
extract($options);
 
return " $text\\footnote\{$href}";
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Emphasis.php
New file
0,0 → 1,29
<?php
 
class Text_Wiki_Render_Latex_Emphasis extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
if ($options['type'] == 'start') {
return '\textsl{';
}
if ($options['type'] == 'end') {
return '}';
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Code.php
New file
0,0 → 1,26
<?php
 
class Text_Wiki_Render_Latex_Code extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
$text = $options['text'];
 
return "\\begin{verbatim}\n$text\n\\end{verbatim}\n\n";
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Strong.php
New file
0,0 → 1,30
<?php
 
class Text_Wiki_Render_Latex_Strong extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
if ($options['type'] == 'start') {
return '\textbf{';
}
if ($options['type'] == 'end') {
return '}';
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Center.php
New file
0,0 → 1,33
<?php
 
class Text_Wiki_Render_Latex_Center extends Text_Wiki_Render {
 
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return 'Center: NI';
if ($options['type'] == 'start') {
//return "\n<center>\n";
return '<div style="text-align: center;">';
}
if ($options['type'] == 'end') {
//return "</center>\n";
return '</div>';
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Phplookup.php
New file
0,0 → 1,34
<?php
 
class Text_Wiki_Render_Latex_Phplookup extends Text_Wiki_Render {
var $conf = array('target' => '_blank');
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return 'Phplookup: NI';
$text = trim($options['text']);
$target = $this->getConf('target', '');
if ($target) {
$target = " target=\"$target\"";
}
return "<a$target href=\"http://php.net/$text\">$text</a>";
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Superscript.php
New file
0,0 → 1,31
<?php
 
class Text_Wiki_Render_Latex_Superscript extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return 'Superscript: NI';
if ($options['type'] == 'start') {
return '<sup>';
}
if ($options['type'] == 'end') {
return '</sup>';
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Include.php
New file
0,0 → 1,8
<?php
class Text_Wiki_Render_Latex_Include extends Text_Wiki_Render {
function token()
{
return '';
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Colortext.php
New file
0,0 → 1,58
<?php
 
class Text_Wiki_Render_Latex_Colortext extends Text_Wiki_Render {
var $colors = array(
'aqua',
'black',
'blue',
'fuchsia',
'gray',
'green',
'lime',
'maroon',
'navy',
'olive',
'purple',
'red',
'silver',
'teal',
'white',
'yellow'
);
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return 'Colortext: NI';
$type = $options['type'];
$color = $options['color'];
if (! in_array($color, $this->colors)) {
$color = '#' . $color;
}
if ($type == 'start') {
return "<span style=\"color: $color;\">";
}
if ($options['type'] == 'end') {
return '</span>';
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Break.php
New file
0,0 → 1,24
<?php
 
class Text_Wiki_Render_Latex_Break extends Text_Wiki_Render {
 
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return "\\newline\n";
}
}
 
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Toc.php
New file
0,0 → 1,30
<?php
 
class Text_Wiki_Render_Latex_Toc extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
if($options['type'] == 'list_start') {
return "\\tableofcontents\n\n";
}
return '';
}
 
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Function.php
New file
0,0 → 1,23
<?php
 
class Text_Wiki_Render_Latex_Function extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return "Function: NI";
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Table.php
New file
0,0 → 1,93
<?php
 
class Text_Wiki_Render_Latex_Table extends Text_Wiki_Render {
var $cell_id = 0;
var $cell_count = 0;
var $is_spanning = false;
var $conf = array(
'css_table' => null,
'css_tr' => null,
'css_th' => null,
'css_td' => null
);
 
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
 
function token($options)
{
// make nice variable names (type, attr, span)
extract($options);
 
switch ($type)
{
case 'table_start':
$this->cell_count = $cols;
$tbl_start = '\begin{tabular}{|';
for ($a=0; $a < $this->cell_count; $a++) {
$tbl_start .= 'l|';
}
$tbl_start .= "}\n";
return $tbl_start;
 
case 'table_end':
return "\\hline\n\\end{tabular}\n";
 
case 'row_start':
$this->is_spanning = false;
$this->cell_id = 0;
return "\\hline\n";
 
case 'row_end':
return "\\\\\n";
 
case 'cell_start':
if ($span > 1) {
$col_spec = '';
if ($this->cell_id == 0) {
$col_spec = '|';
}
$col_spec .= 'l|';
$this->cell_id += $span;
$this->is_spanning = true;
return "\\multicolumn\{$span}\{$col_spec}{";
}
 
$this->cell_id += 1;
return '';
 
case 'cell_end':
$out = '';
if ($this->is_spanning) {
$this->is_spanning = false;
$out = '}';
}
if ($this->cell_id != $this->cell_count) {
$out .= ' & ';
}
 
return $out;
 
default:
return '';
 
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Raw.php
New file
0,0 → 1,23
<?php
 
class Text_Wiki_Render_Latex_Raw extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return "Raw: ".$options['text'];
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Deflist.php
New file
0,0 → 1,53
<?php
 
class Text_Wiki_Render_Latex_Deflist extends Text_Wiki_Render {
 
var $conf = array(
'css_dl' => null,
'css_dt' => null,
'css_dd' => null
);
 
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
 
function token($options)
{
$type = $options['type'];
switch ($type)
{
case 'list_start':
return "\\begin{description}\n";
 
case 'list_end':
return "\\end{description}\n\n";
 
case 'term_start':
return '\item[';
 
case 'term_end':
return '] ';
 
case 'narr_start':
return '{';
 
case 'narr_end':
return "}\n";
 
default:
return '';
 
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Horiz.php
New file
0,0 → 1,23
<?php
 
class Text_Wiki_Render_Latex_Horiz extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return "\n\\noindent\\rule{\\textwidth}{1pt}\n";
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Prefilter.php
New file
0,0 → 1,40
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Jeremy Cowgar <jeremy@cowgar.com> |
// +----------------------------------------------------------------------+
//
// $Id: Prefilter.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
 
 
/**
*
* This class implements a Text_Wiki_Render_Latex to "pre-filter" source text so
* that line endings are consistently \n, lines ending in a backslash \
* are concatenated with the next line, and tabs are converted to spaces.
*
* @author Jeremy Cowgar <jeremy@cowgar.com>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Render_Latex_Prefilter extends Text_Wiki_Render {
function token()
{
return '';
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Heading.php
New file
0,0 → 1,33
<?php
 
class Text_Wiki_Render_Latex_Heading extends Text_Wiki_Render {
 
function token($options)
{
// get nice variable names (type, level)
extract($options);
 
if ($type == 'start') {
switch ($level)
{
case '1':
return '\part{';
case '2':
return '\section{';
case '3':
return '\subsection{';
case '4':
return '\subsubsection{';
case '5':
return '\paragraph{';
case '6':
return '\subparagraph{';
}
}
if ($type == 'end') {
return "}\n";
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Tighten.php
New file
0,0 → 1,9
<?php
class Text_Wiki_Render_Latex_Tighten extends Text_Wiki_Render {
function token()
{
return '';
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Html.php
New file
0,0 → 1,25
<?php
 
class Text_Wiki_Render_Latex_Html extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
print_r($this);
return '';
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Interwiki.php
New file
0,0 → 1,60
<?php
 
class Text_Wiki_Render_Latex_Interwiki extends Text_Wiki_Render {
var $conf = array(
'sites' => array(
'MeatBall' => 'http://www.usemod.com/cgi-bin/mb.pl?%s',
'Advogato' => 'http://advogato.org/%s',
'Wiki' => 'http://c2.com/cgi/wiki?%s'
),
'target' => '_blank'
);
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
$site = $options['site'];
$page = $options['page'];
$text = $options['text'];
if (isset($this->conf['sites'][$site])) {
$href = $this->conf['sites'][$site];
} else {
return $text;
}
// old form where page is at end,
// or new form with %s placeholder for sprintf()?
if (strpos($href, '%s') === false) {
// use the old form
$href = $href . $page;
} else {
// use the new form
$href = sprintf($href, $page);
}
// allow for alternative targets
$target = $this->getConf('target', '');
if ($target && trim($target) != '') {
$target = " target=\"$target\"";
}
return "$text\\footnote\{$href}";
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Italic.php
New file
0,0 → 1,5
<?php
 
class Text_Wiki_Render_Latex_Italic extends Text_Wiki_Render_Latex_Emphasis {
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Paragraph.php
New file
0,0 → 1,31
<?php
 
class Text_Wiki_Render_Latex_Paragraph extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
extract($options); //type
if ($type == 'start') {
return '';
}
if ($type == 'end') {
return "\n\n";
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Blockquote.php
New file
0,0 → 1,36
<?php
 
class Text_Wiki_Render_Latex_Blockquote extends Text_Wiki_Render {
var $conf = array('css' => null);
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
$type = $options['type'];
$level = $options['level'];
// starting
if ($type == 'start') {
return "\\begin{quote}\n";
}
// ending
if ($type == 'end') {
return "\\end{quote}\n\n";
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Anchor.php
New file
0,0 → 1,33
<?php
 
/**
*
* This class renders an anchor target name in LaTeX.
*
* $Id: Anchor.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
*
* @author Jeremy Cowgar <jeremy@cowgar.com>
*
* @package Text_Wiki
*
*/
 
class Text_Wiki_Render_Latex_Anchor extends Text_Wiki_Render {
function token($options)
{
extract($options); // $type, $name
if ($type == 'start') {
//return sprintf('<a id="%s">',$name);
return '';
}
if ($type == 'end') {
//return '</a>';
return '';
}
}
}
 
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/List.php
New file
0,0 → 1,57
<?php
 
 
class Text_Wiki_Render_Latex_List extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* This rendering method is syntactically and semantically compliant
* with XHTML 1.1 in that sub-lists are part of the previous list item.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
 
function token($options)
{
// make nice variables (type, level, count)
extract($options);
switch ($type)
{
case 'bullet_list_start':
return "\\begin{itemize}\n";
case 'bullet_list_end':
return "\\end{itemize}\n";
case 'number_list_start':
return "\\begin{enumerate}\n";
case 'number_list_end':
return "\\end{enumerate}\n";
case 'bullet_item_start':
case 'number_item_start':
return "\\item{";
case 'bullet_item_end':
case 'number_item_end':
return "}\n";
default:
// ignore item endings and all other types.
// item endings are taken care of by the other types
// depending on their place in the list.
return '';
break;
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Embed.php
New file
0,0 → 1,23
<?php
 
class Text_Wiki_Render_Latex_Embed extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return "Embed: ".$options['text'];
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Delimiter.php
New file
0,0 → 1,25
<?php
 
class Text_Wiki_Render_Latex_Delimiter extends Text_Wiki_Render {
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
// TODO: Is this where I can do some LaTeX escaping for items
// such as $ { } _ ?
return "Delimiter: ".$options['text'];
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Bold.php
New file
0,0 → 1,4
<?php
 
class Text_Wiki_Render_Latex_Bold extends Text_Wiki_Render_Latex_Strong {}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Wikilink.php
New file
0,0 → 1,60
<?php
 
class Text_Wiki_Render_Latex_Wikilink extends Text_Wiki_Render {
var $conf = array(
'pages' => array(),
'view_url' => 'http://example.com/index.php?page=%s',
'new_url' => 'http://example.com/new.php?page=%s',
'new_text' => '?'
);
/**
*
* Renders a token into XHTML.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
// make nice variable names (page, anchor, text)
extract($options);
// are we checking page existence?
$list =& $this->getConf('pages');
if (is_array($list)) {
// yes, check against the page list
$exists = in_array($page, $list);
} else {
// no, assume it exists
$exists = true;
}
// convert *after* checking against page names so as not to mess
// up what the user typed and what we're checking.
$page = htmlspecialchars($page);
$anchor = htmlspecialchars($anchor);
$text = htmlspecialchars($text);
$href = $this->getConf('view_url');
if (strpos($href, '%s') === false) {
// use the old form (page-at-end)
$href = $href . $page . $anchor;
} else {
// use the new form (sprintf format string)
$href = sprintf($href, $page . $anchor);
}
// get the CSS class and generate output
$css = $this->formatConf(' class="%s"', 'css');
return "$text\\footnote\{$href}";
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Render/Latex/Image.php
New file
0,0 → 1,70
<?php
class Text_Wiki_Render_Latex_Image extends Text_Wiki_Render {
 
var $conf = array(
'base' => '/'
);
/**
*
* Renders a token into text matching the requested format.
*
* @access public
*
* @param array $options The "options" portion of the token (second
* element).
*
* @return string The text rendered from the token options.
*
*/
function token($options)
{
return 'Image: NI';
$src = '"' .
$this->getConf('base', '/') .
$options['src'] . '"';
if (isset($options['attr']['link'])) {
// this image has a link
if (strpos($options['attr']['link'], '://')) {
// it's a URL
$href = $options['attr']['link'];
} else {
$href = $this->wiki->getRenderConf('xhtml', 'wikilink', 'view_url') .
$options['attr']['link'];
}
} else {
// image is not linked
$href = null;
}
// unset these so they don't show up as attributes
unset($options['attr']['link']);
$attr = '';
$alt = false;
foreach ($options['attr'] as $key => $val) {
if (strtolower($key) == 'alt') {
$alt = true;
}
$attr .= " $key=\"$val\"";
}
// always add an "alt" attribute per Stephane Solliec
if (! $alt) {
$attr .= ' alt="' . basename($options['src']) . '"';
}
if ($href) {
return "<a href=\"$href\"><img src=$src$attr/></a>";
} else {
return "<img src=$src$attr/>";
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki/Parse.php
New file
0,0 → 1,253
<?php
 
/**
*
* Baseline rule class for extension into a "real" parser component.
*
* Text_Wiki_Rule classes do not stand on their own; they are called by a
* Text_Wiki object, typcially in the transform()method. Each rule class
* performs three main activities: parse, process, and render.
*
* The parse() method takes a regex and applies it to the whole block of
* source text at one time. Each match is sent as $matches to the
* process() method.
*
* The process() method acts on the matched text from the source, and
* then processes the source text is some way. This may mean the
* creation of a delimited token using addToken(). In every case, the
* process() method returns the text that should replace the matched text
* from parse().
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
* $Id: Parse.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
*
*/
 
class Text_Wiki_Parse {
/**
*
* Configuration options for this parser rule.
*
* @access public
*
* @var string
*
*/
var $conf = array();
/**
*
* Regular expression to find matching text for this rule.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = null;
/**
*
* The name of this rule for new token array elements.
*
* @access public
*
* @var string
*
*/
var $rule = null;
/**
*
* A reference to the calling Text_Wiki object.
*
* This is needed so that each rule has access to the same source
* text, token set, URLs, interwiki maps, page names, etc.
*
* @access public
*
* @var object
*/
var $wiki = null;
/**
*
* Constructor for this parser rule.
*
* @access public
*
* @param object &$obj The calling "parent" Text_Wiki object.
*
*/
function Text_Wiki_Parse(&$obj)
{
// set the reference to the calling Text_Wiki object;
// this allows us access to the shared source text, token
// array, etc.
$this->wiki =& $obj;
// set the name of this rule; generally used when adding
// to the tokens array. strip off the Text_Wiki_Parse_ portion.
// text_wiki_parse_
// 0123456789012345
$tmp = substr(get_class($this), 16);
$this->rule = ucwords(strtolower($tmp));
// override config options for the rule if specified
if (isset($this->wiki->parseConf[$this->rule]) &&
is_array($this->wiki->parseConf[$this->rule])) {
$this->conf = array_merge(
$this->conf,
$this->wiki->parseConf[$this->rule]
);
}
}
/**
*
* Abstrct method to parse source text for matches.
*
* Applies the rule's regular expression to the source text, passes
* every match to the process() method, and replaces the matched text
* with the results of the processing.
*
* @access public
*
* @see Text_Wiki_Parse::process()
*
*/
function parse()
{
$this->wiki->source = preg_replace_callback(
$this->regex,
array(&$this, 'process'),
$this->wiki->source
);
}
/**
*
* Abstract method to generate replacements for matched text.
*
* @access public
*
* @param array $matches An array of matches from the parse() method
* as generated by preg_replace_callback. $matches[0] is the full
* matched string, $matches[1] is the first matched pattern,
* $matches[2] is the second matched pattern, and so on.
*
* @return string The processed text replacement; defaults to the
* full matched string (i.e., no changes to the text).
*
* @see Text_Wiki_Parse::parse()
*
*/
function process(&$matches)
{
return $matches[0];
}
/**
*
* Simple method to safely get configuration key values.
*
* @access public
*
* @param string $key The configuration key.
*
* @param mixed $default If the key does not exist, return this value
* instead.
*
* @return mixed The configuration key value (if it exists) or the
* default value (if not).
*
*/
function getConf($key, $default = null)
{
if (isset($this->conf[$key])) {
return $this->conf[$key];
} else {
return $default;
}
}
/**
*
* Extract 'attribute="value"' portions of wiki markup.
*
* This kind of markup is typically used only in macros, but is useful
* anywhere.
*
* The syntax is pretty strict; there can be no spaces between the
* option name, the equals, and the first double-quote; the value
* must be surrounded by double-quotes. You can escape characters in
* the value with a backslash, and the backslash will be stripped for
* you.
*
* @access public
*
* @param string $text The "attributes" portion of markup.
*
* @return array An associative array of key-value pairs where the
* key is the option name and the value is the option value.
*
*/
function getAttrs($text)
{
// find the =" sections;
$tmp = explode('="', trim($text));
// basic setup
$k = count($tmp) - 1;
$attrs = array();
$key = null;
// loop through the sections
foreach ($tmp as $i => $val) {
// first element is always the first key
if ($i == 0) {
$key = trim($val);
continue;
}
// find the last double-quote in the value.
// the part to the left is the value for the last key,
// the part to the right is the next key name
$pos = strrpos($val, '"');
$attrs[$key] = stripslashes(substr($val, 0, $pos));
$key = trim(substr($val, $pos+1));
}
return $attrs;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Text/Wiki.php
New file
0,0 → 1,1258
<?php
 
/**
* The baseline abstract parser class.
*/
 
require_once 'Wiki/Parse.php';
 
/**
* The baseline abstract render class.
*/
 
require_once 'Wiki/Render.php';
 
/**
*
* Parse structured wiki text and render into arbitrary formats such as XHTML.
*
* This is the "master" class for handling the management and convenience
* functions to transform Wiki-formatted text.
*
* $Id: Wiki.php,v 1.2 2005-06-24 10:47:09 jpm Exp $
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Text_Wiki
*
* @version 0.23.1
*
* @license LGPL
*
*/
 
class Text_Wiki {
/**
*
* The default list of rules, in order, to apply to the source text.
*
* @access public
*
* @var array
*
*/
var $rules = array(
'Prefilter',
'Delimiter',
'Code',
'Function',
'Html',
'Raw',
'Include',
'Embed',
'Anchor',
'Heading',
'Toc',
'Horiz',
'Break',
'Blockquote',
'List',
'Deflist',
'Table',
'Image',
'Phplookup',
'Center',
'Newline',
'Paragraph',
'Url',
'Freelink',
'Interwiki',
'Wikilink',
'Colortext',
'Strong',
'Bold',
'Emphasis',
'Italic',
'Tt',
'Superscript',
'Revise',
'Tighten'
);
/**
*
* The list of rules to not-apply to the source text.
*
* @access public
*
* @var array
*
*/
var $disable = array(
'Html',
'Include',
'Embed'
);
/**
*
* Custom configuration for rules at the parsing stage.
*
* In this array, the key is the parsing rule name, and the value is
* an array of key-value configuration pairs corresponding to the $conf
* property in the target parsing rule.
*
* For example:
*
* <code>
* $parseConf = array(
* 'Include' => array(
* 'base' => '/path/to/scripts/'
* )
* );
* </code>
*
* Note that most default rules do not need any parsing configuration.
*
* @access public
*
* @var array
*
*/
var $parseConf = array();
/**
*
* Custom configuration for rules at the rendering stage.
*
* Because rendering may be different for each target format, the
* first-level element in this array is always a format name (e.g.,
* 'Xhtml').
*
* Within that first level element, the subsequent elements match the
* $parseConf format. That is, the sub-key is the rendering rule name,
* and the sub-value is an array of key-value configuration pairs
* corresponding to the $conf property in the target rendering rule.
*
* @access public
*
* @var array
*
*/
var $renderConf = array(
'Docbook' => array(),
'Latex' => array(),
'Pdf' => array(),
'Plain' => array(),
'Rtf' => array(),
'Xhtml' => array()
);
/**
*
* Custom configuration for the output format itself.
*
* Even though Text_Wiki will render the tokens from parsed text,
* the format itself may require some configuration. For example,
* RTF needs to know font names and sizes, PDF requires page layout
* information, and DocBook needs a section hierarchy. This array
* matches the $conf property of the the format-level renderer
* (e.g., Text_Wiki_Render_Xhtml).
*
* In this array, the key is the rendering format name, and the value is
* an array of key-value configuration pairs corresponding to the $conf
* property in the rendering format rule.
*
* @access public
*
* @var array
*
*/
var $formatConf = array(
'Docbook' => array(),
'Latex' => array(),
'Pdf' => array(),
'Plain' => array(),
'Rtf' => array(),
'Xhtml' => array()
);
/**
*
* The delimiter for token numbers of parsed elements in source text.
*
* @access public
*
* @var string
*
*/
var $delim = "\xFF";
/**
*
* The tokens generated by rules as the source text is parsed.
*
* As Text_Wiki applies rule classes to the source text, it will
* replace portions of the text with a delimited token number. This
* is the array of those tokens, representing the replaced text and
* any options set by the parser for that replaced text.
*
* The tokens array is sequential; each element is itself a sequential
* array where element 0 is the name of the rule that generated the
* token, and element 1 is an associative array where the key is an
* option name and the value is an option value.
*
* @access private
*
* @var array
*
*/
var $tokens = array();
/**
*
* The source text to which rules will be applied.
*
* This text will be transformed in-place, which means that it will
* change as the rules are applied.
*
* @access private
*
* @var string
*
*/
var $source = '';
/**
*
* Array of rule parsers.
*
* Text_Wiki creates one instance of every rule that is applied to
* the source text; this array holds those instances. The array key
* is the rule name, and the array value is an instance of the rule
* class.
*
* @access private
*
* @var array
*
*/
var $parseObj = array();
/**
*
* Array of rule renderers.
*
* Text_Wiki creates one instance of every rule that is applied to
* the source text; this array holds those instances. The array key
* is the rule name, and the array value is an instance of the rule
* class.
*
* @access private
*
* @var array
*
*/
var $renderObj = array();
/**
*
* Array of format renderers.
*
* @access private
*
* @var array
*
*/
var $formatObj = array();
/**
*
* Array of paths to search, in order, for parsing and rendering rules.
*
* @access private
*
* @var array
*
*/
var $path = array(
'parse' => array(),
'render' => array()
);
/**
*
* The directory separator character.
*
* @access private
*
* @var string
*
*/
var $_dirSep = DIRECTORY_SEPARATOR;
/**
*
* Constructor.
*
* @access public
*
* @param array $rules The set of rules to load for this object.
*
*/
function Text_Wiki($rules = null)
{
if (is_array($rules)) {
$this->rules = $rules;
}
$this->addPath(
'parse',
$this->fixPath(dirname(__FILE__)) . 'Wiki/Parse/'
);
$this->addPath(
'render',
$this->fixPath(dirname(__FILE__)) . 'Wiki/Render/'
);
}
/**
*
* Set parser configuration for a specific rule and key.
*
* @access public
*
* @param string $rule The parse rule to set config for.
*
* @param array|string $arg1 The full config array to use for the
* parse rule, or a conf key in that array.
*
* @param string $arg2 The config value for the key.
*
* @return void
*
*/
function setParseConf($rule, $arg1, $arg2 = null)
{
$rule = ucwords(strtolower($rule));
if (! isset($this->parseConf[$rule])) {
$this->parseConf[$rule] = array();
}
// if first arg is an array, use it as the entire
// conf array for the rule. otherwise, treat arg1
// as a key and arg2 as a value for the rule conf.
if (is_array($arg1)) {
$this->parseConf[$rule] = $arg1;
} else {
$this->parseConf[$rule][$arg1] = $arg2;
}
}
/**
*
* Get parser configuration for a specific rule and key.
*
* @access public
*
* @param string $rule The parse rule to get config for.
*
* @param string $key A key in the conf array; if null,
* returns the entire conf array.
*
* @return mixed The whole conf array if no key is specified,
* or the specific conf key value.
*
*/
function getParseConf($rule, $key = null)
{
$rule = ucwords(strtolower($rule));
// the rule does not exist
if (! isset($this->parseConf[$rule])) {
return null;
}
// no key requested, return the whole array
if (is_null($key)) {
return $this->parseConf[$rule];
}
// does the requested key exist?
if (isset($this->parseConf[$rule][$key])) {
// yes, return that value
return $this->parseConf[$rule][$key];
} else {
// no
return null;
}
}
/**
*
* Set renderer configuration for a specific format, rule, and key.
*
* @access public
*
* @param string $format The render format to set config for.
*
* @param string $rule The render rule to set config for in the format.
*
* @param array|string $arg1 The config array, or the config key
* within the render rule.
*
* @param string $arg2 The config value for the key.
*
* @return void
*
*/
function setRenderConf($format, $rule, $arg1, $arg2 = null)
{
$format = ucwords(strtolower($format));
$rule = ucwords(strtolower($rule));
if (! isset($this->renderConf[$format])) {
$this->renderConf[$format] = array();
}
if (! isset($this->renderConf[$format][$rule])) {
$this->renderConf[$format][$rule] = array();
}
// if first arg is an array, use it as the entire
// conf array for the render rule. otherwise, treat arg1
// as a key and arg2 as a value for the render rule conf.
if (is_array($arg1)) {
$this->renderConf[$format][$rule] = $arg1;
} else {
$this->renderConf[$format][$rule][$arg1] = $arg2;
}
}
/**
*
* Get renderer configuration for a specific format, rule, and key.
*
* @access public
*
* @param string $format The render format to get config for.
*
* @param string $rule The render format rule to get config for.
*
* @param string $key A key in the conf array; if null,
* returns the entire conf array.
*
* @return mixed The whole conf array if no key is specified,
* or the specific conf key value.
*
*/
function getRenderConf($format, $rule, $key = null)
{
$format = ucwords(strtolower($format));
$rule = ucwords(strtolower($rule));
if (! isset($this->renderConf[$format]) ||
! isset($this->renderConf[$format][$rule])) {
return null;
}
// no key requested, return the whole array
if (is_null($key)) {
return $this->renderConf[$format][$rule];
}
// does the requested key exist?
if (isset($this->renderConf[$format][$rule][$key])) {
// yes, return that value
return $this->renderConf[$format][$rule][$key];
} else {
// no
return null;
}
}
/**
*
* Set format configuration for a specific rule and key.
*
* @access public
*
* @param string $format The format to set config for.
*
* @param string $key The config key within the format.
*
* @param string $val The config value for the key.
*
* @return void
*
*/
function setFormatConf($format, $arg1, $arg2 = null)
{
if (! is_array($this->formatConf[$format])) {
$this->formatConf[$format] = array();
}
// if first arg is an array, use it as the entire
// conf array for the format. otherwise, treat arg1
// as a key and arg2 as a value for the format conf.
if (is_array($arg1)) {
$this->formatConf[$format] = $arg1;
} else {
$this->formatConf[$format][$arg1] = $arg2;
}
}
/**
*
* Get configuration for a specific format and key.
*
* @access public
*
* @param string $format The format to get config for.
*
* @param mixed $key A key in the conf array; if null,
* returns the entire conf array.
*
* @return mixed The whole conf array if no key is specified,
* or the specific conf key value.
*
*/
function getFormatConf($format, $key = null)
{
// the format does not exist
if (! isset($this->formatConf[$format])) {
return null;
}
// no key requested, return the whole array
if (is_null($key)) {
return $this->formatConf[$format];
}
// does the requested key exist?
if (isset($this->formatConf[$format][$key])) {
// yes, return that value
return $this->formatConf[$format][$key];
} else {
// no
return null;
}
}
/**
*
* Inserts a rule into to the rule set.
*
* @access public
*
* @param string $name The name of the rule. Should be different from
* all other keys in the rule set.
*
* @param string $tgt The rule after which to insert this new rule. By
* default (null) the rule is inserted at the end; if set to '', inserts
* at the beginning.
*
* @return void
*
*/
function insertRule($name, $tgt = null)
{
$name = ucwords(strtolower($name));
if (! is_null($tgt)) {
$tgt = ucwords(strtolower($tgt));
}
// does the rule name to be inserted already exist?
if (in_array($name, $this->rules)) {
// yes, return
return null;
}
// the target name is not null, and not '', but does not exist
// in the list of rules. this means we're trying to insert after
// a target key, but the target key isn't there.
if (! is_null($tgt) && $tgt != '' &&
! in_array($tgt, $this->rules)) {
return false;
}
// if $tgt is null, insert at the end. We know this is at the
// end (instead of resetting an existing rule) becuase we exited
// at the top of this method if the rule was already in place.
if (is_null($tgt)) {
$this->rules[] = $name;
return true;
}
// save a copy of the current rules, then reset the rule set
// so we can insert in the proper place later.
// where to insert the rule?
if ($tgt == '') {
// insert at the beginning
array_unshift($this->rules, $name);
return true;
}
// insert after the named rule
$tmp = $this->rules;
$this->rules = array();
foreach ($tmp as $val) {
$this->rules[] = $val;
if ($val == $tgt) {
$this->rules[] = $name;
}
}
return true;
}
/**
*
* Delete (remove or unset) a rule from the $rules property.
*
* @access public
*
* @param string $rule The name of the rule to remove.
*
* @return void
*
*/
function deleteRule($name)
{
$name = ucwords(strtolower($name));
$key = array_search($name, $this->rules);
if ($key !== false) {
unset($this->rules[$key]);
}
}
/**
*
* Change from one rule to another in-place.
*
* @access public
*
* @param string $old The name of the rule to change from.
*
* @param string $new The name of the rule to change to.
*
* @return void
*
*/
function changeRule($old, $new)
{
$old = ucwords(strtolower($old));
$new = ucwords(strtolower($new));
$key = array_search($old, $this->rules);
if ($key !== false) {
$this->rules[$old] = $new;
}
}
/**
*
* Enables a rule so that it is applied when parsing.
*
* @access public
*
* @param string $rule The name of the rule to enable.
*
* @return void
*
*/
function enableRule($name)
{
$name = ucwords(strtolower($name));
$key = array_search($name, $this->disable);
if ($key !== false) {
unset($this->disable[$key]);
}
}
/**
*
* Disables a rule so that it is not applied when parsing.
*
* @access public
*
* @param string $rule The name of the rule to disable.
*
* @return void
*
*/
function disableRule($name)
{
$name = ucwords(strtolower($name));
$key = array_search($name, $this->disable);
if ($key === false) {
$this->disable[] = $name;
}
}
/**
*
* Parses and renders the text passed to it, and returns the results.
*
* First, the method parses the source text, applying rules to the
* text as it goes. These rules will modify the source text
* in-place, replacing some text with delimited tokens (and
* populating the $this->tokens array as it goes).
*
* Next, the method renders the in-place tokens into the requested
* output format.
*
* Finally, the method returns the transformed text. Note that the
* source text is transformed in place; once it is transformed, it is
* no longer the same as the original source text.
*
* @access public
*
* @param string $text The source text to which wiki rules should be
* applied, both for parsing and for rendering.
*
* @param string $format The target output format, typically 'xhtml'.
* If a rule does not support a given format, the output from that
* rule is rule-specific.
*
* @return string The transformed wiki text.
*
*/
function transform($text, $format = 'Xhtml')
{
$this->parse($text);
return $this->render($format);
}
/**
*
* Sets the $_source text property, then parses it in place and
* retains tokens in the $_tokens array property.
*
* @access public
*
* @param string $text The source text to which wiki rules should be
* applied, both for parsing and for rendering.
*
* @return void
*
*/
function parse($text)
{
// set the object property for the source text
$this->source = $text;
// reset the tokens.
$this->tokens = array();
// apply the parse() method of each requested rule to the source
// text.
foreach ($this->rules as $name) {
// do not parse the rules listed in $disable
if (! in_array($name, $this->disable)) {
// load the parsing object
$this->loadParseObj($name);
// load may have failed; only parse if
// an object is in the array now
if (is_object($this->parseObj[$name])) {
$this->parseObj[$name]->parse();
}
}
}
}
/**
*
* Renders tokens back into the source text, based on the requested format.
*
* @access public
*
* @param string $format The target output format, typically 'xhtml'.
* If a rule does not support a given format, the output from that
* rule is rule-specific.
*
* @return string The transformed wiki text.
*
*/
function render($format = 'Xhtml')
{
// the rendering method we're going to use from each rule
$format = ucwords(strtolower($format));
// the eventual output text
$output = '';
// when passing through the parsed source text, keep track of when
// we are in a delimited section
$in_delim = false;
// when in a delimited section, capture the token key number
$key = '';
// load the format object
$this->loadFormatObj($format);
// pre-rendering activity
if (is_object($this->formatObj[$format])) {
$output .= $this->formatObj[$format]->pre();
}
// load the render objects
foreach (array_keys($this->parseObj) as $rule) {
$this->loadRenderObj($format, $rule);
}
// pass through the parsed source text character by character
$k = strlen($this->source);
for ($i = 0; $i < $k; $i++) {
// the current character
$char = $this->source{$i};
// are alredy in a delimited section?
if ($in_delim) {
// yes; are we ending the section?
if ($char == $this->delim) {
// yes, get the replacement text for the delimited
// token number and unset the flag.
$key = (int)$key;
$rule = $this->tokens[$key][0];
$opts = $this->tokens[$key][1];
$output .= $this->renderObj[$rule]->token($opts);
$in_delim = false;
} else {
// no, add to the dlimited token key number
$key .= $char;
}
} else {
// not currently in a delimited section.
// are we starting into a delimited section?
if ($char == $this->delim) {
// yes, reset the previous key and
// set the flag.
$key = '';
$in_delim = true;
} else {
// no, add to the output as-is
$output .= $char;
}
}
}
// post-rendering activity
if (is_object($this->formatObj[$format])) {
$output .= $this->formatObj[$format]->post();
}
// return the rendered source text.
return $output;
}
/**
*
* Returns the parsed source text with delimited token placeholders.
*
* @access public
*
* @return string The parsed source text.
*
*/
function getSource()
{
return $this->source;
}
/**
*
* Returns tokens that have been parsed out of the source text.
*
* @access public
*
* @param array $rules If an array of rule names is passed, only return
* tokens matching these rule names. If no array is passed, return all
* tokens.
*
* @return array An array of tokens.
*
*/
function getTokens($rules = null)
{
if (is_null($rules)) {
return $this->tokens;
} else {
settype($rules, 'array');
$result = array();
foreach ($this->tokens as $key => $val) {
if (in_array($val[0], $rules)) {
$result[] = $val;
}
}
return $result;
}
}
/**
*
* Add a token to the Text_Wiki tokens array, and return a delimited
* token number.
*
* @access public
*
* @param array $options An associative array of options for the new
* token array element. The keys and values are specific to the
* rule, and may or may not be common to other rule options. Typical
* options keys are 'text' and 'type' but may include others.
*
* @param boolean $id_only If true, return only the token number, not
* a delimited token string.
*
* @return string|int By default, return the number of the
* newly-created token array element with a delimiter prefix and
* suffix; however, if $id_only is set to true, return only the token
* number (no delimiters).
*
*/
function addToken($rule, $options = array(), $id_only = false)
{
// increment the token ID number. note that if you parse
// multiple times with the same Text_Wiki object, the ID number
// will not reset to zero.
static $id;
if (! isset($id)) {
$id = 0;
} else {
$id ++;
}
// force the options to be an array
settype($options, 'array');
// add the token
$this->tokens[$id] = array(
0 => $rule,
1 => $options
);
// return a value
if ($id_only) {
// return the last token number
return $id;
} else {
// return the token number with delimiters
return $this->delim . $id . $this->delim;
}
}
/**
*
* Set or re-set a token with specific information, overwriting any
* previous rule name and rule options.
*
* @access public
*
* @param int $id The token number to reset.
*
* @param int $rule The rule name to use.
*
* @param array $options An associative array of options for the
* token array element. The keys and values are specific to the
* rule, and may or may not be common to other rule options. Typical
* options keys are 'text' and 'type' but may include others.
*
* @return void
*
*/
function setToken($id, $rule, $options = array())
{
// reset the token
$this->tokens[$id] = array(
0 => $rule,
1 => $options
);
}
/**
*
* Load a rule parser class file.
*
* @access public
*
* @return bool True if loaded, false if not.
*
*/
function loadParseObj($rule)
{
$rule = ucwords(strtolower($rule));
$file = $rule . '.php';
$class = "Text_Wiki_Parse_$rule";
if (! class_exists($class)) {
$loc = $this->findFile('parse', $file);
if ($loc) {
// found the class
include_once $loc;
} else {
// can't find the class
$this->parseObj[$rule] = null;
return false;
}
}
$this->parseObj[$rule] =& new $class($this);
 
}
/**
*
* Load a rule-render class file.
*
* @access public
*
* @return bool True if loaded, false if not.
*
*/
function loadRenderObj($format, $rule)
{
$format = ucwords(strtolower($format));
$rule = ucwords(strtolower($rule));
$file = "$format/$rule.php";
$class = "Text_Wiki_Render_$format" . "_$rule";
if (! class_exists($class)) {
// load the class
$loc = $this->findFile('render', $file);
if ($loc) {
// found the class
include_once $loc;
} else {
// can't find the class
return false;
}
}
$this->renderObj[$rule] =& new $class($this);
}
/**
*
* Load a format-render class file.
*
* @access public
*
* @return bool True if loaded, false if not.
*
*/
function loadFormatObj($format)
{
$format = ucwords(strtolower($format));
$file = $format . '.php';
$class = "Text_Wiki_Render_$format";
if (! class_exists($class)) {
$loc = $this->findFile('render', $file);
if ($loc) {
// found the class
include_once $loc;
} else {
// can't find the class
return false;
}
}
$this->formatObj[$format] =& new $class($this);
}
/**
*
* Add a path to a path array.
*
* @access public
*
* @param string $type The path-type to add (parse or render).
*
* @param string $dir The directory to add to the path-type.
*
* @return void
*
*/
function addPath($type, $dir)
{
$dir = $this->fixPath($dir);
if (! isset($this->path[$type])) {
$this->path[$type] = array($dir);
} else {
array_unshift($this->path[$type], $dir);
}
}
/**
*
* Get the current path array for a path-type.
*
* @access public
*
* @param string $type The path-type to look up (plugin, filter, or
* template). If not set, returns all path types.
*
* @return array The array of paths for the requested type.
*
*/
function getPath($type = null)
{
if (is_null($type)) {
return $this->path;
} elseif (! isset($this->path[$type])) {
return array();
} else {
return $this->path[$type];
}
}
/**
*
* Searches a series of paths for a given file.
*
* @param array $type The type of paths to search (template, plugin,
* or filter).
*
* @param string $file The file name to look for.
*
* @return string|bool The full path and file name for the target file,
* or boolean false if the file is not found in any of the paths.
*
*/
function findFile($type, $file)
{
// get the set of paths
$set = $this->getPath($type);
// start looping through them
foreach ($set as $path) {
$fullname = $path . $file;
if (file_exists($fullname) && is_readable($fullname)) {
return $fullname;
}
}
// could not find the file in the set of paths
return false;
}
/**
*
* Append a trailing '/' to paths, unless the path is empty.
*
* @access private
*
* @param string $path The file path to fix
*
* @return string The fixed file path
*
*/
function fixPath($path)
{
$len = strlen($this->_dirSep);
if (! empty($path) &&
substr($path, -1 * $len, $len) != $this->_dirSep) {
return $path . $this->_dirSep;
} else {
return $path;
}
}
}
 
?>
/tags/Racine_livraison_narmer/api/pear/DB/NestedSet.php
New file
0,0 → 1,2747
<?php
//
// +----------------------------------------------------------------------+
// | PEAR :: DB_NestedSet |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |f
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Daniel Khan <dk@webcluster.at> |
// | Jason Rust <jason@rustyparts.com> |
// +----------------------------------------------------------------------+
// $Id: NestedSet.php,v 1.1 2006-12-14 15:04:28 jp_milcent Exp $
//
 
// CREDITS:
// --------
// - Thanks to Kristian Koehntopp for publishing an explanation of the Nested Set
// technique and for the great work he did and does for the php community
// - Thanks to Daniel T. Gorski for his great tutorial on www.develnet.org
//
// - Thanks to my parents for ... just kidding :]
 
require_once 'PEAR.php';
 
// {{{ constants
 
// Error and message codes
define('NESE_ERROR_RECURSION', 'E100');
define('NESE_ERROR_NODRIVER', 'E200');
define('NESE_ERROR_NOHANDLER', 'E300');
define('NESE_ERROR_TBLOCKED', 'E010');
define('NESE_MESSAGE_UNKNOWN', 'E0');
define('NESE_ERROR_NOTSUPPORTED', 'E1');
define('NESE_ERROR_PARAM_MISSING','E400');
define('NESE_ERROR_NOT_FOUND', 'E500');
define('NESE_ERROR_WRONG_MPARAM', 'E2');
 
// for moving a node before another
define('NESE_MOVE_BEFORE', 'BE');
// for moving a node after another
define('NESE_MOVE_AFTER', 'AF');
// for moving a node below another
define('NESE_MOVE_BELOW', 'SUB');
 
 
// Sortorders
define('NESE_SORT_LEVEL', 'SLV');
define('NESE_SORT_PREORDER', 'SPO');
 
// }}}
// {{{ DB_NestedSet:: class
/**
* DB_NestedSet is a class for handling nested sets
*
* @author Daniel Khan <dk@webcluster.at>
* @package DB_NestedSet
* @version $Revision: 1.1 $
* @access public
*/
 
// }}}
class DB_NestedSet {
// {{{ properties
 
/**
* @var array The field parameters of the table with the nested set. Format: 'realFieldName' => 'fieldId'
* @access public
*/
var $params = array(
'STRID' => 'id',
'ROOTID'=> 'rootid',
'l' => 'l',
'r' => 'r',
'STREH' => 'norder',
'LEVEL' => 'level',
// 'parent'=>'parent', // Optional but very useful
'STRNA' => 'name'
);
 
// To be used with 2.0 - would be an api break atm
// var $quotedParams = array('name');
 
/**
* @var string The table with the actual tree data
* @access public
*/
var $node_table = 'tb_nodes';
 
/**
* @var string The table to handle locking
* @access public
*/
var $lock_table = 'tb_locks';
 
/**
* @var string The table used for sequences
* @access public
*/
var $sequence_table;
 
/**
* Secondary order field. Normally this is the order field, but can be changed to
* something else (i.e. the name field so that the tree can be shown alphabetically)
*
* @var string
* @access public
*/
var $secondarySort;
 
/**
* Used to store the secondary sort method set by the user while doing manipulative queries
*
* @var string
* @access private
*/
var $_userSecondarySort = false;
 
/**
* The default sorting field - will be set to the table column inside the constructor
*
* @var string
* @access private
*/
var $_defaultSecondarySort = 'norder';
 
/**
* @var int The time to live of the lock
* @access public
*/
var $lockTTL = 1;
 
/**
* @var bool Enable debugging statements?
* @access public
*/
var $debug = 0;
 
/**
* @var bool Lock the structure of the table?
* @access private
*/
var $_structureTableLock = false;
 
 
/**
* @var bool Don't allow unlocking (used inside of moves)
* @access private
*/
var $_lockExclusive = false;
 
/**
* @var object cache Optional PEAR::Cache object
* @access public
*/
var $cache = false;
 
/**
* Specify the sortMode of the query methods
* NESE_SORT_LEVEL is the 'old' sorting method and sorts a tree by level
* all nodes of level 1, all nodes of level 2,...
* NESE_SORT_PREORDER will sort doing a preorder walk.
* So all children of node x will come right after it
* Note that moving a node within it's siblings will obviously not change the output
* in this mode
*
* @var constant Order method (NESE_SORT_LEVEL|NESE_SORT_PREORDER)
* @access private
*/
var $_sortMode = NESE_SORT_LEVEL;
 
/**
* @var array Available sortModes
* @access private
*/
var $_sortModes = array(NESE_SORT_LEVEL, NESE_SORT_PREORDER);
 
/**
* @var array An array of field ids that must exist in the table
* @access private
*/
var $_requiredParams = array('id', 'rootid', 'l', 'r', 'norder', 'level');
 
/**
* @var bool Skip the callback events?
* @access private
*/
var $_skipCallbacks = false;
 
/**
* @var bool Do we want to use caching
* @access private
*/
var $_caching = false;
 
/**
* @var array The above parameters flipped for easy access
* @access private
*/
var $_flparams = array();
 
/**
*
* @var bool Temporary switch for cache
* @access private
*/
var $_restcache = false;
 
/**
* Used to determine the presence of listeners for an event in triggerEvent()
*
* If any event listeners are registered for an event, the event name will
* have a key set in this array, otherwise, it will not be set.
* @see triggerEvent()
* @var arrayg
* @access private
*/
var $_hasListeners = array();
 
 
/**
* @var string packagename
* @access private
*/
var $_packagename = 'DB_NestedSet';
 
/**
* @var int Majorversion
* @access private
*/
var $_majorversion = 1;
 
/**
* @var string Minorversion
* @access private
*/
var $_minorversion = '3';
 
/**
* @var array Used for mapping a cloned tree to the real tree for move_* operations
* @access private
*/
var $_relations = array();
 
/**
* Used for _internal_ tree conversion
* @var bool Turn off user param verification and id generation
* @access private
*/
var $_dumbmode = false;
 
/**
* @var array Map of error messages to their descriptions
*/
var $messages = array(
NESE_ERROR_RECURSION => '%s: This operation would lead to a recursion',
NESE_ERROR_TBLOCKED => 'The structure Table is locked for another database operation, please retry.',
NESE_ERROR_NODRIVER => 'The selected database driver %s wasn\'t found',
NESE_ERROR_NOTSUPPORTED => 'Method not supported yet',
NESE_ERROR_NOHANDLER => 'Event handler not found',
NESE_ERROR_PARAM_MISSING=> 'Parameter missing',
NESE_MESSAGE_UNKNOWN => 'Unknown error or message',
NESE_ERROR_NOT_FOUND => '%s: Node %s not found',
NESE_ERROR_WRONG_MPARAM => '%s: %s'
);
 
/**
* @var array The array of event listeners
* @access private
*/
var $eventListeners = array();
 
 
// }}}
// +---------------------------------------+
// | Base methods |
// +---------------------------------------+
// {{{ constructor
 
/**
* Constructor
*
* @param array $params Database column fields which should be returned
*
* @access private
* @return void
*/
function DB_NestedSet($params) {
 
if ($this->debug) {
$this->_debugMessage('DB_NestedSet()');
}
if (is_array($params) && count($params) > 0) {
$this->params = $params;
}
 
$this->_flparams = array_flip($this->params);
$this->sequence_table = $this->node_table . '_' . $this->_flparams['id'];
$this->secondarySort = $this->_flparams[$this->_defaultSecondarySort];
register_shutdown_function(array(&$this,'_DB_NestedSet'));
}
 
// }}}
// {{{ destructor
 
/**
* PEAR Destructor
* Releases all locks
* Closes open database connections
*
* @access private
* @return void
*/
function _DB_NestedSet() {
if ($this->debug) {
$this->_debugMessage('_DB_NestedSet()');
}
$this->_releaseLock(true);
}
 
// }}}
// {{{ factory
 
/**
* Handles the returning of a concrete instance of DB_NestedSet based on the driver.
* If the class given by $driver allready exists it will be used.
* If not the driver will be searched inside the default path ./NestedSet/
*
* @param string $driver The driver, such as DB or MDB
* @param string $dsn The dsn for connecting to the database
* @param array $params The field name params for the node table
*
* @static
* @access public
* @return object The DB_NestedSet object
*/
function & factory($driver, $dsn, $params = array()) {
 
$classname = 'DB_NestedSet_' . $driver;
if (!class_exists($classname)) {
$driverpath = dirname(__FILE__).'/NestedSet/'.$driver.'.php';
if(!file_exists($driverpath) || !$driver) {
return PEAR::raiseError("factory(): The database driver '$driver' wasn't found", NESE_ERROR_NODRIVER, PEAR_ERROR_TRIGGER, E_USER_ERROR);
}
include_once($driverpath);
}
return new $classname($dsn, $params);
}
 
// }}}
 
 
// }}}
// +----------------------------------------------+
// | NestedSet manipulation and query methods |
// |----------------------------------------------+
// | Querying the tree |
// +----------------------------------------------+
 
// {{{ getAllNodes()
 
/**
* Fetch the whole NestedSet
*
* @param bool $keepAsArray (optional) Keep the result as an array or transform it into
* a set of DB_NestedSet_Node objects?
* @param bool $aliasFields (optional) Should we alias the fields so they are the names
* of the parameter keys, or leave them as is?
* @param array $addSQL (optional) Array of additional params to pass to the query.
*
* @access public
* @return mixed False on error, or an array of nodes
*/
function getAllNodes($keepAsArray = false, $aliasFields = true, $addSQL = array()) {
if ($this->debug) {
$this->_debugMessage('getAllNodes()');
}
 
if($this->_sortMode == NESE_SORT_LEVEL) {
$sql = sprintf('SELECT %s %s FROM %s %s %s ORDER BY %s.%s, %s.%s ASC',
$this->_getSelectFields($aliasFields),
$this->_addSQL($addSQL, 'cols'),
$this->node_table,
$this->_addSQL($addSQL, 'join'),
$this->_addSQL($addSQL, 'append'),
$this->node_table,
$this->_flparams['level'],
$this->node_table,
$this->secondarySort);
} elseif ($this->_sortMode == NESE_SORT_PREORDER) {
$nodeSet = array();
$rootnodes = $this->getRootNodes(true);
foreach($rootnodes AS $rid=>$rootnode) {
$nodeSet = $nodeSet+$this->getBranch($rootnode, true);
}
return $nodeSet;
}
 
if (!$this->_caching) {
$nodeSet = $this->_processResultSet($sql, $keepAsArray, $aliasFields);
} else {
$nodeSet = $this->cache->call('DB_NestedSet->_processResultSet', $sql, $keepAsArray, $aliasFields);
}
 
if (!$this->_skipCallbacks && isset($this->_hasListeners['nodeLoad'])) {
// EVENT (nodeLoad)
foreach (array_keys($nodeSet) as $key) {
$this->triggerEvent('nodeLoad', $nodeSet[$key]);
}
}
return $nodeSet;
}
 
// }}}
// {{{ getRootNodes()
 
/**
* Fetches the first level (the rootnodes) of the NestedSet
*
* @param bool $keepAsArray (optional) Keep the result as an array or transform it into
* a set of DB_NestedSet_Node objects?
* @param bool $aliasFields (optional) Should we alias the fields so they are the names
* of the parameter keys, or leave them as is?
* @param array $addSQL (optional) Array of additional params to pass to the query.
*
* @see _addSQL()
* @access public
* @return mixed False on error, or an array of nodes
*/
function getRootNodes($keepAsArray = false, $aliasFields = true, $addSQL = array()) {
if ($this->debug) {
$this->_debugMessage('getRootNodes()');
}
$sql = sprintf('SELECT %s %s FROM %s %s WHERE %s.%s=%s.%s %s ORDER BY %s.%s ASC',
$this->_getSelectFields($aliasFields),
$this->_addSQL($addSQL, 'cols'),
$this->node_table,
$this->_addSQL($addSQL, 'join'),
$this->node_table,
$this->_flparams['id'],
$this->node_table,
$this->_flparams['rootid'],
$this->_addSQL($addSQL, 'append'),
$this->node_table,
$this->secondarySort);
 
if (!$this->_caching) {
$nodeSet = $this->_processResultSet($sql, $keepAsArray, $aliasFields);
} else {
$nodeSet = $this->cache->call('DB_NestedSet->_processResultSet', $sql, $keepAsArray, $aliasFields);
}
 
if (!$this->_skipCallbacks && isset($this->_hasListeners['nodeLoad'])) {
// EVENT (nodeLoad)
foreach (array_keys($nodeSet) as $key) {
$this->triggerEvent('nodeLoad', $nodeSet[$key]);
}
}
return $nodeSet;
}
 
// }}}
 
// {{{ getBranch()
 
/**
* Fetch the whole branch where a given node id is in
*
* @param int $id The node ID
* @param bool $keepAsArray (optional) Keep the result as an array or transform it into
* a set of DB_NestedSet_Node objects?
* @param bool $aliasFields (optional) Should we alias the fields so they are the names
* of the parameter keys, or leave them as is?
* @param array $addSQL (optional) Array of additional params to pass to the query.
*
* @see _addSQL()
* @access public
* @return mixed False on error, or an array of nodes
*/
function getBranch($id, $keepAsArray = false, $aliasFields = true, $addSQL = array()) {
if ($this->debug) {
$this->_debugMessage('getBranch($id)');
}
if (!($thisnode = $this->pickNode($id, true))) {
$epr = array('getBranch()', $id);
return $this->_raiseError(NESE_ERROR_NOT_FOUND, PEAR_ERROR_TRIGGER, E_USER_NOTICE, $epr);
}
if($this->_sortMode == NESE_SORT_LEVEL) {
$firstsort = $this->_flparams['level'];
$sql = sprintf('SELECT %s %s FROM %s %s WHERE %s.%s=%s %s ORDER BY %s.%s, %s.%s ASC',
$this->_getSelectFields($aliasFields),
$this->_addSQL($addSQL, 'cols'),
$this->node_table,
$this->_addSQL($addSQL, 'join'),
$this->node_table,
$this->_flparams['rootid'],
$thisnode['rootid'],
$this->_addSQL($addSQL, 'append'),
$this->node_table,
$firstsort,
$this->node_table,
$this->secondarySort);
} elseif($this->_sortMode == NESE_SORT_PREORDER) {
$firstsort = $this->_flparams['l'];
$sql = sprintf('SELECT %s %s FROM %s %s WHERE %s.%s=%s %s ORDER BY %s.%s ASC',
$this->_getSelectFields($aliasFields),
$this->_addSQL($addSQL, 'cols'),
$this->node_table,
$this->_addSQL($addSQL, 'join'),
$this->node_table,
$this->_flparams['rootid'],
$thisnode['rootid'],
$this->_addSQL($addSQL, 'append'),
$this->node_table,
$firstsort);
}
 
 
if (!$this->_caching) {
$nodeSet = $this->_processResultSet($sql, $keepAsArray, $aliasFields);
} else {
$nodeSet = $this->cache->call('DB_NestedSet->_processResultSet', $sql, $keepAsArray, $aliasFields);
}
 
if (!$this->_skipCallbacks && isset($this->_hasListeners['nodeLoad'])) {
// EVENT (nodeLoad)
foreach (array_keys($nodeSet) as $key) {
$this->triggerEvent('nodeLoad', $nodeSet[$key]);
}
}
if($this->_sortMode == NESE_SORT_PREORDER && ($this->params[$this->secondarySort] != $this->_defaultSecondarySort)) {
uasort($nodeSet, array($this, '_secSort'));
}
return $nodeSet;
}
 
// }}}
// {{{ getParents()
 
/**
* Fetch the parents of a node given by id
*
* @param int $id The node ID
* @param bool $keepAsArray (optional) Keep the result as an array or transform it into
* a set of DB_NestedSet_Node objects?
* @param bool $aliasFields (optional) Should we alias the fields so they are the names
* of the parameter keys, or leave them as is?
* @param array $addSQL (optional) Array of additional params to pass to the query.
*
* @see _addSQL()
* @access public
* @return mixed False on error, or an array of nodes
*/
function getParents($id, $keepAsArray = false, $aliasFields = true, $addSQL = array()) {
if ($this->debug) {
$this->_debugMessage('getParents($id)');
}
if (!($child = $this->pickNode($id, true))) {
$epr = array('getParents()', $id);
return $this->_raiseError(NESE_ERROR_NOT_FOUND, PEAR_ERROR_TRIGGER, E_USER_NOTICE, $epr);
}
 
$sql = sprintf('SELECT %s %s FROM %s %s
WHERE %s.%s=%s AND %s.%s<%s AND %s.%s<%s AND %s.%s>%s %s
ORDER BY %s.%s ASC',
$this->_getSelectFields($aliasFields),
$this->_addSQL($addSQL, 'cols'),
$this->node_table,
$this->_addSQL($addSQL, 'join'),
$this->node_table,
$this->_flparams['rootid'],
$child['rootid'],
$this->node_table,
$this->_flparams['level'],
$child['level'],
$this->node_table,
$this->_flparams['l'],
$child['l'],
$this->node_table,
$this->_flparams['r'],
$child['r'],
$this->_addSQL($addSQL, 'append'),
$this->node_table,
$this->_flparams['level']);
 
if (!$this->_caching) {
$nodeSet = $this->_processResultSet($sql, $keepAsArray, $aliasFields);
} else {
$nodeSet = $this->cache->call('DB_NestedSet->_processResultSet', $sql, $keepAsArray, $aliasFields);
}
 
if (!$this->_skipCallbacks && isset($this->_hasListeners['nodeLoad'])) {
// EVENT (nodeLoad)
foreach (array_keys($nodeSet) as $key) {
$this->triggerEvent('nodeLoad', $nodeSet[$key]);
}
}
return $nodeSet;
}
 
// }}}
// {{{ getParent()
 
/**
* Fetch the immediate parent of a node given by id
*
* @param int $id The node ID
* @param bool $keepAsArray (optional) Keep the result as an array or transform it into
* a set of DB_NestedSet_Node objects?
* @param bool $aliasFields (optional) Should we alias the fields so they are the names
* of the parameter keys, or leave them as is?
* @param array $addSQL (optional) Array of additional params to pass to the query.
*
* @see _addSQL()
* @access public
* @return mixed False on error, or the parent node
*/
function getParent($id, $keepAsArray = false, $aliasFields = true, $addSQL = array()) {
if ($this->debug) {
$this->_debugMessage('getParent($id)');
}
if (!($child = $this->pickNode($id, true))) {
$epr = array('getParent()', $id);
return $this->_raiseError(NESE_ERROR_NOT_FOUND, PEAR_ERROR_TRIGGER, E_USER_NOTICE, $epr);
}
 
if($child['id'] == $child['rootid']) {
return false;
}
 
// If parent node is set inside the db simply return it
if(isset($child['parent']) && !empty($child['parent'])) {
return $this->pickNode($child['parent'], $keepAsArray, $aliasFields, 'id', $addSQL);
}
 
$addSQL['append'] = sprintf('AND %s.%s = %s',
$this->node_table,
$this->_flparams['level'],
$child['level']-1);
 
$nodeSet = $this->getParents($id, $keepAsArray, $aliasFields, $addSQL);
 
if(!empty($nodeSet)) {
$keys = array_keys($nodeSet);
return $nodeSet[$keys[0]];
} else {
return false;
}
}
 
// }}}
// {{{ getSiblings)
 
/**
* Fetch all siblings of the node given by id
* Important: The node given by ID will also be returned
* Do a unset($array[$id]) on the result if you don't want that
*
* @param int $id The node ID
* @param bool $keepAsArray (optional) Keep the result as an array or transform it into
* a set of DB_NestedSet_Node objects?
* @param bool $aliasFields (optional) Should we alias the fields so they are the names
* of the parameter keys, or leave them as is?
* @param array $addSQL (optional) Array of additional params to pass to the query.
*
* @see _addSQL()
* @access public
* @return mixed False on error, or the parent node
*/
function getSiblings($id, $keepAsArray = false, $aliasFields = true, $addSQL = array()) {
if ($this->debug) {
$this->_debugMessage('getParents($id)');
}
 
if (!($sibling = $this->pickNode($id, true))) {
$epr = array('getSibling()', $id);
return $this->_raiseError(NESE_ERROR_NOT_FOUND, PEAR_ERROR_TRIGGER, E_USER_NOTICE, $epr);
}
 
$parent = $this->getParent($sibling, true);
 
return $this->getChildren($parent, $keepAsArray, $aliasFields, $addSQL);
}
 
// }}}
// {{{ getChildren()
 
/**
* Fetch the children _one level_ after of a node given by id
*
* @param int $id The node ID
* @param bool $keepAsArray (optional) Keep the result as an array or transform it into
* a set of DB_NestedSet_Node objects?
* @param bool $aliasFields (optional) Should we alias the fields so they are the names
* of the parameter keys, or leave them as is?
* @param bool $forceNorder (optional) Force the result to be ordered by the norder
* param (as opposed to the value of secondary sort). Used by the move and
* add methods.
* @param array $addSQL (optional) Array of additional params to pass to the query.
*
* @see _addSQL()
* @access public
* @return mixed False on error, or an array of nodes
*/
function getChildren($id, $keepAsArray = false, $aliasFields = true, $forceNorder = false, $addSQL = array()) {
if ($this->debug) {
$this->_debugMessage('getChildren($id)');
}
 
if (!($parent = $this->pickNode($id, true))) {
$epr = array('getChildren()', $id);
return $this->_raiseError(NESE_ERROR_NOT_FOUND, PEAR_ERROR_TRIGGER, E_USER_NOTICE, $epr);
}
if (!$parent || $parent['l'] == ($parent['r'] - 1)) {
return false;
}
 
$sql = sprintf('SELECT %s %s FROM %s %s
WHERE %s.%s=%s AND %s.%s=%s+1 AND %s.%s BETWEEN %s AND %s %s
ORDER BY %s.%s ASC',
$this->_getSelectFields($aliasFields),
$this->_addSQL($addSQL, 'cols'),
$this->node_table,
$this->_addSQL($addSQL, 'join'),
$this->node_table,
$this->_flparams['rootid'],
$parent['rootid'],
$this->node_table,
$this->_flparams['level'],
$parent['level'],
$this->node_table,
$this->_flparams['l'],
$parent['l'],
$parent['r'],
$this->_addSQL($addSQL, 'append'),
$this->node_table,
$this->secondarySort);
 
if (!$this->_caching) {
$nodeSet = $this->_processResultSet($sql, $keepAsArray, $aliasFields);
} else {
$nodeSet = $this->cache->call('DB_NestedSet->_processResultSet', $sql, $keepAsArray, $aliasFields);
}
 
if (!$this->_skipCallbacks && isset($this->_hasListeners['nodeLoad'])) {
// EVENT (nodeLoad)
foreach (array_keys($nodeSet) as $key) {
$this->triggerEvent('nodeLoad', $nodeSet[$key]);
}
}
return $nodeSet;
}
 
// }}}
// {{{ getSubBranch()
 
/**
* Fetch all the children of a node given by id
*
* getChildren only queries the immediate children
* getSubBranch returns all nodes below the given node
*
* @param string $id The node ID
* @param bool $keepAsArray (optional) Keep the result as an array or transform it into
* a set of DB_NestedSet_Node objects?
* @param bool $aliasFields (optional) Should we alias the fields so they are the names
* of the parameter keys, or leave them as is?
* @param array $addSQL (optional) Array of additional params to pass to the query.
*
* @see _addSQL()
* @access public
* @return mixed False on error, or an array of nodes
*/
function getSubBranch($id, $keepAsArray = false, $aliasFields = true, $addSQL = array()) {
 
if ($this->debug) {
$this->_debugMessage('getSubBranch($id)');
}
if (!($parent = $this->pickNode($id, true))) {
$epr = array('getSubBranch()', $id);
return $this->_raiseError(NESE_ERROR_NOT_FOUND, E_USER_NOTICE, $epr);
}
if($this->_sortMode == NESE_SORT_LEVEL) {
$firstsort = $this->_flparams['level'];
$sql = sprintf('SELECT %s %s FROM %s %s WHERE %s.%s BETWEEN %s AND %s AND %s.%s=%s AND %s.%s!=%s %s ORDER BY %s.%s, %s.%s ASC',
$this->_getSelectFields($aliasFields),
$this->_addSQL($addSQL, 'cols'),
$this->node_table,
$this->_addSQL($addSQL, 'join'),
$this->node_table,
$this->_flparams['l'],
$parent['l'],
$parent['r'],
$this->node_table,
$this->_flparams['rootid'],
$parent['rootid'],
$this->node_table,
$this->_flparams['id'],
$this->_addSQL($addSQL, 'append'),
$id,
$this->node_table,
$firstsort,
$this->node_table,
$this->secondarySort
);
} elseif($this->_sortMode == NESE_SORT_PREORDER) {
$firstsort = $this->_flparams['l'];
$firstsort = $this->_flparams['level'];
$sql = sprintf('SELECT %s %s FROM %s %s WHERE %s.%s BETWEEN %s AND %s AND %s.%s=%s AND %s.%s!=%s %s ORDER BY %s.%s ASC',
$this->_getSelectFields($aliasFields),
$this->_addSQL($addSQL, 'cols'),
$this->node_table,
$this->_addSQL($addSQL, 'join'),
$this->node_table,
$this->_flparams['l'],
$parent['l'],
$parent['r'],
$this->node_table,
$this->_flparams['rootid'],
$parent['rootid'],
$this->node_table,
$this->_flparams['id'],
$this->_addSQL($addSQL, 'append'),
$id,
$this->node_table,
$firstsort
);
}
 
if (!$this->_caching) {
$nodeSet = $this->_processResultSet($sql, $keepAsArray, $aliasFields);
} else {
$nodeSet = $this->cache->call('DB_NestedSet->_processResultSet', $sql, $keepAsArray, $aliasFields);
}
 
if (!$this->_skipCallbacks && isset($this->_hasListeners['nodeLoad'])) {
// EVENT (nodeLoad)
foreach (array_keys($nodeSet) as $key) {
$this->triggerEvent('nodeLoad', $nodeSet[$key]);
}
}
if($this->params[$this->secondarySort] != $this->_defaultSecondarySort) {
uasort($nodeSet, array($this, '_secSort'));
}
return $nodeSet;
}
 
// }}}
// {{{ pickNode()
 
/**
* Fetch the data of a node with the given id
*
* @param int $id The node id of the node to fetch
* @param bool $keepAsArray (optional) Keep the result as an array or transform it into
* a set of DB_NestedSet_Node objects?
* @param bool $aliasFields (optional) Should we alias the fields so they are the names
* of the parameter keys, or leave them as is?
* @param string $idfield (optional) Which field has to be compared with $id?
* This is can be used to pick a node by other values (e.g. it's name).
* @param array $addSQL (optional) Array of additional params to pass to the query.
*
* @see _addSQL()
* @access public
* @return mixed False on error, or an array of nodes
*/
function pickNode($id, $keepAsArray = false, $aliasFields = true, $idfield = 'id', $addSQL = array()) {
if ($this->debug) {
$this->_debugMessage('pickNode($id)');
}
 
if (is_object($id) && $id->id) {
return $id;
} elseif (is_array($id) && isset($id['id'])) {
return $id;
}
 
if(!$id) {
return false;
}
 
$sql = sprintf('SELECT %s %s FROM %s %s WHERE %s.%s=%s %s',
$this->_getSelectFields($aliasFields),
$this->_addSQL($addSQL, 'cols'),
$this->node_table,
$this->_addSQL($addSQL, 'join'),
$this->node_table,
$this->_flparams[$idfield],
$id,
$this->_addSQL($addSQL, 'append'));
 
if (!$this->_caching) {
$nodeSet = $this->_processResultSet($sql, $keepAsArray, $aliasFields);
} else {
$nodeSet = $this->cache->call('DB_NestedSet->_processResultSet', $sql, $keepAsArray, $aliasFields);
}
 
$nsKey = false;
 
if (!$this->_skipCallbacks && isset($this->_hasListeners['nodeLoad'])) {
// EVENT (nodeLoad)
foreach (array_keys($nodeSet) as $key) {
$this->triggerEvent('nodeLoad', $nodeSet[$key]);
$nsKey = $key;
}
} else {
foreach (array_keys($nodeSet) as $key) {
$nsKey = $key;
}
}
 
if (is_array($nodeSet) && $idfield != 'id') {
$id = $nsKey;
}
 
return isset($nodeSet[$id]) ? $nodeSet[$id] : false;
}
 
// }}}
// {{{ isParent()
 
/**
* See if a given node is a parent of another given node
*
* A node is considered to be a parent if it resides above the child
* So it doesn't mean that the node has to be an immediate parent.
* To get this information simply compare the levels of the two nodes
* after you know that you have a parent relation.
*
* @param mixed $parent The parent node as array or object
* @param mixed $child The child node as array or object
*
* @access public
* @return bool True if it's a parent
*/
function isParent($parent, $child) {
 
if ($this->debug) {
$this->_debugMessage('isParent($parent, $child)');
}
 
if (!isset($parent)|| !isset($child)) {
return false;
}
 
if (is_array($parent)) {
$p_rootid = $parent['rootid'];
$p_l = $parent['l'];
$p_r = $parent['r'];
 
} elseif (is_object($parent)) {
$p_rootid = $parent->rootid;
$p_l = $parent->l;
$p_r = $parent->r;
}
 
if (is_array($child)) {
$c_rootid = $child['rootid'];
$c_l = $child['l'];
$c_r = $child['r'];
} elseif (is_object($child)) {
$c_rootid = $child->rootid;
$c_l = $child->l;
$c_r = $child->r;
}
 
if (($p_rootid == $c_rootid) && ($p_l < $c_l && $p_r > $c_r)) {
return true;
}
 
return false;
}
 
 
// }}}
// +----------------------------------------------+
// | NestedSet manipulation and query methods |
// |----------------------------------------------+
// | insert / delete / update of nodes |
// +----------------------------------------------+
// | [PUBLIC] |
// +----------------------------------------------+
// {{{ createRootNode()
 
/**
* Creates a new root node
* Optionally it deletes the whole tree and creates one initial rootnode
*
* <pre>
* +-- root1 [target]
* |
* +-- root2 [new]
* |
* +-- root3
* </pre>
*
* @param array $values Hash with param => value pairs of the node (see $this->params)
* @param integer $id ID of target node (the rootnode after which the node should be inserted)
* @param bool $first Danger: Deletes and (re)init's the hole tree - sequences are reset
*
* @access public
* @return mixed The node id or false on error
*/
function createRootNode($values, $id = false, $first = false, $_pos = 'AF') {
 
if ($this->debug) {
$this->_debugMessage('createRootNode($values, $id = false, $first = false, $_pos = \'AF\')');
}
 
$this->_verifyUserValues('createRootNode()', $values);
 
if(!$first && (!$id || !$parent = $this->pickNode($id, true))) {
$epr = array('createRootNode()', $id);
return $this->_raiseError(NESE_ERROR_NOT_FOUND, PEAR_ERROR_TRIGGER, E_USER_ERROR, $epr);
} elseif($first && $id) {
 
// No notice for now.
// But tehese 2 params don't make sense together
$epr = array(
'createRootNode()',
'[id] AND [first] were passed - that doesn\'t make sense');
//$this->_raiseError(NESE_ERROR_WRONG_MPARAM, E_USER_WARNING, $epr);
}
 
// Try to aquire a table lock
if(PEAR::isError($lock=$this->_setLock())) {
return $lock;
}
 
$sql = array();
$addval = array();
$addval[$this->_flparams['level']] = 1;
 
// Shall we delete the existing tree (reinit)
if ($first) {
$dsql = sprintf('DELETE FROM %s',
$this->node_table);
$this->db->query($dsql);
$this->db->dropSequence($this->sequence_table);
// New order of the new node will be 1
$addval[$this->_flparams['norder']] = 1;
} else {
// Let's open a gap for the new node
if($_pos == NESE_MOVE_AFTER) {
$addval[$this->_flparams['norder']] = $parent['norder'] + 1;
$sql[] = sprintf('UPDATE %s SET %s=%s+1 WHERE %s=%s AND %s > %s',
$this->node_table,
$this->_flparams['norder'],
$this->_flparams['norder'],
$this->_flparams['id'],
$this->_flparams['rootid'],
$this->_flparams['norder'],
$parent['norder']);
} elseif($_pos == NESE_MOVE_BEFORE) {
$addval[$this->_flparams['norder']] = $parent['norder'];
$sql[] = sprintf('UPDATE %s SET %s=%s+1 WHERE %s=%s AND %s >= %s',
$this->node_table,
$this->_flparams['norder'],
$this->_flparams['norder'],
$this->_flparams['id'],
$this->_flparams['rootid'],
$this->_flparams['norder'],
$parent['norder']);
}
}
 
if(isset($this->_flparams['parent'])) {
$addval[$this->_flparams['parent']] = 0;
}
// Sequence of node id (equals to root id in this case
 
if(!$this->_dumbmode || !$node_id=isset($values[$this->_flparams['id']]) || !isset($values[$this->_flparams['rootid']])) {
$addval[$this->_flparams['rootid']] = $node_id = $addval[$this->_flparams['id']] = $this->db->nextId($this->sequence_table);
} else {
$node_id = $values[$this->_flparams['id']];
}
// Left/Right values for rootnodes
$addval[$this->_flparams['l']] = 1;
$addval[$this->_flparams['r']] = 2;
// Transform the node data hash to a query
if (!$qr = $this->_values2Query($values, $addval)) {
$this->_releaseLock();
return false;
}
 
// Insert the new node
$sql[] = sprintf('INSERT INTO %s SET %s',
$this->node_table,
$qr);
 
for($i=0;$i<count($sql);$i++) {
$res = $this->db->query($sql[$i]);
$this->_testFatalAbort($res, __FILE__, __LINE__);
}
 
// EVENT (nodeCreate)
 
if (!$this->_skipCallbacks && isset($this->_hasListeners['nodeCreate'])) {
$this->triggerEvent('nodeCreate', $this->pickNode($node_id));
}
$this->_releaseLock();
return $node_id;
}
 
// }}}
// {{{ createSubNode()
 
/**
* Creates a subnode
*
* <pre>
* +-- root1
* |
* +-\ root2 [target]
* | |
* | |-- subnode1 [new]
* |
* +-- root3
* </pre>
*
* @param integer $id Parent node ID
* @param array $values Hash with param => value pairs of the node (see $this->params)
*
* @access public
* @return mixed The node id or false on error
*/
function createSubNode($id, $values) {
if ($this->debug) {
$this->_debugMessage('createSubNode($id, $values)');
}
 
// invalid parent id, bail out
if (!($thisnode = $this->pickNode($id, true))) {
$epr = array('createSubNode()', $id);
return $this->_raiseError(NESE_ERROR_NOT_FOUND, PEAR_ERROR_TRIGGER, E_USER_ERROR, $epr);
}
 
// Try to aquire a table lock
if(PEAR::isError($lock = $this->_setLock())) {
return $lock;
}
 
$this->_verifyUserValues('createRootNode()', $values);
 
// Get the children of the target node
$children = $this->getChildren($id, true);
 
// We have children here
if ($thisnode['r']-1 != $thisnode['l']) {
// Get the last child
$last = array_pop($children);
// What we have to do is virtually an insert of a node after the last child
// So we don't have to proceed creating a subnode
$newNode = $this->createRightNode($last['id'], $values);
$this->_releaseLock();
return $newNode;
}
 
$sql = array();
$sql[] = sprintf('
UPDATE %s SET
%s=IF(%s>=%s, %s+2, %s),
%s=IF(%s>=%s, %s+2, %s)
WHERE %s=%s',
$this->node_table,
$this->_flparams['l'],
$this->_flparams['l'],
$thisnode['r'],
$this->_flparams['l'],
$this->_flparams['l'],
$this->_flparams['r'],
$this->_flparams['r'],
$thisnode['r'],
$this->_flparams['r'],
$this->_flparams['r'],
$this->_flparams['rootid'],
$thisnode['rootid']
);
 
$addval = array();
if(isset($this->_flparams['parent'])) {
$addval[$this->_flparams['parent']] = $thisnode['id'];
}
 
$addval[$this->_flparams['l']] = $thisnode['r'];
$addval[$this->_flparams['r']] = $thisnode['r'] + 1;
$addval[$this->_flparams['rootid']] = $thisnode['rootid'];
$addval[$this->_flparams['norder']] = 1;
$addval[$this->_flparams['level']] = $thisnode['level'] + 1;
 
if(!$this->_dumbmode || !$node_id=isset($values[$this->_flparams['id']])) {
$node_id = $addval[$this->_flparams['id']] = $this->db->nextId($this->sequence_table);
} else {
$node_id = $values[$this->_flparams['id']];
}
if (!$qr = $this->_values2Query($values, $addval)) {
$this->_releaseLock();
return false;
}
 
$sql[] = sprintf('INSERT INTO %s SET %s',
$this->node_table,
$qr);
for($i=0;$i<count($sql);$i++) {
$res = $this->db->query($sql[$i]);
$this->_testFatalAbort($res, __FILE__, __LINE__);
}
 
// EVENT (NodeCreate)
if (!$this->_skipCallbacks && isset($this->_hasListeners['nodeCreate'])) {
$thisnode = $this->pickNode($node_id);
$this->triggerEvent('nodeCreate', $this->pickNode($id));
}
$this->_releaseLock();
return $node_id;
}
 
// }}}
// {{{ createLeftNode()
/**
* Creates a node before a given node
* <pre>
* +-- root1
* |
* +-\ root2
* | |
* | |-- subnode2 [new]
* | |-- subnode1 [target]
* | |-- subnode3
* |
* +-- root3
* </pre>
*
* @param int $id Target node ID
* @param array $values Hash with param => value pairs of the node (see $this->params)
* @param bool $returnID Tell the method to return a node id instead of an object.
* ATTENTION: That the method defaults to return an object instead of the node id
* has been overseen and is basically a bug. We have to keep this to maintain BC.
* You will have to set $returnID to true to make it behave like the other creation methods.
* This flaw will get fixed with the next major version.
*
* @access public
* @return mixed The node id or false on error
*/
function createLeftNode($id, $values) {
 
if ($this->debug) {
$this->_debugMessage('createLeftNode($target, $values)');
}
 
$this->_verifyUserValues('createLeftode()', $values);
 
// invalid target node, bail out
if (!($thisnode = $this->pickNode($id, true))) {
$epr = array('createLeftNode()', $id);
return $this->_raiseError(NESE_ERROR_NOT_FOUND, PEAR_ERROR_TRIGGER, E_USER_ERROR, $epr);
}
 
if(PEAR::isError($lock=$this->_setLock())) {
return $lock;
}
 
 
// If the target node is a rootnode we virtually want to create a new root node
if ($thisnode['rootid'] == $thisnode['id']) {
return $this->createRootNode($values, $id, false, NESE_MOVE_BEFORE);
}
 
 
$addval = array();
$parent = $this->getParent($id, true);
if(isset($this->_flparams['parent'])) {
$addval[$this->_flparams['parent']] = $parent['id'];
}
 
$sql = array();
 
 
$sql[] = sprintf('UPDATE %s SET %s=%s+1
WHERE
%s=%s AND %s>=%s AND %s=%s AND %s BETWEEN %s AND %s',
$this->node_table,
$this->_flparams['norder'],
$this->_flparams['norder'],
$this->_flparams['rootid'],
$thisnode['rootid'],
$this->_flparams['norder'],
$thisnode['norder'],
$this->_flparams['level'],
$thisnode['level'],
$this->_flparams['l'],
$parent['l'],
$parent['r']);
 
 
// Update all nodes which have dependent left and right values
$sql[] = sprintf('
UPDATE %s SET
%s=IF(%s>=%s, %s+2, %s),
%s=IF(%s>=%s, %s+2, %s)
WHERE %s=%s',
$this->node_table,
$this->_flparams['l'],
$this->_flparams['l'],
$thisnode['l'],
$this->_flparams['l'],
$this->_flparams['l'],
$this->_flparams['r'],
$this->_flparams['r'],
$thisnode['r'],
$this->_flparams['r'],
$this->_flparams['r'],
$this->_flparams['rootid'],
$thisnode['rootid']
);
 
 
 
$addval[$this->_flparams['norder']] = $thisnode['norder'];
$addval[$this->_flparams['l']] = $thisnode['l'];
$addval[$this->_flparams['r']] = $thisnode['l']+1;
$addval[$this->_flparams['rootid']] = $thisnode['rootid'];
$addval[$this->_flparams['level']] = $thisnode['level'];
 
if(!$this->_dumbmode || !$node_id=isset($values[$this->_flparams['id']])) {
$node_id = $addval[$this->_flparams['id']] = $this->db->nextId($this->sequence_table);
} else {
$node_id = $values[$this->_flparams['id']];
}
if (!$qr = $this->_values2Query($values, $addval)) {
$this->_releaseLock();
return false;
}
 
// Insert the new node
$sql[] = sprintf('INSERT INTO %s SET %s',
$this->node_table,
$qr);
 
for($i=0;$i<count($sql);$i++) {
$res = $this->db->query($sql[$i]);
$this->_testFatalAbort($res, __FILE__, __LINE__);
}
 
// EVENT (NodeCreate)
if (!$this->_skipCallbacks && isset($this->_hasListeners['nodeCreate'])) {
$this->triggerEvent('nodeCreate', $this->pickNode($id));
}
$this->_releaseLock();
return $node_id;
}
 
/**
* Creates a node after a given node
* <pre>
* +-- root1
* |
* +-\ root2
* | |
* | |-- subnode1 [target]
* | |-- subnode2 [new]
* | |-- subnode3
* |
* +-- root3
* </pre>
*
* @param int $id Target node ID
* @param array $values Hash with param => value pairs of the node (see $this->params)
* @param bool $returnID Tell the method to return a node id instead of an object.
* ATTENTION: That the method defaults to return an object instead of the node id
* has been overseen and is basically a bug. We have to keep this to maintain BC.
* You will have to set $returnID to true to make it behave like the other creation methods.
* This flaw will get fixed with the next major version.
*
* @access public
* @return mixed The node id or false on error
*/
function createRightNode($id, $values) {
 
if ($this->debug) {
$this->_debugMessage('createRightNode($target, $values)');
}
 
$this->_verifyUserValues('createRootNode()', $values);
 
// invalid target node, bail out
if (!($thisnode = $this->pickNode($id, true))) {
$epr = array('createRightNode()', $id);
return $this->_raiseError(NESE_ERROR_NOT_FOUND, PEAR_ERROR_TRIGGER, E_USER_ERROR, $epr);
}
 
if(PEAR::isError($lock=$this->_setLock())) {
return $lock;
}
 
 
// If the target node is a rootnode we virtually want to create a new root node
if ($thisnode['rootid'] == $thisnode['id']) {
 
$nid = $this->createRootNode($values, $id);
$this->_releaseLock();
return $nid;
}
 
 
$addval = array();
$parent = $this->getParent($id, true);
if(isset($this->_flparams['parent'])) {
$addval[$this->_flparams['parent']] = $parent['id'];
}
 
$sql = array();
 
$sql[] = sprintf('UPDATE %s SET %s=%s+1
WHERE
%s=%s AND %s>%s AND %s=%s AND %s BETWEEN %s AND %s',
$this->node_table,
$this->_flparams['norder'],
$this->_flparams['norder'],
$this->_flparams['rootid'],
$thisnode['rootid'],
$this->_flparams['norder'],
$thisnode['norder'],
$this->_flparams['level'],
$thisnode['level'],
$this->_flparams['l'],
$parent['l'],
$parent['r']);
 
 
// Update all nodes which have dependent left and right values
 
 
$sql[] = sprintf('
UPDATE %s SET
%s=IF(%s>%s, %s+2, %s),
%s=IF(%s>%s, %s+2, %s)
WHERE %s=%s',
$this->node_table,
$this->_flparams['l'],
$this->_flparams['l'],
$thisnode['r'],
$this->_flparams['l'],
$this->_flparams['l'],
$this->_flparams['r'],
$this->_flparams['r'],
$thisnode['r'],
$this->_flparams['r'],
$this->_flparams['r'],
$this->_flparams['rootid'],
$thisnode['rootid']
);
 
$addval[$this->_flparams['norder']] = $thisnode['norder'] + 1;
$addval[$this->_flparams['l']] = $thisnode['r'] + 1;
$addval[$this->_flparams['r']] = $thisnode['r'] + 2;
$addval[$this->_flparams['rootid']] = $thisnode['rootid'];
$addval[$this->_flparams['level']] = $thisnode['level'];
 
if(!$this->_dumbmode || !isset($values[$this->_flparams['id']])) {
$node_id = $addval[$this->_flparams['id']] = $this->db->nextId($this->sequence_table);
} else {
$node_id = $values[$this->_flparams['id']];
}
if (!$qr = $this->_values2Query($values, $addval)) {
$this->_releaseLock();
return false;
}
 
// Insert the new node
$sql[] = sprintf('INSERT INTO %s SET %s', $this->node_table, $qr);
 
for($i=0;$i<count($sql);$i++) {
$res = $this->db->query($sql[$i]);
$this->_testFatalAbort($res, __FILE__, __LINE__);
}
 
// EVENT (NodeCreate)
if (!$this->_skipCallbacks && isset($this->_hasListeners['nodeCreate'])) {
$this->triggerEvent('nodeCreate', $this->pickNode($id));
}
$this->_releaseLock();
return $node_id;
}
 
// }}}
// {{{ deleteNode()
 
/**
* Deletes a node
*
* @param int $id ID of the node to be deleted
*
* @access public
* @return bool True if the delete succeeds
*/
function deleteNode($id) {
 
if ($this->debug) {
$this->_debugMessage("deleteNode($id)");
}
 
// invalid target node, bail out
if (!($thisnode = $this->pickNode($id, true))) {
$epr = array('deleteNode()', $id);
return $this->_raiseError(NESE_ERROR_NOT_FOUND, PEAR_ERROR_TRIGGER, E_USER_ERROR, $epr);
}
 
if (PEAR::isError($lock = $this->_setLock())) {
return $lock;
}
 
if (!$this->_skipCallbacks && isset($this->_hasListeners['nodeDelete'])) {
// EVENT (NodeDelete)
$this->triggerEvent('nodeDelete', $this->pickNode($id));
}
 
$parent = $this->getParent($id, true);
$len = $thisnode['r'] - $thisnode['l'] + 1;
 
 
$sql = array();
 
// Delete the node
$sql[] = sprintf('DELETE FROM %s WHERE %s BETWEEN %s AND %s AND %s=%s',
$this->node_table,
$this->_flparams['l'],
$thisnode['l'],
$thisnode['r'],
$this->_flparams['rootid'],
$thisnode['rootid']
);
 
if ($thisnode['id'] != $thisnode['rootid']) {
 
// The node isn't a rootnode so close the gap
$sql[] = sprintf('UPDATE %s SET
%s=IF(%s>%s, %s-%s, %s),
%s=IF(%s>%s, %s-%s, %s)
WHERE %s=%s AND
(%s>%s OR %s>%s)',
$this->node_table,
$this->_flparams['l'],
$this->_flparams['l'],
$thisnode['l'],
$this->_flparams['l'],
$len,
$this->_flparams['l'],
$this->_flparams['r'],
$this->_flparams['r'],
$thisnode['l'],
$this->_flparams['r'],
$len,
$this->_flparams['r'],
$this->_flparams['rootid'],
$thisnode['rootid'],
$this->_flparams['l'],
$thisnode['l'],
$this->_flparams['r'],
$thisnode['r']
);
 
// Re-order
 
$sql[] = sprintf('UPDATE %s SET %s=%s-1 WHERE %s=%s AND %s=%s AND %s>%s AND %s BETWEEN %s AND %s',
$this->node_table,
$this->_flparams['norder'],
$this->_flparams['norder'],
$this->_flparams['rootid'],
$thisnode['rootid'],
$this->_flparams['level'],
$thisnode['level'],
$this->_flparams['norder'],
$thisnode['norder'],
$this->_flparams['l'],
$parent['l'],
$parent['r']);
 
} else {
// A rootnode was deleted and we only have to close the gap inside the order
$sql[] = sprintf('UPDATE %s SET %s=%s+1 WHERE %s=%s AND %s > %s',
$this->node_table,
$this->_flparams['norder'],
$this->_flparams['norder'],
$this->_flparams['rootid'],
$this->_flparams['id'],
$this->_flparams['norder'],
$thisnode['norder']);
}
for($i=0;$i<count($sql);$i++) {
$res = $this->db->query($sql[$i]);
$this->_testFatalAbort($res, __FILE__, __LINE__);
}
$this->_releaseLock();
return true;
}
 
// }}}
// {{{ updateNode()
 
/**
* Changes the payload of a node
*
* @param int $id Node ID
* @param array $values Hash with param => value pairs of the node (see $this->params)
* @param bool $_intermal Internal use only. Used to skip value validation. Leave this as it is.
*
* @access public
* @return bool True if the update is successful
*/
function updateNode($id, $values, $_internal=false) {
if ($this->debug) {
$this->_debugMessage('updateNode($id, $values)');
}
 
if (PEAR::isError($lock = $this->_setLock())) {
return $lock;
}
 
if(!$_internal) {
$this->_verifyUserValues('createRootNode()', $values);
}
 
$eparams = array('values' => $values);
if (!$this->_skipCallbacks && isset($this->_hasListeners['nodeUpdate'])) {
// EVENT (NodeUpdate)
$this->triggerEvent('nodeUpdate', $this->pickNode($id), $eparams);
}
 
$addvalues = array();
if (!$qr = $this->_values2Query($values, $addvalues)) {
$this->_releaseLock();
return false;
}
 
$sql = sprintf('UPDATE %s SET %s WHERE %s = %s',
$this->node_table,
$qr,
$this->_flparams['id'],
$id);
$res = $this->db->query($sql);
$this->_testFatalAbort($res, __FILE__, __LINE__);
$this->_releaseLock();
return true;
}
 
 
 
// }}}
// +----------------------------------------------+
// | Moving and copying |
// |----------------------------------------------+
// | [PUBLIC] |
// +----------------------------------------------+
// {{{ moveTree()
 
/**
* Wrapper for node moving and copying
*
* @param int $id Source ID
* @param int $target Target ID
* @param constant $pos Position (use one of the NESE_MOVE_* constants)
* @param bool $copy Shall we create a copy
*
* @see _moveInsideLevel
* @see _moveAcross
* @see _moveRoot2Root
* @access public
* @return int ID of the moved node or false on error
*/
function moveTree($id, $targetid, $pos, $copy = false) {
 
if ($this->debug) {
$this->_debugMessage('moveTree($id, $target, $pos, $copy = false)');
}
if($id == $targetid && !$copy) {
// TRIGGER BOGUS MESSAGE
return false;
}
 
// Get information about source and target
if (!($source = $this->pickNode($id, true))) {
$epr = array('moveTree()', $id);
return $this->_raiseError(NESE_ERROR_NOT_FOUND, PEAR_ERROR_TRIGGER, E_USER_ERROR, $epr);
}
 
if (!($target = $this->pickNode($targetid, true))) {
$epr = array('moveTree()', $targetid);
return $this->_raiseError(NESE_ERROR_NOT_FOUND, PEAR_ERROR_TRIGGER, E_USER_ERROR, $epr);
}
 
if (PEAR::isError($lock = $this->_setLock(true))) {
return $lock;
}
 
$this->_relations = array();
// This operations don't need callbacks except the copy handler
// which ignores this setting
$this->_skipCallbacks = true;
 
if(!$copy) {
// We have a recursion - let's stop
if (($target['rootid'] == $source['rootid']) &&
(($source['l'] <= $target['l']) &&
($source['r'] >= $target['r']))) {
$this->_releaseLock(true);
$epr = array('moveTree()');
return $this->_raiseError(NESE_ERROR_RECURSION, PEAR_ERROR_RETURN, E_USER_NOTICE, $epr);
}
 
// Insert/move before or after
 
if (($source['rootid'] == $source['id']) &&
($target['rootid'] == $target['id'])) {
// We have to move a rootnode which is different from moving inside a tree
$nid = $this->_moveRoot2Root($source, $target, $pos, $copy);
$this->_releaseLock(true);
return $nid;
}
} elseif(($target['rootid'] == $source['rootid']) &&
(($source['l'] < $target['l']) &&
($source['r'] > $target['r']))) {
$this->_releaseLock(true);
$epr = array('moveTree()');
return $this->_raiseError(NESE_ERROR_RECURSION, PEAR_ERROR_RETURN, E_USER_NOTICE, $epr);
}
 
 
// We have to move between different levels and maybe subtrees - let's rock ;)
$this->_moveAcross($source, $target, $pos);
$this->_moveCleanup($copy);
$this->_releaseLock(true);
}
 
// }}}
// {{{ _moveAcross()
 
/**
* Moves nodes and trees to other subtrees or levels
*
* <pre>
* [+] <--------------------------------+
* +-[\] root1 [target] |
* <-------------------------+ |p
* +-\ root2 | |
* | | | |
* | |-- subnode1 [target] | |B
* | |-- subnode2 [new] |S |E
* | |-- subnode3 |U |F
* | |B |O
* +-\ root3 | |R
* |-- subnode 3.1 | |E
* |-\ subnode 3.2 [source] >--+------+
* |-- subnode 3.2.1
*</pre>
*
* @param object NodeCT $source Source node
* @param object NodeCT $target Target node
* @param string $pos Position [SUBnode/BEfore]
* @param bool $copy Shall we create a copy
*
* @access private
* @see moveTree
* @see _r_moveAcross
* @see _moveCleanup
*/
function _moveAcross($source, $target, $pos) {
if ($this->debug) {
$this->_debugMessage('_moveAcross($source, $target, $pos, $copy = false)');
}
 
// Get the current data from a node and exclude the id params which will be changed
// because of the node move
$values = array();
foreach($this->params as $key => $val) {
if ($source[$val] && !in_array($val, $this->_requiredParams)) {
$values[$key] = trim($source[$val]);
}
}
 
switch($pos) {
 
case NESE_MOVE_BEFORE:
$clone_id = $this->createLeftNode($target['id'], $values);
break;
 
case NESE_MOVE_AFTER:
$clone_id = $this->createRightNode($target['id'], $values);
break;
 
case NESE_MOVE_BELOW:
$clone_id = $this->createSubNode($target['id'], $values);
break;
}
 
 
$children = $this->getChildren($source['id'], true, true, true);
 
 
if ($children) {
$pos = NESE_MOVE_BELOW;
$sclone_id = $clone_id;
// Recurse through the child nodes
foreach($children AS $cid => $child) {
$sclone = $this->pickNode($sclone_id, true);
$sclone_id = $this->_moveAcross($child, $sclone, $pos);
 
$pos = NESE_MOVE_AFTER;
}
}
 
$this->_relations[$source['id']] = $clone_id;
return $clone_id;
}
 
// }}}
// {{{ _moveCleanup()
 
/**
* Deletes the old subtree (node) and writes the node id's into the cloned tree
*
*
* @param array $relations Hash in der Form $h[alteid]=neueid
* @param array $copy Are we in copy mode?
* @access private
*/
function _moveCleanup($copy = false) {
 
$relations = $this->_relations;
if ($this->debug) {
$this->_debugMessage('_moveCleanup($relations, $copy = false)');
}
 
$deletes = array();
$updates = array();
$tb = $this->node_table;
$fid = $this->_flparams['id'];
$froot = $this->_flparams['rootid'];
foreach($relations AS $key => $val) {
$clone = $this->pickNode($val);
if ($copy) {
// EVENT (NodeCopy)
 
$eparams = array('clone' => $clone);
 
if (!$this->_skipCallbacks && isset($this->_hasListeners['nodeCopy'])) {
$this->triggerEvent('nodeCopy', $this->pickNode($key), $eparams);
}
continue;
}
 
// No callbacks here because the node itself doesn't get changed
// Only it's position
// If one needs a callback here please let me know
 
$deletes[] = $key;
// It's isn't a rootnode
if ($clone->id != $clone->rootid) {
 
 
$sql = sprintf('UPDATE %s SET %s=%s WHERE %s = %s',
$this->node_table,
$fid,
$key,
$fid,
$val);
$updates[] = $sql;
} else {
$sql = sprintf('UPDATE %s SET %s=%s, %s=%s WHERE %s=%s',
$tb,
$fid,
$key,
$froot,
$val,
$fid,
$val);
 
$updates[] = $sql;
$orootid = $clone->rootid;
 
$sql = sprintf('UPDATE %s SET %s=%s WHERE %s=%s',
$tb,
$froot,
$key,
$froot,
$orootid);
$updates[] = $sql;
}
$this->_skipCallbacks = false;
}
 
if(!empty($deletes)) {
for($i=0;$i<count($deletes);$i++) {
$this->deleteNode($deletes[$i]);
}
}
 
if(!empty($updates)) {
for($i=0;$i<count($updates);$i++) {
$res = $this->db->query($updates[$i]);
$this->_testFatalAbort($res, __FILE__, __LINE__);
}
}
 
return true;
}
 
// }}}
// {{{ _moveRoot2Root()
 
/**
* Moves rootnodes
*
* <pre>
* +-- root1
* |
* +-\ root2
* | |
* | |-- subnode1 [target]
* | |-- subnode2 [new]
* | |-- subnode3
* |
* +-\ root3
* [|] <-----------------------+
* |-- subnode 3.1 [target] |
* |-\ subnode 3.2 [source] >--+
* |-- subnode 3.2.1
* </pre>
*
* @param object NodeCT $source Source
* @param object NodeCT $target Target
* @param string $pos BEfore | AFter
* @access private
* @see moveTree
*/
function _moveRoot2Root($source, $target, $pos) {
 
if ($this->debug) {
$this->_debugMessage('_moveRoot2Root($source, $target, $pos, $copy)');
}
if(PEAR::isError($lock=$this->_setLock())) {
return $lock;
}
 
$tb = $this->node_table;
$fid = $this->_flparams['id'];
$froot = $this->_flparams['rootid'];
$freh = $this->_flparams['norder'];
$s_order = $source['norder'];
$t_order = $target['norder'];
$s_id = $source['id'];
$t_id = $target['id'];
 
 
if ($s_order < $t_order) {
if ($pos == NESE_MOVE_BEFORE) {
$sql = "UPDATE $tb SET $freh=$freh-1
WHERE $freh BETWEEN $s_order AND $t_order AND
$fid!=$t_id AND
$fid!=$s_id AND
$froot=$fid";
$res = $this->db->query($sql);
$this->_testFatalAbort($res, __FILE__, __LINE__);
$sql = "UPDATE $tb SET $freh=$t_order -1 WHERE $fid=$s_id";
$res = $this->db->query($sql);
$this->_testFatalAbort($res, __FILE__, __LINE__);
}
elseif($pos == NESE_MOVE_AFTER) {
 
$sql = "UPDATE $tb SET $freh=$freh-1
WHERE $freh BETWEEN $s_order AND $t_order AND
$fid!=$s_id AND
$froot=$fid";
$res = $this->db->query($sql);
$this->_testFatalAbort($res, __FILE__, __LINE__);
 
$sql = "UPDATE $tb SET $freh=$t_order WHERE $fid=$s_id";
$res = $this->db->query($sql);
$this->_testFatalAbort($res, __FILE__, __LINE__);
}
}
 
if ($s_order > $t_order) {
if ($pos == NESE_MOVE_BEFORE) {
$sql = "UPDATE $tb SET $freh=$freh+1
WHERE $freh BETWEEN $t_order AND $s_order AND
$fid != $s_id AND
$froot=$fid";
$res = $this->db->query($sql);
$this->_testFatalAbort($res, __FILE__, __LINE__);
 
$sql = "UPDATE $tb SET $freh=$t_order WHERE $fid=$s_id";
$res = $this->db->query($sql);
$this->_testFatalAbort($res, __FILE__, __LINE__);
}
elseif ($pos == NESE_MOVE_AFTER) {
$sql = "UPDATE $tb SET $freh=$freh+1
WHERE $freh BETWEEN $t_order AND $s_order AND
$fid!=$t_id AND
$fid!=$s_id AND
$froot=$fid";
$res = $this->db->query($sql);
$this->_testFatalAbort($res, __FILE__, __LINE__);
 
$sql = "UPDATE $tb SET $freh=$t_order+1 WHERE $fid = $s_id";
$res = $this->db->query($sql);
$this->_testFatalAbort($res, __FILE__, __LINE__);
}
}
$this->_releaseLock();
return $source->id;
}
 
// }}}
// +-----------------------+
// | Helper methods |
// +-----------------------+
 
// }}}
// {{{ _secSort()
 
/**
* Callback for uasort used to sort siblings
*
* @access private
*/
function _secSort($node1, $node2) {
// Within the same level?
if($node1['level'] != $node2['level']) {
return strnatcmp($node1['l'], $node2['l']);
}
 
// Are they siblings?
$p1 = $this->getParent($node1);
$p2 = $this->getParent($node2);
if($p1['id'] != $p2['id']) {
return strnatcmp($node1['l'], $node2['l']);
}
 
// Same field value? Use the lft value then
$field = $this->params[$this->secondarySort];
if($node1[$field] == $node2[$field]) {
return strnatcmp($node1['l'], $node2[l]);
}
 
// Compare between siblings with different field value
return strnatcmp($node1[$field], $node2[$field]);
}
 
// }}}
// {{{ _addSQL()
 
/**
* Adds a specific type of SQL to a query string
*
* @param array $addSQL The array of SQL strings to add. Example value:
* $addSQL = array(
* 'cols' => 'tb2.col2, tb2.col3', // Additional tables/columns
* 'join' => 'LEFT JOIN tb1 USING(STRID)', // Join statement
* 'append' => 'GROUP by tb1.STRID'); // Group condition
* @param string $type The type of SQL. Can be 'cols', 'join', or 'append'.
*
* @access private
* @return string The SQL, properly formatted
*/
function _addSQL($addSQL, $type) {
if (!isset($addSQL[$type])) {
return '';
}
 
switch($type) {
case 'cols':
return ', ' . $addSQL[$type];
default:
return $addSQL[$type];
}
}
 
// }}}
// {{{ _getSelectFields()
 
/**
* Gets the select fields based on the params
*
* @param bool $aliasFields Should we alias the fields so they are the names of the
* parameter keys, or leave them as is?
*
* @access private
* @return string A string of query fields to select
*/
function _getSelectFields($aliasFields) {
$queryFields = array();
foreach ($this->params as $key => $val) {
$tmp_field = $this->node_table . '.' . $key;
if ($aliasFields) {
$tmp_field .= ' AS ' . $val;
}
$queryFields[] = $tmp_field;
}
 
$fields = implode(', ', $queryFields);
return $fields;
}
 
// }}}
// {{{ _processResultSet()
 
/**
* Processes a DB result set by checking for a DB error and then transforming the result
* into a set of DB_NestedSet_Node objects or leaving it as an array.
*
* @param string $sql The sql query to be done
* @param bool $keepAsArray Keep the result as an array or transform it into a set of
* DB_NestedSet_Node objects?
* @param bool $fieldsAreAliased Are the fields aliased?
*
* @access private
* @return mixed False on error or the transformed node set.
*/
function _processResultSet($sql, $keepAsArray, $fieldsAreAliased) {
$result = $this->db->getAll($sql);
if ($this->_testFatalAbort($result, __FILE__, __LINE__)) {
return false;
}
 
$nodes = array();
$idKey = $fieldsAreAliased ? 'id' : $this->_flparams['id'];
foreach ($result as $row) {
$node_id = $row[$idKey];
if ($keepAsArray) {
$nodes[$node_id] = $row;
} else {
// Create an instance of the node container
$nodes[$node_id] =& new DB_NestedSet_Node($row);
}
 
}
return $nodes;
}
 
// }}}
// {{{ _testFatalAbort()
 
/**
* Error Handler
*
* Tests if a given ressource is a PEAR error object
* ans raises a fatal error in case of an error object
*
* @param object PEAR::Error $errobj The object to test
* @param string $file The filename wher the error occured
* @param int $line The line number of the error
* @return void
* @access private
*/
function _testFatalAbort($errobj, $file, $line) {
if (!$this->_isDBError($errobj)) {
return false;
}
 
if ($this->debug) {
$this->_debugMessage('_testFatalAbort($errobj, $file, $line)');
}
if ($this->debug) {
$message = $errobj->getUserInfo();
$code = $errobj->getCode();
$msg = "$message ($code) in file $file at line $line";
} else {
$msg = $errobj->getMessage();
$code = $errobj->getCode(); }
 
PEAR::raiseError($msg, $code, PEAR_ERROR_TRIGGER, E_USER_ERROR);
}
 
// {{{ __raiseError()
 
/**
* @access private
*/
function _raiseError($code, $mode, $option, $epr=array()) {
$message = vsprintf($this->_getMessage($code), $epr);
return PEAR::raiseError($message, $code, $mode, $option);
}
 
// }}}
 
// {{{ addListener()
 
/**
* Add an event listener
*
* Adds an event listener and returns an ID for it
*
* @param string $event The ivent name
* @param string $listener The listener object
* @return string
* @access public
*/
function addListener($event, &$listener) {
$listenerID = uniqid('el');
$this->eventListeners[$event][$listenerID] =& $listener;
$this->_hasListeners[$event] = true;
return $listenerID;
}
 
// }}}
// {{{ removeListener()
 
/**
* Removes an event listener
*
* Removes the event listener with the given ID
*
* @param string $event The ivent name
* @param string $listenerID The listener's ID
* @return bool
* @access public
*/
function removeListener($event, $listenerID) {
unset($this->eventListeners[$event][$listenerID]);
if (!isset($this->eventListeners[$event]) ||
!is_array($this->eventListeners[$event]) ||
count($this->eventListeners[$event]) == 0) {
unset($this->_hasListeners[$event]);
}
return true;
}
 
// }}}
// {{{ triggerEvent()
 
/**
* Triggers and event an calls the event listeners
*
* @param string $event The Event that occured
* @param object node $node A Reference to the node object which was subject to changes
* @param array $eparams A associative array of params which may be needed by the handler
* @return bool
* @access public
*/
function triggerEvent($event, &$node, $eparams = false) {
if ($this->_skipCallbacks || !isset($this->_hasListeners[$event])) {
return false;
}
 
foreach($this->eventListeners[$event] as $key => $val) {
if (!method_exists($val, 'callEvent')) {
return new PEAR_Error($this->_getMessage(NESE_ERROR_NOHANDLER), NESE_ERROR_NOHANDLER);
}
 
$val->callEvent($event, $node, $eparams);
}
 
return true;
}
 
// }}}
// {{{ apiVersion()
 
function apiVersion() {
return array(
'package:'=>$this->_packagename,
'majorversion'=>$this->_majorversion,
'minorversion'=>$this->_minorversion,
'version'=>sprintf('%s.%s',$this->_majorversion, $this->_minorversion),
'revision'=>str_replace('$', '',"$Revision: 1.1 $")
);
}
 
// }}}
// {{{ setAttr()
 
/**
* Sets an object attribute
*
* @param array $attr An associative array with attributes
*
* @return bool
* @access public
*/
function setAttr($attr) {
static $hasSetSequence;
if (!isset($hasSetSequence)) {
$hasSetSequence = false;
}
 
if (!is_array($attr) || count($attr) == 0) {
return false;
}
 
foreach ($attr as $key => $val) {
$this->$key = $val;
if ($key == 'sequence_table') {
$hasSetSequence = true;
}
 
// only update sequence to reflect new table if they haven't set it manually
if (!$hasSetSequence && $key == 'node_table') {
$this->sequence_table = $this->node_table . '_' . $this->_flparams['id'];
}
if($key == 'cache' && is_object($val)) {
$this->_caching = true;
$GLOBALS['DB_NestedSet'] = & $this;
}
}
 
return true;
}
 
// }}}
// {{{ setsortMode()
/**
* This enables you to set specific options for each output method
*
* @param constant $sortMode
*
* @access public
* @return Current sortMode
*/
function setsortMode($sortMode=false) {
if($sortMode && in_array($sortMode, $this->_sortModes)) {
$this->_sortMode = $sortMode;
} else {
return $this->_sortMode;
}
return $this->_sortMode;
}
// }}}
// {{{ setDbOption()
 
/**
* Sets a db option. Example, setting the sequence table format
*
* @var string $option The option to set
* @var string $val The value of the option
*
* @access public
* @return void
*/
function setDbOption($option, $val) {
$this->db->setOption($option, $val);
}
 
// }}}
// {{{ testLock()
 
/**
* Tests if a database lock is set
*
* @access public
*/
function testLock() {
if ($this->debug) {
$this->_debugMessage('testLock()');
}
 
if($lockID = $this->_structureTableLock) {
return $lockID;
}
$this->_lockGC();
$sql = sprintf('SELECT lockID FROM %s WHERE lockTable=%s',
$this->lock_table,
$this->_quote($this->node_table)) ;
 
$res = $this->db->query($sql);
$this->_testFatalAbort($res, __FILE__, __LINE__);
 
if ($this->_numRows($res)) {
return new PEAR_Error($this->_getMessage(NESE_ERROR_TBLOCKED),NESE_ERROR_TBLOCKED);
}
 
return false;
}
 
// }}}
// {{{ _setLock()
 
/**
* @access private
*/
function _setLock($exclusive=false) {
$lock = $this->testLock();
if(PEAR::isError($lock)) {
return $lock;
}
 
if ($this->debug) {
$this->_debugMessage('_setLock()');
}
if($this->_caching) {
@$this->cache->flush('function_cache');
$this->_caching = false;
$this->_restcache = true;
}
 
if (!$lockID = $this->_structureTableLock) {
$lockID = $this->_structureTableLock = uniqid('lck-');
 
$sql = sprintf('INSERT INTO %s SET lockID=%s, lockTable=%s, lockStamp=%s',
$this->lock_table,
$this->_quote($lockID),
$this->_quote($this->node_table),
time());
 
} else {
$sql = sprintf('UPDATE %s set lockStamp=%s WHERE lockID=%s AND lockTable=%s',
$this->lock_table,
time(),
$this->_quote($lockID),
$this->_quote($this->node_table));
}
if($exclusive) {
$this->_lockExclusive = true;
}
 
$res = $this->db->query($sql);
$this->_testFatalAbort($res, __FILE__, __LINE__);
return $lockID;
}
 
// }}}
// {{{ _releaseLock()
 
/**
* @access private
*/
function _releaseLock($exclusive=false) {
if ($this->debug) {
$this->_debugMessage('_releaseLock()');
}
 
if($exclusive) {
$this->_lockExclusive = false;
}
 
if ((!$lockID = $this->_structureTableLock) || $this->_lockExclusive) {
return false;
}
 
$tb = $this->lock_table;
$stb = $this->node_table;
$sql = "DELETE FROM $tb
WHERE lockTable=" . $this->_quote($stb) . " AND
lockID=" . $this->_quote($lockID);
 
$res = $this->db->query($sql);
$this->_testFatalAbort($res, __FILE__, __LINE__);
$this->_structureTableLock = false;
if($this->_restcache) {
$this->_caching = true;
$this->_restcache = false;
}
return true;
}
 
// }}}
// {{{ _lockGC()
 
/**
* @access private
*/
function _lockGC() {
if ($this->debug) {
$this->_debugMessage('_lockGC()');
}
$tb = $this->lock_table;
$stb = $this->node_table;
$lockTTL = time() - $this->lockTTL;
$sql = "DELETE FROM $tb
WHERE lockTable=" . $this->_quote($stb) . " AND
lockStamp < $lockTTL";
 
$res = $this->db->query($sql);
$this->_testFatalAbort($res, __FILE__, __LINE__);
}
 
// }}}
// {{{ _values2Query()
 
/**
* @access private
*/
function _values2Query($values, $addval = false) {
 
if ($this->debug) {
$this->_debugMessage('_values2Query($values, $addval = false)');
}
if (is_array($addval)) {
$values = $values + $addval;
}
 
$arq = array();
foreach($values AS $key => $val) {
$k = trim($key);
$v = trim($val);
if ($k) {
// To be used with the next mahor version
// $iv = in_array($this->params[$k], $this->_quotedParams) ? $this->_quote($v) : $v;
$iv = $this->_quote($v);
$arq[] = "$k=$iv";
}
}
 
if (!is_array($arq) || count($arq) == 0) {
return false;
}
 
$query = implode(', ', $arq);
return $query;
}
 
// }}}
// {{{ _verifyUserValues()
 
/**
* Clean values from protected or unknown columns
*
* @var string $caller The calling method
* @var string $values The values array
*
* @access private
* @return void
*/
function _verifyUserValues($caller, &$values) {
 
if($this->_dumbmode) {
return true;
}
foreach($values AS $field=>$value) {
if(!isset($this->params[$field])) {
$epr = array(
$caller,
sprintf('Unknown column/param \'%s\'', $field));
$this->_raiseError(NESE_ERROR_WRONG_MPARAM, PEAR_ERROR_RETURN, E_USER_NOTICE, $epr);
unset($values[$field]);
} else {
$flip = $this->params[$field];
if(in_array($flip, $this->_requiredParams)) {
$epr = array(
$caller,
sprintf('\'%s\' is autogenerated and can\'t be passed - it will be ignored', $field));
$this->_raiseError(NESE_ERROR_WRONG_MPARAM, PEAR_ERROR_RETURN, E_USER_NOTICE, $epr);
unset($values[$field]);
}
}
}
}
 
// }}}
// {{{ _debugMessage()
 
/**
* @access private
*/
function _debugMessage($msg) {
if ($this->debug) {
$time = $this->_getmicrotime();
echo "$time::Debug:: $msg<br />\n";
}
}
 
// }}}
// {{{ _getMessage()
 
/**
* @access private
*/
function _getMessage($code) {
if ($this->debug) {
$this->_debugMessage('_getMessage($code)');
}
return isset($this->messages[$code]) ? $this->messages[$code] : $this->messages[NESE_MESSAGE_UNKNOWN];
 
}
 
// }}}
// {{{ _getmicrotime()
 
/**
* @access private
*/
function _getmicrotime() {
list($usec, $sec) = explode(' ', microtime());
return ((float)$usec + (float)$sec);
}
 
// }}}
// {{{ convertTreeModel()
 
/**
* Convert a <1.3 tree into a 1.3 tree format
*
* This will convert the tree into a format needed for some new features in
* 1.3. Your <1.3 tree will still work without converting but some new features
* like preorder sorting won't work as expected.
*
* <pre>
* Usage:
* - Create a new node table (tb_nodes2) from the current node table (tb_nodes1) (only copy the structure).
* - Create a nested set instance of the 'old' set (NeSe1) and one of the new set (NeSe2)
* - Now you have 2 identical objects where only node_table differs
* - Call DB_NestedSet::convertTreeModel(&$orig, &$copy);
* - After that you have a cleaned up copy of tb_nodes1 inside tb_nodes2
* </pre>
*
* @param object DB_NestedSet $orig Nested set we want to copy
* @param object DB_NestedSet $copy Object where the new tree is copied to
* @param integer $_parent ID of the parent node (private)
*
* @static
* @access public
* @return bool True uns success
*/
function convertTreeModel(&$orig, &$copy, $_parent=false) {
 
static $firstSet;
 
$isRoot = false;
if(!$_parent) {
if(!is_object($orig) || !is_object($copy)) {
return false;
}
if($orig->node_table == $copy->node_table) {
return false;
}
$copy->_dumbmode = true;
$orig->sortMode = NESE_SORT_LEVEL;
$copy->sortMode = NESE_SORT_LEVEL;
$sibl = $orig->getRootNodes(true);
$isRoot = true;
} else {
$sibl = $orig->getChildren($_parent, true);
}
 
if(empty($sibl)) {
return false;
}
 
foreach($sibl AS $sid=>$sibling) {
unset($sibling['l']);
unset($sibling['r']);
unset($sibling['norder']);
 
$values = array();
foreach($sibling AS $key=>$val) {
if(!isset($copy->_flparams[$key])) {
continue;
}
$values[$copy->_flparams[$key]] = $val;
}
 
if(!$firstSet) {
$psid = $copy->createRootNode($values, false, true);
$firstSet = true;
} elseif($isRoot) {
$psid = $copy->createRightNode($psid, $values);
} else {
$copy->createSubNode($_parent, $values);
}
 
DB_NestedSet::convertTreeModel($orig, $copy, $sid);
}
return true;
}
// }}}
// {{{ _numRows()
/**
* Fetches the number of rows the last query returned
* @access private
* @abstract
*/
function _numRows($res) {
}
// }}}
// {{{ _isDBError()
/**
* Returns true if a db return value is an error object
* @access private
* @abstract
*/
function _isDBError($err) {
}
// }}}
// {{{ quote()
/**
* Quotes a string to use it inside queries
* @access private
* @abstract
*/
function _quote($str) {
}
 
}
 
// {{{ DB_NestedSet_Node:: class
 
/**
* Generic class for node objects
*
* @autor Daniel Khan <dk@webcluster.at>;
* @version $Revision: 1.1 $
* @package DB_NestedSet
*
* @access private
*/
 
class DB_NestedSet_Node {
// {{{ constructor
 
/**
* Constructor
*/
function DB_NestedSet_Node($data) {
if (!is_array($data) || count($data) == 0) {
return new PEAR_ERROR($data, NESE_ERROR_PARAM_MISSING);
}
 
$this->setAttr($data);
return true;
}
 
// }}}
// {{{ setAttr()
 
function setAttr($data) {
if(!is_array($data) || count($data) == 0) {
return false;
}
 
foreach ($data as $key => $val) {
$this->$key = $val;
}
}
 
// }}}
 
}
// }}}
 
 
?>
/tags/Racine_livraison_narmer/api/pear/DB/Pager.php
New file
0,0 → 1,250
<?php
//
// Pear DB Pager - Retrieve and return information of databases
// result sets
//
// Copyright (C) 2001 Tomas Von Veschler Cox <cox@idecnet.com>
//
// 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
//
//
// $Id: Pager.php,v 1.1 2006-12-14 15:04:28 jp_milcent Exp $
 
require_once 'PEAR.php';
require_once 'DB.php';
 
/**
* This class handles all the stuff needed for displaying paginated results
* from a database query of Pear DB, in a very easy way.
* Documentation and examples of use, can be found in:
* http://vulcanonet.com/soft/pager/ (could be outdated)
*
* IMPORTANT!
* Since PEAR DB already support native row limit (more fast and avaible in
* all the drivers), there is no more need to use $pager->build() or
* the $pager->fetch*() methods.
*
* Usage example:
*
*< ?php
* require_once 'DB/Pager.php';
* $db = DB::connect('your DSN string');
* $from = 0; // The row to start to fetch from (you might want to get this
* // param from the $_GET array
* $limit = 10; // The number of results per page
* $maxpages = 10; // The number of pages for displaying in the pager (optional)
* $res = $db->limitQuery($sql, $from, $limit);
* $nrows = 0; // Alternative you could use $res->numRows()
* while ($row = $res->fetchrow()) {
* // XXX code for building the page here
* $nrows++;
* }
* $data = DB_Pager::getData($from, $limit, $nrows, $maxpages);
* // XXX code for building the pager here
* ? >
*
* @version 0.7
* @author Tomas V.V.Cox <cox@idecnet.com>
* @see http://vulcanonet.com/soft/pager/
*/
 
class DB_Pager extends PEAR
{
 
/**
* Constructor
*
* @param object $res A DB_result object from Pear_DB
* @param int $from The row to start fetching
* @param int $limit How many results per page
* @param int $numrows Pager will automatically
* find this param if is not given. If your Pear_DB backend extension
* doesn't support numrows(), you can manually calculate it
* and supply later to the constructor
* @deprecated
*/
function DB_Pager (&$res, $from, $limit, $numrows = null)
{
$this->res = $res;
$this->from = $from;
$this->limit = $limit;
$this->numrows = $numrows;
}
 
/**
* Calculates all the data needed by Pager to work
*
* @return mixed An assoc array with all the data (see getData)
* or DB_Error on error
* @see DB_Pager::getData
* @deprecated
*/
function build()
{
// if there is no numrows given, calculate it
if ($this->numrows === null) {
$this->numrows = $this->res->numrows();
if (DB::isError($this->numrows)) {
return $this->numrows;
}
}
$data = $this->getData($this->from, $this->limit, $this->numrows);
if (DB::isError($data)) {
return $data;
}
$this->current = $this->from - 1;
$this->top = $data['to'];
return $data;
}
 
/**
* @deprecated
*/
function fetchRow($mode=DB_FETCHMODE_DEFAULT)
{
$this->current++;
if ($this->current >= $this->top) {
return null;
}
return $this->res->fetchRow($mode, $this->current);
}
 
/**
* @deprecated
*/
function fetchInto(&$arr, $mode=DB_FETCHMODE_DEFAULT)
{
$this->current++;
if ($this->current >= $this->top) {
return null;
}
return $this->res->fetchInto($arr, $mode, $this->current);
}
 
/*
* Gets all the data needed to paginate results
* This is an associative array with the following
* values filled in:
*
* array(
* 'current' => X, // current page you are
* 'numrows' => X, // total number of results
* 'next' => X, // row number where next page starts
* 'prev' => X, // row number where prev page starts
* 'remain' => X, // number of results remaning *in next page*
* 'numpages'=> X, // total number of pages
* 'from' => X, // the row to start fetching
* 'to' => X, // the row to stop fetching
* 'limit' => X, // how many results per page
* 'maxpages' => X, // how many pages to show (google style)
* 'firstpage' => X, // the row number of the first page
* 'lastpage' => X, // the row number where the last page starts
* 'pages' => array( // assoc with page "number => start row"
* 1 => X,
* 2 => X,
* 3 => X
* )
* );
* @param int $from The row to start fetching
* @param int $limit How many results per page
* @param int $numrows Number of results from query
*
* @return array associative array with data or DB_error on error
*
*/
function &getData($from, $limit, $numrows, $maxpages = false)
{
if (empty($numrows) || ($numrows < 0)) {
return null;
}
$from = (empty($from)) ? 0 : $from;
 
if ($limit <= 0) {
return PEAR::raiseError (null, 'wrong "limit" param', null,
null, null, 'DB_Error', true);
}
 
// Total number of pages
$pages = ceil($numrows/$limit);
$data['numpages'] = $pages;
 
// first & last page
$data['firstpage'] = 1;
$data['lastpage'] = $pages;
 
// Build pages array
$data['pages'] = array();
for ($i=1; $i <= $pages; $i++) {
$offset = $limit * ($i-1);
$data['pages'][$i] = $offset;
// $from must point to one page
if ($from == $offset) {
// The current page we are
$data['current'] = $i;
}
}
if (!isset($data['current'])) {
return PEAR::raiseError (null, 'wrong "from" param', null,
null, null, 'DB_Error', true);
}
 
// Limit number of pages (goole algoritm)
if ($maxpages) {
$radio = floor($maxpages/2);
$minpage = $data['current'] - $radio;
if ($minpage < 1) {
$minpage = 1;
}
$maxpage = $data['current'] + $radio - 1;
if ($maxpage > $data['numpages']) {
$maxpage = $data['numpages'];
}
foreach (range($minpage, $maxpage) as $page) {
$tmp[$page] = $data['pages'][$page];
}
$data['pages'] = $tmp;
$data['maxpages'] = $maxpages;
} else {
$data['maxpages'] = null;
}
 
// Prev link
$prev = $from - $limit;
$data['prev'] = ($prev >= 0) ? $prev : null;
 
// Next link
$next = $from + $limit;
$data['next'] = ($next < $numrows) ? $next : null;
 
// Results remaining in next page & Last row to fetch
if ($data['current'] == $pages) {
$data['remain'] = 0;
$data['to'] = $numrows;
} else {
if ($data['current'] == ($pages - 1)) {
$data['remain'] = $numrows - ($limit*($pages-1));
} else {
$data['remain'] = $limit;
}
$data['to'] = $data['current'] * $limit;
}
$data['numrows'] = $numrows;
$data['from'] = $from + 1;
$data['limit'] = $limit;
 
return $data;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/DB/mssql.php
New file
0,0 → 1,914
<?php
 
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 
/**
* The PEAR DB driver for PHP's mssql extension
* for interacting with Microsoft SQL Server databases
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Database
* @package DB
* @author Sterling Hughes <sterling@php.net>
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id: mssql.php,v 1.3 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/DB
*/
 
/**
* Obtain the DB_common class so it can be extended from
*/
require_once 'DB/common.php';
 
/**
* The methods PEAR DB uses to interact with PHP's mssql extension
* for interacting with Microsoft SQL Server databases
*
* These methods overload the ones declared in DB_common.
*
* @category Database
* @package DB
* @author Sterling Hughes <sterling@php.net>
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version Release: 1.7.6
* @link http://pear.php.net/package/DB
*/
class DB_mssql extends DB_common
{
// {{{ properties
 
/**
* The DB driver type (mysql, oci8, odbc, etc.)
* @var string
*/
var $phptype = 'mssql';
 
/**
* The database syntax variant to be used (db2, access, etc.), if any
* @var string
*/
var $dbsyntax = 'mssql';
 
/**
* The capabilities of this DB implementation
*
* The 'new_link' element contains the PHP version that first provided
* new_link support for this DBMS. Contains false if it's unsupported.
*
* Meaning of the 'limit' element:
* + 'emulate' = emulate with fetch row by number
* + 'alter' = alter the query
* + false = skip rows
*
* @var array
*/
var $features = array(
'limit' => 'emulate',
'new_link' => false,
'numrows' => true,
'pconnect' => true,
'prepare' => false,
'ssl' => false,
'transactions' => true,
);
 
/**
* A mapping of native error codes to DB error codes
* @var array
*/
// XXX Add here error codes ie: 'S100E' => DB_ERROR_SYNTAX
var $errorcode_map = array(
110 => DB_ERROR_VALUE_COUNT_ON_ROW,
155 => DB_ERROR_NOSUCHFIELD,
170 => DB_ERROR_SYNTAX,
207 => DB_ERROR_NOSUCHFIELD,
208 => DB_ERROR_NOSUCHTABLE,
245 => DB_ERROR_INVALID_NUMBER,
515 => DB_ERROR_CONSTRAINT_NOT_NULL,
547 => DB_ERROR_CONSTRAINT,
1913 => DB_ERROR_ALREADY_EXISTS,
2627 => DB_ERROR_CONSTRAINT,
2714 => DB_ERROR_ALREADY_EXISTS,
3701 => DB_ERROR_NOSUCHTABLE,
8134 => DB_ERROR_DIVZERO,
);
 
/**
* The raw database connection created by PHP
* @var resource
*/
var $connection;
 
/**
* The DSN information for connecting to a database
* @var array
*/
var $dsn = array();
 
 
/**
* Should data manipulation queries be committed automatically?
* @var bool
* @access private
*/
var $autocommit = true;
 
/**
* The quantity of transactions begun
*
* {@internal While this is private, it can't actually be designated
* private in PHP 5 because it is directly accessed in the test suite.}}
*
* @var integer
* @access private
*/
var $transaction_opcount = 0;
 
/**
* The database specified in the DSN
*
* It's a fix to allow calls to different databases in the same script.
*
* @var string
* @access private
*/
var $_db = null;
 
 
// }}}
// {{{ constructor
 
/**
* This constructor calls <kbd>$this->DB_common()</kbd>
*
* @return void
*/
function DB_mssql()
{
$this->DB_common();
}
 
// }}}
// {{{ connect()
 
/**
* Connect to the database server, log in and open the database
*
* Don't call this method directly. Use DB::connect() instead.
*
* @param array $dsn the data source name
* @param bool $persistent should the connection be persistent?
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function connect($dsn, $persistent = false)
{
if (!PEAR::loadExtension('mssql') && !PEAR::loadExtension('sybase')
&& !PEAR::loadExtension('sybase_ct'))
{
return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
}
 
$this->dsn = $dsn;
if ($dsn['dbsyntax']) {
$this->dbsyntax = $dsn['dbsyntax'];
}
 
$params = array(
$dsn['hostspec'] ? $dsn['hostspec'] : 'localhost',
$dsn['username'] ? $dsn['username'] : null,
$dsn['password'] ? $dsn['password'] : null,
);
if ($dsn['port']) {
$params[0] .= ((substr(PHP_OS, 0, 3) == 'WIN') ? ',' : ':')
. $dsn['port'];
}
 
$connect_function = $persistent ? 'mssql_pconnect' : 'mssql_connect';
 
$this->connection = @call_user_func_array($connect_function, $params);
 
if (!$this->connection) {
return $this->raiseError(DB_ERROR_CONNECT_FAILED,
null, null, null,
@mssql_get_last_message());
}
if ($dsn['database']) {
if (!@mssql_select_db($dsn['database'], $this->connection)) {
return $this->raiseError(DB_ERROR_NODBSELECTED,
null, null, null,
@mssql_get_last_message());
}
$this->_db = $dsn['database'];
}
return DB_OK;
}
 
// }}}
// {{{ disconnect()
 
/**
* Disconnects from the database server
*
* @return bool TRUE on success, FALSE on failure
*/
function disconnect()
{
$ret = @mssql_close($this->connection);
$this->connection = null;
return $ret;
}
 
// }}}
// {{{ simpleQuery()
 
/**
* Sends a query to the database server
*
* @param string the SQL query string
*
* @return mixed + a PHP result resrouce for successful SELECT queries
* + the DB_OK constant for other successful queries
* + a DB_Error object on failure
*/
function simpleQuery($query)
{
$ismanip = DB::isManip($query);
$this->last_query = $query;
if (!@mssql_select_db($this->_db, $this->connection)) {
return $this->mssqlRaiseError(DB_ERROR_NODBSELECTED);
}
$query = $this->modifyQuery($query);
if (!$this->autocommit && $ismanip) {
if ($this->transaction_opcount == 0) {
$result = @mssql_query('BEGIN TRAN', $this->connection);
if (!$result) {
return $this->mssqlRaiseError();
}
}
$this->transaction_opcount++;
}
$result = @mssql_query($query, $this->connection);
if (!$result) {
return $this->mssqlRaiseError();
}
// Determine which queries that should return data, and which
// should return an error code only.
return $ismanip ? DB_OK : $result;
}
 
// }}}
// {{{ nextResult()
 
/**
* Move the internal mssql result pointer to the next available result
*
* @param a valid fbsql result resource
*
* @access public
*
* @return true if a result is available otherwise return false
*/
function nextResult($result)
{
return @mssql_next_result($result);
}
 
// }}}
// {{{ fetchInto()
 
/**
* Places a row from the result set into the given array
*
* Formating of the array and the data therein are configurable.
* See DB_result::fetchInto() for more information.
*
* This method is not meant to be called directly. Use
* DB_result::fetchInto() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result the query result resource
* @param array $arr the referenced array to put the data in
* @param int $fetchmode how the resulting array should be indexed
* @param int $rownum the row number to fetch (0 = first row)
*
* @return mixed DB_OK on success, NULL when the end of a result set is
* reached or on failure
*
* @see DB_result::fetchInto()
*/
function fetchInto($result, &$arr, $fetchmode, $rownum = null)
{
if ($rownum !== null) {
if (!@mssql_data_seek($result, $rownum)) {
return null;
}
}
if ($fetchmode & DB_FETCHMODE_ASSOC) {
$arr = @mssql_fetch_array($result, MSSQL_ASSOC);
if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) {
$arr = array_change_key_case($arr, CASE_LOWER);
}
} else {
$arr = @mssql_fetch_row($result);
}
if (!$arr) {
return null;
}
if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
$this->_rtrimArrayValues($arr);
}
if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
$this->_convertNullArrayValuesToEmpty($arr);
}
return DB_OK;
}
 
// }}}
// {{{ freeResult()
 
/**
* Deletes the result set and frees the memory occupied by the result set
*
* This method is not meant to be called directly. Use
* DB_result::free() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return bool TRUE on success, FALSE if $result is invalid
*
* @see DB_result::free()
*/
function freeResult($result)
{
return @mssql_free_result($result);
}
 
// }}}
// {{{ numCols()
 
/**
* Gets the number of columns in a result set
*
* This method is not meant to be called directly. Use
* DB_result::numCols() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return int the number of columns. A DB_Error object on failure.
*
* @see DB_result::numCols()
*/
function numCols($result)
{
$cols = @mssql_num_fields($result);
if (!$cols) {
return $this->mssqlRaiseError();
}
return $cols;
}
 
// }}}
// {{{ numRows()
 
/**
* Gets the number of rows in a result set
*
* This method is not meant to be called directly. Use
* DB_result::numRows() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return int the number of rows. A DB_Error object on failure.
*
* @see DB_result::numRows()
*/
function numRows($result)
{
$rows = @mssql_num_rows($result);
if ($rows === false) {
return $this->mssqlRaiseError();
}
return $rows;
}
 
// }}}
// {{{ autoCommit()
 
/**
* Enables or disables automatic commits
*
* @param bool $onoff true turns it on, false turns it off
*
* @return int DB_OK on success. A DB_Error object if the driver
* doesn't support auto-committing transactions.
*/
function autoCommit($onoff = false)
{
// XXX if $this->transaction_opcount > 0, we should probably
// issue a warning here.
$this->autocommit = $onoff ? true : false;
return DB_OK;
}
 
// }}}
// {{{ commit()
 
/**
* Commits the current transaction
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function commit()
{
if ($this->transaction_opcount > 0) {
if (!@mssql_select_db($this->_db, $this->connection)) {
return $this->mssqlRaiseError(DB_ERROR_NODBSELECTED);
}
$result = @mssql_query('COMMIT TRAN', $this->connection);
$this->transaction_opcount = 0;
if (!$result) {
return $this->mssqlRaiseError();
}
}
return DB_OK;
}
 
// }}}
// {{{ rollback()
 
/**
* Reverts the current transaction
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function rollback()
{
if ($this->transaction_opcount > 0) {
if (!@mssql_select_db($this->_db, $this->connection)) {
return $this->mssqlRaiseError(DB_ERROR_NODBSELECTED);
}
$result = @mssql_query('ROLLBACK TRAN', $this->connection);
$this->transaction_opcount = 0;
if (!$result) {
return $this->mssqlRaiseError();
}
}
return DB_OK;
}
 
// }}}
// {{{ affectedRows()
 
/**
* Determines the number of rows affected by a data maniuplation query
*
* 0 is returned for queries that don't manipulate data.
*
* @return int the number of rows. A DB_Error object on failure.
*/
function affectedRows()
{
if (DB::isManip($this->last_query)) {
$res = @mssql_query('select @@rowcount', $this->connection);
if (!$res) {
return $this->mssqlRaiseError();
}
$ar = @mssql_fetch_row($res);
if (!$ar) {
$result = 0;
} else {
@mssql_free_result($res);
$result = $ar[0];
}
} else {
$result = 0;
}
return $result;
}
 
// }}}
// {{{ nextId()
 
/**
* Returns the next free id in a sequence
*
* @param string $seq_name name of the sequence
* @param boolean $ondemand when true, the seqence is automatically
* created if it does not exist
*
* @return int the next id number in the sequence.
* A DB_Error object on failure.
*
* @see DB_common::nextID(), DB_common::getSequenceName(),
* DB_mssql::createSequence(), DB_mssql::dropSequence()
*/
function nextId($seq_name, $ondemand = true)
{
$seqname = $this->getSequenceName($seq_name);
if (!@mssql_select_db($this->_db, $this->connection)) {
return $this->mssqlRaiseError(DB_ERROR_NODBSELECTED);
}
$repeat = 0;
do {
$this->pushErrorHandling(PEAR_ERROR_RETURN);
$result = $this->query("INSERT INTO $seqname (vapor) VALUES (0)");
$this->popErrorHandling();
if ($ondemand && DB::isError($result) &&
($result->getCode() == DB_ERROR || $result->getCode() == DB_ERROR_NOSUCHTABLE))
{
$repeat = 1;
$result = $this->createSequence($seq_name);
if (DB::isError($result)) {
return $this->raiseError($result);
}
} elseif (!DB::isError($result)) {
$result =& $this->query("SELECT @@IDENTITY FROM $seqname");
$repeat = 0;
} else {
$repeat = false;
}
} while ($repeat);
if (DB::isError($result)) {
return $this->raiseError($result);
}
$result = $result->fetchRow(DB_FETCHMODE_ORDERED);
return $result[0];
}
 
/**
* Creates a new sequence
*
* @param string $seq_name name of the new sequence
*
* @return int DB_OK on success. A DB_Error object on failure.
*
* @see DB_common::createSequence(), DB_common::getSequenceName(),
* DB_mssql::nextID(), DB_mssql::dropSequence()
*/
function createSequence($seq_name)
{
return $this->query('CREATE TABLE '
. $this->getSequenceName($seq_name)
. ' ([id] [int] IDENTITY (1, 1) NOT NULL,'
. ' [vapor] [int] NULL)');
}
 
// }}}
// {{{ dropSequence()
 
/**
* Deletes a sequence
*
* @param string $seq_name name of the sequence to be deleted
*
* @return int DB_OK on success. A DB_Error object on failure.
*
* @see DB_common::dropSequence(), DB_common::getSequenceName(),
* DB_mssql::nextID(), DB_mssql::createSequence()
*/
function dropSequence($seq_name)
{
return $this->query('DROP TABLE ' . $this->getSequenceName($seq_name));
}
 
// }}}
// {{{ quoteIdentifier()
 
/**
* Quotes a string so it can be safely used as a table or column name
*
* @param string $str identifier name to be quoted
*
* @return string quoted identifier string
*
* @see DB_common::quoteIdentifier()
* @since Method available since Release 1.6.0
*/
function quoteIdentifier($str)
{
return '[' . str_replace(']', ']]', $str) . ']';
}
 
// }}}
// {{{ mssqlRaiseError()
 
/**
* Produces a DB_Error object regarding the current problem
*
* @param int $errno if the error is being manually raised pass a
* DB_ERROR* constant here. If this isn't passed
* the error information gathered from the DBMS.
*
* @return object the DB_Error object
*
* @see DB_common::raiseError(),
* DB_mssql::errorNative(), DB_mssql::errorCode()
*/
function mssqlRaiseError($code = null)
{
$message = @mssql_get_last_message();
if (!$code) {
$code = $this->errorNative();
}
return $this->raiseError($this->errorCode($code, $message),
null, null, null, "$code - $message");
}
 
// }}}
// {{{ errorNative()
 
/**
* Gets the DBMS' native error code produced by the last query
*
* @return int the DBMS' error code
*/
function errorNative()
{
$res = @mssql_query('select @@ERROR as ErrorCode', $this->connection);
if (!$res) {
return DB_ERROR;
}
$row = @mssql_fetch_row($res);
return $row[0];
}
 
// }}}
// {{{ errorCode()
 
/**
* Determines PEAR::DB error code from mssql's native codes.
*
* If <var>$nativecode</var> isn't known yet, it will be looked up.
*
* @param mixed $nativecode mssql error code, if known
* @return integer an error number from a DB error constant
* @see errorNative()
*/
function errorCode($nativecode = null, $msg = '')
{
if (!$nativecode) {
$nativecode = $this->errorNative();
}
if (isset($this->errorcode_map[$nativecode])) {
if ($nativecode == 3701
&& preg_match('/Cannot drop the index/i', $msg))
{
return DB_ERROR_NOT_FOUND;
}
return $this->errorcode_map[$nativecode];
} else {
return DB_ERROR;
}
}
 
// }}}
// {{{ tableInfo()
 
/**
* Returns information about a table or a result set
*
* NOTE: only supports 'table' and 'flags' if <var>$result</var>
* is a table name.
*
* @param object|string $result DB_result object from a query or a
* string containing the name of a table.
* While this also accepts a query result
* resource identifier, this behavior is
* deprecated.
* @param int $mode a valid tableInfo mode
*
* @return array an associative array with the information requested.
* A DB_Error object on failure.
*
* @see DB_common::tableInfo()
*/
function tableInfo($result, $mode = null)
{
if (is_string($result)) {
/*
* Probably received a table name.
* Create a result resource identifier.
*/
if (!@mssql_select_db($this->_db, $this->connection)) {
return $this->mssqlRaiseError(DB_ERROR_NODBSELECTED);
}
$id = @mssql_query("SELECT * FROM $result WHERE 1=0",
$this->connection);
$got_string = true;
} elseif (isset($result->result)) {
/*
* Probably received a result object.
* Extract the result resource identifier.
*/
$id = $result->result;
$got_string = false;
} else {
/*
* Probably received a result resource identifier.
* Copy it.
* Deprecated. Here for compatibility only.
*/
$id = $result;
$got_string = false;
}
 
if (!is_resource($id)) {
return $this->mssqlRaiseError(DB_ERROR_NEED_MORE_DATA);
}
 
if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
$case_func = 'strtolower';
} else {
$case_func = 'strval';
}
 
$count = @mssql_num_fields($id);
$res = array();
 
if ($mode) {
$res['num_fields'] = $count;
}
 
for ($i = 0; $i < $count; $i++) {
$res[$i] = array(
'table' => $got_string ? $case_func($result) : '',
'name' => $case_func(@mssql_field_name($id, $i)),
'type' => @mssql_field_type($id, $i),
'len' => @mssql_field_length($id, $i),
// We only support flags for table
'flags' => $got_string
? $this->_mssql_field_flags($result,
@mssql_field_name($id, $i))
: '',
);
if ($mode & DB_TABLEINFO_ORDER) {
$res['order'][$res[$i]['name']] = $i;
}
if ($mode & DB_TABLEINFO_ORDERTABLE) {
$res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
}
}
 
// free the result only if we were called on a table
if ($got_string) {
@mssql_free_result($id);
}
return $res;
}
 
// }}}
// {{{ _mssql_field_flags()
 
/**
* Get a column's flags
*
* Supports "not_null", "primary_key",
* "auto_increment" (mssql identity), "timestamp" (mssql timestamp),
* "unique_key" (mssql unique index, unique check or primary_key) and
* "multiple_key" (multikey index)
*
* mssql timestamp is NOT similar to the mysql timestamp so this is maybe
* not useful at all - is the behaviour of mysql_field_flags that primary
* keys are alway unique? is the interpretation of multiple_key correct?
*
* @param string $table the table name
* @param string $column the field name
*
* @return string the flags
*
* @access private
* @author Joern Barthel <j_barthel@web.de>
*/
function _mssql_field_flags($table, $column)
{
static $tableName = null;
static $flags = array();
 
if ($table != $tableName) {
 
$flags = array();
$tableName = $table;
 
// get unique and primary keys
$res = $this->getAll("EXEC SP_HELPINDEX[$table]", DB_FETCHMODE_ASSOC);
 
foreach ($res as $val) {
$keys = explode(', ', $val['index_keys']);
 
if (sizeof($keys) > 1) {
foreach ($keys as $key) {
$this->_add_flag($flags[$key], 'multiple_key');
}
}
 
if (strpos($val['index_description'], 'primary key')) {
foreach ($keys as $key) {
$this->_add_flag($flags[$key], 'primary_key');
}
} elseif (strpos($val['index_description'], 'unique')) {
foreach ($keys as $key) {
$this->_add_flag($flags[$key], 'unique_key');
}
}
}
 
// get auto_increment, not_null and timestamp
$res = $this->getAll("EXEC SP_COLUMNS[$table]", DB_FETCHMODE_ASSOC);
 
foreach ($res as $val) {
$val = array_change_key_case($val, CASE_LOWER);
if ($val['nullable'] == '0') {
$this->_add_flag($flags[$val['column_name']], 'not_null');
}
if (strpos($val['type_name'], 'identity')) {
$this->_add_flag($flags[$val['column_name']], 'auto_increment');
}
if (strpos($val['type_name'], 'timestamp')) {
$this->_add_flag($flags[$val['column_name']], 'timestamp');
}
}
}
 
if (array_key_exists($column, $flags)) {
return(implode(' ', $flags[$column]));
}
return '';
}
 
// }}}
// {{{ _add_flag()
 
/**
* Adds a string to the flags array if the flag is not yet in there
* - if there is no flag present the array is created
*
* @param array &$array the reference to the flag-array
* @param string $value the flag value
*
* @return void
*
* @access private
* @author Joern Barthel <j_barthel@web.de>
*/
function _add_flag(&$array, $value)
{
if (!is_array($array)) {
$array = array($value);
} elseif (!in_array($value, $array)) {
array_push($array, $value);
}
}
 
// }}}
// {{{ getSpecialQuery()
 
/**
* Obtains the query string needed for listing a given type of objects
*
* @param string $type the kind of objects you want to retrieve
*
* @return string the SQL query string or null if the driver doesn't
* support the object type requested
*
* @access protected
* @see DB_common::getListOf()
*/
function getSpecialQuery($type)
{
switch ($type) {
case 'tables':
return "SELECT name FROM sysobjects WHERE type = 'U'"
. ' ORDER BY name';
case 'views':
return "SELECT name FROM sysobjects WHERE type = 'V'";
default:
return null;
}
}
 
// }}}
}
 
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/
 
?>
/tags/Racine_livraison_narmer/api/pear/DB/DataObject.php
New file
0,0 → 1,3827
<?php
/**
* Object Based Database Query Builder and data store
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Database
* @package DB_DataObject
* @author Alan Knowles <alan@akbkhome.com>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id: DataObject.php,v 1.1 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/DB_DataObject
*/
 
/* ===========================================================================
*
* !!!!!!!!!!!!! W A R N I N G !!!!!!!!!!!
*
* THIS MAY SEGFAULT PHP IF YOU ARE USING THE ZEND OPTIMIZER (to fix it,
* just add "define('DB_DATAOBJECT_NO_OVERLOAD',true);" before you include
* this file. reducing the optimization level may also solve the segfault.
* ===========================================================================
*/
 
/**
* The main "DB_DataObject" class is really a base class for your own tables classes
*
* // Set up the class by creating an ini file (refer to the manual for more details
* [DB_DataObject]
* database = mysql:/username:password@host/database
* schema_location = /home/myapplication/database
* class_location = /home/myapplication/DBTables/
* clase_prefix = DBTables_
*
*
* //Start and initialize...................... - dont forget the &
* $config = parse_ini_file('example.ini',true);
* $options = &PEAR::getStaticProperty('DB_DataObject','options');
* $options = $config['DB_DataObject'];
*
* // example of a class (that does not use the 'auto generated tables data')
* class mytable extends DB_DataObject {
* // mandatory - set the table
* var $_database_dsn = "mysql://username:password@localhost/database";
* var $__table = "mytable";
* function table() {
* return array(
* 'id' => 1, // integer or number
* 'name' => 2, // string
* );
* }
* function keys() {
* return array('id');
* }
* }
*
* // use in the application
*
*
* Simple get one row
*
* $instance = new mytable;
* $instance->get("id",12);
* echo $instance->somedata;
*
*
* Get multiple rows
*
* $instance = new mytable;
* $instance->whereAdd("ID > 12");
* $instance->whereAdd("ID < 14");
* $instance->find();
* while ($instance->fetch()) {
* echo $instance->somedata;
* }
 
 
/**
* Needed classes
* - we use getStaticProperty from PEAR pretty extensively (cant remove it ATM)
*/
 
require_once 'PEAR.php';
 
/**
* We are setting a global fetchmode assoc constant of 2 to be compatible with
* both DB and MDB2
*/
define('DB_DATAOBJECT_FETCHMODE_ASSOC',2);
 
 
 
 
 
/**
* these are constants for the get_table array
* user to determine what type of escaping is required around the object vars.
*/
define('DB_DATAOBJECT_INT', 1); // does not require ''
define('DB_DATAOBJECT_STR', 2); // requires ''
 
define('DB_DATAOBJECT_DATE', 4); // is date #TODO
define('DB_DATAOBJECT_TIME', 8); // is time #TODO
define('DB_DATAOBJECT_BOOL', 16); // is boolean #TODO
define('DB_DATAOBJECT_TXT', 32); // is long text #TODO
define('DB_DATAOBJECT_BLOB', 64); // is blob type
 
 
define('DB_DATAOBJECT_NOTNULL', 128); // not null col.
define('DB_DATAOBJECT_MYSQLTIMESTAMP' , 256); // mysql timestamps (ignored by update/insert)
/*
* Define this before you include DataObjects.php to disable overload - if it segfaults due to Zend optimizer..
*/
//define('DB_DATAOBJECT_NO_OVERLOAD',true)
 
 
/**
* Theses are the standard error codes, most methods will fail silently - and return false
* to access the error message either use $table->_lastError
* or $last_error = PEAR::getStaticProperty('DB_DataObject','lastError');
* the code is $last_error->code, and the message is $last_error->message (a standard PEAR error)
*/
 
define('DB_DATAOBJECT_ERROR_INVALIDARGS', -1); // wrong args to function
define('DB_DATAOBJECT_ERROR_NODATA', -2); // no data available
define('DB_DATAOBJECT_ERROR_INVALIDCONFIG', -3); // something wrong with the config
define('DB_DATAOBJECT_ERROR_NOCLASS', -4); // no class exists
define('DB_DATAOBJECT_ERROR_INVALID_CALL' ,-7); // overlad getter/setter failure
 
/**
* Used in methods like delete() and count() to specify that the method should
* build the condition only out of the whereAdd's and not the object parameters.
*/
define('DB_DATAOBJECT_WHEREADD_ONLY', true);
 
/**
*
* storage for connection and result objects,
* it is done this way so that print_r()'ing the is smaller, and
* it reduces the memory size of the object.
* -- future versions may use $this->_connection = & PEAR object..
* although will need speed tests to see how this affects it.
* - includes sub arrays
* - connections = md5 sum mapp to pear db object
* - results = [id] => map to pear db object
* - resultseq = sequence id for results & results field
* - resultfields = [id] => list of fields return from query (for use with toArray())
* - ini = mapping of database to ini file results
* - links = mapping of database to links file
* - lasterror = pear error objects for last error event.
* - config = aliased view of PEAR::getStaticPropery('DB_DataObject','options') * done for performance.
* - array of loaded classes by autoload method - to stop it doing file access request over and over again!
*/
$GLOBALS['_DB_DATAOBJECT']['RESULTS'] = array();
$GLOBALS['_DB_DATAOBJECT']['RESULTSEQ'] = 1;
$GLOBALS['_DB_DATAOBJECT']['RESULTFIELDS'] = array();
$GLOBALS['_DB_DATAOBJECT']['CONNECTIONS'] = array();
$GLOBALS['_DB_DATAOBJECT']['INI'] = array();
$GLOBALS['_DB_DATAOBJECT']['LINKS'] = array();
$GLOBALS['_DB_DATAOBJECT']['SEQUENCE'] = array();
$GLOBALS['_DB_DATAOBJECT']['LASTERROR'] = null;
$GLOBALS['_DB_DATAOBJECT']['CONFIG'] = array();
$GLOBALS['_DB_DATAOBJECT']['CACHE'] = array();
$GLOBALS['_DB_DATAOBJECT']['OVERLOADED'] = false;
$GLOBALS['_DB_DATAOBJECT']['QUERYENDTIME'] = 0;
 
 
// this will be horrifically slow!!!!
// NOTE: Overload SEGFAULTS ON PHP4 + Zend Optimizer (see define before..)
// these two are BC/FC handlers for call in PHP4/5
 
if ( substr(phpversion(),0,1) == 5) {
class DB_DataObject_Overload
{
function __call($method,$args)
{
$return = null;
$this->_call($method,$args,$return);
return $return;
}
function __sleep()
{
return array_keys(get_object_vars($this)) ;
}
}
} else {
if (version_compare(phpversion(),'4.3.10','eq') && !defined('DB_DATAOBJECT_NO_OVERLOAD')) {
trigger_error(
"overload does not work with PHP4.3.10, either upgrade
(snaps.php.net) or more recent version
or define DB_DATAOBJECT_NO_OVERLOAD as per the manual.
",E_USER_ERROR);
}
 
if (!function_exists('clone')) {
// emulate clone - as per php_compact, slow but really the correct behaviour..
eval('function clone($t) { $r = $t; if (method_exists($r,"__clone")) { $r->__clone(); } return $r; }');
}
eval('
class DB_DataObject_Overload {
function __call($method,$args,&$return) {
return $this->_call($method,$args,$return);
}
}
');
}
 
 
 
 
/*
*
* @package DB_DataObject
* @author Alan Knowles <alan@akbkhome.com>
* @since PHP 4.0
*/
class DB_DataObject extends DB_DataObject_Overload
{
/**
* The Version - use this to check feature changes
*
* @access private
* @var string
*/
var $_DB_DataObject_version = "1.7.15";
 
/**
* The Database table (used by table extends)
*
* @access private
* @var string
*/
var $__table = ''; // database table
 
/**
* The Number of rows returned from a query
*
* @access public
* @var int
*/
var $N = 0; // Number of rows returned from a query
 
 
/* ============================================================= */
/* Major Public Methods */
/* (designed to be optionally then called with parent::method()) */
/* ============================================================= */
 
 
/**
* Get a result using key, value.
*
* for example
* $object->get("ID",1234);
* Returns Number of rows located (usually 1) for success,
* and puts all the table columns into this classes variables
*
* see the fetch example on how to extend this.
*
* if no value is entered, it is assumed that $key is a value
* and get will then use the first key in keys()
* to obtain the key.
*
* @param string $k column
* @param string $v value
* @access public
* @return int No. of rows
*/
function get($k = null, $v = null)
{
global $_DB_DATAOBJECT;
if (empty($_DB_DATAOBJECT['CONFIG'])) {
DB_DataObject::_loadConfig();
}
$keys = array();
if ($v === null) {
$v = $k;
$keys = $this->keys();
if (!$keys) {
$this->raiseError("No Keys available for {$this->__table}", DB_DATAOBJECT_ERROR_INVALIDCONFIG);
return false;
}
$k = $keys[0];
}
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
$this->debug("$k $v " .print_r($keys,true), "GET");
}
if ($v === null) {
$this->raiseError("No Value specified for get", DB_DATAOBJECT_ERROR_INVALIDARGS);
return false;
}
$this->$k = $v;
return $this->find(1);
}
 
/**
* An autoloading, caching static get method using key, value (based on get)
*
* Usage:
* $object = DB_DataObject::staticGet("DbTable_mytable",12);
* or
* $object = DB_DataObject::staticGet("DbTable_mytable","name","fred");
*
* or write it into your extended class:
* function &staticGet($k,$v=NULL) { return DB_DataObject::staticGet("This_Class",$k,$v); }
*
* @param string $class class name
* @param string $k column (or value if using keys)
* @param string $v value (optional)
* @access public
* @return object
*/
function &staticGet($class, $k, $v = null)
{
$lclass = strtolower($class);
global $_DB_DATAOBJECT;
if (empty($_DB_DATAOBJECT['CONFIG'])) {
DB_DataObject::_loadConfig();
}
 
 
$key = "$k:$v";
if ($v === null) {
$key = $k;
}
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
DB_DataObject::debug("$class $key","STATIC GET - TRY CACHE");
}
if (!empty($_DB_DATAOBJECT['CACHE'][$lclass][$key])) {
return $_DB_DATAOBJECT['CACHE'][$lclass][$key];
}
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
DB_DataObject::debug("$class $key","STATIC GET - NOT IN CACHE");
}
 
$obj = DB_DataObject::factory(substr($class,strlen($_DB_DATAOBJECT['CONFIG']['class_prefix'])));
if (PEAR::isError($obj)) {
DB_DataObject::raiseError("could not autoload $class", DB_DATAOBJECT_ERROR_NOCLASS);
return false;
}
if (!isset($_DB_DATAOBJECT['CACHE'][$lclass])) {
$_DB_DATAOBJECT['CACHE'][$lclass] = array();
}
if (!$obj->get($k,$v)) {
DB_DataObject::raiseError("No Data return from get $k $v", DB_DATAOBJECT_ERROR_NODATA);
return false;
}
$_DB_DATAOBJECT['CACHE'][$lclass][$key] = $obj;
return $_DB_DATAOBJECT['CACHE'][$lclass][$key];
}
 
/**
* find results, either normal or crosstable
*
* for example
*
* $object = new mytable();
* $object->ID = 1;
* $object->find();
*
*
* will set $object->N to number of rows, and expects next command to fetch rows
* will return $object->N
*
* @param boolean $n Fetch first result
* @access public
* @return mixed (number of rows returned, or true if numRows fetching is not supported)
*/
function find($n = false)
{
global $_DB_DATAOBJECT;
if (!isset($this->_query)) {
$this->raiseError(
"You cannot do two queries on the same object (copy it before finding)",
DB_DATAOBJECT_ERROR_INVALIDARGS);
return false;
}
if (empty($_DB_DATAOBJECT['CONFIG'])) {
DB_DataObject::_loadConfig();
}
 
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
$this->debug($n, "__find",1);
}
if (!$this->__table) {
// xdebug can backtrace this!
php_error("NO \$__table SPECIFIED in class definition",E_USER_ERROR);
}
$this->N = 0;
$query_before = $this->_query;
$this->_build_condition($this->table()) ;
$quoteIdentifiers = !empty($_DB_DATAOBJECT['CONFIG']['quote_identifiers']);
$this->_connect();
$DB = &$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5];
/* We are checking for method modifyLimitQuery as it is PEAR DB specific */
$sql = 'SELECT ' .
$this->_query['data_select'] .
' FROM ' . ($quoteIdentifiers ? $DB->quoteIdentifier($this->__table) : $this->__table) . " " .
$this->_join .
$this->_query['condition'] . ' '.
$this->_query['group_by'] . ' '.
$this->_query['having'] . ' '.
$this->_query['order_by'] . ' ';
if ((!isset($_DB_DATAOBJECT['CONFIG']['db_driver'])) ||
($_DB_DATAOBJECT['CONFIG']['db_driver'] == 'DB')) {
/* PEAR DB specific */
if (isset($this->_query['limit_start']) && strlen($this->_query['limit_start'] . $this->_query['limit_count'])) {
$sql = $DB->modifyLimitQuery($sql,$this->_query['limit_start'], $this->_query['limit_count']);
}
} else {
/* theoretically MDB! */
if (isset($this->_query['limit_start']) && strlen($this->_query['limit_start'] . $this->_query['limit_count'])) {
$DB->setLimit($this->_query['limit_count'],$this->_query['limit_start']);
}
}
$this->_query($sql);
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
$this->debug("CHECK autofetchd $n", "__find", 1);
}
// unset the
if ($n && $this->N > 0 ) {
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
$this->debug("ABOUT TO AUTOFETCH", "__find", 1);
}
$this->fetch() ;
}
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
$this->debug("DONE", "__find", 1);
}
$this->_query = $query_before;
return $this->N;
}
 
/**
* fetches next row into this objects var's
*
* returns 1 on success 0 on failure
*
*
*
* Example
* $object = new mytable();
* $object->name = "fred";
* $object->find();
* $store = array();
* while ($object->fetch()) {
* echo $this->ID;
* $store[] = $object; // builds an array of object lines.
* }
*
* to add features to a fetch
* function fetch () {
* $ret = parent::fetch();
* $this->date_formated = date('dmY',$this->date);
* return $ret;
* }
*
* @access public
* @return boolean on success
*/
function fetch()
{
 
global $_DB_DATAOBJECT;
if (empty($_DB_DATAOBJECT['CONFIG'])) {
DB_DataObject::_loadConfig();
}
if (empty($this->N)) {
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
$this->debug("No data returned from FIND (eg. N is 0)","FETCH", 3);
}
return false;
}
if (empty($_DB_DATAOBJECT['RESULTS'][$this->_DB_resultid]) ||
!is_object($result = &$_DB_DATAOBJECT['RESULTS'][$this->_DB_resultid]))
{
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
$this->debug('fetched on object after fetch completed (no results found)');
}
return false;
}
$array = $result->fetchRow(DB_DATAOBJECT_FETCHMODE_ASSOC);
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
$this->debug(serialize($array),"FETCH");
}
 
if ($array === null) {
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
$t= explode(' ',microtime());
$this->debug("Last Data Fetch'ed after " .
($t[0]+$t[1]- $_DB_DATAOBJECT['QUERYENDTIME'] ) .
" seconds",
"FETCH", 1);
}
// reduce the memory usage a bit... (but leave the id in, so count() works ok on it)
unset($_DB_DATAOBJECT['RESULTS'][$this->_DB_resultid]);
// this is probably end of data!!
//DB_DataObject::raiseError("fetch: no data returned", DB_DATAOBJECT_ERROR_NODATA);
return false;
}
if (!isset($_DB_DATAOBJECT['RESULTFIELDS'][$this->_DB_resultid])) {
// note: we dont declare this to keep the print_r size down.
$_DB_DATAOBJECT['RESULTFIELDS'][$this->_DB_resultid]= array_flip(array_keys($array));
}
foreach($array as $k=>$v) {
$kk = str_replace(".", "_", $k);
$kk = str_replace(" ", "_", $kk);
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
$this->debug("$kk = ". $array[$k], "fetchrow LINE", 3);
}
$this->$kk = $array[$k];
}
// set link flag
$this->_link_loaded=false;
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
$this->debug("{$this->__table} DONE", "fetchrow",2);
}
if (isset($this->_query) && empty($_DB_DATAOBJECT['CONFIG']['keep_query_after_fetch'])) {
unset($this->_query);
}
return true;
}
 
/**
* Adds a condition to the WHERE statement, defaults to AND
*
* $object->whereAdd(); //reset or cleaer ewhwer
* $object->whereAdd("ID > 20");
* $object->whereAdd("age > 20","OR");
*
* @param string $cond condition
* @param string $logic optional logic "OR" (defaults to "AND")
* @access public
* @return string|PEAR::Error - previous condition or Error when invalid args found
*/
function whereAdd($cond = false, $logic = 'AND')
{
if (!isset($this->_query)) {
return $this->raiseError(
"You cannot do two queries on the same object (clone it before finding)",
DB_DATAOBJECT_ERROR_INVALIDARGS);
}
if ($cond === false) {
$r = $this->_query['condition'];
$this->_query['condition'] = '';
return $r;
}
// check input...= 0 or ' ' == error!
if (!trim($cond)) {
return $this->raiseError("WhereAdd: No Valid Arguments", DB_DATAOBJECT_ERROR_INVALIDARGS);
}
$r = $this->_query['condition'];
if ($this->_query['condition']) {
$this->_query['condition'] .= " {$logic} {$cond}";
return $r;
}
$this->_query['condition'] = " WHERE {$cond}";
return $r;
}
 
/**
* Adds a order by condition
*
* $object->orderBy(); //clears order by
* $object->orderBy("ID");
* $object->orderBy("ID,age");
*
* @param string $order Order
* @access public
* @return none|PEAR::Error - invalid args only
*/
function orderBy($order = false)
{
if (!isset($this->_query)) {
$this->raiseError(
"You cannot do two queries on the same object (copy it before finding)",
DB_DATAOBJECT_ERROR_INVALIDARGS);
return false;
}
if ($order === false) {
$this->_query['order_by'] = '';
return;
}
// check input...= 0 or ' ' == error!
if (!trim($order)) {
return $this->raiseError("orderBy: No Valid Arguments", DB_DATAOBJECT_ERROR_INVALIDARGS);
}
if (!$this->_query['order_by']) {
$this->_query['order_by'] = " ORDER BY {$order} ";
return;
}
$this->_query['order_by'] .= " , {$order}";
}
 
/**
* Adds a group by condition
*
* $object->groupBy(); //reset the grouping
* $object->groupBy("ID DESC");
* $object->groupBy("ID,age");
*
* @param string $group Grouping
* @access public
* @return none|PEAR::Error - invalid args only
*/
function groupBy($group = false)
{
if (!isset($this->_query)) {
$this->raiseError(
"You cannot do two queries on the same object (copy it before finding)",
DB_DATAOBJECT_ERROR_INVALIDARGS);
return false;
}
if ($group === false) {
$this->_query['group_by'] = '';
return;
}
// check input...= 0 or ' ' == error!
if (!trim($group)) {
return $this->raiseError("groupBy: No Valid Arguments", DB_DATAOBJECT_ERROR_INVALIDARGS);
}
if (!$this->_query['group_by']) {
$this->_query['group_by'] = " GROUP BY {$group} ";
return;
}
$this->_query['group_by'] .= " , {$group}";
}
 
/**
* Adds a having clause
*
* $object->having(); //reset the grouping
* $object->having("sum(value) > 0 ");
*
* @param string $having condition
* @access public
* @return none|PEAR::Error - invalid args only
*/
function having($having = false)
{
if (!isset($this->_query)) {
$this->raiseError(
"You cannot do two queries on the same object (copy it before finding)",
DB_DATAOBJECT_ERROR_INVALIDARGS);
return false;
}
if ($having === false) {
$this->_query['having'] = '';
return;
}
// check input...= 0 or ' ' == error!
if (!trim($having)) {
return $this->raiseError("Having: No Valid Arguments", DB_DATAOBJECT_ERROR_INVALIDARGS);
}
if (!$this->_query['having']) {
$this->_query['having'] = " HAVING {$having} ";
return;
}
$this->_query['having'] .= " AND {$having}";
}
 
/**
* Sets the Limit
*
* $boject->limit(); // clear limit
* $object->limit(12);
* $object->limit(12,10);
*
* Note this will emit an error on databases other than mysql/postgress
* as there is no 'clean way' to implement it. - you should consider refering to
* your database manual to decide how you want to implement it.
*
* @param string $a limit start (or number), or blank to reset
* @param string $b number
* @access public
* @return none|PEAR::Error - invalid args only
*/
function limit($a = null, $b = null)
{
if (!isset($this->_query)) {
$this->raiseError(
"You cannot do two queries on the same object (copy it before finding)",
DB_DATAOBJECT_ERROR_INVALIDARGS);
return false;
}
if ($a === null) {
$this->_query['limit_start'] = '';
$this->_query['limit_count'] = '';
return;
}
// check input...= 0 or ' ' == error!
if ((!is_int($a) && ((string)((int)$a) !== (string)$a))
|| (($b !== null) && (!is_int($b) && ((string)((int)$b) !== (string)$b)))) {
return $this->raiseError("limit: No Valid Arguments", DB_DATAOBJECT_ERROR_INVALIDARGS);
}
global $_DB_DATAOBJECT;
$this->_connect();
$DB = &$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5];
$this->_query['limit_start'] = ($b == null) ? 0 : (int)$a;
$this->_query['limit_count'] = ($b == null) ? (int)$a : (int)$b;
}
 
/**
* Adds a select columns
*
* $object->selectAdd(); // resets select to nothing!
* $object->selectAdd("*"); // default select
* $object->selectAdd("unixtime(DATE) as udate");
* $object->selectAdd("DATE");
*
* to prepend distict:
* $object->selectAdd('distinct ' . $object->selectAdd());
*
* @param string $k
* @access public
* @return mixed null or old string if you reset it.
*/
function selectAdd($k = null)
{
if (!isset($this->_query)) {
$this->raiseError(
"You cannot do two queries on the same object (copy it before finding)",
DB_DATAOBJECT_ERROR_INVALIDARGS);
return false;
}
if ($k === null) {
$old = $this->_query['data_select'];
$this->_query['data_select'] = '';
return $old;
}
// check input...= 0 or ' ' == error!
if (!trim($k)) {
return $this->raiseError("selectAdd: No Valid Arguments", DB_DATAOBJECT_ERROR_INVALIDARGS);
}
if ($this->_query['data_select']) {
$this->_query['data_select'] .= ', ';
}
$this->_query['data_select'] .= " $k ";
}
/**
* Adds multiple Columns or objects to select with formating.
*
* $object->selectAs(null); // adds "table.colnameA as colnameA,table.colnameB as colnameB,......"
* // note with null it will also clear the '*' default select
* $object->selectAs(array('a','b'),'%s_x'); // adds "a as a_x, b as b_x"
* $object->selectAs(array('a','b'),'ddd_%s','ccc'); // adds "ccc.a as ddd_a, ccc.b as ddd_b"
* $object->selectAdd($object,'prefix_%s'); // calls $object->get_table and adds it all as
* objectTableName.colnameA as prefix_colnameA
*
* @param array|object|null the array or object to take column names from.
* @param string format in sprintf format (use %s for the colname)
* @param string table name eg. if you have joinAdd'd or send $from as an array.
* @access public
* @return void
*/
function selectAs($from = null,$format = '%s',$tableName=false)
{
global $_DB_DATAOBJECT;
if (!isset($this->_query)) {
$this->raiseError(
"You cannot do two queries on the same object (copy it before finding)",
DB_DATAOBJECT_ERROR_INVALIDARGS);
return false;
}
if ($from === null) {
// blank the '*'
$this->selectAdd();
$from = $this;
}
$table = $this->__table;
if (is_object($from)) {
$table = $from->__table;
$from = array_keys($from->table());
}
if ($tableName !== false) {
$table = $tableName;
}
$s = '%s';
if (!empty($_DB_DATAOBJECT['CONFIG']['quote_identifiers'])) {
$this->_connect();
$DB = &$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5];
$s = $DB->quoteIdentifier($s);
}
foreach ($from as $k) {
$this->selectAdd(sprintf("{$s}.{$s} as {$format}",$table,$k,$k));
}
$this->_query['data_select'] .= "\n";
}
/**
* Insert the current objects variables into the database
*
* Returns the ID of the inserted element (if auto increment or sequences are used.)
*
* for example
*
* Designed to be extended
*
* $object = new mytable();
* $object->name = "fred";
* echo $object->insert();
*
* @access public
* @return mixed false on failure, int when auto increment or sequence used, otherwise true on success
*/
function insert()
{
global $_DB_DATAOBJECT;
// we need to write to the connection (For nextid) - so us the real
// one not, a copyied on (as ret-by-ref fails with overload!)
if (!isset($_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5])) {
$this->_connect();
}
$quoteIdentifiers = !empty($_DB_DATAOBJECT['CONFIG']['quote_identifiers']);
$DB = &$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5];
$items = isset($_DB_DATAOBJECT['INI'][$this->_database][$this->__table]) ?
$_DB_DATAOBJECT['INI'][$this->_database][$this->__table] : $this->table();
if (!$items) {
$this->raiseError("insert:No table definition for {$this->__table}",
DB_DATAOBJECT_ERROR_INVALIDCONFIG);
return false;
}
$options = &$_DB_DATAOBJECT['CONFIG'];
 
 
$datasaved = 1;
$leftq = '';
$rightq = '';
$seqKeys = isset($_DB_DATAOBJECT['SEQUENCE'][$this->_database][$this->__table]) ?
$_DB_DATAOBJECT['SEQUENCE'][$this->_database][$this->__table] :
$this->sequenceKey();
$key = isset($seqKeys[0]) ? $seqKeys[0] : false;
$useNative = isset($seqKeys[1]) ? $seqKeys[1] : false;
$seq = isset($seqKeys[2]) ? $seqKeys[2] : false;
$dbtype = $_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]->dsn["phptype"];
// nativeSequences or Sequences..
 
// big check for using sequences
if (($key !== false) && !$useNative) {
if (!$seq) {
$this->$key = $DB->nextId($this->__table);
} else {
$f = $DB->getOption('seqname_format');
$DB->setOption('seqname_format','%s');
$this->$key = $DB->nextId($seq);
$DB->setOption('seqname_format',$f);
}
}
 
 
 
foreach($items as $k => $v) {
// if we are using autoincrement - skip the column...
if ($key && ($k == $key) && $useNative) {
continue;
}
if (!isset($this->$k)) {
continue;
}
// dont insert data into mysql timestamps
// use query() if you really want to do this!!!!
if ($v & DB_DATAOBJECT_MYSQLTIMESTAMP) {
continue;
}
if ($leftq) {
$leftq .= ', ';
$rightq .= ', ';
}
$leftq .= ($quoteIdentifiers ? ($DB->quoteIdentifier($k) . ' ') : "$k ");
if (is_a($this->$k,'db_dataobject_cast')) {
$value = $this->$k->toString($v,$DB);
if (PEAR::isError($value)) {
$this->raiseError($value->getMessage() ,DB_DATAOBJECT_ERROR_INVALIDARG);
return false;
}
$rightq .= $value;
continue;
}
 
if ((strtolower($this->$k) === 'null') && !($v & DB_DATAOBJECT_NOTNULL)) {
$rightq .= " NULL ";
continue;
}
// DATE is empty... on a col. that can be null..
// note: this may be usefull for time as well..
if (!$this->$k &&
(($v & DB_DATAOBJECT_DATE) || ($v & DB_DATAOBJECT_TIME)) &&
!($v & DB_DATAOBJECT_NOTNULL)) {
$rightq .= " NULL ";
continue;
}
if ($v & DB_DATAOBJECT_STR) {
$rightq .= $this->_quote((string) (
($v & DB_DATAOBJECT_BOOL) ?
// this is thanks to the braindead idea of postgres to
// use t/f for boolean.
(($this->$k == 'f') ? 0 : (int)(bool) $this->$k) :
$this->$k
)) . " ";
continue;
}
if (is_numeric($this->$k)) {
$rightq .=" {$this->$k} ";
continue;
}
// at present we only cast to integers
// - V2 may store additional data about float/int
$rightq .= ' ' . intval($this->$k) . ' ';
 
}
// not sure why we let empty insert here.. - I guess to generate a blank row..
if ($leftq || $useNative) {
$table = ($quoteIdentifiers ? $DB->quoteIdentifier($this->__table) : $this->__table);
$r = $this->_query("INSERT INTO {$table} ($leftq) VALUES ($rightq) ");
if (PEAR::isError($r)) {
$this->raiseError($r);
return false;
}
if ($r < 1) {
return 0;
}
// now do we have an integer key!
if ($key && $useNative) {
switch ($dbtype) {
case 'mysql':
case 'mysqli':
$method = "{$dbtype}_insert_id";
$this->$key = $method(
$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]->connection
);
break;
case 'mssql':
// note this is not really thread safe - you should wrapp it with
// transactions = eg.
// $db->query('BEGIN');
// $db->insert();
// $db->query('COMMIT');
$mssql_key = $DB->getOne("SELECT @@IDENTITY");
if (PEAR::isError($mssql_key)) {
$this->raiseError($r);
return false;
}
$this->$key = $mssql_key;
break;
case 'pgsql':
if (!$seq) {
$seq = $DB->getSequenceName($this->__table );
}
$pgsql_key = $DB->getOne("SELECT last_value FROM ".$seq);
if (PEAR::isError($pgsql_key)) {
$this->raiseError($r);
return false;
}
$this->$key = $pgsql_key;
break;
case 'ifx':
$this->$key = array_shift (
ifx_fetch_row (
ifx_query(
"select DBINFO('sqlca.sqlerrd1') FROM systables where tabid=1",
$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]->connection,
IFX_SCROLL
),
"FIRST"
)
);
break;
}
}
 
if (isset($_DB_DATAOBJECT['CACHE'][strtolower(get_class($this))])) {
$this->_clear_cache();
}
if ($key) {
return $this->$key;
}
return true;
}
$this->raiseError("insert: No Data specifed for query", DB_DATAOBJECT_ERROR_NODATA);
return false;
}
 
/**
* Updates current objects variables into the database
* uses the keys() to decide how to update
* Returns the true on success
*
* for example
*
* $object = DB_DataObject::factory('mytable');
* $object->get("ID",234);
* $object->email="testing@test.com";
* if(!$object->update())
* echo "UPDATE FAILED";
*
* to only update changed items :
* $dataobject->get(132);
* $original = $dataobject; // clone/copy it..
* $dataobject->setFrom($_POST);
* if ($dataobject->validate()) {
* $dataobject->update($original);
* } // otherwise an error...
*
* performing global updates:
* $object = DB_DataObject::factory('mytable');
* $object->status = "dead";
* $object->whereAdd('age > 150');
* $object->update(DB_DATAOBJECT_WHEREADD_ONLY);
*
* @param object dataobject (optional) | DB_DATAOBJECT_WHEREADD_ONLY - used to only update changed items.
* @access public
* @return int rows affected or false on failure
*/
function update($dataObject = false)
{
global $_DB_DATAOBJECT;
// connect will load the config!
$this->_connect();
$original_query = isset($this->_query) ? $this->_query : null;
$items = isset($_DB_DATAOBJECT['INI'][$this->_database][$this->__table]) ?
$_DB_DATAOBJECT['INI'][$this->_database][$this->__table] : $this->table();
// only apply update against sequence key if it is set?????
$seq = $this->sequenceKey();
if ($seq[0] !== false) {
$keys = array($seq[0]);
if (empty($this->{$keys[0]}) && $dataObject !== true) {
$this->raiseError("update: trying to perform an update without
the key set, and argument to update is not
DB_DATAOBJECT_WHEREADD_ONLY
", DB_DATAOBJECT_ERROR_INVALIDARGS);
return false;
}
} else {
$keys = $this->keys();
}
if (!$items) {
$this->raiseError("update:No table definition for {$this->__table}", DB_DATAOBJECT_ERROR_INVALIDCONFIG);
return false;
}
$datasaved = 1;
$settings = '';
$this->_connect();
$DB = &$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5];
$dbtype = $DB->dsn["phptype"];
$quoteIdentifiers = !empty($_DB_DATAOBJECT['CONFIG']['quote_identifiers']);
foreach($items as $k => $v) {
if (!isset($this->$k)) {
continue;
}
// ignore stuff thats
// dont write things that havent changed..
if (($dataObject !== false) && isset($dataObject->$k) && ($dataObject->$k == $this->$k)) {
continue;
}
// - dont write keys to left.!!!
if (in_array($k,$keys)) {
continue;
}
// dont insert data into mysql timestamps
// use query() if you really want to do this!!!!
if ($v & DB_DATAOBJECT_MYSQLTIMESTAMP) {
continue;
}
if ($settings) {
$settings .= ', ';
}
$kSql = ($quoteIdentifiers ? $DB->quoteIdentifier($k) : $k);
if (is_a($this->$k,'db_dataobject_cast')) {
$value = $this->$k->toString($v,$DB);
if (PEAR::isError($value)) {
$this->raiseError($value->getMessage() ,DB_DATAOBJECT_ERROR_INVALIDARG);
return false;
}
$settings .= "$kSql = $value ";
continue;
}
// special values ... at least null is handled...
if ((strtolower($this->$k) === 'null') && !($v & DB_DATAOBJECT_NOTNULL)) {
$settings .= "$kSql = NULL ";
continue;
}
// DATE is empty... on a col. that can be null..
// note: this may be usefull for time as well..
if (!$this->$k &&
(($v & DB_DATAOBJECT_DATE) || ($v & DB_DATAOBJECT_TIME)) &&
!($v & DB_DATAOBJECT_NOTNULL)) {
$settings .= "$kSql = NULL ";
continue;
}
 
if ($v & DB_DATAOBJECT_STR) {
$settings .= "$kSql = ". $this->_quote((string) (
($v & DB_DATAOBJECT_BOOL) ?
// this is thanks to the braindead idea of postgres to
// use t/f for boolean.
(($this->$k == 'f') ? 0 : (int)(bool) $this->$k) :
$this->$k
)) . ' ';
continue;
}
if (is_numeric($this->$k)) {
$settings .= "$kSql = {$this->$k} ";
continue;
}
// at present we only cast to integers
// - V2 may store additional data about float/int
$settings .= "$kSql = " . intval($this->$k) . ' ';
}
 
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
$this->debug("got keys as ".serialize($keys),3);
}
if ($dataObject !== true) {
$this->_build_condition($items,$keys);
} else {
// prevent wiping out of data!
if (empty($this->_query['condition'])) {
$this->raiseError("update: global table update not available
do \$do->whereAdd('1=1'); if you really want to do that.
", DB_DATAOBJECT_ERROR_INVALIDARGS);
return false;
}
}
// echo " $settings, $this->condition ";
if ($settings && isset($this->_query) && $this->_query['condition']) {
$table = ($quoteIdentifiers ? $DB->quoteIdentifier($this->__table) : $this->__table);
$r = $this->_query("UPDATE {$table} SET {$settings} {$this->_query['condition']} ");
// restore original query conditions.
$this->_query = $original_query;
if (PEAR::isError($r)) {
$this->raiseError($r);
return false;
}
if ($r < 1) {
return 0;
}
 
$this->_clear_cache();
return $r;
}
// restore original query conditions.
$this->_query = $original_query;
// if you manually specified a dataobject, and there where no changes - then it's ok..
if ($dataObject !== false) {
return true;
}
$this->raiseError(
"update: No Data specifed for query $settings , {$this->_query['condition']}",
DB_DATAOBJECT_ERROR_NODATA);
return false;
}
 
/**
* Deletes items from table which match current objects variables
*
* Returns the true on success
*
* for example
*
* Designed to be extended
*
* $object = new mytable();
* $object->ID=123;
* echo $object->delete(); // builds a conditon
*
* $object = new mytable();
* $object->whereAdd('age > 12');
* $object->limit(1);
* $object->orderBy('age DESC');
* $object->delete(true); // dont use object vars, use the conditions, limit and order.
*
* @param bool $useWhere (optional) If DB_DATAOBJECT_WHEREADD_ONLY is passed in then
* we will build the condition only using the whereAdd's. Default is to
* build the condition only using the object parameters.
*
* @access public
* @return mixed True on success, false on failure, 0 on no data affected
*/
function delete($useWhere = false)
{
global $_DB_DATAOBJECT;
// connect will load the config!
$this->_connect();
$DB = &$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5];
$quoteIdentifiers = !empty($_DB_DATAOBJECT['CONFIG']['quote_identifiers']);
$extra_cond = ' ' . (isset($this->_query['order_by']) ? $this->_query['order_by'] : '');
if (!$useWhere) {
 
$keys = $this->keys();
$this->_query = array(); // as it's probably unset!
$this->_query['condition'] = ''; // default behaviour not to use where condition
$this->_build_condition($this->table(),$keys);
// if primary keys are not set then use data from rest of object.
if (!$this->_query['condition']) {
$this->_build_condition($this->table(),array(),$keys);
}
$extra_cond = '';
}
 
// don't delete without a condition
if (isset($this->_query) && $this->_query['condition']) {
$table = ($quoteIdentifiers ? $DB->quoteIdentifier($this->__table) : $this->__table);
$sql = "DELETE FROM {$table} {$this->_query['condition']}{$extra_cond}";
// add limit..
if (isset($this->_query['limit_start']) && strlen($this->_query['limit_start'] . $this->_query['limit_count'])) {
if (!isset($_DB_DATAOBJECT['CONFIG']['db_driver']) ||
($_DB_DATAOBJECT['CONFIG']['db_driver'] == 'DB')) {
// pear DB
$sql = $DB->modifyLimitQuery($sql,$this->_query['limit_start'], $this->_query['limit_count']);
} else {
// MDB
$DB->setLimit( $this->_query['limit_count'],$this->_query['limit_start']);
}
}
$r = $this->_query($sql);
if (PEAR::isError($r)) {
$this->raiseError($r);
return false;
}
if ($r < 1) {
return 0;
}
$this->_clear_cache();
return $r;
} else {
$this->raiseError("delete: No condition specifed for query", DB_DATAOBJECT_ERROR_NODATA);
return false;
}
}
 
/**
* fetches a specific row into this object variables
*
* Not recommended - better to use fetch()
*
* Returens true on success
*
* @param int $row row
* @access public
* @return boolean true on success
*/
function fetchRow($row = null)
{
global $_DB_DATAOBJECT;
if (empty($_DB_DATAOBJECT['CONFIG'])) {
$this->_loadConfig();
}
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
$this->debug("{$this->__table} $row of {$this->N}", "fetchrow",3);
}
if (!$this->__table) {
$this->raiseError("fetchrow: No table", DB_DATAOBJECT_ERROR_INVALIDCONFIG);
return false;
}
if ($row === null) {
$this->raiseError("fetchrow: No row specified", DB_DATAOBJECT_ERROR_INVALIDARGS);
return false;
}
if (!$this->N) {
$this->raiseError("fetchrow: No results avaiable", DB_DATAOBJECT_ERROR_NODATA);
return false;
}
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
$this->debug("{$this->__table} $row of {$this->N}", "fetchrow",3);
}
 
 
$result = &$_DB_DATAOBJECT['RESULTS'][$this->_DB_resultid];
$array = $result->fetchrow(DB_DATAOBJECT_FETCHMODE_ASSOC,$row);
if (!is_array($array)) {
$this->raiseError("fetchrow: No results available", DB_DATAOBJECT_ERROR_NODATA);
return false;
}
 
foreach($array as $k => $v) {
$kk = str_replace(".", "_", $k);
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
$this->debug("$kk = ". $array[$k], "fetchrow LINE", 3);
}
$this->$kk = $array[$k];
}
 
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
$this->debug("{$this->__table} DONE", "fetchrow", 3);
}
return true;
}
 
/**
* Find the number of results from a simple query
*
* for example
*
* $object = new mytable();
* $object->name = "fred";
* echo $object->count();
* echo $object->count(true); // dont use object vars.
* echo $object->count('distinct mycol'); count distinct mycol.
* echo $object->count('distinct mycol',true); // dont use object vars.
* echo $object->count('distinct'); // count distinct id (eg. the primary key)
*
*
* @param bool|string (optional)
* (true|false => see below not on whereAddonly)
* (string)
* "DISTINCT" => does a distinct count on the tables 'key' column
* otherwise => normally it counts primary keys - you can use
* this to do things like $do->count('distinct mycol');
*
* @param bool $whereAddOnly (optional) If DB_DATAOBJECT_WHEREADD_ONLY is passed in then
* we will build the condition only using the whereAdd's. Default is to
* build the condition using the object parameters as well.
*
* @access public
* @return int
*/
function count($countWhat = false,$whereAddOnly = false)
{
global $_DB_DATAOBJECT;
if (is_bool($countWhat)) {
$whereAddOnly = $countWhat;
}
$t = clone($this);
$quoteIdentifiers = !empty($_DB_DATAOBJECT['CONFIG']['quote_identifiers']);
$items = $t->table();
if (!isset($t->_query)) {
$this->raiseError(
"You cannot do run count after you have run fetch()",
DB_DATAOBJECT_ERROR_INVALIDARGS);
return false;
}
$this->_connect();
$DB = &$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5];
 
if (!$whereAddOnly && $items) {
$t->_build_condition($items);
}
$keys = $this->keys();
 
if (!$keys[0] && !is_string($countWhat)) {
$this->raiseError(
"You cannot do run count without keys - use \$do->keys('id');",
DB_DATAOBJECT_ERROR_INVALIDARGS,PEAR_ERROR_DIE);
return false;
}
$table = ($quoteIdentifiers ? $DB->quoteIdentifier($this->__table) : $this->__table);
$key_col = ($quoteIdentifiers ? $DB->quoteIdentifier($keys[0]) : $keys[0]);
$as = ($quoteIdentifiers ? $DB->quoteIdentifier('DATAOBJECT_NUM') : 'DATAOBJECT_NUM');
// support distinct on default keys.
$countWhat = (strtoupper($countWhat) == 'DISTINCT') ?
"DISTINCT {$table}.{$key_col}" : $countWhat;
$countWhat = is_string($countWhat) ? $countWhat : "{$table}.{$key_col}";
$r = $t->_query(
"SELECT count({$countWhat}) as $as
FROM $table {$t->_join} {$t->_query['condition']}");
if (PEAR::isError($r)) {
return false;
}
$result = &$_DB_DATAOBJECT['RESULTS'][$t->_DB_resultid];
$l = $result->fetchRow();
return $l[0];
}
 
/**
* sends raw query to database
*
* Since _query has to be a private 'non overwriteable method', this is a relay
*
* @param string $string SQL Query
* @access public
* @return void or DB_Error
*/
function query($string)
{
return $this->_query($string);
}
 
 
/**
* an escape wrapper around DB->escapeSimple()
* can be used when adding manual queries or clauses
* eg.
* $object->query("select * from xyz where abc like '". $object->escape($_GET['name']) . "'");
*
* @param string $string value to be escaped
* @access public
* @return string
*/
function escape($string)
{
global $_DB_DATAOBJECT;
$this->_connect();
$DB = &$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5];
// mdb uses escape...
$dd = empty($_DB_DATAOBJECT['CONFIG']['db_driver']) ? 'DB' : $_DB_DATAOBJECT['CONFIG']['db_driver'];
return ($dd == 'DB') ? $DB->escapeSimple($string) : $DB->escape($string);
}
 
/* ==================================================== */
/* Major Private Vars */
/* ==================================================== */
 
/**
* The Database connection dsn (as described in the PEAR DB)
* only used really if you are writing a very simple application/test..
* try not to use this - it is better stored in configuration files..
*
* @access private
* @var string
*/
var $_database_dsn = '';
 
/**
* The Database connection id (md5 sum of databasedsn)
*
* @access private
* @var string
*/
var $_database_dsn_md5 = '';
 
/**
* The Database name
* created in __connection
*
* @access private
* @var string
*/
var $_database = '';
 
/**
* The QUERY rules
* This replaces alot of the private variables
* used to build a query, it is unset after find() is run.
*
*
*
* @access private
* @var array
*/
var $_query = array(
'condition' => '', // the WHERE condition
'group_by' => '', // the GROUP BY condition
'order_by' => '', // the ORDER BY condition
'having' => '', // the HAVING condition
'limit_start' => '', // the LIMIT condition
'limit_count' => '', // the LIMIT condition
'data_select' => '*', // the columns to be SELECTed
);
 
/**
* Database result id (references global $_DB_DataObject[results]
*
* @access private
* @var integer
*/
var $_DB_resultid; // database result object
 
 
/* ============================================================== */
/* Table definition layer (started of very private but 'came out'*/
/* ============================================================== */
 
/**
* Autoload or manually load the table definitions
*
*
* usage :
* DB_DataObject::databaseStructure( 'databasename',
* parse_ini_file('mydb.ini',true),
* parse_ini_file('mydb.link.ini',true));
*
* obviously you dont have to use ini files.. (just return array similar to ini files..)
*
* It should append to the table structure array
*
*
* @param optional string name of database to assign / read
* @param optional array structure of database, and keys
* @param optional array table links
*
* @access public
* @return true or PEAR:error on wrong paramenters.. or false if no file exists..
* or the array(tablename => array(column_name=>type)) if called with 1 argument.. (databasename)
*/
function databaseStructure()
{
 
global $_DB_DATAOBJECT;
// Assignment code
if ($args = func_get_args()) {
if (count($args) == 1) {
// this returns all the tables and their structure..
$x = new DB_DataObject;
$x->_database = $args[0];
$this->_connect();
$DB = &$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5];
$tables = $DB->getListOf('tables');
require_once 'DB/DataObject/Generator.php';
foreach($tables as $table) {
$y = new DB_DataObject_Generator;
$y->fillTableSchema($x->_database,$table);
}
return $_DB_DATAOBJECT['INI'][$x->_database];
} else {
$_DB_DATAOBJECT['INI'][$args[0]] = isset($_DB_DATAOBJECT['INI'][$args[0]]) ?
$_DB_DATAOBJECT['INI'][$args[0]] + $args[1] : $args[1];
if (isset($args[1])) {
$_DB_DATAOBJECT['LINKS'][$args[0]] = isset($_DB_DATAOBJECT['LINKS'][$args[0]]) ?
$_DB_DATAOBJECT['LINKS'][$args[0]] + $args[2] : $args[2];
}
return true;
}
}
if (!$this->_database) {
$this->_connect();
}
// loaded already?
if (!empty($_DB_DATAOBJECT['INI'][$this->_database])) {
// database loaded - but this is table is not available..
if (empty($_DB_DATAOBJECT['INI'][$this->_database][$this->__table])) {
require_once 'DB/DataObject/Generator.php';
$x = new DB_DataObject_Generator;
$x->fillTableSchema($this->_database,$this->__table);
}
return true;
}
if (empty($_DB_DATAOBJECT['CONFIG'])) {
DB_DataObject::_loadConfig();
}
// if you supply this with arguments, then it will take those
// as the database and links array...
$schemas = isset($_DB_DATAOBJECT['CONFIG']['schema_location']) ?
array("{$_DB_DATAOBJECT['CONFIG']['schema_location']}/{$this->_database}.ini") :
array() ;
if (isset($_DB_DATAOBJECT['CONFIG']["ini_{$this->_database}"])) {
$schemas = is_array($_DB_DATAOBJECT['CONFIG']["ini_{$this->_database}"]) ?
$_DB_DATAOBJECT['CONFIG']["ini_{$this->_database}"] :
explode(PATH_SEPARATOR,$_DB_DATAOBJECT['CONFIG']["ini_{$this->_database}"]);
}
foreach ($schemas as $ini) {
$links =
isset($_DB_DATAOBJECT['CONFIG']["links_{$this->_database}"]) ?
$_DB_DATAOBJECT['CONFIG']["links_{$this->_database}"] :
str_replace('.ini','.links.ini',$ini);
 
if (file_exists($ini) && is_file($ini)) {
$_DB_DATAOBJECT['INI'][$this->_database] = parse_ini_file($ini, true);
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
$this->debug("Loaded ini file: $ini","databaseStructure",1);
}
} else {
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
$this->debug("Missing ini file: $ini","databaseStructure",1);
}
}
if (empty($_DB_DATAOBJECT['LINKS'][$this->_database]) && file_exists($links) && is_file($links)) {
/* not sure why $links = ... here - TODO check if that works */
$_DB_DATAOBJECT['LINKS'][$this->_database] = parse_ini_file($links, true);
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
$this->debug("Loaded links.ini file: $links","databaseStructure",1);
}
} else {
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
$this->debug("Missing links.ini file: $links","databaseStructure",1);
}
}
}
// now have we loaded the structure.. - if not try building it..
if (empty($_DB_DATAOBJECT['INI'][$this->_database][$this->__table])) {
require_once 'DB/DataObject/Generator.php';
$x = new DB_DataObject_Generator;
$x->fillTableSchema($this->_database,$this->__table);
}
return true;
}
 
 
 
 
/**
* Return or assign the name of the current table
*
*
* @param string optinal table name to set
* @access public
* @return string The name of the current table
*/
function tableName()
{
$args = func_get_args();
if (count($args)) {
$this->__table = $args[0];
}
return $this->__table;
}
/**
* Return or assign the name of the current database
*
* @param string optional database name to set
* @access public
* @return string The name of the current database
*/
function database()
{
$args = func_get_args();
if (count($args)) {
$this->_database = $args[0];
}
return $this->_database;
}
/**
* get/set an associative array of table columns
*
* @access public
* @param array key=>type array
* @return array (associative)
*/
function table()
{
// for temporary storage of database fields..
// note this is not declared as we dont want to bloat the print_r output
$args = func_get_args();
if (count($args)) {
$this->_database_fields = $args[0];
}
if (isset($this->_database_fields)) {
return $this->_database_fields;
}
global $_DB_DATAOBJECT;
if (!isset($_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5])) {
$this->_connect();
}
if (isset($_DB_DATAOBJECT['INI'][$this->_database][$this->__table])) {
return $_DB_DATAOBJECT['INI'][$this->_database][$this->__table];
}
$this->databaseStructure();
$ret = array();
if (isset($_DB_DATAOBJECT['INI'][$this->_database][$this->__table])) {
$ret = $_DB_DATAOBJECT['INI'][$this->_database][$this->__table];
}
return $ret;
}
 
/**
* get/set an array of table primary keys
*
* set usage: $do->keys('id','code');
*
* This is defined in the table definition if it gets it wrong,
* or you do not want to use ini tables, you can override this.
* @param string optional set the key
* @param * optional set more keys
* @access private
* @return array
*/
function keys()
{
// for temporary storage of database fields..
// note this is not declared as we dont want to bloat the print_r output
$args = func_get_args();
if (count($args)) {
$this->_database_keys = $args;
}
if (isset($this->_database_keys)) {
return $this->_database_keys;
}
global $_DB_DATAOBJECT;
if (!isset($_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5])) {
$this->_connect();
}
if (isset($_DB_DATAOBJECT['INI'][$this->_database][$this->__table."__keys"])) {
return array_keys($_DB_DATAOBJECT['INI'][$this->_database][$this->__table."__keys"]);
}
$this->databaseStructure();
if (isset($_DB_DATAOBJECT['INI'][$this->_database][$this->__table."__keys"])) {
return array_keys($_DB_DATAOBJECT['INI'][$this->_database][$this->__table."__keys"]);
}
return array();
}
/**
* get/set an sequence key
*
* by default it returns the first key from keys()
* set usage: $do->sequenceKey('id',true);
*
* override this to return array(false,false) if table has no real sequence key.
*
* @param string optional the key sequence/autoinc. key
* @param boolean optional use native increment. default false
* @param false|string optional native sequence name
* @access private
* @return array (column,use_native,sequence_name)
*/
function sequenceKey()
{
global $_DB_DATAOBJECT;
// call setting
if (!$this->_database) {
$this->_connect();
}
if (!isset($_DB_DATAOBJECT['SEQUENCE'][$this->_database])) {
$_DB_DATAOBJECT['SEQUENCE'][$this->_database] = array();
}
 
$args = func_get_args();
if (count($args)) {
$args[1] = isset($args[1]) ? $args[1] : false;
$args[2] = isset($args[2]) ? $args[2] : false;
$_DB_DATAOBJECT['SEQUENCE'][$this->_database][$this->__table] = $args;
}
if (isset($_DB_DATAOBJECT['SEQUENCE'][$this->_database][$this->__table])) {
return $_DB_DATAOBJECT['SEQUENCE'][$this->_database][$this->__table];
}
// end call setting (eg. $do->sequenceKeys(a,b,c); )
$keys = $this->keys();
if (!$keys) {
return $_DB_DATAOBJECT['SEQUENCE'][$this->_database][$this->__table]
= array(false,false,false);;
}
 
$table = isset($_DB_DATAOBJECT['INI'][$this->_database][$this->__table]) ?
$_DB_DATAOBJECT['INI'][$this->_database][$this->__table] : $this->table();
$dbtype = $_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]->dsn['phptype'];
$usekey = $keys[0];
$seqname = false;
if (!empty($_DB_DATAOBJECT['CONFIG']['sequence_'.$this->__table])) {
$usekey = $_DB_DATAOBJECT['CONFIG']['sequence_'.$this->__table];
if (strpos($usekey,':') !== false) {
list($usekey,$seqname) = explode(':',$usekey);
}
}
// if the key is not an integer - then it's not a sequence or native
if (!($table[$usekey] & DB_DATAOBJECT_INT)) {
return $_DB_DATAOBJECT['SEQUENCE'][$this->_database][$this->__table] = array(false,false,false);
}
if (!empty($_DB_DATAOBJECT['CONFIG']['ignore_sequence_keys'])) {
$ignore = $_DB_DATAOBJECT['CONFIG']['ignore_sequence_keys'];
if (is_string($ignore) && (strtoupper($ignore) == 'ALL')) {
return $_DB_DATAOBJECT['SEQUENCE'][$this->_database][$this->__table] = array(false,false,$seqname);
}
if (is_string($ignore)) {
$ignore = $_DB_DATAOBJECT['CONFIG']['ignore_sequence_keys'] = explode(',',$ignore);
}
if (in_array($this->__table,$ignore)) {
return $_DB_DATAOBJECT['SEQUENCE'][$this->_database][$this->__table] = array(false,false,$seqname);
}
}
$realkeys = $_DB_DATAOBJECT['INI'][$this->_database][$this->__table."__keys"];
// if you are using an old ini file - go back to old behaviour...
if (is_numeric($realkeys[$usekey])) {
$realkeys[$usekey] = 'N';
}
// multiple unique primary keys without a native sequence...
if (($realkeys[$usekey] == 'K') && (count($keys) > 1)) {
return $_DB_DATAOBJECT['SEQUENCE'][$this->_database][$this->__table] = array(false,false,$seqname);
}
// use native sequence keys...
// technically postgres native here...
// we need to get the new improved tabledata sorted out first.
if ( in_array($dbtype , array( 'mysql', 'mysqli', 'mssql', 'ifx')) &&
($table[$usekey] & DB_DATAOBJECT_INT) &&
isset($realkeys[$usekey]) && ($realkeys[$usekey] == 'N')
) {
return $_DB_DATAOBJECT['SEQUENCE'][$this->_database][$this->__table] = array($usekey,true,$seqname);
}
// if not a native autoinc, and we have not assumed all primary keys are sequence
if (($realkeys[$usekey] != 'N') &&
!empty($_DB_DATAOBJECT['CONFIG']['dont_use_pear_sequences'])) {
return array(false,false,false);
}
// I assume it's going to try and be a nextval DB sequence.. (not native)
return $_DB_DATAOBJECT['SEQUENCE'][$this->_database][$this->__table] = array($usekey,false,$seqname);
}
/* =========================================================== */
/* Major Private Methods - the core part! */
/* =========================================================== */
 
/**
* clear the cache values for this class - normally done on insert/update etc.
*
* @access private
* @return void
*/
function _clear_cache()
{
global $_DB_DATAOBJECT;
$class = get_class($this);
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
$this->debug("Clearing Cache for ".$class,1);
}
if (!empty($_DB_DATAOBJECT['CACHE'][$class])) {
unset($_DB_DATAOBJECT['CACHE'][$class]);
}
}
 
/**
* backend wrapper for quoting, as MDB and DB do it differently...
*
* @access private
* @return string quoted
*/
function _quote($str)
{
global $_DB_DATAOBJECT;
return (empty($_DB_DATAOBJECT['CONFIG']['db_driver']) ||
($_DB_DATAOBJECT['CONFIG']['db_driver'] == 'DB'))
? $_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]->quoteSmart($str)
: $_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]->quote($str);
}
/**
* connects to the database
*
*
* TODO: tidy this up - This has grown to support a number of connection options like
* a) dynamic changing of ini file to change which database to connect to
* b) multi data via the table_{$table} = dsn ini option
* c) session based storage.
*
* @access private
* @return true | PEAR::error
*/
function _connect()
{
global $_DB_DATAOBJECT;
if (empty($_DB_DATAOBJECT['CONFIG'])) {
$this->_loadConfig();
}
 
// is it already connected ?
 
if ($this->_database_dsn_md5 && !empty($_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5])) {
if (PEAR::isError($_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5])) {
return $this->raiseError(
$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]->message,
$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]->code, PEAR_ERROR_DIE
);
}
 
if (!$this->_database) {
$this->_database = $_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]->dsn['database'];
if (($_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]->dsn['phptype'] == 'sqlite')
&& is_file($this->_database))
{
$this->_database = basename($this->_database);
}
}
// theoretically we have a md5, it's listed in connections and it's not an error.
// so everything is ok!
return true;
}
 
// it's not currently connected!
// try and work out what to use for the dsn !
 
$options= &$_DB_DATAOBJECT['CONFIG'];
$dsn = isset($this->_database_dsn) ? $this->_database_dsn : null;
 
if (!$dsn) {
if (!$this->_database) {
$this->_database = isset($options["table_{$this->__table}"]) ? $options["table_{$this->__table}"] : null;
}
if ($this->_database && !empty($options["database_{$this->_database}"])) {
$dsn = $options["database_{$this->_database}"];
} else if (!empty($options['database'])) {
$dsn = $options['database'];
}
}
// if still no database...
if (!$dsn) {
return $this->raiseError(
"No database name / dsn found anywhere",
DB_DATAOBJECT_ERROR_INVALIDCONFIG, PEAR_ERROR_DIE
);
}
 
$this->_database_dsn_md5 = md5($dsn);
 
if (!empty($_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5])) {
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
$this->debug("USING CACHED CONNECTION", "CONNECT",3);
}
if (!$this->_database) {
$this->_database = $_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]->dsn["database"];
if (($_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]->dsn['phptype'] == 'sqlite')
&& is_file($this->_database))
{
$this->_database = basename($this->_database);
}
}
return true;
}
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
$this->debug("NEW CONNECTION", "CONNECT",3);
/* actualy make a connection */
$this->debug("{$dsn} {$this->_database_dsn_md5}", "CONNECT",3);
}
// Note this is verbose deliberatly!
if (!isset($_DB_DATAOBJECT['CONFIG']['db_driver']) ||
($_DB_DATAOBJECT['CONFIG']['db_driver'] == 'DB')) {
/* PEAR DB connect */
// this allows the setings of compatibility on DB
$db_options = PEAR::getStaticProperty('DB','options');
require_once 'DB.php';
if ($db_options) {
$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5] = DB::connect($dsn,$db_options);
} else {
$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5] = DB::connect($dsn);
}
} else {
/* assumption is MDB */
require_once 'MDB2.php';
// this allows the setings of compatibility on MDB2
$db_options = PEAR::getStaticProperty('MDB2','options');
if ($db_options) {
$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5] = MDB2::connect($dsn,$db_options);
} else {
$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5] = MDB2::connect($dsn);
}
}
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
$this->debug(serialize($_DB_DATAOBJECT['CONNECTIONS']), "CONNECT",5);
}
if (PEAR::isError($_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5])) {
$this->debug($_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]->toString(), "CONNECT FAILED",5);
return $this->raiseError(
"Connect failed, turn on debugging to 5 see why",
$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]->code, PEAR_ERROR_DIE
);
 
}
 
if (!$this->_database) {
$this->_database = $_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]->dsn["database"];
if (($_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]->dsn['phptype'] == 'sqlite')
&& is_file($this->_database))
{
$this->_database = basename($this->_database);
}
}
// Oracle need to optimize for portibility - not sure exactly what this does though :)
$c = &$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5];
return true;
}
 
/**
* sends query to database - this is the private one that must work
* - internal functions use this rather than $this->query()
*
* @param string $string
* @access private
* @return mixed none or PEAR_Error
*/
function _query($string)
{
global $_DB_DATAOBJECT;
$this->_connect();
 
$DB = &$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5];
 
$options = &$_DB_DATAOBJECT['CONFIG'];
$_DB_driver = empty($_DB_DATAOBJECT['CONFIG']['db_driver']) ?
'DB': $_DB_DATAOBJECT['CONFIG']['db_driver'];
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
$this->debug($string,$log="QUERY");
}
if (strtoupper($string) == 'BEGIN') {
if ($_DB_driver == 'DB') {
$DB->autoCommit(false);
} else {
$DB->beginTransaction();
}
// db backend adds begin anyway from now on..
return true;
}
if (strtoupper($string) == 'COMMIT') {
$res = $DB->commit();
if ($_DB_driver == 'DB') {
$DB->autoCommit(true);
}
return $res;
}
if (strtoupper($string) == 'ROLLBACK') {
$DB->rollback();
if ($_DB_driver == 'DB') {
$DB->autoCommit(true);
}
return true;
}
 
if (!empty($options['debug_ignore_updates']) &&
(strtolower(substr(trim($string), 0, 6)) != 'select') &&
(strtolower(substr(trim($string), 0, 4)) != 'show') &&
(strtolower(substr(trim($string), 0, 8)) != 'describe')) {
 
$this->debug('Disabling Update as you are in debug mode');
return $this->raiseError("Disabling Update as you are in debug mode", null) ;
 
}
//if (@$_DB_DATAOBJECT['CONFIG']['debug'] > 1) {
// this will only work when PEAR:DB supports it.
//$this->debug($DB->getAll('explain ' .$string,DB_DATAOBJECT_FETCHMODE_ASSOC), $log="sql",2);
//}
// some sim
$t= explode(' ',microtime());
$_DB_DATAOBJECT['QUERYENDTIME'] = $time = $t[0]+$t[1];
$result = $DB->query($string);
 
if (is_a($result,'DB_Error')) {
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
$this->debug($result->toString(), "Query Error",1 );
}
return $this->raiseError($result);
}
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
$t= explode(' ',microtime());
$_DB_DATAOBJECT['QUERYENDTIME'] = $t[0]+$t[1];
$this->debug('QUERY DONE IN '.($t[0]+$t[1]-$time)." seconds", 'query',1);
}
switch (strtolower(substr(trim($string),0,6))) {
case 'insert':
case 'update':
case 'delete':
if ($_DB_driver == 'DB') {
// pear DB specific
return $DB->affectedRows();
}
return $result;
}
if (is_object($result)) {
// lets hope that copying the result object is OK!
$_DB_resultid = $GLOBALS['_DB_DATAOBJECT']['RESULTSEQ']++;
$_DB_DATAOBJECT['RESULTS'][$_DB_resultid] = $result;
$this->_DB_resultid = $_DB_resultid;
}
$this->N = 0;
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
$this->debug(serialize($result), 'RESULT',5);
}
if (method_exists($result, 'numrows')) {
$DB->expectError(DB_ERROR_UNSUPPORTED);
$this->N = $result->numrows();
if (is_a($this->N,'DB_Error')) {
$this->N = true;
}
$DB->popExpect();
}
}
 
/**
* Builds the WHERE based on the values of of this object
*
* @param mixed $keys
* @param array $filter (used by update to only uses keys in this filter list).
* @param array $negative_filter (used by delete to prevent deleting using the keys mentioned..)
* @access private
* @return string
*/
function _build_condition($keys, $filter = array(),$negative_filter=array())
{
global $_DB_DATAOBJECT;
$this->_connect();
$DB = &$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5];
$quoteIdentifiers = !empty($_DB_DATAOBJECT['CONFIG']['quote_identifiers']);
// if we dont have query vars.. - reset them.
if (!isset($this->_query)) {
$x = new DB_DataObject;
$this->_query= $x->_query;
}
 
foreach($keys as $k => $v) {
// index keys is an indexed array
/* these filter checks are a bit suspicious..
- need to check that update really wants to work this way */
 
if ($filter) {
if (!in_array($k, $filter)) {
continue;
}
}
if ($negative_filter) {
if (in_array($k, $negative_filter)) {
continue;
}
}
if (!isset($this->$k)) {
continue;
}
$kSql = $quoteIdentifiers
? ( $DB->quoteIdentifier($this->__table) . '.' . $DB->quoteIdentifier($k) )
: "{$this->__table}.{$k}";
if (is_a($this->$k,'db_dataobject_cast')) {
$dbtype = $DB->dsn["phptype"];
$value = $this->$k->toString($v,$DB);
if (PEAR::isError($value)) {
$this->raiseError($value->getMessage() ,DB_DATAOBJECT_ERROR_INVALIDARG);
return false;
}
if ((strtolower($value) === 'null') && !($v & DB_DATAOBJECT_NOTNULL)) {
$this->whereAdd(" $kSql IS NULL");
continue;
}
$this->whereAdd(" $kSql = $value");
continue;
}
if ((strtolower($this->$k) === 'null') && !($v & DB_DATAOBJECT_NOTNULL)) {
$this->whereAdd(" $kSql IS NULL");
continue;
}
 
if ($v & DB_DATAOBJECT_STR) {
$this->whereAdd(" $kSql = " . $this->_quote((string) (
($v & DB_DATAOBJECT_BOOL) ?
// this is thanks to the braindead idea of postgres to
// use t/f for boolean.
(($this->$k == 'f') ? 0 : (int)(bool) $this->$k) :
$this->$k
)) );
continue;
}
if (is_numeric($this->$k)) {
$this->whereAdd(" $kSql = {$this->$k}");
continue;
}
/* this is probably an error condition! */
$this->whereAdd(" $kSql = ".intval($this->$k));
}
}
 
/**
* autoload Class relating to a table
* (depreciated - use ::factory)
*
* @param string $table table
* @access private
* @return string classname on Success
*/
function staticAutoloadTable($table)
{
global $_DB_DATAOBJECT;
if (empty($_DB_DATAOBJECT['CONFIG'])) {
DB_DataObject::_loadConfig();
}
$p = isset($_DB_DATAOBJECT['CONFIG']['class_prefix']) ?
$_DB_DATAOBJECT['CONFIG']['class_prefix'] : '';
$class = $p . preg_replace('/[^A-Z0-9]/i','_',ucfirst($table));
$class = (class_exists($class)) ? $class : DB_DataObject::_autoloadClass($class);
return $class;
}
/**
* classic factory method for loading a table class
* usage: $do = DB_DataObject::factory('person')
* WARNING - this may emit a include error if the file does not exist..
* use @ to silence it (if you are sure it is acceptable)
* eg. $do = @DB_DataObject::factory('person')
*
* table name will eventually be databasename/table
* - and allow modular dataobjects to be written..
* (this also helps proxy creation)
*
*
* @param string $table tablename (use blank to create a new instance of the same class.)
* @access private
* @return DataObject|PEAR_Error
*/
 
function factory($table = '') {
global $_DB_DATAOBJECT;
if (empty($_DB_DATAOBJECT['CONFIG'])) {
DB_DataObject::_loadConfig();
}
if ($table === '') {
if (is_a($this,'DB_DataObject') && strlen($this->__table)) {
$table = $this->__table;
} else {
return DB_DataObject::raiseError(
"factory did not recieve a table name",
DB_DATAOBJECT_ERROR_INVALIDARGS);
}
}
$p = isset($_DB_DATAOBJECT['CONFIG']['class_prefix']) ?
$_DB_DATAOBJECT['CONFIG']['class_prefix'] : '';
$class = $p . preg_replace('/[^A-Z0-9]/i','_',ucfirst($table));
$class = (class_exists($class)) ? $class : DB_DataObject::_autoloadClass($class);
// proxy = full|light
if (!$class && isset($_DB_DATAOBJECT['CONFIG']['proxy'])) {
$proxyMethod = 'getProxy'.$_DB_DATAOBJECT['CONFIG']['proxy'];
require_once 'DB/DataObject/Generator.php';
$d = new DB_DataObject;
$d->__table = $table;
$d->_connect();
$x = new DB_DataObject_Generator;
return $x->$proxyMethod( $d->_database, $table);
}
if (!$class) {
return DB_DataObject::raiseError(
"factory could not find class $class from $table",
DB_DATAOBJECT_ERROR_INVALIDCONFIG);
}
 
return new $class;
}
/**
* autoload Class
*
* @param string $class Class
* @access private
* @return string classname on Success
*/
function _autoloadClass($class)
{
global $_DB_DATAOBJECT;
if (empty($_DB_DATAOBJECT['CONFIG'])) {
DB_DataObject::_loadConfig();
}
$table = substr($class,strlen($_DB_DATAOBJECT['CONFIG']['class_prefix']));
 
// only include the file if it exists - and barf badly if it has parse errors :)
if (!empty($_DB_DATAOBJECT['CONFIG']['proxy']) && empty($_DB_DATAOBJECT['CONFIG']['class_location'])) {
return false;
}
if (strpos($_DB_DATAOBJECT['CONFIG']['class_location'],'%s') !== false) {
$file = sprintf($_DB_DATAOBJECT['CONFIG']['class_location'], preg_replace('/[^A-Z0-9]/i','_',ucfirst($table)));
} else {
$file = $_DB_DATAOBJECT['CONFIG']['class_location'].'/'.preg_replace('/[^A-Z0-9]/i','_',ucfirst($table)).".php";
}
if (!file_exists($file)) {
$found = false;
foreach(explode(PATH_SEPARATOR, ini_get('include_path')) as $p) {
if (file_exists("$p/$file")) {
$file = "$p/$file";
$found = true;
break;
}
}
if (!$found) {
DB_DataObject::raiseError(
"autoload:Could not find class {$class} using class_location value",
DB_DATAOBJECT_ERROR_INVALIDCONFIG);
return false;
}
}
include_once $file;
if (!class_exists($class)) {
DB_DataObject::raiseError(
"autoload:Could not autoload {$class}",
DB_DATAOBJECT_ERROR_INVALIDCONFIG);
return false;
}
return $class;
}
/**
* Have the links been loaded?
* if they have it contains a array of those variables.
*
* @access private
* @var boolean | array
*/
var $_link_loaded = false;
/**
* Get the links associate array as defined by the links.ini file.
*
*
* Experimental... -
* Should look a bit like
* [local_col_name] => "related_tablename:related_col_name"
*
*
* @return array|null
* array = if there are links defined for this table.
* empty array - if there is a links.ini file, but no links on this table
* null - if no links.ini exists for this database (hence try auto_links).
* @access public
* @see DB_DataObject::getLinks(), DB_DataObject::getLink()
*/
function links()
{
global $_DB_DATAOBJECT;
if (empty($_DB_DATAOBJECT['CONFIG'])) {
$this->_loadConfig();
}
if (isset($_DB_DATAOBJECT['LINKS'][$this->_database][$this->__table])) {
return $_DB_DATAOBJECT['LINKS'][$this->_database][$this->__table];
}
$this->databaseStructure();
// if there is no link data at all on the file!
// we return null.
if (!isset($_DB_DATAOBJECT['LINKS'][$this->_database])) {
return null;
}
if (isset($_DB_DATAOBJECT['LINKS'][$this->_database][$this->__table])) {
return $_DB_DATAOBJECT['LINKS'][$this->_database][$this->__table];
}
return array();
}
/**
* load related objects
*
* There are two ways to use this, one is to set up a <dbname>.links.ini file
* into a static property named <dbname>.links and specifies the table joins,
* the other highly dependent on naming columns 'correctly' :)
* using colname = xxxxx_yyyyyy
* xxxxxx = related table; (yyyyy = user defined..)
* looks up table xxxxx, for value id=$this->xxxxx
* stores it in $this->_xxxxx_yyyyy
* you can change what object vars the links are stored in by
* changeing the format parameter
*
*
* @param string format (default _%s) where %s is the table name.
* @author Tim White <tim@cyface.com>
* @access public
* @return boolean , true on success
*/
function getLinks($format = '_%s')
{
// get table will load the options.
if ($this->_link_loaded) {
return true;
}
$this->_link_loaded = false;
$cols = $this->table();
$links = $this->links();
$loaded = array();
if ($links) {
foreach($links as $key => $match) {
list($table,$link) = explode(':', $match);
$k = sprintf($format, str_replace('.', '_', $key));
// makes sure that '.' is the end of the key;
if ($p = strpos($key,'.')) {
$key = substr($key, 0, $p);
}
$this->$k = $this->getLink($key, $table, $link);
if (is_object($this->$k)) {
$loaded[] = $k;
}
}
$this->_link_loaded = $loaded;
return true;
}
// this is the autonaming stuff..
// it sends the column name down to getLink and lets that sort it out..
// if there is a links file then it is not used!
// IT IS DEPRECIATED!!!! - USE
if (!is_null($links)) {
return false;
}
foreach (array_keys($cols) as $key) {
if (!($p = strpos($key, '_'))) {
continue;
}
// does the table exist.
$k =sprintf($format, $key);
$this->$k = $this->getLink($key);
if (is_object($this->$k)) {
$loaded[] = $k;
}
}
$this->_link_loaded = $loaded;
return true;
}
 
/**
* return name from related object
*
* There are two ways to use this, one is to set up a <dbname>.links.ini file
* into a static property named <dbname>.links and specifies the table joins,
* the other is highly dependant on naming columns 'correctly' :)
*
* NOTE: the naming convention is depreciated!!! - use links.ini
*
* using colname = xxxxx_yyyyyy
* xxxxxx = related table; (yyyyy = user defined..)
* looks up table xxxxx, for value id=$this->xxxxx
* stores it in $this->_xxxxx_yyyyy
*
* you can also use $this->getLink('thisColumnName','otherTable','otherTableColumnName')
*
*
* @param string $row either row or row.xxxxx
* @param string $table name of table to look up value in
* @param string $link name of column in other table to match
* @author Tim White <tim@cyface.com>
* @access public
* @return mixed object on success
*/
function &getLink($row, $table = null, $link = false)
{
// GUESS THE LINKED TABLE.. (if found - recursevly call self)
if ($table === null) {
$links = $this->links();
if (is_array($links)) {
if ($links[$row]) {
list($table,$link) = explode(':', $links[$row]);
if ($p = strpos($row,".")) {
$row = substr($row,0,$p);
}
return $r = &$this->getLink($row,$table,$link);
}
$this->raiseError(
"getLink: $row is not defined as a link (normally this is ok)",
DB_DATAOBJECT_ERROR_NODATA);
return false; // technically a possible error condition?
 
}
// use the old _ method - this shouldnt happen if called via getLinks()
if (!($p = strpos($row, '_'))) {
return null;
}
$table = substr($row, 0, $p);
return $r = &$this->getLink($row, $table);
 
}
if (!isset($this->$row)) {
$this->raiseError("getLink: row not set $row", DB_DATAOBJECT_ERROR_NODATA);
return false;
}
// check to see if we know anything about this table..
$obj = $this->factory($table);
if (!is_a($obj,'DB_DataObject')) {
$this->raiseError(
"getLink:Could not find class for row $row, table $table",
DB_DATAOBJECT_ERROR_INVALIDCONFIG);
return false;
}
if ($link) {
if ($obj->get($link, $this->$row)) {
return $obj;
}
return false;
}
if ($obj->get($this->$row)) {
return $obj;
}
return false;
}
 
/**
* IS THIS SUPPORTED/USED ANYMORE????
*return a list of options for a linked table
*
* This is highly dependant on naming columns 'correctly' :)
* using colname = xxxxx_yyyyyy
* xxxxxx = related table; (yyyyy = user defined..)
* looks up table xxxxx, for value id=$this->xxxxx
* stores it in $this->_xxxxx_yyyyy
*
* @access public
* @return array of results (empty array on failure)
*/
function &getLinkArray($row, $table = null)
{
$ret = array();
if (!$table) {
$links = $this->links();
if (is_array($links)) {
if (!isset($links[$row])) {
// failed..
return $ret;
}
list($table,$link) = explode(':',$links[$row]);
} else {
if (!($p = strpos($row,'_'))) {
return $ret;
}
$table = substr($row,0,$p);
}
}
$c = $this->factory($table);
if (!is_a($c,'DB_DataObject')) {
$this->raiseError(
"getLinkArray:Could not find class for row $row, table $table",
DB_DATAOBJECT_ERROR_INVALIDCONFIG
);
return $ret;
}
 
// if the user defined method list exists - use it...
if (method_exists($c, 'listFind')) {
$c->listFind($this->id);
} else {
$c->find();
}
while ($c->fetch()) {
$ret[] = $c;
}
return $ret;
}
 
/**
* The JOIN condition
*
* @access private
* @var string
*/
var $_join = '';
 
/**
* joinAdd - adds another dataobject to this, building a joined query.
*
* example (requires links.ini to be set up correctly)
* // get all the images for product 24
* $i = new DataObject_Image();
* $pi = new DataObjects_Product_image();
* $pi->product_id = 24; // set the product id to 24
* $i->joinAdd($pi); // add the product_image connectoin
* $i->find();
* while ($i->fetch()) {
* // do stuff
* }
* // an example with 2 joins
* // get all the images linked with products or productgroups
* $i = new DataObject_Image();
* $pi = new DataObject_Product_image();
* $pgi = new DataObject_Productgroup_image();
* $i->joinAdd($pi);
* $i->joinAdd($pgi);
* $i->find();
* while ($i->fetch()) {
* // do stuff
* }
*
*
* @param optional $obj object |array the joining object (no value resets the join)
* If you use an array here it should be in the format:
* array('local_column','remotetable:remote_column');
* if remotetable does not have a definition, you should
* use @ to hide the include error message..
*
*
* @param optional $joinType string 'LEFT'|'INNER'|'RIGHT'|'' Inner is default, '' indicates
* just select ... from a,b,c with no join and
* links are added as where items.
*
* @param optional $joinAs string if you want to select the table as anther name
* useful when you want to select multiple columsn
* from a secondary table.
* @param optional $joinCol string The column on This objects table to match (needed
* if this table links to the child object in
* multiple places eg.
* user->friend (is a link to another user)
* user->mother (is a link to another user..)
*
* @return none
* @access public
* @author Stijn de Reede <sjr@gmx.co.uk>
*/
function joinAdd($obj = false, $joinType='INNER', $joinAs=false, $joinCol=false)
{
global $_DB_DATAOBJECT;
if ($obj === false) {
$this->_join = '';
return;
}
// support for array as first argument
// this assumes that you dont have a links.ini for the specified table.
// and it doesnt exist as am extended dataobject!! - experimental.
$ofield = false; // object field
$tfield = false; // this field
$toTable = false;
if (is_array($obj)) {
$tfield = $obj[0];
list($toTable,$ofield) = explode(':',$obj[1]);
$obj = DB_DataObject::factory($toTable);
if (!$obj || is_a($obj,'PEAR_Error')) {
$obj = new DB_DataObject;
$obj->__table = $toTable;
}
$obj->_connect();
// set the table items to nothing.. - eg. do not try and match
// things in the child table...???
$items = array();
}
if (!is_object($obj)) {
$this->raiseError("joinAdd: called without an object", DB_DATAOBJECT_ERROR_NODATA,PEAR_ERROR_DIE);
}
/* make sure $this->_database is set. */
$this->_connect();
$DB = &$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5];
 
/* look up the links for obj table */
//print_r($obj->links());
if (!$ofield && ($olinks = $obj->links())) {
foreach ($olinks as $k => $v) {
/* link contains {this column} = {linked table}:{linked column} */
$ar = explode(':', $v);
if ($ar[0] == $this->__table) {
// you have explictly specified the column
// and the col is listed here..
// not sure if 1:1 table could cause probs here..
if ($joinCol !== false) {
$this->raiseError(
"joinAdd: You cannot target a join column in the " .
"'link from' table ({$obj->__table}). " .
"Either remove the fourth argument to joinAdd() ".
"({$joinCol}), or alter your links.ini file.",
DB_DATAOBJECT_ERROR_NODATA);
return false;
}
$ofield = $k;
$tfield = $ar[1];
break;
}
}
}
 
/* otherwise see if there are any links from this table to the obj. */
//print_r($this->links());
if (($ofield === false) && ($links = $this->links())) {
foreach ($links as $k => $v) {
/* link contains {this column} = {linked table}:{linked column} */
$ar = explode(':', $v);
if ($ar[0] == $obj->__table) {
if ($joinCol !== false) {
if ($k == $joinCol) {
$tfield = $k;
$ofield = $ar[1];
break;
} else {
continue;
}
} else {
$tfield = $k;
$ofield = $ar[1];
break;
}
}
}
}
/* did I find a conneciton between them? */
 
if ($ofield === false) {
$this->raiseError(
"joinAdd: {$obj->__table} has no link with {$this->__table}",
DB_DATAOBJECT_ERROR_NODATA);
return false;
}
$joinType = strtoupper($joinType);
// we default to joining as the same name (this is remvoed later..)
if ($joinAs === false) {
$joinAs = $obj->__table;
}
$quoteIdentifiers = !empty($_DB_DATAOBJECT['CONFIG']['quote_identifiers']);
// not sure how portable adding database prefixes is..
$objTable = $quoteIdentifiers ?
$DB->quoteIdentifier($obj->__table) :
$obj->__table ;
// as far as we know only mysql supports database prefixes..
if (
in_array($DB->dsn['phptype'],array('mysql','mysqli')) &&
($obj->_database != $this->_database) &&
strlen($obj->_database)
)
{
// prefix database (quoted if neccessary..)
$objTable = ($quoteIdentifiers
? $DB->quoteIdentifier($obj->_database)
: $obj->_database)
. '.' . $objTable;
}
// nested (join of joined objects..)
$appendJoin = '';
if ($obj->_join) {
// postgres allows nested queries, with ()'s
// not sure what the results are with other databases..
// may be unpredictable..
if (in_array($DB->dsn["phptype"],array('pgsql'))) {
$objTable = "($objTable {$obj->_join})";
} else {
$appendJoin = $obj->_join;
}
}
$table = $this->__table;
if ($quoteIdentifiers) {
$joinAs = $DB->quoteIdentifier($joinAs);
$table = $DB->quoteIdentifier($table);
$ofield = $DB->quoteIdentifier($ofield);
$tfield = $DB->quoteIdentifier($tfield);
}
// add database prefix if they are different databases
$fullJoinAs = '';
$addJoinAs = ($quoteIdentifiers ? $DB->quoteIdentifier($obj->__table) : $obj->__table) != $joinAs;
if ($addJoinAs) {
$fullJoinAs = "AS {$joinAs}";
} else {
// if
if (
in_array($DB->dsn['phptype'],array('mysql','mysqli')) &&
($obj->_database != $this->_database) &&
strlen($this->_database)
)
{
$joinAs = ($quoteIdentifiers ? $DB->quoteIdentifier($obj->_database) : $obj->_database) . '.' . $joinAs;
}
}
switch ($joinType) {
case 'INNER':
case 'LEFT':
case 'RIGHT': // others??? .. cross, left outer, right outer, natural..?
$this->_join .= "\n {$joinType} JOIN {$objTable} {$fullJoinAs}".
" ON {$joinAs}.{$ofield}={$table}.{$tfield} {$appendJoin} ";
break;
case '': // this is just a standard multitable select..
$this->_join .= "\n , {$objTable} {$fullJoinAs} {$appendJoin}";
$this->whereAdd("{$joinAs}.{$ofield}={$table}.{$tfield}");
}
// if obj only a dataobject - eg. no extended class has been defined..
// it obvioulsy cant work out what child elements might exist...
// untill we get on the fly querying of tables..
if ( strtolower(get_class($obj)) == 'db_dataobject') {
return true;
}
/* now add where conditions for anything that is set in the object */
$items = $obj->table();
// will return an array if no items..
// only fail if we where expecting it to work (eg. not joined on a array)
if (!$items) {
$this->raiseError(
"joinAdd: No table definition for {$obj->__table}",
DB_DATAOBJECT_ERROR_INVALIDCONFIG);
return false;
}
 
foreach($items as $k => $v) {
if (!isset($obj->$k)) {
continue;
}
$kSql = ($quoteIdentifiers ? $DB->quoteIdentifier($k) : $k);
if ($v & DB_DATAOBJECT_STR) {
$this->whereAdd("{$joinAs}.{$kSql} = " . $this->_quote((string) (
($v & DB_DATAOBJECT_BOOL) ?
// this is thanks to the braindead idea of postgres to
// use t/f for boolean.
(($obj->$k == 'f') ? 0 : (int)(bool) $obj->$k) :
$obj->$k
)));
continue;
}
if (is_numeric($obj->$k)) {
$this->whereAdd("{$joinAs}.{$kSql} = {$obj->$k}");
continue;
}
/* this is probably an error condition! */
$this->whereAdd("{$joinAs}.{$kSql} = 0");
}
if (!isset($this->_query)) {
$this->raiseError(
"joinAdd can not be run from a object that has had a query run on it,
clone the object or create a new one and use setFrom()",
DB_DATAOBJECT_ERROR_INVALIDARGS);
return false;
}
// and finally merge the whereAdd from the child..
if (!$obj->_query['condition']) {
return true;
}
$cond = preg_replace('/^\sWHERE/i','',$obj->_query['condition']);
$this->whereAdd("($cond)");
return true;
 
}
 
/**
* Copies items that are in the table definitions from an
* array or object into the current object
* will not override key values.
*
*
* @param array | object $from
* @param string $format eg. map xxxx_name to $object->name using 'xxxx_%s' (defaults to %s - eg. name -> $object->name
* @access public
* @return true on success or array of key=>setValue error message
*/
function setFrom(&$from, $format = '%s', $checkEmpty=false)
{
global $_DB_DATAOBJECT;
$keys = $this->keys();
$items = $this->table();
if (!$items) {
$this->raiseError(
"setFrom:Could not find table definition for {$this->__table}",
DB_DATAOBJECT_ERROR_INVALIDCONFIG);
return;
}
$overload_return = array();
foreach (array_keys($items) as $k) {
if (in_array($k,$keys)) {
continue; // dont overwrite keys
}
if (!$k) {
continue; // ignore empty keys!!! what
}
if (is_object($from) && isset($from->{sprintf($format,$k)})) {
$kk = (strtolower($k) == 'from') ? '_from' : $k;
if (method_exists($this,'set'.$kk)) {
$ret = $this->{'set'.$kk}($from->{sprintf($format,$k)});
if (is_string($ret)) {
$overload_return[$k] = $ret;
}
continue;
}
$this->$k = $from->{sprintf($format,$k)};
continue;
}
if (is_object($from)) {
continue;
}
if (!isset($from[sprintf($format,$k)])) {
continue;
}
$kk = (strtolower($k) == 'from') ? '_from' : $k;
if (method_exists($this,'set'. $kk)) {
$ret = $this->{'set'.$kk}($from[sprintf($format,$k)]);
if (is_string($ret)) {
$overload_return[$k] = $ret;
}
continue;
}
if (is_object($from[sprintf($format,$k)])) {
continue;
}
if (is_array($from[sprintf($format,$k)])) {
continue;
}
$ret = $this->fromValue($k,$from[sprintf($format,$k)]);
if ($ret !== true) {
$overload_return[$k] = 'Not A Valid Value';
}
//$this->$k = $from[sprintf($format,$k)];
}
if ($overload_return) {
return $overload_return;
}
return true;
}
 
/**
* Returns an associative array from the current data
* (kind of oblivates the idea behind DataObjects, but
* is usefull if you use it with things like QuickForms.
*
* you can use the format to return things like user[key]
* by sending it $object->toArray('user[%s]')
*
* will also return links converted to arrays.
*
* @param string sprintf format for array
* @param bool empty only return elemnts that have a value set.
*
* @access public
* @return array of key => value for row
*/
 
function toArray($format = '%s', $hideEmpty = false)
{
global $_DB_DATAOBJECT;
$ret = array();
$ar = isset($_DB_DATAOBJECT['RESULTFIELDS'][$this->_DB_resultid]) ?
array_merge($_DB_DATAOBJECT['RESULTFIELDS'][$this->_DB_resultid],$this->table()) :
$this->table();
 
foreach($ar as $k=>$v) {
if (!isset($this->$k)) {
if (!$hideEmpty) {
$ret[sprintf($format,$k)] = '';
}
continue;
}
// call the overloaded getXXXX() method. - except getLink and getLinks
if (method_exists($this,'get'.$k) && !in_array(strtolower($k),array('links','link'))) {
$ret[sprintf($format,$k)] = $this->{'get'.$k}();
continue;
}
// should this call toValue() ???
$ret[sprintf($format,$k)] = $this->$k;
}
if (!$this->_link_loaded) {
return $ret;
}
foreach($this->_link_loaded as $k) {
$ret[sprintf($format,$k)] = $this->$k->toArray();
}
return $ret;
}
 
/**
* validate - override this to set up your validation rules
*
* validate the current objects values either just testing strings/numbers or
* using the user defined validate{Row name}() methods.
* will attempt to call $this->validate{column_name}() - expects true = ok false = ERROR
* you can the use the validate Class from your own methods.
*
* This should really be in a extenal class - eg. DB_DataObject_Validate.
*
* @access public
* @return array of validation results or true
*/
function validate()
{
require_once 'Validate.php';
$table = $this->table();
$ret = array();
$seq = $this->sequenceKey();
foreach($table as $key => $val) {
// call user defined validation always...
$method = "Validate" . ucfirst($key);
if (method_exists($this, $method)) {
$ret[$key] = $this->$method();
continue;
}
// if not null - and it's not set.......
if (!isset($this->$key) && ($val & DB_DATAOBJECT_NOTNULL)) {
// dont check empty sequence key values..
if (($key == $seq[0]) && ($seq[1] == true)) {
continue;
}
$ret[$key] = false;
continue;
}
if (is_string($this->$key) && (strtolower($this->$key) == 'null') && ($val & DB_DATAOBJECT_NOTNULL)) {
$ret[$key] = false;
continue;
}
// ignore things that are not set. ?
if (!isset($this->$key)) {
continue;
}
// if the string is empty.. assume it is ok..
if (!is_object($this->$key) && !is_array($this->$key) && !strlen((string) $this->$key)) {
continue;
}
switch (true) {
// todo: date time.....
case ($val & DB_DATAOBJECT_STR):
$ret[$key] = Validate::string($this->$key, VALIDATE_PUNCTUATION . VALIDATE_NAME);
continue;
case ($val & DB_DATAOBJECT_INT):
$ret[$key] = Validate::number($this->$key, array('decimal'=>'.'));
continue;
}
}
 
foreach ($ret as $key => $val) {
if ($val === false) {
return $ret;
}
}
return true; // everything is OK.
}
 
/**
* Gets the DB object related to an object - so you can use funky peardb stuf with it :)
*
* @access public
* @return object The DB connection
*/
function &getDatabaseConnection()
{
global $_DB_DATAOBJECT;
 
if (($e = $this->_connect()) !== true) {
return $e;
}
if (!isset($_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5])) {
return false;
}
return $_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5];
}
/**
* Gets the DB result object related to the objects active query
* - so you can use funky pear stuff with it - like pager for example.. :)
*
* @access public
* @return object The DB result object
*/
function &getDatabaseResult()
{
global $_DB_DATAOBJECT;
$this->_connect();
if (!isset($_DB_DATAOBJECT['RESULTS'][$this->_DB_resultid])) {
return false;
}
return $_DB_DATAOBJECT['RESULTS'][$this->_DB_resultid];
}
 
/**
* Overload Extension support
* - enables setCOLNAME/getCOLNAME
* if you define a set/get method for the item it will be called.
* otherwise it will just return/set the value.
* NOTE this currently means that a few Names are NO-NO's
* eg. links,link,linksarray, from, Databaseconnection,databaseresult
*
* note
* - set is automatically called by setFrom.
* - get is automatically called by toArray()
*
* setters return true on success. = strings on failure
* getters return the value!
*
* this fires off trigger_error - if any problems.. pear_error,
* has problems with 4.3.2RC2 here
*
* @access public
* @return true?
* @see overload
*/
 
function _call($method,$params,&$return) {
//$this->debug("ATTEMPTING OVERLOAD? $method");
// ignore constructors : - mm
if (strtolower($method) == strtolower(get_class($this))) {
return true;
}
$type = strtolower(substr($method,0,3));
$class = get_class($this);
if (($type != 'set') && ($type != 'get')) {
return false;
}
// deal with naming conflick of setFrom = this is messy ATM!
if (strtolower($method) == 'set_from') {
$return = $this->toValue('from',isset($params[0]) ? $params[0] : null);
return true;
}
$element = substr($method,3);
// dont you just love php's case insensitivity!!!!
$array = array_keys(get_class_vars($class));
/* php5 version which segfaults on 5.0.3 */
if (class_exists('ReflectionClass')) {
$reflection = new ReflectionClass($class);
$array = array_keys($reflection->getdefaultProperties());
}
if (!in_array($element,$array)) {
// munge case
foreach($array as $k) {
$case[strtolower($k)] = $k;
}
if ((substr(phpversion(),0,1) == 5) && isset($case[strtolower($element)])) {
trigger_error("PHP5 set/get calls should match the case of the variable",E_USER_WARNING);
$element = strtolower($element);
}
// does it really exist?
if (!isset($case[$element])) {
return false;
}
// use the mundged case
$element = $case[$element]; // real case !
}
if ($type == 'get') {
$return = $this->toValue($element,isset($params[0]) ? $params[0] : null);
return true;
}
$return = $this->fromValue($element, $params[0]);
return true;
}
/**
* standard set* implementation.
*
* takes data and uses it to set dates/strings etc.
* normally called from __call..
*
* Current supports
* date = using (standard time format, or unixtimestamp).... so you could create a method :
* function setLastread($string) { $this->fromValue('lastread',strtotime($string)); }
*
* time = using strtotime
* datetime = using same as date - accepts iso standard or unixtimestamp.
* string = typecast only..
*
* TODO: add formater:: eg. d/m/Y for date! ???
*
* @param string column of database
* @param mixed value to assign
*
* @return true| false (False on error)
* @access public
* @see DB_DataObject::_call
*/
function fromValue($col,$value)
{
$cols = $this->table();
// dont know anything about this col..
if (!isset($cols[$col])) {
$this->$col = $value;
return true;
}
//echo "FROM VALUE $col, {$cols[$col]}, $value\n";
switch (true) {
// set to null and column is can be null...
case ((strtolower($value) == 'null') && (!($cols[$col] & DB_DATAOBJECT_NOTNULL))):
case (is_object($value) && is_a($value,'DB_DataObject_Cast')):
$this->$col = $value;
return true;
// fail on setting null on a not null field..
case ((strtolower($value) == 'null') && ($cols[$col] & DB_DATAOBJECT_NOTNULL)):
return false;
case (($cols[$col] & DB_DATAOBJECT_DATE) && ($cols[$col] & DB_DATAOBJECT_TIME)):
// empty values get set to '' (which is inserted/updated as NULl
if (!$value) {
$this->$col = '';
}
if (is_numeric($value)) {
$this->$col = date('Y-m-d H:i:s', $value);
return true;
}
// eak... - no way to validate date time otherwise...
$this->$col = (string) $value;
return true;
case ($cols[$col] & DB_DATAOBJECT_DATE):
// empty values get set to '' (which is inserted/updated as NULl
if (!$value) {
$this->$col = '';
return true;
}
if (is_numeric($value)) {
$this->$col = date('Y-m-d',$value);
return true;
}
// try date!!!!
require_once 'Date.php';
$x = new Date($value);
$this->$col = $x->format("%Y-%m-%d");
return true;
case ($cols[$col] & DB_DATAOBJECT_TIME):
// empty values get set to '' (which is inserted/updated as NULl
if (!$value) {
$this->$col = '';
}
$guess = strtotime($value);
if ($guess != -1) {
$this->$col = date('H:i:s', $guess);
return $return = true;
}
// otherwise an error in type...
return false;
case ($cols[$col] & DB_DATAOBJECT_STR):
$this->$col = (string) $value;
return true;
// todo : floats numerics and ints...
default:
$this->$col = $value;
return true;
}
}
/**
* standard get* implementation.
*
* with formaters..
* supported formaters:
* date/time : %d/%m/%Y (eg. php strftime) or pear::Date
* numbers : %02d (eg. sprintf)
* NOTE you will get unexpected results with times like 0000-00-00 !!!
*
*
*
* @param string column of database
* @param format foramt
*
* @return true Description
* @access public
* @see DB_DataObject::_call(),strftime(),Date::format()
*/
function toValue($col,$format = null)
{
if (is_null($format)) {
return $this->$col;
}
$cols = $this->table();
switch (true) {
case (($cols[$col] & DB_DATAOBJECT_DATE) && ($cols[$col] & DB_DATAOBJECT_TIME)):
if (!$this->$col) {
return '';
}
$guess = strtotime($this->$col);
if ($guess != -1) {
return strftime($format, $guess);
}
// eak... - no way to validate date time otherwise...
return $this->$col;
case ($cols[$col] & DB_DATAOBJECT_DATE):
if (!$this->$col) {
return '';
}
$guess = strtotime($this->$col);
if ($guess != -1) {
return strftime($format,$guess);
}
// try date!!!!
require_once 'Date.php';
$x = new Date($this->$col);
return $x->format($format);
case ($cols[$col] & DB_DATAOBJECT_TIME):
if (!$this->$col) {
return '';
}
$guess = strtotime($this->$col);
if ($guess > -1) {
return strftime($format, $guess);
}
// otherwise an error in type...
return $this->$col;
case ($cols[$col] & DB_DATAOBJECT_MYSQLTIMESTAMP):
if (!$this->$col) {
return '';
}
require_once 'Date.php';
$x = new Date($this->$col);
return $x->format($format);
case ($cols[$col] & DB_DATAOBJECT_BOOLEAN):
if ($cols[$col] & DB_DATAOBJECT_STR) {
// it's a 't'/'f' !
return ($cols[$col] == 't');
}
return (bool) $cols[$col];
default:
return sprintf($format,$this->col);
}
 
}
/* ----------------------- Debugger ------------------ */
 
/**
* Debugger. - use this in your extended classes to output debugging information.
*
* Uses DB_DataObject::DebugLevel(x) to turn it on
*
* @param string $message - message to output
* @param string $logtype - bold at start
* @param string $level - output level
* @access public
* @return none
*/
function debug($message, $logtype = 0, $level = 1)
{
global $_DB_DATAOBJECT;
 
if (empty($_DB_DATAOBJECT['CONFIG']['debug']) ||
(is_numeric($_DB_DATAOBJECT['CONFIG']['debug']) && $_DB_DATAOBJECT['CONFIG']['debug'] < $level)) {
return;
}
// this is a bit flaky due to php's wonderfull class passing around crap..
// but it's about as good as it gets..
$class = (isset($this) && is_a($this,'DB_DataObject')) ? get_class($this) : 'DB_DataObject';
if (!is_string($message)) {
$message = print_r($message,true);
}
if (!is_numeric( $_DB_DATAOBJECT['CONFIG']['debug']) && is_callable( $_DB_DATAOBJECT['CONFIG']['debug'])) {
return call_user_func($_DB_DATAOBJECT['CONFIG']['debug'], $class, $message, $logtype, $level);
}
if (!ini_get('html_errors')) {
echo "$class : $logtype : $message\n";
flush();
return;
}
if (!is_string($message)) {
$message = print_r($message,true);
}
echo "<code><B>$class: $logtype:</B> $message</code><BR>\n";
flush();
}
 
/**
* sets and returns debug level
* eg. DB_DataObject::debugLevel(4);
*
* @param int $v level
* @access public
* @return none
*/
function debugLevel($v = null)
{
global $_DB_DATAOBJECT;
if (empty($_DB_DATAOBJECT['CONFIG'])) {
DB_DataObject::_loadConfig();
}
if ($v !== null) {
$r = isset($_DB_DATAOBJECT['CONFIG']['debug']) ? $_DB_DATAOBJECT['CONFIG']['debug'] : 0;
$_DB_DATAOBJECT['CONFIG']['debug'] = $v;
return $r;
}
return isset($_DB_DATAOBJECT['CONFIG']['debug']) ? $_DB_DATAOBJECT['CONFIG']['debug'] : 0;
}
 
/**
* Last Error that has occured
* - use $this->_lastError or
* $last_error = &PEAR::getStaticProperty('DB_DataObject','lastError');
*
* @access public
* @var object PEAR_Error (or false)
*/
var $_lastError = false;
 
/**
* Default error handling is to create a pear error, but never return it.
* if you need to handle errors you should look at setting the PEAR_Error callback
* this is due to the fact it would wreck havoc on the internal methods!
*
* @param int $message message
* @param int $type type
* @param int $behaviour behaviour (die or continue!);
* @access public
* @return error object
*/
function raiseError($message, $type = null, $behaviour = null)
{
global $_DB_DATAOBJECT;
if ($behaviour == PEAR_ERROR_DIE && !empty($_DB_DATAOBJECT['CONFIG']['dont_die'])) {
$behaviour = null;
}
$error = &PEAR::getStaticProperty('DB_DataObject','lastError');
if (PEAR::isError($message)) {
$error = $message;
} else {
require_once 'DB/DataObject/Error.php';
$error = PEAR::raiseError($message, $type, $behaviour,
$opts=null, $userinfo=null, 'DB_DataObject_Error'
);
}
// this will never work totally with PHP's object model.
// as this is passed on static calls (like staticGet in our case)
 
if (isset($this) && is_object($this) && is_subclass_of($this,'db_dataobject')) {
$this->_lastError = $error;
}
 
$_DB_DATAOBJECT['LASTERROR'] = $error;
 
// no checks for production here?.......
DB_DataObject::debug($message,"ERROR",1);
return $error;
}
 
/**
* Define the global $_DB_DATAOBJECT['CONFIG'] as an alias to PEAR::getStaticProperty('DB_DataObject','options');
*
* After Profiling DB_DataObject, I discoved that the debug calls where taking
* considerable time (well 0.1 ms), so this should stop those calls happening. as
* all calls to debug are wrapped with direct variable queries rather than actually calling the funciton
* THIS STILL NEEDS FURTHER INVESTIGATION
*
* @access public
* @return object an error object
*/
function _loadConfig()
{
global $_DB_DATAOBJECT;
 
$_DB_DATAOBJECT['CONFIG'] = &PEAR::getStaticProperty('DB_DataObject','options');
 
 
}
/**
* Free global arrays associated with this object.
*
* Note: as we now store resultfields in a global, it is never freed, if you do alot of calls to find(),
* memory will grow gradually.
*
*
* @access public
* @return none
*/
function free()
{
global $_DB_DATAOBJECT;
if (isset($_DB_DATAOBJECT['RESULTFIELDS'][$this->_DB_resultid])) {
unset($_DB_DATAOBJECT['RESULTFIELDS'][$this->_DB_resultid]);
}
if (isset($_DB_DATAOBJECT['RESULTS'][$this->_DB_resultid])) {
unset($_DB_DATAOBJECT['RESULTS'][$this->_DB_resultid]);
}
// this is a huge bug in DB!
if (isset($_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5])) {
$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]->num_rows = array();
}
}
/* ---- LEGACY BC METHODS - NOT DOCUMENTED - See Documentation on New Methods. ---*/
function _get_table() { return $this->table(); }
function _get_keys() { return $this->keys(); }
}
// technially 4.3.2RC1 was broken!!
// looks like 4.3.3 may have problems too....
if (!defined('DB_DATAOBJECT_NO_OVERLOAD')) {
 
if ((phpversion() != '4.3.2-RC1') && (version_compare( phpversion(), "4.3.1") > 0)) {
if (version_compare( phpversion(), "5") < 0) {
overload('DB_DataObject');
}
$GLOBALS['_DB_DATAOBJECT']['OVERLOADED'] = true;
}
}
 
/tags/Racine_livraison_narmer/api/pear/DB/sqlite.php
New file
0,0 → 1,942
<?php
 
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 
/**
* The PEAR DB driver for PHP's sqlite extension
* for interacting with SQLite databases
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Database
* @package DB
* @author Urs Gehrig <urs@circle.ch>
* @author Mika Tuupola <tuupola@appelsiini.net>
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0 3.0
* @version CVS: $Id: sqlite.php,v 1.3 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/DB
*/
 
/**
* Obtain the DB_common class so it can be extended from
*/
require_once 'DB/common.php';
 
/**
* The methods PEAR DB uses to interact with PHP's sqlite extension
* for interacting with SQLite databases
*
* These methods overload the ones declared in DB_common.
*
* NOTICE: This driver needs PHP's track_errors ini setting to be on.
* It is automatically turned on when connecting to the database.
* Make sure your scripts don't turn it off.
*
* @category Database
* @package DB
* @author Urs Gehrig <urs@circle.ch>
* @author Mika Tuupola <tuupola@appelsiini.net>
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0 3.0
* @version Release: 1.7.6
* @link http://pear.php.net/package/DB
*/
class DB_sqlite extends DB_common
{
// {{{ properties
 
/**
* The DB driver type (mysql, oci8, odbc, etc.)
* @var string
*/
var $phptype = 'sqlite';
 
/**
* The database syntax variant to be used (db2, access, etc.), if any
* @var string
*/
var $dbsyntax = 'sqlite';
 
/**
* The capabilities of this DB implementation
*
* The 'new_link' element contains the PHP version that first provided
* new_link support for this DBMS. Contains false if it's unsupported.
*
* Meaning of the 'limit' element:
* + 'emulate' = emulate with fetch row by number
* + 'alter' = alter the query
* + false = skip rows
*
* @var array
*/
var $features = array(
'limit' => 'alter',
'new_link' => false,
'numrows' => true,
'pconnect' => true,
'prepare' => false,
'ssl' => false,
'transactions' => false,
);
 
/**
* A mapping of native error codes to DB error codes
*
* {@internal Error codes according to sqlite_exec. See the online
* manual at http://sqlite.org/c_interface.html for info.
* This error handling based on sqlite_exec is not yet implemented.}}
*
* @var array
*/
var $errorcode_map = array(
);
 
/**
* The raw database connection created by PHP
* @var resource
*/
var $connection;
 
/**
* The DSN information for connecting to a database
* @var array
*/
var $dsn = array();
 
 
/**
* SQLite data types
*
* @link http://www.sqlite.org/datatypes.html
*
* @var array
*/
var $keywords = array (
'BLOB' => '',
'BOOLEAN' => '',
'CHARACTER' => '',
'CLOB' => '',
'FLOAT' => '',
'INTEGER' => '',
'KEY' => '',
'NATIONAL' => '',
'NUMERIC' => '',
'NVARCHAR' => '',
'PRIMARY' => '',
'TEXT' => '',
'TIMESTAMP' => '',
'UNIQUE' => '',
'VARCHAR' => '',
'VARYING' => '',
);
 
/**
* The most recent error message from $php_errormsg
* @var string
* @access private
*/
var $_lasterror = '';
 
 
// }}}
// {{{ constructor
 
/**
* This constructor calls <kbd>$this->DB_common()</kbd>
*
* @return void
*/
function DB_sqlite()
{
$this->DB_common();
}
 
// }}}
// {{{ connect()
 
/**
* Connect to the database server, log in and open the database
*
* Don't call this method directly. Use DB::connect() instead.
*
* PEAR DB's sqlite driver supports the following extra DSN options:
* + mode The permissions for the database file, in four digit
* chmod octal format (eg "0600").
*
* Example of connecting to a database in read-only mode:
* <code>
* require_once 'DB.php';
*
* $dsn = 'sqlite:///path/and/name/of/db/file?mode=0400';
* $options = array(
* 'portability' => DB_PORTABILITY_ALL,
* );
*
* $db =& DB::connect($dsn, $options);
* if (PEAR::isError($db)) {
* die($db->getMessage());
* }
* </code>
*
* @param array $dsn the data source name
* @param bool $persistent should the connection be persistent?
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function connect($dsn, $persistent = false)
{
if (!PEAR::loadExtension('sqlite')) {
return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
}
 
$this->dsn = $dsn;
if ($dsn['dbsyntax']) {
$this->dbsyntax = $dsn['dbsyntax'];
}
 
if ($dsn['database']) {
if (!file_exists($dsn['database'])) {
if (!touch($dsn['database'])) {
return $this->sqliteRaiseError(DB_ERROR_NOT_FOUND);
}
if (!isset($dsn['mode']) ||
!is_numeric($dsn['mode']))
{
$mode = 0644;
} else {
$mode = octdec($dsn['mode']);
}
if (!chmod($dsn['database'], $mode)) {
return $this->sqliteRaiseError(DB_ERROR_NOT_FOUND);
}
if (!file_exists($dsn['database'])) {
return $this->sqliteRaiseError(DB_ERROR_NOT_FOUND);
}
}
if (!is_file($dsn['database'])) {
return $this->sqliteRaiseError(DB_ERROR_INVALID);
}
if (!is_readable($dsn['database'])) {
return $this->sqliteRaiseError(DB_ERROR_ACCESS_VIOLATION);
}
} else {
return $this->sqliteRaiseError(DB_ERROR_ACCESS_VIOLATION);
}
 
$connect_function = $persistent ? 'sqlite_popen' : 'sqlite_open';
 
// track_errors must remain on for simpleQuery()
ini_set('track_errors', 1);
$php_errormsg = '';
 
if (!$this->connection = @$connect_function($dsn['database'])) {
return $this->raiseError(DB_ERROR_NODBSELECTED,
null, null, null,
$php_errormsg);
}
return DB_OK;
}
 
// }}}
// {{{ disconnect()
 
/**
* Disconnects from the database server
*
* @return bool TRUE on success, FALSE on failure
*/
function disconnect()
{
$ret = @sqlite_close($this->connection);
$this->connection = null;
return $ret;
}
 
// }}}
// {{{ simpleQuery()
 
/**
* Sends a query to the database server
*
* NOTICE: This method needs PHP's track_errors ini setting to be on.
* It is automatically turned on when connecting to the database.
* Make sure your scripts don't turn it off.
*
* @param string the SQL query string
*
* @return mixed + a PHP result resrouce for successful SELECT queries
* + the DB_OK constant for other successful queries
* + a DB_Error object on failure
*/
function simpleQuery($query)
{
$ismanip = DB::isManip($query);
$this->last_query = $query;
$query = $this->modifyQuery($query);
 
$php_errormsg = '';
 
$result = @sqlite_query($query, $this->connection);
$this->_lasterror = $php_errormsg ? $php_errormsg : '';
 
$this->result = $result;
if (!$this->result) {
return $this->sqliteRaiseError(null);
}
 
// sqlite_query() seems to allways return a resource
// so cant use that. Using $ismanip instead
if (!$ismanip) {
$numRows = $this->numRows($result);
if (is_object($numRows)) {
// we've got PEAR_Error
return $numRows;
}
return $result;
}
return DB_OK;
}
 
// }}}
// {{{ nextResult()
 
/**
* Move the internal sqlite result pointer to the next available result
*
* @param resource $result the valid sqlite result resource
*
* @return bool true if a result is available otherwise return false
*/
function nextResult($result)
{
return false;
}
 
// }}}
// {{{ fetchInto()
 
/**
* Places a row from the result set into the given array
*
* Formating of the array and the data therein are configurable.
* See DB_result::fetchInto() for more information.
*
* This method is not meant to be called directly. Use
* DB_result::fetchInto() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result the query result resource
* @param array $arr the referenced array to put the data in
* @param int $fetchmode how the resulting array should be indexed
* @param int $rownum the row number to fetch (0 = first row)
*
* @return mixed DB_OK on success, NULL when the end of a result set is
* reached or on failure
*
* @see DB_result::fetchInto()
*/
function fetchInto($result, &$arr, $fetchmode, $rownum = null)
{
if ($rownum !== null) {
if (!@sqlite_seek($this->result, $rownum)) {
return null;
}
}
if ($fetchmode & DB_FETCHMODE_ASSOC) {
$arr = @sqlite_fetch_array($result, SQLITE_ASSOC);
if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) {
$arr = array_change_key_case($arr, CASE_LOWER);
}
} else {
$arr = @sqlite_fetch_array($result, SQLITE_NUM);
}
if (!$arr) {
return null;
}
if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
/*
* Even though this DBMS already trims output, we do this because
* a field might have intentional whitespace at the end that
* gets removed by DB_PORTABILITY_RTRIM under another driver.
*/
$this->_rtrimArrayValues($arr);
}
if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
$this->_convertNullArrayValuesToEmpty($arr);
}
return DB_OK;
}
 
// }}}
// {{{ freeResult()
 
/**
* Deletes the result set and frees the memory occupied by the result set
*
* This method is not meant to be called directly. Use
* DB_result::free() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return bool TRUE on success, FALSE if $result is invalid
*
* @see DB_result::free()
*/
function freeResult(&$result)
{
// XXX No native free?
if (!is_resource($result)) {
return false;
}
$result = null;
return true;
}
 
// }}}
// {{{ numCols()
 
/**
* Gets the number of columns in a result set
*
* This method is not meant to be called directly. Use
* DB_result::numCols() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return int the number of columns. A DB_Error object on failure.
*
* @see DB_result::numCols()
*/
function numCols($result)
{
$cols = @sqlite_num_fields($result);
if (!$cols) {
return $this->sqliteRaiseError();
}
return $cols;
}
 
// }}}
// {{{ numRows()
 
/**
* Gets the number of rows in a result set
*
* This method is not meant to be called directly. Use
* DB_result::numRows() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return int the number of rows. A DB_Error object on failure.
*
* @see DB_result::numRows()
*/
function numRows($result)
{
$rows = @sqlite_num_rows($result);
if ($rows === null) {
return $this->sqliteRaiseError();
}
return $rows;
}
 
// }}}
// {{{ affected()
 
/**
* Determines the number of rows affected by a data maniuplation query
*
* 0 is returned for queries that don't manipulate data.
*
* @return int the number of rows. A DB_Error object on failure.
*/
function affectedRows()
{
return @sqlite_changes($this->connection);
}
 
// }}}
// {{{ dropSequence()
 
/**
* Deletes a sequence
*
* @param string $seq_name name of the sequence to be deleted
*
* @return int DB_OK on success. A DB_Error object on failure.
*
* @see DB_common::dropSequence(), DB_common::getSequenceName(),
* DB_sqlite::nextID(), DB_sqlite::createSequence()
*/
function dropSequence($seq_name)
{
return $this->query('DROP TABLE ' . $this->getSequenceName($seq_name));
}
 
/**
* Creates a new sequence
*
* @param string $seq_name name of the new sequence
*
* @return int DB_OK on success. A DB_Error object on failure.
*
* @see DB_common::createSequence(), DB_common::getSequenceName(),
* DB_sqlite::nextID(), DB_sqlite::dropSequence()
*/
function createSequence($seq_name)
{
$seqname = $this->getSequenceName($seq_name);
$query = 'CREATE TABLE ' . $seqname .
' (id INTEGER UNSIGNED PRIMARY KEY) ';
$result = $this->query($query);
if (DB::isError($result)) {
return($result);
}
$query = "CREATE TRIGGER ${seqname}_cleanup AFTER INSERT ON $seqname
BEGIN
DELETE FROM $seqname WHERE id<LAST_INSERT_ROWID();
END ";
$result = $this->query($query);
if (DB::isError($result)) {
return($result);
}
}
 
// }}}
// {{{ nextId()
 
/**
* Returns the next free id in a sequence
*
* @param string $seq_name name of the sequence
* @param boolean $ondemand when true, the seqence is automatically
* created if it does not exist
*
* @return int the next id number in the sequence.
* A DB_Error object on failure.
*
* @see DB_common::nextID(), DB_common::getSequenceName(),
* DB_sqlite::createSequence(), DB_sqlite::dropSequence()
*/
function nextId($seq_name, $ondemand = true)
{
$seqname = $this->getSequenceName($seq_name);
 
do {
$repeat = 0;
$this->pushErrorHandling(PEAR_ERROR_RETURN);
$result = $this->query("INSERT INTO $seqname (id) VALUES (NULL)");
$this->popErrorHandling();
if ($result === DB_OK) {
$id = @sqlite_last_insert_rowid($this->connection);
if ($id != 0) {
return $id;
}
} elseif ($ondemand && DB::isError($result) &&
$result->getCode() == DB_ERROR_NOSUCHTABLE)
{
$result = $this->createSequence($seq_name);
if (DB::isError($result)) {
return $this->raiseError($result);
} else {
$repeat = 1;
}
}
} while ($repeat);
 
return $this->raiseError($result);
}
 
// }}}
// {{{ getDbFileStats()
 
/**
* Get the file stats for the current database
*
* Possible arguments are dev, ino, mode, nlink, uid, gid, rdev, size,
* atime, mtime, ctime, blksize, blocks or a numeric key between
* 0 and 12.
*
* @param string $arg the array key for stats()
*
* @return mixed an array on an unspecified key, integer on a passed
* arg and false at a stats error
*/
function getDbFileStats($arg = '')
{
$stats = stat($this->dsn['database']);
if ($stats == false) {
return false;
}
if (is_array($stats)) {
if (is_numeric($arg)) {
if (((int)$arg <= 12) & ((int)$arg >= 0)) {
return false;
}
return $stats[$arg ];
}
if (array_key_exists(trim($arg), $stats)) {
return $stats[$arg ];
}
}
return $stats;
}
 
// }}}
// {{{ escapeSimple()
 
/**
* Escapes a string according to the current DBMS's standards
*
* In SQLite, this makes things safe for inserts/updates, but may
* cause problems when performing text comparisons against columns
* containing binary data. See the
* {@link http://php.net/sqlite_escape_string PHP manual} for more info.
*
* @param string $str the string to be escaped
*
* @return string the escaped string
*
* @since Method available since Release 1.6.1
* @see DB_common::escapeSimple()
*/
function escapeSimple($str)
{
return @sqlite_escape_string($str);
}
 
// }}}
// {{{ modifyLimitQuery()
 
/**
* Adds LIMIT clauses to a query string according to current DBMS standards
*
* @param string $query the query to modify
* @param int $from the row to start to fetching (0 = the first row)
* @param int $count the numbers of rows to fetch
* @param mixed $params array, string or numeric data to be used in
* execution of the statement. Quantity of items
* passed must match quantity of placeholders in
* query: meaning 1 placeholder for non-array
* parameters or 1 placeholder per array element.
*
* @return string the query string with LIMIT clauses added
*
* @access protected
*/
function modifyLimitQuery($query, $from, $count, $params = array())
{
return "$query LIMIT $count OFFSET $from";
}
 
// }}}
// {{{ modifyQuery()
 
/**
* Changes a query string for various DBMS specific reasons
*
* This little hack lets you know how many rows were deleted
* when running a "DELETE FROM table" query. Only implemented
* if the DB_PORTABILITY_DELETE_COUNT portability option is on.
*
* @param string $query the query string to modify
*
* @return string the modified query string
*
* @access protected
* @see DB_common::setOption()
*/
function modifyQuery($query)
{
if ($this->options['portability'] & DB_PORTABILITY_DELETE_COUNT) {
if (preg_match('/^\s*DELETE\s+FROM\s+(\S+)\s*$/i', $query)) {
$query = preg_replace('/^\s*DELETE\s+FROM\s+(\S+)\s*$/',
'DELETE FROM \1 WHERE 1=1', $query);
}
}
return $query;
}
 
// }}}
// {{{ sqliteRaiseError()
 
/**
* Produces a DB_Error object regarding the current problem
*
* @param int $errno if the error is being manually raised pass a
* DB_ERROR* constant here. If this isn't passed
* the error information gathered from the DBMS.
*
* @return object the DB_Error object
*
* @see DB_common::raiseError(),
* DB_sqlite::errorNative(), DB_sqlite::errorCode()
*/
function sqliteRaiseError($errno = null)
{
$native = $this->errorNative();
if ($errno === null) {
$errno = $this->errorCode($native);
}
 
$errorcode = @sqlite_last_error($this->connection);
$userinfo = "$errorcode ** $this->last_query";
 
return $this->raiseError($errno, null, null, $userinfo, $native);
}
 
// }}}
// {{{ errorNative()
 
/**
* Gets the DBMS' native error message produced by the last query
*
* {@internal This is used to retrieve more meaningfull error messages
* because sqlite_last_error() does not provide adequate info.}}
*
* @return string the DBMS' error message
*/
function errorNative()
{
return $this->_lasterror;
}
 
// }}}
// {{{ errorCode()
 
/**
* Determines PEAR::DB error code from the database's text error message
*
* @param string $errormsg the error message returned from the database
*
* @return integer the DB error number
*/
function errorCode($errormsg)
{
static $error_regexps;
if (!isset($error_regexps)) {
$error_regexps = array(
'/^no such table:/' => DB_ERROR_NOSUCHTABLE,
'/^no such index:/' => DB_ERROR_NOT_FOUND,
'/^(table|index) .* already exists$/' => DB_ERROR_ALREADY_EXISTS,
'/PRIMARY KEY must be unique/i' => DB_ERROR_CONSTRAINT,
'/is not unique/' => DB_ERROR_CONSTRAINT,
'/columns .* are not unique/i' => DB_ERROR_CONSTRAINT,
'/uniqueness constraint failed/' => DB_ERROR_CONSTRAINT,
'/may not be NULL/' => DB_ERROR_CONSTRAINT_NOT_NULL,
'/^no such column:/' => DB_ERROR_NOSUCHFIELD,
'/column not present in both tables/i' => DB_ERROR_NOSUCHFIELD,
'/^near ".*": syntax error$/' => DB_ERROR_SYNTAX,
'/[0-9]+ values for [0-9]+ columns/i' => DB_ERROR_VALUE_COUNT_ON_ROW,
);
}
foreach ($error_regexps as $regexp => $code) {
if (preg_match($regexp, $errormsg)) {
return $code;
}
}
// Fall back to DB_ERROR if there was no mapping.
return DB_ERROR;
}
 
// }}}
// {{{ tableInfo()
 
/**
* Returns information about a table
*
* @param string $result a string containing the name of a table
* @param int $mode a valid tableInfo mode
*
* @return array an associative array with the information requested.
* A DB_Error object on failure.
*
* @see DB_common::tableInfo()
* @since Method available since Release 1.7.0
*/
function tableInfo($result, $mode = null)
{
if (is_string($result)) {
/*
* Probably received a table name.
* Create a result resource identifier.
*/
$id = @sqlite_array_query($this->connection,
"PRAGMA table_info('$result');",
SQLITE_ASSOC);
$got_string = true;
} else {
$this->last_query = '';
return $this->raiseError(DB_ERROR_NOT_CAPABLE, null, null, null,
'This DBMS can not obtain tableInfo' .
' from result sets');
}
 
if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
$case_func = 'strtolower';
} else {
$case_func = 'strval';
}
 
$count = count($id);
$res = array();
 
if ($mode) {
$res['num_fields'] = $count;
}
 
for ($i = 0; $i < $count; $i++) {
if (strpos($id[$i]['type'], '(') !== false) {
$bits = explode('(', $id[$i]['type']);
$type = $bits[0];
$len = rtrim($bits[1],')');
} else {
$type = $id[$i]['type'];
$len = 0;
}
 
$flags = '';
if ($id[$i]['pk']) {
$flags .= 'primary_key ';
}
if ($id[$i]['notnull']) {
$flags .= 'not_null ';
}
if ($id[$i]['dflt_value'] !== null) {
$flags .= 'default_' . rawurlencode($id[$i]['dflt_value']);
}
$flags = trim($flags);
 
$res[$i] = array(
'table' => $case_func($result),
'name' => $case_func($id[$i]['name']),
'type' => $type,
'len' => $len,
'flags' => $flags,
);
 
if ($mode & DB_TABLEINFO_ORDER) {
$res['order'][$res[$i]['name']] = $i;
}
if ($mode & DB_TABLEINFO_ORDERTABLE) {
$res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
}
}
 
return $res;
}
 
// }}}
// {{{ getSpecialQuery()
 
/**
* Obtains the query string needed for listing a given type of objects
*
* @param string $type the kind of objects you want to retrieve
* @param array $args SQLITE DRIVER ONLY: a private array of arguments
* used by the getSpecialQuery(). Do not use
* this directly.
*
* @return string the SQL query string or null if the driver doesn't
* support the object type requested
*
* @access protected
* @see DB_common::getListOf()
*/
function getSpecialQuery($type, $args = array())
{
if (!is_array($args)) {
return $this->raiseError('no key specified', null, null, null,
'Argument has to be an array.');
}
 
switch ($type) {
case 'master':
return 'SELECT * FROM sqlite_master;';
case 'tables':
return "SELECT name FROM sqlite_master WHERE type='table' "
. 'UNION ALL SELECT name FROM sqlite_temp_master '
. "WHERE type='table' ORDER BY name;";
case 'schema':
return 'SELECT sql FROM (SELECT * FROM sqlite_master '
. 'UNION ALL SELECT * FROM sqlite_temp_master) '
. "WHERE type!='meta' "
. 'ORDER BY tbl_name, type DESC, name;';
case 'schemax':
case 'schema_x':
/*
* Use like:
* $res = $db->query($db->getSpecialQuery('schema_x',
* array('table' => 'table3')));
*/
return 'SELECT sql FROM (SELECT * FROM sqlite_master '
. 'UNION ALL SELECT * FROM sqlite_temp_master) '
. "WHERE tbl_name LIKE '{$args['table']}' "
. "AND type!='meta' "
. 'ORDER BY type DESC, name;';
case 'alter':
/*
* SQLite does not support ALTER TABLE; this is a helper query
* to handle this. 'table' represents the table name, 'rows'
* the news rows to create, 'save' the row(s) to keep _with_
* the data.
*
* Use like:
* $args = array(
* 'table' => $table,
* 'rows' => "id INTEGER PRIMARY KEY, firstname TEXT, surname TEXT, datetime TEXT",
* 'save' => "NULL, titel, content, datetime"
* );
* $res = $db->query( $db->getSpecialQuery('alter', $args));
*/
$rows = strtr($args['rows'], $this->keywords);
 
$q = array(
'BEGIN TRANSACTION',
"CREATE TEMPORARY TABLE {$args['table']}_backup ({$args['rows']})",
"INSERT INTO {$args['table']}_backup SELECT {$args['save']} FROM {$args['table']}",
"DROP TABLE {$args['table']}",
"CREATE TABLE {$args['table']} ({$args['rows']})",
"INSERT INTO {$args['table']} SELECT {$rows} FROM {$args['table']}_backup",
"DROP TABLE {$args['table']}_backup",
'COMMIT',
);
 
/*
* This is a dirty hack, since the above query will not get
* executed with a single query call so here the query method
* will be called directly and return a select instead.
*/
foreach ($q as $query) {
$this->query($query);
}
return "SELECT * FROM {$args['table']};";
default:
return null;
}
}
 
// }}}
}
 
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/
 
?>
/tags/Racine_livraison_narmer/api/pear/DB/oci8.php
New file
0,0 → 1,1117
<?php
 
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 
/**
* The PEAR DB driver for PHP's oci8 extension
* for interacting with Oracle databases
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Database
* @package DB
* @author James L. Pine <jlp@valinux.com>
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id: oci8.php,v 1.3 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/DB
*/
 
/**
* Obtain the DB_common class so it can be extended from
*/
require_once 'DB/common.php';
 
/**
* The methods PEAR DB uses to interact with PHP's oci8 extension
* for interacting with Oracle databases
*
* Definitely works with versions 8 and 9 of Oracle.
*
* These methods overload the ones declared in DB_common.
*
* Be aware... OCIError() only appears to return anything when given a
* statement, so functions return the generic DB_ERROR instead of more
* useful errors that have to do with feedback from the database.
*
* @category Database
* @package DB
* @author James L. Pine <jlp@valinux.com>
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version Release: 1.7.6
* @link http://pear.php.net/package/DB
*/
class DB_oci8 extends DB_common
{
// {{{ properties
 
/**
* The DB driver type (mysql, oci8, odbc, etc.)
* @var string
*/
var $phptype = 'oci8';
 
/**
* The database syntax variant to be used (db2, access, etc.), if any
* @var string
*/
var $dbsyntax = 'oci8';
 
/**
* The capabilities of this DB implementation
*
* The 'new_link' element contains the PHP version that first provided
* new_link support for this DBMS. Contains false if it's unsupported.
*
* Meaning of the 'limit' element:
* + 'emulate' = emulate with fetch row by number
* + 'alter' = alter the query
* + false = skip rows
*
* @var array
*/
var $features = array(
'limit' => 'alter',
'new_link' => '5.0.0',
'numrows' => 'subquery',
'pconnect' => true,
'prepare' => true,
'ssl' => false,
'transactions' => true,
);
 
/**
* A mapping of native error codes to DB error codes
* @var array
*/
var $errorcode_map = array(
1 => DB_ERROR_CONSTRAINT,
900 => DB_ERROR_SYNTAX,
904 => DB_ERROR_NOSUCHFIELD,
913 => DB_ERROR_VALUE_COUNT_ON_ROW,
921 => DB_ERROR_SYNTAX,
923 => DB_ERROR_SYNTAX,
942 => DB_ERROR_NOSUCHTABLE,
955 => DB_ERROR_ALREADY_EXISTS,
1400 => DB_ERROR_CONSTRAINT_NOT_NULL,
1401 => DB_ERROR_INVALID,
1407 => DB_ERROR_CONSTRAINT_NOT_NULL,
1418 => DB_ERROR_NOT_FOUND,
1476 => DB_ERROR_DIVZERO,
1722 => DB_ERROR_INVALID_NUMBER,
2289 => DB_ERROR_NOSUCHTABLE,
2291 => DB_ERROR_CONSTRAINT,
2292 => DB_ERROR_CONSTRAINT,
2449 => DB_ERROR_CONSTRAINT,
);
 
/**
* The raw database connection created by PHP
* @var resource
*/
var $connection;
 
/**
* The DSN information for connecting to a database
* @var array
*/
var $dsn = array();
 
 
/**
* Should data manipulation queries be committed automatically?
* @var bool
* @access private
*/
var $autocommit = true;
 
/**
* Stores the $data passed to execute() in the oci8 driver
*
* Gets reset to array() when simpleQuery() is run.
*
* Needed in case user wants to call numRows() after prepare/execute
* was used.
*
* @var array
* @access private
*/
var $_data = array();
 
/**
* The result or statement handle from the most recently executed query
* @var resource
*/
var $last_stmt;
 
/**
* Is the given prepared statement a data manipulation query?
* @var array
* @access private
*/
var $manip_query = array();
 
 
// }}}
// {{{ constructor
 
/**
* This constructor calls <kbd>$this->DB_common()</kbd>
*
* @return void
*/
function DB_oci8()
{
$this->DB_common();
}
 
// }}}
// {{{ connect()
 
/**
* Connect to the database server, log in and open the database
*
* Don't call this method directly. Use DB::connect() instead.
*
* If PHP is at version 5.0.0 or greater:
* + Generally, oci_connect() or oci_pconnect() are used.
* + But if the new_link DSN option is set to true, oci_new_connect()
* is used.
*
* When using PHP version 4.x, OCILogon() or OCIPLogon() are used.
*
* PEAR DB's oci8 driver supports the following extra DSN options:
* + charset The character set to be used on the connection.
* Only used if PHP is at version 5.0.0 or greater
* and the Oracle server is at 9.2 or greater.
* Available since PEAR DB 1.7.0.
* + new_link If set to true, causes subsequent calls to
* connect() to return a new connection link
* instead of the existing one. WARNING: this is
* not portable to other DBMS's.
* Available since PEAR DB 1.7.0.
*
* @param array $dsn the data source name
* @param bool $persistent should the connection be persistent?
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function connect($dsn, $persistent = false)
{
if (!PEAR::loadExtension('oci8')) {
return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
}
 
$this->dsn = $dsn;
if ($dsn['dbsyntax']) {
$this->dbsyntax = $dsn['dbsyntax'];
}
 
if (function_exists('oci_connect')) {
if (isset($dsn['new_link'])
&& ($dsn['new_link'] == 'true' || $dsn['new_link'] === true))
{
$connect_function = 'oci_new_connect';
} else {
$connect_function = $persistent ? 'oci_pconnect'
: 'oci_connect';
}
 
// Backwards compatibility with DB < 1.7.0
if (empty($dsn['database']) && !empty($dsn['hostspec'])) {
$db = $dsn['hostspec'];
} else {
$db = $dsn['database'];
}
 
$char = empty($dsn['charset']) ? null : $dsn['charset'];
$this->connection = @$connect_function($dsn['username'],
$dsn['password'],
$db,
$char);
$error = OCIError();
if (!empty($error) && $error['code'] == 12541) {
// Couldn't find TNS listener. Try direct connection.
$this->connection = @$connect_function($dsn['username'],
$dsn['password'],
null,
$char);
}
} else {
$connect_function = $persistent ? 'OCIPLogon' : 'OCILogon';
if ($dsn['hostspec']) {
$this->connection = @$connect_function($dsn['username'],
$dsn['password'],
$dsn['hostspec']);
} elseif ($dsn['username'] || $dsn['password']) {
$this->connection = @$connect_function($dsn['username'],
$dsn['password']);
}
}
 
if (!$this->connection) {
$error = OCIError();
$error = (is_array($error)) ? $error['message'] : null;
return $this->raiseError(DB_ERROR_CONNECT_FAILED,
null, null, null,
$error);
}
return DB_OK;
}
 
// }}}
// {{{ disconnect()
 
/**
* Disconnects from the database server
*
* @return bool TRUE on success, FALSE on failure
*/
function disconnect()
{
if (function_exists('oci_close')) {
$ret = @oci_close($this->connection);
} else {
$ret = @OCILogOff($this->connection);
}
$this->connection = null;
return $ret;
}
 
// }}}
// {{{ simpleQuery()
 
/**
* Sends a query to the database server
*
* To determine how many rows of a result set get buffered using
* ocisetprefetch(), see the "result_buffering" option in setOptions().
* This option was added in Release 1.7.0.
*
* @param string the SQL query string
*
* @return mixed + a PHP result resrouce for successful SELECT queries
* + the DB_OK constant for other successful queries
* + a DB_Error object on failure
*/
function simpleQuery($query)
{
$this->_data = array();
$this->last_parameters = array();
$this->last_query = $query;
$query = $this->modifyQuery($query);
$result = @OCIParse($this->connection, $query);
if (!$result) {
return $this->oci8RaiseError();
}
if ($this->autocommit) {
$success = @OCIExecute($result,OCI_COMMIT_ON_SUCCESS);
} else {
$success = @OCIExecute($result,OCI_DEFAULT);
}
if (!$success) {
return $this->oci8RaiseError($result);
}
$this->last_stmt = $result;
if (DB::isManip($query)) {
return DB_OK;
} else {
@ocisetprefetch($result, $this->options['result_buffering']);
return $result;
}
}
 
// }}}
// {{{ nextResult()
 
/**
* Move the internal oracle result pointer to the next available result
*
* @param a valid oci8 result resource
*
* @access public
*
* @return true if a result is available otherwise return false
*/
function nextResult($result)
{
return false;
}
 
// }}}
// {{{ fetchInto()
 
/**
* Places a row from the result set into the given array
*
* Formating of the array and the data therein are configurable.
* See DB_result::fetchInto() for more information.
*
* This method is not meant to be called directly. Use
* DB_result::fetchInto() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result the query result resource
* @param array $arr the referenced array to put the data in
* @param int $fetchmode how the resulting array should be indexed
* @param int $rownum the row number to fetch (0 = first row)
*
* @return mixed DB_OK on success, NULL when the end of a result set is
* reached or on failure
*
* @see DB_result::fetchInto()
*/
function fetchInto($result, &$arr, $fetchmode, $rownum = null)
{
if ($rownum !== null) {
return $this->raiseError(DB_ERROR_NOT_CAPABLE);
}
if ($fetchmode & DB_FETCHMODE_ASSOC) {
$moredata = @OCIFetchInto($result,$arr,OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS);
if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE &&
$moredata)
{
$arr = array_change_key_case($arr, CASE_LOWER);
}
} else {
$moredata = OCIFetchInto($result,$arr,OCI_RETURN_NULLS+OCI_RETURN_LOBS);
}
if (!$moredata) {
return null;
}
if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
$this->_rtrimArrayValues($arr);
}
if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
$this->_convertNullArrayValuesToEmpty($arr);
}
return DB_OK;
}
 
// }}}
// {{{ freeResult()
 
/**
* Deletes the result set and frees the memory occupied by the result set
*
* This method is not meant to be called directly. Use
* DB_result::free() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return bool TRUE on success, FALSE if $result is invalid
*
* @see DB_result::free()
*/
function freeResult($result)
{
return @OCIFreeStatement($result);
}
 
/**
* Frees the internal resources associated with a prepared query
*
* @param resource $stmt the prepared statement's resource
* @param bool $free_resource should the PHP resource be freed too?
* Use false if you need to get data
* from the result set later.
*
* @return bool TRUE on success, FALSE if $result is invalid
*
* @see DB_oci8::prepare()
*/
function freePrepared($stmt, $free_resource = true)
{
if (!is_resource($stmt)) {
return false;
}
if ($free_resource) {
@ocifreestatement($stmt);
}
if (isset($this->prepare_types[(int)$stmt])) {
unset($this->prepare_types[(int)$stmt]);
unset($this->manip_query[(int)$stmt]);
} else {
return false;
}
return true;
}
 
// }}}
// {{{ numRows()
 
/**
* Gets the number of rows in a result set
*
* Only works if the DB_PORTABILITY_NUMROWS portability option
* is turned on.
*
* This method is not meant to be called directly. Use
* DB_result::numRows() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return int the number of rows. A DB_Error object on failure.
*
* @see DB_result::numRows(), DB_common::setOption()
*/
function numRows($result)
{
// emulate numRows for Oracle. yuck.
if ($this->options['portability'] & DB_PORTABILITY_NUMROWS &&
$result === $this->last_stmt)
{
$countquery = 'SELECT COUNT(*) FROM ('.$this->last_query.')';
$save_query = $this->last_query;
$save_stmt = $this->last_stmt;
 
if (count($this->_data)) {
$smt = $this->prepare('SELECT COUNT(*) FROM ('.$this->last_query.')');
$count = $this->execute($smt, $this->_data);
} else {
$count =& $this->query($countquery);
}
 
if (DB::isError($count) ||
DB::isError($row = $count->fetchRow(DB_FETCHMODE_ORDERED)))
{
$this->last_query = $save_query;
$this->last_stmt = $save_stmt;
return $this->raiseError(DB_ERROR_NOT_CAPABLE);
}
return $row[0];
}
return $this->raiseError(DB_ERROR_NOT_CAPABLE);
}
 
// }}}
// {{{ numCols()
 
/**
* Gets the number of columns in a result set
*
* This method is not meant to be called directly. Use
* DB_result::numCols() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return int the number of columns. A DB_Error object on failure.
*
* @see DB_result::numCols()
*/
function numCols($result)
{
$cols = @OCINumCols($result);
if (!$cols) {
return $this->oci8RaiseError($result);
}
return $cols;
}
 
// }}}
// {{{ prepare()
 
/**
* Prepares a query for multiple execution with execute().
*
* With oci8, this is emulated.
*
* prepare() requires a generic query as string like <code>
* INSERT INTO numbers VALUES (?, ?, ?)
* </code>. The <kbd>?</kbd> characters are placeholders.
*
* Three types of placeholders can be used:
* + <kbd>?</kbd> a quoted scalar value, i.e. strings, integers
* + <kbd>!</kbd> value is inserted 'as is'
* + <kbd>&</kbd> requires a file name. The file's contents get
* inserted into the query (i.e. saving binary
* data in a db)
*
* Use backslashes to escape placeholder characters if you don't want
* them to be interpreted as placeholders. Example: <code>
* "UPDATE foo SET col=? WHERE col='over \& under'"
* </code>
*
* @param string $query the query to be prepared
*
* @return mixed DB statement resource on success. DB_Error on failure.
*
* @see DB_oci8::execute()
*/
function prepare($query)
{
$tokens = preg_split('/((?<!\\\)[&?!])/', $query, -1,
PREG_SPLIT_DELIM_CAPTURE);
$binds = count($tokens) - 1;
$token = 0;
$types = array();
$newquery = '';
 
foreach ($tokens as $key => $val) {
switch ($val) {
case '?':
$types[$token++] = DB_PARAM_SCALAR;
unset($tokens[$key]);
break;
case '&':
$types[$token++] = DB_PARAM_OPAQUE;
unset($tokens[$key]);
break;
case '!':
$types[$token++] = DB_PARAM_MISC;
unset($tokens[$key]);
break;
default:
$tokens[$key] = preg_replace('/\\\([&?!])/', "\\1", $val);
if ($key != $binds) {
$newquery .= $tokens[$key] . ':bind' . $token;
} else {
$newquery .= $tokens[$key];
}
}
}
 
$this->last_query = $query;
$newquery = $this->modifyQuery($newquery);
if (!$stmt = @OCIParse($this->connection, $newquery)) {
return $this->oci8RaiseError();
}
$this->prepare_types[(int)$stmt] = $types;
$this->manip_query[(int)$stmt] = DB::isManip($query);
return $stmt;
}
 
// }}}
// {{{ execute()
 
/**
* Executes a DB statement prepared with prepare().
*
* To determine how many rows of a result set get buffered using
* ocisetprefetch(), see the "result_buffering" option in setOptions().
* This option was added in Release 1.7.0.
*
* @param resource $stmt a DB statement resource returned from prepare()
* @param mixed $data array, string or numeric data to be used in
* execution of the statement. Quantity of items
* passed must match quantity of placeholders in
* query: meaning 1 for non-array items or the
* quantity of elements in the array.
*
* @return mixed returns an oic8 result resource for successful SELECT
* queries, DB_OK for other successful queries.
* A DB error object is returned on failure.
*
* @see DB_oci8::prepare()
*/
function &execute($stmt, $data = array())
{
$data = (array)$data;
$this->last_parameters = $data;
$this->_data = $data;
 
$types =& $this->prepare_types[(int)$stmt];
if (count($types) != count($data)) {
$tmp =& $this->raiseError(DB_ERROR_MISMATCH);
return $tmp;
}
 
$i = 0;
foreach ($data as $key => $value) {
if ($types[$i] == DB_PARAM_MISC) {
/*
* Oracle doesn't seem to have the ability to pass a
* parameter along unchanged, so strip off quotes from start
* and end, plus turn two single quotes to one single quote,
* in order to avoid the quotes getting escaped by
* Oracle and ending up in the database.
*/
$data[$key] = preg_replace("/^'(.*)'$/", "\\1", $data[$key]);
$data[$key] = str_replace("''", "'", $data[$key]);
} elseif ($types[$i] == DB_PARAM_OPAQUE) {
$fp = @fopen($data[$key], 'rb');
if (!$fp) {
$tmp =& $this->raiseError(DB_ERROR_ACCESS_VIOLATION);
return $tmp;
}
$data[$key] = fread($fp, filesize($data[$key]));
fclose($fp);
}
if (!@OCIBindByName($stmt, ':bind' . $i, $data[$key], -1)) {
$tmp = $this->oci8RaiseError($stmt);
return $tmp;
}
$i++;
}
if ($this->autocommit) {
$success = @OCIExecute($stmt, OCI_COMMIT_ON_SUCCESS);
} else {
$success = @OCIExecute($stmt, OCI_DEFAULT);
}
if (!$success) {
$tmp = $this->oci8RaiseError($stmt);
return $tmp;
}
$this->last_stmt = $stmt;
if ($this->manip_query[(int)$stmt]) {
$tmp = DB_OK;
} else {
@ocisetprefetch($stmt, $this->options['result_buffering']);
$tmp =& new DB_result($this, $stmt);
}
return $tmp;
}
 
// }}}
// {{{ autoCommit()
 
/**
* Enables or disables automatic commits
*
* @param bool $onoff true turns it on, false turns it off
*
* @return int DB_OK on success. A DB_Error object if the driver
* doesn't support auto-committing transactions.
*/
function autoCommit($onoff = false)
{
$this->autocommit = (bool)$onoff;;
return DB_OK;
}
 
// }}}
// {{{ commit()
 
/**
* Commits the current transaction
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function commit()
{
$result = @OCICommit($this->connection);
if (!$result) {
return $this->oci8RaiseError();
}
return DB_OK;
}
 
// }}}
// {{{ rollback()
 
/**
* Reverts the current transaction
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function rollback()
{
$result = @OCIRollback($this->connection);
if (!$result) {
return $this->oci8RaiseError();
}
return DB_OK;
}
 
// }}}
// {{{ affectedRows()
 
/**
* Determines the number of rows affected by a data maniuplation query
*
* 0 is returned for queries that don't manipulate data.
*
* @return int the number of rows. A DB_Error object on failure.
*/
function affectedRows()
{
if ($this->last_stmt === false) {
return $this->oci8RaiseError();
}
$result = @OCIRowCount($this->last_stmt);
if ($result === false) {
return $this->oci8RaiseError($this->last_stmt);
}
return $result;
}
 
// }}}
// {{{ modifyQuery()
 
/**
* Changes a query string for various DBMS specific reasons
*
* "SELECT 2+2" must be "SELECT 2+2 FROM dual" in Oracle.
*
* @param string $query the query string to modify
*
* @return string the modified query string
*
* @access protected
*/
function modifyQuery($query)
{
if (preg_match('/^\s*SELECT/i', $query) &&
!preg_match('/\sFROM\s/i', $query)) {
$query .= ' FROM dual';
}
return $query;
}
 
// }}}
// {{{ modifyLimitQuery()
 
/**
* Adds LIMIT clauses to a query string according to current DBMS standards
*
* @param string $query the query to modify
* @param int $from the row to start to fetching (0 = the first row)
* @param int $count the numbers of rows to fetch
* @param mixed $params array, string or numeric data to be used in
* execution of the statement. Quantity of items
* passed must match quantity of placeholders in
* query: meaning 1 placeholder for non-array
* parameters or 1 placeholder per array element.
*
* @return string the query string with LIMIT clauses added
*
* @access protected
*/
function modifyLimitQuery($query, $from, $count, $params = array())
{
// Let Oracle return the name of the columns instead of
// coding a "home" SQL parser
 
if (count($params)) {
$result = $this->prepare("SELECT * FROM ($query) "
. 'WHERE NULL = NULL');
$tmp =& $this->execute($result, $params);
} else {
$q_fields = "SELECT * FROM ($query) WHERE NULL = NULL";
 
if (!$result = @OCIParse($this->connection, $q_fields)) {
$this->last_query = $q_fields;
return $this->oci8RaiseError();
}
if (!@OCIExecute($result, OCI_DEFAULT)) {
$this->last_query = $q_fields;
return $this->oci8RaiseError($result);
}
}
 
$ncols = OCINumCols($result);
$cols = array();
for ( $i = 1; $i <= $ncols; $i++ ) {
$cols[] = '"' . OCIColumnName($result, $i) . '"';
}
$fields = implode(', ', $cols);
// XXX Test that (tip by John Lim)
//if (preg_match('/^\s*SELECT\s+/is', $query, $match)) {
// // Introduce the FIRST_ROWS Oracle query optimizer
// $query = substr($query, strlen($match[0]), strlen($query));
// $query = "SELECT /* +FIRST_ROWS */ " . $query;
//}
 
// Construct the query
// more at: http://marc.theaimsgroup.com/?l=php-db&m=99831958101212&w=2
// Perhaps this could be optimized with the use of Unions
$query = "SELECT $fields FROM".
" (SELECT rownum as linenum, $fields FROM".
" ($query)".
' WHERE rownum <= '. ($from + $count) .
') WHERE linenum >= ' . ++$from;
return $query;
}
 
// }}}
// {{{ nextId()
 
/**
* Returns the next free id in a sequence
*
* @param string $seq_name name of the sequence
* @param boolean $ondemand when true, the seqence is automatically
* created if it does not exist
*
* @return int the next id number in the sequence.
* A DB_Error object on failure.
*
* @see DB_common::nextID(), DB_common::getSequenceName(),
* DB_oci8::createSequence(), DB_oci8::dropSequence()
*/
function nextId($seq_name, $ondemand = true)
{
$seqname = $this->getSequenceName($seq_name);
$repeat = 0;
do {
$this->expectError(DB_ERROR_NOSUCHTABLE);
$result =& $this->query("SELECT ${seqname}.nextval FROM dual");
$this->popExpect();
if ($ondemand && DB::isError($result) &&
$result->getCode() == DB_ERROR_NOSUCHTABLE) {
$repeat = 1;
$result = $this->createSequence($seq_name);
if (DB::isError($result)) {
return $this->raiseError($result);
}
} else {
$repeat = 0;
}
} while ($repeat);
if (DB::isError($result)) {
return $this->raiseError($result);
}
$arr = $result->fetchRow(DB_FETCHMODE_ORDERED);
return $arr[0];
}
 
/**
* Creates a new sequence
*
* @param string $seq_name name of the new sequence
*
* @return int DB_OK on success. A DB_Error object on failure.
*
* @see DB_common::createSequence(), DB_common::getSequenceName(),
* DB_oci8::nextID(), DB_oci8::dropSequence()
*/
function createSequence($seq_name)
{
return $this->query('CREATE SEQUENCE '
. $this->getSequenceName($seq_name));
}
 
// }}}
// {{{ dropSequence()
 
/**
* Deletes a sequence
*
* @param string $seq_name name of the sequence to be deleted
*
* @return int DB_OK on success. A DB_Error object on failure.
*
* @see DB_common::dropSequence(), DB_common::getSequenceName(),
* DB_oci8::nextID(), DB_oci8::createSequence()
*/
function dropSequence($seq_name)
{
return $this->query('DROP SEQUENCE '
. $this->getSequenceName($seq_name));
}
 
// }}}
// {{{ oci8RaiseError()
 
/**
* Produces a DB_Error object regarding the current problem
*
* @param int $errno if the error is being manually raised pass a
* DB_ERROR* constant here. If this isn't passed
* the error information gathered from the DBMS.
*
* @return object the DB_Error object
*
* @see DB_common::raiseError(),
* DB_oci8::errorNative(), DB_oci8::errorCode()
*/
function oci8RaiseError($errno = null)
{
if ($errno === null) {
$error = @OCIError($this->connection);
return $this->raiseError($this->errorCode($error['code']),
null, null, null, $error['message']);
} elseif (is_resource($errno)) {
$error = @OCIError($errno);
return $this->raiseError($this->errorCode($error['code']),
null, null, null, $error['message']);
}
return $this->raiseError($this->errorCode($errno));
}
 
// }}}
// {{{ errorNative()
 
/**
* Gets the DBMS' native error code produced by the last query
*
* @return int the DBMS' error code. FALSE if the code could not be
* determined
*/
function errorNative()
{
if (is_resource($this->last_stmt)) {
$error = @OCIError($this->last_stmt);
} else {
$error = @OCIError($this->connection);
}
if (is_array($error)) {
return $error['code'];
}
return false;
}
 
// }}}
// {{{ tableInfo()
 
/**
* Returns information about a table or a result set
*
* NOTE: only supports 'table' and 'flags' if <var>$result</var>
* is a table name.
*
* NOTE: flags won't contain index information.
*
* @param object|string $result DB_result object from a query or a
* string containing the name of a table.
* While this also accepts a query result
* resource identifier, this behavior is
* deprecated.
* @param int $mode a valid tableInfo mode
*
* @return array an associative array with the information requested.
* A DB_Error object on failure.
*
* @see DB_common::tableInfo()
*/
function tableInfo($result, $mode = null)
{
if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
$case_func = 'strtolower';
} else {
$case_func = 'strval';
}
 
$res = array();
 
if (is_string($result)) {
/*
* Probably received a table name.
* Create a result resource identifier.
*/
$result = strtoupper($result);
$q_fields = 'SELECT column_name, data_type, data_length, '
. 'nullable '
. 'FROM user_tab_columns '
. "WHERE table_name='$result' ORDER BY column_id";
 
$this->last_query = $q_fields;
 
if (!$stmt = @OCIParse($this->connection, $q_fields)) {
return $this->oci8RaiseError(DB_ERROR_NEED_MORE_DATA);
}
if (!@OCIExecute($stmt, OCI_DEFAULT)) {
return $this->oci8RaiseError($stmt);
}
 
$i = 0;
while (@OCIFetch($stmt)) {
$res[$i] = array(
'table' => $case_func($result),
'name' => $case_func(@OCIResult($stmt, 1)),
'type' => @OCIResult($stmt, 2),
'len' => @OCIResult($stmt, 3),
'flags' => (@OCIResult($stmt, 4) == 'N') ? 'not_null' : '',
);
if ($mode & DB_TABLEINFO_ORDER) {
$res['order'][$res[$i]['name']] = $i;
}
if ($mode & DB_TABLEINFO_ORDERTABLE) {
$res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
}
$i++;
}
 
if ($mode) {
$res['num_fields'] = $i;
}
@OCIFreeStatement($stmt);
 
} else {
if (isset($result->result)) {
/*
* Probably received a result object.
* Extract the result resource identifier.
*/
$result = $result->result;
}
 
$res = array();
 
if ($result === $this->last_stmt) {
$count = @OCINumCols($result);
if ($mode) {
$res['num_fields'] = $count;
}
for ($i = 0; $i < $count; $i++) {
$res[$i] = array(
'table' => '',
'name' => $case_func(@OCIColumnName($result, $i+1)),
'type' => @OCIColumnType($result, $i+1),
'len' => @OCIColumnSize($result, $i+1),
'flags' => '',
);
if ($mode & DB_TABLEINFO_ORDER) {
$res['order'][$res[$i]['name']] = $i;
}
if ($mode & DB_TABLEINFO_ORDERTABLE) {
$res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
}
}
} else {
return $this->raiseError(DB_ERROR_NOT_CAPABLE);
}
}
return $res;
}
 
// }}}
// {{{ getSpecialQuery()
 
/**
* Obtains the query string needed for listing a given type of objects
*
* @param string $type the kind of objects you want to retrieve
*
* @return string the SQL query string or null if the driver doesn't
* support the object type requested
*
* @access protected
* @see DB_common::getListOf()
*/
function getSpecialQuery($type)
{
switch ($type) {
case 'tables':
return 'SELECT table_name FROM user_tables';
case 'synonyms':
return 'SELECT synonym_name FROM user_synonyms';
default:
return null;
}
}
 
// }}}
 
}
 
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/
 
?>
/tags/Racine_livraison_narmer/api/pear/DB/QueryTool.php
New file
0,0 → 1,63
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 
/**
* Contains the DB_QueryTool class
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Database
* @package DB_QueryTool
* @author Wolfram Kriesing <wk@visionp.de>
* @author Paolo Panto <wk@visionp.de>
* @copyright 2003-2005 Wolfram Kriesing, Paolo Panto
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id: QueryTool.php,v 1.1 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/DB_QueryTool
*/
 
/**
* require the DB_QueryTool_EasyJoin class
*/
require_once 'DB/QueryTool/EasyJoin.php';
 
/**
* MDB_QueryTool class
*
* This class should be extended; it's here to make it easy using the base
* class of the package by its package name.
* Since I tried to seperate the functionality a bit inside the
* really working classes i decided to have this class here just to
* provide the name, since the functionality inside the other
* classes might be restructured a bit but this name always stays.
*
* @category Database
* @package DB_QueryTool
* @author Wolfram Kriesing <wk@visionp.de>
* @copyright 2003-2005 Wolfram Kriesing
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @link http://pear.php.net/package/DB_QueryTool
*/
class DB_QueryTool extends DB_QueryTool_EasyJoin
{
// {{{ DB_QueryTool()
 
/**
* call parent constructor
* @param mixed $dsn DSN string, DSN array or DB object
* @param array $options
*/
function DB_QueryTool($dsn=false, $options=array())
{
parent::__construct($dsn, $options);
}
 
// }}}
}
?>
/tags/Racine_livraison_narmer/api/pear/DB/storage.php
New file
0,0 → 1,504
<?php
 
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 
/**
* Provides an object interface to a table row
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Database
* @package DB
* @author Stig Bakken <stig@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id: storage.php,v 1.3 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/DB
*/
 
/**
* Obtain the DB class so it can be extended from
*/
require_once 'DB.php';
 
/**
* Provides an object interface to a table row
*
* It lets you add, delete and change rows using objects rather than SQL
* statements.
*
* @category Database
* @package DB
* @author Stig Bakken <stig@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version Release: 1.7.6
* @link http://pear.php.net/package/DB
*/
class DB_storage extends PEAR
{
// {{{ properties
 
/** the name of the table (or view, if the backend database supports
updates in views) we hold data from */
var $_table = null;
 
/** which column(s) in the table contains primary keys, can be a
string for single-column primary keys, or an array of strings
for multiple-column primary keys */
var $_keycolumn = null;
 
/** DB connection handle used for all transactions */
var $_dbh = null;
 
/** an assoc with the names of database fields stored as properties
in this object */
var $_properties = array();
 
/** an assoc with the names of the properties in this object that
have been changed since they were fetched from the database */
var $_changes = array();
 
/** flag that decides if data in this object can be changed.
objects that don't have their table's key column in their
property lists will be flagged as read-only. */
var $_readonly = false;
 
/** function or method that implements a validator for fields that
are set, this validator function returns true if the field is
valid, false if not */
var $_validator = null;
 
// }}}
// {{{ constructor
 
/**
* Constructor
*
* @param $table string the name of the database table
*
* @param $keycolumn mixed string with name of key column, or array of
* strings if the table has a primary key of more than one column
*
* @param $dbh object database connection object
*
* @param $validator mixed function or method used to validate
* each new value, called with three parameters: the name of the
* field/column that is changing, a reference to the new value and
* a reference to this object
*
*/
function DB_storage($table, $keycolumn, &$dbh, $validator = null)
{
$this->PEAR('DB_Error');
$this->_table = $table;
$this->_keycolumn = $keycolumn;
$this->_dbh = $dbh;
$this->_readonly = false;
$this->_validator = $validator;
}
 
// }}}
// {{{ _makeWhere()
 
/**
* Utility method to build a "WHERE" clause to locate ourselves in
* the table.
*
* XXX future improvement: use rowids?
*
* @access private
*/
function _makeWhere($keyval = null)
{
if (is_array($this->_keycolumn)) {
if ($keyval === null) {
for ($i = 0; $i < sizeof($this->_keycolumn); $i++) {
$keyval[] = $this->{$this->_keycolumn[$i]};
}
}
$whereclause = '';
for ($i = 0; $i < sizeof($this->_keycolumn); $i++) {
if ($i > 0) {
$whereclause .= ' AND ';
}
$whereclause .= $this->_keycolumn[$i];
if (is_null($keyval[$i])) {
// there's not much point in having a NULL key,
// but we support it anyway
$whereclause .= ' IS NULL';
} else {
$whereclause .= ' = ' . $this->_dbh->quote($keyval[$i]);
}
}
} else {
if ($keyval === null) {
$keyval = @$this->{$this->_keycolumn};
}
$whereclause = $this->_keycolumn;
if (is_null($keyval)) {
// there's not much point in having a NULL key,
// but we support it anyway
$whereclause .= ' IS NULL';
} else {
$whereclause .= ' = ' . $this->_dbh->quote($keyval);
}
}
return $whereclause;
}
 
// }}}
// {{{ setup()
 
/**
* Method used to initialize a DB_storage object from the
* configured table.
*
* @param $keyval mixed the key[s] of the row to fetch (string or array)
*
* @return int DB_OK on success, a DB error if not
*/
function setup($keyval)
{
$whereclause = $this->_makeWhere($keyval);
$query = 'SELECT * FROM ' . $this->_table . ' WHERE ' . $whereclause;
$sth = $this->_dbh->query($query);
if (DB::isError($sth)) {
return $sth;
}
$row = $sth->fetchRow(DB_FETCHMODE_ASSOC);
if (DB::isError($row)) {
return $row;
}
if (!$row) {
return $this->raiseError(null, DB_ERROR_NOT_FOUND, null, null,
$query, null, true);
}
foreach ($row as $key => $value) {
$this->_properties[$key] = true;
$this->$key = $value;
}
return DB_OK;
}
 
// }}}
// {{{ insert()
 
/**
* Create a new (empty) row in the configured table for this
* object.
*/
function insert($newpk)
{
if (is_array($this->_keycolumn)) {
$primarykey = $this->_keycolumn;
} else {
$primarykey = array($this->_keycolumn);
}
settype($newpk, "array");
for ($i = 0; $i < sizeof($primarykey); $i++) {
$pkvals[] = $this->_dbh->quote($newpk[$i]);
}
 
$sth = $this->_dbh->query("INSERT INTO $this->_table (" .
implode(",", $primarykey) . ") VALUES(" .
implode(",", $pkvals) . ")");
if (DB::isError($sth)) {
return $sth;
}
if (sizeof($newpk) == 1) {
$newpk = $newpk[0];
}
$this->setup($newpk);
}
 
// }}}
// {{{ toString()
 
/**
* Output a simple description of this DB_storage object.
* @return string object description
*/
function toString()
{
$info = strtolower(get_class($this));
$info .= " (table=";
$info .= $this->_table;
$info .= ", keycolumn=";
if (is_array($this->_keycolumn)) {
$info .= "(" . implode(",", $this->_keycolumn) . ")";
} else {
$info .= $this->_keycolumn;
}
$info .= ", dbh=";
if (is_object($this->_dbh)) {
$info .= $this->_dbh->toString();
} else {
$info .= "null";
}
$info .= ")";
if (sizeof($this->_properties)) {
$info .= " [loaded, key=";
$keyname = $this->_keycolumn;
if (is_array($keyname)) {
$info .= "(";
for ($i = 0; $i < sizeof($keyname); $i++) {
if ($i > 0) {
$info .= ",";
}
$info .= $this->$keyname[$i];
}
$info .= ")";
} else {
$info .= $this->$keyname;
}
$info .= "]";
}
if (sizeof($this->_changes)) {
$info .= " [modified]";
}
return $info;
}
 
// }}}
// {{{ dump()
 
/**
* Dump the contents of this object to "standard output".
*/
function dump()
{
foreach ($this->_properties as $prop => $foo) {
print "$prop = ";
print htmlentities($this->$prop);
print "<br />\n";
}
}
 
// }}}
// {{{ &create()
 
/**
* Static method used to create new DB storage objects.
* @param $data assoc. array where the keys are the names
* of properties/columns
* @return object a new instance of DB_storage or a subclass of it
*/
function &create($table, &$data)
{
$classname = strtolower(get_class($this));
$obj =& new $classname($table);
foreach ($data as $name => $value) {
$obj->_properties[$name] = true;
$obj->$name = &$value;
}
return $obj;
}
 
// }}}
// {{{ loadFromQuery()
 
/**
* Loads data into this object from the given query. If this
* object already contains table data, changes will be saved and
* the object re-initialized first.
*
* @param $query SQL query
*
* @param $params parameter list in case you want to use
* prepare/execute mode
*
* @return int DB_OK on success, DB_WARNING_READ_ONLY if the
* returned object is read-only (because the object's specified
* key column was not found among the columns returned by $query),
* or another DB error code in case of errors.
*/
// XXX commented out for now
/*
function loadFromQuery($query, $params = null)
{
if (sizeof($this->_properties)) {
if (sizeof($this->_changes)) {
$this->store();
$this->_changes = array();
}
$this->_properties = array();
}
$rowdata = $this->_dbh->getRow($query, DB_FETCHMODE_ASSOC, $params);
if (DB::isError($rowdata)) {
return $rowdata;
}
reset($rowdata);
$found_keycolumn = false;
while (list($key, $value) = each($rowdata)) {
if ($key == $this->_keycolumn) {
$found_keycolumn = true;
}
$this->_properties[$key] = true;
$this->$key = &$value;
unset($value); // have to unset, or all properties will
// refer to the same value
}
if (!$found_keycolumn) {
$this->_readonly = true;
return DB_WARNING_READ_ONLY;
}
return DB_OK;
}
*/
 
// }}}
// {{{ set()
 
/**
* Modify an attriute value.
*/
function set($property, $newvalue)
{
// only change if $property is known and object is not
// read-only
if ($this->_readonly) {
return $this->raiseError(null, DB_WARNING_READ_ONLY, null,
null, null, null, true);
}
if (@isset($this->_properties[$property])) {
if (empty($this->_validator)) {
$valid = true;
} else {
$valid = @call_user_func($this->_validator,
$this->_table,
$property,
$newvalue,
$this->$property,
$this);
}
if ($valid) {
$this->$property = $newvalue;
if (empty($this->_changes[$property])) {
$this->_changes[$property] = 0;
} else {
$this->_changes[$property]++;
}
} else {
return $this->raiseError(null, DB_ERROR_INVALID, null,
null, "invalid field: $property",
null, true);
}
return true;
}
return $this->raiseError(null, DB_ERROR_NOSUCHFIELD, null,
null, "unknown field: $property",
null, true);
}
 
// }}}
// {{{ &get()
 
/**
* Fetch an attribute value.
*
* @param string attribute name
*
* @return attribute contents, or null if the attribute name is
* unknown
*/
function &get($property)
{
// only return if $property is known
if (isset($this->_properties[$property])) {
return $this->$property;
}
$tmp = null;
return $tmp;
}
 
// }}}
// {{{ _DB_storage()
 
/**
* Destructor, calls DB_storage::store() if there are changes
* that are to be kept.
*/
function _DB_storage()
{
if (sizeof($this->_changes)) {
$this->store();
}
$this->_properties = array();
$this->_changes = array();
$this->_table = null;
}
 
// }}}
// {{{ store()
 
/**
* Stores changes to this object in the database.
*
* @return DB_OK or a DB error
*/
function store()
{
foreach ($this->_changes as $name => $foo) {
$params[] = &$this->$name;
$vars[] = $name . ' = ?';
}
if ($vars) {
$query = 'UPDATE ' . $this->_table . ' SET ' .
implode(', ', $vars) . ' WHERE ' .
$this->_makeWhere();
$stmt = $this->_dbh->prepare($query);
$res = $this->_dbh->execute($stmt, $params);
if (DB::isError($res)) {
return $res;
}
$this->_changes = array();
}
return DB_OK;
}
 
// }}}
// {{{ remove()
 
/**
* Remove the row represented by this object from the database.
*
* @return mixed DB_OK or a DB error
*/
function remove()
{
if ($this->_readonly) {
return $this->raiseError(null, DB_WARNING_READ_ONLY, null,
null, null, null, true);
}
$query = 'DELETE FROM ' . $this->_table .' WHERE '.
$this->_makeWhere();
$res = $this->_dbh->query($query);
if (DB::isError($res)) {
return $res;
}
foreach ($this->_properties as $prop => $foo) {
unset($this->$prop);
}
$this->_properties = array();
$this->_changes = array();
return DB_OK;
}
 
// }}}
}
 
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/
 
?>
/tags/Racine_livraison_narmer/api/pear/DB/mysql.php
New file
0,0 → 1,1034
<?php
 
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 
/**
* The PEAR DB driver for PHP's mysql extension
* for interacting with MySQL databases
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Database
* @package DB
* @author Stig Bakken <ssb@php.net>
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id: mysql.php,v 1.3 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/DB
*/
 
/**
* Obtain the DB_common class so it can be extended from
*/
require_once 'DB/common.php';
 
/**
* The methods PEAR DB uses to interact with PHP's mysql extension
* for interacting with MySQL databases
*
* These methods overload the ones declared in DB_common.
*
* @category Database
* @package DB
* @author Stig Bakken <ssb@php.net>
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version Release: 1.7.6
* @link http://pear.php.net/package/DB
*/
class DB_mysql extends DB_common
{
// {{{ properties
 
/**
* The DB driver type (mysql, oci8, odbc, etc.)
* @var string
*/
var $phptype = 'mysql';
 
/**
* The database syntax variant to be used (db2, access, etc.), if any
* @var string
*/
var $dbsyntax = 'mysql';
 
/**
* The capabilities of this DB implementation
*
* The 'new_link' element contains the PHP version that first provided
* new_link support for this DBMS. Contains false if it's unsupported.
*
* Meaning of the 'limit' element:
* + 'emulate' = emulate with fetch row by number
* + 'alter' = alter the query
* + false = skip rows
*
* @var array
*/
var $features = array(
'limit' => 'alter',
'new_link' => '4.2.0',
'numrows' => true,
'pconnect' => true,
'prepare' => false,
'ssl' => false,
'transactions' => true,
);
 
/**
* A mapping of native error codes to DB error codes
* @var array
*/
var $errorcode_map = array(
1004 => DB_ERROR_CANNOT_CREATE,
1005 => DB_ERROR_CANNOT_CREATE,
1006 => DB_ERROR_CANNOT_CREATE,
1007 => DB_ERROR_ALREADY_EXISTS,
1008 => DB_ERROR_CANNOT_DROP,
1022 => DB_ERROR_ALREADY_EXISTS,
1044 => DB_ERROR_ACCESS_VIOLATION,
1046 => DB_ERROR_NODBSELECTED,
1048 => DB_ERROR_CONSTRAINT,
1049 => DB_ERROR_NOSUCHDB,
1050 => DB_ERROR_ALREADY_EXISTS,
1051 => DB_ERROR_NOSUCHTABLE,
1054 => DB_ERROR_NOSUCHFIELD,
1061 => DB_ERROR_ALREADY_EXISTS,
1062 => DB_ERROR_ALREADY_EXISTS,
1064 => DB_ERROR_SYNTAX,
1091 => DB_ERROR_NOT_FOUND,
1100 => DB_ERROR_NOT_LOCKED,
1136 => DB_ERROR_VALUE_COUNT_ON_ROW,
1142 => DB_ERROR_ACCESS_VIOLATION,
1146 => DB_ERROR_NOSUCHTABLE,
1216 => DB_ERROR_CONSTRAINT,
1217 => DB_ERROR_CONSTRAINT,
);
 
/**
* The raw database connection created by PHP
* @var resource
*/
var $connection;
 
/**
* The DSN information for connecting to a database
* @var array
*/
var $dsn = array();
 
 
/**
* Should data manipulation queries be committed automatically?
* @var bool
* @access private
*/
var $autocommit = true;
 
/**
* The quantity of transactions begun
*
* {@internal While this is private, it can't actually be designated
* private in PHP 5 because it is directly accessed in the test suite.}}
*
* @var integer
* @access private
*/
var $transaction_opcount = 0;
 
/**
* The database specified in the DSN
*
* It's a fix to allow calls to different databases in the same script.
*
* @var string
* @access private
*/
var $_db = '';
 
 
// }}}
// {{{ constructor
 
/**
* This constructor calls <kbd>$this->DB_common()</kbd>
*
* @return void
*/
function DB_mysql()
{
$this->DB_common();
}
 
// }}}
// {{{ connect()
 
/**
* Connect to the database server, log in and open the database
*
* Don't call this method directly. Use DB::connect() instead.
*
* PEAR DB's mysql driver supports the following extra DSN options:
* + new_link If set to true, causes subsequent calls to connect()
* to return a new connection link instead of the
* existing one. WARNING: this is not portable to
* other DBMS's. Available since PEAR DB 1.7.0.
* + client_flags Any combination of MYSQL_CLIENT_* constants.
* Only used if PHP is at version 4.3.0 or greater.
* Available since PEAR DB 1.7.0.
*
* @param array $dsn the data source name
* @param bool $persistent should the connection be persistent?
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function connect($dsn, $persistent = false)
{
if (!PEAR::loadExtension('mysql')) {
return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
}
 
$this->dsn = $dsn;
if ($dsn['dbsyntax']) {
$this->dbsyntax = $dsn['dbsyntax'];
}
 
$params = array();
if ($dsn['protocol'] && $dsn['protocol'] == 'unix') {
$params[0] = ':' . $dsn['socket'];
} else {
$params[0] = $dsn['hostspec'] ? $dsn['hostspec']
: 'localhost';
if ($dsn['port']) {
$params[0] .= ':' . $dsn['port'];
}
}
$params[] = $dsn['username'] ? $dsn['username'] : null;
$params[] = $dsn['password'] ? $dsn['password'] : null;
 
if (!$persistent) {
if (isset($dsn['new_link'])
&& ($dsn['new_link'] == 'true' || $dsn['new_link'] === true))
{
$params[] = true;
} else {
$params[] = false;
}
}
if (version_compare(phpversion(), '4.3.0', '>=')) {
$params[] = isset($dsn['client_flags'])
? $dsn['client_flags'] : null;
}
 
$connect_function = $persistent ? 'mysql_pconnect' : 'mysql_connect';
 
$ini = ini_get('track_errors');
$php_errormsg = '';
if ($ini) {
$this->connection = @call_user_func_array($connect_function,
$params);
} else {
ini_set('track_errors', 1);
$this->connection = @call_user_func_array($connect_function,
$params);
ini_set('track_errors', $ini);
}
 
if (!$this->connection) {
if (($err = @mysql_error()) != '') {
return $this->raiseError(DB_ERROR_CONNECT_FAILED,
null, null, null,
$err);
} else {
return $this->raiseError(DB_ERROR_CONNECT_FAILED,
null, null, null,
$php_errormsg);
}
}
 
if ($dsn['database']) {
if (!@mysql_select_db($dsn['database'], $this->connection)) {
return $this->mysqlRaiseError();
}
$this->_db = $dsn['database'];
}
 
return DB_OK;
}
 
// }}}
// {{{ disconnect()
 
/**
* Disconnects from the database server
*
* @return bool TRUE on success, FALSE on failure
*/
function disconnect()
{
$ret = @mysql_close($this->connection);
$this->connection = null;
return $ret;
}
 
// }}}
// {{{ simpleQuery()
 
/**
* Sends a query to the database server
*
* Generally uses mysql_query(). If you want to use
* mysql_unbuffered_query() set the "result_buffering" option to 0 using
* setOptions(). This option was added in Release 1.7.0.
*
* @param string the SQL query string
*
* @return mixed + a PHP result resrouce for successful SELECT queries
* + the DB_OK constant for other successful queries
* + a DB_Error object on failure
*/
function simpleQuery($query)
{
$ismanip = DB::isManip($query);
$this->last_query = $query;
$query = $this->modifyQuery($query);
if ($this->_db) {
if (!@mysql_select_db($this->_db, $this->connection)) {
return $this->mysqlRaiseError(DB_ERROR_NODBSELECTED);
}
}
if (!$this->autocommit && $ismanip) {
if ($this->transaction_opcount == 0) {
$result = @mysql_query('SET AUTOCOMMIT=0', $this->connection);
$result = @mysql_query('BEGIN', $this->connection);
if (!$result) {
return $this->mysqlRaiseError();
}
}
$this->transaction_opcount++;
}
if (!$this->options['result_buffering']) {
$result = @mysql_unbuffered_query($query, $this->connection);
} else {
$result = @mysql_query($query, $this->connection);
}
if (!$result) {
return $this->mysqlRaiseError();
}
if (is_resource($result)) {
return $result;
}
return DB_OK;
}
 
// }}}
// {{{ nextResult()
 
/**
* Move the internal mysql result pointer to the next available result
*
* This method has not been implemented yet.
*
* @param a valid sql result resource
*
* @return false
*/
function nextResult($result)
{
return false;
}
 
// }}}
// {{{ fetchInto()
 
/**
* Places a row from the result set into the given array
*
* Formating of the array and the data therein are configurable.
* See DB_result::fetchInto() for more information.
*
* This method is not meant to be called directly. Use
* DB_result::fetchInto() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result the query result resource
* @param array $arr the referenced array to put the data in
* @param int $fetchmode how the resulting array should be indexed
* @param int $rownum the row number to fetch (0 = first row)
*
* @return mixed DB_OK on success, NULL when the end of a result set is
* reached or on failure
*
* @see DB_result::fetchInto()
*/
function fetchInto($result, &$arr, $fetchmode, $rownum = null)
{
if ($rownum !== null) {
if (!@mysql_data_seek($result, $rownum)) {
return null;
}
}
if ($fetchmode & DB_FETCHMODE_ASSOC) {
$arr = @mysql_fetch_array($result, MYSQL_ASSOC);
if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) {
$arr = array_change_key_case($arr, CASE_LOWER);
}
} else {
$arr = @mysql_fetch_row($result);
}
if (!$arr) {
return null;
}
if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
/*
* Even though this DBMS already trims output, we do this because
* a field might have intentional whitespace at the end that
* gets removed by DB_PORTABILITY_RTRIM under another driver.
*/
$this->_rtrimArrayValues($arr);
}
if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
$this->_convertNullArrayValuesToEmpty($arr);
}
return DB_OK;
}
 
// }}}
// {{{ freeResult()
 
/**
* Deletes the result set and frees the memory occupied by the result set
*
* This method is not meant to be called directly. Use
* DB_result::free() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return bool TRUE on success, FALSE if $result is invalid
*
* @see DB_result::free()
*/
function freeResult($result)
{
return @mysql_free_result($result);
}
 
// }}}
// {{{ numCols()
 
/**
* Gets the number of columns in a result set
*
* This method is not meant to be called directly. Use
* DB_result::numCols() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return int the number of columns. A DB_Error object on failure.
*
* @see DB_result::numCols()
*/
function numCols($result)
{
$cols = @mysql_num_fields($result);
if (!$cols) {
return $this->mysqlRaiseError();
}
return $cols;
}
 
// }}}
// {{{ numRows()
 
/**
* Gets the number of rows in a result set
*
* This method is not meant to be called directly. Use
* DB_result::numRows() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return int the number of rows. A DB_Error object on failure.
*
* @see DB_result::numRows()
*/
function numRows($result)
{
$rows = @mysql_num_rows($result);
if ($rows === null) {
return $this->mysqlRaiseError();
}
return $rows;
}
 
// }}}
// {{{ autoCommit()
 
/**
* Enables or disables automatic commits
*
* @param bool $onoff true turns it on, false turns it off
*
* @return int DB_OK on success. A DB_Error object if the driver
* doesn't support auto-committing transactions.
*/
function autoCommit($onoff = false)
{
// XXX if $this->transaction_opcount > 0, we should probably
// issue a warning here.
$this->autocommit = $onoff ? true : false;
return DB_OK;
}
 
// }}}
// {{{ commit()
 
/**
* Commits the current transaction
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function commit()
{
if ($this->transaction_opcount > 0) {
if ($this->_db) {
if (!@mysql_select_db($this->_db, $this->connection)) {
return $this->mysqlRaiseError(DB_ERROR_NODBSELECTED);
}
}
$result = @mysql_query('COMMIT', $this->connection);
$result = @mysql_query('SET AUTOCOMMIT=1', $this->connection);
$this->transaction_opcount = 0;
if (!$result) {
return $this->mysqlRaiseError();
}
}
return DB_OK;
}
 
// }}}
// {{{ rollback()
 
/**
* Reverts the current transaction
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function rollback()
{
if ($this->transaction_opcount > 0) {
if ($this->_db) {
if (!@mysql_select_db($this->_db, $this->connection)) {
return $this->mysqlRaiseError(DB_ERROR_NODBSELECTED);
}
}
$result = @mysql_query('ROLLBACK', $this->connection);
$result = @mysql_query('SET AUTOCOMMIT=1', $this->connection);
$this->transaction_opcount = 0;
if (!$result) {
return $this->mysqlRaiseError();
}
}
return DB_OK;
}
 
// }}}
// {{{ affectedRows()
 
/**
* Determines the number of rows affected by a data maniuplation query
*
* 0 is returned for queries that don't manipulate data.
*
* @return int the number of rows. A DB_Error object on failure.
*/
function affectedRows()
{
if (DB::isManip($this->last_query)) {
return @mysql_affected_rows($this->connection);
} else {
return 0;
}
}
 
// }}}
// {{{ nextId()
 
/**
* Returns the next free id in a sequence
*
* @param string $seq_name name of the sequence
* @param boolean $ondemand when true, the seqence is automatically
* created if it does not exist
*
* @return int the next id number in the sequence.
* A DB_Error object on failure.
*
* @see DB_common::nextID(), DB_common::getSequenceName(),
* DB_mysql::createSequence(), DB_mysql::dropSequence()
*/
function nextId($seq_name, $ondemand = true)
{
$seqname = $this->getSequenceName($seq_name);
do {
$repeat = 0;
$this->pushErrorHandling(PEAR_ERROR_RETURN);
$result = $this->query("UPDATE ${seqname} ".
'SET id=LAST_INSERT_ID(id+1)');
$this->popErrorHandling();
if ($result === DB_OK) {
// COMMON CASE
$id = @mysql_insert_id($this->connection);
if ($id != 0) {
return $id;
}
// EMPTY SEQ TABLE
// Sequence table must be empty for some reason, so fill
// it and return 1 and obtain a user-level lock
$result = $this->getOne("SELECT GET_LOCK('${seqname}_lock',10)");
if (DB::isError($result)) {
return $this->raiseError($result);
}
if ($result == 0) {
// Failed to get the lock
return $this->mysqlRaiseError(DB_ERROR_NOT_LOCKED);
}
 
// add the default value
$result = $this->query("REPLACE INTO ${seqname} (id) VALUES (0)");
if (DB::isError($result)) {
return $this->raiseError($result);
}
 
// Release the lock
$result = $this->getOne('SELECT RELEASE_LOCK('
. "'${seqname}_lock')");
if (DB::isError($result)) {
return $this->raiseError($result);
}
// We know what the result will be, so no need to try again
return 1;
 
} elseif ($ondemand && DB::isError($result) &&
$result->getCode() == DB_ERROR_NOSUCHTABLE)
{
// ONDEMAND TABLE CREATION
$result = $this->createSequence($seq_name);
if (DB::isError($result)) {
return $this->raiseError($result);
} else {
$repeat = 1;
}
 
} elseif (DB::isError($result) &&
$result->getCode() == DB_ERROR_ALREADY_EXISTS)
{
// BACKWARDS COMPAT
// see _BCsequence() comment
$result = $this->_BCsequence($seqname);
if (DB::isError($result)) {
return $this->raiseError($result);
}
$repeat = 1;
}
} while ($repeat);
 
return $this->raiseError($result);
}
 
// }}}
// {{{ createSequence()
 
/**
* Creates a new sequence
*
* @param string $seq_name name of the new sequence
*
* @return int DB_OK on success. A DB_Error object on failure.
*
* @see DB_common::createSequence(), DB_common::getSequenceName(),
* DB_mysql::nextID(), DB_mysql::dropSequence()
*/
function createSequence($seq_name)
{
$seqname = $this->getSequenceName($seq_name);
$res = $this->query('CREATE TABLE ' . $seqname
. ' (id INTEGER UNSIGNED AUTO_INCREMENT NOT NULL,'
. ' PRIMARY KEY(id))');
if (DB::isError($res)) {
return $res;
}
// insert yields value 1, nextId call will generate ID 2
$res = $this->query("INSERT INTO ${seqname} (id) VALUES (0)");
if (DB::isError($res)) {
return $res;
}
// so reset to zero
return $this->query("UPDATE ${seqname} SET id = 0");
}
 
// }}}
// {{{ dropSequence()
 
/**
* Deletes a sequence
*
* @param string $seq_name name of the sequence to be deleted
*
* @return int DB_OK on success. A DB_Error object on failure.
*
* @see DB_common::dropSequence(), DB_common::getSequenceName(),
* DB_mysql::nextID(), DB_mysql::createSequence()
*/
function dropSequence($seq_name)
{
return $this->query('DROP TABLE ' . $this->getSequenceName($seq_name));
}
 
// }}}
// {{{ _BCsequence()
 
/**
* Backwards compatibility with old sequence emulation implementation
* (clean up the dupes)
*
* @param string $seqname the sequence name to clean up
*
* @return bool true on success. A DB_Error object on failure.
*
* @access private
*/
function _BCsequence($seqname)
{
// Obtain a user-level lock... this will release any previous
// application locks, but unlike LOCK TABLES, it does not abort
// the current transaction and is much less frequently used.
$result = $this->getOne("SELECT GET_LOCK('${seqname}_lock',10)");
if (DB::isError($result)) {
return $result;
}
if ($result == 0) {
// Failed to get the lock, can't do the conversion, bail
// with a DB_ERROR_NOT_LOCKED error
return $this->mysqlRaiseError(DB_ERROR_NOT_LOCKED);
}
 
$highest_id = $this->getOne("SELECT MAX(id) FROM ${seqname}");
if (DB::isError($highest_id)) {
return $highest_id;
}
// This should kill all rows except the highest
// We should probably do something if $highest_id isn't
// numeric, but I'm at a loss as how to handle that...
$result = $this->query('DELETE FROM ' . $seqname
. " WHERE id <> $highest_id");
if (DB::isError($result)) {
return $result;
}
 
// If another thread has been waiting for this lock,
// it will go thru the above procedure, but will have no
// real effect
$result = $this->getOne("SELECT RELEASE_LOCK('${seqname}_lock')");
if (DB::isError($result)) {
return $result;
}
return true;
}
 
// }}}
// {{{ quoteIdentifier()
 
/**
* Quotes a string so it can be safely used as a table or column name
*
* MySQL can't handle the backtick character (<kbd>`</kbd>) in
* table or column names.
*
* @param string $str identifier name to be quoted
*
* @return string quoted identifier string
*
* @see DB_common::quoteIdentifier()
* @since Method available since Release 1.6.0
*/
function quoteIdentifier($str)
{
return '`' . $str . '`';
}
 
// }}}
// {{{ quote()
 
/**
* @deprecated Deprecated in release 1.6.0
*/
function quote($str)
{
return $this->quoteSmart($str);
}
 
// }}}
// {{{ escapeSimple()
 
/**
* Escapes a string according to the current DBMS's standards
*
* @param string $str the string to be escaped
*
* @return string the escaped string
*
* @see DB_common::quoteSmart()
* @since Method available since Release 1.6.0
*/
function escapeSimple($str)
{
if (function_exists('mysql_real_escape_string')) {
return @mysql_real_escape_string($str, $this->connection);
} else {
return @mysql_escape_string($str);
}
}
 
// }}}
// {{{ modifyQuery()
 
/**
* Changes a query string for various DBMS specific reasons
*
* This little hack lets you know how many rows were deleted
* when running a "DELETE FROM table" query. Only implemented
* if the DB_PORTABILITY_DELETE_COUNT portability option is on.
*
* @param string $query the query string to modify
*
* @return string the modified query string
*
* @access protected
* @see DB_common::setOption()
*/
function modifyQuery($query)
{
if ($this->options['portability'] & DB_PORTABILITY_DELETE_COUNT) {
// "DELETE FROM table" gives 0 affected rows in MySQL.
// This little hack lets you know how many rows were deleted.
if (preg_match('/^\s*DELETE\s+FROM\s+(\S+)\s*$/i', $query)) {
$query = preg_replace('/^\s*DELETE\s+FROM\s+(\S+)\s*$/',
'DELETE FROM \1 WHERE 1=1', $query);
}
}
return $query;
}
 
// }}}
// {{{ modifyLimitQuery()
 
/**
* Adds LIMIT clauses to a query string according to current DBMS standards
*
* @param string $query the query to modify
* @param int $from the row to start to fetching (0 = the first row)
* @param int $count the numbers of rows to fetch
* @param mixed $params array, string or numeric data to be used in
* execution of the statement. Quantity of items
* passed must match quantity of placeholders in
* query: meaning 1 placeholder for non-array
* parameters or 1 placeholder per array element.
*
* @return string the query string with LIMIT clauses added
*
* @access protected
*/
function modifyLimitQuery($query, $from, $count, $params = array())
{
if (DB::isManip($query)) {
return $query . " LIMIT $count";
} else {
return $query . " LIMIT $from, $count";
}
}
 
// }}}
// {{{ mysqlRaiseError()
 
/**
* Produces a DB_Error object regarding the current problem
*
* @param int $errno if the error is being manually raised pass a
* DB_ERROR* constant here. If this isn't passed
* the error information gathered from the DBMS.
*
* @return object the DB_Error object
*
* @see DB_common::raiseError(),
* DB_mysql::errorNative(), DB_common::errorCode()
*/
function mysqlRaiseError($errno = null)
{
if ($errno === null) {
if ($this->options['portability'] & DB_PORTABILITY_ERRORS) {
$this->errorcode_map[1022] = DB_ERROR_CONSTRAINT;
$this->errorcode_map[1048] = DB_ERROR_CONSTRAINT_NOT_NULL;
$this->errorcode_map[1062] = DB_ERROR_CONSTRAINT;
} else {
// Doing this in case mode changes during runtime.
$this->errorcode_map[1022] = DB_ERROR_ALREADY_EXISTS;
$this->errorcode_map[1048] = DB_ERROR_CONSTRAINT;
$this->errorcode_map[1062] = DB_ERROR_ALREADY_EXISTS;
}
$errno = $this->errorCode(mysql_errno($this->connection));
}
return $this->raiseError($errno, null, null, null,
@mysql_errno($this->connection) . ' ** ' .
@mysql_error($this->connection));
}
 
// }}}
// {{{ errorNative()
 
/**
* Gets the DBMS' native error code produced by the last query
*
* @return int the DBMS' error code
*/
function errorNative()
{
return @mysql_errno($this->connection);
}
 
// }}}
// {{{ tableInfo()
 
/**
* Returns information about a table or a result set
*
* @param object|string $result DB_result object from a query or a
* string containing the name of a table.
* While this also accepts a query result
* resource identifier, this behavior is
* deprecated.
* @param int $mode a valid tableInfo mode
*
* @return array an associative array with the information requested.
* A DB_Error object on failure.
*
* @see DB_common::tableInfo()
*/
function tableInfo($result, $mode = null)
{
if (is_string($result)) {
/*
* Probably received a table name.
* Create a result resource identifier.
*/
$id = @mysql_list_fields($this->dsn['database'],
$result, $this->connection);
$got_string = true;
} elseif (isset($result->result)) {
/*
* Probably received a result object.
* Extract the result resource identifier.
*/
$id = $result->result;
$got_string = false;
} else {
/*
* Probably received a result resource identifier.
* Copy it.
* Deprecated. Here for compatibility only.
*/
$id = $result;
$got_string = false;
}
 
if (!is_resource($id)) {
return $this->mysqlRaiseError(DB_ERROR_NEED_MORE_DATA);
}
 
if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
$case_func = 'strtolower';
} else {
$case_func = 'strval';
}
 
$count = @mysql_num_fields($id);
$res = array();
 
if ($mode) {
$res['num_fields'] = $count;
}
 
for ($i = 0; $i < $count; $i++) {
$res[$i] = array(
'table' => $case_func(@mysql_field_table($id, $i)),
'name' => $case_func(@mysql_field_name($id, $i)),
'type' => @mysql_field_type($id, $i),
'len' => @mysql_field_len($id, $i),
'flags' => @mysql_field_flags($id, $i),
);
if ($mode & DB_TABLEINFO_ORDER) {
$res['order'][$res[$i]['name']] = $i;
}
if ($mode & DB_TABLEINFO_ORDERTABLE) {
$res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
}
}
 
// free the result only if we were called on a table
if ($got_string) {
@mysql_free_result($id);
}
return $res;
}
 
// }}}
// {{{ getSpecialQuery()
 
/**
* Obtains the query string needed for listing a given type of objects
*
* @param string $type the kind of objects you want to retrieve
*
* @return string the SQL query string or null if the driver doesn't
* support the object type requested
*
* @access protected
* @see DB_common::getListOf()
*/
function getSpecialQuery($type)
{
switch ($type) {
case 'tables':
return 'SHOW TABLES';
case 'users':
return 'SELECT DISTINCT User FROM mysql.user';
case 'databases':
return 'SHOW DATABASES';
default:
return null;
}
}
 
// }}}
 
}
 
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/
 
?>
/tags/Racine_livraison_narmer/api/pear/DB/odbc.php
New file
0,0 → 1,883
<?php
 
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 
/**
* The PEAR DB driver for PHP's odbc extension
* for interacting with databases via ODBC connections
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Database
* @package DB
* @author Stig Bakken <ssb@php.net>
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id: odbc.php,v 1.3 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/DB
*/
 
/**
* Obtain the DB_common class so it can be extended from
*/
require_once 'DB/common.php';
 
/**
* The methods PEAR DB uses to interact with PHP's odbc extension
* for interacting with databases via ODBC connections
*
* These methods overload the ones declared in DB_common.
*
* More info on ODBC errors could be found here:
* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/trblsql/tr_err_odbc_5stz.asp
*
* @category Database
* @package DB
* @author Stig Bakken <ssb@php.net>
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version Release: 1.7.6
* @link http://pear.php.net/package/DB
*/
class DB_odbc extends DB_common
{
// {{{ properties
 
/**
* The DB driver type (mysql, oci8, odbc, etc.)
* @var string
*/
var $phptype = 'odbc';
 
/**
* The database syntax variant to be used (db2, access, etc.), if any
* @var string
*/
var $dbsyntax = 'sql92';
 
/**
* The capabilities of this DB implementation
*
* The 'new_link' element contains the PHP version that first provided
* new_link support for this DBMS. Contains false if it's unsupported.
*
* Meaning of the 'limit' element:
* + 'emulate' = emulate with fetch row by number
* + 'alter' = alter the query
* + false = skip rows
*
* NOTE: The feature set of the following drivers are different than
* the default:
* + solid: 'transactions' = true
* + navision: 'limit' = false
*
* @var array
*/
var $features = array(
'limit' => 'emulate',
'new_link' => false,
'numrows' => true,
'pconnect' => true,
'prepare' => false,
'ssl' => false,
'transactions' => false,
);
 
/**
* A mapping of native error codes to DB error codes
* @var array
*/
var $errorcode_map = array(
'01004' => DB_ERROR_TRUNCATED,
'07001' => DB_ERROR_MISMATCH,
'21S01' => DB_ERROR_VALUE_COUNT_ON_ROW,
'21S02' => DB_ERROR_MISMATCH,
'22001' => DB_ERROR_INVALID,
'22003' => DB_ERROR_INVALID_NUMBER,
'22005' => DB_ERROR_INVALID_NUMBER,
'22008' => DB_ERROR_INVALID_DATE,
'22012' => DB_ERROR_DIVZERO,
'23000' => DB_ERROR_CONSTRAINT,
'23502' => DB_ERROR_CONSTRAINT_NOT_NULL,
'23503' => DB_ERROR_CONSTRAINT,
'23504' => DB_ERROR_CONSTRAINT,
'23505' => DB_ERROR_CONSTRAINT,
'24000' => DB_ERROR_INVALID,
'34000' => DB_ERROR_INVALID,
'37000' => DB_ERROR_SYNTAX,
'42000' => DB_ERROR_SYNTAX,
'42601' => DB_ERROR_SYNTAX,
'IM001' => DB_ERROR_UNSUPPORTED,
'S0000' => DB_ERROR_NOSUCHTABLE,
'S0001' => DB_ERROR_ALREADY_EXISTS,
'S0002' => DB_ERROR_NOSUCHTABLE,
'S0011' => DB_ERROR_ALREADY_EXISTS,
'S0012' => DB_ERROR_NOT_FOUND,
'S0021' => DB_ERROR_ALREADY_EXISTS,
'S0022' => DB_ERROR_NOSUCHFIELD,
'S1009' => DB_ERROR_INVALID,
'S1090' => DB_ERROR_INVALID,
'S1C00' => DB_ERROR_NOT_CAPABLE,
);
 
/**
* The raw database connection created by PHP
* @var resource
*/
var $connection;
 
/**
* The DSN information for connecting to a database
* @var array
*/
var $dsn = array();
 
 
/**
* The number of rows affected by a data manipulation query
* @var integer
* @access private
*/
var $affected = 0;
 
 
// }}}
// {{{ constructor
 
/**
* This constructor calls <kbd>$this->DB_common()</kbd>
*
* @return void
*/
function DB_odbc()
{
$this->DB_common();
}
 
// }}}
// {{{ connect()
 
/**
* Connect to the database server, log in and open the database
*
* Don't call this method directly. Use DB::connect() instead.
*
* PEAR DB's odbc driver supports the following extra DSN options:
* + cursor The type of cursor to be used for this connection.
*
* @param array $dsn the data source name
* @param bool $persistent should the connection be persistent?
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function connect($dsn, $persistent = false)
{
if (!PEAR::loadExtension('odbc')) {
return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
}
 
$this->dsn = $dsn;
if ($dsn['dbsyntax']) {
$this->dbsyntax = $dsn['dbsyntax'];
}
switch ($this->dbsyntax) {
case 'access':
case 'db2':
case 'solid':
$this->features['transactions'] = true;
break;
case 'navision':
$this->features['limit'] = false;
}
 
/*
* This is hear for backwards compatibility. Should have been using
* 'database' all along, but prior to 1.6.0RC3 'hostspec' was used.
*/
if ($dsn['database']) {
$odbcdsn = $dsn['database'];
} elseif ($dsn['hostspec']) {
$odbcdsn = $dsn['hostspec'];
} else {
$odbcdsn = 'localhost';
}
 
$connect_function = $persistent ? 'odbc_pconnect' : 'odbc_connect';
 
if (empty($dsn['cursor'])) {
$this->connection = @$connect_function($odbcdsn, $dsn['username'],
$dsn['password']);
} else {
$this->connection = @$connect_function($odbcdsn, $dsn['username'],
$dsn['password'],
$dsn['cursor']);
}
 
if (!is_resource($this->connection)) {
return $this->raiseError(DB_ERROR_CONNECT_FAILED,
null, null, null,
$this->errorNative());
}
return DB_OK;
}
 
// }}}
// {{{ disconnect()
 
/**
* Disconnects from the database server
*
* @return bool TRUE on success, FALSE on failure
*/
function disconnect()
{
$err = @odbc_close($this->connection);
$this->connection = null;
return $err;
}
 
// }}}
// {{{ simpleQuery()
 
/**
* Sends a query to the database server
*
* @param string the SQL query string
*
* @return mixed + a PHP result resrouce for successful SELECT queries
* + the DB_OK constant for other successful queries
* + a DB_Error object on failure
*/
function simpleQuery($query)
{
$this->last_query = $query;
$query = $this->modifyQuery($query);
$result = @odbc_exec($this->connection, $query);
if (!$result) {
return $this->odbcRaiseError(); // XXX ERRORMSG
}
// Determine which queries that should return data, and which
// should return an error code only.
if (DB::isManip($query)) {
$this->affected = $result; // For affectedRows()
return DB_OK;
}
$this->affected = 0;
return $result;
}
 
// }}}
// {{{ nextResult()
 
/**
* Move the internal odbc result pointer to the next available result
*
* @param a valid fbsql result resource
*
* @access public
*
* @return true if a result is available otherwise return false
*/
function nextResult($result)
{
return @odbc_next_result($result);
}
 
// }}}
// {{{ fetchInto()
 
/**
* Places a row from the result set into the given array
*
* Formating of the array and the data therein are configurable.
* See DB_result::fetchInto() for more information.
*
* This method is not meant to be called directly. Use
* DB_result::fetchInto() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result the query result resource
* @param array $arr the referenced array to put the data in
* @param int $fetchmode how the resulting array should be indexed
* @param int $rownum the row number to fetch (0 = first row)
*
* @return mixed DB_OK on success, NULL when the end of a result set is
* reached or on failure
*
* @see DB_result::fetchInto()
*/
function fetchInto($result, &$arr, $fetchmode, $rownum = null)
{
$arr = array();
if ($rownum !== null) {
$rownum++; // ODBC first row is 1
if (version_compare(phpversion(), '4.2.0', 'ge')) {
$cols = @odbc_fetch_into($result, $arr, $rownum);
} else {
$cols = @odbc_fetch_into($result, $rownum, $arr);
}
} else {
$cols = @odbc_fetch_into($result, $arr);
}
if (!$cols) {
return null;
}
if ($fetchmode !== DB_FETCHMODE_ORDERED) {
for ($i = 0; $i < count($arr); $i++) {
$colName = @odbc_field_name($result, $i+1);
$a[$colName] = $arr[$i];
}
if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
$a = array_change_key_case($a, CASE_LOWER);
}
$arr = $a;
}
if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
$this->_rtrimArrayValues($arr);
}
if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
$this->_convertNullArrayValuesToEmpty($arr);
}
return DB_OK;
}
 
// }}}
// {{{ freeResult()
 
/**
* Deletes the result set and frees the memory occupied by the result set
*
* This method is not meant to be called directly. Use
* DB_result::free() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return bool TRUE on success, FALSE if $result is invalid
*
* @see DB_result::free()
*/
function freeResult($result)
{
return @odbc_free_result($result);
}
 
// }}}
// {{{ numCols()
 
/**
* Gets the number of columns in a result set
*
* This method is not meant to be called directly. Use
* DB_result::numCols() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return int the number of columns. A DB_Error object on failure.
*
* @see DB_result::numCols()
*/
function numCols($result)
{
$cols = @odbc_num_fields($result);
if (!$cols) {
return $this->odbcRaiseError();
}
return $cols;
}
 
// }}}
// {{{ affectedRows()
 
/**
* Determines the number of rows affected by a data maniuplation query
*
* 0 is returned for queries that don't manipulate data.
*
* @return int the number of rows. A DB_Error object on failure.
*/
function affectedRows()
{
if (empty($this->affected)) { // In case of SELECT stms
return 0;
}
$nrows = @odbc_num_rows($this->affected);
if ($nrows == -1) {
return $this->odbcRaiseError();
}
return $nrows;
}
 
// }}}
// {{{ numRows()
 
/**
* Gets the number of rows in a result set
*
* Not all ODBC drivers support this functionality. If they don't
* a DB_Error object for DB_ERROR_UNSUPPORTED is returned.
*
* This method is not meant to be called directly. Use
* DB_result::numRows() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return int the number of rows. A DB_Error object on failure.
*
* @see DB_result::numRows()
*/
function numRows($result)
{
$nrows = @odbc_num_rows($result);
if ($nrows == -1) {
return $this->odbcRaiseError(DB_ERROR_UNSUPPORTED);
}
if ($nrows === false) {
return $this->odbcRaiseError();
}
return $nrows;
}
 
// }}}
// {{{ quoteIdentifier()
 
/**
* Quotes a string so it can be safely used as a table or column name
*
* Use 'mssql' as the dbsyntax in the DB DSN only if you've unchecked
* "Use ANSI quoted identifiers" when setting up the ODBC data source.
*
* @param string $str identifier name to be quoted
*
* @return string quoted identifier string
*
* @see DB_common::quoteIdentifier()
* @since Method available since Release 1.6.0
*/
function quoteIdentifier($str)
{
switch ($this->dsn['dbsyntax']) {
case 'access':
return '[' . $str . ']';
case 'mssql':
case 'sybase':
return '[' . str_replace(']', ']]', $str) . ']';
case 'mysql':
case 'mysqli':
return '`' . $str . '`';
default:
return '"' . str_replace('"', '""', $str) . '"';
}
}
 
// }}}
// {{{ quote()
 
/**
* @deprecated Deprecated in release 1.6.0
* @internal
*/
function quote($str)
{
return $this->quoteSmart($str);
}
 
// }}}
// {{{ nextId()
 
/**
* Returns the next free id in a sequence
*
* @param string $seq_name name of the sequence
* @param boolean $ondemand when true, the seqence is automatically
* created if it does not exist
*
* @return int the next id number in the sequence.
* A DB_Error object on failure.
*
* @see DB_common::nextID(), DB_common::getSequenceName(),
* DB_odbc::createSequence(), DB_odbc::dropSequence()
*/
function nextId($seq_name, $ondemand = true)
{
$seqname = $this->getSequenceName($seq_name);
$repeat = 0;
do {
$this->pushErrorHandling(PEAR_ERROR_RETURN);
$result = $this->query("update ${seqname} set id = id + 1");
$this->popErrorHandling();
if ($ondemand && DB::isError($result) &&
$result->getCode() == DB_ERROR_NOSUCHTABLE) {
$repeat = 1;
$this->pushErrorHandling(PEAR_ERROR_RETURN);
$result = $this->createSequence($seq_name);
$this->popErrorHandling();
if (DB::isError($result)) {
return $this->raiseError($result);
}
$result = $this->query("insert into ${seqname} (id) values(0)");
} else {
$repeat = 0;
}
} while ($repeat);
 
if (DB::isError($result)) {
return $this->raiseError($result);
}
 
$result = $this->query("select id from ${seqname}");
if (DB::isError($result)) {
return $result;
}
 
$row = $result->fetchRow(DB_FETCHMODE_ORDERED);
if (DB::isError($row || !$row)) {
return $row;
}
 
return $row[0];
}
 
/**
* Creates a new sequence
*
* @param string $seq_name name of the new sequence
*
* @return int DB_OK on success. A DB_Error object on failure.
*
* @see DB_common::createSequence(), DB_common::getSequenceName(),
* DB_odbc::nextID(), DB_odbc::dropSequence()
*/
function createSequence($seq_name)
{
return $this->query('CREATE TABLE '
. $this->getSequenceName($seq_name)
. ' (id integer NOT NULL,'
. ' PRIMARY KEY(id))');
}
 
// }}}
// {{{ dropSequence()
 
/**
* Deletes a sequence
*
* @param string $seq_name name of the sequence to be deleted
*
* @return int DB_OK on success. A DB_Error object on failure.
*
* @see DB_common::dropSequence(), DB_common::getSequenceName(),
* DB_odbc::nextID(), DB_odbc::createSequence()
*/
function dropSequence($seq_name)
{
return $this->query('DROP TABLE ' . $this->getSequenceName($seq_name));
}
 
// }}}
// {{{ autoCommit()
 
/**
* Enables or disables automatic commits
*
* @param bool $onoff true turns it on, false turns it off
*
* @return int DB_OK on success. A DB_Error object if the driver
* doesn't support auto-committing transactions.
*/
function autoCommit($onoff = false)
{
if (!@odbc_autocommit($this->connection, $onoff)) {
return $this->odbcRaiseError();
}
return DB_OK;
}
 
// }}}
// {{{ commit()
 
/**
* Commits the current transaction
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function commit()
{
if (!@odbc_commit($this->connection)) {
return $this->odbcRaiseError();
}
return DB_OK;
}
 
// }}}
// {{{ rollback()
 
/**
* Reverts the current transaction
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function rollback()
{
if (!@odbc_rollback($this->connection)) {
return $this->odbcRaiseError();
}
return DB_OK;
}
 
// }}}
// {{{ odbcRaiseError()
 
/**
* Produces a DB_Error object regarding the current problem
*
* @param int $errno if the error is being manually raised pass a
* DB_ERROR* constant here. If this isn't passed
* the error information gathered from the DBMS.
*
* @return object the DB_Error object
*
* @see DB_common::raiseError(),
* DB_odbc::errorNative(), DB_common::errorCode()
*/
function odbcRaiseError($errno = null)
{
if ($errno === null) {
switch ($this->dbsyntax) {
case 'access':
if ($this->options['portability'] & DB_PORTABILITY_ERRORS) {
$this->errorcode_map['07001'] = DB_ERROR_NOSUCHFIELD;
} else {
// Doing this in case mode changes during runtime.
$this->errorcode_map['07001'] = DB_ERROR_MISMATCH;
}
 
$native_code = odbc_error($this->connection);
 
// S1000 is for "General Error." Let's be more specific.
if ($native_code == 'S1000') {
$errormsg = odbc_errormsg($this->connection);
static $error_regexps;
if (!isset($error_regexps)) {
$error_regexps = array(
'/includes related records.$/i' => DB_ERROR_CONSTRAINT,
'/cannot contain a Null value/i' => DB_ERROR_CONSTRAINT_NOT_NULL,
);
}
foreach ($error_regexps as $regexp => $code) {
if (preg_match($regexp, $errormsg)) {
return $this->raiseError($code,
null, null, null,
$native_code . ' ' . $errormsg);
}
}
$errno = DB_ERROR;
} else {
$errno = $this->errorCode($native_code);
}
break;
default:
$errno = $this->errorCode(odbc_error($this->connection));
}
}
return $this->raiseError($errno, null, null, null,
$this->errorNative());
}
 
// }}}
// {{{ errorNative()
 
/**
* Gets the DBMS' native error code and message produced by the last query
*
* @return string the DBMS' error code and message
*/
function errorNative()
{
if (!is_resource($this->connection)) {
return @odbc_error() . ' ' . @odbc_errormsg();
}
return @odbc_error($this->connection) . ' ' . @odbc_errormsg($this->connection);
}
 
// }}}
// {{{ tableInfo()
 
/**
* Returns information about a table or a result set
*
* @param object|string $result DB_result object from a query or a
* string containing the name of a table.
* While this also accepts a query result
* resource identifier, this behavior is
* deprecated.
* @param int $mode a valid tableInfo mode
*
* @return array an associative array with the information requested.
* A DB_Error object on failure.
*
* @see DB_common::tableInfo()
* @since Method available since Release 1.7.0
*/
function tableInfo($result, $mode = null)
{
if (is_string($result)) {
/*
* Probably received a table name.
* Create a result resource identifier.
*/
$id = @odbc_exec($this->connection, "SELECT * FROM $result");
if (!$id) {
return $this->odbcRaiseError();
}
$got_string = true;
} elseif (isset($result->result)) {
/*
* Probably received a result object.
* Extract the result resource identifier.
*/
$id = $result->result;
$got_string = false;
} else {
/*
* Probably received a result resource identifier.
* Copy it.
* Deprecated. Here for compatibility only.
*/
$id = $result;
$got_string = false;
}
 
if (!is_resource($id)) {
return $this->odbcRaiseError(DB_ERROR_NEED_MORE_DATA);
}
 
if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
$case_func = 'strtolower';
} else {
$case_func = 'strval';
}
 
$count = @odbc_num_fields($id);
$res = array();
 
if ($mode) {
$res['num_fields'] = $count;
}
 
for ($i = 0; $i < $count; $i++) {
$col = $i + 1;
$res[$i] = array(
'table' => $got_string ? $case_func($result) : '',
'name' => $case_func(@odbc_field_name($id, $col)),
'type' => @odbc_field_type($id, $col),
'len' => @odbc_field_len($id, $col),
'flags' => '',
);
if ($mode & DB_TABLEINFO_ORDER) {
$res['order'][$res[$i]['name']] = $i;
}
if ($mode & DB_TABLEINFO_ORDERTABLE) {
$res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
}
}
 
// free the result only if we were called on a table
if ($got_string) {
@odbc_free_result($id);
}
return $res;
}
 
// }}}
// {{{ getSpecialQuery()
 
/**
* Obtains the query string needed for listing a given type of objects
*
* Thanks to symbol1@gmail.com and Philippe.Jausions@11abacus.com.
*
* @param string $type the kind of objects you want to retrieve
*
* @return string the list of objects requested
*
* @access protected
* @see DB_common::getListOf()
* @since Method available since Release 1.7.0
*/
function getSpecialQuery($type)
{
switch ($type) {
case 'databases':
if (!function_exists('odbc_data_source')) {
return null;
}
$res = @odbc_data_source($this->connection, SQL_FETCH_FIRST);
if (is_array($res)) {
$out = array($res['server']);
while($res = @odbc_data_source($this->connection,
SQL_FETCH_NEXT))
{
$out[] = $res['server'];
}
return $out;
} else {
return $this->odbcRaiseError();
}
break;
case 'tables':
case 'schema.tables':
$keep = 'TABLE';
break;
case 'views':
$keep = 'VIEW';
break;
default:
return null;
}
 
/*
* Removing non-conforming items in the while loop rather than
* in the odbc_tables() call because some backends choke on this:
* odbc_tables($this->connection, '', '', '', 'TABLE')
*/
$res = @odbc_tables($this->connection);
if (!$res) {
return $this->odbcRaiseError();
}
$out = array();
while ($row = odbc_fetch_array($res)) {
if ($row['TABLE_TYPE'] != $keep) {
continue;
}
if ($type == 'schema.tables') {
$out[] = $row['TABLE_SCHEM'] . '.' . $row['TABLE_NAME'];
} else {
$out[] = $row['TABLE_NAME'];
}
}
return $out;
}
 
// }}}
 
}
 
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/
 
?>
/tags/Racine_livraison_narmer/api/pear/DB/fbsql.php
New file
0,0 → 1,770
<?php
 
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 
/**
* The PEAR DB driver for PHP's fbsql extension
* for interacting with FrontBase databases
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Database
* @package DB
* @author Frank M. Kromann <frank@frontbase.com>
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id: fbsql.php,v 1.3 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/DB
*/
 
/**
* Obtain the DB_common class so it can be extended from
*/
require_once 'DB/common.php';
 
/**
* The methods PEAR DB uses to interact with PHP's fbsql extension
* for interacting with FrontBase databases
*
* These methods overload the ones declared in DB_common.
*
* @category Database
* @package DB
* @author Frank M. Kromann <frank@frontbase.com>
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version Release: 1.7.6
* @link http://pear.php.net/package/DB
* @since Class functional since Release 1.7.0
*/
class DB_fbsql extends DB_common
{
// {{{ properties
 
/**
* The DB driver type (mysql, oci8, odbc, etc.)
* @var string
*/
var $phptype = 'fbsql';
 
/**
* The database syntax variant to be used (db2, access, etc.), if any
* @var string
*/
var $dbsyntax = 'fbsql';
 
/**
* The capabilities of this DB implementation
*
* The 'new_link' element contains the PHP version that first provided
* new_link support for this DBMS. Contains false if it's unsupported.
*
* Meaning of the 'limit' element:
* + 'emulate' = emulate with fetch row by number
* + 'alter' = alter the query
* + false = skip rows
*
* @var array
*/
var $features = array(
'limit' => 'alter',
'new_link' => false,
'numrows' => true,
'pconnect' => true,
'prepare' => false,
'ssl' => false,
'transactions' => true,
);
 
/**
* A mapping of native error codes to DB error codes
* @var array
*/
var $errorcode_map = array(
22 => DB_ERROR_SYNTAX,
85 => DB_ERROR_ALREADY_EXISTS,
108 => DB_ERROR_SYNTAX,
116 => DB_ERROR_NOSUCHTABLE,
124 => DB_ERROR_VALUE_COUNT_ON_ROW,
215 => DB_ERROR_NOSUCHFIELD,
217 => DB_ERROR_INVALID_NUMBER,
226 => DB_ERROR_NOSUCHFIELD,
231 => DB_ERROR_INVALID,
239 => DB_ERROR_TRUNCATED,
251 => DB_ERROR_SYNTAX,
266 => DB_ERROR_NOT_FOUND,
357 => DB_ERROR_CONSTRAINT_NOT_NULL,
358 => DB_ERROR_CONSTRAINT,
360 => DB_ERROR_CONSTRAINT,
361 => DB_ERROR_CONSTRAINT,
);
 
/**
* The raw database connection created by PHP
* @var resource
*/
var $connection;
 
/**
* The DSN information for connecting to a database
* @var array
*/
var $dsn = array();
 
 
// }}}
// {{{ constructor
 
/**
* This constructor calls <kbd>$this->DB_common()</kbd>
*
* @return void
*/
function DB_fbsql()
{
$this->DB_common();
}
 
// }}}
// {{{ connect()
 
/**
* Connect to the database server, log in and open the database
*
* Don't call this method directly. Use DB::connect() instead.
*
* @param array $dsn the data source name
* @param bool $persistent should the connection be persistent?
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function connect($dsn, $persistent = false)
{
if (!PEAR::loadExtension('fbsql')) {
return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
}
 
$this->dsn = $dsn;
if ($dsn['dbsyntax']) {
$this->dbsyntax = $dsn['dbsyntax'];
}
 
$params = array(
$dsn['hostspec'] ? $dsn['hostspec'] : 'localhost',
$dsn['username'] ? $dsn['username'] : null,
$dsn['password'] ? $dsn['password'] : null,
);
 
$connect_function = $persistent ? 'fbsql_pconnect' : 'fbsql_connect';
 
$ini = ini_get('track_errors');
$php_errormsg = '';
if ($ini) {
$this->connection = @call_user_func_array($connect_function,
$params);
} else {
ini_set('track_errors', 1);
$this->connection = @call_user_func_array($connect_function,
$params);
ini_set('track_errors', $ini);
}
 
if (!$this->connection) {
return $this->raiseError(DB_ERROR_CONNECT_FAILED,
null, null, null,
$php_errormsg);
}
 
if ($dsn['database']) {
if (!@fbsql_select_db($dsn['database'], $this->connection)) {
return $this->fbsqlRaiseError();
}
}
 
return DB_OK;
}
 
// }}}
// {{{ disconnect()
 
/**
* Disconnects from the database server
*
* @return bool TRUE on success, FALSE on failure
*/
function disconnect()
{
$ret = @fbsql_close($this->connection);
$this->connection = null;
return $ret;
}
 
// }}}
// {{{ simpleQuery()
 
/**
* Sends a query to the database server
*
* @param string the SQL query string
*
* @return mixed + a PHP result resrouce for successful SELECT queries
* + the DB_OK constant for other successful queries
* + a DB_Error object on failure
*/
function simpleQuery($query)
{
$this->last_query = $query;
$query = $this->modifyQuery($query);
$result = @fbsql_query("$query;", $this->connection);
if (!$result) {
return $this->fbsqlRaiseError();
}
// Determine which queries that should return data, and which
// should return an error code only.
if (DB::isManip($query)) {
return DB_OK;
}
return $result;
}
 
// }}}
// {{{ nextResult()
 
/**
* Move the internal fbsql result pointer to the next available result
*
* @param a valid fbsql result resource
*
* @access public
*
* @return true if a result is available otherwise return false
*/
function nextResult($result)
{
return @fbsql_next_result($result);
}
 
// }}}
// {{{ fetchInto()
 
/**
* Places a row from the result set into the given array
*
* Formating of the array and the data therein are configurable.
* See DB_result::fetchInto() for more information.
*
* This method is not meant to be called directly. Use
* DB_result::fetchInto() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result the query result resource
* @param array $arr the referenced array to put the data in
* @param int $fetchmode how the resulting array should be indexed
* @param int $rownum the row number to fetch (0 = first row)
*
* @return mixed DB_OK on success, NULL when the end of a result set is
* reached or on failure
*
* @see DB_result::fetchInto()
*/
function fetchInto($result, &$arr, $fetchmode, $rownum = null)
{
if ($rownum !== null) {
if (!@fbsql_data_seek($result, $rownum)) {
return null;
}
}
if ($fetchmode & DB_FETCHMODE_ASSOC) {
$arr = @fbsql_fetch_array($result, FBSQL_ASSOC);
if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) {
$arr = array_change_key_case($arr, CASE_LOWER);
}
} else {
$arr = @fbsql_fetch_row($result);
}
if (!$arr) {
return null;
}
if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
$this->_rtrimArrayValues($arr);
}
if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
$this->_convertNullArrayValuesToEmpty($arr);
}
return DB_OK;
}
 
// }}}
// {{{ freeResult()
 
/**
* Deletes the result set and frees the memory occupied by the result set
*
* This method is not meant to be called directly. Use
* DB_result::free() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return bool TRUE on success, FALSE if $result is invalid
*
* @see DB_result::free()
*/
function freeResult($result)
{
return @fbsql_free_result($result);
}
 
// }}}
// {{{ autoCommit()
 
/**
* Enables or disables automatic commits
*
* @param bool $onoff true turns it on, false turns it off
*
* @return int DB_OK on success. A DB_Error object if the driver
* doesn't support auto-committing transactions.
*/
function autoCommit($onoff=false)
{
if ($onoff) {
$this->query("SET COMMIT TRUE");
} else {
$this->query("SET COMMIT FALSE");
}
}
 
// }}}
// {{{ commit()
 
/**
* Commits the current transaction
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function commit()
{
@fbsql_commit();
}
 
// }}}
// {{{ rollback()
 
/**
* Reverts the current transaction
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function rollback()
{
@fbsql_rollback();
}
 
// }}}
// {{{ numCols()
 
/**
* Gets the number of columns in a result set
*
* This method is not meant to be called directly. Use
* DB_result::numCols() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return int the number of columns. A DB_Error object on failure.
*
* @see DB_result::numCols()
*/
function numCols($result)
{
$cols = @fbsql_num_fields($result);
if (!$cols) {
return $this->fbsqlRaiseError();
}
return $cols;
}
 
// }}}
// {{{ numRows()
 
/**
* Gets the number of rows in a result set
*
* This method is not meant to be called directly. Use
* DB_result::numRows() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return int the number of rows. A DB_Error object on failure.
*
* @see DB_result::numRows()
*/
function numRows($result)
{
$rows = @fbsql_num_rows($result);
if ($rows === null) {
return $this->fbsqlRaiseError();
}
return $rows;
}
 
// }}}
// {{{ affectedRows()
 
/**
* Determines the number of rows affected by a data maniuplation query
*
* 0 is returned for queries that don't manipulate data.
*
* @return int the number of rows. A DB_Error object on failure.
*/
function affectedRows()
{
if (DB::isManip($this->last_query)) {
$result = @fbsql_affected_rows($this->connection);
} else {
$result = 0;
}
return $result;
}
 
// }}}
// {{{ nextId()
 
/**
* Returns the next free id in a sequence
*
* @param string $seq_name name of the sequence
* @param boolean $ondemand when true, the seqence is automatically
* created if it does not exist
*
* @return int the next id number in the sequence.
* A DB_Error object on failure.
*
* @see DB_common::nextID(), DB_common::getSequenceName(),
* DB_fbsql::createSequence(), DB_fbsql::dropSequence()
*/
function nextId($seq_name, $ondemand = true)
{
$seqname = $this->getSequenceName($seq_name);
do {
$repeat = 0;
$this->pushErrorHandling(PEAR_ERROR_RETURN);
$result = $this->query('SELECT UNIQUE FROM ' . $seqname);
$this->popErrorHandling();
if ($ondemand && DB::isError($result) &&
$result->getCode() == DB_ERROR_NOSUCHTABLE) {
$repeat = 1;
$result = $this->createSequence($seq_name);
if (DB::isError($result)) {
return $result;
}
} else {
$repeat = 0;
}
} while ($repeat);
if (DB::isError($result)) {
return $this->fbsqlRaiseError();
}
$result->fetchInto($tmp, DB_FETCHMODE_ORDERED);
return $tmp[0];
}
 
/**
* Creates a new sequence
*
* @param string $seq_name name of the new sequence
*
* @return int DB_OK on success. A DB_Error object on failure.
*
* @see DB_common::createSequence(), DB_common::getSequenceName(),
* DB_fbsql::nextID(), DB_fbsql::dropSequence()
*/
function createSequence($seq_name)
{
$seqname = $this->getSequenceName($seq_name);
$res = $this->query('CREATE TABLE ' . $seqname
. ' (id INTEGER NOT NULL,'
. ' PRIMARY KEY(id))');
if ($res) {
$res = $this->query('SET UNIQUE = 0 FOR ' . $seqname);
}
return $res;
}
 
// }}}
// {{{ dropSequence()
 
/**
* Deletes a sequence
*
* @param string $seq_name name of the sequence to be deleted
*
* @return int DB_OK on success. A DB_Error object on failure.
*
* @see DB_common::dropSequence(), DB_common::getSequenceName(),
* DB_fbsql::nextID(), DB_fbsql::createSequence()
*/
function dropSequence($seq_name)
{
return $this->query('DROP TABLE ' . $this->getSequenceName($seq_name)
. ' RESTRICT');
}
 
// }}}
// {{{ modifyLimitQuery()
 
/**
* Adds LIMIT clauses to a query string according to current DBMS standards
*
* @param string $query the query to modify
* @param int $from the row to start to fetching (0 = the first row)
* @param int $count the numbers of rows to fetch
* @param mixed $params array, string or numeric data to be used in
* execution of the statement. Quantity of items
* passed must match quantity of placeholders in
* query: meaning 1 placeholder for non-array
* parameters or 1 placeholder per array element.
*
* @return string the query string with LIMIT clauses added
*
* @access protected
*/
function modifyLimitQuery($query, $from, $count, $params = array())
{
if (DB::isManip($query)) {
return preg_replace('/^([\s(])*SELECT/i',
"\\1SELECT TOP($count)", $query);
} else {
return preg_replace('/([\s(])*SELECT/i',
"\\1SELECT TOP($from, $count)", $query);
}
}
 
// }}}
// {{{ quoteSmart()
 
/**
* Formats input so it can be safely used in a query
*
* @param mixed $in the data to be formatted
*
* @return mixed the formatted data. The format depends on the input's
* PHP type:
* + null = the string <samp>NULL</samp>
* + boolean = string <samp>TRUE</samp> or <samp>FALSE</samp>
* + integer or double = the unquoted number
* + other (including strings and numeric strings) =
* the data escaped according to FrontBase's settings
* then encapsulated between single quotes
*
* @see DB_common::quoteSmart()
* @since Method available since Release 1.6.0
*/
function quoteSmart($in)
{
if (is_int($in) || is_double($in)) {
return $in;
} elseif (is_bool($in)) {
return $in ? 'TRUE' : 'FALSE';
} elseif (is_null($in)) {
return 'NULL';
} else {
return "'" . $this->escapeSimple($in) . "'";
}
}
 
// }}}
// {{{ fbsqlRaiseError()
 
/**
* Produces a DB_Error object regarding the current problem
*
* @param int $errno if the error is being manually raised pass a
* DB_ERROR* constant here. If this isn't passed
* the error information gathered from the DBMS.
*
* @return object the DB_Error object
*
* @see DB_common::raiseError(),
* DB_fbsql::errorNative(), DB_common::errorCode()
*/
function fbsqlRaiseError($errno = null)
{
if ($errno === null) {
$errno = $this->errorCode(fbsql_errno($this->connection));
}
return $this->raiseError($errno, null, null, null,
@fbsql_error($this->connection));
}
 
// }}}
// {{{ errorNative()
 
/**
* Gets the DBMS' native error code produced by the last query
*
* @return int the DBMS' error code
*/
function errorNative()
{
return @fbsql_errno($this->connection);
}
 
// }}}
// {{{ tableInfo()
 
/**
* Returns information about a table or a result set
*
* @param object|string $result DB_result object from a query or a
* string containing the name of a table.
* While this also accepts a query result
* resource identifier, this behavior is
* deprecated.
* @param int $mode a valid tableInfo mode
*
* @return array an associative array with the information requested.
* A DB_Error object on failure.
*
* @see DB_common::tableInfo()
*/
function tableInfo($result, $mode = null)
{
if (is_string($result)) {
/*
* Probably received a table name.
* Create a result resource identifier.
*/
$id = @fbsql_list_fields($this->dsn['database'],
$result, $this->connection);
$got_string = true;
} elseif (isset($result->result)) {
/*
* Probably received a result object.
* Extract the result resource identifier.
*/
$id = $result->result;
$got_string = false;
} else {
/*
* Probably received a result resource identifier.
* Copy it.
* Deprecated. Here for compatibility only.
*/
$id = $result;
$got_string = false;
}
 
if (!is_resource($id)) {
return $this->fbsqlRaiseError(DB_ERROR_NEED_MORE_DATA);
}
 
if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
$case_func = 'strtolower';
} else {
$case_func = 'strval';
}
 
$count = @fbsql_num_fields($id);
$res = array();
 
if ($mode) {
$res['num_fields'] = $count;
}
 
for ($i = 0; $i < $count; $i++) {
$res[$i] = array(
'table' => $case_func(@fbsql_field_table($id, $i)),
'name' => $case_func(@fbsql_field_name($id, $i)),
'type' => @fbsql_field_type($id, $i),
'len' => @fbsql_field_len($id, $i),
'flags' => @fbsql_field_flags($id, $i),
);
if ($mode & DB_TABLEINFO_ORDER) {
$res['order'][$res[$i]['name']] = $i;
}
if ($mode & DB_TABLEINFO_ORDERTABLE) {
$res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
}
}
 
// free the result only if we were called on a table
if ($got_string) {
@fbsql_free_result($id);
}
return $res;
}
 
// }}}
// {{{ getSpecialQuery()
 
/**
* Obtains the query string needed for listing a given type of objects
*
* @param string $type the kind of objects you want to retrieve
*
* @return string the SQL query string or null if the driver doesn't
* support the object type requested
*
* @access protected
* @see DB_common::getListOf()
*/
function getSpecialQuery($type)
{
switch ($type) {
case 'tables':
return 'SELECT "table_name" FROM information_schema.tables'
. ' t0, information_schema.schemata t1'
. ' WHERE t0.schema_pk=t1.schema_pk AND'
. ' "table_type" = \'BASE TABLE\''
. ' AND "schema_name" = current_schema';
case 'views':
return 'SELECT "table_name" FROM information_schema.tables'
. ' t0, information_schema.schemata t1'
. ' WHERE t0.schema_pk=t1.schema_pk AND'
. ' "table_type" = \'VIEW\''
. ' AND "schema_name" = current_schema';
case 'users':
return 'SELECT "user_name" from information_schema.users';
case 'functions':
return 'SELECT "routine_name" FROM'
. ' information_schema.psm_routines'
. ' t0, information_schema.schemata t1'
. ' WHERE t0.schema_pk=t1.schema_pk'
. ' AND "routine_kind"=\'FUNCTION\''
. ' AND "schema_name" = current_schema';
case 'procedures':
return 'SELECT "routine_name" FROM'
. ' information_schema.psm_routines'
. ' t0, information_schema.schemata t1'
. ' WHERE t0.schema_pk=t1.schema_pk'
. ' AND "routine_kind"=\'PROCEDURE\''
. ' AND "schema_name" = current_schema';
default:
return null;
}
}
 
// }}}
}
 
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/
 
?>
/tags/Racine_livraison_narmer/api/pear/DB/NestedSet/TreeMenu.php
New file
0,0 → 1,205
<?php
//
// +----------------------------------------------------------------------+
// | PEAR :: DB_NestedSet_TreeMenu |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Jason Rust <jrust@rustyparts.com> |
// +----------------------------------------------------------------------+
//
// $Id: TreeMenu.php,v 1.1 2006-12-14 15:04:29 jp_milcent Exp $
//
 
require_once 'HTML/TreeMenu.php';
 
// {{{ DB_NestedSet_TreeMenu:: class
 
/**
* A helper class to translate the data from a nested set table into a HTML_TreeMenu object
* so that it can be used to create a dynamic tree menu using the PEAR HTML_TreeMenu class.
*
* @see docs/TreeMenu_example.php
* @author Jason Rust <jrust@rustyparts.com>
* @package DB_NestedSet
* @version $Revision: 1.1 $
* @access public
*/
// }}}
class DB_NestedSet_TreeMenu extends DB_NestedSet_Output {
// {{{ properties
 
/**
* @var array The current menu structure
* @access private
*/
var $_structTreeMenu = false;
 
// }}}
// {{{ DB_NestedSet_TreeMenu
 
function &DB_NestedSet_TreeMenu($params) {
$this->_structTreeMenu =& $this->_createFromStructure($params);
}
 
// }}}
// {{{ _createFromStructure()
 
/**
* <pre>Creates a HTML_TreeMenu structure based off of the results from getAllNodes() method
* of the DB_NestedSet class. The needed parameters are:
* o 'structure' => the result from $nestedSet->getAllNodes(true)
* o 'textField' => the field in the table that has the text for node
* o 'linkField' => the field in the table that has the link for the node
* o 'options' => (optional) an array of any additional options to pass to the node when
* Additionally these parameters may be added to the individual nodes to control their
* behavior:
* o 'ensureVisible' => (optional) whether or not the field should be forced as visible
* creating it such as 'icon' or 'expandedIcon'
* o 'events' => (optional) an array of any events to pass to the node when creating it
* such as 'onclick' or 'onexpand'</pre>
* </pre>
* @access public
* @return object A HTML_TreeMenu object
*/
function &_createFromStructure($params)
{
// Basically we go through the array of nodes checking to see
// if each node has children and if so recursing. The reason this
// works is because the data from getAllNodes() is ordered by level
// so a root node will always be first, and sub children will always
// be after them.
if (!isset($params['treeMenu'])) {
$treeMenu =& new HTML_TreeMenu();
} else {
$treeMenu =& $params['treeMenu'];
}
 
// always start at level 1
if (!isset($params['currentLevel'])) {
$params['currentLevel'] = 1;
}
 
// have to use a while loop here because foreach works on a copy of the array and
// the child nodes are passed by reference during the recursion so that the parent
// will know when they have been hit.
reset($params['structure']);
while(list($key, $node) = each($params['structure'])) {
// see if we've already been here before
if (isset($node['hit'])) {
continue;
}
 
// mark that we've hit this node
$params['structure'][$key]['hit'] = $node['hit'] = true;
$tag = array(
'text' => $node[$params['textField']],
'link' => $node[$params['linkField']],
'ensureVisible' => isset($node['ensureVisible']) ? $node['ensureVisible'] : false,
);
$options = isset($params['options']) ? array_merge($params['options'], $tag) : $tag;
$events = isset($node['events']) ? $node['events'] : array();
$parentNode =& $treeMenu->addItem(new HTML_TreeNode($options, $events));
// see if it has children
if (($node['r'] - 1) != $node['l']) {
$children = array();
// harvest all the children
$tempStructure = $params['structure'];
foreach ($tempStructure as $childKey => $childNode) {
if (!isset($childNode['hit']) &&
$childNode['l'] > $node['l'] &&
$childNode['r'] < $node['r'] &&
$childNode['rootid'] == $node['rootid']) {
// important that we assign it by reference here, so that when the child
// marks itself 'hit' the parent loops will know
$children[] =& $params['structure'][$childKey];
}
}
 
$recurseParams = $params;
$recurseParams['structure'] = $children;
$recurseParams['treeMenu'] =& $parentNode;
$recurseParams['currentLevel']++;
$this->_createFromStructure($recurseParams);
}
}
 
return $treeMenu;
}
 
// }}}
// {{{ printTree()
 
/**
* Print's the current tree using the output driver
*
* @access public
*/
function printTree() {
$options = $this->_getOptions('printTree');
$tree =& new HTML_TreeMenu_DHTML($this->_structTreeMenu, $options);
$tree->printMenu();
}
 
// }}}
// {{{ printListbox()
 
/**
* Print's a listbox representing the current tree
*
* @access public
*/
function printListbox() {
$options = $this->_getOptions('printListbox');
$listBox =& new HTML_TreeMenu_Listbox($this->_structTreeMenu, $options);
$listBox->printMenu();
}
// }}}
 
// }}}
// {{{ tree_toHTML()
 
/**
* Returns the HTML for the DHTML-menu. This method can be
* used instead of printMenu() to use the menu system
* with a template system.
*
* @access public
* @return string The HTML for the menu
* @Author Emanuel Zueger
*/
function tree_toHTML() {
$options = $this->_getOptions('toHTML');
$tree =& new HTML_TreeMenu_DHTML($this->_structTreeMenu, $options);
return $tree->toHTML();
}
 
// }}}
// {{{ listbox_toHTML()
 
/**
* Returns the HTML for the listbox. This method can be
* used instead of printListbox() to use the menu system
* with a template system.
*
* @access public
* @return string The HTML for the listbox
* @author Emanuel Zueger
*/
function listbox_toHTML() {
$options = $this->_getOptions('toHTML');
$listBox =& new HTML_TreeMenu_Listbox($this->_structTreeMenu, $options);
return $listBox->toHTML();
}
 
// }}}
}
?>
/tags/Racine_livraison_narmer/api/pear/DB/NestedSet/DB.php
New file
0,0 → 1,135
<?php
//
// +----------------------------------------------------------------------+
// | PEAR :: DB_NestedSet_DB |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Daniel Khan <dk@webcluster.at> |
// +----------------------------------------------------------------------+
//
// $Id: DB.php,v 1.1 2006-12-14 15:04:29 jp_milcent Exp $
//
 
require_once 'DB.php';
 
// {{{ DB_NestedSet_DB:: class
 
/**
* Wrapper class for PEAR::DB
*
* @author Daniel Khan <dk@webcluster.at>
* @package DB_NestedSet
* @version $Revision: 1.1 $
* @access public
*/
 
// }}}
class DB_NestedSet_DB extends DB_NestedSet {
// {{{ properties
 
/**
* @var object Db object
*/
var $db;
 
// }}}
// {{{ constructor
 
/**
* Constructor
*
* @param mixed $dsn DSN as PEAR dsn URI or dsn Array
* @param array $params Database column fields which should be returned
*
*/
function DB_NestedSet_DB($dsn, $params = array())
{
$this->_debugMessage('DB_NestedSet_DB($dsn, $params = array())');
$this->DB_NestedSet($params);
$this->db =& $this->_db_Connect($dsn);
$this->db->setFetchMode(DB_FETCHMODE_ASSOC);
}
 
// }}}
// {{{ destructor
 
/**
* Destructor
*/
function _DB_NestedSet_DB()
{
$this->_debugMessage('_DB_NestedSet_DB()');
$this->_DB_NestedSet();
$this->_db_Disconnect();
}
 
// }}}
// {{{ _db_Connect()
 
/**
* Connects to the db
*
* @return object DB The database object
* @access private
*/
function &_db_Connect($dsn)
{
$this->_debugMessage('_db_Connect($dsn)');
if (is_object($this->db)) {
return $this->db;
}
 
$db =& DB::connect($dsn);
$this->_testFatalAbort($db, __FILE__, __LINE__);
return $db;
}
 
// }}}
 
 
function _numRows($res) {
return $res->numRows();
}
 
function _isDBError($err) {
if(!DB::isError($err)) {
return false;
}
return true;
}
 
function _quote($str) {
return $this->db->quote($str);
}
 
// {{{ _db_Disconnect()
 
/**
* Disconnects from db
*
* @return void
* @access private
*/
function _db_Disconnect()
{
$this->_debugMessage('_db_Disconnect()');
if (is_object($this->db)) {
@$this->db->disconnect();
}
 
return true;
}
 
// }}}
}
 
?>
/tags/Racine_livraison_narmer/api/pear/DB/NestedSet/TigraMenu.php
New file
0,0 → 1,402
<?php
//
// +----------------------------------------------------------------------+
// | PEAR :: DB_NestedSet_TigraMenu |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Daniel Khan <dk@webcluster.at> |
// +----------------------------------------------------------------------+
//
// $Id: TigraMenu.php,v 1.1 2006-12-14 15:04:29 jp_milcent Exp $
//
 
// {{{ DB_NestedSet_TigraMenu:: class
 
/**
* This class can be used to generate the data to build javascript popup menu
* from a DB_NestedSet node array.
* The Javascript part is done using the free available TigraMenu
* available at http://www.softcomplex.com/products/tigra_menu/.
* Currently version 1.0 is supported.
* Parts of this class where taken ftom the TreemMenu driver by Jason Rust
*
* @author Daniel Khan <dk@webcluster.at>
* @package DB_NestedSet
* @version $Revision: 1.1 $
* @access public
*/
// }}}
class DB_NestedSet_TigraMenu extends DB_NestedSet_Output {
// {{{{ properties
 
/**
* @var integer The depth of the current menu.
* @access private
*/
var $_levels = 1;
 
/**
* @var integer The level we started at
* @access private
*/
var $_levelOffset = false;
 
 
/**
* @var array The current menu structure
* @access private
*/
var $_structTigraMenu = false;
 
/**
* @var array The longest text for each level
* @access private
*/
var $_strlenByLevel = array();
 
// }}}
// {{{ DB_NestedSet_TigraMenu
 
/**
* Constructor
*
* @param array $params A hash with parameters needed by the class
* @see _createFromStructure()
* @return bool
**/
function &DB_NestedSet_TigraMenu($params) {
$this->_menu_id = $params['menu_id'];
$this->_structTigraMenu = $this->_createFromStructure($params);
return true;
}
 
// }}}
// {{{ _createFromStructure()
 
/**
* Creates the JavaScript array for TigraMenu
* Initially this method was introduced for the TreeMenu driver by Jason Rust
*
* o 'structure' => the result from $nestedSet->getAllNodes(true)
* o 'textField' => the field in the table that has the text for node
* o 'linkField' => the field in the table that has the link for the node
*
* @access private
* @return string The TigraMenu JavaScript array
*/
function &_createFromStructure($params)
{
// Basically we go through the array of nodes checking to see
// if each node has children and if so recursing. The reason this
// works is because the data from getAllNodes() is ordered by level
// so a root node will always be first, and sub children will always
// be after them.
 
static $rootlevel;
 
// always start at level 1
if (!isset($params['currentLevel'])) {
$params['currentLevel'] = 1;
}
 
if (!isset($rootlevel)) {
$rootlevel = $params['currentLevel'];
}
 
if (isset($params['tigraMenu'])) {
$tigraMenu = $tigraMenu.$params['tigraMenu'];
}
 
if(!$this->_levelOffset) {
$this->_levelOffset = $params['currentLevel'];
}
 
if($this->_levels < ($params['currentLevel']- $this->_levelOffset)) {
$this->_levels = $params['currentLevel'] - $this->_levelOffset;
}
 
 
// have to use a while loop here because foreach works on a copy of the array and
// the child nodes are passed by reference during the recursion so that the parent
// will know when they have been hit.
reset($params['structure']);
while(list($key, $node) = each($params['structure'])) {
// see if we've already been here before
if (isset($node['hit']) || $node['level'] < $params['currentLevel']) {
continue;
}
 
// mark that we've hit this node
$params['structure'][$key]['hit'] = $node['hit'] = true;
 
$tag = array(
isset($node[$params['textField']]) ? "'".$node[$params['textField']]."'" : 'null',
isset($node[$params['linkField']]) ? "'".$node[$params['linkField']]."'" : 'null'
);
 
if (!$this->_strlenByLevel[$params['currentLevel'] - $this->_levelOffset] ||
strlen($node[$params['textField']]) > $this->_strlenByLevel[$params['currentLevel'] - $this->_levelOffset]) {
$this->_strlenByLevel[$params['currentLevel'] - $this->_levelOffset] = strlen($node[$params['textField']]);
};
 
$tigraMenu = $tigraMenu.$this->_openSubMenu($tag);
 
// see if it has children
if (($node['r'] - 1) != $node['l']) {
$children = array();
// harvest all the children
$tempStructure = $params['structure'];
foreach ($tempStructure as $childKey => $childNode) {
if (!isset($childNode['hit']) &&
$node['rootid'] == $childNode['rootid'] &&
$node['l'] < $childNode['l'] &&
$node['r'] > $childNode['r'] &&
$childNode['level'] > $params['currentLevel']) {
// important that we assign it by reference here, so that when the child
// marks itself 'hit' the parent loops will know
$children[] =& $params['structure'][$childKey];
}
}
 
$recurseParams = $params;
$recurseParams['structure'] = $children;
$recurseParams['currentLevel']++;
$tigraMenu = $tigraMenu.$this->_createFromStructure($recurseParams);
}
 
$tigraMenu = $tigraMenu.$this->_closeSubMenu();
}
return $tigraMenu;
}
 
// }}}
// {{{ _openMenu()
 
/**
* Returns the string which opens the JavaScript menu
*
* @access private
* @param int $menu_id ID of the menu needed to use more than one menu on a page
* @return string The JavaScript piece
*/
function _openMenu($menu_id=1)
{
$str = false;
$str = $str."var MENU_ITEMS".$menu_id." = new Array();\n";
$str = $str."MENU_ITEMS".$menu_id." = [\n";
return $str;
}
 
// }}}
// {{{ _openSubMenu()
 
/**
* Returns the string which opens a submenu within the JavaScript menu
*
* @access private
* @param array $tag Contains the content of the current item (name, link)
* @return string The JavaScript piece
*/
function _openSubMenu($tag)
{
$rtag = implode(', ', $tag);
return "\n[".$rtag.',';
}
 
// }}}
// {{{ _closeMenu()
 
/**
* Closes the JavaScript array
*
* @access private
* @return string The JavaScript piece
*/
function _closeMenu()
{
 
return '];';
}
 
// }}}
// {{{ _closeSubMenu()
 
/**
* Closes the JavaScript array of a submenu
*
* @access private
* @return string The JavaScript piece
*/
function _closeSubMenu()
{
return "\n],";
}
 
// }}}
// {{{ _addStyles()
 
/**
* Creates the JavaScript code which sets the styles for each level
*
* @access private
* @param int $menu_id ID of the menu needed to use more than one menu on a page
* @param array $rootStyles Array of style attributes for the top items
* @param array $childStyles Array of style attributes for the sub items
* @return string The JavaScript piece
*/
function _addStyles($menu_id, $rootStyles, $childStyles = false)
{
if (!$childStyles) {
$childStyles = $rootStyles;
}
 
$styles = array();
foreach ($rootStyles as $key => $val) {
foreach ($val as $skey => $sval) {
$styles["'$key'"][$skey][] = "'$sval'";
}
}
 
foreach ($childStyles as $key => $val) {
foreach ($val as $skey => $sval) {
for ($i = 1; $i <= $this->_levels; $i++) {
$styles["'$key'"][$skey][] = "'$sval'";
}
}
}
 
$menustyles = false;
$menustyles = $menustyles . 'var MENU_STYLES'.$menu_id." = new Array();\n";
foreach ($styles as $key => $val) {
$menustyles = $menustyles.'MENU_STYLES'.$menu_id."[$key] = [\n";
foreach ($val as $skey => $sval) {
$menustyles = $menustyles . "'$skey', [".implode(', ', $sval)."],\n";
}
$menustyles = $menustyles."];\n";
}
 
return $menustyles;
}
 
// }}}
// {{{ _addGeometry()
 
/**
* Creates the JavaScript code which sets the position and geometry of the menu
*
* @access private
* @param int $menu_id ID of the menu needed to use more than one menu on a page
* @param array $rootGeometry Array of geometry attributes for the top items
* @param array $childGeometry Array of geometry attributes for the sub items
* @return string The JavaScript piece
*/
function _addGeometry($menu_id, $rootGeometry, $childGeometry = false)
{
if (!$childGeometry) {
$childGeometry = $rootGeometry;
}
 
$params = array();
$geometry = array();
foreach ($rootGeometry as $key => $val) {
$geometry["'$key'"][] = $val;
$incr = false;
if (strpos($val, ',') !== false) {
list($start, $interval) = explode(',',$val);
$incr = true;
}
 
$ratio = false;
if ($key == 'width' && strpos($val, '*') !== false) {
$ratio = trim(str_replace('*','', $val));
}
if ($incr) {
$val = trim($interval);
if ($key == 'left' && preg_match('/[+-]/', $interval)) {
$val = $params[0]['width'] + trim($val);
}
} elseif ($incr) {
$val = trim($start);
} elseif ($ratio) {
$val = $ratio * $this->_strlenByLevel[0];
}
$geometry["'$key'"][0] = $val;
$params[0][$key] = $val;
}
 
foreach($childGeometry as $key => $val) {
$incr = false;
if (strpos($val, ',') !== false) {
list($start, $interval) = explode(',', $val);
$incr = true;
}
 
$ratio = false;
if ($key == 'width' && strpos($val, '*') !== false) {
$ratio = trim(str_replace('*', '', $val));
}
 
for ($i = 1; $i <= $this->_levels; $i++) {
if ($incr && isset($lastval[$key])) {
$val = trim($interval);
if($key == 'block_left' && preg_match('/[+-]/', $interval)) {
$val = $params[$i - 1]['width'] + trim($val);
}
} elseif($incr) {
$val = trim($start);
} elseif ($ratio) {
$val = $ratio * $this->_strlenByLevel[$i];
if($val < $params[0]['width']) {
$val = $params[0]['width'];
}
}
 
$lastval[$key] = $val;
$geometry["'$key'"][] = $val;
$params[$i][$key] = $val;
}
 
}
 
$pos = false;
$pos = $pos . 'var MENU_POS'.$menu_id." = new Array();\n";
foreach ($geometry as $key => $val) {
$pos = $pos . 'MENU_POS' . $menu_id . "[$key] = [" . implode(', ', $val) . "];\n";
}
 
return $pos;
}
 
// }}}
// {{{ printTree()
 
/**
* Print's the current tree using the output driver
*
* @access public
*/
function printTree()
{
if (!$options = $this->_getOptions('printTree')) {
return PEAR::raiseError("TigraMenu::printTree() needs options. See TigraMenu::setOptions()", NESEO_ERROR_NO_OPTIONS, PEAR_ERROR_TRIGGER, E_USER_ERROR);
}
 
echo $this->_openMenu($options['menu_id']) . $this->_structTigraMenu .$this->_closeMenu();
echo "\n\n";
echo $this->_addStyles($options['menu_id'], $options['rootStyles'], $options['childStyles']);
echo "\n\n";
echo $this->_addGeometry($options['menu_id'], $options['rootGeometry'], $options['childGeometry']);
}
 
// }}}
}
?>
/tags/Racine_livraison_narmer/api/pear/DB/NestedSet/Output.php
New file
0,0 → 1,211
<?php
//
// +----------------------------------------------------------------------+
// | PEAR :: DB_NestedSet_Output |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Daniel Khan <dk@webcluster.at> |
// | Jason Rust <jason@rustyparts.com> |
// +----------------------------------------------------------------------+
// $Id: Output.php,v 1.1 2006-12-14 15:04:29 jp_milcent Exp $
//
 
require_once 'PEAR.php';
 
// {{{ constants
 
define('NESEO_ERROR_NO_METHOD', 'E1000');
define('NESEO_DRIVER_NOT_FOUND', 'E1100');
define('NESEO_ERROR_NO_OPTIONS', 'E2100');
 
// }}}
// {{{ DB_NestedSet_Output:: class
 
/**
* DB_NestedSet_Output is a unified API for other output drivers
* Status is beta
*
* At the moment PEAR::HTML_TreeMenu written by Jason Rust is supported
* A driver for treemenu.org will follow soon.
*
* Usage example:
*
* require_once('DB_NestedSet/NestedSet/Output.php');
* $icon = 'folder.gif';
* $expandedIcon = 'folder-expanded.gif';
* // get data (important to fetch it as an array, using the true flag)
* $data = $NeSe->getAllNodes(true);
* // change the events for one of the elements
* $data[35]['events'] = array('onexpand' => 'alert("we expanded!");');
* // add links to each item
* foreach ($data as $a_data) {
* $a_data['link'] = 'http://foo.com/foo.php?' . $a_data['id'];
* }
* $params = array(
* 'structure' => $data,
* 'options' => array(
* 'icon' => $icon,
* 'expandedIcon' => $expandedIcon,
* ),
* 'textField' => 'name',
* 'linkField' => 'link',
* );
* $menu =& DB_NestedSet_Output::factory('TreeMenu', $params);
* $menu->printListbox();
*
* @author Daniel Khan <dk@webcluster.at>
* @package DB_NestedSet
* @version $Revision: 1.1 $
* @access public
*
*/
 
// }}}
class DB_NestedSet_Output {
// {{{ properties
 
/**
* @var object The tree menu structure
* @access private
*/
var $_structTreeMenu = false;
 
/**
* @var array Array of options to be passed to the ouput methods
* @access public
*/
var $options = array();
 
// }}}
// {{{ factory()
 
/**
* Returns a output driver object
*
* @param array $params A DB_NestedSet nodeset
* @param string $driver (optional) The driver, such as TreeMenu (default)
*
* @access public
* @return object The DB_NestedSet_Ouput object
*/
function &factory ($params, $driver = 'TreeMenu') {
 
$path = dirname(__FILE__).'/'.$driver.'.php';
 
if(is_dir($path) || !file_exists($path)) {
PEAR::raiseError("The output driver '$driver' wasn't found", NESEO_DRIVER_NOT_FOUND, PEAR_ERROR_TRIGGER, E_USER_ERROR);
}
 
require_once($path);
$driverClass = 'DB_NestedSet_'.$driver;
return new $driverClass($params);
}
 
// }}}
// {{{ setOptions()
 
/**
* Set's options for a specific output group (printTree, printListbox)
* This enables you to set specific options for each output method
*
* @param string $group Output group ATM 'printTree' or 'printListbox'
* @param array $options Hash with options
*
* @access public
* @return bool
*/
function setOptions($group, $options) {
$this->options[$group] = $options;
return true;
}
 
// }}}
// {{{ _getOptions()
 
/**
* Get's all option for a specific output group (printTree, printListbox)
*
* @param string $group Output group ATM 'printTree' or 'printListbox'
*
* @access private
* @return array Options
*/
function _getOptions($group) {
 
if (!isset($this->options[$group])) {
return array();
}
return $this->options[$group];
}
 
// }}}
// {{{ printTree()
 
/**
* Print's the current tree using the output driver
* Overriden by the driver class
*
* @access public
*/
function printTree() {
PEAR::raiseError("Method not available for this driver", NESEO_ERROR_NO_METHOD, PEAR_ERROR_TRIGGER, E_USER_ERROR);
}
 
// }}}
// {{{ printListbox()
 
/**
* Print's a listbox representing the current tree
* Overriden by the driver class
*
* @access public
*/
function printListbox() {
PEAR::raiseError("Method not available for this driver", NESEO_ERROR_NO_METHOD, PEAR_ERROR_TRIGGER, E_USER_ERROR);
}
 
// }}}
 
// {{{ toHTML()
 
/**
* Returns the HTML for the DHTML-menu. This method can be
* used instead of printMenu() to use the menu system
* with a template system.
*
* @access public
* @return string The HTML for the menu
* @author Emanuel Zueger
*/
function tree_toHTML() {
PEAR::raiseError("Method not available for this driver", NESEO_ERROR_NO_METHOD, PEAR_ERROR_TRIGGER, E_USER_ERROR);
}
 
// }}}
// {{{ listbox_toHTML()
 
/**
* Returns the HTML for the listbox. This method can be
* used instead of printListbox() to use the menu system
* with a template system.
*
* @access public
* @return string The HTML for the listbox
* @author Emanuel Zueger
*/
function listbox_toHTML() {
PEAR::raiseError("Method not available for this driver", NESEO_ERROR_NO_METHOD, PEAR_ERROR_TRIGGER, E_USER_ERROR);
}
 
// }}}
}
?>
/tags/Racine_livraison_narmer/api/pear/DB/NestedSet/Event.php
New file
0,0 → 1,79
<?php
/**
// +----------------------------------------------------------------------+
// | PEAR :: DB_NestedSet_DB |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Daniel Khan <dk@webcluster.at> |
// +----------------------------------------------------------------------+
//
// $Id: Event.php,v 1.1 2006-12-14 15:04:29 jp_milcent Exp $
//
//
*/
 
/**
* Poor mans event handler for DB_NestedSet
*
* Mostly for demo purposes or for extending it if
* someone has ideas...
*
* @author Daniel Khan <dk@webcluster.at>
* @package DB_NestedSet
* @version $Revision: 1.1 $
* @access public
*/
Class DB_NestedSetEvent extends PEAR {
 
/**
* Constructor
*
* @return void
*/
function DB_NestedSetEvent() {
 
$this->PEAR();
}
 
/**
* Destructor
*
* @return void
*/
function _DB_NestedSetEvent() {
 
$this->_PEAR();
}
 
 
/**
* Calls the event handler
*
* You may want to do a switch() here and call you methods
* depending on the event
*
* @param string $event The Event that occured
* @param object node $node A Reference to the node object which was subject to changes
* @param array $eparams A associative array of params which may be needed by the handler
* @return void
* @access private
*/
function callEvent($event, &$node, $eparams = array()) {
 
echo "<br>Override callEvent() if you want to have custom event handlers<br>\n";
echo "Event $event was called with the following params:<br><br>\n";
echo "<PRE>";
print_r($eparams);
echo "</PRE><br>\n";
}
}
?>
/tags/Racine_livraison_narmer/api/pear/DB/NestedSet/MDB.php
New file
0,0 → 1,136
<?php
//
// +----------------------------------------------------------------------+
// | PEAR :: DB_NestedSet_MDB |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Daniel Khan <dk@webcluster.at> |
// +----------------------------------------------------------------------+
// Thanks to Hans Lellelid for suggesting support for PEAR::MDB
// and for his help in implementing this.
//
// $Id: MDB.php,v 1.1 2006-12-14 15:04:29 jp_milcent Exp $
//
 
require_once 'MDB.php';
 
// {{{ DB_NestedSet_MDB:: class
 
/**
* Wrapper class for PEAR::MDB
*
* @author Daniel Khan <dk@webcluster.at>
* @package DB_NestedSet
* @version $Revision: 1.1 $
* @access public
*/
// }}}
class DB_NestedSet_MDB extends DB_NestedSet {
// {{{ properties
 
/**
* @var object The MDB object
*/
var $db;
 
// }}}
// {{{ constructor
 
/**
* Constructor
*
* @param mixed $dsn DSN as PEAR dsn URI or dsn Array
* @param array $params Database column fields which should be returned
*
*/
function DB_NestedSet_MDB($dsn, $params = array())
{
$this->_debugMessage('DB_NestedSet_MDB($dsn, $params = array())');
$this->DB_NestedSet($params);
$this->db =& $this->_db_Connect($dsn);
$this->db->setFetchMode(MDB_FETCHMODE_ASSOC);
}
 
// }}}
// {{{ destructor
 
/**
* Destructor
*/
function _DB_NestedSet_MDB()
{
$this->_debugMessage('_DB_NestedSet_MDB()');
$this->_DB_NestedSet();
$this->_db_Disconnect();
}
 
// }}}
// {{{ _db_Connect()
 
/**
* Connects to the db
*
* @return object DB The database object
* @access private
*/
function &_db_Connect($dsn)
{
$this->_debugMessage('_db_Connect($dsn)');
if (is_object($this->db)) {
return $this->db;
}
 
$db =& MDB::connect($dsn);
$this->_testFatalAbort($db, __FILE__, __LINE__);
 
return $db;
}
 
// }}}
 
function _isDBError($err) {
if(!MDB::isError($err)) {
return false;
}
return true;
}
 
function _numRows($res) {
return $this->db->numRows($res);
}
 
function _quote($str) {
return $this->db->getTextValue($str);
}
 
// {{{ _db_Disconnect()
 
/**
* Disconnects from db
*
* @return void
* @access private
*/
function _db_Disconnect()
{
$this->_debugMessage('_db_Disconnect()');
if (is_object($this->db)) {
@$this->db->disconnect();
}
 
return true;
}
 
// }}}
}
 
?>
/tags/Racine_livraison_narmer/api/pear/DB/DataObject/createTables.php
New file
0,0 → 1,55
#!/usr/bin/php -q
<?php
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Alan Knowles <alan@akbkhome.com>
// +----------------------------------------------------------------------+
//
// $Id: createTables.php,v 1.1 2006-12-14 15:04:28 jp_milcent Exp $
//
 
// since this version doesnt use overload,
// and I assume anyone using custom generators should add this..
 
define('DB_DATAOBJECT_NO_OVERLOAD',1);
 
require_once 'DB/DataObject/Generator.php';
 
if (!ini_get('register_argc_argv')) {
PEAR::raiseError("\nERROR: You must turn register_argc_argv On in you php.ini file for this to work\neg.\n\nregister_argc_argv = On\n\n", null, PEAR_ERROR_DIE);
exit;
}
 
if (!@$_SERVER['argv'][1]) {
PEAR::raiseError("\nERROR: createTable.php usage:\n\nC:\php\pear\DB\DataObjects\createTable.php example.ini\n\n", null, PEAR_ERROR_DIE);
exit;
}
 
$config = parse_ini_file($_SERVER['argv'][1], true);
foreach($config as $class=>$values) {
$options = &PEAR::getStaticProperty($class,'options');
$options = $values;
}
 
 
$options = &PEAR::getStaticProperty('DB_DataObject','options');
if (empty($options)) {
PEAR::raiseError("\nERROR: could not read ini file\n\n", null, PEAR_ERROR_DIE);
exit;
}
set_time_limit(0);
DB_DataObject::debugLevel(1);
$generator = new DB_DataObject_Generator;
$generator->start();
/tags/Racine_livraison_narmer/api/pear/DB/DataObject/Generator.php
New file
0,0 → 1,929
<?php
/**
* Generation tools for DB_DataObject
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Database
* @package DB_DataObject
* @author Alan Knowles <alan@akbkhome.com>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id: Generator.php,v 1.1 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/DB_DataObject
*/
/**
*
* Config _$ptions
* [DB_DataObject_Generator]
* ; optional default = DB/DataObject.php
* extends_location =
* ; optional default = DB_DataObject
* extends =
* ; alter the extends field when updating a class (defaults to only replacing DB_DataObject)
* generator_class_rewrite = ANY|specific_name // default is DB_DataObject
*
*/
 
/**
* Needed classes
*/
require_once 'DB/DataObject.php';
//require_once('Config.php');
 
/**
* Generator class
*
* @package DB_DataObject
*/
class DB_DataObject_Generator extends DB_DataObject
{
/* =========================================================== */
/* Utility functions - for building db config files */
/* =========================================================== */
 
/**
* Array of table names
*
* @var array
* @access private
*/
var $tables;
 
/**
* associative array table -> array of table row objects
*
* @var array
* @access private
*/
var $_definitions;
 
/**
* active table being output
*
* @var string
* @access private
*/
var $table; // active tablename
 
 
/**
* The 'starter' = call this to start the process
*
* @access public
* @return none
*/
function start()
{
$options = &PEAR::getStaticProperty('DB_DataObject','options');
$databases = array();
foreach($options as $k=>$v) {
if (substr($k,0,9) == 'database_') {
$databases[substr($k,9)] = $v;
}
}
 
if (@$options['database']) {
require_once 'DB.php';
$dsn = DB::parseDSN($options['database']);
if (!isset($database[$dsn['database']])) {
$databases[$dsn['database']] = $options['database'];
}
}
 
foreach($databases as $databasename => $database) {
if (!$database) {
continue;
}
$this->debug("CREATING FOR $databasename\n");
$class = get_class($this);
$t = new $class;
$t->_database_dsn = $database;
$t->_database = $databasename;
$dsn = DB::parseDSN($database);
if (($dsn['phptype'] == 'sqlite') && is_file($databasename)) {
$t->_database = basename($t->_database);
}
$t->_createTableList();
 
foreach(get_class_methods($class) as $method) {
if (substr($method,0,8 ) != 'generate') {
continue;
}
$this->debug("calling $method");
$t->$method();
}
}
$this->debug("DONE\n\n");
}
 
/**
* Output File was config object, now just string
* Used to generate the Tables
*
* @var string outputbuffer for table definitions
* @access private
*/
var $_newConfig;
 
/**
* Build a list of tables;
* Currently this is very Mysql Specific - ideas for more generic stiff welcome
*
* @access private
* @return none
*/
function _createTableList()
{
$this->_connect();
$options = &PEAR::getStaticProperty('DB_DataObject','options');
 
$__DB= &$GLOBALS['_DB_DATAOBJECT']['CONNECTIONS'][$this->_database_dsn_md5];
// try getting a list of schema tables first. (postgres)
$__DB->expectError(DB_ERROR_UNSUPPORTED);
$this->tables = $__DB->getListOf('schema.tables');
$__DB->popExpect();
if (empty($this->tables) || is_a($this->tables , 'PEAR_Error')) {
//if that fails fall back to clasic tables list.
$this->tables = $__DB->getListOf('tables');
}
if (is_a($this->tables , 'PEAR_Error')) {
return PEAR::raiseError($this->tables->toString(), null, PEAR_ERROR_DIE);
}
// build views as well if asked to.
if (!empty($options['build_views'])) {
$views = $__DB->getListOf('views');
if (is_a($views,'PEAR_Error')) {
return PEAR::raiseError(
'Error getting Views (check the PEAR bug database for the fix to DB), ' .
$views->toString(),
null,
PEAR_ERROR_DIE
);
}
$this->tables = array_merge ($this->tables, $views);
}
// declare a temporary table to be filled with matching tables names
$tmp_table = array();
 
 
foreach($this->tables as $table) {
if (isset($options['generator_include_regex']) &&
!preg_match($options['generator_include_regex'],$table)) {
continue;
} else if (isset($options['generator_exclude_regex']) &&
preg_match($options['generator_exclude_regex'],$table)) {
continue;
}
// postgres strip the schema bit from the
if (!empty($options['generator_strip_schema'])) {
$bits = explode('.', $table,2);
$table = $bits[0];
if (count($bits) > 1) {
$table = $bits[1];
}
}
$defs = $__DB->tableInfo($table);
if (is_a($defs,'PEAR_Error')) {
echo $defs->toString();
exit;
}
// cast all definitions to objects - as we deal with that better.
foreach($defs as $def) {
if (!is_array($def)) {
continue;
}
$this->_definitions[$table][] = (object) $def;
}
// we find a matching table, just store it into a temporary array
$tmp_table[] = $table;
}
// the temporary table array is now the right one (tables names matching
// with regex expressions have been removed)
$this->tables = $tmp_table;
//print_r($this->_definitions);
}
 
/**
* Auto generation of table data.
*
* it will output to db_oo_{database} the table definitions
*
* @access private
* @return none
*/
function generateDefinitions()
{
$this->debug("Generating Definitions file: ");
if (!$this->tables) {
$this->debug("-- NO TABLES -- \n");
return;
}
 
$options = &PEAR::getStaticProperty('DB_DataObject','options');
 
 
//$this->_newConfig = new Config('IniFile');
$this->_newConfig = '';
foreach($this->tables as $this->table) {
$this->_generateDefinitionsTable();
}
$this->_connect();
// dont generate a schema if location is not set
// it's created on the fly!
if (!@$options['schema_location'] && @!$options["ini_{$this->_database}"] ) {
return;
}
$base = @$options['schema_location'];
if (isset($options["ini_{$this->_database}"])) {
$file = $options["ini_{$this->_database}"];
} else {
$file = "{$base}/{$this->_database}.ini";
}
if (!file_exists(dirname($file))) {
require_once 'System.php';
System::mkdir(array('-p','-m',0755,dirname($file)));
}
$this->debug("Writing ini as {$file}\n");
touch($file);
//print_r($this->_newConfig);
$fh = fopen($file,'w');
fwrite($fh,$this->_newConfig);
fclose($fh);
//$ret = $this->_newConfig->writeInput($file,false);
 
//if (PEAR::isError($ret) ) {
// return PEAR::raiseError($ret->message,null,PEAR_ERROR_DIE);
// }
}
 
/**
* The table geneation part
*
* @access private
* @return tabledef and keys array.
*/
function _generateDefinitionsTable()
{
global $_DB_DATAOBJECT;
$defs = $this->_definitions[$this->table];
$this->_newConfig .= "\n[{$this->table}]\n";
$keys_out = "\n[{$this->table}__keys]\n";
$keys_out_primary = '';
$keys_out_secondary = '';
if (@$_DB_DATAOBJECT['CONFIG']['debug'] > 2) {
echo "TABLE STRUCTURE FOR {$this->table}\n";
print_r($defs);
}
$DB = $this->getDatabaseConnection();
$dbtype = $DB->phptype;
$ret = array(
'table' => array(),
'keys' => array(),
);
$ret_keys_primary = array();
$ret_keys_secondary = array();
foreach($defs as $t) {
$n=0;
 
switch (strtoupper($t->type)) {
 
case 'INT':
case 'INT2': // postgres
case 'INT4': // postgres
case 'INT8': // postgres
case 'SERIAL4': // postgres
case 'SERIAL8': // postgres
case 'INTEGER':
case 'TINYINT':
case 'SMALLINT':
case 'MEDIUMINT':
case 'BIGINT':
$type = DB_DATAOBJECT_INT;
if ($t->len == 1) {
$type += DB_DATAOBJECT_BOOL;
}
break;
case 'REAL':
case 'DOUBLE':
case 'FLOAT':
case 'FLOAT8': // double precision (postgres)
case 'DECIMAL':
case 'NUMERIC':
case 'NUMBER': // oci8
$type = DB_DATAOBJECT_INT; // should really by FLOAT!!! / MONEY...
break;
case 'YEAR':
$type = DB_DATAOBJECT_INT;
break;
case 'BIT':
case 'BOOL':
case 'BOOLEAN':
$type = DB_DATAOBJECT_BOOL;
// postgres needs to quote '0'
if ($dbtype == 'pgsql') {
$type += DB_DATAOBJECT_STR;
}
break;
case 'STRING':
case 'CHAR':
case 'VARCHAR':
case 'VARCHAR2':
case 'TINYTEXT':
case 'ENUM':
case 'SET': // not really but oh well
case 'TIMESTAMPTZ': // postgres
case 'BPCHAR': // postgres
case 'INTERVAL': // postgres (eg. '12 days')
case 'CIDR': // postgres IP net spec
case 'INET': // postgres IP
case 'MACADDR': // postgress network Mac address.
$type = DB_DATAOBJECT_STR;
break;
case 'TEXT':
case 'MEDIUMTEXT':
case 'LONGTEXT':
$type = DB_DATAOBJECT_STR + DB_DATAOBJECT_TXT;
break;
case 'DATE':
$type = DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE;
break;
case 'TIME':
$type = DB_DATAOBJECT_STR + DB_DATAOBJECT_TIME;
break;
case 'DATETIME':
$type = DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME;
break;
case 'TIMESTAMP': // do other databases use this???
$type = ($dbtype == 'mysql') ?
DB_DATAOBJECT_MYSQLTIMESTAMP :
DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME;
break;
case 'TINYBLOB':
case 'BLOB': /// these should really be ignored!!!???
case 'MEDIUMBLOB':
case 'LONGBLOB':
case 'BYTEA': // postgres blob support..
$type = DB_DATAOBJECT_STR + DB_DATAOBJECT_BLOB;
break;
}
if (!strlen(trim($t->name))) {
continue;
}
if (preg_match('/not_null/i',$t->flags)) {
$type += DB_DATAOBJECT_NOTNULL;
}
$write_ini = true;
if (in_array($t->name,array('null','yes','no','true','false'))) {
echo "*****************************************************************\n".
"** WARNING **\n".
"** Found column '{$t->name}', which is invalid in an .ini file **\n".
"** This line will not be writen to the file - you will have **\n".
"** define the keys()/method manually. **\n".
"*****************************************************************\n";
$write_ini = false;
} else {
$this->_newConfig .= "{$t->name} = $type\n";
}
$ret['table'][$t->name] = $type;
// i've no idea if this will work well on other databases?
// only use primary key or nextval(), cause the setFrom blocks you setting all key items...
// if no keys exist fall back to using unique
//echo "\n{$t->name} => {$t->flags}\n";
if (preg_match("/(auto_increment|nextval\()/i",rawurldecode($t->flags))) {
// native sequences = 2
if ($write_ini) {
$keys_out_primary .= "{$t->name} = N\n";
}
$ret_keys_primary[$t->name] = 'N';
} else if (preg_match("/(primary|unique)/i",$t->flags)) {
// keys.. = 1
if ($write_ini) {
$keys_out_secondary .= "{$t->name} = K\n";
}
$ret_keys_secondary[$t->name] = 'K';
}
}
$this->_newConfig .= $keys_out . (empty($keys_out_primary) ? $keys_out_secondary : $keys_out_primary);
$ret['keys'] = empty($keys_out_primary) ? $ret_keys_secondary : $ret_keys_primary;
if (@$_DB_DATAOBJECT['CONFIG']['debug'] > 2) {
print_r(array("dump for {$this->table}", $ret));
}
return $ret;
}
 
/*
* building the class files
* for each of the tables output a file!
*/
function generateClasses()
{
//echo "Generating Class files: \n";
$options = &PEAR::getStaticProperty('DB_DataObject','options');
$base = $options['class_location'];
if (strpos($base,'%s') !== false) {
$base = dirname($base);
}
if (!file_exists($base)) {
require_once 'System.php';
System::mkdir(array('-p',$base));
}
$class_prefix = $options['class_prefix'];
if ($extends = @$options['extends']) {
$this->_extends = $extends;
$this->_extendsFile = $options['extends_location'];
}
 
foreach($this->tables as $this->table) {
$this->table = trim($this->table);
$this->classname = $class_prefix.preg_replace('/[^A-Z0-9]/i','_',ucfirst($this->table));
$i = '';
if (strpos($options['class_location'],'%s') !== false) {
$outfilename = sprintf($options['class_location'], preg_replace('/[^A-Z0-9]/i','_',ucfirst($this->table)));
} else {
$outfilename = "{$base}/".preg_replace('/[^A-Z0-9]/i','_',ucfirst($this->table)).".php";
}
$oldcontents = '';
if (file_exists($outfilename)) {
// file_get_contents???
$oldcontents = implode('',file($outfilename));
}
$out = $this->_generateClassTable($oldcontents);
$this->debug( "writing $this->classname\n");
$fh = fopen($outfilename, "w");
fputs($fh,$out);
fclose($fh);
}
//echo $out;
}
 
/**
* class being extended (can be overridden by [DB_DataObject_Generator] extends=xxxx
*
* @var string
* @access private
*/
var $_extends = 'DB_DataObject';
 
/**
* line to use for require('DB/DataObject.php');
*
* @var string
* @access private
*/
var $_extendsFile = "DB/DataObject.php";
 
/**
* class being generated
*
* @var string
* @access private
*/
var $_className;
 
/**
* The table class geneation part - single file.
*
* @access private
* @return none
*/
function _generateClassTable($input = '')
{
// title = expand me!
$foot = "";
$head = "<?php\n/**\n * Table Definition for {$this->table}\n */\n";
// requires
$head .= "require_once '{$this->_extendsFile}';\n\n";
// add dummy class header in...
// class
$head .= "class {$this->classname} extends {$this->_extends} \n{";
 
$body = "\n ###START_AUTOCODE\n";
$body .= " /* the code below is auto generated do not remove the above tag */\n\n";
// table
$padding = (30 - strlen($this->table));
if ($padding < 2) $padding =2;
$p = str_repeat(' ',$padding) ;
$options = &PEAR::getStaticProperty('DB_DataObject','options');
$var = (substr(phpversion(),0,1) > 4) ? 'public' : 'var';
$body .= " {$var} \$__table = '{$this->table}'; {$p}// table name\n";
// if we are using the option database_{databasename} = dsn
// then we should add var $_database = here
// as database names may not always match..
if (isset($options["database_{$this->_database}"])) {
$body .= " {$var} \$_database = '{$this->_database}'; {$p}// database name (used with database_{*} config)\n";
}
$var = (substr(phpversion(),0,1) > 4) ? 'public' : 'var';
if (!empty($options['generator_novars'])) {
$var = '//'.$var;
}
$defs = $this->_definitions[$this->table];
 
// show nice information!
$connections = array();
$sets = array();
foreach($defs as $t) {
if (!strlen(trim($t->name))) {
continue;
}
$padding = (30 - strlen($t->name));
if ($padding < 2) $padding =2;
$p = str_repeat(' ',$padding) ;
$body .=" {$var} \${$t->name}; {$p}// {$t->type}({$t->len}) {$t->flags}\n";
// can not do set as PEAR::DB table info doesnt support it.
//if (substr($t->Type,0,3) == "set")
// $sets[$t->Field] = "array".substr($t->Type,3);
$body .= $this->derivedHookVar($t,$padding);
}
 
// THIS IS TOTALLY BORKED old FC creation
// IT WILL BE REMOVED!!!!! in DataObjects 1.6
// grep -r __clone * to find all it's uses
// and replace them with $x = clone($y);
// due to the change in the PHP5 clone design.
if ( substr(phpversion(),0,1) < 5) {
$body .= "\n";
$body .= " /* ZE2 compatibility trick*/\n";
$body .= " function __clone() { return \$this;}\n";
}
 
// simple creation tools ! (static stuff!)
$body .= "\n";
$body .= " /* Static get */\n";
$body .= " function staticGet(\$k,\$v=NULL) { return DB_DataObject::staticGet('{$this->classname}',\$k,\$v); }\n";
// generate getter and setter methods
$body .= $this->_generateGetters($input);
$body .= $this->_generateSetters($input);
/*
theoretically there is scope here to introduce 'list' methods
based up 'xxxx_up' column!!! for heiracitcal trees..
*/
 
// set methods
//foreach ($sets as $k=>$v) {
// $kk = strtoupper($k);
// $body .=" function getSets{$k}() { return {$v}; }\n";
//}
$body .= $this->derivedHookFunctions();
 
$body .= "\n /* the code above is auto generated do not remove the tag below */";
$body .= "\n ###END_AUTOCODE\n";
 
 
// stubs..
if (!empty($options['generator_add_validate_stubs'])) {
foreach($defs as $t) {
if (!strlen(trim($t->name))) {
continue;
}
$validate_fname = 'validate' . ucfirst(strtolower($t->name));
// dont re-add it..
if (preg_match('/\s+function\s+' . $validate_fname . '\s*\(/i', $input)) {
continue;
}
$body .= "\n function {$validate_fname}()\n {\n return false;\n }\n";
}
}
 
 
 
 
$foot .= "}\n";
$full = $head . $body . $foot;
 
if (!$input) {
return $full;
}
if (!preg_match('/(\n|\r\n)\s*###START_AUTOCODE(\n|\r\n)/s',$input)) {
return $full;
}
if (!preg_match('/(\n|\r\n)\s*###END_AUTOCODE(\n|\r\n)/s',$input)) {
return $full;
}
 
 
/* this will only replace extends DB_DataObject by default,
unless use set generator_class_rewrite to ANY or a name*/
 
$class_rewrite = 'DB_DataObject';
$options = &PEAR::getStaticProperty('DB_DataObject','options');
if (!($class_rewrite = @$options['generator_class_rewrite'])) {
$class_rewrite = 'DB_DataObject';
}
if ($class_rewrite == 'ANY') {
$class_rewrite = '[a-z_]+';
}
 
$input = preg_replace(
'/(\n|\r\n)class\s*[a-z0-9_]+\s*extends\s*' .$class_rewrite . '\s*\{(\n|\r\n)/si',
"\nclass {$this->classname} extends {$this->_extends} \n{\n",
$input);
 
return preg_replace(
'/(\n|\r\n)\s*###START_AUTOCODE(\n|\r\n).*(\n|\r\n)\s*###END_AUTOCODE(\n|\r\n)/s',
$body,$input);
}
 
/**
* hook to add extra methods to all classes
*
* called once for each class, use with $this->table and
* $this->_definitions[$this->table], to get data out of the current table,
* use it to add extra methods to the default classes.
*
* @access public
* @return string added to class eg. functions.
*/
function derivedHookFunctions()
{
// This is so derived generator classes can generate functions
// It MUST NOT be changed here!!!
return "";
}
 
/**
* hook for var lines
* called each time a var line is generated, override to add extra var
* lines
*
* @param object t containing type,len,flags etc. from tableInfo call
* @param int padding number of spaces
* @access public
* @return string added to class eg. functions.
*/
function derivedHookVar(&$t,$padding)
{
// This is so derived generator classes can generate variabels
// It MUST NOT be changed here!!!
return "";
}
 
 
/**
* getProxyFull - create a class definition on the fly and instantate it..
*
* similar to generated files - but also evals the class definitoin code.
*
*
* @param string database name
* @param string table name of table to create proxy for.
*
*
* @return object Instance of class. or PEAR Error
* @access public
*/
function getProxyFull($database,$table) {
if ($err = $this->fillTableSchema($database,$table)) {
return $err;
}
$options = &PEAR::getStaticProperty('DB_DataObject','options');
$class_prefix = $options['class_prefix'];
if ($extends = @$options['extends']) {
$this->_extends = $extends;
$this->_extendsFile = $options['extends_location'];
}
 
$classname = $this->classname = $class_prefix.preg_replace('/[^A-Z0-9]/i','_',ucfirst(trim($this->table)));
 
$out = $this->_generateClassTable();
//echo $out;
eval('?>'.$out);
return new $classname;
}
/**
* fillTableSchema - set the database schema on the fly
*
*
*
* @param string database name
* @param string table name of table to create schema info for
*
* @return none | PEAR::error()
* @access public
*/
function fillTableSchema($database,$table) {
global $_DB_DATAOBJECT;
$this->_database = $database;
$this->_connect();
$table = trim($table);
$__DB= &$GLOBALS['_DB_DATAOBJECT']['CONNECTIONS'][$this->_database_dsn_md5];
$defs = $__DB->tableInfo($table);
if (PEAR::isError($defs)) {
return $defs;
}
if (@$_DB_DATAOBJECT['CONFIG']['debug'] > 2) {
$this->debug("getting def for $database/$table",'fillTable');
$this->debug(print_r($defs,true),'defs');
}
// cast all definitions to objects - as we deal with that better.
foreach($defs as $def) {
if (is_array($def)) {
$this->_definitions[$table][] = (object) $def;
}
}
 
$this->table = trim($table);
$ret = $this->_generateDefinitionsTable();
$_DB_DATAOBJECT['INI'][$database][$table] = $ret['table'];
$_DB_DATAOBJECT['INI'][$database][$table.'__keys'] = $ret['keys'];
return false;
}
/**
* Generate getter methods for class definition
*
* @param string $input Existing class contents
* @return string
* @access public
*/
function _generateGetters($input) {
 
$options = &PEAR::getStaticProperty('DB_DataObject','options');
$getters = '';
 
// only generate if option is set to true
if (empty($options['generate_getters'])) {
return '';
}
 
// remove auto-generated code from input to be able to check if the method exists outside of the auto-code
$input = preg_replace('/(\n|\r\n)\s*###START_AUTOCODE(\n|\r\n).*(\n|\r\n)\s*###END_AUTOCODE(\n|\r\n)/s', '', $input);
 
$getters .= "\n\n";
$defs = $this->_definitions[$this->table];
 
// loop through properties and create getter methods
foreach ($defs = $defs as $t) {
 
// build mehtod name
$methodName = 'get' . ucfirst($t->name);
 
if (!strlen(trim($t->name)) || preg_match("/function[\s]+[&]?$methodName\(/i", $input)) {
continue;
}
 
$getters .= " /**\n";
$getters .= " * Getter for \${$t->name}\n";
$getters .= " *\n";
$getters .= (stristr($t->flags, 'multiple_key')) ? " * @return object\n"
: " * @return {$t->type}\n";
$getters .= " * @access public\n";
$getters .= " */\n";
$getters .= (substr(phpversion(),0,1) > 4) ? ' public '
: ' ';
$getters .= "function $methodName() {\n";
$getters .= " return \$this->{$t->name};\n";
$getters .= " }\n\n";
}
 
return $getters;
}
 
 
/**
* Generate setter methods for class definition
*
* @param string Existing class contents
* @return string
* @access public
*/
function _generateSetters($input) {
 
$options = &PEAR::getStaticProperty('DB_DataObject','options');
$setters = '';
 
// only generate if option is set to true
if (empty($options['generate_setters'])) {
return '';
}
 
// remove auto-generated code from input to be able to check if the method exists outside of the auto-code
$input = preg_replace('/(\n|\r\n)\s*###START_AUTOCODE(\n|\r\n).*(\n|\r\n)\s*###END_AUTOCODE(\n|\r\n)/s', '', $input);
 
$setters .= "\n";
$defs = $this->_definitions[$this->table];
 
// loop through properties and create setter methods
foreach ($defs = $defs as $t) {
 
// build mehtod name
$methodName = 'set' . ucfirst($t->name);
 
if (!strlen(trim($t->name)) || preg_match("/function[\s]+[&]?$methodName\(/i", $input)) {
continue;
}
 
$setters .= " /**\n";
$setters .= " * Setter for \${$t->name}\n";
$setters .= " *\n";
$setters .= " * @param mixed input value\n";
$setters .= " * @access public\n";
$setters .= " */\n";
$setters .= (substr(phpversion(),0,1) > 4) ? ' public '
: ' ';
$setters .= "function $methodName(\$value) {\n";
$setters .= " \$this->{$t->name} = \$value;\n";
$setters .= " }\n\n";
}
 
return $setters;
}
 
}
/tags/Racine_livraison_narmer/api/pear/DB/DataObject/Error.php
New file
0,0 → 1,53
<?php
/**
* DataObjects error handler, loaded on demand...
*
* DB_DataObject_Error is a quick wrapper around pear error, so you can distinguish the
* error code source.
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Database
* @package DB_DataObject
* @author Alan Knowles <alan@akbkhome.com>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id: Error.php,v 1.1 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/DB_DataObject
*/
class DB_DataObject_Error extends PEAR_Error
{
/**
* DB_DataObject_Error constructor.
*
* @param mixed $code DB error code, or string with error message.
* @param integer $mode what "error mode" to operate in
* @param integer $level what error level to use for $mode & PEAR_ERROR_TRIGGER
* @param mixed $debuginfo additional debug info, such as the last query
*
* @access public
*
* @see PEAR_Error
*/
function DB_DataObject_Error($message = '', $code = DB_ERROR, $mode = PEAR_ERROR_RETURN,
$level = E_USER_NOTICE)
{
$this->PEAR_Error('DB_DataObject Error: ' . $message, $code, $mode, $level);
}
// todo : - support code -> message handling, and translated error messages...
}
/tags/Racine_livraison_narmer/api/pear/DB/DataObject/Cast.php
New file
0,0 → 1,546
<?php
/**
* Prototype Castable Object.. for DataObject queries
*
* Storage for Data that may be cast into a variety of formats.
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Database
* @package DB_DataObject
* @author Alan Knowles <alan@akbkhome.com>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id: Cast.php,v 1.1 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/DB_DataObject
*/
/**
*
* Common usages:
* // blobs
* $data = DB_DataObject_Cast::blob($somefile);
* $data = DB_DataObject_Cast::string($somefile);
* $dataObject->someblobfield = $data
*
* // dates?
* $d1 = new DB_DataObject_Cast::date('12/12/2000');
* $d2 = new DB_DataObject_Cast::date(2000,12,30);
* $d3 = new DB_DataObject_Cast::date($d1->year, $d1->month+30, $d1->day+30);
*
* // time, datetime.. ?????????
*
* // raw sql????
* $data = DB_DataObject_Cast::sql('cast("123123",datetime)');
* $data = DB_DataObject_Cast::sql('NULL');
*
* // int's/string etc. are proably pretty pointless..!!!!
*
*
* inside DB_DataObject,
* if (is_a($v,'db_dataobject_class')) {
* $value .= $v->toString(DB_DATAOBJECT_INT,'mysql');
* }
*
*
*
*
 
*/
class DB_DataObject_Cast {
/**
* Type of data Stored in the object..
*
* @var string (date|blob|.....?)
* @access public
*/
var $type;
/**
* Data For date representation
*
* @var int day/month/year
* @access public
*/
var $day;
var $month;
var $year;
 
/**
* Generic Data..
*
* @var string
* @access public
*/
 
var $value;
 
 
 
/**
* Blob consructor
*
* create a Cast object from some raw data.. (binary)
*
*
* @param string (with binary data!)
*
* @return object DB_DataObject_Cast
* @access public
*/
function blob($value) {
$r = new DB_DataObject_Cast;
$r->type = 'blob';
$r->value = $value;
return $r;
}
 
 
/**
* String consructor (actually use if for ints and everything else!!!
*
* create a Cast object from some string (not binary)
*
*
* @param string (with binary data!)
*
* @return object DB_DataObject_Cast
* @access public
*/
function string($value) {
$r = new DB_DataObject_Cast;
$r->type = 'string';
$r->value = $value;
return $r;
}
/**
* SQL constructor (for raw SQL insert)
*
* create a Cast object from some sql
*
* @param string (with binary data!)
*
* @return object DB_DataObject_Cast
* @access public
*/
function sql($value)
{
$r = new DB_DataObject_Cast;
$r->type = 'sql';
$r->value = $value;
return $r;
}
 
 
/**
* Date Constructor
*
* create a Cast object from some string (not binary)
* NO VALIDATION DONE, although some crappy re-calcing done!
*
* @param vargs... accepts
* dd/mm
* dd/mm/yyyy
* yyyy-mm
* yyyy-mm-dd
* array(yyyy,dd)
* array(yyyy,dd,mm)
*
*
*
* @return object DB_DataObject_Cast
* @access public
*/
function date()
{
$args = func_get_args();
switch(count($args)) {
case 0: // no args = today!
$bits = explode('-',date('Y-m-d'));
break;
case 1: // one arg = a string
if (strpos($args[0],'/') !== false) {
$bits = array_reverse(explode('/',$args[0]));
} else {
$bits = explode('-',$args[0]);
}
break;
default: // 2 or more..
$bits = $args;
}
if (count($bits) == 1) { // if YYYY set day = 1st..
$bits[] = 1;
}
if (count($bits) == 2) { // if YYYY-DD set day = 1st..
$bits[] = 1;
}
// if year < 1970 we cant use system tools to check it...
// so we make a few best gueses....
// basically do date calculations for the year 2000!!!
// fix me if anyone has more time...
if (($bits[0] < 1975) || ($bits[0] > 2030)) {
$oldyear = $bits[0];
$bits = explode('-',date('Y-m-d',mktime(1,1,1,$bits[1],$bits[2],2000)));
$bits[0] = ($bits[0] - 2000) + $oldyear;
} else {
// now mktime
$bits = explode('-',date('Y-m-d',mktime(1,1,1,$bits[1],$bits[2],$bits[0])));
}
$r = new DB_DataObject_Cast;
$r->type = 'date';
list($r->year,$r->month,$r->day) = $bits;
return $r;
}
 
/**
* Data For time representation ** does not handle timezones!!
*
* @var int hour/minute/second
* @access public
*/
var $hour;
var $minute;
var $second;
 
/**
* DateTime Constructor
*
* create a Cast object from a Date/Time
* Maybe should accept a Date object.!
* NO VALIDATION DONE, although some crappy re-calcing done!
*
* @param vargs... accepts
* noargs (now)
* yyyy-mm-dd HH:MM:SS (Iso)
* array(yyyy,mm,dd,HH,MM,SS)
*
*
* @return object DB_DataObject_Cast
* @access public
* @author therion 5 at hotmail
*/
function dateTime()
{
$args = func_get_args();
switch(count($args)) {
case 0: // no args = now!
$datetime = date('Y-m-d G:i:s', mktime());
case 1:
// continue on from 0 args.
if (!isset($datetime)) {
$datetime = $args[0];
}
$parts = explode(' ', $datetime);
$bits = explode('-', $parts[0]);
$bits = array_merge($bits, explode(':', $parts[1]));
break;
default: // 2 or more..
$bits = $args;
}
 
if (count($bits) != 6) {
// PEAR ERROR?
return false;
}
$r = DB_DataObject_Cast::date($bits[0], $bits[1], $bits[2]);
if (!$r) {
return $r; // pass thru error (False) - doesnt happen at present!
}
// change the type!
$r->type = 'datetime';
// should we mathematically sort this out..
// (or just assume that no-one's dumb enough to enter 26:90:90 as a time!
$r->hour = $bits[3];
$r->minute = $bits[4];
$r->second = $bits[5];
return $r;
 
}
 
 
 
/**
* time Constructor
*
* create a Cast object from a Date/Time
* Maybe should accept a Date object.!
* NO VALIDATION DONE, and no-recalcing done!
*
* @param vargs... accepts
* noargs (now)
* HH:MM:SS (Iso)
* array(HH,MM,SS)
*
*
* @return object DB_DataObject_Cast
* @access public
* @author therion 5 at hotmail
*/
function time()
{
$args = func_get_args();
switch (count($args)) {
case 0: // no args = now!
$time = date('G:i:s', mktime());
case 1:
// continue on from 0 args.
if (!isset($time)) {
$time = $args[0];
}
$bits = explode(':', $time);
break;
default: // 2 or more..
$bits = $args;
}
if (count($bits) != 3) {
return false;
}
// now take data from bits into object fields
$r = new DB_DataObject_Cast;
$r->type = 'time';
$r->hour = $bits[0];
$r->minute = $bits[1];
$r->second = $bits[2];
return $r;
 
}
 
/**
* get the string to use in the SQL statement for this...
*
*
* @param int $to Type (DB_DATAOBJECT_*
* @param object $db DB Connection Object
*
*
* @return string
* @access public
*/
function toString($to=false,$db)
{
// if $this->type is not set, we are in serious trouble!!!!
// values for to:
$method = 'toStringFrom'.$this->type;
return $this->$method($to,$db);
}
/**
* get the string to use in the SQL statement from a blob of binary data
* ** Suppots only blob->postgres::bytea
*
* @param int $to Type (DB_DATAOBJECT_*
* @param object $db DB Connection Object
*
*
* @return string
* @access public
*/
function toStringFromBlob($to,$db)
{
// first weed out invalid casts..
// in blobs can only be cast to blobs.!
// perhaps we should support TEXT fields???
if (!($to & DB_DATAOBJECT_BLOB)) {
return PEAR::raiseError('Invalid Cast from a DB_DataObject_Cast::blob to something other than a blob!');
}
switch ($db->dsn["phptype"]) {
case 'pgsql':
return "'".pg_escape_bytea($this->value)."'::bytea";
case 'mysql':
return "'".mysql_real_escape_string($this->value,$db->connection)."'";
case 'mysqli':
// this is funny - the parameter order is reversed ;)
return "'".mysqli_real_escape_string($db->connection, $this->value)."'";
default:
return PEAR::raiseError("DB_DataObject_Cast cant handle blobs for Database:{$db->dsn['phptype']} Yet");
}
}
/**
* get the string to use in the SQL statement for a blob from a string!
* ** Suppots only string->postgres::bytea
*
*
* @param int $to Type (DB_DATAOBJECT_*
* @param object $db DB Connection Object
*
*
* @return string
* @access public
*/
function toStringFromString($to,$db)
{
// first weed out invalid casts..
// in blobs can only be cast to blobs.!
// perhaps we should support TEXT fields???
//
if (!($to & DB_DATAOBJECT_BLOB)) {
return PEAR::raiseError('Invalid Cast from a DB_DataObject_Cast::string to something other than a blob!'.
' (why not just use native features)');
}
switch ($db->dsn['phptype']) {
case 'pgsql':
return "'".pg_escape_string($this->value)."'::bytea";
case 'mysql':
return "'".mysql_real_escape_string($this->value,$db->connection)."'";
case 'mysqli':
return "'".mysqli_real_escape_string($db->connection, $this->value)."'";
 
default:
return PEAR::raiseError("DB_DataObject_Cast cant handle blobs for Database:{$db->dsn['phptype']} Yet");
}
}
/**
* get the string to use in the SQL statement for a date
*
*
*
* @param int $to Type (DB_DATAOBJECT_*
* @param object $db DB Connection Object
*
*
* @return string
* @access public
*/
function toStringFromDate($to,$db)
{
// first weed out invalid casts..
// in blobs can only be cast to blobs.!
// perhaps we should support TEXT fields???
//
if (($to !== false) && !($to & DB_DATAOBJECT_DATE)) {
return PEAR::raiseError('Invalid Cast from a DB_DataObject_Cast::string to something other than a date!'.
' (why not just use native features)');
}
return "'{$this->year}-{$this->month}-{$this->day}'";
}
/**
* get the string to use in the SQL statement for a datetime
*
*
*
* @param int $to Type (DB_DATAOBJECT_*
* @param object $db DB Connection Object
*
*
* @return string
* @access public
* @author therion 5 at hotmail
*/
function toStringFromDateTime($to,$db)
{
// first weed out invalid casts..
// in blobs can only be cast to blobs.!
// perhaps we should support TEXT fields???
if (($to !== false) &&
!($to & (DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME))) {
return PEAR::raiseError('Invalid Cast from a ' .
' DB_DataObject_Cast::dateTime to something other than a datetime!' .
' (try using native features)');
}
return "'{$this->year}-{$this->month}-{$this->day} {$this->hour}:{$this->minute}:{$this->second}'";
}
 
/**
* get the string to use in the SQL statement for a time
*
*
*
* @param int $to Type (DB_DATAOBJECT_*
* @param object $db DB Connection Object
*
*
* @return string
* @access public
* @author therion 5 at hotmail
*/
 
function toStringFromTime($to,$db)
{
// first weed out invalid casts..
// in blobs can only be cast to blobs.!
// perhaps we should support TEXT fields???
if (($to !== false) && !($to & DB_DATAOBJECT_TIME)) {
return PEAR::raiseError('Invalid Cast from a' .
' DB_DataObject_Cast::time to something other than a time!'.
' (try using native features)');
}
return "'{$this->hour}:{$this->minute}:{$this->second}'";
}
/**
* get the string to use in the SQL statement for a raw sql statement.
*
* @param int $to Type (DB_DATAOBJECT_*
* @param object $db DB Connection Object
*
*
* @return string
* @access public
*/
function toStringFromSql($to,$db)
{
return $this->value;
}
}
 
/tags/Racine_livraison_narmer/api/pear/DB/msql.php
New file
0,0 → 1,810
<?php
 
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 
/**
* The PEAR DB driver for PHP's msql extension
* for interacting with Mini SQL databases
*
* PHP's mSQL extension did weird things with NULL values prior to PHP
* 4.3.11 and 5.0.4. Make sure your version of PHP meets or exceeds
* those versions.
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Database
* @package DB
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id: msql.php,v 1.3 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/DB
*/
 
/**
* Obtain the DB_common class so it can be extended from
*/
require_once 'DB/common.php';
 
/**
* The methods PEAR DB uses to interact with PHP's msql extension
* for interacting with Mini SQL databases
*
* These methods overload the ones declared in DB_common.
*
* PHP's mSQL extension did weird things with NULL values prior to PHP
* 4.3.11 and 5.0.4. Make sure your version of PHP meets or exceeds
* those versions.
*
* @category Database
* @package DB
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version Release: 1.7.6
* @link http://pear.php.net/package/DB
* @since Class not functional until Release 1.7.0
*/
class DB_msql extends DB_common
{
// {{{ properties
 
/**
* The DB driver type (mysql, oci8, odbc, etc.)
* @var string
*/
var $phptype = 'msql';
 
/**
* The database syntax variant to be used (db2, access, etc.), if any
* @var string
*/
var $dbsyntax = 'msql';
 
/**
* The capabilities of this DB implementation
*
* The 'new_link' element contains the PHP version that first provided
* new_link support for this DBMS. Contains false if it's unsupported.
*
* Meaning of the 'limit' element:
* + 'emulate' = emulate with fetch row by number
* + 'alter' = alter the query
* + false = skip rows
*
* @var array
*/
var $features = array(
'limit' => 'emulate',
'new_link' => false,
'numrows' => true,
'pconnect' => true,
'prepare' => false,
'ssl' => false,
'transactions' => false,
);
 
/**
* A mapping of native error codes to DB error codes
* @var array
*/
var $errorcode_map = array(
);
 
/**
* The raw database connection created by PHP
* @var resource
*/
var $connection;
 
/**
* The DSN information for connecting to a database
* @var array
*/
var $dsn = array();
 
 
/**
* The query result resource created by PHP
*
* Used to make affectedRows() work. Only contains the result for
* data manipulation queries. Contains false for other queries.
*
* @var resource
* @access private
*/
var $_result;
 
 
// }}}
// {{{ constructor
 
/**
* This constructor calls <kbd>$this->DB_common()</kbd>
*
* @return void
*/
function DB_msql()
{
$this->DB_common();
}
 
// }}}
// {{{ connect()
 
/**
* Connect to the database server, log in and open the database
*
* Don't call this method directly. Use DB::connect() instead.
*
* Example of how to connect:
* <code>
* require_once 'DB.php';
*
* // $dsn = 'msql://hostname/dbname'; // use a TCP connection
* $dsn = 'msql:///dbname'; // use a socket
* $options = array(
* 'portability' => DB_PORTABILITY_ALL,
* );
*
* $db =& DB::connect($dsn, $options);
* if (PEAR::isError($db)) {
* die($db->getMessage());
* }
* </code>
*
* @param array $dsn the data source name
* @param bool $persistent should the connection be persistent?
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function connect($dsn, $persistent = false)
{
if (!PEAR::loadExtension('msql')) {
return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
}
 
$this->dsn = $dsn;
if ($dsn['dbsyntax']) {
$this->dbsyntax = $dsn['dbsyntax'];
}
 
$params = array();
if ($dsn['hostspec']) {
$params[] = $dsn['port']
? $dsn['hostspec'] . ',' . $dsn['port']
: $dsn['hostspec'];
}
 
$connect_function = $persistent ? 'msql_pconnect' : 'msql_connect';
 
$ini = ini_get('track_errors');
$php_errormsg = '';
if ($ini) {
$this->connection = @call_user_func_array($connect_function,
$params);
} else {
ini_set('track_errors', 1);
$this->connection = @call_user_func_array($connect_function,
$params);
ini_set('track_errors', $ini);
}
 
if (!$this->connection) {
if (($err = @msql_error()) != '') {
return $this->raiseError(DB_ERROR_CONNECT_FAILED,
null, null, null,
$err);
} else {
return $this->raiseError(DB_ERROR_CONNECT_FAILED,
null, null, null,
$php_errormsg);
}
}
 
if (!@msql_select_db($dsn['database'], $this->connection)) {
return $this->msqlRaiseError();
}
return DB_OK;
}
 
// }}}
// {{{ disconnect()
 
/**
* Disconnects from the database server
*
* @return bool TRUE on success, FALSE on failure
*/
function disconnect()
{
$ret = @msql_close($this->connection);
$this->connection = null;
return $ret;
}
 
// }}}
// {{{ simpleQuery()
 
/**
* Sends a query to the database server
*
* @param string the SQL query string
*
* @return mixed + a PHP result resrouce for successful SELECT queries
* + the DB_OK constant for other successful queries
* + a DB_Error object on failure
*/
function simpleQuery($query)
{
$this->last_query = $query;
$query = $this->modifyQuery($query);
$result = @msql_query($query, $this->connection);
if (!$result) {
return $this->msqlRaiseError();
}
// Determine which queries that should return data, and which
// should return an error code only.
if (DB::isManip($query)) {
$this->_result = $result;
return DB_OK;
} else {
$this->_result = false;
return $result;
}
}
 
 
// }}}
// {{{ nextResult()
 
/**
* Move the internal msql result pointer to the next available result
*
* @param a valid fbsql result resource
*
* @access public
*
* @return true if a result is available otherwise return false
*/
function nextResult($result)
{
return false;
}
 
// }}}
// {{{ fetchInto()
 
/**
* Places a row from the result set into the given array
*
* Formating of the array and the data therein are configurable.
* See DB_result::fetchInto() for more information.
*
* This method is not meant to be called directly. Use
* DB_result::fetchInto() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* PHP's mSQL extension did weird things with NULL values prior to PHP
* 4.3.11 and 5.0.4. Make sure your version of PHP meets or exceeds
* those versions.
*
* @param resource $result the query result resource
* @param array $arr the referenced array to put the data in
* @param int $fetchmode how the resulting array should be indexed
* @param int $rownum the row number to fetch (0 = first row)
*
* @return mixed DB_OK on success, NULL when the end of a result set is
* reached or on failure
*
* @see DB_result::fetchInto()
*/
function fetchInto($result, &$arr, $fetchmode, $rownum = null)
{
if ($rownum !== null) {
if (!@msql_data_seek($result, $rownum)) {
return null;
}
}
if ($fetchmode & DB_FETCHMODE_ASSOC) {
$arr = @msql_fetch_array($result, MSQL_ASSOC);
if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) {
$arr = array_change_key_case($arr, CASE_LOWER);
}
} else {
$arr = @msql_fetch_row($result);
}
if (!$arr) {
return null;
}
if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
$this->_rtrimArrayValues($arr);
}
if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
$this->_convertNullArrayValuesToEmpty($arr);
}
return DB_OK;
}
 
// }}}
// {{{ freeResult()
 
/**
* Deletes the result set and frees the memory occupied by the result set
*
* This method is not meant to be called directly. Use
* DB_result::free() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return bool TRUE on success, FALSE if $result is invalid
*
* @see DB_result::free()
*/
function freeResult($result)
{
return @msql_free_result($result);
}
 
// }}}
// {{{ numCols()
 
/**
* Gets the number of columns in a result set
*
* This method is not meant to be called directly. Use
* DB_result::numCols() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return int the number of columns. A DB_Error object on failure.
*
* @see DB_result::numCols()
*/
function numCols($result)
{
$cols = @msql_num_fields($result);
if (!$cols) {
return $this->msqlRaiseError();
}
return $cols;
}
 
// }}}
// {{{ numRows()
 
/**
* Gets the number of rows in a result set
*
* This method is not meant to be called directly. Use
* DB_result::numRows() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return int the number of rows. A DB_Error object on failure.
*
* @see DB_result::numRows()
*/
function numRows($result)
{
$rows = @msql_num_rows($result);
if ($rows === false) {
return $this->msqlRaiseError();
}
return $rows;
}
 
// }}}
// {{{ affected()
 
/**
* Determines the number of rows affected by a data maniuplation query
*
* 0 is returned for queries that don't manipulate data.
*
* @return int the number of rows. A DB_Error object on failure.
*/
function affectedRows()
{
if (!$this->_result) {
return 0;
}
return msql_affected_rows($this->_result);
}
 
// }}}
// {{{ nextId()
 
/**
* Returns the next free id in a sequence
*
* @param string $seq_name name of the sequence
* @param boolean $ondemand when true, the seqence is automatically
* created if it does not exist
*
* @return int the next id number in the sequence.
* A DB_Error object on failure.
*
* @see DB_common::nextID(), DB_common::getSequenceName(),
* DB_msql::createSequence(), DB_msql::dropSequence()
*/
function nextId($seq_name, $ondemand = true)
{
$seqname = $this->getSequenceName($seq_name);
$repeat = false;
do {
$this->pushErrorHandling(PEAR_ERROR_RETURN);
$result =& $this->query("SELECT _seq FROM ${seqname}");
$this->popErrorHandling();
if ($ondemand && DB::isError($result) &&
$result->getCode() == DB_ERROR_NOSUCHTABLE) {
$repeat = true;
$this->pushErrorHandling(PEAR_ERROR_RETURN);
$result = $this->createSequence($seq_name);
$this->popErrorHandling();
if (DB::isError($result)) {
return $this->raiseError($result);
}
} else {
$repeat = false;
}
} while ($repeat);
if (DB::isError($result)) {
return $this->raiseError($result);
}
$arr = $result->fetchRow(DB_FETCHMODE_ORDERED);
$result->free();
return $arr[0];
}
 
// }}}
// {{{ createSequence()
 
/**
* Creates a new sequence
*
* Also creates a new table to associate the sequence with. Uses
* a separate table to ensure portability with other drivers.
*
* @param string $seq_name name of the new sequence
*
* @return int DB_OK on success. A DB_Error object on failure.
*
* @see DB_common::createSequence(), DB_common::getSequenceName(),
* DB_msql::nextID(), DB_msql::dropSequence()
*/
function createSequence($seq_name)
{
$seqname = $this->getSequenceName($seq_name);
$res = $this->query('CREATE TABLE ' . $seqname
. ' (id INTEGER NOT NULL)');
if (DB::isError($res)) {
return $res;
}
$res = $this->query("CREATE SEQUENCE ON ${seqname}");
return $res;
}
 
// }}}
// {{{ dropSequence()
 
/**
* Deletes a sequence
*
* @param string $seq_name name of the sequence to be deleted
*
* @return int DB_OK on success. A DB_Error object on failure.
*
* @see DB_common::dropSequence(), DB_common::getSequenceName(),
* DB_msql::nextID(), DB_msql::createSequence()
*/
function dropSequence($seq_name)
{
return $this->query('DROP TABLE ' . $this->getSequenceName($seq_name));
}
 
// }}}
// {{{ quoteIdentifier()
 
/**
* mSQL does not support delimited identifiers
*
* @param string $str the identifier name to be quoted
*
* @return object a DB_Error object
*
* @see DB_common::quoteIdentifier()
* @since Method available since Release 1.7.0
*/
function quoteIdentifier($str)
{
return $this->raiseError(DB_ERROR_UNSUPPORTED);
}
 
// }}}
// {{{ escapeSimple()
 
/**
* Escapes a string according to the current DBMS's standards
*
* @param string $str the string to be escaped
*
* @return string the escaped string
*
* @see DB_common::quoteSmart()
* @since Method available since Release 1.7.0
*/
function escapeSimple($str)
{
return addslashes($str);
}
 
// }}}
// {{{ msqlRaiseError()
 
/**
* Produces a DB_Error object regarding the current problem
*
* @param int $errno if the error is being manually raised pass a
* DB_ERROR* constant here. If this isn't passed
* the error information gathered from the DBMS.
*
* @return object the DB_Error object
*
* @see DB_common::raiseError(),
* DB_msql::errorNative(), DB_msql::errorCode()
*/
function msqlRaiseError($errno = null)
{
$native = $this->errorNative();
if ($errno === null) {
$errno = $this->errorCode($native);
}
return $this->raiseError($errno, null, null, null, $native);
}
 
// }}}
// {{{ errorNative()
 
/**
* Gets the DBMS' native error message produced by the last query
*
* @return string the DBMS' error message
*/
function errorNative()
{
return @msql_error();
}
 
// }}}
// {{{ errorCode()
 
/**
* Determines PEAR::DB error code from the database's text error message
*
* @param string $errormsg the error message returned from the database
*
* @return integer the error number from a DB_ERROR* constant
*/
function errorCode($errormsg)
{
static $error_regexps;
if (!isset($error_regexps)) {
$error_regexps = array(
'/^Access to database denied/i'
=> DB_ERROR_ACCESS_VIOLATION,
'/^Bad index name/i'
=> DB_ERROR_ALREADY_EXISTS,
'/^Bad order field/i'
=> DB_ERROR_SYNTAX,
'/^Bad type for comparison/i'
=> DB_ERROR_SYNTAX,
'/^Can\'t perform LIKE on/i'
=> DB_ERROR_SYNTAX,
'/^Can\'t use TEXT fields in LIKE comparison/i'
=> DB_ERROR_SYNTAX,
'/^Couldn\'t create temporary table/i'
=> DB_ERROR_CANNOT_CREATE,
'/^Error creating table file/i'
=> DB_ERROR_CANNOT_CREATE,
'/^Field .* cannot be null$/i'
=> DB_ERROR_CONSTRAINT_NOT_NULL,
'/^Index (field|condition) .* cannot be null$/i'
=> DB_ERROR_SYNTAX,
'/^Invalid date format/i'
=> DB_ERROR_INVALID_DATE,
'/^Invalid time format/i'
=> DB_ERROR_INVALID,
'/^Literal value for .* is wrong type$/i'
=> DB_ERROR_INVALID_NUMBER,
'/^No Database Selected/i'
=> DB_ERROR_NODBSELECTED,
'/^No value specified for field/i'
=> DB_ERROR_VALUE_COUNT_ON_ROW,
'/^Non unique value for unique index/i'
=> DB_ERROR_CONSTRAINT,
'/^Out of memory for temporary table/i'
=> DB_ERROR_CANNOT_CREATE,
'/^Permission denied/i'
=> DB_ERROR_ACCESS_VIOLATION,
'/^Reference to un-selected table/i'
=> DB_ERROR_SYNTAX,
'/^syntax error/i'
=> DB_ERROR_SYNTAX,
'/^Table .* exists$/i'
=> DB_ERROR_ALREADY_EXISTS,
'/^Unknown database/i'
=> DB_ERROR_NOSUCHDB,
'/^Unknown field/i'
=> DB_ERROR_NOSUCHFIELD,
'/^Unknown (index|system variable)/i'
=> DB_ERROR_NOT_FOUND,
'/^Unknown table/i'
=> DB_ERROR_NOSUCHTABLE,
'/^Unqualified field/i'
=> DB_ERROR_SYNTAX,
);
}
 
foreach ($error_regexps as $regexp => $code) {
if (preg_match($regexp, $errormsg)) {
return $code;
}
}
return DB_ERROR;
}
 
// }}}
// {{{ tableInfo()
 
/**
* Returns information about a table or a result set
*
* @param object|string $result DB_result object from a query or a
* string containing the name of a table.
* While this also accepts a query result
* resource identifier, this behavior is
* deprecated.
* @param int $mode a valid tableInfo mode
*
* @return array an associative array with the information requested.
* A DB_Error object on failure.
*
* @see DB_common::setOption()
*/
function tableInfo($result, $mode = null)
{
if (is_string($result)) {
/*
* Probably received a table name.
* Create a result resource identifier.
*/
$id = @msql_query("SELECT * FROM $result",
$this->connection);
$got_string = true;
} elseif (isset($result->result)) {
/*
* Probably received a result object.
* Extract the result resource identifier.
*/
$id = $result->result;
$got_string = false;
} else {
/*
* Probably received a result resource identifier.
* Copy it.
* Deprecated. Here for compatibility only.
*/
$id = $result;
$got_string = false;
}
 
if (!is_resource($id)) {
return $this->raiseError(DB_ERROR_NEED_MORE_DATA);
}
 
if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
$case_func = 'strtolower';
} else {
$case_func = 'strval';
}
 
$count = @msql_num_fields($id);
$res = array();
 
if ($mode) {
$res['num_fields'] = $count;
}
 
for ($i = 0; $i < $count; $i++) {
$tmp = @msql_fetch_field($id);
 
$flags = '';
if ($tmp->not_null) {
$flags .= 'not_null ';
}
if ($tmp->unique) {
$flags .= 'unique_key ';
}
$flags = trim($flags);
 
$res[$i] = array(
'table' => $case_func($tmp->table),
'name' => $case_func($tmp->name),
'type' => $tmp->type,
'len' => msql_field_len($id, $i),
'flags' => $flags,
);
 
if ($mode & DB_TABLEINFO_ORDER) {
$res['order'][$res[$i]['name']] = $i;
}
if ($mode & DB_TABLEINFO_ORDERTABLE) {
$res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
}
}
 
// free the result only if we were called on a table
if ($got_string) {
@msql_free_result($id);
}
return $res;
}
 
// }}}
// {{{ getSpecialQuery()
 
/**
* Obtain a list of a given type of objects
*
* @param string $type the kind of objects you want to retrieve
*
* @return array the array containing the list of objects requested
*
* @access protected
* @see DB_common::getListOf()
*/
function getSpecialQuery($type)
{
switch ($type) {
case 'databases':
$id = @msql_list_dbs($this->connection);
break;
case 'tables':
$id = @msql_list_tables($this->dsn['database'],
$this->connection);
break;
default:
return null;
}
if (!$id) {
return $this->msqlRaiseError();
}
$out = array();
while ($row = @msql_fetch_row($id)) {
$out[] = $row[0];
}
return $out;
}
 
// }}}
 
}
 
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/
 
?>
/tags/Racine_livraison_narmer/api/pear/DB/QueryTool/Query.php
New file
0,0 → 1,2395
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 
/**
* Contains the DB_QueryTool_Query class
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Database
* @package DB_QueryTool
* @author Wolfram Kriesing <wk@visionp.de>
* @author Paolo Panto <wk@visionp.de>
* @author Lorenzo Alberton <l dot alberton at quipo dot it>
* @copyright 2003-2005 Wolfram Kriesing, Paolo Panto, Lorenzo Alberton
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id: Query.php,v 1.1 2006-12-14 15:04:29 jp_milcent Exp $
* @link http://pear.php.net/package/DB_QueryTool
*/
 
/**
* require the PEAR and DB classes
*/
require_once 'PEAR.php';
require_once 'DB.php';
 
/**
* DB_QueryTool_Query class
*
* This class should be extended
*
* @category Database
* @package DB_QueryTool
* @author Wolfram Kriesing <wk@visionp.de>
* @author Paolo Panto <wk@visionp.de>
* @author Lorenzo Alberton <l dot alberton at quipo dot it>
* @copyright 2003-2005 Wolfram Kriesing, Paolo Panto, Lorenzo Alberton
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @link http://pear.php.net/package/DB_QueryTool
*/
class DB_QueryTool_Query
{
// {{{ class vars
 
/**
* @var string the name of the primary column
*/
var $primaryCol = 'id';
 
/**
* @var string the current table the class works on
*/
var $table = '';
 
/**
* @var string the name of the sequence for this table
*/
var $sequenceName = null;
 
/**
* @var object the db-object, a PEAR::DB instance
*/
var $db = null;
 
/**
* @var string the where condition
* @access private
*/
var $_where = '';
 
/**
* @var string the order condition
* @access private
*/
var $_order = '';
 
/**
* @var string the having definition
* @access private
*/
var $_having = '';
 
/**
* @var array contains the join content
* the key is the join type, for now we have 'default' and 'left'
* inside each key 'table' contains the table
* key 'where' contains the where clause for the join
* @access private
*/
var $_join = array();
 
/**
* @var string which column to index the result by
* @access private
*/
var $_index = null;
 
/**
* @var string the group-by clause
* @access private
*/
var $_group = '';
 
/**
* @var array the limit
* @access private
*/
var $_limit = array();
 
/**
* @var string type of result to return
* @access private
*/
var $_resultType = 'none';
 
/**
* @var array the metadata temporary saved
* @access private
*/
var $_metadata = array();
 
/**
* @var string
* @access private
*/
var $_lastQuery = null;
 
/**
* @var string the rows that shall be selected
* @access private
*/
var $_select = '*';
 
/**
* @var string the rows that shall not be selected
* @access private
*/
var $_dontSelect = '';
 
/**
* @var array this array saves different modes in which this class works
* i.e. 'raw' means no quoting before saving/updating data
* @access private
*/
var $options = array(
'raw' => false,
'verbose' => true, // set this to false in a productive environment
// it will produce error-logs if set to true
'useCache' => false,
'logFile' => false,
);
 
/**
* this array contains information about the tables
* those are
* - 'name' => the real table name
* - 'shortName' => the short name used, so that when moving the table i.e.
* onto a provider's db and u have to rename the tables to
* longer names this name will be relevant, i.e. when
* autoJoining, i.e. a table name on your local machine is:
* 'user' but online it has to be 'applName_user' then the
* shortName will be used to determine if a column refers to
* another table, if the colName is 'user_id', it knows the
* shortName 'user' refers to the table 'applName_user'
*/
var $tableSpec = array();
 
/**
* this is the regular expression that shall be used to find a table's shortName
* in a column name, the string found by using this regular expression will be removed
* from the column name and it will be checked if it is a table name
* i.e. the default '/_id$/' would find the table name 'user' from the column name 'user_id'
*/
var $_tableNameToShortNamePreg = '/^.*_/';
 
/**
* @var array this array caches queries that have already been built once
* to reduce the execution time
*/
var $_queryCache = array();
 
/**
* The object that contains the log-instance
*/
var $_logObject = null;
 
/**
* Some internal data the logging needs
*/
var $_logData = array();
 
// }}}
// {{{ __construct()
 
/**
* this is the constructor, as it will be implemented in ZE2 (php5)
*
* @version 2002/04/02
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param object db-object
*/
/*
function __construct($dsn=false, $options=array())
{
if (!isset($options['autoConnect'])) {
$autoConnect = true;
} else {
$autoConnect = $options['autoConnect'];
}
if (isset($options['errorCallback'])) {
$this->setErrorCallback($options['errorCallback']);
}
if (isset($options['errorSetCallback'])) {
$this->setErrorSetCallback($options['errorSetCallback']);
}
if (isset($options['errorLogCallback'])) {
$this->setErrorLogCallback($options['errorLogCallback']);
}
 
if ($autoConnect && $dsn) {
$this->connect($dsn, $options);
}
//we would need to parse the dsn first ... i dont feel like now :-)
// oracle has all column names in upper case
//FIXXXME make the class work only with upper case when we work with oracle
//if ($this->db->phptype=='oci8' && !$this->primaryCol) {
// $this->primaryCol = 'ID';
//}
 
if ($this->sequenceName == null) {
$this->sequenceName = $this->table;
}
}
*/
 
// }}}
// {{{ DB_QueryTool_Query()
 
/**
* @version 2002/04/02
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param mixed $dsn DSN string, DSN array or DB object
* @param array $options
*/
function DB_QueryTool_Query($dsn=false, $options=array())
{
//$this->__construct($dsn, $options);
if (!isset($options['autoConnect'])) {
$autoConnect = true;
} else {
$autoConnect = $options['autoConnect'];
unset($options['autoConnect']);
}
if (isset($options['errorCallback'])) {
$this->setErrorCallback($options['errorCallback']);
unset($options['errorCallback']);
}
if (isset($options['errorSetCallback'])) {
$this->setErrorSetCallback($options['errorSetCallback']);
unset($options['errorSetCallback']);
}
if (isset($options['errorLogCallback'])) {
$this->setErrorLogCallback($options['errorLogCallback']);
unset($options['errorLogCallback']);
}
if ($autoConnect && $dsn) {
$this->connect($dsn, $options);
}
if (is_null($this->sequenceName)) {
$this->sequenceName = $this->table;
}
}
 
// }}}
// {{{ connect()
 
/**
* use this method if you want to connect manually
* @param mixed $dsn DSN string, DSN array or MDB object
* @param array $options
*/
function connect($dsn, $options=array())
{
if (is_object($dsn)) {
$res = $this->db =& $dsn;
} else {
$res = $this->db = DB::connect($dsn, $options);
}
if (DB::isError($res)) {
// FIXXME what shall we do here?
$this->_errorLog($res->getUserInfo());
} else {
$this->db->setFetchMode(DB_FETCHMODE_ASSOC);
}
}
 
// }}}
// {{{ getDbInstance()
 
/**
* @return reference to current DB instance
*/
function &getDbInstance()
{
return $this->db;
}
 
// }}}
// {{{ setDbInstance()
 
/**
* Setup using an existing connection.
* this also sets the DB_FETCHMODE_ASSOC since this class
* needs this to be set!
*
* @param object a reference to an existing DB-object
* @return void
*/
function setDbInstance(&$dbh)
{
$this->db =& $dbh;
$this->db->setFetchMode(DB_FETCHMODE_ASSOC);
}
 
// }}}
// {{{ get()
 
/**
* get the data of a single entry
* if the second parameter is only one column the result will be returned
* directly not as an array!
*
* @version 2002/03/05
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param integer the id of the element to retrieve
* @param string if this is given only one row shall be returned, directly, not an array
* @return mixed (1) an array of the retrieved data
* (2) if the second parameter is given and its only one column,
* only this column's data will be returned
* (3) false in case of failure
*/
function get($id, $column='')
{
$table = $this->table;
$getMethod = 'getRow';
if ($column && !strpos($column, ',')) { // if only one column shall be selected
$getMethod = 'getOne';
}
// we dont use 'setSelect' here, since this changes the setup of the class, we
// build the query directly
// if $column is '' then _buildSelect selects '*' anyway, so that's the same behaviour as before
$query['select'] = $this->_buildSelect($column);
$query['where'] = $this->_buildWhere($this->table.'.'.$this->primaryCol.'='.$id);
$queryString = $this->_buildSelectQuery($query);
 
return $this->returnResult($this->execute($queryString,$getMethod));
}
 
// }}}
// {{{ getMultiple()
 
/**
* gets the data of the given ids
*
* @version 2002/04/23
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param array this is an array of ids to retreive
* @param string the column to search in for
* @return mixed an array of the retreived data, or false in case of failure
* when failing an error is set in $this->_error
*/
function getMultiple($ids, $column='')
{
$col = $this->primaryCol;
if ($column) {
$col = $column;
}
// FIXXME if $ids has no table.col syntax and we are using joins, the table better be put in front!!!
$ids = $this->_quoteArray($ids);
 
$query['where'] = $this->_buildWhere($col.' IN ('.implode(',', $ids).')');
$queryString = $this->_buildSelectQuery($query);
 
return $this->returnResult($this->execute($queryString));
}
 
// }}}
// {{{ getAll()
 
/**
* get all entries from the DB
* for sorting use setOrder!!!, the last 2 parameters are deprecated
*
* @version 2002/03/05
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param int to start from
* @param int the number of rows to show
* @param string the DB-method to use, i dont know if we should leave this param here ...
* @return mixed an array of the retreived data, or false in case of failure
* when failing an error is set in $this->_error
*/
function getAll($from=0,$count=0,$method='getAll')
{
$query = array();
if ($count) {
$query = array('limit' => array($from, $count));
}
return $this->returnResult($this->execute($this->_buildSelectQuery($query), $method));
}
 
// }}}
// {{{ getCol()
 
/**
* this method only returns one column, so the result will be a one dimensional array
* this does also mean that using setSelect() should be set to *one* column, the one you want to
* have returned a most common use case for this could be:
* $table->setSelect('id');
* $ids = $table->getCol();
* OR
* $ids = $table->getCol('id');
* so ids will be an array with all the id's
*
* @version 2003/02/25
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param string the column that shall be retreived
* @param int to start from
* @param int the number of rows to show
* @return mixed an array of the retreived data, or false in case of failure
* when failing an error is set in $this->_error
*/
function getCol($column=null, $from=0, $count=0)
{
$query = array();
if (!is_null($column)) {
// by using _buildSelect() i can be sure that the table name will not be ambigious
// i.e. in a join, where all the joined tables have a col 'id'
// _buildSelect() will put the proper table name in front in case there is none
$query['select'] = $this->_buildSelect($column);
}
if ($count) {
$query['limit'] = array($from,$count);
}
return $this->returnResult($this->execute($this->_buildSelectQuery($query), 'getCol'));
}
 
// }}}
// {{{ getCount()
 
/**
* get the number of entries
*
* @version 2002/04/02
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param
* @return mixed an array of the retreived data, or false in case of failure
* when failing an error is set in $this->_error
*/
function getCount()
{
/* the following query works on mysql
SELECT count(DISTINCT image.id) FROM image2tree
RIGHT JOIN image ON image.id = image2tree.image_id
the reason why this is needed - i just wanted to get the number of rows that do exist if the result is grouped by image.id
the following query is what i tried first, but that returns the number of rows that have been grouped together
for each image.id
SELECT count(*) FROM image2tree
RIGHT JOIN image ON image.id = image2tree.image_id GROUP BY image.id
 
so that's why we do the following, i am not sure if that is standard SQL and absolutley correct!!!
*/
 
//FIXXME see comment above if this is absolutely correct!!!
if ($group = $this->_buildGroup()) {
$query['select'] = 'COUNT(DISTINCT '.$group.')';
$query['group'] = '';
} else {
$query['select'] = 'COUNT(*)';
}
 
$query['order'] = ''; // order is not of importance and might freak up the special group-handling up there, since the order-col is not be known
/*# FIXXME use the following line, but watch out, then it has to be used in every method, or this
# value will be used always, simply try calling getCount and getAll afterwards, getAll will return the count :-)
# if getAll doesn't use setSelect!!!
*/
//$this->setSelect('count(*)');
$queryString = $this->_buildSelectQuery($query, true);
 
return ($res = $this->execute($queryString, 'getOne')) ? $res : 0;
}
 
// }}}
// {{{ getDefaultValues()
 
/**
* return an empty element where all the array elements do already exist
* corresponding to the columns in the DB
*
* @version 2002/04/05
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @return array an empty, or pre-initialized element
*/
function getDefaultValues()
{
$ret = array();
// here we read all the columns from the DB and initialize them
// with '' to prevent PHP-warnings in case we use error_reporting=E_ALL
foreach ($this->metadata() as $aCol=>$x) {
$ret[$aCol] = '';
}
return $ret;
}
 
// }}}
// {{{ getEmptyElement()
 
/**
* this is just for BC
* @deprecated
*/
function getEmptyElement()
{
$this->getDefaultValues();
}
 
// }}}
// {{{ getQueryString()
 
/**
* Render the current query and return it as a string.
*
* @return string the current query
*/
function getQueryString()
{
$ret = $this->_buildSelectQuery();
if (is_string($ret)) {
$ret = trim($ret);
}
return $ret;
}
 
// }}}
// {{{ save()
 
/**
* save data, calls either update or add
* if the primaryCol is given in the data this method knows that the
* data passed to it are meant to be updated (call 'update'), otherwise it will
* call the method 'add'.
* If you dont like this behaviour simply stick with the methods 'add'
* and 'update' and ignore this one here.
* This method is very useful when you have validation checks that have to
* be done for both adding and updating, then you can simply overwrite this
* method and do the checks in here, and both cases will be validated first.
*
* @version 2002/03/11
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param array contains the new data that shall be saved in the DB
* @return mixed the data returned by either add or update-method
*/
function save($data)
{
if (!empty($data[$this->primaryCol])) {
return $this->update($data);
}
return $this->add($data);
}
 
// }}}
// {{{ update()
 
/**
* update the member data of a data set
*
* @version 2002/03/06
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param array contains the new data that shall be saved in the DB
* the id has to be given in the field with the key 'ID'
* @return mixed true on success, or false otherwise
*/
function update($newData)
{
$query = array();
// do only set the 'where' part in $query, if a primary column is given
// if not the default 'where' clause is used
if (isset($newData[$this->primaryCol])) {
$query['where'] = $this->primaryCol.'='.$newData[$this->primaryCol];
}
$newData = $this->_checkColumns($newData, 'update');
$values = array();
$raw = $this->getOption('raw');
foreach ($newData as $key => $aData) { // quote the data
//$values[] = "{$this->table}.$key=". ($raw ? $aData : $this->db->quote($aData));
$values[] = "$key=". ($raw ? $aData : $this->db->quote($aData));
}
 
$query['set'] = implode(',', $values);
//FIXXXME _buildUpdateQuery() seems to take joins into account, whcih is bullshit here
$updateString = $this->_buildUpdateQuery($query);
#print '$updateString = '.$updateString;
return $this->execute($updateString, 'query') ? true : false;
}
 
// }}}
// {{{ add()
 
/**
* add a new member in the DB
*
* @version 2002/04/02
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param array contains the new data that shall be saved in the DB
* @return mixed the inserted id on success, or false otherwise
*/
function add($newData)
{
// if no primary col is given, get next sequence value
if (empty($newData[$this->primaryCol])) {
if ($this->primaryCol) { // do only use the sequence if a primary column is given
// otherwise the data are written as given
$id = $this->db->nextId($this->sequenceName);
$newData[$this->primaryCol] = (int)$id;
} else {
// if no primary col is given return true on success
$id = true;
}
} else {
$id = $newData[$this->primaryCol];
}
 
//unset($newData[$this->primaryCol]);
 
$newData = $this->_checkColumns($newData, 'add');
$newData = $this->_quoteArray($newData);
 
$query = sprintf( 'INSERT INTO %s (%s) VALUES (%s)',
$this->table,
implode(', ', array_keys($newData)),
implode(', ', $newData)
);
return $this->execute($query, 'query') ? $id : false;
}
 
// }}}
// {{{ addMultiple()
 
/**
* adds multiple new members in the DB
*
* @version 2002/07/17
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param array contains an array of new data that shall be saved in the DB
* the key-value pairs have to be the same for all the data!!!
* @return mixed the inserted ids on success, or false otherwise
*/
function addMultiple($data)
{
if (!sizeof($data)) {
return false;
}
// the inserted ids which will be returned or if no primaryCol is given
// we return true by default
$retIds = $this->primaryCol ? array() : true;
$allData = array(); // each row that will be inserted
foreach ($data as $key => $aData) {
$aData = $this->_checkColumns($aData, 'add');
$aData = $this->_quoteArray($aData);
 
if (empty($aData[$this->primaryCol])) {
if ($this->primaryCol) { // do only use the sequence if a primary column is given
// otherwise the data are written as given
$retIds[] = $id = (int)$this->db->nextId($this->sequenceName);
$aData[$this->primaryCol] = $id;
}
} else {
$retIds[] = $aData[$this->primaryCol];
}
$allData[] = '('.implode(', ', $aData).')';
}
 
$query = sprintf( 'INSERT INTO %s (%s) VALUES %s',
$this->table,
implode(', ', array_keys($aData)), // use the keys of the last element built
implode(', ', $allData)
);
return $this->execute($query, 'query') ? $retIds : false;
}
 
// }}}
// {{{ remove()
 
/**
* removes a member from the DB
*
* @version 2002/04/08
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param mixed integer/string - the value of the column that shall be removed
* array - multiple columns that shall be matched, the second parameter will be ignored
* @param string the column to match the data against, only if $data is not an array
* @return boolean
*/
function remove($data, $whereCol='')
{
$raw = $this->getOption('raw');
 
if (is_array($data)) {
//FIXXME check $data if it only contains columns that really exist in the table
$wheres = array();
foreach ($data as $key => $val) {
$wheres[] = $key.'='. ($raw ? $val : $this->db->quote($val));
}
$whereClause = implode(' AND ',$wheres);
} else {
if (empty($whereCol)) {
$whereCol = $this->primaryCol;
}
$whereClause = $whereCol.'='. ($raw ? $data : $this->db->quote($data));
}
 
$query = sprintf( 'DELETE FROM %s WHERE %s',
$this->table,
$whereClause
);
return $this->execute($query, 'query') ? true : false;
// i think this method should return the ID's that it removed, this way we could simply use the result
// for further actions that depend on those id ... or? make stuff easier, see ignaz::imail::remove
}
 
// }}}
// {{{ removeAll()
 
/**
* empty a table
*
* @version 2002/06/17
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @return
*/
function removeAll()
{
$query = 'DELETE FROM '.$this->table;
return $this->execute($query, 'query') ? true : false;
}
 
// }}}
// {{{ removeMultiple()
 
/**
* remove the datasets with the given ids
*
* @version 2002/04/24
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param array the ids to remove
* @return
*/
function removeMultiple($ids, $colName='')
{
if (empty($colName)) {
$colName = $this->primaryCol;
}
$ids = $this->_quoteArray($ids);
 
$query = sprintf( 'DELETE FROM %s WHERE %s IN (%s)',
$this->table,
$colName,
implode(',', $ids)
);
return $this->execute($query, 'query') ? true : false;
}
 
// }}}
// {{{ removePrimary()
 
/**
* removes a member from the DB and calls the remove methods of the given objects
* so all rows in another table that refer to this table are erased too
*
* @version 2002/04/08
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param integer the value of the primary key
* @param string the column name of the tables with the foreign keys
* @param object just for convinience, so nobody forgets to call this method
* with at least one object as a parameter
* @return boolean
*/
function removePrimary($id, $colName, $atLeastOneObject)
{
$argCounter = 2; // we have 2 parameters that need to be given at least
// func_get_arg returns false and a warning if there are no more parameters, so
// we suppress the warning and check for false
while ($object = @func_get_arg($argCounter++)) {
//FIXXXME let $object also simply be a table name
if (!$object->remove($id, $colName)) {
//FIXXXME do this better
$this->_errorSet("Error removing '$colName=$id' from table {$object->table}.");
return false;
}
}
 
return ($this->remove($id) ? true : false);
}
 
// }}}
// {{{ setLimit()
 
/**
* @param integer $from
* @param integer $count
*/
function setLimit($from=0, $count=0)
{
if ($from==0 && $count==0) {
$this->_limit = array();
} else {
$this->_limit = array($from, $count);
}
}
 
// }}}
// {{{ getLimit()
 
/**
* @return array
*/
function getLimit()
{
return $this->_limit;
}
 
// }}}
// {{{ setWhere()
 
/**
* sets the where condition which is used for the current instance
*
* @version 2002/04/16
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param string the where condition, this can be complete like 'X=7 AND Y=8'
*/
function setWhere($whereCondition='')
{
$this->_where = $whereCondition;
//FIXXME parse the where condition and replace ambigious column names, such as "name='Deutschland'" with "country.name='Deutschland'"
// then the users dont have to write that explicitly and can use the same name as in the setOrder i.e. setOrder('name,_net_name,_netPrefix_prefix');
}
 
// }}}
// {{{ getWhere()
 
/**
* gets the where condition which is used for the current instance
*
* @version 2002/04/22
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @return string the where condition, this can be complete like 'X=7 AND Y=8'
*/
function getWhere()
{
return $this->_where;
}
 
// }}}
// {{{ addWhere()
 
/**
* only adds a string to the where clause
*
* @version 2002/07/22
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param string the where clause to add to the existing one
* @param string the condition for how to concatenate the new where clause
* to the existing one
*/
function addWhere($where, $condition='AND')
{
if ($this->getWhere()) {
$where = $this->getWhere().' '.$condition.' '.$where;
}
$this->setWhere($where);
}
 
// }}}
// {{{ addWhereSearch()
 
/**
* add a where-like clause which works like a search for the given string
* i.e. calling it like this:
* $this->addWhereSearch('name', 'otto hans')
* produces a where clause like this one
* LOWER(name) LIKE "%otto%hans%"
* so the search finds the given string
*
* @version 2002/08/14
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param string the column to search in for
* @param string the string to search for
*/
function addWhereSearch($column, $string, $condition='AND')
{
// if the column doesn't contain a tablename use the current table name
// in case it is a defined column to prevent ambiguous rows
if (strpos($column, '.') === false) {
$meta = $this->metadata();
if (isset($meta[$column])) {
$column = $this->table.".$column";
}
}
 
$string = $this->db->quote('%'.str_replace(' ', '%', strtolower($string)).'%');
$this->addWhere("LOWER($column) LIKE $string", $condition);
}
 
// }}}
// {{{ setOrder()
 
/**
* sets the order condition which is used for the current instance
*
* @version 2002/05/16
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param string the where condition, this can be complete like 'X=7 AND Y=8'
* @param boolean sorting order (TRUE => ASC, FALSE => DESC)
*/
function setOrder($orderCondition='', $desc=false)
{
$this->_order = $orderCondition .($desc ? ' DESC' : '');
}
 
// }}}
// {{{ addOrder()
 
/**
* Add a order parameter to the query.
*
* @version 2003/05/28
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param string the where condition, this can be complete like 'X=7 AND Y=8'
* @param boolean sorting order (TRUE => ASC, FALSE => DESC)
*/
function addOrder($orderCondition='', $desc=false)
{
$order = $orderCondition .($desc ? ' DESC' : '');
if ($this->_order) {
$this->_order = $this->_order.','.$order;
} else {
$this->_order = $order;
}
}
 
// }}}
// {{{ getOrder()
 
/**
* gets the order condition which is used for the current instance
*
* @version 2002/05/16
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @return string the order condition, this can be complete like 'ID,TIMESTAMP DESC'
*/
function getOrder()
{
return $this->_order;
}
 
// }}}
// {{{ setHaving()
 
/**
* sets the having definition
*
* @version 2003/06/05
* @access public
* @author Johannes Schaefer <johnschaefer@gmx.de>
* @param string the having definition
*/
function setHaving($having='')
{
$this->_having = $having;
}
 
// }}}
// {{{ getHaving()
 
/**
* gets the having definition which is used for the current instance
*
* @version 2003/06/05
* @access public
* @author Johannes Schaefer <johnschaefer@gmx.de>
* @return string the having definition
*/
function getHaving()
{
return $this->_having;
}
 
// }}}
// {{{ addHaving()
 
/**
* Extend the current having clause. This is very useful, when you are building
* this clause from different places and don't want to overwrite the currently
* set having clause, but extend it.
*
* @param string this is a having clause, i.e. 'column' or 'table.column' or 'MAX(column)'
* @param string the connection string, which usually stays the default, which is ',' (a comma)
*/
function addHaving($what='*', $connectString=' AND ')
{
if ($this->_having) {
$this->_having = $this->_having.$connectString.$what;
} else {
$this->_having = $what;
}
}
 
// }}}
// {{{ setJoin()
 
/**
* sets a join-condition
*
* @version 2002/06/10
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param mixed either a string or an array that contains
* the table(s) to join on the current table
* @param string the where clause for the join
*/
function setJoin($table=null, $where=null, $joinType='default')
{
//FIXXME make it possible to pass a table name as a string like this too 'user u'
// where u is the string that can be used to refer to this table in a where/order
// or whatever condition
// this way it will be possible to join tables with itself, like setJoin(array('user u','user u1'))
// this wouldnt work yet, but for doing so we would need to change the _build methods too!!!
// because they use getJoin('tables') and this simply returns all the tables in use
// but don't take care of the mentioned syntax
 
if (is_null($table) || is_null($where)) { // remove the join if not sufficient parameters are given
$this->_join[$joinType] = array();
return;
}
/* this causes problems if we use the order-by, since it doenst know the name to order it by ... :-)
// replace the table names with the internal name used for the join
// this way we can also join one table multiple times if it will be implemented one day
$this->_join[$table] = preg_replace('/'.$table.'/','j1',$where);
*/
$this->_join[$joinType][$table] = $where;
}
 
// }}}
// {{{ setJoin()
 
/**
* if you do a left join on $this->table you will get all entries
* from $this->table, also if there are no entries for them in the joined table
* if both parameters are not given the left-join will be removed
* NOTE: be sure to only use either a right or a left join
*
* @version 2002/07/22
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param string the table(s) to be left-joined
* @param string the where clause for the join
*/
function setLeftJoin($table=null, $where=null)
{
$this->setJoin($table, $where, 'left');
}
 
// }}}
// {{{ addLeftJoin()
 
/**
* @param string the table to be left-joined
* @param string the where clause for the join
* @param string the join type
*/
function addLeftJoin($table, $where, $type='left')
{
// init value, to prevent E_ALL-warning
if (!isset($this->_join[$type]) || !$this->_join[$type]) {
$this->_join[$type] = array();
}
$this->_join[$type][$table] = $where;
}
 
// }}}
// {{{ setRightJoin()
 
/**
* see setLeftJoin for further explaination on what a left/right join is
* NOTE: be sure to only use either a right or a left join
//FIXXME check if the above sentence is necessary and if sql doesnt allow the use of both
*
* @see setLeftJoin()
* @version 2002/09/04
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param string the table(s) to be right-joined
* @param string the where clause for the join
*/
function setRightJoin($table=null, $where=null)
{
$this->setJoin($table, $where, 'right');
}
 
// }}}
// {{{ getJoin()
 
/**
* gets the join-condition
*
* @access public
* @param string [null|''|'table'|'tables'|'right'|'left']
* @return array gets the join parameters
*/
function getJoin($what=null)
{
// if the user requests all the join data or if the join is empty, return it
if (is_null($what) || empty($this->_join)) {
return $this->_join;
}
 
$ret = array();
switch (strtolower($what)) {
case 'table':
case 'tables':
foreach ($this->_join as $aJoin) {
if (count($aJoin)) {
$ret = array_merge($ret, array_keys($aJoin));
}
}
break;
case 'right': // return right-join data only
case 'left': // return left join data only
if (count($this->_join[$what])) {
$ret = array_merge($ret, $this->_join[$what]);
}
break;
}
return $ret;
}
 
// }}}
// {{{ addJoin()
 
/**
* adds a table and a where clause that shall be used for the join
* instead of calling
* setJoin(array(table1,table2),'<where clause1> AND <where clause2>')
* you can also call
* setJoin(table1,'<where clause1>')
* addJoin(table2,'<where clause2>')
* or where it makes more sense is to build a query which is made out of a
* left join and a standard join
* setLeftJoin(table1,'<where clause1>')
* // results in ... FROM $this->table LEFT JOIN table ON <where clause1>
* addJoin(table2,'<where clause2>')
* // results in ... FROM $this->table,table2 LEFT JOIN table ON <where clause1> WHERE <where clause2>
*
* @access public
* @param string the table to be joined
* @param string the where clause for the join
* @param string the join type
*/
function addJoin($table, $where, $type='default')
{
if ($table == $this->table) {
return; //skip. Self joins are not supported.
}
// init value, to prevent E_ALL-warning
if (!isset($this->_join[$type]) || !$this->_join[$type]) {
$this->_join[$type] = array();
}
$this->_join[$type][$table] = $where;
}
 
// }}}
// {{{ setTable()
 
/**
* sets the table this class is currently working on
*
* @version 2002/07/11
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param string the table name
*/
function setTable($table)
{
$this->table = $table;
}
 
// }}}
// {{{ getTable()
 
/**
* gets the table this class is currently working on
*
* @version 2002/07/11
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @return string the table name
*/
function getTable()
{
return $this->table;
}
 
// }}}
// {{{ setGroup()
 
/**
* sets the group-by condition
*
* @version 2002/07/22
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param string the group condition
*/
function setGroup($group='')
{
$this->_group = $group;
//FIXXME parse the condition and replace ambigious column names, such as "name='Deutschland'" with "country.name='Deutschland'"
// then the users dont have to write that explicitly and can use the same name as in the setOrder i.e. setOrder('name,_net_name,_netPrefix_prefix');
}
 
// }}}
// {{{ getGroup()
 
/**
* gets the group condition which is used for the current instance
*
* @version 2002/07/22
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @return string the group condition
*/
function getGroup()
{
return $this->_group;
}
 
// }}}
// {{{ setSelect()
 
/**
* limit the result to return only the columns given in $what
* @param string fields that shall be selected
*/
function setSelect($what='*')
{
$this->_select = $what;
}
 
// }}}
// {{{ addSelect()
 
/**
* add a string to the select part of the query
*
* add a string to the select-part of the query and connects it to an existing
* string using the $connectString, which by default is a comma.
* (SELECT xxx FROM - xxx is the select-part of a query)
*
* @version 2003/01/08
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param string the string that shall be added to the select-part
* @param string the string to connect the new string with the existing one
* @return void
*/
function addSelect($what='*', $connectString=',')
{
// if the select string is not empty add the string, otherwise simply set it
if ($this->_select) {
$this->_select = $this->_select.$connectString.$what;
} else {
$this->_select = $what;
}
}
 
// }}}
// {{{ getSelect()
 
/**
* @return string
*/
function getSelect()
{
return $this->_select;
}
 
// }}}
// {{{ setDontSelect()
 
/**
* @param string
*/
function setDontSelect($what='')
{
$this->_dontSelect = $what;
}
 
// }}}
// {{{ getDontSelect()
 
/**
* @return string
*/
function getDontSelect()
{
return $this->_dontSelect;
}
 
// }}}
// {{{ reset()
 
/**
* reset all the set* settings; with no parameter given, it resets them all
*
* @version 2002/09/16
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @return void
*/
function reset($what=array())
{
if (!sizeof($what)) {
$what = array(
'select',
'dontSelect',
'group',
'having',
'limit',
'where',
'index',
'order',
'join',
'leftJoin',
'rightJoin'
);
}
 
foreach ($what as $aReset) {
$this->{'set'.ucfirst($aReset)}();
}
}
 
// }}}
// {{{ setOption()
 
/**
* set mode the class shall work in
* currently we have the modes:
* 'raw' does not quote the data before building the query
*
* @version 2002/09/17
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param string the mode to be set
* @param mixed the value of the mode
* @return void
*/
function setOption($option, $value)
{
$this->options[strtolower($option)] = $value;
}
 
// }}}
// {{{ getOption()
 
/**
* @return string
*/
function getOption($option)
{
return $this->options[strtolower($option)];
}
 
// }}}
// {{{ _quoteArray()
 
/**
* quotes all the data in this array if we are not in raw mode!
* @param array
*/
function _quoteArray($data)
{
if (!$this->getOption('raw')) {
foreach ($data as $key => $val) {
$data[$key] = $this->db->quote($val);
}
}
return $data;
}
 
// }}}
// {{{ _checkColumns()
 
/**
* checks if the columns which are given as the array's indexes really exist
* if not it will be unset anyway
*
* @version 2002/04/16
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param string the actual message, first word should always be the method name,
* to build the message like this: className::methodname
* @param integer the line number
*/
function _checkColumns($newData, $method='unknown')
{
if (!$meta = $this->metadata()) { // if no metadata available, return data as given
return $newData;
}
 
foreach ($newData as $colName => $x) {
if (!isset($meta[$colName])) {
$this->_errorLog("$method, column {$this->table}.$colName doesnt exist, value was removed before '$method'",__LINE__);
unset($newData[$colName]);
} else {
// if the current column exists, check the length too, not to write content that is too long
// prevent DB-errors here
// do only check the data length if this field is given
if (isset($meta[$colName]['len']) && ($meta[$colName]['len'] != -1) &&
($oldLength=strlen($newData[$colName])) > $meta[$colName]['len']
) {
$this->_errorLog("_checkColumns, had to trim column '$colName' from $oldLength to ".
$meta[$colName]['DATA_LENGTH'].' characters.', __LINE__);
$newData[$colName] = substr($newData[$colName], 0, $meta[$colName]['len']);
}
}
}
return $newData;
}
 
// }}}
// {{{ debug()
 
/**
* overwrite this method and i.e. print the query $string
* to see the final query
*
* @param string the query mostly
*/
function debug($string){}
 
//
//
// ONLY ORACLE SPECIFIC, not very nice since it is DB dependent, but we need it!!!
//
//
 
// }}}
// {{{ metadata()
 
/**
* !!!! query COPIED FROM db_oci8.inc - from PHPLIB !!!!
*
* @access public
* @see
* @version 2001/09
* @author PHPLIB
* @param
* @return
*/
function metadata($table='')
{
// is there an alias in the table name, then we have something like this: 'user ua'
// cut of the alias and return the table name
if (strpos($table, ' ') !== false) {
$split = explode(' ', trim($table));
$table = $split[0];
}
 
$full = false;
if (empty($table)) {
$table = $this->table;
}
// to prevent multiple selects for the same metadata
if (isset($this->_metadata[$table])) {
return $this->_metadata[$table];
}
 
// FIXXXME use oci8 implementation of newer PEAR::DB-version
if ($this->db->phptype == 'oci8') {
$count = 0;
$id = 0;
$res = array();
 
//# This is a RIGHT OUTER JOIN: "(+)", if you want to see, what
//# this query results try the following:
//// $table = new Table; $this->db = new my_DB_Sql; // you have to make
//// // your own class
//// $table->show_results($this->db->query(see query vvvvvv))
////
$res = $this->db->getAll("SELECT T.column_name,T.table_name,T.data_type,".
"T.data_length,T.data_precision,T.data_scale,T.nullable,".
"T.char_col_decl_length,I.index_name".
" FROM ALL_TAB_COLUMNS T,ALL_IND_COLUMNS I".
" WHERE T.column_name=I.column_name (+)".
" AND T.table_name=I.table_name (+)".
" AND T.table_name=UPPER('$table') ORDER BY T.column_id");
 
if (DB::isError($res)) {
//$this->_errorSet($res->getMessage());
// i think we only need to log here, since this method is never used
// directly for the user's functionality, which means if it fails it
// is most probably an appl error
$this->_errorLog($res->getUserInfo());
return false;
}
foreach ($res as $key=>$val) {
$res[$key]['name'] = $val['COLUMN_NAME'];
}
} else {
if (!is_object($this->db)) {
return false;
}
$res = $this->db->tableinfo($table);
if (DB::isError($res)) {
$this->_errorSet($res->getUserInfo());
return false;
}
}
 
$ret = array();
foreach ($res as $key => $val) {
$ret[$val['name']] = $val;
}
$this->_metadata[$table] = $ret;
return $ret;
}
 
 
 
//
// methods for building the query
//
 
// }}}
// {{{ _buildFrom()
 
/**
* build the from string
*
* @access private
* @return string the string added after FROM
*/
function _buildFrom()
{
$from = $this->table;
$join = $this->getJoin();
 
if (!$join) { // no join set
return $from;
}
// handle the standard join thingy
if (isset($join['default']) && count($join['default'])) {
$from .= ','.implode(',',array_keys($join['default']));
}
 
// handle left/right joins
foreach (array('left', 'right') as $joinType) {
if (isset($join[$joinType]) && count($join[$joinType])) {
foreach($join[$joinType] as $table => $condition) {
// replace the _TABLENAME_COLUMNNAME by TABLENAME.COLUMNNAME
// since oracle doesnt work with the _TABLENAME_COLUMNNAME which i think is strange
// FIXXME i think this should become deprecated since the setWhere should not be used like this: '_table_column' but 'table.column'
$regExp = '/_('.$table.')_([^\s]+)/';
$where = preg_replace($regExp, '$1.$2', $condition);
 
// add the table name before any column that has no table prefix
// since this might cause "unambiguous column" errors
if ($meta = $this->metadata()) {
foreach ($meta as $aCol=>$x) {
// this covers the LIKE,IN stuff: 'name LIKE "%you%"' 'id IN (2,3,4,5)'
$condition = preg_replace('/\s'.$aCol.'\s/', " {$this->table}.$aCol ", $condition);
// replace also the column names which are behind a '='
// and do this also if the aCol is at the end of the where clause
// that's what the $ is for
$condition = preg_replace('/=\s*'.$aCol.'(\s|$)/', "={$this->table}.$aCol ", $condition);
// replace if colName is first and possibly also if at the beginning of the where-string
$condition = preg_replace('/(^\s*|\s+)'.$aCol.'\s*=/', "$1{$this->table}.$aCol=", $condition);
}
}
$from .= ' '.strtoupper($joinType).' JOIN '.$table.' ON '.$condition;
}
}
}
return $from;
}
 
// }}}
// {{{ getTableShortName()
 
/**
* this method gets the short name for a table
*
* get the short name for a table, this is needed to properly build the
* 'AS' parts in the select query
* @param string the real table name
* @return string the table's short name
*/
function getTableShortName($table)
{
$tableSpec = $this->getTableSpec(false);
if (isset($tableSpec[$table]['shortName']) && $tableSpec[$table]['shortName']) {
//print "$table ... ".$tableSpec[$table]['shortName'].'<br>';
return $tableSpec[$table]['shortName'];
}
 
$possibleTableShortName = preg_replace($this->_tableNameToShortNamePreg, '', $table);
//print "$table ... $possibleTableShortName<br>";
return $possibleTableShortName;
}
 
// }}}
// {{{ getTableSpec()
 
/**
* gets the tableSpec either indexed by the short name or the name
* returns the array for the tables given as parameter or if no
* parameter given for all tables that exist in the tableSpec
*
* @param array table names (not the short names!)
* @param boolean if true the table is returned indexed by the shortName
* otherwise indexed by the name
* @return array the tableSpec indexed
*/
function getTableSpec($shortNameIndexed=true, $tables=array())
{
$newSpec = array();
foreach ($this->tableSpec as $aSpec) {
if (sizeof($tables)==0 || in_array($aSpec['name'],$tables)) {
if ($shortNameIndexed) {
$newSpec[$aSpec['shortName']] = $aSpec;
} else {
$newSpec[$aSpec['name']] = $aSpec;
}
}
}
return $newSpec;
}
 
// }}}
// {{{ _buildSelect()
 
/**
* build the 'SELECT <what> FROM ... 'for a select
*
* @version 2002/07/11
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param string if given use this string
* @return string the what-clause
*/
function _buildSelect($what=null)
{
// what has preference, that means if what is set it is used
// this is only because the methods like 'get' pass an individually built value, which
// is supposed to be used, but usually it's generically build using the 'getSelect' values
if (empty($what) && $this->getSelect()) {
$what = $this->getSelect();
}
 
//
// replace all the '*' by the real column names, and take care of the dontSelect-columns!
//
$dontSelect = $this->getDontSelect();
$dontSelect = $dontSelect ? explode(',', $dontSelect) : array(); // make sure dontSelect is an array
 
// here we will replace all the '*' and 'table.*' by all the columns that this table
// contains. we do this so we can easily apply the 'dontSelect' values.
// and so we can also handle queries like: 'SELECT *,count() FROM ' and 'SELECT table.*,x FROM ' too
if (strpos($what, '*') !== false) {
// subpattern 1 get all the table names, that are written like this: 'table.*' including '*'
// for '*' the tablename will be ''
preg_match_all('/([^,]*)(\.)?\*\s*(,|$)/U', $what, $res);
//print "$what ... ";print_r($res);print "<br>";
$selectAllFromTables = array_unique($res[1]); // make the table names unique, so we do it all just once for each table
$tables = array();
if (in_array('', $selectAllFromTables)) { // was there a '*' ?
// get all the tables that we need to process, depending on if joined or not
$tables = $this->getJoin() ?
array_merge($this->getJoin('tables'), array($this->table)) : // get the joined tables and this->table
array($this->table); // create an array with only this->table
} else {
$tables = $selectAllFromTables;
}
 
$cols = array();
foreach ($tables as $aTable) { // go thru all the tables and get all columns for each, and handle 'dontSelect'
if ($meta = $this->metadata($aTable)) {
foreach ($meta as $colName => $x) {
// handle the dontSelect's
if (in_array($colName, $dontSelect) || in_array("$aTable.$colName", $dontSelect)) {
continue;
}
 
// build the AS clauses
// put " around them to enable use of reserved words, i.e. SELECT table.option as option FROM...
// and 'option' actually is a reserved word, at least in mysql
// put double quotes around them, since pgsql doesnt work with single quotes
// but don't do this for ibase because it doesn't work!
if ($aTable == $this->table) {
if ($this->db->phptype == 'ibase') {
$cols[$aTable][] = $this->table. '.' .$colName . ' AS '. $colName;
} else {
$cols[$aTable][] = $this->table. '.' .$colName . ' AS "'. $colName .'"';
}
} else {
$cols[$aTable][] = "$aTable.$colName AS \"_".$this->getTableShortName($aTable)."_$colName\"";
}
}
}
}
 
// put the extracted select back in the $what
// that means replace 'table.*' by the i.e. 'table.id AS _table_id'
// or if it is the table of this class replace 'table.id AS id'
if (in_array('', $selectAllFromTables)) {
$allCols = array();
foreach ($cols as $aTable) {
$allCols[] = implode(',', $aTable);
}
$what = preg_replace('/(^|,)\*($|,)/', '$1'.implode(',',$allCols).'$2', $what);
// remove all the 'table.*' since we have selected all anyway (because there was a '*' in the select)
$what = preg_replace('/[^,]*(\.)?\*\s*(,|$)/U', '', $what);
} else {
foreach ($cols as $tableName => $aTable) {
if (is_array($aTable) && sizeof($aTable)) {
// replace all the 'table.*' by their select of each column
$what = preg_replace('/(^|,)\s*'.$tableName.'\.\*\s*($|,)/', '$1'.implode(',',$aTable).'$2', $what);
}
}
}
}
 
if ($this->getJoin()) {
// replace all 'column' by '$this->table.column' to prevent ambigious errors
$metadata = $this->metadata();
if (is_array($metadata)) {
foreach ($metadata as $aCol => $x) {
// handle ',id as xid,MAX(id),id' etc.
// FIXXME do this better!!!
$what = preg_replace( "/(^|,|\()(\s*)$aCol(\)|\s|,|as|$)/i",
// $2 is actually just to keep the spaces, is not really
// necessary, but this way the test works independent of this functionality here
"$1$2{$this->table}.$aCol$3",
$what);
}
}
// replace all 'joinedTable.columnName' by '_joinedTable_columnName'
// this actually only has an effect if there was no 'table.*' for 'table'
// if that was there, then it has already been done before
foreach ($this->getJoin('tables') as $aTable) {
if ($meta = $this->metadata($aTable)) {
foreach ($meta as $aCol=>$x) {
// dont put the 'AS' behind it if there is already one
if (preg_match("/$aTable.$aCol\s*as/i",$what)) {
continue;
}
// this covers a ' table.colName ' surrounded by spaces, and replaces it by ' table.colName AS _table_colName'
$what = preg_replace('/\s'.$aTable.'.'.$aCol.'\s/', " $aTable.$aCol AS _".$this->getTableShortName($aTable)."_$aCol ", $what);
// replace also the column names which are behind a ','
// and do this also if the aCol is at the end that's what the $ is for
$what = preg_replace('/,\s*'.$aTable.'.'.$aCol.'(,|\s|$)/', ",$aTable.$aCol AS _".$this->getTableShortName($aTable)."_$aCol$1", $what);
// replace if colName is first and possibly also if at the beginning of the where-string
$what = preg_replace('/(^\s*|\s+)'.$aTable.'.'.$aCol.'\s*,/', "$1$aTable.$aCol AS _".$this->getTableShortName($aTable)."_$aCol,", $what);
}
}
}
}
return $what;
}
 
// }}}
// {{{ _buildWhere()
 
/**
* Build WHERE clause
*
* @param string $where WHERE clause
* @return string $where WHERE clause after processing
* @access private
*/
function _buildWhere($where='')
{
$where = trim($where);
$originalWhere = $this->getWhere();
if ($originalWhere) {
if (!empty($where)) {
$where = $originalWhere.' AND '.$where;
} else {
$where = $originalWhere;
}
}
$where = trim($where);
 
if ($join = $this->getJoin()) { // is join set?
// only those where conditions in the default-join have to be added here
// left-join conditions are added behind 'ON', the '_buildJoin()' does that
if (isset($join['default']) && count($join['default'])) {
// we have to add this join-where clause here
// since at least in mysql a query like: select * from tableX JOIN tableY ON ...
// doesnt work, may be that's even SQL-standard...
if (!empty($where)) {
$where = implode(' AND ', $join['default']).' AND '.$where;
} else {
$where = implode(' AND ', $join['default']);
}
}
// replace the _TABLENAME_COLUMNNAME by TABLENAME.COLUMNNAME
// since oracle doesnt work with the _TABLENAME_COLUMNNAME which i think is strange
// FIXXME i think this should become deprecated since the setWhere should not be used like this: '_table_column' but 'table.column'
$regExp = '/_('.implode('|', $this->getJoin('tables')).')_([^\s]+)/';
$where = preg_replace($regExp, '$1.$2', $where);
// add the table name before any column that has no table prefix
// since this might cause "unambigious column" errors
if ($meta = $this->metadata()) {
foreach ($meta as $aCol => $x) {
// this covers the LIKE,IN stuff: 'name LIKE "%you%"' 'id IN (2,3,4,5)'
$where = preg_replace('/\s'.$aCol.'\s/', " {$this->table}.$aCol ", $where);
// replace also the column names which are behind a '='
// and do this also if the aCol is at the end of the where clause
// that's what the $ is for
$where = preg_replace('/([=<>])\s*'.$aCol.'(\s|$)/', "$1{$this->table}.$aCol ", $where);
// replace if colName is first and possibly also if at the beginning of the where-string
$where = preg_replace('/(^\s*|\s+)'.$aCol.'\s*([=<>])/', "$1{$this->table}.$aCol$2", $where);
}
}
}
return $where;
}
 
// }}}
// {{{ _buildOrder()
 
/**
*
*
* @version 2002/07/11
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param
* @return
*/
function _buildOrder()
{
$order = $this->getOrder();
// replace 'column' by '$this->table.column' if the column is defined for $this->table
if ($meta = $this->metadata()) {
foreach ($meta as $aCol=>$x) {
$order = preg_replace('/(^\s*|\s+|,)'.$aCol.'\s*(,)?/U', "$1{$this->table}.$aCol$2", $order);
}
}
return $order;
}
 
// }}}
// {{{ _buildGroup()
 
/**
* Build the group-clause, replace 'column' by 'table.column'.
*
* @access public
* @param void
* @return string the rendered group clause
*/
function _buildGroup()
{
$group = $this->getGroup();
// replace 'column' by '$this->table.column' if the column is defined for $this->table
if ($meta = $this->metadata()) {
foreach ($meta as $aCol => $x) {
$group = preg_replace('/(^\s*|\s+|,)'.$aCol.'\s*(,)?/U', "$1{$this->table}.$aCol$2", $group);
}
}
return $group;
}
 
// }}}
// {{{ _buildHaving()
 
/**
*
* @version 2003/06/05
* @access public
* @author Johannes Schaefer <johnschaefer@gmx.de>
* @param
* @return string the having clause
*/
function _buildHaving()
{
$having = $this->getHaving();
// replace 'column' by '$this->table.column' if the column is defined for $this->table
if ($meta = $this->metadata()) {
foreach ($meta as $aCol => $x) {
$having = preg_replace('/(^\s*|\s+|,)'.$aCol.'\s*(,)?/U',"$1{$this->table}.$aCol$2",$having);
}
}
return $having;
}
 
// }}}
// {{{ _buildHaving()
 
/**
*
* @version 2002/07/11
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param array this array contains the elements of the query,
* indexed by their key, which are: 'select','from','where', etc.
* @param boolean whether this method is called via getCount() or not.
* @return
*/
function _buildSelectQuery($query=array(), $isCalledViaGetCount = false)
{
/*FIXXXME finish this
$cacheKey = md5(serialize(????));
if (isset($this->_queryCache[$cacheKey])) {
$this->_errorLog('using cached query',__LINE__);
return $this->_queryCache[$cacheKey];
}
*/
$where = isset($query['where']) ? $query['where'] : $this->_buildWhere();
if ($where) {
$where = 'WHERE '.$where;
}
$order = isset($query['order']) ? $query['order'] : $this->_buildOrder();
if ($order) {
$order = 'ORDER BY '.$order;
}
$group = isset($query['group']) ? $query['group'] : $this->_buildGroup();
if ($group) {
$group = 'GROUP BY '.$group;
}
$having = isset($query['having']) ? $query['having'] : $this->_buildHaving();
if ($having) {
$having = 'HAVING '.$having;
}
$queryString = sprintf( 'SELECT %s FROM %s %s %s %s %s',
isset($query['select']) ? $query['select'] : $this->_buildSelect(),
isset($query['from']) ? $query['from'] : $this->_buildFrom(),
$where,
$group,
$having,
$order
);
// $query['limit'] has preference!
$limit = isset($query['limit']) ? $query['limit'] : $this->_limit;
if (!$isCalledViaGetCount && @$limit[1]) { // is there a count set?
$queryString=$this->db->modifyLimitQuery($queryString,$limit[0],$limit[1]);
if (DB::isError($queryString)) {
$this->_errorSet('DB_QueryTool::db::modifyLimitQuery failed '.$queryString->getMessage());
$this->_errorLog($queryString->getUserInfo());
return false;
}
}
// $this->_queryCache[$cacheKey] = $queryString;
return $queryString;
}
 
// }}}
// {{{ _buildUpdateQuery()
 
/**
* this simply builds an update query.
*
* @param array the parameter array might contain the following indexes
* 'where' the where clause to be added, i.e.
* UPDATE table SET x=1 WHERE y=0
* here the 'where' part simply would be 'y=0'
* 'set' the actual data to be updated
* in the example above, that would be 'x=1'
* @return string the resulting query
*/
function _buildUpdateQuery($query=array())
{
$where = isset($query['where']) ? $query['where'] : $this->_buildWhere();
if ($where) {
$where = 'WHERE '.$where;
}
 
$updateString = sprintf('UPDATE %s SET %s %s',
$this->table,
$query['set'],
$where
);
return $updateString;
}
 
// }}}
// {{{ execute()
 
/**
*
* @version 2002/07/11
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param
* @param string query method
* @return boolean
*/
function execute($query=null, $method='getAll')
{
$this->writeLog();
if (is_null($query)) {
$query = $this->_buildSelectQuery();
}
$this->writeLog('query built: '.$query);
 
// FIXXME on ORACLE this doesnt work, since we return joined columns as _TABLE_COLNAME and the _ in front
// doesnt work on oracle, add a letter before it!!!
$this->_lastQuery = $query;
 
$this->debug($query);
$this->writeLog('start query');
if (DB::isError($res = $this->db->$method($query))) {
$this->writeLog('end query (failed)');
if ($this->getOption('verbose')) {
$this->_errorSet($res->getMessage());
} else {
$this->_errorLog($res->getMessage());
}
$this->_errorLog($res->getUserInfo(), __LINE__);
return false;
} else {
$this->writeLog('end query');
}
$res = $this->_makeIndexed($res);
return $res;
}
 
// }}}
// {{{ writeLog()
 
/**
* Write events to the logfile.
*
* It does some additional work, like time measuring etc. to
* see some additional info
*
*/
function writeLog($text='START')
{
//its still really a quicky.... 'refactor' (nice word) that
if (!isset($this->options['logfile'])) {
return;
}
 
include_once 'Log.php';
if (!class_exists('Log')) {
return;
}
if (!$this->_logObject) {
$this->_logObject =& Log::factory('file', $this->options['logfile']);
}
 
if ($text==='start query' || $text==='end query') {
$bytesSent = $this->db->getAll("SHOW STATUS like 'Bytes_sent'");
$bytesSent = $bytesSent[0]['Value'];
}
if ($text==='START') {
$startTime = split(' ', microtime());
$this->_logData['startTime'] = $startTime[1] + $startTime[0];
}
if ($text==='start query') {
$this->_logData['startBytesSent'] = $bytesSent;
$startTime = split(' ', microtime());
$this->_logData['startQueryTime'] = $startTime[1] + $startTime[0];
return;
}
if ($text==='end query') {
$text .= ' result size: '.((int)$bytesSent-(int)$this->_logData['startBytesSent']).' bytes';
$endTime = split(' ', microtime());
$endTime = $endTime[1] + $endTime[0];
$text .= ', took: '.(($endTime - $this->_logData['startQueryTime'])).' seconds';
}
if (strpos($text, 'query built')===0) {
$endTime = split(' ', microtime());
$endTime = $endTime[1] + $endTime[0];
$this->writeLog('query building took: '.(($endTime - $this->_logData['startTime'])).' seconds');
}
$this->_logObject->log($text);
 
if (strpos($text, 'end query')===0) {
$endTime = split(' ', microtime());
$endTime = $endTime[1] + $endTime[0];
$text = 'time over all: '.(($endTime - $this->_logData['startTime'])).' seconds';
$this->_logObject->log($text);
}
}
 
// }}}
// {{{ returnResult()
 
/**
* Return the chosen result type
*
* @version 2004/04/28
* @access public
* @param object reference
* @return mixed
*/
function returnResult(&$result)
{
if ($this->_resultType == 'none') {
return $result;
}
if ($result === false) {
return false;
}
//what about allowing other (custom) result types?
switch (strtolower($this->_resultType)) {
case 'object': return new DB_QueryTool_Result_Object($result);
case 'array':
default: return new DB_QueryTool_Result($result);
}
}
 
// }}}
// {{{ _makeIndexed()
 
/**
*
* @version 2002/07/11
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param mixed
* @return mixed
*/
function &_makeIndexed(&$data)
{
// we can only return an indexed result if the result has a number of columns
if (is_array($data) && sizeof($data) && $key = $this->getIndex()) {
// build the string to evaluate which might be made up out of multiple indexes of a result-row
$evalString = '$val[\''.implode('\'].\',\'.$val[\'',explode(',',$key)).'\']'; //"
 
$indexedData = array();
//FIXXME actually we also need to check ONCE if $val is an array, so to say if $data is 2-dimensional
foreach ($data as $val) {
eval("\$keyValue = $evalString;"); // get the actual real (string-)key (string if multiple cols are used as index)
$indexedData[$keyValue] = $val;
}
unset($data);
return $indexedData;
}
 
return $data;
}
 
// }}}
// {{{ setIndex()
 
/**
* format the result to be indexed by $key
* NOTE: be careful, when using this you should be aware, that if you
* use an index which's value appears multiple times you may loose data
* since a key cant exist multiple times!!
* the result for a result to be indexed by a key(=columnName)
* (i.e. 'relationtoMe') which's values are 'brother' and 'sister'
* or alike normally returns this:
* $res['brother'] = array('name'=>'xxx')
* $res['sister'] = array('name'=>'xxx')
* but if the column 'relationtoMe' contains multiple entries for 'brother'
* then the returned dataset will only contain one brother, since the
* value from the column 'relationtoMe' is used
* and which 'brother' you get depends on a lot of things, like the sortorder,
* how the db saves the data, and whatever else
*
* you can also set indexes which depend on 2 columns, simply pass the parameters like
* 'table1.id,table2.id' it will be used as a string for indexing the result
* and the index will be built using the 2 values given, so a possible
* index might be '1,2' or '2108,29389' this way you can access data which
* have 2 primary keys. Be sure to remember that the index is a string!
*
* @version 2002/07/11
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param
* @return
*/
function setIndex($key=null)
{
if ($this->getJoin()) { // is join set?
// replace TABLENAME.COLUMNNAME by _TABLENAME_COLUMNNAME
// since this is only the result-keys can be used for indexing :-)
$regExp = '/('.implode('|', $this->getJoin('tables')).')\.([^\s]+)/';
$key = preg_replace($regExp, '_$1_$2', $key);
 
// remove the table name if it is in front of '<$this->table>.columnname'
// since the key doesnt contain it neither
if ($meta = $this->metadata()) {
foreach ($meta as $aCol => $x) {
$key = preg_replace('/'.$this->table.'\.'.$aCol.'/', $aCol, $key);
}
}
}
$this->_index = $key;
}
 
// }}}
// {{{ getIndex()
 
/**
*
* @version 2002/07/11
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param
* @return
*/
function getIndex()
{
return $this->_index;
}
 
// }}}
// {{{ useResult()
 
/**
* Choose the type of the returned result
*
* @version 2004/04/28
* @access public
* @param string $type ['array' | 'object' | 'none']
* For BC reasons, $type=true is equal to 'array',
* $type=false is equal to 'none'
*/
function useResult($type='array')
{
if ($type === true) {
$type = 'array';
} elseif ($type === false) {
$type = 'none';
}
switch (strtolower($type)) {
case 'array':
$this->_resultType = 'array';
require_once 'DB/QueryTool/Result.php';
break;
case 'object':
$this->_resultType = 'object';
require_once 'DB/QueryTool/Result/Object.php';
break;
default:
$this->_resultType = 'none';
}
}
 
// }}}
// {{{ setErrorCallback()
 
/**
* set both callbacks
* @param string
*/
function setErrorCallback($param='')
{
$this->setErrorLogCallback($param);
$this->setErrorSetCallback($param);
}
 
// }}}
// {{{ setErrorLogCallback()
 
/**
* @param string
*/
function setErrorLogCallback($param='')
{
$errorLogCallback = &PEAR::getStaticProperty('DB_QueryTool','_errorLogCallback');
$errorLogCallback = $param;
}
 
// }}}
// {{{ setErrorSetCallback()
 
/**
* @param string
*/
function setErrorSetCallback($param='')
{
$errorSetCallback = &PEAR::getStaticProperty('DB_QueryTool','_errorSetCallback');
$errorSetCallback = $param;
}
 
// }}}
// {{{ _errorLog()
 
/**
* sets error log and adds additional info
*
* @version 2002/04/16
* @access public
* @author Wolfram Kriesing <wk@visionp.de>
* @param string the actual message, first word should always be the method name,
* to build the message like this: className::methodname
* @param integer the line number
*/
function _errorLog($msg, $line='unknown')
{
$this->_errorHandler('log', $msg, $line);
/*
if ($this->getOption('verbose') == true)
{
$this->_errorLog(get_class($this)."::$msg ($line)");
return;
}
 
if ($this->_errorLogCallback)
call_user_func($this->_errorLogCallback, $msg);
*/
}
 
// }}}
// {{{ _errorSet()
 
/**
* @param string
* @param string
*/
function _errorSet($msg, $line='unknown')
{
$this->_errorHandler('set', $msg, $line);
}
 
// }}}
// {{{ _errorHandler()
 
/**
* @param
* @param string
* @param string
*/
function _errorHandler($logOrSet, $msg, $line='unknown')
{
/* what did i do this for?
if ($this->getOption('verbose') == true)
{
$this->_errorHandler($logOrSet, get_class($this)."::$msg ($line)");
return;
}
*/
 
$msg = get_class($this)."::$msg ($line)";
 
$logOrSet = ucfirst($logOrSet);
$callback = &PEAR::getStaticProperty('DB_QueryTool','_error'.$logOrSet.'Callback');
//var_dump($callback);
//if ($callback)
// call_user_func($callback, $msg);
// else
// ?????
 
}
 
// }}}
}
?>
/tags/Racine_livraison_narmer/api/pear/DB/QueryTool/Result/Object.php
New file
0,0 → 1,89
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 
/**
* Contains the DB_QueryTool_Result_Row and DB_QueryTool_Result_Object classes
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Database
* @package DB_QueryTool
* @author Roman Dostovalov, Com-tec-so S.A.<roman.dostovalov@ctco.lv>
* @copyright 2004-2005 Roman Dostovalov
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id: Object.php,v 1.1 2006-12-14 15:04:29 jp_milcent Exp $
* @link http://pear.php.net/package/DB_QueryTool
*/
 
/**
* Include parent class
*/
require_once 'DB/QueryTool/Result.php';
 
/**
* DB_QueryTool_Result_Row class
*
* @category Database
* @package DB_QueryTool
* @author Roman Dostovalov, Com-tec-so S.A.<roman.dostovalov@ctco.lv>
* @copyright 2004-2005 Roman Dostovalov
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @link http://pear.php.net/package/DB_QueryTool
*/
class DB_QueryTool_Result_Row
{
/**
* create object properties from the array
* @param array
*/
function DB_QueryTool_Result_Row($arr)
{
foreach ($arr as $key => $value) {
$this->$key = $value;
}
}
}
 
// -----------------------------------------------------------------------------
 
/**
* DB_QueryTool_Result_Object class
*
* @category Database
* @package DB_QueryTool
* @author Roman Dostovalov, Com-tec-so S.A.<roman.dostovalov@ctco.lv>
* @copyright 2004-2005 Roman Dostovalov
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @link http://pear.php.net/package/DB_QueryTool
*/
class DB_QueryTool_Result_Object extends DB_QueryTool_Result
{
// {{{ fetchRow
 
/**
* This function emulates PEAR::DB fetchRow() method
* With this function DB_QueryTool can transparently replace PEAR::DB
*
* @todo implement fetchmode support?
* @access public
* @return void
*/
function fetchRow()
{
$arr = $this->getNext();
if (!PEAR::isError($arr)) {
$row = new DB_QueryTool_Result_Row($arr);
return $row;
}
return false;
}
 
// }}}
}
?>
/tags/Racine_livraison_narmer/api/pear/DB/QueryTool/Result.php
New file
0,0 → 1,261
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 
/**
* Contains the DB_QueryTool_Result class
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Database
* @package DB_QueryTool
* @author Wolfram Kriesing <wk@visionp.de>
* @author Paolo Panto <wk@visionp.de>
* @author Lorenzo Alberton <l dot alberton at quipo dot it>
* @copyright 2003-2005 Wolfram Kriesing, Paolo Panto, Lorenzo Alberton
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id: Result.php,v 1.1 2006-12-14 15:04:29 jp_milcent Exp $
* @link http://pear.php.net/package/DB_QueryTool
*/
 
/**
* DB_QueryTool_Result class
*
* This result actually contains the 'data' itself, the number of rows
* returned and some additional info
* using ZE2 you can also get retrieve data from the result doing the following:
* <DB_QueryTool_Common-instance>->getAll()->getCount()
* or
* <DB_QueryTool_Common-instance>->getAll()->getData()
*
* @category Database
* @package DB_QueryTool
* @author Wolfram Kriesing <wk@visionp.de>
* @author Paolo Panto <wk@visionp.de>
* @author Lorenzo Alberton <l dot alberton at quipo dot it>
* @copyright 2003-2005 Wolfram Kriesing, Paolo Panto, Lorenzo Alberton
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @link http://pear.php.net/package/DB_QueryTool
*/
class DB_QueryTool_Result
{
// {{{ class vars
 
/**
* @var array
*/
var $_data = array();
 
/**
* @var array
*/
var $_dataKeys = array();
 
/**
* @var integer
*/
var $_count = 0;
 
/**
* the counter for the methods getFirst, getNext
* @var array
*/
var $_counter = null;
 
// }}}
// {{{ DB_QueryTool_Result()
 
/**
* create a new instance of result with the data returned by the query
*
* @version 2002/07/11
* @access public
* @author Wolfram Kriesing <wolfram@kriesing.de>
* @param array the data returned by the result
*/
function DB_QueryTool_Result($data)
{
if (!count($data)) {
$this->_count = 0;
} else {
list($firstElement) = $data;
if (is_array($firstElement)) { // is the array a collection of rows?
$this->_count = sizeof($data);
} else {
if (sizeof($data) > 0) {
$this->_count = 1;
} else {
$this->_count = 0;
}
}
}
$this->_data = $data;
}
 
// }}}
// {{{ numRows
 
/**
* return the number of rows returned. This is an alias for getCount().
*
* @access public
* @return integer
*/
function numRows()
{
return $this->_count;
}
 
// }}}
// {{{ getCount()
 
/**
* return the number of rows returned
*
* @version 2002/07/11
* @access public
* @author Wolfram Kriesing <wolfram@kriesing.de>
* @return integer the number of rows returned
*/
function getCount()
{
return $this->_count;
}
 
// }}}
// {{{ getData()
 
/**
* get all the data returned
*
* @version 2002/07/11
* @access public
* @author Wolfram Kriesing <wolfram@kriesing.de>
* @param string $key
* @return mixed array or PEAR_Error
*/
function getData($key=null)
{
if (is_null($key)) {
return $this->_data;
}
if ($this->_data[$key]) {
return $this->_data[$key];
}
return new PEAR_Error("there is no element with the key '$key'!");
}
 
// }}}
// {{{ getFirst()
 
/**
* get the first result set
* we are not using next, current, and reset, since those ignore keys
* which are empty or 0
*
* @version 2002/07/11
* @access public
* @author Wolfram Kriesing <wolfram@kriesing.de>
* @return mixed
*/
function getFirst()
{
if ($this->getCount() > 0) {
$this->_dataKeys = array_keys($this->_data);
$this->_counter = 0;
return $this->_data[$this->_dataKeys[$this->_counter]];
}
return new PEAR_Error('There are no elements!');
}
 
// }}}
// {{{ getNext()
 
/**
* Get next result set. If getFirst() has never been called before,
* it calls that method.
* @return mixed
* @access public
*/
function getNext()
{
if (!$this->initDone()) {
return $this->getFirst();
}
if ($this->hasMore()) {
$this->_counter++;
return $this->_data[$this->_dataKeys[$this->_counter]];
}
return new PEAR_Error('there are no more elements!');
}
 
// }}}
// {{{ hasMore()
 
/**
* check if there are other rows
*
* @return boolean
* @access public
*/
function hasMore()
{
if ($this->_counter+1 < $this->getCount()) {
return true;
}
return false;
}
 
// }}}
// {{{ fetchRow
 
/**
* This function emulates PEAR::DB fetchRow() method.
* With this method, DB_QueryTool can transparently replace PEAR_DB
*
* @todo implement fetchmode support?
* @access public
* @return void
*/
function fetchRow()
{
if ($this->hasMore()) {
$arr = $this->getNext();
if (!PEAR::isError($arr)) {
return $arr;
}
}
return false;
}
 
// }}}
// {{{ initDone
 
/**
* Helper method. Check if $this->_dataKeys has been initialized
*
* @return boolean
* @access private
*/
function initDone()
{
return (
isset($this->_dataKeys) &&
is_array($this->_dataKeys) &&
count($this->_dataKeys)
);
}
 
// }}}
 
#TODO
#function getPrevious()
#function getLast()
 
}
?>
/tags/Racine_livraison_narmer/api/pear/DB/QueryTool/EasyJoin.php
New file
0,0 → 1,135
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 
/**
* Contains the DB_QueryTool_EasyJoin class
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Database
* @package DB_QueryTool
* @author Wolfram Kriesing <wk@visionp.de>
* @author Paolo Panto <wk@visionp.de>
* @copyright 2003-2005 Wolfram Kriesing, Paolo Panto
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id: EasyJoin.php,v 1.1 2006-12-14 15:04:29 jp_milcent Exp $
* @link http://pear.php.net/package/DB_QueryTool
*/
 
/**
* require the DB_QueryTool_Query class
*/
require_once 'DB/QueryTool/Query.php';
 
/**
* DB_QueryTool_EasyJoin class
*
* @category Database
* @package DB_QueryTool
* @author Wolfram Kriesing <wk@visionp.de>
* @copyright 2003-2005 Wolfram Kriesing
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @link http://pear.php.net/package/DB_QueryTool
*/
class DB_QueryTool_EasyJoin extends DB_QueryTool_Query
{
// {{{ class vars
 
/**
* This is the regular expression that shall be used to find a table's shortName
* in a column name, the string found by using this regular expression will be removed
* from the column name and it will be checked if it is a table name
* i.e. the default '/_id$/' would find the table name 'user' from the column name 'user_id'
*
* @var string regexp
*/
var $_tableNamePreg = '/_id$/';
 
/**
* This is to find the column name that is referred by it, so the default find
* from 'user_id' the column 'id' which will be used to refer to the 'user' table
*
* @var string regexp
*/
var $_columnNamePreg = '/^.*_/';
 
// }}}
// {{{ __construct()
 
/**
* call parent constructor
* @param mixed $dsn DSN string, DSN array or DB object
* @param array $options
*/
function __construct($dsn=false, $options=array())
{
parent::DB_QueryTool_Query($dsn, $options);
}
 
// }}}
// {{{ autoJoin()
 
/**
* Join the given tables, using the column names, to find out how to join the tables;
* i.e., if table1 has a column named &quot;table2_id&quot;, this method will join
* &quot;WHERE table1.table2_id=table2.id&quot;.
* All joins made here are only concatenated via AND.
* @param array $tables
*/
function autoJoin($tables)
{
// FIXXME if $tables is empty autoJoin all available tables that have a relation
// to $this->table, starting to search in $this->table
settype($tables, 'array');
// add this->table to the tables array, so we go thru the current table first
$tables = array_merge(array($this->table), $tables);
 
$shortNameIndexed = $this->getTableSpec(true, $tables);
$nameIndexed = $this->getTableSpec(false, $tables);
 
//print_r($shortNameIndexed);
//print_r($tables); print '<br><br>';
if (sizeof($shortNameIndexed) != sizeof($tables)) {
$this->_errorLog("autoJoin-ERROR: not all the tables are in the tableSpec!<br />");
}
 
$joinTables = array();
$joinConditions = array();
foreach ($tables as $aTable) { // go through $this->table and all the given tables
if ($metadata = $this->metadata($aTable))
foreach ($metadata as $aCol => $x) { // go through each row to check which might be related to $aTable
$possibleTableShortName = preg_replace($this->_tableNamePreg, '' , $aCol);
$possibleColumnName = preg_replace($this->_columnNamePreg, '' , $aCol);
//print "$aTable.$aCol .... possibleTableShortName=$possibleTableShortName .... possibleColumnName=$possibleColumnName<br />";
if (isset($shortNameIndexed[$possibleTableShortName])) {
// are the tables given in the tableSpec?
if (!$shortNameIndexed[$possibleTableShortName]['name'] ||
!$nameIndexed[$aTable]['name']) {
// its an error of the developer, so log the error, dont show it to the end user
$this->_errorLog("autoJoin-ERROR: '$aTable' is not given in the tableSpec!<br />");
} else {
// do only join different table.col combination,
// we should not join stuff like 'question.question=question.question'
// this would be quite stupid, but it used to be :-(
if ($shortNameIndexed[$possibleTableShortName]['name'] != $aTable ||
$possibleColumnName != $aCol
) {
$where = $shortNameIndexed[$possibleTableShortName]['name'].".$possibleColumnName=$aTable.$aCol";
$this->addJoin($nameIndexed[$aTable]['name'], $where);
$this->addJoin($shortNameIndexed[$possibleTableShortName]['name'], $where);
}
}
}
}
}
}
 
// }}}
}
?>
/tags/Racine_livraison_narmer/api/pear/DB/dbase.php
New file
0,0 → 1,510
<?php
 
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 
/**
* The PEAR DB driver for PHP's dbase extension
* for interacting with dBase databases
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Database
* @package DB
* @author Tomas V.V. Cox <cox@idecnet.com>
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id: dbase.php,v 1.3 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/DB
*/
 
/**
* Obtain the DB_common class so it can be extended from
*/
require_once 'DB/common.php';
 
/**
* The methods PEAR DB uses to interact with PHP's dbase extension
* for interacting with dBase databases
*
* These methods overload the ones declared in DB_common.
*
* @category Database
* @package DB
* @author Tomas V.V. Cox <cox@idecnet.com>
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version Release: 1.7.6
* @link http://pear.php.net/package/DB
*/
class DB_dbase extends DB_common
{
// {{{ properties
 
/**
* The DB driver type (mysql, oci8, odbc, etc.)
* @var string
*/
var $phptype = 'dbase';
 
/**
* The database syntax variant to be used (db2, access, etc.), if any
* @var string
*/
var $dbsyntax = 'dbase';
 
/**
* The capabilities of this DB implementation
*
* The 'new_link' element contains the PHP version that first provided
* new_link support for this DBMS. Contains false if it's unsupported.
*
* Meaning of the 'limit' element:
* + 'emulate' = emulate with fetch row by number
* + 'alter' = alter the query
* + false = skip rows
*
* @var array
*/
var $features = array(
'limit' => false,
'new_link' => false,
'numrows' => true,
'pconnect' => false,
'prepare' => false,
'ssl' => false,
'transactions' => false,
);
 
/**
* A mapping of native error codes to DB error codes
* @var array
*/
var $errorcode_map = array(
);
 
/**
* The raw database connection created by PHP
* @var resource
*/
var $connection;
 
/**
* The DSN information for connecting to a database
* @var array
*/
var $dsn = array();
 
 
/**
* A means of emulating result resources
* @var array
*/
var $res_row = array();
 
/**
* The quantity of results so far
*
* For emulating result resources.
*
* @var integer
*/
var $result = 0;
 
/**
* Maps dbase data type id's to human readable strings
*
* The human readable values are based on the output of PHP's
* dbase_get_header_info() function.
*
* @var array
* @since Property available since Release 1.7.0
*/
var $types = array(
'C' => 'character',
'D' => 'date',
'L' => 'boolean',
'M' => 'memo',
'N' => 'number',
);
 
 
// }}}
// {{{ constructor
 
/**
* This constructor calls <kbd>$this->DB_common()</kbd>
*
* @return void
*/
function DB_dbase()
{
$this->DB_common();
}
 
// }}}
// {{{ connect()
 
/**
* Connect to the database and create it if it doesn't exist
*
* Don't call this method directly. Use DB::connect() instead.
*
* PEAR DB's dbase driver supports the following extra DSN options:
* + mode An integer specifying the read/write mode to use
* (0 = read only, 1 = write only, 2 = read/write).
* Available since PEAR DB 1.7.0.
* + fields An array of arrays that PHP's dbase_create() function needs
* to create a new database. This information is used if the
* dBase file specified in the "database" segment of the DSN
* does not exist. For more info, see the PHP manual's
* {@link http://php.net/dbase_create dbase_create()} page.
* Available since PEAR DB 1.7.0.
*
* Example of how to connect and establish a new dBase file if necessary:
* <code>
* require_once 'DB.php';
*
* $dsn = array(
* 'phptype' => 'dbase',
* 'database' => '/path/and/name/of/dbase/file',
* 'mode' => 2,
* 'fields' => array(
* array('a', 'N', 5, 0),
* array('b', 'C', 40),
* array('c', 'C', 255),
* array('d', 'C', 20),
* ),
* );
* $options = array(
* 'debug' => 2,
* 'portability' => DB_PORTABILITY_ALL,
* );
*
* $db =& DB::connect($dsn, $options);
* if (PEAR::isError($db)) {
* die($db->getMessage());
* }
* </code>
*
* @param array $dsn the data source name
* @param bool $persistent should the connection be persistent?
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function connect($dsn, $persistent = false)
{
if (!PEAR::loadExtension('dbase')) {
return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
}
 
$this->dsn = $dsn;
if ($dsn['dbsyntax']) {
$this->dbsyntax = $dsn['dbsyntax'];
}
 
/*
* Turn track_errors on for entire script since $php_errormsg
* is the only way to find errors from the dbase extension.
*/
ini_set('track_errors', 1);
$php_errormsg = '';
 
if (!file_exists($dsn['database'])) {
$this->dsn['mode'] = 2;
if (empty($dsn['fields']) || !is_array($dsn['fields'])) {
return $this->raiseError(DB_ERROR_CONNECT_FAILED,
null, null, null,
'the dbase file does not exist and '
. 'it could not be created because '
. 'the "fields" element of the DSN '
. 'is not properly set');
}
$this->connection = @dbase_create($dsn['database'],
$dsn['fields']);
if (!$this->connection) {
return $this->raiseError(DB_ERROR_CONNECT_FAILED,
null, null, null,
'the dbase file does not exist and '
. 'the attempt to create it failed: '
. $php_errormsg);
}
} else {
if (!isset($this->dsn['mode'])) {
$this->dsn['mode'] = 0;
}
$this->connection = @dbase_open($dsn['database'],
$this->dsn['mode']);
if (!$this->connection) {
return $this->raiseError(DB_ERROR_CONNECT_FAILED,
null, null, null,
$php_errormsg);
}
}
return DB_OK;
}
 
// }}}
// {{{ disconnect()
 
/**
* Disconnects from the database server
*
* @return bool TRUE on success, FALSE on failure
*/
function disconnect()
{
$ret = @dbase_close($this->connection);
$this->connection = null;
return $ret;
}
 
// }}}
// {{{ &query()
 
function &query($query = null)
{
// emulate result resources
$this->res_row[(int)$this->result] = 0;
$tmp =& new DB_result($this, $this->result++);
return $tmp;
}
 
// }}}
// {{{ fetchInto()
 
/**
* Places a row from the result set into the given array
*
* Formating of the array and the data therein are configurable.
* See DB_result::fetchInto() for more information.
*
* This method is not meant to be called directly. Use
* DB_result::fetchInto() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result the query result resource
* @param array $arr the referenced array to put the data in
* @param int $fetchmode how the resulting array should be indexed
* @param int $rownum the row number to fetch (0 = first row)
*
* @return mixed DB_OK on success, NULL when the end of a result set is
* reached or on failure
*
* @see DB_result::fetchInto()
*/
function fetchInto($result, &$arr, $fetchmode, $rownum = null)
{
if ($rownum === null) {
$rownum = $this->res_row[(int)$result]++;
}
if ($fetchmode & DB_FETCHMODE_ASSOC) {
$arr = @dbase_get_record_with_names($this->connection, $rownum);
if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) {
$arr = array_change_key_case($arr, CASE_LOWER);
}
} else {
$arr = @dbase_get_record($this->connection, $rownum);
}
if (!$arr) {
return null;
}
if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
$this->_rtrimArrayValues($arr);
}
if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
$this->_convertNullArrayValuesToEmpty($arr);
}
return DB_OK;
}
 
// }}}
// {{{ numCols()
 
/**
* Gets the number of columns in a result set
*
* This method is not meant to be called directly. Use
* DB_result::numCols() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return int the number of columns. A DB_Error object on failure.
*
* @see DB_result::numCols()
*/
function numCols($foo)
{
return @dbase_numfields($this->connection);
}
 
// }}}
// {{{ numRows()
 
/**
* Gets the number of rows in a result set
*
* This method is not meant to be called directly. Use
* DB_result::numRows() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return int the number of rows. A DB_Error object on failure.
*
* @see DB_result::numRows()
*/
function numRows($foo)
{
return @dbase_numrecords($this->connection);
}
 
// }}}
// {{{ quoteSmart()
 
/**
* Formats input so it can be safely used in a query
*
* @param mixed $in the data to be formatted
*
* @return mixed the formatted data. The format depends on the input's
* PHP type:
* + null = the string <samp>NULL</samp>
* + boolean = <samp>T</samp> if true or
* <samp>F</samp> if false. Use the <kbd>Logical</kbd>
* data type.
* + integer or double = the unquoted number
* + other (including strings and numeric strings) =
* the data with single quotes escaped by preceeding
* single quotes then the whole string is encapsulated
* between single quotes
*
* @see DB_common::quoteSmart()
* @since Method available since Release 1.6.0
*/
function quoteSmart($in)
{
if (is_int($in) || is_double($in)) {
return $in;
} elseif (is_bool($in)) {
return $in ? 'T' : 'F';
} elseif (is_null($in)) {
return 'NULL';
} else {
return "'" . $this->escapeSimple($in) . "'";
}
}
 
// }}}
// {{{ tableInfo()
 
/**
* Returns information about the current database
*
* @param mixed $result THIS IS UNUSED IN DBASE. The current database
* is examined regardless of what is provided here.
* @param int $mode a valid tableInfo mode
*
* @return array an associative array with the information requested.
* A DB_Error object on failure.
*
* @see DB_common::tableInfo()
* @since Method available since Release 1.7.0
*/
function tableInfo($result = null, $mode = null)
{
if (function_exists('dbase_get_header_info')) {
$id = @dbase_get_header_info($this->connection);
if (!$id && $php_errormsg) {
return $this->raiseError(DB_ERROR,
null, null, null,
$php_errormsg);
}
} else {
/*
* This segment for PHP 4 is loosely based on code by
* Hadi Rusiah <deegos@yahoo.com> in the comments on
* the dBase reference page in the PHP manual.
*/
$db = @fopen($this->dsn['database'], 'r');
if (!$db) {
return $this->raiseError(DB_ERROR_CONNECT_FAILED,
null, null, null,
$php_errormsg);
}
 
$id = array();
$i = 0;
 
$line = fread($db, 32);
while (!feof($db)) {
$line = fread($db, 32);
if (substr($line, 0, 1) == chr(13)) {
break;
} else {
$pos = strpos(substr($line, 0, 10), chr(0));
$pos = ($pos == 0 ? 10 : $pos);
$id[$i] = array(
'name' => substr($line, 0, $pos),
'type' => $this->types[substr($line, 11, 1)],
'length' => ord(substr($line, 16, 1)),
'precision' => ord(substr($line, 17, 1)),
);
}
$i++;
}
 
fclose($db);
}
 
if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
$case_func = 'strtolower';
} else {
$case_func = 'strval';
}
 
$res = array();
$count = count($id);
 
if ($mode) {
$res['num_fields'] = $count;
}
 
for ($i = 0; $i < $count; $i++) {
$res[$i] = array(
'table' => $this->dsn['database'],
'name' => $case_func($id[$i]['name']),
'type' => $id[$i]['type'],
'len' => $id[$i]['length'],
'flags' => ''
);
if ($mode & DB_TABLEINFO_ORDER) {
$res['order'][$res[$i]['name']] = $i;
}
if ($mode & DB_TABLEINFO_ORDERTABLE) {
$res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
}
}
 
return $res;
}
 
// }}}
}
 
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/
 
?>
/tags/Racine_livraison_narmer/api/pear/DB/mysqli.php
New file
0,0 → 1,1076
<?php
 
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 
/**
* The PEAR DB driver for PHP's mysqli extension
* for interacting with MySQL databases
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Database
* @package DB
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id: mysqli.php,v 1.3 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/DB
*/
 
/**
* Obtain the DB_common class so it can be extended from
*/
require_once 'DB/common.php';
 
/**
* The methods PEAR DB uses to interact with PHP's mysqli extension
* for interacting with MySQL databases
*
* This is for MySQL versions 4.1 and above. Requires PHP 5.
*
* Note that persistent connections no longer exist.
*
* These methods overload the ones declared in DB_common.
*
* @category Database
* @package DB
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version Release: 1.7.6
* @link http://pear.php.net/package/DB
* @since Class functional since Release 1.6.3
*/
class DB_mysqli extends DB_common
{
// {{{ properties
 
/**
* The DB driver type (mysql, oci8, odbc, etc.)
* @var string
*/
var $phptype = 'mysqli';
 
/**
* The database syntax variant to be used (db2, access, etc.), if any
* @var string
*/
var $dbsyntax = 'mysqli';
 
/**
* The capabilities of this DB implementation
*
* The 'new_link' element contains the PHP version that first provided
* new_link support for this DBMS. Contains false if it's unsupported.
*
* Meaning of the 'limit' element:
* + 'emulate' = emulate with fetch row by number
* + 'alter' = alter the query
* + false = skip rows
*
* @var array
*/
var $features = array(
'limit' => 'alter',
'new_link' => false,
'numrows' => true,
'pconnect' => false,
'prepare' => false,
'ssl' => true,
'transactions' => true,
);
 
/**
* A mapping of native error codes to DB error codes
* @var array
*/
var $errorcode_map = array(
1004 => DB_ERROR_CANNOT_CREATE,
1005 => DB_ERROR_CANNOT_CREATE,
1006 => DB_ERROR_CANNOT_CREATE,
1007 => DB_ERROR_ALREADY_EXISTS,
1008 => DB_ERROR_CANNOT_DROP,
1022 => DB_ERROR_ALREADY_EXISTS,
1044 => DB_ERROR_ACCESS_VIOLATION,
1046 => DB_ERROR_NODBSELECTED,
1048 => DB_ERROR_CONSTRAINT,
1049 => DB_ERROR_NOSUCHDB,
1050 => DB_ERROR_ALREADY_EXISTS,
1051 => DB_ERROR_NOSUCHTABLE,
1054 => DB_ERROR_NOSUCHFIELD,
1061 => DB_ERROR_ALREADY_EXISTS,
1062 => DB_ERROR_ALREADY_EXISTS,
1064 => DB_ERROR_SYNTAX,
1091 => DB_ERROR_NOT_FOUND,
1100 => DB_ERROR_NOT_LOCKED,
1136 => DB_ERROR_VALUE_COUNT_ON_ROW,
1142 => DB_ERROR_ACCESS_VIOLATION,
1146 => DB_ERROR_NOSUCHTABLE,
1216 => DB_ERROR_CONSTRAINT,
1217 => DB_ERROR_CONSTRAINT,
);
 
/**
* The raw database connection created by PHP
* @var resource
*/
var $connection;
 
/**
* The DSN information for connecting to a database
* @var array
*/
var $dsn = array();
 
 
/**
* Should data manipulation queries be committed automatically?
* @var bool
* @access private
*/
var $autocommit = true;
 
/**
* The quantity of transactions begun
*
* {@internal While this is private, it can't actually be designated
* private in PHP 5 because it is directly accessed in the test suite.}}
*
* @var integer
* @access private
*/
var $transaction_opcount = 0;
 
/**
* The database specified in the DSN
*
* It's a fix to allow calls to different databases in the same script.
*
* @var string
* @access private
*/
var $_db = '';
 
/**
* Array for converting MYSQLI_*_FLAG constants to text values
* @var array
* @access public
* @since Property available since Release 1.6.5
*/
var $mysqli_flags = array(
MYSQLI_NOT_NULL_FLAG => 'not_null',
MYSQLI_PRI_KEY_FLAG => 'primary_key',
MYSQLI_UNIQUE_KEY_FLAG => 'unique_key',
MYSQLI_MULTIPLE_KEY_FLAG => 'multiple_key',
MYSQLI_BLOB_FLAG => 'blob',
MYSQLI_UNSIGNED_FLAG => 'unsigned',
MYSQLI_ZEROFILL_FLAG => 'zerofill',
MYSQLI_AUTO_INCREMENT_FLAG => 'auto_increment',
MYSQLI_TIMESTAMP_FLAG => 'timestamp',
MYSQLI_SET_FLAG => 'set',
// MYSQLI_NUM_FLAG => 'numeric', // unnecessary
// MYSQLI_PART_KEY_FLAG => 'multiple_key', // duplicatvie
MYSQLI_GROUP_FLAG => 'group_by'
);
 
/**
* Array for converting MYSQLI_TYPE_* constants to text values
* @var array
* @access public
* @since Property available since Release 1.6.5
*/
var $mysqli_types = array(
MYSQLI_TYPE_DECIMAL => 'decimal',
MYSQLI_TYPE_TINY => 'tinyint',
MYSQLI_TYPE_SHORT => 'int',
MYSQLI_TYPE_LONG => 'int',
MYSQLI_TYPE_FLOAT => 'float',
MYSQLI_TYPE_DOUBLE => 'double',
// MYSQLI_TYPE_NULL => 'DEFAULT NULL', // let flags handle it
MYSQLI_TYPE_TIMESTAMP => 'timestamp',
MYSQLI_TYPE_LONGLONG => 'bigint',
MYSQLI_TYPE_INT24 => 'mediumint',
MYSQLI_TYPE_DATE => 'date',
MYSQLI_TYPE_TIME => 'time',
MYSQLI_TYPE_DATETIME => 'datetime',
MYSQLI_TYPE_YEAR => 'year',
MYSQLI_TYPE_NEWDATE => 'date',
MYSQLI_TYPE_ENUM => 'enum',
MYSQLI_TYPE_SET => 'set',
MYSQLI_TYPE_TINY_BLOB => 'tinyblob',
MYSQLI_TYPE_MEDIUM_BLOB => 'mediumblob',
MYSQLI_TYPE_LONG_BLOB => 'longblob',
MYSQLI_TYPE_BLOB => 'blob',
MYSQLI_TYPE_VAR_STRING => 'varchar',
MYSQLI_TYPE_STRING => 'char',
MYSQLI_TYPE_GEOMETRY => 'geometry',
);
 
 
// }}}
// {{{ constructor
 
/**
* This constructor calls <kbd>$this->DB_common()</kbd>
*
* @return void
*/
function DB_mysqli()
{
$this->DB_common();
}
 
// }}}
// {{{ connect()
 
/**
* Connect to the database server, log in and open the database
*
* Don't call this method directly. Use DB::connect() instead.
*
* PEAR DB's mysqli driver supports the following extra DSN options:
* + When the 'ssl' $option passed to DB::connect() is true:
* + key The path to the key file.
* + cert The path to the certificate file.
* + ca The path to the certificate authority file.
* + capath The path to a directory that contains trusted SSL
* CA certificates in pem format.
* + cipher The list of allowable ciphers for SSL encryption.
*
* Example of how to connect using SSL:
* <code>
* require_once 'DB.php';
*
* $dsn = array(
* 'phptype' => 'mysqli',
* 'username' => 'someuser',
* 'password' => 'apasswd',
* 'hostspec' => 'localhost',
* 'database' => 'thedb',
* 'key' => 'client-key.pem',
* 'cert' => 'client-cert.pem',
* 'ca' => 'cacert.pem',
* 'capath' => '/path/to/ca/dir',
* 'cipher' => 'AES',
* );
*
* $options = array(
* 'ssl' => true,
* );
*
* $db =& DB::connect($dsn, $options);
* if (PEAR::isError($db)) {
* die($db->getMessage());
* }
* </code>
*
* @param array $dsn the data source name
* @param bool $persistent should the connection be persistent?
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function connect($dsn, $persistent = false)
{
if (!PEAR::loadExtension('mysqli')) {
return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
}
 
$this->dsn = $dsn;
if ($dsn['dbsyntax']) {
$this->dbsyntax = $dsn['dbsyntax'];
}
 
$ini = ini_get('track_errors');
ini_set('track_errors', 1);
$php_errormsg = '';
 
if ($this->getOption('ssl') === true) {
$init = mysqli_init();
mysqli_ssl_set(
$init,
empty($dsn['key']) ? null : $dsn['key'],
empty($dsn['cert']) ? null : $dsn['cert'],
empty($dsn['ca']) ? null : $dsn['ca'],
empty($dsn['capath']) ? null : $dsn['capath'],
empty($dsn['cipher']) ? null : $dsn['cipher']
);
if ($this->connection = @mysqli_real_connect(
$init,
$dsn['hostspec'],
$dsn['username'],
$dsn['password'],
$dsn['database'],
$dsn['port'],
$dsn['socket']))
{
$this->connection = $init;
}
} else {
$this->connection = @mysqli_connect(
$dsn['hostspec'],
$dsn['username'],
$dsn['password'],
$dsn['database'],
$dsn['port'],
$dsn['socket']
);
}
 
ini_set('track_errors', $ini);
 
if (!$this->connection) {
if (($err = @mysqli_connect_error()) != '') {
return $this->raiseError(DB_ERROR_CONNECT_FAILED,
null, null, null,
$err);
} else {
return $this->raiseError(DB_ERROR_CONNECT_FAILED,
null, null, null,
$php_errormsg);
}
}
 
if ($dsn['database']) {
$this->_db = $dsn['database'];
}
 
return DB_OK;
}
 
// }}}
// {{{ disconnect()
 
/**
* Disconnects from the database server
*
* @return bool TRUE on success, FALSE on failure
*/
function disconnect()
{
$ret = @mysqli_close($this->connection);
$this->connection = null;
return $ret;
}
 
// }}}
// {{{ simpleQuery()
 
/**
* Sends a query to the database server
*
* @param string the SQL query string
*
* @return mixed + a PHP result resrouce for successful SELECT queries
* + the DB_OK constant for other successful queries
* + a DB_Error object on failure
*/
function simpleQuery($query)
{
$ismanip = DB::isManip($query);
$this->last_query = $query;
$query = $this->modifyQuery($query);
if ($this->_db) {
if (!@mysqli_select_db($this->connection, $this->_db)) {
return $this->mysqliRaiseError(DB_ERROR_NODBSELECTED);
}
}
if (!$this->autocommit && $ismanip) {
if ($this->transaction_opcount == 0) {
$result = @mysqli_query($this->connection, 'SET AUTOCOMMIT=0');
$result = @mysqli_query($this->connection, 'BEGIN');
if (!$result) {
return $this->mysqliRaiseError();
}
}
$this->transaction_opcount++;
}
$result = @mysqli_query($this->connection, $query);
if (!$result) {
return $this->mysqliRaiseError();
}
if (is_object($result)) {
return $result;
}
return DB_OK;
}
 
// }}}
// {{{ nextResult()
 
/**
* Move the internal mysql result pointer to the next available result.
*
* This method has not been implemented yet.
*
* @param resource $result a valid sql result resource
* @return false
* @access public
*/
function nextResult($result)
{
return false;
}
 
// }}}
// {{{ fetchInto()
 
/**
* Places a row from the result set into the given array
*
* Formating of the array and the data therein are configurable.
* See DB_result::fetchInto() for more information.
*
* This method is not meant to be called directly. Use
* DB_result::fetchInto() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result the query result resource
* @param array $arr the referenced array to put the data in
* @param int $fetchmode how the resulting array should be indexed
* @param int $rownum the row number to fetch (0 = first row)
*
* @return mixed DB_OK on success, NULL when the end of a result set is
* reached or on failure
*
* @see DB_result::fetchInto()
*/
function fetchInto($result, &$arr, $fetchmode, $rownum = null)
{
if ($rownum !== null) {
if (!@mysqli_data_seek($result, $rownum)) {
return null;
}
}
if ($fetchmode & DB_FETCHMODE_ASSOC) {
$arr = @mysqli_fetch_array($result, MYSQLI_ASSOC);
if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) {
$arr = array_change_key_case($arr, CASE_LOWER);
}
} else {
$arr = @mysqli_fetch_row($result);
}
if (!$arr) {
return null;
}
if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
/*
* Even though this DBMS already trims output, we do this because
* a field might have intentional whitespace at the end that
* gets removed by DB_PORTABILITY_RTRIM under another driver.
*/
$this->_rtrimArrayValues($arr);
}
if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
$this->_convertNullArrayValuesToEmpty($arr);
}
return DB_OK;
}
 
// }}}
// {{{ freeResult()
 
/**
* Deletes the result set and frees the memory occupied by the result set
*
* This method is not meant to be called directly. Use
* DB_result::free() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return bool TRUE on success, FALSE if $result is invalid
*
* @see DB_result::free()
*/
function freeResult($result)
{
return @mysqli_free_result($result);
}
 
// }}}
// {{{ numCols()
 
/**
* Gets the number of columns in a result set
*
* This method is not meant to be called directly. Use
* DB_result::numCols() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return int the number of columns. A DB_Error object on failure.
*
* @see DB_result::numCols()
*/
function numCols($result)
{
$cols = @mysqli_num_fields($result);
if (!$cols) {
return $this->mysqliRaiseError();
}
return $cols;
}
 
// }}}
// {{{ numRows()
 
/**
* Gets the number of rows in a result set
*
* This method is not meant to be called directly. Use
* DB_result::numRows() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return int the number of rows. A DB_Error object on failure.
*
* @see DB_result::numRows()
*/
function numRows($result)
{
$rows = @mysqli_num_rows($result);
if ($rows === null) {
return $this->mysqliRaiseError();
}
return $rows;
}
 
// }}}
// {{{ autoCommit()
 
/**
* Enables or disables automatic commits
*
* @param bool $onoff true turns it on, false turns it off
*
* @return int DB_OK on success. A DB_Error object if the driver
* doesn't support auto-committing transactions.
*/
function autoCommit($onoff = false)
{
// XXX if $this->transaction_opcount > 0, we should probably
// issue a warning here.
$this->autocommit = $onoff ? true : false;
return DB_OK;
}
 
// }}}
// {{{ commit()
 
/**
* Commits the current transaction
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function commit()
{
if ($this->transaction_opcount > 0) {
if ($this->_db) {
if (!@mysqli_select_db($this->connection, $this->_db)) {
return $this->mysqliRaiseError(DB_ERROR_NODBSELECTED);
}
}
$result = @mysqli_query($this->connection, 'COMMIT');
$result = @mysqli_query($this->connection, 'SET AUTOCOMMIT=1');
$this->transaction_opcount = 0;
if (!$result) {
return $this->mysqliRaiseError();
}
}
return DB_OK;
}
 
// }}}
// {{{ rollback()
 
/**
* Reverts the current transaction
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function rollback()
{
if ($this->transaction_opcount > 0) {
if ($this->_db) {
if (!@mysqli_select_db($this->connection, $this->_db)) {
return $this->mysqliRaiseError(DB_ERROR_NODBSELECTED);
}
}
$result = @mysqli_query($this->connection, 'ROLLBACK');
$result = @mysqli_query($this->connection, 'SET AUTOCOMMIT=1');
$this->transaction_opcount = 0;
if (!$result) {
return $this->mysqliRaiseError();
}
}
return DB_OK;
}
 
// }}}
// {{{ affectedRows()
 
/**
* Determines the number of rows affected by a data maniuplation query
*
* 0 is returned for queries that don't manipulate data.
*
* @return int the number of rows. A DB_Error object on failure.
*/
function affectedRows()
{
if (DB::isManip($this->last_query)) {
return @mysqli_affected_rows($this->connection);
} else {
return 0;
}
}
 
// }}}
// {{{ nextId()
 
/**
* Returns the next free id in a sequence
*
* @param string $seq_name name of the sequence
* @param boolean $ondemand when true, the seqence is automatically
* created if it does not exist
*
* @return int the next id number in the sequence.
* A DB_Error object on failure.
*
* @see DB_common::nextID(), DB_common::getSequenceName(),
* DB_mysqli::createSequence(), DB_mysqli::dropSequence()
*/
function nextId($seq_name, $ondemand = true)
{
$seqname = $this->getSequenceName($seq_name);
do {
$repeat = 0;
$this->pushErrorHandling(PEAR_ERROR_RETURN);
$result = $this->query('UPDATE ' . $seqname
. ' SET id = LAST_INSERT_ID(id + 1)');
$this->popErrorHandling();
if ($result === DB_OK) {
// COMMON CASE
$id = @mysqli_insert_id($this->connection);
if ($id != 0) {
return $id;
}
 
// EMPTY SEQ TABLE
// Sequence table must be empty for some reason,
// so fill it and return 1
// Obtain a user-level lock
$result = $this->getOne('SELECT GET_LOCK('
. "'${seqname}_lock', 10)");
if (DB::isError($result)) {
return $this->raiseError($result);
}
if ($result == 0) {
return $this->mysqliRaiseError(DB_ERROR_NOT_LOCKED);
}
 
// add the default value
$result = $this->query('REPLACE INTO ' . $seqname
. ' (id) VALUES (0)');
if (DB::isError($result)) {
return $this->raiseError($result);
}
 
// Release the lock
$result = $this->getOne('SELECT RELEASE_LOCK('
. "'${seqname}_lock')");
if (DB::isError($result)) {
return $this->raiseError($result);
}
// We know what the result will be, so no need to try again
return 1;
 
} elseif ($ondemand && DB::isError($result) &&
$result->getCode() == DB_ERROR_NOSUCHTABLE)
{
// ONDEMAND TABLE CREATION
$result = $this->createSequence($seq_name);
 
// Since createSequence initializes the ID to be 1,
// we do not need to retrieve the ID again (or we will get 2)
if (DB::isError($result)) {
return $this->raiseError($result);
} else {
// First ID of a newly created sequence is 1
return 1;
}
 
} elseif (DB::isError($result) &&
$result->getCode() == DB_ERROR_ALREADY_EXISTS)
{
// BACKWARDS COMPAT
// see _BCsequence() comment
$result = $this->_BCsequence($seqname);
if (DB::isError($result)) {
return $this->raiseError($result);
}
$repeat = 1;
}
} while ($repeat);
 
return $this->raiseError($result);
}
 
/**
* Creates a new sequence
*
* @param string $seq_name name of the new sequence
*
* @return int DB_OK on success. A DB_Error object on failure.
*
* @see DB_common::createSequence(), DB_common::getSequenceName(),
* DB_mysqli::nextID(), DB_mysqli::dropSequence()
*/
function createSequence($seq_name)
{
$seqname = $this->getSequenceName($seq_name);
$res = $this->query('CREATE TABLE ' . $seqname
. ' (id INTEGER UNSIGNED AUTO_INCREMENT NOT NULL,'
. ' PRIMARY KEY(id))');
if (DB::isError($res)) {
return $res;
}
// insert yields value 1, nextId call will generate ID 2
return $this->query("INSERT INTO ${seqname} (id) VALUES (0)");
}
 
// }}}
// {{{ dropSequence()
 
/**
* Deletes a sequence
*
* @param string $seq_name name of the sequence to be deleted
*
* @return int DB_OK on success. A DB_Error object on failure.
*
* @see DB_common::dropSequence(), DB_common::getSequenceName(),
* DB_mysql::nextID(), DB_mysql::createSequence()
*/
function dropSequence($seq_name)
{
return $this->query('DROP TABLE ' . $this->getSequenceName($seq_name));
}
 
// }}}
// {{{ _BCsequence()
 
/**
* Backwards compatibility with old sequence emulation implementation
* (clean up the dupes)
*
* @param string $seqname the sequence name to clean up
*
* @return bool true on success. A DB_Error object on failure.
*
* @access private
*/
function _BCsequence($seqname)
{
// Obtain a user-level lock... this will release any previous
// application locks, but unlike LOCK TABLES, it does not abort
// the current transaction and is much less frequently used.
$result = $this->getOne("SELECT GET_LOCK('${seqname}_lock',10)");
if (DB::isError($result)) {
return $result;
}
if ($result == 0) {
// Failed to get the lock, can't do the conversion, bail
// with a DB_ERROR_NOT_LOCKED error
return $this->mysqliRaiseError(DB_ERROR_NOT_LOCKED);
}
 
$highest_id = $this->getOne("SELECT MAX(id) FROM ${seqname}");
if (DB::isError($highest_id)) {
return $highest_id;
}
 
// This should kill all rows except the highest
// We should probably do something if $highest_id isn't
// numeric, but I'm at a loss as how to handle that...
$result = $this->query('DELETE FROM ' . $seqname
. " WHERE id <> $highest_id");
if (DB::isError($result)) {
return $result;
}
 
// If another thread has been waiting for this lock,
// it will go thru the above procedure, but will have no
// real effect
$result = $this->getOne("SELECT RELEASE_LOCK('${seqname}_lock')");
if (DB::isError($result)) {
return $result;
}
return true;
}
 
// }}}
// {{{ quoteIdentifier()
 
/**
* Quotes a string so it can be safely used as a table or column name
*
* MySQL can't handle the backtick character (<kbd>`</kbd>) in
* table or column names.
*
* @param string $str identifier name to be quoted
*
* @return string quoted identifier string
*
* @see DB_common::quoteIdentifier()
* @since Method available since Release 1.6.0
*/
function quoteIdentifier($str)
{
return '`' . $str . '`';
}
 
// }}}
// {{{ escapeSimple()
 
/**
* Escapes a string according to the current DBMS's standards
*
* @param string $str the string to be escaped
*
* @return string the escaped string
*
* @see DB_common::quoteSmart()
* @since Method available since Release 1.6.0
*/
function escapeSimple($str)
{
return @mysqli_real_escape_string($this->connection, $str);
}
 
// }}}
// {{{ modifyLimitQuery()
 
/**
* Adds LIMIT clauses to a query string according to current DBMS standards
*
* @param string $query the query to modify
* @param int $from the row to start to fetching (0 = the first row)
* @param int $count the numbers of rows to fetch
* @param mixed $params array, string or numeric data to be used in
* execution of the statement. Quantity of items
* passed must match quantity of placeholders in
* query: meaning 1 placeholder for non-array
* parameters or 1 placeholder per array element.
*
* @return string the query string with LIMIT clauses added
*
* @access protected
*/
function modifyLimitQuery($query, $from, $count, $params = array())
{
if (DB::isManip($query)) {
return $query . " LIMIT $count";
} else {
return $query . " LIMIT $from, $count";
}
}
 
// }}}
// {{{ mysqliRaiseError()
 
/**
* Produces a DB_Error object regarding the current problem
*
* @param int $errno if the error is being manually raised pass a
* DB_ERROR* constant here. If this isn't passed
* the error information gathered from the DBMS.
*
* @return object the DB_Error object
*
* @see DB_common::raiseError(),
* DB_mysqli::errorNative(), DB_common::errorCode()
*/
function mysqliRaiseError($errno = null)
{
if ($errno === null) {
if ($this->options['portability'] & DB_PORTABILITY_ERRORS) {
$this->errorcode_map[1022] = DB_ERROR_CONSTRAINT;
$this->errorcode_map[1048] = DB_ERROR_CONSTRAINT_NOT_NULL;
$this->errorcode_map[1062] = DB_ERROR_CONSTRAINT;
} else {
// Doing this in case mode changes during runtime.
$this->errorcode_map[1022] = DB_ERROR_ALREADY_EXISTS;
$this->errorcode_map[1048] = DB_ERROR_CONSTRAINT;
$this->errorcode_map[1062] = DB_ERROR_ALREADY_EXISTS;
}
$errno = $this->errorCode(mysqli_errno($this->connection));
}
return $this->raiseError($errno, null, null, null,
@mysqli_errno($this->connection) . ' ** ' .
@mysqli_error($this->connection));
}
 
// }}}
// {{{ errorNative()
 
/**
* Gets the DBMS' native error code produced by the last query
*
* @return int the DBMS' error code
*/
function errorNative()
{
return @mysqli_errno($this->connection);
}
 
// }}}
// {{{ tableInfo()
 
/**
* Returns information about a table or a result set
*
* @param object|string $result DB_result object from a query or a
* string containing the name of a table.
* While this also accepts a query result
* resource identifier, this behavior is
* deprecated.
* @param int $mode a valid tableInfo mode
*
* @return array an associative array with the information requested.
* A DB_Error object on failure.
*
* @see DB_common::setOption()
*/
function tableInfo($result, $mode = null)
{
if (is_string($result)) {
/*
* Probably received a table name.
* Create a result resource identifier.
*/
$id = @mysqli_query($this->connection,
"SELECT * FROM $result LIMIT 0");
$got_string = true;
} elseif (isset($result->result)) {
/*
* Probably received a result object.
* Extract the result resource identifier.
*/
$id = $result->result;
$got_string = false;
} else {
/*
* Probably received a result resource identifier.
* Copy it.
* Deprecated. Here for compatibility only.
*/
$id = $result;
$got_string = false;
}
 
if (!is_a($id, 'mysqli_result')) {
return $this->mysqliRaiseError(DB_ERROR_NEED_MORE_DATA);
}
 
if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
$case_func = 'strtolower';
} else {
$case_func = 'strval';
}
 
$count = @mysqli_num_fields($id);
$res = array();
 
if ($mode) {
$res['num_fields'] = $count;
}
 
for ($i = 0; $i < $count; $i++) {
$tmp = @mysqli_fetch_field($id);
 
$flags = '';
foreach ($this->mysqli_flags as $const => $means) {
if ($tmp->flags & $const) {
$flags .= $means . ' ';
}
}
if ($tmp->def) {
$flags .= 'default_' . rawurlencode($tmp->def);
}
$flags = trim($flags);
 
$res[$i] = array(
'table' => $case_func($tmp->table),
'name' => $case_func($tmp->name),
'type' => isset($this->mysqli_types[$tmp->type])
? $this->mysqli_types[$tmp->type]
: 'unknown',
'len' => $tmp->max_length,
'flags' => $flags,
);
 
if ($mode & DB_TABLEINFO_ORDER) {
$res['order'][$res[$i]['name']] = $i;
}
if ($mode & DB_TABLEINFO_ORDERTABLE) {
$res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
}
}
 
// free the result only if we were called on a table
if ($got_string) {
@mysqli_free_result($id);
}
return $res;
}
 
// }}}
// {{{ getSpecialQuery()
 
/**
* Obtains the query string needed for listing a given type of objects
*
* @param string $type the kind of objects you want to retrieve
*
* @return string the SQL query string or null if the driver doesn't
* support the object type requested
*
* @access protected
* @see DB_common::getListOf()
*/
function getSpecialQuery($type)
{
switch ($type) {
case 'tables':
return 'SHOW TABLES';
case 'users':
return 'SELECT DISTINCT User FROM mysql.user';
case 'databases':
return 'SHOW DATABASES';
default:
return null;
}
}
 
// }}}
 
}
 
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/
 
?>
/tags/Racine_livraison_narmer/api/pear/DB/ldap.php
New file
0,0 → 1,994
<?php
//
// Pear DB LDAP - Database independent query interface definition
// for PHP's LDAP extension.
//
// Copyright (c) 2002-2003 Ludovico Magnocavallo <ludo@sumatrasolutions.com>
//
// 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
//
// Contributors
// - Piotr Roszatycki <dexter@debian.org>
// DB_ldap::base() method, support for LDAP sequences, various fixes
// - Aaron Spencer Hawley <aaron dot hawley at uvm dot edu>
// fix to use port number if present in DB_ldap->connect()
//
// $Id: ldap.php,v 1.1 2006-12-14 15:04:28 jp_milcent Exp $
//
 
require_once 'DB.php';
require_once 'DB/common.php';
 
define("DB_ERROR_BIND_FAILED", -26);
define("DB_ERROR_UNKNOWN_LDAP_ACTION", -27);
 
/**
* LDAP result class
*
* LDAP_result extends DB_result to provide specific LDAP
* result methods.
*
* @version 1.0
* @author Ludovico Magnocavallo <ludo@sumatrasolutions.com>
* @package DB
*/
 
class LDAP_result extends DB_result
{
 
// {{{ properties
 
/**
* data returned from ldap_entries()
* @access private
*/
var $_entries = null;
/**
* result rows as hash of records
* @access private
*/
var $_recordset = null;
/**
* current record as hash
* @access private
*/
var $_record = null;
 
// }}}
// {{{ constructor
 
/**
* class constructor, calls DB_result constructor
* @param ref $dbh reference to the db instance
* @param resource $result ldap command result
*/
function LDAP_result(&$dbh, $result)
{
$this->DB_result($dbh, $result);
}
 
/**
* fetch rows of data into $this->_recordset
*
* called once as soon as something needs to be returned
* @access private
* @param resource $result ldap command result
* @return boolean true
*/
function getRows() {
if ($this->_recordset === null) {
// begin processing result into recordset
$this->_entries = ldap_get_entries($this->dbh->connection, $this->result);
$this->row_counter = $this->_entries['count'];
$i = 1;
$rs_template = array();
if (count($this->dbh->attributes) > 0) {
reset($this->dbh->attributes);
while (list($a_index, $a_name) = each($this->dbh->attributes)) $rs_template[$a_name] = '';
}
while (list($entry_idx, $entry) = each($this->_entries)) {
// begin first loop, iterate through entries
if (!empty($this->dbh->limit_from) && ($i < $this->dbh->limit_from)) continue;
if (!empty($this->dbh->limit_count) && ($i > $this->dbh->limit_count)) break;
$rs = $rs_template;
if (!is_array($entry)) continue;
while (list($attr, $attr_values) = each($entry)) {
// begin second loop, iterate through attributes
if (is_int($attr) || $attr == 'count') continue;
if (is_string($attr_values)) $rs[$attr] = $attr_values;
else {
$value = '';
while (list($value_idx, $attr_value) = each($attr_values)) {
// begin third loop, iterate through attribute values
if (!is_int($value_idx)) continue;
if (empty($value)) $value = $attr_value;
else {
if (is_array($value)) $value[] = $attr_value;
else $value = array($value, $attr_value);
}
// else $value .= "\n$attr_value";
// end third loop
}
$rs[$attr] = $value;
}
// end second loop
}
reset($rs);
$this->_recordset[$entry_idx] = $rs;
$i++;
// end first loop
}
$this->_entries = null;
if (!is_array($this->_recordset))
$this->_recordset = array();
if (!empty($this->dbh->sorting)) {
$sorting_method = (!empty($this->dbh->sorting_method) ? $this->dbh->sorting_method : 'cmp');
uksort($this->_recordset, array(&$this, $sorting_method));
}
reset($this->_recordset);
// end processing result into recordset
}
return DB_OK;
}
 
 
/**
* Fetch and return a row of data (it uses driver->fetchInto for that)
* @param int $fetchmode format of fetched row
* @param int $rownum the row number to fetch
*
* @return array a row of data, NULL on no more rows or PEAR_Error on error
*
* @access public
*/
function &fetchRow($fetchmode = DB_FETCHMODE_DEFAULT, $rownum=null)
{
$this->getRows();
if (count($this->_recordset) == 0) return null;
if ($this->_record !== null) $this->_record = next($this->_recordset);
else $this->_record = current($this->_recordset);
$row = $this->_record;
return $row;
}
 
 
/**
* Fetch a row of data into an existing variable.
*
* @param mixed $arr reference to data containing the row
* @param integer $fetchmode format of fetched row
* @param integer $rownum the row number to fetch
*
* @return mixed DB_OK on success, NULL on no more rows or
* a DB_Error object on error
*
* @access public
*/
 
function fetchInto(&$ar, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum = null)
{
$this->getRows();
if ($this->_record !== null) $this->_record = next($this->_recordset);
else $this->_record = current($this->_recordset);
$ar = $this->_record;
if (!$ar) {
return null;
}
return DB_OK;
}
 
/**
* return all records
*
* returns a hash of all records, basically returning
* a copy of $this->_recordset
* @param integer $fetchmode format of fetched row
* @param integer $rownum the row number to fetch (not used, here for interface compatibility)
*
* @return mixed DB_OK on success, NULL on no more rows or
* a DB_Error object on error
*
* @access public
*/
function fetchAll($fetchmode = DB_FETCHMODE_DEFAULT, $rownum = null)
{
$this->getRows();
return($this->_recordset);
}
 
/**
* Get the the number of columns in a result set.
*
* @return int the number of columns, or a DB error
*
* @access public
*/
function numCols($result)
{
$this->getRows();
return(count(array_keys($this->_record)));
}
 
function cmp($a, $b)
{
return(strcmp(strtolower($this->_recordset[$a][$this->dbh->sorting]), strtolower($this->_recordset[$b][$this->dbh->sorting])));
}
 
/**
* Get the number of rows in a result set.
*
* @return int the number of rows, or a DB error
*
* @access public
*/
function numRows()
{
$this->getRows();
return $this->row_counter;
}
 
/**
* Get the next result if a batch of queries was executed.
*
* @return bool true if a new result is available or false if not.
*
* @access public
*/
function nextResult()
{
return $this->dbh->nextResult($this->result);
}
 
/**
* Frees the resources allocated for this result set.
* @return int error code
*
* @access public
*/
function free()
{
$this->_recordset = null;
$this->_record = null;
ldap_free_result($this->result);
$this->result = null;
return true;
}
 
/**
* @deprecated
*/
function tableInfo($mode = null)
{
return $this->dbh->tableInfo($this->result, $mode);
}
 
/**
* returns the actual rows number
* @return integer
*/
function getRowCounter()
{
$this->getRows();
return $this->row_counter;
}
}
 
/**
* LDAP DB interface class
*
* LDAP extends DB_common to provide DB compliant
* access to LDAP servers
*
* @version 1.0
* @author Ludovico Magnocavallo <ludo@sumatrasolutions.com>
* @package DB
*/
 
class DB_ldap extends DB_common
{
// {{{ properties
 
/**
* LDAP connection
* @access private
*/
var $connection;
/**
* base dn
* @access private
*/
var $base = '';
/**
* default base dn
* @access private
*/
var $d_base = '';
/**
* query base dn
* @access private
*/
var $q_base = '';
/**
* array of LDAP actions that only manipulate data
* returning a true/false value
* @access private
*/
var $manip = array('add', 'compare', 'delete', 'modify', 'mod_add', 'mod_del', 'mod_replace', 'rename');
/**
* store the default real LDAP action to perform
* @access private
*/
var $action = 'search';
/**
* store the real LDAP action to perform
* (ie PHP ldap function to call) for a query
* @access private
*/
var $q_action = '';
/**
* store optional parameters passed
* to the real LDAP action
* @access private
*/
var $q_params = array();
 
// }}}
 
/**
* Constructor, calls DB_common constructor
*
* @see DB_common::DB_common()
*/
function DB_ldap()
{
$this->DB_common();
$this->phptype = 'ldap';
$this->dbsyntax = 'ldap';
$this->features = array(
'prepare' => false,
'pconnect' => false,
'transactions' => false,
'limit' => false
);
$this->errorcode_map = array(
0x10 => DB_ERROR_NOSUCHFIELD, // LDAP_NO_SUCH_ATTRIBUTE
0x11 => DB_ERROR_INVALID, // LDAP_UNDEFINED_TYPE
0x12 => DB_ERROR_INVALID, // LDAP_INAPPROPRIATE_MATCHING
0x13 => DB_ERROR_INVALID, // LDAP_CONSTRAINT_VIOLATION
0x14 => DB_ERROR_ALREADY_EXISTS, // LDAP_TYPE_OR_VALUE_EXISTS
0x15 => DB_ERROR_INVALID, // LDAP_INVALID_SYNTAX
0x20 => DB_ERROR_NOT_FOUND, // LDAP_NO_SUCH_OBJECT
0x21 => DB_ERROR_NOT_FOUND, // LDAP_ALIAS_PROBLEM
0x22 => DB_ERROR_INVALID, // LDAP_INVALID_DN_SYNTAX
0x23 => DB_ERROR_INVALID, // LDAP_IS_LEAF
0x24 => DB_ERROR_INVALID, // LDAP_ALIAS_DEREF_PROBLEM
0x30 => DB_ERROR_ACCESS_VIOLATION, // LDAP_INAPPROPRIATE_AUTH
0x31 => DB_ERROR_ACCESS_VIOLATION, // LDAP_INVALID_CREDENTIALS
0x32 => DB_ERROR_ACCESS_VIOLATION, // LDAP_INSUFFICIENT_ACCESS
0x40 => DB_ERROR_MISMATCH, // LDAP_NAMING_VIOLATION
0x41 => DB_ERROR_MISMATCH, // LDAP_OBJECT_CLASS_VIOLATION
0x44 => DB_ERROR_ALREADY_EXISTS, // LDAP_ALREADY_EXISTS
0x51 => DB_ERROR_CONNECT_FAILED, // LDAP_SERVER_DOWN
0x57 => DB_ERROR_SYNTAX // LDAP_FILTER_ERROR
);
}
 
/**
* Connect and bind to LDAP server with either anonymous or authenticated bind depending on dsn info
*
* @param array $dsninfo dsn info as passed by DB::connect()
* @param boolean $persistent kept for interface compatibility
* @return DB_OK if successfully connected. A DB error code is returned on failure.
*/
function connect($dsninfo, $persistent = false)
{
if (!PEAR::loadExtension('ldap'))
return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
 
$this->dsn = $dsninfo;
$user = $dsninfo['username'];
$pw = $dsninfo['password'];
$host = $dsninfo['hostspec'];
$port = $dsninfo['port'];
$this->base = $dsninfo['database'];
$this->d_base = $this->base;
 
if (empty($host)) {
return $this->raiseError("no host specified $host");
} // else ...
 
if (isset($port)) {
$conn = ldap_connect($host, $port);
} else {
$conn = ldap_connect($host);
}
if (!$conn) {
return $this->raiseError(DB_ERROR_CONNECT_FAILED);
}
if ($user && $pw) {
$bind = @ldap_bind($conn, $user, $pw);
} else {
$bind = @ldap_bind($conn);
}
if (!$bind) {
return $this->raiseError(DB_ERROR_BIND_FAILED);
}
$this->connection = $conn;
return DB_OK;
}
 
/**
* Unbinds from LDAP server
*
* @return int ldap_unbind() return value
*/
function disconnect()
{
$ret = @ldap_unbind($this->connection);
$this->connection = null;
return $ret;
}
 
 
/**
* Performs a request against the LDAP server
*
* The type of request (and the corresponding PHP ldap function called)
* depend on two additional parameters, added in respect to the
* DB_common interface.
*
* @param string $filter text of the request to send to the LDAP server
* @param string $action type of request to perform, defaults to search (ldap_search())
* @param array $params array of additional parameters to pass to the PHP ldap function requested
* @return result from ldap function or DB Error object if no result
*/
function simpleQuery($filter, $action = null, $params = null)
{
if ($action === null) {
$action = (!empty($this->q_action) ? $this->q_action : $this->action);
}
if ($params === null) {
$params = (count($this->q_params) > 0 ? $this->q_params : array());
}
if (!$this->isManip($action)) {
$base = $this->q_base ? $this->q_base : $this->base;
$attributes = array();
$attrsonly = 0;
$sizelimit = 0;
$timelimit = 0;
$deref = LDAP_DEREF_NEVER;
$sorting = '';
$sorting_method = '';
reset($params);
while (list($k, $v) = each($params)) {
if (isset(${$k})) ${$k} = $v;
}
$this->sorting = $sorting;
$this->sorting_method = $sorting_method;
$this->attributes = $attributes;
# double escape char for filter: '(o=Przedsi\C4\99biorstwo)' => '(o=Przedsi\\C4\\99biorstwo)'
$filter = str_replace('\\', '\\\\', $filter);
$this->last_query = $filter;
if ($action == 'search')
$result = @ldap_search($this->connection, $base, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref);
else if ($action == 'list')
$result = @ldap_list($this->connection, $base, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref);
else if ($action == 'read')
$result = @ldap_read($this->connection, $base, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref);
else
return $this->ldapRaiseError(DB_ERROR_UNKNOWN_LDAP_ACTION);
if (!$result) {
return $this->ldapRaiseError();
}
} else {
# If first argument is an array, it contains the entry with DN.
if (is_array($filter)) {
$entry = $filter;
$filter = $entry["dn"];
} else {
$entry = array();
}
unset($entry["dn"]);
$attribute = '';
$value = '';
$newrdn = '';
$newparent = '';
$deleteoldrdn = false;
reset($params);
while (list($k, $v) = each($params)) {
if (isset(${$k})) ${$k} = $v;
}
$this->last_query = $filter;
if ($action == 'add')
$result = @ldap_add($this->connection, $filter, $entry);
else if ($action == 'compare')
$result = @ldap_add($this->connection, $filter, $attribute, $value);
else if ($action == 'delete')
$result = @ldap_delete($this->connection, $filter);
else if ($action == 'modify')
$result = @ldap_modify($this->connection, $filter, $entry);
else if ($action == 'mod_add')
$result = @ldap_mod_add($this->connection, $filter, $entry);
else if ($action == 'mod_del')
$result = @ldap_mod_del($this->connection, $filter, $entry);
else if ($action == 'mod_replace')
$result = @ldap_mod_replace($this->connection, $filter, $entry);
else if ($action == 'rename')
$result = @ldap_rename($this->connection, $filter, $newrdn, $newparent, $deleteoldrdn);
else
return $this->ldapRaiseError(DB_ERROR_UNKNOWN_LDAP_ACTION);
if (!$result) {
return $this->ldapRaiseError();
}
}
$this->freeQuery();
return $result;
}
 
/**
* Executes a query performing variables substitution in the query text
*
* @param string $stmt text of the request to send to the LDAP server
* @param array $data query variables values to substitute
* @param string $action type of request to perform, defaults to search (ldap_search())
* @param array $params array of additional parameters to pass to the PHP ldap function requested
* @return LDAP_result object or DB Error object if no result
* @see DB_common::executeEmulateQuery $this->simpleQuery()
*/
function execute($stmt, $data = false, $action = null, $params = array())
{
$this->q_params = $params;
$realquery = $this->executeEmulateQuery($stmt, $data);
if (DB::isError($realquery)) {
return $realquery;
}
$result = $this->simpleQuery($realquery);
if (DB::isError($result) || $result === DB_OK) {
return $result;
} else {
return new LDAP_result($this, $result);
}
}
 
/**
* Executes multiple queries performing variables substitution for each query
*
* @param string $stmt text of the request to send to the LDAP server
* @param array $data query variables values to substitute
* @param string $action type of request to perform, defaults to search (ldap_search())
* @param array $params array of additional parameters to pass to the PHP ldap function requested
* @return LDAP_result object or DB Error object if no result
* @see DB_common::executeMultiple
*/
function executeMultiple($stmt, &$data, $action = null, $params = array())
{
$this->q_action = $action ? $action : $this->action;
$this->q_params = $params;
return(parent::executeMultiple($stmt, $data));
}
 
/**
* Executes a query substituting variables if any are present
*
* @param string $query text of the request to send to the LDAP server
* @param array $data query variables values to substitute
* @param string $action type of request to perform, defaults to search (ldap_search())
* @param array $params array of additional parameters to pass to the PHP ldap function requested
* @return LDAP_result object or DB Error object if no result
* @see DB_common::prepare() $this->execute()$this->simpleQuery()
*/
function &query($query, $data = array(), $action = null, $params = array()) {
// $this->q_action = $action ? $action : $this->action;
// $this->q_params = $params;
if (sizeof($data) > 0) {
$sth = $this->prepare($query);
if (DB::isError($sth)) {
return $sth;
}
return $this->execute($sth, $data);
} else {
$result = $this->simpleQuery($query);
if (DB::isError($result) || $result === DB_OK) {
return $result;
} else {
return new LDAP_result($this, $result);
}
}
}
 
/**
* Modifies a query to return only a set of rows, stores $from and $count for LDAP_result
*
* @param string $query text of the request to send to the LDAP server
* @param int $from record position from which to start returning data
* @param int $count number of records to return
* @return modified query text (no modifications are made, see above)
*/
function modifyLimitQuery($query, $from, $count)
{
$this->limit_from = $from;
$this->limit_count = $count;
return $query;
}
 
/**
* Executes a query returning only a specified number of rows
*
* This method only saves the $from and $count parameters for LDAP_result
* where the actual records processing takes place
*
* @param string $query text of the request to send to the LDAP server
* @param int $from record position from which to start returning data
* @param int $count number of records to return
* @param string $action type of request to perform, defaults to search (ldap_search())
* @param array $params array of additional parameters to pass to the PHP ldap function requested
* @return LDAP_result object or DB Error object if no result
*/
function limitQuery($query, $from, $count, $action = null, $params = array())
{
$query = $this->modifyLimitQuery($query, $from, $count);
$this->q_action = $action ? $action : $this->action;
$this->q_params = $params;
return $this->query($query, $action, $params);
}
 
/**
* Fetch the first column of the first row of data returned from
* a query. Takes care of doing the query and freeing the results
* when finished.
*
* @param $query the SQL query
* @param $data if supplied, prepare/execute will be used
* with this array as execute parameters
* @param string $action type of request to perform, defaults to search (ldap_search())
* @param array $params array of additional parameters to pass to the PHP ldap function requested
* @return array
* @see DB_common::getOne()
* @access public
*/
function &getOne($query, $data = array(), $action = null, $params = array())
{
$this->q_action = $action ? $action : $this->action;
$this->q_params = $params;
return(parent::getOne($query, $data));
}
 
/**
* Fetch the first row of data returned from a query. Takes care
* of doing the query and freeing the results when finished.
*
* @param $query the SQL query
* @param $fetchmode the fetch mode to use
* @param $data array if supplied, prepare/execute will be used
* with this array as execute parameters
* @param string $action type of request to perform, defaults to search (ldap_search())
* @param array $params array of additional parameters to pass to the PHP ldap function requested
* @access public
* @return array the first row of results as an array indexed from
* 0, or a DB error code.
* @see DB_common::getRow()
* @access public
*/
function &getRow($query,
$data = null,
$fetchmode = DB_FETCHMODE_DEFAULT,
$action = null, $params = array())
{
$this->q_action = $action ? $action : $this->action;
$this->q_params = $params;
return(parent::getRow($query, $data, $fetchmode));
}
 
/**
* Fetch the first column of data returned from a query. Takes care
* of doing the query and freeing the results when finished.
*
* @param $query the SQL query
* @param $col which column to return (integer [column number,
* starting at 0] or string [column name])
* @param $data array if supplied, prepare/execute will be used
* with this array as execute parameters
* @param string $action type of request to perform, defaults to search (ldap_search())
* @param array $params array of additional parameters to pass to the PHP ldap function requested
* @access public
* @return array an indexed array with the data from the first
* row at index 0, or a DB error code.
* @see DB_common::getCol()
* @access public
*/
function &getCol($query, $col = 0, $data = array(), $action = null, $params = array())
{
$this->q_action = $action ? $action : $this->action;
$this->q_params = $params;
return(parent::getCol($query, $col, $data));
}
 
/**
* Calls DB_common::getAssoc()
*
* @param $query the SQL query
* @param $force_array (optional) used only when the query returns
* exactly two columns. If true, the values of the returned array
* will be one-element arrays instead of scalars.
* starting at 0] or string [column name])
* @param array $data if supplied, prepare/execute will be used
* with this array as execute parameters
* @param $fetchmode the fetch mode to use
* @param boolean $group see DB_Common::getAssoc()
* @param string $action type of request to perform, defaults to search (ldap_search())
* @param array $params array of additional parameters to pass to the PHP ldap function requested
* @access public
* @return array an indexed array with the data from the first
* row at index 0, or a DB error code.
* @see DB_common::getAssoc()
* @access public
*/
function &getAssoc($query, $force_array = false, $data = array(),
$fetchmode = DB_FETCHMODE_ORDERED, $group = false,
$action = null, $params = array())
{
$this->q_action = $action ? $action : $this->action;
$this->q_params = $params;
return(parent::getAssoc($query, $force_array, $data, $fetchmode, $group));
}
 
/**
* Fetch all the rows returned from a query.
*
* @param $query the SQL query
* @param array $data if supplied, prepare/execute will be used
* with this array as execute parameters
* @param $fetchmode the fetch mode to use
* @param string $action type of request to perform, defaults to search (ldap_search())
* @param array $params array of additional parameters to pass to the PHP ldap function requested
* @access public
* @return array an nested array, or a DB error
* @see DB_common::getAll()
*/
function &getAll($query,
$data = null,
$fetchmode = DB_FETCHMODE_DEFAULT,
$action = null, $params = array())
{
$this->q_action = $action ? $action : $this->action;
$this->q_params = $params;
return(parent::getAll($query, $data, $fetchmode));
}
 
function numRows($result)
{
return $result->numRows();
}
 
function getTables()
{
return $this->ldapRaiseError(DB_ERROR_NOT_CAPABLE);
}
 
function getListOf($type)
{
return $this->ldapRaiseError(DB_ERROR_NOT_CAPABLE);
}
 
function isManip($action)
{
return(in_array($action, $this->manip));
}
 
function freeResult()
{
return true;
}
 
function freeQuery($query = '')
{
$this->q_action = '';
$this->q_base = '';
$this->q_params = array();
$this->attributes = null;
$this->sorting = '';
return true;
}
 
// Deprecated, will be removed in future releases.
function base($base = null)
{
$this->q_base = ($base !== null) ? $base : null;
return true;
}
 
function ldapSetBase($base = null)
{
$this->base = ($base !== null) ? $base : $this->d_base;
$this->q_base = '';
return true;
}
 
function ldapSetAction($action = 'search')
{
if ($action != 'search' && $action != 'list' && $action != 'read') {
return $this->ldapRaiseError(DB_ERROR_UNKNOWN_LDAP_ACTION);
}
$this->action = $action;
$this->q_action = '';
return true;
}
 
/**
* Get the next value in a sequence.
*
* LDAP provides transactions for only one entry and we need to
* prevent race condition. If unique value before and after modify
* aren't equal then wait and try again.
*
* The name of sequence is LDAP DN of entry.
*
* @access public
* @param string $seq_name the DN of the sequence
* @param bool $ondemand whether to create the sequence on demand
* @return a sequence integer, or a DB error
*/
function nextId($seq_name, $ondemand = true)
{
$repeat = 0;
do {
// Get the sequence entry
$this->base($seq_name);
$this->pushErrorHandling(PEAR_ERROR_RETURN);
$data = $this->getRow("objectClass=*");
$this->popErrorHandling();
 
if (DB::isError($data)) {
// DB_ldap doesn't use DB_ERROR_NOT_FOUND
if ($ondemand && $repeat == 0
&& $data->getCode() == DB_ERROR) {
// Try to create sequence and repeat
$repeat = 1;
$data = $this->createSequence($seq_name);
if (DB::isError($data)) {
return $this->ldapRaiseError($data);
}
} else {
// Other error
return $this->ldapRaiseError($data);
}
} else {
// Increment sequence value
$data["cn"]++;
// Unique identificator of transaction
$seq_unique = mt_rand();
$data["uid"] = $seq_unique;
// Modify the LDAP entry
$this->pushErrorHandling(PEAR_ERROR_RETURN);
$data = $this->simpleQuery($data, 'modify');
$this->popErrorHandling();
if (DB::isError($data)) {
return $this->ldapRaiseError($data);
}
// Get the entry and check if it contains our unique value
$this->base($seq_name);
$data = $this->getRow("objectClass=*");
if (DB::isError($data)) {
return $this->ldapRaiseError($data);
}
if ($data["uid"] != $seq_unique) {
// It is not our entry. Wait a little time and repeat
sleep(1);
$repeat = 1;
} else {
$repeat = 0;
}
}
} while ($repeat);
 
if (DB::isError($data)) {
return $data;
}
return $data["cn"];
}
 
/**
* Create the sequence
*
* The sequence entry is based on core schema with extensibleObject,
* so it should work with any LDAP server which doesn't check schema
* or supports extensibleObject object class.
*
* Sequence name have to be DN started with "sn=$seq_id,", i.e.:
*
* $seq_name = "sn=uidNumber,ou=sequences,dc=php,dc=net";
*
* dn: $seq_name
* objectClass: top
* objectClass: extensibleObject
* sn: $seq_id
* cn: $seq_value
* uid: $seq_uniq
*
* @param string $seq_name the DN of the sequence
* @return mixed DB_OK on success or DB error on error
* @access public
*/
function createSequence($seq_name)
{
// Extract $seq_id from DN
ereg("^([^,]*),", $seq_name, $regs);
$seq_id = $regs[1];
 
// Create the sequence entry
$data = array(
dn => $seq_name,
objectclass => array("top", "extensibleObject"),
sn => $seq_id,
cn => 0,
uid => 0
);
 
// Add the LDAP entry
$this->pushErrorHandling(PEAR_ERROR_RETURN);
$data = $this->simpleQuery($data, 'add');
$this->popErrorHandling();
return $data;
}
 
/**
* Drop a sequence
*
* @param string $seq_name the DN of the sequence
* @return mixed DB_OK on success or DB error on error
* @access public
*/
function dropSequence($seq_name)
{
// Delete the sequence entry
$data = array(
dn => $seq_name,
);
$this->pushErrorHandling(PEAR_ERROR_RETURN);
$data = $this->simpleQuery($data, 'delete');
$this->popErrorHandling();
return $data;
}
 
// {{{ ldapRaiseError()
 
function ldapRaiseError($errno = null)
{
if ($errno === null) {
$errno = $this->errorCode(ldap_errno($this->connection));
}
if ($this->q_action !== null) {
return $this->raiseError($errno, null, null,
sprintf('%s base="%s" filter="%s"',
$this->q_action, $this->q_base, $this->last_query
),
$errno == DB_ERROR_UNKNOWN_LDAP_ACTION ? null : @ldap_error($this->connection));
} else {
return $this->raiseError($errno, null, null, "???",
@ldap_error($this->connection));
}
}
 
// }}}
 
}
 
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/
?>
/tags/Racine_livraison_narmer/api/pear/DB/ibase.php
New file
0,0 → 1,1071
<?php
 
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 
/**
* The PEAR DB driver for PHP's interbase extension
* for interacting with Interbase and Firebird databases
*
* While this class works with PHP 4, PHP's InterBase extension is
* unstable in PHP 4. Use PHP 5.
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Database
* @package DB
* @author Sterling Hughes <sterling@php.net>
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id: ibase.php,v 1.3 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/DB
*/
 
/**
* Obtain the DB_common class so it can be extended from
*/
require_once 'DB/common.php';
 
/**
* The methods PEAR DB uses to interact with PHP's interbase extension
* for interacting with Interbase and Firebird databases
*
* These methods overload the ones declared in DB_common.
*
* While this class works with PHP 4, PHP's InterBase extension is
* unstable in PHP 4. Use PHP 5.
*
* NOTICE: limitQuery() only works for Firebird.
*
* @category Database
* @package DB
* @author Sterling Hughes <sterling@php.net>
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version Release: 1.7.6
* @link http://pear.php.net/package/DB
* @since Class became stable in Release 1.7.0
*/
class DB_ibase extends DB_common
{
// {{{ properties
 
/**
* The DB driver type (mysql, oci8, odbc, etc.)
* @var string
*/
var $phptype = 'ibase';
 
/**
* The database syntax variant to be used (db2, access, etc.), if any
* @var string
*/
var $dbsyntax = 'ibase';
 
/**
* The capabilities of this DB implementation
*
* The 'new_link' element contains the PHP version that first provided
* new_link support for this DBMS. Contains false if it's unsupported.
*
* Meaning of the 'limit' element:
* + 'emulate' = emulate with fetch row by number
* + 'alter' = alter the query
* + false = skip rows
*
* NOTE: only firebird supports limit.
*
* @var array
*/
var $features = array(
'limit' => false,
'new_link' => false,
'numrows' => 'emulate',
'pconnect' => true,
'prepare' => true,
'ssl' => false,
'transactions' => true,
);
 
/**
* A mapping of native error codes to DB error codes
* @var array
*/
var $errorcode_map = array(
-104 => DB_ERROR_SYNTAX,
-150 => DB_ERROR_ACCESS_VIOLATION,
-151 => DB_ERROR_ACCESS_VIOLATION,
-155 => DB_ERROR_NOSUCHTABLE,
-157 => DB_ERROR_NOSUCHFIELD,
-158 => DB_ERROR_VALUE_COUNT_ON_ROW,
-170 => DB_ERROR_MISMATCH,
-171 => DB_ERROR_MISMATCH,
-172 => DB_ERROR_INVALID,
// -204 => // Covers too many errors, need to use regex on msg
-205 => DB_ERROR_NOSUCHFIELD,
-206 => DB_ERROR_NOSUCHFIELD,
-208 => DB_ERROR_INVALID,
-219 => DB_ERROR_NOSUCHTABLE,
-297 => DB_ERROR_CONSTRAINT,
-303 => DB_ERROR_INVALID,
-413 => DB_ERROR_INVALID_NUMBER,
-530 => DB_ERROR_CONSTRAINT,
-551 => DB_ERROR_ACCESS_VIOLATION,
-552 => DB_ERROR_ACCESS_VIOLATION,
// -607 => // Covers too many errors, need to use regex on msg
-625 => DB_ERROR_CONSTRAINT_NOT_NULL,
-803 => DB_ERROR_CONSTRAINT,
-804 => DB_ERROR_VALUE_COUNT_ON_ROW,
-904 => DB_ERROR_CONNECT_FAILED,
-922 => DB_ERROR_NOSUCHDB,
-923 => DB_ERROR_CONNECT_FAILED,
-924 => DB_ERROR_CONNECT_FAILED
);
 
/**
* The raw database connection created by PHP
* @var resource
*/
var $connection;
 
/**
* The DSN information for connecting to a database
* @var array
*/
var $dsn = array();
 
 
/**
* The number of rows affected by a data manipulation query
* @var integer
* @access private
*/
var $affected = 0;
 
/**
* Should data manipulation queries be committed automatically?
* @var bool
* @access private
*/
var $autocommit = true;
 
/**
* The prepared statement handle from the most recently executed statement
*
* {@internal Mainly here because the InterBase/Firebird API is only
* able to retrieve data from result sets if the statemnt handle is
* still in scope.}}
*
* @var resource
*/
var $last_stmt;
 
/**
* Is the given prepared statement a data manipulation query?
* @var array
* @access private
*/
var $manip_query = array();
 
 
// }}}
// {{{ constructor
 
/**
* This constructor calls <kbd>$this->DB_common()</kbd>
*
* @return void
*/
function DB_ibase()
{
$this->DB_common();
}
 
// }}}
// {{{ connect()
 
/**
* Connect to the database server, log in and open the database
*
* Don't call this method directly. Use DB::connect() instead.
*
* PEAR DB's ibase driver supports the following extra DSN options:
* + buffers The number of database buffers to allocate for the
* server-side cache.
* + charset The default character set for a database.
* + dialect The default SQL dialect for any statement
* executed within a connection. Defaults to the
* highest one supported by client libraries.
* Functional only with InterBase 6 and up.
* + role Functional only with InterBase 5 and up.
*
* @param array $dsn the data source name
* @param bool $persistent should the connection be persistent?
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function connect($dsn, $persistent = false)
{
if (!PEAR::loadExtension('interbase')) {
return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
}
 
$this->dsn = $dsn;
if ($dsn['dbsyntax']) {
$this->dbsyntax = $dsn['dbsyntax'];
}
if ($this->dbsyntax == 'firebird') {
$this->features['limit'] = 'alter';
}
 
$params = array(
$dsn['hostspec']
? ($dsn['hostspec'] . ':' . $dsn['database'])
: $dsn['database'],
$dsn['username'] ? $dsn['username'] : null,
$dsn['password'] ? $dsn['password'] : null,
isset($dsn['charset']) ? $dsn['charset'] : null,
isset($dsn['buffers']) ? $dsn['buffers'] : null,
isset($dsn['dialect']) ? $dsn['dialect'] : null,
isset($dsn['role']) ? $dsn['role'] : null,
);
 
$connect_function = $persistent ? 'ibase_pconnect' : 'ibase_connect';
 
$this->connection = @call_user_func_array($connect_function, $params);
if (!$this->connection) {
return $this->ibaseRaiseError(DB_ERROR_CONNECT_FAILED);
}
return DB_OK;
}
 
// }}}
// {{{ disconnect()
 
/**
* Disconnects from the database server
*
* @return bool TRUE on success, FALSE on failure
*/
function disconnect()
{
$ret = @ibase_close($this->connection);
$this->connection = null;
return $ret;
}
 
// }}}
// {{{ simpleQuery()
 
/**
* Sends a query to the database server
*
* @param string the SQL query string
*
* @return mixed + a PHP result resrouce for successful SELECT queries
* + the DB_OK constant for other successful queries
* + a DB_Error object on failure
*/
function simpleQuery($query)
{
$ismanip = DB::isManip($query);
$this->last_query = $query;
$query = $this->modifyQuery($query);
$result = @ibase_query($this->connection, $query);
 
if (!$result) {
return $this->ibaseRaiseError();
}
if ($this->autocommit && $ismanip) {
@ibase_commit($this->connection);
}
if ($ismanip) {
$this->affected = $result;
return DB_OK;
} else {
$this->affected = 0;
return $result;
}
}
 
// }}}
// {{{ modifyLimitQuery()
 
/**
* Adds LIMIT clauses to a query string according to current DBMS standards
*
* Only works with Firebird.
*
* @param string $query the query to modify
* @param int $from the row to start to fetching (0 = the first row)
* @param int $count the numbers of rows to fetch
* @param mixed $params array, string or numeric data to be used in
* execution of the statement. Quantity of items
* passed must match quantity of placeholders in
* query: meaning 1 placeholder for non-array
* parameters or 1 placeholder per array element.
*
* @return string the query string with LIMIT clauses added
*
* @access protected
*/
function modifyLimitQuery($query, $from, $count, $params = array())
{
if ($this->dsn['dbsyntax'] == 'firebird') {
$query = preg_replace('/^([\s(])*SELECT/i',
"SELECT FIRST $count SKIP $from", $query);
}
return $query;
}
 
// }}}
// {{{ nextResult()
 
/**
* Move the internal ibase result pointer to the next available result
*
* @param a valid fbsql result resource
*
* @access public
*
* @return true if a result is available otherwise return false
*/
function nextResult($result)
{
return false;
}
 
// }}}
// {{{ fetchInto()
 
/**
* Places a row from the result set into the given array
*
* Formating of the array and the data therein are configurable.
* See DB_result::fetchInto() for more information.
*
* This method is not meant to be called directly. Use
* DB_result::fetchInto() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result the query result resource
* @param array $arr the referenced array to put the data in
* @param int $fetchmode how the resulting array should be indexed
* @param int $rownum the row number to fetch (0 = first row)
*
* @return mixed DB_OK on success, NULL when the end of a result set is
* reached or on failure
*
* @see DB_result::fetchInto()
*/
function fetchInto($result, &$arr, $fetchmode, $rownum = null)
{
if ($rownum !== null) {
return $this->ibaseRaiseError(DB_ERROR_NOT_CAPABLE);
}
if ($fetchmode & DB_FETCHMODE_ASSOC) {
if (function_exists('ibase_fetch_assoc')) {
$arr = @ibase_fetch_assoc($result);
} else {
$arr = get_object_vars(ibase_fetch_object($result));
}
if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) {
$arr = array_change_key_case($arr, CASE_LOWER);
}
} else {
$arr = @ibase_fetch_row($result);
}
if (!$arr) {
return null;
}
if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
$this->_rtrimArrayValues($arr);
}
if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
$this->_convertNullArrayValuesToEmpty($arr);
}
return DB_OK;
}
 
// }}}
// {{{ freeResult()
 
/**
* Deletes the result set and frees the memory occupied by the result set
*
* This method is not meant to be called directly. Use
* DB_result::free() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return bool TRUE on success, FALSE if $result is invalid
*
* @see DB_result::free()
*/
function freeResult($result)
{
return @ibase_free_result($result);
}
 
// }}}
// {{{ freeQuery()
 
function freeQuery($query)
{
@ibase_free_query($query);
return true;
}
 
// }}}
// {{{ affectedRows()
 
/**
* Determines the number of rows affected by a data maniuplation query
*
* 0 is returned for queries that don't manipulate data.
*
* @return int the number of rows. A DB_Error object on failure.
*/
function affectedRows()
{
if (is_integer($this->affected)) {
return $this->affected;
}
return $this->ibaseRaiseError(DB_ERROR_NOT_CAPABLE);
}
 
// }}}
// {{{ numCols()
 
/**
* Gets the number of columns in a result set
*
* This method is not meant to be called directly. Use
* DB_result::numCols() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return int the number of columns. A DB_Error object on failure.
*
* @see DB_result::numCols()
*/
function numCols($result)
{
$cols = @ibase_num_fields($result);
if (!$cols) {
return $this->ibaseRaiseError();
}
return $cols;
}
 
// }}}
// {{{ prepare()
 
/**
* Prepares a query for multiple execution with execute().
*
* prepare() requires a generic query as string like <code>
* INSERT INTO numbers VALUES (?, ?, ?)
* </code>. The <kbd>?</kbd> characters are placeholders.
*
* Three types of placeholders can be used:
* + <kbd>?</kbd> a quoted scalar value, i.e. strings, integers
* + <kbd>!</kbd> value is inserted 'as is'
* + <kbd>&</kbd> requires a file name. The file's contents get
* inserted into the query (i.e. saving binary
* data in a db)
*
* Use backslashes to escape placeholder characters if you don't want
* them to be interpreted as placeholders. Example: <code>
* "UPDATE foo SET col=? WHERE col='over \& under'"
* </code>
*
* @param string $query query to be prepared
* @return mixed DB statement resource on success. DB_Error on failure.
*/
function prepare($query)
{
$tokens = preg_split('/((?<!\\\)[&?!])/', $query, -1,
PREG_SPLIT_DELIM_CAPTURE);
$token = 0;
$types = array();
$newquery = '';
 
foreach ($tokens as $key => $val) {
switch ($val) {
case '?':
$types[$token++] = DB_PARAM_SCALAR;
break;
case '&':
$types[$token++] = DB_PARAM_OPAQUE;
break;
case '!':
$types[$token++] = DB_PARAM_MISC;
break;
default:
$tokens[$key] = preg_replace('/\\\([&?!])/', "\\1", $val);
$newquery .= $tokens[$key] . '?';
}
}
 
$newquery = substr($newquery, 0, -1);
$this->last_query = $query;
$newquery = $this->modifyQuery($newquery);
$stmt = @ibase_prepare($this->connection, $newquery);
$this->prepare_types[(int)$stmt] = $types;
$this->manip_query[(int)$stmt] = DB::isManip($query);
return $stmt;
}
 
// }}}
// {{{ execute()
 
/**
* Executes a DB statement prepared with prepare().
*
* @param resource $stmt a DB statement resource returned from prepare()
* @param mixed $data array, string or numeric data to be used in
* execution of the statement. Quantity of items
* passed must match quantity of placeholders in
* query: meaning 1 for non-array items or the
* quantity of elements in the array.
* @return object a new DB_Result or a DB_Error when fail
* @see DB_ibase::prepare()
* @access public
*/
function &execute($stmt, $data = array())
{
$data = (array)$data;
$this->last_parameters = $data;
 
$types =& $this->prepare_types[(int)$stmt];
if (count($types) != count($data)) {
$tmp =& $this->raiseError(DB_ERROR_MISMATCH);
return $tmp;
}
 
$i = 0;
foreach ($data as $key => $value) {
if ($types[$i] == DB_PARAM_MISC) {
/*
* ibase doesn't seem to have the ability to pass a
* parameter along unchanged, so strip off quotes from start
* and end, plus turn two single quotes to one single quote,
* in order to avoid the quotes getting escaped by
* ibase and ending up in the database.
*/
$data[$key] = preg_replace("/^'(.*)'$/", "\\1", $data[$key]);
$data[$key] = str_replace("''", "'", $data[$key]);
} elseif ($types[$i] == DB_PARAM_OPAQUE) {
$fp = @fopen($data[$key], 'rb');
if (!$fp) {
$tmp =& $this->raiseError(DB_ERROR_ACCESS_VIOLATION);
return $tmp;
}
$data[$key] = fread($fp, filesize($data[$key]));
fclose($fp);
}
$i++;
}
 
array_unshift($data, $stmt);
 
$res = call_user_func_array('ibase_execute', $data);
if (!$res) {
$tmp =& $this->ibaseRaiseError();
return $tmp;
}
/* XXX need this?
if ($this->autocommit && $this->manip_query[(int)$stmt]) {
@ibase_commit($this->connection);
}*/
$this->last_stmt = $stmt;
if ($this->manip_query[(int)$stmt]) {
$tmp = DB_OK;
} else {
$tmp =& new DB_result($this, $res);
}
return $tmp;
}
 
/**
* Frees the internal resources associated with a prepared query
*
* @param resource $stmt the prepared statement's PHP resource
* @param bool $free_resource should the PHP resource be freed too?
* Use false if you need to get data
* from the result set later.
*
* @return bool TRUE on success, FALSE if $result is invalid
*
* @see DB_ibase::prepare()
*/
function freePrepared($stmt, $free_resource = true)
{
if (!is_resource($stmt)) {
return false;
}
if ($free_resource) {
@ibase_free_query($stmt);
}
unset($this->prepare_tokens[(int)$stmt]);
unset($this->prepare_types[(int)$stmt]);
unset($this->manip_query[(int)$stmt]);
return true;
}
 
// }}}
// {{{ autoCommit()
 
/**
* Enables or disables automatic commits
*
* @param bool $onoff true turns it on, false turns it off
*
* @return int DB_OK on success. A DB_Error object if the driver
* doesn't support auto-committing transactions.
*/
function autoCommit($onoff = false)
{
$this->autocommit = $onoff ? 1 : 0;
return DB_OK;
}
 
// }}}
// {{{ commit()
 
/**
* Commits the current transaction
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function commit()
{
return @ibase_commit($this->connection);
}
 
// }}}
// {{{ rollback()
 
/**
* Reverts the current transaction
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function rollback()
{
return @ibase_rollback($this->connection);
}
 
// }}}
// {{{ transactionInit()
 
function transactionInit($trans_args = 0)
{
return $trans_args
? @ibase_trans($trans_args, $this->connection)
: @ibase_trans();
}
 
// }}}
// {{{ nextId()
 
/**
* Returns the next free id in a sequence
*
* @param string $seq_name name of the sequence
* @param boolean $ondemand when true, the seqence is automatically
* created if it does not exist
*
* @return int the next id number in the sequence.
* A DB_Error object on failure.
*
* @see DB_common::nextID(), DB_common::getSequenceName(),
* DB_ibase::createSequence(), DB_ibase::dropSequence()
*/
function nextId($seq_name, $ondemand = true)
{
$sqn = strtoupper($this->getSequenceName($seq_name));
$repeat = 0;
do {
$this->pushErrorHandling(PEAR_ERROR_RETURN);
$result =& $this->query("SELECT GEN_ID(${sqn}, 1) "
. 'FROM RDB$GENERATORS '
. "WHERE RDB\$GENERATOR_NAME='${sqn}'");
$this->popErrorHandling();
if ($ondemand && DB::isError($result)) {
$repeat = 1;
$result = $this->createSequence($seq_name);
if (DB::isError($result)) {
return $result;
}
} else {
$repeat = 0;
}
} while ($repeat);
if (DB::isError($result)) {
return $this->raiseError($result);
}
$arr = $result->fetchRow(DB_FETCHMODE_ORDERED);
$result->free();
return $arr[0];
}
 
// }}}
// {{{ createSequence()
 
/**
* Creates a new sequence
*
* @param string $seq_name name of the new sequence
*
* @return int DB_OK on success. A DB_Error object on failure.
*
* @see DB_common::createSequence(), DB_common::getSequenceName(),
* DB_ibase::nextID(), DB_ibase::dropSequence()
*/
function createSequence($seq_name)
{
$sqn = strtoupper($this->getSequenceName($seq_name));
$this->pushErrorHandling(PEAR_ERROR_RETURN);
$result = $this->query("CREATE GENERATOR ${sqn}");
$this->popErrorHandling();
 
return $result;
}
 
// }}}
// {{{ dropSequence()
 
/**
* Deletes a sequence
*
* @param string $seq_name name of the sequence to be deleted
*
* @return int DB_OK on success. A DB_Error object on failure.
*
* @see DB_common::dropSequence(), DB_common::getSequenceName(),
* DB_ibase::nextID(), DB_ibase::createSequence()
*/
function dropSequence($seq_name)
{
return $this->query('DELETE FROM RDB$GENERATORS '
. "WHERE RDB\$GENERATOR_NAME='"
. strtoupper($this->getSequenceName($seq_name))
. "'");
}
 
// }}}
// {{{ _ibaseFieldFlags()
 
/**
* Get the column's flags
*
* Supports "primary_key", "unique_key", "not_null", "default",
* "computed" and "blob".
*
* @param string $field_name the name of the field
* @param string $table_name the name of the table
*
* @return string the flags
*
* @access private
*/
function _ibaseFieldFlags($field_name, $table_name)
{
$sql = 'SELECT R.RDB$CONSTRAINT_TYPE CTYPE'
.' FROM RDB$INDEX_SEGMENTS I'
.' JOIN RDB$RELATION_CONSTRAINTS R ON I.RDB$INDEX_NAME=R.RDB$INDEX_NAME'
.' WHERE I.RDB$FIELD_NAME=\'' . $field_name . '\''
.' AND UPPER(R.RDB$RELATION_NAME)=\'' . strtoupper($table_name) . '\'';
 
$result = @ibase_query($this->connection, $sql);
if (!$result) {
return $this->ibaseRaiseError();
}
 
$flags = '';
if ($obj = @ibase_fetch_object($result)) {
@ibase_free_result($result);
if (isset($obj->CTYPE) && trim($obj->CTYPE) == 'PRIMARY KEY') {
$flags .= 'primary_key ';
}
if (isset($obj->CTYPE) && trim($obj->CTYPE) == 'UNIQUE') {
$flags .= 'unique_key ';
}
}
 
$sql = 'SELECT R.RDB$NULL_FLAG AS NFLAG,'
.' R.RDB$DEFAULT_SOURCE AS DSOURCE,'
.' F.RDB$FIELD_TYPE AS FTYPE,'
.' F.RDB$COMPUTED_SOURCE AS CSOURCE'
.' FROM RDB$RELATION_FIELDS R '
.' JOIN RDB$FIELDS F ON R.RDB$FIELD_SOURCE=F.RDB$FIELD_NAME'
.' WHERE UPPER(R.RDB$RELATION_NAME)=\'' . strtoupper($table_name) . '\''
.' AND R.RDB$FIELD_NAME=\'' . $field_name . '\'';
 
$result = @ibase_query($this->connection, $sql);
if (!$result) {
return $this->ibaseRaiseError();
}
if ($obj = @ibase_fetch_object($result)) {
@ibase_free_result($result);
if (isset($obj->NFLAG)) {
$flags .= 'not_null ';
}
if (isset($obj->DSOURCE)) {
$flags .= 'default ';
}
if (isset($obj->CSOURCE)) {
$flags .= 'computed ';
}
if (isset($obj->FTYPE) && $obj->FTYPE == 261) {
$flags .= 'blob ';
}
}
 
return trim($flags);
}
 
// }}}
// {{{ ibaseRaiseError()
 
/**
* Produces a DB_Error object regarding the current problem
*
* @param int $errno if the error is being manually raised pass a
* DB_ERROR* constant here. If this isn't passed
* the error information gathered from the DBMS.
*
* @return object the DB_Error object
*
* @see DB_common::raiseError(),
* DB_ibase::errorNative(), DB_ibase::errorCode()
*/
function &ibaseRaiseError($errno = null)
{
if ($errno === null) {
$errno = $this->errorCode($this->errorNative());
}
$tmp =& $this->raiseError($errno, null, null, null, @ibase_errmsg());
return $tmp;
}
 
// }}}
// {{{ errorNative()
 
/**
* Gets the DBMS' native error code produced by the last query
*
* @return int the DBMS' error code. NULL if there is no error code.
*
* @since Method available since Release 1.7.0
*/
function errorNative()
{
if (function_exists('ibase_errcode')) {
return @ibase_errcode();
}
if (preg_match('/^Dynamic SQL Error SQL error code = ([0-9-]+)/i',
@ibase_errmsg(), $m)) {
return (int)$m[1];
}
return null;
}
 
// }}}
// {{{ errorCode()
 
/**
* Maps native error codes to DB's portable ones
*
* @param int $nativecode the error code returned by the DBMS
*
* @return int the portable DB error code. Return DB_ERROR if the
* current driver doesn't have a mapping for the
* $nativecode submitted.
*
* @since Method available since Release 1.7.0
*/
function errorCode($nativecode = null)
{
if (isset($this->errorcode_map[$nativecode])) {
return $this->errorcode_map[$nativecode];
}
 
static $error_regexps;
if (!isset($error_regexps)) {
$error_regexps = array(
'/generator .* is not defined/'
=> DB_ERROR_SYNTAX, // for compat. w ibase_errcode()
'/table.*(not exist|not found|unknown)/i'
=> DB_ERROR_NOSUCHTABLE,
'/table .* already exists/i'
=> DB_ERROR_ALREADY_EXISTS,
'/unsuccessful metadata update .* failed attempt to store duplicate value/i'
=> DB_ERROR_ALREADY_EXISTS,
'/unsuccessful metadata update .* not found/i'
=> DB_ERROR_NOT_FOUND,
'/validation error for column .* value "\*\*\* null/i'
=> DB_ERROR_CONSTRAINT_NOT_NULL,
'/violation of [\w ]+ constraint/i'
=> DB_ERROR_CONSTRAINT,
'/conversion error from string/i'
=> DB_ERROR_INVALID_NUMBER,
'/no permission for/i'
=> DB_ERROR_ACCESS_VIOLATION,
'/arithmetic exception, numeric overflow, or string truncation/i'
=> DB_ERROR_INVALID,
);
}
 
$errormsg = @ibase_errmsg();
foreach ($error_regexps as $regexp => $code) {
if (preg_match($regexp, $errormsg)) {
return $code;
}
}
return DB_ERROR;
}
 
// }}}
// {{{ tableInfo()
 
/**
* Returns information about a table or a result set
*
* NOTE: only supports 'table' and 'flags' if <var>$result</var>
* is a table name.
*
* @param object|string $result DB_result object from a query or a
* string containing the name of a table.
* While this also accepts a query result
* resource identifier, this behavior is
* deprecated.
* @param int $mode a valid tableInfo mode
*
* @return array an associative array with the information requested.
* A DB_Error object on failure.
*
* @see DB_common::tableInfo()
*/
function tableInfo($result, $mode = null)
{
if (is_string($result)) {
/*
* Probably received a table name.
* Create a result resource identifier.
*/
$id = @ibase_query($this->connection,
"SELECT * FROM $result WHERE 1=0");
$got_string = true;
} elseif (isset($result->result)) {
/*
* Probably received a result object.
* Extract the result resource identifier.
*/
$id = $result->result;
$got_string = false;
} else {
/*
* Probably received a result resource identifier.
* Copy it.
* Deprecated. Here for compatibility only.
*/
$id = $result;
$got_string = false;
}
 
if (!is_resource($id)) {
return $this->ibaseRaiseError(DB_ERROR_NEED_MORE_DATA);
}
 
if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
$case_func = 'strtolower';
} else {
$case_func = 'strval';
}
 
$count = @ibase_num_fields($id);
$res = array();
 
if ($mode) {
$res['num_fields'] = $count;
}
 
for ($i = 0; $i < $count; $i++) {
$info = @ibase_field_info($id, $i);
$res[$i] = array(
'table' => $got_string ? $case_func($result) : '',
'name' => $case_func($info['name']),
'type' => $info['type'],
'len' => $info['length'],
'flags' => ($got_string)
? $this->_ibaseFieldFlags($info['name'], $result)
: '',
);
if ($mode & DB_TABLEINFO_ORDER) {
$res['order'][$res[$i]['name']] = $i;
}
if ($mode & DB_TABLEINFO_ORDERTABLE) {
$res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
}
}
 
// free the result only if we were called on a table
if ($got_string) {
@ibase_free_result($id);
}
return $res;
}
 
// }}}
// {{{ getSpecialQuery()
 
/**
* Obtains the query string needed for listing a given type of objects
*
* @param string $type the kind of objects you want to retrieve
*
* @return string the SQL query string or null if the driver doesn't
* support the object type requested
*
* @access protected
* @see DB_common::getListOf()
*/
function getSpecialQuery($type)
{
switch ($type) {
case 'tables':
return 'SELECT DISTINCT R.RDB$RELATION_NAME FROM '
. 'RDB$RELATION_FIELDS R WHERE R.RDB$SYSTEM_FLAG=0';
case 'views':
return 'SELECT DISTINCT RDB$VIEW_NAME from RDB$VIEW_RELATIONS';
case 'users':
return 'SELECT DISTINCT RDB$USER FROM RDB$USER_PRIVILEGES';
default:
return null;
}
}
 
// }}}
 
}
 
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/
 
?>
/tags/Racine_livraison_narmer/api/pear/DB/sybase.php
New file
0,0 → 1,907
<?php
 
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 
/**
* The PEAR DB driver for PHP's sybase extension
* for interacting with Sybase databases
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Database
* @package DB
* @author Sterling Hughes <sterling@php.net>
* @author Antônio Carlos Venâncio Júnior <floripa@php.net>
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id: sybase.php,v 1.3 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/DB
*/
 
/**
* Obtain the DB_common class so it can be extended from
*/
require_once 'DB/common.php';
 
/**
* The methods PEAR DB uses to interact with PHP's sybase extension
* for interacting with Sybase databases
*
* These methods overload the ones declared in DB_common.
*
* WARNING: This driver may fail with multiple connections under the
* same user/pass/host and different databases.
*
* @category Database
* @package DB
* @author Sterling Hughes <sterling@php.net>
* @author Antônio Carlos Venâncio Júnior <floripa@php.net>
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version Release: 1.7.6
* @link http://pear.php.net/package/DB
*/
class DB_sybase extends DB_common
{
// {{{ properties
 
/**
* The DB driver type (mysql, oci8, odbc, etc.)
* @var string
*/
var $phptype = 'sybase';
 
/**
* The database syntax variant to be used (db2, access, etc.), if any
* @var string
*/
var $dbsyntax = 'sybase';
 
/**
* The capabilities of this DB implementation
*
* The 'new_link' element contains the PHP version that first provided
* new_link support for this DBMS. Contains false if it's unsupported.
*
* Meaning of the 'limit' element:
* + 'emulate' = emulate with fetch row by number
* + 'alter' = alter the query
* + false = skip rows
*
* @var array
*/
var $features = array(
'limit' => 'emulate',
'new_link' => false,
'numrows' => true,
'pconnect' => true,
'prepare' => false,
'ssl' => false,
'transactions' => true,
);
 
/**
* A mapping of native error codes to DB error codes
* @var array
*/
var $errorcode_map = array(
);
 
/**
* The raw database connection created by PHP
* @var resource
*/
var $connection;
 
/**
* The DSN information for connecting to a database
* @var array
*/
var $dsn = array();
 
 
/**
* Should data manipulation queries be committed automatically?
* @var bool
* @access private
*/
var $autocommit = true;
 
/**
* The quantity of transactions begun
*
* {@internal While this is private, it can't actually be designated
* private in PHP 5 because it is directly accessed in the test suite.}}
*
* @var integer
* @access private
*/
var $transaction_opcount = 0;
 
/**
* The database specified in the DSN
*
* It's a fix to allow calls to different databases in the same script.
*
* @var string
* @access private
*/
var $_db = '';
 
 
// }}}
// {{{ constructor
 
/**
* This constructor calls <kbd>$this->DB_common()</kbd>
*
* @return void
*/
function DB_sybase()
{
$this->DB_common();
}
 
// }}}
// {{{ connect()
 
/**
* Connect to the database server, log in and open the database
*
* Don't call this method directly. Use DB::connect() instead.
*
* PEAR DB's sybase driver supports the following extra DSN options:
* + appname The application name to use on this connection.
* Available since PEAR DB 1.7.0.
* + charset The character set to use on this connection.
* Available since PEAR DB 1.7.0.
*
* @param array $dsn the data source name
* @param bool $persistent should the connection be persistent?
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function connect($dsn, $persistent = false)
{
if (!PEAR::loadExtension('sybase') &&
!PEAR::loadExtension('sybase_ct'))
{
return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
}
 
$this->dsn = $dsn;
if ($dsn['dbsyntax']) {
$this->dbsyntax = $dsn['dbsyntax'];
}
 
$dsn['hostspec'] = $dsn['hostspec'] ? $dsn['hostspec'] : 'localhost';
$dsn['password'] = !empty($dsn['password']) ? $dsn['password'] : false;
$dsn['charset'] = isset($dsn['charset']) ? $dsn['charset'] : false;
$dsn['appname'] = isset($dsn['appname']) ? $dsn['appname'] : false;
 
$connect_function = $persistent ? 'sybase_pconnect' : 'sybase_connect';
 
if ($dsn['username']) {
$this->connection = @$connect_function($dsn['hostspec'],
$dsn['username'],
$dsn['password'],
$dsn['charset'],
$dsn['appname']);
} else {
return $this->raiseError(DB_ERROR_CONNECT_FAILED,
null, null, null,
'The DSN did not contain a username.');
}
 
if (!$this->connection) {
return $this->raiseError(DB_ERROR_CONNECT_FAILED,
null, null, null,
@sybase_get_last_message());
}
 
if ($dsn['database']) {
if (!@sybase_select_db($dsn['database'], $this->connection)) {
return $this->raiseError(DB_ERROR_NODBSELECTED,
null, null, null,
@sybase_get_last_message());
}
$this->_db = $dsn['database'];
}
 
return DB_OK;
}
 
// }}}
// {{{ disconnect()
 
/**
* Disconnects from the database server
*
* @return bool TRUE on success, FALSE on failure
*/
function disconnect()
{
$ret = @sybase_close($this->connection);
$this->connection = null;
return $ret;
}
 
// }}}
// {{{ simpleQuery()
 
/**
* Sends a query to the database server
*
* @param string the SQL query string
*
* @return mixed + a PHP result resrouce for successful SELECT queries
* + the DB_OK constant for other successful queries
* + a DB_Error object on failure
*/
function simpleQuery($query)
{
$ismanip = DB::isManip($query);
$this->last_query = $query;
if (!@sybase_select_db($this->_db, $this->connection)) {
return $this->sybaseRaiseError(DB_ERROR_NODBSELECTED);
}
$query = $this->modifyQuery($query);
if (!$this->autocommit && $ismanip) {
if ($this->transaction_opcount == 0) {
$result = @sybase_query('BEGIN TRANSACTION', $this->connection);
if (!$result) {
return $this->sybaseRaiseError();
}
}
$this->transaction_opcount++;
}
$result = @sybase_query($query, $this->connection);
if (!$result) {
return $this->sybaseRaiseError();
}
if (is_resource($result)) {
return $result;
}
// Determine which queries that should return data, and which
// should return an error code only.
return $ismanip ? DB_OK : $result;
}
 
// }}}
// {{{ nextResult()
 
/**
* Move the internal sybase result pointer to the next available result
*
* @param a valid sybase result resource
*
* @access public
*
* @return true if a result is available otherwise return false
*/
function nextResult($result)
{
return false;
}
 
// }}}
// {{{ fetchInto()
 
/**
* Places a row from the result set into the given array
*
* Formating of the array and the data therein are configurable.
* See DB_result::fetchInto() for more information.
*
* This method is not meant to be called directly. Use
* DB_result::fetchInto() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result the query result resource
* @param array $arr the referenced array to put the data in
* @param int $fetchmode how the resulting array should be indexed
* @param int $rownum the row number to fetch (0 = first row)
*
* @return mixed DB_OK on success, NULL when the end of a result set is
* reached or on failure
*
* @see DB_result::fetchInto()
*/
function fetchInto($result, &$arr, $fetchmode, $rownum = null)
{
if ($rownum !== null) {
if (!@sybase_data_seek($result, $rownum)) {
return null;
}
}
if ($fetchmode & DB_FETCHMODE_ASSOC) {
if (function_exists('sybase_fetch_assoc')) {
$arr = @sybase_fetch_assoc($result);
} else {
if ($arr = @sybase_fetch_array($result)) {
foreach ($arr as $key => $value) {
if (is_int($key)) {
unset($arr[$key]);
}
}
}
}
if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) {
$arr = array_change_key_case($arr, CASE_LOWER);
}
} else {
$arr = @sybase_fetch_row($result);
}
if (!$arr) {
return null;
}
if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
$this->_rtrimArrayValues($arr);
}
if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
$this->_convertNullArrayValuesToEmpty($arr);
}
return DB_OK;
}
 
// }}}
// {{{ freeResult()
 
/**
* Deletes the result set and frees the memory occupied by the result set
*
* This method is not meant to be called directly. Use
* DB_result::free() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return bool TRUE on success, FALSE if $result is invalid
*
* @see DB_result::free()
*/
function freeResult($result)
{
return @sybase_free_result($result);
}
 
// }}}
// {{{ numCols()
 
/**
* Gets the number of columns in a result set
*
* This method is not meant to be called directly. Use
* DB_result::numCols() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return int the number of columns. A DB_Error object on failure.
*
* @see DB_result::numCols()
*/
function numCols($result)
{
$cols = @sybase_num_fields($result);
if (!$cols) {
return $this->sybaseRaiseError();
}
return $cols;
}
 
// }}}
// {{{ numRows()
 
/**
* Gets the number of rows in a result set
*
* This method is not meant to be called directly. Use
* DB_result::numRows() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return int the number of rows. A DB_Error object on failure.
*
* @see DB_result::numRows()
*/
function numRows($result)
{
$rows = @sybase_num_rows($result);
if ($rows === false) {
return $this->sybaseRaiseError();
}
return $rows;
}
 
// }}}
// {{{ affectedRows()
 
/**
* Determines the number of rows affected by a data maniuplation query
*
* 0 is returned for queries that don't manipulate data.
*
* @return int the number of rows. A DB_Error object on failure.
*/
function affectedRows()
{
if (DB::isManip($this->last_query)) {
$result = @sybase_affected_rows($this->connection);
} else {
$result = 0;
}
return $result;
}
 
// }}}
// {{{ nextId()
 
/**
* Returns the next free id in a sequence
*
* @param string $seq_name name of the sequence
* @param boolean $ondemand when true, the seqence is automatically
* created if it does not exist
*
* @return int the next id number in the sequence.
* A DB_Error object on failure.
*
* @see DB_common::nextID(), DB_common::getSequenceName(),
* DB_sybase::createSequence(), DB_sybase::dropSequence()
*/
function nextId($seq_name, $ondemand = true)
{
$seqname = $this->getSequenceName($seq_name);
if (!@sybase_select_db($this->_db, $this->connection)) {
return $this->sybaseRaiseError(DB_ERROR_NODBSELECTED);
}
$repeat = 0;
do {
$this->pushErrorHandling(PEAR_ERROR_RETURN);
$result = $this->query("INSERT INTO $seqname (vapor) VALUES (0)");
$this->popErrorHandling();
if ($ondemand && DB::isError($result) &&
($result->getCode() == DB_ERROR || $result->getCode() == DB_ERROR_NOSUCHTABLE))
{
$repeat = 1;
$result = $this->createSequence($seq_name);
if (DB::isError($result)) {
return $this->raiseError($result);
}
} elseif (!DB::isError($result)) {
$result =& $this->query("SELECT @@IDENTITY FROM $seqname");
$repeat = 0;
} else {
$repeat = false;
}
} while ($repeat);
if (DB::isError($result)) {
return $this->raiseError($result);
}
$result = $result->fetchRow(DB_FETCHMODE_ORDERED);
return $result[0];
}
 
/**
* Creates a new sequence
*
* @param string $seq_name name of the new sequence
*
* @return int DB_OK on success. A DB_Error object on failure.
*
* @see DB_common::createSequence(), DB_common::getSequenceName(),
* DB_sybase::nextID(), DB_sybase::dropSequence()
*/
function createSequence($seq_name)
{
return $this->query('CREATE TABLE '
. $this->getSequenceName($seq_name)
. ' (id numeric(10, 0) IDENTITY NOT NULL,'
. ' vapor int NULL)');
}
 
// }}}
// {{{ dropSequence()
 
/**
* Deletes a sequence
*
* @param string $seq_name name of the sequence to be deleted
*
* @return int DB_OK on success. A DB_Error object on failure.
*
* @see DB_common::dropSequence(), DB_common::getSequenceName(),
* DB_sybase::nextID(), DB_sybase::createSequence()
*/
function dropSequence($seq_name)
{
return $this->query('DROP TABLE ' . $this->getSequenceName($seq_name));
}
 
// }}}
// {{{ autoCommit()
 
/**
* Enables or disables automatic commits
*
* @param bool $onoff true turns it on, false turns it off
*
* @return int DB_OK on success. A DB_Error object if the driver
* doesn't support auto-committing transactions.
*/
function autoCommit($onoff = false)
{
// XXX if $this->transaction_opcount > 0, we should probably
// issue a warning here.
$this->autocommit = $onoff ? true : false;
return DB_OK;
}
 
// }}}
// {{{ commit()
 
/**
* Commits the current transaction
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function commit()
{
if ($this->transaction_opcount > 0) {
if (!@sybase_select_db($this->_db, $this->connection)) {
return $this->sybaseRaiseError(DB_ERROR_NODBSELECTED);
}
$result = @sybase_query('COMMIT', $this->connection);
$this->transaction_opcount = 0;
if (!$result) {
return $this->sybaseRaiseError();
}
}
return DB_OK;
}
 
// }}}
// {{{ rollback()
 
/**
* Reverts the current transaction
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function rollback()
{
if ($this->transaction_opcount > 0) {
if (!@sybase_select_db($this->_db, $this->connection)) {
return $this->sybaseRaiseError(DB_ERROR_NODBSELECTED);
}
$result = @sybase_query('ROLLBACK', $this->connection);
$this->transaction_opcount = 0;
if (!$result) {
return $this->sybaseRaiseError();
}
}
return DB_OK;
}
 
// }}}
// {{{ sybaseRaiseError()
 
/**
* Produces a DB_Error object regarding the current problem
*
* @param int $errno if the error is being manually raised pass a
* DB_ERROR* constant here. If this isn't passed
* the error information gathered from the DBMS.
*
* @return object the DB_Error object
*
* @see DB_common::raiseError(),
* DB_sybase::errorNative(), DB_sybase::errorCode()
*/
function sybaseRaiseError($errno = null)
{
$native = $this->errorNative();
if ($errno === null) {
$errno = $this->errorCode($native);
}
return $this->raiseError($errno, null, null, null, $native);
}
 
// }}}
// {{{ errorNative()
 
/**
* Gets the DBMS' native error message produced by the last query
*
* @return string the DBMS' error message
*/
function errorNative()
{
return @sybase_get_last_message();
}
 
// }}}
// {{{ errorCode()
 
/**
* Determines PEAR::DB error code from the database's text error message.
*
* @param string $errormsg error message returned from the database
* @return integer an error number from a DB error constant
*/
function errorCode($errormsg)
{
static $error_regexps;
if (!isset($error_regexps)) {
$error_regexps = array(
'/Incorrect syntax near/'
=> DB_ERROR_SYNTAX,
'/^Unclosed quote before the character string [\"\'].*[\"\']\./'
=> DB_ERROR_SYNTAX,
'/Implicit conversion (from datatype|of NUMERIC value)/i'
=> DB_ERROR_INVALID_NUMBER,
'/Cannot drop the table [\"\'].+[\"\'], because it doesn\'t exist in the system catalogs\./'
=> DB_ERROR_NOSUCHTABLE,
'/Only the owner of object [\"\'].+[\"\'] or a user with System Administrator \(SA\) role can run this command\./'
=> DB_ERROR_ACCESS_VIOLATION,
'/^.+ permission denied on object .+, database .+, owner .+/'
=> DB_ERROR_ACCESS_VIOLATION,
'/^.* permission denied, database .+, owner .+/'
=> DB_ERROR_ACCESS_VIOLATION,
'/[^.*] not found\./'
=> DB_ERROR_NOSUCHTABLE,
'/There is already an object named/'
=> DB_ERROR_ALREADY_EXISTS,
'/Invalid column name/'
=> DB_ERROR_NOSUCHFIELD,
'/does not allow null values/'
=> DB_ERROR_CONSTRAINT_NOT_NULL,
'/Command has been aborted/'
=> DB_ERROR_CONSTRAINT,
'/^Cannot drop the index .* because it doesn\'t exist/i'
=> DB_ERROR_NOT_FOUND,
'/^There is already an index/i'
=> DB_ERROR_ALREADY_EXISTS,
'/^There are fewer columns in the INSERT statement than values specified/i'
=> DB_ERROR_VALUE_COUNT_ON_ROW,
);
}
 
foreach ($error_regexps as $regexp => $code) {
if (preg_match($regexp, $errormsg)) {
return $code;
}
}
return DB_ERROR;
}
 
// }}}
// {{{ tableInfo()
 
/**
* Returns information about a table or a result set
*
* NOTE: only supports 'table' and 'flags' if <var>$result</var>
* is a table name.
*
* @param object|string $result DB_result object from a query or a
* string containing the name of a table.
* While this also accepts a query result
* resource identifier, this behavior is
* deprecated.
* @param int $mode a valid tableInfo mode
*
* @return array an associative array with the information requested.
* A DB_Error object on failure.
*
* @see DB_common::tableInfo()
* @since Method available since Release 1.6.0
*/
function tableInfo($result, $mode = null)
{
if (is_string($result)) {
/*
* Probably received a table name.
* Create a result resource identifier.
*/
if (!@sybase_select_db($this->_db, $this->connection)) {
return $this->sybaseRaiseError(DB_ERROR_NODBSELECTED);
}
$id = @sybase_query("SELECT * FROM $result WHERE 1=0",
$this->connection);
$got_string = true;
} elseif (isset($result->result)) {
/*
* Probably received a result object.
* Extract the result resource identifier.
*/
$id = $result->result;
$got_string = false;
} else {
/*
* Probably received a result resource identifier.
* Copy it.
* Deprecated. Here for compatibility only.
*/
$id = $result;
$got_string = false;
}
 
if (!is_resource($id)) {
return $this->sybaseRaiseError(DB_ERROR_NEED_MORE_DATA);
}
 
if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
$case_func = 'strtolower';
} else {
$case_func = 'strval';
}
 
$count = @sybase_num_fields($id);
$res = array();
 
if ($mode) {
$res['num_fields'] = $count;
}
 
for ($i = 0; $i < $count; $i++) {
$f = @sybase_fetch_field($id, $i);
// column_source is often blank
$res[$i] = array(
'table' => $got_string
? $case_func($result)
: $case_func($f->column_source),
'name' => $case_func($f->name),
'type' => $f->type,
'len' => $f->max_length,
'flags' => '',
);
if ($res[$i]['table']) {
$res[$i]['flags'] = $this->_sybase_field_flags(
$res[$i]['table'], $res[$i]['name']);
}
if ($mode & DB_TABLEINFO_ORDER) {
$res['order'][$res[$i]['name']] = $i;
}
if ($mode & DB_TABLEINFO_ORDERTABLE) {
$res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
}
}
 
// free the result only if we were called on a table
if ($got_string) {
@sybase_free_result($id);
}
return $res;
}
 
// }}}
// {{{ _sybase_field_flags()
 
/**
* Get the flags for a field
*
* Currently supports:
* + <samp>unique_key</samp> (unique index, unique check or primary_key)
* + <samp>multiple_key</samp> (multi-key index)
*
* @param string $table the table name
* @param string $column the field name
*
* @return string space delimited string of flags. Empty string if none.
*
* @access private
*/
function _sybase_field_flags($table, $column)
{
static $tableName = null;
static $flags = array();
 
if ($table != $tableName) {
$flags = array();
$tableName = $table;
 
// get unique/primary keys
$res = $this->getAll("sp_helpindex $table", DB_FETCHMODE_ASSOC);
 
if (!isset($res[0]['index_description'])) {
return '';
}
 
foreach ($res as $val) {
$keys = explode(', ', trim($val['index_keys']));
 
if (sizeof($keys) > 1) {
foreach ($keys as $key) {
$this->_add_flag($flags[$key], 'multiple_key');
}
}
 
if (strpos($val['index_description'], 'unique')) {
foreach ($keys as $key) {
$this->_add_flag($flags[$key], 'unique_key');
}
}
}
 
}
 
if (array_key_exists($column, $flags)) {
return(implode(' ', $flags[$column]));
}
 
return '';
}
 
// }}}
// {{{ _add_flag()
 
/**
* Adds a string to the flags array if the flag is not yet in there
* - if there is no flag present the array is created
*
* @param array $array reference of flags array to add a value to
* @param mixed $value value to add to the flag array
*
* @return void
*
* @access private
*/
function _add_flag(&$array, $value)
{
if (!is_array($array)) {
$array = array($value);
} elseif (!in_array($value, $array)) {
array_push($array, $value);
}
}
 
// }}}
// {{{ getSpecialQuery()
 
/**
* Obtains the query string needed for listing a given type of objects
*
* @param string $type the kind of objects you want to retrieve
*
* @return string the SQL query string or null if the driver doesn't
* support the object type requested
*
* @access protected
* @see DB_common::getListOf()
*/
function getSpecialQuery($type)
{
switch ($type) {
case 'tables':
return "SELECT name FROM sysobjects WHERE type = 'U'"
. ' ORDER BY name';
case 'views':
return "SELECT name FROM sysobjects WHERE type = 'V'";
default:
return null;
}
}
 
// }}}
 
}
 
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/
 
?>
/tags/Racine_livraison_narmer/api/pear/DB/pgsql.php
New file
0,0 → 1,1097
<?php
 
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 
/**
* The PEAR DB driver for PHP's pgsql extension
* for interacting with PostgreSQL databases
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Database
* @package DB
* @author Rui Hirokawa <hirokawa@php.net>
* @author Stig Bakken <ssb@php.net>
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id: pgsql.php,v 1.3 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/DB
*/
 
/**
* Obtain the DB_common class so it can be extended from
*/
require_once 'DB/common.php';
 
/**
* The methods PEAR DB uses to interact with PHP's pgsql extension
* for interacting with PostgreSQL databases
*
* These methods overload the ones declared in DB_common.
*
* @category Database
* @package DB
* @author Rui Hirokawa <hirokawa@php.net>
* @author Stig Bakken <ssb@php.net>
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version Release: 1.7.6
* @link http://pear.php.net/package/DB
*/
class DB_pgsql extends DB_common
{
// {{{ properties
 
/**
* The DB driver type (mysql, oci8, odbc, etc.)
* @var string
*/
var $phptype = 'pgsql';
 
/**
* The database syntax variant to be used (db2, access, etc.), if any
* @var string
*/
var $dbsyntax = 'pgsql';
 
/**
* The capabilities of this DB implementation
*
* The 'new_link' element contains the PHP version that first provided
* new_link support for this DBMS. Contains false if it's unsupported.
*
* Meaning of the 'limit' element:
* + 'emulate' = emulate with fetch row by number
* + 'alter' = alter the query
* + false = skip rows
*
* @var array
*/
var $features = array(
'limit' => 'alter',
'new_link' => '4.3.0',
'numrows' => true,
'pconnect' => true,
'prepare' => false,
'ssl' => true,
'transactions' => true,
);
 
/**
* A mapping of native error codes to DB error codes
* @var array
*/
var $errorcode_map = array(
);
 
/**
* The raw database connection created by PHP
* @var resource
*/
var $connection;
 
/**
* The DSN information for connecting to a database
* @var array
*/
var $dsn = array();
 
 
/**
* Should data manipulation queries be committed automatically?
* @var bool
* @access private
*/
var $autocommit = true;
 
/**
* The quantity of transactions begun
*
* {@internal While this is private, it can't actually be designated
* private in PHP 5 because it is directly accessed in the test suite.}}
*
* @var integer
* @access private
*/
var $transaction_opcount = 0;
 
/**
* The number of rows affected by a data manipulation query
* @var integer
*/
var $affected = 0;
 
/**
* The current row being looked at in fetchInto()
* @var array
* @access private
*/
var $row = array();
 
/**
* The number of rows in a given result set
* @var array
* @access private
*/
var $_num_rows = array();
 
 
// }}}
// {{{ constructor
 
/**
* This constructor calls <kbd>$this->DB_common()</kbd>
*
* @return void
*/
function DB_pgsql()
{
$this->DB_common();
}
 
// }}}
// {{{ connect()
 
/**
* Connect to the database server, log in and open the database
*
* Don't call this method directly. Use DB::connect() instead.
*
* PEAR DB's pgsql driver supports the following extra DSN options:
* + connect_timeout How many seconds to wait for a connection to
* be established. Available since PEAR DB 1.7.0.
* + new_link If set to true, causes subsequent calls to
* connect() to return a new connection link
* instead of the existing one. WARNING: this is
* not portable to other DBMS's. Available only
* if PHP is >= 4.3.0 and PEAR DB is >= 1.7.0.
* + options Command line options to be sent to the server.
* Available since PEAR DB 1.6.4.
* + service Specifies a service name in pg_service.conf that
* holds additional connection parameters.
* Available since PEAR DB 1.7.0.
* + sslmode How should SSL be used when connecting? Values:
* disable, allow, prefer or require.
* Available since PEAR DB 1.7.0.
* + tty This was used to specify where to send server
* debug output. Available since PEAR DB 1.6.4.
*
* Example of connecting to a new link via a socket:
* <code>
* require_once 'DB.php';
*
* $dsn = 'pgsql://user:pass@unix(/tmp)/dbname?new_link=true';
* $options = array(
* 'portability' => DB_PORTABILITY_ALL,
* );
*
* $db =& DB::connect($dsn, $options);
* if (PEAR::isError($db)) {
* die($db->getMessage());
* }
* </code>
*
* @param array $dsn the data source name
* @param bool $persistent should the connection be persistent?
*
* @return int DB_OK on success. A DB_Error object on failure.
*
* @link http://www.postgresql.org/docs/current/static/libpq.html#LIBPQ-CONNECT
*/
function connect($dsn, $persistent = false)
{
if (!PEAR::loadExtension('pgsql')) {
return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
}
 
$this->dsn = $dsn;
if ($dsn['dbsyntax']) {
$this->dbsyntax = $dsn['dbsyntax'];
}
 
$protocol = $dsn['protocol'] ? $dsn['protocol'] : 'tcp';
 
$params = array('');
if ($protocol == 'tcp') {
if ($dsn['hostspec']) {
$params[0] .= 'host=' . $dsn['hostspec'];
}
if ($dsn['port']) {
$params[0] .= ' port=' . $dsn['port'];
}
} elseif ($protocol == 'unix') {
// Allow for pg socket in non-standard locations.
if ($dsn['socket']) {
$params[0] .= 'host=' . $dsn['socket'];
}
if ($dsn['port']) {
$params[0] .= ' port=' . $dsn['port'];
}
}
if ($dsn['database']) {
$params[0] .= ' dbname=\'' . addslashes($dsn['database']) . '\'';
}
if ($dsn['username']) {
$params[0] .= ' user=\'' . addslashes($dsn['username']) . '\'';
}
if ($dsn['password']) {
$params[0] .= ' password=\'' . addslashes($dsn['password']) . '\'';
}
if (!empty($dsn['options'])) {
$params[0] .= ' options=' . $dsn['options'];
}
if (!empty($dsn['tty'])) {
$params[0] .= ' tty=' . $dsn['tty'];
}
if (!empty($dsn['connect_timeout'])) {
$params[0] .= ' connect_timeout=' . $dsn['connect_timeout'];
}
if (!empty($dsn['sslmode'])) {
$params[0] .= ' sslmode=' . $dsn['sslmode'];
}
if (!empty($dsn['service'])) {
$params[0] .= ' service=' . $dsn['service'];
}
 
if (isset($dsn['new_link'])
&& ($dsn['new_link'] == 'true' || $dsn['new_link'] === true))
{
if (version_compare(phpversion(), '4.3.0', '>=')) {
$params[] = PGSQL_CONNECT_FORCE_NEW;
}
}
 
$connect_function = $persistent ? 'pg_pconnect' : 'pg_connect';
 
$ini = ini_get('track_errors');
$php_errormsg = '';
if ($ini) {
$this->connection = @call_user_func_array($connect_function,
$params);
} else {
ini_set('track_errors', 1);
$this->connection = @call_user_func_array($connect_function,
$params);
ini_set('track_errors', $ini);
}
 
if (!$this->connection) {
return $this->raiseError(DB_ERROR_CONNECT_FAILED,
null, null, null,
$php_errormsg);
}
return DB_OK;
}
 
// }}}
// {{{ disconnect()
 
/**
* Disconnects from the database server
*
* @return bool TRUE on success, FALSE on failure
*/
function disconnect()
{
$ret = @pg_close($this->connection);
$this->connection = null;
return $ret;
}
 
// }}}
// {{{ simpleQuery()
 
/**
* Sends a query to the database server
*
* @param string the SQL query string
*
* @return mixed + a PHP result resrouce for successful SELECT queries
* + the DB_OK constant for other successful queries
* + a DB_Error object on failure
*/
function simpleQuery($query)
{
$ismanip = DB::isManip($query);
$this->last_query = $query;
$query = $this->modifyQuery($query);
if (!$this->autocommit && $ismanip) {
if ($this->transaction_opcount == 0) {
$result = @pg_exec($this->connection, 'begin;');
if (!$result) {
return $this->pgsqlRaiseError();
}
}
$this->transaction_opcount++;
}
$result = @pg_exec($this->connection, $query);
if (!$result) {
return $this->pgsqlRaiseError();
}
// Determine which queries that should return data, and which
// should return an error code only.
if ($ismanip) {
$this->affected = @pg_affected_rows($result);
return DB_OK;
} elseif (preg_match('/^\s*\(*\s*(SELECT|EXPLAIN|SHOW)\s/si', $query)) {
/* PostgreSQL commands:
ABORT, ALTER, BEGIN, CLOSE, CLUSTER, COMMIT, COPY,
CREATE, DECLARE, DELETE, DROP TABLE, EXPLAIN, FETCH,
GRANT, INSERT, LISTEN, LOAD, LOCK, MOVE, NOTIFY, RESET,
REVOKE, ROLLBACK, SELECT, SELECT INTO, SET, SHOW,
UNLISTEN, UPDATE, VACUUM
*/
$this->row[(int)$result] = 0; // reset the row counter.
$numrows = $this->numRows($result);
if (is_object($numrows)) {
return $numrows;
}
$this->_num_rows[(int)$result] = $numrows;
$this->affected = 0;
return $result;
} else {
$this->affected = 0;
return DB_OK;
}
}
 
// }}}
// {{{ nextResult()
 
/**
* Move the internal pgsql result pointer to the next available result
*
* @param a valid fbsql result resource
*
* @access public
*
* @return true if a result is available otherwise return false
*/
function nextResult($result)
{
return false;
}
 
// }}}
// {{{ fetchInto()
 
/**
* Places a row from the result set into the given array
*
* Formating of the array and the data therein are configurable.
* See DB_result::fetchInto() for more information.
*
* This method is not meant to be called directly. Use
* DB_result::fetchInto() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result the query result resource
* @param array $arr the referenced array to put the data in
* @param int $fetchmode how the resulting array should be indexed
* @param int $rownum the row number to fetch (0 = first row)
*
* @return mixed DB_OK on success, NULL when the end of a result set is
* reached or on failure
*
* @see DB_result::fetchInto()
*/
function fetchInto($result, &$arr, $fetchmode, $rownum = null)
{
$result_int = (int)$result;
$rownum = ($rownum !== null) ? $rownum : $this->row[$result_int];
if ($rownum >= $this->_num_rows[$result_int]) {
return null;
}
if ($fetchmode & DB_FETCHMODE_ASSOC) {
$arr = @pg_fetch_array($result, $rownum, PGSQL_ASSOC);
if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) {
$arr = array_change_key_case($arr, CASE_LOWER);
}
} else {
$arr = @pg_fetch_row($result, $rownum);
}
if (!$arr) {
return null;
}
if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
$this->_rtrimArrayValues($arr);
}
if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
$this->_convertNullArrayValuesToEmpty($arr);
}
$this->row[$result_int] = ++$rownum;
return DB_OK;
}
 
// }}}
// {{{ freeResult()
 
/**
* Deletes the result set and frees the memory occupied by the result set
*
* This method is not meant to be called directly. Use
* DB_result::free() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return bool TRUE on success, FALSE if $result is invalid
*
* @see DB_result::free()
*/
function freeResult($result)
{
if (is_resource($result)) {
unset($this->row[(int)$result]);
unset($this->_num_rows[(int)$result]);
$this->affected = 0;
return @pg_freeresult($result);
}
return false;
}
 
// }}}
// {{{ quote()
 
/**
* @deprecated Deprecated in release 1.6.0
* @internal
*/
function quote($str)
{
return $this->quoteSmart($str);
}
 
// }}}
// {{{ quoteSmart()
 
/**
* Formats input so it can be safely used in a query
*
* @param mixed $in the data to be formatted
*
* @return mixed the formatted data. The format depends on the input's
* PHP type:
* + null = the string <samp>NULL</samp>
* + boolean = string <samp>TRUE</samp> or <samp>FALSE</samp>
* + integer or double = the unquoted number
* + other (including strings and numeric strings) =
* the data escaped according to MySQL's settings
* then encapsulated between single quotes
*
* @see DB_common::quoteSmart()
* @since Method available since Release 1.6.0
*/
function quoteSmart($in)
{
if (is_int($in) || is_double($in)) {
return $in;
} elseif (is_bool($in)) {
return $in ? 'TRUE' : 'FALSE';
} elseif (is_null($in)) {
return 'NULL';
} else {
return "'" . $this->escapeSimple($in) . "'";
}
}
 
// }}}
// {{{ escapeSimple()
 
/**
* Escapes a string according to the current DBMS's standards
*
* {@internal PostgreSQL treats a backslash as an escape character,
* so they are escaped as well.
*
* Not using pg_escape_string() yet because it requires PostgreSQL
* to be at version 7.2 or greater.}}
*
* @param string $str the string to be escaped
*
* @return string the escaped string
*
* @see DB_common::quoteSmart()
* @since Method available since Release 1.6.0
*/
function escapeSimple($str)
{
return str_replace("'", "''", str_replace('\\', '\\\\', $str));
}
 
// }}}
// {{{ numCols()
 
/**
* Gets the number of columns in a result set
*
* This method is not meant to be called directly. Use
* DB_result::numCols() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return int the number of columns. A DB_Error object on failure.
*
* @see DB_result::numCols()
*/
function numCols($result)
{
$cols = @pg_numfields($result);
if (!$cols) {
return $this->pgsqlRaiseError();
}
return $cols;
}
 
// }}}
// {{{ numRows()
 
/**
* Gets the number of rows in a result set
*
* This method is not meant to be called directly. Use
* DB_result::numRows() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return int the number of rows. A DB_Error object on failure.
*
* @see DB_result::numRows()
*/
function numRows($result)
{
$rows = @pg_numrows($result);
if ($rows === null) {
return $this->pgsqlRaiseError();
}
return $rows;
}
 
// }}}
// {{{ autoCommit()
 
/**
* Enables or disables automatic commits
*
* @param bool $onoff true turns it on, false turns it off
*
* @return int DB_OK on success. A DB_Error object if the driver
* doesn't support auto-committing transactions.
*/
function autoCommit($onoff = false)
{
// XXX if $this->transaction_opcount > 0, we should probably
// issue a warning here.
$this->autocommit = $onoff ? true : false;
return DB_OK;
}
 
// }}}
// {{{ commit()
 
/**
* Commits the current transaction
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function commit()
{
if ($this->transaction_opcount > 0) {
// (disabled) hack to shut up error messages from libpq.a
//@fclose(@fopen("php://stderr", "w"));
$result = @pg_exec($this->connection, 'end;');
$this->transaction_opcount = 0;
if (!$result) {
return $this->pgsqlRaiseError();
}
}
return DB_OK;
}
 
// }}}
// {{{ rollback()
 
/**
* Reverts the current transaction
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function rollback()
{
if ($this->transaction_opcount > 0) {
$result = @pg_exec($this->connection, 'abort;');
$this->transaction_opcount = 0;
if (!$result) {
return $this->pgsqlRaiseError();
}
}
return DB_OK;
}
 
// }}}
// {{{ affectedRows()
 
/**
* Determines the number of rows affected by a data maniuplation query
*
* 0 is returned for queries that don't manipulate data.
*
* @return int the number of rows. A DB_Error object on failure.
*/
function affectedRows()
{
return $this->affected;
}
 
// }}}
// {{{ nextId()
 
/**
* Returns the next free id in a sequence
*
* @param string $seq_name name of the sequence
* @param boolean $ondemand when true, the seqence is automatically
* created if it does not exist
*
* @return int the next id number in the sequence.
* A DB_Error object on failure.
*
* @see DB_common::nextID(), DB_common::getSequenceName(),
* DB_pgsql::createSequence(), DB_pgsql::dropSequence()
*/
function nextId($seq_name, $ondemand = true)
{
$seqname = $this->getSequenceName($seq_name);
$repeat = false;
do {
$this->pushErrorHandling(PEAR_ERROR_RETURN);
$result =& $this->query("SELECT NEXTVAL('${seqname}')");
$this->popErrorHandling();
if ($ondemand && DB::isError($result) &&
$result->getCode() == DB_ERROR_NOSUCHTABLE) {
$repeat = true;
$this->pushErrorHandling(PEAR_ERROR_RETURN);
$result = $this->createSequence($seq_name);
$this->popErrorHandling();
if (DB::isError($result)) {
return $this->raiseError($result);
}
} else {
$repeat = false;
}
} while ($repeat);
if (DB::isError($result)) {
return $this->raiseError($result);
}
$arr = $result->fetchRow(DB_FETCHMODE_ORDERED);
$result->free();
return $arr[0];
}
 
// }}}
// {{{ createSequence()
 
/**
* Creates a new sequence
*
* @param string $seq_name name of the new sequence
*
* @return int DB_OK on success. A DB_Error object on failure.
*
* @see DB_common::createSequence(), DB_common::getSequenceName(),
* DB_pgsql::nextID(), DB_pgsql::dropSequence()
*/
function createSequence($seq_name)
{
$seqname = $this->getSequenceName($seq_name);
$result = $this->query("CREATE SEQUENCE ${seqname}");
return $result;
}
 
// }}}
// {{{ dropSequence()
 
/**
* Deletes a sequence
*
* @param string $seq_name name of the sequence to be deleted
*
* @return int DB_OK on success. A DB_Error object on failure.
*
* @see DB_common::dropSequence(), DB_common::getSequenceName(),
* DB_pgsql::nextID(), DB_pgsql::createSequence()
*/
function dropSequence($seq_name)
{
return $this->query('DROP SEQUENCE '
. $this->getSequenceName($seq_name));
}
 
// }}}
// {{{ modifyLimitQuery()
 
/**
* Adds LIMIT clauses to a query string according to current DBMS standards
*
* @param string $query the query to modify
* @param int $from the row to start to fetching (0 = the first row)
* @param int $count the numbers of rows to fetch
* @param mixed $params array, string or numeric data to be used in
* execution of the statement. Quantity of items
* passed must match quantity of placeholders in
* query: meaning 1 placeholder for non-array
* parameters or 1 placeholder per array element.
*
* @return string the query string with LIMIT clauses added
*
* @access protected
*/
function modifyLimitQuery($query, $from, $count, $params = array())
{
return "$query LIMIT $count OFFSET $from";
}
 
// }}}
// {{{ pgsqlRaiseError()
 
/**
* Produces a DB_Error object regarding the current problem
*
* @param int $errno if the error is being manually raised pass a
* DB_ERROR* constant here. If this isn't passed
* the error information gathered from the DBMS.
*
* @return object the DB_Error object
*
* @see DB_common::raiseError(),
* DB_pgsql::errorNative(), DB_pgsql::errorCode()
*/
function pgsqlRaiseError($errno = null)
{
$native = $this->errorNative();
if ($errno === null) {
$errno = $this->errorCode($native);
}
return $this->raiseError($errno, null, null, null, $native);
}
 
// }}}
// {{{ errorNative()
 
/**
* Gets the DBMS' native error message produced by the last query
*
* {@internal Error messages are used instead of error codes
* in order to support older versions of PostgreSQL.}}
*
* @return string the DBMS' error message
*/
function errorNative()
{
return @pg_errormessage($this->connection);
}
 
// }}}
// {{{ errorCode()
 
/**
* Determines PEAR::DB error code from the database's text error message.
*
* @param string $errormsg error message returned from the database
* @return integer an error number from a DB error constant
*/
function errorCode($errormsg)
{
static $error_regexps;
if (!isset($error_regexps)) {
$error_regexps = array(
'/(relation|sequence|table).*does not exist|class .* not found/i'
=> DB_ERROR_NOSUCHTABLE,
'/index .* does not exist/'
=> DB_ERROR_NOT_FOUND,
'/column .* does not exist/i'
=> DB_ERROR_NOSUCHFIELD,
'/relation .* already exists/i'
=> DB_ERROR_ALREADY_EXISTS,
'/(divide|division) by zero$/i'
=> DB_ERROR_DIVZERO,
'/pg_atoi: error in .*: can\'t parse /i'
=> DB_ERROR_INVALID_NUMBER,
'/invalid input syntax for( type)? (integer|numeric)/i'
=> DB_ERROR_INVALID_NUMBER,
'/value .* is out of range for type \w*int/i'
=> DB_ERROR_INVALID_NUMBER,
'/integer out of range/i'
=> DB_ERROR_INVALID_NUMBER,
'/value too long for type character/i'
=> DB_ERROR_INVALID,
'/attribute .* not found|relation .* does not have attribute/i'
=> DB_ERROR_NOSUCHFIELD,
'/column .* specified in USING clause does not exist in (left|right) table/i'
=> DB_ERROR_NOSUCHFIELD,
'/parser: parse error at or near/i'
=> DB_ERROR_SYNTAX,
'/syntax error at/'
=> DB_ERROR_SYNTAX,
'/column reference .* is ambiguous/i'
=> DB_ERROR_SYNTAX,
'/permission denied/'
=> DB_ERROR_ACCESS_VIOLATION,
'/violates not-null constraint/'
=> DB_ERROR_CONSTRAINT_NOT_NULL,
'/violates [\w ]+ constraint/'
=> DB_ERROR_CONSTRAINT,
'/referential integrity violation/'
=> DB_ERROR_CONSTRAINT,
'/more expressions than target columns/i'
=> DB_ERROR_VALUE_COUNT_ON_ROW,
);
}
foreach ($error_regexps as $regexp => $code) {
if (preg_match($regexp, $errormsg)) {
return $code;
}
}
// Fall back to DB_ERROR if there was no mapping.
return DB_ERROR;
}
 
// }}}
// {{{ tableInfo()
 
/**
* Returns information about a table or a result set
*
* NOTE: only supports 'table' and 'flags' if <var>$result</var>
* is a table name.
*
* @param object|string $result DB_result object from a query or a
* string containing the name of a table.
* While this also accepts a query result
* resource identifier, this behavior is
* deprecated.
* @param int $mode a valid tableInfo mode
*
* @return array an associative array with the information requested.
* A DB_Error object on failure.
*
* @see DB_common::tableInfo()
*/
function tableInfo($result, $mode = null)
{
if (is_string($result)) {
/*
* Probably received a table name.
* Create a result resource identifier.
*/
$id = @pg_exec($this->connection, "SELECT * FROM $result LIMIT 0");
$got_string = true;
} elseif (isset($result->result)) {
/*
* Probably received a result object.
* Extract the result resource identifier.
*/
$id = $result->result;
$got_string = false;
} else {
/*
* Probably received a result resource identifier.
* Copy it.
* Deprecated. Here for compatibility only.
*/
$id = $result;
$got_string = false;
}
 
if (!is_resource($id)) {
return $this->pgsqlRaiseError(DB_ERROR_NEED_MORE_DATA);
}
 
if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
$case_func = 'strtolower';
} else {
$case_func = 'strval';
}
 
$count = @pg_numfields($id);
$res = array();
 
if ($mode) {
$res['num_fields'] = $count;
}
 
for ($i = 0; $i < $count; $i++) {
$res[$i] = array(
'table' => $got_string ? $case_func($result) : '',
'name' => $case_func(@pg_fieldname($id, $i)),
'type' => @pg_fieldtype($id, $i),
'len' => @pg_fieldsize($id, $i),
'flags' => $got_string
? $this->_pgFieldFlags($id, $i, $result)
: '',
);
if ($mode & DB_TABLEINFO_ORDER) {
$res['order'][$res[$i]['name']] = $i;
}
if ($mode & DB_TABLEINFO_ORDERTABLE) {
$res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
}
}
 
// free the result only if we were called on a table
if ($got_string) {
@pg_freeresult($id);
}
return $res;
}
 
// }}}
// {{{ _pgFieldFlags()
 
/**
* Get a column's flags
*
* Supports "not_null", "default_value", "primary_key", "unique_key"
* and "multiple_key". The default value is passed through
* rawurlencode() in case there are spaces in it.
*
* @param int $resource the PostgreSQL result identifier
* @param int $num_field the field number
*
* @return string the flags
*
* @access private
*/
function _pgFieldFlags($resource, $num_field, $table_name)
{
$field_name = @pg_fieldname($resource, $num_field);
 
$result = @pg_exec($this->connection, "SELECT f.attnotnull, f.atthasdef
FROM pg_attribute f, pg_class tab, pg_type typ
WHERE tab.relname = typ.typname
AND typ.typrelid = f.attrelid
AND f.attname = '$field_name'
AND tab.relname = '$table_name'");
if (@pg_numrows($result) > 0) {
$row = @pg_fetch_row($result, 0);
$flags = ($row[0] == 't') ? 'not_null ' : '';
 
if ($row[1] == 't') {
$result = @pg_exec($this->connection, "SELECT a.adsrc
FROM pg_attribute f, pg_class tab, pg_type typ, pg_attrdef a
WHERE tab.relname = typ.typname AND typ.typrelid = f.attrelid
AND f.attrelid = a.adrelid AND f.attname = '$field_name'
AND tab.relname = '$table_name' AND f.attnum = a.adnum");
$row = @pg_fetch_row($result, 0);
$num = preg_replace("/'(.*)'::\w+/", "\\1", $row[0]);
$flags .= 'default_' . rawurlencode($num) . ' ';
}
} else {
$flags = '';
}
$result = @pg_exec($this->connection, "SELECT i.indisunique, i.indisprimary, i.indkey
FROM pg_attribute f, pg_class tab, pg_type typ, pg_index i
WHERE tab.relname = typ.typname
AND typ.typrelid = f.attrelid
AND f.attrelid = i.indrelid
AND f.attname = '$field_name'
AND tab.relname = '$table_name'");
$count = @pg_numrows($result);
 
for ($i = 0; $i < $count ; $i++) {
$row = @pg_fetch_row($result, $i);
$keys = explode(' ', $row[2]);
 
if (in_array($num_field + 1, $keys)) {
$flags .= ($row[0] == 't' && $row[1] == 'f') ? 'unique_key ' : '';
$flags .= ($row[1] == 't') ? 'primary_key ' : '';
if (count($keys) > 1)
$flags .= 'multiple_key ';
}
}
 
return trim($flags);
}
 
// }}}
// {{{ getSpecialQuery()
 
/**
* Obtains the query string needed for listing a given type of objects
*
* @param string $type the kind of objects you want to retrieve
*
* @return string the SQL query string or null if the driver doesn't
* support the object type requested
*
* @access protected
* @see DB_common::getListOf()
*/
function getSpecialQuery($type)
{
switch ($type) {
case 'tables':
return 'SELECT c.relname AS "Name"'
. ' FROM pg_class c, pg_user u'
. ' WHERE c.relowner = u.usesysid'
. " AND c.relkind = 'r'"
. ' AND NOT EXISTS'
. ' (SELECT 1 FROM pg_views'
. ' WHERE viewname = c.relname)'
. " AND c.relname !~ '^(pg_|sql_)'"
. ' UNION'
. ' SELECT c.relname AS "Name"'
. ' FROM pg_class c'
. " WHERE c.relkind = 'r'"
. ' AND NOT EXISTS'
. ' (SELECT 1 FROM pg_views'
. ' WHERE viewname = c.relname)'
. ' AND NOT EXISTS'
. ' (SELECT 1 FROM pg_user'
. ' WHERE usesysid = c.relowner)'
. " AND c.relname !~ '^pg_'";
case 'schema.tables':
return "SELECT schemaname || '.' || tablename"
. ' AS "Name"'
. ' FROM pg_catalog.pg_tables'
. ' WHERE schemaname NOT IN'
. " ('pg_catalog', 'information_schema', 'pg_toast')";
case 'views':
// Table cols: viewname | viewowner | definition
return 'SELECT viewname from pg_views WHERE schemaname'
. " NOT IN ('information_schema', 'pg_catalog')";
case 'users':
// cols: usename |usesysid|usecreatedb|usetrace|usesuper|usecatupd|passwd |valuntil
return 'SELECT usename FROM pg_user';
case 'databases':
return 'SELECT datname FROM pg_database';
case 'functions':
case 'procedures':
return 'SELECT proname FROM pg_proc WHERE proowner <> 1';
default:
return null;
}
}
 
// }}}
 
}
 
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/
 
?>
/tags/Racine_livraison_narmer/api/pear/DB/ifx.php
New file
0,0 → 1,681
<?php
 
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 
/**
* The PEAR DB driver for PHP's ifx extension
* for interacting with Informix databases
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Database
* @package DB
* @author Tomas V.V.Cox <cox@idecnet.com>
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id: ifx.php,v 1.3 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/DB
*/
 
/**
* Obtain the DB_common class so it can be extended from
*/
require_once 'DB/common.php';
 
/**
* The methods PEAR DB uses to interact with PHP's ifx extension
* for interacting with Informix databases
*
* These methods overload the ones declared in DB_common.
*
* More info on Informix errors can be found at:
* http://www.informix.com/answers/english/ierrors.htm
*
* TODO:
* - set needed env Informix vars on connect
* - implement native prepare/execute
*
* @category Database
* @package DB
* @author Tomas V.V.Cox <cox@idecnet.com>
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version Release: 1.7.6
* @link http://pear.php.net/package/DB
*/
class DB_ifx extends DB_common
{
// {{{ properties
 
/**
* The DB driver type (mysql, oci8, odbc, etc.)
* @var string
*/
var $phptype = 'ifx';
 
/**
* The database syntax variant to be used (db2, access, etc.), if any
* @var string
*/
var $dbsyntax = 'ifx';
 
/**
* The capabilities of this DB implementation
*
* The 'new_link' element contains the PHP version that first provided
* new_link support for this DBMS. Contains false if it's unsupported.
*
* Meaning of the 'limit' element:
* + 'emulate' = emulate with fetch row by number
* + 'alter' = alter the query
* + false = skip rows
*
* @var array
*/
var $features = array(
'limit' => 'emulate',
'new_link' => false,
'numrows' => 'emulate',
'pconnect' => true,
'prepare' => false,
'ssl' => false,
'transactions' => true,
);
 
/**
* A mapping of native error codes to DB error codes
* @var array
*/
var $errorcode_map = array(
'-201' => DB_ERROR_SYNTAX,
'-206' => DB_ERROR_NOSUCHTABLE,
'-217' => DB_ERROR_NOSUCHFIELD,
'-236' => DB_ERROR_VALUE_COUNT_ON_ROW,
'-239' => DB_ERROR_CONSTRAINT,
'-253' => DB_ERROR_SYNTAX,
'-292' => DB_ERROR_CONSTRAINT_NOT_NULL,
'-310' => DB_ERROR_ALREADY_EXISTS,
'-316' => DB_ERROR_ALREADY_EXISTS,
'-319' => DB_ERROR_NOT_FOUND,
'-329' => DB_ERROR_NODBSELECTED,
'-346' => DB_ERROR_CONSTRAINT,
'-386' => DB_ERROR_CONSTRAINT_NOT_NULL,
'-391' => DB_ERROR_CONSTRAINT_NOT_NULL,
'-554' => DB_ERROR_SYNTAX,
'-691' => DB_ERROR_CONSTRAINT,
'-692' => DB_ERROR_CONSTRAINT,
'-703' => DB_ERROR_CONSTRAINT_NOT_NULL,
'-1204' => DB_ERROR_INVALID_DATE,
'-1205' => DB_ERROR_INVALID_DATE,
'-1206' => DB_ERROR_INVALID_DATE,
'-1209' => DB_ERROR_INVALID_DATE,
'-1210' => DB_ERROR_INVALID_DATE,
'-1212' => DB_ERROR_INVALID_DATE,
'-1213' => DB_ERROR_INVALID_NUMBER,
);
 
/**
* The raw database connection created by PHP
* @var resource
*/
var $connection;
 
/**
* The DSN information for connecting to a database
* @var array
*/
var $dsn = array();
 
 
/**
* Should data manipulation queries be committed automatically?
* @var bool
* @access private
*/
var $autocommit = true;
 
/**
* The quantity of transactions begun
*
* {@internal While this is private, it can't actually be designated
* private in PHP 5 because it is directly accessed in the test suite.}}
*
* @var integer
* @access private
*/
var $transaction_opcount = 0;
 
/**
* The number of rows affected by a data manipulation query
* @var integer
* @access private
*/
var $affected = 0;
 
 
// }}}
// {{{ constructor
 
/**
* This constructor calls <kbd>$this->DB_common()</kbd>
*
* @return void
*/
function DB_ifx()
{
$this->DB_common();
}
 
// }}}
// {{{ connect()
 
/**
* Connect to the database server, log in and open the database
*
* Don't call this method directly. Use DB::connect() instead.
*
* @param array $dsn the data source name
* @param bool $persistent should the connection be persistent?
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function connect($dsn, $persistent = false)
{
if (!PEAR::loadExtension('informix') &&
!PEAR::loadExtension('Informix'))
{
return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
}
 
$this->dsn = $dsn;
if ($dsn['dbsyntax']) {
$this->dbsyntax = $dsn['dbsyntax'];
}
 
$dbhost = $dsn['hostspec'] ? '@' . $dsn['hostspec'] : '';
$dbname = $dsn['database'] ? $dsn['database'] . $dbhost : '';
$user = $dsn['username'] ? $dsn['username'] : '';
$pw = $dsn['password'] ? $dsn['password'] : '';
 
$connect_function = $persistent ? 'ifx_pconnect' : 'ifx_connect';
 
$this->connection = @$connect_function($dbname, $user, $pw);
if (!is_resource($this->connection)) {
return $this->ifxRaiseError(DB_ERROR_CONNECT_FAILED);
}
return DB_OK;
}
 
// }}}
// {{{ disconnect()
 
/**
* Disconnects from the database server
*
* @return bool TRUE on success, FALSE on failure
*/
function disconnect()
{
$ret = @ifx_close($this->connection);
$this->connection = null;
return $ret;
}
 
// }}}
// {{{ simpleQuery()
 
/**
* Sends a query to the database server
*
* @param string the SQL query string
*
* @return mixed + a PHP result resrouce for successful SELECT queries
* + the DB_OK constant for other successful queries
* + a DB_Error object on failure
*/
function simpleQuery($query)
{
$ismanip = DB::isManip($query);
$this->last_query = $query;
$this->affected = null;
if (preg_match('/(SELECT)/i', $query)) { //TESTME: Use !DB::isManip()?
// the scroll is needed for fetching absolute row numbers
// in a select query result
$result = @ifx_query($query, $this->connection, IFX_SCROLL);
} else {
if (!$this->autocommit && $ismanip) {
if ($this->transaction_opcount == 0) {
$result = @ifx_query('BEGIN WORK', $this->connection);
if (!$result) {
return $this->ifxRaiseError();
}
}
$this->transaction_opcount++;
}
$result = @ifx_query($query, $this->connection);
}
if (!$result) {
return $this->ifxRaiseError();
}
$this->affected = @ifx_affected_rows($result);
// Determine which queries should return data, and which
// should return an error code only.
if (preg_match('/(SELECT)/i', $query)) {
return $result;
}
// XXX Testme: free results inside a transaction
// may cause to stop it and commit the work?
 
// Result has to be freed even with a insert or update
@ifx_free_result($result);
 
return DB_OK;
}
 
// }}}
// {{{ nextResult()
 
/**
* Move the internal ifx result pointer to the next available result
*
* @param a valid fbsql result resource
*
* @access public
*
* @return true if a result is available otherwise return false
*/
function nextResult($result)
{
return false;
}
 
// }}}
// {{{ affectedRows()
 
/**
* Determines the number of rows affected by a data maniuplation query
*
* 0 is returned for queries that don't manipulate data.
*
* @return int the number of rows. A DB_Error object on failure.
*/
function affectedRows()
{
if (DB::isManip($this->last_query)) {
return $this->affected;
} else {
return 0;
}
}
 
// }}}
// {{{ fetchInto()
 
/**
* Places a row from the result set into the given array
*
* Formating of the array and the data therein are configurable.
* See DB_result::fetchInto() for more information.
*
* This method is not meant to be called directly. Use
* DB_result::fetchInto() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result the query result resource
* @param array $arr the referenced array to put the data in
* @param int $fetchmode how the resulting array should be indexed
* @param int $rownum the row number to fetch (0 = first row)
*
* @return mixed DB_OK on success, NULL when the end of a result set is
* reached or on failure
*
* @see DB_result::fetchInto()
*/
function fetchInto($result, &$arr, $fetchmode, $rownum = null)
{
if (($rownum !== null) && ($rownum < 0)) {
return null;
}
if ($rownum === null) {
/*
* Even though fetch_row() should return the next row if
* $rownum is null, it doesn't in all cases. Bug 598.
*/
$rownum = 'NEXT';
} else {
// Index starts at row 1, unlike most DBMS's starting at 0.
$rownum++;
}
if (!$arr = @ifx_fetch_row($result, $rownum)) {
return null;
}
if ($fetchmode !== DB_FETCHMODE_ASSOC) {
$i=0;
$order = array();
foreach ($arr as $val) {
$order[$i++] = $val;
}
$arr = $order;
} elseif ($fetchmode == DB_FETCHMODE_ASSOC &&
$this->options['portability'] & DB_PORTABILITY_LOWERCASE)
{
$arr = array_change_key_case($arr, CASE_LOWER);
}
if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
$this->_rtrimArrayValues($arr);
}
if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
$this->_convertNullArrayValuesToEmpty($arr);
}
return DB_OK;
}
 
// }}}
// {{{ numCols()
 
/**
* Gets the number of columns in a result set
*
* This method is not meant to be called directly. Use
* DB_result::numCols() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return int the number of columns. A DB_Error object on failure.
*
* @see DB_result::numCols()
*/
function numCols($result)
{
if (!$cols = @ifx_num_fields($result)) {
return $this->ifxRaiseError();
}
return $cols;
}
 
// }}}
// {{{ freeResult()
 
/**
* Deletes the result set and frees the memory occupied by the result set
*
* This method is not meant to be called directly. Use
* DB_result::free() instead. It can't be declared "protected"
* because DB_result is a separate object.
*
* @param resource $result PHP's query result resource
*
* @return bool TRUE on success, FALSE if $result is invalid
*
* @see DB_result::free()
*/
function freeResult($result)
{
return @ifx_free_result($result);
}
 
// }}}
// {{{ autoCommit()
 
/**
* Enables or disables automatic commits
*
* @param bool $onoff true turns it on, false turns it off
*
* @return int DB_OK on success. A DB_Error object if the driver
* doesn't support auto-committing transactions.
*/
function autoCommit($onoff = true)
{
// XXX if $this->transaction_opcount > 0, we should probably
// issue a warning here.
$this->autocommit = $onoff ? true : false;
return DB_OK;
}
 
// }}}
// {{{ commit()
 
/**
* Commits the current transaction
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function commit()
{
if ($this->transaction_opcount > 0) {
$result = @ifx_query('COMMIT WORK', $this->connection);
$this->transaction_opcount = 0;
if (!$result) {
return $this->ifxRaiseError();
}
}
return DB_OK;
}
 
// }}}
// {{{ rollback()
 
/**
* Reverts the current transaction
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function rollback()
{
if ($this->transaction_opcount > 0) {
$result = @ifx_query('ROLLBACK WORK', $this->connection);
$this->transaction_opcount = 0;
if (!$result) {
return $this->ifxRaiseError();
}
}
return DB_OK;
}
 
// }}}
// {{{ ifxRaiseError()
 
/**
* Produces a DB_Error object regarding the current problem
*
* @param int $errno if the error is being manually raised pass a
* DB_ERROR* constant here. If this isn't passed
* the error information gathered from the DBMS.
*
* @return object the DB_Error object
*
* @see DB_common::raiseError(),
* DB_ifx::errorNative(), DB_ifx::errorCode()
*/
function ifxRaiseError($errno = null)
{
if ($errno === null) {
$errno = $this->errorCode(ifx_error());
}
return $this->raiseError($errno, null, null, null,
$this->errorNative());
}
 
// }}}
// {{{ errorNative()
 
/**
* Gets the DBMS' native error code and message produced by the last query
*
* @return string the DBMS' error code and message
*/
function errorNative()
{
return @ifx_error() . ' ' . @ifx_errormsg();
}
 
// }}}
// {{{ errorCode()
 
/**
* Maps native error codes to DB's portable ones.
*
* Requires that the DB implementation's constructor fills
* in the <var>$errorcode_map</var> property.
*
* @param string $nativecode error code returned by the database
* @return int a portable DB error code, or DB_ERROR if this DB
* implementation has no mapping for the given error code.
*/
function errorCode($nativecode)
{
if (ereg('SQLCODE=(.*)]', $nativecode, $match)) {
$code = $match[1];
if (isset($this->errorcode_map[$code])) {
return $this->errorcode_map[$code];
}
}
return DB_ERROR;
}
 
// }}}
// {{{ tableInfo()
 
/**
* Returns information about a table or a result set
*
* NOTE: only supports 'table' if <var>$result</var> is a table name.
*
* If analyzing a query result and the result has duplicate field names,
* an error will be raised saying
* <samp>can't distinguish duplicate field names</samp>.
*
* @param object|string $result DB_result object from a query or a
* string containing the name of a table.
* While this also accepts a query result
* resource identifier, this behavior is
* deprecated.
* @param int $mode a valid tableInfo mode
*
* @return array an associative array with the information requested.
* A DB_Error object on failure.
*
* @see DB_common::tableInfo()
* @since Method available since Release 1.6.0
*/
function tableInfo($result, $mode = null)
{
if (is_string($result)) {
/*
* Probably received a table name.
* Create a result resource identifier.
*/
$id = @ifx_query("SELECT * FROM $result WHERE 1=0",
$this->connection);
$got_string = true;
} elseif (isset($result->result)) {
/*
* Probably received a result object.
* Extract the result resource identifier.
*/
$id = $result->result;
$got_string = false;
} else {
/*
* Probably received a result resource identifier.
* Copy it.
*/
$id = $result;
$got_string = false;
}
 
if (!is_resource($id)) {
return $this->ifxRaiseError(DB_ERROR_NEED_MORE_DATA);
}
 
$flds = @ifx_fieldproperties($id);
$count = @ifx_num_fields($id);
 
if (count($flds) != $count) {
return $this->raiseError("can't distinguish duplicate field names");
}
 
if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
$case_func = 'strtolower';
} else {
$case_func = 'strval';
}
 
$i = 0;
$res = array();
 
if ($mode) {
$res['num_fields'] = $count;
}
 
foreach ($flds as $key => $value) {
$props = explode(';', $value);
$res[$i] = array(
'table' => $got_string ? $case_func($result) : '',
'name' => $case_func($key),
'type' => $props[0],
'len' => $props[1],
'flags' => $props[4] == 'N' ? 'not_null' : '',
);
if ($mode & DB_TABLEINFO_ORDER) {
$res['order'][$res[$i]['name']] = $i;
}
if ($mode & DB_TABLEINFO_ORDERTABLE) {
$res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
}
$i++;
}
 
// free the result only if we were called on a table
if ($got_string) {
@ifx_free_result($id);
}
return $res;
}
 
// }}}
// {{{ getSpecialQuery()
 
/**
* Obtains the query string needed for listing a given type of objects
*
* @param string $type the kind of objects you want to retrieve
*
* @return string the SQL query string or null if the driver doesn't
* support the object type requested
*
* @access protected
* @see DB_common::getListOf()
*/
function getSpecialQuery($type)
{
switch ($type) {
case 'tables':
return 'SELECT tabname FROM systables WHERE tabid >= 100';
default:
return null;
}
}
 
// }}}
 
}
 
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/
 
?>
/tags/Racine_livraison_narmer/api/pear/DB/common.php
New file
0,0 → 1,2157
<?php
 
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 
/**
* Contains the DB_common base class
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Database
* @package DB
* @author Stig Bakken <ssb@php.net>
* @author Tomas V.V. Cox <cox@idecnet.com>
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id: common.php,v 1.3 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/DB
*/
 
/**
* Obtain the PEAR class so it can be extended from
*/
require_once 'PEAR.php';
 
/**
* DB_common is the base class from which each database driver class extends
*
* All common methods are declared here. If a given DBMS driver contains
* a particular method, that method will overload the one here.
*
* @category Database
* @package DB
* @author Stig Bakken <ssb@php.net>
* @author Tomas V.V. Cox <cox@idecnet.com>
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version Release: 1.7.6
* @link http://pear.php.net/package/DB
*/
class DB_common extends PEAR
{
// {{{ properties
 
/**
* The current default fetch mode
* @var integer
*/
var $fetchmode = DB_FETCHMODE_ORDERED;
 
/**
* The name of the class into which results should be fetched when
* DB_FETCHMODE_OBJECT is in effect
*
* @var string
*/
var $fetchmode_object_class = 'stdClass';
 
/**
* Was a connection present when the object was serialized()?
* @var bool
* @see DB_common::__sleep(), DB_common::__wake()
*/
var $was_connected = null;
 
/**
* The most recently executed query
* @var string
*/
var $last_query = '';
 
/**
* Run-time configuration options
*
* The 'optimize' option has been deprecated. Use the 'portability'
* option instead.
*
* @var array
* @see DB_common::setOption()
*/
var $options = array(
'result_buffering' => 500,
'persistent' => false,
'ssl' => false,
'debug' => 0,
'seqname_format' => '%s_seq',
'autofree' => false,
'portability' => DB_PORTABILITY_NONE,
'optimize' => 'performance', // Deprecated. Use 'portability'.
);
 
/**
* The parameters from the most recently executed query
* @var array
* @since Property available since Release 1.7.0
*/
var $last_parameters = array();
 
/**
* The elements from each prepared statement
* @var array
*/
var $prepare_tokens = array();
 
/**
* The data types of the various elements in each prepared statement
* @var array
*/
var $prepare_types = array();
 
/**
* The prepared queries
* @var array
*/
var $prepared_queries = array();
 
 
// }}}
// {{{ DB_common
 
/**
* This constructor calls <kbd>$this->PEAR('DB_Error')</kbd>
*
* @return void
*/
function DB_common()
{
$this->PEAR('DB_Error');
}
 
// }}}
// {{{ __sleep()
 
/**
* Automatically indicates which properties should be saved
* when PHP's serialize() function is called
*
* @return array the array of properties names that should be saved
*/
function __sleep()
{
if ($this->connection) {
// Don't disconnect(), people use serialize() for many reasons
$this->was_connected = true;
} else {
$this->was_connected = false;
}
if (isset($this->autocommit)) {
return array('autocommit',
'dbsyntax',
'dsn',
'features',
'fetchmode',
'fetchmode_object_class',
'options',
'was_connected',
);
} else {
return array('dbsyntax',
'dsn',
'features',
'fetchmode',
'fetchmode_object_class',
'options',
'was_connected',
);
}
}
 
// }}}
// {{{ __wakeup()
 
/**
* Automatically reconnects to the database when PHP's unserialize()
* function is called
*
* The reconnection attempt is only performed if the object was connected
* at the time PHP's serialize() function was run.
*
* @return void
*/
function __wakeup()
{
if ($this->was_connected) {
$this->connect($this->dsn, $this->options);
}
}
 
// }}}
// {{{ __toString()
 
/**
* Automatic string conversion for PHP 5
*
* @return string a string describing the current PEAR DB object
*
* @since Method available since Release 1.7.0
*/
function __toString()
{
$info = strtolower(get_class($this));
$info .= ': (phptype=' . $this->phptype .
', dbsyntax=' . $this->dbsyntax .
')';
if ($this->connection) {
$info .= ' [connected]';
}
return $info;
}
 
// }}}
// {{{ toString()
 
/**
* DEPRECATED: String conversion method
*
* @return string a string describing the current PEAR DB object
*
* @deprecated Method deprecated in Release 1.7.0
*/
function toString()
{
return $this->__toString();
}
 
// }}}
// {{{ quoteString()
 
/**
* DEPRECATED: Quotes a string so it can be safely used within string
* delimiters in a query
*
* @param string $string the string to be quoted
*
* @return string the quoted string
*
* @see DB_common::quoteSmart(), DB_common::escapeSimple()
* @deprecated Method deprecated some time before Release 1.2
*/
function quoteString($string)
{
$string = $this->quote($string);
if ($string{0} == "'") {
return substr($string, 1, -1);
}
return $string;
}
 
// }}}
// {{{ quote()
 
/**
* DEPRECATED: Quotes a string so it can be safely used in a query
*
* @param string $string the string to quote
*
* @return string the quoted string or the string <samp>NULL</samp>
* if the value submitted is <kbd>null</kbd>.
*
* @see DB_common::quoteSmart(), DB_common::escapeSimple()
* @deprecated Deprecated in release 1.6.0
*/
function quote($string = null)
{
return ($string === null) ? 'NULL'
: "'" . str_replace("'", "''", $string) . "'";
}
 
// }}}
// {{{ quoteIdentifier()
 
/**
* Quotes a string so it can be safely used as a table or column name
*
* Delimiting style depends on which database driver is being used.
*
* NOTE: just because you CAN use delimited identifiers doesn't mean
* you SHOULD use them. In general, they end up causing way more
* problems than they solve.
*
* Portability is broken by using the following characters inside
* delimited identifiers:
* + backtick (<kbd>`</kbd>) -- due to MySQL
* + double quote (<kbd>"</kbd>) -- due to Oracle
* + brackets (<kbd>[</kbd> or <kbd>]</kbd>) -- due to Access
*
* Delimited identifiers are known to generally work correctly under
* the following drivers:
* + mssql
* + mysql
* + mysqli
* + oci8
* + odbc(access)
* + odbc(db2)
* + pgsql
* + sqlite
* + sybase (must execute <kbd>set quoted_identifier on</kbd> sometime
* prior to use)
*
* InterBase doesn't seem to be able to use delimited identifiers
* via PHP 4. They work fine under PHP 5.
*
* @param string $str the identifier name to be quoted
*
* @return string the quoted identifier
*
* @since Method available since Release 1.6.0
*/
function quoteIdentifier($str)
{
return '"' . str_replace('"', '""', $str) . '"';
}
 
// }}}
// {{{ quoteSmart()
 
/**
* Formats input so it can be safely used in a query
*
* The output depends on the PHP data type of input and the database
* type being used.
*
* @param mixed $in the data to be formatted
*
* @return mixed the formatted data. The format depends on the input's
* PHP type:
* <ul>
* <li>
* <kbd>input</kbd> -> <samp>returns</samp>
* </li>
* <li>
* <kbd>null</kbd> -> the string <samp>NULL</samp>
* </li>
* <li>
* <kbd>integer</kbd> or <kbd>double</kbd> -> the unquoted number
* </li>
* <li>
* <kbd>bool</kbd> -> output depends on the driver in use
* Most drivers return integers: <samp>1</samp> if
* <kbd>true</kbd> or <samp>0</samp> if
* <kbd>false</kbd>.
* Some return strings: <samp>TRUE</samp> if
* <kbd>true</kbd> or <samp>FALSE</samp> if
* <kbd>false</kbd>.
* Finally one returns strings: <samp>T</samp> if
* <kbd>true</kbd> or <samp>F</samp> if
* <kbd>false</kbd>. Here is a list of each DBMS,
* the values returned and the suggested column type:
* <ul>
* <li>
* <kbd>dbase</kbd> -> <samp>T/F</samp>
* (<kbd>Logical</kbd>)
* </li>
* <li>
* <kbd>fbase</kbd> -> <samp>TRUE/FALSE</samp>
* (<kbd>BOOLEAN</kbd>)
* </li>
* <li>
* <kbd>ibase</kbd> -> <samp>1/0</samp>
* (<kbd>SMALLINT</kbd>) [1]
* </li>
* <li>
* <kbd>ifx</kbd> -> <samp>1/0</samp>
* (<kbd>SMALLINT</kbd>) [1]
* </li>
* <li>
* <kbd>msql</kbd> -> <samp>1/0</samp>
* (<kbd>INTEGER</kbd>)
* </li>
* <li>
* <kbd>mssql</kbd> -> <samp>1/0</samp>
* (<kbd>BIT</kbd>)
* </li>
* <li>
* <kbd>mysql</kbd> -> <samp>1/0</samp>
* (<kbd>TINYINT(1)</kbd>)
* </li>
* <li>
* <kbd>mysqli</kbd> -> <samp>1/0</samp>
* (<kbd>TINYINT(1)</kbd>)
* </li>
* <li>
* <kbd>oci8</kbd> -> <samp>1/0</samp>
* (<kbd>NUMBER(1)</kbd>)
* </li>
* <li>
* <kbd>odbc</kbd> -> <samp>1/0</samp>
* (<kbd>SMALLINT</kbd>) [1]
* </li>
* <li>
* <kbd>pgsql</kbd> -> <samp>TRUE/FALSE</samp>
* (<kbd>BOOLEAN</kbd>)
* </li>
* <li>
* <kbd>sqlite</kbd> -> <samp>1/0</samp>
* (<kbd>INTEGER</kbd>)
* </li>
* <li>
* <kbd>sybase</kbd> -> <samp>1/0</samp>
* (<kbd>TINYINT(1)</kbd>)
* </li>
* </ul>
* [1] Accommodate the lowest common denominator because not all
* versions of have <kbd>BOOLEAN</kbd>.
* </li>
* <li>
* other (including strings and numeric strings) ->
* the data with single quotes escaped by preceeding
* single quotes, backslashes are escaped by preceeding
* backslashes, then the whole string is encapsulated
* between single quotes
* </li>
* </ul>
*
* @see DB_common::escapeSimple()
* @since Method available since Release 1.6.0
*/
function quoteSmart($in)
{
if (is_int($in) || is_double($in)) {
return $in;
} elseif (is_bool($in)) {
return $in ? 1 : 0;
} elseif (is_null($in)) {
return 'NULL';
} else {
return "'" . $this->escapeSimple($in) . "'";
}
}
 
// }}}
// {{{ escapeSimple()
 
/**
* Escapes a string according to the current DBMS's standards
*
* In SQLite, this makes things safe for inserts/updates, but may
* cause problems when performing text comparisons against columns
* containing binary data. See the
* {@link http://php.net/sqlite_escape_string PHP manual} for more info.
*
* @param string $str the string to be escaped
*
* @return string the escaped string
*
* @see DB_common::quoteSmart()
* @since Method available since Release 1.6.0
*/
function escapeSimple($str)
{
return str_replace("'", "''", $str);
}
 
// }}}
// {{{ provides()
 
/**
* Tells whether the present driver supports a given feature
*
* @param string $feature the feature you're curious about
*
* @return bool whether this driver supports $feature
*/
function provides($feature)
{
return $this->features[$feature];
}
 
// }}}
// {{{ setFetchMode()
 
/**
* Sets the fetch mode that should be used by default for query results
*
* @param integer $fetchmode DB_FETCHMODE_ORDERED, DB_FETCHMODE_ASSOC
* or DB_FETCHMODE_OBJECT
* @param string $object_class the class name of the object to be returned
* by the fetch methods when the
* DB_FETCHMODE_OBJECT mode is selected.
* If no class is specified by default a cast
* to object from the assoc array row will be
* done. There is also the posibility to use
* and extend the 'DB_row' class.
*
* @see DB_FETCHMODE_ORDERED, DB_FETCHMODE_ASSOC, DB_FETCHMODE_OBJECT
*/
function setFetchMode($fetchmode, $object_class = 'stdClass')
{
switch ($fetchmode) {
case DB_FETCHMODE_OBJECT:
$this->fetchmode_object_class = $object_class;
case DB_FETCHMODE_ORDERED:
case DB_FETCHMODE_ASSOC:
$this->fetchmode = $fetchmode;
break;
default:
return $this->raiseError('invalid fetchmode mode');
}
}
 
// }}}
// {{{ setOption()
 
/**
* Sets run-time configuration options for PEAR DB
*
* Options, their data types, default values and description:
* <ul>
* <li>
* <var>autofree</var> <kbd>boolean</kbd> = <samp>false</samp>
* <br />should results be freed automatically when there are no
* more rows?
* </li><li>
* <var>result_buffering</var> <kbd>integer</kbd> = <samp>500</samp>
* <br />how many rows of the result set should be buffered?
* <br />In mysql: mysql_unbuffered_query() is used instead of
* mysql_query() if this value is 0. (Release 1.7.0)
* <br />In oci8: this value is passed to ocisetprefetch().
* (Release 1.7.0)
* </li><li>
* <var>debug</var> <kbd>integer</kbd> = <samp>0</samp>
* <br />debug level
* </li><li>
* <var>persistent</var> <kbd>boolean</kbd> = <samp>false</samp>
* <br />should the connection be persistent?
* </li><li>
* <var>portability</var> <kbd>integer</kbd> = <samp>DB_PORTABILITY_NONE</samp>
* <br />portability mode constant (see below)
* </li><li>
* <var>seqname_format</var> <kbd>string</kbd> = <samp>%s_seq</samp>
* <br />the sprintf() format string used on sequence names. This
* format is applied to sequence names passed to
* createSequence(), nextID() and dropSequence().
* </li><li>
* <var>ssl</var> <kbd>boolean</kbd> = <samp>false</samp>
* <br />use ssl to connect?
* </li>
* </ul>
*
* -----------------------------------------
*
* PORTABILITY MODES
*
* These modes are bitwised, so they can be combined using <kbd>|</kbd>
* and removed using <kbd>^</kbd>. See the examples section below on how
* to do this.
*
* <samp>DB_PORTABILITY_NONE</samp>
* turn off all portability features
*
* This mode gets automatically turned on if the deprecated
* <var>optimize</var> option gets set to <samp>performance</samp>.
*
*
* <samp>DB_PORTABILITY_LOWERCASE</samp>
* convert names of tables and fields to lower case when using
* <kbd>get*()</kbd>, <kbd>fetch*()</kbd> and <kbd>tableInfo()</kbd>
*
* This mode gets automatically turned on in the following databases
* if the deprecated option <var>optimize</var> gets set to
* <samp>portability</samp>:
* + oci8
*
*
* <samp>DB_PORTABILITY_RTRIM</samp>
* right trim the data output by <kbd>get*()</kbd> <kbd>fetch*()</kbd>
*
*
* <samp>DB_PORTABILITY_DELETE_COUNT</samp>
* force reporting the number of rows deleted
*
* Some DBMS's don't count the number of rows deleted when performing
* simple <kbd>DELETE FROM tablename</kbd> queries. This portability
* mode tricks such DBMS's into telling the count by adding
* <samp>WHERE 1=1</samp> to the end of <kbd>DELETE</kbd> queries.
*
* This mode gets automatically turned on in the following databases
* if the deprecated option <var>optimize</var> gets set to
* <samp>portability</samp>:
* + fbsql
* + mysql
* + mysqli
* + sqlite
*
*
* <samp>DB_PORTABILITY_NUMROWS</samp>
* enable hack that makes <kbd>numRows()</kbd> work in Oracle
*
* This mode gets automatically turned on in the following databases
* if the deprecated option <var>optimize</var> gets set to
* <samp>portability</samp>:
* + oci8
*
*
* <samp>DB_PORTABILITY_ERRORS</samp>
* makes certain error messages in certain drivers compatible
* with those from other DBMS's
*
* + mysql, mysqli: change unique/primary key constraints
* DB_ERROR_ALREADY_EXISTS -> DB_ERROR_CONSTRAINT
*
* + odbc(access): MS's ODBC driver reports 'no such field' as code
* 07001, which means 'too few parameters.' When this option is on
* that code gets mapped to DB_ERROR_NOSUCHFIELD.
* DB_ERROR_MISMATCH -> DB_ERROR_NOSUCHFIELD
*
* <samp>DB_PORTABILITY_NULL_TO_EMPTY</samp>
* convert null values to empty strings in data output by get*() and
* fetch*(). Needed because Oracle considers empty strings to be null,
* while most other DBMS's know the difference between empty and null.
*
*
* <samp>DB_PORTABILITY_ALL</samp>
* turn on all portability features
*
* -----------------------------------------
*
* Example 1. Simple setOption() example
* <code>
* $db->setOption('autofree', true);
* </code>
*
* Example 2. Portability for lowercasing and trimming
* <code>
* $db->setOption('portability',
* DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_RTRIM);
* </code>
*
* Example 3. All portability options except trimming
* <code>
* $db->setOption('portability',
* DB_PORTABILITY_ALL ^ DB_PORTABILITY_RTRIM);
* </code>
*
* @param string $option option name
* @param mixed $value value for the option
*
* @return int DB_OK on success. A DB_Error object on failure.
*
* @see DB_common::$options
*/
function setOption($option, $value)
{
if (isset($this->options[$option])) {
$this->options[$option] = $value;
 
/*
* Backwards compatibility check for the deprecated 'optimize'
* option. Done here in case settings change after connecting.
*/
if ($option == 'optimize') {
if ($value == 'portability') {
switch ($this->phptype) {
case 'oci8':
$this->options['portability'] =
DB_PORTABILITY_LOWERCASE |
DB_PORTABILITY_NUMROWS;
break;
case 'fbsql':
case 'mysql':
case 'mysqli':
case 'sqlite':
$this->options['portability'] =
DB_PORTABILITY_DELETE_COUNT;
break;
}
} else {
$this->options['portability'] = DB_PORTABILITY_NONE;
}
}
 
return DB_OK;
}
return $this->raiseError("unknown option $option");
}
 
// }}}
// {{{ getOption()
 
/**
* Returns the value of an option
*
* @param string $option the option name you're curious about
*
* @return mixed the option's value
*/
function getOption($option)
{
if (isset($this->options[$option])) {
return $this->options[$option];
}
return $this->raiseError("unknown option $option");
}
 
// }}}
// {{{ prepare()
 
/**
* Prepares a query for multiple execution with execute()
*
* Creates a query that can be run multiple times. Each time it is run,
* the placeholders, if any, will be replaced by the contents of
* execute()'s $data argument.
*
* Three types of placeholders can be used:
* + <kbd>?</kbd> scalar value (i.e. strings, integers). The system
* will automatically quote and escape the data.
* + <kbd>!</kbd> value is inserted 'as is'
* + <kbd>&</kbd> requires a file name. The file's contents get
* inserted into the query (i.e. saving binary
* data in a db)
*
* Example 1.
* <code>
* $sth = $db->prepare('INSERT INTO tbl (a, b, c) VALUES (?, !, &)');
* $data = array(
* "John's text",
* "'it''s good'",
* 'filename.txt'
* );
* $res = $db->execute($sth, $data);
* </code>
*
* Use backslashes to escape placeholder characters if you don't want
* them to be interpreted as placeholders:
* <pre>
* "UPDATE foo SET col=? WHERE col='over \& under'"
* </pre>
*
* With some database backends, this is emulated.
*
* {@internal ibase and oci8 have their own prepare() methods.}}
*
* @param string $query the query to be prepared
*
* @return mixed DB statement resource on success. A DB_Error object
* on failure.
*
* @see DB_common::execute()
*/
function prepare($query)
{
$tokens = preg_split('/((?<!\\\)[&?!])/', $query, -1,
PREG_SPLIT_DELIM_CAPTURE);
$token = 0;
$types = array();
$newtokens = array();
 
foreach ($tokens as $val) {
switch ($val) {
case '?':
$types[$token++] = DB_PARAM_SCALAR;
break;
case '&':
$types[$token++] = DB_PARAM_OPAQUE;
break;
case '!':
$types[$token++] = DB_PARAM_MISC;
break;
default:
$newtokens[] = preg_replace('/\\\([&?!])/', "\\1", $val);
}
}
 
$this->prepare_tokens[] = &$newtokens;
end($this->prepare_tokens);
 
$k = key($this->prepare_tokens);
$this->prepare_types[$k] = $types;
$this->prepared_queries[$k] = implode(' ', $newtokens);
 
return $k;
}
 
// }}}
// {{{ autoPrepare()
 
/**
* Automaticaly generates an insert or update query and pass it to prepare()
*
* @param string $table the table name
* @param array $table_fields the array of field names
* @param int $mode a type of query to make:
* DB_AUTOQUERY_INSERT or DB_AUTOQUERY_UPDATE
* @param string $where for update queries: the WHERE clause to
* append to the SQL statement. Don't
* include the "WHERE" keyword.
*
* @return resource the query handle
*
* @uses DB_common::prepare(), DB_common::buildManipSQL()
*/
function autoPrepare($table, $table_fields, $mode = DB_AUTOQUERY_INSERT,
$where = false)
{
$query = $this->buildManipSQL($table, $table_fields, $mode, $where);
if (DB::isError($query)) {
return $query;
}
return $this->prepare($query);
}
 
// }}}
// {{{ autoExecute()
 
/**
* Automaticaly generates an insert or update query and call prepare()
* and execute() with it
*
* @param string $table the table name
* @param array $fields_values the associative array where $key is a
* field name and $value its value
* @param int $mode a type of query to make:
* DB_AUTOQUERY_INSERT or DB_AUTOQUERY_UPDATE
* @param string $where for update queries: the WHERE clause to
* append to the SQL statement. Don't
* include the "WHERE" keyword.
*
* @return mixed a new DB_result object for successful SELECT queries
* or DB_OK for successul data manipulation queries.
* A DB_Error object on failure.
*
* @uses DB_common::autoPrepare(), DB_common::execute()
*/
function autoExecute($table, $fields_values, $mode = DB_AUTOQUERY_INSERT,
$where = false)
{
$sth = $this->autoPrepare($table, array_keys($fields_values), $mode,
$where);
if (DB::isError($sth)) {
return $sth;
}
$ret =& $this->execute($sth, array_values($fields_values));
$this->freePrepared($sth);
return $ret;
 
}
 
// }}}
// {{{ buildManipSQL()
 
/**
* Produces an SQL query string for autoPrepare()
*
* Example:
* <pre>
* buildManipSQL('table_sql', array('field1', 'field2', 'field3'),
* DB_AUTOQUERY_INSERT);
* </pre>
*
* That returns
* <samp>
* INSERT INTO table_sql (field1,field2,field3) VALUES (?,?,?)
* </samp>
*
* NOTES:
* - This belongs more to a SQL Builder class, but this is a simple
* facility.
* - Be carefull! If you don't give a $where param with an UPDATE
* query, all the records of the table will be updated!
*
* @param string $table the table name
* @param array $table_fields the array of field names
* @param int $mode a type of query to make:
* DB_AUTOQUERY_INSERT or DB_AUTOQUERY_UPDATE
* @param string $where for update queries: the WHERE clause to
* append to the SQL statement. Don't
* include the "WHERE" keyword.
*
* @return string the sql query for autoPrepare()
*/
function buildManipSQL($table, $table_fields, $mode, $where = false)
{
if (count($table_fields) == 0) {
return $this->raiseError(DB_ERROR_NEED_MORE_DATA);
}
$first = true;
switch ($mode) {
case DB_AUTOQUERY_INSERT:
$values = '';
$names = '';
foreach ($table_fields as $value) {
if ($first) {
$first = false;
} else {
$names .= ',';
$values .= ',';
}
$names .= $value;
$values .= '?';
}
return "INSERT INTO $table ($names) VALUES ($values)";
case DB_AUTOQUERY_UPDATE:
$set = '';
foreach ($table_fields as $value) {
if ($first) {
$first = false;
} else {
$set .= ',';
}
$set .= "$value = ?";
}
$sql = "UPDATE $table SET $set";
if ($where) {
$sql .= " WHERE $where";
}
return $sql;
default:
return $this->raiseError(DB_ERROR_SYNTAX);
}
}
 
// }}}
// {{{ execute()
 
/**
* Executes a DB statement prepared with prepare()
*
* Example 1.
* <code>
* $sth = $db->prepare('INSERT INTO tbl (a, b, c) VALUES (?, !, &)');
* $data = array(
* "John's text",
* "'it''s good'",
* 'filename.txt'
* );
* $res =& $db->execute($sth, $data);
* </code>
*
* @param resource $stmt a DB statement resource returned from prepare()
* @param mixed $data array, string or numeric data to be used in
* execution of the statement. Quantity of items
* passed must match quantity of placeholders in
* query: meaning 1 placeholder for non-array
* parameters or 1 placeholder per array element.
*
* @return mixed a new DB_result object for successful SELECT queries
* or DB_OK for successul data manipulation queries.
* A DB_Error object on failure.
*
* {@internal ibase and oci8 have their own execute() methods.}}
*
* @see DB_common::prepare()
*/
function &execute($stmt, $data = array())
{
$realquery = $this->executeEmulateQuery($stmt, $data);
if (DB::isError($realquery)) {
return $realquery;
}
$result = $this->simpleQuery($realquery);
 
if ($result === DB_OK || DB::isError($result)) {
return $result;
} else {
$tmp =& new DB_result($this, $result);
return $tmp;
}
}
 
// }}}
// {{{ executeEmulateQuery()
 
/**
* Emulates executing prepared statements if the DBMS not support them
*
* @param resource $stmt a DB statement resource returned from execute()
* @param mixed $data array, string or numeric data to be used in
* execution of the statement. Quantity of items
* passed must match quantity of placeholders in
* query: meaning 1 placeholder for non-array
* parameters or 1 placeholder per array element.
*
* @return mixed a string containing the real query run when emulating
* prepare/execute. A DB_Error object on failure.
*
* @access protected
* @see DB_common::execute()
*/
function executeEmulateQuery($stmt, $data = array())
{
$stmt = (int)$stmt;
$data = (array)$data;
$this->last_parameters = $data;
 
if (count($this->prepare_types[$stmt]) != count($data)) {
$this->last_query = $this->prepared_queries[$stmt];
return $this->raiseError(DB_ERROR_MISMATCH);
}
 
$realquery = $this->prepare_tokens[$stmt][0];
 
$i = 0;
foreach ($data as $value) {
if ($this->prepare_types[$stmt][$i] == DB_PARAM_SCALAR) {
$realquery .= $this->quoteSmart($value);
} elseif ($this->prepare_types[$stmt][$i] == DB_PARAM_OPAQUE) {
$fp = @fopen($value, 'rb');
if (!$fp) {
return $this->raiseError(DB_ERROR_ACCESS_VIOLATION);
}
$realquery .= $this->quoteSmart(fread($fp, filesize($value)));
fclose($fp);
} else {
$realquery .= $value;
}
 
$realquery .= $this->prepare_tokens[$stmt][++$i];
}
 
return $realquery;
}
 
// }}}
// {{{ executeMultiple()
 
/**
* Performs several execute() calls on the same statement handle
*
* $data must be an array indexed numerically
* from 0, one execute call is done for every "row" in the array.
*
* If an error occurs during execute(), executeMultiple() does not
* execute the unfinished rows, but rather returns that error.
*
* @param resource $stmt query handle from prepare()
* @param array $data numeric array containing the
* data to insert into the query
*
* @return int DB_OK on success. A DB_Error object on failure.
*
* @see DB_common::prepare(), DB_common::execute()
*/
function executeMultiple($stmt, $data)
{
foreach ($data as $value) {
$res =& $this->execute($stmt, $value);
if (DB::isError($res)) {
return $res;
}
}
return DB_OK;
}
 
// }}}
// {{{ freePrepared()
 
/**
* Frees the internal resources associated with a prepared query
*
* @param resource $stmt the prepared statement's PHP resource
* @param bool $free_resource should the PHP resource be freed too?
* Use false if you need to get data
* from the result set later.
*
* @return bool TRUE on success, FALSE if $result is invalid
*
* @see DB_common::prepare()
*/
function freePrepared($stmt, $free_resource = true)
{
$stmt = (int)$stmt;
if (isset($this->prepare_tokens[$stmt])) {
unset($this->prepare_tokens[$stmt]);
unset($this->prepare_types[$stmt]);
unset($this->prepared_queries[$stmt]);
return true;
}
return false;
}
 
// }}}
// {{{ modifyQuery()
 
/**
* Changes a query string for various DBMS specific reasons
*
* It is defined here to ensure all drivers have this method available.
*
* @param string $query the query string to modify
*
* @return string the modified query string
*
* @access protected
* @see DB_mysql::modifyQuery(), DB_oci8::modifyQuery(),
* DB_sqlite::modifyQuery()
*/
function modifyQuery($query)
{
return $query;
}
 
// }}}
// {{{ modifyLimitQuery()
 
/**
* Adds LIMIT clauses to a query string according to current DBMS standards
*
* It is defined here to assure that all implementations
* have this method defined.
*
* @param string $query the query to modify
* @param int $from the row to start to fetching (0 = the first row)
* @param int $count the numbers of rows to fetch
* @param mixed $params array, string or numeric data to be used in
* execution of the statement. Quantity of items
* passed must match quantity of placeholders in
* query: meaning 1 placeholder for non-array
* parameters or 1 placeholder per array element.
*
* @return string the query string with LIMIT clauses added
*
* @access protected
*/
function modifyLimitQuery($query, $from, $count, $params = array())
{
return $query;
}
 
// }}}
// {{{ query()
 
/**
* Sends a query to the database server
*
* The query string can be either a normal statement to be sent directly
* to the server OR if <var>$params</var> are passed the query can have
* placeholders and it will be passed through prepare() and execute().
*
* @param string $query the SQL query or the statement to prepare
* @param mixed $params array, string or numeric data to be used in
* execution of the statement. Quantity of items
* passed must match quantity of placeholders in
* query: meaning 1 placeholder for non-array
* parameters or 1 placeholder per array element.
*
* @return mixed a new DB_result object for successful SELECT queries
* or DB_OK for successul data manipulation queries.
* A DB_Error object on failure.
*
* @see DB_result, DB_common::prepare(), DB_common::execute()
*/
function &query($query, $params = array())
{
if (sizeof($params) > 0) {
$sth = $this->prepare($query);
if (DB::isError($sth)) {
return $sth;
}
$ret =& $this->execute($sth, $params);
$this->freePrepared($sth, false);
return $ret;
} else {
$this->last_parameters = array();
$result = $this->simpleQuery($query);
if ($result === DB_OK || DB::isError($result)) {
return $result;
} else {
$tmp =& new DB_result($this, $result);
return $tmp;
}
}
}
 
// }}}
// {{{ limitQuery()
 
/**
* Generates and executes a LIMIT query
*
* @param string $query the query
* @param intr $from the row to start to fetching (0 = the first row)
* @param int $count the numbers of rows to fetch
* @param mixed $params array, string or numeric data to be used in
* execution of the statement. Quantity of items
* passed must match quantity of placeholders in
* query: meaning 1 placeholder for non-array
* parameters or 1 placeholder per array element.
*
* @return mixed a new DB_result object for successful SELECT queries
* or DB_OK for successul data manipulation queries.
* A DB_Error object on failure.
*/
function &limitQuery($query, $from, $count, $params = array())
{
$query = $this->modifyLimitQuery($query, $from, $count, $params);
if (DB::isError($query)){
return $query;
}
$result =& $this->query($query, $params);
if (is_a($result, 'DB_result')) {
$result->setOption('limit_from', $from);
$result->setOption('limit_count', $count);
}
return $result;
}
 
// }}}
// {{{ getOne()
 
/**
* Fetches the first column of the first row from a query result
*
* Takes care of doing the query and freeing the results when finished.
*
* @param string $query the SQL query
* @param mixed $params array, string or numeric data to be used in
* execution of the statement. Quantity of items
* passed must match quantity of placeholders in
* query: meaning 1 placeholder for non-array
* parameters or 1 placeholder per array element.
*
* @return mixed the returned value of the query.
* A DB_Error object on failure.
*/
function &getOne($query, $params = array())
{
$params = (array)$params;
// modifyLimitQuery() would be nice here, but it causes BC issues
if (sizeof($params) > 0) {
$sth = $this->prepare($query);
if (DB::isError($sth)) {
return $sth;
}
$res =& $this->execute($sth, $params);
$this->freePrepared($sth);
} else {
$res =& $this->query($query);
}
 
if (DB::isError($res)) {
return $res;
}
 
$err = $res->fetchInto($row, DB_FETCHMODE_ORDERED);
$res->free();
 
if ($err !== DB_OK) {
return $err;
}
 
return $row[0];
}
 
// }}}
// {{{ getRow()
 
/**
* Fetches the first row of data returned from a query result
*
* Takes care of doing the query and freeing the results when finished.
*
* @param string $query the SQL query
* @param mixed $params array, string or numeric data to be used in
* execution of the statement. Quantity of items
* passed must match quantity of placeholders in
* query: meaning 1 placeholder for non-array
* parameters or 1 placeholder per array element.
* @param int $fetchmode the fetch mode to use
*
* @return array the first row of results as an array.
* A DB_Error object on failure.
*/
function &getRow($query, $params = array(),
$fetchmode = DB_FETCHMODE_DEFAULT)
{
// compat check, the params and fetchmode parameters used to
// have the opposite order
if (!is_array($params)) {
if (is_array($fetchmode)) {
if ($params === null) {
$tmp = DB_FETCHMODE_DEFAULT;
} else {
$tmp = $params;
}
$params = $fetchmode;
$fetchmode = $tmp;
} elseif ($params !== null) {
$fetchmode = $params;
$params = array();
}
}
// modifyLimitQuery() would be nice here, but it causes BC issues
if (sizeof($params) > 0) {
$sth = $this->prepare($query);
if (DB::isError($sth)) {
return $sth;
}
$res =& $this->execute($sth, $params);
$this->freePrepared($sth);
} else {
$res =& $this->query($query);
}
 
if (DB::isError($res)) {
return $res;
}
 
$err = $res->fetchInto($row, $fetchmode);
 
$res->free();
 
if ($err !== DB_OK) {
return $err;
}
 
return $row;
}
 
// }}}
// {{{ getCol()
 
/**
* Fetches a single column from a query result and returns it as an
* indexed array
*
* @param string $query the SQL query
* @param mixed $col which column to return (integer [column number,
* starting at 0] or string [column name])
* @param mixed $params array, string or numeric data to be used in
* execution of the statement. Quantity of items
* passed must match quantity of placeholders in
* query: meaning 1 placeholder for non-array
* parameters or 1 placeholder per array element.
*
* @return array the results as an array. A DB_Error object on failure.
*
* @see DB_common::query()
*/
function &getCol($query, $col = 0, $params = array())
{
$params = (array)$params;
if (sizeof($params) > 0) {
$sth = $this->prepare($query);
 
if (DB::isError($sth)) {
return $sth;
}
 
$res =& $this->execute($sth, $params);
$this->freePrepared($sth);
} else {
$res =& $this->query($query);
}
 
if (DB::isError($res)) {
return $res;
}
 
$fetchmode = is_int($col) ? DB_FETCHMODE_ORDERED : DB_FETCHMODE_ASSOC;
 
if (!is_array($row = $res->fetchRow($fetchmode))) {
$ret = array();
} else {
if (!array_key_exists($col, $row)) {
$ret =& $this->raiseError(DB_ERROR_NOSUCHFIELD);
} else {
$ret = array($row[$col]);
while (is_array($row = $res->fetchRow($fetchmode))) {
$ret[] = $row[$col];
}
}
}
 
$res->free();
 
if (DB::isError($row)) {
$ret = $row;
}
 
return $ret;
}
 
// }}}
// {{{ getAssoc()
 
/**
* Fetches an entire query result and returns it as an
* associative array using the first column as the key
*
* If the result set contains more than two columns, the value
* will be an array of the values from column 2-n. If the result
* set contains only two columns, the returned value will be a
* scalar with the value of the second column (unless forced to an
* array with the $force_array parameter). A DB error code is
* returned on errors. If the result set contains fewer than two
* columns, a DB_ERROR_TRUNCATED error is returned.
*
* For example, if the table "mytable" contains:
*
* <pre>
* ID TEXT DATE
* --------------------------------
* 1 'one' 944679408
* 2 'two' 944679408
* 3 'three' 944679408
* </pre>
*
* Then the call getAssoc('SELECT id,text FROM mytable') returns:
* <pre>
* array(
* '1' => 'one',
* '2' => 'two',
* '3' => 'three',
* )
* </pre>
*
* ...while the call getAssoc('SELECT id,text,date FROM mytable') returns:
* <pre>
* array(
* '1' => array('one', '944679408'),
* '2' => array('two', '944679408'),
* '3' => array('three', '944679408')
* )
* </pre>
*
* If the more than one row occurs with the same value in the
* first column, the last row overwrites all previous ones by
* default. Use the $group parameter if you don't want to
* overwrite like this. Example:
*
* <pre>
* getAssoc('SELECT category,id,name FROM mytable', false, null,
* DB_FETCHMODE_ASSOC, true) returns:
*
* array(
* '1' => array(array('id' => '4', 'name' => 'number four'),
* array('id' => '6', 'name' => 'number six')
* ),
* '9' => array(array('id' => '4', 'name' => 'number four'),
* array('id' => '6', 'name' => 'number six')
* )
* )
* </pre>
*
* Keep in mind that database functions in PHP usually return string
* values for results regardless of the database's internal type.
*
* @param string $query the SQL query
* @param bool $force_array used only when the query returns
* exactly two columns. If true, the values
* of the returned array will be one-element
* arrays instead of scalars.
* @param mixed $params array, string or numeric data to be used in
* execution of the statement. Quantity of
* items passed must match quantity of
* placeholders in query: meaning 1
* placeholder for non-array parameters or
* 1 placeholder per array element.
* @param int $fetchmode the fetch mode to use
* @param bool $group if true, the values of the returned array
* is wrapped in another array. If the same
* key value (in the first column) repeats
* itself, the values will be appended to
* this array instead of overwriting the
* existing values.
*
* @return array the associative array containing the query results.
* A DB_Error object on failure.
*/
function &getAssoc($query, $force_array = false, $params = array(),
$fetchmode = DB_FETCHMODE_DEFAULT, $group = false)
{
$params = (array)$params;
if (sizeof($params) > 0) {
$sth = $this->prepare($query);
 
if (DB::isError($sth)) {
return $sth;
}
 
$res =& $this->execute($sth, $params);
$this->freePrepared($sth);
} else {
$res =& $this->query($query);
}
 
if (DB::isError($res)) {
return $res;
}
if ($fetchmode == DB_FETCHMODE_DEFAULT) {
$fetchmode = $this->fetchmode;
}
$cols = $res->numCols();
 
if ($cols < 2) {
$tmp =& $this->raiseError(DB_ERROR_TRUNCATED);
return $tmp;
}
 
$results = array();
 
if ($cols > 2 || $force_array) {
// return array values
// XXX this part can be optimized
if ($fetchmode == DB_FETCHMODE_ASSOC) {
while (is_array($row = $res->fetchRow(DB_FETCHMODE_ASSOC))) {
reset($row);
$key = current($row);
unset($row[key($row)]);
if ($group) {
$results[$key][] = $row;
} else {
$results[$key] = $row;
}
}
} elseif ($fetchmode == DB_FETCHMODE_OBJECT) {
while ($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) {
$arr = get_object_vars($row);
$key = current($arr);
if ($group) {
$results[$key][] = $row;
} else {
$results[$key] = $row;
}
}
} else {
while (is_array($row = $res->fetchRow(DB_FETCHMODE_ORDERED))) {
// we shift away the first element to get
// indices running from 0 again
$key = array_shift($row);
if ($group) {
$results[$key][] = $row;
} else {
$results[$key] = $row;
}
}
}
if (DB::isError($row)) {
$results = $row;
}
} else {
// return scalar values
while (is_array($row = $res->fetchRow(DB_FETCHMODE_ORDERED))) {
if ($group) {
$results[$row[0]][] = $row[1];
} else {
$results[$row[0]] = $row[1];
}
}
if (DB::isError($row)) {
$results = $row;
}
}
 
$res->free();
 
return $results;
}
 
// }}}
// {{{ getAll()
 
/**
* Fetches all of the rows from a query result
*
* @param string $query the SQL query
* @param mixed $params array, string or numeric data to be used in
* execution of the statement. Quantity of
* items passed must match quantity of
* placeholders in query: meaning 1
* placeholder for non-array parameters or
* 1 placeholder per array element.
* @param int $fetchmode the fetch mode to use:
* + DB_FETCHMODE_ORDERED
* + DB_FETCHMODE_ASSOC
* + DB_FETCHMODE_ORDERED | DB_FETCHMODE_FLIPPED
* + DB_FETCHMODE_ASSOC | DB_FETCHMODE_FLIPPED
*
* @return array the nested array. A DB_Error object on failure.
*/
function &getAll($query, $params = array(),
$fetchmode = DB_FETCHMODE_DEFAULT)
{
// compat check, the params and fetchmode parameters used to
// have the opposite order
if (!is_array($params)) {
if (is_array($fetchmode)) {
if ($params === null) {
$tmp = DB_FETCHMODE_DEFAULT;
} else {
$tmp = $params;
}
$params = $fetchmode;
$fetchmode = $tmp;
} elseif ($params !== null) {
$fetchmode = $params;
$params = array();
}
}
 
if (sizeof($params) > 0) {
$sth = $this->prepare($query);
 
if (DB::isError($sth)) {
return $sth;
}
 
$res =& $this->execute($sth, $params);
$this->freePrepared($sth);
} else {
$res =& $this->query($query);
}
 
if ($res === DB_OK || DB::isError($res)) {
return $res;
}
 
$results = array();
while (DB_OK === $res->fetchInto($row, $fetchmode)) {
if ($fetchmode & DB_FETCHMODE_FLIPPED) {
foreach ($row as $key => $val) {
$results[$key][] = $val;
}
} else {
$results[] = $row;
}
}
 
$res->free();
 
if (DB::isError($row)) {
$tmp =& $this->raiseError($row);
return $tmp;
}
return $results;
}
 
// }}}
// {{{ autoCommit()
 
/**
* Enables or disables automatic commits
*
* @param bool $onoff true turns it on, false turns it off
*
* @return int DB_OK on success. A DB_Error object if the driver
* doesn't support auto-committing transactions.
*/
function autoCommit($onoff = false)
{
return $this->raiseError(DB_ERROR_NOT_CAPABLE);
}
 
// }}}
// {{{ commit()
 
/**
* Commits the current transaction
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function commit()
{
return $this->raiseError(DB_ERROR_NOT_CAPABLE);
}
 
// }}}
// {{{ rollback()
 
/**
* Reverts the current transaction
*
* @return int DB_OK on success. A DB_Error object on failure.
*/
function rollback()
{
return $this->raiseError(DB_ERROR_NOT_CAPABLE);
}
 
// }}}
// {{{ numRows()
 
/**
* Determines the number of rows in a query result
*
* @param resource $result the query result idenifier produced by PHP
*
* @return int the number of rows. A DB_Error object on failure.
*/
function numRows($result)
{
return $this->raiseError(DB_ERROR_NOT_CAPABLE);
}
 
// }}}
// {{{ affectedRows()
 
/**
* Determines the number of rows affected by a data maniuplation query
*
* 0 is returned for queries that don't manipulate data.
*
* @return int the number of rows. A DB_Error object on failure.
*/
function affectedRows()
{
return $this->raiseError(DB_ERROR_NOT_CAPABLE);
}
 
// }}}
// {{{ getSequenceName()
 
/**
* Generates the name used inside the database for a sequence
*
* The createSequence() docblock contains notes about storing sequence
* names.
*
* @param string $sqn the sequence's public name
*
* @return string the sequence's name in the backend
*
* @access protected
* @see DB_common::createSequence(), DB_common::dropSequence(),
* DB_common::nextID(), DB_common::setOption()
*/
function getSequenceName($sqn)
{
return sprintf($this->getOption('seqname_format'),
preg_replace('/[^a-z0-9_.]/i', '_', $sqn));
}
 
// }}}
// {{{ nextId()
 
/**
* Returns the next free id in a sequence
*
* @param string $seq_name name of the sequence
* @param boolean $ondemand when true, the seqence is automatically
* created if it does not exist
*
* @return int the next id number in the sequence.
* A DB_Error object on failure.
*
* @see DB_common::createSequence(), DB_common::dropSequence(),
* DB_common::getSequenceName()
*/
function nextId($seq_name, $ondemand = true)
{
return $this->raiseError(DB_ERROR_NOT_CAPABLE);
}
 
// }}}
// {{{ createSequence()
 
/**
* Creates a new sequence
*
* The name of a given sequence is determined by passing the string
* provided in the <var>$seq_name</var> argument through PHP's sprintf()
* function using the value from the <var>seqname_format</var> option as
* the sprintf()'s format argument.
*
* <var>seqname_format</var> is set via setOption().
*
* @param string $seq_name name of the new sequence
*
* @return int DB_OK on success. A DB_Error object on failure.
*
* @see DB_common::dropSequence(), DB_common::getSequenceName(),
* DB_common::nextID()
*/
function createSequence($seq_name)
{
return $this->raiseError(DB_ERROR_NOT_CAPABLE);
}
 
// }}}
// {{{ dropSequence()
 
/**
* Deletes a sequence
*
* @param string $seq_name name of the sequence to be deleted
*
* @return int DB_OK on success. A DB_Error object on failure.
*
* @see DB_common::createSequence(), DB_common::getSequenceName(),
* DB_common::nextID()
*/
function dropSequence($seq_name)
{
return $this->raiseError(DB_ERROR_NOT_CAPABLE);
}
 
// }}}
// {{{ raiseError()
 
/**
* Communicates an error and invoke error callbacks, etc
*
* Basically a wrapper for PEAR::raiseError without the message string.
*
* @param mixed integer error code, or a PEAR error object (all
* other parameters are ignored if this parameter is
* an object
* @param int error mode, see PEAR_Error docs
* @param mixed if error mode is PEAR_ERROR_TRIGGER, this is the
* error level (E_USER_NOTICE etc). If error mode is
* PEAR_ERROR_CALLBACK, this is the callback function,
* either as a function name, or as an array of an
* object and method name. For other error modes this
* parameter is ignored.
* @param string extra debug information. Defaults to the last
* query and native error code.
* @param mixed native error code, integer or string depending the
* backend
*
* @return object the PEAR_Error object
*
* @see PEAR_Error
*/
function &raiseError($code = DB_ERROR, $mode = null, $options = null,
$userinfo = null, $nativecode = null)
{
// The error is yet a DB error object
if (is_object($code)) {
// because we the static PEAR::raiseError, our global
// handler should be used if it is set
if ($mode === null && !empty($this->_default_error_mode)) {
$mode = $this->_default_error_mode;
$options = $this->_default_error_options;
}
$tmp = PEAR::raiseError($code, null, $mode, $options,
null, null, true);
return $tmp;
}
 
if ($userinfo === null) {
$userinfo = $this->last_query;
}
 
if ($nativecode) {
$userinfo .= ' [nativecode=' . trim($nativecode) . ']';
} else {
$userinfo .= ' [DB Error: ' . DB::errorMessage($code) . ']';
}
 
$tmp = PEAR::raiseError(null, $code, $mode, $options, $userinfo,
'DB_Error', true);
return $tmp;
}
 
// }}}
// {{{ errorNative()
 
/**
* Gets the DBMS' native error code produced by the last query
*
* @return mixed the DBMS' error code. A DB_Error object on failure.
*/
function errorNative()
{
return $this->raiseError(DB_ERROR_NOT_CAPABLE);
}
 
// }}}
// {{{ errorCode()
 
/**
* Maps native error codes to DB's portable ones
*
* Uses the <var>$errorcode_map</var> property defined in each driver.
*
* @param string|int $nativecode the error code returned by the DBMS
*
* @return int the portable DB error code. Return DB_ERROR if the
* current driver doesn't have a mapping for the
* $nativecode submitted.
*/
function errorCode($nativecode)
{
if (isset($this->errorcode_map[$nativecode])) {
return $this->errorcode_map[$nativecode];
}
// Fall back to DB_ERROR if there was no mapping.
return DB_ERROR;
}
 
// }}}
// {{{ errorMessage()
 
/**
* Maps a DB error code to a textual message
*
* @param integer $dbcode the DB error code
*
* @return string the error message corresponding to the error code
* submitted. FALSE if the error code is unknown.
*
* @see DB::errorMessage()
*/
function errorMessage($dbcode)
{
return DB::errorMessage($this->errorcode_map[$dbcode]);
}
 
// }}}
// {{{ tableInfo()
 
/**
* Returns information about a table or a result set
*
* The format of the resulting array depends on which <var>$mode</var>
* you select. The sample output below is based on this query:
* <pre>
* SELECT tblFoo.fldID, tblFoo.fldPhone, tblBar.fldId
* FROM tblFoo
* JOIN tblBar ON tblFoo.fldId = tblBar.fldId
* </pre>
*
* <ul>
* <li>
*
* <kbd>null</kbd> (default)
* <pre>
* [0] => Array (
* [table] => tblFoo
* [name] => fldId
* [type] => int
* [len] => 11
* [flags] => primary_key not_null
* )
* [1] => Array (
* [table] => tblFoo
* [name] => fldPhone
* [type] => string
* [len] => 20
* [flags] =>
* )
* [2] => Array (
* [table] => tblBar
* [name] => fldId
* [type] => int
* [len] => 11
* [flags] => primary_key not_null
* )
* </pre>
*
* </li><li>
*
* <kbd>DB_TABLEINFO_ORDER</kbd>
*
* <p>In addition to the information found in the default output,
* a notation of the number of columns is provided by the
* <samp>num_fields</samp> element while the <samp>order</samp>
* element provides an array with the column names as the keys and
* their location index number (corresponding to the keys in the
* the default output) as the values.</p>
*
* <p>If a result set has identical field names, the last one is
* used.</p>
*
* <pre>
* [num_fields] => 3
* [order] => Array (
* [fldId] => 2
* [fldTrans] => 1
* )
* </pre>
*
* </li><li>
*
* <kbd>DB_TABLEINFO_ORDERTABLE</kbd>
*
* <p>Similar to <kbd>DB_TABLEINFO_ORDER</kbd> but adds more
* dimensions to the array in which the table names are keys and
* the field names are sub-keys. This is helpful for queries that
* join tables which have identical field names.</p>
*
* <pre>
* [num_fields] => 3
* [ordertable] => Array (
* [tblFoo] => Array (
* [fldId] => 0
* [fldPhone] => 1
* )
* [tblBar] => Array (
* [fldId] => 2
* )
* )
* </pre>
*
* </li>
* </ul>
*
* The <samp>flags</samp> element contains a space separated list
* of extra information about the field. This data is inconsistent
* between DBMS's due to the way each DBMS works.
* + <samp>primary_key</samp>
* + <samp>unique_key</samp>
* + <samp>multiple_key</samp>
* + <samp>not_null</samp>
*
* Most DBMS's only provide the <samp>table</samp> and <samp>flags</samp>
* elements if <var>$result</var> is a table name. The following DBMS's
* provide full information from queries:
* + fbsql
* + mysql
*
* If the 'portability' option has <samp>DB_PORTABILITY_LOWERCASE</samp>
* turned on, the names of tables and fields will be lowercased.
*
* @param object|string $result DB_result object from a query or a
* string containing the name of a table.
* While this also accepts a query result
* resource identifier, this behavior is
* deprecated.
* @param int $mode either unused or one of the tableInfo modes:
* <kbd>DB_TABLEINFO_ORDERTABLE</kbd>,
* <kbd>DB_TABLEINFO_ORDER</kbd> or
* <kbd>DB_TABLEINFO_FULL</kbd> (which does both).
* These are bitwise, so the first two can be
* combined using <kbd>|</kbd>.
*
* @return array an associative array with the information requested.
* A DB_Error object on failure.
*
* @see DB_common::setOption()
*/
function tableInfo($result, $mode = null)
{
/*
* If the DB_<driver> class has a tableInfo() method, that one
* overrides this one. But, if the driver doesn't have one,
* this method runs and tells users about that fact.
*/
return $this->raiseError(DB_ERROR_NOT_CAPABLE);
}
 
// }}}
// {{{ getTables()
 
/**
* Lists the tables in the current database
*
* @return array the list of tables. A DB_Error object on failure.
*
* @deprecated Method deprecated some time before Release 1.2
*/
function getTables()
{
return $this->getListOf('tables');
}
 
// }}}
// {{{ getListOf()
 
/**
* Lists internal database information
*
* @param string $type type of information being sought.
* Common items being sought are:
* tables, databases, users, views, functions
* Each DBMS's has its own capabilities.
*
* @return array an array listing the items sought.
* A DB DB_Error object on failure.
*/
function getListOf($type)
{
$sql = $this->getSpecialQuery($type);
if ($sql === null) {
$this->last_query = '';
return $this->raiseError(DB_ERROR_UNSUPPORTED);
} elseif (is_int($sql) || DB::isError($sql)) {
// Previous error
return $this->raiseError($sql);
} elseif (is_array($sql)) {
// Already the result
return $sql;
}
// Launch this query
return $this->getCol($sql);
}
 
// }}}
// {{{ getSpecialQuery()
 
/**
* Obtains the query string needed for listing a given type of objects
*
* @param string $type the kind of objects you want to retrieve
*
* @return string the SQL query string or null if the driver doesn't
* support the object type requested
*
* @access protected
* @see DB_common::getListOf()
*/
function getSpecialQuery($type)
{
return $this->raiseError(DB_ERROR_UNSUPPORTED);
}
 
// }}}
// {{{ _rtrimArrayValues()
 
/**
* Right-trims all strings in an array
*
* @param array $array the array to be trimmed (passed by reference)
*
* @return void
*
* @access protected
*/
function _rtrimArrayValues(&$array)
{
foreach ($array as $key => $value) {
if (is_string($value)) {
$array[$key] = rtrim($value);
}
}
}
 
// }}}
// {{{ _convertNullArrayValuesToEmpty()
 
/**
* Converts all null values in an array to empty strings
*
* @param array $array the array to be de-nullified (passed by reference)
*
* @return void
*
* @access protected
*/
function _convertNullArrayValuesToEmpty(&$array)
{
foreach ($array as $key => $value) {
if (is_null($value)) {
$array[$key] = '';
}
}
}
 
// }}}
}
 
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/
 
?>
/tags/Racine_livraison_narmer/api/pear/HTTP.php
New file
0,0 → 1,353
<?php
// +----------------------------------------------------------------------+
// | PEAR :: HTTP |
// +----------------------------------------------------------------------+
// | This source file is subject to version 3.0 of the PHP license, |
// | that is available at http://www.php.net/license/3_0.txt |
// | If you did not receive a copy of the PHP license and are unable |
// | to obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Stig Bakken <ssb@fast.no> |
// | Sterling Hughes <sterling@php.net> |
// | Tomas V.V.Cox <cox@idecnet.com> |
// | Richard Heyes <richard@php.net> |
// | Philippe Jausions <Philippe.Jausions@11abacus.com> |
// | Michael Wallner <mike@php.net> |
// +----------------------------------------------------------------------+
//
// $Id: HTTP.php,v 1.1 2005-03-30 08:50:19 jpm Exp $
 
/**
* HTTP
*
* HTTP utility functions
*
* @package HTTP
* @category HTTP
* @license PHP License
* @access public
* @version $Revision: 1.1 $
*/
class HTTP
{
/**
* Date
*
* Format a RFC compliant GMT date HTTP header. This function honors the
* "y2k_compliance" php.ini directive and formats the GMT date corresponding
* to either RFC850 or RFC822.
*
* @static
* @access public
* @return mixed GMT date string, or false for an invalid $time parameter
* @param mixed $time unix timestamp or date (default = current time)
*/
function Date($time = null)
{
if (!isset($time)) {
$time = time();
} elseif (!is_numeric($time) && (-1 === $time = strtotime($time))) {
return false;
}
// RFC822 or RFC850
$format = ini_get('y2k_compliance') ? 'D, d M Y' : 'l, d-M-y';
return gmdate($format .' H:i:s \G\M\T', $time);
}
 
/**
* Negotiate Language
*
* Negotiate language with the user's browser through the Accept-Language
* HTTP header or the user's host address. Language codes are generally in
* the form "ll" for a language spoken in only one country, or "ll-CC" for a
* language spoken in a particular country. For example, U.S. English is
* "en-US", while British English is "en-UK". Portugese as spoken in
* Portugal is "pt-PT", while Brazilian Portugese is "pt-BR".
*
* Quality factors in the Accept-Language: header are supported, e.g.:
* Accept-Language: en-UK;q=0.7, en-US;q=0.6, no, dk;q=0.8
*
* <code>
* require_once 'HTTP.php';
* $langs = array(
* 'en' => 'locales/en',
* 'en-US'=> 'locales/en',
* 'en-UK'=> 'locales/en',
* 'de' => 'locales/de',
* 'de-DE'=> 'locales/de',
* 'de-AT'=> 'locales/de',
* );
* $neg = HTTP::negotiateLanguage($langs);
* $dir = $langs[$neg];
* </code>
*
* @static
* @access public
* @return string The negotiated language result or the supplied default.
* @param array $supported An associative array of supported languages,
* whose values must evaluate to true.
* @param string $default The default language to use if none is found.
*/
function negotiateLanguage($supported, $default = 'en-US')
{
$supp = array();
foreach ($supported as $lang => $isSupported) {
if ($isSupported) {
$supp[strToLower($lang)] = $lang;
}
}
if (!count($supp)) {
return $default;
}
 
$matches = array();
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
foreach (explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']) as $lang) {
$lang = array_map('trim', explode(';', $lang));
if (isset($lang[1])) {
$l = strtolower($lang[0]);
$q = (float) str_replace('q=', '', $lang[1]);
} else {
$l = strtolower($lang[0]);
$q = null;
}
if (isset($supp[$l])) {
$matches[$l] = isset($q) ? $q : 1000 - count($matches);
}
}
}
 
if (count($matches)) {
asort($matches, SORT_NUMERIC);
return $supp[array_pop(array_keys($matches))];
}
if (isset($_SERVER['REMOTE_HOST'])) {
$lang = strtolower(array_pop(explode('.', $_SERVER['REMOTE_HOST'])));
if (isset($supp[$lang])) {
return $supp[$lang];
}
}
 
return $default;
}
 
/**
* Head
*
* Sends a "HEAD" HTTP command to a server and returns the headers
* as an associative array. Example output could be:
* <code>
* Array
* (
* [response_code] => 200 // The HTTP response code
* [response] => HTTP/1.1 200 OK // The full HTTP response string
* [Date] => Fri, 11 Jan 2002 01:41:44 GMT
* [Server] => Apache/1.3.20 (Unix) PHP/4.1.1
* [X-Powered-By] => PHP/4.1.1
* [Connection] => close
* [Content-Type] => text/html
* )
* </code>
*
* @see HTTP_Client::head()
* @see HTTP_Request
*
* @static
* @access public
* @return mixed Returns associative array of response headers on success
* or PEAR error on failure.
* @param string $url A valid URL, e.g.: http://pear.php.net/credits.php
* @param integer $timeout Timeout in seconds (default = 10)
*/
function head($url, $timeout = 10)
{
$p = parse_url($url);
if (!isset($p['scheme'])) {
$p = parse_url(HTTP::absoluteURI($url));
} elseif ($p['scheme'] != 'http') {
return HTTP::raiseError('Unsupported protocol: '. $p['scheme']);
}
 
$port = isset($p['port']) ? $p['port'] : 80;
 
if (!$fp = @fsockopen($p['host'], $port, $eno, $estr, $timeout)) {
return HTTP::raiseError("Connection error: $estr ($eno)");
}
 
$path = !empty($p['path']) ? $p['path'] : '/';
$path .= !empty($p['query']) ? '?' . $p['query'] : '';
 
fputs($fp, "HEAD $path HTTP/1.0\r\n");
fputs($fp, 'Host: ' . $p['host'] . ':' . $port . "\r\n");
fputs($fp, "Connection: close\r\n\r\n");
 
$response = rtrim(fgets($fp, 4096));
if (preg_match("|^HTTP/[^\s]*\s(.*?)\s|", $response, $status)) {
$headers['response_code'] = $status[1];
}
$headers['response'] = $response;
 
while ($line = fgets($fp, 4096)) {
if (!trim($line)) {
break;
}
if (($pos = strpos($line, ':')) !== false) {
$header = substr($line, 0, $pos);
$value = trim(substr($line, $pos + 1));
$headers[$header] = $value;
}
}
fclose($fp);
return $headers;
}
 
/**
* Redirect
*
* This function redirects the client. This is done by issuing
* a "Location" header and exiting if wanted. If you set $rfc2616 to true
* HTTP will output a hypertext note with the location of the redirect.
*
* @static
* @access public
* @return mixed Returns true on succes (or exits) or false if headers
* have already been sent.
* @param string $url URL where the redirect should go to.
* @param bool $exit Whether to exit immediately after redirection.
* @param bool $rfc2616 Wheter to output a hypertext note where we're
* redirecting to (Redirecting to <a href="...">...</a>.)
*/
function redirect($url, $exit = true, $rfc2616 = false)
{
if (headers_sent()) {
return false;
}
$url = HTTP::absoluteURI($url);
header('Location: '. $url);
if ( $rfc2616 && isset($_SERVER['REQUEST_METHOD']) &&
$_SERVER['REQUEST_METHOD'] != 'HEAD') {
printf('Redirecting to: <a href="%s">%s</a>.', $url, $url);
}
if ($exit) {
exit;
}
return true;
}
 
/**
* Absolute URI
*
* This function returns the absolute URI for the partial URL passed.
* The current scheme (HTTP/HTTPS), host server, port, current script
* location are used if necessary to resolve any relative URLs.
*
* Offsets potentially created by PATH_INFO are taken care of to resolve
* relative URLs to the current script.
*
* You can choose a new protocol while resolving the URI. This is
* particularly useful when redirecting a web browser using relative URIs
* and to switch from HTTP to HTTPS, or vice-versa, at the same time.
*
* @author Philippe Jausions <Philippe.Jausions@11abacus.com>
* @static
* @access public
* @return string The absolute URI.
* @param string $url Absolute or relative URI the redirect should go to.
* @param string $protocol Protocol to use when redirecting URIs.
* @param integer $port A new port number.
*/
function absoluteURI($url = null, $protocol = null, $port = null)
{
// filter CR/LF
$url = str_replace(array("\r", "\n"), ' ', $url);
// Mess around with already absolute URIs
if (preg_match('!^([a-z0-9]+)://!i', $url)) {
if (empty($protocol) && empty($port)) {
return $url;
}
if (!empty($protocol)) {
$url = $protocol .':'. array_pop(explode(':', $url, 2));
}
if (!empty($port)) {
$url = preg_replace('!^(([a-z0-9]+)://[^/:]+)(:[\d]+)?!i',
'\1:'. $port, $url);
}
return $url;
}
$host = 'localhost';
if (!empty($_SERVER['HTTP_HOST'])) {
list($host) = explode(':', $_SERVER['HTTP_HOST']);
} elseif (!empty($_SERVER['SERVER_NAME'])) {
list($host) = explode(':', $_SERVER['SERVER_NAME']);
}
 
if (empty($protocol)) {
if (isset($_SERVER['HTTPS']) && !strcasecmp($_SERVER['HTTPS'], 'on')) {
$protocol = 'https';
} else {
$protocol = 'http';
}
if (!isset($port) || $port != intval($port)) {
$port = isset($_SERVER['SERVER_PORT']) ? $_SERVER['SERVER_PORT'] : 80;
}
}
if ($protocol == 'http' && $port == 80) {
unset($port);
}
if ($protocol == 'https' && $port == 443) {
unset($port);
}
 
$server = $protocol .'://'. $host . (isset($port) ? ':'. $port : '');
if (!strlen($url)) {
$url = isset($_SERVER['REQUEST_URI']) ?
$_SERVER['REQUEST_URI'] : $_SERVER['PHP_SELF'];
}
if ($url{0} == '/') {
return $server . $url;
}
// Check for PATH_INFO
if (isset($_SERVER['PATH_INFO']) && $_SERVER['PHP_SELF'] != $_SERVER['PATH_INFO']) {
$path = dirname(substr($_SERVER['PHP_SELF'], 0, -strlen($_SERVER['PATH_INFO'])));
} else {
$path = dirname($_SERVER['PHP_SELF']);
}
if (substr($path = strtr($path, '\\', '/'), -1) != '/') {
$path .= '/';
}
return $server . $path . $url;
}
 
/**
* Raise Error
*
* Lazy raising of PEAR_Errors.
*
* @static
* @access protected
* @return object PEAR_Error
* @param mixed $error
* @param int $code
*/
function raiseError($error = null, $code = null)
{
require_once 'PEAR.php';
return PEAR::raiseError($error, $code);
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Net/URL.php
New file
0,0 → 1,411
<?php
// +-----------------------------------------------------------------------+
// | Copyright (c) 2002-2004, Richard Heyes |
// | All rights reserved. |
// | |
// | Redistribution and use in source and binary forms, with or without |
// | modification, are permitted provided that the following conditions |
// | are met: |
// | |
// | o Redistributions of source code must retain the above copyright |
// | notice, this list of conditions and the following disclaimer. |
// | o Redistributions in binary form must reproduce the above copyright |
// | notice, this list of conditions and the following disclaimer in the |
// | documentation and/or other materials provided with the distribution.|
// | o The names of the authors may not be used to endorse or promote |
// | products derived from this software without specific prior written |
// | permission. |
// | |
// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
// | |
// +-----------------------------------------------------------------------+
// | Author: Richard Heyes <richard at php net> |
// +-----------------------------------------------------------------------+
//
// $Id: URL.php,v 1.2 2006-03-13 21:00:48 ddelon Exp $
//
// Net_URL Class
 
class Net_URL
{
/**
* Full url
* @var string
*/
var $url;
 
/**
* Protocol
* @var string
*/
var $protocol;
 
/**
* Username
* @var string
*/
var $username;
 
/**
* Password
* @var string
*/
var $password;
 
/**
* Host
* @var string
*/
var $host;
 
/**
* Port
* @var integer
*/
var $port;
 
/**
* Path
* @var string
*/
var $path;
 
/**
* Query string
* @var array
*/
var $querystring;
 
/**
* Anchor
* @var string
*/
var $anchor;
 
/**
* Whether to use []
* @var bool
*/
var $useBrackets;
 
/**
* PHP4 Constructor
*
* @see __construct()
*/
function Net_URL($url = null, $useBrackets = true)
{
$this->__construct($url, $useBrackets);
}
 
/**
* PHP5 Constructor
*
* Parses the given url and stores the various parts
* Defaults are used in certain cases
*
* @param string $url Optional URL
* @param bool $useBrackets Whether to use square brackets when
* multiple querystrings with the same name
* exist
*/
function __construct($url = null, $useBrackets = true)
{
$HTTP_SERVER_VARS = !empty($_SERVER) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS'];
 
$this->useBrackets = $useBrackets;
$this->url = $url;
$this->user = '';
$this->pass = '';
$this->host = '';
$this->port = 80;
$this->path = '';
$this->querystring = array();
$this->anchor = '';
 
// Only use defaults if not an absolute URL given
if (!preg_match('/^[a-z0-9]+:\/\//i', $url)) {
 
$this->protocol = 'http';
 
/**
* Figure out host/port
*/
if (!empty($HTTP_SERVER_VARS['HTTP_HOST']) AND preg_match('/^(.*)(:([0-9]+))?$/U', $HTTP_SERVER_VARS['HTTP_HOST'], $matches)) {
$host = $matches[1];
if (!empty($matches[3])) {
$port = $matches[3];
} else {
$port = $this->getStandardPort($this->protocol);
}
}
 
$this->user = '';
$this->pass = '';
$this->host = !empty($host) ? $host : (isset($HTTP_SERVER_VARS['SERVER_NAME']) ? $HTTP_SERVER_VARS['SERVER_NAME'] : 'localhost');
$this->port = !empty($port) ? $port : (isset($HTTP_SERVER_VARS['SERVER_PORT']) ? $HTTP_SERVER_VARS['SERVER_PORT'] : $this->getStandardPort($this->protocol));
$this->path = !empty($HTTP_SERVER_VARS['PHP_SELF']) ? $HTTP_SERVER_VARS['PHP_SELF'] : '/';
$this->querystring = isset($HTTP_SERVER_VARS['QUERY_STRING']) ? $this->_parseRawQuerystring($HTTP_SERVER_VARS['QUERY_STRING']) : null;
$this->anchor = '';
}
 
// Parse the url and store the various parts
if (!empty($url)) {
$urlinfo = parse_url($url);
 
// Default querystring
$this->querystring = array();
 
foreach ($urlinfo as $key => $value) {
switch ($key) {
case 'scheme':
$this->protocol = $value;
$this->port = $this->getStandardPort($value);
break;
 
case 'user':
case 'pass':
case 'host':
case 'port':
$this->$key = $value;
break;
 
case 'path':
if ($value{0} == '/') {
$this->path = $value;
} else {
$path = dirname($this->path) == DIRECTORY_SEPARATOR ? '' : dirname($this->path);
$this->path = sprintf('%s/%s', $path, $value);
}
break;
 
case 'query':
$this->querystring = $this->_parseRawQueryString($value);
break;
 
case 'fragment':
$this->anchor = $value;
break;
}
}
}
}
 
/**
* Returns full url
*
* @return string Full url
* @access public
*/
function getURL()
{
$querystring = $this->getQueryString();
 
$this->url = $this->protocol . '://'
. $this->user . (!empty($this->pass) ? ':' : '')
. $this->pass . (!empty($this->user) ? '@' : '')
. $this->host . ($this->port == $this->getStandardPort($this->protocol) ? '' : ':' . $this->port)
. $this->path
. (!empty($querystring) ? '?' . $querystring : '')
. (!empty($this->anchor) ? '#' . $this->anchor : '');
 
return $this->url;
}
 
/**
* Adds a querystring item
*
* @param string $name Name of item
* @param string $value Value of item
* @param bool $preencoded Whether value is urlencoded or not, default = not
* @access public
*/
function addQueryString($name, $value, $preencoded = false)
{
if ($preencoded) {
$this->querystring[$name] = $value;
} else {
$this->querystring[$name] = is_array($value) ? array_map('rawurlencode', $value): rawurlencode($value);
}
}
 
/**
* Removes a querystring item
*
* @param string $name Name of item
* @access public
*/
function removeQueryString($name)
{
if (isset($this->querystring[$name])) {
unset($this->querystring[$name]);
}
}
 
/**
* Sets the querystring to literally what you supply
*
* @param string $querystring The querystring data. Should be of the format foo=bar&x=y etc
* @access public
*/
function addRawQueryString($querystring)
{
$this->querystring = $this->_parseRawQueryString($querystring);
}
 
/**
* Returns flat querystring
*
* @return string Querystring
* @access public
*/
function getQueryString()
{
if (!empty($this->querystring)) {
foreach ($this->querystring as $name => $value) {
if (is_array($value)) {
foreach ($value as $k => $v) {
$querystring[] = $this->useBrackets ? sprintf('%s[%s]=%s', $name, $k, $v) : ($name . '=' . $v);
}
} elseif (!is_null($value)) {
$querystring[] = $name . '=' . $value;
} else {
$querystring[] = $name;
}
}
$querystring = implode(ini_get('arg_separator.output'), $querystring);
} else {
$querystring = '';
}
 
return $querystring;
}
 
/**
* Parses raw querystring and returns an array of it
*
* @param string $querystring The querystring to parse
* @return array An array of the querystring data
* @access private
*/
function _parseRawQuerystring($querystring)
{
$parts = preg_split('/[' . preg_quote(ini_get('arg_separator.input'), '/') . ']/', $querystring, -1, PREG_SPLIT_NO_EMPTY);
$return = array();
 
foreach ($parts as $part) {
if (strpos($part, '=') !== false) {
$value = substr($part, strpos($part, '=') + 1);
$key = substr($part, 0, strpos($part, '='));
} else {
$value = null;
$key = $part;
}
if (substr($key, -2) == '[]') {
$key = substr($key, 0, -2);
if (@!is_array($return[$key])) {
$return[$key] = array();
$return[$key][] = $value;
} else {
$return[$key][] = $value;
}
} elseif (!$this->useBrackets AND !empty($return[$key])) {
$return[$key] = (array)$return[$key];
$return[$key][] = $value;
} else {
$return[$key] = $value;
}
}
 
return $return;
}
 
/**
* Resolves //, ../ and ./ from a path and returns
* the result. Eg:
*
* /foo/bar/../boo.php => /foo/boo.php
* /foo/bar/../../boo.php => /boo.php
* /foo/bar/.././/boo.php => /foo/boo.php
*
* This method can also be called statically.
*
* @param string $url URL path to resolve
* @return string The result
*/
function resolvePath($path)
{
$path = explode('/', str_replace('//', '/', $path));
 
for ($i=0; $i<count($path); $i++) {
if ($path[$i] == '.') {
unset($path[$i]);
$path = array_values($path);
$i--;
 
} elseif ($path[$i] == '..' AND ($i > 1 OR ($i == 1 AND $path[0] != '') ) ) {
unset($path[$i]);
unset($path[$i-1]);
$path = array_values($path);
$i -= 2;
 
} elseif ($path[$i] == '..' AND $i == 1 AND $path[0] == '') {
unset($path[$i]);
$path = array_values($path);
$i--;
 
} else {
continue;
}
}
 
return implode('/', $path);
}
 
/**
* Returns the standard port number for a protocol
*
* @param string $scheme The protocol to lookup
* @return integer Port number or NULL if no scheme matches
*
* @author Philippe Jausions <Philippe.Jausions@11abacus.com>
*/
function getStandardPort($scheme)
{
switch (strtolower($scheme)) {
case 'http': return 80;
case 'https': return 443;
case 'ftp': return 21;
case 'imap': return 143;
case 'imaps': return 993;
case 'pop3': return 110;
case 'pop3s': return 995;
default: return null;
}
}
 
/**
* Forces the URL to a particular protocol
*
* @param string $protocol Protocol to force the URL to
* @param integer $port Optional port (standard port is used by default)
*/
function setProtocol($protocol, $port = null)
{
$this->protocol = $protocol;
$this->port = is_null($port) ? $this->getStandardPort() : $port;
}
 
}
?>
/tags/Racine_livraison_narmer/api/pear/Net/FTP/Observer.php
New file
0,0 → 1,101
<?php
 
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 
/**
* Net_FTP observer.
*
* This class implements the Observer part of a Subject-Observer
* design pattern. It listens to the events sent by a Net_FTP instance.
* This module had many influences from the Log_observer code.
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Networking
* @package FTP
* @author Tobias Schlitt <toby@php.net>
* @author Laurent Laville <pear@laurent-laville.org>
* @author Chuck Hagenbuch <chuck@horde.org>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id: Observer.php,v 1.1 2005-03-30 08:50:33 jpm Exp $
* @link http://pear.php.net/package/Net_FTP
* @since File available since Release 0.0.1
*/
 
/**
* This class implements the Observer part of a Subject-Observer
* design pattern. It listens to the events sent by a Net_FTP instance.
* This module had many influences from the Log_observer code.
*
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @category Networking
* @package FTP
* @author Laurent Laville <pear@laurent-laville.org>
* @author Chuck Hagenbuch <chuck@horde.org>
* @author Tobias Schlitt <toby@php.net>
* @copyright 1997-2005 The PHP Group
* @version Release: 1.3.0
* @link http://pear.php.net/package/Net_FTP
* @since 1.3.0.0
* @access public
*
* @example observer_upload.php An example of Net_FTP_Observer implementation.
*/
class Net_FTP_Observer
{
/**
* Instance-specific unique identification number.
*
* @var integer
* @since 1.3.0
* @access private
*/
var $_id;
 
/**
* Creates a new basic Net_FTP_Observer instance.
*
* @since 1.3.0
* @access public
*/
function Net_FTP_Observer()
{
$this->_id = md5(microtime());
}
 
/**
* Returns the listener's identifier
*
* @return string
* @since 1.3.0
* @access public
*/
function getId()
{
return $this->_id;
}
 
/**
* This is a stub method to make sure that Net_FTP_Observer classes do
* something when they are notified of a message. The default behavior
* is to just do nothing.
* You should override this method.
*
* @param mixed $event A hash describing the net event.
*
* @since 1.3.0
* @access public
*/
function notify($event)
{
return;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Net/SMTP.php
New file
0,0 → 1,970
<?php
/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Chuck Hagenbuch <chuck@horde.org> |
// | Jon Parise <jon@php.net> |
// | Damian Alejandro Fernandez Sosa <damlists@cnba.uba.ar> |
// +----------------------------------------------------------------------+
 
require_once 'PEAR.php';
require_once 'Net/Socket.php';
 
/**
* Provides an implementation of the SMTP protocol using PEAR's
* Net_Socket:: class.
*
* @package Net_SMTP
* @author Chuck Hagenbuch <chuck@horde.org>
* @author Jon Parise <jon@php.net>
* @author Damian Alejandro Fernandez Sosa <damlists@cnba.uba.ar>
*
* @example basic.php A basic implementation of the Net_SMTP package.
*/
class Net_SMTP
{
/**
* The server to connect to.
* @var string
* @access public
*/
var $host = 'localhost';
 
/**
* The port to connect to.
* @var int
* @access public
*/
var $port = 25;
 
/**
* The value to give when sending EHLO or HELO.
* @var string
* @access public
*/
var $localhost = 'localhost';
 
/**
* List of supported authentication methods, in preferential order.
* @var array
* @access public
*/
var $auth_methods = array('DIGEST-MD5', 'CRAM-MD5', 'LOGIN', 'PLAIN');
 
/**
* Should debugging output be enabled?
* @var boolean
* @access private
*/
var $_debug = false;
 
/**
* The socket resource being used to connect to the SMTP server.
* @var resource
* @access private
*/
var $_socket = null;
 
/**
* The most recent server response code.
* @var int
* @access private
*/
var $_code = -1;
 
/**
* The most recent server response arguments.
* @var array
* @access private
*/
var $_arguments = array();
 
/**
* Stores detected features of the SMTP server.
* @var array
* @access private
*/
var $_esmtp = array();
 
/**
* Instantiates a new Net_SMTP object, overriding any defaults
* with parameters that are passed in.
*
* @param string The server to connect to.
* @param int The port to connect to.
* @param string The value to give when sending EHLO or HELO.
*
* @access public
* @since 1.0
*/
function Net_SMTP($host = null, $port = null, $localhost = null)
{
if (isset($host)) $this->host = $host;
if (isset($port)) $this->port = $port;
if (isset($localhost)) $this->localhost = $localhost;
 
$this->_socket = new Net_Socket();
 
/*
* Include the Auth_SASL package. If the package is not available,
* we disable the authentication methods that depend upon it.
*/
if ((@include_once 'Auth/SASL.php') === false) {
$pos = array_search('DIGEST-MD5', $this->auth_methods);
unset($this->auth_methods[$pos]);
$pos = array_search('CRAM-MD5', $this->auth_methods);
unset($this->auth_methods[$pos]);
}
}
 
/**
* Set the value of the debugging flag.
*
* @param boolean $debug New value for the debugging flag.
*
* @access public
* @since 1.1.0
*/
function setDebug($debug)
{
$this->_debug = $debug;
}
 
/**
* Send the given string of data to the server.
*
* @param string $data The string of data to send.
*
* @return mixed True on success or a PEAR_Error object on failure.
*
* @access private
* @since 1.1.0
*/
function _send($data)
{
if ($this->_debug) {
echo "DEBUG: Send: $data\n";
}
 
if (PEAR::isError($error = $this->_socket->write($data))) {
return new PEAR_Error('Failed to write to socket: ' .
$error->getMessage());
}
 
return true;
}
 
/**
* Send a command to the server with an optional string of arguments.
* A carriage return / linefeed (CRLF) sequence will be appended to each
* command string before it is sent to the SMTP server.
*
* @param string $command The SMTP command to send to the server.
* @param string $args A string of optional arguments to append
* to the command.
*
* @return mixed The result of the _send() call.
*
* @access private
* @since 1.1.0
*/
function _put($command, $args = '')
{
if (!empty($args)) {
return $this->_send($command . ' ' . $args . "\r\n");
}
 
return $this->_send($command . "\r\n");
}
 
/**
* Read a reply from the SMTP server. The reply consists of a response
* code and a response message.
*
* @param mixed $valid The set of valid response codes. These
* may be specified as an array of integer
* values or as a single integer value.
*
* @return mixed True if the server returned a valid response code or
* a PEAR_Error object is an error condition is reached.
*
* @access private
* @since 1.1.0
*
* @see getResponse
*/
function _parseResponse($valid)
{
$this->_code = -1;
$this->_arguments = array();
 
while ($line = $this->_socket->readLine()) {
if ($this->_debug) {
echo "DEBUG: Recv: $line\n";
}
 
/* If we receive an empty line, the connection has been closed. */
if (empty($line)) {
$this->disconnect();
return new PEAR_Error("Connection was unexpectedly closed");
}
 
/* Read the code and store the rest in the arguments array. */
$code = substr($line, 0, 3);
$this->_arguments[] = trim(substr($line, 4));
 
/* Check the syntax of the response code. */
if (is_numeric($code)) {
$this->_code = (int)$code;
} else {
$this->_code = -1;
break;
}
 
/* If this is not a multiline response, we're done. */
if (substr($line, 3, 1) != '-') {
break;
}
}
 
/* Compare the server's response code with the valid code. */
if (is_int($valid) && ($this->_code === $valid)) {
return true;
}
 
/* If we were given an array of valid response codes, check each one. */
if (is_array($valid)) {
foreach ($valid as $valid_code) {
if ($this->_code === $valid_code) {
return true;
}
}
}
 
return new PEAR_Error("Invalid response code received from server");
}
 
/**
* Return a 2-tuple containing the last response from the SMTP server.
*
* @return array A two-element array: the first element contains the
* response code as an integer and the second element
* contains the response's arguments as a string.
*
* @access public
* @since 1.1.0
*/
function getResponse()
{
return array($this->_code, join("\n", $this->_arguments));
}
 
/**
* Attempt to connect to the SMTP server.
*
* @param int $timeout The timeout value (in seconds) for the
* socket connection.
* @param bool $persistent Should a persistent socket connection
* be used?
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
* @access public
* @since 1.0
*/
function connect($timeout = null, $persistent = false)
{
$result = $this->_socket->connect($this->host, $this->port,
$persistent, $timeout);
if (PEAR::isError($result)) {
return new PEAR_Error('Failed to connect socket: ' .
$result->getMessage());
}
 
if (PEAR::isError($error = $this->_parseResponse(220))) {
return $error;
}
if (PEAR::isError($error = $this->_negotiate())) {
return $error;
}
 
return true;
}
 
/**
* Attempt to disconnect from the SMTP server.
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
* @access public
* @since 1.0
*/
function disconnect()
{
if (PEAR::isError($error = $this->_put('QUIT'))) {
return $error;
}
if (PEAR::isError($error = $this->_parseResponse(221))) {
return $error;
}
if (PEAR::isError($error = $this->_socket->disconnect())) {
return new PEAR_Error('Failed to disconnect socket: ' .
$error->getMessage());
}
 
return true;
}
 
/**
* Attempt to send the EHLO command and obtain a list of ESMTP
* extensions available, and failing that just send HELO.
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
*
* @access private
* @since 1.1.0
*/
function _negotiate()
{
if (PEAR::isError($error = $this->_put('EHLO', $this->localhost))) {
return $error;
}
 
if (PEAR::isError($this->_parseResponse(250))) {
/* If we receive a 503 response, we're already authenticated. */
if ($this->_code === 503) {
return true;
}
 
/* If the EHLO failed, try the simpler HELO command. */
if (PEAR::isError($error = $this->_put('HELO', $this->localhost))) {
return $error;
}
if (PEAR::isError($this->_parseResponse(250))) {
return new PEAR_Error('HELO was not accepted: ', $this->_code);
}
 
return true;
}
 
foreach ($this->_arguments as $argument) {
$verb = strtok($argument, ' ');
$arguments = substr($argument, strlen($verb) + 1,
strlen($argument) - strlen($verb) - 1);
$this->_esmtp[$verb] = $arguments;
}
 
return true;
}
 
/**
* Returns the name of the best authentication method that the server
* has advertised.
*
* @return mixed Returns a string containing the name of the best
* supported authentication method or a PEAR_Error object
* if a failure condition is encountered.
* @access private
* @since 1.1.0
*/
function _getBestAuthMethod()
{
$available_methods = explode(' ', $this->_esmtp['AUTH']);
 
foreach ($this->auth_methods as $method) {
if (in_array($method, $available_methods)) {
return $method;
}
}
 
return new PEAR_Error('No supported authentication methods');
}
 
/**
* Attempt to do SMTP authentication.
*
* @param string The userid to authenticate as.
* @param string The password to authenticate with.
* @param string The requested authentication method. If none is
* specified, the best supported method will be used.
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
* @access public
* @since 1.0
*/
function auth($uid, $pwd , $method = '')
{
if (empty($this->_esmtp['AUTH'])) {
return new PEAR_Error('SMTP server does no support authentication');
}
 
/*
* If no method has been specified, get the name of the best supported
* method advertised by the SMTP server.
*/
if (empty($method)) {
if (PEAR::isError($method = $this->_getBestAuthMethod())) {
/* Return the PEAR_Error object from _getBestAuthMethod(). */
return $method;
}
} else {
$method = strtoupper($method);
if (!in_array($method, $this->auth_methods)) {
return new PEAR_Error("$method is not a supported authentication method");
}
}
 
switch ($method) {
case 'DIGEST-MD5':
$result = $this->_authDigest_MD5($uid, $pwd);
break;
case 'CRAM-MD5':
$result = $this->_authCRAM_MD5($uid, $pwd);
break;
case 'LOGIN':
$result = $this->_authLogin($uid, $pwd);
break;
case 'PLAIN':
$result = $this->_authPlain($uid, $pwd);
break;
default:
$result = new PEAR_Error("$method is not a supported authentication method");
break;
}
 
/* If an error was encountered, return the PEAR_Error object. */
if (PEAR::isError($result)) {
return $result;
}
 
/* RFC-2554 requires us to re-negotiate ESMTP after an AUTH. */
if (PEAR::isError($error = $this->_negotiate())) {
return $error;
}
 
return true;
}
 
/**
* Authenticates the user using the DIGEST-MD5 method.
*
* @param string The userid to authenticate as.
* @param string The password to authenticate with.
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
* @access private
* @since 1.1.0
*/
function _authDigest_MD5($uid, $pwd)
{
if (PEAR::isError($error = $this->_put('AUTH', 'DIGEST-MD5'))) {
return $error;
}
/* 334: Continue authentication request */
if (PEAR::isError($error = $this->_parseResponse(334))) {
/* 503: Error: already authenticated */
if ($this->_code === 503) {
return true;
}
return $error;
}
 
$challenge = base64_decode($this->_arguments[0]);
$digest = &Auth_SASL::factory('digestmd5');
$auth_str = base64_encode($digest->getResponse($uid, $pwd, $challenge,
$this->host, "smtp"));
 
if (PEAR::isError($error = $this->_put($auth_str))) {
return $error;
}
/* 334: Continue authentication request */
if (PEAR::isError($error = $this->_parseResponse(334))) {
return $error;
}
 
/*
* We don't use the protocol's third step because SMTP doesn't allow
* subsequent authentication, so we just silently ignore it.
*/
if (PEAR::isError($error = $this->_put(' '))) {
return $error;
}
/* 235: Authentication successful */
if (PEAR::isError($error = $this->_parseResponse(235))) {
return $error;
}
}
 
/**
* Authenticates the user using the CRAM-MD5 method.
*
* @param string The userid to authenticate as.
* @param string The password to authenticate with.
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
* @access private
* @since 1.1.0
*/
function _authCRAM_MD5($uid, $pwd)
{
if (PEAR::isError($error = $this->_put('AUTH', 'CRAM-MD5'))) {
return $error;
}
/* 334: Continue authentication request */
if (PEAR::isError($error = $this->_parseResponse(334))) {
/* 503: Error: already authenticated */
if ($this->_code === 503) {
return true;
}
return $error;
}
 
$challenge = base64_decode($this->_arguments[0]);
$cram = &Auth_SASL::factory('crammd5');
$auth_str = base64_encode($cram->getResponse($uid, $pwd, $challenge));
 
if (PEAR::isError($error = $this->_put($auth_str))) {
return $error;
}
 
/* 235: Authentication successful */
if (PEAR::isError($error = $this->_parseResponse(235))) {
return $error;
}
}
 
/**
* Authenticates the user using the LOGIN method.
*
* @param string The userid to authenticate as.
* @param string The password to authenticate with.
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
* @access private
* @since 1.1.0
*/
function _authLogin($uid, $pwd)
{
if (PEAR::isError($error = $this->_put('AUTH', 'LOGIN'))) {
return $error;
}
/* 334: Continue authentication request */
if (PEAR::isError($error = $this->_parseResponse(334))) {
/* 503: Error: already authenticated */
if ($this->_code === 503) {
return true;
}
return $error;
}
 
if (PEAR::isError($error = $this->_put(base64_encode($uid)))) {
return $error;
}
/* 334: Continue authentication request */
if (PEAR::isError($error = $this->_parseResponse(334))) {
return $error;
}
 
if (PEAR::isError($error = $this->_put(base64_encode($pwd)))) {
return $error;
}
 
/* 235: Authentication successful */
if (PEAR::isError($error = $this->_parseResponse(235))) {
return $error;
}
 
return true;
}
 
/**
* Authenticates the user using the PLAIN method.
*
* @param string The userid to authenticate as.
* @param string The password to authenticate with.
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
* @access private
* @since 1.1.0
*/
function _authPlain($uid, $pwd)
{
if (PEAR::isError($error = $this->_put('AUTH', 'PLAIN'))) {
return $error;
}
/* 334: Continue authentication request */
if (PEAR::isError($error = $this->_parseResponse(334))) {
/* 503: Error: already authenticated */
if ($this->_code === 503) {
return true;
}
return $error;
}
 
$auth_str = base64_encode(chr(0) . $uid . chr(0) . $pwd);
 
if (PEAR::isError($error = $this->_put($auth_str))) {
return $error;
}
 
/* 235: Authentication successful */
if (PEAR::isError($error = $this->_parseResponse(235))) {
return $error;
}
 
return true;
}
 
/**
* Send the HELO command.
*
* @param string The domain name to say we are.
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
* @access public
* @since 1.0
*/
function helo($domain)
{
if (PEAR::isError($error = $this->_put('HELO', $domain))) {
return $error;
}
if (PEAR::isError($error = $this->_parseResponse(250))) {
return $error;
}
 
return true;
}
 
/**
* Send the MAIL FROM: command.
*
* @param string The sender (reverse path) to set.
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
* @access public
* @since 1.0
*/
function mailFrom($sender)
{
if (PEAR::isError($error = $this->_put('MAIL', "FROM:<$sender>"))) {
return $error;
}
if (PEAR::isError($error = $this->_parseResponse(250))) {
return $error;
}
 
return true;
}
 
/**
* Send the RCPT TO: command.
*
* @param string The recipient (forward path) to add.
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
* @access public
* @since 1.0
*/
function rcptTo($recipient)
{
if (PEAR::isError($error = $this->_put('RCPT', "TO:<$recipient>"))) {
return $error;
}
if (PEAR::isError($error = $this->_parseResponse(array(250, 251)))) {
return $error;
}
 
return true;
}
 
/**
* Quote the data so that it meets SMTP standards.
*
* This is provided as a separate public function to facilitate easier
* overloading for the cases where it is desirable to customize the
* quoting behavior.
*
* @param string The message text to quote. The string must be passed
* by reference, and the text will be modified in place.
*
* @access public
* @since 1.2
*/
function quotedata(&$data)
{
/*
* Change Unix (\n) and Mac (\r) linefeeds into Internet-standard CRLF
* (\r\n) linefeeds.
*/
$data = preg_replace("/([^\r]{1})\n/", "\\1\r\n", $data);
$data = preg_replace("/\n\n/", "\n\r\n", $data);
 
/*
* Because a single leading period (.) signifies an end to the data,
* legitimate leading periods need to be "doubled" (e.g. '..').
*/
$data = preg_replace("/\n\./", "\n..", $data);
}
 
/**
* Send the DATA command.
*
* @param string The message body to send.
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
* @access public
* @since 1.0
*/
function data($data)
{
/*
* RFC 1870, section 3, subsection 3 states "a value of zero indicates
* that no fixed maximum message size is in force". Furthermore, it
* says that if "the parameter is omitted no information is conveyed
* about the server's fixed maximum message size".
*/
if (isset($this->_esmtp['SIZE']) && ($this->_esmtp['SIZE'] > 0)) {
if (strlen($data) >= $this->_esmtp['SIZE']) {
$this->disconnect();
return new PEAR_Error('Message size excedes the server limit');
}
}
 
/* Quote the data based on the SMTP standards. */
$this->quotedata($data);
 
if (PEAR::isError($error = $this->_put('DATA'))) {
return $error;
}
if (PEAR::isError($error = $this->_parseResponse(354))) {
return $error;
}
 
if (PEAR::isError($this->_send($data . "\r\n.\r\n"))) {
return new PEAR_Error('write to socket failed');
}
if (PEAR::isError($error = $this->_parseResponse(250))) {
return $error;
}
 
return true;
}
 
/**
* Send the SEND FROM: command.
*
* @param string The reverse path to send.
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
* @access public
* @since 1.2.6
*/
function sendFrom($path)
{
if (PEAR::isError($error = $this->_put('SEND', "FROM:<$path>"))) {
return $error;
}
if (PEAR::isError($error = $this->_parseResponse(250))) {
return $error;
}
 
return true;
}
 
/**
* Backwards-compatibility wrapper for sendFrom().
*
* @param string The reverse path to send.
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
*
* @access public
* @since 1.0
* @deprecated 1.2.6
*/
function send_from($path)
{
return sendFrom($path);
}
 
/**
* Send the SOML FROM: command.
*
* @param string The reverse path to send.
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
* @access public
* @since 1.2.6
*/
function somlFrom($path)
{
if (PEAR::isError($error = $this->_put('SOML', "FROM:<$path>"))) {
return $error;
}
if (PEAR::isError($error = $this->_parseResponse(250))) {
return $error;
}
 
return true;
}
 
/**
* Backwards-compatibility wrapper for somlFrom().
*
* @param string The reverse path to send.
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
*
* @access public
* @since 1.0
* @deprecated 1.2.6
*/
function soml_from($path)
{
return somlFrom($path);
}
 
/**
* Send the SAML FROM: command.
*
* @param string The reverse path to send.
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
* @access public
* @since 1.2.6
*/
function samlFrom($path)
{
if (PEAR::isError($error = $this->_put('SAML', "FROM:<$path>"))) {
return $error;
}
if (PEAR::isError($error = $this->_parseResponse(250))) {
return $error;
}
 
return true;
}
 
/**
* Backwards-compatibility wrapper for samlFrom().
*
* @param string The reverse path to send.
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
*
* @access public
* @since 1.0
* @deprecated 1.2.6
*/
function saml_from($path)
{
return samlFrom($path);
}
 
/**
* Send the RSET command.
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
* @access public
* @since 1.0
*/
function rset()
{
if (PEAR::isError($error = $this->_put('RSET'))) {
return $error;
}
if (PEAR::isError($error = $this->_parseResponse(250))) {
return $error;
}
 
return true;
}
 
/**
* Send the VRFY command.
*
* @param string The string to verify
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
* @access public
* @since 1.0
*/
function vrfy($string)
{
/* Note: 251 is also a valid response code */
if (PEAR::isError($error = $this->_put('VRFY', $string))) {
return $error;
}
if (PEAR::isError($error = $this->_parseResponse(250))) {
return $error;
}
 
return true;
}
 
/**
* Send the NOOP command.
*
* @return mixed Returns a PEAR_Error with an error message on any
* kind of failure, or true on success.
* @access public
* @since 1.0
*/
function noop()
{
if (PEAR::isError($error = $this->_put('NOOP'))) {
return $error;
}
if (PEAR::isError($error = $this->_parseResponse(250))) {
return $error;
}
 
return true;
}
 
/**
* Backwards-compatibility method. identifySender()'s functionality is
* now handled internally.
*
* @return boolean This method always return true.
*
* @access public
* @since 1.0
*/
function identifySender()
{
return true;
}
}
 
?>
/tags/Racine_livraison_narmer/api/pear/Net/Socket.php
New file
0,0 → 1,528
<?php
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Stig Bakken <ssb@php.net> |
// | Chuck Hagenbuch <chuck@horde.org> |
// +----------------------------------------------------------------------+
//
// $Id: Socket.php,v 1.1 2005-03-30 08:50:33 jpm Exp $
 
require_once 'PEAR.php';
 
define('NET_SOCKET_READ', 1);
define('NET_SOCKET_WRITE', 2);
define('NET_SOCKET_ERROR', 3);
 
/**
* Generalized Socket class.
*
* @version 1.1
* @author Stig Bakken <ssb@php.net>
* @author Chuck Hagenbuch <chuck@horde.org>
*/
class Net_Socket extends PEAR {
 
/**
* Socket file pointer.
* @var resource $fp
*/
var $fp = null;
 
/**
* Whether the socket is blocking. Defaults to true.
* @var boolean $blocking
*/
var $blocking = true;
 
/**
* Whether the socket is persistent. Defaults to false.
* @var boolean $persistent
*/
var $persistent = false;
 
/**
* The IP address to connect to.
* @var string $addr
*/
var $addr = '';
 
/**
* The port number to connect to.
* @var integer $port
*/
var $port = 0;
 
/**
* Number of seconds to wait on socket connections before assuming
* there's no more data. Defaults to no timeout.
* @var integer $timeout
*/
var $timeout = false;
 
/**
* Number of bytes to read at a time in readLine() and
* readAll(). Defaults to 2048.
* @var integer $lineLength
*/
var $lineLength = 2048;
 
/**
* Connect to the specified port. If called when the socket is
* already connected, it disconnects and connects again.
*
* @param string $addr IP address or host name.
* @param integer $port TCP port number.
* @param boolean $persistent (optional) Whether the connection is
* persistent (kept open between requests
* by the web server).
* @param integer $timeout (optional) How long to wait for data.
* @param array $options See options for stream_context_create.
*
* @access public
*
* @return boolean | PEAR_Error True on success or a PEAR_Error on failure.
*/
function connect($addr, $port = 0, $persistent = null, $timeout = null, $options = null)
{
if (is_resource($this->fp)) {
@fclose($this->fp);
$this->fp = null;
}
 
if (!$addr) {
return $this->raiseError('$addr cannot be empty');
} elseif (strspn($addr, '.0123456789') == strlen($addr) ||
strstr($addr, '/') !== false) {
$this->addr = $addr;
} else {
$this->addr = @gethostbyname($addr);
}
 
$this->port = $port % 65536;
 
if ($persistent !== null) {
$this->persistent = $persistent;
}
 
if ($timeout !== null) {
$this->timeout = $timeout;
}
 
$openfunc = $this->persistent ? 'pfsockopen' : 'fsockopen';
$errno = 0;
$errstr = '';
if ($options && function_exists('stream_context_create')) {
if ($this->timeout) {
$timeout = $this->timeout;
} else {
$timeout = 0;
}
$context = stream_context_create($options);
$fp = @$openfunc($this->addr, $this->port, $errno, $errstr, $timeout, $context);
} else {
if ($this->timeout) {
$fp = @$openfunc($this->addr, $this->port, $errno, $errstr, $this->timeout);
} else {
$fp = @$openfunc($this->addr, $this->port, $errno, $errstr);
}
}
 
if (!$fp) {
return $this->raiseError($errstr, $errno);
}
 
$this->fp = $fp;
 
return $this->setBlocking($this->blocking);
}
 
/**
* Disconnects from the peer, closes the socket.
*
* @access public
* @return mixed true on success or an error object otherwise
*/
function disconnect()
{
if (!is_resource($this->fp)) {
return $this->raiseError('not connected');
}
 
@fclose($this->fp);
$this->fp = null;
return true;
}
 
/**
* Find out if the socket is in blocking mode.
*
* @access public
* @return boolean The current blocking mode.
*/
function isBlocking()
{
return $this->blocking;
}
 
/**
* Sets whether the socket connection should be blocking or
* not. A read call to a non-blocking socket will return immediately
* if there is no data available, whereas it will block until there
* is data for blocking sockets.
*
* @param boolean $mode True for blocking sockets, false for nonblocking.
* @access public
* @return mixed true on success or an error object otherwise
*/
function setBlocking($mode)
{
if (!is_resource($this->fp)) {
return $this->raiseError('not connected');
}
 
$this->blocking = $mode;
socket_set_blocking($this->fp, $this->blocking);
return true;
}
 
/**
* Sets the timeout value on socket descriptor,
* expressed in the sum of seconds and microseconds
*
* @param integer $seconds Seconds.
* @param integer $microseconds Microseconds.
* @access public
* @return mixed true on success or an error object otherwise
*/
function setTimeout($seconds, $microseconds)
{
if (!is_resource($this->fp)) {
return $this->raiseError('not connected');
}
 
return socket_set_timeout($this->fp, $seconds, $microseconds);
}
 
/**
* Returns information about an existing socket resource.
* Currently returns four entries in the result array:
*
* <p>
* timed_out (bool) - The socket timed out waiting for data<br>
* blocked (bool) - The socket was blocked<br>
* eof (bool) - Indicates EOF event<br>
* unread_bytes (int) - Number of bytes left in the socket buffer<br>
* </p>
*
* @access public
* @return mixed Array containing information about existing socket resource or an error object otherwise
*/
function getStatus()
{
if (!is_resource($this->fp)) {
return $this->raiseError('not connected');
}
 
return socket_get_status($this->fp);
}
 
/**
* Get a specified line of data
*
* @access public
* @return $size bytes of data from the socket, or a PEAR_Error if
* not connected.
*/
function gets($size)
{
if (!is_resource($this->fp)) {
return $this->raiseError('not connected');
}
 
return @fgets($this->fp, $size);
}
 
/**
* Read a specified amount of data. This is guaranteed to return,
* and has the added benefit of getting everything in one fread()
* chunk; if you know the size of the data you're getting
* beforehand, this is definitely the way to go.
*
* @param integer $size The number of bytes to read from the socket.
* @access public
* @return $size bytes of data from the socket, or a PEAR_Error if
* not connected.
*/
function read($size)
{
if (!is_resource($this->fp)) {
return $this->raiseError('not connected');
}
 
return @fread($this->fp, $size);
}
 
/**
* Write a specified amount of data.
*
* @param string $data Data to write.
* @param integer $blocksize Amount of data to write at once.
* NULL means all at once.
*
* @access public
* @return mixed true on success or an error object otherwise
*/
function write($data, $blocksize = null)
{
if (!is_resource($this->fp)) {
return $this->raiseError('not connected');
}
 
if (is_null($blocksize) && !OS_WINDOWS) {
return fwrite($this->fp, $data);
} else {
if (is_null($blocksize)) {
$blocksize = 1024;
}
 
$pos = 0;
$size = strlen($data);
while ($pos < $size) {
$written = @fwrite($this->fp, substr($data, $pos, $blocksize));
if ($written === false) {
return false;
}
$pos += $written;
}
 
return $pos;
}
}
 
/**
* Write a line of data to the socket, followed by a trailing "\r\n".
*
* @access public
* @return mixed fputs result, or an error
*/
function writeLine($data)
{
if (!is_resource($this->fp)) {
return $this->raiseError('not connected');
}
 
return fwrite($this->fp, $data . "\r\n");
}
 
/**
* Tests for end-of-file on a socket descriptor.
*
* @access public
* @return bool
*/
function eof()
{
return (is_resource($this->fp) && feof($this->fp));
}
 
/**
* Reads a byte of data
*
* @access public
* @return 1 byte of data from the socket, or a PEAR_Error if
* not connected.
*/
function readByte()
{
if (!is_resource($this->fp)) {
return $this->raiseError('not connected');
}
 
return ord(@fread($this->fp, 1));
}
 
/**
* Reads a word of data
*
* @access public
* @return 1 word of data from the socket, or a PEAR_Error if
* not connected.
*/
function readWord()
{
if (!is_resource($this->fp)) {
return $this->raiseError('not connected');
}
 
$buf = @fread($this->fp, 2);
return (ord($buf[0]) + (ord($buf[1]) << 8));
}
 
/**
* Reads an int of data
*
* @access public
* @return integer 1 int of data from the socket, or a PEAR_Error if
* not connected.
*/
function readInt()
{
if (!is_resource($this->fp)) {
return $this->raiseError('not connected');
}
 
$buf = @fread($this->fp, 4);
return (ord($buf[0]) + (ord($buf[1]) << 8) +
(ord($buf[2]) << 16) + (ord($buf[3]) << 24));
}
 
/**
* Reads a zero-terminated string of data
*
* @access public
* @return string, or a PEAR_Error if
* not connected.
*/
function readString()
{
if (!is_resource($this->fp)) {
return $this->raiseError('not connected');
}
 
$string = '';
while (($char = @fread($this->fp, 1)) != "\x00") {
$string .= $char;
}
return $string;
}
 
/**
* Reads an IP Address and returns it in a dot formated string
*
* @access public
* @return Dot formated string, or a PEAR_Error if
* not connected.
*/
function readIPAddress()
{
if (!is_resource($this->fp)) {
return $this->raiseError('not connected');
}
 
$buf = @fread($this->fp, 4);
return sprintf("%s.%s.%s.%s", ord($buf[0]), ord($buf[1]),
ord($buf[2]), ord($buf[3]));
}
 
/**
* Read until either the end of the socket or a newline, whichever
* comes first. Strips the trailing newline from the returned data.
*
* @access public
* @return All available data up to a newline, without that
* newline, or until the end of the socket, or a PEAR_Error if
* not connected.
*/
function readLine()
{
if (!is_resource($this->fp)) {
return $this->raiseError('not connected');
}
 
$line = '';
$timeout = time() + $this->timeout;
while (!feof($this->fp) && (!$this->timeout || time() < $timeout)) {
$line .= @fgets($this->fp, $this->lineLength);
if (substr($line, -1) == "\n") {
return rtrim($line, "\r\n");
}
}
return $line;
}
 
/**
* Read until the socket closes, or until there is no more data in
* the inner PHP buffer. If the inner buffer is empty, in blocking
* mode we wait for at least 1 byte of data. Therefore, in
* blocking mode, if there is no data at all to be read, this
* function will never exit (unless the socket is closed on the
* remote end).
*
* @access public
*
* @return string All data until the socket closes, or a PEAR_Error if
* not connected.
*/
function readAll()
{
if (!is_resource($this->fp)) {
return $this->raiseError('not connected');
}
 
$data = '';
while (!feof($this->fp)) {
$data .= @fread($this->fp, $this->lineLength);
}
return $data;
}
 
/**
* Runs the equivalent of the select() system call on the socket
* with a timeout specified by tv_sec and tv_usec.
*
* @param integer $state Which of read/write/error to check for.
* @param integer $tv_sec Number of seconds for timeout.
* @param integer $tv_usec Number of microseconds for timeout.
*
* @access public
* @return False if select fails, integer describing which of read/write/error
* are ready, or PEAR_Error if not connected.
*/
function select($state, $tv_sec, $tv_usec = 0)
{
if (!is_resource($this->fp)) {
return $this->raiseError('not connected');
}
 
$read = null;
$write = null;
$except = null;
if ($state & NET_SOCKET_READ) {
$read[] = $this->fp;
}
if ($state & NET_SOCKET_WRITE) {
$write[] = $this->fp;
}
if ($state & NET_SOCKET_ERROR) {
$except[] = $this->fp;
}
if (false === ($sr = stream_select($read, $write, $except, $tv_sec, $tv_usec))) {
return false;
}
 
$result = 0;
if (count($read)) {
$result |= NET_SOCKET_READ;
}
if (count($write)) {
$result |= NET_SOCKET_WRITE;
}
if (count($except)) {
$result |= NET_SOCKET_ERROR;
}
return $result;
}
 
}
/tags/Racine_livraison_narmer/api/pear/Net/FTP.php
New file
0,0 → 1,2148
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 
/**
* Net_FTP main file.
*
* This file must be included to use the Net_FTP package.
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Networking
* @package FTP
* @author Tobias Schlitt <toby@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id: FTP.php,v 1.2 2006-10-05 08:55:35 florian Exp $
* @link http://pear.php.net/package/Net_FTP
* @since File available since Release 0.0.1
*/
 
require_once 'PEAR.php';
 
/**
* Option to let the ls() method return only files.
*
* @since 1.3
* @name NET_FTP_FILES_ONLY
* @see Net_FTP::ls()
*/
define('NET_FTP_FILES_ONLY', 0, true);
 
/**
* Option to let the ls() method return only directories.
*
* @since 1.3
* @name NET_FTP_DIRS_ONLY
* @see Net_FTP::ls()
*/
define('NET_FTP_DIRS_ONLY', 1, true);
 
/**
* Option to let the ls() method return directories and files (default).
*
* @since 1.3
* @name NET_FTP_DIRS_FILES
* @see Net_FTP::ls()
*/
define('NET_FTP_DIRS_FILES', 2, true);
 
/**
* Option to let the ls() method return the raw directory listing from ftp_rawlist().
*
* @since 1.3
* @name NET_FTP_RAWLIST
* @see Net_FTP::ls()
*/
define('NET_FTP_RAWLIST', 3, true);
 
 
/**
* Error code to indicate a failed connection
* This error code indicates, that the connection you tryed to set up
* could not be established. Check your connection settings (host & port)!
*
* @since 1.3
* @name NET_FTP_ERR_CONNECT_FAILED
* @see Net_FTP::connect()
*/
define('NET_FTP_ERR_CONNECT_FAILED', -1);
 
/**
* Error code to indicate a failed login
* This error code indicates, that the login to the FTP server failed. Check
* your user data (username & password).
*
* @since 1.3
* @name NET_FTP_ERR_LOGIN_FAILED
* @see Net_FTP::login()
*/
define('NET_FTP_ERR_LOGIN_FAILED', -2);
 
/**
* Error code to indicate a failed directory change
* The cd() method failed. Ensure that the directory you wanted to access exists.
*
* @since 1.3
* @name NET_FTP_ERR_DIRCHANGE_FAILED
* @see Net_FTP::cd()
*/
define('NET_FTP_ERR_DIRCHANGE_FAILED', 2); // Compatibillity reasons!
 
/**
* Error code to indicate that Net_FTP could not determine the current path
* The cwd() method failed and could not determine the path you currently reside
* in on the FTP server.
*
* @since 1.3
* @name NET_FTP_ERR_DETERMINEPATH_FAILED
* @see Net_FTP::pwd()
*/
define('NET_FTP_ERR_DETERMINEPATH_FAILED', 4); // Compatibillity reasons!
 
/**
* Error code to indicate that the creation of a directory failed
* The directory you tryed to create could not be created. Check the
* access rights on the parent directory!
*
* @since 1.3
* @name NET_FTP_ERR_CREATEDIR_FAILED
* @see Net_FTP::mkdir()
*/
define('NET_FTP_ERR_CREATEDIR_FAILED', -4);
 
/**
* Error code to indicate that the EXEC execution failed.
* The execution of a command using EXEC failed. Ensure, that your
* FTP server supports the EXEC command.
*
* @since 1.3
* @name NET_FTP_ERR_EXEC_FAILED
* @see Net_FTP::execute()
*/
define('NET_FTP_ERR_EXEC_FAILED', -5);
 
/**
* Error code to indicate that the SITE command failed.
* The execution of a command using SITE failed. Ensure, that your
* FTP server supports the SITE command.
*
* @since 1.3
* @name NET_FTP_ERR_SITE_FAILED
* @see Net_FTP::site()
*/
define('NET_FTP_ERR_SITE_FAILED', -6);
 
/**
* Error code to indicate that the CHMOD command failed.
* The execution of CHMOD failed. Ensure, that your
* FTP server supports the CHMOD command and that you have the appropriate
* access rights to use CHMOD.
*
* @since 1.3
* @name NET_FTP_ERR_CHMOD_FAILED
* @see Net_FTP::chmod()
*/
define('NET_FTP_ERR_CHMOD_FAILED', -7);
 
/**
* Error code to indicate that a file rename failed
* The renaming of a file on the server failed. Ensure that you have the
* appropriate access rights to rename the file.
*
* @since 1.3
* @name NET_FTP_ERR_RENAME_FAILED
* @see Net_FTP::rename()
*/
define('NET_FTP_ERR_RENAME_FAILED', -8);
 
/**
* Error code to indicate that the MDTM command failed
* The MDTM command is not supported for directories. Ensure that you gave
* a file path to the mdtm() method, not a directory path.
*
* @since 1.3
* @name NET_FTP_ERR_MDTMDIR_UNSUPPORTED
* @see Net_FTP::mdtm()
*/
define('NET_FTP_ERR_MDTMDIR_UNSUPPORTED', -9);
 
/**
* Error code to indicate that the MDTM command failed
* The MDTM command failed. Ensure that your server supports the MDTM command.
*
* @since 1.3
* @name NET_FTP_ERR_MDTM_FAILED
* @see Net_FTP::mdtm()
*/
define('NET_FTP_ERR_MDTM_FAILED', -10);
 
/**
* Error code to indicate that a date returned by the server was misformated
* A date string returned by your server seems to be missformated and could not be
* parsed. Check that the server is configured correctly. If you're sure, please
* send an email to the auhtor with a dumped output of $ftp->ls('./', NET_FTP_RAWLIST);
* to get the date format supported.
*
* @since 1.3
* @name NET_FTP_ERR_DATEFORMAT_FAILED
* @see Net_FTP::mdtm(), Net_FTP::ls()
*/
define('NET_FTP_ERR_DATEFORMAT_FAILED', -11);
 
/**
* Error code to indicate that the SIZE command failed
* The determination of the filesize of a file failed. Ensure that your server supports the
* SIZE command.
*
* @since 1.3
* @name NET_FTP_ERR_SIZE_FAILED
* @see Net_FTP::size()
*/
define('NET_FTP_ERR_SIZE_FAILED', -12);
 
/**
* Error code to indicate that a local file could not be overwritten
* You specified not to overwrite files. Therefore the local file has not been
* overwriten. If you want to get the file overwriten, please set the option to
* do so.
*
* @since 1.3
* @name NET_FTP_ERR_OVERWRITELOCALFILE_FORBIDDEN
* @see Net_FTP::get(), Net_FTP::getRecursive()
*/
define('NET_FTP_ERR_OVERWRITELOCALFILE_FORBIDDEN', -13);
 
/**
* Error code to indicate that a local file could not be overwritten
* Also you specified to overwrite the local file you want to download to,
* it has not been possible to do so. Check that you have the appropriate access
* rights on the local file to overwrite it.
*
* @since 1.3
* @name NET_FTP_ERR_OVERWRITELOCALFILE_FAILED
* @see Net_FTP::get(), Net_FTP::getRecursive()
*/
define('NET_FTP_ERR_OVERWRITELOCALFILE_FAILED', -14);
 
/**
* Error code to indicate that the file you wanted to upload does not exist
* The file you tried to upload does not exist. Ensure that it exists.
*
* @since 1.3
* @name NET_FTP_ERR_LOCALFILENOTEXIST
* @see Net_FTP::put(), Net_FTP::putRecursive()
*/
define('NET_FTP_ERR_LOCALFILENOTEXIST', -15);
 
/**
* Error code to indicate that a remote file could not be overwritten
* You specified not to overwrite files. Therefore the remote file has not been
* overwriten. If you want to get the file overwriten, please set the option to
* do so.
*
* @since 1.3
* @name NET_FTP_ERR_OVERWRITEREMOTEFILE_FORBIDDEN
* @see Net_FTP::put(), Net_FTP::putRecursive()
*/
define('NET_FTP_ERR_OVERWRITEREMOTEFILE_FORBIDDEN', -16);
 
/**
* Error code to indicate that the upload of a file failed
* The upload you tried failed. Ensure that you have appropriate access rights
* to upload the desired file.
*
* @since 1.3
* @name NET_FTP_ERR_UPLOADFILE_FAILED
* @see Net_FTP::put(), Net_FTP::putRecursive()
*/
define('NET_FTP_ERR_UPLOADFILE_FAILED', -17);
 
/**
* Error code to indicate that you specified an incorrect directory path
* The remote path you specified seems not to be a directory. Ensure that
* the path you specify is a directory and that the path string ends with
* a /.
*
* @since 1.3
* @name NET_FTP_ERR_REMOTEPATHNODIR
* @see Net_FTP::putRecursive(), Net_FTP::getRecursive()
*/
define('NET_FTP_ERR_REMOTEPATHNODIR', -18);
 
/**
* Error code to indicate that you specified an incorrect directory path
* The local path you specified seems not to be a directory. Ensure that
* the path you specify is a directory and that the path string ends with
* a /.
*
* @since 1.3
* @name NET_FTP_ERR_LOCALPATHNODIR
* @see Net_FTP::putRecursive(), Net_FTP::getRecursive()
*/
define('NET_FTP_ERR_LOCALPATHNODIR', -19);
 
/**
* Error code to indicate that a local directory failed to be created
* You tried to create a local directory through getRecursive() method,
* which has failed. Ensure that you have the appropriate access rights
* to create it.
*
* @since 1.3
* @name NET_FTP_ERR_CREATELOCALDIR_FAILED
* @see Net_FTP::getRecursive()
*/
define('NET_FTP_ERR_CREATELOCALDIR_FAILED', -20);
 
/**
* Error code to indicate that the provided hostname was incorrect
* The hostname you provided was invalid. Ensure to provide either a
* full qualified domain name or an IP address.
*
* @since 1.3
* @name NET_FTP_ERR_HOSTNAMENOSTRING
* @see Net_FTP::setHostname()
*/
define('NET_FTP_ERR_HOSTNAMENOSTRING', -21);
 
/**
* Error code to indicate that the provided port was incorrect
* The port number you provided was invalid. Ensure to provide either a
* a numeric port number greater zero.
*
* @since 1.3
* @name NET_FTP_ERR_PORTLESSZERO
* @see Net_FTP::setPort()
*/
define('NET_FTP_ERR_PORTLESSZERO', -22);
 
/**
* Error code to indicate that you provided an invalid mode constant
* The mode constant you provided was invalid. You may only provide
* FTP_ASCII or FTP_BINARY.
*
* @since 1.3
* @name NET_FTP_ERR_NOMODECONST
* @see Net_FTP::setMode()
*/
define('NET_FTP_ERR_NOMODECONST', -23);
 
/**
* Error code to indicate that you provided an invalid timeout
* The timeout you provided was invalid. You have to provide a timeout greater
* or equal to zero.
*
* @since 1.3
* @name NET_FTP_ERR_TIMEOUTLESSZERO
* @see Net_FTP::Net_FTP(), Net_FTP::setTimeout()
*/
define('NET_FTP_ERR_TIMEOUTLESSZERO', -24);
 
/**
* Error code to indicate that you provided an invalid timeout
* An error occured while setting the timeout. Ensure that you provide a
* valid integer for the timeount and that your PHP installation works
* correctly.
*
* @since 1.3
* @name NET_FTP_ERR_SETTIMEOUT_FAILED
* @see Net_FTP::Net_FTP(), Net_FTP::setTimeout()
*/
define('NET_FTP_ERR_SETTIMEOUT_FAILED', -25);
 
/**
* Error code to indicate that the provided extension file doesn't exist
* The provided extension file does not exist. Ensure to provided an
* existant extension file.
*
* @since 1.3
* @name NET_FTP_ERR_EXTFILENOTEXIST
* @see Net_FTP::getExtensionFile()
*/
define('NET_FTP_ERR_EXTFILENOTEXIST', -26);
 
/**
* Error code to indicate that the provided extension file is not readable
* The provided extension file is not readable. Ensure to have sufficient
* access rights for it.
*
* @since 1.3
* @name NET_FTP_ERR_EXTFILEREAD_FAILED
* @see Net_FTP::getExtensionFile()
*/
define('NET_FTP_ERR_EXTFILEREAD_FAILED', -27);
 
/**
* Error code to indicate that the deletion of a file failed
* The specified file could not be deleted. Ensure to have sufficient
* access rights to delete the file.
*
* @since 1.3
* @name NET_FTP_ERR_EXTFILEREAD_FAILED
* @see Net_FTP::rm()
*/
define('NET_FTP_ERR_DELETEFILE_FAILED', -28);
 
/**
* Error code to indicate that the deletion of a directory faild
* The specified file could not be deleted. Ensure to have sufficient
* access rights to delete the file.
*
* @since 1.3
* @name NET_FTP_ERR_EXTFILEREAD_FAILED
* @see Net_FTP::rm()
*/
define('NET_FTP_ERR_DELETEDIR_FAILED', -29);
 
/**
* Error code to indicate that the directory listing failed
* PHP could not list the directory contents on the server. Ensure
* that your server is configured appropriate.
*
* @since 1.3
* @name NET_FTP_ERR_RAWDIRLIST_FAILED
* @see Net_FTP::ls()
*/
define('NET_FTP_ERR_RAWDIRLIST_FAILED', -30);
 
/**
* Error code to indicate that the directory listing failed
* The directory listing format your server uses seems not to
* be supported by Net_FTP. Please send the output of the
* call ls('./', NET_FTP_RAWLIST); to the author of this
* class to get it supported.
*
* @since 1.3
* @name NET_FTP_ERR_DIRLIST_UNSUPPORTED
* @see Net_FTP::ls()
*/
define('NET_FTP_ERR_DIRLIST_UNSUPPORTED', -31);
 
/**
* Error code to indicate failed disconnecting
* This error code indicates, that disconnection was not possible.
*
* @since 1.3
* @name NET_FTP_ERR_DISCONNECT_FAILED
* @see Net_FTP::disconnect()
*/
define('NET_FTP_ERR_DISCONNECT_FAILED', -32);
 
/**
* Error code to indicate that the username you provided was invalid.
* Check that you provided a non-empty string as the username.
*
* @since 1.3
* @name NET_FTP_ERR_USERNAMENOSTRING
* @see Net_FTP::setUsername()
*/
define('NET_FTP_ERR_USERNAMENOSTRING', -33);
 
/**
* Error code to indicate that the username you provided was invalid.
* Check that you provided a non-empty string as the username.
*
* @since 1.3
* @name NET_FTP_ERR_PASSWORDNOSTRING
* @see Net_FTP::setPassword()
*/
define('NET_FTP_ERR_PASSWORDNOSTRING', -33);
 
/**
* Class for comfortable FTP-communication
*
* This class provides comfortable communication with FTP-servers. You may do everything
* enabled by the PHP-FTP-extension and further functionalities, like recursive-deletion,
* -up- and -download. Another feature is to create directories recursively.
*
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @category Networking
* @package FTP
* @author Tobias Schlitt <toby@php.net>
* @copyright 1997-2005 The PHP Group
* @version Release: @package_version@
* @link http://pear.php.net/package/Net_FTP
* @since 0.0.1
* @access public
*/
class Net_FTP extends PEAR
{
/**
* The host to connect to
*
* @access private
* @var string
*/
var $_hostname;
 
/**
* The port for ftp-connection (standard is 21)
*
* @access private
* @var int
*/
var $_port = 21;
 
/**
* The username for login
*
* @access private
* @var string
*/
var $_username;
 
/**
* The password for login
*
* @access private
* @var string
*/
var $_password;
 
/**
* Determine whether to use passive-mode (true) or active-mode (false)
*
* @access private
* @var bool
*/
var $_passv;
 
/**
* The standard mode for ftp-transfer
*
* @access private
* @var int
*/
var $_mode = FTP_BINARY;
 
/**
* This holds the handle for the ftp-connection
*
* @access private
* @var resource
*/
var $_handle;
 
/**
* Contains the timeout for FTP operations
*
* @access private
* @var int
* @since 1.3
*/
var $_timeout = 90;
/**
* Saves file-extensions for ascii- and binary-mode
*
* The array contains 2 sub-arrays ("ascii" and "binary"), which both contain
* file-extensions without the "." (".php" = "php").
*
* @access private
* @var array
*/
var $_file_extensions;
 
/**
* ls match
* Matches the ls entries against a regex and maps the resulting array to speaking names
*
* @access private
* @var array
* @since 1.3
*/
var $_ls_match = array(
'unix' => array(
'pattern' => '/(?:(d)|.)([rwxt-]+)\s+(\w+)\s+([\w\d-]+)\s+([\w\d-]+)\s+(\w+)\s+(\S+\s+\S+\s+\S+)\s+(.+)/',
'map' => array(
'is_dir' => 1,
'rights' => 2,
'files_inside' => 3,
'user' => 4,
'group' => 5,
'size' => 6,
'date' => 7,
'name' => 8,
)
),
'windows' => array(
'pattern' => '/(.+)\s+(.+)\s+((<DIR>)|[0-9]+)\s+(.+)/',
'map' => array(
'name' => 5,
'date' => 1,
'size' => 3,
'is_dir' => 4,
)
)
);
/**
* matcher
* Stores the matcher for the current connection
*
* @access private
* @var array
* @since 1.3
*/
var $_matcher = null;
/**
* Holds all Net_FTP_Observer objects
* that wish to be notified of new messages.
*
* @var array
* @access private
* @since 1.3
*/
var $_listeners = array();
 
/**
* This generates a new FTP-Object. The FTP-connection will not be established, yet.
* You can leave $host and $port blank, if you want. The $host will not be set
* and the $port will be left at 21. You have to set the $host manualy before
* trying to connect or with the connect() method.
*
* @access public
* @param string $host (optional) The hostname
* @param int $port (optional) The port
* @param int $timeout (optional) Sets the standard timeout
* @return void
* @see Net_FTP::setHostname(), Net_FTP::setPort(), Net_FTP::connect()
*/
function Net_FTP($host = null, $port = null, $timeout = 90)
{
$this->PEAR();
if (isset($host)) {
$this->setHostname($host);
}
if (isset($port)) {
$this->setPort($port);
}
$this->_timeout = $timeout;
$this->_file_extensions[FTP_ASCII] = array();
$this->_file_extensions[FTP_BINARY] = array();
}
 
/**
* This function generates the FTP-connection. You can optionally define a
* hostname and/or a port. If you do so, this data is stored inside the object.
*
* @access public
* @param string $host (optional) The Hostname
* @param int $port (optional) The Port
* @return mixed True on success, otherwise PEAR::Error
* @see NET_FTP_ERR_CONNECT_FAILED
*/
function connect($host = null, $port = null)
{
$this->_matcher = null;
if (isset($host)) {
$this->setHostname($host);
}
if (isset($port)) {
$this->setPort($port);
}
$handle = @ftp_connect($this->getHostname(), $this->getPort(), $this->_timeout);
if (!$handle) {
return $this->raiseError("Connection to host failed", NET_FTP_ERR_CONNECT_FAILED);
} else {
$this->_handle =& $handle;
return true;
}
}
 
/**
* This function close the FTP-connection
*
* @access public
* @return bool|PEAR_Error Returns true on success, PEAR_Error on failure
*/
function disconnect()
{
$res = @ftp_close($this->_handle);
if (!$res) {
return PEAR::raiseError('Disconnect failed.', NET_FTP_ERR_DISCONNECT_FAILED);
}
return true;
}
 
/**
* This logges you into the ftp-server. You are free to specify username and password
* in this method. If you specify it, the values will be taken into the corresponding
* attributes, if do not specify, the attributes are taken.
*
* @access public
* @param string $username (optional) The username to use
* @param string $password (optional) The password to use
* @return mixed True on success, otherwise PEAR::Error
* @see NET_FTP_ERR_LOGIN_FAILED
*/
function login($username = null, $password = null)
{
if (!isset($username)) {
$username = $this->getUsername();
} else {
$this->setUsername($username);
}
 
if (!isset($password)) {
$password = $this->getPassword();
} else {
$this->setPassword($password);
}
 
$res = @ftp_login($this->_handle, $username, $password);
 
if (!$res) {
return $this->raiseError("Unable to login", NET_FTP_ERR_LOGIN_FAILED);
} else {
return true;
}
}
 
/**
* This changes the currently used directory. You can use either an absolute
* directory-path (e.g. "/home/blah") or a relative one (e.g. "../test").
*
* @access public
* @param string $dir The directory to go to.
* @return mixed True on success, otherwise PEAR::Error
* @see NET_FTP_ERR_DIRCHANGE_FAILED
*/
function cd($dir)
{
$erg = @ftp_chdir($this->_handle, $dir);
if (!$erg) {
return $this->raiseError("Directory change failed", NET_FTP_ERR_DIRCHANGE_FAILED);
} else {
return true;
}
}
 
/**
* Show's you the actual path on the server
* This function questions the ftp-handle for the actual selected path and returns it.
*
* @access public
* @return mixed The actual path or PEAR::Error
* @see NET_FTP_ERR_DETERMINEPATH_FAILED
*/
function pwd()
{
$res = @ftp_pwd($this->_handle);
if (!$res) {
return $this->raiseError("Could not determine the actual path.", NET_FTP_ERR_DETERMINEPATH_FAILED);
} else {
return $res;
}
}
 
/**
* This works similar to the mkdir-command on your local machine. You can either give
* it an absolute or relative path. The relative path will be completed with the actual
* selected server-path. (see: pwd())
*
* @access public
* @param string $dir Absolute or relative dir-path
* @param bool $recursive (optional) Create all needed directories
* @return mixed True on success, otherwise PEAR::Error
* @see NET_FTP_ERR_CREATEDIR_FAILED
*/
function mkdir($dir, $recursive = false)
{
$dir = $this->_construct_path($dir);
$savedir = $this->pwd();
$this->pushErrorHandling(PEAR_ERROR_RETURN);
$e = $this->cd($dir);
$this->popErrorHandling();
if ($e === true) {
$this->cd($savedir);
return true;
}
$this->cd($savedir);
if ($recursive === false){
$res = @ftp_mkdir($this->_handle, $dir);
if (!$res) {
return $this->raiseError("Creation of '$dir' failed", NET_FTP_ERR_CREATEDIR_FAILED);
} else {
return true;
}
} else {
if(strpos($dir, '/') === false) {
return $this->mkdir($dir,false);
}
$pos = 0;
$res = $this->mkdir(dirname($dir), true);
$res = $this->mkdir($dir, false);
if ($res !== true) {
return $res;
}
return true;
}
}
 
/**
* This method tries executing a command on the ftp, using SITE EXEC.
*
* @access public
* @param string $command The command to execute
* @return mixed The result of the command (if successfull), otherwise PEAR::Error
* @see NET_FTP_ERR_EXEC_FAILED
*/
function execute($command)
{
$res = @ftp_exec($this->_handle, $command);
if (!$res) {
return $this->raiseError("Execution of command '$command' failed.", NET_FTP_ERR_EXEC_FAILED);
} else {
return $res;
}
}
 
/**
* Execute a SITE command on the server
* This method tries to execute a SITE command on the ftp server.
*
* @access public
* @param string $command The command with parameters to execute
* @return mixed True if successful, otherwise PEAR::Error
* @see NET_FTP_ERR_SITE_FAILED
*/
function site($command)
{
$res = @ftp_site($this->_handle, $command);
if (!$res) {
return $this->raiseError("Execution of SITE command '$command' failed.", NET_FTP_ERR_SITE_FAILED);
} else {
return $res;
}
}
 
/**
* This method will try to chmod the file specified on the server
* Currently, you must give a number as the the permission argument (777 or
* similar). The file can be either a relative or absolute path.
* NOTE: Some servers do not support this feature. In that case, you will
* get a PEAR error object returned. If successful, the method returns true
*
* @access public
* @param mixed $target The file or array of files to set permissions for
* @param integer $permissions The mode to set the file permissions to
* @return mixed True if successful, otherwise PEAR::Error
* @see NET_FTP_ERR_CHMOD_FAILED
*/
function chmod($target, $permissions)
{
// If $target is an array: Loop through it.
if (is_array($target)) {
 
for ($i = 0; $i < count($target); $i++) {
$res = $this->chmod($target[$i], $permissions);
if (PEAR::isError($res)) {
return $res;
} // end if isError
} // end for i < count($target)
 
} else {
 
$res = $this->site("CHMOD " . $permissions . " " . $target);
if (!$res) {
return PEAR::raiseError("CHMOD " . $permissions . " " . $target . " failed", NET_FTP_ERR_CHMOD_FAILED);
} else {
return $res;
}
 
} // end if is_array
 
} // end method chmod
 
/**
* This method will try to chmod a folder and all of its contents
* on the server. The target argument must be a folder or an array of folders
* and the permissions argument have to be an integer (i.e. 777).
* The file can be either a relative or absolute path.
* NOTE: Some servers do not support this feature. In that case, you
* will get a PEAR error object returned. If successful, the method
* returns true
*
* @access public
* @param mixed $target The folder or array of folders to
* set permissions for
* @param integer $permissions The mode to set the folder
* and file permissions to
* @return mixed True if successful, otherwise PEAR::Error
* @see NET_FTP_ERR_CHMOD_FAILED, NET_FTP_ERR_DETERMINEPATH_FAILED, NET_FTP_ERR_RAWDIRLIST_FAILED, NET_FTP_ERR_DIRLIST_UNSUPPORTED
*/
function chmodRecursive($target, $permissions)
{
static $dir_permissions;
 
if(!isset($dir_permissions)){ // Making directory specific permissions
$dir_permissions = $this->_makeDirPermissions($permissions);
}
 
// If $target is an array: Loop through it
if (is_array($target)) {
 
for ($i = 0; $i < count($target); $i++) {
$res = $this->chmodRecursive($target[$i], $permissions);
if (PEAR::isError($res)) {
return $res;
} // end if isError
} // end for i < count($target)
 
} else {
 
$remote_path = $this->_construct_path($target);
 
// Chmod the directory itself
$result = $this->chmod($remote_path, $dir_permissions);
 
if (PEAR::isError($result)) {
return $result;
}
 
// If $remote_path last character is not a slash, add one
if (substr($remote_path, strlen($remote_path)-1) != "/") {
 
$remote_path .= "/";
}
 
$dir_list = array();
$mode = NET_FTP_DIRS_ONLY;
$dir_list = $this->ls($remote_path, $mode);
foreach ($dir_list as $dir_entry) {
if ($dir_entry == '.' || $dir_entry == '..') {;
continue;
}
$remote_path_new = $remote_path.$dir_entry["name"]."/";
 
// Chmod the directory we're about to enter
$result = $this->chmod($remote_path_new, $dir_permissions);
 
if (PEAR::isError($result)) {
return $result;
}
 
$result = $this->chmodRecursive($remote_path_new, $permissions);
 
if (PEAR::isError($result)) {
return $result;
}
 
} // end foreach dir_list as dir_entry
 
$file_list = array();
$mode = NET_FTP_FILES_ONLY;
$file_list = $this->ls($remote_path, $mode);
 
foreach ($file_list as $file_entry) {
 
$remote_file = $remote_path.$file_entry["name"];
 
$result = $this->chmod($remote_file, $permissions);
 
if (PEAR::isError($result)) {
return $result;
}
 
} // end foreach $file_list
 
} // end if is_array
 
return true; // No errors
 
} // end method chmodRecursive
 
/**
* Rename or move a file or a directory from the ftp-server
*
* @access public
* @param string $remote_from The remote file or directory original to rename or move
* @param string $remote_to The remote file or directory final to rename or move
* @return bool $res True on success, otherwise PEAR::Error
* @see NET_FTP_ERR_RENAME_FAILED
*/
 
function rename ($remote_from, $remote_to)
{
$res = @ftp_rename($this->_handle, $remote_from, $remote_to);
if(!$res) {
return $this->raiseError("Could not rename ".$remote_from." to ".$remote_to." !", NET_FTP_ERR_RENAME_FAILED);
}
return true;
}
 
/**
* This will return logical permissions mask for directory.
* if directory have to be writeable it have also be executable
*
* @access private
* @param string $permissions File permissions in digits for file (i.e. 666)
* @return string File permissions in digits for directory (i.e. 777)
*/
 
function _makeDirPermissions($permissions){
$permissions = (string)$permissions;
 
for($i = 0; $i < strlen($permissions); $i++){ // going through (user, group, world)
if((int)$permissions{$i} & 4 and !((int)$permissions{$i} & 1)){ // Read permission is set
// but execute not yet
(int)$permissions{$i} = (int)$permissions{$i} + 1; // Adding execute flag
}
}
 
return (string)$permissions;
}
 
/**
* This will return the last modification-time of a file. You can either give this
* function a relative or an absolute path to the file to check.
* NOTE: Some servers will not support this feature and the function works
* only on files, not directories! When successful,
* it will return the last modification-time as a unix-timestamp or, when $format is
* specified, a preformated timestring.
*
* @access public
* @param string $file The file to check
* @param string $format (optional) The format to give the date back
* if not set, it will return a Unix timestamp
* @return mixed Unix timestamp, a preformated date-string or PEAR::Error
* @see NET_FTP_ERR_MDTMDIR_UNSUPPORTED, NET_FTP_ERR_MDTM_FAILED, NET_FTP_ERR_DATEFORMAT_FAILED
*/
function mdtm($file, $format = null)
{
$file = $this->_construct_path($file);
if ($this->_check_dir($file)) {
return $this->raiseError("Filename '$file' seems to be a directory.", NET_FTP_ERR_MDTMDIR_UNSUPPORTED);
}
$res = @ftp_mdtm($this->_handle, $file);
if ($res == -1) {
return $this->raiseError("Could not get last-modification-date of '$file'.", NET_FTP_ERR_MDTM_FAILED);
}
if (isset($format)) {
$res = date($format, $res);
if (!$res) {
return $this->raiseError("Date-format failed on timestamp '$res'.", NET_FTP_ERR_DATEFORMAT_FAILED);
}
}
return $res;
}
 
/**
* This will return the size of a given file in bytes. You can either give this function
* a relative or an absolute file-path. NOTE: Some servers do not support this feature!
*
* @access public
* @param string $file The file to check
* @return mixed Size in bytes or PEAR::Error
* @see NET_FTP_ERR_SIZE_FAILED
*/
function size($file)
{
$file = $this->_construct_path($file);
$res = @ftp_size($this->_handle, $file);
if ($res == -1) {
return $this->raiseError("Could not determine filesize of '$file'.", NET_FTP_ERR_SIZE_FAILED);
} else {
return $res;
}
}
 
/**
* This method returns a directory-list of the current directory or given one.
* To display the current selected directory, simply set the first parameter to null
* or leave it blank, if you do not want to use any other parameters.
* <BR><BR>
* There are 4 different modes of listing directories. Either to list only
* the files (using NET_FTP_FILES_ONLY), to list only directories (using
* NET_FTP_DIRS_ONLY) or to show both (using NET_FTP_DIRS_FILES, which is default).
* <BR><BR>
* The 4th one is the NET_FTP_RAWLIST, which returns just the array created by the
* ftp_rawlist()-function build into PHP.
* <BR><BR>
* The other function-modes will return an array containing the requested data.
* The files and dirs are listed in human-sorted order, but if you select
* NET_FTP_DIRS_FILES the directories will be added above the files,
* but although both sorted.
* <BR><BR>
* All elements in the arrays are associative arrays themselves. The have the following
* structure:
* <BR><BR>
* Dirs:<BR>
* ["name"] => string The name of the directory<BR>
* ["rights"] => string The rights of the directory (in style "rwxr-xr-x")<BR>
* ["user"] => string The owner of the directory<BR>
* ["group"] => string The group-owner of the directory<BR>
* ["files_inside"]=> string The number of files/dirs inside the directory
* excluding "." and ".."<BR>
* ["date"] => int The creation-date as Unix timestamp<BR>
* ["is_dir"] => bool true, cause this is a dir<BR>
* <BR><BR>
* Files:<BR>
* ["name"] => string The name of the file<BR>
* ["size"] => int Size in bytes<BR>
* ["rights"] => string The rights of the file (in style "rwxr-xr-x")<BR>
* ["user"] => string The owner of the file<BR>
* ["group"] => string The group-owner of the file<BR>
* ["date"] => int The creation-date as Unix timestamp<BR>
* ["is_dir"] => bool false, cause this is a file<BR>
*
* @access public
* @param string $dir (optional) The directory to list or null, when listing the current directory.
* @param int $mode (optional) The mode which types to list (files, directories or both).
* @return mixed The directory list as described above or PEAR::Error on failure.
* @see NET_FTP_DIRS_FILES, NET_FTP_DIRS_ONLY, NET_FTP_FILES_ONLY, NET_FTP_RAWLIST, NET_FTP_ERR_DETERMINEPATH_FAILED, NET_FTP_ERR_RAWDIRLIST_FAILED, NET_FTP_ERR_DIRLIST_UNSUPPORTED
*/
function ls($dir = null, $mode = NET_FTP_DIRS_FILES)
{
if (!isset($dir)) {
$dir = @ftp_pwd($this->_handle);
if (!$dir) {
return $this->raiseError("Could not retrieve current directory", NET_FTP_ERR_DETERMINEPATH_FAILED);
}
}
if (($mode != NET_FTP_FILES_ONLY) && ($mode != NET_FTP_DIRS_ONLY) && ($mode != NET_FTP_RAWLIST)) {
$mode = NET_FTP_DIRS_FILES;
}
 
switch ($mode) {
case NET_FTP_DIRS_FILES: $res = $this->_ls_both ( $dir );
break;
case NET_FTP_DIRS_ONLY: $res = $this->_ls_dirs ( $dir );
break;
case NET_FTP_FILES_ONLY: $res = $this->_ls_files ( $dir );
break;
case NET_FTP_RAWLIST: $res = @ftp_rawlist($this->_handle, $dir);
break;
}
 
return $res;
}
 
/**
* This method will delete the given file or directory ($path) from the server
* (maybe recursive).
*
* Whether the given string is a file or directory is only determined by the last
* sign inside the string ("/" or not).
*
* If you specify a directory, you can optionally specify $recursive as true,
* to let the directory be deleted recursive (with all sub-directories and files
* inherited).
*
* You can either give a absolute or relative path for the file / dir. If you choose to
* use the relative path, it will be automatically completed with the actual
* selected directory.
*
* @access public
* @param string $path The absolute or relative path to the file / directory.
* @param bool $recursive (optional)
* @return mixed True on success, otherwise PEAR::Error
* @see NET_FTP_ERR_DELETEFILE_FAILED, NET_FTP_ERR_DELETEDIR_FAILED, NET_FTP_ERR_REMOTEPATHNODIR
*/
function rm($path, $recursive = false)
{
$path = $this->_construct_path($path);
 
if ($this->_check_dir($path)) {
if ($recursive) {
return $this->_rm_dir_recursive($path);
} else {
return $this->_rm_dir($path);
}
} else {
return $this->_rm_file($path);
}
}
 
/**
* This function will download a file from the ftp-server. You can either spcify a absolute
* path to the file (beginning with "/") or a relative one, which will be completed
* with the actual directory you selected on the server. You can specify
* the path to which the file will be downloaded on the local
* maschine, if the file should be overwritten if it exists (optionally, default is
* no overwriting) and in which mode (FTP_ASCII or FTP_BINARY) the file should be
* downloaded (if you do not specify this, the method tries to determine it automatically
* from the mode-directory or uses the default-mode, set by you). If you give a relative
* path to the local-file, the script-path is used as basepath.
*
* @access public
* @param string $remote_file The absolute or relative path to the file to download
* @param string $local_file The local file to put the downloaded in
* @param bool $overwrite (optional) Whether to overwrite existing file
* @param int $mode (optional) Either FTP_ASCII or FTP_BINARY
* @return mixed True on success, otherwise PEAR::Error
* @see NET_FTP_ERR_OVERWRITELOCALFILE_FORBIDDEN, NET_FTP_ERR_OVERWRITELOCALFILE_FAILED, NET_FTP_ERR_OVERWRITELOCALFILE_FAILED
*/
function get($remote_file, $local_file, $overwrite = false, $mode = null)
{
if (!isset($mode)) {
$mode = $this->checkFileExtension($remote_file);
}
 
$remote_file = $this->_construct_path($remote_file);
 
if (@file_exists($local_file) && !$overwrite) {
return $this->raiseError("Local file '$local_file' exists and may not be overwriten.", NET_FTP_ERR_OVERWRITELOCALFILE_FORBIDDEN);
}
if (@file_exists($local_file) && !@is_writeable($local_file) && $overwrite) {
return $this->raiseError("Local file '$local_file' is not writeable. Can not overwrite.", NET_FTP_ERR_OVERWRITELOCALFILE_FAILED);
}
 
if (@function_exists('ftp_nb_get')){
$res = @ftp_nb_get($this->_handle, $local_file, $remote_file, $mode);
while ($res == FTP_MOREDATA) {
$this->_announce('nb_get');
$res = @ftp_nb_continue ($this->_handle);
}
} else {
$res = @ftp_get($this->_handle, $local_file, $remote_file, $mode);
}
if (!$res) {
return $this->raiseError("File '$remote_file' could not be downloaded to '$local_file'.", NET_FTP_ERR_OVERWRITELOCALFILE_FAILED);
} else {
return true;
}
}
 
/**
* This function will upload a file to the ftp-server. You can either specify a absolute
* path to the remote-file (beginning with "/") or a relative one, which will be completed
* with the actual directory you selected on the server. You can specify
* the path from which the file will be uploaded on the local
* maschine, if the file should be overwritten if it exists (optionally, default is
* no overwriting) and in which mode (FTP_ASCII or FTP_BINARY) the file should be
* downloaded (if you do not specify this, the method tries to determine it automatically
* from the mode-directory or uses the default-mode, set by you). If you give a relative
* path to the local-file, the script-path is used as basepath.
*
* @access public
* @param string $local_file The local file to upload
* @param string $remote_file The absolute or relative path to the file to upload to
* @param bool $overwrite (optional) Whether to overwrite existing file
* @param int $mode (optional) Either FTP_ASCII or FTP_BINARY
* @return mixed True on success, otherwise PEAR::Error
* @see NET_FTP_ERR_LOCALFILENOTEXIST, NET_FTP_ERR_OVERWRITEREMOTEFILE_FORBIDDEN, NET_FTP_ERR_UPLOADFILE_FAILED
*/
function put($local_file, $remote_file, $overwrite = false, $mode = null)
{
if (!isset($mode)) {
$mode = $this->checkFileExtension($local_file);
}
$remote_file = $this->_construct_path($remote_file);
 
if (!@file_exists($local_file)) {
return $this->raiseError("Local file '$local_file' does not exist.", NET_FTP_ERR_LOCALFILENOTEXIST);
}
if ((@ftp_size($this->_handle, $remote_file) != -1) && !$overwrite) {
return $this->raiseError("Remote file '$remote_file' exists and may not be overwriten.", NET_FTP_ERR_OVERWRITEREMOTEFILE_FORBIDDEN);
}
 
if (function_exists('ftp_nb_put')){
$res = @ftp_nb_put($this->_handle, $remote_file, $local_file, $mode);
while ($res == FTP_MOREDATA) {
$this->_announce('nb_put');
$res = @ftp_nb_continue($this->_handle);
}
 
} else {
$res = @ftp_put($this->_handle, $remote_file, $local_file, $mode);
}
if (!$res) {
return $this->raiseError("File '$local_file' could not be uploaded to '$remote_file'.", NET_FTP_ERR_UPLOADFILE_FAILED);
} else {
return true;
}
}
 
/**
* This functionality allows you to transfer a whole directory-structure from the
* remote-ftp to your local host. You have to give a remote-directory (ending with
* '/') and the local directory (ending with '/') where to put the files you download.
* The remote path is automatically completed with the current-remote-dir, if you give
* a relative path to this function. You can give a relative path for the $local_path,
* too. Then the script-basedir will be used for comletion of the path.
* The parameter $overwrite will determine, whether to overwrite existing files or not.
* Standard for this is false. Fourth you can explicitly set a mode for all transfer-
* actions done. If you do not set this, the method tries to determine the transfer-
* mode by checking your mode-directory for the file-extension. If the extension is not
* inside the mode-directory, it will get your default-mode.
*
* @access public
* @param string $remote_path The path to download
* @param string $local_path The path to download to
* @param bool $overwrite (optional) Whether to overwrite existing files (true) or not (false, standard).
* @param int $mode (optional) The transfermode (either FTP_ASCII or FTP_BINARY).
* @return mixed True on succes, otherwise PEAR::Error
* @see NET_FTP_ERR_OVERWRITELOCALFILE_FORBIDDEN, NET_FTP_ERR_OVERWRITELOCALFILE_FAILED, NET_FTP_ERR_OVERWRITELOCALFILE_FAILED, NET_FTP_ERR_REMOTEPATHNODIR, NET_FTP_ERR_LOCALPATHNODIR,NET_FTP_ERR_CREATELOCALDIR_FAILED
*/
function getRecursive($remote_path, $local_path, $overwrite = false, $mode = null)
{
$remote_path = $this->_construct_path($remote_path);
if (!$this->_check_dir($remote_path)) {
return $this->raiseError("Given remote-path '$remote_path' seems not to be a directory.", NET_FTP_ERR_REMOTEPATHNODIR);
}
if (!$this->_check_dir($local_path)) {
return $this->raiseError("Given local-path '$local_path' seems not to be a directory.", NET_FTP_ERR_LOCALPATHNODIR);
}
 
if (!@is_dir($local_path)) {
$res = @mkdir($local_path);
if (!$res) {
return $this->raiseError("Could not create dir '$local_path'", NET_FTP_ERR_CREATELOCALDIR_FAILED);
}
}
$dir_list = array();
$dir_list = $this->ls($remote_path, NET_FTP_DIRS_ONLY);
foreach ($dir_list as $dir_entry) {
if ($dir_entry['name'] != '.' && $dir_entry['name'] != '..') {
$remote_path_new = $remote_path.$dir_entry["name"]."/";
$local_path_new = $local_path.$dir_entry["name"]."/";
$result = $this->getRecursive($remote_path_new, $local_path_new, $overwrite, $mode);
if ($this->isError($result)) {
return $result;
}
}
}
$file_list = array();
$file_list = $this->ls($remote_path, NET_FTP_FILES_ONLY);
foreach ($file_list as $file_entry) {
$remote_file = $remote_path.$file_entry["name"];
$local_file = $local_path.$file_entry["name"];
$result = $this->get($remote_file, $local_file, $overwrite, $mode);
if ($this->isError($result)) {
return $result;
}
}
return true;
}
 
/**
* This functionality allows you to transfer a whole directory-structure from your
* local host to the remote-ftp. You have to give a remote-directory (ending with
* '/') and the local directory (ending with '/') where to put the files you download.
* The remote path is automatically completed with the current-remote-dir, if you give
* a relative path to this function. You can give a relative path for the $local_path,
* too. Then the script-basedir will be used for comletion of the path.
* The parameter $overwrite will determine, whether to overwrite existing files or not.
* Standard for this is false. Fourth you can explicitly set a mode for all transfer-
* actions done. If you do not set this, the method tries to determine the transfer-
* mode by checking your mode-directory for the file-extension. If the extension is not
* inside the mode-directory, it will get your default-mode.
*
* @access public
* @param string $remote_path The path to download
* @param string $local_path The path to download to
* @param bool $overwrite (optional) Whether to overwrite existing files (true) or not (false, standard).
* @param int $mode (optional) The transfermode (either FTP_ASCII or FTP_BINARY).
* @return mixed True on succes, otherwise PEAR::Error
* @see NET_FTP_ERR_LOCALFILENOTEXIST, NET_FTP_ERR_OVERWRITEREMOTEFILE_FORBIDDEN, NET_FTP_ERR_UPLOADFILE_FAILED, NET_FTP_ERR_LOCALPATHNODIR, NET_FTP_ERR_REMOTEPATHNODIR
*/
function putRecursive($local_path, $remote_path, $overwrite = false, $mode = null)
{
$remote_path = $this->_construct_path($remote_path);
if (!$this->_check_dir($local_path) || !is_dir($local_path)) {
return $this->raiseError("Given local-path '$local_path' seems not to be a directory.", NET_FTP_ERR_LOCALPATHNODIR);
}
if (!$this->_check_dir($remote_path)) {
return $this->raiseError("Given remote-path '$remote_path' seems not to be a directory.", NET_FTP_ERR_REMOTEPATHNODIR);
}
$old_path = $this->pwd();
if ($this->isError($this->cd($remote_path))) {
$res = $this->mkdir($remote_path);
if ($this->isError($res)) {
return $res;
}
}
$this->cd($old_path);
$dir_list = $this->_ls_local($local_path);
foreach ($dir_list["dirs"] as $dir_entry) {
$remote_path_new = $remote_path.$dir_entry."/";
$local_path_new = $local_path.$dir_entry."/";
$result = $this->putRecursive($local_path_new, $remote_path_new, $overwrite, $mode);
if ($this->isError($result)) {
return $result;
}
}
 
foreach ($dir_list["files"] as $file_entry) {
$remote_file = $remote_path.$file_entry;
$local_file = $local_path.$file_entry;
$result = $this->put($local_file, $remote_file, $overwrite, $mode);
if ($this->isError($result)) {
return $result;
}
}
return true;
}
 
/**
* This checks, whether a file should be transfered in ascii- or binary-mode
* by it's file-extension. If the file-extension is not set or
* the extension is not inside one of the extension-dirs, the actual set
* transfer-mode is returned.
*
* @access public
* @param string $filename The filename to be checked
* @return int Either FTP_ASCII or FTP_BINARY
*/
function checkFileExtension($filename)
{
$pattern = "/\.(.*)$/";
$has_extension = preg_match($pattern, $filename, $eregs);
if (!$has_extension) {
return $this->_mode;
} else {
$ext = $eregs[1];
}
 
if (!empty($this->_file_extensions[$ext])) {
return $this->_file_extensions[$ext];
}
 
return $this->_mode;
}
 
/**
* Set the Hostname
*
* @access public
* @param string $host The Hostname to set
* @return bool True on success, otherwise PEAR::Error
* @see NET_FTP_ERR_HOSTNAMENOSTRING
*/
function setHostname($host)
{
if (!is_string($host)) {
return PEAR::raiseError("Hostname must be a string.", NET_FTP_ERR_HOSTNAMENOSTRING);
}
$this->_hostname = $host;
return true;
}
 
/**
* Set the Port
*
* @access public
* @param int $port The Port to set
* @return bool True on success, otherwise PEAR::Error
* @see NET_FTP_ERR_PORTLESSZERO
*/
function setPort($port)
{
if (!is_int($port) || ($port < 0)) {
PEAR::raiseError("Invalid port. Has to be integer >= 0", NET_FTP_ERR_PORTLESSZERO);
}
$this->_port = $port;
return true;
}
 
/**
* Set the Username
*
* @access public
* @param string $user The Username to set
* @return mixed True on success, otherwise PEAR::Error
* @see NET_FTP_ERR_USERNAMENOSTRING
*/
function setUsername($user)
{
if (empty($user) || !is_string($user)) {
return PEAR::raiseError('Username $user invalid.', NET_FTP_ERR_USERNAMENOSTRING);
}
$this->_username = $user;
}
 
/**
* Set the Password
*
* @access private
* @param string $password The Password to set
* @return void
* @see NET_FTP_ERR_PASSWORDNOSTRING
*/
function setPassword($password)
{
if (empty($password) || !is_string($password)) {
return PEAR::raiseError('Password xxx invalid.', NET_FTP_ERR_PASSWORDNOSTRING);
}
$this->_password = $password;
}
 
/**
* Set the transfer-mode. You can use the predefined constants
* FTP_ASCII or FTP_BINARY. The mode will be stored for any further transfers.
*
* @access public
* @param int $mode The mode to set
* @return mixed True on success, otherwise PEAR::Error
* @see NET_FTP_ERR_NOMODECONST
*/
function setMode($mode)
{
if (($mode == FTP_ASCII) || ($mode == FTP_BINARY)) {
$this->_mode = $mode;
return true;
} else {
return $this->raiseError('FTP-Mode has either to be FTP_ASCII or FTP_BINARY', NET_FTP_ERR_NOMODECONST);
}
}
 
/**
* Set the transfer-method to passive mode
*
* @access public
* @return void
*/
function setPassive()
{
$this->_passv = true;
@ftp_pasv($this->_handle, true);
}
 
/**
* Set the transfer-method to active mode
*
* @access public
* @return void
*/
function setActive()
{
$this->_passv = false;
@ftp_pasv($this->_handle, false);
}
 
/**
* Set the timeout for FTP operations
* Use this method to set a timeout for FTP operation. Timeout has to be an integer.
*
* @acess public
* @param int $timeout the timeout to use
* @return bool True on success, otherwise PEAR::Error
* @see NET_FTP_ERR_TIMEOUTLESSZERO, NET_FTP_ERR_SETTIMEOUT_FAILED
*/
function setTimeout ( $timeout = 0 )
{
if (!is_int($timeout) || ($timeout < 0)) {
return PEAR::raiseError("Timeout $timeout is invalid, has to be an integer >= 0", NET_FTP_ERR_TIMEOUTLESSZERO);
}
$this->_timeout = $timeout;
if (isset($this->_handle) && is_resource($this->_handle)) {
$res = @ftp_set_option($this->_handle, FTP_TIMEOUT_SEC, $timeout);
} else {
$res = true;
}
if (!$res) {
return PEAR::raiseError("Set timeout failed.", NET_FTP_ERR_SETTIMEOUT_FAILED);
}
return true;
}
/**
* Adds an extension to a mode-directory
* The mode-directory saves file-extensions coresponding to filetypes
* (ascii e.g.: 'php', 'txt', 'htm',...; binary e.g.: 'jpg', 'gif', 'exe',...).
* The extensions have to be saved without the '.'. And
* can be predefined in an external file (see: getExtensionsFile()).
*
* The array is build like this: 'php' => FTP_ASCII, 'png' => FTP_BINARY
*
* To change the mode of an extension, just add it again with the new mode!
*
* @access public
* @param int $mode Either FTP_ASCII or FTP_BINARY
* @param string $ext Extension
* @return void
*/
function addExtension($mode, $ext)
{
$this->_file_extensions[$ext] = $mode;
}
 
/**
* This function removes an extension from the mode-directories
* (described above).
*
* @access public
* @param string $ext The extension to remove
* @return void
*/
function removeExtension($ext)
{
unset($this->_file_extensions[$ext]);
}
 
/**
* This get's both (ascii- and binary-mode-directories) from the given file.
* Beware, if you read a file into the mode-directory, all former set values
* will be unset!
*
* @access public
* @param string $filename The file to get from
* @return mixed True on success, otherwise PEAR::Error
* @see NET_FTP_ERR_EXTFILENOTEXIST, NET_FTP_ERR_EXTFILEREAD_FAILED
*/
function getExtensionsFile($filename)
{
if (!file_exists($filename)) {
return $this->raiseError("Extensions-file '$filename' does not exist", NET_FTP_ERR_EXTFILENOTEXIST);
}
 
if (!is_readable($filename)) {
return $this->raiseError("Extensions-file '$filename' is not readable", NET_FTP_ERR_EXTFILEREAD_FAILED);
}
 
$this->_file_extension = @parse_ini_file($filename);
return true;
}
 
/**
* Returns the Hostname
*
* @access public
* @return string The Hostname
*/
function getHostname()
{
return $this->_hostname;
}
 
/**
* Returns the Port
*
* @access public
* @return int The Port
*/
function getPort()
{
return $this->_port;
}
 
/**
* Returns the Username
*
* @access public
* @return string The Username
*/
function getUsername()
{
return $this->_username;
}
 
/**
* Returns the Password
*
* @access public
* @return string The Password
*/
function getPassword()
{
return $this->_password;
}
 
/**
* Returns the Transfermode
*
* @access public
* @return int The transfermode, either FTP_ASCII or FTP_BINARY.
*/
function getMode()
{
return $this->_mode;
}
 
/**
* Returns, whether the connection is set to passive mode or not
*
* @access public
* @return bool True if passive-, false if active-mode
*/
function isPassive()
{
return $this->_passv;
}
 
/**
* Returns the mode set for a file-extension
*
* @access public
* @param string $ext The extension you wanna ask for
* @return int Either FTP_ASCII, FTP_BINARY or NULL (if not set a mode for it)
*/
function getExtensionMode($ext)
{
return @$this->_file_extensions[$ext];
}
 
/**
* Get the currently set timeout.
* Returns the actual timeout set.
*
* @access public
* @return int The actual timeout
*/
function getTimeout ( )
{
return ftp_get_option($this->_handle, FTP_TIMEOUT_SEC);
}
 
/**
* Adds a Net_FTP_Observer instance to the list of observers
* that are listening for messages emitted by this Net_FTP instance.
*
* @param object $observer The Net_FTP_Observer instance to attach
* as a listener.
* @return boolean True if the observer is successfully attached.
* @access public
* @since 1.3
*/
function attach(&$observer)
{
if (!is_a($observer, 'Net_FTP_Observer')) {
return false;
}
 
$this->_listeners[$observer->getId()] = &$observer;
return true;
}
 
/**
* Removes a Net_FTP_Observer instance from the list of observers.
*
* @param object $observer The Net_FTP_Observer instance to detach
* from the list of listeners.
* @return boolean True if the observer is successfully detached.
* @access public
* @since 1.3
*/
function detach($observer)
{
if (!is_a($observer, 'Net_FTP_Observer') ||
!isset($this->_listeners[$observer->getId()])) {
return false;
}
 
unset($this->_listeners[$observer->getId()]);
return true;
}
 
/**
* Informs each registered observer instance that a new message has been
* sent.
*
* @param mixed $event A hash describing the net event.
* @access private
* @since 1.3
*/
function _announce($event)
{
foreach ($this->_listeners as $id => $listener) {
$this->_listeners[$id]->notify($event);
}
}
/**
* Rebuild the path, if given relative
*
* @access private
* @param string $path The path to check and construct
* @return string The build path
*/
function _construct_path($path)
{
if ((substr($path, 0, 1) != "/") && (substr($path, 0, 2) != "./")) {
$actual_dir = @ftp_pwd($this->_handle);
if (substr($actual_dir, (strlen($actual_dir) - 2), 1) != "/") {
$actual_dir .= "/";
}
$path = $actual_dir.$path;
}
return $path;
}
 
/**
* Checks, whether a given string is a directory-path (ends with "/") or not.
*
* @access private
* @param string $path Path to check
* @return bool True if $path is a directory, otherwise false
*/
function _check_dir($path)
{
if (!empty($path) && substr($path, (strlen($path) - 1), 1) == "/") {
return true;
} else {
return false;
}
}
 
/**
* This will remove a file
*
* @access private
* @param string $file The file to delete
* @return mixed True on success, otherwise PEAR::Error
* @see NET_FTP_ERR_DELETEFILE_FAILED
*/
function _rm_file($file)
{
if (substr($file, 0, 1) != "/") {
$actual_dir = @ftp_pwd($this->_handle);
if (substr($actual_dir, (strlen($actual_dir) - 2), 1) != "/") {
$actual_dir .= "/";
}
$file = $actual_dir.$file;
}
$res = @ftp_delete($this->_handle, $file);
if (!$res) {
return $this->raiseError("Could not delete file '$file'.", NET_FTP_ERR_DELETEFILE_FAILED);
} else {
return true;
}
}
 
/**
* This will remove a dir
*
* @access private
* @param string $dir The dir to delete
* @return mixed True on success, otherwise PEAR::Error
* @see NET_FTP_ERR_REMOTEPATHNODIR, NET_FTP_ERR_DELETEDIR_FAILED
*/
function _rm_dir($dir)
{
if (substr($dir, (strlen($dir) - 1), 1) != "/") {
return $this->raiseError("Directory name '$dir' is invalid, has to end with '/'", NET_FTP_ERR_REMOTEPATHNODIR);
}
$res = @ftp_rmdir($this->_handle, $dir);
if (!$res) {
return $this->raiseError("Could not delete directory '$dir'.", NET_FTP_ERR_DELETEDIR_FAILED);
} else {
return true;
}
}
 
/**
* This will remove a dir and all subdirs and -files
*
* @access private
* @param string $file The dir to delete recursively
* @return mixed True on success, otherwise PEAR::Error
* @see NET_FTP_ERR_REMOTEPATHNODIR, NET_FTP_ERR_DELETEDIR_FAILED
*/
function _rm_dir_recursive($dir)
{
if (substr($dir, (strlen($dir) - 1), 1) != "/") {
return $this->raiseError("Directory name '$dir' is invalid, has to end with '/'", NET_FTP_ERR_REMOTEPATHNODIR);
}
$file_list = $this->_ls_files($dir);
foreach ($file_list as $file) {
$file = $dir.$file["name"];
$res = $this->rm($file);
if ($this->isError($res)) {
return $res;
}
}
$dir_list = $this->_ls_dirs($dir);
foreach ($dir_list as $new_dir) {
if ($new_dir == '.' || $new_dir == '..') {
continue;
}
$new_dir = $dir.$new_dir["name"]."/";
$res = $this->_rm_dir_recursive($new_dir);
if ($this->isError($res)) {
return $res;
}
}
$res = $this->_rm_dir($dir);
if (PEAR::isError($res)) {
return $res;
} else {
return true;
}
}
 
/**
* Lists up files and directories
*
* @access private
* @param string $dir The directory to list up
* @return array An array of dirs and files
*/
function _ls_both($dir)
{
$list_splitted = $this->_list_and_parse($dir);
if (PEAR::isError($list_splitted)) {
return $list_splitted;
}
if (!is_array($list_splitted["files"])) {
$list_splitted["files"] = array();
}
if (!is_array($list_splitted["dirs"])) {
$list_splitted["dirs"] = array();
}
$res = array();
@array_splice($res, 0, 0, $list_splitted["files"]);
@array_splice($res, 0, 0, $list_splitted["dirs"]);
return $res;
}
 
/**
* Lists up directories
*
* @access private
* @param string $dir The directory to list up
* @return array An array of dirs
*/
function _ls_dirs($dir)
{
$list = $this->_list_and_parse($dir);
if (PEAR::isError($list)) {
return $list;
}
return $list["dirs"];
}
 
/**
* Lists up files
*
* @access private
* @param string $dir The directory to list up
* @return array An array of files
*/
function _ls_files($dir)
{
$list = $this->_list_and_parse($dir);
if (PEAR::isError($list)) {
return $list;
}
return $list["files"];
}
 
/**
* This lists up the directory-content and parses the items into well-formated arrays
* The results of this array are sorted (dirs on top, sorted by name;
* files below, sorted by name).
*
* @access private
* @param string $dir The directory to parse
* @return array Lists of dirs and files
* @see NET_FTP_ERR_RAWDIRLIST_FAILED
*/
function _list_and_parse($dir)
{
$dirs_list = array();
$files_list = array();
$dir_list = @ftp_rawlist($this->_handle, $dir);
if (!is_array($dir_list)) {
return PEAR::raiseError('Could not get raw directory listing.', NET_FTP_ERR_RAWDIRLIST_FAILED);
}
// Handle empty directories
if (count($dir_list) == 0) {
return array('dirs' => $dirs_list, 'files' => $files_list);
}
 
// Exception for some FTP servers seem to return this wiered result instead of an empty list
if (count($dirs_list) == 1 && $dirs_list[0] == 'total 0') {
return array('dirs' => array(), 'files' => $files_list);
}
if (!isset($this->_matcher) || PEAR::isError($this->_matcher)) {
$this->_matcher = $this->_determine_os_match($dir_list);
if (PEAR::isError($this->_matcher)) {
return $this->_matcher;
}
}
foreach ($dir_list as $entry) {
if (!preg_match($this->_matcher['pattern'], $entry, $m)) {
continue;
}
$entry = array();
foreach ($this->_matcher['map'] as $key=>$val) {
$entry[$key] = $m[$val];
}
$entry['stamp'] = $this->_parse_Date($entry['date']);
 
if ($entry['is_dir']) {
$dirs_list[] = $entry;
} else {
$files_list[] = $entry;
}
}
@usort($dirs_list, array("Net_FTP", "_nat_sort"));
@usort($files_list, array("Net_FTP", "_nat_sort"));
$res["dirs"] = (is_array($dirs_list)) ? $dirs_list : array();
$res["files"] = (is_array($files_list)) ? $files_list : array();
return $res;
}
/**
* Determine server OS
* This determines the server OS and returns a valid regex to parse
* ls() output.
*
* @access private
* @param array $dir_list The raw dir list to parse
* @return mixed An array of 'pattern' and 'map' on success, otherwise PEAR::Error
* @see NET_FTP_ERR_DIRLIST_UNSUPPORTED
*/
function _determine_os_match(&$dir_list) {
foreach ($dir_list as $entry) {
foreach ($this->_ls_match as $os => $match) {
if (preg_match($match['pattern'], $entry)) {
return $match;
}
}
}
$error = 'The list style of your server seems not to be supported. Please email a "$ftp->ls(NET_FTP_RAWLIST);" output plus info on the server to the maintainer of this package to get it supported! Thanks for your help!';
return PEAR::raiseError($error, NET_FTP_ERR_DIRLIST_UNSUPPORTED);
}
/**
* Lists a local directory
*
* @access private
* @param string $dir_path The dir to list
* @return array The list of dirs and files
*/
function _ls_local($dir_path)
{
$dir = dir($dir_path);
$dir_list = array();
$file_list = array();
while (false !== ($entry = $dir->read())) {
if (($entry != '.') && ($entry != '..')) {
if (is_dir($dir_path.$entry)) {
$dir_list[] = $entry;
} else {
$file_list[] = $entry;
}
}
}
$dir->close();
$res['dirs'] = $dir_list;
$res['files'] = $file_list;
return $res;
}
 
/**
* Function for use with usort().
* Compares the list-array-elements by name.
*
* @access private
*/
function _nat_sort($item_1, $item_2)
{
return strnatcmp($item_1['name'], $item_2['name']);
}
 
/**
* Parse dates to timestamps
*
* @access private
* @param string $date Date
* @return int Timestamp
* @see NET_FTP_ERR_DATEFORMAT_FAILED
*/
function _parse_Date($date)
{
// Sep 10 22:06 => Sep 10, <year> 22:06
if (preg_match('/([A-Za-z]+)[ ]+([0-9]+)[ ]+([0-9]+):([0-9]+)/', $date, $res)) {
$year = date('Y');
$month = $res[1];
$day = $res[2];
$hour = $res[3];
$minute = $res[4];
$date = "$month $day, $year $hour:$minute";
$tmpDate = strtotime($date);
if ($tmpDate > time()) {
$year--;
$date = "$month $day, $year $hour:$minute";
}
}
// 09-10-04 => 09/10/04
elseif (preg_match('/^\d\d-\d\d-\d\d/',$date)) {
$date = str_replace('-','/',$date);
}
$res = strtotime($date);
if (!$res) {
return $this->raiseError('Dateconversion failed.', NET_FTP_ERR_DATEFORMAT_FAILED);
}
return $res;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Auth.php
New file
0,0 → 1,1118
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */
 
/**
* The main include file for Auth package
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Authentication
* @package Auth
* @author Martin Jansen <mj@php.net>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: Auth.php,v 1.2 2006-12-14 15:04:29 jp_milcent Exp $
* @link http://pear.php.net/package/Auth
*/
 
/**
* Returned if session exceeds idle time
*/
define('AUTH_IDLED', -1);
/**
* Returned if session has expired
*/
define('AUTH_EXPIRED', -2);
/**
* Returned if container is unable to authenticate user/password pair
*/
define('AUTH_WRONG_LOGIN', -3);
/**
* Returned if a container method is not supported.
*/
define('AUTH_METHOD_NOT_SUPPORTED', -4);
/**
* Returned if new Advanced security system detects a breach
*/
define('AUTH_SECURITY_BREACH', -5);
/**
* Returned if checkAuthCallback says session should not continue.
*/
define('AUTH_CALLBACK_ABORT', -6);
 
/**
* PEAR::Auth
*
* The PEAR::Auth class provides methods for creating an
* authentication system using PHP.
*
* @category Authentication
* @package Auth
* @author Martin Jansen <mj@php.net>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version Release: 1.4.3 File: $Revision: 1.2 $
* @link http://pear.php.net/package/Auth
*/
class Auth {
 
// {{{ properties
 
/**
* Auth lifetime in seconds
*
* If this variable is set to 0, auth never expires
*
* @var integer
* @see setExpire(), checkAuth()
*/
var $expire = 0;
 
/**
* Has the auth session expired?
*
* @var bool
* @see checkAuth()
*/
var $expired = false;
 
/**
* Maximum idletime in seconds
*
* The difference to $expire is, that the idletime gets
* refreshed each time checkAuth() is called. If this
* variable is set to 0, idletime is never checked.
*
* @var integer
* @see setIdle(), checkAuth()
*/
var $idle = 0;
 
/**
* Is the maximum idletime over?
*
* @var boolean
* @see checkAuth()
*/
var $idled = false;
 
/**
* Storage object
*
* @var object
* @see Auth(), validateLogin()
*/
var $storage = '';
 
/**
* User-defined function that creates the login screen
*
* @var string
*/
var $loginFunction = '';
 
/**
* Should the login form be displayed
*
* @var bool
* @see setShowlogin()
*/
var $showLogin = true;
/**
* Is Login Allowed from this page
*
* @var bool
* @see setAllowLogin
*/
var $allowLogin = true;
 
/**
* Current authentication status
*
* @var string
*/
var $status = '';
 
/**
* Username
*
* @var string
*/
var $username = '';
 
/**
* Password
*
* @var string
*/
var $password = '';
 
/**
* checkAuth callback function name
*
* @var string
* @see setCheckAuthCallback()
*/
var $checkAuthCallback = '';
 
/**
* Login callback function name
*
* @var string
* @see setLoginCallback()
*/
var $loginCallback = '';
 
/**
* Failed Login callback function name
*
* @var string
* @see setFailedLoginCallback()
*/
var $loginFailedCallback = '';
 
/**
* Logout callback function name
*
* @var string
* @see setLogoutCallback()
*/
var $logoutCallback = '';
 
/**
* Auth session-array name
*
* @var string
*/
var $_sessionName = '_authsession';
 
/**
* Package Version
*
* @var string
*/
var $version = "@version@";
 
/**
* Flag to use advanced security
* When set extra checks will be made to see if the
* user's IP or useragent have changed across requests.
* Turned off by default to preserve BC.
*
* @var boolean
*/
var $advancedsecurity = false;
 
/**
* Username key in POST array
*
* @var string
*/
var $_postUsername = 'username';
 
/**
* Password key in POST array
*
* @var string
*/
var $_postPassword = 'password';
 
/**
* Holds a reference to the session auth variable
* @var array
*/
var $session;
 
/**
* Holds a reference to the global server variable
* @var array
*/
var $server;
 
/**
* Holds a reference to the global post variable
* @var array
*/
var $post;
 
/**
* Holds a reference to the global cookie variable
* @var array
*/
var $cookie;
 
/**
* A hash to hold various superglobals as reference
* @var array
*/
var $authdata;
/**
* How many times has checkAuth been called
* var int
*/
var $authChecks = 0;
 
// }}}
// {{{ Auth() [constructor]
 
/**
* Constructor
*
* Set up the storage driver.
*
* @param string Type of the storage driver
* @param mixed Additional options for the storage driver
* (example: if you are using DB as the storage
* driver, you have to pass the dsn string here)
*
* @param string Name of the function that creates the login form
* @param boolean Should the login form be displayed if neccessary?
* @return void
*/
function Auth($storageDriver, $options = '', $loginFunction = '', $showLogin = true)
{
$this->applyAuthOptions($options);
 
// Start the session suppress error if already started
if(!session_id()){
@session_start();
if(!session_id()) {
// Throw error
include_once 'PEAR.php';
PEAR::throwError('Session could not be started by Auth, '
.'possibly headers are already sent, try putting '
.'ob_start in the beginning of your script');
}
}
 
// Make Sure Auth session variable is there
if(!isset($_SESSION[$this->_sessionName])) {
$_SESSION[$this->_sessionName] = array();
}
 
// Assign Some globals to internal references, this will replace _importGlobalVariable
$this->session =& $_SESSION[$this->_sessionName];
$this->server =& $_SERVER;
$this->post =& $_POST;
$this->cookie =& $_COOKIE;
 
if ($loginFunction != '' && is_callable($loginFunction)) {
$this->loginFunction = $loginFunction;
}
 
if (is_bool($showLogin)) {
$this->showLogin = $showLogin;
}
 
if (is_object($storageDriver)) {
$this->storage =& $storageDriver;
// Pass a reference to auth to the container, ugly but works
// this is used by the DB container to use method setAuthData not staticaly.
$this->storage->_auth_obj =& $this;
} else {
// $this->storage = $this->_factory($storageDriver, $options);
//
$this->storage_driver = $storageDriver;
$this->storage_options =& $options;
}
}
 
// }}}
// {{{ applyAuthOptions()
 
/**
* Set the Auth options
*
* Some options which are Auth specific will be applied
* the rest will be left for usage by the container
*
* @param array An array of Auth options
* @return array The options which were not applied
* @access private
*/
function &applyAuthOptions(&$options)
{
if(is_array($options)){
if (!empty($options['sessionName'])) {
$this->_sessionName = $options['sessionName'];
unset($options['sessionName']);
}
if (isset($options['allowLogin'])) {
$this->allowLogin = $options['allowLogin'];
unset($options['allowLogin']);
}
if (!empty($options['postUsername'])) {
$this->_postUsername = $options['postUsername'];
unset($options['postUsername']);
}
if (!empty($options['postPassword'])) {
$this->_postPassword = $options['postPassword'];
unset($options['postPassword']);
}
if (isset($options['advancedsecurity'])) {
$this->advancedsecurity = $options['advancedsecurity'];
unset($options['advancedsecurity']);
}
}
return($options);
}
 
// }}}
// {{{ _loadStorage()
/**
* Load Storage Driver if not already loaded
*
* Suspend storage instantiation to make Auth lighter to use
* for calls which do not require login
*
* @return bool True if the conainer is loaded, false if the container
* is already loaded
* @access private
*/
function _loadStorage()
{
if(!is_object($this->storage)) {
$this->storage =& $this->_factory($this->storage_driver,
$this->storage_options);
$this->storage->_auth_obj =& $this;
return(true);
}
return(false);
}
 
// }}}
// {{{ _factory()
 
/**
* Return a storage driver based on $driver and $options
*
* @static
* @param string $driver Type of storage class to return
* @param string $options Optional parameters for the storage class
* @return object Object Storage object
* @access private
*/
function &_factory($driver, $options = '')
{
$storage_class = 'Auth_Container_' . $driver;
include_once 'Auth/Container/' . $driver . '.php';
$obj =& new $storage_class($options);
return $obj;
}
 
// }}}
// {{{ assignData()
 
/**
* Assign data from login form to internal values
*
* This function takes the values for username and password
* from $HTTP_POST_VARS/$_POST and assigns them to internal variables.
* If you wish to use another source apart from $HTTP_POST_VARS/$_POST,
* you have to derive this function.
*
* @global $HTTP_POST_VARS, $_POST
* @see Auth
* @return void
* @access private
*/
function assignData()
{
if ( isset($this->post[$this->_postUsername])
&& $this->post[$this->_postUsername] != '') {
$this->username = (get_magic_quotes_gpc() == 1
? stripslashes($this->post[$this->_postUsername])
: $this->post[$this->_postUsername]);
}
if ( isset($this->post[$this->_postPassword])
&& $this->post[$this->_postPassword] != '') {
$this->password = (get_magic_quotes_gpc() == 1
? stripslashes($this->post[$this->_postPassword])
: $this->post[$this->_postPassword] );
}
}
 
// }}}
// {{{ start()
 
/**
* Start new auth session
*
* @return void
* @access public
*/
function start()
{
$this->assignData();
if (!$this->checkAuth() && $this->allowLogin) {
$this->login();
}
}
 
// }}}
// {{{ login()
 
/**
* Login function
*
* @return void
* @access private
*/
function login()
{
$login_ok = false;
$this->_loadStorage();
// Check if using challenge response
(isset($this->post['authsecret']) && $this->post['authsecret'] == 1)
? $usingChap = true
: $usingChap = false;
 
// When the user has already entered a username, we have to validate it.
if (!empty($this->username)) {
if (true === $this->storage->fetchData($this->username, $this->password, $usingChap)) {
$this->session['challengekey'] = md5($this->username.$this->password);
$login_ok = true;
}
}
 
if (!empty($this->username) && $login_ok) {
$this->setAuth($this->username);
if (is_callable($this->loginCallback)) {
call_user_func_array($this->loginCallback, array($this->username, &$this));
}
}
 
// If the login failed or the user entered no username,
// output the login screen again.
if (!empty($this->username) && !$login_ok) {
$this->status = AUTH_WRONG_LOGIN;
if (is_callable($this->loginFailedCallback)) {
call_user_func_array($this->loginFailedCallback, array($this->username, &$this));
}
}
 
if ((empty($this->username) || !$login_ok) && $this->showLogin) {
if (is_callable($this->loginFunction)) {
call_user_func_array($this->loginFunction, array($this->username, $this->status, &$this));
} else {
// BC fix Auth used to use drawLogin for this
// call is sub classes implement this
if (is_callable(array($this, 'drawLogin'))) {
return $this->drawLogin($this->username, $this);
}
 
// New Login form
include_once 'Auth/Frontend/Html.php';
return Auth_Frontend_Html::render($this, $this->username);
}
} else {
return;
}
}
 
// }}}
// {{{ setExpire()
 
/**
* Set the maximum expire time
*
* @param integer time in seconds
* @param bool add time to current expire time or not
* @return void
* @access public
*/
function setExpire($time, $add = false)
{
$add ? $this->expire += $time : $this->expire = $time;
}
 
// }}}
// {{{ setIdle()
 
/**
* Set the maximum idle time
*
* @param integer time in seconds
* @param bool add time to current maximum idle time or not
* @return void
* @access public
*/
function setIdle($time, $add = false)
{
$add ? $this->idle += $time : $this->idle = $time;
}
 
// }}}
// {{{ setSessionName()
 
/**
* Set name of the session to a customized value.
*
* If you are using multiple instances of PEAR::Auth
* on the same domain, you can change the name of
* session per application via this function.
* This will chnage the name of the session variable
* auth uses to store it's data in the session
*
* @param string New name for the session
* @return void
* @access public
*/
function setSessionName($name = 'session')
{
$this->_sessionName = '_auth_'.$name;
$this->session =& $_SESSION[$this->_sessionName];
}
 
// }}}
// {{{ setShowLogin()
 
/**
* Should the login form be displayed if neccessary?
*
* @param bool show login form or not
* @return void
* @access public
*/
function setShowLogin($showLogin = true)
{
$this->showLogin = $showLogin;
}
 
// }}}
// {{{ setAllowLogin()
 
/**
* Should the login form be displayed if neccessary?
*
* @param bool show login form or not
* @return void
* @access public
*/
function setAllowLogin($allowLogin = true)
{
$this->allowLogin = $allowLogin;
}
 
// }}}
// {{{ setCheckAuthCallback()
 
/**
* Register a callback function to be called whenever the validity of the login is checked
* The function will receive two parameters, the username and a reference to the auth object.
*
* @param string callback function name
* @return void
* @access public
* @since Method available since Release 1.4.3
*/
function setCheckAuthCallback($checkAuthCallback)
{
$this->checkAuthCallback = $checkAuthCallback;
}
 
// }}}
// {{{ setLoginCallback()
/**
* Register a callback function to be called on user login.
* The function will receive two parameters, the username and a reference to the auth object.
*
* @param string callback function name
* @return void
* @see setLogoutCallback()
* @access public
*/
function setLoginCallback($loginCallback)
{
$this->loginCallback = $loginCallback;
}
 
// }}}
// {{{ setFailedLoginCallback()
 
/**
* Register a callback function to be called on failed user login.
* The function will receive two parameters, the username and a reference to the auth object.
*
* @param string callback function name
* @return void
* @access public
*/
function setFailedLoginCallback($loginFailedCallback)
{
$this->loginFailedCallback = $loginFailedCallback;
}
 
// }}}
// {{{ setLogoutCallback()
 
/**
* Register a callback function to be called on user logout.
* The function will receive three parameters, the username and a reference to the auth object.
*
* @param string callback function name
* @return void
* @see setLoginCallback()
* @access public
*/
function setLogoutCallback($logoutCallback)
{
$this->logoutCallback = $logoutCallback;
}
 
// }}}
// {{{ setAuthData()
 
/**
* Register additional information that is to be stored
* in the session.
*
* @param string Name of the data field
* @param mixed Value of the data field
* @param boolean Should existing data be overwritten? (default
* is true)
* @return void
* @access public
*/
function setAuthData($name, $value, $overwrite = true)
{
if (!empty($this->session['data'][$name]) && $overwrite == false) {
return;
}
$this->session['data'][$name] = $value;
}
 
// }}}
// {{{ getAuthData()
 
/**
* Get additional information that is stored in the session.
*
* If no value for the first parameter is passed, the method will
* return all data that is currently stored.
*
* @param string Name of the data field
* @return mixed Value of the data field.
* @access public
*/
function getAuthData($name = null)
{
if (!isset($this->session['data'])) {
return null;
}
if(!isset($name)) {
return $this->session['data'];
}
if (isset($name) && isset($this->session['data'][$name])) {
return $this->session['data'][$name];
}
return null;
}
 
// }}}
// {{{ setAuth()
 
/**
* Register variable in a session telling that the user
* has logged in successfully
*
* @param string Username
* @return void
* @access public
*/
function setAuth($username)
{
// #2021 - Change the session id to avoid session fixation attacks php 4.3.3 >
session_regenerate_id(true);
 
if (!isset($this->session) || !is_array($this->session)) {
$this->session = array();
}
 
if (!isset($this->session['data'])) {
$this->session['data'] = array();
}
 
$this->session['sessionip'] = isset($this->server['REMOTE_ADDR'])
? $this->server['REMOTE_ADDR']
: '';
$this->session['sessionuseragent'] = isset($this->server['HTTP_USER_AGENT'])
? $this->server['HTTP_USER_AGENT']
: '';
 
// This should be set by the container to something more safe
// Like md5(passwd.microtime)
if(empty($this->session['challengekey'])) {
$this->session['challengekey'] = md5($username.microtime());
}
 
$this->session['challengecookie'] = md5($this->session['challengekey'].microtime());
setcookie('authchallenge', $this->session['challengecookie']);
 
$this->session['registered'] = true;
$this->session['username'] = $username;
$this->session['timestamp'] = time();
$this->session['idle'] = time();
}
 
// }}}
// {{{ setAdvancedSecurity()
/**
* Enables advanced security checks
*
* Currently only ip change and useragent change
* are detected
* @todo Add challenge cookies - Create a cookie which changes every time
* and contains some challenge key which the server can verify with
* a session var cookie might need to be crypted (user pass)
* @param bool Enable or disable
* @return void
* @access public
*/
function setAdvancedSecurity($flag=true)
{
$this->advancedsecurity = $flag;
}
 
// }}}
// {{{ checkAuth()
 
/**
* Checks if there is a session with valid auth information.
*
* @access public
* @return boolean Whether or not the user is authenticated.
*/
function checkAuth()
{
$this->authChecks++;
if (isset($this->session)) {
// Check if authentication session is expired
if ( $this->expire > 0
&& isset($this->session['timestamp'])
&& ($this->session['timestamp'] + $this->expire) < time()) {
$this->expired = true;
$this->status = AUTH_EXPIRED;
$this->logout();
return false;
}
 
// Check if maximum idle time is reached
if ( $this->idle > 0
&& isset($this->session['idle'])
&& ($this->session['idle'] + $this->idle) < time()) {
$this->idled = true;
$this->status = AUTH_IDLED;
$this->logout();
return false;
}
 
if ( isset($this->session['registered'])
&& isset($this->session['username'])
&& $this->session['registered'] == true
&& $this->session['username'] != '') {
Auth::updateIdle();
 
if ($this->advancedsecurity) {
// Only Generate the challenge once
if($this->authChecks == 1) {
$this->session['challengecookieold'] = $this->session['challengecookie'];
$this->session['challengecookie'] = md5($this->session['challengekey'].microtime());
setcookie('authchallenge', $this->session['challengecookie']);
}
// Check for ip change
if ( isset($this->server['REMOTE_ADDR'])
&& $this->session['sessionip'] != $this->server['REMOTE_ADDR']) {
// Check if the IP of the user has changed, if so we
// assume a man in the middle attack and log him out
$this->expired = true;
$this->status = AUTH_SECURITY_BREACH;
$this->logout();
return false;
}
// Check for useragent change
if ( isset($this->server['HTTP_USER_AGENT'])
&& $this->session['sessionuseragent'] != $this->server['HTTP_USER_AGENT']) {
// Check if the User-Agent of the user has changed, if
// so we assume a man in the middle attack and log him out
$this->expired = true;
$this->status = AUTH_SECURITY_BREACH;
$this->logout();
return false;
}
// Check challenge cookie here, if challengecookieold is not set
// this is the first time and check is skipped
// TODO when user open two pages similtaneuly (open in new window,open
// in tab) auth breach is caused find out a way around that if possible
if ( isset($this->session['challengecookieold'])
&& $this->session['challengecookieold'] != $this->cookie['authchallenge']) {
$this->expired = true;
$this->status = AUTH_SECURITY_BREACH;
$this->logout();
$this->login();
return false;
}
}
 
if (is_callable($this->checkAuthCallback)) {
$checkCallback = call_user_func_array($this->checkAuthCallback, array($this->username, &$this));
if ($checkCallback == false) {
$this->expired = true;
$this->status = AUTH_CALLBACK_ABORT;
$this->logout();
return false;
}
}
 
return true;
}
}
return false;
}
 
// }}}
// {{{ staticCheckAuth() [static]
 
/**
* Statically checks if there is a session with valid auth information.
*
* @access public
* @see checkAuth
* @return boolean Whether or not the user is authenticated.
* @static
*/
function staticCheckAuth($options = null)
{
static $staticAuth;
if(!isset($staticAuth)) {
$staticAuth = new Auth('null', $options);
}
return $staticAuth->checkAuth();
}
 
// }}}
// {{{ getAuth()
 
/**
* Has the user been authenticated?
*
* @access public
* @return bool True if the user is logged in, otherwise false.
*/
function getAuth()
{
return $this->checkAuth();
}
 
// }}}
// {{{ logout()
 
/**
* Logout function
*
* This function clears any auth tokens in the currently
* active session and executes the logout callback function,
* if any
*
* @access public
* @return void
*/
function logout()
{
if (is_callable($this->logoutCallback)) {
call_user_func_array($this->logoutCallback, array($this->session['username'], &$this));
}
 
$this->username = '';
$this->password = '';
$this->session = null;
}
 
// }}}
// {{{ updateIdle()
 
/**
* Update the idletime
*
* @access private
* @return void
*/
function updateIdle()
{
$this->session['idle'] = time();
}
 
// }}}
// {{{ getUsername()
 
/**
* Get the username
*
* @return string
* @access public
*/
function getUsername()
{
if (isset($this->session['username'])) {
return($this->session['username']);
}
return('');
}
 
// }}}
// {{{ getStatus()
 
/**
* Get the current status
*
* @return string
* @access public
*/
function getStatus()
{
return $this->status;
}
 
// }}}
// {{{ getPostUsernameField()
/**
* Gets the post varible used for the username
*
* @return string
* @access public
*/
function getPostUsernameField()
{
return($this->_postUsername);
}
 
// }}}
// {{{ getPostPasswordField()
 
/**
* Gets the post varible used for the username
*
* @return string
* @access public
*/
function getPostPasswordField()
{
return($this->_postPassword);
}
 
// }}}
// {{{ sessionValidThru()
 
/**
* Returns the time up to the session is valid
*
* @access public
* @return integer
*/
function sessionValidThru()
{
if (!isset($this->session['idle'])) {
return 0;
}
if ($this->idle == 0) {
return 0;
}
return ($this->session['idle'] + $this->idle);
}
 
// }}}
// {{{ listUsers()
 
/**
* List all users that are currently available in the storage
* container
*
* @access public
* @return array
*/
function listUsers()
{
$this->_loadStorage();
return $this->storage->listUsers();
}
 
// }}}
// {{{ addUser()
 
/**
* Add user to the storage container
*
* @access public
* @param string Username
* @param string Password
* @param mixed Additional parameters
* @return mixed True on success, PEAR error object on error
* and AUTH_METHOD_NOT_SUPPORTED otherwise.
*/
function addUser($username, $password, $additional = '')
{
$this->_loadStorage();
return $this->storage->addUser($username, $password, $additional);
}
 
// }}}
// {{{ removeUser()
 
/**
* Remove user from the storage container
*
* @access public
* @param string Username
* @return mixed True on success, PEAR error object on error
* and AUTH_METHOD_NOT_SUPPORTED otherwise.
*/
function removeUser($username)
{
$this->_loadStorage();
return $this->storage->removeUser($username);
}
 
// }}}
// {{{ changePassword()
 
/**
* Change password for user in the storage container
*
* @access public
* @param string Username
* @param string The new password
* @return mixed True on success, PEAR error object on error
* and AUTH_METHOD_NOT_SUPPORTED otherwise.
*/
function changePassword($username, $password)
{
$this->_loadStorage();
return $this->storage->changePassword($username, $password);
}
 
// }}}
 
}
?>
/tags/Racine_livraison_narmer/api/pear/Mail.php
New file
0,0 → 1,211
<?php
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Chuck Hagenbuch <chuck@horde.org> |
// +----------------------------------------------------------------------+
//
// $Id: Mail.php,v 1.1 2005-11-24 16:15:46 florian Exp $
 
require_once 'PEAR.php';
 
/**
* PEAR's Mail:: interface. Defines the interface for implementing
* mailers under the PEAR hierarchy, and provides supporting functions
* useful in multiple mailer backends.
*
* @access public
* @version $Revision: 1.1 $
* @package Mail
*/
class Mail
{
/**
* Line terminator used for separating header lines.
* @var string
*/
var $sep = "\r\n";
 
/**
* Provides an interface for generating Mail:: objects of various
* types
*
* @param string $driver The kind of Mail:: object to instantiate.
* @param array $params The parameters to pass to the Mail:: object.
* @return object Mail a instance of the driver class or if fails a PEAR Error
* @access public
*/
function &factory($driver, $params = array())
{
$driver = strtolower($driver);
@include_once 'Mail/' . $driver . '.php';
$class = 'Mail_' . $driver;
if (class_exists($class)) {
$mailer = new $class($params);
return $mailer;
} else {
return PEAR::raiseError('Unable to find class for driver ' . $driver);
}
}
 
/**
* Implements Mail::send() function using php's built-in mail()
* command.
*
* @param mixed $recipients Either a comma-seperated list of recipients
* (RFC822 compliant), or an array of recipients,
* each RFC822 valid. This may contain recipients not
* specified in the headers, for Bcc:, resending
* messages, etc.
*
* @param array $headers The array of headers to send with the mail, in an
* associative array, where the array key is the
* header name (ie, 'Subject'), and the array value
* is the header value (ie, 'test'). The header
* produced from those values would be 'Subject:
* test'.
*
* @param string $body The full text of the message body, including any
* Mime parts, etc.
*
* @return mixed Returns true on success, or a PEAR_Error
* containing a descriptive error message on
* failure.
* @access public
* @deprecated use Mail_mail::send instead
*/
function send($recipients, $headers, $body)
{
// if we're passed an array of recipients, implode it.
if (is_array($recipients)) {
$recipients = implode(', ', $recipients);
}
 
// get the Subject out of the headers array so that we can
// pass it as a seperate argument to mail().
$subject = '';
if (isset($headers['Subject'])) {
$subject = $headers['Subject'];
unset($headers['Subject']);
}
 
// flatten the headers out.
list(,$text_headers) = Mail::prepareHeaders($headers);
 
return mail($recipients, $subject, $body, $text_headers);
 
}
 
/**
* Take an array of mail headers and return a string containing
* text usable in sending a message.
*
* @param array $headers The array of headers to prepare, in an associative
* array, where the array key is the header name (ie,
* 'Subject'), and the array value is the header
* value (ie, 'test'). The header produced from those
* values would be 'Subject: test'.
*
* @return mixed Returns false if it encounters a bad address,
* otherwise returns an array containing two
* elements: Any From: address found in the headers,
* and the plain text version of the headers.
* @access private
*/
function prepareHeaders($headers)
{
$lines = array();
$from = null;
 
foreach ($headers as $key => $value) {
if (strcasecmp($key, 'From') === 0) {
include_once 'Mail/RFC822.php';
$parser = &new Mail_RFC822();
$addresses = $parser->parseAddressList($value, 'localhost', false);
if (PEAR::isError($addresses)) {
return $addresses;
}
 
$from = $addresses[0]->mailbox . '@' . $addresses[0]->host;
 
// Reject envelope From: addresses with spaces.
if (strstr($from, ' ')) {
return false;
}
 
$lines[] = $key . ': ' . $value;
} elseif (strcasecmp($key, 'Received') === 0) {
$received = array();
if (is_array($value)) {
foreach ($value as $line) {
$received[] = $key . ': ' . $line;
}
}
else {
$received[] = $key . ': ' . $value;
}
// Put Received: headers at the top. Spam detectors often
// flag messages with Received: headers after the Subject:
// as spam.
$lines = array_merge($received, $lines);
} else {
// If $value is an array (i.e., a list of addresses), convert
// it to a comma-delimited string of its elements (addresses).
if (is_array($value)) {
$value = implode(', ', $value);
}
$lines[] = $key . ': ' . $value;
}
}
 
return array($from, join($this->sep, $lines) . $this->sep);
}
 
/**
* Take a set of recipients and parse them, returning an array of
* bare addresses (forward paths) that can be passed to sendmail
* or an smtp server with the rcpt to: command.
*
* @param mixed Either a comma-seperated list of recipients
* (RFC822 compliant), or an array of recipients,
* each RFC822 valid.
*
* @return array An array of forward paths (bare addresses).
* @access private
*/
function parseRecipients($recipients)
{
include_once 'Mail/RFC822.php';
 
// if we're passed an array, assume addresses are valid and
// implode them before parsing.
if (is_array($recipients)) {
$recipients = implode(', ', $recipients);
}
 
// Parse recipients, leaving out all personal info. This is
// for smtp recipients, etc. All relevant personal information
// should already be in the headers.
$addresses = Mail_RFC822::parseAddressList($recipients, 'localhost', false);
$recipients = array();
if (is_array($addresses)) {
foreach ($addresses as $ob) {
$recipients[] = $ob->mailbox . '@' . $ob->host;
}
}
 
return $recipients;
}
 
}
/tags/Racine_livraison_narmer/api/pear/A_LIRE.txt
New file
0,0 → 1,16
Liste des packages PEAR :
==============================
Package Version State
Auth 1.4.3 stable
Calendar 0.5.2 beta
DB 1.7.6 stable
HTML_Common 1.2.1 stable
HTML_QuickForm 3.2.5 stable
HTML_Table 1.5 stable
HTTP 1.3.5 stable
Net_FTP 1.3.0 stable
Net_SMTP 1.2.6 stable
Net_Socket 1.0.6 stable
Net_URL 1.0.14 stable
PEAR 1.4.11 stable
Text_Wiki 1.0.0 stable
/tags/Racine_livraison_narmer/api/pear/Calendar/Week.php
New file
0,0 → 1,410
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Harry Fuecks <hfuecks@phppatterns.com> |
// | Lorenzo Alberton <l dot alberton at quipo dot it> |
// +----------------------------------------------------------------------+
//
// $Id: Week.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
//
/**
* @package Calendar
* @version $Id: Week.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
*/
 
/**
* Allows Calendar include path to be redefined
* @ignore
*/
if (!defined('CALENDAR_ROOT')) {
define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR);
}
 
/**
* Load Calendar base class
*/
require_once CALENDAR_ROOT.'Calendar.php';
 
/**
* Represents a Week and builds Days in tabular format<br>
* <code>
* require_once 'Calendar'.DIRECTORY_SEPARATOR.'Week.php';
* $Week = & new Calendar_Week(2003, 10, 1); Oct 2003, 1st tabular week
* echo '<tr>';
* while ($Day = & $Week->fetch()) {
* if ($Day->isEmpty()) {
* echo '<td>&nbsp;</td>';
* } else {
* echo '<td>'.$Day->thisDay().'</td>';
* }
* }
* echo '</tr>';
* </code>
* @package Calendar
* @access public
*/
class Calendar_Week extends Calendar
{
/**
* Instance of Calendar_Table_Helper
* @var Calendar_Table_Helper
* @access private
*/
var $tableHelper;
 
/**
* Stores the timestamp of the first day of this week
* @access private
* @var object
*/
var $thisWeek;
 
/**
* Stores the timestamp of first day of previous week
* @access private
* @var object
*/
var $prevWeek;
 
/**
* Stores the timestamp of first day of next week
* @access private
* @var object
*/
var $nextWeek;
 
/**
* Used by build() to set empty days
* @access private
* @var boolean
*/
var $firstWeek = false;
 
/**
* Used by build() to set empty days
* @access private
* @var boolean
*/
var $lastWeek = false;
 
/**
* First day of the week (0=sunday, 1=monday...)
* @access private
* @var boolean
*/
var $firstDay = 1;
 
/**
* Constructs Week
* @param int year e.g. 2003
* @param int month e.g. 5
* @param int a day of the desired week
* @param int (optional) first day of week (e.g. 0 for Sunday, 2 for Tuesday etc.)
* @access public
*/
function Calendar_Week($y, $m, $d, $firstDay=false)
{
require_once CALENDAR_ROOT.'Table'.DIRECTORY_SEPARATOR.'Helper.php';
Calendar::Calendar($y, $m, $d);
if ($firstDay !== false) {
$this->firstDay = $firstDay;
}
$this->tableHelper = & new Calendar_Table_Helper($this, $firstDay);
$this->thisWeek = $this->tableHelper->getWeekStart($y, $m, $d, $firstDay);
$this->prevWeek = $this->tableHelper->getWeekStart($y, $m, $d - $this->cE->getDaysInWeek(
$this->thisYear(),
$this->thisMonth(),
$this->thisDay()), $firstDay);
$this->nextWeek = $this->tableHelper->getWeekStart($y, $m, $d + $this->cE->getDaysInWeek(
$this->thisYear(),
$this->thisMonth(),
$this->thisDay()), $firstDay);
}
 
/**
* Defines the calendar by a timestamp (Unix or ISO-8601), replacing values
* passed to the constructor
* @param int|string Unix or ISO-8601 timestamp
* @return void
* @access public
*/
function setTimestamp($ts)
{
+
+ $this->thisWeek = $this->tableHelper->getWeekStart(
+ $this->year, $this->month, $this->day, $this->firstDay
+
+ $this->prevWeek = $this->tableHelper->getWeekStart(
+ $this->year, $this->month, $this->day - $this->cE->getDaysInWeek(
+ $this->thisYear(),
+ $this->thisMonth(),
+ $this->thisDay()), $this->firstDay
+
+ $this->nextWeek = $this->tableHelper->getWeekStart(
+ $this->year, $this->month, $this->day + $this->cE->getDaysInWeek(
+ $this->thisYear(),
+ $this->thisMonth(),
+ $this->thisDay()), $this->firstDay
+ );
+ }
+
+ /**
+ * Builds Calendar_Day objects for this Week
+ * @param array (optional) Calendar_Day objects representing selected dates
+ * @return boolean
+ * @access public
+ */
+ function build($sDates = array())
+ {
+ require_once CALENDAR_ROOT.'Day.php';
+ $year = $this->cE->stampToYear($this->thisWeek);
+ $month = $this->cE->stampToMonth($this->thisWeek);
+ $day = $this->cE->stampToDay($this->thisWeek);
+ $end = $this->cE->getDaysInWeek(
+ $this->thisYear(),
+ $this->thisMonth(),
+ $this->thisDay()
+ );
+
+ for ($i=1; $i <= $end; $i++) {
+ $stamp = $this->cE->dateToStamp($year, $month, $day++);
+ $this->children[$i] = new Calendar_Day(
+ $this->cE->stampToYear($stamp),
+ $this->cE->stampToMonth($stamp),
+ $this->cE->stampToDay($stamp));
+ }
+
+ //set empty days (@see Calendar_Month_Weeks::build())
+ if ($this->firstWeek) {
+ $eBefore = $this->tableHelper->getEmptyDaysBefore();
+ for ($i=1; $i <= $eBefore; $i++) {
+ $this->children[$i]->setEmpty();
+ }
+ }
+ if ($this->lastWeek) {
+ $eAfter = $this->tableHelper->getEmptyDaysAfterOffset();
+ for ($i = $eAfter+1; $i <= $end; $i++) {
+ $this->children[$i]->setEmpty();
+ }
+ }
+
+ if (count($sDates) > 0) {
+ $this->setSelection($sDates);
+ }
+ return true;
+ }
+
+ /**
+ * @param boolean
+ * @return void
+ * @access private
+ */
+ function setFirst($state=true)
+ {
+ $this->firstWeek = $state;
+ }
+
+ /**
+ * @param boolean
+ * @return void
+ * @access private
+ */
+ function setLast($state=true)
+ {
+ $this->lastWeek = $state;
+ }
+
+ /**
+ * Called from build()
+ * @param array
+ * @return void
+ * @access private
+ */
+ function setSelection($sDates)
+ {
+
+
+
+
+ $child->thisYear() == $sDate->thisYear()
+
+
+
+
+
+
+
+ }
+
+ /**
+ * Gets the value of the previous week, according to the requested format
+ *
+ * @param string $format ['timestamp' | 'n_in_month' | 'n_in_year' | 'array']
+ * @return mixed
+ * @access public
+ */
+ function prevWeek($format = 'n_in_month')
+ {
+ switch (strtolower($format)) {
+ case 'int':
+ case 'n_in_month':
+ return ($this->firstWeek) ? null : $this->thisWeek('n_in_month') -1;
+ break;
+ case 'n_in_year':
+ return $this->cE->getWeekNInYear(
+ $this->cE->stampToYear($this->prevWeek),
+ $this->cE->stampToMonth($this->prevWeek),
+ $this->cE->stampToDay($this->prevWeek));
+ break;
+ case 'array':
+ return $this->toArray($this->prevWeek);
+ break;
+ case 'object':
+ require_once CALENDAR_ROOT.'Factory.php';
+ return Calendar_Factory::createByTimestamp('Week',$this->prevWeek);
+ break;
+ case 'timestamp':
+ default:
+ return $this->prevWeek;
+ break;
+ }
+ }
+
+ /**
+ * Gets the value of the current week, according to the requested format
+ *
+ * @param string $format ['timestamp' | 'n_in_month' | 'n_in_year' | 'array']
+ * @return mixed
+ * @access public
+ */
+ function thisWeek($format = 'n_in_month')
+ {
+ switch (strtolower($format)) {
+ case 'int':
+ case 'n_in_month':
+ if ($this->firstWeek) {
+ return 1;
+ }
+ if ($this->lastWeek) {
+ return $this->cE->getWeeksInMonth(
+ $this->cE->stampToYear($this->thisWeek),
+ $this->cE->stampToMonth($this->thisWeek),
+ $this->firstDay);
+ }
+ return $this->cE->getWeekNInMonth(
+ $this->cE->stampToYear($this->thisWeek),
+ $this->cE->stampToMonth($this->thisWeek),
+ $this->cE->stampToDay($this->thisWeek),
+ $this->firstDay);
+ break;
+ case 'n_in_year':
+ return $this->cE->getWeekNInYear(
+ $this->cE->stampToYear($this->thisWeek),
+ $this->cE->stampToMonth($this->thisWeek),
+ $this->cE->stampToDay($this->thisWeek));
+ break;
+ case 'array':
+ return $this->toArray($this->thisWeek);
+ break;
+ case 'object':
+ require_once CALENDAR_ROOT.'Factory.php';
+ return Calendar_Factory::createByTimestamp('Week',$this->thisWeek);
+ break;
+ case 'timestamp':
+ default:
+ return $this->thisWeek;
+ break;
+ }
+ }
+
+ /**
+ * Gets the value of the following week, according to the requested format
+ *
+ * @param string $format ['timestamp' | 'n_in_month' | 'n_in_year' | 'array']
+ * @return mixed
+ * @access public
+ */
+ function nextWeek($format = 'n_in_month')
+ {
+ switch (strtolower($format)) {
+ case 'int':
+ case 'n_in_month':
+ return ($this->lastWeek) ? null : $this->thisWeek('n_in_month') +1;
+ break;
+ case 'n_in_year':
+ return $this->cE->getWeekNInYear(
+ $this->cE->stampToYear($this->nextWeek),
+ $this->cE->stampToMonth($this->nextWeek),
+ $this->cE->stampToDay($this->nextWeek));
+ break;
+ case 'array':
+ return $this->toArray($this->nextWeek);
+ break;
+ case 'object':
+ require_once CALENDAR_ROOT.'Factory.php';
+ return Calendar_Factory::createByTimestamp('Week',$this->nextWeek);
+ break;
+ case 'timestamp':
+ default:
+ return $this->nextWeek;
+ break;
+ }
+ }
+
+ /**
+ * Returns the instance of Calendar_Table_Helper.
+ * Called from Calendar_Validator::isValidWeek
+ * @return Calendar_Table_Helper
+ * @access protected
+ */
+ function & getHelper()
+ {
+ return $this->tableHelper;
+ }
+
+ /**
+ * Makes sure theres a value for $this->day
+ * @return void
+ * @access private
+ */
+ function findFirstDay()
+ {
+ if (!count($this->children) > 0) {
+ $this->build();
+ foreach ($this->children as $Day) {
+ if (!$Day->isEmpty()) {
+ $this->day = $Day->thisDay();
+ break;
+ }
+ }
+ }
+ }
+}
+?>
\ No newline at end of file
/tags/Racine_livraison_narmer/api/pear/Calendar/Decorator/Wrapper.php
New file
0,0 → 1,89
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Harry Fuecks <hfuecks@phppatterns.com> |
// | Lorenzo Alberton <l dot alberton at quipo dot it> |
// +----------------------------------------------------------------------+
//
// $Id: Wrapper.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
//
/**
* @package Calendar
* @version $Id: Wrapper.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
*/
 
/**
* Allows Calendar include path to be redefined
* @ignore
*/
if (!defined('CALENDAR_ROOT')) {
define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR);
}
 
/**
* Load Calendar decorator base class
*/
require_once CALENDAR_ROOT.'Decorator.php';
 
/**
* Decorator to help with wrapping built children in another decorator
* @package Calendar
* @access public
*/
class Calendar_Decorator_Wrapper extends Calendar_Decorator
{
/**
* Constructs Calendar_Decorator_Wrapper
* @param object subclass of Calendar
* @access public
*/
function Calendar_Decorator_Wrapper(&$Calendar)
{
parent::Calendar_Decorator($Calendar);
}
 
/**
* Wraps objects returned from fetch in the named Decorator class
* @param string name of Decorator class to wrap with
* @return object instance of named decorator
* @access public
*/
function & fetch($decorator)
{
$Calendar = parent::fetch();
if ($Calendar) {
return new $decorator($Calendar);
} else {
return false;
}
}
 
/**
* Wraps the returned calendar objects from fetchAll in the named decorator
* @param string name of Decorator class to wrap with
* @return array
* @access public
*/
function fetchAll($decorator)
{
$children = parent::fetchAll();
foreach ($children as $key => $Calendar) {
$children[$key] = & new $decorator($Calendar);
}
return $children;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/Decorator/Textual.php
New file
0,0 → 1,169
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Harry Fuecks <hfuecks@phppatterns.com> |
// | Lorenzo Alberton <l dot alberton at quipo dot it> |
// +----------------------------------------------------------------------+
//
// $Id: Textual.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
//
/**
* @package Calendar
* @version $Id: Textual.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
*/
 
/**
* Allows Calendar include path to be redefined
* @ignore
*/
if (!defined('CALENDAR_ROOT')) {
define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR);
}
 
/**
* Load Calendar decorator base class
*/
require_once CALENDAR_ROOT.'Decorator.php';
 
/**
* Load the Uri utility
*/
require_once CALENDAR_ROOT.'Util'.DIRECTORY_SEPARATOR.'Textual.php';
 
/**
* Decorator to help with fetching textual representations of months and
* days of the week.
* <b>Note:</b> for performance you should prefer Calendar_Util_Textual unless you
* have a specific need to use a decorator
* @package Calendar
* @access public
*/
class Calendar_Decorator_Textual extends Calendar_Decorator
{
/**
* Constructs Calendar_Decorator_Textual
* @param object subclass of Calendar
* @access public
*/
function Calendar_Decorator_Textual(&$Calendar)
{
parent::Calendar_Decorator($Calendar);
}
 
/**
* Returns an array of 12 month names (first index = 1)
* @param string (optional) format of returned months (one,two,short or long)
* @return array
* @access public
* @static
*/
function monthNames($format='long')
{
return Calendar_Util_Textual::monthNames($format);
}
 
/**
* Returns an array of 7 week day names (first index = 0)
* @param string (optional) format of returned days (one,two,short or long)
* @return array
* @access public
* @static
*/
function weekdayNames($format='long')
{
return Calendar_Util_Textual::weekdayNames($format);
}
 
/**
* Returns textual representation of the previous month of the decorated calendar object
* @param string (optional) format of returned months (one,two,short or long)
* @return string
* @access public
*/
function prevMonthName($format='long')
{
return Calendar_Util_Textual::prevMonthName($this->calendar,$format);
}
 
/**
* Returns textual representation of the month of the decorated calendar object
* @param string (optional) format of returned months (one,two,short or long)
* @return string
* @access public
*/
function thisMonthName($format='long')
{
return Calendar_Util_Textual::thisMonthName($this->calendar,$format);
}
 
/**
* Returns textual representation of the next month of the decorated calendar object
* @param string (optional) format of returned months (one,two,short or long)
* @return string
* @access public
*/
function nextMonthName($format='long')
{
return Calendar_Util_Textual::nextMonthName($this->calendar,$format);
}
 
/**
* Returns textual representation of the previous day of week of the decorated calendar object
* @param string (optional) format of returned months (one,two,short or long)
* @return string
* @access public
*/
function prevDayName($format='long')
{
return Calendar_Util_Textual::prevDayName($this->calendar,$format);
}
 
/**
* Returns textual representation of the day of week of the decorated calendar object
* @param string (optional) format of returned months (one,two,short or long)
* @return string
* @access public
*/
function thisDayName($format='long')
{
return Calendar_Util_Textual::thisDayName($this->calendar,$format);
}
 
/**
* Returns textual representation of the next day of week of the decorated calendar object
* @param string (optional) format of returned months (one,two,short or long)
* @return string
* @access public
*/
function nextDayName($format='long')
{
return Calendar_Util_Textual::nextDayName($this->calendar,$format);
}
 
/**
* Returns the days of the week using the order defined in the decorated
* calendar object. Only useful for Calendar_Month_Weekdays, Calendar_Month_Weeks
* and Calendar_Week. Otherwise the returned array will begin on Sunday
* @param string (optional) format of returned months (one,two,short or long)
* @return array ordered array of week day names
* @access public
*/
function orderedWeekdays($format='long')
{
return Calendar_Util_Textual::orderedWeekdays($this->calendar,$format);
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/Decorator/Weekday.php
New file
0,0 → 1,148
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Harry Fuecks <hfuecks@phppatterns.com> |
// | Lorenzo Alberton <l dot alberton at quipo dot it> |
// +----------------------------------------------------------------------+
//
// $Id: Weekday.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
//
/**
* @package Calendar
* @version $Id: Weekday.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
*/
 
/**
* Allows Calendar include path to be redefined
* @ignore
*/
if (!defined('CALENDAR_ROOT')) {
define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR);
}
 
/**
* Load Calendar decorator base class
*/
require_once CALENDAR_ROOT.'Decorator.php';
 
/**
* Load a Calendar_Day
*/
require_once CALENDAR_ROOT.'Day.php';
/**
* Decorator for fetching the day of the week
* <code>
* $Day = new Calendar_Day(2003, 10, 23);
* $Weekday = & new Calendar_Decorator_Weekday($Day);
* $Weekday->setFirstDay(0); // Set first day of week to Sunday (default Mon)
* echo $Weekday->thisWeekDay(); // Displays 5 - fifth day of week relative to Sun
* </code>
* @package Calendar
* @access public
*/
class Calendar_Decorator_Weekday extends Calendar_Decorator
{
/**
* First day of week
* @var int (default = 1 for Monday)
* @access private
*/
var $firstDay = 1;
 
/**
* Constructs Calendar_Decorator_Weekday
* @param object subclass of Calendar
* @access public
*/
function Calendar_Decorator_Weekday(& $Calendar)
{
parent::Calendar_Decorator($Calendar);
}
 
/**
* Sets the first day of the week (0 = Sunday, 1 = Monday (default) etc)
* @param int first day of week
* @return void
* @access public
*/
function setFirstDay($firstDay) {
$this->firstDay = (int)$firstDay;
}
 
/**
* Returns the previous weekday
* @param string (default = 'int') return value format
* @return int numeric day of week or timestamp
* @access public
*/
function prevWeekDay($format = 'int')
{
$ts = $this->calendar->prevDay('timestamp');
$Day = new Calendar_Day(2000,1,1);
$Day->setTimeStamp($ts);
$day = $this->calendar->cE->getDayOfWeek($Day->thisYear(),$Day->thisMonth(),$Day->thisDay());
$day = $this->adjustWeekScale($day);
return $this->returnValue('Day', $format, $ts, $day);
}
 
/**
* Returns the current weekday
* @param string (default = 'int') return value format
* @return int numeric day of week or timestamp
* @access public
*/
function thisWeekDay($format = 'int')
{
$ts = $this->calendar->thisDay('timestamp');
$day = $this->calendar->cE->getDayOfWeek($this->calendar->year,$this->calendar->month,$this->calendar->day);
$day = $this->adjustWeekScale($day);
return $this->returnValue('Day', $format, $ts, $day);
}
 
/**
* Returns the next weekday
* @param string (default = 'int') return value format
* @return int numeric day of week or timestamp
* @access public
*/
function nextWeekDay($format = 'int')
{
$ts = $this->calendar->nextDay('timestamp');
$Day = new Calendar_Day(2000,1,1);
$Day->setTimeStamp($ts);
$day = $this->calendar->cE->getDayOfWeek($Day->thisYear(),$Day->thisMonth(),$Day->thisDay());
$day = $this->adjustWeekScale($day);
return $this->returnValue('Day', $format, $ts, $day);
}
 
/**
* Adjusts the day of the week relative to the first day of the week
* @param int day of week calendar from Calendar_Engine
* @return int day of week adjusted to first day
* @access private
*/
function adjustWeekScale($dayOfWeek) {
$dayOfWeek = $dayOfWeek - $this->firstDay;
if ( $dayOfWeek >= 0 ) {
return $dayOfWeek;
} else {
return $this->calendar->cE->getDaysInWeek(
$this->calendar->year,$this->calendar->month,$this->calendar->day
) + $dayOfWeek;
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/Decorator/Uri.php
New file
0,0 → 1,151
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Harry Fuecks <hfuecks@phppatterns.com> |
// | Lorenzo Alberton <l dot alberton at quipo dot it> |
// +----------------------------------------------------------------------+
//
// $Id: Uri.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
//
/**
* @package Calendar
* @version $Id: Uri.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
*/
 
/**
* Allows Calendar include path to be redefined
* @ignore
*/
if (!defined('CALENDAR_ROOT')) {
define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR);
}
 
/**
* Load Calendar decorator base class
*/
require_once CALENDAR_ROOT.'Decorator.php';
 
/**
* Load the Uri utility
*/
require_once CALENDAR_ROOT.'Util'.DIRECTORY_SEPARATOR.'Uri.php';
 
/**
* Decorator to help with building HTML links for navigating the calendar<br />
* <b>Note:</b> for performance you should prefer Calendar_Util_Uri unless you
* have a specific need to use a decorator
* <code>
* $Day = new Calendar_Day(2003, 10, 23);
* $Uri = & new Calendar_Decorator_Uri($Day);
* $Uri->setFragments('year', 'month', 'day');
* echo $Uri->getPrev(); // Displays year=2003&month=10&day=22
* </code>
* @see Calendar_Util_Uri
* @package Calendar
* @access public
*/
class Calendar_Decorator_Uri extends Calendar_Decorator
{
 
/**
* @var Calendar_Util_Uri
* @access private
*/
var $Uri;
 
/**
* Constructs Calendar_Decorator_Uri
* @param object subclass of Calendar
* @access public
*/
function Calendar_Decorator_Uri(&$Calendar)
{
parent::Calendar_Decorator($Calendar);
}
 
/**
* Sets the URI fragment names
* @param string URI fragment for year
* @param string (optional) URI fragment for month
* @param string (optional) URI fragment for day
* @param string (optional) URI fragment for hour
* @param string (optional) URI fragment for minute
* @param string (optional) URI fragment for second
* @return void
* @access public
*/
function setFragments($y, $m=null, $d=null, $h=null, $i=null, $s=null) {
$this->Uri = & new Calendar_Util_Uri($y, $m, $d, $h, $i, $s);
}
 
/**
* Sets the separator string between fragments
* @param string separator e.g. /
* @return void
* @access public
*/
function setSeparator($separator)
{
$this->Uri->separator = $separator;
}
 
/**
* Puts Uri decorator into "scalar mode" - URI variable names are not
* returned
* @param boolean (optional)
* @return void
* @access public
*/
function setScalar($state=true)
{
$this->Uri->scalar = $state;
}
 
/**
* Gets the URI string for the previous calendar unit
* @param string calendar unit to fetch uri for (year,month,week or day etc)
* @return string
* @access public
*/
function prev($method)
{
return $this->Uri->prev($this, $method);
}
 
/**
* Gets the URI string for the current calendar unit
* @param string calendar unit to fetch uri for (year,month,week or day etc)
* @return string
* @access public
*/
function this($method)
{
return $this->Uri->this($this, $method);
}
 
/**
* Gets the URI string for the next calendar unit
* @param string calendar unit to fetch uri for (year,month,week or day etc)
* @return string
* @access public
*/
function next($method)
{
return $this->Uri->next($this, $method);
}
 
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/Month/Weekdays.php
New file
0,0 → 1,188
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Harry Fuecks <hfuecks@phppatterns.com> |
// +----------------------------------------------------------------------+
//
// $Id: Weekdays.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
//
/**
* @package Calendar
* @version $Id: Weekdays.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
*/
 
/**
* Allows Calendar include path to be redefined
* @ignore
*/
if (!defined('CALENDAR_ROOT')) {
define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR);
}
 
/**
* Load Calendar base class
*/
require_once CALENDAR_ROOT.'Calendar.php';
 
/**
* Load base month
*/
require_once CALENDAR_ROOT.'Month.php';
 
/**
* Represents a Month and builds Days in tabular form<br>
* <code>
* require_once 'Calendar'.DIRECTORY_SEPARATOR.'Month'.DIRECTORY_SEPARATOR.'Weekdays.php';
* $Month = & new Calendar_Month_Weekdays(2003, 10); // Oct 2003
* $Month->build(); // Build Calendar_Day objects
* while ($Day = & $Month->fetch()) {
* if ($Day->isFirst()) {
* echo '<tr>';
* }
* if ($Day->isEmpty()) {
* echo '<td>&nbsp;</td>';
* } else {
* echo '<td>'.$Day->thisDay().'</td>';
* }
* if ($Day->isLast()) {
* echo '</tr>';
* }
* }
* </code>
* @package Calendar
* @access public
*/
class Calendar_Month_Weekdays extends Calendar_Month
{
/**
* Instance of Calendar_Table_Helper
* @var Calendar_Table_Helper
* @access private
*/
var $tableHelper;
 
/**
* First day of the week
* @access private
* @var string
*/
var $firstDay;
 
/**
* Constructs Calendar_Month_Weekdays
* @param int year e.g. 2003
* @param int month e.g. 5
* @param int (optional) first day of week (e.g. 0 for Sunday, 2 for Tuesday etc.)
* @access public
*/
function Calendar_Month_Weekdays($y, $m, $firstDay=false)
{
Calendar_Month::Calendar_Month($y, $m);
$this->firstDay = $firstDay;
}
 
/**
* Builds Day objects in tabular form, to allow display of calendar month
* with empty cells if the first day of the week does not fall on the first
* day of the month.
* @see Calendar_Day::isEmpty()
* @see Calendar_Day_Base::isFirst()
* @see Calendar_Day_Base::isLast()
* @param array (optional) Calendar_Day objects representing selected dates
* @return boolean
* @access public
*/
function build($sDates=array())
{
require_once CALENDAR_ROOT.'Table'.DIRECTORY_SEPARATOR.'Helper.php';
$this->tableHelper = & new Calendar_Table_Helper($this, $this->firstDay);
Calendar_Month::build($sDates);
$this->buildEmptyDaysBefore();
$this->shiftDays();
$this->buildEmptyDaysAfter();
$this->setWeekMarkers();
return true;
}
 
/**
* Prepends empty days before the real days in the month
* @return void
* @access private
*/
function buildEmptyDaysBefore()
{
$eBefore = $this->tableHelper->getEmptyDaysBefore();
for ($i=0; $i < $eBefore; $i++) {
$stamp = $this->cE->dateToStamp($this->year, $this->month, -$i);
$Day = new Calendar_Day(
$this->cE->stampToYear($stamp),
$this->cE->stampToMonth($stamp),
$this->cE->stampToDay($stamp));
$Day->setEmpty();
array_unshift($this->children, $Day);
}
}
 
/**
* Shifts the array of children forward, if necessary
* @return void
* @access private
*/
function shiftDays()
{
if (isset ($this->children[0])) {
array_unshift($this->children, null);
unset($this->children[0]);
}
}
 
/**
* Appends empty days after the real days in the month
* @return void
* @access private
*/
function buildEmptyDaysAfter()
{
$eAfter = $this->tableHelper->getEmptyDaysAfter();
$sDOM = $this->tableHelper->getNumTableDaysInMonth();
for ($i = 1; $i <= $sDOM-$eAfter; $i++) {
$Day = new Calendar_Day($this->year, $this->month+1, $i);
$Day->setEmpty();
array_push($this->children, $Day);
}
}
 
/**
* Sets the "markers" for the beginning and of a of week, in the
* built Calendar_Day children
* @return void
* @access private
*/
function setWeekMarkers()
{
$dIW = $this->cE->getDaysInWeek(
$this->thisYear(),
$this->thisMonth(),
$this->thisDay()
);
$sDOM = $this->tableHelper->getNumTableDaysInMonth();
for ($i=1; $i <= $sDOM; $i+= $dIW) {
$this->children[$i]->setFirst();
$this->children[$i+($dIW-1)]->setLast();
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/Month/Weeks.php
New file
0,0 → 1,140
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Harry Fuecks <hfuecks@phppatterns.com> |
// | Lorenzo Alberton <l dot alberton at quipo dot it> |
// +----------------------------------------------------------------------+
//
// $Id: Weeks.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
//
/**
* @package Calendar
* @version $Id: Weeks.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
*/
 
/**
* Allows Calendar include path to be redefined
* @ignore
*/
if (!defined('CALENDAR_ROOT')) {
define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR);
}
 
/**
* Load Calendar base class
*/
require_once CALENDAR_ROOT.'Calendar.php';
 
/**
* Load base month
*/
require_once CALENDAR_ROOT.'Month.php';
 
/**
* Represents a Month and builds Weeks
* <code>
* require_once 'Calendar'.DIRECTORY_SEPARATOR.'Month'.DIRECTORY_SEPARATOR.'Weeks.php';
* $Month = & new Calendar_Month_Weeks(2003, 10); // Oct 2003
* $Month->build(); // Build Calendar_Day objects
* while ($Week = & $Month->fetch()) {
* echo $Week->thisWeek().'<br />';
* }
* </code>
* @package Calendar
* @access public
*/
class Calendar_Month_Weeks extends Calendar_Month
{
/**
* Instance of Calendar_Table_Helper
* @var Calendar_Table_Helper
* @access private
*/
var $tableHelper;
 
/**
* First day of the week
* @access private
* @var string
*/
var $firstDay;
 
/**
* Constructs Calendar_Month_Weeks
* @param int year e.g. 2003
* @param int month e.g. 5
* @param int (optional) first day of week (e.g. 0 for Sunday, 2 for Tuesday etc.)
* @access public
*/
function Calendar_Month_Weeks($y, $m, $firstDay=false)
{
Calendar_Month::Calendar_Month($y, $m);
$this->firstDay = $firstDay;
}
 
/**
* Builds Calendar_Week objects for the Month. Note that Calendar_Week
* builds Calendar_Day object in tabular form (with Calendar_Day->empty)
* @param array (optional) Calendar_Week objects representing selected dates
* @return boolean
* @access public
*/
function build($sDates=array())
{
require_once CALENDAR_ROOT.'Table'.DIRECTORY_SEPARATOR.'Helper.php';
$this->tableHelper = & new Calendar_Table_Helper($this, $this->firstDay);
require_once CALENDAR_ROOT.'Week.php';
$numWeeks = $this->tableHelper->getNumWeeks();
for ($i=1, $d=1; $i<=$numWeeks; $i++,
$d+=$this->cE->getDaysInWeek(
$this->thisYear(),
$this->thisMonth(),
$this->thisDay()) ) {
$this->children[$i] = new Calendar_Week(
$this->year, $this->month, $d, $this->tableHelper->getFirstDay());
}
//used to set empty days
$this->children[1]->setFirst(true);
$this->children[$numWeeks]->setLast(true);
 
// Handle selected weeks here
if (count($sDates) > 0) {
$this->setSelection($sDates);
}
return true;
}
 
/**
* Called from build()
* @param array
* @return void
* @access private
*/
function setSelection($sDates)
{
foreach ($sDates as $sDate) {
if ($this->year == $sDate->thisYear()
&& $this->month == $sDate->thisMonth())
{
$key = $sDate->thisWeek('n_in_month');
if (isset($this->children[$key])) {
$this->children[$key]->setSelected();
}
}
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/Year.php
New file
0,0 → 1,119
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Harry Fuecks <hfuecks@phppatterns.com> |
// +----------------------------------------------------------------------+
//
// $Id: Year.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
//
/**
* @package Calendar
* @version $Id: Year.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
*/
 
/**
* Allows Calendar include path to be redefined
* @ignore
*/
if (!defined('CALENDAR_ROOT')) {
define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR);
}
 
/**
* Load Calendar base class
*/
require_once CALENDAR_ROOT.'Calendar.php';
 
/**
* Represents a Year and builds Months<br>
* <code>
* require_once 'Calendar'.DIRECTORY_SEPARATOR.'Year.php';
* $Year = & new Calendar_Year(2003, 10, 21); // 21st Oct 2003
* $Year->build(); // Build Calendar_Month objects
* while ($Month = & $Year->fetch()) {
* echo $Month->thisMonth().'<br />';
* }
* </code>
* @package Calendar
* @access public
*/
class Calendar_Year extends Calendar
{
/**
* Constructs Calendar_Year
* @param int year e.g. 2003
* @access public
*/
function Calendar_Year($y)
{
Calendar::Calendar($y);
}
 
/**
* Builds the Months of the Year.<br>
* <b>Note:</b> by defining the constant CALENDAR_MONTH_STATE you can
* control what class of Calendar_Month is built e.g.;
* <code>
* require_once 'Calendar/Calendar_Year.php';
* define ('CALENDAR_MONTH_STATE',CALENDAR_USE_MONTH_WEEKDAYS); // Use Calendar_Month_Weekdays
* // define ('CALENDAR_MONTH_STATE',CALENDAR_USE_MONTH_WEEKS); // Use Calendar_Month_Weeks
* // define ('CALENDAR_MONTH_STATE',CALENDAR_USE_MONTH); // Use Calendar_Month
* </code>
* It defaults to building Calendar_Month objects.
* @param array (optional) array of Calendar_Month objects representing selected dates
* @param int (optional) first day of week (e.g. 0 for Sunday, 2 for Tuesday etc.)
* @return boolean
* @access public
*/
function build($sDates = array(), $firstDay = null)
{
require_once CALENDAR_ROOT.'Factory.php';
if (is_null($firstDay)) {
$firstDay = $this->cE->getFirstDayOfWeek(
$this->thisYear(),
$this->thisMonth(),
$this->thisDay()
);
}
$monthsInYear = $this->cE->getMonthsInYear($this->thisYear());
for ($i=1; $i <= $monthsInYear; $i++) {
$this->children[$i] = Calendar_Factory::create('Month',$this->year,$i);
}
if (count($sDates) > 0) {
$this->setSelection($sDates);
}
return true;
}
 
/**
* Called from build()
* @param array
* @return void
* @access private
*/
function setSelection($sDates) {
foreach ($sDates as $sDate) {
if ($this->year == $sDate->thisYear()) {
$key = $sDate->thisMonth();
if (isset($this->children[$key])) {
$sDate->setSelected();
$this->children[$key] = $sDate;
}
}
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/Minute.php
New file
0,0 → 1,114
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Harry Fuecks <hfuecks@phppatterns.com> |
// +----------------------------------------------------------------------+
//
// $Id: Minute.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
//
/**
* @package Calendar
* @version $Id: Minute.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
*/
 
/**
* Allows Calendar include path to be redefined
* @ignore
*/
if (!defined('CALENDAR_ROOT')) {
define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR);
}
 
/**
* Load Calendar base class
*/
require_once CALENDAR_ROOT.'Calendar.php';
 
/**
* Represents a Minute and builds Seconds
* <code>
* require_once 'Calendar'.DIRECTORY_SEPARATOR.'Minute.php';
* $Minute = & new Calendar_Minute(2003, 10, 21, 15, 31); // Oct 21st 2003, 3:31pm
* $Minute->build(); // Build Calendar_Second objects
* while ($Second = & $Minute->fetch()) {
* echo $Second->thisSecond().'<br />';
* }
* </code>
* @package Calendar
* @access public
*/
class Calendar_Minute extends Calendar
{
/**
* Constructs Minute
* @param int year e.g. 2003
* @param int month e.g. 5
* @param int day e.g. 11
* @param int hour e.g. 13
* @param int minute e.g. 31
* @access public
*/
function Calendar_Minute($y, $m, $d, $h, $i)
{
Calendar::Calendar($y, $m, $d, $h, $i);
}
 
/**
* Builds the Calendar_Second objects
* @param array (optional) Calendar_Second objects representing selected dates
* @return boolean
* @access public
*/
function build($sDates=array())
{
require_once CALENDAR_ROOT.'Second.php';
$sIM = $this->cE->getSecondsInMinute($this->year, $this->month,
$this->day, $this->hour, $this->minute);
for ($i=0; $i < $sIM; $i++) {
$this->children[$i] = new Calendar_Second($this->year, $this->month,
$this->day, $this->hour, $this->minute, $i);
}
if (count($sDates) > 0) {
$this->setSelection($sDates);
}
return true;
}
 
/**
* Called from build()
* @param array
* @return void
* @access private
*/
function setSelection($sDates)
{
foreach ($sDates as $sDate) {
if ($this->year == $sDate->thisYear()
&& $this->month == $sDate->thisMonth()
&& $this->day == $sDate->thisDay()
&& $this->hour == $sDate->thisHour()
&& $this->minute == $sDate->thisMinute())
{
$key = (int)$sDate->thisSecond();
if (isset($this->children[$key])) {
$sDate->setSelected();
$this->children[$key] = $sDate;
}
}
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/Table/Helper.php
New file
0,0 → 1,280
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Harry Fuecks <hfuecks@phppatterns.com> |
// +----------------------------------------------------------------------+
//
// $Id: Helper.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
//
/**
* @package Calendar
* @version $Id: Helper.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
*/
 
/**
* Used by Calendar_Month_Weekdays, Calendar_Month_Weeks and Calendar_Week to
* help with building the calendar in tabular form
* @package Calendar
* @access protected
*/
class Calendar_Table_Helper
{
/**
* Instance of the Calendar object being helped.
* @var object
* @access private
*/
var $calendar;
 
/**
* Instance of the Calendar_Engine
* @var object
* @access private
*/
var $cE;
 
/**
* First day of the week
* @access private
* @var string
*/
var $firstDay;
 
/**
* The seven days of the week named
* @access private
* @var array
*/
var $weekDays;
 
/**
* Days of the week ordered with $firstDay at the beginning
* @access private
* @var array
*/
var $daysOfWeek = array();
 
/**
* Days of the month built from days of the week
* @access private
* @var array
*/
var $daysOfMonth = array();
 
/**
* Number of weeks in month
* @var int
* @access private
*/
var $numWeeks = null;
 
/**
* Number of emtpy days before real days begin in month
* @var int
* @access private
*/
var $emptyBefore = 0;
 
/**
* Constructs Calendar_Table_Helper
* @param object Calendar_Month_Weekdays, Calendar_Month_Weeks, Calendar_Week
* @param int (optional) first day of the week e.g. 1 for Monday
* @access protected
*/
function Calendar_Table_Helper(& $calendar, $firstDay=false)
{
$this->calendar = & $calendar;
$this->cE = & $calendar->getEngine();
if ($firstDay === false) {
$firstDay = $this->cE->getFirstDayOfWeek(
$this->calendar->thisYear(),
$this->calendar->thisMonth(),
$this->calendar->thisDay()
);
}
$this->firstDay = $firstDay;
$this->setFirstDay();
$this->setDaysOfMonth();
}
 
/**
* Constructs $this->daysOfWeek based on $this->firstDay
* @return void
* @access private
*/
function setFirstDay()
{
$weekDays = $this->cE->getWeekDays(
$this->calendar->thisYear(),
$this->calendar->thisMonth(),
$this->calendar->thisDay()
);
$endDays = array();
$tmpDays = array();
$begin = false;
foreach ($weekDays as $day) {
if ($begin == true) {
$endDays[] = $day;
} else if ($day === $this->firstDay) {
$begin = true;
$endDays[] = $day;
} else {
$tmpDays[] = $day;
}
}
$this->daysOfWeek = array_merge($endDays, $tmpDays);
}
 
/**
* Constructs $this->daysOfMonth
* @return void
* @access private
*/
function setDaysOfMonth()
{
$this->daysOfMonth = $this->daysOfWeek;
$daysInMonth = $this->cE->getDaysInMonth(
$this->calendar->thisYear(), $this->calendar->thisMonth());
$firstDayInMonth = $this->cE->getFirstDayInMonth(
$this->calendar->thisYear(), $this->calendar->thisMonth());
$this->emptyBefore=0;
foreach ($this->daysOfMonth as $dayOfWeek) {
if ($firstDayInMonth == $dayOfWeek) {
break;
}
$this->emptyBefore++;
}
$this->numWeeks = ceil(
($daysInMonth + $this->emptyBefore)
/
$this->cE->getDaysInWeek(
$this->calendar->thisYear(),
$this->calendar->thisMonth(),
$this->calendar->thisDay()
)
);
for ($i=1; $i < $this->numWeeks; $i++) {
$this->daysOfMonth =
array_merge($this->daysOfMonth, $this->daysOfWeek);
}
}
 
/**
* Returns the first day of the month
* @see Calendar_Engine_Interface::getFirstDayOfWeek()
* @return int
* @access protected
*/
function getFirstDay()
{
return $this->firstDay;
}
 
/**
* Returns the order array of days in a week
* @return int
* @access protected
*/
function getDaysOfWeek()
{
return $this->daysOfWeek;
}
 
/**
* Returns the number of tabular weeks in a month
* @return int
* @access protected
*/
function getNumWeeks()
{
return $this->numWeeks;
}
 
/**
* Returns the number of real days + empty days
* @return int
* @access protected
*/
function getNumTableDaysInMonth()
{
return count($this->daysOfMonth);
}
 
/**
* Returns the number of empty days before the real days begin
* @return int
* @access protected
*/
function getEmptyDaysBefore()
{
return $this->emptyBefore;
}
 
/**
* Returns the index of the last real day in the month
* @todo Potential performance optimization with static
* @return int
* @access protected
*/
function getEmptyDaysAfter()
{
// Causes bug when displaying more than one month
// static $index;
// if (!isset($index)) {
$index = $this->getEmptyDaysBefore() + $this->cE->getDaysInMonth(
$this->calendar->thisYear(), $this->calendar->thisMonth());
// }
return $index;
}
 
/**
* Returns the index of the last real day in the month, relative to the
* beginning of the tabular week it is part of
* @return int
* @access protected
*/
function getEmptyDaysAfterOffset()
{
$eAfter = $this->getEmptyDaysAfter();
return $eAfter - (
$this->cE->getDaysInWeek(
$this->calendar->thisYear(),
$this->calendar->thisMonth(),
$this->calendar->thisDay()
) * ($this->numWeeks-1) );
}
 
/**
* Returns the timestamp of the first day of the current week
*/
function getWeekStart($y, $m, $d, $firstDay=1)
{
$dow = $this->cE->getDayOfWeek($y, $m, $d);
if ($dow > $firstDay) {
$d -= ($dow - $firstDay);
}
if ($dow < $firstDay) {
$d -= (
$this->cE->getDaysInWeek(
$this->calendar->thisYear(),
$this->calendar->thisMonth(),
$this->calendar->thisDay()
) - $firstDay + $dow);
}
return $this->cE->dateToStamp($y, $m, $d);
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/Readme
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/Readme
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/10.php
New file
0,0 → 1,93
<?php
/**
* Description: demonstrates a decorator to provide simple output formatting
* on the month while still allowing the days to be accessed via the decorator
* In practice you _wouldn't_ do this - each decorator comes with a performance
* hit for extra method calls. For this example some simple functions could help
* format the month while the days are accessed via the normal Month object
*/
if ( !@include 'Calendar/Calendar.php' ) {
define('CALENDAR_ROOT','../../');
}
require_once CALENDAR_ROOT.'Month/Weekdays.php';
require_once CALENDAR_ROOT.'Decorator.php';
 
// Decorate a Month with methods to improve formatting
class MonthDecorator extends Calendar_Decorator {
/**
* @param Calendar_Month
*/
function MonthDecorator(& $Month) {
parent::Calendar_Decorator($Month);
}
/**
* Override the prevMonth method to format the output
*/
function prevMonth() {
$prevStamp = parent::prevMonth(TRUE);
// Build the URL for the previous month
return $_SERVER['PHP_SELF'].'?y='.date('Y',$prevStamp).
'&m='.date('n',$prevStamp).'&d='.date('j',$prevStamp);
}
/**
* Override the thisMonth method to format the output
*/
function thisMonth() {
$thisStamp = parent::thisMonth(TRUE);
// A human readable string from this month
return date('F Y',$thisStamp);
}
/**
* Override the nextMonth method to format the output
*/
function nextMonth() {
$nextStamp = parent::nextMonth(TRUE);
// Build the URL for next month
return $_SERVER['PHP_SELF'].'?y='.date('Y',$nextStamp).
'&m='.date('n',$nextStamp).'&d='.date('j',$nextStamp);
}
}
 
if (!isset($_GET['y'])) $_GET['y'] = date('Y');
if (!isset($_GET['m'])) $_GET['m'] = date('n');
 
// Creata a month as usual
$Month = new Calendar_Month_Weekdays($_GET['y'],$_GET['m']);
 
// Pass it to the decorator and use the decorator from now on...
$MonthDecorator = new MonthDecorator($Month);
$MonthDecorator->build();
?>
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> A Simple Decorator </title>
</head>
<body>
<h1>A Simple Decorator</h1>
<table>
<caption><?php echo ( $MonthDecorator->thisMonth() ); ?></caption>
<?php
while ( $Day = $MonthDecorator->fetch() ) {
if ( $Day->isFirst() ) {
echo ( "\n<tr>\n" );
}
if ( $Day->isEmpty() ) {
echo ( "<td>&nbsp;</td>" );
} else {
echo ( "<td>".$Day->thisDay()."</td>" );
}
if ( $Day->isLast() ) {
echo ( "\n</tr>\n" );
}
}
?>
<tr>
<td><a href="<?php echo ($MonthDecorator->prevMonth()); ?>">Prev</a></td>
<td colspan="5">&nbsp;</td>
<td><a href="<?php echo ($MonthDecorator->nextMonth()); ?>">Next</a></td>
</tr>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/11.php
New file
0,0 → 1,109
<?php
/**
* Description: demonstrates a decorator used to "attach a payload" to a selection
* to make it available when iterating over calendar children
*/
if ( !@include 'Calendar/Calendar.php' ) {
define('CALENDAR_ROOT','../../');
}
require_once CALENDAR_ROOT.'Day.php';
require_once CALENDAR_ROOT.'Hour.php';
require_once CALENDAR_ROOT.'Decorator.php';
 
// Decorator to "attach" functionality to selected hours
class DiaryEvent extends Calendar_Decorator {
var $entry;
function DiaryEvent($calendar) {
Calendar_Decorator::Calendar_Decorator($calendar);
}
function setEntry($entry) {
$this->entry = $entry;
}
function getEntry() {
return $this->entry;
}
}
 
// Create a day to view the hours for
$Day = & new Calendar_Day(2003,10,24);
 
// A sample query to get the data for today (NOT ACTUALLY USED HERE)
$sql = "
SELECT
*
FROM
diary
WHERE
eventtime >= '".$Day->thisDay(TRUE)."'
AND
eventtime < '".$Day->nextDay(TRUE)."';";
 
// An array simulating data from a database
$result = array (
array('eventtime'=>mktime(9,0,0,10,24,2003),'entry'=>'Meeting with sales team'),
array('eventtime'=>mktime(11,0,0,10,24,2003),'entry'=>'Conference call with Widget Inc.'),
array('eventtime'=>mktime(15,0,0,10,24,2003),'entry'=>'Presentation to board of directors')
);
 
// An array to place selected hours in
$selection = array();
 
// Loop through the "database result"
foreach ( $result as $row ) {
$Hour = new Calendar_Hour(2000,1,1,1); // Create Hour with dummy values
$Hour->setTimeStamp($row['eventtime']); // Set the real time with setTimeStamp
 
// Create the decorator, passing it the Hour
$DiaryEvent = new DiaryEvent($Hour);
 
// Attach the payload
$DiaryEvent->setEntry($row['entry']);
 
// Add the decorator to the selection
$selection[] = $DiaryEvent;
}
 
// Build the hours in that day, passing the selection
$Day->build($selection);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> Passing a Selection Payload with a Decorator </title>
</head>
<body>
<h1>Passing a Selection "Payload" using a Decorator</h1>
<table>
<caption><b>Your Schedule for <?php echo ( date('D nS F Y',$Day->thisDay(TRUE)) ); ?></b></caption>
<tr>
<th width="5%">Time</th>
<th>Entry</th>
</tr>
<?php
while ( $Hour = & $Day->fetch() ) {
 
$hour = $Hour->thisHour();
$minute = $Hour->thisMinute();
 
// Office hours only...
if ( $hour >= 8 && $hour <= 18 ) {
echo ( "<tr>\n" );
echo ( "<td>$hour:$minute</td>\n" );
 
// If the hour is selected, call the decorator method...
if ( $Hour->isSelected() ) {
echo ( "<td bgcolor=\"silver\">".$Hour->getEntry()."</td>\n" );
} else {
echo ( "<td>&nbsp;</td>\n" );
}
echo ( "</tr>\n" );
}
}
?>
</table>
<p>The query to fetch this data, with help from PEAR::Calendar, might be;</p>
<pre>
<?php echo ( $sql ); ?>
</pre>
</body>
</html>
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/12.php
New file
0,0 → 1,116
<?php
/**
* Description: a complete year
*/
function getmicrotime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
$start = getmicrotime();
 
if ( !@include 'Calendar/Calendar.php' ) {
define('CALENDAR_ROOT','../../');
}
 
require_once CALENDAR_ROOT.'Year.php';
 
define ('CALENDAR_MONTH_STATE',CALENDAR_USE_MONTH_WEEKDAYS);
 
if ( !isset($_GET['year']) ) $_GET['year'] = date('Y');
 
$Year = new Calendar_Year($_GET['year']);
 
$Year->build();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> <?php echo ( $Year->thisYear() ); ?> </title>
<style type="text/css">
body {
font-family: Georgia, serif;
}
caption.year {
font-weight: bold;
font-size: 120%;
font-color: navy;
}
caption.month {
font-size: 110%;
font-color: navy;
}
table.month {
border: thin groove #800080
}
tr {
vertical-align: top;
}
th, td {
text-align: right;
font-size: 70%;
}
#prev {
float: left;
font-size: 70%;
}
#next {
float: right;
font-size: 70%;
}
</style>
</head>
<body>
<table>
<caption class="year">
<?php echo ( $Year->thisYear() ); ?>
<div id="next">
<a href="?year=<?php echo ( $Year->nextYear() ); ?>">>></a>
</div>
<div id="prev">
<a href="?year=<?php echo ( $Year->prevYear() ); ?>"><<</a>
</div>
</caption>
<?php
$i = 0;
while ( $Month = $Year->fetch() ) {
 
switch ( $i ) {
case 0:
echo ( "<tr>\n" );
break;
case 3:
case 6:
case 9:
echo ( "</tr>\n<tr>\n" );
break;
case 12:
echo ( "</tr>\n" );
break;
}
 
echo ( "<td>\n<table class=\"month\">\n" );
echo ( "<caption class=\"month\">".date('F',$Month->thisMonth(TRUE))."</caption>" );
echo ( "<tr>\n<th>M</th><th>T</th><th>W</th><th>T</th><th>F</th><th>S</th><th>S</th>\n</tr>" );
$Month->build();
while ( $Day = $Month->fetch() ) {
if ( $Day->isFirst() ) {
echo ( "<tr>\n" );
}
if ( $Day->isEmpty() ) {
echo ( "<td>&nbsp;</td>\n" );
} else {
echo ( "<td>".$Day->thisDay()."</td>\n" );
}
if ( $Day->isLast() ) {
echo ( "</tr>\n" );
}
}
echo ( "</table>\n</td>\n" );
 
$i++;
}
?>
</table>
<p>Took: <?php echo ((getmicrotime()-$start)); ?></p>
</body>
</html>
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/13.php
New file
0,0 → 1,99
<?php
/**
* Description: same as 1.php, but using the PEAR::Date engine
* Notice the use of the CALENDAR_ENGINE constant, which
* switches the calculation "engine"
* Note: make sure PEAR::Date is a stable release!!!
*/
function getmicrotime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
 
// Switch to PEAR::Date engine
define('CALENDAR_ENGINE','PearDate');
 
if ( !@include 'Calendar/Calendar.php' ) {
define('CALENDAR_ROOT','../../');
}
 
if (!isset($_GET['y'])) $_GET['y'] = 2003;
if (!isset($_GET['m'])) $_GET['m'] = 8;
if (!isset($_GET['d'])) $_GET['d'] = 9;
if (!isset($_GET['h'])) $_GET['h'] = 12;
if (!isset($_GET['i'])) $_GET['i'] = 34;
if (!isset($_GET['s'])) $_GET['s'] = 46;
 
switch ( @$_GET['view'] ) {
default:
$_GET['view'] = 'calendar_year';
case 'calendar_year':
require_once CALENDAR_ROOT.'Year.php';
$c = new Calendar_Year($_GET['y']);
break;
case 'calendar_month':
require_once CALENDAR_ROOT.'Month.php';
$c = new Calendar_Month($_GET['y'],$_GET['m']);
break;
case 'calendar_day':
require_once CALENDAR_ROOT.'Day.php';
$c = new Calendar_Day($_GET['y'],$_GET['m'],$_GET['d']);
break;
case 'calendar_hour':
require_once CALENDAR_ROOT.'Hour.php';
$c = new Calendar_Hour($_GET['y'],$_GET['m'],$_GET['d'],$_GET['h']);
break;
case 'calendar_minute':
require_once CALENDAR_ROOT.'Minute.php';
$c = new Calendar_Minute($_GET['y'],$_GET['m'],$_GET['d'],$_GET['h'],$_GET['i']);
break;
case 'calendar_second':
require_once CALENDAR_ROOT.'Second.php';
$c = new Calendar_Second($_GET['y'],$_GET['m'],$_GET['d'],$_GET['h'],$_GET['i'],$_GET['s']);
break;
}
 
// Convert timestamp to human readable date
$date = new Date($c->getTimestamp());
 
echo ( '<h1>Using PEAR::Date engine</h1>' );
echo ( 'Viewing: '.@$_GET['view'].'<br />' );
echo ( 'The time is now: '.$date->format('%Y %a %e %T').'<br >' );
 
$i = 1;
echo ( '<h1>First Iteration</h1>' );
echo ( '<p>The first iteration is more "expensive", the calendar data
structures having to be built.</p>' );
$start = getmicrotime();
$c->build();
while ( $e = $c->fetch() ) {
$class = strtolower(get_class($e));
$link ="&y=".$e->thisYear()."&m=".$e->thisMonth()."&d=".$e->thisDay().
"&h=".$e->thisHour()."&i=".$e->thisMinute()."&s=".$e->thisSecond();
$method = 'this'.str_replace('calendar_','',$class);
echo ( "<a href=\"".$_SERVER['PHP_SELF']."?view=".$class.$link."\">".$e->{$method}()."</a> : " );
if ( ($i % 10) == 0 ) {
echo ( '<br>' );
}
$i++;
}
echo ( '<p><b>Took: '.(getmicrotime()-$start).' seconds</b></p>' );
 
$i = 1;
echo ( '<h1>Second Iteration</h1>' );
echo ( '<p>This second iteration is faster, the data structures
being re-used</p>' );
$start = getmicrotime();
while ( $e = $c->fetch() ) {
$class = strtolower(get_class($e));
$link ="&y=".$e->thisYear()."&m=".$e->thisMonth()."&d=".$e->thisDay().
"&h=".$e->thisHour()."&i=".$e->thisMinute()."&s=".$e->thisSecond();
$method = 'this'.str_replace('calendar_','',$class);
echo ( "<a href=\"".$_SERVER['PHP_SELF']."?view=".$class.$link."\">".$e->{$method}()."</a> : " );
if ( ($i % 10) == 0 ) {
echo ( '<br>' );
}
$i++;
}
echo ( '<p><b>Took: '.(getmicrotime()-$start).' seconds</b></p>' );
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/1.phps
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/1.phps
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/index.html
New file
0,0 → 1,49
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>PEAR::Calendar Examples</title>
<style type="text/css">
body {
font-family: georgia, serif;
}
pre {
background-color: silver;
}
code {
color: navy;
background-color: #e2e3e4;
}
</style>
</head>
 
<body>
<h1>PEAR::Calendar Examples</h1>
<p>$Id: index.html,v 1.1 2005-09-30 14:58:00 ddelon Exp $</p>
<ul>
<li><a href="1.php">1.php</a> [<a href="1.phps">src</a>] - shows basic usage, passing all the way down from <code>Calendar_Year</code> to <code>Calendar_Second</code> - more of a quick test it's working</li>
<li><a href="2.php">2.php</a> [<a href="2.phps">src</a>] - shows how to build a tabular month using <code>Calendar_Month_Weeks</code>, <code>Calendar_Week</code>, <code>Calendar_Day</code> as well as selecting some dates.</li>
<li><a href="3.php">3.php</a> [<a href="3.phps">src</a>] - shows how to build a tabular month using <code>Calendar_Month_Weekdays</code> and <code>Calendar_Day</code>, as well as selecting some dates (this method is faster).</li>
<li><a href="4.php">4.php</a> [<a href="4.phps">src</a>] - shows how to use PEAR::Calendar for validation.</li>
<li><a href="5.php">5.php</a> [<a href="5.phps">src</a>] - shows PEAR::Calendar in use to help generate a form.</li>
<li><a href="6.php">6.php</a> [<a href="6.phps">src</a>] - a month and day "planner" calendar, which can be rendered both as HTML and WML.</li>
<li><a href="7.php">7.php</a> [<a href="7.phps">src</a>] - a simple SOAP Calendar Server, using PEAR::SOAP and PEAR::Calendar</li>
<li><a href="8.php">8.php</a> [<a href="8.phps">src</a>] - a WSDL SOAP client for the SOAP Calendar Server</li>
<li><a href="9.php">9.php</a> [<a href="9.phps">src</a>] - quick example of i18n with <code>setlocale</code> (not working on SF)</li>
<li><a href="10.php">10.php</a> [<a href="10.phps">src</a>] - an example of extending <code>Calendar_Decorator</code> to modify output</li>
<li><a href="11.php">11.php</a> [<a href="11.phps">src</a>] - attaching a "payload" (e.g. results of a DB query) to a calendar using <code>Calendar_Decorator</code> to allow the payload to be available inside the main loop.</li>
<li><a href="12.php">12.php</a> [<a href="12.phps">src</a>] - a complete year with months.</li>
<li><a href="13.php">13.php</a> [<a href="13.phps">src</a>] - same as 1.php but using <code>Calendar_Engine_PearDate</code>, (see <a href="http://pear.php.net/Date">PEAR::Date</a>).</li>
<li><a href="14.php">14.php</a> [<a href="14.phps">src</a>] - same as 3.php but using <code>Calendar_Engine_PearDate</code></li>
<li><a href="15.php">15.php</a> [<a href="15.phps">src</a>] - paging through weeks </li>
<li><a href="16.php">16.php</a> [<a href="16.phps">src</a>] - demonstrates using the Uri decorator. <i>Note</i> you should prefer <code>Calendar_Util_Uri</code> (see below) in most cases, for performance </li>
<li><a href="17.php">17.php</a> [<a href="17.phps">src</a>] - demonstrates using the Textual decorator</li>
<li><a href="18.php">18.php</a> [<a href="18.phps">src</a>] - demonstrates using the Wrapper decorator</li>
<li><a href="19.php">19.php</a> [<a href="19.phps">src</a>] - demonstrates using the Weekday decorator</li>
<li><a href="20.php">20.php</a> [<a href="20.phps">src</a>] - shows how to attach a "payload" spanning multiple days, with more than one entry per day</li>
<li><a href="21.php">21.php</a> [<a href="21.phps">src</a>] - same as 12.php but using <code>Calendar_Month_Weeks</code> instead of <code>Calendar_Month_Weekdays</code> to allow the week in the year or week in the month to be displayed.</li>
<li><a href="22.php">22.php</a> [<a href="22.phps">src</a>] - demonstrates use of <code>Calendar_Util_Uri</code>.</li>
<li><a href="22.php">23.php</a> [<a href="23.phps">src</a>] - demonstrates use of <code>Calendar_Util_Textual</code>.</li>
</ul>
</body>
</html>
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/14.php
New file
0,0 → 1,141
<?php
/**
* Description: same as 3.php, but using the PEAR::Date engine
* Note: make sure PEAR::Date is a stable release!!!
*/
function getmicrotime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
$start = getmicrotime();
 
// Switch to PEAR::Date engine
define('CALENDAR_ENGINE', 'PearDate');
 
if (!@include 'Calendar'.DIRECTORY_SEPARATOR.'Calendar.php') {
define('CALENDAR_ROOT','../../');
}
require_once CALENDAR_ROOT.'Month/Weekdays.php';
require_once CALENDAR_ROOT.'Day.php';
 
// Initialize GET variables if not set
if (!isset($_GET['y'])) $_GET['y'] = date('Y');
if (!isset($_GET['m'])) $_GET['m'] = date('m');
if (!isset($_GET['d'])) $_GET['d'] = date('d');
 
// Build the month
$month = new Calendar_Month_Weekdays($_GET['y'], $_GET['m']);
 
// Create an array of days which are "selected"
// Used for Week::build() below
$selectedDays = array (
new Calendar_Day($_GET['y'], $_GET['m'], $_GET['d']),
new Calendar_Day($_GET['y'], 12, 25),
);
 
// Build the days in the month
$month->build($selectedDays);
 
// Construct strings for next/previous links
$PMonth = $month->prevMonth('object'); // Get previous month as object
$prev = $_SERVER['PHP_SELF'].'?y='.$PMonth->thisYear().'&m='.$PMonth->thisMonth().'&d='.$PMonth->thisDay();
$NMonth = $month->nextMonth('object');
$next = $_SERVER['PHP_SELF'].'?y='.$NMonth->thisYear().'&m='.$NMonth->thisMonth().'&d='.$NMonth->thisDay();
 
$thisDate = new Date($month->thisMonth('timestamp'));
?>
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> Calendar using PEAR::Date Engine </title>
<style text="text/css">
table {
background-color: silver;
}
caption {
font-family: verdana;
font-size: 12px;
background-color: while;
}
.prevMonth {
font-size: 10px;
text-align: left;
}
.nextMonth {
font-size: 10px;
text-align: right;
}
th {
font-family: verdana;
font-size: 11px;
color: navy;
text-align: right;
}
td {
font-family: verdana;
font-size: 11px;
text-align: right;
}
.selected {
background-color: yellow;
}
</style>
</head>
 
<body>
 
<h2>Calendar using PEAR::Date Engine</h2>
<table class="calendar">
<caption>
<?php echo $thisDate->format('%B %Y'); ?>
</caption>
<tr>
<th>M</th>
<th>T</th>
<th>W</th>
<th>T</th>
<th>F</th>
<th>S</th>
<th>S</th>
</tr>
<?php
while ($day = $month->fetch()) {
// Build a link string for each day
$link = $_SERVER['PHP_SELF'].
'?y='.$day->thisYear().
'&m='.$day->thisMonth().
'&d='.$day->thisDay();
 
// isFirst() to find start of week
if ($day->isFirst())
echo "<tr>\n";
 
if ($day->isSelected()) {
echo '<td class="selected">'.$day->thisDay().'</td>'."\n";
} else if ($day->isEmpty()) {
echo '<td>&nbsp;</td>'."\n";
} else {
echo '<td><a href="'.$link.'">'.$day->thisDay().'</a></td>'."\n";
}
 
// isLast() to find end of week
if ($day->isLast()) {
echo "</tr>\n";
}
}
?>
<tr>
<td>
<a href="<?php echo $prev; ?>" class="prevMonth"><< </a>
</td>
<td colspan="5">&nbsp;</td>
<td>
<a href="<?php echo $next; ?>" class="nextMonth"> >></a>
</td>
</tr>
</table>
<?php
echo '<p><b>Took: '.(getmicrotime()-$start).' seconds</b></p>';
?>
</body>
</html>
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/3.phps
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/3.phps
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/15.php
New file
0,0 → 1,58
<?php
/**
* Shows more on how a week can be used
*/
function getmicrotime() {
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
$start = getmicrotime();
 
if (!@include 'Calendar/Calendar.php') {
define('CALENDAR_ROOT', '../../');
}
require_once CALENDAR_ROOT.'Week.php';
 
if (!isset($_GET['y'])) $_GET['y'] = date('Y');
if (!isset($_GET['m'])) $_GET['m'] = date('m');
if (!isset($_GET['d'])) $_GET['d'] = 1;
 
// Build the month
$Week = new Calendar_Week($_GET['y'], $_GET['m'], $_GET['d']);
/*
$Validator = $Week->getValidator();
if (!$Validator->isValidWeek()) {
die ('Please enter a valid week!');
}
*/
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> Paging Weeks </title>
</head>
<body>
<h1>Paging Weeks</h1>
<h2>Week: <?php echo $Week->thisWeek().' '.date('F Y',$Week->thisMonth(true)); ?></h2>
<?php
$Week->build();
while ($Day = $Week->fetch()) {
echo '<p>'.date('jS F',$Day->thisDay(true))."</p>\n";
}
$days = $Week->fetchAll();
 
$prevWeek = $Week->prevWeek('array');
$prevWeekLink = $_SERVER['PHP_SELF'].
'?y='.$prevWeek['year'].
'&m='.$prevWeek['month'].
'&d='.$prevWeek['day'];
 
$nextWeek = $Week->nextWeek('array');
$nextWeekLink = $_SERVER['PHP_SELF'].
'?y='.$nextWeek['year'].
'&m='.$nextWeek['month'].
'&d='.$nextWeek['day'];
?>
<p><a href="<?php echo $prevWeekLink; ?>"><<</a> | <a href="<?php echo $nextWeekLink; ?>">>></a></p>
</body>
</html>
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/16.php
New file
0,0 → 1,31
<?php
/**
* Description: demonstrates using the Uri decorator
*/
if (!@include 'Calendar/Calendar.php') {
define('CALENDAR_ROOT', '../../');
}
require_once CALENDAR_ROOT.'Month/Weekdays.php';
require_once CALENDAR_ROOT.'Decorator/Uri.php';
 
if (!isset($_GET['jahr'])) $_GET['jahr'] = date('Y');
if (!isset($_GET['monat'])) $_GET['monat'] = date('m');
 
// Build the month
$Calendar = new Calendar_Month_Weekdays($_GET['jahr'], $_GET['monat']);
 
echo ( '<p>The current month is '
.$Calendar->thisMonth().' of year '.$Calendar->thisYear().'</p>');
 
$Uri = & new Calendar_Decorator_Uri($Calendar);
$Uri->setFragments('jahr','monat');
// $Uri->setSeperator('/'); // Default is &
// $Uri->setScalar(); // Omit variable names
echo ( "<pre>Previous Uri:\t".$Uri->prev('month')."\n" );
echo ( "This Uri:\t".$Uri->this('month')."\n" );
echo ( "Next Uri:\t".$Uri->next('month')."\n</pre>" );
?>
<p>
<a href="<?php echo($_SERVER['PHP_SELF'].'?'.$Uri->prev('month'));?>">Prev</a> :
<a href="<?php echo($_SERVER['PHP_SELF'].'?'.$Uri->next('month'));?>">Next</a>
</p>
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/17.php
New file
0,0 → 1,71
<?php
/**
* Description: demonstrates using the Textual decorator
*/
 
if (!@include 'Calendar'.DIRECTORY_SEPARATOR.'Calendar.php') {
define('CALENDAR_ROOT', '../../');
}
require_once CALENDAR_ROOT.'Day.php';
require_once CALENDAR_ROOT.'Month'.DIRECTORY_SEPARATOR.'Weekdays.php';
require_once CALENDAR_ROOT.'Decorator'.DIRECTORY_SEPARATOR.'Textual.php';
 
// Could change language like this
// setlocale (LC_TIME, "de_DE"); // Unix based (probably)
// setlocale (LC_TIME, "ge"); // Windows
 
echo "<hr>Calling: Calendar_Decorator_Textual::monthNames('long');<pre>";
print_r(Calendar_Decorator_Textual::monthNames('long'));
echo '</pre>';
 
echo "<hr>Calling: Calendar_Decorator_Textual::weekdayNames('two');<pre>";
print_r(Calendar_Decorator_Textual::weekdayNames('two'));
echo '</pre>';
 
echo "<hr>Creating: new Calendar_Day(date('Y'), date('n'), date('d'));<br />";
$Calendar = new Calendar_Day(date('Y'), date('n'), date('d'));
 
// Decorate
$Textual = & new Calendar_Decorator_Textual($Calendar);
 
echo '<hr>Previous month is: '.$Textual->prevMonthName('two').'<br />';
echo 'This month is: '.$Textual->thisMonthName('short').'<br />';
echo 'Next month is: '.$Textual->nextMonthName().'<br /><hr />';
echo 'Previous day is: '.$Textual->prevDayName().'<br />';
echo 'This day is: '.$Textual->thisDayName('short').'<br />';
echo 'Next day is: '.$Textual->nextDayName('one').'<br /><hr />';
 
echo "Creating: new Calendar_Month_Weekdays(date('Y'), date('n'), 6); - Saturday is first day of week<br />";
$Calendar = new Calendar_Month_Weekdays(date('Y'), date('n'), 6);
 
// Decorate
$Textual = & new Calendar_Decorator_Textual($Calendar);
?>
<p>Rendering calendar....</p>
<table>
<caption><?php echo $Textual->thisMonthName().' '.$Textual->thisYear(); ?></caption>
<tr>
<?php
$dayheaders = $Textual->orderedWeekdays('short');
foreach ($dayheaders as $dayheader) {
echo '<th>'.$dayheader.'</th>';
}
?>
</tr>
<?php
$Calendar->build();
while ($Day = $Calendar->fetch()) {
if ($Day->isFirst()) {
echo "<tr>\n";
}
if ($Day->isEmpty()) {
echo '<td>&nbsp;</td>';
} else {
echo '<td>'.$Day->thisDay().'</td>';
}
if ($Day->isLast()) {
echo "</tr>\n";
}
}
?>
</table>
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/5.phps
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/5.phps
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/18.php
New file
0,0 → 1,36
<?php
/**
* Description: demonstrates using the Wrapper decorator
*/
 
if (!@include 'Calendar/Calendar.php') {
define('CALENDAR_ROOT', '../../');
}
require_once CALENDAR_ROOT.'Month.php';
require_once CALENDAR_ROOT.'Decorator.php'; // Not really needed but added to help this make sense
require_once CALENDAR_ROOT.'Decorator/Wrapper.php';
 
class MyBoldDecorator extends Calendar_Decorator
{
function MyBoldDecorator(&$Calendar)
{
parent::Calendar_Decorator($Calendar);
}
 
function thisDay()
{
return '<b>'.parent::thisDay().'</b>';
}
}
 
$Month = new Calendar_Month(date('Y'), date('n'));
 
$Wrapper = & new Calendar_Decorator_Wrapper($Month);
$Wrapper->build();
 
echo '<h2>The Wrapper decorator</h2>';
echo '<i>Day numbers are rendered in bold</i><br /> <br />';
while ($DecoratedDay = $Wrapper->fetch('MyBoldDecorator')) {
echo $DecoratedDay->thisDay().'<br />';
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/19.php
New file
0,0 → 1,24
<?php
/**
* Description: demonstrates using the Weekday decorator
*/
if (!@include 'Calendar'.DIRECTORY_SEPARATOR.'Calendar.php') {
define('CALENDAR_ROOT', '../../');
}
require_once CALENDAR_ROOT.'Day.php';
require_once CALENDAR_ROOT.'Decorator/Weekday.php';
 
$Day = new Calendar_Day(date('Y'), date('n'),date('d'));
$WeekDay = & new Calendar_Decorator_Weekday($Day);
// $WeekDay->setFirstDay(0); // Make Sunday first Day
 
echo 'Yesterday: '.$WeekDay->prevWeekDay().'<br>';
echo 'Today: '.$WeekDay->thisWeekDay().'<br>';
echo 'Tomorrow: '.$WeekDay->nextWeekDay().'<br>';
 
$WeekDay->build();
echo 'Hours today:<br>';
while ( $Hour = $WeekDay->fetch() ) {
echo $Hour->thisHour().'<br>';
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/7.phps
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/7.phps
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/9.phps
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/9.phps
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/1.php
New file
0,0 → 1,92
<?php
/**
* Description: Passes through all main calendar classes, beginning with year
* and down to seconds, skipping weeks. Useful to test Calendar is (basically)
* working correctly
*
*/
function getmicrotime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
 
if ( !@include 'Calendar/Calendar.php' ) {
define('CALENDAR_ROOT','../../');
}
 
if (!isset($_GET['y'])) $_GET['y'] = 2003;
if (!isset($_GET['m'])) $_GET['m'] = 8;
if (!isset($_GET['d'])) $_GET['d'] = 9;
if (!isset($_GET['h'])) $_GET['h'] = 12;
if (!isset($_GET['i'])) $_GET['i'] = 34;
if (!isset($_GET['s'])) $_GET['s'] = 46;
 
switch ( @$_GET['view'] ) {
default:
$_GET['view'] = 'calendar_year';
case 'calendar_year':
require_once CALENDAR_ROOT.'Year.php';
$c = new Calendar_Year($_GET['y']);
break;
case 'calendar_month':
require_once CALENDAR_ROOT.'Month.php';
$c = new Calendar_Month($_GET['y'],$_GET['m']);
break;
case 'calendar_day':
require_once CALENDAR_ROOT.'Day.php';
$c = new Calendar_Day($_GET['y'],$_GET['m'],$_GET['d']);
break;
case 'calendar_hour':
require_once CALENDAR_ROOT.'Hour.php';
$c = new Calendar_Hour($_GET['y'],$_GET['m'],$_GET['d'],$_GET['h']);
break;
case 'calendar_minute':
require_once CALENDAR_ROOT.'Minute.php';
$c = new Calendar_Minute($_GET['y'],$_GET['m'],$_GET['d'],$_GET['h'],$_GET['i']);
break;
case 'calendar_second':
require_once CALENDAR_ROOT.'Second.php';
$c = new Calendar_Second($_GET['y'],$_GET['m'],$_GET['d'],$_GET['h'],$_GET['i'],$_GET['s']);
break;
}
 
echo ( 'Viewing: '.@$_GET['view'].'<br />' );
echo ( 'The time is now: '.date('Y M d H:i:s',$c->getTimestamp()).'<br >' );
 
$i = 1;
echo ( '<h1>First Iteration</h1>' );
echo ( '<p>The first iteration is more "expensive", the calendar data
structures having to be built.</p>' );
$start = getmicrotime();
$c->build();
while ( $e = $c->fetch() ) {
$class = strtolower(get_class($e));
$link ="&y=".$e->thisYear()."&m=".$e->thisMonth()."&d=".$e->thisDay().
"&h=".$e->thisHour()."&i=".$e->thisMinute()."&s=".$e->thisSecond();
$method = 'this'.str_replace('calendar_','',$class);
echo ( "<a href=\"".$_SERVER['PHP_SELF']."?view=".$class.$link."\">".$e->{$method}()."</a> : " );
if ( ($i % 10) == 0 ) {
echo ( '<br>' );
}
$i++;
}
echo ( '<p><b>Took: '.(getmicrotime()-$start).' seconds</b></p>' );
 
$i = 1;
echo ( '<h1>Second Iteration</h1>' );
echo ( '<p>This second iteration is faster, the data structures
being re-used</p>' );
$start = getmicrotime();
while ( $e = $c->fetch() ) {
$class = strtolower(get_class($e));
$link ="&y=".$e->thisYear()."&m=".$e->thisMonth()."&d=".$e->thisDay().
"&h=".$e->thisHour()."&i=".$e->thisMinute()."&s=".$e->thisSecond();
$method = 'this'.str_replace('calendar_','',$class);
echo ( "<a href=\"".$_SERVER['PHP_SELF']."?view=".$class.$link."\">".$e->{$method}()."</a> : " );
if ( ($i % 10) == 0 ) {
echo ( '<br>' );
}
$i++;
}
echo ( '<p><b>Took: '.(getmicrotime()-$start).' seconds</b></p>' );
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/2.php
New file
0,0 → 1,142
<?php
/**
* Description: Demonstrates building a calendar for a month using the Week class
* Uses UnixTs engine
*/
function getmicrotime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
$start = getmicrotime();
 
// Force UnixTs engine (default setting)
define('CALENDAR_ENGINE','UnixTs');
 
if (!@include 'Calendar'.DIRECTORY_SEPARATOR.'Calendar.php') {
define('CALENDAR_ROOT', '../../');
}
require_once CALENDAR_ROOT.'Month/Weeks.php';
require_once CALENDAR_ROOT.'Day.php';
 
// Initialize GET variables if not set
if (!isset($_GET['y'])) $_GET['y'] = date('Y');
if (!isset($_GET['m'])) $_GET['m'] = date('m');
if (!isset($_GET['d'])) $_GET['d'] = date('d');
 
// Build a month object
$Month = new Calendar_Month_Weeks($_GET['y'], $_GET['m']);
 
// Create an array of days which are "selected"
// Used for Week::build() below
$selectedDays = array (
new Calendar_Day($_GET['y'],$_GET['m'], $_GET['d']),
new Calendar_Day($_GET['y'], 12, 25),
new Calendar_Day(date('Y'), date('m'), date('d')),
);
 
// Instruct month to build Week objects
$Month->build();
 
// Construct strings for next/previous links
$PMonth = $Month->prevMonth('object'); // Get previous month as object
$prev = $_SERVER['PHP_SELF'].'?y='.$PMonth->thisYear().'&m='.$PMonth->thisMonth().'&d='.$PMonth->thisDay();
$NMonth = $Month->nextMonth('object');
$next = $_SERVER['PHP_SELF'].'?y='.$NMonth->thisYear().'&m='.$NMonth->thisMonth().'&d='.$NMonth->thisDay();
?>
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> Calendar </title>
<style text="text/css">
table {
background-color: silver;
}
caption {
font-family: verdana;
font-size: 12px;
background-color: while;
}
.prevMonth {
font-size: 10px;
text-align: left;
}
.nextMonth {
font-size: 10px;
text-align: right;
}
th {
font-family: verdana;
font-size: 11px;
color: navy;
text-align: right;
}
td {
font-family: verdana;
font-size: 11px;
text-align: right;
}
.selected {
background-color: yellow;
}
.empty {
color: white;
}
</style>
</head>
 
<body>
<h2>Build with Calendar_Month_Weeks::build() then Calendar_Week::build()</h2>
<table class="calendar">
<caption>
<?php echo date('F Y', $Month->getTimeStamp()); ?>
</caption>
<tr>
<th>M</th>
<th>T</th>
<th>W</th>
<th>T</th>
<th>F</th>
<th>S</th>
<th>S</th>
</tr>
<?php
while ($Week = $Month->fetch()) {
echo "<tr>\n";
// Build the days in the week, passing the selected days
$Week->build($selectedDays);
while ($Day = $Week->fetch()) {
 
// Build a link string for each day
$link = $_SERVER['PHP_SELF'].
'?y='.$Day->thisYear().
'&m='.$Day->thisMonth().
'&d='.$Day->thisDay();
 
// Check to see if day is selected
if ($Day->isSelected()) {
echo '<td class="selected">'.$Day->thisDay().'</td>'."\n";
// Check to see if day is empty
} else if ($Day->isEmpty()) {
echo '<td class="empty">'.$Day->thisDay().'</td>'."\n";
} else {
echo '<td><a href="'.$link.'">'.$Day->thisDay().'</a></td>'."\n";
}
}
echo '</tr>'."\n";
}
?>
<tr>
<td>
<a href="<?php echo $prev; ?>" class="prevMonth"><< </a>
</td>
<td colspan="5">&nbsp;</td>
<td>
<a href="<?php echo $next; ?>" class="nextMonth"> >></a>
</td>
</tr>
</table>
<?php
echo '<p><b>Took: '.(getmicrotime()-$start).' seconds</b></p>';
?>
</body>
</html>
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/3.php
New file
0,0 → 1,134
<?php
/**
* Description: Performs same behaviour as 2.php but uses Month::buildWeekDays()
* and is faster
*/
function getmicrotime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
$start = getmicrotime();
 
if ( !@include 'Calendar/Calendar.php' ) {
define('CALENDAR_ROOT','../../');
}
require_once CALENDAR_ROOT.'Month/Weekdays.php';
require_once CALENDAR_ROOT.'Day.php';
 
if (!isset($_GET['y'])) $_GET['y'] = date('Y');
if (!isset($_GET['m'])) $_GET['m'] = date('m');
if (!isset($_GET['d'])) $_GET['d'] = date('d');
 
// Build the month
$Month = new Calendar_Month_Weekdays($_GET['y'],$_GET['m']);
 
// Construct strings for next/previous links
$PMonth = $Month->prevMonth('object'); // Get previous month as object
$prev = $_SERVER['PHP_SELF'].'?y='.$PMonth->thisYear().'&m='.$PMonth->thisMonth().'&d='.$PMonth->thisDay();
$NMonth = $Month->nextMonth('object');
$next = $_SERVER['PHP_SELF'].'?y='.$NMonth->thisYear().'&m='.$NMonth->thisMonth().'&d='.$NMonth->thisDay();
?>
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> Calendar </title>
<style text="text/css">
table {
background-color: silver;
}
caption {
font-family: verdana;
font-size: 12px;
background-color: while;
}
.prevMonth {
font-size: 10px;
text-align: left;
}
.nextMonth {
font-size: 10px;
text-align: right;
}
th {
font-family: verdana;
font-size: 11px;
color: navy;
text-align: right;
}
td {
font-family: verdana;
font-size: 11px;
text-align: right;
}
.selected {
background-color: yellow;
}
</style>
</head>
 
<body>
 
<?php
$selectedDays = array (
new Calendar_Day($_GET['y'],$_GET['m'],$_GET['d']),
new Calendar_Day($_GET['y'],12,25),
);
 
// Build the days in the month
$Month->build($selectedDays);
?>
<h2>Built with Calendar_Month_Weekday::build()</h2>
<table class="calendar">
<caption>
<?php echo ( date('F Y',$Month->getTimeStamp())); ?>
</caption>
<tr>
<th>M</th>
<th>T</th>
<th>W</th>
<th>T</th>
<th>F</th>
<th>S</th>
<th>S</th>
</tr>
<?php
while ( $Day = $Month->fetch() ) {
 
// Build a link string for each day
$link = $_SERVER['PHP_SELF'].
'?y='.$Day->thisYear().
'&m='.$Day->thisMonth().
'&d='.$Day->thisDay();
 
// isFirst() to find start of week
if ( $Day->isFirst() )
echo ( "<tr>\n" );
 
if ( $Day->isSelected() ) {
echo ( "<td class=\"selected\">".$Day->thisDay()."</td>\n" );
} else if ( $Day->isEmpty() ) {
echo ( "<td>&nbsp;</td>\n" );
} else {
echo ( "<td><a href=\"".$link."\">".$Day->thisDay()."</a></td>\n" );
}
 
// isLast() to find end of week
if ( $Day->isLast() )
echo ( "</tr>\n" );
}
?>
<tr>
<td>
<a href="<?php echo ($prev);?>" class="prevMonth"><< </a>
</td>
<td colspan="5">&nbsp;</td>
<td>
<a href="<?php echo ($next);?>" class="nextMonth"> >></a>
</td>
</tr>
</table>
<?php
echo ( '<p><b>Took: '.(getmicrotime()-$start).' seconds</b></p>' );
?>
</body>
</html>
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/4.php
New file
0,0 → 1,49
<?php
/**
* Description: shows how to perform validation with PEAR::Calendar
*/
function getmicrotime(){
list($usec, $sec) = explode(' ', microtime());
return ((float)$usec + (float)$sec);
}
$start = getmicrotime();
 
if ( !@include 'Calendar/Calendar.php' ) {
define('CALENDAR_ROOT', '../../');
}
require_once CALENDAR_ROOT.'Second.php';
 
if (!isset($_GET['y'])) $_GET['y'] = date('Y');
if (!isset($_GET['m'])) $_GET['m'] = date('n');
if (!isset($_GET['d'])) $_GET['d'] = date('j');
if (!isset($_GET['h'])) $_GET['h'] = date('H');
if (!isset($_GET['i'])) $_GET['i'] = date('i');
if (!isset($_GET['s'])) $_GET['s'] = date('s');
 
$Unit = & new Calendar_Second($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i'], $_GET['s']);
 
echo '<p><b>Result:</b> '.$Unit->thisYear().'-'.$Unit->thisMonth().'-'.$Unit->thisDay().
' '.$Unit->thisHour().':'.$Unit->thisMinute().':'.$Unit->thisSecond();
if ($Unit->isValid()) {
echo ' is valid!</p>';
} else {
$V= & $Unit->getValidator();
echo ' is invalid:</p>';
while ($error = $V->fetch()) {
echo $error->toString() .'<br />';
}
}
?>
<p>Enter a date / time to validate:</p>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get">
Year: <input type="text" name="y" value="2039"><br />
Month: <input type="text" name="m" value="13"><br />
Day: <input type="text" name="d" value="32"><br />
Hour: <input type="text" name="h" value="24"><br />
Minute: <input type="text" name="i" value="-1"><br />
Second: <input type="text" name="s" value="60"><br />
<input type="submit" value="Validate">
</form>
<p><b>Note:</b> Error messages can be controlled with the constants <code>CALENDAR_VALUE_TOOSMALL</code> and <code>CALENDAR_VALUE_TOOLARGE</code> - see <code>Calendar_Validator.php</code></p>
 
<?php echo '<p><b>Took: '.(getmicrotime()-$start).' seconds</b></p>'; ?>
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/11.phps
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/11.phps
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/5.php
New file
0,0 → 1,132
<?php
/**
* Description: generating elements of a form with PEAR::Calendar, using
* selections as well as validating the submission
*/
function getmicrotime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
$start = getmicrotime();
 
if ( !@include 'Calendar/Calendar.php' ) {
define('CALENDAR_ROOT','../../');
}
require_once CALENDAR_ROOT.'Year.php';
require_once CALENDAR_ROOT.'Month.php';
require_once CALENDAR_ROOT.'Day.php';
require_once CALENDAR_ROOT.'Hour.php';
require_once CALENDAR_ROOT.'Minute.php';
require_once CALENDAR_ROOT.'Second.php';
 
// Initialize if not set
if (!isset($_POST['y'])) $_POST['y'] = date('Y');
if (!isset($_POST['m'])) $_POST['m'] = date('n');
if (!isset($_POST['d'])) $_POST['d'] = date('j');
if (!isset($_POST['h'])) $_POST['h'] = date('H');
if (!isset($_POST['i'])) $_POST['i'] = date('i');
if (!isset($_POST['s'])) $_POST['s'] = date('s');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> Select and Update </title>
</head>
<body>
<h1>Select and Update</h1>
<?php
if ( isset($_POST['update']) ) {
$Second = & new Calendar_Second($_POST['y'],$_POST['m'],$_POST['d'],$_POST['h'],$_POST['i'],$_POST['s']);
if ( !$Second->isValid() ) {
$V= & $Second->getValidator();
echo ('<p>Validation failed:</p>' );
while ( $error = $V->fetch() ) {
echo ( $error->toString() .'<br>' );
}
} else {
echo ('<p>Validation success.</p>' );
echo ( '<p>New timestamp is: '.$Second->getTimeStamp().' which could be used to update a database, for example');
}
} else {
$Year = new Calendar_Year($_POST['y']);
$Month = new Calendar_Month($_POST['y'],$_POST['m']);
$Day = new Calendar_Day($_POST['y'],$_POST['m'],$_POST['d']);
$Hour = new Calendar_Hour($_POST['y'],$_POST['m'],$_POST['d'],$_POST['h']);
$Minute = new Calendar_Minute($_POST['y'],$_POST['m'],$_POST['d'],$_POST['h'],$_POST['i']);
$Second = new Calendar_Second($_POST['y'],$_POST['m'],$_POST['d'],$_POST['h'],$_POST['i'],$_POST['s']);
?>
<p><b>Set the alarm clock</p></p>
<form action="<?php echo ( $_SERVER['PHP_SELF'] ); ?>" method="post">
Year: <input type="text" name="y" value="<?php echo ( $_POST['y'] ); ?>" size="4">&nbsp;
Month:<select name="m">
<?php
$selection = array($Month);
$Year->build($selection);
while ( $Child = & $Year->fetch() ) {
if ( $Child->isSelected() ) {
echo ( "<option value=\"".$Child->thisMonth()."\" selected>".$Child->thisMonth()."\n" );
} else {
echo ( "<option value=\"".$Child->thisMonth()."\">".$Child->thisMonth()."\n" );
}
}
?>
</select>&nbsp;
Day:<select name="d">
<?php
$selection = array($Day);
$Month->build($selection);
while ( $Child = & $Month->fetch() ) {
if ( $Child->isSelected() ) {
echo ( "<option value=\"".$Child->thisDay()."\" selected>".$Child->thisDay()."\n" );
} else {
echo ( "<option value=\"".$Child->thisDay()."\">".$Child->thisDay()."\n" );
}
}
?>
</select>&nbsp;
Hour:<select name="h">
<?php
$selection = array($Hour);
$Day->build($selection);
while ( $Child = & $Day->fetch() ) {
if ( $Child->isSelected() ) {
echo ( "<option value=\"".$Child->thisHour()."\" selected>".$Child->thisHour()."\n" );
} else {
echo ( "<option value=\"".$Child->thisHour()."\">".$Child->thisHour()."\n" );
}
}
?>
</select>&nbsp;
Minute:<select name="i">
<?php
$selection = array($Minute);
$Hour->build($selection);
while ( $Child = & $Hour->fetch() ) {
if ( $Child->isSelected() ) {
echo ( "<option value=\"".$Child->thisMinute()."\" selected>".$Child->thisMinute()."\n" );
} else {
echo ( "<option value=\"".$Child->thisMinute()."\">".$Child->thisMinute()."\n" );
}
}
?>
</select>&nbsp;
Second:<select name="s">
<?php
$selection = array($Second);
$Minute->build($selection);
while ( $Child = & $Minute->fetch() ) {
if ( $Child->isSelected() ) {
echo ( "<option value=\"".$Child->thisSecond()."\" selected>".$Child->thisSecond()."\n" );
} else {
echo ( "<option value=\"".$Child->thisSecond()."\">".$Child->thisSecond()."\n" );
}
}
?>
</select>&nbsp;
<input type="submit" name="update" value="Set Alarm"><br>
<?php
}
?>
<?php echo ( '<p><b>Took: '.(getmicrotime()-$start).' seconds</b></p>' ); ?>
</body>
</html>
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/21.phps
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/21.phps
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/6.php
New file
0,0 → 1,210
<?php
/**
* Description: A "personal planner" with some WML for fun
* Note this is done the stupid way - a giant if/else for WML or HTML
* could be greatly simplified with some HTML/WML rendering classes...
*/
function getmicrotime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
$start = getmicrotime();
 
if ( !@include 'Calendar/Calendar.php' ) {
define('CALENDAR_ROOT','../../');
}
require_once CALENDAR_ROOT.'Month/Weekdays.php';
require_once CALENDAR_ROOT.'Day.php';
 
if (!isset($_GET['y'])) $_GET['y'] = date('Y');
if (!isset($_GET['m'])) $_GET['m'] = date('n');
if (!isset($_GET['d'])) $_GET['d'] = date('j');
 
$Month = & new Calendar_Month_Weekdays($_GET['y'],$_GET['m']);
$Day = & new Calendar_Day($_GET['y'],$_GET['m'],$_GET['d']);
$selection = array($Day);
 
#-----------------------------------------------------------------------------#
if ( isset($_GET['mime']) && $_GET['mime']=='wml' ) {
header ('Content-Type: text/vnd.wap.wml');
echo ( '<?xml version="1.0"?>' );
?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<big><strong>Personal Planner Rendered with WML</strong></big>
<?php
if ( isset($_GET['viewday']) ) {
?>
<p><strong>Viewing <?php echo ( date('l, jS of F, Y',$Day->getTimeStamp()) ); ?></strong></p>
<p>
<anchor>
Back to Month View
<go href="<?php
echo ( "?y=".$Day->thisYear()."&amp;m=".
$Day->thisMonth()."&amp;d=".$Day->thisDay()."&amp;mime=wml" );
?>"/>
</anchor>
</p>
<table>
<?php
$Day->build();
while ( $Hour = & $Day->fetch() ) {
echo ( "<tr>\n" );
echo ( "<td>".date('g a',$Hour->getTimeStamp())."</td><td>Free time!</td>\n" );
echo ( "</tr>\n" );
}
?>
</table>
<?php
} else {
?>
<p><strong><?php echo ( date('F Y',$Month->getTimeStamp()) ); ?></strong></p>
<table>
<tr>
<td>M</td><td>T</td><td>W</td><td>T</td><td>F</td><td>S</td><td>S</td>
</tr>
<?php
$Month->build($selection);
while ( $Day = $Month->fetch() ) {
if ( $Day->isFirst() ) {
echo ( "<tr>\n" );
}
if ( $Day->isEmpty() ) {
echo ( "<td></td>\n" );
} else if ( $Day->isSelected() ) {
echo ( "<td><anchor><strong><u>".$Day->thisDay()."</u></strong>\n<go href=\"".$_SERVER['PHP_SELF']."?viewday=true&amp;y=".
$Day->thisYear()."&amp;m=".$Day->thisMonth()."&amp;d=".$Day->thisDay().
"&amp;mime=wml\" />\n</anchor></td>\n" );
} else {
echo ( "<td><anchor>".$Day->thisDay()."\n<go href=\"?viewday=true&amp;y=".
$Day->thisYear()."&amp;m=".$Day->thisMonth()."&amp;d=".$Day->thisDay().
"&amp;mime=wml\" /></anchor></td>\n" );
}
if ( $Day->isLast() ) {
echo ( "</tr>\n" );
}
}
?>
<tr>
<td>
<anchor>
&lt;&lt;
<go href="<?php
echo ( "?y=".$Month->thisYear()."&amp;m=".
$Month->prevMonth()."&amp;d=".$Month->thisDay()."&amp;mime=wml" );
?>"/>
</anchor>
</td>
<td></td><td></td><td></td><td></td><td></td>
<td>
<anchor>
&gt;&gt;
<go href="<?php
echo ( "?y=".$Month->thisYear()."&amp;m=".
$Month->nextMonth()."&amp;d=".$Month->thisDay()."&amp;mime=wml" );
?>"/>
</anchor>
</td>
</tr>
</table>
 
<?php
}
?>
<p><a href="<?php echo ( $_SERVER['PHP_SELF'] ); ?>">Back to HTML</a></p>
<?php echo ( '<p>Took: '.(getmicrotime()-$start).' seconds</p>' ); ?>
</wml>
<?php
#-----------------------------------------------------------------------------#
} else {
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> HTML (+WML) Personal Planner </title>
</head>
<body>
<h1>Personal Planner Rendered with HTML</h1>
<p>To view in WML, click <a href="<?php echo ( $_SERVER['PHP_SELF'] ); ?>?mime=wml">here</a> or place a ?mime=wml at the end of any URL.
Note that <a href="http://www.opera.com/download">Opera</a> supports WML natively and Mozilla / Firefox has the WMLBrowser
plugin: <a href="http://wmlbrowser.mozdev.org">wmlbrowser.mozdev.org</a></p>
<?php
if ( isset($_GET['viewday']) ) {
?>
<p><strong>Viewing <?php echo ( date('l, jS of F, Y',$Day->getTimeStamp()) ); ?></strong></p>
<p>
<anchor>
<a href="<?php
echo ( "?y=".$Day->thisYear()."&amp;m=".
$Day->thisMonth()."&amp;d=".$Day->thisDay());
?>">Back to Month View</a>
</p>
<table>
<?php
$Day->build();
while ( $Hour = & $Day->fetch() ) {
echo ( "<tr>\n" );
echo ( "<td>".date('g a',$Hour->getTimeStamp())."</td><td>Free time!</td>\n" );
echo ( "</tr>\n" );
}
?>
</table>
<?php
} else {
?>
<p><strong><?php echo ( date('F Y',$Month->getTimeStamp()) ); ?></strong></p>
<table>
<tr>
<td>M</td><td>T</td><td>W</td><td>T</td><td>F</td><td>S</td><td>S</td>
</tr>
<?php
$Month->build($selection);
while ( $Day = $Month->fetch() ) {
if ( $Day->isFirst() ) {
echo ( "<tr>\n" );
}
if ( $Day->isEmpty() ) {
echo ( "<td></td>\n" );
} else if ( $Day->isSelected() ) {
echo ( "<td><a href=\"".$_SERVER['PHP_SELF']."?viewday=true&amp;y=".
$Day->thisYear()."&amp;m=".$Day->thisMonth()."&amp;d=".$Day->thisDay().
"&amp;wml\"><strong><u>".$Day->thisDay()."</u></strong></a></td>\n" );
} else {
echo ( "<td><a href=\"".$_SERVER['PHP_SELF']."?viewday=true&amp;y=".
$Day->thisYear()."&amp;m=".$Day->thisMonth()."&amp;d=".$Day->thisDay().
"\">".$Day->thisDay()."</a></td>\n" );
}
if ( $Day->isLast() ) {
echo ( "</tr>\n" );
}
}
?>
<tr>
<td>
<a href="<?php
echo ( "?y=".$Month->thisYear()."&amp;m=".
$Month->prevMonth()."&amp;d=".$Month->thisDay() );
?>">
&lt;&lt;</a>
</td>
<td></td><td></td><td></td><td></td><td></td>
<td>
<a href="<?php
echo ( "?y=".$Month->thisYear()."&amp;m=".
$Month->nextMonth()."&amp;d=".$Month->thisDay() );
?>">&gt;&gt;</a>
</td>
</tr>
</table>
 
<?php
}
?>
 
 
<?php echo ( '<p><b>Took: '.(getmicrotime()-$start).' seconds</b></p>' ); ?>
</body>
</html>
<?php
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/13.phps
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/13.phps
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/7.php
New file
0,0 → 1,92
<?php
/**
* Description: a SOAP Calendar Server
*/
if (!@include('SOAP'.DIRECTORY_SEPARATOR.'Server.php')) {
die('You must have PEAR::SOAP installed');
}
 
if (!@include 'Calendar'.DIRECTORY_SEPARATOR.'Calendar.php') {
define('CALENDAR_ROOT', '../../');
}
 
class Calendar_Server
{
var $__dispatch_map = array();
var $__typedef = array();
 
function Calendar_Server()
{
$this->__dispatch_map['getMonth'] =
array('in' => array('year' => 'int', 'month'=>'int'),
'out' => array('month' => '{urn:PEAR_SOAP_Calendar}Month'),
);
$this->__typedef['Month'] = array (
'monthname' => 'string',
'days' => '{urn:PEAR_SOAP_Calendar}MonthDays'
);
$this->__typedef['MonthDays'] = array (array ('{urn:PEAR_SOAP_Calendar}Day'));
$this->__typedef['Day'] = array (
'isFirst' => 'int',
'isLast' => 'int',
'isEmpty' => 'int',
'day' => 'int' );
}
 
function __dispatch($methodname)
{
if (isset($this->__dispatch_map[$methodname]))
return $this->__dispatch_map[$methodname];
return NULL;
}
 
function getMonth($year, $month)
{
require_once(CALENDAR_ROOT.'Month'.DIRECTORY_SEPARATOR.'Weekdays.php');
$Month = & new Calendar_Month_Weekdays($year,$month);
if (!$Month->isValid()) {
$V = & $Month->getValidator();
$errorMsg = '';
while ($error = $V->fetch()) {
$errorMsg .= $error->toString()."\n";
}
return new SOAP_Fault($errorMsg, 'Client');
} else {
$monthname = date('F Y', $Month->getTimeStamp());
$days = array();
$Month->build();
while ($Day = & $Month->fetch()) {
$day = array(
'isFirst' => (int)$Day->isFirst(),
'isLast' => (int)$Day->isLast(),
'isEmpty' => (int)$Day->isEmpty(),
'day' => (int)$Day->thisDay(),
);
$days[] = $day;
}
return array('monthname' => $monthname, 'days' => $days);
}
}
}
 
$server = new SOAP_Server();
$server->_auto_translation = true;
$calendar = new Calendar_Server();
$server->addObjectMap($calendar, 'urn:PEAR_SOAP_Calendar');
 
if (strtoupper($_SERVER['REQUEST_METHOD'])=='POST') {
$server->service($GLOBALS['HTTP_RAW_POST_DATA']);
} else {
require_once 'SOAP'.DIRECTORY_SEPARATOR.'Disco.php';
$disco = new SOAP_DISCO_Server($server, "PEAR_SOAP_Calendar");
if (isset($_SERVER['QUERY_STRING']) &&
strcasecmp($_SERVER['QUERY_STRING'], 'wsdl')==0) {
header("Content-type: text/xml");
echo $disco->getWSDL();
} else {
echo 'This is a PEAR::SOAP Calendar Server. For client try <a href="8.php">here</a><br />';
echo 'For WSDL try <a href="?wsdl">here</a>';
}
exit;
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/8.php
New file
0,0 → 1,70
<?php
/**
* Description: client for the SOAP Calendar Server
*/
if ( version_compare(phpversion(), "5.0.0", ">") ) {
die('PHP 5 has problems with PEAR::SOAP Client (8.0RC3)
- remove @ before include below to see why');
}
 
if (!@include('SOAP'.DIRECTORY_SEPARATOR.'Client.php')) {
die('You must have PEAR::SOAP installed');
}
 
// Just to save manaul modification...
$basePath = explode('/', $_SERVER['SCRIPT_NAME']);
array_pop($basePath);
$basePath = implode('/', $basePath);
$url = 'http://'.$_SERVER['SERVER_NAME'].$basePath.'/7.php?wsdl';
 
if (!isset($_GET['y'])) $_GET['y'] = date('Y');
if (!isset($_GET['m'])) $_GET['m'] = date('n');
 
$wsdl = new SOAP_WSDL ($url);
 
echo ( '<pre>'.$wsdl->generateProxyCode().'</pre>' );
 
$calendarClient = $wsdl->getProxy();
 
$month = $calendarClient->getMonth((int)$_GET['y'],(int)$_GET['m']);
 
if ( PEAR::isError($month) ) {
die ( $month->toString() );
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> Calendar over the Wire </title>
</head>
<body>
<h1>Calendar Over the Wire (featuring PEAR::SOAP)</h1>
<table>
<caption><b><?php echo ( $month->monthname );?></b></caption>
<tr>
<th>M</th><th>T</th><th>W</th><th>T</th><th>F</th><th>S</th><th>S</th>
</tr>
<?php
foreach ( $month->days as $day ) {
 
if ( $day->isFirst === 1 )
echo ( "<tr>\n" );
if ( $day->isEmpty === 1 ) {
echo ( "<td></td>" );
} else {
echo ( "<td>".$day->day."</td>" );
}
if ( $day->isLast === 1 )
echo ( "</tr>\n" );
}
?>
<tr>
</table>
<p>Enter Year and Month to View:</p>
<form action="<?php echo ( $_SERVER['PHP_SELF'] ); ?>" method="get">
Year: <input type="text" size="4" name="y" value="<?php echo ( $_GET['y'] ); ?>">&nbsp;
Month: <input type="text" size="2" name="m" value="<?php echo ( $_GET['m'] ); ?>">&nbsp;
<input type="submit" value="Fetch Calendar">
</form>
</body>
</html>
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/23.phps
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/23.phps
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/9.php
New file
0,0 → 1,16
<?php
/**
* Description: simple example on i18N
*/
if ( !@include 'Calendar/Calendar.php' ) {
define('CALENDAR_ROOT','../../');
}
require_once CALENDAR_ROOT.'Day.php';
 
$Day = & new Calendar_Day(2003,10,23);
 
setlocale (LC_TIME, "de_DE"); // Unix based (probably)
// setlocale (LC_TIME, "ge"); // Windows
 
echo ( strftime('%A %d %B %Y',$Day->getTimeStamp()));
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/15.phps
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/15.phps
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/17.phps
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/17.phps
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/19.phps
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/19.phps
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/20.php
New file
0,0 → 1,314
<?php
/**
* Description: demonstrates a decorator used to "attach a payload" to a selection
* to make it available when iterating over calendar children
*/
 
//if you use ISO-8601 dates, switch to PearDate engine
define('CALENDAR_ENGINE', 'PearDate');
 
if ( !@include 'Calendar/Calendar.php' ) {
define('CALENDAR_ROOT','../../');
}
 
require_once CALENDAR_ROOT . 'Month/Weekdays.php';
require_once CALENDAR_ROOT . 'Day.php';
require_once CALENDAR_ROOT . 'Decorator.php';
 
// accepts multiple entries
class DiaryEvent extends Calendar_Decorator
{
var $entries = array();
 
function DiaryEvent($calendar) {
Calendar_Decorator::Calendar_Decorator($calendar);
}
 
function addEntry($entry) {
$this->entries[] = $entry;
}
 
function getEntry() {
$entry = each($this->entries);
if ($entry) {
return $entry['value'];
} else {
reset($this->entries);
return false;
}
}
}
 
class MonthPayload_Decorator extends Calendar_Decorator
{
//Calendar engine
var $cE;
var $tableHelper;
 
var $year;
var $month;
var $firstDay = false;
 
function build($events=array())
{
require_once CALENDAR_ROOT . 'Day.php';
require_once CALENDAR_ROOT . 'Table/Helper.php';
 
$this->tableHelper = & new Calendar_Table_Helper($this, $this->firstDay);
$this->cE = & $this->getEngine();
$this->year = $this->thisYear();
$this->month = $this->thisMonth();
 
$daysInMonth = $this->cE->getDaysInMonth($this->year, $this->month);
for ($i=1; $i<=$daysInMonth; $i++) {
$Day = new Calendar_Day(2000,1,1); // Create Day with dummy values
$Day->setTimeStamp($this->cE->dateToStamp($this->year, $this->month, $i));
$this->children[$i] = new DiaryEvent($Day);
}
if (count($events) > 0) {
$this->setSelection($events);
}
Calendar_Month_Weekdays::buildEmptyDaysBefore();
Calendar_Month_Weekdays::shiftDays();
Calendar_Month_Weekdays::buildEmptyDaysAfter();
Calendar_Month_Weekdays::setWeekMarkers();
return true;
}
 
function setSelection($events)
{
$daysInMonth = $this->cE->getDaysInMonth($this->year, $this->month);
for ($i=1; $i<=$daysInMonth; $i++) {
$stamp1 = $this->cE->dateToStamp($this->year, $this->month, $i);
$stamp2 = $this->cE->dateToStamp($this->year, $this->month, $i+1);
foreach ($events as $event) {
if (($stamp1 >= $event['start'] && $stamp1 < $event['end']) ||
($stamp2 >= $event['start'] && $stamp2 < $event['end']) ||
($stamp1 <= $event['start'] && $stamp2 > $event['end'])
) {
$this->children[$i]->addEntry($event);
$this->children[$i]->setSelected();
}
}
}
}
 
function fetch()
{
$child = each($this->children);
if ($child) {
return $child['value'];
} else {
reset($this->children);
return false;
}
}
}
 
// Calendar instance used to get the dates in the preferred format:
// you can switch Calendar Engine and the example still works
$cal = new Calendar;
 
$events = array();
//add some events
$events[] = array(
'start' => $cal->cE->dateToStamp(2004, 6, 1, 10),
'end' => $cal->cE->dateToStamp(2004, 6, 1, 12),
'desc' => 'Important meeting'
);
$events[] = array(
'start' => $cal->cE->dateToStamp(2004, 6, 1, 21),
'end' => $cal->cE->dateToStamp(2004, 6, 1, 23, 59),
'desc' => 'Dinner with the boss'
);
$events[] = array(
'start' => $cal->cE->dateToStamp(2004, 6, 5),
'end' => $cal->cE->dateToStamp(2004, 6, 10, 23, 59),
'desc' => 'Holidays!'
);
 
 
 
$Month = & new Calendar_Month_Weekdays(2004, 6);
$MonthDecorator = new MonthPayload_Decorator($Month);
$MonthDecorator->build($events);
 
?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text-align: center;
+ background-color: #e7e3e7;
+ padding: 5pt;
+
+
+
+
+
+
+ text-align: left;
+
+
+
+
+
+
+
+
+
+
+
+
+div.dayNumber {
+ text-align: right;
+ background-color: #f8f8f8;
+ border-bottom: 1px solid #ccc;
+}
+ul {
+ margin-left: 0;
+
+
+
+
+
+
+
+<body>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ echo '<td class="calCell';
+ if ($Day->isSelected()) {
+ echo ' calCellBusy';
+ } elseif ($Day->isEmpty()) {
+ echo ' calCellEmpty';
+ }
+ echo '">';
+ echo '<div class="dayNumber">'.$Day->thisDay().'</div>';
+
+
+
+
+ echo '<div class="dayContents"><ul>';
+ while ($entry = $Day->getEntry()) {
+ echo '<li>'.$entry['desc'].'</li>';
+ //you can print the time range as well
+ }
+ echo '</ul></div>';
+ }
+
+
+
+ echo "</tr>\n";
+
+
+
+
+
+</html>
\ No newline at end of file
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/21.php
New file
0,0 → 1,139
<?php
/**
* Description: a complete year with numeric week numbers
*/
function getmicrotime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
$start = getmicrotime();
 
if (!@include 'Calendar/Calendar.php') {
define('CALENDAR_ROOT', '../../');
}
 
require_once CALENDAR_ROOT.'Year.php';
require_once CALENDAR_ROOT.'Month/Weeks.php';
 
define ('CALENDAR_MONTH_STATE',CALENDAR_USE_MONTH_WEEKS);
 
if (!isset($_GET['year'])) $_GET['year'] = date('Y');
 
$week_types = array(
'n_in_year',
'n_in_month',
);
 
if (!isset($_GET['week_type']) || !in_array($_GET['week_type'],$week_types) ) {
$_GET['week_type'] = 'n_in_year';
}
 
$Year = new Calendar_Year($_GET['year']);
 
$Year->build();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> <?php echo $Year->thisYear(); ?> </title>
<style type="text/css">
body {
font-family: Georgia, serif;
}
caption.year {
font-weight: bold;
font-size: 120%;
font-color: navy;
}
caption.month {
font-size: 110%;
font-color: navy;
}
table.month {
border: thin groove #800080
}
tr {
vertical-align: top;
}
th, td {
text-align: right;
font-size: 70%;
}
#prev {
float: left;
font-size: 70%;
}
#next {
float: right;
font-size: 70%;
}
#week_type {
float: none;
font-size: 70%;
}
.weekNumbers {
background-color: #e5e5f5;
padding-right: 3pt;
}
</style>
</head>
<body>
<table>
<caption class="year">
<?php echo $Year->thisYear(); ?>
<div id="next">
<a href="?year=<?php echo $Year->nextYear(); ?>&week_type=<?php echo $_GET['week_type']; ?>">>></a>
</div>
<div id="prev">
<a href="?year=<?php echo $Year->prevYear(); ?>&week_type=<?php echo $_GET['week_type']; ?>"><<</a>
</div>
<div id="week_type">
<a href="?year=<?php echo $Year->thisYear(); ?>&week_type=n_in_year">Weeks by Year</a> :
<a href="?year=<?php echo $Year->thisYear(); ?>&week_type=n_in_month">Weeks by Month</a>
</div>
</caption>
<?php
$i = 0;
while ($Month = $Year->fetch()) {
 
switch ($i) {
case 0:
echo "<tr>\n";
break;
case 3:
case 6:
case 9:
echo "</tr>\n<tr>\n";
break;
case 12:
echo "</tr>\n";
break;
}
 
echo "<td>\n<table class=\"month\">\n";
echo '<caption class="month">'.date('F', $Month->thisMonth(TRUE)).'</caption>';
echo '<colgroup><col class="weekNumbers"><col span="7"></colgroup>'."\n";
echo "<tr>\n<th>Week</th><th>M</th><th>T</th><th>W</th><th>T</th><th>F</th><th>S</th><th>S</th>\n</tr>";
$Month->build();
while ($Week = $Month->fetch()) {
echo "<tr>\n";
echo '<td>'.$Week->thisWeek($_GET['week_type'])."</td>\n";
$Week->build();
 
while ($Day = $Week->fetch()) {
if ($Day->isEmpty()) {
echo "<td>&nbsp;</td>\n";
} else {
echo "<td>".$Day->thisDay()."</td>\n";
}
}
}
echo "</table>\n</td>\n";
 
$i++;
}
?>
</table>
<p>Took: <?php echo ((getmicrotime()-$start)); ?></p>
</body>
</html>
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/22.php
New file
0,0 → 1,46
<?php
/**
* Description: demonstrates using the Uri util
*/
if (!@include 'Calendar/Calendar.php') {
define('CALENDAR_ROOT', '../../');
}
require_once CALENDAR_ROOT.'Month/Weekdays.php';
require_once CALENDAR_ROOT.'Util/Uri.php';
 
if (!isset($_GET['jahr'])) $_GET['jahr'] = date('Y');
if (!isset($_GET['monat'])) $_GET['monat'] = date('m');
 
// Build the month
$Calendar = new Calendar_Month_Weekdays($_GET['jahr'], $_GET['monat']);
 
echo ( '<p>The current month is '
.$Calendar->thisMonth().' of year '.$Calendar->thisYear().'</p>');
 
$Uri = & new Calendar_Util_Uri('jahr','monat');
$Uri->setFragments('jahr','monat');
 
echo "\"Vector\" URIs<pre>";
echo ( "Previous Uri:\t".htmlentities($Uri->prev($Calendar, 'month'))."\n" );
echo ( "This Uri:\t".htmlentities($Uri->this($Calendar, 'month'))."\n" );
echo ( "Next Uri:\t".htmlentities($Uri->next($Calendar, 'month'))."\n" );
echo "</pre>";
 
// Switch to scalar URIs
$Uri->separator = '/'; // Default is &amp;
$Uri->scalar = true; // Omit variable names
 
echo "\"Scalar\" URIs<pre>";
echo ( "Previous Uri:\t".$Uri->prev($Calendar, 'month')."\n" );
echo ( "This Uri:\t".$Uri->this($Calendar, 'month')."\n" );
echo ( "Next Uri:\t".$Uri->next($Calendar, 'month')."\n" );
echo "</pre>";
 
// Restore the vector URIs
$Uri->separator = '&amp;';
$Uri->scalar = false;
?>
<p>
<a href="<?php echo($_SERVER['PHP_SELF'].'?'.$Uri->prev($Calendar, 'month'));?>">Prev</a> :
<a href="<?php echo($_SERVER['PHP_SELF'].'?'.$Uri->next($Calendar, 'month'));?>">Next</a>
</p>
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/23.php
New file
0,0 → 1,66
<?php
/**
* Description: demonstrates using the Textual util
*/
 
if (!@include 'Calendar'.DIRECTORY_SEPARATOR.'Calendar.php') {
define('CALENDAR_ROOT', '../../');
}
require_once CALENDAR_ROOT.'Day.php';
require_once CALENDAR_ROOT.'Month'.DIRECTORY_SEPARATOR.'Weekdays.php';
require_once CALENDAR_ROOT.'Util'.DIRECTORY_SEPARATOR.'Textual.php';
 
// Could change language like this
// setlocale (LC_TIME, "de_DE"); // Unix based (probably)
// setlocale (LC_TIME, "ge"); // Windows
 
echo "<hr>Calling: Calendar_Util_Textual::monthNames('long');<pre>";
print_r(Calendar_Util_Textual::monthNames('long'));
echo '</pre>';
 
echo "<hr>Calling: Calendar_Util_Textual::weekdayNames('two');<pre>";
print_r(Calendar_Util_Textual::weekdayNames('two'));
echo '</pre>';
 
echo "<hr>Creating: new Calendar_Day(date('Y'), date('n'), date('d'));<br />";
$Calendar = new Calendar_Day(date('Y'), date('n'), date('d'));
 
echo '<hr>Previous month is: '.Calendar_Util_Textual::prevMonthName($Calendar,'two').'<br />';
echo 'This month is: '.Calendar_Util_Textual::thisMonthName($Calendar,'short').'<br />';
echo 'Next month is: '.Calendar_Util_Textual::nextMonthName($Calendar).'<br /><hr />';
echo 'Previous day is: '.Calendar_Util_Textual::prevDayName($Calendar).'<br />';
echo 'This day is: '.Calendar_Util_Textual::thisDayName($Calendar,'short').'<br />';
echo 'Next day is: '.Calendar_Util_Textual::nextDayName($Calendar,'one').'<br /><hr />';
 
echo "Creating: new Calendar_Month_Weekdays(date('Y'), date('n'), 6); - Saturday is first day of week<br />";
$Calendar = new Calendar_Month_Weekdays(date('Y'), date('n'), 6);
 
?>
<p>Rendering calendar....</p>
<table>
<caption><?php echo Calendar_Util_Textual::thisMonthName($Calendar).' '.$Calendar->thisYear(); ?></caption>
<tr>
<?php
$dayheaders = Calendar_Util_Textual::orderedWeekdays($Calendar,'short');
foreach ($dayheaders as $dayheader) {
echo '<th>'.$dayheader.'</th>';
}
?>
</tr>
<?php
$Calendar->build();
while ($Day = $Calendar->fetch()) {
if ($Day->isFirst()) {
echo "<tr>\n";
}
if ($Day->isEmpty()) {
echo '<td>&nbsp;</td>';
} else {
echo '<td>'.$Day->thisDay().'</td>';
}
if ($Day->isLast()) {
echo "</tr>\n";
}
}
?>
</table>
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/2.phps
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/2.phps
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/4.phps
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/4.phps
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/6.phps
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/6.phps
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/8.phps
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/8.phps
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/10.phps
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/10.phps
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/20.phps
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/20.phps
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/12.phps
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/12.phps
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/22.phps
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/22.phps
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/14.phps
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/14.phps
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/16.phps
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/16.phps
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/18.phps
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/pear/Calendar/docs/examples/18.phps
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/pear/Calendar/Factory.php
New file
0,0 → 1,158
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Harry Fuecks <hfuecks@phppatterns.com> |
// | Lorenzo Alberton <l dot alberton at quipo dot it> |
// +----------------------------------------------------------------------+
//
// $Id: Factory.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
//
/**
* @package Calendar
* @version $Id: Factory.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
*/
 
/**
* Allows Calendar include path to be redefined
* @ignore
*/
if (!defined('CALENDAR_ROOT')) {
define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR);
}
 
/**
* Load Calendar base class
*/
require_once CALENDAR_ROOT.'Calendar.php';
 
/**
* Constant for the first day of the week (integer e.g. 0-6)
*/
if ( !defined ('CALENDAR_FIRST_DAY_OF_WEEK') ) {
define ('CALENDAR_FIRST_DAY_OF_WEEK',1);
}
 
/**
* Contains a factory method to return a Singleton instance of a class
* implementing the Calendar_Engine_Interface.<br>
* For Month objects, to control type of month returned, use CALENDAR_MONTH_STATE
* constact e.g.;
* <code>
* require_once 'Calendar/Factory.php';
* define ('CALENDAR_MONTH_STATE',CALENDAR_USE_MONTH_WEEKDAYS); // Use Calendar_Month_Weekdays
* // define ('CALENDAR_MONTH_STATE',CALENDAR_USE_MONTH_WEEKS); // Use Calendar_Month_Weeks
* // define ('CALENDAR_MONTH_STATE',CALENDAR_USE_MONTH); // Use Calendar_Month
* </code>
* It defaults to building Calendar_Month objects.<br>
* Use the constract CALENDAR_FIRST_DAY_OF_WEEK to control the first day of the week
* for Month or Week objects (e.g. 0 = Sunday, 6 = Saturday)
* @package Calendar
* @access protected
*/
class Calendar_Factory
{
/**
* Creates a calendar object given the type and units
* @param string class of calendar object to create
* @param int year
* @param int month
* @param int day
* @param int hour
* @param int minute
* @param int second
* @return object subclass of Calendar
* @access public
* @static
*/
function create($type, $y = 2000, $m = 1, $d = 1, $h = 0, $i = 0, $s = 0)
{
switch ( $type ) {
case 'Day':
require_once CALENDAR_ROOT.'Day.php';
return new Calendar_Day($y,$m,$d);
break;
case 'Month':
// Set default state for which month type to build
if (!defined('CALENDAR_MONTH_STATE')) {
define('CALENDAR_MONTH_STATE', CALENDAR_USE_MONTH);
}
switch (CALENDAR_MONTH_STATE) {
case CALENDAR_USE_MONTH_WEEKDAYS:
require_once CALENDAR_ROOT.'Month'.DIRECTORY_SEPARATOR.'Weekdays.php';
$class = 'Calendar_Month_Weekdays';
break;
case CALENDAR_USE_MONTH_WEEKS:
require_once CALENDAR_ROOT.'Month'.DIRECTORY_SEPARATOR.'Weeks.php';
$class = 'Calendar_Month_Weeks';
break;
case CALENDAR_USE_MONTH:
default:
require_once CALENDAR_ROOT.'Month.php';
$class = 'Calendar_Month';
break;
}
return new $class($y,$m,CALENDAR_FIRST_DAY_OF_WEEK);
break;
case 'Week':
require_once CALENDAR_ROOT.'Week.php';
return new Calendar_Week($y,$m,$d,CALENDAR_FIRST_DAY_OF_WEEK);
break;
case 'Hour':
require_once CALENDAR_ROOT.'Hour.php';
return new Calendar_Hour($y,$m,$d,$h);
break;
case 'Minute':
require_once CALENDAR_ROOT.'Minute.php';
return new Calendar_Minute($y,$m,$d,$h,$i);
break;
case 'Second':
require_once CALENDAR_ROOT.'Second.php';
return new Calendar_Second($y,$m,$d,$h,$i,$s);
break;
case 'Year':
require_once CALENDAR_ROOT.'Year.php';
return new Calendar_Year($y);
break;
default:
require_once 'PEAR.php';
PEAR::raiseError(
'Calendar_Factory::create() unrecognised type: '.$type, null, PEAR_ERROR_TRIGGER,
E_USER_NOTICE, 'Calendar_Factory::create()');
return false;
break;
}
}
/**
* Creates an instance of a calendar object, given a type and timestamp
* @param string type of object to create
* @param mixed timestamp (depending on Calendar engine being used)
* @return object subclass of Calendar
* @access public
* @static
*/
function & createByTimestamp($type, $stamp)
{
$cE = & Calendar_Engine_Factory::getEngine();
$y = $cE->stampToYear($stamp);
$m = $cE->stampToMonth($stamp);
$d = $cE->stampToDay($stamp);
$h = $cE->stampToHour($stamp);
$i = $cE->stampToMinute($stamp);
$s = $cE->stampToSecond($stamp);
return Calendar_Factory::create($type, $y, $m, $d, $h, $i, $s);
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/Calendar.php
New file
0,0 → 1,654
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Harry Fuecks <hfuecks@phppatterns.com> |
// | Lorenzo Alberton <l dot alberton at quipo dot it> |
// +----------------------------------------------------------------------+
//
// $Id: Calendar.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
//
/**
* @package Calendar
* @version $Id: Calendar.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
*/
 
/**
* Allows Calendar include path to be redefined
*/
if (!defined('CALENDAR_ROOT')) {
define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR);
}
 
/**
* Constant which defines the calculation engine to use
*/
if (!defined('CALENDAR_ENGINE')) {
define('CALENDAR_ENGINE', 'UnixTS');
}
 
/**
* Define Calendar Month states
*/
define('CALENDAR_USE_MONTH', 1);
define('CALENDAR_USE_MONTH_WEEKDAYS', 2);
define('CALENDAR_USE_MONTH_WEEKS', 3);
 
/**
* Contains a factory method to return a Singleton instance of a class
* implementing the Calendar_Engine_Interface.<br>
* <b>Note:</b> this class must be modified to "register" alternative
* Calendar_Engines. The engine used can be controlled with the constant
* CALENDAR_ENGINE
* @see Calendar_Engine_Interface
* @package Calendar
* @access protected
*/
class Calendar_Engine_Factory
{
/**
* Returns an instance of the engine
* @return object instance of a calendar calculation engine
* @access protected
*/
function & getEngine()
{
static $engine = false;
switch (CALENDAR_ENGINE) {
case 'PearDate':
$class = 'Calendar_Engine_PearDate';
break;
case 'UnixTS':
default:
$class = 'Calendar_Engine_UnixTS';
break;
}
if (!$engine) {
if (!class_exists($class)) {
require_once CALENDAR_ROOT.'Engine'.DIRECTORY_SEPARATOR.CALENDAR_ENGINE.'.php';
}
$engine = new $class;
}
return $engine;
}
}
 
/**
* Base class for Calendar API. This class should not be instantiated
* directly.
* @abstract
* @package Calendar
*/
class Calendar
{
/**
* Instance of class implementing calendar engine interface
* @var object
* @access private
*/
var $cE;
 
/**
* Instance of Calendar_Validator (lazy initialized when isValid() or
* getValidor() is called
* @var Calendar_Validator
* @access private
*/
var $validator;
 
/**
* Year for this calendar object e.g. 2003
* @access private
* @var int
*/
var $year;
 
/**
* Month for this calendar object e.g. 9
* @access private
* @var int
*/
var $month;
 
/**
* Day of month for this calendar object e.g. 23
* @access private
* @var int
*/
var $day;
 
/**
* Hour of day for this calendar object e.g. 13
* @access private
* @var int
*/
var $hour;
 
/**
* Minute of hour this calendar object e.g. 46
* @access private
* @var int
*/
var $minute;
 
/**
* Second of minute this calendar object e.g. 34
* @access private
* @var int
*/
var $second;
 
/**
* Marks this calendar object as selected (e.g. 'today')
* @access private
* @var boolean
*/
var $selected = false;
 
/**
* Collection of child calendar objects created from subclasses
* of Calendar. Type depends on the object which created them.
* @access private
* @var array
*/
var $children = array();
 
/**
* Constructs the Calendar
* @param int year
* @param int month
* @param int day
* @param int hour
* @param int minute
* @param int second
* @access protected
*/
function Calendar($y = 2000, $m = 1, $d = 1, $h = 0, $i = 0, $s = 0)
{
static $cE = null;
if (!isset($cE)) {
$cE = & Calendar_Engine_Factory::getEngine();
}
$this->cE = & $cE;
$this->year = (int)$y;
$this->month = (int)$m;
$this->day = (int)$d;
$this->hour = (int)$h;
$this->minute = (int)$i;
$this->second = (int)$s;
}
 
/**
* Defines the calendar by a timestamp (Unix or ISO-8601), replacing values
* passed to the constructor
* @param int|string Unix or ISO-8601 timestamp
* @return void
* @access public
*/
function setTimestamp($ts)
{
$this->year = $this->cE->stampToYear($ts);
$this->month = $this->cE->stampToMonth($ts);
$this->day = $this->cE->stampToDay($ts);
$this->hour = $this->cE->stampToHour($ts);
$this->minute = $this->cE->stampToMinute($ts);
$this->second = $this->cE->stampToSecond($ts);
}
 
/**
* Returns a timestamp from the current date / time values. Format of
* timestamp depends on Calendar_Engine implementation being used
* @return int|string timestamp
* @access public
*/
function getTimestamp()
{
return $this->cE->dateToStamp(
$this->year, $this->month, $this->day,
$this->hour, $this->minute, $this->second);
}
 
/**
* Defines calendar object as selected (e.g. for today)
* @param boolean state whether Calendar subclass
* @return void
* @access public
*/
function setSelected($state = true)
{
$this->selected = $state;
}
 
/**
* True if the calendar subclass object is selected (e.g. today)
* @return boolean
* @access public
*/
function isSelected()
{
return $this->selected;
}
 
/**
* Adjusts the date (helper method)
* @return void
* @access public
*/
function adjust()
{
$stamp = $this->getTimeStamp();
$this->year = $this->cE->stampToYear($stamp);
$this->month = $this->cE->stampToMonth($stamp);
$this->day = $this->cE->stampToDay($stamp);
$this->hour = $this->cE->stampToHour($stamp);
$this->minute = $this->cE->stampToMinute($stamp);
$this->second = $this->cE->stampToSecond($stamp);
}
 
/**
* Returns the date as an associative array (helper method)
* @param mixed timestamp (leave empty for current timestamp)
* @return array
* @access public
*/
function toArray($stamp=null)
{
if (is_null($stamp)) {
$stamp = $this->getTimeStamp();
}
return array(
'year' => $this->cE->stampToYear($stamp),
'month' => $this->cE->stampToMonth($stamp),
'day' => $this->cE->stampToDay($stamp),
'hour' => $this->cE->stampToHour($stamp),
'minute' => $this->cE->stampToMinute($stamp),
'second' => $this->cE->stampToSecond($stamp)
);
}
 
/**
* Returns the value as an associative array (helper method)
* @param string type of date object that return value represents
* @param string $format ['int' | 'array' | 'timestamp' | 'object']
* @param mixed timestamp (depending on Calendar engine being used)
* @param int integer default value (i.e. give me the answer quick)
* @return mixed
* @access private
*/
function returnValue($returnType, $format, $stamp, $default)
{
switch (strtolower($format)) {
case 'int':
return $default;
case 'array':
return $this->toArray($stamp);
break;
case 'object':
require_once CALENDAR_ROOT.'Factory.php';
return Calendar_Factory::createByTimestamp($returnType,$stamp);
break;
case 'timestamp':
default:
return $stamp;
break;
}
}
 
/**
* Abstract method for building the children of a calendar object.
* Implemented by Calendar subclasses
* @param array containing Calendar objects to select (optional)
* @return boolean
* @access public
* @abstract
*/
function build($sDates = array())
{
require_once 'PEAR.php';
PEAR::raiseError(
'Calendar::build is abstract', null, PEAR_ERROR_TRIGGER,
E_USER_NOTICE, 'Calendar::build()');
return false;
}
 
/**
* Abstract method for selected data objects called from build
* @param array
* @return boolean
* @access public
* @abstract
*/
function setSelection($sDates)
{
require_once 'PEAR.php';
PEAR::raiseError(
'Calendar::setSelection is abstract', null, PEAR_ERROR_TRIGGER,
E_USER_NOTICE, 'Calendar::setSelection()');
return false;
}
 
/**
* Iterator method for fetching child Calendar subclass objects
* (e.g. a minute from an hour object). On reaching the end of
* the collection, returns false and resets the collection for
* further iteratations.
* @return mixed either an object subclass of Calendar or false
* @access public
*/
function fetch()
{
$child = each($this->children);
if ($child) {
return $child['value'];
} else {
reset($this->children);
return false;
}
}
 
/**
* Fetches all child from the current collection of children
* @return array
* @access public
*/
function fetchAll()
{
return $this->children;
}
 
/**
* Get the number Calendar subclass objects stored in the internal
* collection.
* @return int
* @access public
*/
function size()
{
return count($this->children);
}
 
/**
* Determine whether this date is valid, with the bounds determined by
* the Calendar_Engine. The call is passed on to
* Calendar_Validator::isValid
* @return boolean
* @access public
*/
function isValid()
{
$validator = & $this->getValidator();
return $validator->isValid();
}
 
/**
* Returns an instance of Calendar_Validator
* @return Calendar_Validator
* @access public
*/
function & getValidator()
{
if (!isset($this->validator)) {
require_once CALENDAR_ROOT.'Validator.php';
$this->validator = & new Calendar_Validator($this);
}
return $this->validator;
}
 
/**
* Returns a reference to the current Calendar_Engine being used. Useful
* for Calendar_Table_Helper and Caledar_Validator
* @return object implementing Calendar_Engine_Inteface
* @access private
*/
function & getEngine()
{
return $this->cE;
}
 
/**
* Returns the value for the previous year
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 2002 or timestamp
* @access public
*/
function prevYear($format = 'int')
{
$ts = $this->cE->dateToStamp($this->year-1, 1, 1, 0, 0, 0);
return $this->returnValue('Year', $format, $ts, $this->year-1);
}
 
/**
* Returns the value for this year
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 2003 or timestamp
* @access public
*/
function thisYear($format = 'int')
{
$ts = $this->cE->dateToStamp($this->year, 1, 1, 0, 0, 0);
return $this->returnValue('Year', $format, $ts, $this->year);
}
 
/**
* Returns the value for next year
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 2004 or timestamp
* @access public
*/
function nextYear($format = 'int')
{
$ts = $this->cE->dateToStamp($this->year+1, 1, 1, 0, 0, 0);
return $this->returnValue('Year', $format, $ts, $this->year+1);
}
 
/**
* Returns the value for the previous month
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 4 or Unix timestamp
* @access public
*/
function prevMonth($format = 'int')
{
$ts = $this->cE->dateToStamp($this->year, $this->month-1, 1, 0, 0, 0);
return $this->returnValue('Month', $format, $ts, $this->cE->stampToMonth($ts));
}
 
/**
* Returns the value for this month
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 5 or timestamp
* @access public
*/
function thisMonth($format = 'int')
{
$ts = $this->cE->dateToStamp($this->year, $this->month, 1, 0, 0, 0);
return $this->returnValue('Month', $format, $ts, $this->month);
}
 
/**
* Returns the value for next month
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 6 or timestamp
* @access public
*/
function nextMonth($format = 'int')
{
$ts = $this->cE->dateToStamp($this->year, $this->month+1, 1, 0, 0, 0);
return $this->returnValue('Month', $format, $ts, $this->cE->stampToMonth($ts));
}
 
/**
* Returns the value for the previous day
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 10 or timestamp
* @access public
*/
function prevDay($format = 'int')
{
$ts = $this->cE->dateToStamp(
$this->year, $this->month, $this->day-1, 0, 0, 0);
return $this->returnValue('Day', $format, $ts, $this->cE->stampToDay($ts));
}
 
/**
* Returns the value for this day
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 11 or timestamp
* @access public
*/
function thisDay($format = 'int')
{
$ts = $this->cE->dateToStamp(
$this->year, $this->month, $this->day, 0, 0, 0);
return $this->returnValue('Day', $format, $ts, $this->day);
}
 
/**
* Returns the value for the next day
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 12 or timestamp
* @access public
*/
function nextDay($format = 'int')
{
$ts = $this->cE->dateToStamp(
$this->year, $this->month, $this->day+1, 0, 0, 0);
return $this->returnValue('Day', $format, $ts, $this->cE->stampToDay($ts));
}
 
/**
* Returns the value for the previous hour
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 13 or timestamp
* @access public
*/
function prevHour($format = 'int')
{
$ts = $this->cE->dateToStamp(
$this->year, $this->month, $this->day, $this->hour-1, 0, 0);
return $this->returnValue('Hour', $format, $ts, $this->cE->stampToHour($ts));
}
 
/**
* Returns the value for this hour
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 14 or timestamp
* @access public
*/
function thisHour($format = 'int')
{
$ts = $this->cE->dateToStamp(
$this->year, $this->month, $this->day, $this->hour, 0, 0);
return $this->returnValue('Hour', $format, $ts, $this->hour);
}
 
/**
* Returns the value for the next hour
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 14 or timestamp
* @access public
*/
function nextHour($format = 'int')
{
$ts = $this->cE->dateToStamp(
$this->year, $this->month, $this->day, $this->hour+1, 0, 0);
return $this->returnValue('Hour', $format, $ts, $this->cE->stampToHour($ts));
}
 
/**
* Returns the value for the previous minute
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 23 or timestamp
* @access public
*/
function prevMinute($format = 'int')
{
$ts = $this->cE->dateToStamp(
$this->year, $this->month, $this->day,
$this->hour, $this->minute-1, 0);
return $this->returnValue('Minute', $format, $ts, $this->cE->stampToMinute($ts));
}
 
/**
* Returns the value for this minute
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 24 or timestamp
* @access public
*/
function thisMinute($format = 'int')
{
$ts = $this->cE->dateToStamp(
$this->year, $this->month, $this->day,
$this->hour, $this->minute, 0);
return $this->returnValue('Minute', $format, $ts, $this->minute);
}
 
/**
* Returns the value for the next minute
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 25 or timestamp
* @access public
*/
function nextMinute($format = 'int')
{
$ts = $this->cE->dateToStamp(
$this->year, $this->month, $this->day,
$this->hour, $this->minute+1, 0);
return $this->returnValue('Minute', $format, $ts, $this->cE->stampToMinute($ts));
}
 
/**
* Returns the value for the previous second
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 43 or timestamp
* @access public
*/
function prevSecond($format = 'int')
{
$ts = $this->cE->dateToStamp(
$this->year, $this->month, $this->day,
$this->hour, $this->minute, $this->second-1);
return $this->returnValue('Second', $format, $ts, $this->cE->stampToSecond($ts));
}
 
/**
* Returns the value for this second
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 44 or timestamp
* @access public
*/
function thisSecond($format = 'int')
{
$ts = $this->cE->dateToStamp(
$this->year, $this->month, $this->day,
$this->hour, $this->minute, $this->second);
return $this->returnValue('Second', $format, $ts, $this->second);
}
 
/**
* Returns the value for the next second
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 45 or timestamp
* @access public
*/
function nextSecond($format = 'int')
{
$ts = $this->cE->dateToStamp(
$this->year, $this->month, $this->day,
$this->hour, $this->minute, $this->second+1);
return $this->returnValue('Second', $format, $ts, $this->cE->stampToSecond($ts));
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/Second.php
New file
0,0 → 1,98
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Harry Fuecks <hfuecks@phppatterns.com> |
// +----------------------------------------------------------------------+
//
// $Id: Second.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
//
/**
* @package Calendar
* @version $Id: Second.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
*/
 
/**
* Allows Calendar include path to be redefined
* @ignore
*/
if (!defined('CALENDAR_ROOT')) {
define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR);
}
 
/**
* Load Calendar base class
*/
require_once CALENDAR_ROOT.'Calendar.php';
 
/**
* Represents a Second<br />
* <b>Note:</b> Seconds do not build other objects
* so related methods are overridden to return NULL
* @package Calendar
*/
class Calendar_Second extends Calendar
{
/**
* Constructs Second
* @param int year e.g. 2003
* @param int month e.g. 5
* @param int day e.g. 11
* @param int hour e.g. 13
* @param int minute e.g. 31
* @param int second e.g. 45
*/
function Calendar_Second($y, $m, $d, $h, $i, $s)
{
Calendar::Calendar($y, $m, $d, $h, $i, $s);
}
 
/**
* Overwrite build
* @return NULL
*/
function build()
{
return null;
}
 
/**
* Overwrite fetch
* @return NULL
*/
function fetch()
{
return null;
}
 
/**
* Overwrite fetchAll
* @return NULL
*/
function fetchAll()
{
return null;
}
 
/**
* Overwrite size
* @return NULL
*/
function size()
{
return null;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/tests/unixts_engine_test.php
New file
0,0 → 1,104
<?php
// $Id: unixts_engine_test.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
 
require_once('simple_include.php');
require_once('calendar_include.php');
 
class TestOfUnixTsEngine extends UnitTestCase {
var $engine;
function TestOfUnixTsEngine() {
$this->UnitTestCase('Test of Calendar_Engine_UnixTs');
}
function setUp() {
$this->engine = new Calendar_Engine_UnixTs();
}
function testGetSecondsInMinute() {
$this->assertEqual($this->engine->getSecondsInMinute(),60);
}
function testGetMinutesInHour() {
$this->assertEqual($this->engine->getMinutesInHour(),60);
}
function testGetHoursInDay() {
$this->assertEqual($this->engine->getHoursInDay(),24);
}
function testGetFirstDayOfWeek() {
$this->assertEqual($this->engine->getFirstDayOfWeek(),1);
}
function testGetWeekDays() {
$this->assertEqual($this->engine->getWeekDays(),array(0,1,2,3,4,5,6));
}
function testGetDaysInWeek() {
$this->assertEqual($this->engine->getDaysInWeek(),7);
}
function testGetWeekNInYear() {
$this->assertEqual($this->engine->getWeekNInYear(2003, 11, 3), 45);
}
function testGetWeekNInMonth() {
$this->assertEqual($this->engine->getWeekNInMonth(2003, 11, 3), 2);
}
function testGetWeeksInMonth0() {
$this->assertEqual($this->engine->getWeeksInMonth(2003, 11, 0), 6); //week starts on sunday
}
function testGetWeeksInMonth1() {
$this->assertEqual($this->engine->getWeeksInMonth(2003, 11, 1), 5); //week starts on monday
}
function testGetWeeksInMonth2() {
$this->assertEqual($this->engine->getWeeksInMonth(2003, 2, 6), 4); //week starts on saturday
}
function testGetWeeksInMonth3() {
// Unusual cases that can cause fails (shows up with example 21.php)
$this->assertEqual($this->engine->getWeeksInMonth(2004,2,1),5);
$this->assertEqual($this->engine->getWeeksInMonth(2004,8,1),6);
}
function testGetDayOfWeek() {
$this->assertEqual($this->engine->getDayOfWeek(2003, 11, 18), 2);
}
function testGetFirstDayInMonth() {
$this->assertEqual($this->engine->getFirstDayInMonth(2003,10),3);
}
function testGetDaysInMonth() {
$this->assertEqual($this->engine->getDaysInMonth(2003,10),31);
}
function testGetMinYears() {
$test = strpos(PHP_OS, 'WIN') >= 0 ? 1970 : 1902;
$this->assertEqual($this->engine->getMinYears(),$test);
}
function testGetMaxYears() {
$this->assertEqual($this->engine->getMaxYears(),2037);
}
function testDateToStamp() {
$stamp = mktime(0,0,0,10,15,2003);
$this->assertEqual($this->engine->dateToStamp(2003,10,15,0,0,0),$stamp);
}
function testStampToSecond() {
$stamp = mktime(13,30,45,10,15,2003);
$this->assertEqual($this->engine->stampToSecond($stamp),45);
}
function testStampToMinute() {
$stamp = mktime(13,30,45,10,15,2003);
$this->assertEqual($this->engine->stampToMinute($stamp),30);
}
function testStampToHour() {
$stamp = mktime(13,30,45,10,15,2003);
$this->assertEqual($this->engine->stampToHour($stamp),13);
}
function testStampToDay() {
$stamp = mktime(13,30,45,10,15,2003);
$this->assertEqual($this->engine->stampToDay($stamp),15);
}
function testStampToMonth() {
$stamp = mktime(13,30,45,10,15,2003);
$this->assertEqual($this->engine->stampToMonth($stamp),10);
}
function testStampToYear() {
$stamp = mktime(13,30,45,10,15,2003);
$this->assertEqual($this->engine->stampToYear($stamp),2003);
}
}
 
if (!defined('TEST_RUNNING')) {
define('TEST_RUNNING', true);
$test = &new TestOfUnixTsEngine();
$test->run(new HtmlReporter());
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/tests/helper_test.php
New file
0,0 → 1,83
<?php
// $Id: helper_test.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
 
require_once('simple_include.php');
require_once('calendar_include.php');
 
Mock::generate('Calendar_Engine_Interface','Mock_Calendar_Engine');
Mock::generate('Calendar_Second','Mock_Calendar_Second');
 
class TestOfTableHelper extends UnitTestCase {
var $mockengine;
var $mockcal;
function TestOfTableHelper() {
$this->UnitTestCase('Test of Calendar_Table_Helper');
}
function setUp() {
$this->mockengine = new Mock_Calendar_Engine($this);
$this->mockengine->setReturnValue('getMinYears',1970);
$this->mockengine->setReturnValue('getMaxYears',2037);
$this->mockengine->setReturnValue('getMonthsInYear',12);
$this->mockengine->setReturnValue('getDaysInMonth',31);
$this->mockengine->setReturnValue('getHoursInDay',24);
$this->mockengine->setReturnValue('getMinutesInHour',60);
$this->mockengine->setReturnValue('getSecondsInMinute',60);
$this->mockengine->setReturnValue('getWeekDays',array(0,1,2,3,4,5,6));
$this->mockengine->setReturnValue('getDaysInWeek',7);
$this->mockengine->setReturnValue('getFirstDayOfWeek',1);
$this->mockengine->setReturnValue('getFirstDayInMonth',3);
$this->mockcal = new Mock_Calendar_Second($this);
$this->mockcal->setReturnValue('thisYear',2003);
$this->mockcal->setReturnValue('thisMonth',10);
$this->mockcal->setReturnValue('thisDay',15);
$this->mockcal->setReturnValue('thisHour',13);
$this->mockcal->setReturnValue('thisMinute',30);
$this->mockcal->setReturnValue('thisSecond',45);
$this->mockcal->setReturnValue('getEngine',$this->mockengine);
}
function testGetFirstDay() {
for ( $i = 0; $i <= 7; $i++ ) {
$Helper = & new Calendar_Table_Helper($this->mockcal,$i);
$this->assertEqual($Helper->getFirstDay(),$i);
}
}
function testGetDaysOfWeekMonday() {
$Helper = & new Calendar_Table_Helper($this->mockcal);
$this->assertEqual($Helper->getDaysOfWeek(),array(1,2,3,4,5,6,0));
}
function testGetDaysOfWeekSunday() {
$Helper = & new Calendar_Table_Helper($this->mockcal,0);
$this->assertEqual($Helper->getDaysOfWeek(),array(0,1,2,3,4,5,6));
}
function testGetDaysOfWeekThursday() {
$Helper = & new Calendar_Table_Helper($this->mockcal,4);
$this->assertEqual($Helper->getDaysOfWeek(),array(4,5,6,0,1,2,3));
}
function testGetNumWeeks() {
$Helper = & new Calendar_Table_Helper($this->mockcal);
$this->assertEqual($Helper->getNumWeeks(),5);
}
function testGetNumTableDaysInMonth() {
$Helper = & new Calendar_Table_Helper($this->mockcal);
$this->assertEqual($Helper->getNumTableDaysInMonth(),35);
}
function testGetEmptyDaysBefore() {
$Helper = & new Calendar_Table_Helper($this->mockcal);
$this->assertEqual($Helper->getEmptyDaysBefore(),2);
}
function testGetEmptyDaysAfter() {
$Helper = & new Calendar_Table_Helper($this->mockcal);
$this->assertEqual($Helper->getEmptyDaysAfter(),33);
}
function testGetEmptyDaysAfterOffset() {
$Helper = & new Calendar_Table_Helper($this->mockcal);
$this->assertEqual($Helper->getEmptyDaysAfterOffset(),5);
}
}
 
if (!defined('TEST_RUNNING')) {
define('TEST_RUNNING', true);
$test = &new TestOfTableHelper();
$test->run(new HtmlReporter());
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/tests/month_weekdays_test.php
New file
0,0 → 1,130
<?php
// $Id: month_weekdays_test.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
 
require_once('simple_include.php');
require_once('calendar_include.php');
 
require_once('./calendar_test.php');
 
class TestOfMonthWeekdays extends TestOfCalendar {
function TestOfMonthWeekdays() {
$this->UnitTestCase('Test of Month Weekdays');
}
function setUp() {
$this->cal = new Calendar_Month_Weekdays(2003,10);
}
function testPrevDay () {
$this->assertEqual(30,$this->cal->prevDay());
}
function testPrevDay_Array () {
$this->assertEqual(
array(
'year' => 2003,
'month' => 9,
'day' => 30,
'hour' => 0,
'minute' => 0,
'second' => 0),
$this->cal->prevDay('array'));
}
function testThisDay () {
$this->assertEqual(1,$this->cal->thisDay());
}
function testNextDay () {
$this->assertEqual(2,$this->cal->nextDay());
}
function testPrevHour () {
$this->assertEqual(23,$this->cal->prevHour());
}
function testThisHour () {
$this->assertEqual(0,$this->cal->thisHour());
}
function testNextHour () {
$this->assertEqual(1,$this->cal->nextHour());
}
function testPrevMinute () {
$this->assertEqual(59,$this->cal->prevMinute());
}
function testThisMinute () {
$this->assertEqual(0,$this->cal->thisMinute());
}
function testNextMinute () {
$this->assertEqual(1,$this->cal->nextMinute());
}
function testPrevSecond () {
$this->assertEqual(59,$this->cal->prevSecond());
}
function testThisSecond () {
$this->assertEqual(0,$this->cal->thisSecond());
}
function testNextSecond () {
$this->assertEqual(1,$this->cal->nextSecond());
}
function testGetTimeStamp() {
$stamp = mktime(0,0,0,10,1,2003);
$this->assertEqual($stamp,$this->cal->getTimeStamp());
}
}
 
class TestOfMonthWeekdaysBuild extends TestOfMonthWeekdays {
function TestOfMonthWeekdaysBuild() {
$this->UnitTestCase('Test of Month_Weekdays::build()');
}
function testSize() {
$this->cal->build();
$this->assertEqual(35,$this->cal->size());
}
function testFetch() {
$this->cal->build();
$i=0;
while ( $Child = $this->cal->fetch() ) {
$i++;
}
$this->assertEqual(35,$i);
}
function testFetchAll() {
$this->cal->build();
$children = array();
$i = 1;
while ( $Child = $this->cal->fetch() ) {
$children[$i]=$Child;
$i++;
}
$this->assertEqual($children,$this->cal->fetchAll());
}
function testSelection() {
require_once(CALENDAR_ROOT . 'Day.php');
$selection = array(new Calendar_Day(2003,10,25));
$this->cal->build($selection);
$i = 1;
while ( $Child = $this->cal->fetch() ) {
if ( $i == 27 )
break;
$i++;
}
$this->assertTrue($Child->isSelected());
}
function testEmptyCount() {
$this->cal->build();
$empty = 0;
while ( $Child = $this->cal->fetch() ) {
if ( $Child->isEmpty() )
$empty++;
}
$this->assertEqual(4,$empty);
}
function testEmptyDaysBefore_AfterAdjust() {
$this->cal = new Calendar_Month_Weekdays(2004,0);
$this->cal->build();
$this->assertEqual(0,$this->cal->tableHelper->getEmptyDaysBefore());
}
}
 
if (!defined('TEST_RUNNING')) {
define('TEST_RUNNING', true);
$test = &new TestOfMonthWeekdays();
$test->run(new HtmlReporter());
$test = &new TestOfMonthWeekdaysBuild();
$test->run(new HtmlReporter());
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/tests/calendar_engine_tests.php
New file
0,0 → 1,20
<?php
// $Id: calendar_engine_tests.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
 
require_once('simple_include.php');
require_once('calendar_include.php');
 
class CalendarEngineTests extends GroupTest {
function CalendarEngineTests() {
$this->GroupTest('Calendar Engine Tests');
$this->addTestFile('peardate_engine_test.php');
$this->addTestFile('unixts_engine_test.php');
}
}
 
if (!defined('TEST_RUNNING')) {
define('TEST_RUNNING', true);
$test = &new CalendarEngineTests();
$test->run(new HtmlReporter());
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/tests/decorator_test.php
New file
0,0 → 1,268
<?php
// $Id: decorator_test.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
 
require_once('simple_include.php');
require_once('calendar_include.php');
 
Mock::generate('Calendar_Engine_Interface','Mock_Calendar_Engine');
Mock::generate('Calendar_Second','Mock_Calendar_Second');
Mock::generate('Calendar_Week','Mock_Calendar_Week');
Mock::generate('Calendar_Day','Mock_Calendar_Day');
 
class TestOfDecorator extends UnitTestCase {
var $mockengine;
var $mockcal;
var $decorator;
function TestOfDecorator() {
$this->UnitTestCase('Test of Calendar_Decorator');
}
function setUp() {
$this->mockengine = new Mock_Calendar_Engine($this);
$this->mockcal = new Mock_Calendar_Second($this);
$this->mockcal->setReturnValue('prevYear',2002);
$this->mockcal->setReturnValue('thisYear',2003);
$this->mockcal->setReturnValue('nextYear',2004);
$this->mockcal->setReturnValue('prevMonth',9);
$this->mockcal->setReturnValue('thisMonth',10);
$this->mockcal->setReturnValue('nextMonth',11);
$this->mockcal->setReturnValue('prevDay',14);
$this->mockcal->setReturnValue('thisDay',15);
$this->mockcal->setReturnValue('nextDay',16);
$this->mockcal->setReturnValue('prevHour',12);
$this->mockcal->setReturnValue('thisHour',13);
$this->mockcal->setReturnValue('nextHour',14);
$this->mockcal->setReturnValue('prevMinute',29);
$this->mockcal->setReturnValue('thisMinute',30);
$this->mockcal->setReturnValue('nextMinute',31);
$this->mockcal->setReturnValue('prevSecond',44);
$this->mockcal->setReturnValue('thisSecond',45);
$this->mockcal->setReturnValue('nextSecond',46);
$this->mockcal->setReturnValue('getEngine',$this->mockengine);
$this->mockcal->setReturnValue('getTimestamp',12345);
 
}
function tearDown() {
unset ( $this->engine );
unset ( $this->mockcal );
}
function testPrevYear() {
$this->mockcal->expectOnce('prevYear',array('int'));
$Decorator =& new Calendar_Decorator($this->mockcal);
$this->assertEqual(2002,$Decorator->prevYear());
}
function testThisYear() {
$this->mockcal->expectOnce('thisYear',array('int'));
$Decorator =& new Calendar_Decorator($this->mockcal);
$this->assertEqual(2003,$Decorator->thisYear());
}
function testNextYear() {
$this->mockcal->expectOnce('nextYear',array('int'));
$Decorator =& new Calendar_Decorator($this->mockcal);
$this->assertEqual(2004,$Decorator->nextYear());
}
function testPrevMonth() {
$this->mockcal->expectOnce('prevMonth',array('int'));
$Decorator =& new Calendar_Decorator($this->mockcal);
$this->assertEqual(9,$Decorator->prevMonth());
}
function testThisMonth() {
$this->mockcal->expectOnce('thisMonth',array('int'));
$Decorator =& new Calendar_Decorator($this->mockcal);
$this->assertEqual(10,$Decorator->thisMonth());
}
function testNextMonth() {
$this->mockcal->expectOnce('nextMonth',array('int'));
$Decorator =& new Calendar_Decorator($this->mockcal);
$this->assertEqual(11,$Decorator->nextMonth());
}
function testPrevWeek() {
$mockweek = & new Mock_Calendar_Week($this);
$mockweek->setReturnValue('prevWeek',1);
$mockweek->expectOnce('prevWeek',array('n_in_month'));
$Decorator =& new Calendar_Decorator($mockweek);
$this->assertEqual(1,$Decorator->prevWeek());
}
function testThisWeek() {
$mockweek = & new Mock_Calendar_Week($this);
$mockweek->setReturnValue('thisWeek',2);
$mockweek->expectOnce('thisWeek',array('n_in_month'));
$Decorator =& new Calendar_Decorator($mockweek);
$this->assertEqual(2,$Decorator->thisWeek());
}
function testNextWeek() {
$mockweek = & new Mock_Calendar_Week($this);
$mockweek->setReturnValue('nextWeek',3);
$mockweek->expectOnce('nextWeek',array('n_in_month'));
$Decorator =& new Calendar_Decorator($mockweek);
$this->assertEqual(3,$Decorator->nextWeek());
}
function testPrevDay() {
$this->mockcal->expectOnce('prevDay',array('int'));
$Decorator =& new Calendar_Decorator($this->mockcal);
$this->assertEqual(14,$Decorator->prevDay());
}
function testThisDay() {
$this->mockcal->expectOnce('thisDay',array('int'));
$Decorator =& new Calendar_Decorator($this->mockcal);
$this->assertEqual(15,$Decorator->thisDay());
}
function testNextDay() {
$this->mockcal->expectOnce('nextDay',array('int'));
$Decorator =& new Calendar_Decorator($this->mockcal);
$this->assertEqual(16,$Decorator->nextDay());
}
function testPrevHour() {
$this->mockcal->expectOnce('prevHour',array('int'));
$Decorator =& new Calendar_Decorator($this->mockcal);
$this->assertEqual(12,$Decorator->prevHour());
}
function testThisHour() {
$this->mockcal->expectOnce('thisHour',array('int'));
$Decorator =& new Calendar_Decorator($this->mockcal);
$this->assertEqual(13,$Decorator->thisHour());
}
function testNextHour() {
$this->mockcal->expectOnce('nextHour',array('int'));
$Decorator =& new Calendar_Decorator($this->mockcal);
$this->assertEqual(14,$Decorator->nextHour());
}
function testPrevMinute() {
$this->mockcal->expectOnce('prevMinute',array('int'));
$Decorator =& new Calendar_Decorator($this->mockcal);
$this->assertEqual(29,$Decorator->prevMinute());
}
function testThisMinute() {
$this->mockcal->expectOnce('thisMinute',array('int'));
$Decorator =& new Calendar_Decorator($this->mockcal);
$this->assertEqual(30,$Decorator->thisMinute());
}
function testNextMinute() {
$this->mockcal->expectOnce('nextMinute',array('int'));
$Decorator =& new Calendar_Decorator($this->mockcal);
$this->assertEqual(31,$Decorator->nextMinute());
}
function testPrevSecond() {
$this->mockcal->expectOnce('prevSecond',array('int'));
$Decorator =& new Calendar_Decorator($this->mockcal);
$this->assertEqual(44,$Decorator->prevSecond());
}
function testThisSecond() {
$this->mockcal->expectOnce('thisSecond',array('int'));
$Decorator =& new Calendar_Decorator($this->mockcal);
$this->assertEqual(45,$Decorator->thisSecond());
}
function testNextSecond() {
$this->mockcal->expectOnce('nextSecond',array('int'));
$Decorator =& new Calendar_Decorator($this->mockcal);
$this->assertEqual(46,$Decorator->nextSecond());
}
function testGetEngine() {
$Decorator =& new Calendar_Decorator($this->mockcal);
$this->assertIsA($Decorator->getEngine(),'Mock_Calendar_Engine');
}
function testSetTimestamp() {
$this->mockcal->expectOnce('setTimestamp',array('12345'));
$Decorator =& new Calendar_Decorator($this->mockcal);
$Decorator->setTimestamp('12345');
}
function testGetTimestamp() {
$Decorator =& new Calendar_Decorator($this->mockcal);
$this->assertEqual(12345,$Decorator->getTimestamp());
}
function testSetSelected() {
$this->mockcal->expectOnce('setSelected',array(true));
$Decorator =& new Calendar_Decorator($this->mockcal);
$Decorator->setSelected();
}
function testIsSelected() {
$this->mockcal->setReturnValue('isSelected',true);
$Decorator =& new Calendar_Decorator($this->mockcal);
$this->assertTrue($Decorator->isSelected());
}
function testAdjust() {
$this->mockcal->expectOnce('adjust',array());
$Decorator =& new Calendar_Decorator($this->mockcal);
$Decorator->adjust();
}
function testToArray() {
$this->mockcal->expectOnce('toArray',array(12345));
$testArray = array('foo'=>'bar');
$this->mockcal->setReturnValue('toArray',$testArray);
$Decorator =& new Calendar_Decorator($this->mockcal);
$this->assertEqual($testArray,$Decorator->toArray(12345));
}
function testReturnValue() {
$this->mockcal->expectOnce('returnValue',array('a','b','c','d'));
$this->mockcal->setReturnValue('returnValue','foo');
$Decorator =& new Calendar_Decorator($this->mockcal);
$this->assertEqual('foo',$Decorator->returnValue('a','b','c','d'));
}
function testSetFirst() {
$mockday = & new Mock_Calendar_Day($this);
$mockday->expectOnce('setFirst',array(true));
$Decorator =& new Calendar_Decorator($mockday);
$Decorator->setFirst();
}
function testSetLast() {
$mockday = & new Mock_Calendar_Day($this);
$mockday->expectOnce('setLast',array(true));
$Decorator =& new Calendar_Decorator($mockday);
$Decorator->setLast();
}
function testIsFirst() {
$mockday = & new Mock_Calendar_Day($this);
$mockday->setReturnValue('isFirst',TRUE);
$Decorator =& new Calendar_Decorator($mockday);
$this->assertTrue($Decorator->isFirst());
}
function testIsLast() {
$mockday = & new Mock_Calendar_Day($this);
$mockday->setReturnValue('isLast',TRUE);
$Decorator =& new Calendar_Decorator($mockday);
$this->assertTrue($Decorator->isLast());
}
function testSetEmpty() {
$mockday = & new Mock_Calendar_Day($this);
$mockday->expectOnce('setEmpty',array(true));
$Decorator =& new Calendar_Decorator($mockday);
$Decorator->setEmpty();
}
function testIsEmpty() {
$mockday = & new Mock_Calendar_Day($this);
$mockday->setReturnValue('isEmpty',TRUE);
$Decorator =& new Calendar_Decorator($mockday);
$this->assertTrue($Decorator->isEmpty());
}
function testBuild() {
$testArray=array('foo'=>'bar');
$this->mockcal->expectOnce('build',array($testArray));
$Decorator =& new Calendar_Decorator($this->mockcal);
$Decorator->build($testArray);
}
function testFetch() {
$this->mockcal->expectOnce('fetch',array());
$Decorator =& new Calendar_Decorator($this->mockcal);
$Decorator->fetch();
}
function testFetchAll() {
$this->mockcal->expectOnce('fetchAll',array());
$Decorator =& new Calendar_Decorator($this->mockcal);
$Decorator->fetchAll();
}
function testSize() {
$this->mockcal->expectOnce('size',array());
$Decorator =& new Calendar_Decorator($this->mockcal);
$Decorator->size();
}
function testIsValid() {
$this->mockcal->expectOnce('isValid',array());
$Decorator =& new Calendar_Decorator($this->mockcal);
$Decorator->isValid();
}
function testGetValidator() {
$this->mockcal->expectOnce('getValidator',array());
$Decorator =& new Calendar_Decorator($this->mockcal);
$Decorator->getValidator();
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/tests/util_textual_test.php
New file
0,0 → 1,191
<?php
// $Id: util_textual_test.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
 
require_once('simple_include.php');
require_once('calendar_include.php');
 
require_once('./decorator_test.php');
 
class TestOfUtilTextual extends UnitTestCase {
var $mockengine;
var $mockcal;
function TestOfUtilTextual() {
$this->UnitTestCase('Test of Calendar_Util_Textual');
}
function setUp() {
$this->mockengine = new Mock_Calendar_Engine($this);
$this->mockcal = new Mock_Calendar_Second($this);
$this->mockcal->setReturnValue('prevYear',2002);
$this->mockcal->setReturnValue('thisYear',2003);
$this->mockcal->setReturnValue('nextYear',2004);
$this->mockcal->setReturnValue('prevMonth',9);
$this->mockcal->setReturnValue('thisMonth',10);
$this->mockcal->setReturnValue('nextMonth',11);
$this->mockcal->setReturnValue('prevDay',14);
$this->mockcal->setReturnValue('thisDay',15);
$this->mockcal->setReturnValue('nextDay',16);
$this->mockcal->setReturnValue('prevHour',12);
$this->mockcal->setReturnValue('thisHour',13);
$this->mockcal->setReturnValue('nextHour',14);
$this->mockcal->setReturnValue('prevMinute',29);
$this->mockcal->setReturnValue('thisMinute',30);
$this->mockcal->setReturnValue('nextMinute',31);
$this->mockcal->setReturnValue('prevSecond',44);
$this->mockcal->setReturnValue('thisSecond',45);
$this->mockcal->setReturnValue('nextSecond',46);
$this->mockcal->setReturnValue('getEngine',$this->mockengine);
$this->mockcal->setReturnValue('getTimestamp',12345);
}
function tearDown() {
unset ( $this->engine );
unset ( $this->mockcal );
}
function testMonthNamesLong() {
$monthNames = array(
1=>'January',
2=>'February',
3=>'March',
4=>'April',
5=>'May',
6=>'June',
7=>'July',
8=>'August',
9=>'September',
10=>'October',
11=>'November',
12=>'December',
);
$this->assertEqual($monthNames,Calendar_Util_Textual::monthNames());
}
function testMonthNamesShort() {
$monthNames = array(
1=>'Jan',
2=>'Feb',
3=>'Mar',
4=>'Apr',
5=>'May',
6=>'Jun',
7=>'Jul',
8=>'Aug',
9=>'Sep',
10=>'Oct',
11=>'Nov',
12=>'Dec',
);
$this->assertEqual($monthNames,Calendar_Util_Textual::monthNames('short'));
}
function testMonthNamesTwo() {
$monthNames = array(
1=>'Ja',
2=>'Fe',
3=>'Ma',
4=>'Ap',
5=>'Ma',
6=>'Ju',
7=>'Ju',
8=>'Au',
9=>'Se',
10=>'Oc',
11=>'No',
12=>'De',
);
$this->assertEqual($monthNames,Calendar_Util_Textual::monthNames('two'));
}
function testMonthNamesOne() {
$monthNames = array(
1=>'J',
2=>'F',
3=>'M',
4=>'A',
5=>'M',
6=>'J',
7=>'J',
8=>'A',
9=>'S',
10=>'O',
11=>'N',
12=>'D',
);
$this->assertEqual($monthNames,Calendar_Util_Textual::monthNames('one'));
}
function testWeekdayNamesLong() {
$weekdayNames = array(
0=>'Sunday',
1=>'Monday',
2=>'Tuesday',
3=>'Wednesday',
4=>'Thursday',
5=>'Friday',
6=>'Saturday',
);
$this->assertEqual($weekdayNames,Calendar_Util_Textual::weekdayNames());
}
function testWeekdayNamesShort() {
$weekdayNames = array(
0=>'Sun',
1=>'Mon',
2=>'Tue',
3=>'Wed',
4=>'Thu',
5=>'Fri',
6=>'Sat',
);
$this->assertEqual($weekdayNames,Calendar_Util_Textual::weekdayNames('short'));
}
function testWeekdayNamesTwo() {
$weekdayNames = array(
0=>'Su',
1=>'Mo',
2=>'Tu',
3=>'We',
4=>'Th',
5=>'Fr',
6=>'Sa',
);
$this->assertEqual($weekdayNames,Calendar_Util_Textual::weekdayNames('two'));
}
function testWeekdayNamesOne() {
$weekdayNames = array(
0=>'S',
1=>'M',
2=>'T',
3=>'W',
4=>'T',
5=>'F',
6=>'S',
);
$this->assertEqual($weekdayNames,Calendar_Util_Textual::weekdayNames('one'));
}
function testPrevMonthNameShort() {
$this->assertEqual('Sep',Calendar_Util_Textual::prevMonthName($this->mockcal,'short'));
}
function testThisMonthNameShort() {
$this->assertEqual('Oct',Calendar_Util_Textual::thisMonthName($this->mockcal,'short'));
}
function testNextMonthNameShort() {
$this->assertEqual('Nov',Calendar_Util_Textual::nextMonthName($this->mockcal,'short'));
}
function testThisDayNameShort() {
$this->assertEqual('Wed',Calendar_Util_Textual::thisDayName($this->mockcal,'short'));
}
function testOrderedWeekdaysShort() {
$weekdayNames = array(
0=>'Sun',
1=>'Mon',
2=>'Tue',
3=>'Wed',
4=>'Thu',
5=>'Fri',
6=>'Sat',
);
$this->assertEqual($weekdayNames,Calendar_Util_Textual::orderedWeekdays($this->mockcal,'short'));
}
 
}
 
if (!defined('TEST_RUNNING')) {
define('TEST_RUNNING', true);
$test = &new TestOfUtilTextual();
$test->run(new HtmlReporter());
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/tests/month_weeks_test.php
New file
0,0 → 1,125
<?php
// $Id: month_weeks_test.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
 
require_once('simple_include.php');
require_once('calendar_include.php');
 
require_once('./calendar_test.php');
 
class TestOfMonthWeeks extends TestOfCalendar {
function TestOfMonthWeeks() {
$this->UnitTestCase('Test of Month Weeks');
}
function setUp() {
$this->cal = new Calendar_Month_Weeks(2003,10);
}
function testPrevDay () {
$this->assertEqual(30,$this->cal->prevDay());
}
function testPrevDay_Array () {
$this->assertEqual(
array(
'year' => 2003,
'month' => 9,
'day' => 30,
'hour' => 0,
'minute' => 0,
'second' => 0),
$this->cal->prevDay('array'));
}
function testThisDay () {
$this->assertEqual(1,$this->cal->thisDay());
}
function testNextDay () {
$this->assertEqual(2,$this->cal->nextDay());
}
function testPrevHour () {
$this->assertEqual(23,$this->cal->prevHour());
}
function testThisHour () {
$this->assertEqual(0,$this->cal->thisHour());
}
function testNextHour () {
$this->assertEqual(1,$this->cal->nextHour());
}
function testPrevMinute () {
$this->assertEqual(59,$this->cal->prevMinute());
}
function testThisMinute () {
$this->assertEqual(0,$this->cal->thisMinute());
}
function testNextMinute () {
$this->assertEqual(1,$this->cal->nextMinute());
}
function testPrevSecond () {
$this->assertEqual(59,$this->cal->prevSecond());
}
function testThisSecond () {
$this->assertEqual(0,$this->cal->thisSecond());
}
function testNextSecond () {
$this->assertEqual(1,$this->cal->nextSecond());
}
function testGetTimeStamp() {
$stamp = mktime(0,0,0,10,1,2003);
$this->assertEqual($stamp,$this->cal->getTimeStamp());
}
}
 
class TestOfMonthWeeksBuild extends TestOfMonthWeeks {
function TestOfMonthWeeksBuild() {
$this->UnitTestCase('Test of Month_Weeks::build()');
}
function testSize() {
$this->cal->build();
$this->assertEqual(5,$this->cal->size());
}
 
function testFetch() {
$this->cal->build();
$i=0;
while ( $Child = $this->cal->fetch() ) {
$i++;
}
$this->assertEqual(5,$i);
}
/* Recusive dependency issue with SimpleTest
function testFetchAll() {
$this->cal->build();
$children = array();
$i = 1;
while ( $Child = $this->cal->fetch() ) {
$children[$i]=$Child;
$i++;
}
$this->assertEqual($children,$this->cal->fetchAll());
}
*/
function testSelection() {
require_once(CALENDAR_ROOT . 'Week.php');
$selection = array(new Calendar_Week(2003, 10, 12));
$this->cal->build($selection);
$i = 1;
while ($Child = $this->cal->fetch()) {
if ($i == 2) {
break; //12-10-2003 is the 2nd day of the week
}
$i++;
}
$this->assertTrue($Child->isSelected());
}
function testEmptyDaysBefore_AfterAdjust() {
$this->cal = new Calendar_Month_Weeks(2004,0);
$this->cal->build();
$this->assertEqual(0,$this->cal->tableHelper->getEmptyDaysBefore());
}
}
 
if (!defined('TEST_RUNNING')) {
define('TEST_RUNNING', true);
$test = &new TestOfMonthWeeks();
$test->run(new HtmlReporter());
$test = &new TestOfMonthWeeksBuild();
$test->run(new HtmlReporter());
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/tests/validator_unit_test.php
New file
0,0 → 1,210
<?php
// $Id: validator_unit_test.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
 
require_once('simple_include.php');
require_once('calendar_include.php');
 
Mock::generate('Calendar_Engine_Interface','Mock_Calendar_Engine');
Mock::generate('Calendar_Second','Mock_Calendar_Second');
 
class TestOfValidator extends UnitTestCase {
var $mockengine;
var $mockcal;
function TestOfValidator() {
$this->UnitTestCase('Test of Validator');
}
function setUp() {
$this->mockengine = new Mock_Calendar_Engine($this);
$this->mockengine->setReturnValue('getMinYears',1970);
$this->mockengine->setReturnValue('getMaxYears',2037);
$this->mockengine->setReturnValue('getMonthsInYear',12);
$this->mockengine->setReturnValue('getDaysInMonth',30);
$this->mockengine->setReturnValue('getHoursInDay',24);
$this->mockengine->setReturnValue('getMinutesInHour',60);
$this->mockengine->setReturnValue('getSecondsInMinute',60);
$this->mockcal = new Mock_Calendar_Second($this);
$this->mockcal->setReturnValue('getEngine',$this->mockengine);
}
function tearDown() {
unset ($this->mockengine);
unset ($this->mocksecond);
}
function testIsValidYear() {
$this->mockcal->setReturnValue('thisYear',2000);
$Validator = & new Calendar_Validator($this->mockcal);
$this->assertTrue($Validator->isValidYear());
}
function testIsValidYearTooSmall() {
$this->mockcal->setReturnValue('thisYear',1969);
$Validator = & new Calendar_Validator($this->mockcal);
$this->assertFalse($Validator->isValidYear());
}
function testIsValidYearTooLarge() {
$this->mockcal->setReturnValue('thisYear',2038);
$Validator = & new Calendar_Validator($this->mockcal);
$this->assertFalse($Validator->isValidYear());
}
function testIsValidMonth() {
$this->mockcal->setReturnValue('thisMonth',10);
$Validator = & new Calendar_Validator($this->mockcal);
$this->assertTrue($Validator->isValidMonth());
}
function testIsValidMonthTooSmall() {
$this->mockcal->setReturnValue('thisMonth',0);
$Validator = & new Calendar_Validator($this->mockcal);
$this->assertFalse($Validator->isValidMonth());
}
function testIsValidMonthTooLarge() {
$this->mockcal->setReturnValue('thisMonth',13);
$Validator = & new Calendar_Validator($this->mockcal);
$this->assertFalse($Validator->isValidMonth());
}
function testIsValidDay() {
$this->mockcal->setReturnValue('thisDay',10);
$Validator = & new Calendar_Validator($this->mockcal);
$this->assertTrue($Validator->isValidDay());
}
function testIsValidDayTooSmall() {
$this->mockcal->setReturnValue('thisDay',0);
$Validator = & new Calendar_Validator($this->mockcal);
$this->assertFalse($Validator->isValidDay());
}
function testIsValidDayTooLarge() {
$this->mockcal->setReturnValue('thisDay',31);
$Validator = & new Calendar_Validator($this->mockcal);
$this->assertFalse($Validator->isValidDay());
}
function testIsValidHour() {
$this->mockcal->setReturnValue('thisHour',10);
$Validator = & new Calendar_Validator($this->mockcal);
$this->assertTrue($Validator->isValidHour());
}
function testIsValidHourTooSmall() {
$this->mockcal->setReturnValue('thisHour',-1);
$Validator = & new Calendar_Validator($this->mockcal);
$this->assertFalse($Validator->isValidHour());
}
function testIsValidHourTooLarge() {
$this->mockcal->setReturnValue('thisHour',24);
$Validator = & new Calendar_Validator($this->mockcal);
$this->assertFalse($Validator->isValidHour());
}
function testIsValidMinute() {
$this->mockcal->setReturnValue('thisMinute',30);
$Validator = & new Calendar_Validator($this->mockcal);
$this->assertTrue($Validator->isValidMinute());
}
function testIsValidMinuteTooSmall() {
$this->mockcal->setReturnValue('thisMinute',-1);
$Validator = & new Calendar_Validator($this->mockcal);
$this->assertFalse($Validator->isValidMinute());
}
function testIsValidMinuteTooLarge() {
$this->mockcal->setReturnValue('thisMinute',60);
$Validator = & new Calendar_Validator($this->mockcal);
$this->assertFalse($Validator->isValidMinute());
}
function testIsValidSecond() {
$this->mockcal->setReturnValue('thisSecond',30);
$Validator = & new Calendar_Validator($this->mockcal);
$this->assertTrue($Validator->isValidSecond());
}
function testIsValidSecondTooSmall() {
$this->mockcal->setReturnValue('thisSecond',-1);
$Validator = & new Calendar_Validator($this->mockcal);
$this->assertFalse($Validator->isValidSecond());
}
function testIsValidSecondTooLarge() {
$this->mockcal->setReturnValue('thisSecond',60);
$Validator = & new Calendar_Validator($this->mockcal);
$this->assertFalse($Validator->isValidSecond());
}
function testIsValid() {
$this->mockcal->setReturnValue('thisYear',2000);
$this->mockcal->setReturnValue('thisMonth',5);
$this->mockcal->setReturnValue('thisDay',15);
$this->mockcal->setReturnValue('thisHour',13);
$this->mockcal->setReturnValue('thisMinute',30);
$this->mockcal->setReturnValue('thisSecond',40);
$Validator = & new Calendar_Validator($this->mockcal);
$this->assertTrue($Validator->isValid());
}
function testIsValidAllWrong() {
$this->mockcal->setReturnValue('thisYear',2038);
$this->mockcal->setReturnValue('thisMonth',13);
$this->mockcal->setReturnValue('thisDay',31);
$this->mockcal->day = 31;
$this->mockcal->setReturnValue('thisHour',24);
$this->mockcal->setReturnValue('thisMinute',60);
$this->mockcal->setReturnValue('thisSecond',60);
$Validator = & new Calendar_Validator($this->mockcal);
$this->assertFalse($Validator->isValid());
$i = 0;
while ( $Validator->fetch() ) {
$i++;
}
$this->assertEqual($i,6);
}
}
 
class TestOfValidatorLive extends UnitTestCase {
function TestOfValidatorLive() {
$this->UnitTestCase('Test of Validator Live');
}
function testYear() {
$Unit = new Calendar_Year(2038);
$Validator = & $Unit->getValidator();
$this->assertFalse($Validator->isValidYear());
}
function testMonth() {
$Unit = new Calendar_Month(2000,13);
$Validator = & $Unit->getValidator();
$this->assertFalse($Validator->isValidMonth());
}
/*
function testWeek() {
$Unit = new Calendar_Week(2000,12,7);
$Validator = & $Unit->getValidator();
$this->assertFalse($Validator->isValidWeek());
}
*/
function testDay() {
$Unit = new Calendar_Day(2000,12,32);
$Validator = & $Unit->getValidator();
$this->assertFalse($Validator->isValidDay());
}
function testHour() {
$Unit = new Calendar_Hour(2000,12,20,24);
$Validator = & $Unit->getValidator();
$this->assertFalse($Validator->isValidHour());
}
function testMinute() {
$Unit = new Calendar_Minute(2000,12,20,23,60);
$Validator = & $Unit->getValidator();
$this->assertFalse($Validator->isValidMinute());
}
function testSecond() {
$Unit = new Calendar_Second(2000,12,20,23,59,60);
$Validator = & $Unit->getValidator();
$this->assertFalse($Validator->isValidSecond());
}
function testAllBad() {
$Unit = new Calendar_Second(2000,13,32,24,60,60);
$this->assertFalse($Unit->isValid());
$Validator = & $Unit->getValidator();
$i = 0;
while ( $Validator->fetch() ) {
$i++;
}
$this->assertEqual($i,5);
}
}
 
if (!defined('TEST_RUNNING')) {
define('TEST_RUNNING', true);
$test = &new TestOfValidator();
$test->run(new HtmlReporter());
$test = &new TestOfValidatorLive();
$test->run(new HtmlReporter());
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/tests/month_test.php
New file
0,0 → 1,119
<?php
// $Id: month_test.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
 
require_once('simple_include.php');
require_once('calendar_include.php');
 
require_once('./calendar_test.php');
 
class TestOfMonth extends TestOfCalendar {
function TestOfMonth() {
$this->UnitTestCase('Test of Month');
}
function setUp() {
$this->cal = new Calendar_Month(2003,10);
}
function testPrevMonth_Object() {
$this->assertEqual(new Calendar_Month(2003, 9), $this->cal->prevMonth('object'));
}
function testPrevDay () {
$this->assertEqual(30,$this->cal->prevDay());
}
function testPrevDay_Array () {
$this->assertEqual(
array(
'year' => 2003,
'month' => 9,
'day' => 30,
'hour' => 0,
'minute' => 0,
'second' => 0),
$this->cal->prevDay('array'));
}
function testThisDay () {
$this->assertEqual(1,$this->cal->thisDay());
}
function testNextDay () {
$this->assertEqual(2,$this->cal->nextDay());
}
function testPrevHour () {
$this->assertEqual(23,$this->cal->prevHour());
}
function testThisHour () {
$this->assertEqual(0,$this->cal->thisHour());
}
function testNextHour () {
$this->assertEqual(1,$this->cal->nextHour());
}
function testPrevMinute () {
$this->assertEqual(59,$this->cal->prevMinute());
}
function testThisMinute () {
$this->assertEqual(0,$this->cal->thisMinute());
}
function testNextMinute () {
$this->assertEqual(1,$this->cal->nextMinute());
}
function testPrevSecond () {
$this->assertEqual(59,$this->cal->prevSecond());
}
function testThisSecond () {
$this->assertEqual(0,$this->cal->thisSecond());
}
function testNextSecond () {
$this->assertEqual(1,$this->cal->nextSecond());
}
function testGetTimeStamp() {
$stamp = mktime(0,0,0,10,1,2003);
$this->assertEqual($stamp,$this->cal->getTimeStamp());
}
}
 
class TestOfMonthBuild extends TestOfMonth {
function TestOfMonthBuild() {
$this->UnitTestCase('Test of Month::build()');
}
function testSize() {
$this->cal->build();
$this->assertEqual(31,$this->cal->size());
}
function testFetch() {
$this->cal->build();
$i=0;
while ( $Child = $this->cal->fetch() ) {
$i++;
}
$this->assertEqual(31,$i);
}
function testFetchAll() {
$this->cal->build();
$children = array();
$i = 1;
while ( $Child = $this->cal->fetch() ) {
$children[$i]=$Child;
$i++;
}
$this->assertEqual($children,$this->cal->fetchAll());
}
function testSelection() {
require_once(CALENDAR_ROOT . 'Day.php');
$selection = array(new Calendar_Day(2003,10,25));
$this->cal->build($selection);
$i = 1;
while ( $Child = $this->cal->fetch() ) {
if ( $i == 25 )
break;
$i++;
}
$this->assertTrue($Child->isSelected());
}
}
 
if (!defined('TEST_RUNNING')) {
define('TEST_RUNNING', true);
$test = &new TestOfMonth();
$test->run(new HtmlReporter());
$test = &new TestOfMonthBuild();
$test->run(new HtmlReporter());
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/tests/decorator_textual_test.php
New file
0,0 → 1,174
<?php
// $Id: decorator_textual_test.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
 
require_once('simple_include.php');
require_once('calendar_include.php');
 
require_once('./decorator_test.php');
 
class TestOfDecoratorTextual extends TestOfDecorator {
function TestOfDecoratorTextual() {
$this->UnitTestCase('Test of Calendar_Decorator_Textual');
}
function testMonthNamesLong() {
$Textual = new Calendar_Decorator_Textual($this->mockcal);
$monthNames = array(
1=>'January',
2=>'February',
3=>'March',
4=>'April',
5=>'May',
6=>'June',
7=>'July',
8=>'August',
9=>'September',
10=>'October',
11=>'November',
12=>'December',
);
$this->assertEqual($monthNames,$Textual->monthNames());
}
function testMonthNamesShort() {
$Textual = new Calendar_Decorator_Textual($this->mockcal);
$monthNames = array(
1=>'Jan',
2=>'Feb',
3=>'Mar',
4=>'Apr',
5=>'May',
6=>'Jun',
7=>'Jul',
8=>'Aug',
9=>'Sep',
10=>'Oct',
11=>'Nov',
12=>'Dec',
);
$this->assertEqual($monthNames,$Textual->monthNames('short'));
}
function testMonthNamesTwo() {
$Textual = new Calendar_Decorator_Textual($this->mockcal);
$monthNames = array(
1=>'Ja',
2=>'Fe',
3=>'Ma',
4=>'Ap',
5=>'Ma',
6=>'Ju',
7=>'Ju',
8=>'Au',
9=>'Se',
10=>'Oc',
11=>'No',
12=>'De',
);
$this->assertEqual($monthNames,$Textual->monthNames('two'));
}
function testMonthNamesOne() {
$Textual = new Calendar_Decorator_Textual($this->mockcal);
$monthNames = array(
1=>'J',
2=>'F',
3=>'M',
4=>'A',
5=>'M',
6=>'J',
7=>'J',
8=>'A',
9=>'S',
10=>'O',
11=>'N',
12=>'D',
);
$this->assertEqual($monthNames,$Textual->monthNames('one'));
}
function testWeekdayNamesLong() {
$Textual = new Calendar_Decorator_Textual($this->mockcal);
$weekdayNames = array(
0=>'Sunday',
1=>'Monday',
2=>'Tuesday',
3=>'Wednesday',
4=>'Thursday',
5=>'Friday',
6=>'Saturday',
);
$this->assertEqual($weekdayNames,$Textual->weekdayNames());
}
function testWeekdayNamesShort() {
$Textual = new Calendar_Decorator_Textual($this->mockcal);
$weekdayNames = array(
0=>'Sun',
1=>'Mon',
2=>'Tue',
3=>'Wed',
4=>'Thu',
5=>'Fri',
6=>'Sat',
);
$this->assertEqual($weekdayNames,$Textual->weekdayNames('short'));
}
function testWeekdayNamesTwo() {
$Textual = new Calendar_Decorator_Textual($this->mockcal);
$weekdayNames = array(
0=>'Su',
1=>'Mo',
2=>'Tu',
3=>'We',
4=>'Th',
5=>'Fr',
6=>'Sa',
);
$this->assertEqual($weekdayNames,$Textual->weekdayNames('two'));
}
function testWeekdayNamesOne() {
$Textual = new Calendar_Decorator_Textual($this->mockcal);
$weekdayNames = array(
0=>'S',
1=>'M',
2=>'T',
3=>'W',
4=>'T',
5=>'F',
6=>'S',
);
$this->assertEqual($weekdayNames,$Textual->weekdayNames('one'));
}
function testPrevMonthNameShort() {
$Textual = new Calendar_Decorator_Textual($this->mockcal);
$this->assertEqual('Sep',$Textual->prevMonthName('short'));
}
function testThisMonthNameShort() {
$Textual = new Calendar_Decorator_Textual($this->mockcal);
$this->assertEqual('Oct',$Textual->thisMonthName('short'));
}
function testNextMonthNameShort() {
$Textual = new Calendar_Decorator_Textual($this->mockcal);
$this->assertEqual('Nov',$Textual->nextMonthName('short'));
}
function testThisDayNameShort() {
$Textual = new Calendar_Decorator_Textual($this->mockcal);
$this->assertEqual('Wed',$Textual->thisDayName('short'));
}
function testOrderedWeekdaysShort() {
$weekdayNames = array(
0=>'Sun',
1=>'Mon',
2=>'Tue',
3=>'Wed',
4=>'Thu',
5=>'Fri',
6=>'Sat',
);
$Textual = new Calendar_Decorator_Textual($this->mockcal);
$this->assertEqual($weekdayNames,$Textual->orderedWeekdays('short'));
}
 
}
 
if (!defined('TEST_RUNNING')) {
define('TEST_RUNNING', true);
$test = &new TestOfDecoratorTextual();
$test->run(new HtmlReporter());
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/tests/week_test.php
New file
0,0 → 1,226
<?php
// $Id: week_test.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
 
require_once('simple_include.php');
require_once('calendar_include.php');
 
require_once('./calendar_test.php');
 
class TestOfWeek extends TestOfCalendar {
function TestOfWeek() {
$this->UnitTestCase('Test of Week');
}
function setUp() {
$this->cal = new Calendar_Week(2003, 10, 9, 1); //force firstDay = monday
//print_r($this->cal);
}
function testPrevDay () {
$this->assertEqual(8, $this->cal->prevDay());
}
function testPrevDay_Array () {
$this->assertEqual(
array(
'year' => 2003,
'month' => 10,
'day' => 8,
'hour' => 0,
'minute' => 0,
'second' => 0),
$this->cal->prevDay('array'));
}
function testThisDay () {
$this->assertEqual(9, $this->cal->thisDay());
}
function testNextDay () {
$this->assertEqual(10, $this->cal->nextDay());
}
function testPrevHour () {
$this->assertEqual(23, $this->cal->prevHour());
}
function testThisHour () {
$this->assertEqual(0, $this->cal->thisHour());
}
function testNextHour () {
$this->assertEqual(1, $this->cal->nextHour());
}
function testPrevMinute () {
$this->assertEqual(59, $this->cal->prevMinute());
}
function testThisMinute () {
$this->assertEqual(0, $this->cal->thisMinute());
}
function testNextMinute () {
$this->assertEqual(1, $this->cal->nextMinute());
}
function testPrevSecond () {
$this->assertEqual(59, $this->cal->prevSecond());
}
function testThisSecond () {
$this->assertEqual(0, $this->cal->thisSecond());
}
function testNextSecond () {
$this->assertEqual(1, $this->cal->nextSecond());
}
function testGetTimeStamp() {
$stamp = mktime(0,0,0,10,9,2003);
$this->assertEqual($stamp,$this->cal->getTimeStamp());
}
function testNewTimeStamp() {
$stamp = mktime(0,0,0,7,28,2004);
$this->cal->setTimestamp($stamp);
$this->assertEqual('30 2004', date('W Y', $this->cal->prevWeek(true)));
$this->assertEqual('31 2004', date('W Y', $this->cal->thisWeek(true)));
$this->assertEqual('32 2004', date('W Y', $this->cal->nextWeek(true)));
}
function testPrevWeekInMonth() {
$this->assertEqual(1, $this->cal->prevWeek());
}
function testThisWeekInMonth() {
$this->assertEqual(2, $this->cal->thisWeek());
}
function testNextWeekInMonth() {
$this->assertEqual(3, $this->cal->nextWeek());
}
function testPrevWeekInYear() {
$this->assertEqual(40, $this->cal->prevWeek('n_in_year'));
}
function testThisWeekInYear() {
$this->assertEqual(41, $this->cal->thisWeek('n_in_year'));
}
function testNextWeekInYear() {
$this->assertEqual(42, $this->cal->nextWeek('n_in_year'));
}
function testPrevWeekArray() {
$testArray = array(
'year'=>2003,
'month'=>9,
'day'=>29,
'hour'=>0,
'minute'=>0,
'second'=>0
);
$this->assertEqual($testArray, $this->cal->prevWeek('array'));
}
function testThisWeekArray() {
$testArray = array(
'year'=>2003,
'month'=>10,
'day'=>6,
'hour'=>0,
'minute'=>0,
'second'=>0
);
$this->assertEqual($testArray, $this->cal->thisWeek('array'));
}
function testNextWeekArray() {
$testArray = array(
'year'=>2003,
'month'=>10,
'day'=>13,
'hour'=>0,
'minute'=>0,
'second'=>0
);
$this->assertEqual($testArray, $this->cal->nextWeek('array'));
}
function testPrevWeekObject() {
$testWeek = new Calendar_Week(2003,9,29);
$Week = $this->cal->prevWeek('object');
$this->assertEqual($testWeek->getTimeStamp(),$Week->getTimeStamp());
}
function testThisWeekObject() {
$testWeek = new Calendar_Week(2003,10,6);
$Week = $this->cal->thisWeek('object');
$this->assertEqual($testWeek->getTimeStamp(),$Week->getTimeStamp());
}
function testNextWeekObject() {
$testWeek = new Calendar_Week(2003,10,13);
$Week = $this->cal->nextWeek('object');
$this->assertEqual($testWeek->getTimeStamp(),$Week->getTimeStamp());
}
}
 
class TestOfWeekBuild extends TestOfWeek {
function TestOfWeekBuild() {
$this->UnitTestCase('Test of Week::build()');
}
function testSize() {
$this->cal->build();
$this->assertEqual(7, $this->cal->size());
}
 
function testFetch() {
$this->cal->build();
$i=0;
while ($Child = $this->cal->fetch()) {
$i++;
}
$this->assertEqual(7, $i);
}
function testFetchAll() {
$this->cal->build();
$children = array();
$i = 1;
while ( $Child = $this->cal->fetch() ) {
$children[$i]=$Child;
$i++;
}
$this->assertEqual($children,$this->cal->fetchAll());
}
 
function testSelection() {
require_once(CALENDAR_ROOT . 'Day.php');
$selection = array(new Calendar_Day(2003, 10, 7));
$this->cal->build($selection);
$i = 1;
while ($Child = $this->cal->fetch()) {
if ($i == 2) {
break; //07-10-2003 is the 2nd day of the week
}
$i++;
}
$this->assertTrue($Child->isSelected());
}
function testSelectionCornerCase() {
require_once(CALENDAR_ROOT . 'Day.php');
+
+
+
+
+
+
+
+ new Calendar_Day(2004, 01, 03)
+ );
+ $this->cal = new Calendar_Week(2003, 12, 31, 0);
+
+
+ $this->assertTrue($Day->isSelected());
+ }
+
+
+
+ $this->assertTrue($Day->isSelected());
+ }
+ }
+}
+if (!defined('TEST_RUNNING')) {
+ define('TEST_RUNNING', true);
+ $test = &new TestOfWeek();
+ $test->run(new HtmlReporter());
+ $test = &new TestOfWeekBuild();
+ $test->run(new HtmlReporter());
+}
+?>
\ No newline at end of file
/tags/Racine_livraison_narmer/api/pear/Calendar/tests/all_tests.php
New file
0,0 → 1,34
<?php
// $Id: all_tests.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
 
require_once('simple_include.php');
require_once('calendar_include.php');
 
define("TEST_RUNNING", true);
 
require_once('./calendar_tests.php');
require_once('./calendar_tabular_tests.php');
require_once('./validator_tests.php');
require_once('./calendar_engine_tests.php');
require_once('./calendar_engine_tests.php');
require_once('./table_helper_tests.php');
require_once('./decorator_tests.php');
require_once('./util_tests.php');
 
 
class AllTests extends GroupTest {
function AllTests() {
$this->GroupTest('All PEAR::Calendar Tests');
$this->AddTestCase(new CalendarTests());
$this->AddTestCase(new CalendarTabularTests());
$this->AddTestCase(new ValidatorTests());
$this->AddTestCase(new CalendarEngineTests());
$this->AddTestCase(new TableHelperTests());
$this->AddTestCase(new DecoratorTests());
$this->AddTestCase(new UtilTests());
}
}
 
$test = &new AllTests();
$test->run(new HtmlReporter());
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/tests/calendar_tests.php
New file
0,0 → 1,25
<?php
// $Id: calendar_tests.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
 
require_once('simple_include.php');
require_once('calendar_include.php');
 
class CalendarTests extends GroupTest {
function CalendarTests() {
$this->GroupTest('Calendar Tests');
$this->addTestFile('calendar_test.php');
$this->addTestFile('year_test.php');
$this->addTestFile('month_test.php');
$this->addTestFile('day_test.php');
$this->addTestFile('hour_test.php');
$this->addTestFile('minute_test.php');
$this->addTestFile('second_test.php');
}
}
 
if (!defined('TEST_RUNNING')) {
define('TEST_RUNNING', true);
$test = &new CalendarTests();
$test->run(new HtmlReporter());
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/tests/util_uri_test.php
New file
0,0 → 1,54
<?php
// $Id: util_uri_test.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
 
require_once('simple_include.php');
require_once('calendar_include.php');
 
Mock::generate('Calendar_Day','Mock_Calendar_Day');
Mock::generate('Calendar_Engine_Interface','Mock_Calendar_Engine');
 
class TestOfUtilUri extends UnitTestCase {
 
var $MockCal;
function TestOfUtilUri() {
$this->UnitTestCase('Test of Calendar_Util_Uri');
}
function setUp() {
$this->MockCal = & new Mock_Calendar_Day($this);
$this->MockCal->setReturnValue('getEngine',new Mock_Calendar_Engine($this));
}
function testFragments() {
$Uri = new Calendar_Util_Uri('y','m','d','h','m','s');
$Uri->setFragments('year','month','day','hour','minute','second');
$this->assertEqual(
'year=&amp;month=&amp;day=&amp;hour=&amp;minute=&amp;second=',
$Uri->this($this->MockCal, 'second')
);
}
function testScalarFragments() {
$Uri = new Calendar_Util_Uri('year','month','day','hour','minute','second');
$Uri->scalar = true;
$this->assertEqual(
'&amp;&amp;&amp;&amp;&amp;',
$Uri->this($this->MockCal, 'second')
);
}
function testSetSeperator() {
$Uri = new Calendar_Util_Uri('year','month','day','hour','minute','second');
$Uri->separator = '/';
$this->assertEqual(
'year=/month=/day=/hour=/minute=/second=',
$Uri->this($this->MockCal, 'second')
);
}
}
 
if (!defined('TEST_RUNNING')) {
define('TEST_RUNNING', true);
$test = &new TestOfUtilUri();
$test->run(new HtmlReporter());
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/tests/simple_include.php
New file
0,0 → 1,10
<?php
// $Id: simple_include.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
if (!defined('SIMPLE_TEST')) {
define('SIMPLE_TEST', '../../../simpletest/');
}
 
require_once(SIMPLE_TEST . 'unit_tester.php');
require_once(SIMPLE_TEST . 'reporter.php');
require_once(SIMPLE_TEST . 'mock_objects.php');
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/tests/validator_error_test.php
New file
0,0 → 1,34
<?php
// $Id: validator_error_test.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
 
require_once('simple_include.php');
require_once('calendar_include.php');
 
class TestOfValidationError extends UnitTestCase {
var $vError;
function TestOfValidationError() {
$this->UnitTestCase('Test of Validation Error');
}
function setUp() {
$this->vError = new Calendar_Validation_Error('foo',20,'bar');
}
function testGetUnit() {
$this->assertEqual($this->vError->getUnit(),'foo');
}
function testGetValue() {
$this->assertEqual($this->vError->getValue(),20);
}
function testGetMessage() {
$this->assertEqual($this->vError->getMessage(),'bar');
}
function testToString() {
$this->assertEqual($this->vError->toString(),'foo = 20 [bar]');
}
}
 
if (!defined('TEST_RUNNING')) {
define('TEST_RUNNING', true);
$test = &new TestOfValidationError();
$test->run(new HtmlReporter());
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/tests/util_tests.php
New file
0,0 → 1,20
<?php
// $Id: util_tests.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
 
require_once('simple_include.php');
require_once('calendar_include.php');
 
class UtilTests extends GroupTest {
function UtilTests() {
$this->GroupTest('Util Tests');
$this->addTestFile('util_uri_test.php');
$this->addTestFile('util_textual_test.php');
}
}
 
if (!defined('TEST_RUNNING')) {
define('TEST_RUNNING', true);
$test = &new UtilTests();
$test->run(new HtmlReporter());
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/tests/year_test.php
New file
0,0 → 1,142
<?php
// $Id: year_test.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
 
require_once('simple_include.php');
require_once('calendar_include.php');
 
require_once('./calendar_test.php');
 
class TestOfYear extends TestOfCalendar {
function TestOfYear() {
$this->UnitTestCase('Test of Year');
}
function setUp() {
$this->cal = new Calendar_Year(2003);
}
function testPrevYear_Object() {
$this->assertEqual(new Calendar_Year(2002), $this->cal->prevYear('object'));
}
function testThisYear_Object() {
$this->assertEqual(new Calendar_Year(2003), $this->cal->thisYear('object'));
}
function testPrevMonth () {
$this->assertEqual(12,$this->cal->prevMonth());
}
function testPrevMonth_Array () {
$this->assertEqual(
array(
'year' => 2002,
'month' => 12,
'day' => 1,
'hour' => 0,
'minute' => 0,
'second' => 0),
$this->cal->prevMonth('array'));
}
function testThisMonth () {
$this->assertEqual(1,$this->cal->thisMonth());
}
function testNextMonth () {
$this->assertEqual(2,$this->cal->nextMonth());
}
function testPrevDay () {
$this->assertEqual(31,$this->cal->prevDay());
}
function testPrevDay_Array () {
$this->assertEqual(
array(
'year' => 2002,
'month' => 12,
'day' => 31,
'hour' => 0,
'minute' => 0,
'second' => 0),
$this->cal->prevDay('array'));
}
function testThisDay () {
$this->assertEqual(1,$this->cal->thisDay());
}
function testNextDay () {
$this->assertEqual(2,$this->cal->nextDay());
}
function testPrevHour () {
$this->assertEqual(23,$this->cal->prevHour());
}
function testThisHour () {
$this->assertEqual(0,$this->cal->thisHour());
}
function testNextHour () {
$this->assertEqual(1,$this->cal->nextHour());
}
function testPrevMinute () {
$this->assertEqual(59,$this->cal->prevMinute());
}
function testThisMinute () {
$this->assertEqual(0,$this->cal->thisMinute());
}
function testNextMinute () {
$this->assertEqual(1,$this->cal->nextMinute());
}
function testPrevSecond () {
$this->assertEqual(59,$this->cal->prevSecond());
}
function testThisSecond () {
$this->assertEqual(0,$this->cal->thisSecond());
}
function testNextSecond () {
$this->assertEqual(1,$this->cal->nextSecond());
}
function testGetTimeStamp() {
$stamp = mktime(0,0,0,1,1,2003);
$this->assertEqual($stamp,$this->cal->getTimeStamp());
}
}
 
class TestOfYearBuild extends TestOfYear {
function TestOfYearBuild() {
$this->UnitTestCase('Test of Year::build()');
}
function testSize() {
$this->cal->build();
$this->assertEqual(12,$this->cal->size());
}
function testFetch() {
$this->cal->build();
$i=0;
while ( $Child = $this->cal->fetch() ) {
$i++;
}
$this->assertEqual(12,$i);
}
function testFetchAll() {
$this->cal->build();
$children = array();
$i = 1;
while ( $Child = $this->cal->fetch() ) {
$children[$i]=$Child;
$i++;
}
$this->assertEqual($children,$this->cal->fetchAll());
}
function testSelection() {
require_once(CALENDAR_ROOT . 'Month.php');
$selection = array(new Calendar_Month(2003,10));
$this->cal->build($selection);
$i = 1;
while ( $Child = $this->cal->fetch() ) {
if ( $i == 10 )
break;
$i++;
}
$this->assertTrue($Child->isSelected());
}
}
 
if (!defined('TEST_RUNNING')) {
define('TEST_RUNNING', true);
$test = &new TestOfYear();
$test->run(new HtmlReporter());
$test = &new TestOfYearBuild();
$test->run(new HtmlReporter());
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/tests/minute_test.php
New file
0,0 → 1,99
<?php
// $Id: minute_test.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
 
require_once('simple_include.php');
require_once('calendar_include.php');
 
require_once('./calendar_test.php');
 
class TestOfMinute extends TestOfCalendar {
function TestOfMinute() {
$this->UnitTestCase('Test of Minute');
}
function setUp() {
$this->cal = new Calendar_Minute(2003,10,25,13,32);
}
function testPrevDay_Array () {
$this->assertEqual(
array(
'year' => 2003,
'month' => 10,
'day' => 24,
'hour' => 0,
'minute' => 0,
'second' => 0),
$this->cal->prevDay('array'));
}
function testPrevSecond () {
$this->assertEqual(59,$this->cal->prevSecond());
}
function testThisSecond () {
$this->assertEqual(0,$this->cal->thisSecond());
}
function testThisSecond_Timestamp () {
$this->assertEqual($this->cal->cE->dateToStamp(
2003, 10, 25, 13, 32, 0),
$this->cal->thisSecond('timestamp'));
}
function testNextSecond () {
$this->assertEqual(1,$this->cal->nextSecond());
}
function testNextSecond_Timestamp () {
$this->assertEqual($this->cal->cE->dateToStamp(
2003, 10, 25, 13, 32, 1),
$this->cal->nextSecond('timestamp'));
}
function testGetTimeStamp() {
$stamp = mktime(13,32,0,10,25,2003);
$this->assertEqual($stamp,$this->cal->getTimeStamp());
}
}
 
class TestOfMinuteBuild extends TestOfMinute {
function TestOfMinuteBuild() {
$this->UnitTestCase('Test of Minute::build()');
}
function testSize() {
$this->cal->build();
$this->assertEqual(60,$this->cal->size());
}
function testFetch() {
$this->cal->build();
$i=0;
while ( $Child = $this->cal->fetch() ) {
$i++;
}
$this->assertEqual(60,$i);
}
function testFetchAll() {
$this->cal->build();
$children = array();
$i = 0;
while ( $Child = $this->cal->fetch() ) {
$children[$i]=$Child;
$i++;
}
$this->assertEqual($children,$this->cal->fetchAll());
}
function testSelection() {
require_once(CALENDAR_ROOT . 'Second.php');
$selection = array(new Calendar_Second(2003,10,25,13,32,43));
$this->cal->build($selection);
$i = 0;
while ( $Child = $this->cal->fetch() ) {
if ( $i == 43 )
break;
$i++;
}
$this->assertTrue($Child->isSelected());
}
}
 
if (!defined('TEST_RUNNING')) {
define('TEST_RUNNING', true);
$test = &new TestOfMinute();
$test->run(new HtmlReporter());
$test = &new TestOfMinuteBuild();
$test->run(new HtmlReporter());
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/tests/decorator_uri_test.php
New file
0,0 → 1,37
<?php
// $Id: decorator_uri_test.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
 
require_once('simple_include.php');
require_once('calendar_include.php');
 
require_once('./decorator_test.php');
 
class TestOfDecoratorUri extends TestOfDecorator {
function TestOfDecoratorUri() {
$this->UnitTestCase('Test of Calendar_Decorator_Uri');
}
function testFragments() {
$Uri = new Calendar_Decorator_Uri($this->mockcal);
$Uri->setFragments('year','month','day','hour','minute','second');
$this->assertEqual('year=&amp;month=&amp;day=&amp;hour=&amp;minute=&amp;second=',$Uri->this('second'));
}
function testScalarFragments() {
$Uri = new Calendar_Decorator_Uri($this->mockcal);
$Uri->setFragments('year','month','day','hour','minute','second');
$Uri->setScalar();
$this->assertEqual('&amp;&amp;&amp;&amp;&amp;',$Uri->this('second'));
}
function testSetSeperator() {
$Uri = new Calendar_Decorator_Uri($this->mockcal);
$Uri->setFragments('year','month','day','hour','minute','second');
$Uri->setSeparator('/');
$this->assertEqual('year=/month=/day=/hour=/minute=/second=',$Uri->this('second'));
}
}
 
if (!defined('TEST_RUNNING')) {
define('TEST_RUNNING', true);
$test = &new TestOfDecoratorUri();
$test->run(new HtmlReporter());
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/tests/decorator_tests.php
New file
0,0 → 1,21
<?php
// $Id: decorator_tests.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
 
require_once('simple_include.php');
require_once('calendar_include.php');
 
class DecoratorTests extends GroupTest {
function DecoratorTests() {
$this->GroupTest('Decorator Tests');
$this->addTestFile('decorator_test.php');
$this->addTestFile('decorator_textual_test.php');
$this->addTestFile('decorator_uri_test.php');
}
}
 
if (!defined('TEST_RUNNING')) {
define('TEST_RUNNING', true);
$test = &new DecoratorTests();
$test->run(new HtmlReporter());
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/tests/calendar_tabular_tests.php
New file
0,0 → 1,21
<?php
// $Id: calendar_tabular_tests.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
 
require_once('simple_include.php');
require_once('calendar_include.php');
 
class CalendarTabularTests extends GroupTest {
function CalendarTabularTests() {
$this->GroupTest('Calendar Tabular Tests');
$this->addTestFile('month_weekdays_test.php');
$this->addTestFile('month_weeks_test.php');
$this->addTestFile('week_test.php');
}
}
 
if (!defined('TEST_RUNNING')) {
define('TEST_RUNNING', true);
$test = &new CalendarTabularTests();
$test->run(new HtmlReporter());
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/tests/README
New file
0,0 → 1,7
These tests require Simple Test: http://www.lastcraft.com/simple_test.php
 
Ideally they would use PEAR::PHPUnit but the current version has bugs and
lacks alot of the functionality (e.g. Mock Objects) which Simple Test
provides.
 
Modifying the simple_include.php script for your simple test install dir
/tags/Racine_livraison_narmer/api/pear/Calendar/tests/validator_tests.php
New file
0,0 → 1,20
<?php
// $Id: validator_tests.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
 
require_once('simple_include.php');
require_once('calendar_include.php');
 
class ValidatorTests extends GroupTest {
function ValidatorTests() {
$this->GroupTest('Validator Tests');
$this->addTestFile('validator_unit_test.php');
$this->addTestFile('validator_error_test.php');
}
}
 
if (!defined('TEST_RUNNING')) {
define('TEST_RUNNING', true);
$test = &new ValidatorTests();
$test->run(new HtmlReporter());
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/tests/calendar_test.php
New file
0,0 → 1,115
<?php
// $Id: calendar_test.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
 
require_once('simple_include.php');
require_once('calendar_include.php');
 
class TestOfCalendar extends UnitTestCase {
var $cal;
function TestOfCalendar($name='Test of Calendar') {
$this->UnitTestCase($name);
}
function setUp() {
$this->cal = new Calendar(2003,10,25,13,32,43);
}
function tearDown() {
unset($this->cal);
}
function testPrevYear () {
$this->assertEqual(2002,$this->cal->prevYear());
}
function testPrevYear_Array () {
$this->assertEqual(
array(
'year' => 2002,
'month' => 1,
'day' => 1,
'hour' => 0,
'minute' => 0,
'second' => 0),
$this->cal->prevYear('array'));
}
function testThisYear () {
$this->assertEqual(2003,$this->cal->thisYear());
}
function testNextYear () {
$this->assertEqual(2004,$this->cal->nextYear());
}
function testPrevMonth () {
$this->assertEqual(9,$this->cal->prevMonth());
}
function testPrevMonth_Array () {
$this->assertEqual(
array(
'year' => 2003,
'month' => 9,
'day' => 1,
'hour' => 0,
'minute' => 0,
'second' => 0),
$this->cal->prevMonth('array'));
}
function testThisMonth () {
$this->assertEqual(10,$this->cal->thisMonth());
}
function testNextMonth () {
$this->assertEqual(11,$this->cal->nextMonth());
}
function testPrevDay () {
$this->assertEqual(24,$this->cal->prevDay());
}
function testPrevDay_Array () {
$this->assertEqual(
array(
'year' => 2003,
'month' => 10,
'day' => 24,
'hour' => 0,
'minute' => 0,
'second' => 0),
$this->cal->prevDay('array'));
}
function testThisDay () {
$this->assertEqual(25,$this->cal->thisDay());
}
function testNextDay () {
$this->assertEqual(26,$this->cal->nextDay());
}
function testPrevHour () {
$this->assertEqual(12,$this->cal->prevHour());
}
function testThisHour () {
$this->assertEqual(13,$this->cal->thisHour());
}
function testNextHour () {
$this->assertEqual(14,$this->cal->nextHour());
}
function testPrevMinute () {
$this->assertEqual(31,$this->cal->prevMinute());
}
function testThisMinute () {
$this->assertEqual(32,$this->cal->thisMinute());
}
function testNextMinute () {
$this->assertEqual(33,$this->cal->nextMinute());
}
function testPrevSecond () {
$this->assertEqual(42,$this->cal->prevSecond());
}
function testThisSecond () {
$this->assertEqual(43,$this->cal->thisSecond());
}
function testNextSecond () {
$this->assertEqual(44,$this->cal->nextSecond());
}
function testSetTimeStamp() {
$stamp = mktime(13,32,43,10,25,2003);
$this->cal->setTimeStamp($stamp);
$this->assertEqual($stamp,$this->cal->getTimeStamp());
}
function testGetTimeStamp() {
$stamp = mktime(13,32,43,10,25,2003);
$this->assertEqual($stamp,$this->cal->getTimeStamp());
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/tests/table_helper_tests.php
New file
0,0 → 1,19
<?php
// $Id: table_helper_tests.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
 
require_once('simple_include.php');
require_once('calendar_include.php');
 
class TableHelperTests extends GroupTest {
function TableHelperTests() {
$this->GroupTest('Table Helper Tests');
$this->addTestFile('helper_test.php');
}
}
 
if (!defined('TEST_RUNNING')) {
define('TEST_RUNNING', true);
$test = &new TableHelperTests();
$test->run(new HtmlReporter());
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/tests/peardate_engine_test.php
New file
0,0 → 1,124
<?php
// $Id: peardate_engine_test.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
 
require_once('simple_include.php');
require_once('calendar_include.php');
 
class TestOfPearDateEngine extends UnitTestCase {
var $engine;
function TestOfPearDateEngine() {
$this->UnitTestCase('Test of Calendar_Engine_PearDate');
}
function setUp() {
$this->engine = new Calendar_Engine_PearDate();
}
function testGetSecondsInMinute() {
$this->assertEqual($this->engine->getSecondsInMinute(),60);
}
function testGetMinutesInHour() {
$this->assertEqual($this->engine->getMinutesInHour(),60);
}
function testGetHoursInDay() {
$this->assertEqual($this->engine->getHoursInDay(),24);
}
function testGetFirstDayOfWeek() {
$this->assertEqual($this->engine->getFirstDayOfWeek(),1);
}
function testGetWeekDays() {
$this->assertEqual($this->engine->getWeekDays(),array(0,1,2,3,4,5,6));
}
function testGetDaysInWeek() {
$this->assertEqual($this->engine->getDaysInWeek(),7);
}
function testGetWeekNInYear() {
$this->assertEqual($this->engine->getWeekNInYear(2003, 11, 3), 45);
}
function testGetWeekNInMonth() {
$this->assertEqual($this->engine->getWeekNInMonth(2003, 11, 3), 2);
}
function testGetWeeksInMonth0() {
$this->assertEqual($this->engine->getWeeksInMonth(2003, 11, 0), 6); //week starts on sunday
}
function testGetWeeksInMonth1() {
$this->assertEqual($this->engine->getWeeksInMonth(2003, 11, 1), 5); //week starts on monday
}
function testGetWeeksInMonth2() {
$this->assertEqual($this->engine->getWeeksInMonth(2003, 2, 6), 4); //week starts on saturday
}
function testGetWeeksInMonth3() {
// Unusual cases that can cause fails (shows up with example 21.php)
$this->assertEqual($this->engine->getWeeksInMonth(2004,2,1),5);
$this->assertEqual($this->engine->getWeeksInMonth(2004,8,1),6);
}
function testGetDayOfWeek() {
$this->assertEqual($this->engine->getDayOfWeek(2003, 11, 18), 2);
}
function testGetFirstDayInMonth() {
$this->assertEqual($this->engine->getFirstDayInMonth(2003,10),3);
}
function testGetDaysInMonth() {
$this->assertEqual($this->engine->getDaysInMonth(2003,10),31);
}
function testGetMinYears() {
$this->assertEqual($this->engine->getMinYears(),0);
}
function testGetMaxYears() {
$this->assertEqual($this->engine->getMaxYears(),9999);
}
function testDateToStamp() {
$stamp = '2003-10-15 13:30:45';
$this->assertEqual($this->engine->dateToStamp(2003,10,15,13,30,45),$stamp);
}
function testStampToSecond() {
$stamp = '2003-10-15 13:30:45';
$this->assertEqual($this->engine->stampToSecond($stamp),45);
}
function testStampToMinute() {
$stamp = '2003-10-15 13:30:45';
$this->assertEqual($this->engine->stampToMinute($stamp),30);
}
function testStampToHour() {
$stamp = '2003-10-15 13:30:45';
$this->assertEqual($this->engine->stampToHour($stamp),13);
}
function testStampToDay() {
$stamp = '2003-10-15 13:30:45';
$this->assertEqual($this->engine->stampToDay($stamp),15);
}
function testStampToMonth() {
$stamp = '2003-10-15 13:30:45';
$this->assertEqual($this->engine->stampToMonth($stamp),10);
}
function testStampToYear() {
$stamp = '2003-10-15 13:30:45';
$this->assertEqual($this->engine->stampToYear($stamp),2003);
}
function testAdjustDate() {
$stamp = '2004-01-01 13:30:45';
$y = $this->engine->stampToYear($stamp);
$m = $this->engine->stampToMonth($stamp);
$d = $this->engine->stampToDay($stamp);
 
//the first day of the month should be thursday
$this->assertEqual($this->engine->getDayOfWeek($y, $m, $d), 4);
 
$m--; // 2004-00-01 => 2003-12-01
$this->engine->adjustDate($y, $m, $d, $dummy, $dummy, $dummy);
 
$this->assertEqual($y, 2003);
$this->assertEqual($m, 12);
$this->assertEqual($d, 1);
 
// get last day and check if it's wednesday
$d = $this->engine->getDaysInMonth($y, $m);
 
$this->assertEqual($this->engine->getDayOfWeek($y, $m, $d), 3);
}
}
 
if (!defined('TEST_RUNNING')) {
define('TEST_RUNNING', true);
$test = &new TestOfPearDateEngine();
$test->run(new HtmlReporter());
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/tests/second_test.php
New file
0,0 → 1,34
<?php
// $Id: second_test.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
 
require_once('simple_include.php');
require_once('calendar_include.php');
 
require_once('./calendar_test.php');
 
class TestOfSecond extends TestOfCalendar {
function TestOfSecond() {
$this->UnitTestCase('Test of Second');
}
function setUp() {
$this->cal = new Calendar_Second(2003,10,25,13,32,43);
}
function testPrevDay_Array () {
$this->assertEqual(
array(
'year' => 2003,
'month' => 10,
'day' => 24,
'hour' => 0,
'minute' => 0,
'second' => 0),
$this->cal->prevDay('array'));
}
}
 
if (!defined('TEST_RUNNING')) {
define('TEST_RUNNING', true);
$test = &new TestOfSecond();
$test->run(new HtmlReporter());
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/tests/calendar_include.php
New file
0,0 → 1,28
<?php
// $Id: calendar_include.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
if ( !@include 'Calendar/Calendar.php' ) {
@define('CALENDAR_ROOT','../');
}
require_once(CALENDAR_ROOT . 'Year.php');
require_once(CALENDAR_ROOT . 'Month.php');
require_once(CALENDAR_ROOT . 'Day.php');
require_once(CALENDAR_ROOT . 'Week.php');
require_once(CALENDAR_ROOT . 'Hour.php');
require_once(CALENDAR_ROOT . 'Minute.php');
require_once(CALENDAR_ROOT . 'Second.php');
require_once(CALENDAR_ROOT . 'Month.php');
require_once(CALENDAR_ROOT . 'Decorator.php');
require_once(CALENDAR_ROOT . 'Month/Weekdays.php');
require_once(CALENDAR_ROOT . 'Month/Weeks.php');
require_once(CALENDAR_ROOT . 'Validator.php');
require_once(CALENDAR_ROOT . 'Engine/Interface.php');
require_once(CALENDAR_ROOT . 'Engine/UnixTs.php');
require_once(CALENDAR_ROOT . 'Engine/PearDate.php');
require_once(CALENDAR_ROOT . 'Table/Helper.php');
require_once(CALENDAR_ROOT . 'Decorator/Textual.php');
require_once(CALENDAR_ROOT . 'Decorator/Uri.php');
require_once(CALENDAR_ROOT . 'Decorator/Weekday.php');
require_once(CALENDAR_ROOT . 'Decorator/Wrapper.php');
require_once(CALENDAR_ROOT . 'Util/Uri.php');
require_once(CALENDAR_ROOT . 'Util/Textual.php');
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/tests/day_test.php
New file
0,0 → 1,107
<?php
// $Id: day_test.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
 
require_once('simple_include.php');
require_once('calendar_include.php');
 
require_once('./calendar_test.php');
 
class TestOfDay extends TestOfCalendar {
function TestOfDay() {
$this->UnitTestCase('Test of Day');
}
function setUp() {
$this->cal = new Calendar_Day(2003,10,25);
}
function testPrevDay_Array () {
$this->assertEqual(
array(
'year' => 2003,
'month' => 10,
'day' => 24,
'hour' => 0,
'minute' => 0,
'second' => 0),
$this->cal->prevDay('array'));
}
function testPrevHour () {
$this->assertEqual(23,$this->cal->prevHour());
}
function testThisHour () {
$this->assertEqual(0,$this->cal->thisHour());
}
function testNextHour () {
$this->assertEqual(1,$this->cal->nextHour());
}
function testPrevMinute () {
$this->assertEqual(59,$this->cal->prevMinute());
}
function testThisMinute () {
$this->assertEqual(0,$this->cal->thisMinute());
}
function testNextMinute () {
$this->assertEqual(1,$this->cal->nextMinute());
}
function testPrevSecond () {
$this->assertEqual(59,$this->cal->prevSecond());
}
function testThisSecond () {
$this->assertEqual(0,$this->cal->thisSecond());
}
function testNextSecond () {
$this->assertEqual(1,$this->cal->nextSecond());
}
function testGetTimeStamp() {
$stamp = mktime(0,0,0,10,25,2003);
$this->assertEqual($stamp,$this->cal->getTimeStamp());
}
}
 
class TestOfDayBuild extends TestOfDay {
function TestOfDayBuild() {
$this->UnitTestCase('Test of Day::build()');
}
function testSize() {
$this->cal->build();
$this->assertEqual(24,$this->cal->size());
}
function testFetch() {
$this->cal->build();
$i=0;
while ( $Child = $this->cal->fetch() ) {
$i++;
}
$this->assertEqual(24,$i);
}
function testFetchAll() {
$this->cal->build();
$children = array();
$i = 0;
while ( $Child = $this->cal->fetch() ) {
$children[$i]=$Child;
$i++;
}
$this->assertEqual($children,$this->cal->fetchAll());
}
function testSelection() {
require_once(CALENDAR_ROOT . 'Hour.php');
$selection = array(new Calendar_Hour(2003,10,25,13));
$this->cal->build($selection);
$i = 0;
while ( $Child = $this->cal->fetch() ) {
if ( $i == 13 )
break;
$i++;
}
$this->assertTrue($Child->isSelected());
}
}
 
if (!defined('TEST_RUNNING')) {
define('TEST_RUNNING', true);
$test = &new TestOfDay();
$test->run(new HtmlReporter());
$test = &new TestOfDayBuild();
$test->run(new HtmlReporter());
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/tests/hour_test.php
New file
0,0 → 1,98
<?php
// $Id: hour_test.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
 
require_once('simple_include.php');
require_once('calendar_include.php');
 
require_once('./calendar_test.php');
 
class TestOfHour extends TestOfCalendar {
function TestOfHour() {
$this->UnitTestCase('Test of Hour');
}
function setUp() {
$this->cal = new Calendar_Hour(2003,10,25,13);
}
function testPrevDay_Array () {
$this->assertEqual(
array(
'year' => 2003,
'month' => 10,
'day' => 24,
'hour' => 0,
'minute' => 0,
'second' => 0),
$this->cal->prevDay('array'));
}
function testPrevMinute () {
$this->assertEqual(59,$this->cal->prevMinute());
}
function testThisMinute () {
$this->assertEqual(0,$this->cal->thisMinute());
}
function testNextMinute () {
$this->assertEqual(1,$this->cal->nextMinute());
}
function testPrevSecond () {
$this->assertEqual(59,$this->cal->prevSecond());
}
function testThisSecond () {
$this->assertEqual(0,$this->cal->thisSecond());
}
function testNextSecond () {
$this->assertEqual(1,$this->cal->nextSecond());
}
function testGetTimeStamp() {
$stamp = mktime(13,0,0,10,25,2003);
$this->assertEqual($stamp,$this->cal->getTimeStamp());
}
}
 
class TestOfHourBuild extends TestOfHour {
function TestOfHourBuild() {
$this->UnitTestCase('Test of Hour::build()');
}
function testSize() {
$this->cal->build();
$this->assertEqual(60,$this->cal->size());
}
function testFetch() {
$this->cal->build();
$i=0;
while ( $Child = $this->cal->fetch() ) {
$i++;
}
$this->assertEqual(60,$i);
}
function testFetchAll() {
$this->cal->build();
$children = array();
$i = 0;
while ( $Child = $this->cal->fetch() ) {
$children[$i]=$Child;
$i++;
}
$this->assertEqual($children,$this->cal->fetchAll());
}
function testSelection() {
require_once(CALENDAR_ROOT . 'Minute.php');
$selection = array(new Calendar_Minute(2003,10,25,13,32));
$this->cal->build($selection);
$i = 0;
while ( $Child = $this->cal->fetch() ) {
if ( $i == 32 )
break;
$i++;
}
$this->assertTrue($Child->isSelected());
}
}
 
if (!defined('TEST_RUNNING')) {
define('TEST_RUNNING', true);
$test = &new TestOfHour();
$test->run(new HtmlReporter());
$test = &new TestOfHourBuild();
$test->run(new HtmlReporter());
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/Day.php
New file
0,0 → 1,197
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Harry Fuecks <hfuecks@phppatterns.com> |
// +----------------------------------------------------------------------+
//
// $Id: Day.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
//
/**
* @package Calendar
* @version $Id: Day.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
*/
 
/**
* Allows Calendar include path to be redefined
* @ignore
*/
if (!defined('CALENDAR_ROOT')) {
define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR);
}
 
/**
* Load Calendar base class
*/
require_once CALENDAR_ROOT.'Calendar.php';
 
/**
* Represents a Day and builds Hours.
* <code>
* require_once 'Calendar'.DIRECTORY_SEPARATOR.'Day.php';
* $Day = & new Calendar_Day(2003, 10, 21); // Oct 21st 2003
* while ($Hour = & $Day->fetch()) {
* echo $Hour->thisHour().'<br />';
* }
* </code>
* @package Calendar
* @access public
*/
class Calendar_Day extends Calendar
{
/**
* Marks the Day at the beginning of a week
* @access private
* @var boolean
*/
var $first = false;
 
/**
* Marks the Day at the end of a week
* @access private
* @var boolean
*/
var $last = false;
 
 
/**
* Used for tabular calendars
* @access private
* @var boolean
*/
var $empty = false;
 
/**
* Constructs Calendar_Day
* @param int year e.g. 2003
* @param int month e.g. 8
* @param int day e.g. 15
* @access public
*/
function Calendar_Day($y, $m, $d)
{
Calendar::Calendar($y, $m, $d);
}
 
/**
* Builds the Hours of the Day
* @param array (optional) Caledar_Hour objects representing selected dates
* @return boolean
* @access public
*/
function build($sDates = array())
{
require_once CALENDAR_ROOT.'Hour.php';
 
$hID = $this->cE->getHoursInDay($this->year, $this->month, $this->day);
for ($i=0; $i < $hID; $i++) {
$this->children[$i]=
new Calendar_Hour($this->year, $this->month, $this->day, $i);
}
if (count($sDates) > 0) {
$this->setSelection($sDates);
}
return true;
}
 
/**
* Called from build()
* @param array
* @return void
* @access private
*/
function setSelection($sDates)
{
foreach ($sDates as $sDate) {
if ($this->year == $sDate->thisYear()
&& $this->month == $sDate->thisMonth()
&& $this->day == $sDate->thisDay())
{
$key = (int)$sDate->thisHour();
if (isset($this->children[$key])) {
$sDate->setSelected();
$this->children[$key] = $sDate;
}
}
}
}
 
/**
* Defines Day object as first in a week
* Only used by Calendar_Month_Weekdays::build()
* @param boolean state
* @return void
* @access private
*/
function setFirst ($state = true)
{
$this->first = $state;
}
 
/**
* Defines Day object as last in a week
* Used only following Calendar_Month_Weekdays::build()
* @param boolean state
* @return void
* @access private
*/
function setLast($state = true)
{
$this->last = $state;
}
 
/**
* Returns true if Day object is first in a Week
* Only relevant when Day is created by Calendar_Month_Weekdays::build()
* @return boolean
* @access public
*/
function isFirst() {
return $this->first;
}
 
/**
* Returns true if Day object is last in a Week
* Only relevant when Day is created by Calendar_Month_Weekdays::build()
* @return boolean
* @access public
*/
function isLast()
{
return $this->last;
}
 
/**
* Defines Day object as empty
* Only used by Calendar_Month_Weekdays::build()
* @param boolean state
* @return void
* @access private
*/
function setEmpty ($state = true)
{
$this->empty = $state;
}
 
/**
* @return boolean
* @access public
*/
function isEmpty()
{
return $this->empty;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/Hour.php
New file
0,0 → 1,113
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Harry Fuecks <hfuecks@phppatterns.com> |
// +----------------------------------------------------------------------+
//
// $Id: Hour.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
//
/**
* @package Calendar
* @version $Id: Hour.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
*/
 
/**
* Allows Calendar include path to be redefined
* @ignore
*/
if (!defined('CALENDAR_ROOT')) {
define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR);
}
 
/**
* Load Calendar base class
*/
require_once CALENDAR_ROOT.'Calendar.php';
 
/**
* Represents an Hour and builds Minutes
* <code>
* require_once 'Calendar'.DIRECTORY_SEPARATOR.'Hour.php';
* $Hour = & new Calendar_Hour(2003, 10, 21, 15); // Oct 21st 2003, 3pm
* $Hour->build(); // Build Calendar_Minute objects
* while ($Minute = & $Hour->fetch()) {
* echo $Minute->thisMinute().'<br />';
* }
* </code>
* @package Calendar
* @access public
*/
class Calendar_Hour extends Calendar
{
/**
* Constructs Calendar_Hour
* @param int year e.g. 2003
* @param int month e.g. 5
* @param int day e.g. 11
* @param int hour e.g. 13
* @access public
*/
function Calendar_Hour($y, $m, $d, $h)
{
Calendar::Calendar($y, $m, $d, $h);
}
 
/**
* Builds the Minutes in the Hour
* @param array (optional) Calendar_Minute objects representing selected dates
* @return boolean
* @access public
*/
function build($sDates=array())
{
require_once CALENDAR_ROOT.'Minute.php';
$mIH = $this->cE->getMinutesInHour($this->year, $this->month, $this->day,
$this->hour);
for ($i=0; $i < $mIH; $i++) {
$this->children[$i]=
new Calendar_Minute($this->year, $this->month, $this->day,
$this->hour, $i);
}
if (count($sDates) > 0) {
$this->setSelection($sDates);
}
return true;
}
 
/**
* Called from build()
* @param array
* @return void
* @access private
*/
function setSelection($sDates)
{
foreach ($sDates as $sDate) {
if ($this->year == $sDate->thisYear()
&& $this->month == $sDate->thisMonth()
&& $this->day == $sDate->thisDay()
&& $this->hour == $sDate->thisHour())
{
$key = (int)$sDate->thisMinute();
if (isset($this->children[$key])) {
$sDate->setSelected();
$this->children[$key] = $sDate;
}
}
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/Engine/Interface.php
New file
0,0 → 1,293
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Harry Fuecks <hfuecks@phppatterns.com> |
// +----------------------------------------------------------------------+
//
// $Id: Interface.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
//
/**
* @package Calendar
* @version $Id: Interface.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
*/
/**
* The methods the classes implementing the Calendar_Engine must implement.
* Note this class is not used but simply to help development
* @package Calendar
* @access protected
*/
class Calendar_Engine_Interface
{
/**
* Provides a mechansim to make sure parsing of timestamps
* into human dates is only performed once per timestamp.
* Typically called "internally" by methods like stampToYear.
* Return value can vary, depending on the specific implementation
* @param int timestamp (depending on implementation)
* @return mixed
* @access protected
*/
function stampCollection($stamp)
{
}
 
/**
* Returns a numeric year given a timestamp
* @param int timestamp (depending on implementation)
* @return int year (e.g. 2003)
* @access protected
*/
function stampToYear($stamp)
{
}
 
/**
* Returns a numeric month given a timestamp
* @param int timestamp (depending on implementation)
* @return int month (e.g. 9)
* @access protected
*/
function stampToMonth($stamp)
{
}
 
/**
* Returns a numeric day given a timestamp
* @param int timestamp (depending on implementation)
* @return int day (e.g. 15)
* @access protected
*/
function stampToDay($stamp)
{
}
 
/**
* Returns a numeric hour given a timestamp
* @param int timestamp (depending on implementation)
* @return int hour (e.g. 13)
* @access protected
*/
function stampToHour($stamp)
{
}
 
/**
* Returns a numeric minute given a timestamp
* @param int timestamp (depending on implementation)
* @return int minute (e.g. 34)
* @access protected
*/
function stampToMinute($stamp)
{
}
 
/**
* Returns a numeric second given a timestamp
* @param int timestamp (depending on implementation)
* @return int second (e.g. 51)
* @access protected
*/
function stampToSecond($stamp)
{
}
 
/**
* Returns a timestamp. Can be worth "caching" generated
* timestamps in a static variable, identified by the
* params this method accepts, to timestamp will only
* be calculated once.
* @param int year (e.g. 2003)
* @param int month (e.g. 9)
* @param int day (e.g. 13)
* @param int hour (e.g. 13)
* @param int minute (e.g. 34)
* @param int second (e.g. 53)
* @return int (depends on implementation)
* @access protected
*/
function dateToStamp($y,$m,$d,$h,$i,$s)
{
}
 
/**
* The upper limit on years that the Calendar Engine can work with
* @return int (e.g. 2037)
* @access protected
*/
function getMaxYears()
{
}
 
/**
* The lower limit on years that the Calendar Engine can work with
* @return int (e.g 1902)
* @access protected
*/
function getMinYears()
{
}
 
/**
* Returns the number of months in a year
* @param int (optional) year to get months for
* @return int (e.g. 12)
* @access protected
*/
function getMonthsInYear($y=null)
{
}
 
/**
* Returns the number of days in a month, given year and month
* @param int year (e.g. 2003)
* @param int month (e.g. 9)
* @return int days in month
* @access protected
*/
function getDaysInMonth($y, $m)
{
}
 
/**
* Returns numeric representation of the day of the week in a month,
* given year and month
* @param int year (e.g. 2003)
* @param int month (e.g. 9)
* @return int
* @access protected
*/
function getFirstDayInMonth ($y, $m)
{
}
 
/**
* Returns the number of days in a week
* @param int year (2003)
* @param int month (9)
* @param int day (4)
* @return int (e.g. 7)
* @access protected
*/
function getDaysInWeek($y=NULL, $m=NULL, $d=NULL)
{
}
 
/**
* Returns the number of the week in the year (ISO-8601), given a date
* @param int year (2003)
* @param int month (9)
* @param int day (4)
* @return int week number
* @access protected
*/
function getWeekNInYear($y, $m, $d)
{
}
 
/**
* Returns the number of the week in the month, given a date
* @param int year (2003)
* @param int month (9)
* @param int day (4)
* @param int first day of the week (default: 1 - monday)
* @return int week number
* @access protected
*/
function getWeekNInMonth($y, $m, $d, $firstDay=1)
{
}
 
/**
* Returns the number of weeks in the month
* @param int year (2003)
* @param int month (9)
* @param int first day of the week (default: 1 - monday)
* @return int weeks number
* @access protected
*/
function getWeeksInMonth($y, $m)
{
}
 
/**
* Returns the number of the day of the week (0=sunday, 1=monday...)
* @param int year (2003)
* @param int month (9)
* @param int day (4)
* @return int weekday number
* @access protected
*/
function getDayOfWeek($y, $m, $d)
{
}
 
/**
* Returns the numeric values of the days of the week.
* @param int year (2003)
* @param int month (9)
* @param int day (4)
* @return array list of numeric values of days in week, beginning 0
* @access protected
*/
function getWeekDays($y=NULL, $m=NULL, $d=NULL)
{
}
 
/**
* Returns the default first day of the week as an integer. Must be a
* member of the array returned from getWeekDays
* @param int year (2003)
* @param int month (9)
* @param int day (4)
* @return int (e.g. 1 for Monday)
* @see getWeekDays
* @access protected
*/
function getFirstDayOfWeek($y=NULL, $m=NULL, $d=NULL)
{
}
 
/**
* Returns the number of hours in a day<br>
* @param int (optional) day to get hours for
* @return int (e.g. 24)
* @access protected
*/
function getHoursInDay($y=null,$m=null,$d=null)
{
}
 
/**
* Returns the number of minutes in an hour
* @param int (optional) hour to get minutes for
* @return int
* @access protected
*/
function getMinutesInHour($y=null,$m=null,$d=null,$h=null)
{
}
 
/**
* Returns the number of seconds in a minutes
* @param int (optional) minute to get seconds for
* @return int
* @access protected
*/
function getSecondsInMinute($y=null,$m=null,$d=null,$h=null,$i=null)
{
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/Engine/PearDate.php
New file
0,0 → 1,413
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Lorenzo Alberton <l dot alberton at quipo dot it> |
// +----------------------------------------------------------------------+
//
// $Id: PearDate.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
//
/**
* @package Calendar
* @version $Id: PearDate.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
*/
/**
* Load PEAR::Date class
*/
require_once 'Date.php';
 
/**
* Performs calendar calculations based on the PEAR::Date class
* Timestamps are in the ISO-8601 format (YYYY-MM-DD HH:MM:SS)
* @package Calendar
* @access protected
*/
class Calendar_Engine_PearDate /* implements Calendar_Engine_Interface */
{
/**
* Makes sure a given timestamp is only ever parsed once
* Uses a static variable to prevent date() being used twice
* for a date which is already known
* @param mixed Any timestamp format recognized by Pear::Date
* @return object Pear::Date object
* @access protected
*/
function stampCollection($stamp)
{
static $stamps = array();
if (!isset($stamps[$stamp])) {
$stamps[$stamp] = new Date($stamp);
}
return $stamps[$stamp];
}
 
/**
* Returns a numeric year given a iso-8601 datetime
* @param string iso-8601 datetime (YYYY-MM-DD HH:MM:SS)
* @return int year (e.g. 2003)
* @access protected
*/
function stampToYear($stamp)
{
$date = Calendar_Engine_PearDate::stampCollection($stamp);
return (int)$date->year;
}
 
/**
* Returns a numeric month given a iso-8601 datetime
* @param string iso-8601 datetime (YYYY-MM-DD HH:MM:SS)
* @return int month (e.g. 9)
* @access protected
*/
function stampToMonth($stamp)
{
$date = Calendar_Engine_PearDate::stampCollection($stamp);
return (int)$date->month;
}
 
/**
* Returns a numeric day given a iso-8601 datetime
* @param string iso-8601 datetime (YYYY-MM-DD HH:MM:SS)
* @return int day (e.g. 15)
* @access protected
*/
function stampToDay($stamp)
{
$date = Calendar_Engine_PearDate::stampCollection($stamp);
return (int)$date->day;
}
 
/**
* Returns a numeric hour given a iso-8601 datetime
* @param string iso-8601 datetime (YYYY-MM-DD HH:MM:SS)
* @return int hour (e.g. 13)
* @access protected
*/
function stampToHour($stamp)
{
$date = Calendar_Engine_PearDate::stampCollection($stamp);
return (int)$date->hour;
}
 
/**
* Returns a numeric minute given a iso-8601 datetime
* @param string iso-8601 datetime (YYYY-MM-DD HH:MM:SS)
* @return int minute (e.g. 34)
* @access protected
*/
function stampToMinute($stamp)
{
$date = Calendar_Engine_PearDate::stampCollection($stamp);
return (int)$date->minute;
}
 
/**
* Returns a numeric second given a iso-8601 datetime
* @param string iso-8601 datetime (YYYY-MM-DD HH:MM:SS)
* @return int second (e.g. 51)
* @access protected
*/
function stampToSecond($stamp)
{
$date = Calendar_Engine_PearDate::stampCollection($stamp);
return (int)$date->second;
}
 
/**
* Returns a iso-8601 datetime
* @param int year (2003)
* @param int month (9)
* @param int day (13)
* @param int hour (13)
* @param int minute (34)
* @param int second (53)
* @return string iso-8601 datetime
* @access protected
*/
function dateToStamp($y, $m, $d, $h=0, $i=0, $s=0)
{
$r = array();
Calendar_Engine_PearDate::adjustDate($y, $m, $d, $h, $i, $s);
$key = $y.$m.$d.$h.$i.$s;
if (!isset($r[$key])) {
$r[$key] = sprintf("%04d-%02d-%02d %02d:%02d:%02d",
$y, $m, $d, $h, $i, $s);
}
return $r[$key];
}
 
/**
* Set the correct date values (useful for math operations on dates)
* @param int year (2003)
* @param int month (9)
* @param int day (13)
* @param int hour (13)
* @param int minute (34)
* @param int second (53)
* @access protected
*/
function adjustDate(&$y, &$m, &$d, &$h, &$i, &$s)
{
if ($s < 0) {
$m -= floor($s / 60);
$s = -$s % 60;
}
if ($s > 60) {
$m += floor($s / 60);
$s %= 60;
}
if ($i < 0) {
$h -= floor($i / 60);
$i = -$i % 60;
}
if ($i > 60) {
$h += floor($i / 60);
$i %= 60;
}
if ($h < 0) {
$d -= floor($h / 24);
$h = -$h % 24;
}
if ($h > 24) {
$d += floor($h / 24);
$h %= 24;
}
for(; $m < 1; $y--, $m+=12);
for(; $m > 12; $y++, $m-=12);
 
while ($d < 1) {
if ($m > 1) {
$m--;
} else {
$m = 12;
$y--;
}
$d += Date_Calc::daysInMonth($m, $y);
}
for ($max_days = Date_Calc::daysInMonth($m, $y); $d > $max_days; ) {
$d -= $max_days;
if ($m < 12) {
$m++;
} else {
$m = 1;
$y++;
}
}
}
 
/**
* The upper limit on years that the Calendar Engine can work with
* @return int 9999
* @access protected
*/
function getMaxYears()
{
return 9999;
}
 
/**
* The lower limit on years that the Calendar Engine can work with
* @return int 0
* @access protected
*/
function getMinYears()
{
return 0;
}
 
/**
* Returns the number of months in a year
* @return int (12)
* @access protected
*/
function getMonthsInYear($y=null)
{
return 12;
}
 
/**
* Returns the number of days in a month, given year and month
* @param int year (2003)
* @param int month (9)
* @return int days in month
* @access protected
*/
function getDaysInMonth($y, $m)
{
return (int)Date_Calc::daysInMonth($m, $y);
}
 
/**
* Returns numeric representation of the day of the week in a month,
* given year and month
* @param int year (2003)
* @param int month (9)
* @return int from 0 to 7
* @access protected
*/
function getFirstDayInMonth($y, $m)
{
return (int)Date_Calc::dayOfWeek(1, $m, $y);
}
 
/**
* Returns the number of days in a week
* @param int year (2003)
* @param int month (9)
* @param int day (4)
* @return int (7)
* @access protected
*/
function getDaysInWeek($y=NULL, $m=NULL, $d=NULL)
{
return 7;
}
 
/**
* Returns the number of the week in the year (ISO-8601), given a date
* @param int year (2003)
* @param int month (9)
* @param int day (4)
* @return int week number
* @access protected
*/
function getWeekNInYear($y, $m, $d)
{
return Date_Calc::weekOfYear($d, $m, $y); //beware, Date_Calc doesn't follow ISO-8601 standard!
}
 
/**
* Returns the number of the week in the month, given a date
* @param int year (2003)
* @param int month (9)
* @param int day (4)
* @param int first day of the week (default: monday)
* @return int week number
* @access protected
*/
function getWeekNInMonth($y, $m, $d, $firstDay=1)
{
$weekEnd = ($firstDay == 0) ? $this->getDaysInWeek()-1 : $firstDay-1;
$end_of_week = (int)Date_Calc::nextDayOfWeek($weekEnd, 1, $m, $y, '%e', true);
$w = 1;
while ($d > $end_of_week) {
++$w;
$end_of_week += $this->getDaysInWeek();
}
return $w;
}
 
/**
* Returns the number of weeks in the month
* @param int year (2003)
* @param int month (9)
* @param int first day of the week (default: monday)
* @return int weeks number
* @access protected
*/
function getWeeksInMonth($y, $m, $firstDay=1)
{
$FDOM = Date_Calc::firstOfMonthWeekday($m, $y);
 
if ($FDOM > $firstDay) {
$firstWeekDays = $this->getDaysInWeek() - $FDOM + $firstDay;
$weeks = 1;
} else {
$firstWeekDays = $firstDay - $FDOM;
$weeks = 0;
}
$firstWeekDays %= $this->getDaysInWeek();
$result = (int)(ceil(($this->getDaysInMonth($y, $m) - $firstWeekDays) /
$this->getDaysInWeek()) + $weeks);
 
if ( $FDOM != 0 ) {
return $result;
} else {
return $result + 1;
}
}
 
/**
* Returns the number of the day of the week (0=sunday, 1=monday...)
* @param int year (2003)
* @param int month (9)
* @param int day (4)
* @return int weekday number
* @access protected
*/
function getDayOfWeek($y, $m, $d)
{
return Date_Calc::dayOfWeek($d, $m, $y);
}
 
/**
* Returns a list of integer days of the week beginning 0
* @param int year (2003)
* @param int month (9)
* @param int day (4)
* @return array (0, 1, 2, 3, 4, 5, 6) 1 = Monday
* @access protected
*/
function getWeekDays($y=NULL, $m=NULL, $d=NULL)
{
return array(0, 1, 2, 3, 4, 5, 6);
}
 
/**
* Returns the default first day of the week
* @param int year (2003)
* @param int month (9)
* @param int day (4)
* @return int (default 1 = Monday)
* @access protected
*/
function getFirstDayOfWeek($y=NULL, $m=NULL, $d=NULL)
{
return 1;
}
 
/**
* Returns the number of hours in a day
* @return int (24)
* @access protected
*/
function getHoursInDay($y=null,$m=null,$d=null)
{
return 24;
}
 
/**
* Returns the number of minutes in an hour
* @return int (60)
* @access protected
*/
function getMinutesInHour($y=null,$m=null,$d=null,$h=null)
{
return 60;
}
 
/**
* Returns the number of seconds in a minutes
* @return int (60)
* @access protected
*/
function getSecondsInMinute($y=null,$m=null,$d=null,$h=null,$i=null)
{
return 60;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/Engine/UnixTS.php
New file
0,0 → 1,372
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Harry Fuecks <hfuecks@phppatterns.com> |
// +----------------------------------------------------------------------+
//
// $Id: UnixTS.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
//
/**
* @package Calendar
* @version $Id: UnixTS.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
*/
/**
* Performs calendar calculations based on the PHP date() function and
* Unix timestamps (using PHP's mktime() function).
* @package Calendar
* @access protected
*/
class Calendar_Engine_UnixTS /* implements Calendar_Engine_Interface */
{
/**
* Makes sure a given timestamp is only ever parsed once
* <pre>
* array (
* [0] => year (e.g 2003),
* [1] => month (e.g 9),
* [2] => day (e.g 6),
* [3] => hour (e.g 14),
* [4] => minute (e.g 34),
* [5] => second (e.g 45),
* [6] => num days in month (e.g. 31),
* [7] => week in year (e.g. 50),
* [8] => day in week (e.g. 0 for Sunday)
* )
* </pre>
* Uses a static variable to prevent date() being used twice
* for a date which is already known
* @param int Unix timestamp
* @return array
* @access protected
*/
function stampCollection($stamp)
{
static $stamps = array();
if ( !isset($stamps[$stamp]) ) {
$date = @date('Y n j H i s t W w',$stamp);
$stamps[$stamp] = sscanf($date, "%d %d %d %d %d %d %d %d %d");
}
return $stamps[$stamp];
}
 
/**
* Returns a numeric year given a timestamp
* @param int Unix timestamp
* @return int year (e.g. 2003)
* @access protected
*/
function stampToYear($stamp)
{
$date = Calendar_Engine_UnixTS::stampCollection($stamp);
return (int)$date[0];
}
 
/**
* Returns a numeric month given a timestamp
* @param int Unix timestamp
* @return int month (e.g. 9)
* @access protected
*/
function stampToMonth($stamp)
{
$date = Calendar_Engine_UnixTS::stampCollection($stamp);
return (int)$date[1];
}
 
/**
* Returns a numeric day given a timestamp
* @param int Unix timestamp
* @return int day (e.g. 15)
* @access protected
*/
function stampToDay($stamp)
{
$date = Calendar_Engine_UnixTS::stampCollection($stamp);
return (int)$date[2];
}
 
/**
* Returns a numeric hour given a timestamp
* @param int Unix timestamp
* @return int hour (e.g. 13)
* @access protected
*/
function stampToHour($stamp)
{
$date = Calendar_Engine_UnixTS::stampCollection($stamp);
return (int)$date[3];
}
 
/**
* Returns a numeric minute given a timestamp
* @param int Unix timestamp
* @return int minute (e.g. 34)
* @access protected
*/
function stampToMinute($stamp)
{
$date = Calendar_Engine_UnixTS::stampCollection($stamp);
return (int)$date[4];
}
 
/**
* Returns a numeric second given a timestamp
* @param int Unix timestamp
* @return int second (e.g. 51)
* @access protected
*/
function stampToSecond($stamp)
{
$date = Calendar_Engine_UnixTS::stampCollection($stamp);
return (int)$date[5];
}
 
/**
* Returns a timestamp
* @param int year (2003)
* @param int month (9)
* @param int day (13)
* @param int hour (13)
* @param int minute (34)
* @param int second (53)
* @return int Unix timestamp
* @access protected
*/
function dateToStamp($y, $m, $d, $h=0, $i=0, $s=0)
{
static $dates = array();
if ( !isset($dates[$y][$m][$d][$h][$i][$s]) ) {
$dates[$y][$m][$d][$h][$i][$s] = @mktime($h, $i, $s, $m, $d, $y);
}
return $dates[$y][$m][$d][$h][$i][$s];
}
 
/**
* The upper limit on years that the Calendar Engine can work with
* @return int (2037)
* @access protected
*/
function getMaxYears()
{
return 2037;
}
 
/**
* The lower limit on years that the Calendar Engine can work with
* @return int (1970 if it's Windows and 1902 for all other OSs)
* @access protected
*/
function getMinYears()
{
return $min = strpos(PHP_OS, 'WIN') === false ? 1902 : 1970;
}
 
/**
* Returns the number of months in a year
* @return int (12)
* @access protected
*/
function getMonthsInYear($y=null)
{
return 12;
}
 
/**
* Returns the number of days in a month, given year and month
* @param int year (2003)
* @param int month (9)
* @return int days in month
* @access protected
*/
function getDaysInMonth($y, $m)
{
$stamp = Calendar_Engine_UnixTS::dateToStamp($y,$m,1);
$date = Calendar_Engine_UnixTS::stampCollection($stamp);
return $date[6];
}
 
/**
* Returns numeric representation of the day of the week in a month,
* given year and month
* @param int year (2003)
* @param int month (9)
* @return int from 0 to 6
* @access protected
*/
function getFirstDayInMonth($y, $m)
{
$stamp = Calendar_Engine_UnixTS::dateToStamp($y,$m,1);
$date = Calendar_Engine_UnixTS::stampCollection($stamp);
return $date[8];
}
 
/**
* Returns the number of days in a week
* @param int year (2003)
* @param int month (9)
* @param int day (4)
* @return int (7)
* @access protected
*/
function getDaysInWeek($y=NULL, $m=NULL, $d=NULL)
{
return 7;
}
 
/**
* Returns the number of the week in the year (ISO-8601), given a date
* @param int year (2003)
* @param int month (9)
* @param int day (4)
* @return int week number
* @access protected
*/
function getWeekNInYear($y, $m, $d)
{
$stamp = Calendar_Engine_UnixTS::dateToStamp($y,$m,$d);
$date = Calendar_Engine_UnixTS::stampCollection($stamp);
return $date[7];
}
 
/**
* Returns the number of the week in the month, given a date
* @param int year (2003)
* @param int month (9)
* @param int day (4)
* @param int first day of the week (default: monday)
* @return int week number
* @access protected
*/
function getWeekNInMonth($y, $m, $d, $firstDay=1)
{
$weekEnd = ($firstDay == 0) ? $this->getDaysInWeek()-1 : $firstDay-1;
$end_of_week = 1;
while (@date('w', @mktime(0, 0, 0, $m, $end_of_week, $y)) != $weekEnd) {
++$end_of_week; //find first weekend of the month
}
$w = 1;
while ($d > $end_of_week) {
++$w;
$end_of_week += $this->getDaysInWeek();
}
return $w;
}
 
/**
* Returns the number of weeks in the month
* @param int year (2003)
* @param int month (9)
* @param int first day of the week (default: monday)
* @return int weeks number
* @access protected
*/
function getWeeksInMonth($y, $m, $firstDay=1)
{
$FDOM = $this->getFirstDayInMonth($y, $m);
 
if ($FDOM > $firstDay) {
$firstWeekDays = $this->getDaysInWeek() - $FDOM + $firstDay;
$weeks = 1;
} else {
$firstWeekDays = $firstDay - $FDOM;
$weeks = 0;
}
$firstWeekDays %= $this->getDaysInWeek();
 
$result = (int)(ceil(($this->getDaysInMonth($y, $m) - $firstWeekDays) /
$this->getDaysInWeek()) + $weeks);
 
// Hack - 0 as FDOM is a special case
if ( $FDOM != 0 ) {
return $result;
} else {
return $result + 1;
}
}
 
/**
* Returns the number of the day of the week (0=sunday, 1=monday...)
* @param int year (2003)
* @param int month (9)
* @param int day (4)
* @return int weekday number
* @access protected
*/
function getDayOfWeek($y, $m, $d)
{
$stamp = Calendar_Engine_UnixTS::dateToStamp($y,$m,$d);
$date = Calendar_Engine_UnixTS::stampCollection($stamp);
return $date[8];
}
 
/**
* Returns a list of integer days of the week beginning 0
* @param int year (2003)
* @param int month (9)
* @param int day (4)
* @return array (0,1,2,3,4,5,6) 1 = Monday
* @access protected
*/
function getWeekDays($y=NULL, $m=NULL, $d=NULL)
{
return array(0, 1, 2, 3, 4, 5, 6);
}
 
/**
* Returns the default first day of the week
* @param int year (2003)
* @param int month (9)
* @param int day (4)
* @return int (default 1 = Monday)
* @access protected
*/
function getFirstDayOfWeek($y=NULL, $m=NULL, $d=NULL)
{
return 1;
}
 
/**
* Returns the number of hours in a day
* @return int (24)
* @access protected
*/
function getHoursInDay($y=null,$m=null,$d=null)
{
return 24;
}
 
/**
* Returns the number of minutes in an hour
* @return int (60)
* @access protected
*/
function getMinutesInHour($y=null,$m=null,$d=null,$h=null)
{
return 60;
}
 
/**
* Returns the number of seconds in a minutes
* @return int (60)
* @access protected
*/
function getSecondsInMinute($y=null,$m=null,$d=null,$h=null,$i=null)
{
return 60;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/Decorator.php
New file
0,0 → 1,557
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Harry Fuecks <hfuecks@phppatterns.com> |
// +----------------------------------------------------------------------+
//
// $Id: Decorator.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
//
/**
* @package Calendar
* @version $Id: Decorator.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
*/
/**
* Decorates any calendar class.
* Create a subclass of this class for your own "decoration".
* Used for "selections"
* <code>
* class DayDecorator extends Calendar_Decorator
* {
* function thisDay($format = 'int')
* {
.* $day = parent::thisDay('timestamp');
.* return date('D', $day);
* }
* }
* $Day = & new Calendar_Day(2003, 10, 25);
* $DayDecorator = & new DayDecorator($Day);
* echo $DayDecorator->thisDay(); // Outputs "Sat"
* </code>
* @abstract
* @package Calendar
*/
class Calendar_Decorator
{
/**
* Subclass of Calendar being decorated
* @var object
* @access private
*/
var $calendar;
 
/**
* Constructs the Calendar_Decorator
* @param object subclass to Calendar to decorate
*/
function Calendar_Decorator(& $calendar)
{
$this->calendar = & $calendar;
}
 
/**
* Defines the calendar by a Unix timestamp, replacing values
* passed to the constructor
* @param int Unix timestamp
* @return void
* @access public
*/
function setTimestamp($ts)
{
$this->calendar->setTimestamp($ts);
}
 
/**
* Returns a timestamp from the current date / time values. Format of
* timestamp depends on Calendar_Engine implementation being used
* @return int timestamp
* @access public
*/
function getTimestamp()
{
return $this->calendar->getTimeStamp();
}
 
/**
* Defines calendar object as selected (e.g. for today)
* @param boolean state whether Calendar subclass
* @return void
* @access public
*/
function setSelected($state = true)
{
$this->calendar->setSelected($state = true);
}
 
/**
* True if the calendar subclass object is selected (e.g. today)
* @return boolean
* @access public
*/
function isSelected()
{
return $this->calendar->isSelected();
}
 
/**
* Adjusts the date (helper method)
* @return void
* @access public
*/
function adjust()
{
$this->calendar->adjust();
}
 
/**
* Returns the date as an associative array (helper method)
* @param mixed timestamp (leave empty for current timestamp)
* @return array
* @access public
*/
function toArray($stamp=null)
{
return $this->calendar->toArray($stamp);
}
 
/**
* Returns the value as an associative array (helper method)
* @param string type of date object that return value represents
* @param string $format ['int' | 'array' | 'timestamp' | 'object']
* @param mixed timestamp (depending on Calendar engine being used)
* @param int integer default value (i.e. give me the answer quick)
* @return mixed
* @access private
*/
function returnValue($returnType, $format, $stamp, $default)
{
return $this->calendar->returnValue($returnType, $format, $stamp, $default);
}
 
/**
* Defines Day object as first in a week
* Only used by Calendar_Month_Weekdays::build()
* @param boolean state
* @return void
* @access private
*/
function setFirst ($state = true)
{
if ( method_exists($this->calendar,'setFirst') ) {
$this->calendar->setFirst($state);
}
}
 
/**
* Defines Day object as last in a week
* Used only following Calendar_Month_Weekdays::build()
* @param boolean state
* @return void
* @access private
*/
function setLast($state = true)
{
if ( method_exists($this->calendar,'setLast') ) {
$this->calendar->setLast($state);
}
}
 
/**
* Returns true if Day object is first in a Week
* Only relevant when Day is created by Calendar_Month_Weekdays::build()
* @return boolean
* @access public
*/
function isFirst() {
if ( method_exists($this->calendar,'isFirst') ) {
return $this->calendar->isFirst();
}
}
 
/**
* Returns true if Day object is last in a Week
* Only relevant when Day is created by Calendar_Month_Weekdays::build()
* @return boolean
* @access public
*/
function isLast()
{
if ( method_exists($this->calendar,'isLast') ) {
return $this->calendar->isLast();
}
}
 
/**
* Defines Day object as empty
* Only used by Calendar_Month_Weekdays::build()
* @param boolean state
* @return void
* @access private
*/
function setEmpty ($state = true)
{
if ( method_exists($this->calendar,'setEmpty') ) {
$this->calendar->setEmpty($state);
}
}
 
/**
* @return boolean
* @access public
*/
function isEmpty()
{
if ( method_exists($this->calendar,'isEmpty') ) {
return $this->calendar->isEmpty();
}
}
 
/**
* Build the children
* @param array containing Calendar objects to select (optional)
* @return boolean
* @access public
* @abstract
*/
function build($sDates = array())
{
$this->calendar->build($sDates);
}
 
/**
* Iterator method for fetching child Calendar subclass objects
* (e.g. a minute from an hour object). On reaching the end of
* the collection, returns false and resets the collection for
* further iteratations.
* @return mixed either an object subclass of Calendar or false
* @access public
*/
function fetch()
{
return $this->calendar->fetch();
}
 
/**
* Fetches all child from the current collection of children
* @return array
* @access public
*/
function fetchAll()
{
return $this->calendar->fetchAll();
}
 
/**
* Get the number Calendar subclass objects stored in the internal
* collection.
* @return int
* @access public
*/
function size()
{
return $this->calendar->size();
}
 
/**
* Determine whether this date is valid, with the bounds determined by
* the Calendar_Engine. The call is passed on to
* Calendar_Validator::isValid
* @return boolean
* @access public
*/
function isValid()
{
return $this->calendar->isValid();
}
 
/**
* Returns an instance of Calendar_Validator
* @return Calendar_Validator
* @access public
*/
function & getValidator()
{
return $this->calendar->getValidator();
}
 
/**
* Returns a reference to the current Calendar_Engine being used. Useful
* for Calendar_Table_Helper and Caledar_Validator
* @return object implementing Calendar_Engine_Inteface
* @access private
*/
function & getEngine()
{
return $this->calendar->getEngine();
}
 
/**
* Returns the value for the previous year
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 2002 or timestamp
* @access public
*/
function prevYear($format = 'int')
{
return $this->calendar->prevYear($format);
}
 
/**
* Returns the value for this year
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 2003 or timestamp
* @access public
*/
function thisYear($format = 'int')
{
return $this->calendar->thisYear($format);
}
 
/**
* Returns the value for next year
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 2004 or timestamp
* @access public
*/
function nextYear($format = 'int')
{
return $this->calendar->nextYear($format);
}
 
/**
* Returns the value for the previous month
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 4 or Unix timestamp
* @access public
*/
function prevMonth($format = 'int')
{
return $this->calendar->prevMonth($format);
}
 
/**
* Returns the value for this month
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 5 or timestamp
* @access public
*/
function thisMonth($format = 'int')
{
return $this->calendar->thisMonth($format);
}
 
/**
* Returns the value for next month
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 6 or timestamp
* @access public
*/
function nextMonth($format = 'int')
{
return $this->calendar->nextMonth($format);
}
 
/**
* Returns the value for the previous week
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 4 or Unix timestamp
* @access public
*/
function prevWeek($format = 'n_in_month')
{
if ( method_exists($this->calendar,'prevWeek') ) {
return $this->calendar->prevWeek($format);
} else {
require_once 'PEAR.php';
PEAR::raiseError(
'Cannot call prevWeek on Calendar object of type: '.
get_class($this->calendar), 133, PEAR_ERROR_TRIGGER,
E_USER_NOTICE, 'Calendar_Decorator::prevWeek()');
return false;
}
}
 
/**
* Returns the value for this week
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 5 or timestamp
* @access public
*/
function thisWeek($format = 'n_in_month')
{
if ( method_exists($this->calendar,'thisWeek') ) {
return $this->calendar->thisWeek($format);
} else {
require_once 'PEAR.php';
PEAR::raiseError(
'Cannot call thisWeek on Calendar object of type: '.
get_class($this->calendar), 133, PEAR_ERROR_TRIGGER,
E_USER_NOTICE, 'Calendar_Decorator::thisWeek()');
return false;
}
}
 
/**
* Returns the value for next week
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 6 or timestamp
* @access public
*/
function nextWeek($format = 'n_in_month')
{
if ( method_exists($this->calendar,'nextWeek') ) {
return $this->calendar->nextWeek($format);
} else {
require_once 'PEAR.php';
PEAR::raiseError(
'Cannot call thisWeek on Calendar object of type: '.
get_class($this->calendar), 133, PEAR_ERROR_TRIGGER,
E_USER_NOTICE, 'Calendar_Decorator::nextWeek()');
return false;
}
}
 
/**
* Returns the value for the previous day
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 10 or timestamp
* @access public
*/
function prevDay($format = 'int') {
return $this->calendar->prevDay($format);
}
 
/**
* Returns the value for this day
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 11 or timestamp
* @access public
*/
function thisDay($format = 'int')
{
return $this->calendar->thisDay($format);
}
 
/**
* Returns the value for the next day
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 12 or timestamp
* @access public
*/
function nextDay($format = 'int')
{
return $this->calendar->nextDay($format);
}
 
/**
* Returns the value for the previous hour
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 13 or timestamp
* @access public
*/
function prevHour($format = 'int')
{
return $this->calendar->prevHour($format);
}
 
/**
* Returns the value for this hour
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 14 or timestamp
* @access public
*/
function thisHour($format = 'int')
{
return $this->calendar->thisHour($format);
}
 
/**
* Returns the value for the next hour
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 14 or timestamp
* @access public
*/
function nextHour($format = 'int')
{
return $this->calendar->nextHour($format);
}
 
/**
* Returns the value for the previous minute
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 23 or timestamp
* @access public
*/
function prevMinute($format = 'int')
{
return $this->calendar->prevMinute($format);
}
 
/**
* Returns the value for this minute
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 24 or timestamp
* @access public
*/
function thisMinute($format = 'int')
{
return $this->calendar->thisMinute($format);
}
 
/**
* Returns the value for the next minute
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 25 or timestamp
* @access public
*/
function nextMinute($format = 'int')
{
return $this->calendar->nextMinute($format);
}
 
/**
* Returns the value for the previous second
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 43 or timestamp
* @access public
*/
function prevSecond($format = 'int')
{
return $this->calendar->prevSecond($format);
}
 
/**
* Returns the value for this second
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 44 or timestamp
* @access public
*/
function thisSecond($format = 'int')
{
return $this->calendar->thisSecond($format);
}
 
/**
* Returns the value for the next second
* @param string return value format ['int' | 'timestamp' | 'object' | 'array']
* @return int e.g. 45 or timestamp
* @access public
*/
function nextSecond($format = 'int')
{
return $this->calendar->nextSecond($format);
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/Validator.php
New file
0,0 → 1,335
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Harry Fuecks <hfuecks@phppatterns.com> |
// +----------------------------------------------------------------------+
//
// $Id: Validator.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
//
/**
* @package Calendar
* @version $Id: Validator.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
*/
 
/**
* Validation Error Messages
*/
if (!defined('CALENDAR_VALUE_TOOSMALL')) {
define('CALENDAR_VALUE_TOOSMALL', 'Too small: min = ');
}
if (!defined('CALENDAR_VALUE_TOOLARGE')) {
define('CALENDAR_VALUE_TOOLARGE', 'Too large: max = ');
}
 
/**
* Used to validate any given Calendar date object. Instances of this class
* can be obtained from any data object using the getValidator method
* @see Calendar::getValidator()
* @package Calendar
* @access public
*/
class Calendar_Validator
{
/**
* Instance of the Calendar date object to validate
* @var object
* @access private
*/
var $calendar;
 
/**
* Instance of the Calendar_Engine
* @var object
* @access private
*/
var $cE;
 
/**
* Array of errors for validation failures
* @var array
* @access private
*/
var $errors = array();
 
/**
* Constructs Calendar_Validator
* @param object subclass of Calendar
* @access public
*/
function Calendar_Validator(& $calendar)
{
$this->calendar = & $calendar;
$this->cE = & $calendar->getEngine();
}
 
/**
* Calls all the other isValidXXX() methods in the validator
* @return boolean
* @access public
*/
function isValid()
{
$checks = array('isValidYear', 'isValidMonth', 'isValidDay',
'isValidHour', 'isValidMinute', 'isValidSecond');
$valid = true;
foreach ($checks as $check) {
if (!$this->{$check}()) {
$valid = false;
}
}
return $valid;
}
 
/**
* Check whether this is a valid year
* @return boolean
* @access public
*/
function isValidYear()
{
$y = $this->calendar->thisYear();
$min = $this->cE->getMinYears();
if ($min > $y) {
$this->errors[] = new Calendar_Validation_Error(
'Year', $y, CALENDAR_VALUE_TOOSMALL.$min);
return false;
}
$max = $this->cE->getMaxYears();
if ($y > $max) {
$this->errors[] = new Calendar_Validation_Error(
'Year', $y, CALENDAR_VALUE_TOOLARGE.$max);
return false;
}
return true;
}
 
/**
* Check whether this is a valid month
* @return boolean
* @access public
*/
function isValidMonth()
{
$m = $this->calendar->thisMonth();
$min = 1;
if ($min > $m) {
$this->errors[] = new Calendar_Validation_Error(
'Month', $m, CALENDAR_VALUE_TOOSMALL.$min);
return false;
}
$max = $this->cE->getMonthsInYear($this->calendar->thisYear());
if ($m > $max) {
$this->errors[] = new Calendar_Validation_Error(
'Month', $m, CALENDAR_VALUE_TOOLARGE.$max);
return false;
}
return true;
}
 
/**
* Check whether this is a valid day
* @return boolean
* @access public
*/
function isValidDay()
{
$d = $this->calendar->thisDay();
$min = 1;
if ($min > $d) {
$this->errors[] = new Calendar_Validation_Error(
'Day', $d, CALENDAR_VALUE_TOOSMALL.$min);
return false;
}
$max = $this->cE->getDaysInMonth(
$this->calendar->thisYear(), $this->calendar->thisMonth());
if ($d > $max) {
$this->errors[] = new Calendar_Validation_Error(
'Day', $d, CALENDAR_VALUE_TOOLARGE.$max);
return false;
}
return true;
}
 
/**
* Check whether this is a valid hour
* @return boolean
* @access public
*/
function isValidHour()
{
$h = $this->calendar->thisHour();
$min = 0;
if ($min > $h) {
$this->errors[] = new Calendar_Validation_Error(
'Hour', $h, CALENDAR_VALUE_TOOSMALL.$min);
return false;
}
$max = ($this->cE->getHoursInDay($this->calendar->thisDay())-1);
if ($h > $max) {
$this->errors[] = new Calendar_Validation_Error(
'Hour', $h, CALENDAR_VALUE_TOOLARGE.$max);
return false;
}
return true;
}
 
/**
* Check whether this is a valid minute
* @return boolean
* @access public
*/
function isValidMinute()
{
$i = $this->calendar->thisMinute();
$min = 0;
if ($min > $i) {
$this->errors[] = new Calendar_Validation_Error(
'Minute', $i, CALENDAR_VALUE_TOOSMALL.$min);
return false;
}
$max = ($this->cE->getMinutesInHour($this->calendar->thisHour())-1);
if ($i > $max) {
$this->errors[] = new Calendar_Validation_Error(
'Minute', $i, CALENDAR_VALUE_TOOLARGE.$max);
return false;
}
return true;
}
 
/**
* Check whether this is a valid second
* @return boolean
* @access public
*/
function isValidSecond()
{
$s = $this->calendar->thisSecond();
$min = 0;
if ($min > $s) {
$this->errors[] = new Calendar_Validation_Error(
'Second', $s, CALENDAR_VALUE_TOOSMALL.$min);
return false;
}
$max = ($this->cE->getSecondsInMinute($this->calendar->thisMinute())-1);
if ($s > $max) {
$this->errors[] = new Calendar_Validation_Error(
'Second', $s, CALENDAR_VALUE_TOOLARGE.$max);
return false;
}
return true;
}
 
/**
* Iterates over any validation errors
* @return mixed either Calendar_Validation_Error or false
* @access public
*/
function fetch()
{
$error = each ($this->errors);
if ($error) {
return $error['value'];
} else {
reset($this->errors);
return false;
}
}
}
 
/**
* For Validation Error messages
* @see Calendar::fetch()
* @package Calendar
* @access public
*/
class Calendar_Validation_Error
{
/**
* Date unit (e.g. month,hour,second) which failed test
* @var string
* @access private
*/
var $unit;
 
/**
* Value of unit which failed test
* @var int
* @access private
*/
var $value;
 
/**
* Validation error message
* @var string
* @access private
*/
var $message;
 
/**
* Constructs Calendar_Validation_Error
* @param string Date unit (e.g. month,hour,second)
* @param int Value of unit which failed test
* @param string Validation error message
* @access protected
*/
function Calendar_Validation_Error($unit,$value,$message)
{
$this->unit = $unit;
$this->value = $value;
$this->message = $message;
}
 
/**
* Returns the Date unit
* @return string
* @access public
*/
function getUnit()
{
return $this->unit;
}
 
/**
* Returns the value of the unit
* @return int
* @access public
*/
function getValue()
{
return $this->value;
}
 
/**
* Returns the validation error message
* @return string
* @access public
*/
function getMessage()
{
return $this->message;
}
 
/**
* Returns a string containing the unit, value and error message
* @return string
* @access public
*/
function toString ()
{
return $this->unit.' = '.$this->value.' ['.$this->message.']';
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/Month.php
New file
0,0 → 1,113
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Harry Fuecks <hfuecks@phppatterns.com> |
// +----------------------------------------------------------------------+
//
// $Id: Month.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
//
/**
* @package Calendar
* @version $Id: Month.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
*/
 
/**
* Allows Calendar include path to be redefined
* @ignore
*/
if (!defined('CALENDAR_ROOT')) {
define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR);
}
 
/**
* Load Calendar base class
*/
require_once CALENDAR_ROOT.'Calendar.php';
 
/**
* Represents a Month and builds Days
* <code>
* require_once 'Calendar'.DIRECTORY_SEPARATOR.'Month.php';
* $Month = & new Calendar_Month(2003, 10); // Oct 2003
* $Month->build(); // Build Calendar_Day objects
* while ($Day = & $Month->fetch()) {
* echo $Day->thisDay().'<br />';
* }
* </code>
* @package Calendar
* @access public
*/
class Calendar_Month extends Calendar
{
/**
* Constructs Calendar_Month
* @param int year e.g. 2003
* @param int month e.g. 5
* @param int (optional) unused in this class
* @access public
*/
function Calendar_Month($y, $m, $firstDay=null)
{
Calendar::Calendar($y, $m);
}
 
/**
* Builds Day objects for this Month. Creates as many Calendar_Day objects
* as there are days in the month
* @param array (optional) Calendar_Day objects representing selected dates
* @return boolean
* @access public
*/
function build($sDates=array())
{
require_once CALENDAR_ROOT.'Day.php';
$daysInMonth = $this->cE->getDaysInMonth($this->year, $this->month);
for ($i=1; $i<=$daysInMonth; $i++) {
$this->children[$i] = new Calendar_Day($this->year, $this->month, $i);
}
if (count($sDates) > 0) {
$this->setSelection($sDates);
}
return true;
}
 
/**
* Called from build()
* @param array
* @return void
* @access private
*/
function setSelection($sDates)
{
foreach ($sDates as $sDate) {
if ($this->year == $sDate->thisYear()
&& $this->month == $sDate->thisMonth() )
{
$key = $sDate->thisDay();
if (isset($this->children[$key])) {
$sDate->setSelected();
$class = strtolower(get_class($sDate));
if ( $class == 'calendar_day' || $class == 'calendar_decorator' ) {
$sDate->setFirst($this->children[$key]->isFirst());
$sDate->setLast($this->children[$key]->isLast());
}
$this->children[$key] = $sDate;
}
}
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/Util/Uri.php
New file
0,0 → 1,169
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
//
// +----------------------------------------------------------------------+
// | PHP |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Harry Fuecks <hfuecks@phppatterns.com> |
// | Lorenzo Alberton <l dot alberton at quipo dot it> |
// +----------------------------------------------------------------------+
//
// $Id: Uri.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
//
/**
* @package Calendar
* @version $Id: Uri.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
*/
 
/**
* Utility to help building HTML links for navigating the calendar<br />
* <code>
* $Day = new Calendar_Day(2003, 10, 23);
* $Uri = & new Calendar_Util_Uri('year', 'month', 'day');
* echo $Uri->prev($Day,'month'); // Displays year=2003&amp;month=10
* echo $Uri->prev($Day,'day'); // Displays year=2003&amp;month=10&amp;day=22
* $Uri->seperator = '/';
* $Uri->scalar = true;
* echo $Uri->prev($Day,'month'); // Displays 2003/10
* echo $Uri->prev($Day,'day'); // Displays 2003/10/22
* </code>
* @package Calendar
* @access public
*/
class Calendar_Util_Uri
{
/**
* Uri fragments for year, month, day etc.
* @var array
* @access private
*/
var $uris = array();
 
/**
* String to separate fragments with.
* Set to just & for HTML.
* For a scalar URL you might use / as the seperator
* @var string (default XHTML &amp;)
* @access public
*/
var $separator = '&amp;';
 
/**
* To output a "scalar" string - variable names omitted.
* Used for urls like index.php/2004/8/12
* @var boolean (default false)
* @access public
*/
var $scalar = false;
 
/**
* Constructs Calendar_Decorator_Uri
* The term "fragment" means <i>name</i> of a calendar GET variables in the URL
* @param string URI fragment for year
* @param string (optional) URI fragment for month
* @param string (optional) URI fragment for day
* @param string (optional) URI fragment for hour
* @param string (optional) URI fragment for minute
* @param string (optional) URI fragment for second
* @access public
*/
function Calendar_Util_Uri($y, $m=null, $d=null, $h=null, $i=null, $s=null)
{
$this->setFragments($y, $m, $d, $h, $i, $s);
}
 
/**
* Sets the URI fragment names
* @param string URI fragment for year
* @param string (optional) URI fragment for month
* @param string (optional) URI fragment for day
* @param string (optional) URI fragment for hour
* @param string (optional) URI fragment for minute
* @param string (optional) URI fragment for second
* @return void
* @access public
*/
function setFragments($y, $m=null, $d=null, $h=null, $i=null, $s=null) {
if (!is_null($y)) $this->uris['Year'] = $y;
if (!is_null($m)) $this->uris['Month'] = $m;
if (!is_null($d)) $this->uris['Day'] = $d;
if (!is_null($h)) $this->uris['Hour'] = $h;
if (!is_null($i)) $this->uris['Minute'] = $i;
if (!is_null($s)) $this->uris['Second'] = $s;
}
 
/**
* Gets the URI string for the previous calendar unit
* @param object subclassed from Calendar e.g. Calendar_Month
* @param string calendar unit ( must be year, month, week, day, hour, minute or second)
* @return string
* @access public
*/
function prev($Calendar, $unit)
{
$method = 'prev'.$unit;
$stamp = $Calendar->{$method}('timestamp');
return $this->buildUriString($Calendar, $method, $stamp);
}
 
/**
* Gets the URI string for the current calendar unit
* @param object subclassed from Calendar e.g. Calendar_Month
* @param string calendar unit ( must be year, month, week, day, hour, minute or second)
* @return string
* @access public
*/
function this($Calendar, $unit)
{
$method = 'this'.$unit;
$stamp = $Calendar->{$method}('timestamp');
return $this->buildUriString($Calendar, $method, $stamp);
}
 
/**
* Gets the URI string for the next calendar unit
* @param object subclassed from Calendar e.g. Calendar_Month
* @param string calendar unit ( must be year, month, week, day, hour, minute or second)
* @return string
* @access public
*/
function next($Calendar, $unit)
{
$method = 'next'.$unit;
$stamp = $Calendar->{$method}('timestamp');
return $this->buildUriString($Calendar, $method, $stamp);
}
 
/**
* Build the URI string
* @param string method substring
* @param int timestamp
* @return string build uri string
* @access private
*/
function buildUriString($Calendar, $method, $stamp)
{
$uriString = '';
$cE = & $Calendar->getEngine();
$separator = '';
foreach ($this->uris as $unit => $uri) {
$call = 'stampTo'.$unit;
$uriString .= $separator;
if (!$this->scalar) $uriString .= $uri.'=';
$uriString .= $cE->{$call}($stamp);
$separator = $this->separator;
}
return $uriString;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Calendar/Util/Textual.php
New file
0,0 → 1,239
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Harry Fuecks <hfuecks@phppatterns.com> |
// | Lorenzo Alberton <l dot alberton at quipo dot it> |
// +----------------------------------------------------------------------+
//
// $Id: Textual.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
//
/**
* @package Calendar
* @version $Id: Textual.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
*/
 
/**
* Allows Calendar include path to be redefined
* @ignore
*/
if (!defined('CALENDAR_ROOT')) {
define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR);
}
 
/**
* Load Calendar decorator base class
*/
require_once CALENDAR_ROOT.'Decorator.php';
 
/**
* Static utlities to help with fetching textual representations of months and
* days of the week.
* @package Calendar
* @access public
*/
class Calendar_Util_Textual
{
 
/**
* Returns an array of 12 month names (first index = 1)
* @param string (optional) format of returned months (one,two,short or long)
* @return array
* @access public
* @static
*/
function monthNames($format='long')
{
$formats = array('one'=>'%b', 'two'=>'%b', 'short'=>'%b', 'long'=>'%B');
if (!array_key_exists($format,$formats)) {
$format = 'long';
}
$months = array();
for ($i=1; $i<=12; $i++) {
$stamp = mktime(0, 0, 0, $i, 1, 2003);
$month = strftime($formats[$format], $stamp);
switch($format) {
case 'one':
$month = substr($month, 0, 1);
break;
case 'two':
$month = substr($month, 0, 2);
break;
}
$months[$i] = $month;
}
return $months;
}
 
/**
* Returns an array of 7 week day names (first index = 0)
* @param string (optional) format of returned days (one,two,short or long)
* @return array
* @access public
* @static
*/
function weekdayNames($format='long')
{
$formats = array('one'=>'%a', 'two'=>'%a', 'short'=>'%a', 'long'=>'%A');
if (!array_key_exists($format,$formats)) {
$format = 'long';
}
$days = array();
for ($i=0; $i<=6; $i++) {
$stamp = mktime(0, 0, 0, 11, $i+2, 2003);
$day = strftime($formats[$format], $stamp);
switch($format) {
case 'one':
$day = substr($day, 0, 1);
break;
case 'two':
$day = substr($day, 0, 2);
break;
}
$days[$i] = $day;
}
return $days;
}
 
/**
* Returns textual representation of the previous month of the decorated calendar object
* @param object subclass of Calendar e.g. Calendar_Month
* @param string (optional) format of returned months (one,two,short or long)
* @return string
* @access public
* @static
*/
function prevMonthName($Calendar, $format='long')
{
$months = Calendar_Util_Textual::monthNames($format);
return $months[$Calendar->prevMonth()];
}
 
/**
* Returns textual representation of the month of the decorated calendar object
* @param object subclass of Calendar e.g. Calendar_Month
* @param string (optional) format of returned months (one,two,short or long)
* @return string
* @access public
* @static
*/
function thisMonthName($Calendar, $format='long')
{
$months = Calendar_Util_Textual::monthNames($format);
return $months[$Calendar->thisMonth()];
}
 
/**
* Returns textual representation of the next month of the decorated calendar object
* @param object subclass of Calendar e.g. Calendar_Month
* @param string (optional) format of returned months (one,two,short or long)
* @return string
* @access public
* @static
*/
function nextMonthName($Calendar, $format='long')
{
$months = Calendar_Util_Textual::monthNames($format);
return $months[$Calendar->nextMonth()];
}
 
/**
* Returns textual representation of the previous day of week of the decorated calendar object
* <b>Note:</b> Requires PEAR::Date
* @param object subclass of Calendar e.g. Calendar_Month
* @param string (optional) format of returned months (one,two,short or long)
* @return string
* @access public
* @static
*/
function prevDayName($Calendar, $format='long')
{
$days = Calendar_Util_Textual::weekdayNames($format);
$stamp = $Calendar->prevDay('timestamp');
$cE = $Calendar->getEngine();
require_once 'Date/Calc.php';
$day = Date_Calc::dayOfWeek($cE->stampToDay($stamp),
$cE->stampToMonth($stamp), $cE->stampToYear($stamp));
return $days[$day];
}
 
/**
* Returns textual representation of the day of week of the decorated calendar object
* <b>Note:</b> Requires PEAR::Date
* @param object subclass of Calendar e.g. Calendar_Month
* @param string (optional) format of returned months (one,two,short or long)
* @return string
* @access public
* @static
*/
function thisDayName($Calendar, $format='long')
{
$days = Calendar_Util_Textual::weekdayNames($format);
require_once 'Date/Calc.php';
$day = Date_Calc::dayOfWeek($Calendar->thisDay(), $Calendar->thisMonth(), $Calendar->thisYear());
return $days[$day];
}
 
/**
* Returns textual representation of the next day of week of the decorated calendar object
* @param object subclass of Calendar e.g. Calendar_Month
* @param string (optional) format of returned months (one,two,short or long)
* @return string
* @access public
* @static
*/
function nextDayName($Calendar, $format='long')
{
$days = Calendar_Util_Textual::weekdayNames($format);
$stamp = $Calendar->nextDay('timestamp');
$cE = $Calendar->getEngine();
require_once 'Date/Calc.php';
$day = Date_Calc::dayOfWeek($cE->stampToDay($stamp),
$cE->stampToMonth($stamp), $cE->stampToYear($stamp));
return $days[$day];
}
 
/**
* Returns the days of the week using the order defined in the decorated
* calendar object. Only useful for Calendar_Month_Weekdays, Calendar_Month_Weeks
* and Calendar_Week. Otherwise the returned array will begin on Sunday
* @param object subclass of Calendar e.g. Calendar_Month
* @param string (optional) format of returned months (one,two,short or long)
* @return array ordered array of week day names
* @access public
* @static
*/
function orderedWeekdays($Calendar, $format='long')
{
$days = Calendar_Util_Textual::weekdayNames($format);
// Not so good - need methods to access this information perhaps...
if (isset($Calendar->tableHelper)) {
$ordereddays = $Calendar->tableHelper->daysOfWeek;
} else {
$ordereddays = array(0, 1, 2, 3, 4, 5, 6);
}
$ordereddays = array_flip($ordereddays);
$i = 0;
$returndays = array();
foreach ($ordereddays as $key => $value) {
$returndays[$i] = $days[$key];
$i++;
}
return $returndays;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/DB.php
New file
0,0 → 1,1388
<?php
 
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 
/**
* Database independent query interface
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Database
* @package DB
* @author Stig Bakken <ssb@php.net>
* @author Tomas V.V.Cox <cox@idecnet.com>
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id: DB.php,v 1.3 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/DB
*/
 
/**
* Obtain the PEAR class so it can be extended from
*/
require_once 'PEAR.php';
 
 
// {{{ constants
// {{{ error codes
 
/**#@+
* One of PEAR DB's portable error codes.
* @see DB_common::errorCode(), DB::errorMessage()
*
* {@internal If you add an error code here, make sure you also add a textual
* version of it in DB::errorMessage().}}
*/
 
/**
* The code returned by many methods upon success
*/
define('DB_OK', 1);
 
/**
* Unkown error
*/
define('DB_ERROR', -1);
 
/**
* Syntax error
*/
define('DB_ERROR_SYNTAX', -2);
 
/**
* Tried to insert a duplicate value into a primary or unique index
*/
define('DB_ERROR_CONSTRAINT', -3);
 
/**
* An identifier in the query refers to a non-existant object
*/
define('DB_ERROR_NOT_FOUND', -4);
 
/**
* Tried to create a duplicate object
*/
define('DB_ERROR_ALREADY_EXISTS', -5);
 
/**
* The current driver does not support the action you attempted
*/
define('DB_ERROR_UNSUPPORTED', -6);
 
/**
* The number of parameters does not match the number of placeholders
*/
define('DB_ERROR_MISMATCH', -7);
 
/**
* A literal submitted did not match the data type expected
*/
define('DB_ERROR_INVALID', -8);
 
/**
* The current DBMS does not support the action you attempted
*/
define('DB_ERROR_NOT_CAPABLE', -9);
 
/**
* A literal submitted was too long so the end of it was removed
*/
define('DB_ERROR_TRUNCATED', -10);
 
/**
* A literal number submitted did not match the data type expected
*/
define('DB_ERROR_INVALID_NUMBER', -11);
 
/**
* A literal date submitted did not match the data type expected
*/
define('DB_ERROR_INVALID_DATE', -12);
 
/**
* Attempt to divide something by zero
*/
define('DB_ERROR_DIVZERO', -13);
 
/**
* A database needs to be selected
*/
define('DB_ERROR_NODBSELECTED', -14);
 
/**
* Could not create the object requested
*/
define('DB_ERROR_CANNOT_CREATE', -15);
 
/**
* Could not drop the database requested because it does not exist
*/
define('DB_ERROR_CANNOT_DROP', -17);
 
/**
* An identifier in the query refers to a non-existant table
*/
define('DB_ERROR_NOSUCHTABLE', -18);
 
/**
* An identifier in the query refers to a non-existant column
*/
define('DB_ERROR_NOSUCHFIELD', -19);
 
/**
* The data submitted to the method was inappropriate
*/
define('DB_ERROR_NEED_MORE_DATA', -20);
 
/**
* The attempt to lock the table failed
*/
define('DB_ERROR_NOT_LOCKED', -21);
 
/**
* The number of columns doesn't match the number of values
*/
define('DB_ERROR_VALUE_COUNT_ON_ROW', -22);
 
/**
* The DSN submitted has problems
*/
define('DB_ERROR_INVALID_DSN', -23);
 
/**
* Could not connect to the database
*/
define('DB_ERROR_CONNECT_FAILED', -24);
 
/**
* The PHP extension needed for this DBMS could not be found
*/
define('DB_ERROR_EXTENSION_NOT_FOUND',-25);
 
/**
* The present user has inadequate permissions to perform the task requestd
*/
define('DB_ERROR_ACCESS_VIOLATION', -26);
 
/**
* The database requested does not exist
*/
define('DB_ERROR_NOSUCHDB', -27);
 
/**
* Tried to insert a null value into a column that doesn't allow nulls
*/
define('DB_ERROR_CONSTRAINT_NOT_NULL',-29);
/**#@-*/
 
 
// }}}
// {{{ prepared statement-related
 
 
/**#@+
* Identifiers for the placeholders used in prepared statements.
* @see DB_common::prepare()
*/
 
/**
* Indicates a scalar (<kbd>?</kbd>) placeholder was used
*
* Quote and escape the value as necessary.
*/
define('DB_PARAM_SCALAR', 1);
 
/**
* Indicates an opaque (<kbd>&</kbd>) placeholder was used
*
* The value presented is a file name. Extract the contents of that file
* and place them in this column.
*/
define('DB_PARAM_OPAQUE', 2);
 
/**
* Indicates a misc (<kbd>!</kbd>) placeholder was used
*
* The value should not be quoted or escaped.
*/
define('DB_PARAM_MISC', 3);
/**#@-*/
 
 
// }}}
// {{{ binary data-related
 
 
/**#@+
* The different ways of returning binary data from queries.
*/
 
/**
* Sends the fetched data straight through to output
*/
define('DB_BINMODE_PASSTHRU', 1);
 
/**
* Lets you return data as usual
*/
define('DB_BINMODE_RETURN', 2);
 
/**
* Converts the data to hex format before returning it
*
* For example the string "123" would become "313233".
*/
define('DB_BINMODE_CONVERT', 3);
/**#@-*/
 
 
// }}}
// {{{ fetch modes
 
 
/**#@+
* Fetch Modes.
* @see DB_common::setFetchMode()
*/
 
/**
* Indicates the current default fetch mode should be used
* @see DB_common::$fetchmode
*/
define('DB_FETCHMODE_DEFAULT', 0);
 
/**
* Column data indexed by numbers, ordered from 0 and up
*/
define('DB_FETCHMODE_ORDERED', 1);
 
/**
* Column data indexed by column names
*/
define('DB_FETCHMODE_ASSOC', 2);
 
/**
* Column data as object properties
*/
define('DB_FETCHMODE_OBJECT', 3);
 
/**
* For multi-dimensional results, make the column name the first level
* of the array and put the row number in the second level of the array
*
* This is flipped from the normal behavior, which puts the row numbers
* in the first level of the array and the column names in the second level.
*/
define('DB_FETCHMODE_FLIPPED', 4);
/**#@-*/
 
/**#@+
* Old fetch modes. Left here for compatibility.
*/
define('DB_GETMODE_ORDERED', DB_FETCHMODE_ORDERED);
define('DB_GETMODE_ASSOC', DB_FETCHMODE_ASSOC);
define('DB_GETMODE_FLIPPED', DB_FETCHMODE_FLIPPED);
/**#@-*/
 
 
// }}}
// {{{ tableInfo() && autoPrepare()-related
 
 
/**#@+
* The type of information to return from the tableInfo() method.
*
* Bitwised constants, so they can be combined using <kbd>|</kbd>
* and removed using <kbd>^</kbd>.
*
* @see DB_common::tableInfo()
*
* {@internal Since the TABLEINFO constants are bitwised, if more of them are
* added in the future, make sure to adjust DB_TABLEINFO_FULL accordingly.}}
*/
define('DB_TABLEINFO_ORDER', 1);
define('DB_TABLEINFO_ORDERTABLE', 2);
define('DB_TABLEINFO_FULL', 3);
/**#@-*/
 
 
/**#@+
* The type of query to create with the automatic query building methods.
* @see DB_common::autoPrepare(), DB_common::autoExecute()
*/
define('DB_AUTOQUERY_INSERT', 1);
define('DB_AUTOQUERY_UPDATE', 2);
/**#@-*/
 
 
// }}}
// {{{ portability modes
 
 
/**#@+
* Portability Modes.
*
* Bitwised constants, so they can be combined using <kbd>|</kbd>
* and removed using <kbd>^</kbd>.
*
* @see DB_common::setOption()
*
* {@internal Since the PORTABILITY constants are bitwised, if more of them are
* added in the future, make sure to adjust DB_PORTABILITY_ALL accordingly.}}
*/
 
/**
* Turn off all portability features
*/
define('DB_PORTABILITY_NONE', 0);
 
/**
* Convert names of tables and fields to lower case
* when using the get*(), fetch*() and tableInfo() methods
*/
define('DB_PORTABILITY_LOWERCASE', 1);
 
/**
* Right trim the data output by get*() and fetch*()
*/
define('DB_PORTABILITY_RTRIM', 2);
 
/**
* Force reporting the number of rows deleted
*/
define('DB_PORTABILITY_DELETE_COUNT', 4);
 
/**
* Enable hack that makes numRows() work in Oracle
*/
define('DB_PORTABILITY_NUMROWS', 8);
 
/**
* Makes certain error messages in certain drivers compatible
* with those from other DBMS's
*
* + mysql, mysqli: change unique/primary key constraints
* DB_ERROR_ALREADY_EXISTS -> DB_ERROR_CONSTRAINT
*
* + odbc(access): MS's ODBC driver reports 'no such field' as code
* 07001, which means 'too few parameters.' When this option is on
* that code gets mapped to DB_ERROR_NOSUCHFIELD.
*/
define('DB_PORTABILITY_ERRORS', 16);
 
/**
* Convert null values to empty strings in data output by
* get*() and fetch*()
*/
define('DB_PORTABILITY_NULL_TO_EMPTY', 32);
 
/**
* Turn on all portability features
*/
define('DB_PORTABILITY_ALL', 63);
/**#@-*/
 
// }}}
 
 
// }}}
// {{{ class DB
 
/**
* Database independent query interface
*
* The main "DB" class is simply a container class with some static
* methods for creating DB objects as well as some utility functions
* common to all parts of DB.
*
* The object model of DB is as follows (indentation means inheritance):
* <pre>
* DB The main DB class. This is simply a utility class
* with some "static" methods for creating DB objects as
* well as common utility functions for other DB classes.
*
* DB_common The base for each DB implementation. Provides default
* | implementations (in OO lingo virtual methods) for
* | the actual DB implementations as well as a bunch of
* | query utility functions.
* |
* +-DB_mysql The DB implementation for MySQL. Inherits DB_common.
* When calling DB::factory or DB::connect for MySQL
* connections, the object returned is an instance of this
* class.
* </pre>
*
* @category Database
* @package DB
* @author Stig Bakken <ssb@php.net>
* @author Tomas V.V.Cox <cox@idecnet.com>
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version Release: 1.7.6
* @link http://pear.php.net/package/DB
*/
class DB
{
// {{{ &factory()
 
/**
* Create a new DB object for the specified database type but don't
* connect to the database
*
* @param string $type the database type (eg "mysql")
* @param array $options an associative array of option names and values
*
* @return object a new DB object. A DB_Error object on failure.
*
* @see DB_common::setOption()
*/
function &factory($type, $options = false)
{
if (!is_array($options)) {
$options = array('persistent' => $options);
}
 
if (isset($options['debug']) && $options['debug'] >= 2) {
// expose php errors with sufficient debug level
include_once "DB/{$type}.php";
} else {
@include_once "DB/{$type}.php";
}
 
$classname = "DB_${type}";
 
if (!class_exists($classname)) {
$tmp = PEAR::raiseError(null, DB_ERROR_NOT_FOUND, null, null,
"Unable to include the DB/{$type}.php"
. " file for '$dsn'",
'DB_Error', true);
return $tmp;
}
 
@$obj =& new $classname;
 
foreach ($options as $option => $value) {
$test = $obj->setOption($option, $value);
if (DB::isError($test)) {
return $test;
}
}
 
return $obj;
}
 
// }}}
// {{{ &connect()
 
/**
* Create a new DB object including a connection to the specified database
*
* Example 1.
* <code>
* require_once 'DB.php';
*
* $dsn = 'pgsql://user:password@host/database';
* $options = array(
* 'debug' => 2,
* 'portability' => DB_PORTABILITY_ALL,
* );
*
* $db =& DB::connect($dsn, $options);
* if (PEAR::isError($db)) {
* die($db->getMessage());
* }
* </code>
*
* @param mixed $dsn the string "data source name" or array in the
* format returned by DB::parseDSN()
* @param array $options an associative array of option names and values
*
* @return object a new DB object. A DB_Error object on failure.
*
* @uses DB_dbase::connect(), DB_fbsql::connect(), DB_ibase::connect(),
* DB_ifx::connect(), DB_msql::connect(), DB_mssql::connect(),
* DB_mysql::connect(), DB_mysqli::connect(), DB_oci8::connect(),
* DB_odbc::connect(), DB_pgsql::connect(), DB_sqlite::connect(),
* DB_sybase::connect()
*
* @uses DB::parseDSN(), DB_common::setOption(), PEAR::isError()
*/
function &connect($dsn, $options = array())
{
$dsninfo = DB::parseDSN($dsn);
$type = $dsninfo['phptype'];
 
if (!is_array($options)) {
/*
* For backwards compatibility. $options used to be boolean,
* indicating whether the connection should be persistent.
*/
$options = array('persistent' => $options);
}
 
if (isset($options['debug']) && $options['debug'] >= 2) {
// expose php errors with sufficient debug level
include_once "DB/${type}.php";
} else {
@include_once "DB/${type}.php";
}
 
$classname = "DB_${type}";
if (!class_exists($classname)) {
$tmp = PEAR::raiseError(null, DB_ERROR_NOT_FOUND, null, null,
"Unable to include the DB/{$type}.php"
. " file for '$dsn'",
'DB_Error', true);
return $tmp;
}
 
@$obj =& new $classname;
 
foreach ($options as $option => $value) {
$test = $obj->setOption($option, $value);
if (DB::isError($test)) {
return $test;
}
}
 
$err = $obj->connect($dsninfo, $obj->getOption('persistent'));
if (DB::isError($err)) {
$err->addUserInfo($dsn);
return $err;
}
 
return $obj;
}
 
// }}}
// {{{ apiVersion()
 
/**
* Return the DB API version
*
* @return string the DB API version number
*/
function apiVersion()
{
return '1.7.6';
}
 
// }}}
// {{{ isError()
 
/**
* Determines if a variable is a DB_Error object
*
* @param mixed $value the variable to check
*
* @return bool whether $value is DB_Error object
*/
function isError($value)
{
return is_a($value, 'DB_Error');
}
 
// }}}
// {{{ isConnection()
 
/**
* Determines if a value is a DB_<driver> object
*
* @param mixed $value the value to test
*
* @return bool whether $value is a DB_<driver> object
*/
function isConnection($value)
{
return (is_object($value) &&
is_subclass_of($value, 'db_common') &&
method_exists($value, 'simpleQuery'));
}
 
// }}}
// {{{ isManip()
 
/**
* Tell whether a query is a data manipulation or data definition query
*
* Examples of data manipulation queries are INSERT, UPDATE and DELETE.
* Examples of data definition queries are CREATE, DROP, ALTER, GRANT,
* REVOKE.
*
* @param string $query the query
*
* @return boolean whether $query is a data manipulation query
*/
function isManip($query)
{
$manips = 'INSERT|UPDATE|DELETE|REPLACE|'
. 'CREATE|DROP|'
. 'LOAD DATA|SELECT .* INTO|COPY|'
. 'ALTER|GRANT|REVOKE|'
. 'LOCK|UNLOCK';
if (preg_match('/^\s*"?(' . $manips . ')\s+/i', $query)) {
return true;
}
return false;
}
 
// }}}
// {{{ errorMessage()
 
/**
* Return a textual error message for a DB error code
*
* @param integer $value the DB error code
*
* @return string the error message or false if the error code was
* not recognized
*/
function errorMessage($value)
{
static $errorMessages;
if (!isset($errorMessages)) {
$errorMessages = array(
DB_ERROR => 'unknown error',
DB_ERROR_ACCESS_VIOLATION => 'insufficient permissions',
DB_ERROR_ALREADY_EXISTS => 'already exists',
DB_ERROR_CANNOT_CREATE => 'can not create',
DB_ERROR_CANNOT_DROP => 'can not drop',
DB_ERROR_CONNECT_FAILED => 'connect failed',
DB_ERROR_CONSTRAINT => 'constraint violation',
DB_ERROR_CONSTRAINT_NOT_NULL=> 'null value violates not-null constraint',
DB_ERROR_DIVZERO => 'division by zero',
DB_ERROR_EXTENSION_NOT_FOUND=> 'extension not found',
DB_ERROR_INVALID => 'invalid',
DB_ERROR_INVALID_DATE => 'invalid date or time',
DB_ERROR_INVALID_DSN => 'invalid DSN',
DB_ERROR_INVALID_NUMBER => 'invalid number',
DB_ERROR_MISMATCH => 'mismatch',
DB_ERROR_NEED_MORE_DATA => 'insufficient data supplied',
DB_ERROR_NODBSELECTED => 'no database selected',
DB_ERROR_NOSUCHDB => 'no such database',
DB_ERROR_NOSUCHFIELD => 'no such field',
DB_ERROR_NOSUCHTABLE => 'no such table',
DB_ERROR_NOT_CAPABLE => 'DB backend not capable',
DB_ERROR_NOT_FOUND => 'not found',
DB_ERROR_NOT_LOCKED => 'not locked',
DB_ERROR_SYNTAX => 'syntax error',
DB_ERROR_UNSUPPORTED => 'not supported',
DB_ERROR_TRUNCATED => 'truncated',
DB_ERROR_VALUE_COUNT_ON_ROW => 'value count on row',
DB_OK => 'no error',
);
}
 
if (DB::isError($value)) {
$value = $value->getCode();
}
 
return isset($errorMessages[$value]) ? $errorMessages[$value]
: $errorMessages[DB_ERROR];
}
 
// }}}
// {{{ parseDSN()
 
/**
* Parse a data source name
*
* Additional keys can be added by appending a URI query string to the
* end of the DSN.
*
* The format of the supplied DSN is in its fullest form:
* <code>
* phptype(dbsyntax)://username:password@protocol+hostspec/database?option=8&another=true
* </code>
*
* Most variations are allowed:
* <code>
* phptype://username:password@protocol+hostspec:110//usr/db_file.db?mode=0644
* phptype://username:password@hostspec/database_name
* phptype://username:password@hostspec
* phptype://username@hostspec
* phptype://hostspec/database
* phptype://hostspec
* phptype(dbsyntax)
* phptype
* </code>
*
* @param string $dsn Data Source Name to be parsed
*
* @return array an associative array with the following keys:
* + phptype: Database backend used in PHP (mysql, odbc etc.)
* + dbsyntax: Database used with regards to SQL syntax etc.
* + protocol: Communication protocol to use (tcp, unix etc.)
* + hostspec: Host specification (hostname[:port])
* + database: Database to use on the DBMS server
* + username: User name for login
* + password: Password for login
*/
function parseDSN($dsn)
{
$parsed = array(
'phptype' => false,
'dbsyntax' => false,
'username' => false,
'password' => false,
'protocol' => false,
'hostspec' => false,
'port' => false,
'socket' => false,
'database' => false,
);
 
if (is_array($dsn)) {
$dsn = array_merge($parsed, $dsn);
if (!$dsn['dbsyntax']) {
$dsn['dbsyntax'] = $dsn['phptype'];
}
return $dsn;
}
 
// Find phptype and dbsyntax
if (($pos = strpos($dsn, '://')) !== false) {
$str = substr($dsn, 0, $pos);
$dsn = substr($dsn, $pos + 3);
} else {
$str = $dsn;
$dsn = null;
}
 
// Get phptype and dbsyntax
// $str => phptype(dbsyntax)
if (preg_match('/^(.+?)\((.*?)\)$/', $str, $arr)) {
$parsed['phptype'] = $arr[1];
$parsed['dbsyntax'] = !$arr[2] ? $arr[1] : $arr[2];
} else {
$parsed['phptype'] = $str;
$parsed['dbsyntax'] = $str;
}
 
if (!count($dsn)) {
return $parsed;
}
 
// Get (if found): username and password
// $dsn => username:password@protocol+hostspec/database
if (($at = strrpos($dsn,'@')) !== false) {
$str = substr($dsn, 0, $at);
$dsn = substr($dsn, $at + 1);
if (($pos = strpos($str, ':')) !== false) {
$parsed['username'] = rawurldecode(substr($str, 0, $pos));
$parsed['password'] = rawurldecode(substr($str, $pos + 1));
} else {
$parsed['username'] = rawurldecode($str);
}
}
 
// Find protocol and hostspec
 
if (preg_match('|^([^(]+)\((.*?)\)/?(.*?)$|', $dsn, $match)) {
// $dsn => proto(proto_opts)/database
$proto = $match[1];
$proto_opts = $match[2] ? $match[2] : false;
$dsn = $match[3];
 
} else {
// $dsn => protocol+hostspec/database (old format)
if (strpos($dsn, '+') !== false) {
list($proto, $dsn) = explode('+', $dsn, 2);
}
if (strpos($dsn, '/') !== false) {
list($proto_opts, $dsn) = explode('/', $dsn, 2);
} else {
$proto_opts = $dsn;
$dsn = null;
}
}
 
// process the different protocol options
$parsed['protocol'] = (!empty($proto)) ? $proto : 'tcp';
$proto_opts = rawurldecode($proto_opts);
if ($parsed['protocol'] == 'tcp') {
if (strpos($proto_opts, ':') !== false) {
list($parsed['hostspec'],
$parsed['port']) = explode(':', $proto_opts);
} else {
$parsed['hostspec'] = $proto_opts;
}
} elseif ($parsed['protocol'] == 'unix') {
$parsed['socket'] = $proto_opts;
}
 
// Get dabase if any
// $dsn => database
if ($dsn) {
if (($pos = strpos($dsn, '?')) === false) {
// /database
$parsed['database'] = rawurldecode($dsn);
} else {
// /database?param1=value1&param2=value2
$parsed['database'] = rawurldecode(substr($dsn, 0, $pos));
$dsn = substr($dsn, $pos + 1);
if (strpos($dsn, '&') !== false) {
$opts = explode('&', $dsn);
} else { // database?param1=value1
$opts = array($dsn);
}
foreach ($opts as $opt) {
list($key, $value) = explode('=', $opt);
if (!isset($parsed[$key])) {
// don't allow params overwrite
$parsed[$key] = rawurldecode($value);
}
}
}
}
 
return $parsed;
}
 
// }}}
}
 
// }}}
// {{{ class DB_Error
 
/**
* DB_Error implements a class for reporting portable database error
* messages
*
* @category Database
* @package DB
* @author Stig Bakken <ssb@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version Release: 1.7.6
* @link http://pear.php.net/package/DB
*/
class DB_Error extends PEAR_Error
{
// {{{ constructor
 
/**
* DB_Error constructor
*
* @param mixed $code DB error code, or string with error message
* @param int $mode what "error mode" to operate in
* @param int $level what error level to use for $mode &
* PEAR_ERROR_TRIGGER
* @param mixed $debuginfo additional debug info, such as the last query
*
* @see PEAR_Error
*/
function DB_Error($code = DB_ERROR, $mode = PEAR_ERROR_RETURN,
$level = E_USER_NOTICE, $debuginfo = null)
{
if (is_int($code)) {
$this->PEAR_Error('DB Error: ' . DB::errorMessage($code), $code,
$mode, $level, $debuginfo);
} else {
$this->PEAR_Error("DB Error: $code", DB_ERROR,
$mode, $level, $debuginfo);
}
}
 
// }}}
}
 
// }}}
// {{{ class DB_result
 
/**
* This class implements a wrapper for a DB result set
*
* A new instance of this class will be returned by the DB implementation
* after processing a query that returns data.
*
* @category Database
* @package DB
* @author Stig Bakken <ssb@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version Release: 1.7.6
* @link http://pear.php.net/package/DB
*/
class DB_result
{
// {{{ properties
 
/**
* Should results be freed automatically when there are no more rows?
* @var boolean
* @see DB_common::$options
*/
var $autofree;
 
/**
* A reference to the DB_<driver> object
* @var object
*/
var $dbh;
 
/**
* The current default fetch mode
* @var integer
* @see DB_common::$fetchmode
*/
var $fetchmode;
 
/**
* The name of the class into which results should be fetched when
* DB_FETCHMODE_OBJECT is in effect
*
* @var string
* @see DB_common::$fetchmode_object_class
*/
var $fetchmode_object_class;
 
/**
* The number of rows to fetch from a limit query
* @var integer
*/
var $limit_count = null;
 
/**
* The row to start fetching from in limit queries
* @var integer
*/
var $limit_from = null;
 
/**
* The execute parameters that created this result
* @var array
* @since Property available since Release 1.7.0
*/
var $parameters;
 
/**
* The query string that created this result
*
* Copied here incase it changes in $dbh, which is referenced
*
* @var string
* @since Property available since Release 1.7.0
*/
var $query;
 
/**
* The query result resource id created by PHP
* @var resource
*/
var $result;
 
/**
* The present row being dealt with
* @var integer
*/
var $row_counter = null;
 
/**
* The prepared statement resource id created by PHP in $dbh
*
* This resource is only available when the result set was created using
* a driver's native execute() method, not PEAR DB's emulated one.
*
* Copied here incase it changes in $dbh, which is referenced
*
* {@internal Mainly here because the InterBase/Firebird API is only
* able to retrieve data from result sets if the statemnt handle is
* still in scope.}}
*
* @var resource
* @since Property available since Release 1.7.0
*/
var $statement;
 
 
// }}}
// {{{ constructor
 
/**
* This constructor sets the object's properties
*
* @param object &$dbh the DB object reference
* @param resource $result the result resource id
* @param array $options an associative array with result options
*
* @return void
*/
function DB_result(&$dbh, $result, $options = array())
{
$this->autofree = $dbh->options['autofree'];
$this->dbh = &$dbh;
$this->fetchmode = $dbh->fetchmode;
$this->fetchmode_object_class = $dbh->fetchmode_object_class;
$this->parameters = $dbh->last_parameters;
$this->query = $dbh->last_query;
$this->result = $result;
$this->statement = empty($dbh->last_stmt) ? null : $dbh->last_stmt;
foreach ($options as $key => $value) {
$this->setOption($key, $value);
}
}
 
/**
* Set options for the DB_result object
*
* @param string $key the option to set
* @param mixed $value the value to set the option to
*
* @return void
*/
function setOption($key, $value = null)
{
switch ($key) {
case 'limit_from':
$this->limit_from = $value;
break;
case 'limit_count':
$this->limit_count = $value;
}
}
 
// }}}
// {{{ fetchRow()
 
/**
* Fetch a row of data and return it by reference into an array
*
* The type of array returned can be controlled either by setting this
* method's <var>$fetchmode</var> parameter or by changing the default
* fetch mode setFetchMode() before calling this method.
*
* There are two options for standardizing the information returned
* from databases, ensuring their values are consistent when changing
* DBMS's. These portability options can be turned on when creating a
* new DB object or by using setOption().
*
* + <var>DB_PORTABILITY_LOWERCASE</var>
* convert names of fields to lower case
*
* + <var>DB_PORTABILITY_RTRIM</var>
* right trim the data
*
* @param int $fetchmode the constant indicating how to format the data
* @param int $rownum the row number to fetch (index starts at 0)
*
* @return mixed an array or object containing the row's data,
* NULL when the end of the result set is reached
* or a DB_Error object on failure.
*
* @see DB_common::setOption(), DB_common::setFetchMode()
*/
function &fetchRow($fetchmode = DB_FETCHMODE_DEFAULT, $rownum = null)
{
if ($fetchmode === DB_FETCHMODE_DEFAULT) {
$fetchmode = $this->fetchmode;
}
if ($fetchmode === DB_FETCHMODE_OBJECT) {
$fetchmode = DB_FETCHMODE_ASSOC;
$object_class = $this->fetchmode_object_class;
}
if ($this->limit_from !== null) {
if ($this->row_counter === null) {
$this->row_counter = $this->limit_from;
// Skip rows
if ($this->dbh->features['limit'] === false) {
$i = 0;
while ($i++ < $this->limit_from) {
$this->dbh->fetchInto($this->result, $arr, $fetchmode);
}
}
}
if ($this->row_counter >= ($this->limit_from + $this->limit_count))
{
if ($this->autofree) {
$this->free();
}
$tmp = null;
return $tmp;
}
if ($this->dbh->features['limit'] === 'emulate') {
$rownum = $this->row_counter;
}
$this->row_counter++;
}
$res = $this->dbh->fetchInto($this->result, $arr, $fetchmode, $rownum);
if ($res === DB_OK) {
if (isset($object_class)) {
// The default mode is specified in the
// DB_common::fetchmode_object_class property
if ($object_class == 'stdClass') {
$arr = (object) $arr;
} else {
$arr = &new $object_class($arr);
}
}
return $arr;
}
if ($res == null && $this->autofree) {
$this->free();
}
return $res;
}
 
// }}}
// {{{ fetchInto()
 
/**
* Fetch a row of data into an array which is passed by reference
*
* The type of array returned can be controlled either by setting this
* method's <var>$fetchmode</var> parameter or by changing the default
* fetch mode setFetchMode() before calling this method.
*
* There are two options for standardizing the information returned
* from databases, ensuring their values are consistent when changing
* DBMS's. These portability options can be turned on when creating a
* new DB object or by using setOption().
*
* + <var>DB_PORTABILITY_LOWERCASE</var>
* convert names of fields to lower case
*
* + <var>DB_PORTABILITY_RTRIM</var>
* right trim the data
*
* @param array &$arr the variable where the data should be placed
* @param int $fetchmode the constant indicating how to format the data
* @param int $rownum the row number to fetch (index starts at 0)
*
* @return mixed DB_OK if a row is processed, NULL when the end of the
* result set is reached or a DB_Error object on failure
*
* @see DB_common::setOption(), DB_common::setFetchMode()
*/
function fetchInto(&$arr, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum = null)
{
if ($fetchmode === DB_FETCHMODE_DEFAULT) {
$fetchmode = $this->fetchmode;
}
if ($fetchmode === DB_FETCHMODE_OBJECT) {
$fetchmode = DB_FETCHMODE_ASSOC;
$object_class = $this->fetchmode_object_class;
}
if ($this->limit_from !== null) {
if ($this->row_counter === null) {
$this->row_counter = $this->limit_from;
// Skip rows
if ($this->dbh->features['limit'] === false) {
$i = 0;
while ($i++ < $this->limit_from) {
$this->dbh->fetchInto($this->result, $arr, $fetchmode);
}
}
}
if ($this->row_counter >= (
$this->limit_from + $this->limit_count))
{
if ($this->autofree) {
$this->free();
}
return null;
}
if ($this->dbh->features['limit'] === 'emulate') {
$rownum = $this->row_counter;
}
 
$this->row_counter++;
}
$res = $this->dbh->fetchInto($this->result, $arr, $fetchmode, $rownum);
if ($res === DB_OK) {
if (isset($object_class)) {
// default mode specified in the
// DB_common::fetchmode_object_class property
if ($object_class == 'stdClass') {
$arr = (object) $arr;
} else {
$arr = new $object_class($arr);
}
}
return DB_OK;
}
if ($res == null && $this->autofree) {
$this->free();
}
return $res;
}
 
// }}}
// {{{ numCols()
 
/**
* Get the the number of columns in a result set
*
* @return int the number of columns. A DB_Error object on failure.
*/
function numCols()
{
return $this->dbh->numCols($this->result);
}
 
// }}}
// {{{ numRows()
 
/**
* Get the number of rows in a result set
*
* @return int the number of rows. A DB_Error object on failure.
*/
function numRows()
{
if ($this->dbh->features['numrows'] === 'emulate'
&& $this->dbh->options['portability'] & DB_PORTABILITY_NUMROWS)
{
if ($this->dbh->features['prepare']) {
$res = $this->dbh->query($this->query, $this->parameters);
} else {
$res = $this->dbh->query($this->query);
}
if (DB::isError($res)) {
return $res;
}
$i = 0;
while ($res->fetchInto($tmp, DB_FETCHMODE_ORDERED)) {
$i++;
}
return $i;
} else {
return $this->dbh->numRows($this->result);
}
}
 
// }}}
// {{{ nextResult()
 
/**
* Get the next result if a batch of queries was executed
*
* @return bool true if a new result is available or false if not
*/
function nextResult()
{
return $this->dbh->nextResult($this->result);
}
 
// }}}
// {{{ free()
 
/**
* Frees the resources allocated for this result set
*
* @return bool true on success. A DB_Error object on failure.
*/
function free()
{
$err = $this->dbh->freeResult($this->result);
if (DB::isError($err)) {
return $err;
}
$this->result = false;
$this->statement = false;
return true;
}
 
// }}}
// {{{ tableInfo()
 
/**
* @see DB_common::tableInfo()
* @deprecated Method deprecated some time before Release 1.2
*/
function tableInfo($mode = null)
{
if (is_string($mode)) {
return $this->dbh->raiseError(DB_ERROR_NEED_MORE_DATA);
}
return $this->dbh->tableInfo($this, $mode);
}
 
// }}}
// {{{ getQuery()
 
/**
* Determine the query string that created this result
*
* @return string the query string
*
* @since Method available since Release 1.7.0
*/
function getQuery()
{
return $this->query;
}
 
// }}}
// {{{ getRowCounter()
 
/**
* Tells which row number is currently being processed
*
* @return integer the current row being looked at. Starts at 1.
*/
function getRowCounter()
{
return $this->row_counter;
}
 
// }}}
}
 
// }}}
// {{{ class DB_row
 
/**
* PEAR DB Row Object
*
* The object contains a row of data from a result set. Each column's data
* is placed in a property named for the column.
*
* @category Database
* @package DB
* @author Stig Bakken <ssb@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version Release: 1.7.6
* @link http://pear.php.net/package/DB
* @see DB_common::setFetchMode()
*/
class DB_row
{
// {{{ constructor
 
/**
* The constructor places a row's data into properties of this object
*
* @param array the array containing the row's data
*
* @return void
*/
function DB_row(&$arr)
{
foreach ($arr as $key => $value) {
$this->$key = &$arr[$key];
}
}
 
// }}}
}
 
// }}}
 
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/
 
?>
/tags/Racine_livraison_narmer/api/pear/PEAR.php
New file
0,0 → 1,1101
<?php
/**
* PEAR, the PHP Extension and Application Repository
*
* PEAR class and PEAR_Error class
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category pear
* @package PEAR
* @author Sterling Hughes <sterling@php.net>
* @author Stig Bakken <ssb@php.net>
* @author Tomas V.V.Cox <cox@idecnet.com>
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id: PEAR.php,v 1.2 2006-12-14 15:04:29 jp_milcent Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
 
/**#@+
* ERROR constants
*/
define('PEAR_ERROR_RETURN', 1);
define('PEAR_ERROR_PRINT', 2);
define('PEAR_ERROR_TRIGGER', 4);
define('PEAR_ERROR_DIE', 8);
define('PEAR_ERROR_CALLBACK', 16);
/**
* WARNING: obsolete
* @deprecated
*/
define('PEAR_ERROR_EXCEPTION', 32);
/**#@-*/
define('PEAR_ZE2', (function_exists('version_compare') &&
version_compare(zend_version(), "2-dev", "ge")));
 
if (substr(PHP_OS, 0, 3) == 'WIN') {
define('OS_WINDOWS', true);
define('OS_UNIX', false);
define('PEAR_OS', 'Windows');
} else {
define('OS_WINDOWS', false);
define('OS_UNIX', true);
define('PEAR_OS', 'Unix'); // blatant assumption
}
 
// instant backwards compatibility
if (!defined('PATH_SEPARATOR')) {
if (OS_WINDOWS) {
define('PATH_SEPARATOR', ';');
} else {
define('PATH_SEPARATOR', ':');
}
}
 
$GLOBALS['_PEAR_default_error_mode'] = PEAR_ERROR_RETURN;
$GLOBALS['_PEAR_default_error_options'] = E_USER_NOTICE;
$GLOBALS['_PEAR_destructor_object_list'] = array();
$GLOBALS['_PEAR_shutdown_funcs'] = array();
$GLOBALS['_PEAR_error_handler_stack'] = array();
 
@ini_set('track_errors', true);
 
/**
* Base class for other PEAR classes. Provides rudimentary
* emulation of destructors.
*
* If you want a destructor in your class, inherit PEAR and make a
* destructor method called _yourclassname (same name as the
* constructor, but with a "_" prefix). Also, in your constructor you
* have to call the PEAR constructor: $this->PEAR();.
* The destructor method will be called without parameters. Note that
* at in some SAPI implementations (such as Apache), any output during
* the request shutdown (in which destructors are called) seems to be
* discarded. If you need to get any debug information from your
* destructor, use error_log(), syslog() or something similar.
*
* IMPORTANT! To use the emulated destructors you need to create the
* objects by reference: $obj =& new PEAR_child;
*
* @category pear
* @package PEAR
* @author Stig Bakken <ssb@php.net>
* @author Tomas V.V. Cox <cox@idecnet.com>
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @see PEAR_Error
* @since Class available since PHP 4.0.2
* @link http://pear.php.net/manual/en/core.pear.php#core.pear.pear
*/
class PEAR
{
// {{{ properties
 
/**
* Whether to enable internal debug messages.
*
* @var bool
* @access private
*/
var $_debug = false;
 
/**
* Default error mode for this object.
*
* @var int
* @access private
*/
var $_default_error_mode = null;
 
/**
* Default error options used for this object when error mode
* is PEAR_ERROR_TRIGGER.
*
* @var int
* @access private
*/
var $_default_error_options = null;
 
/**
* Default error handler (callback) for this object, if error mode is
* PEAR_ERROR_CALLBACK.
*
* @var string
* @access private
*/
var $_default_error_handler = '';
 
/**
* Which class to use for error objects.
*
* @var string
* @access private
*/
var $_error_class = 'PEAR_Error';
 
/**
* An array of expected errors.
*
* @var array
* @access private
*/
var $_expected_errors = array();
 
// }}}
 
// {{{ constructor
 
/**
* Constructor. Registers this object in
* $_PEAR_destructor_object_list for destructor emulation if a
* destructor object exists.
*
* @param string $error_class (optional) which class to use for
* error objects, defaults to PEAR_Error.
* @access public
* @return void
*/
function PEAR($error_class = null)
{
$classname = strtolower(get_class($this));
if ($this->_debug) {
print "PEAR constructor called, class=$classname\n";
}
if ($error_class !== null) {
$this->_error_class = $error_class;
}
while ($classname && strcasecmp($classname, "pear")) {
$destructor = "_$classname";
if (method_exists($this, $destructor)) {
global $_PEAR_destructor_object_list;
$_PEAR_destructor_object_list[] = &$this;
if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) {
register_shutdown_function("_PEAR_call_destructors");
$GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true;
}
break;
} else {
$classname = get_parent_class($classname);
}
}
}
 
// }}}
// {{{ destructor
 
/**
* Destructor (the emulated type of...). Does nothing right now,
* but is included for forward compatibility, so subclass
* destructors should always call it.
*
* See the note in the class desciption about output from
* destructors.
*
* @access public
* @return void
*/
function _PEAR() {
if ($this->_debug) {
printf("PEAR destructor called, class=%s\n", strtolower(get_class($this)));
}
}
 
// }}}
// {{{ getStaticProperty()
 
/**
* If you have a class that's mostly/entirely static, and you need static
* properties, you can use this method to simulate them. Eg. in your method(s)
* do this: $myVar = &PEAR::getStaticProperty('myclass', 'myVar');
* You MUST use a reference, or they will not persist!
*
* @access public
* @param string $class The calling classname, to prevent clashes
* @param string $var The variable to retrieve.
* @return mixed A reference to the variable. If not set it will be
* auto initialised to NULL.
*/
function &getStaticProperty($class, $var)
{
static $properties;
return $properties[$class][$var];
}
 
// }}}
// {{{ registerShutdownFunc()
 
/**
* Use this function to register a shutdown method for static
* classes.
*
* @access public
* @param mixed $func The function name (or array of class/method) to call
* @param mixed $args The arguments to pass to the function
* @return void
*/
function registerShutdownFunc($func, $args = array())
{
// if we are called statically, there is a potential
// that no shutdown func is registered. Bug #6445
if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) {
register_shutdown_function("_PEAR_call_destructors");
$GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true;
}
$GLOBALS['_PEAR_shutdown_funcs'][] = array($func, $args);
}
 
// }}}
// {{{ isError()
 
/**
* Tell whether a value is a PEAR error.
*
* @param mixed $data the value to test
* @param int $code if $data is an error object, return true
* only if $code is a string and
* $obj->getMessage() == $code or
* $code is an integer and $obj->getCode() == $code
* @access public
* @return bool true if parameter is an error
*/
function isError($data, $code = null)
{
if (is_a($data, 'PEAR_Error')) {
if (is_null($code)) {
return true;
} elseif (is_string($code)) {
return $data->getMessage() == $code;
} else {
return $data->getCode() == $code;
}
}
return false;
}
 
// }}}
// {{{ setErrorHandling()
 
/**
* Sets how errors generated by this object should be handled.
* Can be invoked both in objects and statically. If called
* statically, setErrorHandling sets the default behaviour for all
* PEAR objects. If called in an object, setErrorHandling sets
* the default behaviour for that object.
*
* @param int $mode
* One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT,
* PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE,
* PEAR_ERROR_CALLBACK or PEAR_ERROR_EXCEPTION.
*
* @param mixed $options
* When $mode is PEAR_ERROR_TRIGGER, this is the error level (one
* of E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR).
*
* When $mode is PEAR_ERROR_CALLBACK, this parameter is expected
* to be the callback function or method. A callback
* function is a string with the name of the function, a
* callback method is an array of two elements: the element
* at index 0 is the object, and the element at index 1 is
* the name of the method to call in the object.
*
* When $mode is PEAR_ERROR_PRINT or PEAR_ERROR_DIE, this is
* a printf format string used when printing the error
* message.
*
* @access public
* @return void
* @see PEAR_ERROR_RETURN
* @see PEAR_ERROR_PRINT
* @see PEAR_ERROR_TRIGGER
* @see PEAR_ERROR_DIE
* @see PEAR_ERROR_CALLBACK
* @see PEAR_ERROR_EXCEPTION
*
* @since PHP 4.0.5
*/
 
function setErrorHandling($mode = null, $options = null)
{
if (isset($this) && is_a($this, 'PEAR')) {
$setmode = &$this->_default_error_mode;
$setoptions = &$this->_default_error_options;
} else {
$setmode = &$GLOBALS['_PEAR_default_error_mode'];
$setoptions = &$GLOBALS['_PEAR_default_error_options'];
}
 
switch ($mode) {
case PEAR_ERROR_EXCEPTION:
case PEAR_ERROR_RETURN:
case PEAR_ERROR_PRINT:
case PEAR_ERROR_TRIGGER:
case PEAR_ERROR_DIE:
case null:
$setmode = $mode;
$setoptions = $options;
break;
 
case PEAR_ERROR_CALLBACK:
$setmode = $mode;
// class/object method callback
if (is_callable($options)) {
$setoptions = $options;
} else {
trigger_error("invalid error callback", E_USER_WARNING);
}
break;
 
default:
trigger_error("invalid error mode", E_USER_WARNING);
break;
}
}
 
// }}}
// {{{ expectError()
 
/**
* This method is used to tell which errors you expect to get.
* Expected errors are always returned with error mode
* PEAR_ERROR_RETURN. Expected error codes are stored in a stack,
* and this method pushes a new element onto it. The list of
* expected errors are in effect until they are popped off the
* stack with the popExpect() method.
*
* Note that this method can not be called statically
*
* @param mixed $code a single error code or an array of error codes to expect
*
* @return int the new depth of the "expected errors" stack
* @access public
*/
function expectError($code = '*')
{
if (is_array($code)) {
array_push($this->_expected_errors, $code);
} else {
array_push($this->_expected_errors, array($code));
}
return sizeof($this->_expected_errors);
}
 
// }}}
// {{{ popExpect()
 
/**
* This method pops one element off the expected error codes
* stack.
*
* @return array the list of error codes that were popped
*/
function popExpect()
{
return array_pop($this->_expected_errors);
}
 
// }}}
// {{{ _checkDelExpect()
 
/**
* This method checks unsets an error code if available
*
* @param mixed error code
* @return bool true if the error code was unset, false otherwise
* @access private
* @since PHP 4.3.0
*/
function _checkDelExpect($error_code)
{
$deleted = false;
 
foreach ($this->_expected_errors AS $key => $error_array) {
if (in_array($error_code, $error_array)) {
unset($this->_expected_errors[$key][array_search($error_code, $error_array)]);
$deleted = true;
}
 
// clean up empty arrays
if (0 == count($this->_expected_errors[$key])) {
unset($this->_expected_errors[$key]);
}
}
return $deleted;
}
 
// }}}
// {{{ delExpect()
 
/**
* This method deletes all occurences of the specified element from
* the expected error codes stack.
*
* @param mixed $error_code error code that should be deleted
* @return mixed list of error codes that were deleted or error
* @access public
* @since PHP 4.3.0
*/
function delExpect($error_code)
{
$deleted = false;
 
if ((is_array($error_code) && (0 != count($error_code)))) {
// $error_code is a non-empty array here;
// we walk through it trying to unset all
// values
foreach($error_code as $key => $error) {
if ($this->_checkDelExpect($error)) {
$deleted = true;
} else {
$deleted = false;
}
}
return $deleted ? true : PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME
} elseif (!empty($error_code)) {
// $error_code comes alone, trying to unset it
if ($this->_checkDelExpect($error_code)) {
return true;
} else {
return PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME
}
} else {
// $error_code is empty
return PEAR::raiseError("The expected error you submitted is empty"); // IMPROVE ME
}
}
 
// }}}
// {{{ raiseError()
 
/**
* This method is a wrapper that returns an instance of the
* configured error class with this object's default error
* handling applied. If the $mode and $options parameters are not
* specified, the object's defaults are used.
*
* @param mixed $message a text error message or a PEAR error object
*
* @param int $code a numeric error code (it is up to your class
* to define these if you want to use codes)
*
* @param int $mode One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT,
* PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE,
* PEAR_ERROR_CALLBACK, PEAR_ERROR_EXCEPTION.
*
* @param mixed $options If $mode is PEAR_ERROR_TRIGGER, this parameter
* specifies the PHP-internal error level (one of
* E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR).
* If $mode is PEAR_ERROR_CALLBACK, this
* parameter specifies the callback function or
* method. In other error modes this parameter
* is ignored.
*
* @param string $userinfo If you need to pass along for example debug
* information, this parameter is meant for that.
*
* @param string $error_class The returned error object will be
* instantiated from this class, if specified.
*
* @param bool $skipmsg If true, raiseError will only pass error codes,
* the error message parameter will be dropped.
*
* @access public
* @return object a PEAR error object
* @see PEAR::setErrorHandling
* @since PHP 4.0.5
*/
function &raiseError($message = null,
$code = null,
$mode = null,
$options = null,
$userinfo = null,
$error_class = null,
$skipmsg = false)
{
// The error is yet a PEAR error object
if (is_object($message)) {
$code = $message->getCode();
$userinfo = $message->getUserInfo();
$error_class = $message->getType();
$message->error_message_prefix = '';
$message = $message->getMessage();
}
 
if (isset($this) && isset($this->_expected_errors) && sizeof($this->_expected_errors) > 0 && sizeof($exp = end($this->_expected_errors))) {
if ($exp[0] == "*" ||
(is_int(reset($exp)) && in_array($code, $exp)) ||
(is_string(reset($exp)) && in_array($message, $exp))) {
$mode = PEAR_ERROR_RETURN;
}
}
// No mode given, try global ones
if ($mode === null) {
// Class error handler
if (isset($this) && isset($this->_default_error_mode)) {
$mode = $this->_default_error_mode;
$options = $this->_default_error_options;
// Global error handler
} elseif (isset($GLOBALS['_PEAR_default_error_mode'])) {
$mode = $GLOBALS['_PEAR_default_error_mode'];
$options = $GLOBALS['_PEAR_default_error_options'];
}
}
 
if ($error_class !== null) {
$ec = $error_class;
} elseif (isset($this) && isset($this->_error_class)) {
$ec = $this->_error_class;
} else {
$ec = 'PEAR_Error';
}
if ($skipmsg) {
$a = &new $ec($code, $mode, $options, $userinfo);
return $a;
} else {
$a = &new $ec($message, $code, $mode, $options, $userinfo);
return $a;
}
}
 
// }}}
// {{{ throwError()
 
/**
* Simpler form of raiseError with fewer options. In most cases
* message, code and userinfo are enough.
*
* @param string $message
*
*/
function &throwError($message = null,
$code = null,
$userinfo = null)
{
if (isset($this) && is_a($this, 'PEAR')) {
$a = &$this->raiseError($message, $code, null, null, $userinfo);
return $a;
} else {
$a = &PEAR::raiseError($message, $code, null, null, $userinfo);
return $a;
}
}
 
// }}}
function staticPushErrorHandling($mode, $options = null)
{
$stack = &$GLOBALS['_PEAR_error_handler_stack'];
$def_mode = &$GLOBALS['_PEAR_default_error_mode'];
$def_options = &$GLOBALS['_PEAR_default_error_options'];
$stack[] = array($def_mode, $def_options);
switch ($mode) {
case PEAR_ERROR_EXCEPTION:
case PEAR_ERROR_RETURN:
case PEAR_ERROR_PRINT:
case PEAR_ERROR_TRIGGER:
case PEAR_ERROR_DIE:
case null:
$def_mode = $mode;
$def_options = $options;
break;
 
case PEAR_ERROR_CALLBACK:
$def_mode = $mode;
// class/object method callback
if (is_callable($options)) {
$def_options = $options;
} else {
trigger_error("invalid error callback", E_USER_WARNING);
}
break;
 
default:
trigger_error("invalid error mode", E_USER_WARNING);
break;
}
$stack[] = array($mode, $options);
return true;
}
 
function staticPopErrorHandling()
{
$stack = &$GLOBALS['_PEAR_error_handler_stack'];
$setmode = &$GLOBALS['_PEAR_default_error_mode'];
$setoptions = &$GLOBALS['_PEAR_default_error_options'];
array_pop($stack);
list($mode, $options) = $stack[sizeof($stack) - 1];
array_pop($stack);
switch ($mode) {
case PEAR_ERROR_EXCEPTION:
case PEAR_ERROR_RETURN:
case PEAR_ERROR_PRINT:
case PEAR_ERROR_TRIGGER:
case PEAR_ERROR_DIE:
case null:
$setmode = $mode;
$setoptions = $options;
break;
 
case PEAR_ERROR_CALLBACK:
$setmode = $mode;
// class/object method callback
if (is_callable($options)) {
$setoptions = $options;
} else {
trigger_error("invalid error callback", E_USER_WARNING);
}
break;
 
default:
trigger_error("invalid error mode", E_USER_WARNING);
break;
}
return true;
}
 
// {{{ pushErrorHandling()
 
/**
* Push a new error handler on top of the error handler options stack. With this
* you can easily override the actual error handler for some code and restore
* it later with popErrorHandling.
*
* @param mixed $mode (same as setErrorHandling)
* @param mixed $options (same as setErrorHandling)
*
* @return bool Always true
*
* @see PEAR::setErrorHandling
*/
function pushErrorHandling($mode, $options = null)
{
$stack = &$GLOBALS['_PEAR_error_handler_stack'];
if (isset($this) && is_a($this, 'PEAR')) {
$def_mode = &$this->_default_error_mode;
$def_options = &$this->_default_error_options;
} else {
$def_mode = &$GLOBALS['_PEAR_default_error_mode'];
$def_options = &$GLOBALS['_PEAR_default_error_options'];
}
$stack[] = array($def_mode, $def_options);
 
if (isset($this) && is_a($this, 'PEAR')) {
$this->setErrorHandling($mode, $options);
} else {
PEAR::setErrorHandling($mode, $options);
}
$stack[] = array($mode, $options);
return true;
}
 
// }}}
// {{{ popErrorHandling()
 
/**
* Pop the last error handler used
*
* @return bool Always true
*
* @see PEAR::pushErrorHandling
*/
function popErrorHandling()
{
$stack = &$GLOBALS['_PEAR_error_handler_stack'];
array_pop($stack);
list($mode, $options) = $stack[sizeof($stack) - 1];
array_pop($stack);
if (isset($this) && is_a($this, 'PEAR')) {
$this->setErrorHandling($mode, $options);
} else {
PEAR::setErrorHandling($mode, $options);
}
return true;
}
 
// }}}
// {{{ loadExtension()
 
/**
* OS independant PHP extension load. Remember to take care
* on the correct extension name for case sensitive OSes.
*
* @param string $ext The extension name
* @return bool Success or not on the dl() call
*/
function loadExtension($ext)
{
if (!extension_loaded($ext)) {
// if either returns true dl() will produce a FATAL error, stop that
if ((ini_get('enable_dl') != 1) || (ini_get('safe_mode') == 1)) {
return false;
}
if (OS_WINDOWS) {
$suffix = '.dll';
} elseif (PHP_OS == 'HP-UX') {
$suffix = '.sl';
} elseif (PHP_OS == 'AIX') {
$suffix = '.a';
} elseif (PHP_OS == 'OSX') {
$suffix = '.bundle';
} else {
$suffix = '.so';
}
return @dl('php_'.$ext.$suffix) || @dl($ext.$suffix);
}
return true;
}
 
// }}}
}
 
// {{{ _PEAR_call_destructors()
 
function _PEAR_call_destructors()
{
global $_PEAR_destructor_object_list;
if (is_array($_PEAR_destructor_object_list) &&
sizeof($_PEAR_destructor_object_list))
{
reset($_PEAR_destructor_object_list);
if (@PEAR::getStaticProperty('PEAR', 'destructlifo')) {
$_PEAR_destructor_object_list = array_reverse($_PEAR_destructor_object_list);
}
while (list($k, $objref) = each($_PEAR_destructor_object_list)) {
$classname = get_class($objref);
while ($classname) {
$destructor = "_$classname";
if (method_exists($objref, $destructor)) {
$objref->$destructor();
break;
} else {
$classname = get_parent_class($classname);
}
}
}
// Empty the object list to ensure that destructors are
// not called more than once.
$_PEAR_destructor_object_list = array();
}
 
// Now call the shutdown functions
if (is_array($GLOBALS['_PEAR_shutdown_funcs']) AND !empty($GLOBALS['_PEAR_shutdown_funcs'])) {
foreach ($GLOBALS['_PEAR_shutdown_funcs'] as $value) {
call_user_func_array($value[0], $value[1]);
}
}
}
 
// }}}
/**
* Standard PEAR error class for PHP 4
*
* This class is supserseded by {@link PEAR_Exception} in PHP 5
*
* @category pear
* @package PEAR
* @author Stig Bakken <ssb@php.net>
* @author Tomas V.V. Cox <cox@idecnet.com>
* @author Gregory Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version Release: 1.4.11
* @link http://pear.php.net/manual/en/core.pear.pear-error.php
* @see PEAR::raiseError(), PEAR::throwError()
* @since Class available since PHP 4.0.2
*/
class PEAR_Error
{
// {{{ properties
 
var $error_message_prefix = '';
var $mode = PEAR_ERROR_RETURN;
var $level = E_USER_NOTICE;
var $code = -1;
var $message = '';
var $userinfo = '';
var $backtrace = null;
 
// }}}
// {{{ constructor
 
/**
* PEAR_Error constructor
*
* @param string $message message
*
* @param int $code (optional) error code
*
* @param int $mode (optional) error mode, one of: PEAR_ERROR_RETURN,
* PEAR_ERROR_PRINT, PEAR_ERROR_DIE, PEAR_ERROR_TRIGGER,
* PEAR_ERROR_CALLBACK or PEAR_ERROR_EXCEPTION
*
* @param mixed $options (optional) error level, _OR_ in the case of
* PEAR_ERROR_CALLBACK, the callback function or object/method
* tuple.
*
* @param string $userinfo (optional) additional user/debug info
*
* @access public
*
*/
function PEAR_Error($message = 'unknown error', $code = null,
$mode = null, $options = null, $userinfo = null)
{
if ($mode === null) {
$mode = PEAR_ERROR_RETURN;
}
$this->message = $message;
$this->code = $code;
$this->mode = $mode;
$this->userinfo = $userinfo;
if (function_exists("debug_backtrace")) {
if (@!PEAR::getStaticProperty('PEAR_Error', 'skiptrace')) {
$this->backtrace = debug_backtrace();
}
}
if ($mode & PEAR_ERROR_CALLBACK) {
$this->level = E_USER_NOTICE;
$this->callback = $options;
} else {
if ($options === null) {
$options = E_USER_NOTICE;
}
$this->level = $options;
$this->callback = null;
}
if ($this->mode & PEAR_ERROR_PRINT) {
if (is_null($options) || is_int($options)) {
$format = "%s";
} else {
$format = $options;
}
printf($format, $this->getMessage());
}
if ($this->mode & PEAR_ERROR_TRIGGER) {
trigger_error($this->getMessage(), $this->level);
}
if ($this->mode & PEAR_ERROR_DIE) {
$msg = $this->getMessage();
if (is_null($options) || is_int($options)) {
$format = "%s";
if (substr($msg, -1) != "\n") {
$msg .= "\n";
}
} else {
$format = $options;
}
die(sprintf($format, $msg));
}
if ($this->mode & PEAR_ERROR_CALLBACK) {
if (is_callable($this->callback)) {
call_user_func($this->callback, $this);
}
}
if ($this->mode & PEAR_ERROR_EXCEPTION) {
trigger_error("PEAR_ERROR_EXCEPTION is obsolete, use class PEAR_Exception for exceptions", E_USER_WARNING);
eval('$e = new Exception($this->message, $this->code);throw($e);');
}
}
 
// }}}
// {{{ getMode()
 
/**
* Get the error mode from an error object.
*
* @return int error mode
* @access public
*/
function getMode() {
return $this->mode;
}
 
// }}}
// {{{ getCallback()
 
/**
* Get the callback function/method from an error object.
*
* @return mixed callback function or object/method array
* @access public
*/
function getCallback() {
return $this->callback;
}
 
// }}}
// {{{ getMessage()
 
 
/**
* Get the error message from an error object.
*
* @return string full error message
* @access public
*/
function getMessage()
{
return ($this->error_message_prefix . $this->message);
}
 
 
// }}}
// {{{ getCode()
 
/**
* Get error code from an error object
*
* @return int error code
* @access public
*/
function getCode()
{
return $this->code;
}
 
// }}}
// {{{ getType()
 
/**
* Get the name of this error/exception.
*
* @return string error/exception name (type)
* @access public
*/
function getType()
{
return get_class($this);
}
 
// }}}
// {{{ getUserInfo()
 
/**
* Get additional user-supplied information.
*
* @return string user-supplied information
* @access public
*/
function getUserInfo()
{
return $this->userinfo;
}
 
// }}}
// {{{ getDebugInfo()
 
/**
* Get additional debug information supplied by the application.
*
* @return string debug information
* @access public
*/
function getDebugInfo()
{
return $this->getUserInfo();
}
 
// }}}
// {{{ getBacktrace()
 
/**
* Get the call backtrace from where the error was generated.
* Supported with PHP 4.3.0 or newer.
*
* @param int $frame (optional) what frame to fetch
* @return array Backtrace, or NULL if not available.
* @access public
*/
function getBacktrace($frame = null)
{
if (defined('PEAR_IGNORE_BACKTRACE')) {
return null;
}
if ($frame === null) {
return $this->backtrace;
}
return $this->backtrace[$frame];
}
 
// }}}
// {{{ addUserInfo()
 
function addUserInfo($info)
{
if (empty($this->userinfo)) {
$this->userinfo = $info;
} else {
$this->userinfo .= " ** $info";
}
}
 
// }}}
// {{{ toString()
 
/**
* Make a string representation of this object.
*
* @return string a string with an object summary
* @access public
*/
function toString() {
$modes = array();
$levels = array(E_USER_NOTICE => 'notice',
E_USER_WARNING => 'warning',
E_USER_ERROR => 'error');
if ($this->mode & PEAR_ERROR_CALLBACK) {
if (is_array($this->callback)) {
$callback = (is_object($this->callback[0]) ?
strtolower(get_class($this->callback[0])) :
$this->callback[0]) . '::' .
$this->callback[1];
} else {
$callback = $this->callback;
}
return sprintf('[%s: message="%s" code=%d mode=callback '.
'callback=%s prefix="%s" info="%s"]',
strtolower(get_class($this)), $this->message, $this->code,
$callback, $this->error_message_prefix,
$this->userinfo);
}
if ($this->mode & PEAR_ERROR_PRINT) {
$modes[] = 'print';
}
if ($this->mode & PEAR_ERROR_TRIGGER) {
$modes[] = 'trigger';
}
if ($this->mode & PEAR_ERROR_DIE) {
$modes[] = 'die';
}
if ($this->mode & PEAR_ERROR_RETURN) {
$modes[] = 'return';
}
return sprintf('[%s: message="%s" code=%d mode=%s level=%s '.
'prefix="%s" info="%s"]',
strtolower(get_class($this)), $this->message, $this->code,
implode("|", $modes), $levels[$this->level],
$this->error_message_prefix,
$this->userinfo);
}
 
// }}}
}
 
/*
* Local Variables:
* mode: php
* tab-width: 4
* c-basic-offset: 4
* End:
*/
?>
/tags/Racine_livraison_narmer/api/pear/Pager/Common.php
New file
0,0 → 1,1502
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 
/**
* Contains the Pager_Common class
*
* PHP versions 4 and 5
*
* LICENSE: Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* @category HTML
* @package Pager
* @author Lorenzo Alberton <l dot alberton at quipo dot it>
* @author Richard Heyes <richard@phpguru.org>
* @copyright 2003-2006 Lorenzo Alberton, Richard Heyes
* @license http://www.debian.org/misc/bsd.license BSD License (3 Clause)
* @version CVS: $Id$
* @link http://pear.php.net/package/Pager
*/
 
/**
* Two constants used to guess the path- and file-name of the page
* when the user doesn't set any other value
*/
if (substr($_SERVER['PHP_SELF'], -1) == '/') {
define('CURRENT_FILENAME', '');
define('CURRENT_PATHNAME', 'http://'.$_SERVER['HTTP_HOST'].str_replace('\\', '/', $_SERVER['PHP_SELF']));
} else {
define('CURRENT_FILENAME', preg_replace('/(.*)\?.*/', '\\1', basename($_SERVER['PHP_SELF'])));
define('CURRENT_PATHNAME', str_replace('\\', '/', dirname($_SERVER['PHP_SELF'])));
}
/**
* Error codes
*/
define('PAGER_OK', 0);
define('ERROR_PAGER', -1);
define('ERROR_PAGER_INVALID', -2);
define('ERROR_PAGER_INVALID_PLACEHOLDER', -3);
define('ERROR_PAGER_INVALID_USAGE', -4);
define('ERROR_PAGER_NOT_IMPLEMENTED', -5);
 
/**
* Pager_Common - Common base class for [Sliding|Jumping] Window Pager
* Extend this class to write a custom paging class
*
* @category HTML
* @package Pager
* @author Lorenzo Alberton <l dot alberton at quipo dot it>
* @author Richard Heyes <richard@phpguru.org>
* @copyright 2003-2005 Lorenzo Alberton, Richard Heyes
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @link http://pear.php.net/package/Pager
*/
class Pager_Common
{
// {{{ class vars
 
/**
* @var integer number of items
* @access private
*/
var $_totalItems;
 
/**
* @var integer number of items per page
* @access private
*/
var $_perPage = 10;
 
/**
* @var integer number of page links for each window
* @access private
*/
var $_delta = 10;
 
/**
* @var integer current page number
* @access private
*/
var $_currentPage = 1;
 
/**
* @var integer total pages number
* @access private
*/
var $_totalPages = 1;
 
/**
* @var string CSS class for links
* @access private
*/
var $_linkClass = '';
 
/**
* @var string wrapper for CSS class name
* @access private
*/
var $_classString = '';
 
/**
* @var string path name
* @access private
*/
var $_path = CURRENT_PATHNAME;
 
/**
* @var string file name
* @access private
*/
var $_fileName = CURRENT_FILENAME;
/**
* @var boolean If false, don't override the fileName option. Use at your own risk.
* @access private
*/
var $_fixFileName = true;
 
/**
* @var boolean you have to use FALSE with mod_rewrite
* @access private
*/
var $_append = true;
 
/**
* @var string specifies which HTTP method to use
* @access private
*/
var $_httpMethod = 'GET';
/**
* @var string specifies which HTML form to use
* @access private
*/
var $_formID = '';
 
/**
* @var boolean whether or not to import submitted data
* @access private
*/
var $_importQuery = true;
 
/**
* @var string name of the querystring var for pageID
* @access private
*/
var $_urlVar = 'pageID';
 
/**
* @var array data to pass through the link
* @access private
*/
var $_linkData = array();
 
/**
* @var array additional URL vars
* @access private
*/
var $_extraVars = array();
/**
* @var array URL vars to ignore
* @access private
*/
var $_excludeVars = array();
 
/**
* @var boolean TRUE => expanded mode (for Pager_Sliding)
* @access private
*/
var $_expanded = true;
/**
* @var boolean TRUE => show accesskey attribute on <a> tags
* @access private
*/
var $_accesskey = false;
 
/**
* @var string extra attributes for the <a> tag
* @access private
*/
var $_attributes = '';
 
/**
* @var string alt text for "first page" (use "%d" placeholder for page number)
* @access private
*/
var $_altFirst = 'first page';
 
/**
* @var string alt text for "previous page"
* @access private
*/
var $_altPrev = 'previous page';
 
/**
* @var string alt text for "next page"
* @access private
*/
var $_altNext = 'next page';
 
/**
* @var string alt text for "last page" (use "%d" placeholder for page number)
* @access private
*/
var $_altLast = 'last page';
 
/**
* @var string alt text for "page"
* @access private
*/
var $_altPage = 'page';
 
/**
* @var string image/text to use as "prev" link
* @access private
*/
var $_prevImg = '&lt;&lt; Back';
 
/**
* @var string image/text to use as "next" link
* @access private
*/
var $_nextImg = 'Next &gt;&gt;';
 
/**
* @var string link separator
* @access private
*/
var $_separator = '';
 
/**
* @var integer number of spaces before separator
* @access private
*/
var $_spacesBeforeSeparator = 0;
 
/**
* @var integer number of spaces after separator
* @access private
*/
var $_spacesAfterSeparator = 1;
 
/**
* @var string CSS class name for current page link
* @access private
*/
var $_curPageLinkClassName = '';
 
/**
* @var string Text before current page link
* @access private
*/
var $_curPageSpanPre = '';
 
/**
* @var string Text after current page link
* @access private
*/
var $_curPageSpanPost = '';
 
/**
* @var string Text before first page link
* @access private
*/
var $_firstPagePre = '[';
 
/**
* @var string Text to be used for first page link
* @access private
*/
var $_firstPageText = '';
 
/**
* @var string Text after first page link
* @access private
*/
var $_firstPagePost = ']';
 
/**
* @var string Text before last page link
* @access private
*/
var $_lastPagePre = '[';
 
/**
* @var string Text to be used for last page link
* @access private
*/
var $_lastPageText = '';
 
/**
* @var string Text after last page link
* @access private
*/
var $_lastPagePost = ']';
 
/**
* @var string Will contain the HTML code for the spaces
* @access private
*/
var $_spacesBefore = '';
 
/**
* @var string Will contain the HTML code for the spaces
* @access private
*/
var $_spacesAfter = '';
 
/**
* @var string $_firstLinkTitle
* @access private
*/
var $_firstLinkTitle = 'first page';
 
/**
* @var string $_nextLinkTitle
* @access private
*/
var $_nextLinkTitle = 'next page';
 
/**
* @var string $_prevLinkTitle
* @access private
*/
var $_prevLinkTitle = 'previous page';
 
/**
* @var string $_lastLinkTitle
* @access private
*/
var $_lastLinkTitle = 'last page';
 
/**
* @var string Text to be used for the 'show all' option in the select box
* @access private
*/
var $_showAllText = '';
 
/**
* @var array data to be paged
* @access private
*/
var $_itemData = null;
 
/**
* @var boolean If TRUE and there's only one page, links aren't shown
* @access private
*/
var $_clearIfVoid = true;
 
/**
* @var boolean Use session for storing the number of items per page
* @access private
*/
var $_useSessions = false;
 
/**
* @var boolean Close the session when finished reading/writing data
* @access private
*/
var $_closeSession = false;
 
/**
* @var string name of the session var for number of items per page
* @access private
*/
var $_sessionVar = 'setPerPage';
 
/**
* Pear error mode (when raiseError is called)
* (see PEAR doc)
*
* @var int $_pearErrorMode
* @access private
*/
var $_pearErrorMode = null;
 
// }}}
// {{{ public vars
 
/**
* @var string Complete set of links
* @access public
*/
var $links = '';
 
/**
* @var string Complete set of link tags
* @access public
*/
var $linkTags = '';
 
/**
* @var array Array with a key => value pair representing
* page# => bool value (true if key==currentPageNumber).
* can be used for extreme customization.
* @access public
*/
var $range = array();
/**
* @var array list of available options (safety check)
* @access private
*/
var $_allowed_options = array(
'totalItems',
'perPage',
'delta',
'linkClass',
'path',
'fileName',
'fixFileName',
'append',
'httpMethod',
'formID',
'importQuery',
'urlVar',
'altFirst',
'altPrev',
'altNext',
'altLast',
'altPage',
'prevImg',
'nextImg',
'expanded',
'accesskey',
'attributes',
'separator',
'spacesBeforeSeparator',
'spacesAfterSeparator',
'curPageLinkClassName',
'curPageSpanPre',
'curPageSpanPost',
'firstPagePre',
'firstPageText',
'firstPagePost',
'lastPagePre',
'lastPageText',
'lastPagePost',
'firstLinkTitle',
'nextLinkTitle',
'prevLinkTitle',
'lastLinkTitle',
'showAllText',
'itemData',
'clearIfVoid',
'useSessions',
'closeSession',
'sessionVar',
'pearErrorMode',
'extraVars',
'excludeVars',
'currentPage',
);
 
// }}}
// {{{ build()
/**
* Generate or refresh the links and paged data after a call to setOptions()
*
* @access public
*/
function build()
{
$msg = '<b>PEAR::Pager Error:</b>'
.' function "build()" not implemented.';
return $this->raiseError($msg, ERROR_PAGER_NOT_IMPLEMENTED);
}
 
// }}}
// {{{ getPageData()
 
/**
* Returns an array of current pages data
*
* @param $pageID Desired page ID (optional)
* @return array Page data
* @access public
*/
function getPageData($pageID = null)
{
$pageID = empty($pageID) ? $this->_currentPage : $pageID;
 
if (!isset($this->_pageData)) {
$this->_generatePageData();
}
if (!empty($this->_pageData[$pageID])) {
return $this->_pageData[$pageID];
}
return array();
}
 
// }}}
// {{{ getPageIdByOffset()
 
/**
* Returns pageID for given offset
*
* @param $index Offset to get pageID for
* @return int PageID for given offset
*/
function getPageIdByOffset($index)
{
$msg = '<b>PEAR::Pager Error:</b>'
.' function "getPageIdByOffset()" not implemented.';
return $this->raiseError($msg, ERROR_PAGER_NOT_IMPLEMENTED);
}
 
// }}}
// {{{ getOffsetByPageId()
 
/**
* Returns offsets for given pageID. Eg, if you
* pass it pageID one and your perPage limit is 10
* it will return (1, 10). PageID of 2 would
* give you (11, 20).
*
* @param integer PageID to get offsets for
* @return array First and last offsets
* @access public
*/
function getOffsetByPageId($pageid = null)
{
$pageid = isset($pageid) ? $pageid : $this->_currentPage;
if (!isset($this->_pageData)) {
$this->_generatePageData();
}
 
if (isset($this->_pageData[$pageid]) || is_null($this->_itemData)) {
return array(
max(($this->_perPage * ($pageid - 1)) + 1, 1),
min($this->_totalItems, $this->_perPage * $pageid)
);
} else {
return array(0, 0);
}
}
 
// }}}
// {{{ getPageRangeByPageId()
 
/**
* @param integer PageID to get offsets for
* @return array First and last offsets
*/
function getPageRangeByPageId($pageID)
{
$msg = '<b>PEAR::Pager Error:</b>'
.' function "getPageRangeByPageId()" not implemented.';
return $this->raiseError($msg, ERROR_PAGER_NOT_IMPLEMENTED);
}
 
// }}}
// {{{ getLinks()
 
/**
* Returns back/next/first/last and page links,
* both as ordered and associative array.
*
* NB: in original PEAR::Pager this method accepted two parameters,
* $back_html and $next_html. Now the only parameter accepted is
* an integer ($pageID), since the html text for prev/next links can
* be set in the factory. If a second parameter is provided, then
* the method act as it previously did. This hack was done to mantain
* backward compatibility only.
*
* @param integer $pageID Optional pageID. If specified, links
* for that page are provided instead of current one. [ADDED IN NEW PAGER VERSION]
* @param string $next_html HTML to put inside the next link [deprecated: use the factory instead]
* @return array back/next/first/last and page links
*/
function getLinks($pageID=null, $next_html='')
{
$msg = '<b>PEAR::Pager Error:</b>'
.' function "getLinks()" not implemented.';
return $this->raiseError($msg, ERROR_PAGER_NOT_IMPLEMENTED);
}
 
// }}}
// {{{ getCurrentPageID()
 
/**
* Returns ID of current page
*
* @return integer ID of current page
*/
function getCurrentPageID()
{
return $this->_currentPage;
}
 
// }}}
// {{{ getNextPageID()
 
/**
* Returns next page ID. If current page is last page
* this function returns FALSE
*
* @return mixed Next page ID
*/
function getNextPageID()
{
return ($this->getCurrentPageID() == $this->numPages() ? false : $this->getCurrentPageID() + 1);
}
 
// }}}
// {{{ getPreviousPageID()
 
/**
* Returns previous page ID. If current page is first page
* this function returns FALSE
*
* @return mixed Previous pages' ID
*/
function getPreviousPageID()
{
return $this->isFirstPage() ? false : $this->getCurrentPageID() - 1;
}
 
// }}}
// {{{ numItems()
 
/**
* Returns number of items
*
* @return int Number of items
*/
function numItems()
{
return $this->_totalItems;
}
 
// }}}
// {{{ numPages()
 
/**
* Returns number of pages
*
* @return int Number of pages
*/
function numPages()
{
return (int)$this->_totalPages;
}
 
// }}}
// {{{ isFirstPage()
 
/**
* Returns whether current page is first page
*
* @return bool First page or not
*/
function isFirstPage()
{
return ($this->_currentPage < 2);
}
 
// }}}
// {{{ isLastPage()
 
/**
* Returns whether current page is last page
*
* @return bool Last page or not
*/
function isLastPage()
{
return ($this->_currentPage == $this->_totalPages);
}
 
// }}}
// {{{ isLastPageComplete()
 
/**
* Returns whether last page is complete
*
* @return bool Last age complete or not
*/
function isLastPageComplete()
{
return !($this->_totalItems % $this->_perPage);
}
 
// }}}
// {{{ _generatePageData()
 
/**
* Calculates all page data
* @access private
*/
function _generatePageData()
{
// Been supplied an array of data?
if (!is_null($this->_itemData)) {
$this->_totalItems = count($this->_itemData);
}
$this->_totalPages = ceil((float)$this->_totalItems / (float)$this->_perPage);
$i = 1;
if (!empty($this->_itemData)) {
foreach ($this->_itemData as $key => $value) {
$this->_pageData[$i][$key] = $value;
if (count($this->_pageData[$i]) >= $this->_perPage) {
$i++;
}
}
} else {
$this->_pageData = array();
}
 
//prevent URL modification
$this->_currentPage = min($this->_currentPage, $this->_totalPages);
}
 
// }}}
// {{{ _renderLink()
 
/**
* Renders a link using the appropriate method
*
* @param altText Alternative text for this link (title property)
* @param linkText Text contained by this link
* @return string The link in string form
* @access private
*/
function _renderLink($altText, $linkText)
{
if ($this->_httpMethod == 'GET') {
if ($this->_append) {
$href = '?' . $this->_http_build_query_wrapper($this->_linkData);
} else {
$href = str_replace('%d', $this->_linkData[$this->_urlVar], $this->_fileName);
}
return sprintf('<a href="%s"%s%s%s title="%s">%s</a>',
htmlentities($this->_url . $href),
empty($this->_classString) ? '' : ' '.$this->_classString,
empty($this->_attributes) ? '' : ' '.$this->_attributes,
empty($this->_accesskey) ? '' : ' accesskey="'.$this->_linkData[$this->_urlVar].'"',
$altText,
$linkText
);
} elseif ($this->_httpMethod == 'POST') {
return sprintf("<a href='javascript:void(0)' onclick='%s'%s%s%s title='%s'>%s</a>",
$this->_generateFormOnClick($this->_url, $this->_linkData),
empty($this->_classString) ? '' : ' '.$this->_classString,
empty($this->_attributes) ? '' : ' '.$this->_attributes,
empty($this->_accesskey) ? '' : ' accesskey=\''.$this->_linkData[$this->_urlVar].'\'',
$altText,
$linkText
);
}
return '';
}
 
// }}}
// {{{ _generateFormOnClick()
 
/**
* Mimics http_build_query() behavior in the way the data
* in $data will appear when it makes it back to the server.
* For example:
* $arr = array('array' => array(array('hello', 'world'),
* 'things' => array('stuff', 'junk'));
* http_build_query($arr)
* and _generateFormOnClick('foo.php', $arr)
* will yield
* $_REQUEST['array'][0][0] === 'hello'
* $_REQUEST['array'][0][1] === 'world'
* $_REQUEST['array']['things'][0] === 'stuff'
* $_REQUEST['array']['things'][1] === 'junk'
*
* However, instead of generating a query string, it generates
* Javascript to create and submit a form.
*
* @param string $formAction where the form should be submitted
* @param array $data the associative array of names and values
* @return string A string of javascript that generates a form and submits it
* @access private
*/
function _generateFormOnClick($formAction, $data)
{
// Check we have an array to work with
if (!is_array($data)) {
trigger_error(
'_generateForm() Parameter 1 expected to be Array or Object. Incorrect value given.',
E_USER_WARNING
);
return false;
}
 
if (!empty($this->_formID)) {
$str = 'var form = document.getElementById("'.$this->_formID.'"); var input = ""; ';
} else {
$str = 'var form = document.createElement("form"); var input = ""; ';
}
// We /shouldn't/ need to escape the URL ...
$str .= sprintf('form.action = "%s"; ', htmlentities($formAction));
$str .= sprintf('form.method = "%s"; ', $this->_httpMethod);
foreach ($data as $key => $val) {
$str .= $this->_generateFormOnClickHelper($val, $key);
}
 
if (empty($this->_formID)) {
$str .= 'document.getElementsByTagName("body")[0].appendChild(form);';
}
$str .= 'form.submit(); return false;';
return $str;
}
 
// }}}
// {{{ _generateFormOnClickHelper
 
/**
* This is used by _generateFormOnClick().
* Recursively processes the arrays, objects, and literal values.
*
* @param data Data that should be rendered
* @param prev The name so far
* @return string A string of Javascript that creates form inputs
* representing the data
* @access private
*/
function _generateFormOnClickHelper($data, $prev = '')
{
$str = '';
if (is_array($data) || is_object($data)) {
// foreach key/visible member
foreach ((array)$data as $key => $val) {
// append [$key] to prev
$tempKey = sprintf('%s[%s]', $prev, $key);
$str .= $this->_generateFormOnClickHelper($val, $tempKey);
}
} else { // must be a literal value
// escape newlines and carriage returns
$search = array("\n", "\r");
$replace = array('\n', '\n');
$escapedData = str_replace($search, $replace, $data);
// am I forgetting any dangerous whitespace?
// would a regex be faster?
// if it's already encoded, don't encode it again
if (!$this->_isEncoded($escapedData)) {
$escapedData = urlencode($escapedData);
}
$escapedData = htmlentities($escapedData, ENT_QUOTES, 'UTF-8');
 
$str .= 'input = document.createElement("input"); ';
$str .= 'input.type = "hidden"; ';
$str .= sprintf('input.name = "%s"; ', $prev);
$str .= sprintf('input.value = "%s"; ', $escapedData);
$str .= 'form.appendChild(input); ';
}
return $str;
}
 
// }}}
// {{{ _getLinksData()
 
/**
* Returns the correct link for the back/pages/next links
*
* @return array Data
* @access private
*/
function _getLinksData()
{
$qs = array();
if ($this->_importQuery) {
if ($this->_httpMethod == 'POST') {
$qs = $_POST;
} elseif ($this->_httpMethod == 'GET') {
$qs = $_GET;
}
}
if (count($this->_extraVars)){
$this->_recursive_urldecode($this->_extraVars);
}
$qs = array_merge($qs, $this->_extraVars);
foreach ($this->_excludeVars as $exclude) {
if (array_key_exists($exclude, $qs)) {
unset($qs[$exclude]);
}
}
if (count($qs) && get_magic_quotes_gpc()){
$this->_recursive_stripslashes($qs);
}
return $qs;
}
 
// }}}
// {{{ _recursive_stripslashes()
/**
* Helper method
* @param mixed $var
* @access private
*/
function _recursive_stripslashes(&$var)
{
if (is_array($var)) {
foreach (array_keys($var) as $k) {
$this->_recursive_stripslashes($var[$k]);
}
} else {
$var = stripslashes($var);
}
}
 
// }}}
// {{{ _recursive_urldecode()
 
/**
* Helper method
* @param mixed $var
* @access private
*/
function _recursive_urldecode(&$var)
{
if (is_array($var)) {
foreach (array_keys($var) as $k) {
$this->_recursive_urldecode($var[$k]);
}
} else {
$trans_tbl = array_flip(get_html_translation_table(HTML_ENTITIES));
$var = strtr($var, $trans_tbl);
}
}
 
// }}}
// {{{ _getBackLink()
 
/**
* Returns back link
*
* @param $url URL to use in the link [deprecated: use the factory instead]
* @param $link HTML to use as the link [deprecated: use the factory instead]
* @return string The link
* @access private
*/
function _getBackLink($url='', $link='')
{
//legacy settings... the preferred way to set an option
//now is passing it to the factory
if (!empty($url)) {
$this->_path = $url;
}
if (!empty($link)) {
$this->_prevImg = $link;
}
$back = '';
if ($this->_currentPage > 1) {
$this->_linkData[$this->_urlVar] = $this->getPreviousPageID();
$back = $this->_renderLink($this->_altPrev, $this->_prevImg)
. $this->_spacesBefore . $this->_spacesAfter;
}
return $back;
}
 
// }}}
// {{{ _getPageLinks()
 
/**
* Returns pages link
*
* @param $url URL to use in the link [deprecated: use the factory instead]
* @return string Links
* @access private
*/
function _getPageLinks($url='')
{
$msg = '<b>PEAR::Pager Error:</b>'
.' function "_getPageLinks()" not implemented.';
return $this->raiseError($msg, ERROR_PAGER_NOT_IMPLEMENTED);
}
 
// }}}
// {{{ _getNextLink()
 
/**
* Returns next link
*
* @param $url URL to use in the link [deprecated: use the factory instead]
* @param $link HTML to use as the link [deprecated: use the factory instead]
* @return string The link
* @access private
*/
function _getNextLink($url='', $link='')
{
//legacy settings... the preferred way to set an option
//now is passing it to the factory
if (!empty($url)) {
$this->_path = $url;
}
if (!empty($link)) {
$this->_nextImg = $link;
}
$next = '';
if ($this->_currentPage < $this->_totalPages) {
$this->_linkData[$this->_urlVar] = $this->getNextPageID();
$next = $this->_spacesAfter
. $this->_renderLink($this->_altNext, $this->_nextImg)
. $this->_spacesBefore . $this->_spacesAfter;
}
return $next;
}
 
// }}}
// {{{ _getFirstLinkTag()
 
/**
* @return string
* @access private
*/
function _getFirstLinkTag()
{
if ($this->isFirstPage() || ($this->_httpMethod != 'GET')) {
return '';
}
return sprintf('<link rel="first" href="%s" title="%s" />'."\n",
$this->_getLinkTagUrl(1),
$this->_firstLinkTitle
);
}
 
// }}}
// {{{ _getPrevLinkTag()
 
/**
* Returns previous link tag
*
* @return string the link tag
* @access private
*/
function _getPrevLinkTag()
{
if ($this->isFirstPage() || ($this->_httpMethod != 'GET')) {
return '';
}
return sprintf('<link rel="previous" href="%s" title="%s" />'."\n",
$this->_getLinkTagUrl($this->getPreviousPageID()),
$this->_prevLinkTitle
);
}
 
// }}}
// {{{ _getNextLinkTag()
 
/**
* Returns next link tag
*
* @return string the link tag
* @access private
*/
function _getNextLinkTag()
{
if ($this->isLastPage() || ($this->_httpMethod != 'GET')) {
return '';
}
return sprintf('<link rel="next" href="%s" title="%s" />'."\n",
$this->_getLinkTagUrl($this->getNextPageID()),
$this->_nextLinkTitle
);
}
 
// }}}
// {{{ _getLastLinkTag()
 
/**
* @return string the link tag
* @access private
*/
function _getLastLinkTag()
{
if ($this->isLastPage() || ($this->_httpMethod != 'GET')) {
return '';
}
return sprintf('<link rel="last" href="%s" title="%s" />'."\n",
$this->_getLinkTagUrl($this->_totalPages),
$this->_lastLinkTitle
);
}
 
// }}}
// {{{ _getLinkTagUrl()
 
/**
* Helper method
* @return string the link tag url
* @access private
*/
function _getLinkTagUrl($pageID)
{
$this->_linkData[$this->_urlVar] = $pageID;
if ($this->_append) {
$href = '?' . $this->_http_build_query_wrapper($this->_linkData);
} else {
$href = str_replace('%d', $this->_linkData[$this->_urlVar], $this->_fileName);
}
return htmlentities($this->_url . $href);
}
// }}}
// {{{ getPerPageSelectBox()
 
/**
* Returns a string with a XHTML SELECT menu,
* useful for letting the user choose how many items per page should be
* displayed. If parameter useSessions is TRUE, this value is stored in
* a session var. The string isn't echoed right now so you can use it
* with template engines.
*
* @param integer $start
* @param integer $end
* @param integer $step
* @param boolean $showAllData If true, perPage is set equal to totalItems.
* @param array (or string $optionText for BC reasons)
* - 'optionText': text to show in each option.
* Use '%d' where you want to see the number of pages selected.
* - 'attributes': (html attributes) Tag attributes or
* HTML attributes (id="foo" pairs), will be inserted in the
* <select> tag
* @return string xhtml select box
* @access public
*/
function getPerPageSelectBox($start=5, $end=30, $step=5, $showAllData=false, $extraParams=array())
{
require_once 'Pager/HtmlWidgets.php';
$widget =& new Pager_HtmlWidgets($this);
return $widget->getPerPageSelectBox($start, $end, $step, $showAllData, $extraParams);
}
 
// }}}
// {{{ getPageSelectBox()
 
/**
* Returns a string with a XHTML SELECT menu with the page numbers,
* useful as an alternative to the links
*
* @param array - 'optionText': text to show in each option.
* Use '%d' where you want to see the number of pages selected.
* - 'autoSubmit': if TRUE, add some js code to submit the
* form on the onChange event
* @param string $extraAttributes (html attributes) Tag attributes or
* HTML attributes (id="foo" pairs), will be inserted in the
* <select> tag
* @return string xhtml select box
* @access public
*/
function getPageSelectBox($params = array(), $extraAttributes = '')
{
require_once 'Pager/HtmlWidgets.php';
$widget =& new Pager_HtmlWidgets($this);
return $widget->getPageSelectBox($params, $extraAttributes);
}
 
// }}}
// {{{ _printFirstPage()
 
/**
* Print [1]
*
* @return string String with link to 1st page,
* or empty string if this is the 1st page.
* @access private
*/
function _printFirstPage()
{
if ($this->isFirstPage()) {
return '';
}
$this->_linkData[$this->_urlVar] = 1;
return $this->_renderLink(
str_replace('%d', 1, $this->_altFirst),
$this->_firstPagePre . $this->_firstPageText . $this->_firstPagePost
) . $this->_spacesBefore . $this->_spacesAfter;
}
 
// }}}
// {{{ _printLastPage()
 
/**
* Print [numPages()]
*
* @return string String with link to last page,
* or empty string if this is the 1st page.
* @access private
*/
function _printLastPage()
{
if ($this->isLastPage()) {
return '';
}
$this->_linkData[$this->_urlVar] = $this->_totalPages;
return $this->_renderLink(
str_replace('%d', $this->_totalPages, $this->_altLast),
$this->_lastPagePre . $this->_lastPageText . $this->_lastPagePost
);
}
 
// }}}
// {{{ _setFirstLastText()
 
/**
* sets the private _firstPageText, _lastPageText variables
* based on whether they were set in the options
*
* @access private
*/
function _setFirstLastText()
{
if ($this->_firstPageText == '') {
$this->_firstPageText = '1';
}
if ($this->_lastPageText == '') {
$this->_lastPageText = $this->_totalPages;
}
}
 
// }}}
// {{{ _http_build_query_wrapper()
/**
* This is a slightly modified version of the http_build_query() function;
* it heavily borrows code from PHP_Compat's http_build_query().
* The main change is the usage of htmlentities instead of urlencode,
* since it's too aggressive
*
* @author Stephan Schmidt <schst@php.net>
* @author Aidan Lister <aidan@php.net>
* @author Lorenzo Alberton <l dot alberton at quipo dot it>
* @param array $data
* @return string
* @access private
*/
function _http_build_query_wrapper($data)
{
$data = (array)$data;
if (empty($data)) {
return '';
}
$separator = ini_get('arg_separator.output');
if ($separator == '&amp;') {
$separator = '&'; //the string is escaped by htmlentities anyway...
}
$tmp = array ();
foreach ($data as $key => $val) {
if (is_scalar($val)) {
//array_push($tmp, $key.'='.$val);
$val = urlencode($val);
array_push($tmp, $key .'='. str_replace('%2F', '/', $val));
continue;
}
// If the value is an array, recursively parse it
if (is_array($val)) {
array_push($tmp, $this->__http_build_query($val, htmlentities($key)));
continue;
}
}
return implode($separator, $tmp);
}
 
// }}}
// {{{ __http_build_query()
 
/**
* Helper function
* @author Stephan Schmidt <schst@php.net>
* @author Aidan Lister <aidan@php.net>
* @access private
*/
function __http_build_query($array, $name)
{
$tmp = array ();
foreach ($array as $key => $value) {
if (is_array($value)) {
//array_push($tmp, $this->__http_build_query($value, sprintf('%s[%s]', $name, $key)));
array_push($tmp, $this->__http_build_query($value, $name.'%5B'.$key.'%5D'));
} elseif (is_scalar($value)) {
//array_push($tmp, sprintf('%s[%s]=%s', $name, htmlentities($key), htmlentities($value)));
array_push($tmp, $name.'%5B'.htmlentities($key).'%5D='.htmlentities($value));
} elseif (is_object($value)) {
//array_push($tmp, $this->__http_build_query(get_object_vars($value), sprintf('%s[%s]', $name, $key)));
array_push($tmp, $this->__http_build_query(get_object_vars($value), $name.'%5B'.$key.'%5D'));
}
}
return implode(ini_get('arg_separator.output'), $tmp);
}
 
// }}}
// {{{ _isEncoded()
 
/**
* Helper function
* Check if a string is an encoded multibyte string
* @param string $string
* @return boolean
* @access private
*/
function _isEncoded($string)
{
$hexchar = '&#[\dA-Fx]{2,};';
return preg_match("/^(\s|($hexchar))*$/Uims", $string) ? true : false;
}
 
// }}}
// {{{ raiseError()
 
/**
* conditionally includes PEAR base class and raise an error
*
* @param string $msg Error message
* @param int $code Error code
* @access private
*/
function raiseError($msg, $code)
{
include_once 'PEAR.php';
if (empty($this->_pearErrorMode)) {
$this->_pearErrorMode = PEAR_ERROR_RETURN;
}
return PEAR::raiseError($msg, $code, $this->_pearErrorMode);
}
 
// }}}
// {{{ setOptions()
 
/**
* Set and sanitize options
*
* @param mixed $options An associative array of option names and
* their values.
* @return integer error code (PAGER_OK on success)
* @access public
*/
function setOptions($options)
{
foreach ($options as $key => $value) {
if (in_array($key, $this->_allowed_options) && (!is_null($value))) {
$this->{'_' . $key} = $value;
}
}
 
//autodetect http method
if (!isset($options['httpMethod'])
&& !isset($_GET[$this->_urlVar])
&& isset($_POST[$this->_urlVar])
) {
$this->_httpMethod = 'POST';
} else {
$this->_httpMethod = strtoupper($this->_httpMethod);
}
 
$this->_fileName = ltrim($this->_fileName, '/'); //strip leading slash
$this->_path = rtrim($this->_path, '/'); //strip trailing slash
 
if ($this->_append) {
if ($this->_fixFileName) {
$this->_fileName = CURRENT_FILENAME; //avoid possible user error;
}
$this->_url = $this->_path.'/'.$this->_fileName;
} else {
$this->_url = $this->_path;
if (strncasecmp($this->_fileName, 'javascript', 10) != 0) {
$this->_url .= '/';
}
if (!strstr($this->_fileName, '%d')) {
trigger_error($this->errorMessage(ERROR_PAGER_INVALID_USAGE), E_USER_WARNING);
}
}
 
$this->_classString = '';
if (strlen($this->_linkClass)) {
$this->_classString = 'class="'.$this->_linkClass.'"';
}
 
if (strlen($this->_curPageLinkClassName)) {
$this->_curPageSpanPre = '<span class="'.$this->_curPageLinkClassName.'">';
$this->_curPageSpanPost = '</span>';
}
 
$this->_perPage = max($this->_perPage, 1); //avoid possible user errors
 
if ($this->_useSessions && !isset($_SESSION)) {
session_start();
}
if (!empty($_REQUEST[$this->_sessionVar])) {
$this->_perPage = max(1, (int)$_REQUEST[$this->_sessionVar]);
if ($this->_useSessions) {
$_SESSION[$this->_sessionVar] = $this->_perPage;
}
}
 
if (!empty($_SESSION[$this->_sessionVar])) {
$this->_perPage = $_SESSION[$this->_sessionVar];
}
 
if ($this->_closeSession) {
session_write_close();
}
 
$this->_spacesBefore = str_repeat('&nbsp;', $this->_spacesBeforeSeparator);
$this->_spacesAfter = str_repeat('&nbsp;', $this->_spacesAfterSeparator);
 
if (isset($_REQUEST[$this->_urlVar]) && empty($options['currentPage'])) {
$this->_currentPage = (int)$_REQUEST[$this->_urlVar];
}
$this->_currentPage = max($this->_currentPage, 1);
$this->_linkData = $this->_getLinksData();
 
return PAGER_OK;
}
 
// }}}
// {{{ getOption()
/**
* Return the current value of a given option
*
* @param string option name
* @return mixed option value
*/
function getOption($name)
{
if (!in_array($name, $this->_allowed_options)) {
$msg = '<b>PEAR::Pager Error:</b>'
.' invalid option: '.$name;
return $this->raiseError($msg, ERROR_PAGER_INVALID);
}
return $this->{'_' . $name};
}
 
// }}}
// {{{ getOptions()
 
/**
* Return an array with all the current pager options
*
* @return array list of all the pager options
*/
function getOptions()
{
$options = array();
foreach ($this->_allowed_options as $option) {
$options[$option] = $this->{'_' . $option};
}
return $options;
}
 
// }}}
// {{{ errorMessage()
 
/**
* Return a textual error message for a PAGER error code
*
* @param int $code error code
* @return string error message
* @access public
*/
function errorMessage($code)
{
static $errorMessages;
if (!isset($errorMessages)) {
$errorMessages = array(
ERROR_PAGER => 'unknown error',
ERROR_PAGER_INVALID => 'invalid',
ERROR_PAGER_INVALID_PLACEHOLDER => 'invalid format - use "%d" as placeholder.',
ERROR_PAGER_INVALID_USAGE => 'if $options[\'append\'] is set to false, '
.' $options[\'fileName\'] MUST contain the "%d" placeholder.',
ERROR_PAGER_NOT_IMPLEMENTED => 'not implemented'
);
}
 
return '<b>PEAR::Pager error:</b> '. (isset($errorMessages[$code]) ?
$errorMessages[$code] : $errorMessages[ERROR_PAGER]);
}
 
// }}}
}
?>
/tags/Racine_livraison_narmer/api/pear/Pager/examples/example.php
New file
0,0 → 1,78
<?php
require_once 'Pager/Pager.php';
 
//create dummy array of data
$myData = array();
for ($i=0; $i<200; $i++) {
$myData[] = $i;
}
 
$params = array(
'itemData' => $myData,
'perPage' => 10,
'delta' => 8, // for 'Jumping'-style a lower number is better
'append' => true,
//'separator' => ' | ',
'clearIfVoid' => false,
'urlVar' => 'entrant',
'useSessions' => true,
'closeSession' => true,
//'mode' => 'Sliding', //try switching modes
'mode' => 'Jumping',
 
);
$pager = & Pager::factory($params);
$page_data = $pager->getPageData();
$links = $pager->getLinks();
 
$selectBox = $pager->getPerPageSelectBox();
?>
 
<html>
<head>
<title>new PEAR::Pager example</title>
</head>
<body>
 
<table border="1" width="500" summary="example 1">
<tr>
<td colspan="3" align="center">
<?php echo $links['all']; ?>
</td>
</tr>
 
 
<tr>
<td colspan="3">
<pre><?php print_r($page_data); ?></pre>
</td>
</tr>
</table>
 
<h4>Results from methods:</h4>
 
<pre>
getCurrentPageID()...: <?php var_dump($pager->getCurrentPageID()); ?>
getNextPageID()......: <?php var_dump($pager->getNextPageID()); ?>
getPreviousPageID()..: <?php var_dump($pager->getPreviousPageID()); ?>
numItems()...........: <?php var_dump($pager->numItems()); ?>
numPages()...........: <?php var_dump($pager->numPages()); ?>
isFirstPage()........: <?php var_dump($pager->isFirstPage()); ?>
isLastPage().........: <?php var_dump($pager->isLastPage()); ?>
isLastPageComplete().: <?php var_dump($pager->isLastPageComplete()); ?>
$pager->range........: <?php var_dump($pager->range); ?>
</pre>
 
 
<hr />
 
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="GET">
Select how many items per page should be shown:<br />
<?php echo $selectBox; ?> &nbsp;
<input type="submit" value="submit" />
</form>
 
<hr />
 
</body>
</html>
/tags/Racine_livraison_narmer/api/pear/Pager/examples/Pager_Wrapper.php
New file
0,0 → 1,339
<?php
// CVS: $Id$
//
// Pager_Wrapper
// -------------
//
// Ready-to-use wrappers for paging the result of a query,
// when fetching the whole resultset is NOT an option.
// This is a performance- and memory-savvy method
// to use PEAR::Pager with a database.
// With this approach, the network load can be
// consistently smaller than with PEAR::DB_Pager.
//
// The following wrappers are provided: one for each PEAR
// db abstraction layer (DB, MDB and MDB2), one for
// PEAR::DB_DataObject, and one for the PHP Eclipse library
//
//
// SAMPLE USAGE
// ------------
//
// $query = 'SELECT this, that FROM mytable';
// require_once 'Pager_Wrapper.php'; //this file
// $pagerOptions = array(
// 'mode' => 'Sliding',
// 'delta' => 2,
// 'perPage' => 15,
// );
// $paged_data = Pager_Wrapper_MDB2($db, $query, $pagerOptions);
// //$paged_data['data']; //paged data
// //$paged_data['links']; //xhtml links for page navigation
// //$paged_data['page_numbers']; //array('current', 'total');
//
 
/**
* Helper method - Rewrite the query into a "SELECT COUNT(*)" query.
* @param string $sql query
* @return string rewritten query OR false if the query can't be rewritten
* @access private
*/
function rewriteCountQuery($sql)
{
if (preg_match('/^\s*SELECT\s+\bDISTINCT\b/is', $sql) || preg_match('/\s+GROUP\s+BY\s+/is', $sql)) {
return false;
}
$open_parenthesis = '(?:\()';
$close_parenthesis = '(?:\))';
$subquery_in_select = $open_parenthesis.'.*\bFROM\b.*'.$close_parenthesis;
$pattern = '/(?:.*'.$subquery_in_select.'.*)\bFROM\b\s+/Uims';
if (preg_match($pattern, $sql)) {
return false;
}
$subquery_with_limit_order = $open_parenthesis.'.*\b(LIMIT|ORDER)\b.*'.$close_parenthesis;
$pattern = '/.*\bFROM\b.*(?:.*'.$subquery_with_limit_order.'.*).*/Uims';
if (preg_match($pattern, $sql)) {
return false;
}
$queryCount = preg_replace('/(?:.*)\bFROM\b\s+/Uims', 'SELECT COUNT(*) FROM ', $sql, 1);
list($queryCount, ) = preg_split('/\s+ORDER\s+BY\s+/is', $queryCount);
list($queryCount, ) = preg_split('/\bLIMIT\b/is', $queryCount);
return trim($queryCount);
}
 
/**
* @param object PEAR::DB instance
* @param string db query
* @param array PEAR::Pager options
* @param boolean Disable pagination (get all results)
* @param integer fetch mode constant
* @param mixed parameters for query placeholders
* If you use placeholders for table names or column names, please
* count the # of items returned by the query and pass it as an option:
* $pager_options['totalItems'] = count_records('some query');
* @return array with links and paged data
*/
function Pager_Wrapper_DB(&$db, $query, $pager_options = array(), $disabled = false, $fetchMode = DB_FETCHMODE_ASSOC, $dbparams = null)
{
if (!array_key_exists('totalItems', $pager_options)) {
// be smart and try to guess the total number of records
if ($countQuery = rewriteCountQuery($query)) {
$totalItems = $db->getOne($countQuery, $dbparams);
if (PEAR::isError($totalItems)) {
return $totalItems;
}
} else {
$res =& $db->query($query, $dbparams);
if (PEAR::isError($res)) {
return $res;
}
$totalItems = (int)$res->numRows();
$res->free();
}
$pager_options['totalItems'] = $totalItems;
}
require_once 'Pager/Pager.php';
$pager = Pager::factory($pager_options);
 
$page = array();
$page['totalItems'] = $pager_options['totalItems'];
$page['links'] = $pager->links;
$page['page_numbers'] = array(
'current' => $pager->getCurrentPageID(),
'total' => $pager->numPages()
);
list($page['from'], $page['to']) = $pager->getOffsetByPageId();
 
$res = ($disabled)
? $db->limitQuery($query, 0, $totalItems, $dbparams)
: $db->limitQuery($query, $page['from']-1, $pager_options['perPage'], $dbparams);
 
if (PEAR::isError($res)) {
return $res;
}
$page['data'] = array();
while ($res->fetchInto($row, $fetchMode)) {
$page['data'][] = $row;
}
if ($disabled) {
$page['links'] = '';
$page['page_numbers'] = array(
'current' => 1,
'total' => 1
);
}
return $page;
}
 
/**
* @param object PEAR::MDB instance
* @param string db query
* @param array PEAR::Pager options
* @param boolean Disable pagination (get all results)
* @param integer fetch mode constant
* @return array with links and paged data
*/
function Pager_Wrapper_MDB(&$db, $query, $pager_options = array(), $disabled = false, $fetchMode = MDB_FETCHMODE_ASSOC)
{
if (!array_key_exists('totalItems', $pager_options)) {
//be smart and try to guess the total number of records
if ($countQuery = rewriteCountQuery($query)) {
$totalItems = $db->queryOne($countQuery);
if (PEAR::isError($totalItems)) {
return $totalItems;
}
} else {
$res = $db->query($query);
if (PEAR::isError($res)) {
return $res;
}
$totalItems = (int)$db->numRows($res);
$db->freeResult($res);
}
$pager_options['totalItems'] = $totalItems;
}
require_once 'Pager/Pager.php';
$pager = Pager::factory($pager_options);
 
$page = array();
$page['totalItems'] = $pager_options['totalItems'];
$page['links'] = $pager->links;
$page['page_numbers'] = array(
'current' => $pager->getCurrentPageID(),
'total' => $pager->numPages()
);
list($page['from'], $page['to']) = $pager->getOffsetByPageId();
 
$res = ($disabled)
? $db->limitQuery($query, null, 0, $totalItems)
: $db->limitQuery($query, null, $page['from']-1, $pager_options['perPage']);
 
if (PEAR::isError($res)) {
return $res;
}
$page['data'] = array();
while ($row = $db->fetchInto($res, $fetchMode)) {
$page['data'][] = $row;
}
if ($disabled) {
$page['links'] = '';
$page['page_numbers'] = array(
'current' => 1,
'total' => 1
);
}
return $page;
}
 
/**
* @param object PEAR::MDB2 instance
* @param string db query
* @param array PEAR::Pager options
* @param boolean Disable pagination (get all results)
* @param integer fetch mode constant
* @return array with links and paged data
*/
function Pager_Wrapper_MDB2(&$db, $query, $pager_options = array(), $disabled = false, $fetchMode = MDB2_FETCHMODE_ASSOC)
{
if (!array_key_exists('totalItems', $pager_options)) {
//be smart and try to guess the total number of records
if ($countQuery = rewriteCountQuery($query)) {
$totalItems = $db->queryOne($countQuery);
if (PEAR::isError($totalItems)) {
return $totalItems;
}
} else {
//GROUP BY => fetch the whole resultset and count the rows returned
$res =& $db->queryCol($query);
if (PEAR::isError($res)) {
return $res;
}
$totalItems = count($res);
}
$pager_options['totalItems'] = $totalItems;
}
require_once 'Pager/Pager.php';
$pager = Pager::factory($pager_options);
 
$page = array();
$page['links'] = $pager->links;
$page['totalItems'] = $pager_options['totalItems'];
$page['page_numbers'] = array(
'current' => $pager->getCurrentPageID(),
'total' => $pager->numPages()
);
list($page['from'], $page['to']) = $pager->getOffsetByPageId();
$page['limit'] = $page['to'] - $page['from'] +1;
if (!$disabled) {
$db->setLimit($pager_options['perPage'], $page['from']-1);
}
$page['data'] = $db->queryAll($query, null, $fetchMode);
if (PEAR::isError($page['data'])) {
return $page['data'];
}
if ($disabled) {
$page['links'] = '';
$page['page_numbers'] = array(
'current' => 1,
'total' => 1
);
}
return $page;
}
 
/**
* @param object PEAR::DataObject instance
* @param array PEAR::Pager options
* @param boolean Disable pagination (get all results)
* @return array with links and paged data
* @author Massimiliano Arione <garak@studenti.it>
*/
function Pager_Wrapper_DBDO(&$db, $pager_options = array(), $disabled = false)
{
if (!array_key_exists('totalItems', $pager_options)) {
$totalItems = $db->count();
$pager_options['totalItems'] = $totalItems;
}
require_once 'Pager/Pager.php';
$pager = Pager::factory($pager_options);
 
$page = array();
$page['links'] = $pager->links;
$page['totalItems'] = $pager_options['totalItems'];
$page['page_numbers'] = array(
'current' => $pager->getCurrentPageID(),
'total' => $pager->numPages()
);
list($page['from'], $page['to']) = $pager->getOffsetByPageId();
$page['limit'] = $page['to'] - $page['from'] + 1;
if (!$disabled) {
$db->limit($page['from'] - 1, $pager_options['perPage']);
}
$db->find();
while ($db->fetch()) {
$db->getLinks();
$page['data'][] = $db->toArray('%s', true);
}
return $page;
}
 
/**
* @param object PHP Eclipse instance
* @param string db query
* @param array PEAR::Pager options
* @param boolean Disable pagination (get all results)
* @return array with links and paged data
* @author Matte Edens <matte@arubanetworks.com>
* @see http://sourceforge.net/projects/eclipselib/
*/
function Pager_Wrapper_Eclipse(&$db, $query, $pager_options = array(), $disabled = false)
{
if (!$disabled) {
require_once(ECLIPSE_ROOT . 'PagedQuery.php');
$query =& new PagedQuery($db->query($query), $pager_options['perPage']);
$totalrows = $query->getRowCount();
$numpages = $query->getPageCount();
$whichpage = isset($_GET[$pager_options['urlVar']]) ? (int)$_GET[$pager_options['urlVar']] - 1 : 0;
if ($whichpage >= $numpages) {
$whichpage = $numpages - 1;
}
$result = $query->getPage($whichpage);
} else {
$result = $db->query($query);
$totalrows = $result->getRowCount();
$numpages = 1;
}
if (!$result->isSuccess()) {
return PEAR::raiseError($result->getErrorMessage());
}
if (!array_key_exists('totalItems', $pager_options)) {
$pager_options['totalItems'] = $totalrows;
}
 
$page = array();
require_once(ECLIPSE_ROOT . 'QueryIterator.php');
for ($it =& new QueryIterator($result); $it->isValid(); $it->next()) {
$page['data'][] =& $it->getCurrent();
}
require_once 'Pager/Pager.php';
$pager = Pager::factory($pager_options);
 
$page['links'] = $pager->links;
$page['totalItems'] = $pager_options['totalItems'];
$page['page_numbers'] = array(
'current' => $pager->getCurrentPageID(),
'total' => $numpages
);
$page['perPageSelectBox'] = $pager->getperpageselectbox();
list($page['from'], $page['to']) = $pager->getOffsetByPageId();
$page['limit'] = $page['to'] - $page['from'] +1;
if ($disabled) {
$page['links'] = '';
$page['page_numbers'] = array(
'current' => 1,
'total' => 1
);
}
return $page;
}
?>
/tags/Racine_livraison_narmer/api/pear/Pager/Jumping.php
New file
0,0 → 1,280
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 
/**
* Contains the Pager_Jumping class
*
* PHP versions 4 and 5
*
* LICENSE: Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* @category HTML
* @package Pager
* @author Lorenzo Alberton <l dot alberton at quipo dot it>
* @author Richard Heyes <richard@phpguru.org>,
* @copyright 2003-2006 Lorenzo Alberton, Richard Heyes
* @license http://www.debian.org/misc/bsd.license BSD License (3 Clause)
* @version CVS: $Id$
* @link http://pear.php.net/package/Pager
*/
 
/**
* require PEAR::Pager_Common base class
*/
require_once 'Pager/Common.php';
 
/**
* Pager_Jumping - Generic data paging class ("jumping window" style)
* Handles paging a set of data. For usage see the example.php provided.
*
* @category HTML
* @package Pager
* @author Lorenzo Alberton <l dot alberton at quipo dot it>
* @author Richard Heyes <richard@phpguru.org>,
* @copyright 2003-2005 Lorenzo Alberton, Richard Heyes
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @link http://pear.php.net/package/Pager
*/
class Pager_Jumping extends Pager_Common
{
// {{{ Pager_Jumping()
 
/**
* Constructor
*
* @param array $options An associative array of option names
* and their values
* @access public
*/
function Pager_Jumping($options = array())
{
$err = $this->setOptions($options);
if ($err !== PAGER_OK) {
return $this->raiseError($this->errorMessage($err), $err);
}
$this->build();
}
 
// }}}
// {{{ build()
 
/**
* Generate or refresh the links and paged data after a call to setOptions()
*
* @access public
*/
function build()
{
//reset
$this->_pageData = array();
$this->links = '';
 
$this->_generatePageData();
$this->_setFirstLastText();
 
$this->links .= $this->_getBackLink();
$this->links .= $this->_getPageLinks();
$this->links .= $this->_getNextLink();
 
$this->linkTags .= $this->_getFirstLinkTag();
$this->linkTags .= $this->_getPrevLinkTag();
$this->linkTags .= $this->_getNextLinkTag();
$this->linkTags .= $this->_getLastLinkTag();
}
 
// }}}
// {{{ getPageIdByOffset()
 
/**
* Returns pageID for given offset
*
* @param $index Offset to get pageID for
* @return int PageID for given offset
*/
function getPageIdByOffset($index)
{
if (!isset($this->_pageData)) {
$this->_generatePageData();
}
 
if (($index % $this->_perPage) > 0) {
$pageID = ceil((float)$index / (float)$this->_perPage);
} else {
$pageID = $index / $this->_perPage;
}
return $pageID;
}
 
// }}}
// {{{ getPageRangeByPageId()
 
/**
* Given a PageId, it returns the limits of the range of pages displayed.
* While getOffsetByPageId() returns the offset of the data within the
* current page, this method returns the offsets of the page numbers interval.
* E.g., if you have pageId=3 and delta=10, it will return (1, 10).
* PageID of 8 would give you (1, 10) as well, because 1 <= 8 <= 10.
* PageID of 11 would give you (11, 20).
* If the method is called without parameter, pageID is set to currentPage#.
*
* @param integer PageID to get offsets for
* @return array First and last offsets
* @access public
*/
function getPageRangeByPageId($pageid = null)
{
$pageid = isset($pageid) ? (int)$pageid : $this->_currentPage;
if (isset($this->_pageData[$pageid]) || is_null($this->_itemData)) {
// I'm sure I'm missing something here, but this formula works
// so I'm using it until I find something simpler.
$start = ((($pageid + (($this->_delta - ($pageid % $this->_delta))) % $this->_delta) / $this->_delta) - 1) * $this->_delta +1;
return array(
max($start, 1),
min($start+$this->_delta-1, $this->_totalPages)
);
} else {
return array(0, 0);
}
}
 
// }}}
// {{{ getLinks()
 
/**
* Returns back/next/first/last and page links,
* both as ordered and associative array.
*
* NB: in original PEAR::Pager this method accepted two parameters,
* $back_html and $next_html. Now the only parameter accepted is
* an integer ($pageID), since the html text for prev/next links can
* be set in the constructor. If a second parameter is provided, then
* the method act as it previously did. This hack's only purpose is to
* mantain backward compatibility.
*
* @param integer $pageID Optional pageID. If specified, links
* for that page are provided instead of current one.
* [ADDED IN NEW PAGER VERSION]
* @param string $next_html HTML to put inside the next link
* [deprecated: use the constructor instead]
* @return array Back/pages/next links
*/
function getLinks($pageID=null, $next_html='')
{
//BC hack
if (!empty($next_html)) {
$back_html = $pageID;
$pageID = null;
} else {
$back_html = '';
}
 
if (!is_null($pageID)) {
$_sav = $this->_currentPage;
$this->_currentPage = $pageID;
 
$this->links = '';
if ($this->_totalPages > $this->_delta) {
$this->links .= $this->_printFirstPage();
}
$this->links .= $this->_getBackLink('', $back_html);
$this->links .= $this->_getPageLinks();
$this->links .= $this->_getNextLink('', $next_html);
if ($this->_totalPages > $this->_delta) {
$this->links .= $this->_printLastPage();
}
}
 
$back = str_replace('&nbsp;', '', $this->_getBackLink());
$next = str_replace('&nbsp;', '', $this->_getNextLink());
$pages = $this->_getPageLinks();
$first = $this->_printFirstPage();
$last = $this->_printLastPage();
$all = $this->links;
$linkTags = $this->linkTags;
 
if (!is_null($pageID)) {
$this->_currentPage = $_sav;
}
 
return array(
$back,
$pages,
trim($next),
$first,
$last,
$all,
$linkTags,
'back' => $back,
'pages' => $pages,
'next' => $next,
'first' => $first,
'last' => $last,
'all' => $all,
'linktags' => $linkTags
);
}
 
// }}}
// {{{ _getPageLinks()
 
/**
* Returns pages link
*
* @param $url URL to use in the link
* [deprecated: use the constructor instead]
* @return string Links
* @access private
*/
function _getPageLinks($url = '')
{
//legacy setting... the preferred way to set an option now
//is adding it to the constuctor
if (!empty($url)) {
$this->_path = $url;
}
 
//If there's only one page, don't display links
if ($this->_clearIfVoid && ($this->_totalPages < 2)) {
return '';
}
 
$links = '';
$limits = $this->getPageRangeByPageId($this->_currentPage);
 
for ($i=$limits[0]; $i<=min($limits[1], $this->_totalPages); $i++) {
if ($i != $this->_currentPage) {
$this->range[$i] = false;
$this->_linkData[$this->_urlVar] = $i;
$links .= $this->_renderLink($this->_altPage.' '.$i, $i);
} else {
$this->range[$i] = true;
$links .= $this->_curPageSpanPre . $i . $this->_curPageSpanPost;
}
$links .= $this->_spacesBefore
. (($i != $this->_totalPages) ? $this->_separator.$this->_spacesAfter : '');
}
return $links;
}
 
// }}}
}
?>
/tags/Racine_livraison_narmer/api/pear/Pager/Sliding.php
New file
0,0 → 1,324
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 
/**
* Contains the Pager_Sliding class
*
* PHP versions 4 and 5
*
* LICENSE: Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* @category HTML
* @package Pager
* @author Lorenzo Alberton <l dot alberton at quipo dot it>
* @copyright 2003-2006 Lorenzo Alberton
* @license http://www.debian.org/misc/bsd.license BSD License (3 Clause)
* @version CVS: $Id$
* @link http://pear.php.net/package/Pager
*/
 
/**
* require PEAR::Pager_Common base class
*/
require_once 'Pager/Common.php';
 
/**
* Pager_Sliding - Generic data paging class ("sliding window" style)
* Usage examples can be found in the PEAR manual
*
* @category HTML
* @package Pager
* @author Lorenzo Alberton <l dot alberton at quipo dot it>
* @copyright 2003-2005 Lorenzo Alberton
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @link http://pear.php.net/package/Pager
*/
class Pager_Sliding extends Pager_Common
{
// {{{ Pager_Sliding()
 
/**
* Constructor
*
* @param array $options An associative array of option names
* and their values
* @access public
*/
function Pager_Sliding($options = array())
{
//set default Pager_Sliding options
$this->_delta = 2;
$this->_prevImg = '&laquo;';
$this->_nextImg = '&raquo;';
$this->_separator = '|';
$this->_spacesBeforeSeparator = 3;
$this->_spacesAfterSeparator = 3;
$this->_curPageSpanPre = '<b><u>';
$this->_curPageSpanPost = '</u></b>';
 
//set custom options
$err = $this->setOptions($options);
if ($err !== PAGER_OK) {
return $this->raiseError($this->errorMessage($err), $err);
}
$this->build();
}
 
// }}}
// {{{ build()
 
/**
* Generate or refresh the links and paged data after a call to setOptions()
*
* @access public
*/
function build()
{
//reset
$this->_pageData = array();
$this->links = '';
 
$this->_generatePageData();
$this->_setFirstLastText();
 
if ($this->_totalPages > (2 * $this->_delta + 1)) {
$this->links .= $this->_printFirstPage();
}
 
$this->links .= $this->_getBackLink();
$this->links .= $this->_getPageLinks();
$this->links .= $this->_getNextLink();
 
$this->linkTags .= $this->_getFirstLinkTag();
$this->linkTags .= $this->_getPrevLinkTag();
$this->linkTags .= $this->_getNextLinkTag();
$this->linkTags .= $this->_getLastLinkTag();
 
if ($this->_totalPages > (2 * $this->_delta + 1)) {
$this->links .= $this->_printLastPage();
}
}
 
// }}}
// {{{ getPageIdByOffset()
 
/**
* "Overload" PEAR::Pager method. VOID. Not needed here...
* @param integer $index Offset to get pageID for
* @deprecated
* @access public
*/
function getPageIdByOffset($index=null) { }
 
// }}}
// {{{ getPageRangeByPageId()
 
/**
* Given a PageId, it returns the limits of the range of pages displayed.
* While getOffsetByPageId() returns the offset of the data within the
* current page, this method returns the offsets of the page numbers interval.
* E.g., if you have pageId=5 and delta=2, it will return (3, 7).
* PageID of 9 would give you (4, 8).
* If the method is called without parameter, pageID is set to currentPage#.
*
* @param integer PageID to get offsets for
* @return array First and last offsets
* @access public
*/
function getPageRangeByPageId($pageid = null)
{
$pageid = isset($pageid) ? (int)$pageid : $this->_currentPage;
if (!isset($this->_pageData)) {
$this->_generatePageData();
}
if (isset($this->_pageData[$pageid]) || is_null($this->_itemData)) {
if ($this->_expanded) {
$min_surplus = ($pageid <= $this->_delta) ? ($this->_delta - $pageid + 1) : 0;
$max_surplus = ($pageid >= ($this->_totalPages - $this->_delta)) ?
($pageid - ($this->_totalPages - $this->_delta)) : 0;
} else {
$min_surplus = $max_surplus = 0;
}
return array(
max($pageid - $this->_delta - $max_surplus, 1),
min($pageid + $this->_delta + $min_surplus, $this->_totalPages)
);
}
return array(0, 0);
}
 
// }}}
// {{{ getLinks()
 
/**
* Returns back/next/first/last and page links,
* both as ordered and associative array.
*
* @param integer $pageID Optional pageID. If specified, links
* for that page are provided instead of current one.
* @return array back/pages/next/first/last/all links
* @access public
*/
function getLinks($pageID = null)
{
if ($pageID != null) {
$_sav = $this->_currentPage;
$this->_currentPage = $pageID;
 
$this->links = '';
if ($this->_totalPages > (2 * $this->_delta + 1)) {
$this->links .= $this->_printFirstPage();
}
$this->links .= $this->_getBackLink();
$this->links .= $this->_getPageLinks();
$this->links .= $this->_getNextLink();
if ($this->_totalPages > (2 * $this->_delta + 1)) {
$this->links .= $this->_printLastPage();
}
}
 
$back = str_replace('&nbsp;', '', $this->_getBackLink());
$next = str_replace('&nbsp;', '', $this->_getNextLink());
$pages = $this->_getPageLinks();
$first = $this->_printFirstPage();
$last = $this->_printLastPage();
$all = $this->links;
$linkTags = $this->linkTags;
 
if ($pageID != null) {
$this->_currentPage = $_sav;
}
 
return array(
$back,
$pages,
trim($next),
$first,
$last,
$all,
$linkTags,
'back' => $back,
'pages' => $pages,
'next' => $next,
'first' => $first,
'last' => $last,
'all' => $all,
'linktags' => $linkTags
);
}
 
// }}}
// {{{ _getPageLinks()
 
/**
* Returns pages link
*
* @return string Links
* @access private
*/
function _getPageLinks($url = '')
{
//legacy setting... the preferred way to set an option now
//is adding it to the constuctor
if (!empty($url)) {
$this->_path = $url;
}
//If there's only one page, don't display links
if ($this->_clearIfVoid && ($this->_totalPages < 2)) {
return '';
}
 
$links = '';
if ($this->_totalPages > (2 * $this->_delta + 1)) {
if ($this->_expanded) {
if (($this->_totalPages - $this->_delta) <= $this->_currentPage) {
$expansion_before = $this->_currentPage - ($this->_totalPages - $this->_delta);
} else {
$expansion_before = 0;
}
for ($i = $this->_currentPage - $this->_delta - $expansion_before; $expansion_before; $expansion_before--, $i++) {
$print_separator_flag = ($i != $this->_currentPage + $this->_delta); // && ($i != $this->_totalPages - 1)
$this->range[$i] = false;
$this->_linkData[$this->_urlVar] = $i;
$links .= $this->_renderLink($this->_altPage.' '.$i, $i)
. $this->_spacesBefore
. ($print_separator_flag ? $this->_separator.$this->_spacesAfter : '');
}
}
 
$expansion_after = 0;
for ($i = $this->_currentPage - $this->_delta; ($i <= $this->_currentPage + $this->_delta) && ($i <= $this->_totalPages); $i++) {
if ($i < 1) {
++$expansion_after;
continue;
}
 
// check when to print separator
$print_separator_flag = (($i != $this->_currentPage + $this->_delta) && ($i != $this->_totalPages));
 
if ($i == $this->_currentPage) {
$this->range[$i] = true;
$links .= $this->_curPageSpanPre . $i . $this->_curPageSpanPost;
} else {
$this->range[$i] = false;
$this->_linkData[$this->_urlVar] = $i;
$links .= $this->_renderLink($this->_altPage.' '.$i, $i);
}
$links .= $this->_spacesBefore
. ($print_separator_flag ? $this->_separator.$this->_spacesAfter : '');
}
 
if ($this->_expanded && $expansion_after) {
$links .= $this->_separator . $this->_spacesAfter;
for ($i = $this->_currentPage + $this->_delta +1; $expansion_after; $expansion_after--, $i++) {
$print_separator_flag = ($expansion_after != 1);
$this->range[$i] = false;
$this->_linkData[$this->_urlVar] = $i;
$links .= $this->_renderLink($this->_altPage.' '.$i, $i)
. $this->_spacesBefore
. ($print_separator_flag ? $this->_separator.$this->_spacesAfter : '');
}
}
 
} else {
//if $this->_totalPages <= (2*Delta+1) show them all
for ($i=1; $i<=$this->_totalPages; $i++) {
if ($i != $this->_currentPage) {
$this->range[$i] = false;
$this->_linkData[$this->_urlVar] = $i;
$links .= $this->_renderLink($this->_altPage.' '.$i, $i);
} else {
$this->range[$i] = true;
$links .= $this->_curPageSpanPre . $i . $this->_curPageSpanPost;
}
$links .= $this->_spacesBefore
. (($i != $this->_totalPages) ? $this->_separator.$this->_spacesAfter : '');
}
}
return $links;
}
 
// }}}
}
?>
/tags/Racine_livraison_narmer/api/pear/Pager/HtmlWidgets.php
New file
0,0 → 1,217
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 
/**
* Contains the Pager_HtmlWidgets class
*
* PHP versions 4 and 5
*
* LICENSE: Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* @category HTML
* @package Pager
* @author Lorenzo Alberton <l dot alberton at quipo dot it>
* @copyright 2003-2006 Lorenzo Alberton
* @license http://www.debian.org/misc/bsd.license BSD License (3 Clause)
* @version CVS: $Id$
* @link http://pear.php.net/package/Pager
*/
 
/**
* Two constants used to guess the path- and file-name of the page
* when the user doesn't set any other value
*/
class Pager_HtmlWidgets
{
var $pager = null;
// {{{ constructor
function Pager_HtmlWidgets(&$pager)
{
$this->pager =& $pager;
}
// }}}
// {{{ getPerPageSelectBox()
 
/**
* Returns a string with a XHTML SELECT menu,
* useful for letting the user choose how many items per page should be
* displayed. If parameter useSessions is TRUE, this value is stored in
* a session var. The string isn't echoed right now so you can use it
* with template engines.
*
* @param integer $start
* @param integer $end
* @param integer $step
* @param boolean $showAllData If true, perPage is set equal to totalItems.
* @param array (or string $optionText for BC reasons)
* - 'optionText': text to show in each option.
* Use '%d' where you want to see the number of pages selected.
* - 'attributes': (html attributes) Tag attributes or
* HTML attributes (id="foo" pairs), will be inserted in the
* <select> tag
* @return string xhtml select box
* @access public
*/
function getPerPageSelectBox($start=5, $end=30, $step=5, $showAllData=false, $extraParams=array())
{
// FIXME: needs POST support
$optionText = '%d';
$attributes = '';
if (is_string($extraParams)) {
//old behavior, BC maintained
$optionText = $extraParams;
} else {
if (array_key_exists('optionText', $extraParams)) {
$optionText = $extraParams['optionText'];
}
if (array_key_exists('attributes', $extraParams)) {
$attributes = $extraParams['attributes'];
}
}
 
if (!strstr($optionText, '%d')) {
return $this->pager->raiseError(
$this->pager->errorMessage(ERROR_PAGER_INVALID_PLACEHOLDER),
ERROR_PAGER_INVALID_PLACEHOLDER
);
}
$start = (int)$start;
$end = (int)$end;
$step = (int)$step;
if (!empty($_SESSION[$this->pager->_sessionVar])) {
$selected = (int)$_SESSION[$this->pager->_sessionVar];
} else {
$selected = $this->pager->_perPage;
}
 
$tmp = '<select name="'.$this->pager->_sessionVar.'"';
if (!empty($attributes)) {
$tmp .= ' '.$attributes;
}
$tmp .= '>';
for ($i=$start; $i<=$end; $i+=$step) {
$tmp .= '<option value="'.$i.'"';
if ($i == $selected) {
$tmp .= ' selected="selected"';
}
$tmp .= '>'.sprintf($optionText, $i).'</option>';
}
if ($showAllData && $end < $this->pager->_totalItems) {
$tmp .= '<option value="'.$this->pager->_totalItems.'"';
if ($this->pager->_totalItems == $selected) {
$tmp .= ' selected="selected"';
}
$tmp .= '>';
if (empty($this->pager->_showAllText)) {
$tmp .= str_replace('%d', $this->pager->_totalItems, $optionText);
} else {
$tmp .= $this->pager->_showAllText;
}
$tmp .= '</option>';
}
$tmp .= '</select>';
return $tmp;
}
 
// }}}
// {{{ getPageSelectBox()
 
/**
* Returns a string with a XHTML SELECT menu with the page numbers,
* useful as an alternative to the links
*
* @param array - 'optionText': text to show in each option.
* Use '%d' where you want to see the number of pages selected.
* - 'autoSubmit': if TRUE, add some js code to submit the
* form on the onChange event
* @param string $extraAttributes (html attributes) Tag attributes or
* HTML attributes (id="foo" pairs), will be inserted in the
* <select> tag
* @return string xhtml select box
* @access public
*/
function getPageSelectBox($params = array(), $extraAttributes = '')
{
$optionText = '%d';
if (array_key_exists('optionText', $params)) {
$optionText = $params['optionText'];
}
 
if (!strstr($optionText, '%d')) {
return $this->pager->raiseError(
$this->pager->errorMessage(ERROR_PAGER_INVALID_PLACEHOLDER),
ERROR_PAGER_INVALID_PLACEHOLDER
);
}
$tmp = '<select name="'.$this->pager->_urlVar.'"';
if (!empty($extraAttributes)) {
$tmp .= ' '.$extraAttributes;
}
if (!empty($params['autoSubmit'])) {
if ($this->pager->_httpMethod == 'GET') {
$selector = '\' + '.'this.options[this.selectedIndex].value + \'';
if ($this->pager->_append) {
$href = '?' . $this->pager->_http_build_query_wrapper($this->pager->_linkData);
$href = htmlentities($this->pager->_url). preg_replace(
'/(&|&amp;|\?)('.$this->pager->_urlVar.'=)(\d+)/',
'\\1\\2'.$selector,
htmlentities($href)
);
} else {
$href = htmlentities($this->pager->_url . str_replace('%d', $selector, $this->pager->_fileName));
}
$tmp .= ' onchange="document.location.href=\''
. $href .'\''
. '"';
} elseif ($this->pager->_httpMethod == 'POST') {
$tmp .= " onchange='"
. $this->pager->_generateFormOnClick($this->pager->_url, $this->pager->_linkData)
. "'";
$tmp = preg_replace(
'/(input\.name = \"'.$this->pager->_urlVar.'\"; input\.value =) \"(\d+)\";/',
'\\1 this.options[this.selectedIndex].value;',
$tmp
);
}
}
$tmp .= '>';
$start = 1;
$end = $this->pager->numPages();
$selected = $this->pager->getCurrentPageID();
for ($i=$start; $i<=$end; $i++) {
$tmp .= '<option value="'.$i.'"';
if ($i == $selected) {
$tmp .= ' selected="selected"';
}
$tmp .= '>'.sprintf($optionText, $i).'</option>';
}
$tmp .= '</select>';
return $tmp;
}
// }}}
}
?>
/tags/Racine_livraison_narmer/api/pear/Pager/tests/pager_wrapper_include.php
New file
0,0 → 1,5
<?php
// $Id$
require_once 'Pager/Pager.php';
require_once 'Pager/Wrapper.php';
?>
/tags/Racine_livraison_narmer/api/pear/Pager/tests/pager_include.php
New file
0,0 → 1,4
<?php
// $Id$
require_once 'Pager/Pager.php';
?>
/tags/Racine_livraison_narmer/api/pear/Pager/tests/pager_post_test.php
New file
0,0 → 1,67
<?php
// $Id$
 
require_once 'simple_include.php';
require_once 'pager_include.php';
 
class TestOfPagerPOST extends WebTestCase {
var $pager;
var $baseurl;
var $options = array();
 
function TestOfPagerPOST($name='Test of Pager with httpMethod="POST"') {
$this->WebTestCase($name);
}
function setUp() {
$this->options = array(
'itemData' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
'perPage' => 1,
'clearIfVoid' => false,
'httpMethod' => 'POST',
);
//$this->pager = Pager::factory($this->options);
$this->baseurl = 'http://'.$_SERVER['HTTP_HOST'].substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], '/'));
}
function tearDown() {
unset($this->pager);
}
 
function testMultibyteEncoded() {
$test_strings_encoded = array(
'encoded1' => '&#27979;&#35797;',
'encoded2' => '&#50504;&#45397;',
);
$loaded = $this->get($this->baseurl.'/multibyte_post.php');
$this->assertTrue($loaded);
$this->assertResponse(200);
$this->assertTitle('Pager Test: page 1');
$this->assertNoLink('1');
$this->assertLink('2');
$this->assertLink('Next >>');
//$this->showSource();
foreach ($test_strings_encoded as $name => $value) {
$this->assertWantedPattern('/'.$name.'.*'.preg_quote(str_replace('&', '&amp;', $value)).'/Uims');
}
}
 
function testMultibytePlain() {
$test_strings_plain = array(
'plain1' => '안녕',
'plain2' => '더보기',
// 'plain3' => '이젠 전화도
//로 걸면 무료',
);
$loaded = $this->get($this->baseurl.'/multibyte_post.php');
$this->assertTrue($loaded);
$this->assertResponse(200);
$this->assertTitle('Pager Test: page 1');
$this->assertNoLink('1');
$this->assertLink('2');
$this->assertLink('Next >>');
//$this->showSource();
foreach ($test_strings_plain as $name => $value) {
$this->assertWantedPattern('/'.$name.'.*'.preg_quote(urlencode($value)).'/Uims');
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Pager/tests/pager_sliding_test.php
New file
0,0 → 1,56
<?php
// $Id$
 
require_once 'simple_include.php';
require_once 'pager_include.php';
 
class TestOfPagerSliding extends UnitTestCase {
var $pager;
function TestOfPagerSliding($name='Test of Pager_Sliding') {
$this->UnitTestCase($name);
}
function setUp() {
$options = array(
'itemData' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12),
'perPage' => 2,
'mode' => 'Sliding',
);
$this->pager = Pager::factory($options);
}
function tearDown() {
unset($this->pager);
}
function testPageRangeByPageId1() {
$this->assertEqual(array(1, 5), $this->pager->getPageRangeByPageId(1));
}
function testPageRangeByPageId4() {
$this->assertEqual(array(2, 6), $this->pager->getPageRangeByPageId(4));
}
function testPageRangeByPageId_outOfRange() {
$this->assertEqual(array(0, 0), $this->pager->getPageRangeByPageId(20));
}
function testPageRangeByPageId2() {
$this->assertEqual(array(2, 6), $this->pager->getPageRangeByPageId(4));
}
function testGetPageData() {
$this->assertEqual(array(0=>1, 1=>2), $this->pager->getPageData());
}
function testGetPageData2() {
$this->assertEqual(array(2=>3, 3=>4), $this->pager->getPageData(2));
}
function testGetPageData_OutOfRange() {
$this->assertEqual(false, $this->pager->getPageData(20));
}
function testClearIfVoid() {
$this->assertTrue(strlen($this->pager->links) > 0);
$options = array(
'itemData' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12),
'perPage' => 20,
'mode' => 'Sliding',
);
$this->pager = Pager::factory($options);
$this->assertEqual('', $this->pager->links);
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Pager/tests/README
New file
0,0 → 1,5
These tests require Simple Test: http://www.lastcraft.com/simple_test.php
 
- edit the simple_include.php script and set your SimpleTest install dir;
- edit the pager_include.php and pager_wrapper_include.php scripts to set
your Pager directory.
/tags/Racine_livraison_narmer/api/pear/Pager/tests/pager_jumping_tests.php
New file
0,0 → 1,20
<?php
// $Id$
 
require_once 'simple_include.php';
require_once 'pager_include.php';
 
class PagerJumpingTests extends GroupTest {
function PagerJumpingTests() {
$this->GroupTest('Pager_Jumping Tests');
$this->addTestFile('pager_jumping_test.php');
$this->addTestFile('pager_jumping_noData_test.php');
}
}
 
if (!defined('TEST_RUNNING')) {
define('TEST_RUNNING', true);
$test = &new PagerTests();
$test->run(new HtmlReporter());
}
?>
/tags/Racine_livraison_narmer/api/pear/Pager/tests/pager_jumping_noData_test.php
New file
0,0 → 1,36
<?php
// $Id$
 
require_once 'simple_include.php';
require_once 'pager_include.php';
 
class TestOfPagerJumpingNoData extends UnitTestCase {
var $pager;
function TestOfPagerJumpingNoData($name='Test of Pager_Jumping - no data') {
$this->UnitTestCase($name);
}
function setUp() {
$options = array(
'totalItems' => 0,
'perPage' => 2,
'mode' => 'Jumping',
);
$this->pager = Pager::factory($options);
}
function tearDown() {
unset($this->pager);
}
function testOffsetByPageId() {
$this->assertEqual(array(1, 0), $this->pager->getOffsetByPageId());
}
function testPageIdByOffset() {
$this->assertEqual(false, $this->pager->getPageIdByOffset(0));
}
function testPageIdByOffset2() {
$this->assertEqual(1, $this->pager->getPageIdByOffset(1));
}
function testPageIdByOffset3() {
$this->assertEqual(1, $this->pager->getPageIdByOffset(2));
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Pager/tests/pager_tests.php
New file
0,0 → 1,20
<?php
// $Id$
 
require_once 'simple_include.php';
require_once 'pager_include.php';
 
class PagerTests extends GroupTest {
function PagerTests() {
$this->GroupTest('Pager Tests');
$this->addTestFile('pager_test.php');
$this->addTestFile('pager_noData_test.php');
}
}
 
if (!defined('TEST_RUNNING')) {
define('TEST_RUNNING', true);
$test = &new PagerTests();
$test->run(new HtmlReporter());
}
?>
/tags/Racine_livraison_narmer/api/pear/Pager/tests/multibyte_post.php
New file
0,0 → 1,48
<?php
require_once 'Pager/Pager.php';
 
//create dummy array of data
$myData = array();
for ($i=0; $i<200; $i++) {
$myData[] = $i;
}
 
//set a string
$test_strings_encoded = array(
'encoded1' => '&#27979;&#35797;',
'encoded2' => '&#50504;&#45397;',
);
$test_strings_plain = array(
'plain1' => '안녕',
'plain2' => '더보기',
// 'plain3' => '이젠 전화도
//로 걸면 무료',
);
$params = array(
'itemData' => $myData,
'perPage' => 10,
'delta' => 2,
'append' => true,
'clearIfVoid' => false,
'extraVars' => array_merge($test_strings_plain, $test_strings_encoded),
'httpMethod' => 'POST',
'path' => 'http://'.$_SERVER['HTTP_HOST'].substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], '/')),
'fileName' => basename(__FILE__),
);
//var_dump($params['fileName']);exit;
$pager = & Pager::factory($params);
$page_data = $pager->getPageData();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Pager Test: page <?php echo $pager->getCurrentPageID(); ?></title>
</head>
<body>
<?php echo $pager->links; ?>
<hr />
<pre><?php print_r($page_data); ?></pre>
</body>
</html>
/tags/Racine_livraison_narmer/api/pear/Pager/tests/pager_noData_test.php
New file
0,0 → 1,48
<?php
// $Id$
 
require_once 'simple_include.php';
require_once 'pager_include.php';
 
class TestOfPagerNoData extends UnitTestCase {
var $pager;
function TestOfPagerNoData($name='Test of Pager - no data') {
$this->UnitTestCase($name);
}
function setUp() {
$options = array(
'totalItems' => 0,
'perPage' => 5,
'mode' => 'Sliding',
);
$this->pager = Pager::factory($options);
}
function tearDown() {
unset($this->pager);
}
function testCurrentPageID () {
$this->assertEqual(0, $this->pager->getCurrentPageID());
}
function testNextPageID () {
$this->assertEqual(false, $this->pager->getNextPageID());
}
function testPrevPageID () {
$this->assertEqual(false, $this->pager->getPreviousPageID());
}
function testNumItems () {
$this->assertEqual(0, $this->pager->numItems());
}
function testNumPages () {
$this->assertEqual(0, $this->pager->numPages());
}
function testFirstPage () {
$this->assertEqual(true, $this->pager->isFirstPage());
}
function testLastPage () {
$this->assertEqual(true, $this->pager->isLastPage());
}
function testLastPageComplete () {
$this->assertEqual(true, $this->pager->isLastPageComplete());
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Pager/tests/pager_post_tests.php
New file
0,0 → 1,11
<?php
// $Id$
 
require_once 'simple_include.php';
require_once 'pager_include.php';
 
$test = &new GroupTest('Pager POST tests');
$test->addTestFile('pager_post_test.php');
exit ($test->run(new HTMLReporter()) ? 0 : 1);
 
?>
/tags/Racine_livraison_narmer/api/pear/Pager/tests/pager_jumping_test.php
New file
0,0 → 1,83
<?php
// $Id$
 
require_once 'simple_include.php';
require_once 'pager_include.php';
 
class TestOfPagerJumping extends UnitTestCase {
var $pager;
function TestOfPagerJumping($name='Test of Pager_Jumping') {
$this->UnitTestCase($name);
}
function setUp() {
$options = array(
'itemData' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12),
'perPage' => 5,
'mode' => 'Jumping',
'delta' => 2
);
$this->pager = Pager::factory($options);
}
function tearDown() {
unset($this->pager);
}
function testPageIdByOffset1() {
$this->assertEqual(1, $this->pager->getPageIdByOffset(1));
}
function testPageIdByOffset5() {
$this->assertEqual(1, $this->pager->getPageIdByOffset(5));
}
function testPageIdByOffset6() {
$this->assertEqual(2, $this->pager->getPageIdByOffset(6));
}
function testPageRangeByPageId1() {
$this->assertEqual(array(1, 2), $this->pager->getPageRangeByPageId(1));
}
function testPageRangeByPageId2() {
$this->assertEqual(array(1, 2), $this->pager->getPageRangeByPageId(2));
}
function testPageRangeByPageId3() {
$this->assertEqual(array(3, 3), $this->pager->getPageRangeByPageId(3));
}
function testPageRangeByPageId_outOfRange() {
$this->assertEqual(array(0, 0), $this->pager->getPageRangeByPageId(20));
}
function testGetPageData() {
$this->assertEqual(array(0=>1, 1=>2, 2=>3, 3=>4, 4=>5), $this->pager->getPageData());
}
function testGetPageData2() {
$this->assertEqual(array(5=>6, 6=>7, 7=>8, 8=>9, 9=>10), $this->pager->getPageData(2));
}
function testGetPageData_OutOfRange() {
$this->assertEqual(false, $this->pager->getPageData(4));
}
/**
* Returns offsets for given pageID. Eg, if you pass pageID=5 and your
* delta is 2, it will return 3 and 7. A pageID of 6 would give you 4 and 8
* If the method is called without parameter, pageID is set to currentPage#.
*
* Given a PageId, it returns the limits of the range of pages displayed.
* While getOffsetByPageId() returns the offset of the data within the current
* page, this method returns the offsets of the page numbers interval.
* E.g., if you have perPage=10 and pageId=3, it will return you 1 and 10.
* PageID of 8 would give you 1 and 10 as well, because 1 <= 8 <= 10.
* PageID of 11 would give you 11 and 20.
*
* @param pageID PageID to get offsets for
* @return array First and last offsets
* @access public
*/
/**
* Given a PageId, it returns the limits of the range of pages displayed.
* While getOffsetByPageId() returns the offset of the data within the
* current page, this method returns the offsets of the page numbers interval.
* E.g., if you have perPage=10 and pageId=3, it will return you 1 and 10.
* PageID of 8 would give you 1 and 10 as well, because 1 <= 8 <= 10.
* PageID of 11 would give you 11 and 20.
*
* @param pageID PageID to get offsets for
* @return array First and last offsets
* @access public
*/
}
?>
/tags/Racine_livraison_narmer/api/pear/Pager/tests/pager_sliding_tests.php
New file
0,0 → 1,21
<?php
// $Id$
 
require_once 'simple_include.php';
require_once 'pager_include.php';
 
class PagerSlidingTests extends GroupTest {
function PagerSlidingTests() {
$this->GroupTest('Pager_Sliding Tests');
$this->addTestFile('pager_sliding_test.php');
$this->addTestFile('pager_sliding_notExpanded_test.php');
$this->addTestFile('pager_sliding_noData_test.php');
}
}
 
if (!defined('TEST_RUNNING')) {
define('TEST_RUNNING', true);
$test = &new PagerTests();
$test->run(new HtmlReporter());
}
?>
/tags/Racine_livraison_narmer/api/pear/Pager/tests/all_tests.php
New file
0,0 → 1,25
<?php
// $Id$
 
require_once 'simple_include.php';
require_once 'pager_include.php';
 
define('TEST_RUNNING', true);
 
require_once './pager_tests.php';
require_once './pager_jumping_tests.php';
require_once './pager_sliding_tests.php';
 
 
class AllTests extends GroupTest {
function AllTests() {
$this->GroupTest('All PEAR::Pager Tests');
$this->AddTestCase(new PagerTests());
$this->AddTestCase(new PagerJumpingTests());
$this->AddTestCase(new PagerSlidingTests());
}
}
 
$test = &new AllTests();
$test->run(new HtmlReporter());
?>
/tags/Racine_livraison_narmer/api/pear/Pager/tests/pager_test_xss.php
New file
0,0 → 1,43
<?php
// $Id$
 
//override url
$_SERVER['PHP_SELF'] = '">test';
 
require_once 'simple_include.php';
require_once 'pager_include.php';
 
class TestOfPagerXSS extends UnitTestCase {
var $pager;
var $baseurl;
function TestOfPagerXSS($name='Test of Pager - XSS attacks') {
$this->UnitTestCase($name);
}
function setUp() {
$options = array(
'itemData' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
'perPage' => 5,
);
$this->pager = Pager::factory($options);
$this->baseurl = substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], '/'));
}
function tearDown() {
unset($this->pager);
}
function testXSS() {
$options = array(
'itemData' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
'perPage' => 5,
'nextImg' => '&raquo;'
);
$this->pager = Pager::factory($options);
$expected = '&nbsp;<a href="./&quot;&gt;test?pageID=2" title="next page">&raquo;</a>&nbsp;';
$this->assertEqual($expected, $this->pager->_getNextLink());
}
}
if (!defined('TEST_RUNNING')) {
define('TEST_RUNNING', true);
$test = &new TestOfPagerXSS();
$test->run(new HtmlReporter());
}
?>
/tags/Racine_livraison_narmer/api/pear/Pager/tests/simple_include.php
New file
0,0 → 1,17
<?php
// $Id$
//
// This testsuite requires SimpleTest.
// You can find it here:
// http://www.lastcraft.com/simple_test.php
//
if (!defined('SIMPLE_TEST')) {
define('SIMPLE_TEST', '../simpletest/');
}
 
require_once(SIMPLE_TEST . 'unit_tester.php');
require_once(SIMPLE_TEST . 'reporter.php');
require_once(SIMPLE_TEST . 'mock_objects.php');
require_once(SIMPLE_TEST . 'web_tester.php');
require_once(SIMPLE_TEST . 'reporter.php');
?>
/tags/Racine_livraison_narmer/api/pear/Pager/tests/pager_sliding_noData_test.php
New file
0,0 → 1,30
<?php
// $Id$
 
require_once 'simple_include.php';
require_once 'pager_include.php';
 
class TestOfPagerSlidingNoData extends UnitTestCase {
var $pager;
function TestOfPagerSlidingNoData($name='Test of Pager_Sliding - no data') {
$this->UnitTestCase($name);
}
function setUp() {
$options = array(
'totalItems' => 0,
'perPage' => 2,
'mode' => 'Sliding',
);
$this->pager = Pager::factory($options);
}
function tearDown() {
unset($this->pager);
}
function testOffsetByPageId() {
$this->assertEqual(array(1, 0), $this->pager->getOffsetByPageId());
}
function testPageIdByOffset() {
$this->assertNull($this->pager->getPageIdByOffset());
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Pager/tests/pager_wrapper_test.php
New file
0,0 → 1,205
<?php
// $Id$
 
require_once 'simple_include.php';
require_once 'pager_wrapper_include.php';
 
class TestOfPagerWrapper extends UnitTestCase
{
function TestOfPagerWrapper($name='Test of Pager_Wrapper') {
$this->UnitTestCase($name);
}
function setUp() { }
function tearDown() { }
 
/**
* Basic tests for rewriteCountQuery()
*/
function testRewriteCountQuery() {
//test LIMIT
$query = 'SELECT a, b, c, d FROM mytable WHERE a=1 AND c="g" LIMIT 2';
$expected = 'SELECT COUNT(*) FROM mytable WHERE a=1 AND c="g"';
$this->assertEqual($expected, rewriteCountQuery($query));
 
//test ORDER BY and quotes
$query = 'SELECT a, b, c, d FROM mytable WHERE a=1 AND c="g" ORDER BY (a, b)';
$expected = 'SELECT COUNT(*) FROM mytable WHERE a=1 AND c="g"';
$this->assertEqual($expected, rewriteCountQuery($query));
 
//test CR/LF
$query = 'SELECT a, b, c, d FROM mytable
WHERE a=1
AND c="g"
ORDER BY (a, b)';
$expected = 'SELECT COUNT(*) FROM mytable
WHERE a=1
AND c="g"';
$this->assertEqual($expected, rewriteCountQuery($query));
 
//test GROUP BY
$query = 'SELECT a, b, c, d FROM mytable WHERE a=1 GROUP BY c';
$this->assertFalse(rewriteCountQuery($query));
 
//test DISTINCT
$query = 'SELECT DISTINCT a, b, c, d FROM mytable WHERE a=1 GROUP BY c';
$this->assertFalse(rewriteCountQuery($query));
 
//test MiXeD Keyword CaSe
$query = 'SELECT a, b, c, d from mytable WHERE a=1 AND c="g"';
$expected = 'SELECT COUNT(*) FROM mytable WHERE a=1 AND c="g"';
$this->assertEqual($expected, rewriteCountQuery($query));
 
//test function speed... this query used to be very slow to parse
$query = "SELECT i.item_id,
ia.addition,
u.username,
i.date_created,
i.start_date,
i.expiry_date
FROM item i, item_addition ia, item_type it, item_type_mapping itm, usr u, category c
WHERE ia.item_type_mapping_id = itm.item_type_mapping_id
AND i.updated_by_id = u.usr_id
AND it.item_type_id = itm.item_type_id
AND i.item_id = ia.item_id
AND i.item_type_id = it.item_type_id
AND itm.field_name = 'title' AND it.item_type_id = 2 AND i.category_id = 1 AND i.status = 4
AND i.category_id = c.category_id
AND 0 NOT IN (COALESCE(c.perms, '-1'))
ORDER BY i.last_updated DESC";
$expected = "SELECT COUNT(*) FROM item i, item_addition ia, item_type it, item_type_mapping itm, usr u, category c
WHERE ia.item_type_mapping_id = itm.item_type_mapping_id
AND i.updated_by_id = u.usr_id
AND it.item_type_id = itm.item_type_id
AND i.item_id = ia.item_id
AND i.item_type_id = it.item_type_id
AND itm.field_name = 'title' AND it.item_type_id = 2 AND i.category_id = 1 AND i.status = 4
AND i.category_id = c.category_id
AND 0 NOT IN (COALESCE(c.perms, '-1'))";
$this->assertEqual($expected, rewriteCountQuery($query));
}
/**
* Test rewriteCountQuery() with queries having a subquery in the SELECT clause
*/
function testRewriteCountQuery_SubqueriesInSelectClause() {
$query = 'SELECT a, (SELECT a FROM b) AS b, c, d FROM mytable WHERE a=1 AND c="g" LIMIT 2';
$expected = 'SELECT COUNT(*) FROM mytable WHERE a=1 AND c="g"';
$this->assertFalse(rewriteCountQuery($query));
 
$query = 'SELECT a, (SELECT a FROM b) AS b, (SELECT c FROM c) AS c, d FROM mytable WHERE a=1 AND c="g" LIMIT 2';
//$expected = 'SELECT COUNT(*) FROM mytable WHERE a=1 AND c="g"';
$this->assertFalse(rewriteCountQuery($query));
 
$query = 'SELECT `id`, `ip`, (
SELECT TIMEDIFF(MAX(P.`time`), MIN(P.`time`))
FROM `przejscia` as P
WHERE P.`id_wejscia`=W.`id`
) as `czas`
FROM `wejscia` as W
WHERE W.id_domeny=?
ORDER BY W.czas_wejscia DESC';
$expected = 'SELECT COUNT(*)
FROM `wejscia` as W
WHERE W.id_domeny=?
ORDER BY W.czas_wejscia DESC';
$this->assertFalse(rewriteCountQuery($query));
}
/**
* Test rewriteCountQuery() with queries having a subquery in the FROM clause
*/
function testRewriteCountQuery_SubqueriesInFromClause() {
$query = 'SELECT a, b, c, d FROM (SELECT a, b, c, d FROM mytable WHERE a=1) AS tbl_alias WHERE a=1';
$expected = 'SELECT COUNT(*) FROM (SELECT a, b, c, d FROM mytable WHERE a=1) AS tbl_alias WHERE a=1';
$this->assertEqual($expected, rewriteCountQuery($query));
}
/**
* Test rewriteCountQuery() with queries having a subquery in the WHERE clause
*/
function testRewriteCountQuery_SubqueriesInWhereClause() {
//this one is not rewritten: subqueries with ORDER BY clauses might get truncated
$query = 'SELECT Version.VersionId, Version.Identifier,News.*
FROM VersionBroker
JOIN ObjectType ON ObjectType.ObjectTypeId = VersionBroker.ObjectTypeId
JOIN Version ON VersionBroker.Identifier = Version.Identifier
JOIN News ON Version.ObjectId = News.NewsId
WHERE Version.Status = \'Approved\'
AND ObjectType.Name = \'News\'
AND Version.ApprovedTS = (
SELECT SubV.ApprovedTS
FROM Version SubV
WHERE SubV.Identifier = VersionBroker.Identifier
ORDER BY ApprovedTS DESC
LIMIT 1)
ORDER BY ApprovedTS DESC';
 
$expected = 'SELECT COUNT(*)
FROM VersionBroker
JOIN ObjectType ON ObjectType.ObjectTypeId = VersionBroker.ObjectTypeId
JOIN Version ON VersionBroker.Identifier = Version.Identifier
JOIN News ON Version.ObjectId = News.NewsId
WHERE Version.Status = \'Approved\'
AND ObjectType.Name = \'News\'
AND Version.ApprovedTS = (
SELECT SubV.ApprovedTS
FROM Version SubV
WHERE SubV.Identifier = VersionBroker.Identifier
ORDER BY ApprovedTS DESC
LIMIT 1)
ORDER BY ApprovedTS DESC';
//$this->assertEqual($expected, rewriteCountQuery($query));
$this->assertFalse(rewriteCountQuery($query));
//this one should pass... subquery without ORDER BY or LIMIT clause
$query = 'SELECT Version.VersionId, Version.Identifier,News.* FROM VersionBroker JOIN
ObjectType ON ObjectType.ObjectTypeId = VersionBroker.ObjectTypeId JOIN
Version ON VersionBroker.Identifier = Version.Identifier JOIN News ON
Version.ObjectId = News.NewsId WHERE Version.Status = \'Approved\' AND
ObjectType.Name = \'News\' AND Version.ApprovedTS = ( SELECT SubV.ApprovedTS
FROM Version SubV WHERE SubV.Identifier = VersionBroker.Identifier ) ORDER BY ApprovedTS DESC';
 
$expected = 'SELECT COUNT(*) FROM VersionBroker JOIN
ObjectType ON ObjectType.ObjectTypeId = VersionBroker.ObjectTypeId JOIN
Version ON VersionBroker.Identifier = Version.Identifier JOIN News ON
Version.ObjectId = News.NewsId WHERE Version.Status = \'Approved\' AND
ObjectType.Name = \'News\' AND Version.ApprovedTS = ( SELECT SubV.ApprovedTS
FROM Version SubV WHERE SubV.Identifier = VersionBroker.Identifier )';
$this->assertEqual($expected, rewriteCountQuery($query));
}
 
/**
* Test rewriteCountQuery() with queries having keywords embedded in other words
*/
function testRewriteCountQuery_EmbeddedKeywords() {
$query = 'SELECT afieldFROM, b, c, d FROM mytable WHERE a=1 AND c="g"';
$expected = 'SELECT COUNT(*) FROM mytable WHERE a=1 AND c="g"';
$this->assertEqual($expected, rewriteCountQuery($query));
 
$query = 'SELECT FROMafield, b, c, d FROM mytable WHERE a=1 AND c="g"';
$expected = 'SELECT COUNT(*) FROM mytable WHERE a=1 AND c="g"';
$this->assertEqual($expected, rewriteCountQuery($query));
 
$query = 'SELECT afieldFROMaaa, b, c, d FROM mytable WHERE a=1 AND c="gLIMIT"';
$expected = 'SELECT COUNT(*) FROM mytable WHERE a=1 AND c="gLIMIT"';
$this->assertEqual($expected, rewriteCountQuery($query));
 
$query = 'SELECT DISTINCTaaa, b, c, d FROM mytable WHERE a=1 AND c="g"';
$expected = 'SELECT COUNT(*) FROM mytable WHERE a=1 AND c="g"';
$this->assertEqual($expected, rewriteCountQuery($query));
 
//this one fails... the regexp should NOT match keywords within quotes.
//we need a full blown stack-based parser to catch this...
$query = 'SELECT afieldFROMaaa, b, c, d FROM mytable WHERE a=1 AND c="g LIMIT a"';
$expected = 'SELECT COUNT(*) FROM mytable WHERE a=1 AND c="g LIMIT a"';
$this->assertEqual($expected, rewriteCountQuery($query));
}
}
 
if (!defined('TEST_RUNNING')) {
define('TEST_RUNNING', true);
$test = &new TestOfPagerWrapper();
$test->run(new HtmlReporter());
}
?>
/tags/Racine_livraison_narmer/api/pear/Pager/tests/pager_test.php
New file
0,0 → 1,553
<?php
// $Id$
 
require_once 'simple_include.php';
require_once 'pager_include.php';
 
class TestOfPager extends UnitTestCase {
var $pager;
var $baseurl;
function TestOfPager($name='Test of Pager') {
$this->UnitTestCase($name);
}
function setUp() {
$options = array(
'itemData' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
'perPage' => 5,
);
$this->pager = Pager::factory($options);
$this->baseurl = substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], '/'));
}
function tearDown() {
unset($this->pager);
}
function testCurrentPageID () {
$this->assertEqual(1, $this->pager->getCurrentPageID());
}
function testNextPageID () {
$this->assertEqual(2, $this->pager->getNextPageID());
}
function testPrevPageID () {
$this->assertEqual(false, $this->pager->getPreviousPageID());
}
function testNumItems () {
$this->assertEqual(10, $this->pager->numItems());
}
function testNumPages () {
$this->assertEqual(2, $this->pager->numPages());
}
function testFirstPage () {
$this->assertEqual(true, $this->pager->isFirstPage());
}
function testLastPage () {
$this->assertEqual(false, $this->pager->isLastPage());
}
function testLastPageComplete () {
$this->assertEqual(true, $this->pager->isLastPageComplete());
}
function testOffsetByPageId() {
$this->assertEqual(array(1, 5), $this->pager->getOffsetByPageId(1));
$this->assertEqual(array(6, 10), $this->pager->getOffsetByPageId(2));
}
function testOffsetByPageId_outOfRange() {
$this->assertEqual(array(0, 0), $this->pager->getOffsetByPageId(20));
}
function testGetPageData() {
$this->assertEqual(array(0=>1, 1=>2, 2=>3, 3=>4, 4=>5), $this->pager->getPageData());
$this->assertEqual(array(5=>6, 6=>7, 7=>8, 8=>9, 9=>10), $this->pager->getPageData(2));
}
function testGetPageData_OutOfRange() {
$this->assertEqual(array(), $this->pager->getPageData(3));
}
function testSelectBox() {
$selectBox = '<select name="'.$this->pager->_sessionVar.'">';
$selectBox .= '<option value="5" selected="selected">5</option>';
$selectBox .= '<option value="10">10</option>';
$selectBox .= '<option value="15">15</option>';
$selectBox .= '</select>';
$this->assertEqual($selectBox, $this->pager->getPerPageSelectBox(5, 15, 5));
}
function testSelectBoxWithString() {
$selectBox = '<select name="'.$this->pager->_sessionVar.'">';
$selectBox .= '<option value="5" selected="selected">5 bugs</option>';
$selectBox .= '<option value="10">10 bugs</option>';
$selectBox .= '<option value="15">15 bugs</option>';
$selectBox .= '</select>';
$this->assertEqual($selectBox, $this->pager->getPerPageSelectBox(5, 15, 5, false, '%d bugs'));
}
function testSelectBoxWithShowAll() {
$selectBox = '<select name="'.$this->pager->_sessionVar.'">';
$selectBox .= '<option value="3">3</option>';
$selectBox .= '<option value="4">4</option>';
$selectBox .= '<option value="5" selected="selected">5</option>';
$selectBox .= '<option value="6">6</option>';
$selectBox .= '<option value="10">10</option>';
$selectBox .= '</select>';
$this->assertEqual($selectBox, $this->pager->getPerPageSelectBox(3, 6, 1, true));
}
function testSelectBoxWithShowAllAndText() {
$this->pager->_showAllText = 'Show All';
$selectBox = '<select name="'.$this->pager->_sessionVar.'">';
$selectBox .= '<option value="3">3 bugs</option>';
$selectBox .= '<option value="4">4 bugs</option>';
$selectBox .= '<option value="5" selected="selected">5 bugs</option>';
$selectBox .= '<option value="6">6 bugs</option>';
$selectBox .= '<option value="10">Show All</option>';
$selectBox .= '</select>';
$this->assertEqual($selectBox, $this->pager->getPerPageSelectBox(3, 6, 1, true, '%d bugs'));
}
function testSelectBoxWithShowAllWithExtraAttribs() {
$this->pager->_showAllText = 'Show All';
$selectBox = '<select name="'.$this->pager->_sessionVar.'" onmouseover="doSth">';
$selectBox .= '<option value="3">3 bugs</option>';
$selectBox .= '<option value="4">4 bugs</option>';
$selectBox .= '<option value="5" selected="selected">5 bugs</option>';
$selectBox .= '<option value="6">6 bugs</option>';
$selectBox .= '<option value="10">Show All</option>';
$selectBox .= '</select>';
$params = array('optionText' => '%d bugs', 'attributes' => 'onmouseover="doSth"');
$this->assertEqual($selectBox, $this->pager->getPerPageSelectBox(3, 6, 1, true, $params));
}
function testSelectBoxInvalid() {
$err = $this->pager->getPerPageSelectBox(5, 15, 5, false, '%s bugs');
$this->assertEqual(ERROR_PAGER_INVALID_PLACEHOLDER, $err->getCode());
}
function testAppendInvalid() {
$options = array(
'totalItems' => 10,
'append' => false,
'fileName' => 'invalidFileName'
);
$err =& Pager::factory($options); //ERROR_PAGER_INVALID_USAGE
$this->assertError();
}
function testAppendValid() {
$options = array(
'totalItems' => 10,
'append' => false,
'fileName' => 'valid_%d_FileName'
);
$err =& Pager::factory($options);
$this->assertNoErrors();
}
function testEscapeEntities() {
//encode special chars
$options = array(
'extraVars' => array(
'request' => array('aRequest'),
'escape' => 'äö%<>+',
),
'perPage' => 5,
);
$this->pager =& Pager::factory($options);
//$expected = '?request[]=aRequest&amp;escape=&auml;&ouml;%&lt;&gt;+&amp;pageID=';
//$this->assertEqual($expected, $this->pager->_getLinksUrl());
 
$expected = 'request%5B0%5D=aRequest&amp;escape=%E4%F6%25%3C%3E%2B';
$rendered = $this->pager->_renderLink('', '');
preg_match('/href="(.*)"/U', $rendered, $matches);
$actual = str_replace($_SERVER['PHP_SELF'].'?', '', $matches[1]);
$this->assertEqual($expected, $actual);
 
//don't encode slashes
$options = array(
'extraVars' => array(
'request' => 'cat/subcat',
),
'perPage' => 5,
);
$this->pager =& Pager::factory($options);
//$expected = '?request=cat/subcat&amp;pageID=';
//$this->assertEqual($expected, $this->pager->_getLinksUrl());
$expected = '<a href="'.$_SERVER['PHP_SELF'].'?request=cat/subcat" title=""></a>';
$actual = $this->pager->_renderLink('', '');
$this->assertEqual($expected, $actual);
}
function testMultibyteStrings() {
$options = array(
'extraVars' => array(
'test' => '&#27979;&#35797;',
),
'perPage' => 5,
);
$this->pager =& Pager::factory($options);
//$expected = '<a href="'.$_SERVER['PHP_SELF'].'?test=&#27979;&#35797;" title=""></a>';
$rendered = $this->pager->_renderLink('', '');
preg_match('/href="(.*)"/U', $rendered, $matches);
$actual = str_replace($_SERVER['PHP_SELF'].'?test=', '', $matches[1]);
$this->assertEqual(urlencode($options['extraVars']['test']), $actual);
}
function testCurrentPage() {
$options = array(
'itemData' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
'perPage' => 2,
'currentPage' => 2,
);
$this->pager =& Pager::factory($options);
$this->assertEqual(3, $this->pager->getNextPageID());
$this->assertEqual(1, $this->pager->getPreviousPageID());
$this->assertEqual(2, $this->pager->_currentPage);
}
function testArrayExtraVars() {
$arr = array(
'apple',
'orange',
);
$options = array(
'itemData' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
'perPage' => 5,
'extraVars' => array('arr' => $arr, 'no' => 'test'),
);
$this->pager =& Pager::factory($options);
/*
//old
$expected = '?arr[0]=apple&amp;arr[1]=orange&amp;pageID=';
$this->assertEqual($expected, $this->pager->_getLinksUrl());
*/
$expected = $options['extraVars'];
$this->assertEqual($expected, $this->pager->_getLinksData());
 
$expected = '<a href="'.$_SERVER['PHP_SELF'].'?arr%5B0%5D=apple&amp;arr%5B1%5D=orange&amp;no=test&amp;pageID=2" title=""></a>';
$actual = $this->pager->_renderLink('', '');
$this->assertEqual($expected, $actual);
}
function testExcludeVars() {
$arr = array(
'apple',
'orange',
);
$options = array(
'itemData' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
'perPage' => 5,
'extraVars' => array('arr' => $arr, 'no' => 'test'),
'excludeVars' => array('no'),
);
$this->pager =& Pager::factory($options);
$expected = array(
'arr' => array(
0 => 'apple',
1 => 'orange'
),
);
$actual = $this->pager->_getLinksData();
$this->assertEqual($expected, $this->pager->_getLinksData());
 
$expected = '<a href="'.$_SERVER['PHP_SELF'].'?arr%5B0%5D=apple&amp;arr%5B1%5D=orange&amp;pageID=2" title=""></a>';
$actual = $this->pager->_renderLink('', '');
$this->assertEqual($expected, $actual);
}
function testArgSeparator() {
$bkp_arg_separator = ini_get('arg_separator.output');
ini_set('arg_separator.output', '&amp;');
 
$options = array(
'itemData' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
'perPage' => 5,
'extraVars' => array('apple' => 1),
);
$this->pager =& Pager::factory($options);
 
$expected = '<a href="'.$_SERVER['PHP_SELF'].'?apple=1&amp;pageID=2" title=""></a>';
$actual = $this->pager->_renderLink('', '');
$this->assertEqual($expected, $actual);
 
ini_set('arg_separator.output', $bkp_arg_separator);
}
function testAttributes() {
$options = array(
'itemData' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
'perPage' => 5,
'linkClass' => 'testclass',
'attributes' => 'target="_blank"',
);
$this->pager =& Pager::factory($options);
 
$expected = '<a href="'.$_SERVER['PHP_SELF'].'?pageID=2" class="testclass" target="_blank" title=""></a>';
$actual = $this->pager->_renderLink('', '');
$this->assertEqual($expected, $actual);
}
function testImportQuery() {
//add some fake url vars
$_GET['arr'] = array(
'apple',
'orange',
);
$options = array(
'itemData' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
'perPage' => 5,
'importQuery' => false,
);
$this->pager =& Pager::factory($options);
$expected = array();
$actual = $this->pager->_getLinksData();
$this->assertEqual($expected, $this->pager->_getLinksData());
 
$expected = '<a href="'.$_SERVER['PHP_SELF'].'?pageID=2" title=""></a>';
$actual = $this->pager->_renderLink('', '');
$this->assertEqual($expected, $actual);
//remove fake url vars
unset($_GET['arr']);
}
function testGetNextLinkTag() {
//append = true
$expected = '<link rel="next" href="'.$_SERVER['PHP_SELF'].'?pageID=2" title="next page" />'."\n";
$this->assertEqual($expected, $this->pager->_getNextLinkTag());
//append = false
$options = array(
'itemData' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
'perPage' => 5,
'currentPage' => 1,
'append' => false,
'fileName' => 'myfile.%d.php',
);
$this->pager = Pager::factory($options);
$expected = '<link rel="next" href="'.$this->baseurl.'/myfile.2.php" title="next page" />'."\n";
$this->assertEqual($expected, $this->pager->_getNextLinkTag());
//test empty tag
$options['currentPage'] = 2;
$this->pager = Pager::factory($options);
$this->assertEqual('', $this->pager->_getNextLinkTag());
}
function testGetLastLinkTag() {
//append = true
$expected = '<link rel="last" href="'.$_SERVER['PHP_SELF'].'?pageID=2" title="last page" />'."\n";
$this->assertEqual($expected, $this->pager->_getLastLinkTag());
 
//append = false
$options = array(
'itemData' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
'perPage' => 5,
'currentPage' => 1,
'append' => false,
'fileName' => 'myfile.%d.php',
);
$this->pager = Pager::factory($options);
$expected = '<link rel="last" href="'.$this->baseurl.'/myfile.2.php" title="last page" />'."\n";
$this->assertEqual($expected, $this->pager->_getLastLinkTag());
 
//test empty tag
$options['currentPage'] = 2;
$this->pager = Pager::factory($options);
$this->assertEqual('', $this->pager->_getLastLinkTag());
}
function testGetFirstLinkTag() {
//append = true
$options = array(
'itemData' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
'perPage' => 5,
'currentPage' => 2,
);
$this->pager = Pager::factory($options);
$expected = '<link rel="first" href="'.$_SERVER['PHP_SELF'].'?pageID=1" title="first page" />'."\n";
$this->assertEqual($expected, $this->pager->_getFirstLinkTag());
 
//append = false
$options = array(
'itemData' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
'perPage' => 5,
'currentPage' => 2,
'append' => false,
'fileName' => 'myfile.%d.php',
);
$this->pager = Pager::factory($options);
$expected = '<link rel="first" href="'.$this->baseurl.'/myfile.1.php" title="first page" />'."\n";
$this->assertEqual($expected, $this->pager->_getFirstLinkTag());
 
//test empty tag
$options['currentPage'] = 1;
$this->pager = Pager::factory($options);
$this->assertEqual('', $this->pager->_getFirstLinkTag());
}
function testGetPrevLinkTag() {
//append = true
$options = array(
'itemData' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
'perPage' => 5,
'currentPage' => 2,
);
$this->pager = Pager::factory($options);
$expected = '<link rel="previous" href="'.$_SERVER['PHP_SELF'].'?pageID=1" title="previous page" />'."\n";
$this->assertEqual($expected, $this->pager->_getPrevLinkTag());
 
//append = false
$options = array(
'itemData' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
'perPage' => 5,
'currentPage' => 2,
'append' => false,
'fileName' => 'myfile.%d.php',
);
$this->pager = Pager::factory($options);
$expected = '<link rel="previous" href="'.$this->baseurl.'/myfile.1.php" title="previous page" />'."\n";
$this->assertEqual($expected, $this->pager->_getPrevLinkTag());
 
//test empty tag
$options['currentPage'] = 1;
$this->pager = Pager::factory($options);
$this->assertEqual('', $this->pager->_getPrevLinkTag());
}
function testPrintFirstPage() {
$options = array(
'itemData' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
'perPage' => 5,
'currentPage' => 2,
);
$this->pager = Pager::factory($options);
$expected = '<a href="' . $_SERVER['PHP_SELF'] . '?pageID=1" title="first page">[1]</a>&nbsp;';
$this->assertEqual($expected, $this->pager->_printFirstPage());
 
$this->pager->_firstPageText = 'FIRST';
$expected = '<a href="' . $_SERVER['PHP_SELF'] . '?pageID=1" title="first page">[FIRST]</a>&nbsp;';
$this->assertEqual($expected, $this->pager->_printFirstPage());
 
$options = array(
'itemData' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
'perPage' => 5,
'currentPage' => 2,
'altFirst' => 'page %d',
);
$this->pager = Pager::factory($options);
$expected = '<a href="' . $_SERVER['PHP_SELF'] . '?pageID=1" title="page 1">[1]</a>&nbsp;';
$this->assertEqual($expected, $this->pager->_printFirstPage());
}
function testPrintLastPage() {
$expected = '<a href="' . $_SERVER['PHP_SELF'] . '?pageID=2" title="last page">[2]</a>';
$this->assertEqual($expected, $this->pager->_printLastPage());
 
$this->pager->_lastPageText = 'LAST';
$expected = '<a href="' . $_SERVER['PHP_SELF'] . '?pageID=2" title="last page">[LAST]</a>';
$this->assertEqual($expected, $this->pager->_printLastPage());
 
$this->pager->_altLast = 'page %d';
$expected = '<a href="' . $_SERVER['PHP_SELF'] . '?pageID=2" title="page 2">[LAST]</a>';
$this->assertEqual($expected, $this->pager->_printLastPage());
}
function testGetBackLink() {
$img = '&laquo;';
$options = array(
'itemData' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
'perPage' => 5,
'currentPage' => 2,
'prevImg' => $img,
);
$this->pager = Pager::factory($options);
$expected = '<a href="' . $_SERVER['PHP_SELF'] . '?pageID=1" title="previous page">'.$img.'</a>&nbsp;';
$this->assertEqual($expected, $this->pager->_getBackLink());
}
function testGetNexLink() {
$img = '&raquo;';
$options = array(
'itemData' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
'perPage' => 5,
'currentPage' => 1,
'nextImg' => $img,
);
$this->pager = Pager::factory($options);
$expected = '&nbsp;<a href="' . $_SERVER['PHP_SELF'] . '?pageID=2" title="next page">'.$img.'</a>&nbsp;';
$this->assertEqual($expected, $this->pager->_getNextLink());
}
function testHttpMethodAutoDetect() {
$_POST['pageID'] = 3;
$options = array(
'itemData' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
'perPage' => 5,
);
$this->pager = Pager::factory($options);
$this->assertEqual('POST', $this->pager->_httpMethod);
 
$options = array(
'itemData' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
'perPage' => 5,
'httpMethod' => 'GET',
);
$this->pager = Pager::factory($options);
$this->assertEqual('GET', $this->pager->_httpMethod);
 
unset($_POST['pageID']);
 
$options = array(
'itemData' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
'perPage' => 5,
'httpMethod' => 'POST',
);
$this->pager = Pager::factory($options);
$this->assertEqual('POST', $this->pager->_httpMethod);
 
$options = array(
'itemData' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
'perPage' => 5,
);
$this->pager = Pager::factory($options);
$this->assertEqual('GET', $this->pager->_httpMethod);
}
function testAccesskey() {
$options = array(
'itemData' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
'perPage' => 5,
'accesskey' => true,
);
$this->pager = Pager::factory($options);
$this->assertWantedPattern('/accesskey="\d"/i', $this->pager->links);
//var_dump($this->pager->links);
}
function testIsEncoded() {
//var_dump(urlencode('&#50504;&#45397;'));
$test_strings_encoded = array(
'encoded0' => '&#35797;',
'encoded1' => '&#27979;&#35797;',
'encoded2' => '&#50504;&#45397;',
'encoded3' => '&#50504; &#45397;',
'encoded4' => '&#50504;
&#45397;',
);
$test_strings_plain = array(
'plain1' => '안녕',
'plain2' => '더보기',
// 'plain3' => '이젠 전화도
//로 걸면 무료',
'plain4' => 'abcde', //not multibyte
'plain5' => '&#abcfg;', //invalid hex-encoded char
'plain5' => '&#50504; nasty &#45397;', //mixed plain/encoded text
);
foreach ($test_strings_encoded as $string) {
//echo '<hr />'.str_replace('&', '&amp;', $string);
$this->assertTrue($this->pager->_isEncoded($string));
}
foreach ($test_strings_plain as $string) {
$this->assertFalse($this->pager->_isEncoded($string));
}
}
function testGetOption() {
$this->assertEqual(5, $this->pager->getOption('perPage'));
$err = $this->pager->getOption('non_existent_option');
$this->assertEqual(ERROR_PAGER_INVALID, $err->getCode());
}
function testGetOptions() {
$options = $this->pager->getOptions();
$this->assertTrue(is_array($options));
$this->assertEqual(5, $options['perPage']);
}
function testSetOptionsAndBuild() {
$options = array(
'perPage' => 2,
);
$this->pager->setOptions($options);
$this->pager->build();
$this->assertEqual(2, $this->pager->getOption('perPage'));
$this->assertEqual(array(0=>1, 1=>2), $this->pager->getPageData());
$this->assertEqual(array(2=>3, 3=>4), $this->pager->getPageData(2));
 
$options = array(
'currentPage' => 2,
'append' => false,
'fileName' => 'myfile.%d.php',
);
$this->pager->setOptions($options);
$this->pager->build();
$expected = '<link rel="previous" href="'.$this->baseurl.'/myfile.1.php" title="previous page" />'."\n";
$this->assertEqual($expected, $this->pager->_getPrevLinkTag());
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Pager/tests/pager_sliding_notExpanded_test.php
New file
0,0 → 1,49
<?php
// $Id$
 
require_once 'simple_include.php';
require_once 'pager_include.php';
 
class TestOfPagerSlidingNotExpanded extends UnitTestCase {
var $pager;
function TestOfPagerSlidingNotExpanded($name='Test of Pager_Sliding - expanded=false') {
$this->UnitTestCase($name);
}
function setUp() {
$options = array(
'itemData' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21),
'perPage' => 2,
'mode' => 'Sliding',
'expanded' => false
);
$this->pager = new Pager($options);
}
function tearDown() {
unset($this->pager);
}
function testPageRangeByPageId1() {
$this->assertEqual(array(1, 3), $this->pager->getPageRangeByPageId(1));
}
function testPageRangeByPageId2() {
$this->assertEqual(array(1, 4), $this->pager->getPageRangeByPageId(2));
}
function testPageRangeByPageId3() {
$this->assertEqual(array(1, 5), $this->pager->getPageRangeByPageId(3));
}
function testPageRangeByPageId4() {
$this->assertEqual(array(2, 6), $this->pager->getPageRangeByPageId(4));
}
function testPageRangeByPageId9() {
$this->assertEqual(array(7, 11), $this->pager->getPageRangeByPageId(9));
}
function testPageRangeByPageId10() {
$this->assertEqual(array(8, 11), $this->pager->getPageRangeByPageId(10));
}
function testPageRangeByPageId11() {
$this->assertEqual(array(9, 11), $this->pager->getPageRangeByPageId(11));
}
function testPageRangeByPageId_outOfRange() {
$this->assertEqual(array(0, 0), $this->pager->getPageRangeByPageId(20));
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Pager/Pager.php
New file
0,0 → 1,193
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 
/**
* Contains the Pager class
*
* PHP versions 4 and 5
*
* LICENSE: Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* @category HTML
* @package Pager
* @author Lorenzo Alberton <l dot alberton at quipo dot it>
* @author Richard Heyes <richard@phpguru.org>
* @copyright 2003-2006 Lorenzo Alberton, Richard Heyes
* @license http://www.debian.org/misc/bsd.license BSD License (3 Clause)
* @version CVS: $Id$
* @link http://pear.php.net/package/Pager
*/
 
/**
* Pager - Wrapper class for [Sliding|Jumping]-window Pager
* Usage examples can be found in the PEAR manual
*
* @category HTML
* @package Pager
* @author Lorenzo Alberton <l dot alberton at quipo dot it>
* @author Richard Heyes <richard@phpguru.org>,
* @copyright 2003-2005 Lorenzo Alberton, Richard Heyes
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @link http://pear.php.net/package/Pager
*/
class Pager
{
// {{{ Pager()
 
/**
* Constructor
*
* -------------------------------------------------------------------------
* VALID options are (default values are set some lines before):
* - mode (string): "Jumping" or "Sliding" -window - It determines
* pager behaviour. See the manual for more details
* - totalItems (int): # of items to page.
* - perPage (int): # of items per page.
* - delta (int): # of page #s to show before and after the current
* one
* - linkClass (string): name of CSS class used for link styling.
* - append (bool): if true pageID is appended as GET value to the
* URL - if false it is embedded in the URL
* according to "fileName" specs
* - httpMethod (string): Specifies the HTTP method to use. Valid values
* are 'GET' or 'POST'
* according to "fileName" specs
* - importQuery (bool): if true (default behaviour), variables and
* values are imported from the submitted data
* (query string) and used in the generated links
* otherwise they're ignored completely
* - path (string): complete path to the page (without the page name)
* - fileName (string): name of the page, with a %d if append=true
* - urlVar (string): name of pageNumber URL var, for example "pageID"
* - altPrev (string): alt text to display for prev page, on prev link.
* - altNext (string): alt text to display for next page, on next link.
* - altPage (string): alt text to display before the page number.
* - prevImg (string): sth (it can be text such as "<< PREV" or an
* <img/> as well...) to display instead of "<<".
* - nextImg (string): same as prevImg, used for NEXT link, instead of
* the default value, which is ">>".
* - separator (string): what to use to separate numbers (can be an
* <img/>, a comma, an hyphen, or whatever.
* - spacesBeforeSeparator
* (int): number of spaces before the separator.
* - firstPagePre (string):
* string used before first page number (can be an
* <img/>, a "{", an empty string, or whatever.
* - firstPageText (string):
* string used in place of first page number
* - firstPagePost (string):
* string used after first page number (can be an
* <img/>, a "}", an empty string, or whatever.
* - lastPagePre (string):
* similar to firstPagePre.
* - lastPageText (string):
* similar to firstPageText.
* - lastPagePost (string):
* similar to firstPagePost.
* - spacesAfterSeparator
* (int): number of spaces after the separator.
* - firstLinkTitle (string):
* string used as title in <link rel="first"> tag
* - lastLinkTitle (string):
* string used as title in <link rel="last"> tag
* - prevLinkTitle (string):
* string used as title in <link rel="prev"> tag
* - nextLinkTitle (string):
* string used as title in <link rel="next"> tag
* - curPageLinkClassName
* (string): name of CSS class used for current page link.
* - clearIfVoid(bool): if there's only one page, don't display pager.
* - extraVars (array): additional URL vars to be added to the querystring
* - excludeVars (array): URL vars to be excluded in the querystring
* - itemData (array): array of items to page.
* - useSessions (bool): if true, number of items to display per page is
* stored in the $_SESSION[$_sessionVar] var.
* - closeSession (bool): if true, the session is closed just after R/W.
* - sessionVar (string): name of the session var for perPage value.
* A value != from default can be useful when
* using more than one Pager istance in the page.
* - pearErrorMode (constant):
* PEAR_ERROR mode for raiseError().
* Default is PEAR_ERROR_RETURN.
* -------------------------------------------------------------------------
* REQUIRED options are:
* - fileName IF append==false (default is true)
* - itemData OR totalItems (if itemData is set, totalItems is overwritten)
* -------------------------------------------------------------------------
*
* @param mixed $options An associative array of option names and
* their values.
* @access public
*/
function Pager($options = array())
{
//this check evaluates to true on 5.0.0RC-dev,
//so i'm using another one, for now...
//if (version_compare(phpversion(), '5.0.0') == -1) {
if (get_class($this) == 'pager') { //php4 lowers class names
// assign factoried method to this for PHP 4
eval('$this = Pager::factory($options);');
} else { //php5 is case sensitive
$msg = 'Pager constructor is deprecated.'
.' You must use the "Pager::factory($params)" method'
.' instead of "new Pager($params)"';
trigger_error($msg, E_USER_ERROR);
}
}
 
// }}}
// {{{ factory()
 
/**
* Return a pager based on $mode and $options
*
* @param array $options Optional parameters for the storage class
* @return object Object Storage object
* @static
* @access public
*/
function &factory($options = array())
{
$mode = (isset($options['mode']) ? ucfirst($options['mode']) : 'Jumping');
$classname = 'Pager_' . $mode;
$classfile = 'Pager' . DIRECTORY_SEPARATOR . $mode . '.php';
 
// Attempt to include a custom version of the named class, but don't treat
// a failure as fatal. The caller may have already included their own
// version of the named class.
if (!class_exists($classname)) {
include_once $classfile;
}
 
// If the class exists, return a new instance of it.
if (class_exists($classname)) {
$pager =& new $classname($options);
return $pager;
}
 
$null = null;
return $null;
}
 
// }}}
}
?>
/tags/Racine_livraison_narmer/api/pear/XML/Parser/Simple.php
New file
0,0 → 1,297
<?php
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2004 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 3.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Stephan Schmidt <schst@php-tools.net> |
// +----------------------------------------------------------------------+
//
// $Id: Simple.php,v 1.1 2005-04-18 16:13:31 jpm Exp $
 
/**
* Simple XML parser class.
*
* This class is a simplified version of XML_Parser.
* In most XML applications the real action is executed,
* when a closing tag is found.
*
* XML_Parser_Simple allows you to just implement one callback
* for each tag that will receive the tag with its attributes
* and CData
*
* @category XML
* @package XML_Parser
* @author Stephan Schmidt <schst@php-tools.net>
*/
 
/**
* built on XML_Parser
*/
require_once 'XML/Parser.php';
 
/**
* Simple XML parser class.
*
* This class is a simplified version of XML_Parser.
* In most XML applications the real action is executed,
* when a closing tag is found.
*
* XML_Parser_Simple allows you to just implement one callback
* for each tag that will receive the tag with its attributes
* and CData.
*
* <code>
* require_once '../Parser/Simple.php';
*
* class myParser extends XML_Parser_Simple
* {
* function myParser()
* {
* $this->XML_Parser_Simple();
* }
*
* function handleElement($name, $attribs, $data)
* {
* printf('handle %s<br>', $name);
* }
* }
*
* $p = &new myParser();
*
* $result = $p->setInputFile('myDoc.xml');
* $result = $p->parse();
* </code>
*
* @category XML
* @package XML_Parser
* @author Stephan Schmidt <schst@php-tools.net>
*/
class XML_Parser_Simple extends XML_Parser
{
/**
* element stack
*
* @access private
* @var array
*/
var $_elStack = array();
 
/**
* all character data
*
* @access private
* @var array
*/
var $_data = array();
 
/**
* element depth
*
* @access private
* @var integer
*/
var $_depth = 0;
 
/**
* Mapping from expat handler function to class method.
*
* @var array
*/
var $handler = array(
'default_handler' => 'defaultHandler',
'processing_instruction_handler' => 'piHandler',
'unparsed_entity_decl_handler' => 'unparsedHandler',
'notation_decl_handler' => 'notationHandler',
'external_entity_ref_handler' => 'entityrefHandler'
);
/**
* Creates an XML parser.
*
* This is needed for PHP4 compatibility, it will
* call the constructor, when a new instance is created.
*
* @param string $srcenc source charset encoding, use NULL (default) to use
* whatever the document specifies
* @param string $mode how this parser object should work, "event" for
* handleElement(), "func" to have it call functions
* named after elements (handleElement_$name())
* @param string $tgenc a valid target encoding
*/
function XML_Parser_Simple($srcenc = null, $mode = 'event', $tgtenc = null)
{
$this->XML_Parser($srcenc, $mode, $tgtenc);
}
 
/**
* inits the handlers
*
* @access private
*/
function _initHandlers()
{
if (!is_object($this->_handlerObj)) {
$this->_handlerObj = &$this;
}
 
if ($this->mode != 'func' && $this->mode != 'event') {
return $this->raiseError('Unsupported mode given', XML_PARSER_ERROR_UNSUPPORTED_MODE);
}
xml_set_object($this->parser, $this->_handlerObj);
 
xml_set_element_handler($this->parser, array(&$this, 'startHandler'), array(&$this, 'endHandler'));
xml_set_character_data_handler($this->parser, array(&$this, 'cdataHandler'));
/**
* set additional handlers for character data, entities, etc.
*/
foreach ($this->handler as $xml_func => $method) {
if (method_exists($this->_handlerObj, $method)) {
$xml_func = 'xml_set_' . $xml_func;
$xml_func($this->parser, $method);
}
}
}
 
/**
* Reset the parser.
*
* This allows you to use one parser instance
* to parse multiple XML documents.
*
* @access public
* @return boolean|object true on success, PEAR_Error otherwise
*/
function reset()
{
$this->_elStack = array();
$this->_data = array();
$this->_depth = 0;
$result = $this->_create();
if ($this->isError( $result )) {
return $result;
}
return true;
}
 
/**
* start handler
*
* Pushes attributes and tagname onto a stack
*
* @access private
* @final
* @param resource xml parser resource
* @param string element name
* @param array attributes
*/
function startHandler($xp, $elem, &$attribs)
{
array_push($this->_elStack, array(
'name' => $elem,
'attribs' => $attribs
)
);
$this->_depth++;
$this->_data[$this->_depth] = '';
}
 
/**
* end handler
*
* Pulls attributes and tagname from a stack
*
* @access private
* @final
* @param resource xml parser resource
* @param string element name
*/
function endHandler($xp, $elem)
{
$el = array_pop($this->_elStack);
$data = $this->_data[$this->_depth];
$this->_depth--;
 
switch ($this->mode) {
case 'event':
$this->_handlerObj->handleElement($el['name'], $el['attribs'], $data);
break;
case 'func':
$func = 'handleElement_' . $elem;
if (strchr($func, '.')) {
$func = str_replace('.', '_', $func);
}
if (method_exists($this->_handlerObj, $func)) {
call_user_func(array(&$this->_handlerObj, $func), $el['name'], $el['attribs'], $data);
}
break;
}
}
 
/**
* handle character data
*
* @access private
* @final
* @param resource xml parser resource
* @param string data
*/
function cdataHandler($xp, $data)
{
$this->_data[$this->_depth] .= $data;
}
 
/**
* handle a tag
*
* Implement this in your parser
*
* @access public
* @abstract
* @param string element name
* @param array attributes
* @param string character data
*/
function handleElement($name, $attribs, $data)
{
}
 
/**
* get the current tag depth
*
* The root tag is in depth 0.
*
* @access public
* @return integer
*/
function getCurrentDepth()
{
return $this->_depth;
}
 
/**
* add some string to the current ddata.
*
* This is commonly needed, when a document is parsed recursively.
*
* @access public
* @param string data to add
* @return void
*/
function addToData( $data )
{
$this->_data[$this->_depth] .= $data;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/XML/RSS.php
New file
0,0 → 1,359
<?php
// vim: set expandtab tabstop=4 shiftwidth=4 fdm=marker:
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Martin Jansen <mj@php.net> |
// | |
// +----------------------------------------------------------------------+
//
// $Id: RSS.php,v 1.1 2005-04-18 16:13:31 jpm Exp $
//
 
require_once 'XML/Parser.php';
 
/**
* RSS parser class.
*
* This class is a parser for Resource Description Framework (RDF) Site
* Summary (RSS) documents. For more information on RSS see the
* website of the RSS working group (http://www.purl.org/rss/).
*
* @author Martin Jansen <mj@php.net>
* @version $Revision: 1.1 $
* @access public
*/
class XML_RSS extends XML_Parser
{
// {{{ properties
 
/**
* @var string
*/
var $insideTag = '';
 
/**
* @var string
*/
var $activeTag = '';
 
/**
* @var array
*/
var $channel = array();
 
/**
* @var array
*/
var $items = array();
 
/**
* @var array
*/
var $item = array();
 
/**
* @var array
*/
var $image = array();
 
/**
* @var array
*/
var $textinput = array();
/**
* @var array
*/
var $textinputs = array();
 
/**
* @var array
*/
var $parentTags = array('CHANNEL', 'ITEM', 'IMAGE', 'TEXTINPUT');
 
/**
* @var array
*/
var $channelTags = array('TITLE', 'LINK', 'DESCRIPTION', 'IMAGE',
'ITEMS', 'TEXTINPUT');
 
/**
* @var array
*/
var $itemTags = array('TITLE', 'LINK', 'DESCRIPTION', 'PUBDATE');
 
/**
* @var array
*/
var $imageTags = array('TITLE', 'URL', 'LINK');
 
var $textinputTags = array('TITLE', 'DESCRIPTION', 'NAME', 'LINK');
 
/**
* List of allowed module tags
*
* Currently Dublin Core Metadata and the blogChannel RSS module
* are supported.
*
* @var array
*/
var $moduleTags = array('DC:TITLE', 'DC:CREATOR', 'DC:SUBJECT', 'DC:DESCRIPTION',
'DC:PUBLISHER', 'DC:CONTRIBUTOR', 'DC:DATE', 'DC:TYPE',
'DC:FORMAT', 'DC:IDENTIFIER', 'DC:SOURCE', 'DC:LANGUAGE',
'DC:RELATION', 'DC:COVERAGE', 'DC:RIGHTS',
'BLOGCHANNEL:BLOGROLL', 'BLOGCHANNEL:MYSUBSCRIPTIONS',
'BLOGCHANNEL:MYSUBSCRIPTIONS', 'BLOGCHANNEL:CHANGES');
 
// }}}
// {{{ Constructor
 
/**
* Constructor
*
* @access public
* @param mixed File pointer or name of the RDF file.
* @return void
*/
function XML_RSS($handle = '')
{
$this->XML_Parser();
 
if (@is_resource($handle)) {
$this->setInput($handle);
} elseif ($handle != '') {
$this->setInputFile($handle);
} else {
$this->raiseError('No filename passed.');
}
}
 
// }}}
// {{{ startHandler()
 
/**
* Start element handler for XML parser
*
* @access private
* @param object XML parser object
* @param string XML element
* @param array Attributes of XML tag
* @return void
*/
function startHandler($parser, $element, $attribs)
{
switch ($element) {
case 'CHANNEL':
case 'ITEM':
case 'IMAGE':
case 'TEXTINPUT':
$this->insideTag = $element;
break;
 
default:
$this->activeTag = $element;
}
}
 
// }}}
// {{{ endHandler()
 
/**
* End element handler for XML parser
*
* If the end of <item>, <channel>, <image> or <textinput>
* is reached, this function updates the structure array
* $this->struct[] and adds the field "type" to this array,
* that defines the type of the current field.
*
* @access private
* @param object XML parser object
* @param string
* @return void
*/
function endHandler($parser, $element)
{
if ($element == $this->insideTag) {
$this->insideTag = '';
$this->struct[] = array_merge(array('type' => strtolower($element)),
$this->last);
}
 
if ($element == 'ITEM') {
$this->items[] = $this->item;
$this->item = '';
}
 
if ($element == 'IMAGE') {
$this->images[] = $this->image;
$this->image = '';
}
 
if ($element == 'TEXTINPUT') {
$this->textinputs = $this->textinput;
$this->textinput = '';
}
 
$this->activeTag = '';
}
 
// }}}
// {{{ cdataHandler()
 
/**
* Handler for character data
*
* @access private
* @param object XML parser object
* @param string CDATA
* @return void
*/
function cdataHandler($parser, $cdata)
{
if (in_array($this->insideTag, $this->parentTags)) {
$tagName = strtolower($this->insideTag);
$var = $this->{$tagName . 'Tags'};
 
if (in_array($this->activeTag, $var) ||
in_array($this->activeTag, $this->moduleTags)) {
$this->_add($tagName, strtolower($this->activeTag),
$cdata);
}
}
}
 
// }}}
// {{{ defaultHandler()
 
/**
* Default handler for XML parser
*
* @access private
* @param object XML parser object
* @param string CDATA
* @return void
*/
function defaultHandler($parser, $cdata)
{
return;
}
 
// }}}
// {{{ _add()
 
/**
* Add element to internal result sets
*
* @access private
* @param string Name of the result set
* @param string Fieldname
* @param string Value
* @return void
* @see cdataHandler
*/
function _add($type, $field, $value)
{
if (empty($this->{$type}) || empty($this->{$type}[$field])) {
$this->{$type}[$field] = $value;
} else {
$this->{$type}[$field] .= $value;
}
 
$this->last = $this->{$type};
}
 
// }}}
// {{{ getStructure()
 
/**
* Get complete structure of RSS file
*
* @access public
* @return array
*/
function getStructure()
{
return (array)$this->struct;
}
 
// }}}
// {{{ getchannelInfo()
 
/**
* Get general information about current channel
*
* This function returns an array containing the information
* that has been extracted from the <channel>-tag while parsing
* the RSS file.
*
* @access public
* @return array
*/
function getChannelInfo()
{
return (array)$this->channel;
}
 
// }}}
// {{{ getItems()
 
/**
* Get items from RSS file
*
* This function returns an array containing the set of items
* that are provided by the RSS file.
*
* @access public
* @return array
*/
function getItems()
{
return (array)$this->items;
}
 
// }}}
// {{{ getImages()
 
/**
* Get images from RSS file
*
* This function returns an array containing the set of images
* that are provided by the RSS file.
*
* @access public
* @return array
*/
function getImages()
{
return (array)$this->images;
}
 
// }}}
// {{{ getTextinputs()
 
/**
* Get text input fields from RSS file
*
* @access public
* @return array
*/
function getTextinputs()
{
return (array)$this->textinputs;
}
 
// }}}
 
}
?>
/tags/Racine_livraison_narmer/api/pear/XML/Tree/Node.php
New file
0,0 → 1,354
<?php
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Bernd Römer <berndr@bonn.edu> |
// | Sebastian Bergmann <sb@sebastian-bergmann.de> |
// | Christian Kühn <ck@chkuehn.de> (escape xml entities) |
// +----------------------------------------------------------------------+
//
// $Id: Node.php,v 1.1 2005-04-18 16:13:31 jpm Exp $
//
 
/**
* PEAR::XML_Tree_Node
*
* @author Bernd Römer <berndr@bonn.edu>
* @package XML_Tree
* @version 1.0 16-Aug-2001
*/
class XML_Tree_Node {
/**
* Attributes of this node
*
* @var array
*/
var $attributes;
 
/**
* Children of this node
*
* @var array
*/
var $children;
 
/**
* Content
*
* @var string
*/
var $content;
 
/**
* Name
*
* @var string
*/
var $name;
 
/**
* Constructor
*
* @param string name
* @param string content
* @param array attributes
*/
function XML_Tree_Node($name, $content = '', $attributes = array()) {
$this->attributes = $attributes;
$this->children = array();
$this->set_content($content);
$this->name = $name;
}
 
/**
* Adds a child node to this node.
*
* @param mixed child
* @param string content
* @param array attributes
* @return object reference to new child node
*/
function &addChild($child, $content = '', $attributes = array()) {
$index = sizeof($this->children);
 
if (is_object($child)) {
if (strtolower(get_class($child)) == 'xml_tree_node') {
$this->children[$index] = $child;
}
 
if (strtolower(get_class($child)) == 'xml_tree' && isset($child->root)) {
$this->children[$index] = $child->root->get_element();
}
} else {
$this->children[$index] = new XML_Tree_Node($child, $content, $attributes);
}
 
return $this->children[$index];
}
 
/**
* @deprecated
*/
function &add_child($child, $content = '', $attributes = array()) {
return $this->addChild($child, $content, $attributes);
}
 
/**
* clone node and all its children (recursive)
*
* @return object reference to the clone-node
*/
function &clone() {
$clone=new XML_Tree_Node($this->name,$this->content,$this->attributes);
 
$max_child=count($this->children);
for($i=0;$i<$max_child;$i++) {
$clone->children[]=$this->children[$i]->clone();
}
 
/* for future use....
// clone all other vars
$temp=get_object_vars($this);
foreach($temp as $varname => $value)
if (!in_array($varname,array('name','content','attributes','children')))
$clone->$varname=$value;
*/
 
return($clone);
}
 
/**
* inserts child ($child) to a specified child-position ($pos)
*
* @return inserted node
*/
function &insertChild($path,$pos,&$child, $content = '', $attributes = array()) {
// direct insert of objects useing array_splice() faild :(
array_splice($this->children,$pos,0,'dummy');
if (is_object($child)) { // child offered is not instanziated
// insert a single node
if (strtolower(get_class($child)) == 'xml_tree_node') {
$this->children[$pos]=&$child;
}
// insert a tree i.e insert root-element
if (strtolower(get_class($child)) == 'xml_tree' && isset($child->root)) {
$this->children[$pos]=$child->root->get_element();
}
} else { // child offered is not instanziated
$this->children[$pos]=new XML_Tree_Node($child, $content, $attributes);
}
return($this);
}
 
/**
* @deprecated
*/
function &insert_child($path,$pos,&$child, $content = '', $attributes = array()) {
return $this->insertChild($path,$pos,$child, $content, $attributes);
}
 
/**
* removes child ($pos)
*
* @param integer pos position of child in children-list
*
* @return removed node
*/
function &removeChild($pos) {
// array_splice() instead of a simple unset() to maintain index-integrity
return(array_splice($this->children,$pos,1));
}
 
/**
* @deprecated
*/
function &remove_child($pos) {
return $this->removeChild($pos);
}
 
/**
* Returns text representation of this node.
*
* @return string xml
*/
function &get()
{
static $deep = -1;
static $do_ident = true;
$deep++;
if ($this->name !== null) {
$ident = str_repeat(' ', $deep);
if ($do_ident) {
$out = $ident . '<' . $this->name;
} else {
$out = '<' . $this->name;
}
foreach ($this->attributes as $name => $value) {
$out .= ' ' . $name . '="' . $value . '"';
}
 
$out .= '>' . $this->content;
 
if (sizeof($this->children) > 0) {
$out .= "\n";
foreach ($this->children as $child) {
$out .= $child->get();
}
} else {
$ident = '';
}
if ($do_ident) {
$out .= $ident . '</' . $this->name . ">\n";
} else {
$out .= '</' . $this->name . '>';
}
$do_ident = true;
} else {
$out = $this->content;
$do_ident = false;
}
$deep--;
return $out;
}
 
/**
* Gets an attribute by its name.
*
* @param string name
* @return string attribute
*/
function getAttribute($name) {
return $this->attributes[strtolower($name)];
}
 
/**
* @deprecated
*/
function get_attribute($name) {
return $this->getAttribute($name);
}
 
/**
* Gets an element by its 'path'.
*
* @param string path
* @return object element
*/
function &getElement($path) {
if (sizeof($path) == 0) {
return $this;
}
 
$next = array_shift($path);
 
return $this->children[$next]->get_element($path);
}
 
/**
* @deprecated
*/
function &get_element($path) {
return $this->getElement($path);
}
 
/**
* Sets an attribute.
*
* @param string name
* @param string value
*/
function setAttribute($name, $value = '') {
$this->attributes[strtolower($name)] = $value;
}
 
/**
* @deprecated
*/
function set_attribute($name, $value = '') {
return $this->setAttribute($name, $value);
}
 
/**
* Unsets an attribute.
*
* @param string name
*/
function unsetAttribute($name) {
unset($this->attributes[strtolower($name)]);
}
 
/**
* @deprecated
*/
function unset_attribute($name) {
return $this->unsetAttribute($name);
}
 
/**
*
*
*/
function setContent(&$content)
{
$this->content = $this->_xml_entities($content);
}
 
function set_content(&$content)
{
return $this->setContent($content);
}
 
/**
* Escape XML entities.
*
* @param string xml
* @return string xml
* @access private
*/
function _xml_entities($xml) {
$xml = str_replace(array('ü', 'Ü', 'ö',
'Ö', 'ä', 'Ä',
'ß'
),
array('&#252;', '&#220;', '&#246;',
'&#214;', '&#228;', '&#196;',
'&#223;'
),
$xml
);
 
$xml = preg_replace(array("/\&([a-z\d\#]+)\;/i",
"/\&/",
"/\#\|\|([a-z\d\#]+)\|\|\#/i",
"/([^a-zA-Z\d\s\<\>\&\;\.\:\=\"\-\/\%\?\!\'\(\)\[\]\{\}\$\#\+\,\@_])/e"
),
array("#||\\1||#",
"&amp;",
"&\\1;",
"'&#'.ord('\\1').';'"
),
$xml
);
 
return $xml;
}
 
/**
* Print text representation of XML tree.
*/
function dump() {
echo $this->get();
}
}
?>
/tags/Racine_livraison_narmer/api/pear/XML/Parser.php
New file
0,0 → 1,684
<?php
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2004 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 3.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Stig Bakken <ssb@fast.no> |
// | Tomas V.V.Cox <cox@idecnet.com> |
// | Stephan Schmidt <schst@php-tools.net> |
// +----------------------------------------------------------------------+
//
// $Id: Parser.php,v 1.1 2005-04-18 16:13:31 jpm Exp $
 
/**
* XML Parser class.
*
* This is an XML parser based on PHP's "xml" extension,
* based on the bundled expat library.
*
* @category XML
* @package XML_Parser
* @author Stig Bakken <ssb@fast.no>
* @author Tomas V.V.Cox <cox@idecnet.com>
* @author Stephan Schmidt <schst@php-tools.net>
*/
 
/**
* uses PEAR's error handling
*/
require_once 'PEAR.php';
 
/**
* resource could not be created
*/
define('XML_PARSER_ERROR_NO_RESOURCE', 200);
 
/**
* unsupported mode
*/
define('XML_PARSER_ERROR_UNSUPPORTED_MODE', 201);
 
/**
* invalid encoding was given
*/
define('XML_PARSER_ERROR_INVALID_ENCODING', 202);
 
/**
* specified file could not be read
*/
define('XML_PARSER_ERROR_FILE_NOT_READABLE', 203);
 
/**
* invalid input
*/
define('XML_PARSER_ERROR_INVALID_INPUT', 204);
 
/**
* remote file cannot be retrieved in safe mode
*/
define('XML_PARSER_ERROR_REMOTE', 205);
 
/**
* XML Parser class.
*
* This is an XML parser based on PHP's "xml" extension,
* based on the bundled expat library.
*
* Notes:
* - It requires PHP 4.0.4pl1 or greater
* - From revision 1.17, the function names used by the 'func' mode
* are in the format "xmltag_$elem", for example: use "xmltag_name"
* to handle the <name></name> tags of your xml file.
*
* @category XML
* @package XML_Parser
* @author Stig Bakken <ssb@fast.no>
* @author Tomas V.V.Cox <cox@idecnet.com>
* @author Stephan Schmidt <schst@php-tools.net>
* @todo create XML_Parser_Namespace to parse documents with namespaces
* @todo create XML_Parser_Pull
* @todo Tests that need to be made:
* - mixing character encodings
* - a test using all expat handlers
* - options (folding, output charset)
* - different parsing modes
*/
class XML_Parser extends PEAR
{
// {{{ properties
 
/**
* XML parser handle
*
* @var resource
* @see xml_parser_create()
*/
var $parser;
 
/**
* File handle if parsing from a file
*
* @var resource
*/
var $fp;
 
/**
* Whether to do case folding
*
* If set to true, all tag and attribute names will
* be converted to UPPER CASE.
*
* @var boolean
*/
var $folding = true;
 
/**
* Mode of operation, one of "event" or "func"
*
* @var string
*/
var $mode;
 
/**
* Mapping from expat handler function to class method.
*
* @var array
*/
var $handler = array(
'character_data_handler' => 'cdataHandler',
'default_handler' => 'defaultHandler',
'processing_instruction_handler' => 'piHandler',
'unparsed_entity_decl_handler' => 'unparsedHandler',
'notation_decl_handler' => 'notationHandler',
'external_entity_ref_handler' => 'entityrefHandler'
);
 
/**
* source encoding
*
* @var string
*/
var $srcenc;
 
/**
* target encoding
*
* @var string
*/
var $tgtenc;
 
/**
* handler object
*
* @var object
*/
var $_handlerObj;
 
// }}}
// {{{ constructor
 
/**
* Creates an XML parser.
*
* This is needed for PHP4 compatibility, it will
* call the constructor, when a new instance is created.
*
* @param string $srcenc source charset encoding, use NULL (default) to use
* whatever the document specifies
* @param string $mode how this parser object should work, "event" for
* startelement/endelement-type events, "func"
* to have it call functions named after elements
* @param string $tgenc a valid target encoding
*/
function XML_Parser($srcenc = null, $mode = 'event', $tgtenc = null)
{
XML_Parser::__construct($srcenc, $mode, $tgtenc);
}
// }}}
 
/**
* PHP5 constructor
*
* @param string $srcenc source charset encoding, use NULL (default) to use
* whatever the document specifies
* @param string $mode how this parser object should work, "event" for
* startelement/endelement-type events, "func"
* to have it call functions named after elements
* @param string $tgenc a valid target encoding
*/
function __construct($srcenc = null, $mode = 'event', $tgtenc = null)
{
$this->PEAR('XML_Parser_Error');
 
$this->mode = $mode;
$this->srcenc = $srcenc;
$this->tgtenc = $tgtenc;
}
// }}}
 
/**
* Sets the mode of the parser.
*
* Possible modes are:
* - func
* - event
*
* You can set the mode using the second parameter
* in the constructor.
*
* This method is only needed, when switching to a new
* mode at a later point.
*
* @access public
* @param string mode, either 'func' or 'event'
* @return boolean|object true on success, PEAR_Error otherwise
*/
function setMode($mode)
{
if ($mode != 'func' && $mode != 'event') {
$this->raiseError('Unsupported mode given', XML_PARSER_ERROR_UNSUPPORTED_MODE);
}
 
$this->mode = $mode;
return true;
}
 
/**
* Sets the object, that will handle the XML events
*
* This allows you to create a handler object independent of the
* parser object that you are using and easily switch the underlying
* parser.
*
* If no object will be set, XML_Parser assumes that you
* extend this class and handle the events in $this.
*
* @access public
* @param object object to handle the events
* @return boolean will always return true
* @since v1.2.0beta3
*/
function setHandlerObj(&$obj)
{
$this->_handlerObj = &$obj;
return true;
}
 
/**
* Init the element handlers
*
* @access private
*/
function _initHandlers()
{
if (!is_resource($this->parser)) {
return false;
}
 
if (!is_object($this->_handlerObj)) {
$this->_handlerObj = &$this;
}
switch ($this->mode) {
 
case 'func':
xml_set_object($this->parser, $this->_handlerObj);
xml_set_element_handler($this->parser, array(&$this, 'funcStartHandler'), array(&$this, 'funcEndHandler'));
break;
 
case 'event':
xml_set_object($this->parser, $this->_handlerObj);
xml_set_element_handler($this->parser, 'startHandler', 'endHandler');
break;
default:
return $this->raiseError('Unsupported mode given', XML_PARSER_ERROR_UNSUPPORTED_MODE);
break;
}
 
 
/**
* set additional handlers for character data, entities, etc.
*/
foreach ($this->handler as $xml_func => $method) {
if (method_exists($this->_handlerObj, $method)) {
$xml_func = 'xml_set_' . $xml_func;
$xml_func($this->parser, $method);
}
}
}
 
// {{{ _create()
 
/**
* create the XML parser resource
*
* Has been moved from the constructor to avoid
* problems with object references.
*
* Furthermore it allows us returning an error
* if something fails.
*
* @access private
* @return boolean|object true on success, PEAR_Error otherwise
*
* @see xml_parser_create
*/
function _create()
{
if ($this->srcenc === null) {
$xp = @xml_parser_create();
} else {
$xp = @xml_parser_create($this->srcenc);
}
if (is_resource($xp)) {
if ($this->tgtenc !== null) {
if (!@xml_parser_set_option($xp, XML_OPTION_TARGET_ENCODING,
$this->tgtenc)) {
return $this->raiseError('invalid target encoding', XML_PARSER_ERROR_INVALID_ENCODING);
}
}
$this->parser = $xp;
$result = $this->_initHandlers($this->mode);
if ($this->isError($result)) {
return $result;
}
xml_parser_set_option($xp, XML_OPTION_CASE_FOLDING, $this->folding);
 
return true;
}
return $this->raiseError('Unable to create XML parser resource.', XML_PARSER_ERROR_NO_RESOURCE);
}
 
// }}}
// {{{ reset()
 
/**
* Reset the parser.
*
* This allows you to use one parser instance
* to parse multiple XML documents.
*
* @access public
* @return boolean|object true on success, PEAR_Error otherwise
*/
function reset()
{
$result = $this->_create();
if ($this->isError( $result )) {
return $result;
}
return true;
}
 
// }}}
// {{{ setInputFile()
 
/**
* Sets the input xml file to be parsed
*
* @param string Filename (full path)
* @return resource fopen handle of the given file
* @throws XML_Parser_Error
* @see setInput(), setInputString(), parse()
* @access public
*/
function setInputFile($file)
{
/**
* check, if file is a remote file
*/
if (eregi('^(http|ftp)://', substr($file, 0, 10))) {
if (!ini_get('allow_url_fopen')) {
return $this->raiseError('Remote files cannot be parsed, as safe mode is enabled.', XML_PARSER_ERROR_REMOTE);
}
}
$fp = @fopen($file, 'rb');
if (is_resource($fp)) {
$this->fp = $fp;
return $fp;
}
return $this->raiseError('File could not be opened.', XML_PARSER_ERROR_FILE_NOT_READABLE);
}
 
// }}}
// {{{ setInputString()
/**
* XML_Parser::setInputString()
*
* Sets the xml input from a string
*
* @param string $data a string containing the XML document
* @return null
**/
function setInputString($data)
{
$this->fp = $data;
return null;
}
// }}}
// {{{ setInput()
 
/**
* Sets the file handle to use with parse().
*
* You should use setInputFile() or setInputString() if you
* pass a string
*
* @param mixed $fp Can be either a resource returned from fopen(),
* a URL, a local filename or a string.
* @access public
* @see parse()
* @uses setInputString(), setInputFile()
*/
function setInput($fp)
{
if (is_resource($fp)) {
$this->fp = $fp;
return true;
}
// see if it's an absolute URL (has a scheme at the beginning)
elseif (eregi('^[a-z]+://', substr($fp, 0, 10))) {
return $this->setInputFile($fp);
}
// see if it's a local file
elseif (file_exists($fp)) {
return $this->setInputFile($fp);
}
// it must be a string
else {
$this->fp = $fp;
return true;
}
 
return $this->raiseError('Illegal input format', XML_PARSER_ERROR_INVALID_INPUT);
}
 
// }}}
// {{{ parse()
 
/**
* Central parsing function.
*
* @return true|object PEAR error returns true on success, or a PEAR_Error otherwise
* @access public
*/
function parse()
{
/**
* reset the parser
*/
$result = $this->reset();
if ($this->isError($result)) {
return $result;
}
// if $this->fp was fopened previously
if (is_resource($this->fp)) {
while ($data = fread($this->fp, 4096)) {
if (!$this->_parseString($data, feof($this->fp))) {
$error = &$this->raiseError();
$this->free();
return $error;
}
}
// otherwise, $this->fp must be a string
} else {
if (!$this->_parseString($this->fp, true)) {
$error = &$this->raiseError();
$this->free();
return $error;
}
}
$this->free();
 
return true;
}
 
/**
* XML_Parser::_parseString()
*
* @param string $data
* @param boolean $eof
* @return bool
* @access private
* @see parseString()
**/
function _parseString($data, $eof = false)
{
return xml_parse($this->parser, $data, $eof);
}
// }}}
// {{{ parseString()
 
/**
* XML_Parser::parseString()
*
* Parses a string.
*
* @param string $data XML data
* @param boolean $eof If set and TRUE, data is the last piece of data sent in this parser
* @throws XML_Parser_Error
* @return Pear Error|true true on success or a PEAR Error
* @see _parseString()
*/
function parseString($data, $eof = false)
{
if (!isset($this->parser) || !is_resource($this->parser)) {
$this->reset();
}
if (!$this->_parseString($data, $eof)) {
$error = &$this->raiseError();
$this->free();
return $error;
}
 
if ($eof === true) {
$this->free();
}
return true;
}
/**
* XML_Parser::free()
*
* Free the internal resources associated with the parser
*
* @return null
**/
function free()
{
if (isset($this->parser) && is_resource($this->parser)) {
xml_parser_free($this->parser);
unset( $this->parser );
}
if (isset($this->fp) && is_resource($this->fp)) {
fclose($this->fp);
}
unset($this->fp);
return null;
}
/**
* XML_Parser::raiseError()
*
* Throws a XML_Parser_Error
*
* @param string $msg the error message
* @param integer $ecode the error message code
* @return XML_Parser_Error
**/
function raiseError($msg = null, $ecode = 0)
{
$msg = !is_null($msg) ? $msg : $this->parser;
$err = &new XML_Parser_Error($msg, $ecode);
return parent::raiseError($err);
}
// }}}
// {{{ funcStartHandler()
 
function funcStartHandler($xp, $elem, $attribs)
{
$func = 'xmltag_' . $elem;
if (strchr($func, '.')) {
$func = str_replace('.', '_', $func);
}
if (method_exists($this->_handlerObj, $func)) {
call_user_func(array(&$this->_handlerObj, $func), $xp, $elem, $attribs);
} elseif (method_exists($this->_handlerObj, 'xmltag')) {
call_user_func(array(&$this->_handlerObj, 'xmltag'), $xp, $elem, $attribs);
}
}
 
// }}}
// {{{ funcEndHandler()
 
function funcEndHandler($xp, $elem)
{
$func = 'xmltag_' . $elem . '_';
if (strchr($func, '.')) {
$func = str_replace('.', '_', $func);
}
if (method_exists($this->_handlerObj, $func)) {
call_user_func(array(&$this->_handlerObj, $func), $xp, $elem);
} elseif (method_exists($this->_handlerObj, 'xmltag_')) {
call_user_func(array(&$this->_handlerObj, 'xmltag_'), $xp, $elem);
}
}
 
// }}}
// {{{ startHandler()
 
/**
*
* @abstract
*/
function startHandler($xp, $elem, &$attribs)
{
return NULL;
}
 
// }}}
// {{{ endHandler()
 
/**
*
* @abstract
*/
function endHandler($xp, $elem)
{
return NULL;
}
 
 
// }}}me
}
 
/**
* error class, replaces PEAR_Error
*
* An instance of this class will be returned
* if an error occurs inside XML_Parser.
*
* There are three advantages over using the standard PEAR_Error:
* - All messages will be prefixed
* - check for XML_Parser error, using is_a( $error, 'XML_Parser_Error' )
* - messages can be generated from the xml_parser resource
*
* @package XML_Parser
* @access public
* @see PEAR_Error
*/
class XML_Parser_Error extends PEAR_Error
{
// {{{ properties
 
/**
* prefix for all messages
*
* @var string
*/
var $error_message_prefix = 'XML_Parser: ';
 
// }}}
// {{{ constructor()
/**
* construct a new error instance
*
* You may either pass a message or an xml_parser resource as first
* parameter. If a resource has been passed, the last error that
* happened will be retrieved and returned.
*
* @access public
* @param string|resource message or parser resource
* @param integer error code
* @param integer error handling
* @param integer error level
*/
function XML_Parser_Error($msgorparser = 'unknown error', $code = 0, $mode = PEAR_ERROR_RETURN, $level = E_USER_NOTICE)
{
if (is_resource($msgorparser)) {
$code = xml_get_error_code($msgorparser);
$msgorparser = sprintf('%s at XML input line %d',
xml_error_string($code),
xml_get_current_line_number($msgorparser));
}
$this->PEAR_Error($msgorparser, $code, $mode, $level);
}
// }}}
}
?>
/tags/Racine_livraison_narmer/api/pear/XML/Util.php
New file
0,0 → 1,752
<?PHP
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Stephan Schmidt <schst@php-tools.net> |
// +----------------------------------------------------------------------+
//
// $Id: Util.php,v 1.1 2007-03-28 08:51:22 neiluj Exp $
 
/**
* error code for invalid chars in XML name
*/
define("XML_UTIL_ERROR_INVALID_CHARS", 51);
 
/**
* error code for invalid chars in XML name
*/
define("XML_UTIL_ERROR_INVALID_START", 52);
 
/**
* error code for non-scalar tag content
*/
define("XML_UTIL_ERROR_NON_SCALAR_CONTENT", 60);
 
/**
* error code for missing tag name
*/
define("XML_UTIL_ERROR_NO_TAG_NAME", 61);
 
/**
* replace XML entities
*/
define("XML_UTIL_REPLACE_ENTITIES", 1);
 
/**
* embedd content in a CData Section
*/
define("XML_UTIL_CDATA_SECTION", 5);
 
/**
* do not replace entitites
*/
define("XML_UTIL_ENTITIES_NONE", 0);
 
/**
* replace all XML entitites
* This setting will replace <, >, ", ' and &
*/
define("XML_UTIL_ENTITIES_XML", 1);
 
/**
* replace only required XML entitites
* This setting will replace <, " and &
*/
define("XML_UTIL_ENTITIES_XML_REQUIRED", 2);
 
/**
* replace HTML entitites
* @link http://www.php.net/htmlentities
*/
define("XML_UTIL_ENTITIES_HTML", 3);
 
/**
* Collapse all empty tags.
*/
define("XML_UTIL_COLLAPSE_ALL", 1);
 
/**
* Collapse only empty XHTML tags that have no end tag.
*/
define("XML_UTIL_COLLAPSE_XHTML_ONLY", 2);
 
/**
* utility class for working with XML documents
*
* @category XML
* @package XML_Util
* @version 1.1.0
* @author Stephan Schmidt <schst@php.net>
*/
class XML_Util {
 
/**
* return API version
*
* @access public
* @static
* @return string $version API version
*/
function apiVersion()
{
return '1.1';
}
 
/**
* replace XML entities
*
* With the optional second parameter, you may select, which
* entities should be replaced.
*
* <code>
* require_once 'XML/Util.php';
*
* // replace XML entites:
* $string = XML_Util::replaceEntities("This string contains < & >.");
* </code>
*
* @access public
* @static
* @param string string where XML special chars should be replaced
* @param integer setting for entities in attribute values (one of XML_UTIL_ENTITIES_XML, XML_UTIL_ENTITIES_XML_REQUIRED, XML_UTIL_ENTITIES_HTML)
* @return string string with replaced chars
* @see reverseEntities()
*/
function replaceEntities($string, $replaceEntities = XML_UTIL_ENTITIES_XML)
{
switch ($replaceEntities) {
case XML_UTIL_ENTITIES_XML:
return strtr($string,array(
'&' => '&amp;',
'>' => '&gt;',
'<' => '&lt;',
'"' => '&quot;',
'\'' => '&apos;' ));
break;
case XML_UTIL_ENTITIES_XML_REQUIRED:
return strtr($string,array(
'&' => '&amp;',
'<' => '&lt;',
'"' => '&quot;' ));
break;
case XML_UTIL_ENTITIES_HTML:
return htmlentities($string);
break;
}
return $string;
}
 
/**
* reverse XML entities
*
* With the optional second parameter, you may select, which
* entities should be reversed.
*
* <code>
* require_once 'XML/Util.php';
*
* // reverse XML entites:
* $string = XML_Util::reverseEntities("This string contains &lt; &amp; &gt;.");
* </code>
*
* @access public
* @static
* @param string string where XML special chars should be replaced
* @param integer setting for entities in attribute values (one of XML_UTIL_ENTITIES_XML, XML_UTIL_ENTITIES_XML_REQUIRED, XML_UTIL_ENTITIES_HTML)
* @return string string with replaced chars
* @see replaceEntities()
*/
function reverseEntities($string, $replaceEntities = XML_UTIL_ENTITIES_XML)
{
switch ($replaceEntities) {
case XML_UTIL_ENTITIES_XML:
return strtr($string,array(
'&amp;' => '&',
'&gt;' => '>',
'&lt;' => '<',
'&quot;' => '"',
'&apos;' => '\'' ));
break;
case XML_UTIL_ENTITIES_XML_REQUIRED:
return strtr($string,array(
'&amp;' => '&',
'&lt;' => '<',
'&quot;' => '"' ));
break;
case XML_UTIL_ENTITIES_HTML:
$arr = array_flip(get_html_translation_table(HTML_ENTITIES));
return strtr($string, $arr);
break;
}
return $string;
}
 
/**
* build an xml declaration
*
* <code>
* require_once 'XML/Util.php';
*
* // get an XML declaration:
* $xmlDecl = XML_Util::getXMLDeclaration("1.0", "UTF-8", true);
* </code>
*
* @access public
* @static
* @param string $version xml version
* @param string $encoding character encoding
* @param boolean $standAlone document is standalone (or not)
* @return string $decl xml declaration
* @uses XML_Util::attributesToString() to serialize the attributes of the XML declaration
*/
function getXMLDeclaration($version = "1.0", $encoding = null, $standalone = null)
{
$attributes = array(
"version" => $version,
);
// add encoding
if ($encoding !== null) {
$attributes["encoding"] = $encoding;
}
// add standalone, if specified
if ($standalone !== null) {
$attributes["standalone"] = $standalone ? "yes" : "no";
}
 
return sprintf("<?xml%s?>", XML_Util::attributesToString($attributes, false));
}
 
/**
* build a document type declaration
*
* <code>
* require_once 'XML/Util.php';
*
* // get a doctype declaration:
* $xmlDecl = XML_Util::getDocTypeDeclaration("rootTag","myDocType.dtd");
* </code>
*
* @access public
* @static
* @param string $root name of the root tag
* @param string $uri uri of the doctype definition (or array with uri and public id)
* @param string $internalDtd internal dtd entries
* @return string $decl doctype declaration
* @since 0.2
*/
function getDocTypeDeclaration($root, $uri = null, $internalDtd = null)
{
if (is_array($uri)) {
$ref = sprintf( ' PUBLIC "%s" "%s"', $uri["id"], $uri["uri"] );
} elseif (!empty($uri)) {
$ref = sprintf( ' SYSTEM "%s"', $uri );
} else {
$ref = "";
}
 
if (empty($internalDtd)) {
return sprintf("<!DOCTYPE %s%s>", $root, $ref);
} else {
return sprintf("<!DOCTYPE %s%s [\n%s\n]>", $root, $ref, $internalDtd);
}
}
 
/**
* create string representation of an attribute list
*
* <code>
* require_once 'XML/Util.php';
*
* // build an attribute string
* $att = array(
* "foo" => "bar",
* "argh" => "tomato"
* );
*
* $attList = XML_Util::attributesToString($att);
* </code>
*
* @access public
* @static
* @param array $attributes attribute array
* @param boolean|array $sort sort attribute list alphabetically, may also be an assoc array containing the keys 'sort', 'multiline', 'indent', 'linebreak' and 'entities'
* @param boolean $multiline use linebreaks, if more than one attribute is given
* @param string $indent string used for indentation of multiline attributes
* @param string $linebreak string used for linebreaks of multiline attributes
* @param integer $entities setting for entities in attribute values (one of XML_UTIL_ENTITIES_NONE, XML_UTIL_ENTITIES_XML, XML_UTIL_ENTITIES_XML_REQUIRED, XML_UTIL_ENTITIES_HTML)
* @return string string representation of the attributes
* @uses XML_Util::replaceEntities() to replace XML entities in attribute values
* @todo allow sort also to be an options array
*/
function attributesToString($attributes, $sort = true, $multiline = false, $indent = ' ', $linebreak = "\n", $entities = XML_UTIL_ENTITIES_XML)
{
/**
* second parameter may be an array
*/
if (is_array($sort)) {
if (isset($sort['multiline'])) {
$multiline = $sort['multiline'];
}
if (isset($sort['indent'])) {
$indent = $sort['indent'];
}
if (isset($sort['linebreak'])) {
$multiline = $sort['linebreak'];
}
if (isset($sort['entities'])) {
$entities = $sort['entities'];
}
if (isset($sort['sort'])) {
$sort = $sort['sort'];
} else {
$sort = true;
}
}
$string = '';
if (is_array($attributes) && !empty($attributes)) {
if ($sort) {
ksort($attributes);
}
if( !$multiline || count($attributes) == 1) {
foreach ($attributes as $key => $value) {
if ($entities != XML_UTIL_ENTITIES_NONE) {
if ($entities === XML_UTIL_CDATA_SECTION) {
$entities = XML_UTIL_ENTITIES_XML;
}
$value = XML_Util::replaceEntities($value, $entities);
}
$string .= ' '.$key.'="'.$value.'"';
}
} else {
$first = true;
foreach ($attributes as $key => $value) {
if ($entities != XML_UTIL_ENTITIES_NONE) {
$value = XML_Util::replaceEntities($value, $entities);
}
if ($first) {
$string .= " ".$key.'="'.$value.'"';
$first = false;
} else {
$string .= $linebreak.$indent.$key.'="'.$value.'"';
}
}
}
}
return $string;
}
 
/**
* Collapses empty tags.
*
* @access public
* @static
* @param string $xml XML
* @param integer $mode Whether to collapse all empty tags (XML_UTIL_COLLAPSE_ALL) or only XHTML (XML_UTIL_COLLAPSE_XHTML_ONLY) ones.
* @return string $xml XML
*/
function collapseEmptyTags($xml, $mode = XML_UTIL_COLLAPSE_ALL) {
if ($mode == XML_UTIL_COLLAPSE_XHTML_ONLY) {
return preg_replace(
'/<(area|base|br|col|hr|img|input|link|meta|param)([^>]*)><\/\\1>/s',
'<\\1\\2 />',
$xml
);
} else {
return preg_replace(
'/<(\w+)([^>]*)><\/\\1>/s',
'<\\1\\2 />',
$xml
);
}
}
 
/**
* create a tag
*
* This method will call XML_Util::createTagFromArray(), which
* is more flexible.
*
* <code>
* require_once 'XML/Util.php';
*
* // create an XML tag:
* $tag = XML_Util::createTag("myNs:myTag", array("foo" => "bar"), "This is inside the tag", "http://www.w3c.org/myNs#");
* </code>
*
* @access public
* @static
* @param string $qname qualified tagname (including namespace)
* @param array $attributes array containg attributes
* @param mixed $content
* @param string $namespaceUri URI of the namespace
* @param integer $replaceEntities whether to replace XML special chars in content, embedd it in a CData section or none of both
* @param boolean $multiline whether to create a multiline tag where each attribute gets written to a single line
* @param string $indent string used to indent attributes (_auto indents attributes so they start at the same column)
* @param string $linebreak string used for linebreaks
* @param boolean $sortAttributes Whether to sort the attributes or not
* @return string $string XML tag
* @see XML_Util::createTagFromArray()
* @uses XML_Util::createTagFromArray() to create the tag
*/
function createTag($qname, $attributes = array(), $content = null, $namespaceUri = null, $replaceEntities = XML_UTIL_REPLACE_ENTITIES, $multiline = false, $indent = "_auto", $linebreak = "\n", $sortAttributes = true)
{
$tag = array(
"qname" => $qname,
"attributes" => $attributes
);
 
// add tag content
if ($content !== null) {
$tag["content"] = $content;
}
 
// add namespace Uri
if ($namespaceUri !== null) {
$tag["namespaceUri"] = $namespaceUri;
}
 
return XML_Util::createTagFromArray($tag, $replaceEntities, $multiline, $indent, $linebreak, $sortAttributes);
}
 
/**
* create a tag from an array
* this method awaits an array in the following format
* <pre>
* array(
* "qname" => $qname // qualified name of the tag
* "namespace" => $namespace // namespace prefix (optional, if qname is specified or no namespace)
* "localpart" => $localpart, // local part of the tagname (optional, if qname is specified)
* "attributes" => array(), // array containing all attributes (optional)
* "content" => $content, // tag content (optional)
* "namespaceUri" => $namespaceUri // namespaceUri for the given namespace (optional)
* )
* </pre>
*
* <code>
* require_once 'XML/Util.php';
*
* $tag = array(
* "qname" => "foo:bar",
* "namespaceUri" => "http://foo.com",
* "attributes" => array( "key" => "value", "argh" => "fruit&vegetable" ),
* "content" => "I'm inside the tag",
* );
* // creating a tag with qualified name and namespaceUri
* $string = XML_Util::createTagFromArray($tag);
* </code>
*
* @access public
* @static
* @param array $tag tag definition
* @param integer $replaceEntities whether to replace XML special chars in content, embedd it in a CData section or none of both
* @param boolean $multiline whether to create a multiline tag where each attribute gets written to a single line
* @param string $indent string used to indent attributes (_auto indents attributes so they start at the same column)
* @param string $linebreak string used for linebreaks
* @param boolean $sortAttributes Whether to sort the attributes or not
* @return string $string XML tag
* @see XML_Util::createTag()
* @uses XML_Util::attributesToString() to serialize the attributes of the tag
* @uses XML_Util::splitQualifiedName() to get local part and namespace of a qualified name
*/
function createTagFromArray($tag, $replaceEntities = XML_UTIL_REPLACE_ENTITIES, $multiline = false, $indent = "_auto", $linebreak = "\n", $sortAttributes = true)
{
if (isset($tag['content']) && !is_scalar($tag['content'])) {
return XML_Util::raiseError( 'Supplied non-scalar value as tag content', XML_UTIL_ERROR_NON_SCALAR_CONTENT );
}
 
if (!isset($tag['qname']) && !isset($tag['localPart'])) {
return XML_Util::raiseError( 'You must either supply a qualified name (qname) or local tag name (localPart).', XML_UTIL_ERROR_NO_TAG_NAME );
}
 
// if no attributes hav been set, use empty attributes
if (!isset($tag["attributes"]) || !is_array($tag["attributes"])) {
$tag["attributes"] = array();
}
 
if (isset($tag['namespaces'])) {
foreach ($tag['namespaces'] as $ns => $uri) {
$tag['attributes']['xmlns:'.$ns] = $uri;
}
}
 
// qualified name is not given
if (!isset($tag["qname"])) {
// check for namespace
if (isset($tag["namespace"]) && !empty($tag["namespace"])) {
$tag["qname"] = $tag["namespace"].":".$tag["localPart"];
} else {
$tag["qname"] = $tag["localPart"];
}
// namespace URI is set, but no namespace
} elseif (isset($tag["namespaceUri"]) && !isset($tag["namespace"])) {
$parts = XML_Util::splitQualifiedName($tag["qname"]);
$tag["localPart"] = $parts["localPart"];
if (isset($parts["namespace"])) {
$tag["namespace"] = $parts["namespace"];
}
}
 
if (isset($tag["namespaceUri"]) && !empty($tag["namespaceUri"])) {
// is a namespace given
if (isset($tag["namespace"]) && !empty($tag["namespace"])) {
$tag["attributes"]["xmlns:".$tag["namespace"]] = $tag["namespaceUri"];
} else {
// define this Uri as the default namespace
$tag["attributes"]["xmlns"] = $tag["namespaceUri"];
}
}
 
// check for multiline attributes
if ($multiline === true) {
if ($indent === "_auto") {
$indent = str_repeat(" ", (strlen($tag["qname"])+2));
}
}
 
// create attribute list
$attList = XML_Util::attributesToString($tag['attributes'], $sortAttributes, $multiline, $indent, $linebreak, $replaceEntities );
if (!isset($tag['content']) || (string)$tag['content'] == '') {
$tag = sprintf('<%s%s />', $tag['qname'], $attList);
} else {
switch ($replaceEntities) {
case XML_UTIL_ENTITIES_NONE:
break;
case XML_UTIL_CDATA_SECTION:
$tag['content'] = XML_Util::createCDataSection($tag['content']);
break;
default:
$tag['content'] = XML_Util::replaceEntities($tag['content'], $replaceEntities);
break;
}
$tag = sprintf('<%s%s>%s</%s>', $tag['qname'], $attList, $tag['content'], $tag['qname'] );
}
return $tag;
}
 
/**
* create a start element
*
* <code>
* require_once 'XML/Util.php';
*
* // create an XML start element:
* $tag = XML_Util::createStartElement("myNs:myTag", array("foo" => "bar") ,"http://www.w3c.org/myNs#");
* </code>
*
* @access public
* @static
* @param string $qname qualified tagname (including namespace)
* @param array $attributes array containg attributes
* @param string $namespaceUri URI of the namespace
* @param boolean $multiline whether to create a multiline tag where each attribute gets written to a single line
* @param string $indent string used to indent attributes (_auto indents attributes so they start at the same column)
* @param string $linebreak string used for linebreaks
* @param boolean $sortAttributes Whether to sort the attributes or not
* @return string $string XML start element
* @see XML_Util::createEndElement(), XML_Util::createTag()
*/
function createStartElement($qname, $attributes = array(), $namespaceUri = null, $multiline = false, $indent = '_auto', $linebreak = "\n", $sortAttributes = true)
{
// if no attributes hav been set, use empty attributes
if (!isset($attributes) || !is_array($attributes)) {
$attributes = array();
}
 
if ($namespaceUri != null) {
$parts = XML_Util::splitQualifiedName($qname);
}
 
// check for multiline attributes
if ($multiline === true) {
if ($indent === "_auto") {
$indent = str_repeat(" ", (strlen($qname)+2));
}
}
 
if ($namespaceUri != null) {
// is a namespace given
if (isset($parts["namespace"]) && !empty($parts["namespace"])) {
$attributes["xmlns:".$parts["namespace"]] = $namespaceUri;
} else {
// define this Uri as the default namespace
$attributes["xmlns"] = $namespaceUri;
}
}
 
// create attribute list
$attList = XML_Util::attributesToString($attributes, $sortAttributes, $multiline, $indent, $linebreak);
$element = sprintf("<%s%s>", $qname, $attList);
return $element;
}
 
/**
* create an end element
*
* <code>
* require_once 'XML/Util.php';
*
* // create an XML start element:
* $tag = XML_Util::createEndElement("myNs:myTag");
* </code>
*
* @access public
* @static
* @param string $qname qualified tagname (including namespace)
* @return string $string XML end element
* @see XML_Util::createStartElement(), XML_Util::createTag()
*/
function createEndElement($qname)
{
$element = sprintf("</%s>", $qname);
return $element;
}
 
/**
* create an XML comment
*
* <code>
* require_once 'XML/Util.php';
*
* // create an XML start element:
* $tag = XML_Util::createComment("I am a comment");
* </code>
*
* @access public
* @static
* @param string $content content of the comment
* @return string $comment XML comment
*/
function createComment($content)
{
$comment = sprintf("<!-- %s -->", $content);
return $comment;
}
 
/**
* create a CData section
*
* <code>
* require_once 'XML/Util.php';
*
* // create a CData section
* $tag = XML_Util::createCDataSection("I am content.");
* </code>
*
* @access public
* @static
* @param string $data data of the CData section
* @return string $string CData section with content
*/
function createCDataSection($data)
{
return sprintf("<![CDATA[%s]]>", $data);
}
 
/**
* split qualified name and return namespace and local part
*
* <code>
* require_once 'XML/Util.php';
*
* // split qualified tag
* $parts = XML_Util::splitQualifiedName("xslt:stylesheet");
* </code>
* the returned array will contain two elements:
* <pre>
* array(
* "namespace" => "xslt",
* "localPart" => "stylesheet"
* );
* </pre>
*
* @access public
* @static
* @param string $qname qualified tag name
* @param string $defaultNs default namespace (optional)
* @return array $parts array containing namespace and local part
*/
function splitQualifiedName($qname, $defaultNs = null)
{
if (strstr($qname, ':')) {
$tmp = explode(":", $qname);
return array(
"namespace" => $tmp[0],
"localPart" => $tmp[1]
);
}
return array(
"namespace" => $defaultNs,
"localPart" => $qname
);
}
 
/**
* check, whether string is valid XML name
*
* <p>XML names are used for tagname, attribute names and various
* other, lesser known entities.</p>
* <p>An XML name may only consist of alphanumeric characters,
* dashes, undescores and periods, and has to start with a letter
* or an underscore.
* </p>
*
* <code>
* require_once 'XML/Util.php';
*
* // verify tag name
* $result = XML_Util::isValidName("invalidTag?");
* if (XML_Util::isError($result)) {
* print "Invalid XML name: " . $result->getMessage();
* }
* </code>
*
* @access public
* @static
* @param string $string string that should be checked
* @return mixed $valid true, if string is a valid XML name, PEAR error otherwise
* @todo support for other charsets
*/
function isValidName($string)
{
// check for invalid chars
if (!preg_match('/^[[:alpha:]_]$/', $string{0})) {
return XML_Util::raiseError('XML names may only start with letter or underscore', XML_UTIL_ERROR_INVALID_START);
}
 
// check for invalid chars
if (!preg_match('/^([[:alpha:]_]([[:alnum:]\-\.]*)?:)?[[:alpha:]_]([[:alnum:]\_\-\.]+)?$/', $string)) {
return XML_Util::raiseError('XML names may only contain alphanumeric chars, period, hyphen, colon and underscores', XML_UTIL_ERROR_INVALID_CHARS);
}
// XML name is valid
return true;
}
 
/**
* replacement for XML_Util::raiseError
*
* Avoids the necessity to always require
* PEAR.php
*
* @access public
* @param string error message
* @param integer error code
* @return object PEAR_Error
*/
function raiseError($msg, $code)
{
require_once 'PEAR.php';
return PEAR::raiseError($msg, $code);
}
}
?>
/tags/Racine_livraison_narmer/api/pear/XML/Tree.php
New file
0,0 → 1,370
<?php
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Bernd Römer <berndr@bonn.edu> |
// | Sebastian Bergmann <sb@sebastian-bergmann.de> |
// | Tomas V.V.Cox <cox@idecnet.com> (tree mapping from xml file)|
// +----------------------------------------------------------------------+
//
// $Id: Tree.php,v 1.1 2005-04-18 16:13:31 jpm Exp $
//
 
require_once 'XML/Parser.php';
require_once 'XML/Tree/Node.php';
 
/**
* PEAR::XML_Tree
*
* Purpose
*
* Allows for the building of XML data structures
* using a tree representation, without the need
* for an extension like DOMXML.
*
* Example
*
* $tree = new XML_Tree;
* $root =& $tree->addRoot('root');
* $foo =& $root->addChild('foo');
*
* header('Content-Type: text/xml');
* $tree->dump();
*
* @author Bernd Römer <berndr@bonn.edu>
* @package XML
* @version $Version$ - 1.0
*/
class XML_Tree extends XML_Parser
{
/**
* File Handle
*
* @var ressource
*/
var $file = NULL;
 
/**
* Filename
*
* @var string
*/
var $filename = '';
 
/**
* Namespace
*
* @var array
*/
var $namespace = array();
 
/**
* Root
*
* @var object XML_Tree_Node
*/
var $root = NULL;
 
/**
* XML Version
*
* @var string
*/
var $version = '1.0';
 
/**
* Constructor
*
* @param string Filename
* @param string XML Version
*/
function XML_Tree($filename = '', $version = '1.0') {
$this->filename = $filename;
$this->version = $version;
}
 
/**
* Add root node.
*
* @param string $name name of root element
* @return object XML_Tree_Node reference to root node
*
* @access public
*/
function &addRoot($name, $content = '', $attributes = array()) {
$this->root = new XML_Tree_Node($name, $content, $attributes);
return $this->root;
}
 
/**
* @deprecated
*/
function &add_root($name, $content = '', $attributes = array()) {
return $this->addRoot($name, $content, $attributes);
}
 
/**
* inserts a child/tree (child) into tree ($path,$pos) and
* maintains namespace integrity
*
* @param array $path path to parent of child to remove
* @param integer $pos position of child to be inserted in its parents children-list
* @param mixed $child child-node (by XML_Tree,XML_Node or Name)
* @param string $content content (text) for new node
* @param array $attributes attribute-hash for new node
*
* @return object XML_Tree_Node inserted child (node)
* @access public
*/
function &insertChild($path,$pos,$child, $content = '', $attributes = array()) {
// update namespace to maintain namespace integrity
$count=count($path);
foreach($this->namespace as $key => $val) {
if ((array_slice($val,0,$count)==$path) && ($val[$count]>=$pos))
$this->namespace[$key][$count]++;
}
 
$parent=&$this->get_node_by_path($path);
return($parent->insert_child($pos,$child,$content,$attributes));
}
 
/**
* @deprecated
*/
function &insert_child($path,$pos,$child, $content = '', $attributes = array()) {
return $this->insertChild($path, $child, $content, $attributes);
}
 
/*
* removes a child ($path,$pos) from tree ($path,$pos) and
* maintains namespace integrity
*
* @param array $path path to parent of child to remove
* @param integer $pos position of child in parents children-list
*
* @return object XML_Tree_Node parent whichs child was removed
* @access public
*/
function &removeChild($path,$pos) {
// update namespace to maintain namespace integrity
$count=count($path);
foreach($this->namespace as $key => $val) {
if (array_slice($val,0,$count)==$path) {
if ($val[$count]==$pos) { unset($this->namespace[$key]); break; }
if ($val[$count]>$pos)
$this->namespace[$key][$count]--;
}
}
 
$parent=&$this->get_node_by_path($path);
return($parent->remove_child($pos));
}
 
/**
* @deprecated
*/
function &remove_child($path, $pos) {
return $this->removeChild($path, $pos);
}
 
/*
* Maps a xml file to a objects tree
*
* @return mixed The objects tree (XML_tree or an Pear error)
* @access public
*/
function &getTreeFromFile ()
{
$this->folding = false;
$this->XML_Parser(null, 'event');
$err = $this->setInputFile($this->filename);
if (PEAR::isError($err)) {
return $err;
}
$this->cdata = null;
$err = $this->parse();
if (PEAR::isError($err)) {
return $err;
}
return $this->root;
}
 
function getTreeFromString($str)
{
$this->folding = false;
$this->XML_Parser(null, 'event');
$this->cdata = null;
$err = $this->parseString($str);
if (PEAR::isError($err)) {
return $err;
}
return $this->root;
}
 
/**
* Handler for the xml-data
*
* @param mixed $xp ignored
* @param string $elem name of the element
* @param array $attribs attributes for the generated node
*
* @access private
*/
function startHandler($xp, $elem, &$attribs)
{
// root elem
if (!isset($this->i)) {
$this->obj1 =& $this->add_root($elem, null, $attribs);
$this->i = 2;
} else {
// mixed contents
if (!empty($this->cdata)) {
$parent_id = 'obj' . ($this->i - 1);
$parent =& $this->$parent_id;
$parent->children[] = &new XML_Tree_Node(null, $this->cdata);
}
$obj_id = 'obj' . $this->i++;
$this->$obj_id = &new XML_Tree_Node($elem, null, $attribs);
}
$this->cdata = null;
return null;
}
 
/**
* Handler for the xml-data
*
* @param mixed $xp ignored
* @param string $elem name of the element
*
* @access private
*/
function endHandler($xp, $elem)
{
$this->i--;
if ($this->i > 1) {
$obj_id = 'obj' . $this->i;
// recover the node created in StartHandler
$node =& $this->$obj_id;
// mixed contents
if (count($node->children) > 0) {
if (trim($this->cdata)) {
$node->children[] = &new XML_Tree_Node(null, $this->cdata);
}
} else {
$node->set_content($this->cdata);
}
$parent_id = 'obj' . ($this->i - 1);
$parent =& $this->$parent_id;
// attach the node to its parent node children array
$parent->children[] = $node;
}
$this->cdata = null;
return null;
}
 
/*
* The xml character data handler
*
* @param mixed $xp ignored
* @param string $data PCDATA between tags
*
* @access private
*/
function cdataHandler($xp, $data)
{
if (trim($data)) {
$this->cdata .= $data;
}
}
 
/**
* Get a copy of this tree.
*
* @return object XML_Tree
* @access public
*/
function clone() {
$clone=new XML_Tree($this->filename,$this->version);
$clone->root=$this->root->clone();
 
// clone all other vars
$temp=get_object_vars($this);
foreach($temp as $varname => $value)
if (!in_array($varname,array('filename','version','root')))
$clone->$varname=$value;
 
return($clone);
}
 
/**
* Print text representation of XML tree.
*
* @access public
*/
function dump() {
echo $this->get();
}
 
/**
* Get text representation of XML tree.
*
* @return string XML
* @access public
*/
function &get() {
$out = '<?xml version="' . $this->version . "\"?>\n";
$out .= $this->root->get();
 
return $out;
}
 
/**
* Get current namespace.
*
* @param string $name namespace
* @return string
*
* @access public
*/
function &getName($name) {
return $this->root->get_element($this->namespace[$name]);
}
 
/**
* @deprecated
*/
function &get_name($name) {
return $this->getName($name);
}
 
/**
* Register a namespace.
*
* @param string $name namespace
* @param string $path path
*
* @access public
*/
function registerName($name, $path) {
$this->namespace[$name] = $path;
}
 
/**
* @deprecated
*/
function register_name($name, $path) {
return $this->registerName($name, $path);
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Auth/Container/KADM5.php
New file
0,0 → 1,170
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */
 
/**
* Storage driver for Authentication on a Kerberos V server.
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Authentication
* @package Auth
* @author Andrew Teixeira <ateixeira@gmail.com>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: KADM5.php,v 1.1 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/Auth
* @since File available since Release 1.4.0
*/
 
/**
* Include Auth_Container base class
*/
require_once 'Auth/Container.php';
/**
* Include PEAR for error handling
*/
require_once 'PEAR.php';
 
/**
* Storage driver for Authentication on a Kerberos V server.
*
* Available options:
* hostname: The hostname of the kerberos server
* realm: The Kerberos V realm
* timeout: The timeout for checking the server
* checkServer: Set to true to check if the server is running when
* constructing the object
*
* @category Authentication
* @package Auth
* @author Andrew Teixeira <ateixeira@gmail.com>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version Release: 1.4.3 File: $Revision: 1.1 $
* @link http://pear.php.net/package/Auth
* @since Class available since Release 1.4.0
*/
class Auth_Container_KADM5 extends Auth_Container {
 
// {{{ properties
 
/**
* Options for the class
* @var string
*/
var $options = array();
 
// }}}
// {{{ Auth_Container_KADM5()
 
/**
* Constructor of the container class
*
* $options can have these keys:
* 'hostname' The hostname of the kerberos server
* 'realm' The Kerberos V realm
* 'timeout' The timeout for checking the server
* 'checkServer' Set to true to check if the server is running when
* constructing the object
*
* @param $options associative array
* @return object Returns an error object if something went wrong
*/
function Auth_Container_KADM5($options) {
if (!extension_loaded('kadm5')) {
return PEAR::raiseError("Cannot use Kerberos V authentication, KADM5 extension not loaded!", 41, PEAR_ERROR_DIE);
}
$this->_setDefaults();
if (isset($options['hostname'])) {
$this->options['hostname'] = $options['hostname'];
}
if (isset($options['realm'])) {
$this->options['realm'] = $options['realm'];
}
if (isset($options['timeout'])) {
$this->options['timeout'] = $options['timeout'];
}
if (isset($options['checkServer'])) {
$this->options['checkServer'] = $options['checkServer'];
}
if ($this->options['checkServer']) {
$this->_checkServer();
}
}
 
// }}}
// {{{ fetchData()
/**
* Try to login to the KADM5 server
*
* @param string Username
* @param string Password
* @return boolean
*/
function fetchData($username, $password) {
if ( ($username == NULL) || ($password == NULL) ) {
return false;
}
$server = $this->options['hostname'];
$realm = $this->options['realm'];
$check = @kadm5_init_with_password($server, $realm, $username, $password);
if ($check == false) {
return false;
} else {
return true;
}
}
// }}}
// {{{ _setDefaults()
/**
* Set some default options
*
* @access private
*/
function _setDefaults() {
$this->options['hostname'] = 'localhost';
$this->options['realm'] = NULL;
$this->options['timeout'] = 10;
$this->options['checkServer'] = false;
}
// }}}
// {{{ _checkServer()
/**
* Check if the given server and port are reachable
*
* @access private
*/
function _checkServer() {
$fp = @fsockopen ($this->options['hostname'], 88, $errno, $errstr, $this->options['timeout']);
if (is_resource($fp)) {
@fclose($fp);
} else {
$message = "Error connecting to Kerberos V server "
.$this->options['hostname'].":".$this->options['port'];
return PEAR::raiseError($message, 41, PEAR_ERROR_DIE);
}
}
// }}}
 
}
 
?>
/tags/Racine_livraison_narmer/api/pear/Auth/Container/MDB.php
New file
0,0 → 1,573
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */
 
/**
* Storage driver for use against PEAR MDB
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Authentication
* @package Auth
* @author Lorenzo Alberton <l.alberton@quipo.it>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: MDB.php,v 1.2 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/Auth
* @since File available since Release 1.2.3
*/
 
/**
* Include Auth_Container base class
*/
require_once 'Auth/Container.php';
/**
* Include PEAR MDB package
*/
require_once 'MDB.php';
 
/**
* Storage driver for fetching login data from a database
*
* This storage driver can use all databases which are supported
* by the PEAR MDB abstraction layer to fetch login data.
*
* @category Authentication
* @package Auth
* @author Lorenzo Alberton <l.alberton@quipo.it>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version Release: 1.4.3 File: $Revision: 1.2 $
* @link http://pear.php.net/package/Auth
* @since Class available since Release 1.2.3
*/
class Auth_Container_MDB extends Auth_Container
{
 
// {{{ properties
 
/**
* Additional options for the storage container
* @var array
*/
var $options = array();
 
/**
* MDB object
* @var object
*/
var $db = null;
var $dsn = '';
 
/**
* User that is currently selected from the DB.
* @var string
*/
var $activeUser = '';
 
// }}}
// {{{ Auth_Container_MDB() [constructor]
 
/**
* Constructor of the container class
*
* Initate connection to the database via PEAR::MDB
*
* @param string Connection data or MDB object
* @return object Returns an error object if something went wrong
*/
function Auth_Container_MDB($dsn)
{
$this->_setDefaults();
 
if (is_array($dsn)) {
$this->_parseOptions($dsn);
if (empty($this->options['dsn'])) {
PEAR::raiseError('No connection parameters specified!');
}
} else {
$this->options['dsn'] = $dsn;
}
}
 
// }}}
// {{{ _connect()
 
/**
* Connect to database by using the given DSN string
*
* @access private
* @param mixed DSN string | array | mdb object
* @return mixed Object on error, otherwise bool
*/
function _connect($dsn)
{
if (is_string($dsn) || is_array($dsn)) {
$this->db =& MDB::connect($dsn, $this->options['db_options']);
} elseif (is_subclass_of($dsn, 'mdb_common')) {
$this->db = $dsn;
} elseif (is_object($dsn) && MDB::isError($dsn)) {
return PEAR::raiseError($dsn->getMessage(), $dsn->code);
} else {
return PEAR::raiseError('The given dsn was not valid in file ' . __FILE__ . ' at line ' . __LINE__,
41,
PEAR_ERROR_RETURN,
null,
null
);
 
}
 
if (MDB::isError($this->db) || PEAR::isError($this->db)) {
return PEAR::raiseError($this->db->getMessage(), $this->db->code);
}
 
if ($this->options['auto_quote']) {
$this->options['final_table'] = $this->db->quoteIdentifier($this->options['table']);
$this->options['final_usernamecol'] = $this->db->quoteIdentifier($this->options['usernamecol']);
$this->options['final_passwordcol'] = $this->db->quoteIdentifier($this->options['passwordcol']);
} else {
$this->options['final_table'] = $this->options['table'];
$this->options['final_usernamecol'] = $this->options['usernamecol'];
$this->options['final_passwordcol'] = $this->options['passwordcol'];
}
 
return true;
}
 
// }}}
// {{{ _prepare()
 
/**
* Prepare database connection
*
* This function checks if we have already opened a connection to
* the database. If that's not the case, a new connection is opened.
*
* @access private
* @return mixed True or a MDB error object.
*/
function _prepare()
{
if (is_subclass_of($this->db, 'mdb_common')) {
return true;
}
return $this->_connect($this->options['dsn']);
}
 
// }}}
// {{{ query()
 
/**
* Prepare query to the database
*
* This function checks if we have already opened a connection to
* the database. If that's not the case, a new connection is opened.
* After that the query is passed to the database.
*
* @access public
* @param string Query string
* @return mixed a MDB_result object or MDB_OK on success, a MDB
* or PEAR error on failure
*/
function query($query)
{
$err = $this->_prepare();
if ($err !== true) {
return $err;
}
return $this->db->query($query);
}
 
// }}}
// {{{ _setDefaults()
 
/**
* Set some default options
*
* @access private
* @return void
*/
function _setDefaults()
{
$this->options['table'] = 'auth';
$this->options['usernamecol'] = 'username';
$this->options['passwordcol'] = 'password';
$this->options['dsn'] = '';
$this->options['db_fields'] = '';
$this->options['cryptType'] = 'md5';
$this->options['db_options'] = array();
$this->options['auto_quote'] = true;
}
 
// }}}
// {{{ _parseOptions()
 
/**
* Parse options passed to the container class
*
* @access private
* @param array
*/
function _parseOptions($array)
{
foreach ($array as $key => $value) {
if (isset($this->options[$key])) {
$this->options[$key] = $value;
}
}
}
 
// }}}
// {{{ _quoteDBFields()
 
/**
* Quote the db_fields option to avoid the possibility of SQL injection.
*
* @access private
* @return string A properly quoted string that can be concatenated into a
* SELECT clause.
*/
function _quoteDBFields()
{
if (isset($this->options['db_fields'])) {
if (is_array($this->options['db_fields'])) {
if ($this->options['auto_quote']) {
$fields = array();
foreach ($this->options['db_fields'] as $field) {
$fields[] = $this->db->quoteIdentifier($field);
}
return implode(', ', $fields);
} else {
return implode(', ', $this->options['db_fields']);
}
} else {
if (strlen($this->options['db_fields']) > 0) {
if ($this->options['auto_quote']) {
return $this->db->quoteIdentifier($this->options['db_fields']);
} else {
return $this->options['db_fields'];
}
}
}
}
 
return '';
}
// }}}
// {{{ fetchData()
 
/**
* Get user information from database
*
* This function uses the given username to fetch
* the corresponding login data from the database
* table. If an account that matches the passed username
* and password is found, the function returns true.
* Otherwise it returns false.
*
* @param string Username
* @param string Password
* @param boolean If true password is secured using a md5 hash
* the frontend and auth are responsible for making sure the container supports
* challenge response password authentication
* @return mixed Error object or boolean
*/
function fetchData($username, $password, $isChallengeResponse=false)
{
// Prepare for a database query
$err = $this->_prepare();
if ($err !== true) {
return PEAR::raiseError($err->getMessage(), $err->getCode());
}
 
//Check if db_fields contains a *, if so assume all columns are selected
if (is_string($this->options['db_fields'])
&& strstr($this->options['db_fields'], '*')) {
$sql_from = '*';
} else {
$sql_from = $this->options['final_usernamecol'].
", ".$this->options['final_passwordcol'];
 
if (strlen($fields = $this->_quoteDBFields()) > 0) {
$sql_from .= ', '.$fields;
}
}
 
$query = sprintf("SELECT %s FROM %s WHERE %s = %s",
$sql_from,
$this->options['final_table'],
$this->options['final_usernamecol'],
$this->db->getTextValue($username)
);
 
$res = $this->db->getRow($query, null, null, null, MDB_FETCHMODE_ASSOC);
 
if (MDB::isError($res) || PEAR::isError($res)) {
return PEAR::raiseError($res->getMessage(), $res->getCode());
}
if (!is_array($res)) {
$this->activeUser = '';
return false;
}
 
// Perform trimming here before the hashing
$password = trim($password, "\r\n");
$res[$this->options['passwordcol']] = trim($res[$this->options['passwordcol']], "\r\n");
// If using Challenge Response md5 the pass with the secret
if ($isChallengeResponse) {
$res[$this->options['passwordcol']] =
md5($res[$this->options['passwordcol']].$this->_auth_obj->session['loginchallenege']);
// UGLY cannot avoid without modifying verifyPassword
if ($this->options['cryptType'] == 'md5') {
$res[$this->options['passwordcol']] = md5($res[$this->options['passwordcol']]);
}
}
if ($this->verifyPassword($password,
$res[$this->options['passwordcol']],
$this->options['cryptType'])) {
// Store additional field values in the session
foreach ($res as $key => $value) {
if ($key == $this->options['passwordcol'] ||
$key == $this->options['usernamecol']) {
continue;
}
// Use reference to the auth object if exists
// This is because the auth session variable can change so a static
// call to setAuthData does not make sense
$this->_auth_obj->setAuthData($key, $value);
}
return true;
}
 
$this->activeUser = $res[$this->options['usernamecol']];
return false;
}
 
// }}}
// {{{ listUsers()
 
/**
* Returns a list of users from the container
*
* @return mixed array|PEAR_Error
* @access public
*/
function listUsers()
{
$err = $this->_prepare();
if ($err !== true) {
return PEAR::raiseError($err->getMessage(), $err->getCode());
}
 
$retVal = array();
 
//Check if db_fields contains a *, if so assume all columns are selected
if ( is_string($this->options['db_fields'])
&& strstr($this->options['db_fields'], '*')) {
$sql_from = '*';
} else {
$sql_from = $this->options['final_usernamecol']
.', '.$this->options['final_passwordcol'];
if (strlen($fields = $this->_quoteDBFields()) > 0) {
$sql_from .= ', '.$fields;
}
}
 
$query = sprintf('SELECT %s FROM %s',
$sql_from,
$this->options['final_table']
);
 
$res = $this->db->getAll($query, null, null, null, MDB_FETCHMODE_ASSOC);
 
if (MDB::isError($res)) {
return PEAR::raiseError($res->getMessage(), $res->getCode());
} else {
foreach ($res as $user) {
$user['username'] = $user[$this->options['usernamecol']];
$retVal[] = $user;
}
}
return $retVal;
}
 
// }}}
// {{{ addUser()
 
/**
* Add user to the storage container
*
* @access public
* @param string Username
* @param string Password
* @param mixed Additional information that are stored in the DB
*
* @return mixed True on success, otherwise error object
*/
function addUser($username, $password, $additional = "")
{
$err = $this->_prepare();
if ($err !== true) {
return PEAR::raiseError($err->getMessage(), $err->getCode());
}
 
if (isset($this->options['cryptType']) && $this->options['cryptType'] == 'none') {
$cryptFunction = 'strval';
} elseif (isset($this->options['cryptType']) && function_exists($this->options['cryptType'])) {
$cryptFunction = $this->options['cryptType'];
} else {
$cryptFunction = 'md5';
}
 
$password = $cryptFunction($password);
 
$additional_key = '';
$additional_value = '';
 
if (is_array($additional)) {
foreach ($additional as $key => $value) {
if ($this->options['auto_quote']) {
$additional_key .= ', ' . $this->db->quoteIdentifier($key);
} else {
$additional_key .= ', ' . $key;
}
$additional_value .= ', ' . $this->db->getTextValue($value);
}
}
 
$query = sprintf("INSERT INTO %s (%s, %s%s) VALUES (%s, %s%s)",
$this->options['final_table'],
$this->options['final_usernamecol'],
$this->options['final_passwordcol'],
$additional_key,
$this->db->getTextValue($username),
$this->db->getTextValue($password),
$additional_value
);
 
$res = $this->query($query);
 
if (MDB::isError($res)) {
return PEAR::raiseError($res->getMessage(), $res->code);
}
return true;
}
 
// }}}
// {{{ removeUser()
 
/**
* Remove user from the storage container
*
* @access public
* @param string Username
*
* @return mixed True on success, otherwise error object
*/
function removeUser($username)
{
$err = $this->_prepare();
if ($err !== true) {
return PEAR::raiseError($err->getMessage(), $err->getCode());
}
 
$query = sprintf("DELETE FROM %s WHERE %s = %s",
$this->options['final_table'],
$this->options['final_usernamecol'],
$this->db->getTextValue($username)
);
 
$res = $this->query($query);
 
if (MDB::isError($res)) {
return PEAR::raiseError($res->getMessage(), $res->code);
}
return true;
}
 
// }}}
// {{{ changePassword()
 
/**
* Change password for user in the storage container
*
* @param string Username
* @param string The new password (plain text)
*/
function changePassword($username, $password)
{
$err = $this->_prepare();
if ($err !== true) {
return PEAR::raiseError($err->getMessage(), $err->getCode());
}
 
if (isset($this->options['cryptType']) && $this->options['cryptType'] == 'none') {
$cryptFunction = 'strval';
} elseif (isset($this->options['cryptType']) && function_exists($this->options['cryptType'])) {
$cryptFunction = $this->options['cryptType'];
} else {
$cryptFunction = 'md5';
}
 
$password = $cryptFunction($password);
 
$query = sprintf("UPDATE %s SET %s = %s WHERE %s = %s",
$this->options['final_table'],
$this->options['final_passwordcol'],
$this->db->getTextValue($password),
$this->options['final_usernamecol'],
$this->db->getTextValue($username)
);
 
$res = $this->query($query);
 
if (MDB::isError($res)) {
return PEAR::raiseError($res->getMessage(), $res->code);
}
return true;
}
 
// }}}
// {{{ supportsChallengeResponse()
 
/**
* Determine if this container supports
* password authentication with challenge response
*
* @return bool
* @access public
*/
function supportsChallengeResponse()
{
return in_array($this->options['cryptType'], array('md5', 'none', ''));
}
 
// }}}
// {{{ getCryptType()
 
/**
* Returns the selected crypt type for this container
*
* @return string Function used to crypt the password
*/
function getCryptType()
{
return $this->options['cryptType'];
}
 
// }}}
 
}
?>
/tags/Racine_livraison_narmer/api/pear/Auth/Container/SOAP.php
New file
0,0 → 1,228
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */
 
/**
* Storage driver for use against a SOAP service
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Authentication
* @package Auth
* @author Bruno Pedro <bpedro@co.sapo.pt>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: SOAP.php,v 1.2 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/Auth
* @since File available since Release 1.2.0
*/
 
/**
* Include Auth_Container base class
*/
require_once "Auth/Container.php";
/**
* Include PEAR package for error handling
*/
require_once "PEAR.php";
/**
* Include PEAR SOAP_Client
*/
require_once 'SOAP/Client.php';
 
/**
* Storage driver for fetching login data from SOAP
*
* This class takes one parameter (options), where
* you specify the following fields: endpoint, namespace,
* method, encoding, usernamefield and passwordfield.
*
* You can use specify features of your SOAP service
* by providing its parameters in an associative manner by
* using the '_features' array through the options parameter.
*
* The 'matchpassword' option should be set to false if your
* webservice doesn't return (username,password) pairs, but
* instead returns error when the login is invalid.
*
* Example usage:
*
* <?php
*
* ...
*
* $options = array (
* 'endpoint' => 'http://your.soap.service/endpoint',
* 'namespace' => 'urn:/Your/Namespace',
* 'method' => 'get',
* 'encoding' => 'UTF-8',
* 'usernamefield' => 'login',
* 'passwordfield' => 'password',
* 'matchpasswords' => false,
* '_features' => array (
* 'example_feature' => 'example_value',
* 'another_example' => ''
* )
* );
* $auth = new Auth('SOAP', $options, 'loginFunction');
* $auth->start();
*
* ...
*
* ?>
*
* @category Authentication
* @package Auth
* @author Bruno Pedro <bpedro@co.sapo.pt>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version Release: 1.4.3 File: $Revision: 1.2 $
* @link http://pear.php.net/package/Auth
* @since Class available since Release 1.2.0
*/
class Auth_Container_SOAP extends Auth_Container
{
 
// {{{ properties
 
/**
* Required options for the class
* @var array
* @access private
*/
var $_requiredOptions = array(
'endpoint',
'namespace',
'method',
'encoding',
'usernamefield',
'passwordfield',
);
 
/**
* Options for the class
* @var array
* @access private
*/
var $_options = array();
 
/**
* Optional SOAP features
* @var array
* @access private
*/
var $_features = array();
 
/**
* The SOAP response
* @var array
* @access public
*/
var $soapResponse = array();
 
/**
* The SOAP client
* @var mixed
* @access public
*/
var $soapClient = null;
 
// }}}
// {{{ Auth_Container_SOAP() [constructor]
 
/**
* Constructor of the container class
*
* @param $options, associative array with endpoint, namespace, method,
* usernamefield, passwordfield and optional features
*/
function Auth_Container_SOAP($options)
{
$this->_options = $options;
if (!isset($this->_options['matchpasswords'])) {
$this->_options['matchpasswords'] = true;
}
if (!empty($this->_options['_features'])) {
$this->_features = $this->_options['_features'];
unset($this->_options['_features']);
}
}
 
// }}}
// {{{ fetchData()
 
/**
* Fetch data from SOAP service
*
* Requests the SOAP service for the given username/password
* combination.
*
* @param string Username
* @param string Password
* @return mixed Returns the SOAP response or false if something went wrong
*/
function fetchData($username, $password)
{
// check if all required options are set
if (array_intersect($this->_requiredOptions, array_keys($this->_options)) != $this->_requiredOptions) {
return false;
} else {
// create a SOAP client and set encoding
$this->soapClient = new SOAP_Client($this->_options['endpoint']);
$this->soapClient->setEncoding($this->_options['encoding']);
}
 
// set the trace option if requested
if (isset($this->_options['trace'])) {
$this->soapClient->__options['trace'] = true;
}
 
// set the timeout option if requested
if (isset($this->_options['timeout'])) {
$this->soapClient->__options['timeout'] = $this->_options['timeout'];
}
 
// assign username and password fields
$usernameField = new SOAP_Value($this->_options['usernamefield'],'string', $username);
$passwordField = new SOAP_Value($this->_options['passwordfield'],'string', $password);
$SOAPParams = array($usernameField, $passwordField);
 
// assign optional features
foreach ($this->_features as $fieldName => $fieldValue) {
$SOAPParams[] = new SOAP_Value($fieldName, 'string', $fieldValue);
}
 
// make SOAP call
$this->soapResponse = $this->soapClient->call(
$this->_options['method'],
$SOAPParams,
array('namespace' => $this->_options['namespace'])
);
 
if (!PEAR::isError($this->soapResponse)) {
if ($this->_options['matchpasswords']) {
// check if passwords match
if ($password == $this->soapResponse->{$this->_options['passwordfield']}) {
return true;
} else {
return false;
}
} else {
return true;
}
} else {
return false;
}
}
 
// }}}
 
}
?>
/tags/Racine_livraison_narmer/api/pear/Auth/Container/SMBPasswd.php
New file
0,0 → 1,177
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */
 
/**
* Storage driver for use against Samba password files
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Authentication
* @package Auth
* @author Michael Bretterklieber <michael@bretterklieber.com>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: SMBPasswd.php,v 1.2 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/Auth
* @since File available since Release 1.2.3
*/
 
/**
* Include PEAR File_SMBPasswd
*/
require_once "File/SMBPasswd.php";
/**
* Include Auth_Container Base file
*/
require_once "Auth/Container.php";
/**
* Include PEAR class for error handling
*/
require_once "PEAR.php";
 
/**
* Storage driver for fetching login data from an SAMBA smbpasswd file.
*
* This storage container can handle SAMBA smbpasswd files.
*
* Example:
* $a = new Auth("SMBPasswd", '/usr/local/private/smbpasswd');
* $a->start();
* if ($a->getAuth()) {
* printf ("AUTH OK<br>\n");
* $a->logout();
* }
*
* @category Authentication
* @package Auth
* @author Michael Bretterklieber <michael@bretterklieber.com>
* @author Adam Ashley <aashley@php.net>
* @package Auth
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version Release: 1.4.3 File: $Revision: 1.2 $
* @link http://pear.php.net/package/Auth
* @since Class available since Release 1.2.3
*/
class Auth_Container_SMBPasswd extends Auth_Container
{
 
// {{{ properties
 
/**
* File_SMBPasswd object
* @var object
*/
var $pwfile;
 
// }}}
 
// {{{ Auth_Container_SMBPasswd() [constructor]
 
/**
* Constructor of the container class
*
* @param $filename string filename for a passwd type file
* @return object Returns an error object if something went wrong
*/
function Auth_Container_SMBPasswd($filename)
{
$this->pwfile = new File_SMBPasswd($filename,0);
 
if (!$this->pwfile->load()) {
PEAR::raiseError("Error while reading file contents.", 41, PEAR_ERROR_DIE);
return;
}
 
}
 
// }}}
// {{{ fetchData()
 
/**
* Get user information from pwfile
*
* @param string Username
* @param string Password
* @return boolean
*/
function fetchData($username, $password)
{
return $this->pwfile->verifyAccount($username, $password);
}
 
// }}}
// {{{ listUsers()
function listUsers()
{
return $this->pwfile->getAccounts();
}
 
// }}}
// {{{ addUser()
 
/**
* Add a new user to the storage container
*
* @param string Username
* @param string Password
* @param array Additional information
*
* @return boolean
*/
function addUser($username, $password, $additional = '')
{
$res = $this->pwfile->addUser($user, $additional['userid'], $pass);
if ($res === true) {
return $this->pwfile->save();
}
return $res;
}
 
// }}}
// {{{ removeUser()
 
/**
* Remove user from the storage container
*
* @param string Username
*/
function removeUser($username)
{
$res = $this->pwfile->delUser($username);
if ($res === true) {
return $this->pwfile->save();
}
return $res;
}
 
// }}}
// {{{ changePassword()
 
/**
* Change password for user in the storage container
*
* @param string Username
* @param string The new password
*/
function changePassword($username, $password)
{
$res = $this->pwfile->modUser($username, '', $password);
if ($res === true) {
return $this->pwfile->save();
}
return $res;
}
 
// }}}
 
}
?>
/tags/Racine_livraison_narmer/api/pear/Auth/Container/DBLite.php
New file
0,0 → 1,298
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */
 
/**
* Reduced storage driver for use against PEAR DB
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Authentication
* @package Auth
* @author Martin Jansen <mj@php.net>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: DBLite.php,v 1.1 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/Auth
* @since File available since Release 1.3.0
*/
 
/**
* Include Auth_Container base class
*/
require_once 'Auth/Container.php';
/**
* Include PEAR DB package
*/
require_once 'DB.php';
 
/**
* A lighter storage driver for fetching login data from a database
*
* This driver is derived from the DB storage container but
* with the user manipulation function removed for smaller file size
* by the PEAR DB abstraction layer to fetch login data.
*
* @category Authentication
* @package Auth
* @author Martin Jansen <mj@php.net>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version Release: 1.4.3 File: $Revision: 1.1 $
* @link http://pear.php.net/package/Auth
* @since Class available since Release 1.3.0
*/
class Auth_Container_DBLite extends Auth_Container
{
 
// {{{ properties
 
/**
* Additional options for the storage container
* @var array
*/
var $options = array();
 
/**
* DB object
* @var object
*/
var $db = null;
var $dsn = '';
 
/**
* User that is currently selected from the DB.
* @var string
*/
var $activeUser = '';
 
// }}}
// {{{ Auth_Container_DBLite() [constructor]
 
/**
* Constructor of the container class
*
* Initate connection to the database via PEAR::DB
*
* @param string Connection data or DB object
* @return object Returns an error object if something went wrong
*/
function Auth_Container_DBLite($dsn)
{
$this->options['table'] = 'auth';
$this->options['usernamecol'] = 'username';
$this->options['passwordcol'] = 'password';
$this->options['dsn'] = '';
$this->options['db_fields'] = '';
$this->options['cryptType'] = 'md5';
$this->options['db_options'] = array();
$this->options['auto_quote'] = true;
 
if (is_array($dsn)) {
$this->_parseOptions($dsn);
if (empty($this->options['dsn'])) {
PEAR::raiseError('No connection parameters specified!');
}
} else {
$this->options['dsn'] = $dsn;
}
}
 
// }}}
// {{{ _connect()
 
/**
* Connect to database by using the given DSN string
*
* @access private
* @param string DSN string
* @return mixed Object on error, otherwise bool
*/
function _connect(&$dsn)
{
if (is_string($dsn) || is_array($dsn)) {
$this->db =& DB::connect($dsn, $this->options['db_options']);
} elseif (is_subclass_of($dsn, "db_common")) {
$this->db =& $dsn;
} else {
return PEAR::raiseError("Invalid dsn or db object given");
}
 
if (DB::isError($this->db) || PEAR::isError($this->db)) {
return PEAR::raiseError($this->db->getMessage(), $this->db->getCode());
} else {
return true;
}
}
 
// }}}
// {{{ _prepare()
 
/**
* Prepare database connection
*
* This function checks if we have already opened a connection to
* the database. If that's not the case, a new connection is opened.
*
* @access private
* @return mixed True or a DB error object.
*/
function _prepare()
{
if (!DB::isConnection($this->db)) {
$res = $this->_connect($this->options['dsn']);
if (DB::isError($res) || PEAR::isError($res)) {
return $res;
}
}
if ($this->options['auto_quote'] && $this->db->dsn['phptype'] != 'sqlite') {
$this->options['final_table'] = $this->db->quoteIdentifier($this->options['table']);
$this->options['final_usernamecol'] = $this->db->quoteIdentifier($this->options['usernamecol']);
$this->options['final_passwordcol'] = $this->db->quoteIdentifier($this->options['passwordcol']);
} else {
$this->options['final_table'] = $this->options['table'];
$this->options['final_usernamecol'] = $this->options['usernamecol'];
$this->options['final_passwordcol'] = $this->options['passwordcol'];
}
return true;
}
 
// }}}
// {{{ _parseOptions()
 
/**
* Parse options passed to the container class
*
* @access private
* @param array
*/
function _parseOptions($array)
{
foreach ($array as $key => $value) {
if (isset($this->options[$key])) {
$this->options[$key] = $value;
}
}
}
 
// }}}
// {{{ _quoteDBFields()
 
/**
* Quote the db_fields option to avoid the possibility of SQL injection.
*
* @access private
* @return string A properly quoted string that can be concatenated into a
* SELECT clause.
*/
function _quoteDBFields()
{
if (isset($this->options['db_fields'])) {
if (is_array($this->options['db_fields'])) {
if ($this->options['auto_quote']) {
$fields = array();
foreach ($this->options['db_fields'] as $field) {
$fields[] = $this->db->quoteIdentifier($field);
}
return implode(', ', $fields);
} else {
return implode(', ', $this->options['db_fields']);
}
} else {
if (strlen($this->options['db_fields']) > 0) {
if ($this->options['auto_quote']) {
return $this->db->quoteIdentifier($this->options['db_fields']);
} else {
$this->options['db_fields'];
}
}
}
}
 
return '';
}
// }}}
// {{{ fetchData()
 
/**
* Get user information from database
*
* This function uses the given username to fetch
* the corresponding login data from the database
* table. If an account that matches the passed username
* and password is found, the function returns true.
* Otherwise it returns false.
*
* @param string Username
* @param string Password
* @return mixed Error object or boolean
*/
function fetchData($username, $password)
{
// Prepare for a database query
$err = $this->_prepare();
if ($err !== true) {
return PEAR::raiseError($err->getMessage(), $err->getCode());
}
 
// Find if db_fields contains a *, if so assume all col are selected
if (is_string($this->options['db_fields'])
&& strstr($this->options['db_fields'], '*')) {
$sql_from = "*";
} else {
$sql_from = $this->options['final_usernamecol'].
", ".$this->options['final_passwordcol'];
 
if (strlen($fields = $this->_quoteDBFields()) > 0) {
$sql_from .= ', '.$fields;
}
}
$query = "SELECT ".$sql_from.
" FROM ".$this->options['final_table'].
" WHERE ".$this->options['final_usernamecol']." = ".$this->db->quoteSmart($username);
$res = $this->db->getRow($query, null, DB_FETCHMODE_ASSOC);
 
if (DB::isError($res)) {
return PEAR::raiseError($res->getMessage(), $res->getCode());
}
if (!is_array($res)) {
$this->activeUser = '';
return false;
}
if ($this->verifyPassword(trim($password, "\r\n"),
trim($res[$this->options['passwordcol']], "\r\n"),
$this->options['cryptType'])) {
// Store additional field values in the session
foreach ($res as $key => $value) {
if ($key == $this->options['passwordcol'] ||
$key == $this->options['usernamecol']) {
continue;
}
// Use reference to the auth object if exists
// This is because the auth session variable can change so a static call to setAuthData does not make sence
if (is_object($this->_auth_obj)) {
$this->_auth_obj->setAuthData($key, $value);
} else {
Auth::setAuthData($key, $value);
}
}
$this->activeUser = $res[$this->options['usernamecol']];
return true;
}
$this->activeUser = $res[$this->options['usernamecol']];
return false;
}
 
// }}}
 
}
?>
/tags/Racine_livraison_narmer/api/pear/Auth/Container/Array.php
New file
0,0 → 1,159
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */
 
/**
* Storage driver for use against a PHP Array
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Authentication
* @package Auth
* @author georg_1 at have2 dot com
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: Array.php,v 1.1 2006-12-14 15:04:28 jp_milcent Exp $
* @since File available since Release 1.4.0
*/
 
/**
* Include Auth_Container base class
*/
require_once "Auth/Container.php";
/**
* Include PEAR package for error handling
*/
require_once "PEAR.php";
 
/**
* Storage driver for fetching authentication data from a PHP Array
*
* This container takes two options when configuring:
*
* cryptType: The crypt used to store the password. Currently recognised
* are: none, md5 and crypt. default: none
* users: A named array of usernames and passwords.
* Ex:
* array(
* 'guest' => '084e0343a0486ff05530df6c705c8bb4', // password guest
* 'georg' => 'fc77dba827fcc88e0243404572c51325' // password georg
* )
*
* Usage Example:
* <?php
* $AuthOptions = array(
* 'users' => array(
* 'guest' => '084e0343a0486ff05530df6c705c8bb4', // password guest
* 'georg' => 'fc77dba827fcc88e0243404572c51325' // password georg
* ),
* 'cryptType'=>'md5',
* );
*
* $auth = new Auth("Array", $AuthOptions);
* ?>
*
* @category Authentication
* @package Auth
* @author georg_1 at have2 dot com
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version Release: 1.4.3 File: $Revision: 1.1 $
* @since File available since Release 1.4.0
*/
 
class Auth_Container_Array extends Auth_Container {
 
// {{{ properties
 
/**
* The users and their password to authenticate against
*
* @var array $users
*/
var $users;
 
/**
* The cryptType used on the passwords
*
* @var string $cryptType
*/
var $cryptType = 'none';
 
// }}}
// {{{ Auth_Container_Array()
 
/**
* Constructor for Array Container
*
* @param array $data Options for the container
* @return void
*/
function Auth_Container_Array($data)
{
if (!is_array($data)) {
PEAR::raiseError('The options for Auth_Container_Array must be an array');
}
if (isset($data['users']) && is_array($data['users'])) {
$this->users = $data['users'];
} else {
$this->users = array();
PEAR::raiseError('Auth_Container_Array: no user data found inoptions array');
}
if (isset($data['cryptType'])) {
$this->cryptType = $data['cryptType'];
}
}
 
// }}}
// {{{ fetchData()
 
/**
* Get user information from array
*
* This function uses the given username to fetch the corresponding
* login data from the array. If an account that matches the passed
* username and password is found, the function returns true.
* Otherwise it returns false.
*
* @param string Username
* @param string Password
* @return boolean|PEAR_Error Error object or boolean
*/
function fetchData($user, $pass)
{
if ( isset($this->users[$user])
&& $this->verifyPassword($pass, $this->users[$user], $this->cryptType)) {
return true;
}
return false;
}
 
// }}}
// {{{ listUsers()
 
/**
* Returns a list of users available within the container
*
* @return array
*/
function listUsers()
{
$ret = array();
foreach ($this->users as $username => $password) {
$ret[]['username'] = $username;
}
return $ret;
}
 
// }}}
 
}
 
?>
/tags/Racine_livraison_narmer/api/pear/Auth/Container/File.php
New file
0,0 → 1,305
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */
 
/**
* Storage driver for use against a generic password file
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Authentication
* @package Auth
* @author Stefan Ekman <stekman@sedata.org>
* @author Martin Jansen <mj@php.net>
* @author Mika Tuupola <tuupola@appelsiini.net>
* @author Michael Wallner <mike@php.net>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: File.php,v 1.2 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/Auth
*/
 
/**
* Include PEAR File_Passwd package
*/
require_once "File/Passwd.php";
/**
* Include Auth_Container base class
*/
require_once "Auth/Container.php";
/**
* Include PEAR package for error handling
*/
require_once "PEAR.php";
 
/**
* Storage driver for fetching login data from an encrypted password file.
*
* This storage container can handle CVS pserver style passwd files.
*
* @category Authentication
* @package Auth
* @author Stefan Ekman <stekman@sedata.org>
* @author Martin Jansen <mj@php.net>
* @author Mika Tuupola <tuupola@appelsiini.net>
* @author Michael Wallner <mike@php.net>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version Release: 1.4.3 File: $Revision: 1.2 $
* @link http://pear.php.net/package/Auth
*/
class Auth_Container_File extends Auth_Container
{
 
// {{{ properties
 
/**
* Path to passwd file
*
* @var string
*/
var $pwfile = '';
 
/**
* Options for container
*
* @var array
*/
var $options = array();
 
// }}}
// {{{ Auth_Container_File() [constructor]
 
/**
* Constructor of the container class
*
* @param string $filename path to passwd file
* @return object Auth_Container_File new Auth_Container_File object
*/
function Auth_Container_File($filename) {
$this->_setDefaults();
// Only file is a valid option here
if(is_array($filename)) {
$this->pwfile = $filename['file'];
$this->_parseOptions($filename);
} else {
$this->pwfile = $filename;
}
}
 
// }}}
// {{{ fetchData()
 
/**
* Authenticate an user
*
* @param string username
* @param string password
* @return mixed boolean|PEAR_Error
*/
function fetchData($user, $pass)
{
return File_Passwd::staticAuth($this->options['type'], $this->pwfile, $user, $pass);
}
 
// }}}
// {{{ listUsers()
/**
* List all available users
*
* @return array
*/
function listUsers()
{
$pw_obj = &$this->_load();
if (PEAR::isError($pw_obj)) {
return array();
}
 
$users = $pw_obj->listUser();
if (!is_array($users)) {
return array();
}
 
foreach ($users as $key => $value) {
$retVal[] = array("username" => $key,
"password" => $value['passwd'],
"cvsuser" => $value['system']);
}
 
return $retVal;
}
 
// }}}
// {{{ addUser()
 
/**
* Add a new user to the storage container
*
* @param string username
* @param string password
* @param mixed Additional parameters to File_Password_*::addUser()
*
* @return boolean
*/
function addUser($user, $pass, $additional='')
{
$params = array($user, $pass);
if (is_array($additional)) {
foreach ($additional as $item) {
$params[] = $item;
}
} else {
$params[] = $additional;
}
 
$pw_obj = &$this->_load();
if (PEAR::isError($pw_obj)) {
return false;
}
$res = call_user_func_array(array(&$pw_obj, 'addUser'), $params);
if (PEAR::isError($res)) {
return false;
}
$res = $pw_obj->save();
if (PEAR::isError($res)) {
return false;
}
return true;
}
 
// }}}
// {{{ removeUser()
 
/**
* Remove user from the storage container
*
* @param string Username
* @return boolean
*/
function removeUser($user)
{
$pw_obj = &$this->_load();
if (PEAR::isError($pw_obj)) {
return false;
}
$res = $pw_obj->delUser($user);
if (PEAR::isError($res)) {
return false;
}
$res = $pw_obj->save();
if (PEAR::isError($res)) {
return false;
}
return true;
}
 
// }}}
// {{{ changePassword()
 
/**
* Change password for user in the storage container
*
* @param string Username
* @param string The new password
*/
function changePassword($username, $password)
{
$pw_obj = &$this->_load();
if (PEAR::isError($pw_obj)) {
return false;
}
$res = $pw_obj->changePasswd($username, $password);
if (PEAR::isError($res)) {
return false;
}
$res = $pw_obj->save();
if (PEAR::isError($res)) {
return false;
}
return true;
}
 
// }}}
// {{{ _load()
/**
* Load and initialize the File_Passwd object
*
* @return object File_Passwd_Cvs|PEAR_Error
*/
function &_load()
{
static $pw_obj;
if (!isset($pw_obj)) {
$pw_obj = File_Passwd::factory($this->options['type']);
if (PEAR::isError($pw_obj)) {
return $pw_obj;
}
$pw_obj->setFile($this->pwfile);
$res = $pw_obj->load();
if (PEAR::isError($res)) {
return $res;
}
}
return $pw_obj;
}
 
// }}}
// {{{ _setDefaults()
 
/**
* Set some default options
*
* @access private
* @return void
*/
function _setDefaults()
{
$this->options['type'] = 'Cvs';
}
 
// }}}
// {{{ _parseOptions()
 
/**
* Parse options passed to the container class
*
* @access private
* @param array
*/
function _parseOptions($array)
{
foreach ($array as $key => $value) {
if (isset($this->options[$key])) {
$this->options[$key] = $value;
}
}
}
 
// }}}
 
}
?>
/tags/Racine_livraison_narmer/api/pear/Auth/Container/LDAP.php
New file
0,0 → 1,773
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */
 
/**
* Storage driver for use against an LDAP server
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Authentication
* @package Auth
* @author Jan Wagner <wagner@netsols.de>
* @author Adam Ashley <aashley@php.net>
* @author Hugues Peeters <hugues.peeters@claroline.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: LDAP.php,v 1.2 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/Auth
*/
 
/**
* Include Auth_Container base class
*/
require_once "Auth/Container.php";
/**
* Include PEAR package for error handling
*/
require_once "PEAR.php";
 
/**
* Storage driver for fetching login data from LDAP
*
* This class is heavily based on the DB and File containers. By default it
* connects to localhost:389 and searches for uid=$username with the scope
* "sub". If no search base is specified, it will try to determine it via
* the namingContexts attribute. It takes its parameters in a hash, connects
* to the ldap server, binds anonymously, searches for the user, and tries
* to bind as the user with the supplied password. When a group was set, it
* will look for group membership of the authenticated user. If all goes
* well the authentication was successful.
*
* Parameters:
*
* host: localhost (default), ldap.netsols.de or 127.0.0.1
* port: 389 (default) or 636 or whereever your server runs
* url: ldap://localhost:389/
* useful for ldaps://, works only with openldap2 ?
* it will be preferred over host and port
* version: LDAP version to use, ususally 2 (default) or 3,
* must be an integer!
* referrals: If set, determines whether the LDAP library automatically
* follows referrals returned by LDAP servers or not. Possible
* values are true (default) or false.
* binddn: If set, searching for user will be done after binding
* as this user, if not set the bind will be anonymous.
* This is reported to make the container work with MS
* Active Directory, but should work with any server that
* is configured this way.
* This has to be a complete dn for now (basedn and
* userdn will not be appended).
* bindpw: The password to use for binding with binddn
* basedn: the base dn of your server
* userdn: gets prepended to basedn when searching for user
* userscope: Scope for user searching: one, sub (default), or base
* userattr: the user attribute to search for (default: uid)
* userfilter: filter that will be added to the search filter
* this way: (&(userattr=username)(userfilter))
* default: (objectClass=posixAccount)
* attributes: array of additional attributes to fetch from entry.
* these will added to auth data and can be retrieved via
* Auth::getAuthData(). An empty array will fetch all attributes,
* array('') will fetch no attributes at all (default)
* If you add 'dn' as a value to this array, the users DN that was
* used for binding will be added to auth data as well.
* attrformat: The returned format of the additional data defined in the
* 'attributes' option. Two formats are available.
* LDAP returns data formatted in a
* multidimensional array where each array starts with a
* 'count' element providing the number of attributes in the
* entry, or the number of values for attributes. When set
* to this format, the only way to retrieve data from the
* Auth object is by calling getAuthData('attributes').
* AUTH returns data formatted in a
* structure more compliant with other Auth Containers,
* where each attribute element can be directly called by
* getAuthData() method from Auth.
* For compatibily with previous LDAP container versions,
* the default format is LDAP.
* groupdn: gets prepended to basedn when searching for group
* groupattr: the group attribute to search for (default: cn)
* groupfilter: filter that will be added to the search filter when
* searching for a group:
* (&(groupattr=group)(memberattr=username)(groupfilter))
* default: (objectClass=groupOfUniqueNames)
* memberattr : the attribute of the group object where the user dn
* may be found (default: uniqueMember)
* memberisdn: whether the memberattr is the dn of the user (default)
* or the value of userattr (usually uid)
* group: the name of group to search for
* groupscope: Scope for group searching: one, sub (default), or base
* start_tls: enable/disable the use of START_TLS encrypted connection
* (default: false)
* debug: Enable/Disable debugging output (default: false)
* try_all: Whether to try all user accounts returned from the search
* or just the first one. (default: false)
*
* To use this storage container, you have to use the following syntax:
*
* <?php
* ...
*
* $a1 = new Auth("LDAP", array(
* 'host' => 'localhost',
* 'port' => '389',
* 'version' => 3,
* 'basedn' => 'o=netsols,c=de',
* 'userattr' => 'uid'
* 'binddn' => 'cn=admin,o=netsols,c=de',
* 'bindpw' => 'password'));
*
* $a2 = new Auth('LDAP', array(
* 'url' => 'ldaps://ldap.netsols.de',
* 'basedn' => 'o=netsols,c=de',
* 'userscope' => 'one',
* 'userdn' => 'ou=People',
* 'groupdn' => 'ou=Groups',
* 'groupfilter' => '(objectClass=posixGroup)',
* 'memberattr' => 'memberUid',
* 'memberisdn' => false,
* 'group' => 'admin'
* ));
*
* $a3 = new Auth('LDAP', array(
* 'host' => 'ldap.netsols.de',
* 'port' => 389,
* 'version' => 3,
* 'referrals' => false,
* 'basedn' => 'dc=netsols,dc=de',
* 'binddn' => 'cn=Jan Wagner,cn=Users,dc=netsols,dc=de',
* 'bindpw' => 'password',
* 'userattr' => 'samAccountName',
* 'userfilter' => '(objectClass=user)',
* 'attributes' => array(''),
* 'group' => 'testing',
* 'groupattr' => 'samAccountName',
* 'groupfilter' => '(objectClass=group)',
* 'memberattr' => 'member',
* 'memberisdn' => true,
* 'groupdn' => 'cn=Users',
* 'groupscope' => 'one',
* 'debug' => true);
*
* The parameter values have to correspond
* to the ones for your LDAP server of course.
*
* When talking to a Microsoft ActiveDirectory server you have to
* use 'samaccountname' as the 'userattr' and follow special rules
* to translate the ActiveDirectory directory names into 'basedn'.
* The 'basedn' for the default 'Users' folder on an ActiveDirectory
* server for the ActiveDirectory Domain (which is not related to
* its DNS name) "win2000.example.org" would be:
* "CN=Users, DC=win2000, DC=example, DC=org'
* where every component of the domain name becomes a DC attribute
* of its own. If you want to use a custom users folder you have to
* replace "CN=Users" with a sequence of "OU" attributes that specify
* the path to your custom folder in reverse order.
* So the ActiveDirectory folder
* "win2000.example.org\Custom\Accounts"
* would become
* "OU=Accounts, OU=Custom, DC=win2000, DC=example, DC=org'
*
* It seems that binding anonymously to an Active Directory
* is not allowed, so you have to set binddn and bindpw for
* user searching.
*
* LDAP Referrals need to be set to false for AD to work sometimes.
*
* Example a3 shows a full blown and tested example for connection to
* Windows 2000 Active Directory with group mebership checking
*
* Note also that if you want an encrypted connection to an MS LDAP
* server, then, on your webserver, you must specify
* TLS_REQCERT never
* in /etc/ldap/ldap.conf or in the webserver user's ~/.ldaprc (which
* may or may not be read depending on your configuration).
*
*
* @category Authentication
* @package Auth
* @author Jan Wagner <wagner@netsols.de>
* @author Adam Ashley <aashley@php.net>
* @author Hugues Peeters <hugues.peeters@claroline.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version Release: 1.4.3 File: $Revision: 1.2 $
* @link http://pear.php.net/package/Auth
*/
class Auth_Container_LDAP extends Auth_Container
{
 
// {{{ properties
 
/**
* Options for the class
* @var array
*/
var $options = array();
 
/**
* Connection ID of LDAP Link
* @var string
*/
var $conn_id = false;
 
// }}}
 
// {{{ Auth_Container_LDAP() [constructor]
 
/**
* Constructor of the container class
*
* @param $params, associative hash with host,port,basedn and userattr key
* @return object Returns an error object if something went wrong
*/
function Auth_Container_LDAP($params)
{
if (false === extension_loaded('ldap')) {
return PEAR::raiseError('Auth_Container_LDAP: LDAP Extension not loaded',
41, PEAR_ERROR_DIE);
}
 
$this->_setDefaults();
 
if (is_array($params)) {
$this->_parseOptions($params);
}
}
 
// }}}
// {{{ _prepare()
 
/**
* Prepare LDAP connection
*
* This function checks if we have already opened a connection to
* the LDAP server. If that's not the case, a new connection is opened.
*
* @access private
* @return mixed True or a PEAR error object.
*/
function _prepare()
{
if (!$this->_isValidLink()) {
$res = $this->_connect();
if (PEAR::isError($res)) {
return $res;
}
}
return true;
}
 
// }}}
// {{{ _connect()
 
/**
* Connect to the LDAP server using the global options
*
* @access private
* @return object Returns a PEAR error object if an error occurs.
*/
function _connect()
{
// connect
if (isset($this->options['url']) && $this->options['url'] != '') {
$this->_debug('Connecting with URL', __LINE__);
$conn_params = array($this->options['url']);
} else {
$this->_debug('Connecting with host:port', __LINE__);
$conn_params = array($this->options['host'], $this->options['port']);
}
 
if (($this->conn_id = @call_user_func_array('ldap_connect', $conn_params)) === false) {
return PEAR::raiseError('Auth_Container_LDAP: Could not connect to server.', 41);
}
$this->_debug('Successfully connected to server', __LINE__);
 
// switch LDAP version
if (is_numeric($this->options['version']) && $this->options['version'] > 2) {
$this->_debug("Switching to LDAP version {$this->options['version']}", __LINE__);
@ldap_set_option($this->conn_id, LDAP_OPT_PROTOCOL_VERSION, $this->options['version']);
// start TLS if available
if (isset($this->options['start_tls']) && $this->options['start_tls']) {
$this->_debug("Starting TLS session", __LINE__);
if (@ldap_start_tls($this->conn_id) === false) {
return PEAR::raiseError('Auth_Container_LDAP: Could not start tls.', 41);
}
}
}
 
// switch LDAP referrals
if (is_bool($this->options['referrals'])) {
$this->_debug("Switching LDAP referrals to " . (($this->options['referrals']) ? 'true' : 'false'), __LINE__);
@ldap_set_option($this->conn_id, LDAP_OPT_REFERRALS, $this->options['referrals']);
}
 
// bind with credentials or anonymously
if (strlen($this->options['binddn']) && strlen($this->options['bindpw'])) {
$this->_debug('Binding with credentials', __LINE__);
$bind_params = array($this->conn_id, $this->options['binddn'], $this->options['bindpw']);
} else {
$this->_debug('Binding anonymously', __LINE__);
$bind_params = array($this->conn_id);
}
 
// bind for searching
if ((@call_user_func_array('ldap_bind', $bind_params)) === false) {
$this->_debug();
$this->_disconnect();
return PEAR::raiseError("Auth_Container_LDAP: Could not bind to LDAP server.", 41);
}
$this->_debug('Binding was successful', __LINE__);
 
return true;
}
 
// }}}
// {{{ _disconnect()
 
/**
* Disconnects (unbinds) from ldap server
*
* @access private
*/
function _disconnect()
{
if ($this->_isValidLink()) {
$this->_debug('disconnecting from server');
@ldap_unbind($this->conn_id);
}
}
 
// }}}
// {{{ _getBaseDN()
 
/**
* Tries to find Basedn via namingContext Attribute
*
* @access private
*/
function _getBaseDN()
{
$err = $this->_prepare();
if ($err !== true) {
return PEAR::raiseError($err->getMessage(), $err->getCode());
}
 
if ($this->options['basedn'] == "" && $this->_isValidLink()) {
$this->_debug("basedn not set, searching via namingContexts.", __LINE__);
 
$result_id = @ldap_read($this->conn_id, "", "(objectclass=*)", array("namingContexts"));
 
if (@ldap_count_entries($this->conn_id, $result_id) == 1) {
 
$this->_debug("got result for namingContexts", __LINE__);
 
$entry_id = @ldap_first_entry($this->conn_id, $result_id);
$attrs = @ldap_get_attributes($this->conn_id, $entry_id);
$basedn = $attrs['namingContexts'][0];
 
if ($basedn != "") {
$this->_debug("result for namingContexts was $basedn", __LINE__);
$this->options['basedn'] = $basedn;
}
}
@ldap_free_result($result_id);
}
 
// if base ist still not set, raise error
if ($this->options['basedn'] == "") {
return PEAR::raiseError("Auth_Container_LDAP: LDAP search base not specified!", 41);
}
return true;
}
 
// }}}
// {{{ _isValidLink()
 
/**
* determines whether there is a valid ldap conenction or not
*
* @accessd private
* @return boolean
*/
function _isValidLink()
{
if (is_resource($this->conn_id)) {
if (get_resource_type($this->conn_id) == 'ldap link') {
return true;
}
}
return false;
}
 
// }}}
// {{{ _setDefaults()
 
/**
* Set some default options
*
* @access private
*/
function _setDefaults()
{
$this->options['url'] = '';
$this->options['host'] = 'localhost';
$this->options['port'] = '389';
$this->options['version'] = 2;
$this->options['referrals'] = true;
$this->options['binddn'] = '';
$this->options['bindpw'] = '';
$this->options['basedn'] = '';
$this->options['userdn'] = '';
$this->options['userscope'] = 'sub';
$this->options['userattr'] = 'uid';
$this->options['userfilter'] = '(objectClass=posixAccount)';
$this->options['attributes'] = array(''); // no attributes
// $this->options['attrformat'] = 'LDAP'; // returns attribute array as PHP LDAP functions return it
$this->options['attrformat'] = 'AUTH'; // returns attribute like other Auth containers
$this->options['group'] = '';
$this->options['groupdn'] = '';
$this->options['groupscope'] = 'sub';
$this->options['groupattr'] = 'cn';
$this->options['groupfilter'] = '(objectClass=groupOfUniqueNames)';
$this->options['memberattr'] = 'uniqueMember';
$this->options['memberisdn'] = true;
$this->options['start_tls'] = false;
$this->options['debug'] = false;
$this->options['try_all'] = false; // Try all user ids returned not just the first one
}
 
// }}}
// {{{ _parseOptions()
 
/**
* Parse options passed to the container class
*
* @access private
* @param array
*/
function _parseOptions($array)
{
$array = $this->_setV12OptionsToV13($array);
 
foreach ($array as $key => $value) {
if (array_key_exists($key, $this->options)) {
if ($key == 'attributes') {
if (is_array($value)) {
$this->options[$key] = $value;
} else {
$this->options[$key] = explode(',', $value);
}
} else {
$this->options[$key] = $value;
}
}
}
}
 
// }}}
// {{{ _setV12OptionsToV13()
 
/**
* Adapt deprecated options from Auth 1.2 LDAP to Auth 1.3 LDAP
*
* @author Hugues Peeters <hugues.peeters@claroline.net>
* @access private
* @param array
* @return array
*/
function _setV12OptionsToV13($array)
{
if (isset($array['useroc']))
$array['userfilter'] = "(objectClass=".$array['useroc'].")";
if (isset($array['groupoc']))
$array['groupfilter'] = "(objectClass=".$array['groupoc'].")";
if (isset($array['scope']))
$array['userscope'] = $array['scope'];
 
return $array;
}
 
// }}}
// {{{ _scope2function()
 
/**
* Get search function for scope
*
* @param string scope
* @return string ldap search function
*/
function _scope2function($scope)
{
switch($scope) {
case 'one':
$function = 'ldap_list';
break;
case 'base':
$function = 'ldap_read';
break;
default:
$function = 'ldap_search';
break;
}
return $function;
}
 
// }}}
// {{{ fetchData()
 
/**
* Fetch data from LDAP server
*
* Searches the LDAP server for the given username/password
* combination. Escapes all LDAP meta characters in username
* before performing the query.
*
* @param string Username
* @param string Password
* @return boolean
*/
function fetchData($username, $password)
{
$err = $this->_prepare();
if ($err !== true) {
return PEAR::raiseError($err->getMessage(), $err->getCode());
}
 
$err = $this->_getBaseDN();
if ($err !== true) {
return PEAR::raiseError($err->getMessage(), $err->getCode());
}
 
// UTF8 Encode username for LDAPv3
if (@ldap_get_option($this->conn_id, LDAP_OPT_PROTOCOL_VERSION, $ver) && $ver == 3) {
$this->_debug('UTF8 encoding username for LDAPv3', __LINE__);
$username = utf8_encode($username);
}
 
// make search filter
$filter = sprintf('(&(%s=%s)%s)',
$this->options['userattr'],
$this->_quoteFilterString($username),
$this->options['userfilter']);
 
// make search base dn
$search_basedn = $this->options['userdn'];
if ($search_basedn != '' && substr($search_basedn, -1) != ',') {
$search_basedn .= ',';
}
$search_basedn .= $this->options['basedn'];
 
// attributes
$attributes = $this->options['attributes'];
 
// make functions params array
$func_params = array($this->conn_id, $search_basedn, $filter, $attributes);
 
// search function to use
$func_name = $this->_scope2function($this->options['userscope']);
 
$this->_debug("Searching with $func_name and filter $filter in $search_basedn", __LINE__);
 
// search
if (($result_id = @call_user_func_array($func_name, $func_params)) === false) {
$this->_debug('User not found', __LINE__);
} elseif (@ldap_count_entries($this->conn_id, $result_id) >= 1) { // did we get some possible results?
 
$this->_debug('User(s) found', __LINE__);
 
$first = true;
$entry_id = null;
 
do {
// then get the user dn
if ($first) {
$entry_id = @ldap_first_entry($this->conn_id, $result_id);
$first = false;
} else {
$entry_id = @ldap_next_entry($this->conn_id, $entry_id);
if ($entry_id === false)
break;
}
$user_dn = @ldap_get_dn($this->conn_id, $entry_id);
 
// as the dn is not fetched as an attribute, we save it anyway
if (is_array($attributes) && in_array('dn', $attributes)) {
$this->_debug('Saving DN to AuthData', __LINE__);
$this->_auth_obj->setAuthData('dn', $user_dn);
}
// fetch attributes
if ($attributes = @ldap_get_attributes($this->conn_id, $entry_id)) {
 
if (is_array($attributes) && isset($attributes['count']) &&
$attributes['count'] > 0) {
 
// ldap_get_attributes() returns a specific multi dimensional array
// format containing all the attributes and where each array starts
// with a 'count' element providing the number of attributes in the
// entry, or the number of values for attribute. For compatibility
// reasons, it remains the default format returned by LDAP container
// setAuthData().
// The code below optionally returns attributes in another format,
// more compliant with other Auth containers, where each attribute
// element are directly set in the 'authData' list. This option is
// enabled by setting 'attrformat' to
// 'AUTH' in the 'options' array.
// eg. $this->options['attrformat'] = 'AUTH'
 
if ( strtoupper($this->options['attrformat']) == 'AUTH' ) {
$this->_debug('Saving attributes to Auth data in AUTH format', __LINE__);
unset ($attributes['count']);
foreach ($attributes as $attributeName => $attributeValue ) {
if (is_int($attributeName)) continue;
if (is_array($attributeValue) && isset($attributeValue['count'])) {
unset ($attributeValue['count']);
}
if (count($attributeValue)<=1) $attributeValue = $attributeValue[0];
$this->_auth_obj->setAuthData($attributeName, $attributeValue);
}
}
else
{
$this->_debug('Saving attributes to Auth data in LDAP format', __LINE__);
$this->_auth_obj->setAuthData('attributes', $attributes);
}
}
}
@ldap_free_result($result_id);
 
// need to catch an empty password as openldap seems to return TRUE
// if anonymous binding is allowed
if ($password != "") {
$this->_debug("Bind as $user_dn", __LINE__);
 
// try binding as this user with the supplied password
if (@ldap_bind($this->conn_id, $user_dn, $password)) {
$this->_debug('Bind successful', __LINE__);
 
// check group if appropiate
if (strlen($this->options['group'])) {
// decide whether memberattr value is a dn or the username
$this->_debug('Checking group membership', __LINE__);
$return = $this->checkGroup(($this->options['memberisdn']) ? $user_dn : $username);
$this->_disconnect();
return $return;
} else {
$this->_debug('Authenticated', __LINE__);
$this->_disconnect();
return true; // user authenticated
} // checkGroup
} // bind
} // non-empty password
} while ($this->options['try_all'] == true); // interate through entries
} // get results
// default
$this->_debug('NOT authenticated!', __LINE__);
$this->_disconnect();
return false;
}
 
// }}}
// {{{ checkGroup()
 
/**
* Validate group membership
*
* Searches the LDAP server for group membership of the
* supplied username. Quotes all LDAP filter meta characters in
* the user name before querying the LDAP server.
*
* @param string Distinguished Name of the authenticated User
* @return boolean
*/
function checkGroup($user)
{
$err = $this->_prepare();
if ($err !== true) {
return PEAR::raiseError($err->getMessage(), $err->getCode());
}
 
// make filter
$filter = sprintf('(&(%s=%s)(%s=%s)%s)',
$this->options['groupattr'],
$this->options['group'],
$this->options['memberattr'],
$this->_quoteFilterString($user),
$this->options['groupfilter']);
 
// make search base dn
$search_basedn = $this->options['groupdn'];
if ($search_basedn != '' && substr($search_basedn, -1) != ',') {
$search_basedn .= ',';
}
$search_basedn .= $this->options['basedn'];
 
$func_params = array($this->conn_id, $search_basedn, $filter,
array($this->options['memberattr']));
$func_name = $this->_scope2function($this->options['groupscope']);
 
$this->_debug("Searching with $func_name and filter $filter in $search_basedn", __LINE__);
 
// search
if (($result_id = @call_user_func_array($func_name, $func_params)) != false) {
if (@ldap_count_entries($this->conn_id, $result_id) == 1) {
@ldap_free_result($result_id);
$this->_debug('User is member of group', __LINE__);
return true;
}
}
// default
$this->_debug('User is NOT member of group', __LINE__);
return false;
}
 
// }}}
// {{{ _debug()
 
/**
* Outputs debugging messages
*
* @access private
* @param string Debugging Message
* @param integer Line number
*/
function _debug($msg = '', $line = 0)
{
if ($this->options['debug'] == true) {
if ($msg == '' && $this->_isValidLink()) {
$msg = 'LDAP_Error: ' . @ldap_err2str(@ldap_errno($this->_conn_id));
}
print("$line: $msg <br />");
}
}
 
// }}}
// {{{ _quoteFilterString()
 
/**
* Escapes LDAP filter special characters as defined in RFC 2254.
*
* @access private
* @param string Filter String
*/
function _quoteFilterString($filter_str)
{
$metas = array( '\\', '*', '(', ')', "\x00");
$quoted_metas = array('\\\\', '\*', '\(', '\)', "\\\x00");
return str_replace($metas, $quoted_metas, $filter_str);
}
 
// }}}
 
}
 
?>
/tags/Racine_livraison_narmer/api/pear/Auth/Container/POP3.php
New file
0,0 → 1,143
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */
 
/**
* Storage driver for use against a POP3 server
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Authentication
* @package Auth
* @author Stefan Ekman <stekman@sedata.org>
* @author Martin Jansen <mj@php.net>
* @author Mika Tuupola <tuupola@appelsiini.net>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: POP3.php,v 1.2 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/Auth
* @since File available since Release 1.2.0
*/
 
/**
* Include Auth_Container base class
*/
require_once 'Auth/Container.php';
/**
* Include PEAR package for error handling
*/
require_once 'PEAR.php';
/**
* Include PEAR Net_POP3 package
*/
require_once 'Net/POP3.php';
 
/**
* Storage driver for Authentication on a POP3 server.
*
* @category Authentication
* @package Auth
* @author Martin Jansen <mj@php.net>
* @author Mika Tuupola <tuupola@appelsiini.net>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version Release: 1.4.3 File: $Revision: 1.2 $
* @link http://pear.php.net/package/Auth
* @since Class available since Release 1.2.0
*/
class Auth_Container_POP3 extends Auth_Container
{
 
// {{{ properties
 
/**
* POP3 Server
* @var string
*/
var $server='localhost';
 
/**
* POP3 Server port
* @var string
*/
var $port='110';
 
/**
* POP3 Authentication method
*
* Prefered POP3 authentication method. Acceptable values:
* Boolean TRUE - Use Net_POP3's autodetection
* String 'DIGEST-MD5','CRAM-MD5','LOGIN','PLAIN','APOP','USER'
* - Attempt this authentication style first
* then fallback to autodetection.
* @var mixed
*/
var $method=true;
 
// }}}
// {{{ Auth_Container_POP3() [constructor]
 
/**
* Constructor of the container class
*
* @param $server string server or server:port combination
* @return object Returns an error object if something went wrong
*/
function Auth_Container_POP3($server=null)
{
if (isset($server) && !is_null($server)) {
if (is_array($server)) {
if (isset($server['host'])) {
$this->server = $server['host'];
}
if (isset($server['port'])) {
$this->port = $server['port'];
}
if (isset($server['method'])) {
$this->method = $server['method'];
}
} else {
if (strstr($server, ':')) {
$serverparts = explode(':', trim($server));
$this->server = $serverparts[0];
$this->port = $serverparts[1];
} else {
$this->server = $server;
}
}
}
}
 
// }}}
// {{{ fetchData()
 
/**
* Try to login to the POP3 server
*
* @param string Username
* @param string Password
* @return boolean
*/
function fetchData($username, $password)
{
$pop3 =& new Net_POP3();
$res = $pop3->connect($this->server, $this->port, $this->method);
if (!$res) {
return $res;
}
$result = $pop3->login($username, $password);
$pop3->disconnect();
return $result;
}
 
// }}}
 
}
?>
/tags/Racine_livraison_narmer/api/pear/Auth/Container/SAP.php
New file
0,0 → 1,177
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */
 
/**
* Storage driver for use against a SAP system using the SAPRFC PHP extension.
*
* Requires the SAPRFC ext available at http://saprfc.sourceforge.net/
*
* PHP version 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Authentication
* @package Auth
* @author Stoyan Stefanov <ssttoo@gmail.com>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: SAP.php,v 1.1 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/Auth
* @since File available since Release 1.4.0
*/
 
/**
* Include Auth_Container base class
*/
require_once 'Auth/Container.php';
/**
* Include PEAR for error handling
*/
require_once 'PEAR.php';
 
/**
* Performs authentication against a SAP system using the SAPRFC PHP extension.
*
* When the option GETSSO2 is TRUE (default)
* the Single Sign-On (SSO) ticket is retrieved
* and stored as an Auth attribute called 'sap'
* in order to be reused for consecutive connections.
*
* @category Authentication
* @package Auth
* @author Stoyan Stefanov <ssttoo@gmail.com>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version Release: 1.4.3 File: $Revision: 1.1 $
* @since Class available since Release 1.4.0
*/
class Auth_Container_SAP extends Auth_Container {
 
// {{{ properties
/**
* @var array Default options
*/
var $options = array(
'CLIENT' => '000',
'LANG' => 'EN',
'GETSSO2' => true,
);
 
// }}}
// {{{ Auth_Container_SAP()
 
/**
* Class constructor. Checks that required options
* are present and that the SAPRFC extension is loaded
*
* Options that can be passed and their defaults:
* <pre>
* array(
* 'ASHOST' => "",
* 'SYSNR' => "",
* 'CLIENT' => "000",
* 'GWHOST' =>"",
* 'GWSERV' =>"",
* 'MSHOST' =>"",
* 'R3NAME' =>"",
* 'GROUP' =>"",
* 'LANG' =>"EN",
* 'TRACE' =>"",
* 'GETSSO2'=> true
* )
* </pre>
*
* @param array array of options.
* @return void
*/
function Auth_Container_SAP($options)
{
$saprfc_loaded = PEAR::loadExtension('saprfc');
if (!$saprfc_loaded) {
return PEAR::raiseError('Cannot use SAP authentication, '
.'SAPRFC extension not loaded!');
}
if (empty($options['R3NAME']) && empty($options['ASHOST'])) {
return PEAR::raiseError('R3NAME or ASHOST required for authentication');
}
$this->options = array_merge($this->options, $options);
}
 
// }}}
// {{{ fetchData()
 
/**
* Performs username and password check
*
* @param string Username
* @param string Password
* @return boolean TRUE on success (valid user), FALSE otherwise
*/
function fetchData($username, $password)
{
$connection_options = $this->options;
$connection_options['USER'] = $username;
$connection_options['PASSWD'] = $password;
$rfc = saprfc_open($connection_options);
if (!$rfc) {
$message = "Couldn't connect to the SAP system.";
$error = $this->getError();
if ($error['message']) {
$message .= ': ' . $error['message'];
}
PEAR::raiseError($message, null, null, null, @$erorr['all']);
return false;
} else {
if (!empty($this->options['GETSSO2'])) {
if ($ticket = @saprfc_get_ticket($rfc)) {
$this->options['MYSAPSSO2'] = $ticket;
unset($this->options['GETSSO2']);
$this->_auth_obj->setAuthData('sap', $this->options);
} else {
PEAR::raiseError("SSO ticket retrieval failed");
}
}
@saprfc_close($rfc);
return true;
}
}
 
// }}}
// {{{ getError()
 
/**
* Retrieves the last error from the SAP connection
* and returns it as an array.
*
* @return array Array of error information
*/
function getError()
{
 
$error = array();
$sap_error = saprfc_error();
if (empty($err)) {
return $error;
}
$err = explode("n", $sap_error);
foreach ($err AS $line) {
$item = split(':', $line);
$error[strtolower(trim($item[0]))] = trim($item[1]);
}
$error['all'] = $sap_error;
return $error;
}
 
// }}}
 
}
 
?>
/tags/Racine_livraison_narmer/api/pear/Auth/Container/MDB2.php
New file
0,0 → 1,571
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */
 
/**
* Storage driver for use against PEAR MDB2
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Authentication
* @package Auth
* @author Lorenzo Alberton <l.alberton@quipo.it>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: MDB2.php,v 1.1 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/Auth
* @since File available since Release 1.3.0
*/
 
/**
* Include Auth_Container base class
*/
require_once 'Auth/Container.php';
/**
* Include PEAR MDB2 package
*/
require_once 'MDB2.php';
 
/**
* Storage driver for fetching login data from a database
*
* This storage driver can use all databases which are supported
* by the PEAR MDB2 abstraction layer to fetch login data.
*
* @category Authentication
* @package Auth
* @author Lorenzo Alberton <l.alberton@quipo.it>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version Release: 1.4.3 File: $Revision: 1.1 $
* @link http://pear.php.net/package/Auth
* @since Class available since Release 1.3.0
*/
class Auth_Container_MDB2 extends Auth_Container
{
 
// {{{ properties
 
/**
* Additional options for the storage container
* @var array
*/
var $options = array();
 
/**
* MDB object
* @var object
*/
var $db = null;
var $dsn = '';
 
/**
* User that is currently selected from the DB.
* @var string
*/
var $activeUser = '';
 
// }}}
// {{{ Auth_Container_MDB2() [constructor]
 
/**
* Constructor of the container class
*
* Initate connection to the database via PEAR::MDB2
*
* @param string Connection data or MDB2 object
* @return object Returns an error object if something went wrong
*/
function Auth_Container_MDB2($dsn)
{
$this->_setDefaults();
 
if (is_array($dsn)) {
$this->_parseOptions($dsn);
if (empty($this->options['dsn'])) {
PEAR::raiseError('No connection parameters specified!');
}
} else {
$this->options['dsn'] = $dsn;
}
}
 
// }}}
// {{{ _connect()
 
/**
* Connect to database by using the given DSN string
*
* @access private
* @param mixed DSN string | array | mdb object
* @return mixed Object on error, otherwise bool
*/
function _connect($dsn)
{
if (is_string($dsn) || is_array($dsn)) {
$this->db =& MDB2::connect($dsn, $this->options['db_options']);
} elseif (is_subclass_of($dsn, 'MDB2_Driver_Common')) {
$this->db = $dsn;
} elseif (is_object($dsn) && MDB2::isError($dsn)) {
return PEAR::raiseError($dsn->getMessage(), $dsn->code);
} else {
return PEAR::raiseError('The given dsn was not valid in file ' . __FILE__ . ' at line ' . __LINE__,
41,
PEAR_ERROR_RETURN,
null,
null
);
 
}
 
if (MDB2::isError($this->db) || PEAR::isError($this->db)) {
return PEAR::raiseError($this->db->getMessage(), $this->db->code);
}
if ($this->options['auto_quote']) {
$this->options['final_table'] = $this->db->quoteIdentifier($this->options['table'], true);
$this->options['final_usernamecol'] = $this->db->quoteIdentifier($this->options['usernamecol'], true);
$this->options['final_passwordcol'] = $this->db->quoteIdentifier($this->options['passwordcol'], true);
} else {
$this->options['final_table'] = $this->options['table'];
$this->options['final_usernamecol'] = $this->options['usernamecol'];
$this->options['final_passwordcol'] = $this->options['passwordcol'];
}
return true;
}
 
// }}}
// {{{ _prepare()
 
/**
* Prepare database connection
*
* This function checks if we have already opened a connection to
* the database. If that's not the case, a new connection is opened.
*
* @access private
* @return mixed True or a MDB error object.
*/
function _prepare()
{
if (is_subclass_of($this->db, 'MDB2_Driver_Common')) {
return true;
}
return $this->_connect($this->options['dsn']);
}
 
// }}}
// {{{ query()
 
/**
* Prepare query to the database
*
* This function checks if we have already opened a connection to
* the database. If that's not the case, a new connection is opened.
* After that the query is passed to the database.
*
* @access public
* @param string Query string
* @return mixed a MDB_result object or MDB_OK on success, a MDB
* or PEAR error on failure
*/
function query($query)
{
$err = $this->_prepare();
if ($err !== true) {
return $err;
}
return $this->db->exec($query);
}
 
// }}}
// {{{ _setDefaults()
 
/**
* Set some default options
*
* @access private
* @return void
*/
function _setDefaults()
{
$this->options['table'] = 'auth';
$this->options['usernamecol'] = 'username';
$this->options['passwordcol'] = 'password';
$this->options['dsn'] = '';
$this->options['db_fields'] = '';
$this->options['cryptType'] = 'md5';
$this->options['db_options'] = array();
$this->options['auto_quote'] = true;
}
 
// }}}
// {{{ _parseOptions()
 
/**
* Parse options passed to the container class
*
* @access private
* @param array
*/
function _parseOptions($array)
{
foreach ($array as $key => $value) {
if (isset($this->options[$key])) {
$this->options[$key] = $value;
}
}
}
 
// }}}
// {{{ _quoteDBFields()
 
/**
* Quote the db_fields option to avoid the possibility of SQL injection.
*
* @access private
* @return string A properly quoted string that can be concatenated into a
* SELECT clause.
*/
function _quoteDBFields()
{
if (isset($this->options['db_fields'])) {
if (is_array($this->options['db_fields'])) {
if ($this->options['auto_quote']) {
$fields = array();
foreach ($this->options['db_fields'] as $field) {
$fields[] = $this->db->quoteIdentifier($field, true);
}
return implode(', ', $fields);
} else {
return implode(', ', $this->options['db_fields']);
}
} else {
if (strlen($this->options['db_fields']) > 0) {
if ($this->options['auto_quote']) {
return $this->db->quoteIdentifier($this->options['db_fields'], true);
} else {
return $this->options['db_fields'];
}
}
}
}
 
return '';
}
// }}}
// {{{ fetchData()
 
/**
* Get user information from database
*
* This function uses the given username to fetch
* the corresponding login data from the database
* table. If an account that matches the passed username
* and password is found, the function returns true.
* Otherwise it returns false.
*
* @param string Username
* @param string Password
* @param boolean If true password is secured using a md5 hash
* the frontend and auth are responsible for making sure the container supports
* challenge response password authentication
* @return mixed Error object or boolean
*/
function fetchData($username, $password, $isChallengeResponse=false)
{
// Prepare for a database query
$err = $this->_prepare();
if ($err !== true) {
return PEAR::raiseError($err->getMessage(), $err->getCode());
}
 
//Check if db_fields contains a *, if so assume all columns are selected
if (is_string($this->options['db_fields'])
&& strstr($this->options['db_fields'], '*')) {
$sql_from = '*';
} else {
$sql_from = $this->options['final_usernamecol'].
", ".$this->options['final_passwordcol'];
 
if (strlen($fields = $this->_quoteDBFields()) > 0) {
$sql_from .= ', '.$fields;
}
}
$query = sprintf("SELECT %s FROM %s WHERE %s = %s",
$sql_from,
$this->options['final_table'],
$this->options['final_usernamecol'],
$this->db->quote($username, 'text')
);
 
$res = $this->db->queryRow($query, null, MDB2_FETCHMODE_ASSOC);
if (MDB2::isError($res) || PEAR::isError($res)) {
return PEAR::raiseError($res->getMessage(), $res->getCode());
}
if (!is_array($res)) {
$this->activeUser = '';
return false;
}
 
// Perform trimming here before the hashing
$password = trim($password, "\r\n");
$res[$this->options['passwordcol']] = trim($res[$this->options['passwordcol']], "\r\n");
// If using Challenge Response md5 the pass with the secret
if ($isChallengeResponse) {
$res[$this->options['passwordcol']] =
md5($res[$this->options['passwordcol']].$this->_auth_obj->session['loginchallenege']);
// UGLY cannot avoid without modifying verifyPassword
if ($this->options['cryptType'] == 'md5') {
$res[$this->options['passwordcol']] = md5($res[$this->options['passwordcol']]);
}
}
if ($this->verifyPassword($password,
$res[$this->options['passwordcol']],
$this->options['cryptType'])) {
// Store additional field values in the session
foreach ($res as $key => $value) {
if ($key == $this->options['passwordcol'] ||
$key == $this->options['usernamecol']) {
continue;
}
// Use reference to the auth object if exists
// This is because the auth session variable can change so a static call to setAuthData does not make sense
$this->_auth_obj->setAuthData($key, $value);
}
return true;
}
 
$this->activeUser = $res[$this->options['usernamecol']];
return false;
}
 
// }}}
// {{{ listUsers()
 
/**
* Returns a list of users from the container
*
* @return mixed array|PEAR_Error
* @access public
*/
function listUsers()
{
$err = $this->_prepare();
if ($err !== true) {
return PEAR::raiseError($err->getMessage(), $err->getCode());
}
 
$retVal = array();
 
//Check if db_fields contains a *, if so assume all columns are selected
if ( is_string($this->options['db_fields'])
&& strstr($this->options['db_fields'], '*')) {
$sql_from = '*';
} else {
$sql_from = $this->options['final_usernamecol'].
", ".$this->options['final_passwordcol'];
 
if (strlen($fields = $this->_quoteDBFields()) > 0) {
$sql_from .= ', '.$fields;
}
}
 
$query = sprintf('SELECT %s FROM %s',
$sql_from,
$this->options['final_table']
);
 
$res = $this->db->queryAll($query, null, MDB2_FETCHMODE_ASSOC);
if (MDB2::isError($res)) {
return PEAR::raiseError($res->getMessage(), $res->getCode());
} else {
foreach ($res as $user) {
$user['username'] = $user[$this->options['usernamecol']];
$retVal[] = $user;
}
}
return $retVal;
}
 
// }}}
// {{{ addUser()
 
/**
* Add user to the storage container
*
* @access public
* @param string Username
* @param string Password
* @param mixed Additional information that are stored in the DB
*
* @return mixed True on success, otherwise error object
*/
function addUser($username, $password, $additional = "")
{
 
// Prepare for a database query
$err = $this->_prepare();
if ($err !== true) {
return PEAR::raiseError($err->getMessage(), $err->getCode());
}
 
if (isset($this->options['cryptType']) && $this->options['cryptType'] == 'none') {
$cryptFunction = 'strval';
} elseif (isset($this->options['cryptType']) && function_exists($this->options['cryptType'])) {
$cryptFunction = $this->options['cryptType'];
} else {
$cryptFunction = 'md5';
}
 
$password = $cryptFunction($password);
 
$additional_key = '';
$additional_value = '';
 
if (is_array($additional)) {
foreach ($additional as $key => $value) {
if ($this->options['auto_quote']) {
$additional_key .= ', ' . $this->db->quoteIdentifier($key, true);
} else {
$additional_key .= ', ' . $key;
}
$additional_value .= ', ' . $this->db->quote($value, 'text');
}
}
 
$query = sprintf("INSERT INTO %s (%s, %s%s) VALUES (%s, %s%s)",
$this->options['final_table'],
$this->options['final_usernamecol'],
$this->options['final_passwordcol'],
$additional_key,
$this->db->quote($username, 'text'),
$this->db->quote($password, 'text'),
$additional_value
);
 
$res = $this->query($query);
 
if (MDB2::isError($res)) {
return PEAR::raiseError($res->getMessage(), $res->code);
}
return true;
}
 
// }}}
// {{{ removeUser()
 
/**
* Remove user from the storage container
*
* @access public
* @param string Username
*
* @return mixed True on success, otherwise error object
*/
function removeUser($username)
{
// Prepare for a database query
$err = $this->_prepare();
if ($err !== true) {
return PEAR::raiseError($err->getMessage(), $err->getCode());
}
 
$query = sprintf("DELETE FROM %s WHERE %s = %s",
$this->options['final_table'],
$this->options['final_usernamecol'],
$this->db->quote($username, 'text')
);
 
$res = $this->query($query);
 
if (MDB2::isError($res)) {
return PEAR::raiseError($res->getMessage(), $res->code);
}
return true;
}
 
// }}}
// {{{ changePassword()
 
/**
* Change password for user in the storage container
*
* @param string Username
* @param string The new password (plain text)
*/
function changePassword($username, $password)
{
// Prepare for a database query
$err = $this->_prepare();
if ($err !== true) {
return PEAR::raiseError($err->getMessage(), $err->getCode());
}
 
if (isset($this->options['cryptType']) && $this->options['cryptType'] == 'none') {
$cryptFunction = 'strval';
} elseif (isset($this->options['cryptType']) && function_exists($this->options['cryptType'])) {
$cryptFunction = $this->options['cryptType'];
} else {
$cryptFunction = 'md5';
}
 
$password = $cryptFunction($password);
 
$query = sprintf("UPDATE %s SET %s = %s WHERE %s = %s",
$this->options['final_table'],
$this->options['final_passwordcol'],
$this->db->quote($password, 'text'),
$this->options['final_usernamecol'],
$this->db->quote($username, 'text')
);
 
$res = $this->query($query);
 
if (MDB2::isError($res)) {
return PEAR::raiseError($res->getMessage(), $res->code);
}
return true;
}
 
// }}}
// {{{ supportsChallengeResponse()
 
/**
* Determine if this container supports
* password authentication with challenge response
*
* @return bool
* @access public
*/
function supportsChallengeResponse()
{
return in_array($this->options['cryptType'], array('md5', 'none', ''));
}
 
// }}}
// {{{ getCryptType()
 
/**
* Returns the selected crypt type for this container
*
* @return string Function used to crypt the password
*/
function getCryptType()
{
return $this->options['cryptType'];
}
 
// }}}
 
}
?>
/tags/Racine_livraison_narmer/api/pear/Auth/Container/DB.php
New file
0,0 → 1,578
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */
 
/**
* Storage driver for use against PEAR DB
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Authentication
* @package Auth
* @author Martin Jansen <mj@php.net>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: DB.php,v 1.2 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/Auth
*/
 
/**
* Include Auth_Container base class
*/
require_once 'Auth/Container.php';
/**
* Include PEAR DB
*/
require_once 'DB.php';
 
/**
* Storage driver for fetching login data from a database
*
* This storage driver can use all databases which are supported
* by the PEAR DB abstraction layer to fetch login data.
*
* @category Authentication
* @package Auth
* @author Martin Jansen <mj@php.net>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version Release: 1.4.3 File: $Revision: 1.2 $
* @link http://pear.php.net/package/Auth
*/
class Auth_Container_DB extends Auth_Container
{
 
// {{{ properties
 
/**
* Additional options for the storage container
* @var array
*/
var $options = array();
 
/**
* DB object
* @var object
*/
var $db = null;
var $dsn = '';
 
/**
* User that is currently selected from the DB.
* @var string
*/
var $activeUser = '';
 
// }}}
// {{{ Auth_Container_DB [constructor]
 
/**
* Constructor of the container class
*
* Save the initial options passed to the container. Initiation of the DB
* connection is no longer performed here and is only done when needed.
*
* @param string Connection data or DB object
* @return object Returns an error object if something went wrong
*/
function Auth_Container_DB($dsn)
{
$this->_setDefaults();
 
if (is_array($dsn)) {
$this->_parseOptions($dsn);
 
if (empty($this->options['dsn'])) {
PEAR::raiseError('No connection parameters specified!');
}
} else {
$this->options['dsn'] = $dsn;
}
}
 
// }}}
// {{{ _connect()
 
/**
* Connect to database by using the given DSN string
*
* @access private
* @param string DSN string
* @return mixed Object on error, otherwise bool
*/
function _connect($dsn)
{
if (is_string($dsn) || is_array($dsn)) {
$this->db = DB::Connect($dsn, $this->options['db_options']);
} elseif (is_subclass_of($dsn, 'db_common')) {
$this->db = $dsn;
} elseif (DB::isError($dsn)) {
return PEAR::raiseError($dsn->getMessage(), $dsn->getCode());
} else {
return PEAR::raiseError('The given dsn was not valid in file ' . __FILE__ . ' at line ' . __LINE__,
41,
PEAR_ERROR_RETURN,
null,
null
);
}
 
if (DB::isError($this->db) || PEAR::isError($this->db)) {
return PEAR::raiseError($this->db->getMessage(), $this->db->getCode());
} else {
return true;
}
}
 
// }}}
// {{{ _prepare()
 
/**
* Prepare database connection
*
* This function checks if we have already opened a connection to
* the database. If that's not the case, a new connection is opened.
*
* @access private
* @return mixed True or a DB error object.
*/
function _prepare()
{
if (!DB::isConnection($this->db)) {
$res = $this->_connect($this->options['dsn']);
if (DB::isError($res) || PEAR::isError($res)) {
return $res;
}
}
if ($this->options['auto_quote'] && $this->db->dsn['phptype'] != 'sqlite') {
$this->options['final_table'] = $this->db->quoteIdentifier($this->options['table']);
$this->options['final_usernamecol'] = $this->db->quoteIdentifier($this->options['usernamecol']);
$this->options['final_passwordcol'] = $this->db->quoteIdentifier($this->options['passwordcol']);
} else {
$this->options['final_table'] = $this->options['table'];
$this->options['final_usernamecol'] = $this->options['usernamecol'];
$this->options['final_passwordcol'] = $this->options['passwordcol'];
}
return true;
}
 
// }}}
// {{{ query()
 
/**
* Prepare query to the database
*
* This function checks if we have already opened a connection to
* the database. If that's not the case, a new connection is opened.
* After that the query is passed to the database.
*
* @access public
* @param string Query string
* @return mixed a DB_result object or DB_OK on success, a DB
* or PEAR error on failure
*/
function query($query)
{
$err = $this->_prepare();
if ($err !== true) {
return $err;
}
return $this->db->query($query);
}
 
// }}}
// {{{ _setDefaults()
 
/**
* Set some default options
*
* @access private
* @return void
*/
function _setDefaults()
{
$this->options['table'] = 'auth';
$this->options['usernamecol'] = 'username';
$this->options['passwordcol'] = 'password';
$this->options['dsn'] = '';
$this->options['db_fields'] = '';
$this->options['cryptType'] = 'md5';
$this->options['db_options'] = array();
$this->options['auto_quote'] = true;
}
 
// }}}
// {{{ _parseOptions()
 
/**
* Parse options passed to the container class
*
* @access private
* @param array
*/
function _parseOptions($array)
{
foreach ($array as $key => $value) {
if (isset($this->options[$key])) {
$this->options[$key] = $value;
}
}
}
 
// }}}
// {{{ _quoteDBFields()
 
/**
* Quote the db_fields option to avoid the possibility of SQL injection.
*
* @access private
* @return string A properly quoted string that can be concatenated into a
* SELECT clause.
*/
function _quoteDBFields()
{
if (isset($this->options['db_fields'])) {
if (is_array($this->options['db_fields'])) {
if ($this->options['auto_quote']) {
$fields = array();
foreach ($this->options['db_fields'] as $field) {
$fields[] = $this->db->quoteIdentifier($field);
}
return implode(', ', $fields);
} else {
return implode(', ', $this->options['db_fields']);
}
} else {
if (strlen($this->options['db_fields']) > 0) {
if ($this->options['auto_quote']) {
return $this->db->quoteIdentifier($this->options['db_fields']);
} else {
return $this->options['db_fields'];
}
}
}
}
 
return '';
}
// }}}
// {{{ fetchData()
 
/**
* Get user information from database
*
* This function uses the given username to fetch
* the corresponding login data from the database
* table. If an account that matches the passed username
* and password is found, the function returns true.
* Otherwise it returns false.
*
* @param string Username
* @param string Password
* @param boolean If true password is secured using a md5 hash
* the frontend and auth are responsible for making sure the container supports
* challenge response password authentication
* @return mixed Error object or boolean
*/
function fetchData($username, $password, $isChallengeResponse=false)
{
// Prepare for a database query
$err = $this->_prepare();
if ($err !== true) {
return PEAR::raiseError($err->getMessage(), $err->getCode());
}
 
// Find if db_fields contains a *, if so assume all columns are selected
if (is_string($this->options['db_fields'])
&& strstr($this->options['db_fields'], '*')) {
$sql_from = "*";
} else {
$sql_from = $this->options['final_usernamecol'].
", ".$this->options['final_passwordcol'];
 
if (strlen($fields = $this->_quoteDBFields()) > 0) {
$sql_from .= ', '.$fields;
}
}
 
$query = "SELECT ".$sql_from.
" FROM ".$this->options['final_table'].
" WHERE ".$this->options['final_usernamecol']." = ".$this->db->quoteSmart($username);
 
$res = $this->db->getRow($query, null, DB_FETCHMODE_ASSOC);
 
if (DB::isError($res)) {
return PEAR::raiseError($res->getMessage(), $res->getCode());
}
 
if (!is_array($res)) {
$this->activeUser = '';
return false;
}
 
// Perform trimming here before the hashihg
$password = trim($password, "\r\n");
$res[$this->options['passwordcol']] = trim($res[$this->options['passwordcol']], "\r\n");
 
// If using Challenge Response md5 the pass with the secret
if ($isChallengeResponse) {
$res[$this->options['passwordcol']] = md5($res[$this->options['passwordcol']]
.$this->_auth_obj->session['loginchallenege']);
// UGLY cannot avoid without modifying verifyPassword
if ($this->options['cryptType'] == 'md5') {
$res[$this->options['passwordcol']] = md5($res[$this->options['passwordcol']]);
}
//print " Hashed Password [{$res[$this->options['passwordcol']]}]<br/>\n";
}
 
if ($this->verifyPassword($password,
$res[$this->options['passwordcol']],
$this->options['cryptType'])) {
// Store additional field values in the session
foreach ($res as $key => $value) {
if ($key == $this->options['passwordcol'] ||
$key == $this->options['usernamecol']) {
continue;
}
// Use reference to the auth object if exists
// This is because the auth session variable can change so a
// static call to setAuthData does not make sence
$this->_auth_obj->setAuthData($key, $value);
}
return true;
}
$this->activeUser = $res[$this->options['usernamecol']];
return false;
}
 
// }}}
// {{{ listUsers()
 
/**
* Returns a list of users from the container
*
* @return mixed
* @access public
*/
function listUsers()
{
$err = $this->_prepare();
if ($err !== true) {
return PEAR::raiseError($err->getMessage(), $err->getCode());
}
 
$retVal = array();
 
// Find if db_fields contains a *, if so assume all col are selected
if ( is_string($this->options['db_fields'])
&& strstr($this->options['db_fields'], '*')) {
$sql_from = "*";
} else {
$sql_from = $this->options['final_usernamecol'].
", ".$this->options['final_passwordcol'];
 
if (strlen($fields = $this->_quoteDBFields()) > 0) {
$sql_from .= ', '.$fields;
}
}
 
$query = sprintf("SELECT %s FROM %s",
$sql_from,
$this->options['final_table']
);
$res = $this->db->getAll($query, null, DB_FETCHMODE_ASSOC);
 
if (DB::isError($res)) {
return PEAR::raiseError($res->getMessage(), $res->getCode());
} else {
foreach ($res as $user) {
$user['username'] = $user[$this->options['usernamecol']];
$retVal[] = $user;
}
}
return $retVal;
}
 
// }}}
// {{{ addUser()
 
/**
* Add user to the storage container
*
* @access public
* @param string Username
* @param string Password
* @param mixed Additional information that are stored in the DB
*
* @return mixed True on success, otherwise error object
*/
function addUser($username, $password, $additional = "")
{
$err = $this->_prepare();
if ($err !== true) {
return PEAR::raiseError($err->getMessage(), $err->getCode());
}
 
if ( isset($this->options['cryptType'])
&& $this->options['cryptType'] == 'none') {
$cryptFunction = 'strval';
} elseif ( isset($this->options['cryptType'])
&& function_exists($this->options['cryptType'])) {
$cryptFunction = $this->options['cryptType'];
} else {
$cryptFunction = 'md5';
}
 
$password = $cryptFunction($password);
 
$additional_key = '';
$additional_value = '';
 
if (is_array($additional)) {
foreach ($additional as $key => $value) {
if ($this->options['auto_quote']) {
$additional_key .= ', ' . $this->db->quoteIdentifier($key);
} else {
$additional_key .= ', ' . $key;
}
$additional_value .= ", " . $this->db->quoteSmart($value);
}
}
 
$query = sprintf("INSERT INTO %s (%s, %s%s) VALUES (%s, %s%s)",
$this->options['final_table'],
$this->options['final_usernamecol'],
$this->options['final_passwordcol'],
$additional_key,
$this->db->quoteSmart($username),
$this->db->quoteSmart($password),
$additional_value
);
 
$res = $this->query($query);
 
if (DB::isError($res)) {
return PEAR::raiseError($res->getMessage(), $res->getCode());
} else {
return true;
}
}
 
// }}}
// {{{ removeUser()
 
/**
* Remove user from the storage container
*
* @access public
* @param string Username
*
* @return mixed True on success, otherwise error object
*/
function removeUser($username)
{
$err = $this->_prepare();
if ($err !== true) {
return PEAR::raiseError($err->getMessage(), $err->getCode());
}
 
$query = sprintf("DELETE FROM %s WHERE %s = %s",
$this->options['final_table'],
$this->options['final_usernamecol'],
$this->db->quoteSmart($username)
);
 
$res = $this->query($query);
 
if (DB::isError($res)) {
return PEAR::raiseError($res->getMessage(), $res->getCode());
} else {
return true;
}
}
 
// }}}
// {{{ changePassword()
 
/**
* Change password for user in the storage container
*
* @param string Username
* @param string The new password (plain text)
*/
function changePassword($username, $password)
{
$err = $this->_prepare();
if ($err !== true) {
return PEAR::raiseError($err->getMessage(), $err->getCode());
}
 
if ( isset($this->options['cryptType'])
&& $this->options['cryptType'] == 'none') {
$cryptFunction = 'strval';
} elseif ( isset($this->options['cryptType'])
&& function_exists($this->options['cryptType'])) {
$cryptFunction = $this->options['cryptType'];
} else {
$cryptFunction = 'md5';
}
 
$password = $cryptFunction($password);
 
$query = sprintf("UPDATE %s SET %s = %s WHERE %s = %s",
$this->options['final_table'],
$this->options['final_passwordcol'],
$this->db->quoteSmart($password),
$this->options['final_usernamecol'],
$this->db->quoteSmart($username)
);
 
$res = $this->query($query);
 
if (DB::isError($res)) {
return PEAR::raiseError($res->getMessage(), $res->getCode());
} else {
return true;
}
}
 
// }}}
// {{{ supportsChallengeResponse()
 
/**
* Determine if this container supports
* password authentication with challenge response
*
* @return bool
* @access public
*/
function supportsChallengeResponse()
{
return in_array($this->options['cryptType'], array('md5', 'none', ''));
}
 
// }}}
// {{{ getCryptType()
 
/**
* Returns the selected crypt type for this container
*/
function getCryptType()
{
return($this->options['cryptType']);
}
 
// }}}
 
}
?>
/tags/Racine_livraison_narmer/api/pear/Auth/Container/IMAP.php
New file
0,0 → 1,206
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */
 
/**
* Storage driver for use against IMAP servers
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Authentication
* @package Auth
* @author Jeroen Houben <jeroen@terena.nl>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: IMAP.php,v 1.2 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/Auth
* @since File available since Release 1.2.0
*/
 
/**
* Include Auth_Container base class
*/
require_once "Auth/Container.php";
 
/**
* Include PEAR class for error handling
*/
require_once "PEAR.php";
 
/**
* Storage driver for fetching login data from an IMAP server
*
* This class is based on LDAP containers, but it very simple.
* By default it connects to localhost:143
* The constructor will first check if the host:port combination is
* actually reachable. This behaviour can be disabled.
* It then tries to create an IMAP stream (without opening a mailbox)
* If you wish to pass extended options to the connections, you may
* do so by specifying protocol options.
*
* To use this storage containers, you have to use the
* following syntax:
*
* <?php
* ...
* $params = array(
* 'host' => 'mail.example.com',
* 'port' => 143,
* );
* $myAuth = new Auth('IMAP', $params);
* ...
*
* By default we connect without any protocol options set. However, some
* servers require you to connect with the notls or norsh options set.
* To do this you need to add the following value to the params array:
* 'baseDSN' => '/imap/notls/norsh'
*
* To connect to an SSL IMAP server:
* 'baseDSN' => '/imap/ssl'
*
* To connect to an SSL IMAP server with a self-signed certificate:
* 'baseDSN' => '/imap/ssl/novalidate-cert'
*
* Further options may be available and can be found on the php site at
* http://www.php.net/manual/function.imap-open.php
*
* @category Authentication
* @package Auth
* @author Jeroen Houben <jeroen@terena.nl>
* @author Cipriano Groenendal <cipri@campai.nl>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version Release: 1.4.3 File: $Revision: 1.2 $
* @link http://pear.php.net/package/Auth
* @since Class available since Release 1.2.0
*/
class Auth_Container_IMAP extends Auth_Container
{
 
// {{{ properties
 
/**
* Options for the class
* @var array
*/
var $options = array();
 
// }}}
// {{{ Auth_Container_IMAP() [constructor]
 
/**
* Constructor of the container class
*
* @param $params associative array with host, port, baseDSN, checkServer
* and userattr key
* @return object Returns an error object if something went wrong
* @todo Use PEAR Net_IMAP if IMAP extension not loaded
*/
function Auth_Container_IMAP($params)
{
if (!extension_loaded('imap')) {
return PEAR::raiseError('Cannot use IMAP authentication, '
.'IMAP extension not loaded!', 41, PEAR_ERROR_DIE);
}
$this->_setDefaults();
 
// set parameters (if any)
if (is_array($params)) {
$this->_parseOptions($params);
}
 
if ($this->options['checkServer']) {
$this->_checkServer($this->options['timeout']);
}
return true;
}
 
// }}}
// {{{ _setDefaults()
 
/**
* Set some default options
*
* @access private
*/
function _setDefaults()
{
$this->options['host'] = 'localhost';
$this->options['port'] = 143;
$this->options['baseDSN'] = '';
$this->options['checkServer'] = true;
$this->options['timeout'] = 20;
}
 
// }}}
// {{{ _checkServer()
 
/**
* Check if the given server and port are reachable
*
* @access private
*/
function _checkServer() {
$fp = @fsockopen ($this->options['host'], $this->options['port'],
$errno, $errstr, $this->options['timeout']);
if (is_resource($fp)) {
@fclose($fp);
} else {
$message = "Error connecting to IMAP server "
. $this->options['host']
. ":" . $this->options['port'];
return PEAR::raiseError($message, 41);
}
}
 
// }}}
// {{{ _parseOptions()
 
/**
* Parse options passed to the container class
*
* @access private
* @param array
*/
function _parseOptions($array)
{
foreach ($array as $key => $value) {
$this->options[$key] = $value;
}
}
 
// }}}
// {{{ fetchData()
 
/**
* Try to open a IMAP stream using $username / $password
*
* @param string Username
* @param string Password
* @return boolean
*/
function fetchData($username, $password)
{
$dsn = '{'.$this->options['host'].':'.$this->options['port'].$this->options['baseDSN'].'}';
$conn = @imap_open ($dsn, $username, $password, OP_HALFOPEN);
if (is_resource($conn)) {
$this->activeUser = $username;
@imap_close($conn);
return true;
} else {
$this->activeUser = '';
return false;
}
}
 
// }}}
 
}
?>
/tags/Racine_livraison_narmer/api/pear/Auth/Container/vpopmail.php
New file
0,0 → 1,87
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */
 
/**
* Storage driver for use against vpopmail setups
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Authentication
* @package Auth
* @author Stanislav Grozev <tacho@orbitel.bg>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: vpopmail.php,v 1.2 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/Auth
* @since File available since Release 1.2.0
*/
 
/**
* Include Auth_Container base class
*/
require_once "Auth/Container.php";
/**
* Include PEAR package for error handling
*/
require_once "PEAR.php";
 
/**
* Storage driver for fetching login data from vpopmail
*
* @category Authentication
* @package Auth
* @author Stanislav Grozev <tacho@orbitel.bg>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version Release: 1.4.3 File: $Revision: 1.2 $
* @link http://pear.php.net/package/Auth
* @since Class available since Release 1.2.0
*/
class Auth_Container_vpopmail extends Auth_Container {
 
// {{{ Constructor
 
/**
* Constructor of the container class
*
* @return void
*/
function Auth_Container_vpopmail()
{
if (!extension_loaded('vpopmail')) {
return PEAR::raiseError('Cannot use VPOPMail authentication, '
.'VPOPMail extension not loaded!', 41, PEAR_ERROR_DIE);
}
}
 
// }}}
// {{{ fetchData()
 
/**
* Get user information from vpopmail
*
* @param string Username - has to be valid email address
* @param string Password
* @return boolean
*/
function fetchData($username, $password)
{
$userdata = array();
$userdata = preg_split("/@/", $username, 2);
$result = @vpopmail_auth_user($userdata[0], $userdata[1], $password);
 
return $result;
}
 
// }}}
 
}
?>
/tags/Racine_livraison_narmer/api/pear/Auth/Container/PEAR.php
New file
0,0 → 1,103
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */
 
/**
* Storage driver for use against PEAR website
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Authentication
* @package Auth
* @author Yavor Shahpasov <yavo@netsmart.com.cy>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: PEAR.php,v 1.1 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/Auth
* @since File available since Release 1.3.0
*/
 
/**
* Include Auth_Container base class
*/
require_once 'Auth/Container.php';
/**
* Include PEAR XML_RPC
*/
require_once 'XML/RPC.php';
 
/**
* Storage driver for authenticating against PEAR website
*
* This driver provides a method for authenticating against the pear.php.net
* authentication system.
*
* @category Authentication
* @package Auth
* @author Yavor Shahpasov <yavo@netsmart.com.cy>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version Release: 1.4.3 File: $Revision: 1.1 $
* @link http://pear.php.net/package/Auth
* @since Class available since Release 1.3.0
*/
class Auth_Container_Pear extends Auth_Container
{
 
// {{{ Auth_Container_Pear() [constructor]
 
/**
* Constructor
*
* Currently does nothing
*
* @return void
*/
function Auth_Container_Pear()
{
}
 
// }}}
// {{{ fetchData()
/**
* Get user information from pear.php.net
*
* This function uses the given username and password to authenticate
* against the pear.php.net website
*
* @param string Username
* @param string Password
* @return mixed Error object or boolean
*/
function fetchData($username, $password)
{
$rpc = new XML_RPC_Client('/xmlrpc.php', 'pear.php.net');
$rpc_message = new XML_RPC_Message("user.info", array(new XML_RPC_Value($username, "string")) );
// Error Checking howto ???
$result = $rpc->send($rpc_message);
$value = $result->value();
$userinfo = xml_rpc_decode($value);
if ($userinfo['password'] == md5($password)) {
$this->activeUser = $userinfo['handle'];
foreach ($userinfo as $uk=>$uv) {
$this->_auth_obj->setAuthData($uk, $uv);
}
return true;
}
return false;
}
 
// }}}
}
?>
/tags/Racine_livraison_narmer/api/pear/Auth/Container/RADIUS.php
New file
0,0 → 1,180
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */
 
/**
* Storage driver for use against RADIUS servers
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Authentication
* @package Auth
* @author Michael Bretterklieber <michael@bretterklieber.com>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: RADIUS.php,v 1.2 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/Auth
* @since File available since Release 1.2.0
*/
 
/**
* Include Auth_Container base class
*/
require_once "Auth/Container.php";
/**
* Include PEAR Auth_RADIUS package
*/
require_once "Auth/RADIUS.php";
 
/**
* Storage driver for authenticating users against RADIUS servers.
*
* @category Authentication
* @package Auth
* @author Michael Bretterklieber <michael@bretterklieber.com>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version Release: 1.4.3 File: $Revision: 1.2 $
* @link http://pear.php.net/package/Auth
* @since Class available since Release 1.2.0
*/
class Auth_Container_RADIUS extends Auth_Container
{
 
// {{{ properties
 
/**
* Contains a RADIUS object
* @var object
*/
var $radius;
/**
* Contains the authentication type
* @var string
*/
var $authtype;
 
// }}}
// {{{ Auth_Container_RADIUS() [constructor]
 
/**
* Constructor of the container class.
*
* $options can have these keys:
* 'servers' an array containing an array: servername, port,
* sharedsecret, timeout, maxtries
* 'configfile' The filename of the configuration file
* 'authtype' The type of authentication, one of: PAP, CHAP_MD5,
* MSCHAPv1, MSCHAPv2, default is PAP
*
* @param $options associative array
* @return object Returns an error object if something went wrong
*/
function Auth_Container_RADIUS($options)
{
$this->authtype = 'PAP';
if (isset($options['authtype'])) {
$this->authtype = $options['authtype'];
}
$classname = 'Auth_RADIUS_' . $this->authtype;
if (!class_exists($classname)) {
PEAR::raiseError("Unknown Authtype, please use one of: "
."PAP, CHAP_MD5, MSCHAPv1, MSCHAPv2!", 41, PEAR_ERROR_DIE);
}
$this->radius = new $classname;
 
if (isset($options['configfile'])) {
$this->radius->setConfigfile($options['configfile']);
}
 
$servers = $options['servers'];
if (is_array($servers)) {
foreach ($servers as $server) {
$servername = $server[0];
$port = isset($server[1]) ? $server[1] : 0;
$sharedsecret = isset($server[2]) ? $server[2] : 'testing123';
$timeout = isset($server[3]) ? $server[3] : 3;
$maxtries = isset($server[4]) ? $server[4] : 3;
$this->radius->addServer($servername, $port, $sharedsecret, $timeout, $maxtries);
}
}
if (!$this->radius->start()) {
PEAR::raiseError($this->radius->getError(), 41, PEAR_ERROR_DIE);
}
}
 
// }}}
// {{{ fetchData()
 
/**
* Authenticate
*
* @param string Username
* @param string Password
* @return bool true on success, false on reject
*/
function fetchData($username, $password, $challenge = null)
{
switch($this->authtype) {
case 'CHAP_MD5':
case 'MSCHAPv1':
if (isset($challenge)) {
$this->radius->challenge = $challenge;
$this->radius->chapid = 1;
$this->radius->response = pack('H*', $password);
} else {
require_once 'Crypt/CHAP.php';
$classname = 'Crypt_' . $this->authtype;
$crpt = new $classname;
$crpt->password = $password;
$this->radius->challenge = $crpt->challenge;
$this->radius->chapid = $crpt->chapid;
$this->radius->response = $crpt->challengeResponse();
break;
}
 
case 'MSCHAPv2':
require_once 'Crypt/CHAP.php';
$crpt = new Crypt_MSCHAPv2;
$crpt->username = $username;
$crpt->password = $password;
$this->radius->challenge = $crpt->authChallenge;
$this->radius->peerChallenge = $crpt->peerChallenge;
$this->radius->chapid = $crpt->chapid;
$this->radius->response = $crpt->challengeResponse();
break;
 
default:
$this->radius->password = $password;
break;
}
 
$this->radius->username = $username;
 
$this->radius->putAuthAttributes();
$result = $this->radius->send();
if (PEAR::isError($result)) {
return false;
}
 
$this->radius->getAttributes();
// just for debugging
// $this->radius->dumpAttributes();
 
return $result;
}
 
// }}}
 
}
?>
/tags/Racine_livraison_narmer/api/pear/Auth/Container/SOAP5.php
New file
0,0 → 1,267
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */
 
/**
* Storage driver for use against a SOAP service using PHP5 SoapClient
*
* PHP version 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Authentication
* @package Auth
* @author Based upon Auth_Container_SOAP by Bruno Pedro <bpedro@co.sapo.pt>
* @author Marcel Oelke <puRe@rednoize.com>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: SOAP5.php,v 1.1 2006-12-14 15:04:28 jp_milcent Exp $
* @since File available since Release 1.4.0
*/
 
/**
* Include Auth_Container base class
*/
require_once "Auth/Container.php";
/**
* Include PEAR package for error handling
*/
require_once "PEAR.php";
 
/**
* Storage driver for fetching login data from SOAP using the PHP5 Builtin SOAP
* functions. This is a modification of the SOAP Storage driver from Bruno Pedro
* thats using the PEAR SOAP Package.
*
* This class takes one parameter (options), where
* you specify the following fields:
* * location and uri, or wsdl file
* * method to call on the SOAP service
* * usernamefield, the name of the parameter where the username is supplied
* * passwordfield, the name of the parameter where the password is supplied
* * matchpassword, whether to look for the password in the response from
* the function call or assume that no errors means user
* authenticated.
*
* See http://www.php.net/manual/en/ref.soap.php for further details
* on options for the PHP5 SoapClient which are passed through.
*
* Example usage without WSDL:
*
* <?php
*
* $options = array (
* 'wsdl' => NULL,
* 'location' => 'http://your.soap.service/endpoint',
* 'uri' => 'urn:/Your/Namespace',
* 'method' => 'checkAuth',
* 'usernamefield' => 'username',
* 'passwordfield' => 'password',
* 'matchpasswords' => false,
* '_features' => array (
* 'extra_parameter' => 'example_value',
* 'another_parameter' => 'foobar'
* )
* );
*
* $auth = new Auth('SOAP5', $options);
* $auth->start();
*
* ?>
*
* Example usage with WSDL:
*
* <?php
*
* $options = array (
* 'wsdl' => 'http://your.soap.service/wsdl',
* 'method' => 'checkAuth',
* 'usernamefield' => 'username',
* 'passwordfield' => 'password',
* 'matchpasswords' => false,
* '_features' => array (
* 'extra_parameter' => 'example_value',
* 'another_parameter' => 'foobar'
* )
* );
*
* $auth = new Auth('SOAP5', $options);
* $auth->start();
*
* ?>
*
* @category Authentication
* @package Auth
* @author Based upon Auth_Container_SOAP by Bruno Pedro <bpedro@co.sapo.pt>
* @author Marcel Oelke <puRe@rednoize.com>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version Release: 1.4.3 File: $Revision: 1.1 $
* @since Class available since Release 1.4.0
*/
class Auth_Container_SOAP5 extends Auth_Container
{
 
// {{{ properties
 
/**
* Required options for the class
* @var array
* @access private
*/
var $_requiredOptions = array(
'location',
'uri',
'method',
'usernamefield',
'passwordfield',
'wsdl',
);
 
/**
* Options for the class
* @var array
* @access private
*/
var $_options = array();
 
/**
* Optional SOAP features
* @var array
* @access private
*/
var $_features = array();
 
/**
* The SOAP response
* @var array
* @access public
*/
var $soapResponse = array();
// }}}
// {{{ Auth_Container_SOAP5()
 
/**
* Constructor of the container class
*
* @param $options, associative array with endpoint, namespace, method,
* usernamefield, passwordfield and optional features
*/
function Auth_Container_SOAP5($options)
{
$this->_setDefaults();
 
foreach ($options as $name => $value) {
$this->_options[$name] = $value;
}
 
if (!empty($this->_options['_features'])) {
$this->_features = $this->_options['_features'];
unset($this->_options['_features']);
}
}
 
// }}}
// {{{ fetchData()
 
/**
* Fetch data from SOAP service
*
* Requests the SOAP service for the given username/password
* combination.
*
* @param string Username
* @param string Password
* @return mixed Returns the SOAP response or false if something went wrong
*/
function fetchData($username, $password)
{
$result = $this->_validateOptions();
if (PEAR::isError($result))
return $result;
 
// create a SOAP client
$soapClient = new SoapClient($this->_options["wsdl"], $this->_options);
$params = array();
// first, assign the optional features
foreach ($this->_features as $fieldName => $fieldValue) {
$params[$fieldName] = $fieldValue;
}
// assign username and password ...
$params[$this->_options['usernamefield']] = $username;
$params[$this->_options['passwordfield']] = $password;
try {
$this->soapResponse = $soapClient->__soapCall($this->_options['method'], $params);
if ($this->_options['matchpasswords']) {
// check if passwords match
if ($password == $this->soapResponse[$this->_options['passwordfield']]) {
return true;
} else {
return false;
}
} else {
return true;
}
} catch (SoapFault $e) {
return PEAR::raiseError("Error retrieving authentication data. Received SOAP Fault: ".$e->faultstring, $e->faultcode);
}
}
 
// }}}
// {{{ _validateOptions()
/**
* Validate that the options passed to the container class are enough for us to proceed
*
* @access private
* @param array
*/
function _validateOptions($array)
{
if ( ( is_null($this->options['wsdl'])
&& is_null($this->options['location'])
&& is_null($this->options['uri']))
|| ( is_null($this->options['wsdl'])
&& ( is_null($this->options['location'])
|| is_null($this->options['uri'])))) {
return PEAR::raiseError('Either a WSDL file or a location/uri pair must be specified.');
}
if (is_null($this->options['method'])) {
return PEAR::raiseError('A method to call on the soap service must be specified.');
}
return true;
}
// }}}
// {{{ _setDefaults()
 
/**
* Set some default options
*
* @access private
* @return void
*/
function _setDefaults()
{
$this->options['wsdl'] = null;
$this->options['location'] = null;
$this->options['uri'] = null;
$this->options['method'] = null;
$this->options['usernamefield'] = 'username';
$this->options['passwordfield'] = 'password';
$this->options['matchpasswords'] = true;
}
 
// }}}
}
?>
/tags/Racine_livraison_narmer/api/pear/Auth/SASL/Plain.php
New file
0,0 → 1,63
<?php
// +-----------------------------------------------------------------------+
// | Copyright (c) 2002-2003 Richard Heyes |
// | All rights reserved. |
// | |
// | Redistribution and use in source and binary forms, with or without |
// | modification, are permitted provided that the following conditions |
// | are met: |
// | |
// | o Redistributions of source code must retain the above copyright |
// | notice, this list of conditions and the following disclaimer. |
// | o Redistributions in binary form must reproduce the above copyright |
// | notice, this list of conditions and the following disclaimer in the |
// | documentation and/or other materials provided with the distribution.|
// | o The names of the authors may not be used to endorse or promote |
// | products derived from this software without specific prior written |
// | permission. |
// | |
// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
// | |
// +-----------------------------------------------------------------------+
// | Author: Richard Heyes <richard@php.net> |
// +-----------------------------------------------------------------------+
//
// $Id: Plain.php,v 1.1 2006-12-14 15:04:29 jp_milcent Exp $
 
/**
* Implmentation of PLAIN SASL mechanism
*
* @author Richard Heyes <richard@php.net>
* @access public
* @version 1.0
* @package Auth_SASL
*/
 
require_once('Auth/SASL/Common.php');
 
class Auth_SASL_Plain extends Auth_SASL_Common
{
/**
* Returns PLAIN response
*
* @param string $authcid Authentication id (username)
* @param string $pass Password
* @param string $authzid Autorization id
* @return string PLAIN Response
*/
function getResponse($authcid, $pass, $authzid = '')
{
return $authzid . chr(0) . $authcid . chr(0) . $pass;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Auth/SASL/DigestMD5.php
New file
0,0 → 1,194
<?php
// +-----------------------------------------------------------------------+
// | Copyright (c) 2002-2003 Richard Heyes |
// | All rights reserved. |
// | |
// | Redistribution and use in source and binary forms, with or without |
// | modification, are permitted provided that the following conditions |
// | are met: |
// | |
// | o Redistributions of source code must retain the above copyright |
// | notice, this list of conditions and the following disclaimer. |
// | o Redistributions in binary form must reproduce the above copyright |
// | notice, this list of conditions and the following disclaimer in the |
// | documentation and/or other materials provided with the distribution.|
// | o The names of the authors may not be used to endorse or promote |
// | products derived from this software without specific prior written |
// | permission. |
// | |
// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
// | |
// +-----------------------------------------------------------------------+
// | Author: Richard Heyes <richard@php.net> |
// +-----------------------------------------------------------------------+
//
// $Id: DigestMD5.php,v 1.1 2006-12-14 15:04:29 jp_milcent Exp $
 
/**
* Implmentation of DIGEST-MD5 SASL mechanism
*
* @author Richard Heyes <richard@php.net>
* @access public
* @version 1.0
* @package Auth_SASL
*/
 
require_once('Auth/SASL/Common.php');
 
class Auth_SASL_DigestMD5 extends Auth_SASL_Common
{
/**
* Provides the (main) client response for DIGEST-MD5
* requires a few extra parameters than the other
* mechanisms, which are unavoidable.
*
* @param string $authcid Authentication id (username)
* @param string $pass Password
* @param string $challenge The digest challenge sent by the server
* @param string $hostname The hostname of the machine you're connecting to
* @param string $service The servicename (eg. imap, pop, acap etc)
* @param string $authzid Authorization id (username to proxy as)
* @return string The digest response (NOT base64 encoded)
* @access public
*/
function getResponse($authcid, $pass, $challenge, $hostname, $service, $authzid = '')
{
$challenge = $this->_parseChallenge($challenge);
$authzid_string = '';
if ($authzid != '') {
$authzid_string = ',authzid="' . $authzid . '"';
}
 
if (!empty($challenge)) {
$cnonce = $this->_getCnonce();
$digest_uri = sprintf('%s/%s', $service, $hostname);
$response_value = $this->_getResponseValue($authcid, $pass, $challenge['realm'], $challenge['nonce'], $cnonce, $digest_uri, $authzid);
 
return sprintf('username="%s",realm="%s"' . $authzid_string . ',nonce="%s",cnonce="%s",nc="00000001",qop=auth,digest-uri="%s",response=%s,%d', $authcid, $challenge['realm'], $challenge['nonce'], $cnonce, $digest_uri, $response_value, $challenge['maxbuf']);
} else {
return PEAR::raiseError('Invalid digest challenge');
}
}
/**
* Parses and verifies the digest challenge*
*
* @param string $challenge The digest challenge
* @return array The parsed challenge as an assoc
* array in the form "directive => value".
* @access private
*/
function _parseChallenge($challenge)
{
$tokens = array();
while (preg_match('/^([a-z-]+)=("[^"]+(?<!\\\)"|[^,]+)/i', $challenge, $matches)) {
 
// Ignore these as per rfc2831
if ($matches[1] == 'opaque' OR $matches[1] == 'domain') {
$challenge = substr($challenge, strlen($matches[0]) + 1);
continue;
}
 
// Allowed multiple "realm" and "auth-param"
if (!empty($tokens[$matches[1]]) AND ($matches[1] == 'realm' OR $matches[1] == 'auth-param')) {
if (is_array($tokens[$matches[1]])) {
$tokens[$matches[1]][] = preg_replace('/^"(.*)"$/', '\\1', $matches[2]);
} else {
$tokens[$matches[1]] = array($tokens[$matches[1]], preg_replace('/^"(.*)"$/', '\\1', $matches[2]));
}
 
// Any other multiple instance = failure
} elseif (!empty($tokens[$matches[1]])) {
$tokens = array();
break;
 
} else {
$tokens[$matches[1]] = preg_replace('/^"(.*)"$/', '\\1', $matches[2]);
}
 
// Remove the just parsed directive from the challenge
$challenge = substr($challenge, strlen($matches[0]) + 1);
}
 
/**
* Defaults and required directives
*/
// Realm
if (empty($tokens['realm'])) {
$uname = posix_uname();
$tokens['realm'] = $uname['nodename'];
}
// Maxbuf
if (empty($tokens['maxbuf'])) {
$tokens['maxbuf'] = 65536;
}
// Required: nonce, algorithm
if (empty($tokens['nonce']) OR empty($tokens['algorithm'])) {
return array();
}
return $tokens;
}
 
/**
* Creates the response= part of the digest response
*
* @param string $authcid Authentication id (username)
* @param string $pass Password
* @param string $realm Realm as provided by the server
* @param string $nonce Nonce as provided by the server
* @param string $cnonce Client nonce
* @param string $digest_uri The digest-uri= value part of the response
* @param string $authzid Authorization id
* @return string The response= part of the digest response
* @access private
*/
function _getResponseValue($authcid, $pass, $realm, $nonce, $cnonce, $digest_uri, $authzid = '')
{
if ($authzid == '') {
$A1 = sprintf('%s:%s:%s', pack('H32', md5(sprintf('%s:%s:%s', $authcid, $realm, $pass))), $nonce, $cnonce);
} else {
$A1 = sprintf('%s:%s:%s:%s', pack('H32', md5(sprintf('%s:%s:%s', $authcid, $realm, $pass))), $nonce, $cnonce, $authzid);
}
$A2 = 'AUTHENTICATE:' . $digest_uri;
return md5(sprintf('%s:%s:00000001:%s:auth:%s', md5($A1), $nonce, $cnonce, md5($A2)));
}
 
/**
* Creates the client nonce for the response
*
* @return string The cnonce value
* @access private
*/
function _getCnonce()
{
if (file_exists('/dev/urandom')) {
return base64_encode(fread(fopen('/dev/urandom', 'r'), 32));
 
} elseif (file_exists('/dev/random')) {
return base64_encode(fread(fopen('/dev/random', 'r'), 32));
 
} else {
$str = '';
mt_srand((double)microtime()*10000000);
for ($i=0; $i<32; $i++) {
$str .= chr(mt_rand(0, 255));
}
return base64_encode($str);
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Auth/SASL/Anonymous.php
New file
0,0 → 1,71
<?php
// +-----------------------------------------------------------------------+
// | Copyright (c) 2002-2003 Richard Heyes |
// | All rights reserved. |
// | |
// | Redistribution and use in source and binary forms, with or without |
// | modification, are permitted provided that the following conditions |
// | are met: |
// | |
// | o Redistributions of source code must retain the above copyright |
// | notice, this list of conditions and the following disclaimer. |
// | o Redistributions in binary form must reproduce the above copyright |
// | notice, this list of conditions and the following disclaimer in the |
// | documentation and/or other materials provided with the distribution.|
// | o The names of the authors may not be used to endorse or promote |
// | products derived from this software without specific prior written |
// | permission. |
// | |
// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
// | |
// +-----------------------------------------------------------------------+
// | Author: Richard Heyes <richard@php.net> |
// +-----------------------------------------------------------------------+
//
// $Id: Anonymous.php,v 1.1 2006-12-14 15:04:29 jp_milcent Exp $
 
/**
* Implmentation of ANONYMOUS SASL mechanism
*
* @author Richard Heyes <richard@php.net>
* @access public
* @version 1.0
* @package Auth_SASL
*/
 
require_once('Auth/SASL/Common.php');
 
class Auth_SASL_Anonymous extends Auth_SASL_Common
{
/**
* Not much to do here except return the token supplied.
* No encoding, hashing or encryption takes place for this
* mechanism, simply one of:
* o An email address
* o An opaque string not containing "@" that can be interpreted
* by the sysadmin
* o Nothing
*
* We could have some logic here for the second option, but this
* would by no means create something interpretable.
*
* @param string $token Optional email address or string to provide
* as trace information.
* @return string The unaltered input token
*/
function getResponse($token = '')
{
return $token;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Auth/SASL/Common.php
New file
0,0 → 1,74
<?php
// +-----------------------------------------------------------------------+
// | Copyright (c) 2002-2003 Richard Heyes |
// | All rights reserved. |
// | |
// | Redistribution and use in source and binary forms, with or without |
// | modification, are permitted provided that the following conditions |
// | are met: |
// | |
// | o Redistributions of source code must retain the above copyright |
// | notice, this list of conditions and the following disclaimer. |
// | o Redistributions in binary form must reproduce the above copyright |
// | notice, this list of conditions and the following disclaimer in the |
// | documentation and/or other materials provided with the distribution.|
// | o The names of the authors may not be used to endorse or promote |
// | products derived from this software without specific prior written |
// | permission. |
// | |
// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
// | |
// +-----------------------------------------------------------------------+
// | Author: Richard Heyes <richard@php.net> |
// +-----------------------------------------------------------------------+
//
// $Id: Common.php,v 1.1 2006-12-14 15:04:29 jp_milcent Exp $
 
/**
* Common functionality to SASL mechanisms
*
* @author Richard Heyes <richard@php.net>
* @access public
* @version 1.0
* @package Auth_SASL
*/
 
class Auth_SASL_Common
{
/**
* Function which implements HMAC MD5 digest
*
* @param string $key The secret key
* @param string $data The data to protect
* @return string The HMAC MD5 digest
*/
function _HMAC_MD5($key, $data)
{
if (strlen($key) > 64) {
$key = pack('H32', md5($key));
}
 
if (strlen($key) < 64) {
$key = str_pad($key, 64, chr(0));
}
 
$k_ipad = substr($key, 0, 64) ^ str_repeat(chr(0x36), 64);
$k_opad = substr($key, 0, 64) ^ str_repeat(chr(0x5C), 64);
 
$inner = pack('H32', md5($k_ipad . $data));
$digest = md5($k_opad . $inner);
 
return $digest;
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Auth/SASL/CramMD5.php
New file
0,0 → 1,68
<?php
// +-----------------------------------------------------------------------+
// | Copyright (c) 2002-2003 Richard Heyes |
// | All rights reserved. |
// | |
// | Redistribution and use in source and binary forms, with or without |
// | modification, are permitted provided that the following conditions |
// | are met: |
// | |
// | o Redistributions of source code must retain the above copyright |
// | notice, this list of conditions and the following disclaimer. |
// | o Redistributions in binary form must reproduce the above copyright |
// | notice, this list of conditions and the following disclaimer in the |
// | documentation and/or other materials provided with the distribution.|
// | o The names of the authors may not be used to endorse or promote |
// | products derived from this software without specific prior written |
// | permission. |
// | |
// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
// | |
// +-----------------------------------------------------------------------+
// | Author: Richard Heyes <richard@php.net> |
// +-----------------------------------------------------------------------+
//
// $Id: CramMD5.php,v 1.1 2006-12-14 15:04:29 jp_milcent Exp $
 
/**
* Implmentation of CRAM-MD5 SASL mechanism
*
* @author Richard Heyes <richard@php.net>
* @access public
* @version 1.0
* @package Auth_SASL
*/
 
require_once('Auth/SASL/Common.php');
 
class Auth_SASL_CramMD5 extends Auth_SASL_Common
{
/**
* Implements the CRAM-MD5 SASL mechanism
* This DOES NOT base64 encode the return value,
* you will need to do that yourself.
*
* @param string $user Username
* @param string $pass Password
* @param string $challenge The challenge supplied by the server.
* this should be already base64_decoded.
*
* @return string The string to pass back to the server, of the form
* "<user> <digest>". This is NOT base64_encoded.
*/
function getResponse($user, $pass, $challenge)
{
return $user . ' ' . $this->_HMAC_MD5($pass, $challenge);
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Auth/SASL/Login.php
New file
0,0 → 1,65
<?php
// +-----------------------------------------------------------------------+
// | Copyright (c) 2002-2003 Richard Heyes |
// | All rights reserved. |
// | |
// | Redistribution and use in source and binary forms, with or without |
// | modification, are permitted provided that the following conditions |
// | are met: |
// | |
// | o Redistributions of source code must retain the above copyright |
// | notice, this list of conditions and the following disclaimer. |
// | o Redistributions in binary form must reproduce the above copyright |
// | notice, this list of conditions and the following disclaimer in the |
// | documentation and/or other materials provided with the distribution.|
// | o The names of the authors may not be used to endorse or promote |
// | products derived from this software without specific prior written |
// | permission. |
// | |
// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
// | |
// +-----------------------------------------------------------------------+
// | Author: Richard Heyes <richard@php.net> |
// +-----------------------------------------------------------------------+
//
// $Id: Login.php,v 1.1 2006-12-14 15:04:29 jp_milcent Exp $
 
/**
* This is technically not a SASL mechanism, however
* it's used by Net_Sieve, Net_Cyrus and potentially
* other protocols , so here is a good place to abstract
* it.
*
* @author Richard Heyes <richard@php.net>
* @access public
* @version 1.0
* @package Auth_SASL
*/
 
require_once('Auth/SASL/Common.php');
 
class Auth_SASL_Login extends Auth_SASL_Common
{
/**
* Pseudo SASL LOGIN mechanism
*
* @param string $user Username
* @param string $pass Password
* @return string LOGIN string
*/
function getResponse($user, $pass)
{
return sprintf('LOGIN %s %s', $user, $pass);
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Auth/HTTP.php
New file
0,0 → 1,795
<?php
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2004 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Martin Jansen <mj@php.net> |
// | Rui Hirokawa <hirokawa@php.net> |
// | David Costa <gurugeek@php.net> |
// +----------------------------------------------------------------------+
//
// $Id: HTTP.php,v 1.1 2006-12-14 15:04:28 jp_milcent Exp $
//
 
require_once "Auth/Auth.php";
 
define('AUTH_HTTP_NONCE_TIME_LEN', 16);
define('AUTH_HTTP_NONCE_HASH_LEN', 32);
 
// {{{ class Auth_HTTP
 
/**
* PEAR::Auth_HTTP
*
* The PEAR::Auth_HTTP class provides methods for creating an
* HTTP authentication system based on RFC-2617 using PHP.
*
* Instead of generating an HTML driven form like PEAR::Auth
* does, this class sends header commands to the clients which
* cause them to present a login box like they are e.g. used
* in Apache's .htaccess mechanism.
*
* This class requires the PEAR::Auth package.
*
* @notes The HTTP Digest Authentication part is based on
* authentication class written by Tom Pike <tom.pike@xiven.com>
*
* @author Martin Jansen <mj@php.net>
* @author Rui Hirokawa <hirokawa@php.net>
* @author David Costa <gurugeek@php.net>
* @package Auth_HTTP
* @extends Auth
* @version $Revision: 1.1 $
*/
class Auth_HTTP extends Auth
{
// {{{ properties
 
/**
* Authorization method: 'basic' or 'digest'
*
* @access public
* @var string
*/
var $authType = 'basic';
/**
* Name of the realm for Basic Authentication
*
* @access public
* @var string
* @see drawLogin()
*/
var $realm = "protected area";
 
/**
* Text to send if user hits cancel button
*
* @access public
* @var string
* @see drawLogin()
*/
var $CancelText = "Error 401 - Access denied";
 
/**
* option array
*
* @access public
* @var array
*/
var $options = array();
 
/**
* flag to indicate the nonce was stale.
*
* @access public
* @var bool
*/
var $stale = false;
 
/**
* opaque string for digest authentication
*
* @access public
* @var string
*/
var $opaque = 'dummy';
 
/**
* digest URI
*
* @access public
* @var string
*/
var $uri = '';
 
/**
* authorization info returned by the client
*
* @access public
* @var array
*/
var $auth = array();
 
/**
* next nonce value
*
* @access public
* @var string
*/
var $nextNonce = '';
 
/**
* nonce value
*
* @access public
* @var string
*/
var $nonce = '';
 
/**
* Holds a reference to the global server variable
* @var array
*/
var $server;
 
/**
* Holds a reference to the global post variable
* @var array
*/
var $post;
 
/**
* Holds a reference to the global cookie variable
* @var array
*/
var $cookie;
 
 
// }}}
// {{{ Constructor
 
/**
* Constructor
*
* @param string Type of the storage driver
* @param mixed Additional options for the storage driver
* (example: if you are using DB as the storage
* driver, you have to pass the dsn string here)
*
* @return void
*/
function Auth_HTTP($storageDriver, $options = '')
{
/* set default values for options */
$this->options = array('cryptType' => 'md5',
'algorithm' => 'MD5',
'qop' => 'auth-int,auth',
'opaquekey' => 'moo',
'noncekey' => 'moo',
'digestRealm' => 'protected area',
'forceDigestOnly' => false,
'nonceLife' => 300,
'sessionSharing' => true,
);
if (!empty($options['authType'])) {
$this->authType = strtolower($options['authType']);
}
if (is_array($options)) {
foreach($options as $key => $value) {
if (array_key_exists( $key, $this->options)) {
$this->options[$key] = $value;
}
}
if (!empty($this->options['opaquekey'])) {
$this->opaque = md5($this->options['opaquekey']);
}
}
$this->Auth($storageDriver, $options);
}
// }}}
// {{{ assignData()
 
/**
* Assign values from $PHP_AUTH_USER and $PHP_AUTH_PW or 'Authorization' header
* to internal variables and sets the session id based
* on them
*
* @access public
* @return void
*/
function assignData()
{
if (method_exists($this, '_importGlobalVariable')) {
$this->server = &$this->_importGlobalVariable('server');
}
if ($this->authType == 'basic') {
if (!empty($this->server['PHP_AUTH_USER'])) {
$this->username = $this->server['PHP_AUTH_USER'];
}
if (!empty($this->server['PHP_AUTH_PW'])) {
$this->password = $this->server['PHP_AUTH_PW'];
}
/**
* Try to get authentication information from IIS
*/
if (empty($this->username) && empty($this->password)) {
if (!empty($this->server['HTTP_AUTHORIZATION'])) {
list($this->username, $this->password) =
explode(':', base64_decode(substr($this->server['HTTP_AUTHORIZATION'], 6)));
}
}
} elseif ($this->authType == 'digest') {
$this->username = '';
$this->password = '';
 
$this->digest_header = null;
if (!empty($this->server['PHP_AUTH_DIGEST'])) {
$this->digest_header = substr($this->server['PHP_AUTH_DIGEST'],
strpos($this->server['PHP_AUTH_DIGEST'],' ')+1);
} else {
$headers = getallheaders();
if(isset($headers['Authorization']) && !empty($headers['Authorization'])) {
$this->digest_header = substr($headers['Authorization'],
strpos($headers['Authorization'],' ')+1);
}
}
 
if($this->digest_header) {
$authtemp = explode(',', $this->digest_header);
$auth = array();
foreach($authtemp as $key => $value) {
$value = trim($value);
if(strpos($value,'=') !== false) {
$lhs = substr($value,0,strpos($value,'='));
$rhs = substr($value,strpos($value,'=')+1);
if(substr($rhs,0,1) == '"' && substr($rhs,-1,1) == '"') {
$rhs = substr($rhs,1,-1);
}
$auth[$lhs] = $rhs;
}
}
}
if (!isset($auth['uri']) || !isset($auth['realm'])) {
return;
}
if ($this->selfURI() == $auth['uri']) {
$this->uri = $auth['uri'];
if (substr($headers['Authorization'],0,7) == 'Digest ') {
$this->authType = 'digest';
 
if (!isset($auth['nonce']) || !isset($auth['username']) ||
!isset($auth['response']) || !isset($auth['qop']) ||
!isset($auth['nc']) || !isset($auth['cnonce'])){
return;
}
 
if ($auth['qop'] != 'auth' && $auth['qop'] != 'auth-int') {
return;
}
$this->stale = $this->_judgeStale($auth['nonce']);
 
if ($this->nextNonce == false) {
return;
}
 
$this->username = $auth['username'];
$this->password = $auth['response'];
$this->auth['nonce'] = $auth['nonce'];
$this->auth['qop'] = $auth['qop'];
$this->auth['nc'] = $auth['nc'];
$this->auth['cnonce'] = $auth['cnonce'];
 
if (isset($auth['opaque'])) {
$this->auth['opaque'] = $auth['opaque'];
}
} elseif (substr($headers['Authorization'],0,6) == 'Basic ') {
if ($this->options['forceDigestOnly']) {
return; // Basic authentication is not allowed.
}
$this->authType = 'basic';
list($username, $password) =
explode(':',base64_decode(substr($headers['Authorization'],6)));
$this->username = $username;
$this->password = $password;
}
}
} else {
return PEAR::raiseError('authType is invalid.');
}
 
if ($this->options['sessionSharing'] &&
isset($this->username) && isset($this->password)) {
session_id(md5('Auth_HTTP' . $this->username . $this->password));
}
/**
* set sessionName for AUTH, so that the sessionName is different
* for distinct realms
*/
$this->_sessionName = "_authhttp".md5($this->realm);
}
 
// }}}
// {{{ login()
 
/**
* Login function
*
* @access private
* @return void
*/
function login()
{
$login_ok = false;
if (method_exists($this, '_loadStorage')) {
$this->_loadStorage();
}
$this->storage->_auth_obj->_sessionName =& $this->_sessionName;
 
/**
* When the user has already entered a username,
* we have to validate it.
*/
if (!empty($this->username) && !empty($this->password)) {
if ($this->authType == 'basic' && !$this->options['forceDigestOnly']) {
if (true === $this->storage->fetchData($this->username, $this->password)) {
$login_ok = true;
}
} else { /* digest authentication */
 
if (!$this->getAuth() || $this->getAuthData('a1') == null) {
/*
* note:
* - only PEAR::DB is supported as container.
* - password should be stored in container as plain-text
* (if $options['cryptType'] == 'none') or
* A1 hashed form (md5('username:realm:password'))
* (if $options['cryptType'] == 'md5')
*/
$dbs = $this->storage;
if (!DB::isConnection($dbs->db)) {
$dbs->_connect($dbs->options['dsn']);
}
$query = 'SELECT '.$dbs->options['passwordcol']." FROM ".$dbs->options['table'].
' WHERE '.$dbs->options['usernamecol']." = '".
$dbs->db->quoteString($this->username)."' ";
$pwd = $dbs->db->getOne($query); // password stored in container.
if (DB::isError($pwd)) {
return PEAR::raiseError($pwd->getMessage(), $pwd->getCode());
}
if ($this->options['cryptType'] == 'none') {
$a1 = md5($this->username.':'.$this->options['digestRealm'].':'.$pwd);
} else {
$a1 = $pwd;
}
$this->setAuthData('a1', $a1, true);
} else {
$a1 = $this->getAuthData('a1');
}
$login_ok = $this->validateDigest($this->password, $a1);
if ($this->nextNonce == false) {
$login_ok = false;
}
}
if (!$login_ok && is_callable($this->loginFailedCallback)) {
call_user_func($this->loginFailedCallback,$this->username, $this);
}
}
if (!empty($this->username) && $login_ok) {
$this->setAuth($this->username);
if (is_callable($this->loginCallback)) {
call_user_func($this->loginCallback,$this->username, $this);
}
}
/**
* If the login failed or the user entered no username,
* output the login screen again.
*/
if (!empty($this->username) && !$login_ok) {
$this->status = AUTH_WRONG_LOGIN;
}
if ((empty($this->username) || !$login_ok) && $this->showLogin) {
$this->drawLogin($this->storage->activeUser);
return;
}
 
if (!empty($this->username) && $login_ok && $this->authType == 'digest'
&& $this->auth['qop'] == 'auth') {
$this->authenticationInfo();
}
}
// }}}
// {{{ drawLogin()
 
/**
* Launch the login box
*
* @param string $username Username
* @return void
* @access private
*/
function drawLogin($username = "")
{
/**
* Send the header commands
*/
if ($this->authType == 'basic') {
header("WWW-Authenticate: Basic realm=\"".$this->realm."\"");
header('HTTP/1.0 401 Unauthorized');
} else if ($this->authType == 'digest') {
$this->nonce = $this->_getNonce();
 
$wwwauth = 'WWW-Authenticate: Digest ';
$wwwauth .= 'qop="'.$this->options['qop'].'", ';
$wwwauth .= 'algorithm='.$this->options['algorithm'].', ';
$wwwauth .= 'realm="'.$this->options['digestRealm'].'", ';
$wwwauth .= 'nonce="'.$this->nonce.'", ';
if ($this->stale) {
$wwwauth .= 'stale=true, ';
}
if (!empty($this->opaque)) {
$wwwauth .= 'opaque="'.$this->opaque.'"' ;
}
$wwwauth .= "\r\n";
if (!$this->options['forceDigestOnly']) {
$wwwauth .= 'WWW-Authenticate: Basic realm="'.$this->realm.'"';
}
header($wwwauth);
header('HTTP/1.0 401 Unauthorized');
}
 
/**
* This code is only executed if the user hits the cancel
* button or if he enters wrong data 3 times.
*/
if ($this->stale) {
echo 'Stale nonce value, please re-authenticate.';
} else {
echo $this->CancelText;
}
exit;
}
 
// }}}
// {{{ setRealm()
 
/**
* Set name of the current realm
*
* @access public
* @param string $realm Name of the realm
* @param string $digestRealm Name of the realm for digest authentication
* @return void
*/
function setRealm($realm, $digestRealm = '')
{
$this->realm = $realm;
if (!empty($digestRealm)) {
$this->options['digestRealm'] = $digestRealm;
}
}
 
// }}}
// {{{ setCancelText()
 
/**
* Set the text to send if user hits the cancel button
*
* @access public
* @param string $text Text to send
* @return void
*/
function setCancelText($text)
{
$this->CancelText = $text;
}
 
// }}}
// {{{ validateDigest()
/**
* judge if the client response is valid.
*
* @access private
* @param string $response client response
* @param string $a1 password or hashed password stored in container
* @return bool true if success, false otherwise
*/
function validateDigest($response, $a1)
{
if (method_exists($this, '_importGlobalVariable')) {
$this->server = &$this->_importGlobalVariable('server');
}
 
$a2unhashed = $this->server['REQUEST_METHOD'].":".$this->selfURI();
if($this->auth['qop'] == 'auth-int') {
if(isset($GLOBALS["HTTP_RAW_POST_DATA"])) {
// In PHP < 4.3 get raw POST data from this variable
$body = $GLOBALS["HTTP_RAW_POST_DATA"];
} else if($lines = @file('php://input')) {
// In PHP >= 4.3 get raw POST data from this file
$body = implode("\n", $lines);
} else {
if (method_exists($this, '_importGlobalVariable')) {
$this->post = &$this->_importGlobalVariable('post');
}
$body = '';
foreach($this->post as $key => $value) {
if($body != '') $body .= '&';
$body .= rawurlencode($key) . '=' . rawurlencode($value);
}
}
 
$a2unhashed .= ':'.md5($body);
}
$a2 = md5($a2unhashed);
$combined = $a1.':'.
$this->auth['nonce'].':'.
$this->auth['nc'].':'.
$this->auth['cnonce'].':'.
$this->auth['qop'].':'.
$a2;
$expectedResponse = md5($combined);
if(!isset($this->auth['opaque']) || $this->auth['opaque'] == $this->opaque) {
if($response == $expectedResponse) { // password is valid
if(!$this->stale) {
return true;
} else {
$this->drawLogin();
}
}
}
return false;
}
// }}}
// {{{ _judgeStale()
/**
* judge if nonce from client is stale.
*
* @access private
* @param string $nonce nonce value from client
* @return bool stale
*/
function _judgeStale($nonce)
{
$stale = false;
if(!$this->_decodeNonce($nonce, $time, $hash_cli)) {
$this->nextNonce = false;
$stale = true;
return $stale;
}
 
if ($time < time() - $this->options['nonceLife']) {
$this->nextNonce = $this->_getNonce();
$stale = true;
} else {
$this->nextNonce = $nonce;
}
 
return $stale;
}
// }}}
// {{{ _nonceDecode()
/**
* decode nonce string
*
* @access private
* @param string $nonce nonce value from client
* @param string $time decoded time
* @param string $hash decoded hash
* @return bool false if nonce is invalid
*/
function _decodeNonce($nonce, &$time, &$hash)
{
if (method_exists($this, '_importGlobalVariable')) {
$this->server = &$this->_importGlobalVariable('server');
}
 
if (strlen($nonce) != AUTH_HTTP_NONCE_TIME_LEN + AUTH_HTTP_NONCE_HASH_LEN) {
return false;
}
 
$time = base64_decode(substr($nonce, 0, AUTH_HTTP_NONCE_TIME_LEN));
$hash_cli = substr($nonce, AUTH_HTTP_NONCE_TIME_LEN, AUTH_HTTP_NONCE_HASH_LEN);
 
$hash = md5($time . $this->server['HTTP_USER_AGENT'] . $this->options['noncekey']);
 
if ($hash_cli != $hash) {
return false;
}
return true;
}
 
// }}}
// {{{ _getNonce()
/**
* return nonce to detect timeout
*
* @access private
* @return string nonce value
*/
function _getNonce()
{
if (method_exists($this, '_importGlobalVariable')) {
$this->server = &$this->_importGlobalVariable('server');
}
 
$time = time();
$hash = md5($time . $this->server['HTTP_USER_AGENT'] . $this->options['noncekey']);
 
return base64_encode($time) . $hash;
}
 
// }}}
// {{{ authenticationInfo()
/**
* output HTTP Authentication-Info header
*
* @notes md5 hash of contents is required if 'qop' is 'auth-int'
*
* @access private
* @param string MD5 hash of content
*/
function authenticationInfo($contentMD5 = '') {
if($this->getAuth() && ($this->getAuthData('a1') != null)) {
$a1 = $this->getAuthData('a1');
 
// Work out authorisation response
$a2unhashed = ":".$this->selfURI();
if($this->auth['qop'] == 'auth-int') {
$a2unhashed .= ':'.$contentMD5;
}
$a2 = md5($a2unhashed);
$combined = $a1.':'.
$this->nonce.':'.
$this->auth['nc'].':'.
$this->auth['cnonce'].':'.
$this->auth['qop'].':'.
$a2;
// Send authentication info
$wwwauth = 'Authentication-Info: ';
if($this->nonce != $this->nextNonce) {
$wwwauth .= 'nextnonce="'.$this->nextNonce.'", ';
}
$wwwauth .= 'qop='.$this->auth['qop'].', ';
$wwwauth .= 'rspauth="'.md5($combined).'", ';
$wwwauth .= 'cnonce="'.$this->auth['cnonce'].'", ';
$wwwauth .= 'nc='.$this->auth['nc'].'';
header($wwwauth);
}
}
// }}}
// {{{ setOption()
/**
* set authentication option
*
* @access public
* @param mixed $name key of option
* @param mixed $value value of option
* @return void
*/
function setOption($name, $value = null)
{
if (is_array($name)) {
foreach($name as $key => $value) {
if (array_key_exists( $key, $this->options)) {
$this->options[$key] = $value;
}
}
} else {
if (array_key_exists( $name, $this->options)) {
$this->options[$name] = $value;
}
}
}
 
// }}}
// {{{ getOption()
/**
* get authentication option
*
* @access public
* @param string $name key of option
* @return mixed option value
*/
function getOption($name)
{
if (array_key_exists( $name, $this->options)) {
return $this->options[$name];
}
if ($name == 'CancelText') {
return $this->CancelText;
}
if ($name == 'Realm') {
return $this->realm;
}
return false;
}
 
// }}}
// {{{ selfURI()
/**
* get self URI
*
* @access public
* @return string self URI
*/
function selfURI()
{
if (method_exists($this, '_importGlobalVariable')) {
$this->server = &$this->_importGlobalVariable('server');
}
 
if (preg_match("/MSIE/",$this->server['HTTP_USER_AGENT'])) {
// query string should be removed for MSIE
$uri = preg_replace("/^(.*)\?/","\\1",$this->server['REQUEST_URI']);
} else {
$uri = $this->server['REQUEST_URI'];
}
return $uri;
}
 
// }}}
 
}
 
// }}}
 
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/
?>
/tags/Racine_livraison_narmer/api/pear/Auth/Auth.php
New file
0,0 → 1,30
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */
 
/**
* Provide compatibility with previous Auth include location.
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Authentication
* @package Auth
* @author Martin Jansen <mj@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: Auth.php,v 1.2 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/Auth
* @deprecated File deprecated since Release 1.2.0
*/
 
/**
* Include Auth package
*/
require_once 'Auth.php';
 
?>
/tags/Racine_livraison_narmer/api/pear/Auth/Container.php
New file
0,0 → 1,224
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */
 
/**
* Auth_Container Base Class
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Authentication
* @package Auth
* @author Martin Jansen <mj@php.net>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: Container.php,v 1.2 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/Auth
*/
 
/**
* Storage class for fetching login data
*
* @category Authentication
* @package Auth
* @author Martin Jansen <mj@php.net>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version Release: 1.4.3 File: $Revision: 1.2 $
* @link http://pear.php.net/package/Auth
*/
class Auth_Container
{
 
// {{{ properties
 
/**
* User that is currently selected from the storage container.
*
* @access public
*/
var $activeUser = "";
 
// }}}
// {{{ Auth_Container() [constructor]
 
/**
* Constructor
*
* Has to be overwritten by each storage class
*
* @access public
*/
function Auth_Container()
{
}
 
// }}}
// {{{ fetchData()
 
/**
* Fetch data from storage container
*
* Has to be overwritten by each storage class
*
* @access public
*/
function fetchData($username, $password, $isChallengeResponse=false)
{
}
 
// }}}
// {{{ verifyPassword()
 
/**
* Crypt and verfiy the entered password
*
* @param string Entered password
* @param string Password from the data container (usually this password
* is already encrypted.
* @param string Type of algorithm with which the password from
* the container has been crypted. (md5, crypt etc.)
* Defaults to "md5".
* @return bool True, if the passwords match
*/
function verifyPassword($password1, $password2, $cryptType = "md5")
{
switch ($cryptType) {
case "crypt" :
return ((string)crypt($password1, $password2) === (string)$password2);
break;
case "none" :
case "" :
return ((string)$password1 === (string)$password2);
break;
case "md5" :
return ((string)md5($password1) === (string)$password2);
break;
default :
if (function_exists($cryptType)) {
return ((string)$cryptType($password1) === (string)$password2);
} elseif (method_exists($this,$cryptType)) {
return ((string)$this->$cryptType($password1) === (string)$password2);
} else {
return false;
}
break;
}
}
 
// }}}
// {{{ supportsChallengeResponse()
/**
* Returns true if the container supports Challenge Response
* password authentication
*/
function supportsChallengeResponse()
{
return(false);
}
 
// }}}
// {{{ getCryptType()
/**
* Returns the crypt current crypt type of the container
*
* @return string
*/
function getCryptType()
{
return('');
}
 
// }}}
// {{{ listUsers()
 
/**
* List all users that are available from the storage container
*/
function listUsers()
{
return AUTH_METHOD_NOT_SUPPORTED;
}
 
// }}}
// {{{ getUser()
 
/**
* Returns a user assoc array
*
* Containers which want should overide this
*
* @param string The username
*/
function getUser($username)
{
$users = $this->listUsers();
if ($users === AUTH_METHOD_NOT_SUPPORTED) {
return AUTH_METHOD_NOT_SUPPORTED;
}
for ($i=0; $c = count($users), $i<$c; $i++) {
if ($users[$i]['username'] == $username) {
return $users[$i];
}
}
return false;
}
 
// }}}
// {{{ addUser()
 
/**
* Add a new user to the storage container
*
* @param string Username
* @param string Password
* @param array Additional information
*
* @return boolean
*/
function addUser($username, $password, $additional=null)
{
return AUTH_METHOD_NOT_SUPPORTED;
}
 
// }}}
// {{{ removeUser()
 
/**
* Remove user from the storage container
*
* @param string Username
*/
function removeUser($username)
{
return AUTH_METHOD_NOT_SUPPORTED;
}
 
// }}}
// {{{ changePassword()
 
/**
* Change password for user in the storage container
*
* @param string Username
* @param string The new password
*/
function changePassword($username, $password)
{
return AUTH_METHOD_NOT_SUPPORTED;
}
 
// }}}
 
}
 
?>
/tags/Racine_livraison_narmer/api/pear/Auth/SASL.php
New file
0,0 → 1,98
<?php
// +-----------------------------------------------------------------------+
// | Copyright (c) 2002-2003 Richard Heyes |
// | All rights reserved. |
// | |
// | Redistribution and use in source and binary forms, with or without |
// | modification, are permitted provided that the following conditions |
// | are met: |
// | |
// | o Redistributions of source code must retain the above copyright |
// | notice, this list of conditions and the following disclaimer. |
// | o Redistributions in binary form must reproduce the above copyright |
// | notice, this list of conditions and the following disclaimer in the |
// | documentation and/or other materials provided with the distribution.|
// | o The names of the authors may not be used to endorse or promote |
// | products derived from this software without specific prior written |
// | permission. |
// | |
// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
// | |
// +-----------------------------------------------------------------------+
// | Author: Richard Heyes <richard@php.net> |
// +-----------------------------------------------------------------------+
//
// $Id: SASL.php,v 1.1 2006-12-14 15:04:28 jp_milcent Exp $
 
/**
* Client implementation of various SASL mechanisms
*
* @author Richard Heyes <richard@php.net>
* @access public
* @version 1.0
* @package Auth_SASL
*/
 
require_once('PEAR.php');
 
class Auth_SASL
{
/**
* Factory class. Returns an object of the request
* type.
*
* @param string $type One of: Anonymous
* Plain
* CramMD5
* DigestMD5
* Types are not case sensitive
*/
function &factory($type)
{
switch (strtolower($type)) {
case 'anonymous':
$filename = 'Auth/SASL/Anonymous.php';
$classname = 'Auth_SASL_Anonymous';
break;
 
case 'login':
$filename = 'Auth/SASL/Login.php';
$classname = 'Auth_SASL_Login';
break;
 
case 'plain':
$filename = 'Auth/SASL/Plain.php';
$classname = 'Auth_SASL_Plain';
break;
 
case 'crammd5':
$filename = 'Auth/SASL/CramMD5.php';
$classname = 'Auth_SASL_CramMD5';
break;
 
case 'digestmd5':
$filename = 'Auth/SASL/DigestMD5.php';
$classname = 'Auth_SASL_DigestMD5';
break;
 
default:
return PEAR::raiseError('Invalid SASL mechanism type');
break;
}
 
require_once($filename);
return new $classname();
}
}
 
?>
/tags/Racine_livraison_narmer/api/pear/Auth/Controller.php
New file
0,0 → 1,302
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */
 
/**
* Auth Controller
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Authentication
* @package Auth
* @author Yavor Shahpasov <yavo@netsmart.com.cy>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: Controller.php,v 1.1 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/Auth
* @since File available since Release 1.3.0
*/
 
/**
* Controlls access to a group of php access
* and redirects to a predefined login page as
* needed
*
* In all pages
* <code>
* include_once('Auth.php');
* include_once('Auth/Controller.php');
* $_auth = new Auth('File', 'passwd');
* $authController = new Auth_Controller($_auth, 'login.php', 'index.php');
* $authController->start();
* </code>
*
* In login.php
* <code>
* include_once('Auth.php');
* include_once('Auth/Controller.php');
* $_auth = new Auth('File', 'passwd');
* $authController = new Auth_Controller($_auth, 'login.php', 'index.php');
* $authController->start();
* if( $authController->isAuthorised() ){
* $authController->redirectBack();
* }
* </code>
*
* @category Authentication
* @author Yavor Shahpasov <yavo@netsmart.com.cy>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version Release: 1.4.3 File: $Revision: 1.1 $
* @link http://pear.php.net/package/Auth
* @since Class available since Release 1.3.0
*/
class Auth_Controller
{
 
// {{{ properties
 
/**
* The Auth instance this controller is managing
*
* @var object Auth
*/
var $auth = null;
/**
* The login URL
* @var string
* */
var $login = null;
/**
* The default index page to use when the caller page is not set
*
* @var string
*/
var $default = null;
/**
* If this is set to true after a succesfull login the
* Auth_Controller::redirectBack() is invoked automatically
*
* @var boolean
*/
var $autoRedirectBack = false;
 
// }}}
// {{{ Auth_Controller() [constructor]
/**
* Constructor
*
* @param Auth An auth instance
* @param string The login page
* @param string The default page to go to if return page is not set
* @param array Some rules about which urls need to be sent to the login page
* @return void
* @todo Add a list of urls which need redirection
*/
function Auth_Controller(&$auth_obj, $login='login.php', $default='index.php', $accessList=array())
{
$this->auth =& $auth_obj;
$this->_loginPage = $login;
$this->_defaultPage = $default;
@session_start();
if (!empty($_GET['return']) && $_GET['return'] && !strstr($_GET['return'], $this->_loginPage)) {
$this->auth->setAuthData('returnUrl', $_GET['return']);
}
 
if(!empty($_GET['authstatus']) && $this->auth->status == '') {
$this->auth->status = $_GET['authstatus'];
}
}
 
// }}}
// {{{ setAutoRedirectBack()
/**
* Enables auto redirection when login is done
*
* @param bool Sets the autoRedirectBack flag to this
* @see Auth_Controller::autoRedirectBack
* @return void
*/
function setAutoRedirectBack($flag = true)
{
$this->autoRedirectBack = $flag;
}
 
// }}}
// {{{ redirectBack()
/**
* Redirects Back to the calling page
*
* @return void
*/
function redirectBack()
{
// If redirectback go there
// else go to the default page
$returnUrl = $this->auth->getAuthData('returnUrl');
if(!$returnUrl) {
$returnUrl = $this->_defaultPage;
}
// Add some entropy to the return to make it unique
// avoind problems with cached pages and proxies
if(strpos($returnUrl, '?') === false) {
$returnUrl .= '?';
}
$returnUrl .= uniqid('');
 
// Track the auth status
if($this->auth->status != '') {
$url .= '&authstatus='.$this->auth->status;
}
header('Location:'.$returnUrl);
print("You could not be redirected to <a href=\"$returnUrl\">$returnUrl</a>");
}
 
// }}}
// {{{ redirectLogin()
/**
* Redirects to the login Page if not authorised
*
* put return page on the query or in auth
*
* @return void
*/
function redirectLogin()
{
// Go to the login Page
// For Auth, put some check to avoid infinite redirects, this should at least exclude
// the login page
$url = $this->_loginPage;
if(strpos($url, '?') === false) {
$url .= '?';
}
 
if(!strstr($_SERVER['PHP_SELF'], $this->_loginPage)) {
$url .= 'return='.urlencode($_SERVER['PHP_SELF']);
}
 
// Track the auth status
if($this->auth->status != '') {
$url .= '&authstatus='.$this->auth->status;
}
 
header('Location:'.$url);
print("You could not be redirected to <a href=\"$url\">$url</a>");
}
 
// }}}
// {{{ start()
/**
* Starts the Auth Procedure
*
* If the page requires login the user is redirected to the login page
* otherwise the Auth::start is called to initialize Auth
*
* @return void
* @todo Implement an access list which specifies which urls/pages need login and which do not
*/
function start()
{
// Check the accessList here
// ACL should be a list of urls with allow/deny
// If allow set allowLogin to false
// Some wild card matching should be implemented ?,*
if(!strstr($_SERVER['PHP_SELF'], $this->_loginPage) && !$this->auth->checkAuth()) {
$this->redirectLogin();
} else {
$this->auth->start();
// Logged on and on login page
if(strstr($_SERVER['PHP_SELF'], $this->_loginPage) && $this->auth->checkAuth()){
$this->autoRedirectBack ?
$this->redirectBack() :
null ;
}
}
}
 
// }}}
// {{{ isAuthorised()
/**
* Checks is the user is logged on
* @see Auth::checkAuth()
*/
function isAuthorised()
{
return($this->auth->checkAuth());
}
 
// }}}
// {{{ checkAuth()
 
/**
* Proxy call to auth
* @see Auth::checkAuth()
*/
function checkAuth()
{
return($this->auth->checkAuth());
}
 
// }}}
// {{{ logout()
 
/**
* Proxy call to auth
* @see Auth::logout()
*/
function logout()
{
return($this->auth->logout());
}
 
// }}}
// {{{ getUsername()
 
/**
* Proxy call to auth
* @see Auth::getUsername()
*/
function getUsername()
{
return($this->auth->getUsername());
}
 
// }}}
// {{{ getStatus()
 
/**
* Proxy call to auth
* @see Auth::getStatus()
*/
function getStatus()
{
return($this->auth->getStatus());
}
 
// }}}
 
}
 
?>
/tags/Racine_livraison_narmer/api/pear/Auth/PrefManager.php
New file
0,0 → 1,426
<?php
require_once("DB.php");
 
/**
* A simple preference manager, takes userid, preference name pairs and returns the value
* of that preference.
*
* CREATE TABLE `preferences` (
* `user_id` varchar( 255 ) NOT NULL default '',
* `pref_id` varchar( 32 ) NOT NULL default '',
* `pref_value` longtext NOT NULL ,
* PRIMARY KEY ( `user_id` , `pref_id` )
* )
*
* @author Jon Wood <jon@jellybob.co.uk>
* @package Auth_PrefManager
* @category Authentication
*/
class Auth_PrefManager
{
/**
* The database object.
* @var object
* @access private
*/
var $_db;
 
/**
* The user name to get preferences from if the user specified doesn't
* have that preference set.
* @var string
* @access private
*/
var $_defaultUser = "__default__";
 
/**
* Should we search for default values, or just fail when we find out that
* the specified user didn't have it set.
*
* @var bool
* @access private
*/
var $_returnDefaults = true;
 
/**
* The table containing the preferences.
* @var string
* @access private
*/
var $_table = "preferences";
 
/**
* The column containing user ids.
* @var string
* @access private
*/
var $_userColumn = "user_id";
 
/**
* The column containing preference names.
* @var string
* @access private
*/
var $_nameColumn = "pref_id";
 
/**
* The column containing preference values.
* @var string
* @access private
*/
var $_valueColumn = "pref_value";
 
/**
* The quoted value column.
* @var string
* @access private
*/
var $_valueColumnQuoted = "pref_value";
/**
* The session variable that the cache array is stored in.
* @var string
* @access private
*/
var $_cacheName = "prefCache";
 
/**
* The last error given.
* @var string
* @access private
*/
var $_lastError;
 
/**
* Defines whether the cache should be used or not.
* @var bool
* @access private
*/
var $_useCache = true;
/**
* Defines whether values should be serialized before saving.
* @var bool
* @access private
*/
var $_serialize = false;
/**
* Constructor
*
* Options:
* table: The table to get prefs from. [preferences]
* userColumn: The field name to search for userid's [user_id]
* nameColumn: The field name to search for preference names [pref_name]
* valueColumn: The field name to search for preference values [pref_value]
* defaultUser: The userid assigned to default values [__default__]
* cacheName: The name of cache in the session variable ($_SESSION[cacheName]) [prefsCache]
* useCache: Whether or not values should be cached.
* serialize: Should preference values be serialzed before saving?
*
* @param string $dsn The DSN of the database connection to make, or a DB object.
* @param array $properties An array of properties to set.
* @param string $defaultUser The default user to manage for.
* @return bool Success or failure.
* @access public
*/
function Auth_PrefManager($dsn, $properties = NULL)
{
// Connect to the database.
if (isset($dsn)) {
if (is_string($dsn)) {
$this->_db = DB::Connect($dsn);
if (DB::isError($this->_db)) {
$this->_lastError = "DB Error: ".$this->_db->getMessage();
}
} else if (is_subclass_of($dsn, 'db_common')) {
$this->_db = &$dsn;
} else {
$this->_lastError = "Invalid DSN specified.";
return false;
}
} else {
$this->_lastError = "No DSN specified.";
return false;
}
 
if (is_array($properties)) {
if (isset($properties["table"])) { $this->_table = $this->_db->quoteIdentifier($properties["table"]); }
if (isset($properties["userColumn"])) { $this->_userColumn = $this->_db->quoteIdentifier($properties["userColumn"]); }
if (isset($properties["nameColumn"])) { $this->_nameColumn = $this->_db->quoteIdentifier($properties["nameColumn"]); }
if (isset($properties["valueColumn"])) { $this->_valueColumn = $properties["valueColumn"]; }
if (isset($properties["valueColumn"])) { $this->_valueColumnQuoted = $this->_db->quoteIdentifier($properties["valueColumn"]); }
if (isset($properties["defaultUser"])) { $this->_defaultUser = $properties["defaultUser"]; }
if (isset($properties["cacheName"])) { $this->_cacheName = $properties["cacheName"]; }
if (isset($properties["useCache"])) { $this->_useCache = $properties["useCache"]; }
if (isset($properties["serialize"])) { $this->_serialize = $properties["serialize"]; }
}
 
return true;
}
 
function setReturnDefaults($returnDefaults = true)
{
if (is_bool($returnDefaults)) {
$this->_returnDefaults = $returnDefaults;
}
}
 
/**
* Sets whether the cache should be used.
*
* @param bool $use Should the cache be used.
* @access public
*/
function useCache($use = true)
{
$this->_useCache = $use;
}
/**
* Cleans out the cache.
*
* @access public
*/
function clearCache()
{
unset($_SESSION[$this->_cacheName]);
}
 
/**
* Get a preference for the specified user, or, if returning default values
* is enabled, the default.
*
* @param string $user_id The user to get the preference for.
* @param string $pref_id The preference to get.
* @param bool $showDefaults Should default values be searched (overrides the global setting).
* @return mixed The value if it's found, or NULL if it isn't.
* @access public
*/
function getPref($user_id, $pref_id, $showDefaults = true)
{
if (isset($_SESSION[$this->_cacheName][$user_id][$pref_id]) && $this->_useCache) {
// Value is cached for the specified user, so give them the cached copy.
return $_SESSION[$this->_cacheName][$user_id][$pref_id];
} else {
// Not cached, search the database for this user's preference.
$query = sprintf("SELECT * FROM %s WHERE %s=%s AND %s=%s", $this->_table,
$this->_userColumn,
$this->_db->quote($user_id),
$this->_nameColumn,
$this->_db->quote($pref_id));
$result = $this->_db->query($query);
if (DB::isError($result)) {
// Ouch! The query failed!
$this->_lastError = "DB Error: ".$result->getMessage();
return NULL;
} else if ($result->numRows()) {
// The query found a value, so we can cache that, and then return it.
$row = $result->fetchRow(DB_FETCHMODE_ASSOC);
$_SESSION[$this->_cacheName][$user_id][$pref_id] = $this->_unpack($row[$this->_valueColumn]);
return $_SESSION[$this->_cacheName][$user_id][$pref_id];
} else if ($this->_returnDefaults && $showDefaults) {
// I was doing this with a call to getPref again, but it threw things into an
// infinite loop if the default value didn't exist. If you can fix that, it would
// be great ;)
if (isset($_SESSION[$this->_cacheName][$this->_defaultUser][$pref_id]) && $this->_useCache) {
$_SESSION[$this->_cacheName][$user_id][$pref_id] = $_SESSION[$this->_cacheName][$this->_defaultUser][$pref_id];
return $_SESSION[$this->_cacheName][$this->_defaultUser][$pref_id];
} else {
$query = sprintf("SELECT * FROM %s WHERE %s=%s AND %s=%s", $this->_table,
$this->_userColumn,
$this->_db->quote($this->_defaultUser),
$this->_nameColumn,
$this->_db->quote($pref_id));
$result = $this->_db->query($query);
if (DB::isError($result)) {
$this->_lastError = "DB Error: ".$result->getMessage();
return NULL;
} else {
if ($result->numRows()) {
$row = $result->fetchRow(DB_FETCHMODE_ASSOC);
$_SESSION[$this->_cacheName][$this->_defaultUser][$pref_id] = $this->_unpack($row[$this->_valueColumn]);
$_SESSION[$this->_cacheName][$user_id][$pref_id] = $_SESSION[$this->_cacheName][$this->_defaultUser][$pref_id];
return $_SESSION[$this->_cacheName][$user_id][$pref_id];
} else {
return NULL;
}
}
}
} else {
// We've used up all the resources we're allowed to search, so return a NULL.
return NULL;
}
}
}
 
/**
* A shortcut function for getPref($this->_defaultUser, $pref_id, $value),
* useful if you have a logged in user, but want to get defaults anyway.
*
* @param string $pref_id The name of the preference to get.
* @return mixed The value if it's found, or NULL if it isn't.
* @access public
*/
function getDefaultPref($pref_id)
{
return $this->getPref($this->_defaultUser, $pref_id);
}
 
/**
* Set a preference for the specified user.
*
* @param string $user_id The user to set for.
* @param string $pref_id The preference to set.
* @param mixed $value The value it should be set to.
* @return bool Sucess or failure.
* @access public
*/
function setPref($user_id, $pref_id, $value)
{
// Start off by checking if the preference is already set (if it is we need to do
// an UPDATE, if not, it's an INSERT.
if ($this->_exists($user_id, $pref_id, false)) {
$query = sprintf("UPDATE %s SET %s=%s WHERE %s=%s AND %s=%s", $this->_table,
$this->_valueColumnQuoted,
$this->_db->quote($this->_pack($value)),
$this->_userColumn,
$this->_db->quote($user_id),
$this->_nameColumn,
$this->_db->quote($pref_id));
} else {
$query = sprintf("INSERT INTO %s (%s, %s, %s) VALUES(%s, %s, %s)", $this->_table,
$this->_userColumn,
$this->_nameColumn,
$this->_valueColumnQuoted,
$this->_db->quote($user_id),
$this->_db->quote($pref_id),
$this->_db->quote($this->_pack($value)));
}
$result = $this->_db->query($query);
if (DB::isError($result)) {
$this->_lastError = "DB Error: ".$result->getMessage();
return false;
} else {
if ($this->_useCache) {
$_SESSION[$this->_cacheName][$user_id][$pref_id] = $value;
}
return true;
}
}
 
/**
* A shortcut function for setPref($this->_defaultUser, $pref_id, $value)
*
* @param string $pref_id The name of the preference to set.
* @param mixed $value The value to set it to.
* @return bool Sucess or failure.
* @access public
*/
function setDefaultPref($pref_id, $value)
{
return $this->setPref($this->_defaultUser, $pref_id, $value);
}
 
/**
* Deletes a preference for the specified user.
*
* @param string $user_id The userid of the user to delete from.
* @param string $pref_id The preference to delete.
* @return bool Success/Failure
* @access public
*/
function deletePref($user_id, $pref_id)
{
if ($this->getPref($user_id, $pref_id) == NULL) {
// The user doesn't have this variable anyway ;)
return true;
} else {
$query = sprintf("DELETE FROM %s WHERE %s=%s AND %s=%s", $this->_table,
$this->_userColumn,
$this->_db->quote($user_id),
$this->_nameColumn,
$this->_db->quote($pref_id));
$result = $this->_db->query($query);
if (DB::isError($result)) {
$this->_lastError = "DB Error: ".$result->getMessage();
return false;
} else {
if ($this->_useCache) {
unset($_SESSION[$this->_cacheName][$user_id][$pref_id]);
}
return true;
}
}
}
 
/**
* Deletes a preference for the default user.
*
* @param string $pref_id The preference to delete.
* @return bool Success/Failure
* @access public
*/
function deleteDefaultPref($pref_id)
{
return $this->deletePref($this->_defaultUser, $pref_id);
}
/**
* Checks if a preference exists in the database.
*
* @param string $user_id The userid of the preference owner.
* @param string $pref_id The preference to check for.
* @return bool True if the preference exists.
* @access private
*/
function _exists($user_id, $pref_id)
{
$query = sprintf("SELECT COUNT(%s) FROM %s WHERE %s=%s AND %s=%s", $this->_nameColumn,
$this->_table,
$this->_userColumn,
$this->_db->quoteSmart($user_id),
$this->_nameColumn,
$this->_db->quote($pref_id));
$result = $this->_db->getOne($query);
if (DB::isError($result)) {
$this->_lastError = "DB Error: ".$result->getMessage();
return false;
} else {
return (bool)$result;
}
}
 
/**
* Does anything needed to prepare a value for saving in the database.
*
* @param mixed $value The value to be saved.
* @return string The value in a format valid for saving to the database.
* @access private
*/
function _pack($value)
{
if ($this->_serialize) {
return serialize($value);
} else {
return $value;
}
}
/**
* Does anything needed to create a value of the preference, such as unserializing.
*
* @param string $value The value of the preference.
* @return mixed The unpacked version of the preference.
* @access private
*/
function _unpack($value)
{
if ($this->_serialize) {
return unserialize($value);
} else {
return $value;
}
}
}
?>
/tags/Racine_livraison_narmer/api/pear/Auth/RADIUS.php
New file
0,0 → 1,964
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
/*
Copyright (c) 2003, Michael Bretterklieber <michael@bretterklieber.com>
All rights reserved.
 
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
 
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The names of the authors may not be used to endorse or promote products
derived from this software without specific prior written permission.
 
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
This code cannot simply be copied and put under the GNU Public License or
any other GPL-like (LGPL, GPL2) License.
 
$Id: RADIUS.php,v 1.1 2006-12-14 15:04:28 jp_milcent Exp $
*/
 
require_once 'PEAR.php';
 
/**
* Client implementation of RADIUS. This are wrapper classes for
* the RADIUS PECL.
* Provides RADIUS Authentication (RFC2865) and RADIUS Accounting (RFC2866).
*
* @package Auth_RADIUS
* @author Michael Bretterklieber <michael@bretterklieber.com>
* @access public
* @version $Revision: 1.1 $
*/
 
/**
* class Auth_RADIUS
*
* Abstract base class for RADIUS
*
* @package Auth_RADIUS
*/
class Auth_RADIUS extends PEAR {
 
/**
* List of RADIUS servers.
* @var array
* @see addServer(), putServer()
*/
var $_servers = array();
/**
* Path to the configuration-file.
* @var string
* @see setConfigFile()
*/
var $_configfile = null;
/**
* Resource.
* @var resource
* @see open(), close()
*/
var $res = null;
/**
* Username for authentication and accounting requests.
* @var string
*/
var $username = null;
 
/**
* Password for plaintext-authentication (PAP).
* @var string
*/
var $password = null;
/**
* List of known attributes.
* @var array
* @see dumpAttributes(), getAttributes()
*/
var $attributes = array();
/**
* List of raw attributes.
* @var array
* @see dumpAttributes(), getAttributes()
*/
var $rawAttributes = array();
 
/**
* List of raw vendor specific attributes.
* @var array
* @see dumpAttributes(), getAttributes()
*/
var $rawVendorAttributes = array();
/**
* Constructor
*
* Loads the RADIUS PECL/extension
*
* @return void
*/
function Auth_RADIUS()
{
$this->PEAR();
$this->loadExtension('radius');
}
/**
* Adds a RADIUS server to the list of servers for requests.
*
* At most 10 servers may be specified. When multiple servers
* are given, they are tried in round-robin fashion until a
* valid response is received
*
* @access public
* @param string $servername Servername or IP-Address
* @param integer $port Portnumber
* @param string $sharedSecret Shared secret
* @param integer $timeout Timeout for each request
* @param integer $maxtries Max. retries for each request
* @return void
*/
function addServer($servername = 'localhost', $port = 0, $sharedSecret = 'testing123', $timeout = 3, $maxtries = 3)
{
$this->_servers[] = array($servername, $port, $sharedSecret, $timeout, $maxtries);
}
/**
* Returns an error message, if an error occurred.
*
* @access public
* @return string
*/
function getError()
{
return radius_strerror($this->res);
}
/**
* Sets the configuration-file.
*
* @access public
* @param string $file Path to the configuration file
* @return void
*/
function setConfigfile($file)
{
$this->_configfile = $file;
}
 
/**
* Puts an attribute.
*
* @access public
* @param integer $attrib Attribute-number
* @param mixed $port Attribute-value
* @param type $type Attribute-type
* @return bool true on success, false on error
*/
function putAttribute($attrib, $value, $type = null)
{
if ($type == null) {
$type = gettype($value);
}
switch ($type) {
case 'integer':
return radius_put_int($this->res, $attrib, $value);
case 'addr':
return radius_put_addr($this->res, $attrib, $value);
case 'string':
default:
return radius_put_attr($this->res, $attrib, $value);
}
}
/**
* Puts a vendor-specific attribute.
*
* @access public
* @param integer $vendor Vendor (MSoft, Cisco, ...)
* @param integer $attrib Attribute-number
* @param mixed $port Attribute-value
* @param type $type Attribute-type
* @return bool true on success, false on error
*/
function putVendorAttribute($vendor, $attrib, $value, $type = null)
{
if ($type == null) {
$type = gettype($value);
}
switch ($type) {
case 'integer':
return radius_put_vendor_int($this->res, $vendor, $attrib, $value);
case 'addr':
return radius_put_vendor_addr($this->res, $vendor,$attrib, $value);
case 'string':
default:
return radius_put_vendor_attr($this->res, $vendor, $attrib, $value);
}
}
 
/**
* Prints known attributes received from the server.
*
* @access public
*/
function dumpAttributes()
{
foreach ($this->attributes as $name => $data) {
echo "$name:$data<br>\n";
}
}
/**
* Overwrite this.
*
* @access public
*/
function open()
{
}
 
/**
* Overwrite this.
*
* @access public
*/
function createRequest()
{
}
/**
* Puts standard attributes.
*
* @access public
*/
function putStandardAttributes()
{
if (isset($_SERVER)) {
$var = &$_SERVER;
} else {
$var = &$GLOBALS['HTTP_SERVER_VARS'];
}
$this->putAttribute(RADIUS_NAS_IDENTIFIER, isset($var['HTTP_HOST']) ? $var['HTTP_HOST'] : 'localhost');
$this->putAttribute(RADIUS_NAS_PORT_TYPE, RADIUS_VIRTUAL);
$this->putAttribute(RADIUS_SERVICE_TYPE, RADIUS_FRAMED);
$this->putAttribute(RADIUS_FRAMED_PROTOCOL, RADIUS_PPP);
$this->putAttribute(RADIUS_CALLING_STATION_ID, isset($var['REMOTE_HOST']) ? $var['REMOTE_HOST'] : '127.0.0.1');
}
/**
* Puts custom attributes.
*
* @access public
*/
function putAuthAttributes()
{
if (isset($this->username)) {
$this->putAttribute(RADIUS_USER_NAME, $this->username);
}
}
/**
* Configures the radius library.
*
* @access public
* @param string $servername Servername or IP-Address
* @param integer $port Portnumber
* @param string $sharedSecret Shared secret
* @param integer $timeout Timeout for each request
* @param integer $maxtries Max. retries for each request
* @return bool true on success, false on error
* @see addServer()
*/
function putServer($servername, $port = 0, $sharedsecret = 'testing123', $timeout = 3, $maxtries = 3)
{
if (!radius_add_server($this->res, $servername, $port, $sharedsecret, $timeout, $maxtries)) {
return false;
}
return true;
}
/**
* Configures the radius library via external configurationfile
*
* @access public
* @param string $servername Servername or IP-Address
* @return bool true on success, false on error
*/
function putConfigfile($file)
{
if (!radius_config($this->res, $file)) {
return false;
}
return true;
}
/**
* Initiates a RADIUS request.
*
* @access public
* @return bool true on success, false on errors
*/
function start()
{
if (!$this->open()) {
return false;
}
foreach ($this->_servers as $s) {
// Servername, port, sharedsecret, timeout, retries
if (!$this->putServer($s[0], $s[1], $s[2], $s[3], $s[4])) {
return false;
}
}
if (!empty($this->_configfile)) {
if (!$this->putConfigfile($this->_configfile)) {
return false;
}
}
$this->createRequest();
$this->putStandardAttributes();
$this->putAuthAttributes();
return true;
}
/**
* Sends a prepared RADIUS request and waits for a response
*
* @access public
* @return mixed true on success, false on reject, PEAR_Error on error
*/
function send()
{
$req = radius_send_request($this->res);
if (!$req) {
return $this->raiseError('Error sending request: ' . $this->getError());
}
 
switch($req) {
case RADIUS_ACCESS_ACCEPT:
if (is_subclass_of($this, 'auth_radius_acct')) {
return $this->raiseError('RADIUS_ACCESS_ACCEPT is unexpected for accounting');
}
return true;
 
case RADIUS_ACCESS_REJECT:
return false;
case RADIUS_ACCOUNTING_RESPONSE:
if (is_subclass_of($this, 'auth_radius_pap')) {
return $this->raiseError('RADIUS_ACCOUNTING_RESPONSE is unexpected for authentication');
}
return true;
 
default:
return $this->raiseError("Unexpected return value: $req");
}
}
 
/**
* Reads all received attributes after sending the request.
*
* This methos stores know attributes in the property attributes,
* all attributes (including known attibutes) are stored in rawAttributes
* or rawVendorAttributes.
* NOTE: call this functio also even if the request was rejected, because the
* Server returns usualy an errormessage
*
* @access public
* @return bool true on success, false on error
*/
function getAttributes()
{
 
while ($attrib = radius_get_attr($this->res)) {
 
if (!is_array($attrib)) {
return false;
}
 
$attr = $attrib['attr'];
$data = $attrib['data'];
 
$this->rawAttributes[$attr] = $data;
 
switch ($attr) {
case RADIUS_FRAMED_IP_ADDRESS:
$this->attributes['framed_ip'] = radius_cvt_addr($data);
break;
 
case RADIUS_FRAMED_IP_NETMASK:
$this->attributes['framed_mask'] = radius_cvt_addr($data);
break;
 
case RADIUS_FRAMED_MTU:
$this->attributes['framed_mtu'] = radius_cvt_int($data);
break;
 
case RADIUS_FRAMED_COMPRESSION:
$this->attributes['framed_compression'] = radius_cvt_int($data);
break;
 
case RADIUS_SESSION_TIMEOUT:
$this->attributes['session_timeout'] = radius_cvt_int($data);
break;
 
case RADIUS_IDLE_TIMEOUT:
$this->attributes['idle_timeout'] = radius_cvt_int($data);
break;
 
case RADIUS_SERVICE_TYPE:
$this->attributes['service_type'] = radius_cvt_int($data);
break;
 
case RADIUS_CLASS:
$this->attributes['class'] = radius_cvt_int($data);
break;
 
case RADIUS_FRAMED_PROTOCOL:
$this->attributes['framed_protocol'] = radius_cvt_int($data);
break;
 
case RADIUS_FRAMED_ROUTING:
$this->attributes['framed_routing'] = radius_cvt_int($data);
break;
 
case RADIUS_FILTER_ID:
$this->attributes['filter_id'] = radius_cvt_string($data);
break;
 
case RADIUS_VENDOR_SPECIFIC:
$attribv = radius_get_vendor_attr($data);
if (!is_array($attribv)) {
return false;
}
$vendor = $attribv['vendor'];
$attrv = $attribv['attr'];
$datav = $attribv['data'];
$this->rawVendorAttributes[$vendor][$attrv] = $datav;
 
if ($vendor == RADIUS_VENDOR_MICROSOFT) {
 
switch ($attrv) {
case RADIUS_MICROSOFT_MS_CHAP2_SUCCESS:
$this->attributes['ms_chap2_success'] = radius_cvt_string($datav);
break;
 
case RADIUS_MICROSOFT_MS_CHAP_ERROR:
$this->attributes['ms_chap_error'] = radius_cvt_string(substr($datav,1));
break;
 
case RADIUS_MICROSOFT_MS_CHAP_DOMAIN:
$this->attributes['ms_chap_domain'] = radius_cvt_string($datav);
break;
 
case RADIUS_MICROSOFT_MS_MPPE_ENCRYPTION_POLICY:
$this->attributes['ms_mppe_encryption_policy'] = radius_cvt_int($datav);
break;
 
case RADIUS_MICROSOFT_MS_MPPE_ENCRYPTION_TYPES:
$this->attributes['ms_mppe_encryption_types'] = radius_cvt_int($datav);
break;
 
case RADIUS_MICROSOFT_MS_CHAP_MPPE_KEYS:
$demangled = radius_demangle($this->res, $datav);
$this->attributes['ms_chap_mppe_lm_key'] = substr($demangled, 0, 8);
$this->attributes['ms_chap_mppe_nt_key'] = substr($demangled, 8, RADIUS_MPPE_KEY_LEN);
break;
 
case RADIUS_MICROSOFT_MS_MPPE_SEND_KEY:
$this->attributes['ms_chap_mppe_send_key'] = radius_demangle_mppe_key($this->res, $datav);
break;
 
case RADIUS_MICROSOFT_MS_MPPE_RECV_KEY:
$this->attributes['ms_chap_mppe_recv_key'] = radius_demangle_mppe_key($this->res, $datav);
break;
 
case RADIUS_MICROSOFT_MS_PRIMARY_DNS_SERVER:
$this->attributes['ms_primary_dns_server'] = radius_cvt_string($datav);
break;
}
}
break;
}
}
 
return true;
}
/**
* Frees resources.
*
* Calling this method is always a good idea, because all security relevant
* attributes are filled with Nullbytes to leave nothing in the mem.
*
* @access public
*/
function close()
{
if ($this->res != null) {
radius_close($this->res);
$this->res = null;
}
$this->username = str_repeat("\0", strlen($this->username));
$this->password = str_repeat("\0", strlen($this->password));
}
}
 
/**
* class Auth_RADIUS_PAP
*
* Class for authenticating using PAP (Plaintext)
*
* @package Auth_RADIUS
*/
class Auth_RADIUS_PAP extends Auth_RADIUS
{
 
/**
* Constructor
*
* @param string $username Username
* @param string $password Password
* @return void
*/
function Auth_RADIUS_PAP($username = null, $password = null)
{
$this->Auth_RADIUS();
$this->username = $username;
$this->password = $password;
}
/**
* Creates a RADIUS resource
*
* Creates a RADIUS resource for authentication. This should be the first
* call before you make any other things with the library.
*
* @return bool true on success, false on error
*/
function open()
{
$this->res = radius_auth_open();
if (!$this->res) {
return false;
}
return true;
}
/**
* Creates an authentication request
*
* Creates an authentication request.
* You MUST call this method before you can put any attribute
*
* @return bool true on success, false on error
*/
function createRequest()
{
if (!radius_create_request($this->res, RADIUS_ACCESS_REQUEST)) {
return false;
}
return true;
}
 
/**
* Put authentication specific attributes
*
* @return void
*/
function putAuthAttributes()
{
if (isset($this->username)) {
$this->putAttribute(RADIUS_USER_NAME, $this->username);
}
if (isset($this->password)) {
$this->putAttribute(RADIUS_USER_PASSWORD, $this->password);
}
}
 
}
 
/**
* class Auth_RADIUS_CHAP_MD5
*
* Class for authenticating using CHAP-MD5 see RFC1994.
* Instead og the plaintext password the challenge and
* the response are needed.
*
* @package Auth_RADIUS
*/
class Auth_RADIUS_CHAP_MD5 extends Auth_RADIUS_PAP
{
/**
* 8 Bytes binary challenge
* @var string
*/
var $challenge = null;
 
/**
* 16 Bytes MD5 response binary
* @var string
*/
var $response = null;
/**
* Id of the authentication request. Should incremented after every request.
* @var integer
*/
var $chapid = 1;
/**
* Constructor
*
* @param string $username Username
* @param string $challenge 8 Bytes Challenge (binary)
* @param integer $chapid Requestnumber
* @return void
*/
function Auth_RADIUS_CHAP_MD5($username = null, $challenge = null, $chapid = 1)
{
$this->Auth_RADIUS_PAP();
$this->username = $username;
$this->challenge = $challenge;
$this->chapid = $chapid;
}
/**
* Put CHAP-MD5 specific attributes
*
* For authenticating using CHAP-MD5 via RADIUS you have to put the challenge
* and the response. The chapid is inserted in the first byte of the response.
*
* @return void
*/
function putAuthAttributes()
{
if (isset($this->username)) {
$this->putAttribute(RADIUS_USER_NAME, $this->username);
}
if (isset($this->response)) {
$response = pack('C', $this->chapid) . $this->response;
$this->putAttribute(RADIUS_CHAP_PASSWORD, $response);
}
if (isset($this->challenge)) {
$this->putAttribute(RADIUS_CHAP_CHALLENGE, $this->challenge);
}
}
/**
* Frees resources.
*
* Calling this method is always a good idea, because all security relevant
* attributes are filled with Nullbytes to leave nothing in the mem.
*
* @access public
*/
function close()
{
Auth_RADIUS_PAP::close();
$this->challenge = str_repeat("\0", strlen($this->challenge));
$this->response = str_repeat("\0", strlen($this->response));
}
}
 
/**
* class Auth_RADIUS_MSCHAPv1
*
* Class for authenticating using MS-CHAPv1 see RFC2433
*
* @package Auth_RADIUS
*/
class Auth_RADIUS_MSCHAPv1 extends Auth_RADIUS_CHAP_MD5
{
/**
* LAN-Manager-Response
* @var string
*/
var $lmResponse = null;
 
/**
* Wether using deprecated LM-Responses or not.
* 0 = use LM-Response, 1 = use NT-Response
* @var bool
*/
var $flags = 1;
/**
* Put MS-CHAPv1 specific attributes
*
* For authenticating using MS-CHAPv1 via RADIUS you have to put the challenge
* and the response. The response has this structure:
* struct rad_mschapvalue {
* u_char ident;
* u_char flags;
* u_char lm_response[24];
* u_char response[24];
* };
*
* @return void
*/
function putAuthAttributes()
{
if (isset($this->username)) {
$this->putAttribute(RADIUS_USER_NAME, $this->username);
}
if (isset($this->response) || isset($this->lmResponse)) {
$lmResp = isset($this->lmResponse) ? $this->lmResponse : str_repeat ("\0", 24);
$ntResp = isset($this->response) ? $this->response : str_repeat ("\0", 24);
$resp = pack('CC', $this->chapid, $this->flags) . $lmResp . $ntResp;
$this->putVendorAttribute(RADIUS_VENDOR_MICROSOFT, RADIUS_MICROSOFT_MS_CHAP_RESPONSE, $resp);
}
if (isset($this->challenge)) {
$this->putVendorAttribute(RADIUS_VENDOR_MICROSOFT, RADIUS_MICROSOFT_MS_CHAP_CHALLENGE, $this->challenge);
}
}
}
 
/**
* class Auth_RADIUS_MSCHAPv2
*
* Class for authenticating using MS-CHAPv2 see RFC2759
*
* @package Auth_RADIUS
*/
class Auth_RADIUS_MSCHAPv2 extends Auth_RADIUS_MSCHAPv1
{
/**
* 16 Bytes binary challenge
* @var string
*/
var $challenge = null;
/**
* 16 Bytes binary Peer Challenge
* @var string
*/
var $peerChallenge = null;
 
/**
* Put MS-CHAPv2 specific attributes
*
* For authenticating using MS-CHAPv1 via RADIUS you have to put the challenge
* and the response. The response has this structure:
* struct rad_mschapv2value {
* u_char ident;
* u_char flags;
* u_char pchallenge[16];
* u_char reserved[8];
* u_char response[24];
* };
* where pchallenge is the peer challenge. Like for MS-CHAPv1 we set the flags field to 1.
* @return void
*/
function putAuthAttributes()
{
if (isset($this->username)) {
$this->putAttribute(RADIUS_USER_NAME, $this->username);
}
if (isset($this->response) && isset($this->peerChallenge)) {
// Response: chapid, flags (1 = use NT Response), Peer challenge, reserved, Response
$resp = pack('CCa16a8a24',$this->chapid , 1, $this->peerChallenge, str_repeat("\0", 8), $this->response);
$this->putVendorAttribute(RADIUS_VENDOR_MICROSOFT, RADIUS_MICROSOFT_MS_CHAP2_RESPONSE, $resp);
}
if (isset($this->challenge)) {
$this->putVendorAttribute(RADIUS_VENDOR_MICROSOFT, RADIUS_MICROSOFT_MS_CHAP_CHALLENGE, $this->challenge);
}
}
/**
* Frees resources.
*
* Calling this method is always a good idea, because all security relevant
* attributes are filled with Nullbytes to leave nothing in the mem.
*
* @access public
*/
function close()
{
Auth_RADIUS_MSCHAPv1::close();
$this->peerChallenge = str_repeat("\0", strlen($this->peerChallenge));
}
}
 
/**
* class Auth_RADIUS_Acct
*
* Class for RADIUS accounting
*
* @package Auth_RADIUS
*/
class Auth_RADIUS_Acct extends Auth_RADIUS
{
/**
* Defines where the Authentication was made, possible values are:
* RADIUS_AUTH_RADIUS, RADIUS_AUTH_LOCAL, RADIUS_AUTH_REMOTE
* @var integer
*/
var $authentic = null;
 
/**
* Defines the type of the accounting request, on of:
* RADIUS_START, RADIUS_STOP, RADIUS_ACCOUNTING_ON, RADIUS_ACCOUNTING_OFF
* @var integer
*/
var $status_type = null;
 
/**
* The time the user was logged in in seconds
* @var integer
*/
var $session_time = null;
 
/**
* A uniq identifier for the session of the user, maybe the PHP-Session-Id
* @var string
*/
var $session_id = null;
/**
* Constructor
*
* Generates a predefined session_id. We use the Remote-Address, the PID, and the Current user.
* @return void
*/
function Auth_RADIUS_Acct()
{
$this->Auth_RADIUS();
if (isset($_SERVER)) {
$var = &$_SERVER;
} else {
$var = &$GLOBALS['HTTP_SERVER_VARS'];
}
 
$this->session_id = sprintf("%s:%d-%s", isset($var['REMOTE_ADDR']) ? $var['REMOTE_ADDR'] : '127.0.0.1' , getmypid(), get_current_user());
}
 
/**
* Creates a RADIUS resource
*
* Creates a RADIUS resource for accounting. This should be the first
* call before you make any other things with the library.
*
* @return bool true on success, false on error
*/
function open()
{
$this->res = radius_acct_open();
if (!$this->res) {
return false;
}
return true;
}
 
/**
* Creates an accounting request
*
* Creates an accounting request.
* You MUST call this method before you can put any attribute.
*
* @return bool true on success, false on error
*/
function createRequest()
{
if (!radius_create_request($this->res, RADIUS_ACCOUNTING_REQUEST)) {
return false;
}
return true;
}
/**
* Put attributes for accounting.
*
* Here we put some accounting values. There many more attributes for accounting,
* but for web-applications only certain attributes make sense.
* @return void
*/
function putAuthAttributes()
{
$this->putAttribute(RADIUS_ACCT_SESSION_ID, $this->session_id);
$this->putAttribute(RADIUS_ACCT_STATUS_TYPE, $this->status_type);
if (isset($this->session_time) && $this->status_type == RADIUS_STOP) {
$this->putAttribute(RADIUS_ACCT_SESSION_TIME, $this->session_time);
}
if (isset($this->authentic)) {
$this->putAttribute(RADIUS_ACCT_AUTHENTIC, $this->authentic);
}
}
}
 
/**
* class Auth_RADIUS_Acct_Start
*
* Class for RADIUS accounting. Its usualy used, after the user has logged in.
*
* @package Auth_RADIUS
*/
class Auth_RADIUS_Acct_Start extends Auth_RADIUS_Acct
{
/**
* Defines the type of the accounting request.
* It is set to RADIUS_START by default in this class.
* @var integer
*/
var $status_type = Auth_RADIUS_Acct_Stop;
}
 
/**
* class Auth_RADIUS_Acct_Start
*
* Class for RADIUS accounting. Its usualy used, after the user has logged out.
*
* @package Auth_RADIUS
*/
class Auth_RADIUS_Acct_Stop extends Auth_RADIUS_Acct
{
/**
* Defines the type of the accounting request.
* It is set to RADIUS_STOP by default in this class.
* @var integer
*/
var $status_type = RADIUS_STOP;
}
 
?>
/tags/Racine_livraison_narmer/api/pear/Auth/Anonymous.php
New file
0,0 → 1,138
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */
 
/**
* Anonymous authentication support
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Authentication
* @package Auth
* @author Yavor Shahpasov <yavo@netsmart.com.cy>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: Anonymous.php,v 1.1 2006-12-14 15:04:28 jp_milcent Exp $
* @link http://pear.php.net/package/Auth
* @since File available since Release 1.3.0
*/
 
/**
* Include Auth package
*/
require_once 'Auth.php';
 
/**
* Anonymous Authentication
*
* This class provides anonymous authentication if username and password
* were not supplied
*
* @category Authentication
* @package Auth
* @author Yavor Shahpasov <yavo@netsmart.com.cy>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version Release: 1.4.3 File: $Revision: 1.1 $
* @link http://pear.php.net/package/Auth
* @since Class available since Release 1.3.0
*/
class Auth_Anonymous extends Auth
{
 
// {{{ properties
 
/**
* Whether to allow anonymous authentication
*
* @var boolean
*/
var $allow_anonymous = true;
 
/**
* Username to use for anonymous user
*
* @var string
*/
var $anonymous_username = 'anonymous';
 
// }}}
// {{{ Auth_Anonymous() [constructor]
/**
* Pass all parameters to Parent Auth class
*
* Set up the storage driver.
*
* @param string Type of the storage driver
* @param mixed Additional options for the storage driver
* (example: if you are using DB as the storage
* driver, you have to pass the dsn string here)
*
* @param string Name of the function that creates the login form
* @param boolean Should the login form be displayed if neccessary?
* @return void
* @see Auth::Auth()
*/
function Auth_Anonymous($storageDriver, $options = '', $loginFunction = '', $showLogin = true) {
parent::Auth($storageDriver, $options, $loginFunction, $showLogin);
}
 
// }}}
// {{{ login()
/**
* Login function
*
* If no username & password is passed then login as the username
* provided in $this->anonymous_username else call standard login()
* function.
*
* @return void
* @access private
* @see Auth::login()
*/
function login() {
if ( $this->allow_anonymous
&& empty($this->username)
&& empty($this->password) ) {
$this->setAuth($this->anonymous_username);
if (is_callable($this->loginCallback)) {
call_user_func_array($this->loginCallback, array($this->username, $this) );
}
} else {
// Call normal login system
parent::login();
}
}
 
// }}}
// {{{ forceLogin()
/**
* Force the user to login
*
* Calling this function forces the user to provide a real username and
* password before continuing.
*
* @return void
*/
function forceLogin() {
$this->allow_anonymous = false;
if( !empty($this->session['username']) && $this->session['username'] == $this->anonymous_username ) {
$this->logout();
}
}
 
// }}}
 
}
 
?>
/tags/Racine_livraison_narmer/api/pear/Auth/Frontend/md5.js
New file
0,0 → 1,256
/*
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
* Digest Algorithm, as defined in RFC 1321.
* Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distributed under the BSD License
* See http://pajhome.org.uk/crypt/md5 for more info.
*/
 
/*
* Configurable variables. You may need to tweak these to be compatible with
* the server-side, but the defaults work in most cases.
*/
var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */
var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */
var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */
 
/*
* These are the functions you'll usually want to call
* They take string arguments and return either hex or base-64 encoded strings
*/
function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));}
function b64_md5(s){ return binl2b64(core_md5(str2binl(s), s.length * chrsz));}
function str_md5(s){ return binl2str(core_md5(str2binl(s), s.length * chrsz));}
function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); }
function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); }
function str_hmac_md5(key, data) { return binl2str(core_hmac_md5(key, data)); }
 
/*
* Perform a simple self-test to see if the VM is working
*/
function md5_vm_test()
{
return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72";
}
 
/*
* Calculate the MD5 of an array of little-endian words, and a bit length
*/
function core_md5(x, len)
{
/* append padding */
x[len >> 5] |= 0x80 << ((len) % 32);
x[(((len + 64) >>> 9) << 4) + 14] = len;
 
var a = 1732584193;
var b = -271733879;
var c = -1732584194;
var d = 271733878;
 
for(var i = 0; i < x.length; i += 16)
{
var olda = a;
var oldb = b;
var oldc = c;
var oldd = d;
 
a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);
b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);
c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);
d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);
d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);
 
a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);
b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);
c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);
d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);
a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);
b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
 
a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);
b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);
c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);
d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);
a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);
b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);
 
a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);
c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);
d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);
d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);
a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);
b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
 
a = safe_add(a, olda);
b = safe_add(b, oldb);
c = safe_add(c, oldc);
d = safe_add(d, oldd);
}
return Array(a, b, c, d);
 
}
 
/*
* These functions implement the four basic operations the algorithm uses.
*/
function md5_cmn(q, a, b, x, s, t)
{
return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
}
function md5_ff(a, b, c, d, x, s, t)
{
return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
}
function md5_gg(a, b, c, d, x, s, t)
{
return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
}
function md5_hh(a, b, c, d, x, s, t)
{
return md5_cmn(b ^ c ^ d, a, b, x, s, t);
}
function md5_ii(a, b, c, d, x, s, t)
{
return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
}
 
/*
* Calculate the HMAC-MD5, of a key and some data
*/
function core_hmac_md5(key, data)
{
var bkey = str2binl(key);
if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);
 
var ipad = Array(16), opad = Array(16);
for(var i = 0; i < 16; i++)
{
ipad[i] = bkey[i] ^ 0x36363636;
opad[i] = bkey[i] ^ 0x5C5C5C5C;
}
 
var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);
return core_md5(opad.concat(hash), 512 + 128);
}
 
/*
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
* to work around bugs in some JS interpreters.
*/
function safe_add(x, y)
{
var lsw = (x & 0xFFFF) + (y & 0xFFFF);
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
return (msw << 16) | (lsw & 0xFFFF);
}
 
/*
* Bitwise rotate a 32-bit number to the left.
*/
function bit_rol(num, cnt)
{
return (num << cnt) | (num >>> (32 - cnt));
}
 
/*
* Convert a string to an array of little-endian words
* If chrsz is ASCII, characters >255 have their hi-byte silently ignored.
*/
function str2binl(str)
{
var bin = Array();
var mask = (1 << chrsz) - 1;
for(var i = 0; i < str.length * chrsz; i += chrsz)
bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32);
return bin;
}
 
/*
* Convert an array of little-endian words to a string
*/
function binl2str(bin)
{
var str = "";
var mask = (1 << chrsz) - 1;
for(var i = 0; i < bin.length * 32; i += chrsz)
str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask);
return str;
}
 
/*
* Convert an array of little-endian words to a hex string.
*/
function binl2hex(binarray)
{
var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
var str = "";
for(var i = 0; i < binarray.length * 4; i++)
{
str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +
hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);
}
return str;
}
 
/*
* Convert an array of little-endian words to a base-64 string
*/
function binl2b64(binarray)
{
var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var str = "";
for(var i = 0; i < binarray.length * 4; i += 3)
{
var triplet = (((binarray[i >> 2] >> 8 * ( i %4)) & 0xFF) << 16)
| (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 )
| ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF);
for(var j = 0; j < 4; j++)
{
if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
}
}
return str;
}
/tags/Racine_livraison_narmer/api/pear/Auth/Frontend/Html.php
New file
0,0 → 1,142
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */
 
/**
* Standard Html Login form
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Authentication
* @package Auth
* @author Martin Jansen <mj@php.net>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: Html.php,v 1.1 2006-12-14 15:04:29 jp_milcent Exp $
* @link http://pear.php.net/package/Auth
* @since File available since Release 1.3.0
*/
 
/**
* Standard Html Login form
*
* @category Authentication
* @package Auth
* @author Yavor Shahpasov <yavo@netsmart.com.cy>
* @author Adam Ashley <aashley@php.net>
* @copyright 2001-2006 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version Release: 1.4.3 File: $Revision: 1.1 $
* @link http://pear.php.net/package/Auth
* @since Class available since Release 1.3.0
*/
class Auth_Frontend_Html {
// {{{ render()
 
/**
* Displays the login form
*
* @param object The calling auth instance
* @param string The previously used username
* @return void
*/
function render(&$caller, $username = '') {
$loginOnClick = 'return true;';
// Try To Use Challene response
// TODO javascript might need some improvement for work on other browsers
if($caller->advancedsecurity && $caller->storage->supportsChallengeResponse() ) {
 
// Init the secret cookie
$caller->session['loginchallenege'] = md5(microtime());
 
print "\n";
print '<script language="JavaScript">'."\n";
 
include 'Auth/Frontend/md5.js';
 
print "\n";
print ' function securePassword() { '."\n";
print ' var pass = document.getElementById(\''.$caller->getPostPasswordField().'\');'."\n";
print ' var secret = document.getElementById(\'authsecret\')'."\n";
//print ' alert(pass);alert(secret); '."\n";
 
// If using md5 for password storage md5 the password before
// we hash it with the secret
// print ' alert(pass.value);';
if ($caller->storage->getCryptType() == 'md5' ) {
print ' pass.value = hex_md5(pass.value); '."\n";
#print ' alert(pass.value);';
}
 
print ' pass.value = hex_md5(pass.value+\''.$caller->session['loginchallenege'].'\'); '."\n";
// print ' alert(pass.value);';
print ' secret.value = 1;'."\n";
print ' var doLogin = document.getElementById(\'doLogin\')'."\n";
print ' doLogin.disabled = true;'."\n";
print ' return true;';
print ' } '."\n";
print '</script>'."\n";;
print "\n";
 
$loginOnClick = ' return securePassword(); ';
}
 
print '<center>'."\n";
 
$status = '';
if (!empty($caller->status) && $caller->status == AUTH_EXPIRED) {
$status = '<i>Your session has expired. Please login again!</i>'."\n";
} else if (!empty($caller->status) && $caller->status == AUTH_IDLED) {
$status = '<i>You have been idle for too long. Please login again!</i>'."\n";
} else if (!empty ($caller->status) && $caller->status == AUTH_WRONG_LOGIN) {
$status = '<i>Wrong login data!</i>'."\n";
} else if (!empty ($caller->status) && $caller->status == AUTH_SECURITY_BREACH) {
$status = '<i>Security problem detected. </i>'."\n";
}
print '<form method="post" action="'.$caller->server['PHP_SELF'].'" '
.'onSubmit="'.$loginOnClick.'">'."\n";
print '<table border="0" cellpadding="2" cellspacing="0" '
.'summary="login form" align="center" >'."\n";
print '<tr>'."\n";
print ' <td colspan="2" bgcolor="#eeeeee"><strong>Login </strong>'
.$status.'</td>'."\n";
print '</tr>'."\n";
print '<tr>'."\n";
print ' <td>Username:</td>'."\n";
print ' <td><input type="text" id="'.$caller->getPostUsernameField()
.'" name="'.$caller->getPostUsernameField().'" value="' . $username
.'" /></td>'."\n";
print '</tr>'."\n";
print '<tr>'."\n";
print ' <td>Password:</td>'."\n";
print ' <td><input type="password" id="'.$caller->getPostPasswordField()
.'" name="'.$caller->getPostPasswordField().'" /></td>'."\n";
print '</tr>'."\n";
print '<tr>'."\n";
//onClick=" '.$loginOnClick.' "
print ' <td colspan="2" bgcolor="#eeeeee"><input value="Login" '
.'id="doLogin" name="doLogin" type="submit" /></td>'."\n";
print '</tr>'."\n";
print '</table>'."\n";
 
// Might be a good idea to make the variable name variable
print '<input type="hidden" id="authsecret" name="authsecret" value="" />';
print '</form>'."\n";
print '</center>'."\n";
}
 
// }}}
}
 
?>
/tags/Racine_livraison_narmer/api/pear/Mail/RFC822.php
New file
0,0 → 1,923
<?php
// +-----------------------------------------------------------------------+
// | Copyright (c) 2001-2002, Richard Heyes |
// | All rights reserved. |
// | |
// | Redistribution and use in source and binary forms, with or without |
// | modification, are permitted provided that the following conditions |
// | are met: |
// | |
// | o Redistributions of source code must retain the above copyright |
// | notice, this list of conditions and the following disclaimer. |
// | o Redistributions in binary form must reproduce the above copyright |
// | notice, this list of conditions and the following disclaimer in the |
// | documentation and/or other materials provided with the distribution.|
// | o The names of the authors may not be used to endorse or promote |
// | products derived from this software without specific prior written |
// | permission. |
// | |
// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
// | |
// +-----------------------------------------------------------------------+
// | Authors: Richard Heyes <richard@phpguru.org> |
// | Chuck Hagenbuch <chuck@horde.org> |
// +-----------------------------------------------------------------------+
 
/**
* RFC 822 Email address list validation Utility
*
* What is it?
*
* This class will take an address string, and parse it into it's consituent
* parts, be that either addresses, groups, or combinations. Nested groups
* are not supported. The structure it returns is pretty straight forward,
* and is similar to that provided by the imap_rfc822_parse_adrlist(). Use
* print_r() to view the structure.
*
* How do I use it?
*
* $address_string = 'My Group: "Richard" <richard@localhost> (A comment), ted@example.com (Ted Bloggs), Barney;';
* $structure = Mail_RFC822::parseAddressList($address_string, 'example.com', true)
* print_r($structure);
*
* @author Richard Heyes <richard@phpguru.org>
* @author Chuck Hagenbuch <chuck@horde.org>
* @version $Revision: 1.1 $
* @license BSD
* @package Mail
*/
class Mail_RFC822 {
 
/**
* The address being parsed by the RFC822 object.
* @var string $address
*/
var $address = '';
 
/**
* The default domain to use for unqualified addresses.
* @var string $default_domain
*/
var $default_domain = 'localhost';
 
/**
* Should we return a nested array showing groups, or flatten everything?
* @var boolean $nestGroups
*/
var $nestGroups = true;
 
/**
* Whether or not to validate atoms for non-ascii characters.
* @var boolean $validate
*/
var $validate = true;
 
/**
* The array of raw addresses built up as we parse.
* @var array $addresses
*/
var $addresses = array();
 
/**
* The final array of parsed address information that we build up.
* @var array $structure
*/
var $structure = array();
 
/**
* The current error message, if any.
* @var string $error
*/
var $error = null;
 
/**
* An internal counter/pointer.
* @var integer $index
*/
var $index = null;
 
/**
* The number of groups that have been found in the address list.
* @var integer $num_groups
* @access public
*/
var $num_groups = 0;
 
/**
* A variable so that we can tell whether or not we're inside a
* Mail_RFC822 object.
* @var boolean $mailRFC822
*/
var $mailRFC822 = true;
 
/**
* A limit after which processing stops
* @var int $limit
*/
var $limit = null;
 
/**
* Sets up the object. The address must either be set here or when
* calling parseAddressList(). One or the other.
*
* @access public
* @param string $address The address(es) to validate.
* @param string $default_domain Default domain/host etc. If not supplied, will be set to localhost.
* @param boolean $nest_groups Whether to return the structure with groups nested for easier viewing.
* @param boolean $validate Whether to validate atoms. Turn this off if you need to run addresses through before encoding the personal names, for instance.
*
* @return object Mail_RFC822 A new Mail_RFC822 object.
*/
function Mail_RFC822($address = null, $default_domain = null, $nest_groups = null, $validate = null, $limit = null)
{
if (isset($address)) $this->address = $address;
if (isset($default_domain)) $this->default_domain = $default_domain;
if (isset($nest_groups)) $this->nestGroups = $nest_groups;
if (isset($validate)) $this->validate = $validate;
if (isset($limit)) $this->limit = $limit;
}
 
/**
* Starts the whole process. The address must either be set here
* or when creating the object. One or the other.
*
* @access public
* @param string $address The address(es) to validate.
* @param string $default_domain Default domain/host etc.
* @param boolean $nest_groups Whether to return the structure with groups nested for easier viewing.
* @param boolean $validate Whether to validate atoms. Turn this off if you need to run addresses through before encoding the personal names, for instance.
*
* @return array A structured array of addresses.
*/
function parseAddressList($address = null, $default_domain = null, $nest_groups = null, $validate = null, $limit = null)
{
if (!isset($this) || !isset($this->mailRFC822)) {
$obj = new Mail_RFC822($address, $default_domain, $nest_groups, $validate, $limit);
return $obj->parseAddressList();
}
 
if (isset($address)) $this->address = $address;
if (isset($default_domain)) $this->default_domain = $default_domain;
if (isset($nest_groups)) $this->nestGroups = $nest_groups;
if (isset($validate)) $this->validate = $validate;
if (isset($limit)) $this->limit = $limit;
 
$this->structure = array();
$this->addresses = array();
$this->error = null;
$this->index = null;
 
// Unfold any long lines in $this->address.
$this->address = preg_replace('/\r?\n/', "\r\n", $this->address);
$this->address = preg_replace('/\r\n(\t| )+/', ' ', $this->address);
 
while ($this->address = $this->_splitAddresses($this->address));
 
if ($this->address === false || isset($this->error)) {
require_once 'PEAR.php';
return PEAR::raiseError($this->error);
}
 
// Validate each address individually. If we encounter an invalid
// address, stop iterating and return an error immediately.
foreach ($this->addresses as $address) {
$valid = $this->_validateAddress($address);
 
if ($valid === false || isset($this->error)) {
require_once 'PEAR.php';
return PEAR::raiseError($this->error);
}
 
if (!$this->nestGroups) {
$this->structure = array_merge($this->structure, $valid);
} else {
$this->structure[] = $valid;
}
}
 
return $this->structure;
}
 
/**
* Splits an address into separate addresses.
*
* @access private
* @param string $address The addresses to split.
* @return boolean Success or failure.
*/
function _splitAddresses($address)
{
if (!empty($this->limit) && count($this->addresses) == $this->limit) {
return '';
}
 
if ($this->_isGroup($address) && !isset($this->error)) {
$split_char = ';';
$is_group = true;
} elseif (!isset($this->error)) {
$split_char = ',';
$is_group = false;
} elseif (isset($this->error)) {
return false;
}
 
// Split the string based on the above ten or so lines.
$parts = explode($split_char, $address);
$string = $this->_splitCheck($parts, $split_char);
 
// If a group...
if ($is_group) {
// If $string does not contain a colon outside of
// brackets/quotes etc then something's fubar.
 
// First check there's a colon at all:
if (strpos($string, ':') === false) {
$this->error = 'Invalid address: ' . $string;
return false;
}
 
// Now check it's outside of brackets/quotes:
if (!$this->_splitCheck(explode(':', $string), ':')) {
return false;
}
 
// We must have a group at this point, so increase the counter:
$this->num_groups++;
}
 
// $string now contains the first full address/group.
// Add to the addresses array.
$this->addresses[] = array(
'address' => trim($string),
'group' => $is_group
);
 
// Remove the now stored address from the initial line, the +1
// is to account for the explode character.
$address = trim(substr($address, strlen($string) + 1));
 
// If the next char is a comma and this was a group, then
// there are more addresses, otherwise, if there are any more
// chars, then there is another address.
if ($is_group && substr($address, 0, 1) == ','){
$address = trim(substr($address, 1));
return $address;
 
} elseif (strlen($address) > 0) {
return $address;
 
} else {
return '';
}
 
// If you got here then something's off
return false;
}
 
/**
* Checks for a group at the start of the string.
*
* @access private
* @param string $address The address to check.
* @return boolean Whether or not there is a group at the start of the string.
*/
function _isGroup($address)
{
// First comma not in quotes, angles or escaped:
$parts = explode(',', $address);
$string = $this->_splitCheck($parts, ',');
 
// Now we have the first address, we can reliably check for a
// group by searching for a colon that's not escaped or in
// quotes or angle brackets.
if (count($parts = explode(':', $string)) > 1) {
$string2 = $this->_splitCheck($parts, ':');
return ($string2 !== $string);
} else {
return false;
}
}
 
/**
* A common function that will check an exploded string.
*
* @access private
* @param array $parts The exloded string.
* @param string $char The char that was exploded on.
* @return mixed False if the string contains unclosed quotes/brackets, or the string on success.
*/
function _splitCheck($parts, $char)
{
$string = $parts[0];
 
for ($i = 0; $i < count($parts); $i++) {
if ($this->_hasUnclosedQuotes($string)
|| $this->_hasUnclosedBrackets($string, '<>')
|| $this->_hasUnclosedBrackets($string, '[]')
|| $this->_hasUnclosedBrackets($string, '()')
|| substr($string, -1) == '\\') {
if (isset($parts[$i + 1])) {
$string = $string . $char . $parts[$i + 1];
} else {
$this->error = 'Invalid address spec. Unclosed bracket or quotes';
return false;
}
} else {
$this->index = $i;
break;
}
}
 
return $string;
}
 
/**
* Checks if a string has an unclosed quotes or not.
*
* @access private
* @param string $string The string to check.
* @return boolean True if there are unclosed quotes inside the string, false otherwise.
*/
function _hasUnclosedQuotes($string)
{
$string = explode('"', $string);
$string_cnt = count($string);
 
for ($i = 0; $i < (count($string) - 1); $i++)
if (substr($string[$i], -1) == '\\')
$string_cnt--;
 
return ($string_cnt % 2 === 0);
}
 
/**
* Checks if a string has an unclosed brackets or not. IMPORTANT:
* This function handles both angle brackets and square brackets;
*
* @access private
* @param string $string The string to check.
* @param string $chars The characters to check for.
* @return boolean True if there are unclosed brackets inside the string, false otherwise.
*/
function _hasUnclosedBrackets($string, $chars)
{
$num_angle_start = substr_count($string, $chars[0]);
$num_angle_end = substr_count($string, $chars[1]);
 
$this->_hasUnclosedBracketsSub($string, $num_angle_start, $chars[0]);
$this->_hasUnclosedBracketsSub($string, $num_angle_end, $chars[1]);
 
if ($num_angle_start < $num_angle_end) {
$this->error = 'Invalid address spec. Unmatched quote or bracket (' . $chars . ')';
return false;
} else {
return ($num_angle_start > $num_angle_end);
}
}
 
/**
* Sub function that is used only by hasUnclosedBrackets().
*
* @access private
* @param string $string The string to check.
* @param integer &$num The number of occurences.
* @param string $char The character to count.
* @return integer The number of occurences of $char in $string, adjusted for backslashes.
*/
function _hasUnclosedBracketsSub($string, &$num, $char)
{
$parts = explode($char, $string);
for ($i = 0; $i < count($parts); $i++){
if (substr($parts[$i], -1) == '\\' || $this->_hasUnclosedQuotes($parts[$i]))
$num--;
if (isset($parts[$i + 1]))
$parts[$i + 1] = $parts[$i] . $char . $parts[$i + 1];
}
 
return $num;
}
 
/**
* Function to begin checking the address.
*
* @access private
* @param string $address The address to validate.
* @return mixed False on failure, or a structured array of address information on success.
*/
function _validateAddress($address)
{
$is_group = false;
$addresses = array();
 
if ($address['group']) {
$is_group = true;
 
// Get the group part of the name
$parts = explode(':', $address['address']);
$groupname = $this->_splitCheck($parts, ':');
$structure = array();
 
// And validate the group part of the name.
if (!$this->_validatePhrase($groupname)){
$this->error = 'Group name did not validate.';
return false;
} else {
// Don't include groups if we are not nesting
// them. This avoids returning invalid addresses.
if ($this->nestGroups) {
$structure = new stdClass;
$structure->groupname = $groupname;
}
}
 
$address['address'] = ltrim(substr($address['address'], strlen($groupname . ':')));
}
 
// If a group then split on comma and put into an array.
// Otherwise, Just put the whole address in an array.
if ($is_group) {
while (strlen($address['address']) > 0) {
$parts = explode(',', $address['address']);
$addresses[] = $this->_splitCheck($parts, ',');
$address['address'] = trim(substr($address['address'], strlen(end($addresses) . ',')));
}
} else {
$addresses[] = $address['address'];
}
 
// Check that $addresses is set, if address like this:
// Groupname:;
// Then errors were appearing.
if (!count($addresses)){
$this->error = 'Empty group.';
return false;
}
 
// Trim the whitespace from all of the address strings.
array_map('trim', $addresses);
 
// Validate each mailbox.
// Format could be one of: name <geezer@domain.com>
// geezer@domain.com
// geezer
// ... or any other format valid by RFC 822.
for ($i = 0; $i < count($addresses); $i++) {
if (!$this->validateMailbox($addresses[$i])) {
if (empty($this->error)) {
$this->error = 'Validation failed for: ' . $addresses[$i];
}
return false;
}
}
 
// Nested format
if ($this->nestGroups) {
if ($is_group) {
$structure->addresses = $addresses;
} else {
$structure = $addresses[0];
}
 
// Flat format
} else {
if ($is_group) {
$structure = array_merge($structure, $addresses);
} else {
$structure = $addresses;
}
}
 
return $structure;
}
 
/**
* Function to validate a phrase.
*
* @access private
* @param string $phrase The phrase to check.
* @return boolean Success or failure.
*/
function _validatePhrase($phrase)
{
// Splits on one or more Tab or space.
$parts = preg_split('/[ \\x09]+/', $phrase, -1, PREG_SPLIT_NO_EMPTY);
 
$phrase_parts = array();
while (count($parts) > 0){
$phrase_parts[] = $this->_splitCheck($parts, ' ');
for ($i = 0; $i < $this->index + 1; $i++)
array_shift($parts);
}
 
foreach ($phrase_parts as $part) {
// If quoted string:
if (substr($part, 0, 1) == '"') {
if (!$this->_validateQuotedString($part)) {
return false;
}
continue;
}
 
// Otherwise it's an atom:
if (!$this->_validateAtom($part)) return false;
}
 
return true;
}
 
/**
* Function to validate an atom which from rfc822 is:
* atom = 1*<any CHAR except specials, SPACE and CTLs>
*
* If validation ($this->validate) has been turned off, then
* validateAtom() doesn't actually check anything. This is so that you
* can split a list of addresses up before encoding personal names
* (umlauts, etc.), for example.
*
* @access private
* @param string $atom The string to check.
* @return boolean Success or failure.
*/
function _validateAtom($atom)
{
if (!$this->validate) {
// Validation has been turned off; assume the atom is okay.
return true;
}
 
// Check for any char from ASCII 0 - ASCII 127
if (!preg_match('/^[\\x00-\\x7E]+$/i', $atom, $matches)) {
return false;
}
 
// Check for specials:
if (preg_match('/[][()<>@,;\\:". ]/', $atom)) {
return false;
}
 
// Check for control characters (ASCII 0-31):
if (preg_match('/[\\x00-\\x1F]+/', $atom)) {
return false;
}
 
return true;
}
 
/**
* Function to validate quoted string, which is:
* quoted-string = <"> *(qtext/quoted-pair) <">
*
* @access private
* @param string $qstring The string to check
* @return boolean Success or failure.
*/
function _validateQuotedString($qstring)
{
// Leading and trailing "
$qstring = substr($qstring, 1, -1);
 
// Perform check, removing quoted characters first.
return !preg_match('/[\x0D\\\\"]/', preg_replace('/\\\\./', '', $qstring));
}
 
/**
* Function to validate a mailbox, which is:
* mailbox = addr-spec ; simple address
* / phrase route-addr ; name and route-addr
*
* @access public
* @param string &$mailbox The string to check.
* @return boolean Success or failure.
*/
function validateMailbox(&$mailbox)
{
// A couple of defaults.
$phrase = '';
$comment = '';
$comments = array();
 
// Catch any RFC822 comments and store them separately.
$_mailbox = $mailbox;
while (strlen(trim($_mailbox)) > 0) {
$parts = explode('(', $_mailbox);
$before_comment = $this->_splitCheck($parts, '(');
if ($before_comment != $_mailbox) {
// First char should be a (.
$comment = substr(str_replace($before_comment, '', $_mailbox), 1);
$parts = explode(')', $comment);
$comment = $this->_splitCheck($parts, ')');
$comments[] = $comment;
 
// +1 is for the trailing )
$_mailbox = substr($_mailbox, strpos($_mailbox, $comment)+strlen($comment)+1);
} else {
break;
}
}
 
foreach ($comments as $comment) {
$mailbox = str_replace("($comment)", '', $mailbox);
}
 
$mailbox = trim($mailbox);
 
// Check for name + route-addr
if (substr($mailbox, -1) == '>' && substr($mailbox, 0, 1) != '<') {
$parts = explode('<', $mailbox);
$name = $this->_splitCheck($parts, '<');
 
$phrase = trim($name);
$route_addr = trim(substr($mailbox, strlen($name.'<'), -1));
 
if ($this->_validatePhrase($phrase) === false || ($route_addr = $this->_validateRouteAddr($route_addr)) === false) {
return false;
}
 
// Only got addr-spec
} else {
// First snip angle brackets if present.
if (substr($mailbox, 0, 1) == '<' && substr($mailbox, -1) == '>') {
$addr_spec = substr($mailbox, 1, -1);
} else {
$addr_spec = $mailbox;
}
 
if (($addr_spec = $this->_validateAddrSpec($addr_spec)) === false) {
return false;
}
}
 
// Construct the object that will be returned.
$mbox = new stdClass();
 
// Add the phrase (even if empty) and comments
$mbox->personal = $phrase;
$mbox->comment = isset($comments) ? $comments : array();
 
if (isset($route_addr)) {
$mbox->mailbox = $route_addr['local_part'];
$mbox->host = $route_addr['domain'];
$route_addr['adl'] !== '' ? $mbox->adl = $route_addr['adl'] : '';
} else {
$mbox->mailbox = $addr_spec['local_part'];
$mbox->host = $addr_spec['domain'];
}
 
$mailbox = $mbox;
return true;
}
 
/**
* This function validates a route-addr which is:
* route-addr = "<" [route] addr-spec ">"
*
* Angle brackets have already been removed at the point of
* getting to this function.
*
* @access private
* @param string $route_addr The string to check.
* @return mixed False on failure, or an array containing validated address/route information on success.
*/
function _validateRouteAddr($route_addr)
{
// Check for colon.
if (strpos($route_addr, ':') !== false) {
$parts = explode(':', $route_addr);
$route = $this->_splitCheck($parts, ':');
} else {
$route = $route_addr;
}
 
// If $route is same as $route_addr then the colon was in
// quotes or brackets or, of course, non existent.
if ($route === $route_addr){
unset($route);
$addr_spec = $route_addr;
if (($addr_spec = $this->_validateAddrSpec($addr_spec)) === false) {
return false;
}
} else {
// Validate route part.
if (($route = $this->_validateRoute($route)) === false) {
return false;
}
 
$addr_spec = substr($route_addr, strlen($route . ':'));
 
// Validate addr-spec part.
if (($addr_spec = $this->_validateAddrSpec($addr_spec)) === false) {
return false;
}
}
 
if (isset($route)) {
$return['adl'] = $route;
} else {
$return['adl'] = '';
}
 
$return = array_merge($return, $addr_spec);
return $return;
}
 
/**
* Function to validate a route, which is:
* route = 1#("@" domain) ":"
*
* @access private
* @param string $route The string to check.
* @return mixed False on failure, or the validated $route on success.
*/
function _validateRoute($route)
{
// Split on comma.
$domains = explode(',', trim($route));
 
foreach ($domains as $domain) {
$domain = str_replace('@', '', trim($domain));
if (!$this->_validateDomain($domain)) return false;
}
 
return $route;
}
 
/**
* Function to validate a domain, though this is not quite what
* you expect of a strict internet domain.
*
* domain = sub-domain *("." sub-domain)
*
* @access private
* @param string $domain The string to check.
* @return mixed False on failure, or the validated domain on success.
*/
function _validateDomain($domain)
{
// Note the different use of $subdomains and $sub_domains
$subdomains = explode('.', $domain);
 
while (count($subdomains) > 0) {
$sub_domains[] = $this->_splitCheck($subdomains, '.');
for ($i = 0; $i < $this->index + 1; $i++)
array_shift($subdomains);
}
 
foreach ($sub_domains as $sub_domain) {
if (!$this->_validateSubdomain(trim($sub_domain)))
return false;
}
 
// Managed to get here, so return input.
return $domain;
}
 
/**
* Function to validate a subdomain:
* subdomain = domain-ref / domain-literal
*
* @access private
* @param string $subdomain The string to check.
* @return boolean Success or failure.
*/
function _validateSubdomain($subdomain)
{
if (preg_match('|^\[(.*)]$|', $subdomain, $arr)){
if (!$this->_validateDliteral($arr[1])) return false;
} else {
if (!$this->_validateAtom($subdomain)) return false;
}
 
// Got here, so return successful.
return true;
}
 
/**
* Function to validate a domain literal:
* domain-literal = "[" *(dtext / quoted-pair) "]"
*
* @access private
* @param string $dliteral The string to check.
* @return boolean Success or failure.
*/
function _validateDliteral($dliteral)
{
return !preg_match('/(.)[][\x0D\\\\]/', $dliteral, $matches) && $matches[1] != '\\';
}
 
/**
* Function to validate an addr-spec.
*
* addr-spec = local-part "@" domain
*
* @access private
* @param string $addr_spec The string to check.
* @return mixed False on failure, or the validated addr-spec on success.
*/
function _validateAddrSpec($addr_spec)
{
$addr_spec = trim($addr_spec);
 
// Split on @ sign if there is one.
if (strpos($addr_spec, '@') !== false) {
$parts = explode('@', $addr_spec);
$local_part = $this->_splitCheck($parts, '@');
$domain = substr($addr_spec, strlen($local_part . '@'));
 
// No @ sign so assume the default domain.
} else {
$local_part = $addr_spec;
$domain = $this->default_domain;
}
 
if (($local_part = $this->_validateLocalPart($local_part)) === false) return false;
if (($domain = $this->_validateDomain($domain)) === false) return false;
 
// Got here so return successful.
return array('local_part' => $local_part, 'domain' => $domain);
}
 
/**
* Function to validate the local part of an address:
* local-part = word *("." word)
*
* @access private
* @param string $local_part
* @return mixed False on failure, or the validated local part on success.
*/
function _validateLocalPart($local_part)
{
$parts = explode('.', $local_part);
$words = array();
 
// Split the local_part into words.
while (count($parts) > 0){
$words[] = $this->_splitCheck($parts, '.');
for ($i = 0; $i < $this->index + 1; $i++) {
array_shift($parts);
}
}
 
// Validate each word.
foreach ($words as $word) {
// If this word contains an unquoted space, it is invalid. (6.2.4)
if (strpos($word, ' ') && $word[0] !== '"')
{
return false;
}
 
if ($this->_validatePhrase(trim($word)) === false) return false;
}
 
// Managed to get here, so return the input.
return $local_part;
}
 
/**
* Returns an approximate count of how many addresses are in the
* given string. This is APPROXIMATE as it only splits based on a
* comma which has no preceding backslash. Could be useful as
* large amounts of addresses will end up producing *large*
* structures when used with parseAddressList().
*
* @param string $data Addresses to count
* @return int Approximate count
*/
function approximateCount($data)
{
return count(preg_split('/(?<!\\\\),/', $data));
}
 
/**
* This is a email validating function separate to the rest of the
* class. It simply validates whether an email is of the common
* internet form: <user>@<domain>. This can be sufficient for most
* people. Optional stricter mode can be utilised which restricts
* mailbox characters allowed to alphanumeric, full stop, hyphen
* and underscore.
*
* @param string $data Address to check
* @param boolean $strict Optional stricter mode
* @return mixed False if it fails, an indexed array
* username/domain if it matches
*/
function isValidInetAddress($data, $strict = false)
{
$regex = $strict ? '/^([.0-9a-z_+-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,4})$/i' : '/^([*+!.&#$|\'\\%\/0-9a-z^_`{}=?~:-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,4})$/i';
if (preg_match($regex, trim($data), $matches)) {
return array($matches[1], $matches[2]);
} else {
return false;
}
}
 
}
/tags/Racine_livraison_narmer/api/pear/Mail/mime.php
New file
0,0 → 1,713
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
// +-----------------------------------------------------------------------+
// | Copyright (c) 2002-2003 Richard Heyes |
// | Copyright (c) 2003-2005 The PHP Group |
// | All rights reserved. |
// | |
// | Redistribution and use in source and binary forms, with or without |
// | modification, are permitted provided that the following conditions |
// | are met: |
// | |
// | o Redistributions of source code must retain the above copyright |
// | notice, this list of conditions and the following disclaimer. |
// | o Redistributions in binary form must reproduce the above copyright |
// | notice, this list of conditions and the following disclaimer in the |
// | documentation and/or other materials provided with the distribution.|
// | o The names of the authors may not be used to endorse or promote |
// | products derived from this software without specific prior written |
// | permission. |
// | |
// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
// | |
// +-----------------------------------------------------------------------+
// | Author: Richard Heyes <richard@phpguru.org> |
// | Tomas V.V.Cox <cox@idecnet.com> (port to PEAR) |
// +-----------------------------------------------------------------------+
//
// $Id: mime.php,v 1.1 2006-09-13 08:49:41 alexandre_tb Exp $
 
require_once('PEAR.php');
require_once('Mail/mimePart.php');
 
/**
* Mime mail composer class. Can handle: text and html bodies, embedded html
* images and attachments.
* Documentation and examples of this class are avaible here:
* http://pear.php.net/manual/
*
* @notes This class is based on HTML Mime Mail class from
* Richard Heyes <richard@phpguru.org> which was based also
* in the mime_mail.class by Tobias Ratschiller <tobias@dnet.it> and
* Sascha Schumann <sascha@schumann.cx>
*
* @author Richard Heyes <richard.heyes@heyes-computing.net>
* @author Tomas V.V.Cox <cox@idecnet.com>
* @package Mail
* @access public
*/
class Mail_mime
{
/**
* Contains the plain text part of the email
* @var string
*/
var $_txtbody;
/**
* Contains the html part of the email
* @var string
*/
var $_htmlbody;
/**
* contains the mime encoded text
* @var string
*/
var $_mime;
/**
* contains the multipart content
* @var string
*/
var $_multipart;
/**
* list of the attached images
* @var array
*/
var $_html_images = array();
/**
* list of the attachements
* @var array
*/
var $_parts = array();
/**
* Build parameters
* @var array
*/
var $_build_params = array();
/**
* Headers for the mail
* @var array
*/
var $_headers = array();
/**
* End Of Line sequence (for serialize)
* @var string
*/
var $_eol;
 
 
/**
* Constructor function
*
* @access public
*/
function Mail_mime($crlf = "\r\n")
{
$this->_setEOL($crlf);
$this->_build_params = array(
'text_encoding' => '7bit',
'html_encoding' => 'quoted-printable',
'7bit_wrap' => 998,
'html_charset' => 'ISO-8859-1',
'text_charset' => 'ISO-8859-1',
'head_charset' => 'ISO-8859-1'
);
}
 
/**
* Wakeup (unserialize) - re-sets EOL constant
*
* @access private
*/
function __wakeup()
{
$this->_setEOL($this->_eol);
}
 
/**
* Accessor function to set the body text. Body text is used if
* it's not an html mail being sent or else is used to fill the
* text/plain part that emails clients who don't support
* html should show.
*
* @param string $data Either a string or
* the file name with the contents
* @param bool $isfile If true the first param should be treated
* as a file name, else as a string (default)
* @param bool $append If true the text or file is appended to
* the existing body, else the old body is
* overwritten
* @return mixed true on success or PEAR_Error object
* @access public
*/
function setTXTBody($data, $isfile = false, $append = false)
{
if (!$isfile) {
if (!$append) {
$this->_txtbody = $data;
} else {
$this->_txtbody .= $data;
}
} else {
$cont = $this->_file2str($data);
if (PEAR::isError($cont)) {
return $cont;
}
if (!$append) {
$this->_txtbody = $cont;
} else {
$this->_txtbody .= $cont;
}
}
return true;
}
 
/**
* Adds a html part to the mail
*
* @param string $data Either a string or the file name with the
* contents
* @param bool $isfile If true the first param should be treated
* as a file name, else as a string (default)
* @return mixed true on success or PEAR_Error object
* @access public
*/
function setHTMLBody($data, $isfile = false)
{
if (!$isfile) {
$this->_htmlbody = $data;
} else {
$cont = $this->_file2str($data);
if (PEAR::isError($cont)) {
return $cont;
}
$this->_htmlbody = $cont;
}
 
return true;
}
 
/**
* Adds an image to the list of embedded images.
*
* @param string $file The image file name OR image data itself
* @param string $c_type The content type
* @param string $name The filename of the image.
* Only use if $file is the image data
* @param bool $isfilename Whether $file is a filename or not
* Defaults to true
* @return mixed true on success or PEAR_Error object
* @access public
*/
function addHTMLImage($file, $c_type='application/octet-stream',
$name = '', $isfilename = true)
{
$filedata = ($isfilename === true) ? $this->_file2str($file)
: $file;
if ($isfilename === true) {
$filename = ($name == '' ? basename($file) : basename($name));
} else {
$filename = basename($name);
}
if (PEAR::isError($filedata)) {
return $filedata;
}
$this->_html_images[] = array(
'body' => $filedata,
'name' => $filename,
'c_type' => $c_type,
'cid' => md5(uniqid(time()))
);
return true;
}
 
/**
* Adds a file to the list of attachments.
*
* @param string $file The file name of the file to attach
* OR the file data itself
* @param string $c_type The content type
* @param string $name The filename of the attachment
* Only use if $file is the file data
* @param bool $isFilename Whether $file is a filename or not
* Defaults to true
* @return mixed true on success or PEAR_Error object
* @access public
*/
function addAttachment($file, $c_type = 'application/octet-stream',
$name = '', $isfilename = true,
$encoding = 'base64')
{
$filedata = ($isfilename === true) ? $this->_file2str($file)
: $file;
if ($isfilename === true) {
// Force the name the user supplied, otherwise use $file
$filename = (!empty($name)) ? $name : $file;
} else {
$filename = $name;
}
if (empty($filename)) {
return PEAR::raiseError(
'The supplied filename for the attachment can\'t be empty'
);
}
$filename = basename($filename);
if (PEAR::isError($filedata)) {
return $filedata;
}
 
$this->_parts[] = array(
'body' => $filedata,
'name' => $filename,
'c_type' => $c_type,
'encoding' => $encoding
);
return true;
}
 
/**
* Get the contents of the given file name as string
*
* @param string $file_name path of file to process
* @return string contents of $file_name
* @access private
*/
function &_file2str($file_name)
{
if (!is_readable($file_name)) {
return PEAR::raiseError('File is not readable ' . $file_name);
}
if (!$fd = fopen($file_name, 'rb')) {
return PEAR::raiseError('Could not open ' . $file_name);
}
$filesize = filesize($file_name);
if ($filesize == 0){
$cont = "";
}else{
$cont = fread($fd, $filesize);
}
fclose($fd);
return $cont;
}
 
/**
* Adds a text subpart to the mimePart object and
* returns it during the build process.
*
* @param mixed The object to add the part to, or
* null if a new object is to be created.
* @param string The text to add.
* @return object The text mimePart object
* @access private
*/
function &_addTextPart(&$obj, $text)
{
$params['content_type'] = 'text/plain';
$params['encoding'] = $this->_build_params['text_encoding'];
$params['charset'] = $this->_build_params['text_charset'];
if (is_object($obj)) {
return $obj->addSubpart($text, $params);
} else {
return new Mail_mimePart($text, $params);
}
}
 
/**
* Adds a html subpart to the mimePart object and
* returns it during the build process.
*
* @param mixed The object to add the part to, or
* null if a new object is to be created.
* @return object The html mimePart object
* @access private
*/
function &_addHtmlPart(&$obj)
{
$params['content_type'] = 'text/html';
$params['encoding'] = $this->_build_params['html_encoding'];
$params['charset'] = $this->_build_params['html_charset'];
if (is_object($obj)) {
return $obj->addSubpart($this->_htmlbody, $params);
} else {
return new Mail_mimePart($this->_htmlbody, $params);
}
}
 
/**
* Creates a new mimePart object, using multipart/mixed as
* the initial content-type and returns it during the
* build process.
*
* @return object The multipart/mixed mimePart object
* @access private
*/
function &_addMixedPart()
{
$params['content_type'] = 'multipart/mixed';
return new Mail_mimePart('', $params);
}
 
/**
* Adds a multipart/alternative part to a mimePart
* object (or creates one), and returns it during
* the build process.
*
* @param mixed The object to add the part to, or
* null if a new object is to be created.
* @return object The multipart/mixed mimePart object
* @access private
*/
function &_addAlternativePart(&$obj)
{
$params['content_type'] = 'multipart/alternative';
if (is_object($obj)) {
return $obj->addSubpart('', $params);
} else {
return new Mail_mimePart('', $params);
}
}
 
/**
* Adds a multipart/related part to a mimePart
* object (or creates one), and returns it during
* the build process.
*
* @param mixed The object to add the part to, or
* null if a new object is to be created
* @return object The multipart/mixed mimePart object
* @access private
*/
function &_addRelatedPart(&$obj)
{
$params['content_type'] = 'multipart/related';
if (is_object($obj)) {
return $obj->addSubpart('', $params);
} else {
return new Mail_mimePart('', $params);
}
}
 
/**
* Adds an html image subpart to a mimePart object
* and returns it during the build process.
*
* @param object The mimePart to add the image to
* @param array The image information
* @return object The image mimePart object
* @access private
*/
function &_addHtmlImagePart(&$obj, $value)
{
$params['content_type'] = $value['c_type'];
$params['encoding'] = 'base64';
$params['disposition'] = 'inline';
$params['dfilename'] = $value['name'];
$params['cid'] = $value['cid'];
$obj->addSubpart($value['body'], $params);
}
 
/**
* Adds an attachment subpart to a mimePart object
* and returns it during the build process.
*
* @param object The mimePart to add the image to
* @param array The attachment information
* @return object The image mimePart object
* @access private
*/
function &_addAttachmentPart(&$obj, $value)
{
$params['content_type'] = $value['c_type'];
$params['encoding'] = $value['encoding'];
$params['disposition'] = 'attachment';
$params['dfilename'] = $value['name'];
$obj->addSubpart($value['body'], $params);
}
 
/**
* Builds the multipart message from the list ($this->_parts) and
* returns the mime content.
*
* @param array Build parameters that change the way the email
* is built. Should be associative. Can contain:
* text_encoding - What encoding to use for plain text
* Default is 7bit
* html_encoding - What encoding to use for html
* Default is quoted-printable
* 7bit_wrap - Number of characters before text is
* wrapped in 7bit encoding
* Default is 998
* html_charset - The character set to use for html.
* Default is iso-8859-1
* text_charset - The character set to use for text.
* Default is iso-8859-1
* head_charset - The character set to use for headers.
* Default is iso-8859-1
* @return string The mime content
* @access public
*/
function &get($build_params = null)
{
if (isset($build_params)) {
while (list($key, $value) = each($build_params)) {
$this->_build_params[$key] = $value;
}
}
 
if (!empty($this->_html_images) AND isset($this->_htmlbody)) {
foreach ($this->_html_images as $value) {
$regex = '#(\s)((?i)src|background|href(?-i))\s*=\s*(["\']?)' . preg_quote($value['name'], '#') .
'\3#';
$rep = '\1\2=\3cid:' . $value['cid'] .'\3';
$this->_htmlbody = preg_replace($regex, $rep,
$this->_htmlbody
);
}
}
 
$null = null;
$attachments = !empty($this->_parts) ? true : false;
$html_images = !empty($this->_html_images) ? true : false;
$html = !empty($this->_htmlbody) ? true : false;
$text = (!$html AND !empty($this->_txtbody)) ? true : false;
 
switch (true) {
case $text AND !$attachments:
$message =& $this->_addTextPart($null, $this->_txtbody);
break;
 
case !$text AND !$html AND $attachments:
$message =& $this->_addMixedPart();
for ($i = 0; $i < count($this->_parts); $i++) {
$this->_addAttachmentPart($message, $this->_parts[$i]);
}
break;
 
case $text AND $attachments:
$message =& $this->_addMixedPart();
$this->_addTextPart($message, $this->_txtbody);
for ($i = 0; $i < count($this->_parts); $i++) {
$this->_addAttachmentPart($message, $this->_parts[$i]);
}
break;
 
case $html AND !$attachments AND !$html_images:
if (isset($this->_txtbody)) {
$message =& $this->_addAlternativePart($null);
$this->_addTextPart($message, $this->_txtbody);
$this->_addHtmlPart($message);
} else {
$message =& $this->_addHtmlPart($null);
}
break;
 
case $html AND !$attachments AND $html_images:
if (isset($this->_txtbody)) {
$message =& $this->_addAlternativePart($null);
$this->_addTextPart($message, $this->_txtbody);
$related =& $this->_addRelatedPart($message);
} else {
$message =& $this->_addRelatedPart($null);
$related =& $message;
}
$this->_addHtmlPart($related);
for ($i = 0; $i < count($this->_html_images); $i++) {
$this->_addHtmlImagePart($related, $this->_html_images[$i]);
}
break;
 
case $html AND $attachments AND !$html_images:
$message =& $this->_addMixedPart();
if (isset($this->_txtbody)) {
$alt =& $this->_addAlternativePart($message);
$this->_addTextPart($alt, $this->_txtbody);
$this->_addHtmlPart($alt);
} else {
$this->_addHtmlPart($message);
}
for ($i = 0; $i < count($this->_parts); $i++) {
$this->_addAttachmentPart($message, $this->_parts[$i]);
}
break;
 
case $html AND $attachments AND $html_images:
$message =& $this->_addMixedPart();
if (isset($this->_txtbody)) {
$alt =& $this->_addAlternativePart($message);
$this->_addTextPart($alt, $this->_txtbody);
$rel =& $this->_addRelatedPart($alt);
} else {
$rel =& $this->_addRelatedPart($message);
}
$this->_addHtmlPart($rel);
for ($i = 0; $i < count($this->_html_images); $i++) {
$this->_addHtmlImagePart($rel, $this->_html_images[$i]);
}
for ($i = 0; $i < count($this->_parts); $i++) {
$this->_addAttachmentPart($message, $this->_parts[$i]);
}
break;
 
}
 
if (isset($message)) {
$output = $message->encode();
$this->_headers = array_merge($this->_headers,
$output['headers']);
return $output['body'];
 
} else {
return false;
}
}
 
/**
* Returns an array with the headers needed to prepend to the email
* (MIME-Version and Content-Type). Format of argument is:
* $array['header-name'] = 'header-value';
*
* @param array $xtra_headers Assoc array with any extra headers.
* Optional.
* @return array Assoc array with the mime headers
* @access public
*/
function &headers($xtra_headers = null)
{
// Content-Type header should already be present,
// So just add mime version header
$headers['MIME-Version'] = '1.0';
if (isset($xtra_headers)) {
$headers = array_merge($headers, $xtra_headers);
}
$this->_headers = array_merge($headers, $this->_headers);
 
return $this->_encodeHeaders($this->_headers);
}
 
/**
* Get the text version of the headers
* (usefull if you want to use the PHP mail() function)
*
* @param array $xtra_headers Assoc array with any extra headers.
* Optional.
* @return string Plain text headers
* @access public
*/
function txtHeaders($xtra_headers = null)
{
$headers = $this->headers($xtra_headers);
$ret = '';
foreach ($headers as $key => $val) {
$ret .= "$key: $val" . MAIL_MIME_CRLF;
}
return $ret;
}
 
/**
* Sets the Subject header
*
* @param string $subject String to set the subject to
* access public
*/
function setSubject($subject)
{
$this->_headers['Subject'] = $subject;
}
 
/**
* Set an email to the From (the sender) header
*
* @param string $email The email direction to add
* @access public
*/
function setFrom($email)
{
$this->_headers['From'] = $email;
}
 
/**
* Add an email to the Cc (carbon copy) header
* (multiple calls to this method are allowed)
*
* @param string $email The email direction to add
* @access public
*/
function addCc($email)
{
if (isset($this->_headers['Cc'])) {
$this->_headers['Cc'] .= ", $email";
} else {
$this->_headers['Cc'] = $email;
}
}
 
/**
* Add an email to the Bcc (blank carbon copy) header
* (multiple calls to this method are allowed)
*
* @param string $email The email direction to add
* @access public
*/
function addBcc($email)
{
if (isset($this->_headers['Bcc'])) {
$this->_headers['Bcc'] .= ", $email";
} else {
$this->_headers['Bcc'] = $email;
}
}
 
/**
* Encodes a header as per RFC2047
*
* @param string $input The header data to encode
* @return string Encoded data
* @access private
*/
function _encodeHeaders($input)
{
foreach ($input as $hdr_name => $hdr_value) {
preg_match_all('/(\w*[\x80-\xFF]+\w*)/', $hdr_value, $matches);
foreach ($matches[1] as $value) {
$replacement = preg_replace('/([\x80-\xFF])/e',
'"=" .
strtoupper(dechex(ord("\1")))',
$value);
$hdr_value = str_replace($value, '=?' .
$this->_build_params['head_charset'] .
'?Q?' . $replacement . '?=',
$hdr_value);
}
$input[$hdr_name] = $hdr_value;
}
 
return $input;
}
 
/**
* Set the object's end-of-line and define the constant if applicable
*
* @param string $eol End Of Line sequence
* @access private
*/
function _setEOL($eol)
{
$this->_eol = $eol;
if (!defined('MAIL_MIME_CRLF')) {
define('MAIL_MIME_CRLF', $this->_eol, true);
}
}
 
 
} // End of class
?>
/tags/Racine_livraison_narmer/api/pear/Mail/null.php
New file
0,0 → 1,60
<?php
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Phil Kernick <philk@rotfl.com.au> |
// +----------------------------------------------------------------------+
//
// $Id: null.php,v 1.1 2005-11-24 16:15:46 florian Exp $
//
 
/**
* Null implementation of the PEAR Mail:: interface.
* @access public
* @package Mail
* @version $Revision: 1.1 $
*/
class Mail_null extends Mail {
 
/**
* Implements Mail_null::send() function. Silently discards all
* mail.
*
* @param mixed $recipients Either a comma-seperated list of recipients
* (RFC822 compliant), or an array of recipients,
* each RFC822 valid. This may contain recipients not
* specified in the headers, for Bcc:, resending
* messages, etc.
*
* @param array $headers The array of headers to send with the mail, in an
* associative array, where the array key is the
* header name (ie, 'Subject'), and the array value
* is the header value (ie, 'test'). The header
* produced from those values would be 'Subject:
* test'.
*
* @param string $body The full text of the message body, including any
* Mime parts, etc.
*
* @return mixed Returns true on success, or a PEAR_Error
* containing a descriptive error message on
* failure.
* @access public
*/
function send($recipients, $headers, $body)
{
return true;
}
 
}
/tags/Racine_livraison_narmer/api/pear/Mail/mimeDecode.php
New file
0,0 → 1,837
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
// +-----------------------------------------------------------------------+
// | Copyright (c) 2002-2003 Richard Heyes |
// | Copyright (c) 2003-2005 The PHP Group |
// | All rights reserved. |
// | |
// | Redistribution and use in source and binary forms, with or without |
// | modification, are permitted provided that the following conditions |
// | are met: |
// | |
// | o Redistributions of source code must retain the above copyright |
// | notice, this list of conditions and the following disclaimer. |
// | o Redistributions in binary form must reproduce the above copyright |
// | notice, this list of conditions and the following disclaimer in the |
// | documentation and/or other materials provided with the distribution.|
// | o The names of the authors may not be used to endorse or promote |
// | products derived from this software without specific prior written |
// | permission. |
// | |
// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
// | |
// +-----------------------------------------------------------------------+
// | Author: Richard Heyes <richard@phpguru.org> |
// +-----------------------------------------------------------------------+
 
require_once 'PEAR.php';
 
/**
* +----------------------------- IMPORTANT ------------------------------+
* | Usage of this class compared to native php extensions such as |
* | mailparse or imap, is slow and may be feature deficient. If available|
* | you are STRONGLY recommended to use the php extensions. |
* +----------------------------------------------------------------------+
*
* Mime Decoding class
*
* This class will parse a raw mime email and return
* the structure. Returned structure is similar to
* that returned by imap_fetchstructure().
*
* USAGE: (assume $input is your raw email)
*
* $decode = new Mail_mimeDecode($input, "\r\n");
* $structure = $decode->decode();
* print_r($structure);
*
* Or statically:
*
* $params['input'] = $input;
* $structure = Mail_mimeDecode::decode($params);
* print_r($structure);
*
* TODO:
* o Implement multipart/appledouble
* o UTF8: ???
 
> 4. We have also found a solution for decoding the UTF-8
> headers. Therefore I made the following function:
>
> function decode_utf8($txt) {
> $trans=array("Å&#8216;"=>"õ","ű"=>"û","Ő"=>"Ã&#8226;","Å°"
=>"Ã&#8250;");
> $txt=strtr($txt,$trans);
> return(utf8_decode($txt));
> }
>
> And I have inserted the following line to the class:
>
> if (strtolower($charset)=="utf-8") $text=decode_utf8($text);
>
> ... before the following one in the "_decodeHeader" function:
>
> $input = str_replace($encoded, $text, $input);
>
> This way from now on it can easily decode the UTF-8 headers too.
 
*
* @author Richard Heyes <richard@phpguru.org>
* @version $Revision: 1.1 $
* @package Mail
*/
class Mail_mimeDecode extends PEAR
{
/**
* The raw email to decode
* @var string
*/
var $_input;
 
/**
* The header part of the input
* @var string
*/
var $_header;
 
/**
* The body part of the input
* @var string
*/
var $_body;
 
/**
* If an error occurs, this is used to store the message
* @var string
*/
var $_error;
 
/**
* Flag to determine whether to include bodies in the
* returned object.
* @var boolean
*/
var $_include_bodies;
 
/**
* Flag to determine whether to decode bodies
* @var boolean
*/
var $_decode_bodies;
 
/**
* Flag to determine whether to decode headers
* @var boolean
*/
var $_decode_headers;
 
/**
* Constructor.
*
* Sets up the object, initialise the variables, and splits and
* stores the header and body of the input.
*
* @param string The input to decode
* @access public
*/
function Mail_mimeDecode($input)
{
list($header, $body) = $this->_splitBodyHeader($input);
 
$this->_input = $input;
$this->_header = $header;
$this->_body = $body;
$this->_decode_bodies = false;
$this->_include_bodies = true;
}
 
/**
* Begins the decoding process. If called statically
* it will create an object and call the decode() method
* of it.
*
* @param array An array of various parameters that determine
* various things:
* include_bodies - Whether to include the body in the returned
* object.
* decode_bodies - Whether to decode the bodies
* of the parts. (Transfer encoding)
* decode_headers - Whether to decode headers
* input - If called statically, this will be treated
* as the input
* @return object Decoded results
* @access public
*/
function decode($params = null)
{
// determine if this method has been called statically
$isStatic = !(isset($this) && get_class($this) == __CLASS__);
 
// Have we been called statically?
// If so, create an object and pass details to that.
if ($isStatic AND isset($params['input'])) {
 
$obj = new Mail_mimeDecode($params['input']);
$structure = $obj->decode($params);
 
// Called statically but no input
} elseif ($isStatic) {
return PEAR::raiseError('Called statically and no input given');
 
// Called via an object
} else {
$this->_include_bodies = isset($params['include_bodies']) ?
$params['include_bodies'] : false;
$this->_decode_bodies = isset($params['decode_bodies']) ?
$params['decode_bodies'] : false;
$this->_decode_headers = isset($params['decode_headers']) ?
$params['decode_headers'] : false;
 
$structure = $this->_decode($this->_header, $this->_body);
if ($structure === false) {
$structure = $this->raiseError($this->_error);
}
}
 
return $structure;
}
 
/**
* Performs the decoding. Decodes the body string passed to it
* If it finds certain content-types it will call itself in a
* recursive fashion
*
* @param string Header section
* @param string Body section
* @return object Results of decoding process
* @access private
*/
function _decode($headers, $body, $default_ctype = 'text/plain')
{
$return = new stdClass;
$return->headers = array();
$headers = $this->_parseHeaders($headers);
 
foreach ($headers as $value) {
if (isset($return->headers[strtolower($value['name'])]) AND !is_array($return->headers[strtolower($value['name'])])) {
$return->headers[strtolower($value['name'])] = array($return->headers[strtolower($value['name'])]);
$return->headers[strtolower($value['name'])][] = $value['value'];
 
} elseif (isset($return->headers[strtolower($value['name'])])) {
$return->headers[strtolower($value['name'])][] = $value['value'];
 
} else {
$return->headers[strtolower($value['name'])] = $value['value'];
}
}
 
reset($headers);
while (list($key, $value) = each($headers)) {
$headers[$key]['name'] = strtolower($headers[$key]['name']);
switch ($headers[$key]['name']) {
 
case 'content-type':
$content_type = $this->_parseHeaderValue($headers[$key]['value']);
 
if (preg_match('/([0-9a-z+.-]+)\/([0-9a-z+.-]+)/i', $content_type['value'], $regs)) {
$return->ctype_primary = $regs[1];
$return->ctype_secondary = $regs[2];
}
 
if (isset($content_type['other'])) {
while (list($p_name, $p_value) = each($content_type['other'])) {
$return->ctype_parameters[$p_name] = $p_value;
}
}
break;
 
case 'content-disposition':
$content_disposition = $this->_parseHeaderValue($headers[$key]['value']);
$return->disposition = $content_disposition['value'];
if (isset($content_disposition['other'])) {
while (list($p_name, $p_value) = each($content_disposition['other'])) {
$return->d_parameters[$p_name] = $p_value;
}
}
break;
 
case 'content-transfer-encoding':
$content_transfer_encoding = $this->_parseHeaderValue($headers[$key]['value']);
break;
}
}
 
if (isset($content_type)) {
switch (strtolower($content_type['value'])) {
case 'text/plain':
$encoding = isset($content_transfer_encoding) ? $content_transfer_encoding['value'] : '7bit';
$this->_include_bodies ? $return->body = ($this->_decode_bodies ? $this->_decodeBody($body, $encoding) : $body) : null;
break;
 
case 'text/html':
$encoding = isset($content_transfer_encoding) ? $content_transfer_encoding['value'] : '7bit';
$this->_include_bodies ? $return->body = ($this->_decode_bodies ? $this->_decodeBody($body, $encoding) : $body) : null;
break;
 
case 'multipart/parallel':
case 'multipart/report': // RFC1892
case 'multipart/signed': // PGP
case 'multipart/digest':
case 'multipart/alternative':
case 'multipart/related':
case 'multipart/mixed':
if(!isset($content_type['other']['boundary'])){
$this->_error = 'No boundary found for ' . $content_type['value'] . ' part';
return false;
}
 
$default_ctype = (strtolower($content_type['value']) === 'multipart/digest') ? 'message/rfc822' : 'text/plain';
 
$parts = $this->_boundarySplit($body, $content_type['other']['boundary']);
for ($i = 0; $i < count($parts); $i++) {
list($part_header, $part_body) = $this->_splitBodyHeader($parts[$i]);
$part = $this->_decode($part_header, $part_body, $default_ctype);
if($part === false)
$part = $this->raiseError($this->_error);
$return->parts[] = $part;
}
break;
 
case 'message/rfc822':
$obj = &new Mail_mimeDecode($body);
$return->parts[] = $obj->decode(array('include_bodies' => $this->_include_bodies,
'decode_bodies' => $this->_decode_bodies,
'decode_headers' => $this->_decode_headers));
unset($obj);
break;
 
default:
if(!isset($content_transfer_encoding['value']))
$content_transfer_encoding['value'] = '7bit';
$this->_include_bodies ? $return->body = ($this->_decode_bodies ? $this->_decodeBody($body, $content_transfer_encoding['value']) : $body) : null;
break;
}
 
} else {
$ctype = explode('/', $default_ctype);
$return->ctype_primary = $ctype[0];
$return->ctype_secondary = $ctype[1];
$this->_include_bodies ? $return->body = ($this->_decode_bodies ? $this->_decodeBody($body) : $body) : null;
}
 
return $return;
}
 
/**
* Given the output of the above function, this will return an
* array of references to the parts, indexed by mime number.
*
* @param object $structure The structure to go through
* @param string $mime_number Internal use only.
* @return array Mime numbers
*/
function &getMimeNumbers(&$structure, $no_refs = false, $mime_number = '', $prepend = '')
{
$return = array();
if (!empty($structure->parts)) {
if ($mime_number != '') {
$structure->mime_id = $prepend . $mime_number;
$return[$prepend . $mime_number] = &$structure;
}
for ($i = 0; $i < count($structure->parts); $i++) {
 
if (!empty($structure->headers['content-type']) AND substr(strtolower($structure->headers['content-type']), 0, 8) == 'message/') {
$prepend = $prepend . $mime_number . '.';
$_mime_number = '';
} else {
$_mime_number = ($mime_number == '' ? $i + 1 : sprintf('%s.%s', $mime_number, $i + 1));
}
 
$arr = &Mail_mimeDecode::getMimeNumbers($structure->parts[$i], $no_refs, $_mime_number, $prepend);
foreach ($arr as $key => $val) {
$no_refs ? $return[$key] = '' : $return[$key] = &$arr[$key];
}
}
} else {
if ($mime_number == '') {
$mime_number = '1';
}
$structure->mime_id = $prepend . $mime_number;
$no_refs ? $return[$prepend . $mime_number] = '' : $return[$prepend . $mime_number] = &$structure;
}
return $return;
}
 
/**
* Given a string containing a header and body
* section, this function will split them (at the first
* blank line) and return them.
*
* @param string Input to split apart
* @return array Contains header and body section
* @access private
*/
function _splitBodyHeader($input)
{
if (preg_match("/^(.*?)\r?\n\r?\n(.*)/s", $input, $match)) {
return array($match[1], $match[2]);
}
$this->_error = 'Could not split header and body';
return false;
}
 
/**
* Parse headers given in $input and return
* as assoc array.
*
* @param string Headers to parse
* @return array Contains parsed headers
* @access private
*/
function _parseHeaders($input)
{
 
if ($input !== '') {
// Unfold the input
$input = preg_replace("/\r?\n/", "\r\n", $input);
$input = preg_replace("/\r\n(\t| )+/", ' ', $input);
$headers = explode("\r\n", trim($input));
 
foreach ($headers as $value) {
$hdr_name = substr($value, 0, $pos = strpos($value, ':'));
$hdr_value = substr($value, $pos+1);
if($hdr_value[0] == ' ')
$hdr_value = substr($hdr_value, 1);
 
$return[] = array(
'name' => $hdr_name,
'value' => $this->_decode_headers ? $this->_decodeHeader($hdr_value) : $hdr_value
);
}
} else {
$return = array();
}
 
return $return;
}
 
/**
* Function to parse a header value,
* extract first part, and any secondary
* parts (after ;) This function is not as
* robust as it could be. Eg. header comments
* in the wrong place will probably break it.
*
* @param string Header value to parse
* @return array Contains parsed result
* @access private
*/
function _parseHeaderValue($input)
{
 
if (($pos = strpos($input, ';')) !== false) {
 
$return['value'] = trim(substr($input, 0, $pos));
$input = trim(substr($input, $pos+1));
 
if (strlen($input) > 0) {
 
// This splits on a semi-colon, if there's no preceeding backslash
// Now works with quoted values; had to glue the \; breaks in PHP
// the regex is already bordering on incomprehensible
$splitRegex = '/([^;\'"]*[\'"]([^\'"]*([^\'"]*)*)[\'"][^;\'"]*|([^;]+))(;|$)/';
preg_match_all($splitRegex, $input, $matches);
$parameters = array();
for ($i=0; $i<count($matches[0]); $i++) {
$param = $matches[0][$i];
while (substr($param, -2) == '\;') {
$param .= $matches[0][++$i];
}
$parameters[] = $param;
}
 
for ($i = 0; $i < count($parameters); $i++) {
$param_name = trim(substr($parameters[$i], 0, $pos = strpos($parameters[$i], '=')), "'\";\t\\ ");
$param_value = trim(str_replace('\;', ';', substr($parameters[$i], $pos + 1)), "'\";\t\\ ");
if ($param_value[0] == '"') {
$param_value = substr($param_value, 1, -1);
}
$return['other'][$param_name] = $param_value;
$return['other'][strtolower($param_name)] = $param_value;
}
}
} else {
$return['value'] = trim($input);
}
 
return $return;
}
 
/**
* This function splits the input based
* on the given boundary
*
* @param string Input to parse
* @return array Contains array of resulting mime parts
* @access private
*/
function _boundarySplit($input, $boundary)
{
$parts = array();
 
$bs_possible = substr($boundary, 2, -2);
$bs_check = '\"' . $bs_possible . '\"';
 
if ($boundary == $bs_check) {
$boundary = $bs_possible;
}
 
$tmp = explode('--' . $boundary, $input);
 
for ($i = 1; $i < count($tmp) - 1; $i++) {
$parts[] = $tmp[$i];
}
 
return $parts;
}
 
/**
* Given a header, this function will decode it
* according to RFC2047. Probably not *exactly*
* conformant, but it does pass all the given
* examples (in RFC2047).
*
* @param string Input header value to decode
* @return string Decoded header value
* @access private
*/
function _decodeHeader($input)
{
// Remove white space between encoded-words
$input = preg_replace('/(=\?[^?]+\?(q|b)\?[^?]*\?=)(\s)+=\?/i', '\1=?', $input);
 
// For each encoded-word...
while (preg_match('/(=\?([^?]+)\?(q|b)\?([^?]*)\?=)/i', $input, $matches)) {
 
$encoded = $matches[1];
$charset = $matches[2];
$encoding = $matches[3];
$text = $matches[4];
 
switch (strtolower($encoding)) {
case 'b':
$text = base64_decode($text);
break;
 
case 'q':
$text = str_replace('_', ' ', $text);
preg_match_all('/=([a-f0-9]{2})/i', $text, $matches);
foreach($matches[1] as $value)
$text = str_replace('='.$value, chr(hexdec($value)), $text);
break;
}
 
$input = str_replace($encoded, $text, $input);
}
 
return $input;
}
 
/**
* Given a body string and an encoding type,
* this function will decode and return it.
*
* @param string Input body to decode
* @param string Encoding type to use.
* @return string Decoded body
* @access private
*/
function _decodeBody($input, $encoding = '7bit')
{
switch (strtolower($encoding)) {
case '7bit':
return $input;
break;
 
case 'quoted-printable':
return $this->_quotedPrintableDecode($input);
break;
 
case 'base64':
return base64_decode($input);
break;
 
default:
return $input;
}
}
 
/**
* Given a quoted-printable string, this
* function will decode and return it.
*
* @param string Input body to decode
* @return string Decoded body
* @access private
*/
function _quotedPrintableDecode($input)
{
// Remove soft line breaks
$input = preg_replace("/=\r?\n/", '', $input);
 
// Replace encoded characters
$input = preg_replace('/=([a-f0-9]{2})/ie', "chr(hexdec('\\1'))", $input);
 
return $input;
}
 
/**
* Checks the input for uuencoded files and returns
* an array of them. Can be called statically, eg:
*
* $files =& Mail_mimeDecode::uudecode($some_text);
*
* It will check for the begin 666 ... end syntax
* however and won't just blindly decode whatever you
* pass it.
*
* @param string Input body to look for attahcments in
* @return array Decoded bodies, filenames and permissions
* @access public
* @author Unknown
*/
function &uudecode($input)
{
// Find all uuencoded sections
preg_match_all("/begin ([0-7]{3}) (.+)\r?\n(.+)\r?\nend/Us", $input, $matches);
 
for ($j = 0; $j < count($matches[3]); $j++) {
 
$str = $matches[3][$j];
$filename = $matches[2][$j];
$fileperm = $matches[1][$j];
 
$file = '';
$str = preg_split("/\r?\n/", trim($str));
$strlen = count($str);
 
for ($i = 0; $i < $strlen; $i++) {
$pos = 1;
$d = 0;
$len=(int)(((ord(substr($str[$i],0,1)) -32) - ' ') & 077);
 
while (($d + 3 <= $len) AND ($pos + 4 <= strlen($str[$i]))) {
$c0 = (ord(substr($str[$i],$pos,1)) ^ 0x20);
$c1 = (ord(substr($str[$i],$pos+1,1)) ^ 0x20);
$c2 = (ord(substr($str[$i],$pos+2,1)) ^ 0x20);
$c3 = (ord(substr($str[$i],$pos+3,1)) ^ 0x20);
$file .= chr(((($c0 - ' ') & 077) << 2) | ((($c1 - ' ') & 077) >> 4));
 
$file .= chr(((($c1 - ' ') & 077) << 4) | ((($c2 - ' ') & 077) >> 2));
 
$file .= chr(((($c2 - ' ') & 077) << 6) | (($c3 - ' ') & 077));
 
$pos += 4;
$d += 3;
}
 
if (($d + 2 <= $len) && ($pos + 3 <= strlen($str[$i]))) {
$c0 = (ord(substr($str[$i],$pos,1)) ^ 0x20);
$c1 = (ord(substr($str[$i],$pos+1,1)) ^ 0x20);
$c2 = (ord(substr($str[$i],$pos+2,1)) ^ 0x20);
$file .= chr(((($c0 - ' ') & 077) << 2) | ((($c1 - ' ') & 077) >> 4));
 
$file .= chr(((($c1 - ' ') & 077) << 4) | ((($c2 - ' ') & 077) >> 2));
 
$pos += 3;
$d += 2;
}
 
if (($d + 1 <= $len) && ($pos + 2 <= strlen($str[$i]))) {
$c0 = (ord(substr($str[$i],$pos,1)) ^ 0x20);
$c1 = (ord(substr($str[$i],$pos+1,1)) ^ 0x20);
$file .= chr(((($c0 - ' ') & 077) << 2) | ((($c1 - ' ') & 077) >> 4));
 
}
}
$files[] = array('filename' => $filename, 'fileperm' => $fileperm, 'filedata' => $file);
}
 
return $files;
}
 
/**
* getSendArray() returns the arguments required for Mail::send()
* used to build the arguments for a mail::send() call
*
* Usage:
* $mailtext = Full email (for example generated by a template)
* $decoder = new Mail_mimeDecode($mailtext);
* $parts = $decoder->getSendArray();
* if (!PEAR::isError($parts) {
* list($recipents,$headers,$body) = $parts;
* $mail = Mail::factory('smtp');
* $mail->send($recipents,$headers,$body);
* } else {
* echo $parts->message;
* }
* @return mixed array of recipeint, headers,body or Pear_Error
* @access public
* @author Alan Knowles <alan@akbkhome.com>
*/
function getSendArray()
{
// prevent warning if this is not set
$this->_decode_headers = FALSE;
$headerlist =$this->_parseHeaders($this->_header);
$to = "";
if (!$headerlist) {
return $this->raiseError("Message did not contain headers");
}
foreach($headerlist as $item) {
$header[$item['name']] = $item['value'];
switch (strtolower($item['name'])) {
case "to":
case "cc":
case "bcc":
$to = ",".$item['value'];
default:
break;
}
}
if ($to == "") {
return $this->raiseError("Message did not contain any recipents");
}
$to = substr($to,1);
return array($to,$header,$this->_body);
}
 
/**
* Returns a xml copy of the output of
* Mail_mimeDecode::decode. Pass the output in as the
* argument. This function can be called statically. Eg:
*
* $output = $obj->decode();
* $xml = Mail_mimeDecode::getXML($output);
*
* The DTD used for this should have been in the package. Or
* alternatively you can get it from cvs, or here:
* http://www.phpguru.org/xmail/xmail.dtd.
*
* @param object Input to convert to xml. This should be the
* output of the Mail_mimeDecode::decode function
* @return string XML version of input
* @access public
*/
function getXML($input)
{
$crlf = "\r\n";
$output = '<?xml version=\'1.0\'?>' . $crlf .
'<!DOCTYPE email SYSTEM "http://www.phpguru.org/xmail/xmail.dtd">' . $crlf .
'<email>' . $crlf .
Mail_mimeDecode::_getXML($input) .
'</email>';
 
return $output;
}
 
/**
* Function that does the actual conversion to xml. Does a single
* mimepart at a time.
*
* @param object Input to convert to xml. This is a mimepart object.
* It may or may not contain subparts.
* @param integer Number of tabs to indent
* @return string XML version of input
* @access private
*/
function _getXML($input, $indent = 1)
{
$htab = "\t";
$crlf = "\r\n";
$output = '';
$headers = @(array)$input->headers;
 
foreach ($headers as $hdr_name => $hdr_value) {
 
// Multiple headers with this name
if (is_array($headers[$hdr_name])) {
for ($i = 0; $i < count($hdr_value); $i++) {
$output .= Mail_mimeDecode::_getXML_helper($hdr_name, $hdr_value[$i], $indent);
}
 
// Only one header of this sort
} else {
$output .= Mail_mimeDecode::_getXML_helper($hdr_name, $hdr_value, $indent);
}
}
 
if (!empty($input->parts)) {
for ($i = 0; $i < count($input->parts); $i++) {
$output .= $crlf . str_repeat($htab, $indent) . '<mimepart>' . $crlf .
Mail_mimeDecode::_getXML($input->parts[$i], $indent+1) .
str_repeat($htab, $indent) . '</mimepart>' . $crlf;
}
} elseif (isset($input->body)) {
$output .= $crlf . str_repeat($htab, $indent) . '<body><![CDATA[' .
$input->body . ']]></body>' . $crlf;
}
 
return $output;
}
 
/**
* Helper function to _getXML(). Returns xml of a header.
*
* @param string Name of header
* @param string Value of header
* @param integer Number of tabs to indent
* @return string XML version of input
* @access private
*/
function _getXML_helper($hdr_name, $hdr_value, $indent)
{
$htab = "\t";
$crlf = "\r\n";
$return = '';
 
$new_hdr_value = ($hdr_name != 'received') ? Mail_mimeDecode::_parseHeaderValue($hdr_value) : array('value' => $hdr_value);
$new_hdr_name = str_replace(' ', '-', ucwords(str_replace('-', ' ', $hdr_name)));
 
// Sort out any parameters
if (!empty($new_hdr_value['other'])) {
foreach ($new_hdr_value['other'] as $paramname => $paramvalue) {
$params[] = str_repeat($htab, $indent) . $htab . '<parameter>' . $crlf .
str_repeat($htab, $indent) . $htab . $htab . '<paramname>' . htmlspecialchars($paramname) . '</paramname>' . $crlf .
str_repeat($htab, $indent) . $htab . $htab . '<paramvalue>' . htmlspecialchars($paramvalue) . '</paramvalue>' . $crlf .
str_repeat($htab, $indent) . $htab . '</parameter>' . $crlf;
}
 
$params = implode('', $params);
} else {
$params = '';
}
 
$return = str_repeat($htab, $indent) . '<header>' . $crlf .
str_repeat($htab, $indent) . $htab . '<headername>' . htmlspecialchars($new_hdr_name) . '</headername>' . $crlf .
str_repeat($htab, $indent) . $htab . '<headervalue>' . htmlspecialchars($new_hdr_value['value']) . '</headervalue>' . $crlf .
$params .
str_repeat($htab, $indent) . '</header>' . $crlf;
 
return $return;
}
 
} // End of class
?>
/tags/Racine_livraison_narmer/api/pear/Mail/sendmail.php
New file
0,0 → 1,145
<?php
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Chuck Hagenbuch <chuck@horde.org> |
// +----------------------------------------------------------------------+
 
/**
* Sendmail implementation of the PEAR Mail:: interface.
* @access public
* @package Mail
* @version $Revision: 1.1 $
*/
class Mail_sendmail extends Mail {
 
/**
* The location of the sendmail or sendmail wrapper binary on the
* filesystem.
* @var string
*/
var $sendmail_path = '/usr/sbin/sendmail';
 
/**
* Any extra command-line parameters to pass to the sendmail or
* sendmail wrapper binary.
* @var string
*/
var $sendmail_args = '';
 
/**
* Constructor.
*
* Instantiates a new Mail_sendmail:: object based on the parameters
* passed in. It looks for the following parameters:
* sendmail_path The location of the sendmail binary on the
* filesystem. Defaults to '/usr/sbin/sendmail'.
*
* sendmail_args Any extra parameters to pass to the sendmail
* or sendmail wrapper binary.
*
* If a parameter is present in the $params array, it replaces the
* default.
*
* @param array $params Hash containing any parameters different from the
* defaults.
* @access public
*/
function Mail_sendmail($params)
{
if (isset($params['sendmail_path'])) $this->sendmail_path = $params['sendmail_path'];
if (isset($params['sendmail_args'])) $this->sendmail_args = $params['sendmail_args'];
 
/*
* Because we need to pass message headers to the sendmail program on
* the commandline, we can't guarantee the use of the standard "\r\n"
* separator. Instead, we use the system's native line separator.
*/
$this->sep = (strpos(PHP_OS, 'WIN') === false) ? "\n" : "\r\n";
}
 
/**
* Implements Mail::send() function using the sendmail
* command-line binary.
*
* @param mixed $recipients Either a comma-seperated list of recipients
* (RFC822 compliant), or an array of recipients,
* each RFC822 valid. This may contain recipients not
* specified in the headers, for Bcc:, resending
* messages, etc.
*
* @param array $headers The array of headers to send with the mail, in an
* associative array, where the array key is the
* header name (ie, 'Subject'), and the array value
* is the header value (ie, 'test'). The header
* produced from those values would be 'Subject:
* test'.
*
* @param string $body The full text of the message body, including any
* Mime parts, etc.
*
* @return mixed Returns true on success, or a PEAR_Error
* containing a descriptive error message on
* failure.
* @access public
*/
function send($recipients, $headers, $body)
{
$recipients = $this->parseRecipients($recipients);
if (PEAR::isError($recipients)) {
return $recipients;
}
$recipients = escapeShellCmd(implode(' ', $recipients));
 
$headerElements = $this->prepareHeaders($headers);
if (PEAR::isError($headerElements)) {
return $headerElements;
}
list($from, $text_headers) = $headerElements;
 
if (!isset($from)) {
return PEAR::raiseError('No from address given.');
} elseif (strpos($from, ' ') !== false ||
strpos($from, ';') !== false ||
strpos($from, '&') !== false ||
strpos($from, '`') !== false) {
return PEAR::raiseError('From address specified with dangerous characters.');
}
 
$result = 0;
if (@is_file($this->sendmail_path)) {
$from = escapeShellCmd($from);
$mail = popen($this->sendmail_path . (!empty($this->sendmail_args) ? ' ' . $this->sendmail_args : '') . " -f$from -- $recipients", 'w');
fputs($mail, $text_headers);
fputs($mail, $this->sep); // newline to end the headers section
fputs($mail, $body);
$result = pclose($mail);
if (version_compare(phpversion(), '4.2.3') == -1) {
// With older php versions, we need to shift the
// pclose result to get the exit code.
$result = $result >> 8 & 0xFF;
}
} else {
return PEAR::raiseError('sendmail [' . $this->sendmail_path . '] is not a valid file');
}
 
if ($result != 0) {
return PEAR::raiseError('sendmail returned error code ' . $result,
$result);
}
 
return true;
}
 
}
/tags/Racine_livraison_narmer/api/pear/Mail/mimePart.php
New file
0,0 → 1,351
<?php
// +-----------------------------------------------------------------------+
// | Copyright (c) 2002-2003 Richard Heyes |
// | All rights reserved. |
// | |
// | Redistribution and use in source and binary forms, with or without |
// | modification, are permitted provided that the following conditions |
// | are met: |
// | |
// | o Redistributions of source code must retain the above copyright |
// | notice, this list of conditions and the following disclaimer. |
// | o Redistributions in binary form must reproduce the above copyright |
// | notice, this list of conditions and the following disclaimer in the |
// | documentation and/or other materials provided with the distribution.|
// | o The names of the authors may not be used to endorse or promote |
// | products derived from this software without specific prior written |
// | permission. |
// | |
// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
// | |
// +-----------------------------------------------------------------------+
// | Author: Richard Heyes <richard@phpguru.org> |
// +-----------------------------------------------------------------------+
 
/**
*
* Raw mime encoding class
*
* What is it?
* This class enables you to manipulate and build
* a mime email from the ground up.
*
* Why use this instead of mime.php?
* mime.php is a userfriendly api to this class for
* people who aren't interested in the internals of
* mime mail. This class however allows full control
* over the email.
*
* Eg.
*
* // Since multipart/mixed has no real body, (the body is
* // the subpart), we set the body argument to blank.
*
* $params['content_type'] = 'multipart/mixed';
* $email = new Mail_mimePart('', $params);
*
* // Here we add a text part to the multipart we have
* // already. Assume $body contains plain text.
*
* $params['content_type'] = 'text/plain';
* $params['encoding'] = '7bit';
* $text = $email->addSubPart($body, $params);
*
* // Now add an attachment. Assume $attach is
* the contents of the attachment
*
* $params['content_type'] = 'application/zip';
* $params['encoding'] = 'base64';
* $params['disposition'] = 'attachment';
* $params['dfilename'] = 'example.zip';
* $attach =& $email->addSubPart($body, $params);
*
* // Now build the email. Note that the encode
* // function returns an associative array containing two
* // elements, body and headers. You will need to add extra
* // headers, (eg. Mime-Version) before sending.
*
* $email = $message->encode();
* $email['headers'][] = 'Mime-Version: 1.0';
*
*
* Further examples are available at http://www.phpguru.org
*
* TODO:
* - Set encode() to return the $obj->encoded if encode()
* has already been run. Unless a flag is passed to specifically
* re-build the message.
*
* @author Richard Heyes <richard@phpguru.org>
* @version $Revision: 1.1 $
* @package Mail
*/
 
class Mail_mimePart {
 
/**
* The encoding type of this part
* @var string
*/
var $_encoding;
 
/**
* An array of subparts
* @var array
*/
var $_subparts;
 
/**
* The output of this part after being built
* @var string
*/
var $_encoded;
 
/**
* Headers for this part
* @var array
*/
var $_headers;
 
/**
* The body of this part (not encoded)
* @var string
*/
var $_body;
 
/**
* Constructor.
*
* Sets up the object.
*
* @param $body - The body of the mime part if any.
* @param $params - An associative array of parameters:
* content_type - The content type for this part eg multipart/mixed
* encoding - The encoding to use, 7bit, 8bit, base64, or quoted-printable
* cid - Content ID to apply
* disposition - Content disposition, inline or attachment
* dfilename - Optional filename parameter for content disposition
* description - Content description
* charset - Character set to use
* @access public
*/
function Mail_mimePart($body = '', $params = array())
{
if (!defined('MAIL_MIMEPART_CRLF')) {
define('MAIL_MIMEPART_CRLF', defined('MAIL_MIME_CRLF') ? MAIL_MIME_CRLF : "\r\n", TRUE);
}
 
foreach ($params as $key => $value) {
switch ($key) {
case 'content_type':
$headers['Content-Type'] = $value . (isset($charset) ? '; charset="' . $charset . '"' : '');
break;
 
case 'encoding':
$this->_encoding = $value;
$headers['Content-Transfer-Encoding'] = $value;
break;
 
case 'cid':
$headers['Content-ID'] = '<' . $value . '>';
break;
 
case 'disposition':
$headers['Content-Disposition'] = $value . (isset($dfilename) ? '; filename="' . $dfilename . '"' : '');
break;
 
case 'dfilename':
if (isset($headers['Content-Disposition'])) {
$headers['Content-Disposition'] .= '; filename="' . $value . '"';
} else {
$dfilename = $value;
}
break;
 
case 'description':
$headers['Content-Description'] = $value;
break;
 
case 'charset':
if (isset($headers['Content-Type'])) {
$headers['Content-Type'] .= '; charset="' . $value . '"';
} else {
$charset = $value;
}
break;
}
}
 
// Default content-type
if (!isset($headers['Content-Type'])) {
$headers['Content-Type'] = 'text/plain';
}
 
//Default encoding
if (!isset($this->_encoding)) {
$this->_encoding = '7bit';
}
 
// Assign stuff to member variables
$this->_encoded = array();
$this->_headers = $headers;
$this->_body = $body;
}
 
/**
* encode()
*
* Encodes and returns the email. Also stores
* it in the encoded member variable
*
* @return An associative array containing two elements,
* body and headers. The headers element is itself
* an indexed array.
* @access public
*/
function encode()
{
$encoded =& $this->_encoded;
 
if (!empty($this->_subparts)) {
srand((double)microtime()*1000000);
$boundary = '=_' . md5(rand() . microtime());
$this->_headers['Content-Type'] .= ';' . MAIL_MIMEPART_CRLF . "\t" . 'boundary="' . $boundary . '"';
 
// Add body parts to $subparts
for ($i = 0; $i < count($this->_subparts); $i++) {
$headers = array();
$tmp = $this->_subparts[$i]->encode();
foreach ($tmp['headers'] as $key => $value) {
$headers[] = $key . ': ' . $value;
}
$subparts[] = implode(MAIL_MIMEPART_CRLF, $headers) . MAIL_MIMEPART_CRLF . MAIL_MIMEPART_CRLF . $tmp['body'];
}
 
$encoded['body'] = '--' . $boundary . MAIL_MIMEPART_CRLF .
implode('--' . $boundary . MAIL_MIMEPART_CRLF, $subparts) .
'--' . $boundary.'--' . MAIL_MIMEPART_CRLF;
 
} else {
$encoded['body'] = $this->_getEncodedData($this->_body, $this->_encoding) . MAIL_MIMEPART_CRLF;
}
 
// Add headers to $encoded
$encoded['headers'] =& $this->_headers;
 
return $encoded;
}
 
/**
* &addSubPart()
*
* Adds a subpart to current mime part and returns
* a reference to it
*
* @param $body The body of the subpart, if any.
* @param $params The parameters for the subpart, same
* as the $params argument for constructor.
* @return A reference to the part you just added. It is
* crucial if using multipart/* in your subparts that
* you use =& in your script when calling this function,
* otherwise you will not be able to add further subparts.
* @access public
*/
function &addSubPart($body, $params)
{
$this->_subparts[] = new Mail_mimePart($body, $params);
return $this->_subparts[count($this->_subparts) - 1];
}
 
/**
* _getEncodedData()
*
* Returns encoded data based upon encoding passed to it
*
* @param $data The data to encode.
* @param $encoding The encoding type to use, 7bit, base64,
* or quoted-printable.
* @access private
*/
function _getEncodedData($data, $encoding)
{
switch ($encoding) {
case '8bit':
case '7bit':
return $data;
break;
 
case 'quoted-printable':
return $this->_quotedPrintableEncode($data);
break;
 
case 'base64':
return rtrim(chunk_split(base64_encode($data), 76, MAIL_MIMEPART_CRLF));
break;
 
default:
return $data;
}
}
 
/**
* quoteadPrintableEncode()
*
* Encodes data to quoted-printable standard.
*
* @param $input The data to encode
* @param $line_max Optional max line length. Should
* not be more than 76 chars
*
* @access private
*/
function _quotedPrintableEncode($input , $line_max = 76)
{
$lines = preg_split("/\r?\n/", $input);
$eol = MAIL_MIMEPART_CRLF;
$escape = '=';
$output = '';
 
while(list(, $line) = each($lines)){
 
$linlen = strlen($line);
$newline = '';
 
for ($i = 0; $i < $linlen; $i++) {
$char = substr($line, $i, 1);
$dec = ord($char);
 
if (($dec == 32) AND ($i == ($linlen - 1))){ // convert space at eol only
$char = '=20';
 
} elseif(($dec == 9) AND ($i == ($linlen - 1))) { // convert tab at eol only
$char = '=09';
} elseif($dec == 9) {
; // Do nothing if a tab.
} elseif(($dec == 61) OR ($dec < 32 ) OR ($dec > 126)) {
$char = $escape . strtoupper(sprintf('%02s', dechex($dec)));
}
 
if ((strlen($newline) + strlen($char)) >= $line_max) { // MAIL_MIMEPART_CRLF is not counted
$output .= $newline . $escape . $eol; // soft line break; " =\r\n" is okay
$newline = '';
}
$newline .= $char;
} // end of for
$output .= $newline . $eol;
}
$output = substr($output, 0, -1 * strlen($eol)); // Don't want last crlf
return $output;
}
} // End of class
?>
/tags/Racine_livraison_narmer/api/pear/Mail/mail.php
New file
0,0 → 1,130
<?php
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Chuck Hagenbuch <chuck@horde.org> |
// +----------------------------------------------------------------------+
//
// $Id: mail.php,v 1.1 2005-11-24 16:15:46 florian Exp $
 
/**
* internal PHP-mail() implementation of the PEAR Mail:: interface.
* @package Mail
* @version $Revision: 1.1 $
*/
class Mail_mail extends Mail {
 
/**
* Any arguments to pass to the mail() function.
* @var string
*/
var $_params = '';
 
/**
* Constructor.
*
* Instantiates a new Mail_mail:: object based on the parameters
* passed in.
*
* @param array $params Extra arguments for the mail() function.
*/
function Mail_mail($params = null)
{
/* The other mail implementations accept parameters as arrays.
* In the interest of being consistent, explode an array into
* a string of parameter arguments. */
if (is_array($params)) {
$this->_params = join(' ', $params);
} else {
$this->_params = $params;
}
 
/* Because the mail() function may pass headers as command
* line arguments, we can't guarantee the use of the standard
* "\r\n" separator. Instead, we use the system's native line
* separator. */
$this->sep = (strpos(PHP_OS, 'WIN') === false) ? "\n" : "\r\n";
}
 
/**
* Implements Mail_mail::send() function using php's built-in mail()
* command.
*
* @param mixed $recipients Either a comma-seperated list of recipients
* (RFC822 compliant), or an array of recipients,
* each RFC822 valid. This may contain recipients not
* specified in the headers, for Bcc:, resending
* messages, etc.
*
* @param array $headers The array of headers to send with the mail, in an
* associative array, where the array key is the
* header name (ie, 'Subject'), and the array value
* is the header value (ie, 'test'). The header
* produced from those values would be 'Subject:
* test'.
*
* @param string $body The full text of the message body, including any
* Mime parts, etc.
*
* @return mixed Returns true on success, or a PEAR_Error
* containing a descriptive error message on
* failure.
*
* @access public
*/
function send($recipients, $headers, $body)
{
// If we're passed an array of recipients, implode it.
if (is_array($recipients)) {
$recipients = implode(', ', $recipients);
}
 
// Get the Subject out of the headers array so that we can
// pass it as a seperate argument to mail().
$subject = '';
if (isset($headers['Subject'])) {
$subject = $headers['Subject'];
unset($headers['Subject']);
}
 
// Flatten the headers out.
$headerElements = $this->prepareHeaders($headers);
if (PEAR::isError($headerElements)) {
return $headerElements;
}
list(, $text_headers) = $headerElements;
 
/*
* We only use mail()'s optional fifth parameter if the additional
* parameters have been provided and we're not running in safe mode.
*/
if (empty($this->_params) || ini_get('safe_mode')) {
$result = mail($recipients, $subject, $body, $text_headers);
} else {
$result = mail($recipients, $subject, $body, $text_headers,
$this->_params);
}
 
/*
* If the mail() function returned failure, we need to create a
* PEAR_Error object and return it instead of the boolean result.
*/
if ($result === false) {
$result = PEAR::raiseError('mail() returned failure');
}
 
return $result;
}
 
}
/tags/Racine_livraison_narmer/api/pear/Mail/smtp.php
New file
0,0 → 1,323
<?php
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Chuck Hagenbuch <chuck@horde.org> |
// | Jon Parise <jon@php.net> |
// +----------------------------------------------------------------------+
 
/**
* SMTP implementation of the PEAR Mail interface. Requires the Net_SMTP class.
* @access public
* @package Mail
* @version $Revision: 1.1 $
*/
class Mail_smtp extends Mail {
 
/**
* SMTP connection object.
*
* @var object
* @access private
*/
var $_smtp = null;
 
/**
* The SMTP host to connect to.
* @var string
*/
var $host = 'localhost';
 
/**
* The port the SMTP server is on.
* @var integer
*/
var $port = 25;
 
/**
* Should SMTP authentication be used?
*
* This value may be set to true, false or the name of a specific
* authentication method.
*
* If the value is set to true, the Net_SMTP package will attempt to use
* the best authentication method advertised by the remote SMTP server.
*
* @var mixed
*/
var $auth = false;
 
/**
* The username to use if the SMTP server requires authentication.
* @var string
*/
var $username = '';
 
/**
* The password to use if the SMTP server requires authentication.
* @var string
*/
var $password = '';
 
/**
* Hostname or domain that will be sent to the remote SMTP server in the
* HELO / EHLO message.
*
* @var string
*/
var $localhost = 'localhost';
 
/**
* SMTP connection timeout value. NULL indicates no timeout.
*
* @var integer
*/
var $timeout = null;
 
/**
* Whether to use VERP or not. If not a boolean, the string value
* will be used as the VERP separators.
*
* @var mixed boolean or string
*/
var $verp = false;
 
/**
* Turn on Net_SMTP debugging?
*
* @var boolean $debug
*/
var $debug = false;
 
/**
* Indicates whether or not the SMTP connection should persist over
* multiple calls to the send() method.
*
* @var boolean
*/
var $persist = false;
 
/**
* Constructor.
*
* Instantiates a new Mail_smtp:: object based on the parameters
* passed in. It looks for the following parameters:
* host The server to connect to. Defaults to localhost.
* port The port to connect to. Defaults to 25.
* auth SMTP authentication. Defaults to none.
* username The username to use for SMTP auth. No default.
* password The password to use for SMTP auth. No default.
* localhost The local hostname / domain. Defaults to localhost.
* timeout The SMTP connection timeout. Defaults to none.
* verp Whether to use VERP or not. Defaults to false.
* debug Activate SMTP debug mode? Defaults to false.
* persist Should the SMTP connection persist?
*
* If a parameter is present in the $params array, it replaces the
* default.
*
* @param array Hash containing any parameters different from the
* defaults.
* @access public
*/
function Mail_smtp($params)
{
if (isset($params['host'])) $this->host = $params['host'];
if (isset($params['port'])) $this->port = $params['port'];
if (isset($params['auth'])) $this->auth = $params['auth'];
if (isset($params['username'])) $this->username = $params['username'];
if (isset($params['password'])) $this->password = $params['password'];
if (isset($params['localhost'])) $this->localhost = $params['localhost'];
if (isset($params['timeout'])) $this->timeout = $params['timeout'];
if (isset($params['verp'])) $this->verp = $params['verp'];
if (isset($params['debug'])) $this->debug = (boolean)$params['debug'];
if (isset($params['persist'])) $this->persist = (boolean)$params['persist'];
 
register_shutdown_function(array(&$this, '_Mail_smtp'));
}
 
/**
* Destructor implementation to ensure that we disconnect from any
* potentially-alive persistent SMTP connections.
*/
function _Mail_smtp()
{
$this->disconnect();
}
 
/**
* Implements Mail::send() function using SMTP.
*
* @param mixed $recipients Either a comma-seperated list of recipients
* (RFC822 compliant), or an array of recipients,
* each RFC822 valid. This may contain recipients not
* specified in the headers, for Bcc:, resending
* messages, etc.
*
* @param array $headers The array of headers to send with the mail, in an
* associative array, where the array key is the
* header name (e.g., 'Subject'), and the array value
* is the header value (e.g., 'test'). The header
* produced from those values would be 'Subject:
* test'.
*
* @param string $body The full text of the message body, including any
* Mime parts, etc.
*
* @return mixed Returns true on success, or a PEAR_Error
* containing a descriptive error message on
* failure.
* @access public
*/
function send($recipients, $headers, $body)
{
include_once 'Net/SMTP.php';
 
/* If we don't already have an SMTP object, create one. */
if (is_object($this->_smtp) === false) {
$this->_smtp =& new Net_SMTP($this->host, $this->port,
$this->localhost);
 
/* If we still don't have an SMTP object at this point, fail. */
if (is_object($this->_smtp) === false) {
return PEAR::raiseError('Failed to create a Net_SMTP object');
}
 
/* Configure the SMTP connection. */
if ($this->debug) {
$this->_smtp->setDebug(true);
}
 
/* Attempt to connect to the configured SMTP server. */
if (PEAR::isError($res = $this->_smtp->connect($this->timeout))) {
$error = $this->_error('Failed to connect to ' .
$this->host . ':' . $this->port,
$res);
return PEAR::raiseError($error);
}
 
/* Attempt to authenticate if authentication has been enabled. */
if ($this->auth) {
$method = is_string($this->auth) ? $this->auth : '';
 
if (PEAR::isError($res = $this->_smtp->auth($this->username,
$this->password,
$method))) {
$error = $this->_error("$method authentication failure",
$res);
$this->_smtp->rset();
return PEAR::raiseError($error);
}
}
}
 
$headerElements = $this->prepareHeaders($headers);
if (PEAR::isError($headerElements)) {
$this->_smtp->rset();
return $headerElements;
}
list($from, $textHeaders) = $headerElements;
 
/* Since few MTAs are going to allow this header to be forged
* unless it's in the MAIL FROM: exchange, we'll use
* Return-Path instead of From: if it's set. */
if (!empty($headers['Return-Path'])) {
$from = $headers['Return-Path'];
}
 
if (!isset($from)) {
$this->_smtp->rset();
return PEAR::raiseError('No From: address has been provided');
}
 
$args['verp'] = $this->verp;
if (PEAR::isError($res = $this->_smtp->mailFrom($from, $args))) {
$error = $this->_error("Failed to set sender: $from", $res);
$this->_smtp->rset();
return PEAR::raiseError($error);
}
 
$recipients = $this->parseRecipients($recipients);
if (PEAR::isError($recipients)) {
$this->_smtp->rset();
return $recipients;
}
 
foreach ($recipients as $recipient) {
if (PEAR::isError($res = $this->_smtp->rcptTo($recipient))) {
$error = $this->_error("Failed to add recipient: $recipient",
$res);
$this->_smtp->rset();
return PEAR::raiseError($error);
}
}
 
/* Send the message's headers and the body as SMTP data. */
if (PEAR::isError($res = $this->_smtp->data("$textHeaders\r\n$body"))) {
$error = $this->_error('Failed to send data', $res);
$this->_smtp->rset();
return PEAR::raiseError($error);
}
 
/* If persistent connections are disabled, destroy our SMTP object. */
if ($this->persist === false) {
$this->disconnect();
}
 
return true;
}
 
/**
* Disconnect and destroy the current SMTP connection.
*
* @return boolean True if the SMTP connection no longer exists.
*
* @since 1.1.9
* @access public
*/
function disconnect()
{
/* If we have an SMTP object, disconnect and destroy it. */
if (is_object($this->_smtp) && $this->_smtp->disconnect()) {
$this->_smtp = null;
}
 
/* We are disconnected if we no longer have an SMTP object. */
return ($this->_smtp === null);
}
 
/**
* Build a standardized string describing the current SMTP error.
*
* @param string $text Custom string describing the error context.
* @param object $error Reference to the current PEAR_Error object.
*
* @return string A string describing the current SMTP error.
*
* @since 1.1.7
* @access private
*/
function _error($text, &$error)
{
/* Split the SMTP response into a code and a response string. */
list($code, $response) = $this->_smtp->getResponse();
 
/* Build our standardized error string. */
$msg = $text;
$msg .= ' [SMTP: ' . $error->getMessage();
$msg .= " (code: $code, response: $response)]";
 
return $msg;
}
}
/tags/Racine_livraison_narmer/api/fichier/FIC_manipulation.fonct.php
New file
0,0 → 1,138
<?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: FIC_manipulation.fonct.php,v 1.3 2004-10-19 15:57:03 jpm Exp $
/**
* Bibliothèque de fonctions permettant de manipuler des fichier ou des dossiers.
*
* Contient des fonctions permettant de manipuler des fichier ou des dossiers.
*
*@package Fichier
//Auteur original :
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.3 $ $Date: 2004-10-19 15:57:03 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE de FONCTIONS |
// +------------------------------------------------------------------------------------------------------+
 
/**
* Fonction supprimerDossier() - Supprime un fichier ou un dossier et tout son contenu.
*
* Fonction récursive supprimant tout le contenu d'un dossier.
* Auteur d'origine : Aidan Lister (http://aidan.dotgeek.org/lib/?file=function.rmdirr.php)
* Traduction française et ajout gestion séparateur : Jean-Pascal Milcent
*
* @author Aidan Lister <aidan@php.net>
* @author Jean-Pascal Milcent <jpm@tela-botanica.org>
* @version 1.0.0
* @param string le chemin du dossier à supprimer.
* @param string le caractère représentant le séparateur dans un chemin d'accès.
* @return bool retoure TRUE en cas de succès, FALSE dans le cas contraire.
*/
function supprimerDossier($dossier_nom, $separateur = '/')
{
// Simple suppression d'un fichier
if (is_file($dossier_nom)) {
return unlink($dossier_nom);
}
if (is_dir($dossier_nom)) {
// Analyse du dossier
$dossier = dir($dossier_nom);
while (false !== $entree = $dossier->read()) {
// Nous sautons les pointeurs
if ($entree == '.' || $entree == '..') {
continue;
}
// Suppression du dossier ou appel récursif de la fonction
if (is_dir($dossier_nom.$separateur.$entree)) {
supprimerDossier($dossier_nom.$separateur.$entree, $separateur);
} else {
unlink($dossier_nom.$separateur.$entree);
}
}
// Nettoyage
$dossier->close();
return rmdir($dossier_nom);
} else {
return false;
}
}
 
/**
* Fonction creerDossier() - Créer une structure de dossier.
*
* Fonction récursive créant une structure de dossiers.
* Auteur d'origine : Aidan Lister (http://aidan.dotgeek.org/lib/?file=function.mkdirr.php)
* Traduction française et ajout gestion séparateur : Jean-Pascal Milcent
*
* @author Aidan Lister <aidan@php.net>
* @version 1.0.0
* @param string la structure de dossier à créer.
* @param string le mode de création du répertoire.
* @param string le caractère représentant le séparateur dans un chemin d'accès.
* @return bool retourne TRUE en cas de succès, FALSE dans le cas contraire.
*/
 
function creerDossier($chemin, $mode = null, $separateur = '/')
{
// Check if directory already exists
if (is_dir($chemin) || empty($chemin)) {
return true;
}
// Ensure a file does not already exist with the same name
if (is_file($chemin)) {
trigger_error('mkdirr() File exists', E_USER_WARNING);
return false;
}
// Crawl up the directory tree
$chemin_suite = substr($chemin, 0, strrpos($chemin, $separateur));
if (creerDossier($chemin_suite, $mode, $separateur)) {
if (!file_exists($chemin)) {
return @mkdir($chemin, $mode);
}
}
return false;
}
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.2 2004/10/18 10:12:22 jpm
* Traduction commentaires...
*
* Revision 1.1 2004/10/18 10:09:12 jpm
* Ajout d'une fonction permettant de supprimer récursivement un répertoire.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/tags/Racine_livraison_narmer/api/json/JSON.php
New file
0,0 → 1,806
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 
/**
* Converts to and from JSON format.
*
* JSON (JavaScript Object Notation) is a lightweight data-interchange
* format. It is easy for humans to read and write. It is easy for machines
* to parse and generate. It is based on a subset of the JavaScript
* Programming Language, Standard ECMA-262 3rd Edition - December 1999.
* This feature can also be found in Python. JSON is a text format that is
* completely language independent but uses conventions that are familiar
* to programmers of the C-family of languages, including C, C++, C#, Java,
* JavaScript, Perl, TCL, and many others. These properties make JSON an
* ideal data-interchange language.
*
* This package provides a simple encoder and decoder for JSON notation. It
* is intended for use with client-side Javascript applications that make
* use of HTTPRequest to perform server communication functions - data can
* be encoded into JSON notation for use in a client-side javascript, or
* decoded from incoming Javascript requests. JSON format is native to
* Javascript, and can be directly eval()'ed with no further parsing
* overhead
*
* All strings should be in ASCII or UTF-8 format!
*
* LICENSE: Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met: Redistributions of source code must retain the
* above copyright notice, this list of conditions and the following
* disclaimer. Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
* NO EVENT SHALL CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
* @category
* @package Services_JSON
* @author Michal Migurski <mike-json@teczno.com>
* @author Matt Knapp <mdknapp[at]gmail[dot]com>
* @author Brett Stimmerman <brettstimmerman[at]gmail[dot]com>
* @copyright 2005 Michal Migurski
* @version CVS: $Id: JSON.php,v 1.1 2007-04-19 09:12:45 alexandre_tb Exp $
* @license http://www.opensource.org/licenses/bsd-license.php
* @link http://pear.php.net/pepr/pepr-proposal-show.php?id=198
*/
 
/**
* Marker constant for Services_JSON::decode(), used to flag stack state
*/
define('SERVICES_JSON_SLICE', 1);
 
/**
* Marker constant for Services_JSON::decode(), used to flag stack state
*/
define('SERVICES_JSON_IN_STR', 2);
 
/**
* Marker constant for Services_JSON::decode(), used to flag stack state
*/
define('SERVICES_JSON_IN_ARR', 3);
 
/**
* Marker constant for Services_JSON::decode(), used to flag stack state
*/
define('SERVICES_JSON_IN_OBJ', 4);
 
/**
* Marker constant for Services_JSON::decode(), used to flag stack state
*/
define('SERVICES_JSON_IN_CMT', 5);
 
/**
* Behavior switch for Services_JSON::decode()
*/
define('SERVICES_JSON_LOOSE_TYPE', 16);
 
/**
* Behavior switch for Services_JSON::decode()
*/
define('SERVICES_JSON_SUPPRESS_ERRORS', 32);
 
/**
* Converts to and from JSON format.
*
* Brief example of use:
*
* <code>
* // create a new instance of Services_JSON
* $json = new Services_JSON();
*
* // convert a complexe value to JSON notation, and send it to the browser
* $value = array('foo', 'bar', array(1, 2, 'baz'), array(3, array(4)));
* $output = $json->encode($value);
*
* print($output);
* // prints: ["foo","bar",[1,2,"baz"],[3,[4]]]
*
* // accept incoming POST data, assumed to be in JSON notation
* $input = file_get_contents('php://input', 1000000);
* $value = $json->decode($input);
* </code>
*/
class Services_JSON
{
/**
* constructs a new JSON instance
*
* @param int $use object behavior flags; combine with boolean-OR
*
* possible values:
* - SERVICES_JSON_LOOSE_TYPE: loose typing.
* "{...}" syntax creates associative arrays
* instead of objects in decode().
* - SERVICES_JSON_SUPPRESS_ERRORS: error suppression.
* Values which can't be encoded (e.g. resources)
* appear as NULL instead of throwing errors.
* By default, a deeply-nested resource will
* bubble up with an error, so all return values
* from encode() should be checked with isError()
*/
function Services_JSON($use = 0)
{
$this->use = $use;
}
 
/**
* convert a string from one UTF-16 char to one UTF-8 char
*
* Normally should be handled by mb_convert_encoding, but
* provides a slower PHP-only method for installations
* that lack the multibye string extension.
*
* @param string $utf16 UTF-16 character
* @return string UTF-8 character
* @access private
*/
function utf162utf8($utf16)
{
// oh please oh please oh please oh please oh please
if(function_exists('mb_convert_encoding')) {
return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16');
}
 
$bytes = (ord($utf16{0}) << 8) | ord($utf16{1});
 
switch(true) {
case ((0x7F & $bytes) == $bytes):
// this case should never be reached, because we are in ASCII range
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
return chr(0x7F & $bytes);
 
case (0x07FF & $bytes) == $bytes:
// return a 2-byte UTF-8 character
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
return chr(0xC0 | (($bytes >> 6) & 0x1F))
. chr(0x80 | ($bytes & 0x3F));
 
case (0xFFFF & $bytes) == $bytes:
// return a 3-byte UTF-8 character
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
return chr(0xE0 | (($bytes >> 12) & 0x0F))
. chr(0x80 | (($bytes >> 6) & 0x3F))
. chr(0x80 | ($bytes & 0x3F));
}
 
// ignoring UTF-32 for now, sorry
return '';
}
 
/**
* convert a string from one UTF-8 char to one UTF-16 char
*
* Normally should be handled by mb_convert_encoding, but
* provides a slower PHP-only method for installations
* that lack the multibye string extension.
*
* @param string $utf8 UTF-8 character
* @return string UTF-16 character
* @access private
*/
function utf82utf16($utf8)
{
// oh please oh please oh please oh please oh please
if(function_exists('mb_convert_encoding')) {
return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8');
}
 
switch(strlen($utf8)) {
case 1:
// this case should never be reached, because we are in ASCII range
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
return $utf8;
 
case 2:
// return a UTF-16 character from a 2-byte UTF-8 char
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
return chr(0x07 & (ord($utf8{0}) >> 2))
. chr((0xC0 & (ord($utf8{0}) << 6))
| (0x3F & ord($utf8{1})));
 
case 3:
// return a UTF-16 character from a 3-byte UTF-8 char
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
return chr((0xF0 & (ord($utf8{0}) << 4))
| (0x0F & (ord($utf8{1}) >> 2)))
. chr((0xC0 & (ord($utf8{1}) << 6))
| (0x7F & ord($utf8{2})));
}
 
// ignoring UTF-32 for now, sorry
return '';
}
 
/**
* encodes an arbitrary variable into JSON format
*
* @param mixed $var any number, boolean, string, array, or object to be encoded.
* see argument 1 to Services_JSON() above for array-parsing behavior.
* if var is a strng, note that encode() always expects it
* to be in ASCII or UTF-8 format!
*
* @return mixed JSON string representation of input var or an error if a problem occurs
* @access public
*/
function encode($var)
{
switch (gettype($var)) {
case 'boolean':
return $var ? 'true' : 'false';
 
case 'NULL':
return 'null';
 
case 'integer':
return (int) $var;
 
case 'double':
case 'float':
return (float) $var;
 
case 'string':
// STRINGS ARE EXPECTED TO BE IN ASCII OR UTF-8 FORMAT
$ascii = '';
$strlen_var = strlen($var);
 
/*
* Iterate over every character in the string,
* escaping with a slash or encoding to UTF-8 where necessary
*/
for ($c = 0; $c < $strlen_var; ++$c) {
 
$ord_var_c = ord($var{$c});
 
switch (true) {
case $ord_var_c == 0x08:
$ascii .= '\b';
break;
case $ord_var_c == 0x09:
$ascii .= '\t';
break;
case $ord_var_c == 0x0A:
$ascii .= '\n';
break;
case $ord_var_c == 0x0C:
$ascii .= '\f';
break;
case $ord_var_c == 0x0D:
$ascii .= '\r';
break;
 
case $ord_var_c == 0x22:
case $ord_var_c == 0x2F:
case $ord_var_c == 0x5C:
// double quote, slash, slosh
$ascii .= '\\'.$var{$c};
break;
 
case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):
// characters U-00000000 - U-0000007F (same as ASCII)
$ascii .= $var{$c};
break;
 
case (($ord_var_c & 0xE0) == 0xC0):
// characters U-00000080 - U-000007FF, mask 110XXXXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c, ord($var{$c + 1}));
$c += 1;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
break;
 
case (($ord_var_c & 0xF0) == 0xE0):
// characters U-00000800 - U-0000FFFF, mask 1110XXXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c,
ord($var{$c + 1}),
ord($var{$c + 2}));
$c += 2;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
break;
 
case (($ord_var_c & 0xF8) == 0xF0):
// characters U-00010000 - U-001FFFFF, mask 11110XXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c,
ord($var{$c + 1}),
ord($var{$c + 2}),
ord($var{$c + 3}));
$c += 3;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
break;
 
case (($ord_var_c & 0xFC) == 0xF8):
// characters U-00200000 - U-03FFFFFF, mask 111110XX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c,
ord($var{$c + 1}),
ord($var{$c + 2}),
ord($var{$c + 3}),
ord($var{$c + 4}));
$c += 4;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
break;
 
case (($ord_var_c & 0xFE) == 0xFC):
// characters U-04000000 - U-7FFFFFFF, mask 1111110X
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c,
ord($var{$c + 1}),
ord($var{$c + 2}),
ord($var{$c + 3}),
ord($var{$c + 4}),
ord($var{$c + 5}));
$c += 5;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
break;
}
}
 
return '"'.$ascii.'"';
 
case 'array':
/*
* As per JSON spec if any array key is not an integer
* we must treat the the whole array as an object. We
* also try to catch a sparsely populated associative
* array with numeric keys here because some JS engines
* will create an array with empty indexes up to
* max_index which can cause memory issues and because
* the keys, which may be relevant, will be remapped
* otherwise.
*
* As per the ECMA and JSON specification an object may
* have any string as a property. Unfortunately due to
* a hole in the ECMA specification if the key is a
* ECMA reserved word or starts with a digit the
* parameter is only accessible using ECMAScript's
* bracket notation.
*/
 
// treat as a JSON object
if (is_array($var) && count($var) && (array_keys($var) !== range(0, sizeof($var) - 1))) {
$properties = array_map(array($this, 'name_value'),
array_keys($var),
array_values($var));
 
foreach($properties as $property) {
if(Services_JSON::isError($property)) {
return $property;
}
}
 
return '{' . join(',', $properties) . '}';
}
 
// treat it like a regular array
$elements = array_map(array($this, 'encode'), $var);
 
foreach($elements as $element) {
if(Services_JSON::isError($element)) {
return $element;
}
}
 
return '[' . join(',', $elements) . ']';
 
case 'object':
$vars = get_object_vars($var);
 
$properties = array_map(array($this, 'name_value'),
array_keys($vars),
array_values($vars));
 
foreach($properties as $property) {
if(Services_JSON::isError($property)) {
return $property;
}
}
 
return '{' . join(',', $properties) . '}';
 
default:
return ($this->use & SERVICES_JSON_SUPPRESS_ERRORS)
? 'null'
: new Services_JSON_Error(gettype($var)." can not be encoded as JSON string");
}
}
 
/**
* array-walking function for use in generating JSON-formatted name-value pairs
*
* @param string $name name of key to use
* @param mixed $value reference to an array element to be encoded
*
* @return string JSON-formatted name-value pair, like '"name":value'
* @access private
*/
function name_value($name, $value)
{
$encoded_value = $this->encode($value);
 
if(Services_JSON::isError($encoded_value)) {
return $encoded_value;
}
 
return $this->encode(strval($name)) . ':' . $encoded_value;
}
 
/**
* reduce a string by removing leading and trailing comments and whitespace
*
* @param $str string string value to strip of comments and whitespace
*
* @return string string value stripped of comments and whitespace
* @access private
*/
function reduce_string($str)
{
$str = preg_replace(array(
 
// eliminate single line comments in '// ...' form
'#^\s*//(.+)$#m',
 
// eliminate multi-line comments in '/* ... */' form, at start of string
'#^\s*/\*(.+)\*/#Us',
 
// eliminate multi-line comments in '/* ... */' form, at end of string
'#/\*(.+)\*/\s*$#Us'
 
), '', $str);
 
// eliminate extraneous space
return trim($str);
}
 
/**
* decodes a JSON string into appropriate variable
*
* @param string $str JSON-formatted string
*
* @return mixed number, boolean, string, array, or object
* corresponding to given JSON input string.
* See argument 1 to Services_JSON() above for object-output behavior.
* Note that decode() always returns strings
* in ASCII or UTF-8 format!
* @access public
*/
function decode($str)
{
$str = $this->reduce_string($str);
 
switch (strtolower($str)) {
case 'true':
return true;
 
case 'false':
return false;
 
case 'null':
return null;
 
default:
$m = array();
 
if (is_numeric($str)) {
// Lookie-loo, it's a number
 
// This would work on its own, but I'm trying to be
// good about returning integers where appropriate:
// return (float)$str;
 
// Return float or int, as appropriate
return ((float)$str == (integer)$str)
? (integer)$str
: (float)$str;
 
} elseif (preg_match('/^("|\').*(\1)$/s', $str, $m) && $m[1] == $m[2]) {
// STRINGS RETURNED IN UTF-8 FORMAT
$delim = substr($str, 0, 1);
$chrs = substr($str, 1, -1);
$utf8 = '';
$strlen_chrs = strlen($chrs);
 
for ($c = 0; $c < $strlen_chrs; ++$c) {
 
$substr_chrs_c_2 = substr($chrs, $c, 2);
$ord_chrs_c = ord($chrs{$c});
 
switch (true) {
case $substr_chrs_c_2 == '\b':
$utf8 .= chr(0x08);
++$c;
break;
case $substr_chrs_c_2 == '\t':
$utf8 .= chr(0x09);
++$c;
break;
case $substr_chrs_c_2 == '\n':
$utf8 .= chr(0x0A);
++$c;
break;
case $substr_chrs_c_2 == '\f':
$utf8 .= chr(0x0C);
++$c;
break;
case $substr_chrs_c_2 == '\r':
$utf8 .= chr(0x0D);
++$c;
break;
 
case $substr_chrs_c_2 == '\\"':
case $substr_chrs_c_2 == '\\\'':
case $substr_chrs_c_2 == '\\\\':
case $substr_chrs_c_2 == '\\/':
if (($delim == '"' && $substr_chrs_c_2 != '\\\'') ||
($delim == "'" && $substr_chrs_c_2 != '\\"')) {
$utf8 .= $chrs{++$c};
}
break;
 
case preg_match('/\\\u[0-9A-F]{4}/i', substr($chrs, $c, 6)):
// single, escaped unicode character
$utf16 = chr(hexdec(substr($chrs, ($c + 2), 2)))
. chr(hexdec(substr($chrs, ($c + 4), 2)));
$utf8 .= $this->utf162utf8($utf16);
$c += 5;
break;
 
case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):
$utf8 .= $chrs{$c};
break;
 
case ($ord_chrs_c & 0xE0) == 0xC0:
// characters U-00000080 - U-000007FF, mask 110XXXXX
//see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$utf8 .= substr($chrs, $c, 2);
++$c;
break;
 
case ($ord_chrs_c & 0xF0) == 0xE0:
// characters U-00000800 - U-0000FFFF, mask 1110XXXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$utf8 .= substr($chrs, $c, 3);
$c += 2;
break;
 
case ($ord_chrs_c & 0xF8) == 0xF0:
// characters U-00010000 - U-001FFFFF, mask 11110XXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$utf8 .= substr($chrs, $c, 4);
$c += 3;
break;
 
case ($ord_chrs_c & 0xFC) == 0xF8:
// characters U-00200000 - U-03FFFFFF, mask 111110XX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$utf8 .= substr($chrs, $c, 5);
$c += 4;
break;
 
case ($ord_chrs_c & 0xFE) == 0xFC:
// characters U-04000000 - U-7FFFFFFF, mask 1111110X
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$utf8 .= substr($chrs, $c, 6);
$c += 5;
break;
 
}
 
}
 
return $utf8;
 
} elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) {
// array, or object notation
 
if ($str{0} == '[') {
$stk = array(SERVICES_JSON_IN_ARR);
$arr = array();
} else {
if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
$stk = array(SERVICES_JSON_IN_OBJ);
$obj = array();
} else {
$stk = array(SERVICES_JSON_IN_OBJ);
$obj = new stdClass();
}
}
 
array_push($stk, array('what' => SERVICES_JSON_SLICE,
'where' => 0,
'delim' => false));
 
$chrs = substr($str, 1, -1);
$chrs = $this->reduce_string($chrs);
 
if ($chrs == '') {
if (reset($stk) == SERVICES_JSON_IN_ARR) {
return $arr;
 
} else {
return $obj;
 
}
}
 
//print("\nparsing {$chrs}\n");
 
$strlen_chrs = strlen($chrs);
 
for ($c = 0; $c <= $strlen_chrs; ++$c) {
 
$top = end($stk);
$substr_chrs_c_2 = substr($chrs, $c, 2);
 
if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == SERVICES_JSON_SLICE))) {
// found a comma that is not inside a string, array, etc.,
// OR we've reached the end of the character list
$slice = substr($chrs, $top['where'], ($c - $top['where']));
array_push($stk, array('what' => SERVICES_JSON_SLICE, 'where' => ($c + 1), 'delim' => false));
//print("Found split at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
 
if (reset($stk) == SERVICES_JSON_IN_ARR) {
// we are in an array, so just push an element onto the stack
array_push($arr, $this->decode($slice));
 
} elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
// we are in an object, so figure
// out the property name and set an
// element in an associative array,
// for now
$parts = array();
if (preg_match('/^\s*(["\'].*[^\\\]["\'])\s*:\s*(\S.*),?$/Uis', $slice, $parts)) {
// "name":value pair
$key = $this->decode($parts[1]);
$val = $this->decode($parts[2]);
 
if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
$obj[$key] = $val;
} else {
$obj->$key = $val;
}
} elseif (preg_match('/^\s*(\w+)\s*:\s*(\S.*),?$/Uis', $slice, $parts)) {
// name:value pair, where name is unquoted
$key = $parts[1];
$val = $this->decode($parts[2]);
 
if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
$obj[$key] = $val;
} else {
$obj->$key = $val;
}
}
 
}
 
} elseif ((($chrs{$c} == '"') || ($chrs{$c} == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) {
// found a quote, and we are not inside a string
array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c}));
//print("Found start of string at {$c}\n");
 
} elseif (($chrs{$c} == $top['delim']) &&
($top['what'] == SERVICES_JSON_IN_STR) &&
((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\'))) % 2 != 1)) {
// found a quote, we're in a string, and it's not escaped
// we know that it's not escaped becase there is _not_ an
// odd number of backslashes at the end of the string so far
array_pop($stk);
//print("Found end of string at {$c}: ".substr($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n");
 
} elseif (($chrs{$c} == '[') &&
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
// found a left-bracket, and we are in an array, object, or slice
array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false));
//print("Found start of array at {$c}\n");
 
} elseif (($chrs{$c} == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) {
// found a right-bracket, and we're in an array
array_pop($stk);
//print("Found end of array at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
 
} elseif (($chrs{$c} == '{') &&
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
// found a left-brace, and we are in an array, object, or slice
array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false));
//print("Found start of object at {$c}\n");
 
} elseif (($chrs{$c} == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) {
// found a right-brace, and we're in an object
array_pop($stk);
//print("Found end of object at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
 
} elseif (($substr_chrs_c_2 == '/*') &&
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
// found a comment start, and we are in an array, object, or slice
array_push($stk, array('what' => SERVICES_JSON_IN_CMT, 'where' => $c, 'delim' => false));
$c++;
//print("Found start of comment at {$c}\n");
 
} elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == SERVICES_JSON_IN_CMT)) {
// found a comment end, and we're in one now
array_pop($stk);
$c++;
 
for ($i = $top['where']; $i <= $c; ++$i)
$chrs = substr_replace($chrs, ' ', $i, 1);
 
//print("Found end of comment at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
 
}
 
}
 
if (reset($stk) == SERVICES_JSON_IN_ARR) {
return $arr;
 
} elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
return $obj;
 
}
 
}
}
}
 
/**
* @todo Ultimately, this should just call PEAR::isError()
*/
function isError($data, $code = null)
{
if (class_exists('pear')) {
return PEAR::isError($data, $code);
} elseif (is_object($data) && (get_class($data) == 'services_json_error' ||
is_subclass_of($data, 'services_json_error'))) {
return true;
}
 
return false;
}
}
 
if (class_exists('PEAR_Error')) {
 
class Services_JSON_Error extends PEAR_Error
{
function Services_JSON_Error($message = 'unknown error', $code = null,
$mode = null, $options = null, $userinfo = null)
{
parent::PEAR_Error($message, $code, $mode, $options, $userinfo);
}
}
 
} else {
 
/**
* @todo Ultimately, this class shall be descended from PEAR_Error
*/
class Services_JSON_Error
{
function Services_JSON_Error($message = 'unknown error', $code = null,
$mode = null, $options = null, $userinfo = null)
{
 
}
}
 
}
?>
/tags/Racine_livraison_narmer/api/fckeditor/fckconfig.js
New file
0,0 → 1,184
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckconfig.js
* Editor configuration settings.
*
* Follow this link for more information:
* http://wiki.fckeditor.net/Developer%27s_Guide/Configuration/Configurations_Settings
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
FCKConfig.CustomConfigurationsPath = '' ;
 
FCKConfig.EditorAreaCSS = FCKConfig.BasePath + 'css/fck_editorarea.css' ;
FCKConfig.ToolbarComboPreviewCSS = '' ;
 
FCKConfig.DocType = '' ;
 
FCKConfig.BaseHref = '' ;
 
FCKConfig.FullPage = false ;
 
FCKConfig.Debug = false ;
FCKConfig.AllowQueryStringDebug = true ;
 
FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/default/' ;
FCKConfig.PreloadImages = [ FCKConfig.SkinPath + 'images/toolbar.start.gif', FCKConfig.SkinPath + 'images/toolbar.buttonarrow.gif' ] ;
 
FCKConfig.PluginsPath = FCKConfig.BasePath + 'plugins/' ;
 
// FCKConfig.Plugins.Add( 'autogrow' ) ;
FCKConfig.AutoGrowMax = 400 ;
 
// FCKConfig.ProtectedSource.Add( /<%[\s\S]*?%>/g ) ; // ASP style server side code <%...%>
// FCKConfig.ProtectedSource.Add( /<\?[\s\S]*?\?>/g ) ; // PHP style server side code
// FCKConfig.ProtectedSource.Add( /(<asp:[^\>]+>[\s|\S]*?<\/asp:[^\>]+>)|(<asp:[^\>]+\/>)/gi ) ; // ASP.Net style tags <asp:control>
 
FCKConfig.AutoDetectLanguage = true ;
FCKConfig.DefaultLanguage = 'en' ;
FCKConfig.ContentLangDirection = 'ltr' ;
 
FCKConfig.ProcessHTMLEntities = true ;
FCKConfig.IncludeLatinEntities = true ;
FCKConfig.IncludeGreekEntities = true ;
 
FCKConfig.ProcessNumericEntities = false ;
 
FCKConfig.AdditionalNumericEntities = '' ; // Single Quote: "'"
 
FCKConfig.FillEmptyBlocks = true ;
 
FCKConfig.FormatSource = true ;
FCKConfig.FormatOutput = true ;
FCKConfig.FormatIndentator = ' ' ;
 
FCKConfig.ForceStrongEm = true ;
FCKConfig.GeckoUseSPAN = false ;
FCKConfig.StartupFocus = false ;
FCKConfig.ForcePasteAsPlainText = false ;
FCKConfig.AutoDetectPasteFromWord = true ; // IE only.
FCKConfig.ForceSimpleAmpersand = false ;
FCKConfig.TabSpaces = 0 ;
FCKConfig.ShowBorders = true ;
FCKConfig.SourcePopup = false ;
FCKConfig.UseBROnCarriageReturn = false ; // IE only.
FCKConfig.ToolbarStartExpanded = true ;
FCKConfig.ToolbarCanCollapse = true ;
FCKConfig.IgnoreEmptyParagraphValue = true ;
FCKConfig.PreserveSessionOnFileBrowser = false ;
FCKConfig.FloatingPanelsZIndex = 10000 ;
 
FCKConfig.TemplateReplaceAll = true ;
FCKConfig.TemplateReplaceCheckbox = true ;
 
FCKConfig.ToolbarLocation = 'In' ;
 
FCKConfig.ToolbarSets["Default"] = [
['Source','DocProps','-','Save','NewPage','Preview','-','Templates'],
['Cut','Copy','Paste','PasteText','PasteWord','-','Print','SpellCheck'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],
'/',
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
['OrderedList','UnorderedList','-','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink','Anchor'],
['Image','Flash','Table','Rule','Smiley','SpecialChar','PageBreak','UniversalKey'],
'/',
['Style','FontFormat','FontName','FontSize'],
['TextColor','BGColor'],
['FitWindow','-','About']
] ;
 
FCKConfig.ToolbarSets["Basic"] = [
['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','-','About']
] ;
 
FCKConfig.ContextMenu = ['Generic','Link','Anchor','Image','Flash','Select','Textarea','Checkbox','Radio','TextField','HiddenField','ImageButton','Button','BulletedList','NumberedList','Table','Form'] ;
 
FCKConfig.FontColors = '000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,808080,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF' ;
 
FCKConfig.FontNames = 'Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana' ;
FCKConfig.FontSizes = '1/xx-small;2/x-small;3/small;4/medium;5/large;6/x-large;7/xx-large' ;
FCKConfig.FontFormats = 'p;div;pre;address;h1;h2;h3;h4;h5;h6' ;
 
FCKConfig.StylesXmlPath = FCKConfig.EditorPath + 'fckstyles.xml' ;
FCKConfig.TemplatesXmlPath = FCKConfig.EditorPath + 'fcktemplates.xml' ;
 
FCKConfig.SpellChecker = 'ieSpell' ; // 'ieSpell' | 'SpellerPages'
FCKConfig.IeSpellDownloadUrl = 'http://wcarchive.cdrom.com/pub/simtelnet/handheld/webbrow1/ieSpellSetup240428.exe' ;
 
FCKConfig.MaxUndoLevels = 15 ;
 
FCKConfig.DisableObjectResizing = false ;
FCKConfig.DisableFFTableHandles = true ;
 
FCKConfig.LinkDlgHideTarget = false ;
FCKConfig.LinkDlgHideAdvanced = false ;
 
FCKConfig.ImageDlgHideLink = false ;
FCKConfig.ImageDlgHideAdvanced = false ;
 
FCKConfig.FlashDlgHideAdvanced = false ;
 
// The following value defines which File Browser connector and Quick Upload
// "uploader" to use. It is valid for the default implementaion and it is here
// just to make this configuration file cleaner.
// It is not possible to change this value using an external file or even
// inline when creating the editor instance. In that cases you must set the
// values of LinkBrowserURL, ImageBrowserURL and so on.
// Custom implementations should just ignore it.
var _FileBrowserLanguage = 'asp' ; // asp | aspx | cfm | lasso | perl | php | py
var _QuickUploadLanguage = 'asp' ; // asp | aspx | cfm | lasso | php
 
// Don't care about the following line. It just calculates the correct connector
// extension to use for the default File Browser (Perl uses "cgi").
var _FileBrowserExtension = _FileBrowserLanguage == 'perl' ? 'cgi' : _FileBrowserLanguage ;
 
FCKConfig.LinkBrowser = true ;
FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector=connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ;
FCKConfig.LinkBrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; // 70%
FCKConfig.LinkBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ; // 70%
 
FCKConfig.ImageBrowser = true ;
FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector=connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ;
FCKConfig.ImageBrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; // 70% ;
FCKConfig.ImageBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ; // 70% ;
 
FCKConfig.FlashBrowser = true ;
FCKConfig.FlashBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ;
FCKConfig.FlashBrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; //70% ;
FCKConfig.FlashBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ; //70% ;
 
FCKConfig.LinkUpload = true ;
FCKConfig.LinkUploadURL = FCKConfig.BasePath + 'filemanager/upload/' + _QuickUploadLanguage + '/upload.' + _QuickUploadLanguage ;
FCKConfig.LinkUploadAllowedExtensions = "" ; // empty for all
FCKConfig.LinkUploadDeniedExtensions = ".(php|php3|php5|phtml|asp|aspx|ascx|jsp|cfm|cfc|pl|bat|exe|dll|reg|cgi)$" ; // empty for no one
 
FCKConfig.ImageUpload = true ;
FCKConfig.ImageUploadURL = FCKConfig.BasePath + 'filemanager/upload/' + _QuickUploadLanguage + '/upload.' + _QuickUploadLanguage + '?Type=Image' ;
FCKConfig.ImageUploadAllowedExtensions = ".(jpg|gif|jpeg|png)$" ; // empty for all
FCKConfig.ImageUploadDeniedExtensions = "" ; // empty for no one
 
FCKConfig.FlashUpload = true ;
FCKConfig.FlashUploadURL = FCKConfig.BasePath + 'filemanager/upload/' + _QuickUploadLanguage + '/upload.' + _QuickUploadLanguage + '?Type=Flash' ;
FCKConfig.FlashUploadAllowedExtensions = ".(swf|fla)$" ; // empty for all
FCKConfig.FlashUploadDeniedExtensions = "" ; // empty for no one
 
FCKConfig.SmileyPath = FCKConfig.BasePath + 'images/smiley/msn/' ;
FCKConfig.SmileyImages = ['regular_smile.gif','sad_smile.gif','wink_smile.gif','teeth_smile.gif','confused_smile.gif','tounge_smile.gif','embaressed_smile.gif','omg_smile.gif','whatchutalkingabout_smile.gif','angry_smile.gif','angel_smile.gif','shades_smile.gif','devil_smile.gif','cry_smile.gif','lightbulb.gif','thumbs_down.gif','thumbs_up.gif','heart.gif','broken_heart.gif','kiss.gif','envelope.gif'] ;
FCKConfig.SmileyColumns = 8 ;
FCKConfig.SmileyWindowWidth = 320 ;
FCKConfig.SmileyWindowHeight = 240 ;
/tags/Racine_livraison_narmer/api/fckeditor/fckeditor.cfc
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/fckeditor.cfc
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/fckeditor.pl
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/fckeditor.pl
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/fckeditor.js
New file
0,0 → 1,211
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckeditor.js
* This is the integration file for JavaScript.
*
* It defines the FCKeditor class that can be used to create editor
* instances in a HTML page in the client side. For server side
* operations, use the specific integration system.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
// FCKeditor Class
var FCKeditor = function( instanceName, width, height, toolbarSet, value )
{
// Properties
this.InstanceName = instanceName ;
this.Width = width || '100%' ;
this.Height = height || '200' ;
this.ToolbarSet = toolbarSet || 'Default' ;
this.Value = value || '' ;
this.BasePath = '/fckeditor/' ;
this.CheckBrowser = true ;
this.DisplayErrors = true ;
this.EnableSafari = false ; // This is a temporary property, while Safari support is under development.
this.EnableOpera = false ; // This is a temporary property, while Opera support is under development.
 
this.Config = new Object() ;
 
// Events
this.OnError = null ; // function( source, errorNumber, errorDescription )
}
 
FCKeditor.prototype.Version = '2.3.2' ;
FCKeditor.prototype.VersionBuild = '1082' ;
 
FCKeditor.prototype.Create = function()
{
document.write( this.CreateHtml() ) ;
}
 
FCKeditor.prototype.CreateHtml = function()
{
// Check for errors
if ( !this.InstanceName || this.InstanceName.length == 0 )
{
this._ThrowError( 701, 'You must specify an instance name.' ) ;
return ;
}
 
var sHtml = '<div>' ;
 
if ( !this.CheckBrowser || FCKeditor_IsCompatibleBrowser() )
{
sHtml += '<input type="hidden" id="' + this.InstanceName + '" name="' + this.InstanceName + '" value="' + this._HTMLEncode( this.Value ) + '" style="display:none" />' ;
sHtml += this._GetConfigHtml() ;
sHtml += this._GetIFrameHtml() ;
}
else
{
var sWidth = this.Width.toString().indexOf('%') > 0 ? this.Width : this.Width + 'px' ;
var sHeight = this.Height.toString().indexOf('%') > 0 ? this.Height : this.Height + 'px' ;
sHtml += '<textarea name="' + this.InstanceName + '" rows="4" cols="40" style="width:' + sWidth + ';height:' + sHeight + '">' + this._HTMLEncode( this.Value ) + '<\/textarea>' ;
}
 
sHtml += '</div>' ;
return sHtml ;
}
 
FCKeditor.prototype.ReplaceTextarea = function()
{
if ( !this.CheckBrowser || FCKeditor_IsCompatibleBrowser() )
{
// We must check the elements firstly using the Id and then the name.
var oTextarea = document.getElementById( this.InstanceName ) ;
var colElementsByName = document.getElementsByName( this.InstanceName ) ;
var i = 0;
while ( oTextarea || i == 0 )
{
if ( oTextarea && oTextarea.tagName.toLowerCase() == 'textarea' )
break ;
oTextarea = colElementsByName[i++] ;
}
if ( !oTextarea )
{
alert( 'Error: The TEXTAREA with id or name set to "' + this.InstanceName + '" was not found' ) ;
return ;
}
 
oTextarea.style.display = 'none' ;
this._InsertHtmlBefore( this._GetConfigHtml(), oTextarea ) ;
this._InsertHtmlBefore( this._GetIFrameHtml(), oTextarea ) ;
}
}
 
FCKeditor.prototype._InsertHtmlBefore = function( html, element )
{
if ( element.insertAdjacentHTML ) // IE
element.insertAdjacentHTML( 'beforeBegin', html ) ;
else // Gecko
{
var oRange = document.createRange() ;
oRange.setStartBefore( element ) ;
var oFragment = oRange.createContextualFragment( html );
element.parentNode.insertBefore( oFragment, element ) ;
}
}
 
FCKeditor.prototype._GetConfigHtml = function()
{
var sConfig = '' ;
for ( var o in this.Config )
{
if ( sConfig.length > 0 ) sConfig += '&amp;' ;
sConfig += escape(o) + '=' + escape( this.Config[o] ) ;
}
 
return '<input type="hidden" id="' + this.InstanceName + '___Config" value="' + sConfig + '" style="display:none" />' ;
}
 
FCKeditor.prototype._GetIFrameHtml = function()
{
var sFile = 'fckeditor.html' ;
try
{
if ( (/fcksource=true/i).test( window.top.location.search ) )
sFile = 'fckeditor.original.html' ;
}
catch (e) { /* Ignore it. Much probably we are inside a FRAME where the "top" is in another domain (security error). */ }
 
var sLink = this.BasePath + 'editor/' + sFile + '?InstanceName=' + this.InstanceName ;
if (this.ToolbarSet) sLink += '&amp;Toolbar=' + this.ToolbarSet ;
 
return '<iframe id="' + this.InstanceName + '___Frame" src="' + sLink + '" width="' + this.Width + '" height="' + this.Height + '" frameborder="0" scrolling="no"></iframe>' ;
}
 
// Deprecated (to be removed in the 3.0).
FCKeditor.prototype._IsCompatibleBrowser = function()
{
return FCKeditor_IsCompatibleBrowser() ;
}
 
FCKeditor.prototype._ThrowError = function( errorNumber, errorDescription )
{
this.ErrorNumber = errorNumber ;
this.ErrorDescription = errorDescription ;
 
if ( this.DisplayErrors )
{
document.write( '<div style="COLOR: #ff0000">' ) ;
document.write( '[ FCKeditor Error ' + this.ErrorNumber + ': ' + this.ErrorDescription + ' ]' ) ;
document.write( '</div>' ) ;
}
 
if ( typeof( this.OnError ) == 'function' )
this.OnError( this, errorNumber, errorDescription ) ;
}
 
FCKeditor.prototype._HTMLEncode = function( text )
{
if ( typeof( text ) != "string" )
text = text.toString() ;
 
text = text.replace(
/&/g, "&amp;").replace(
/"/g, "&quot;").replace(
/</g, "&lt;").replace(
/>/g, "&gt;") ;
 
return text ;
}
 
function FCKeditor_IsCompatibleBrowser()
{
var sAgent = navigator.userAgent.toLowerCase() ;
 
// Internet Explorer
if ( sAgent.indexOf("msie") != -1 && sAgent.indexOf("mac") == -1 && sAgent.indexOf("opera") == -1 )
{
var sBrowserVersion = navigator.appVersion.match(/MSIE (.\..)/)[1] ;
return ( sBrowserVersion >= 5.5 ) ;
}
 
// Gecko (Opera 9 tries to behave like Gecko at this point).
if ( navigator.product == "Gecko" && navigator.productSub >= 20030210 && !( typeof(opera) == 'object' && opera.postError ) )
return true ;
 
// Opera
if ( this.EnableOpera && navigator.appName == 'Opera' && parseInt( navigator.appVersion ) >= 9 )
return true ;
 
// Safari
if ( this.EnableSafari && sAgent.indexOf( 'safari' ) != -1 )
return ( sAgent.match( /safari\/(\d+)/ )[1] >= 312 ) ; // Build must be at least 312 (1.3)
 
return false ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/anchor.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/anchor.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/arrow_ltr.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/arrow_ltr.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/arrow_rtl.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/arrow_rtl.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/spacer.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/spacer.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/cry_smile.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/cry_smile.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/thumbs_down.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/thumbs_down.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/regular_smile.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/regular_smile.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/tounge_smile.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/tounge_smile.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/devil_smile.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/devil_smile.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/confused_smile.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/confused_smile.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/sad_smile.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/sad_smile.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/shades_smile.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/shades_smile.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/wink_smile.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/wink_smile.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/whatchutalkingabout_smile.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/whatchutalkingabout_smile.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/teeth_smile.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/teeth_smile.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/broken_heart.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/broken_heart.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/cake.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/cake.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/embaressed_smile.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/embaressed_smile.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/heart.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/heart.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/thumbs_up.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/thumbs_up.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/angry_smile.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/angry_smile.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/kiss.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/kiss.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/omg_smile.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/omg_smile.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/lightbulb.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/lightbulb.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/envelope.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/envelope.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/angel_smile.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/images/smiley/msn/angel_smile.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/fckdialog.html
New file
0,0 → 1,322
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckdialog.html
* This page is used by all dialog box as the container.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex, nofollow" />
<script type="text/javascript">
 
// On some Gecko browsers (probably over slow connections) the
// "dialogArguments" are not set so we must get it from the opener window.
if ( !window.dialogArguments )
window.dialogArguments = window.opener.FCKLastDialogInfo ;
 
// Sets the Skin CSS
document.write( '<link href="' + window.dialogArguments.Editor.FCKConfig.SkinPath + 'fck_dialog.css" type="text/css" rel="stylesheet">' ) ;
 
// Sets the language direction.
window.document.dir = window.dialogArguments.Editor.FCKLang.Dir ;
 
var sTitle = window.dialogArguments.Title ;
document.write( '<title>' + sTitle + '<\/title>' ) ;
 
function LoadInnerDialog()
{
// The following value is set, so the editor can check that the dialog has been correctly opened.
window.setTimeout( function() { window.returnValue = true ; }, 100 ) ;
 
if ( window.onresize )
window.onresize() ;
 
// First of all, translate the dialog box contents.
window.dialogArguments.Editor.FCKLanguageManager.TranslatePage( document ) ;
 
window.frames["frmMain"].document.location.href = window.dialogArguments.Page ;
}
 
function InnerDialogLoaded()
{
var oInnerDoc = document.getElementById('frmMain').contentWindow.document ;
 
// Set the language direction.
oInnerDoc.dir = window.dialogArguments.Editor.FCKLang.Dir ;
 
// Sets the Skin CSS.
oInnerDoc.write( '<link href="' + window.dialogArguments.Editor.FCKConfig.SkinPath + 'fck_dialog.css" type="text/css" rel="stylesheet">' ) ;
 
SetOnKeyDown( oInnerDoc ) ;
DisableContextMenu( oInnerDoc ) ;
 
return window.dialogArguments.Editor ;
}
 
function SetOkButton( showIt )
{
document.getElementById('btnOk').style.visibility = ( showIt ? '' : 'hidden' ) ;
}
 
var bAutoSize = false ;
 
function SetAutoSize( autoSize )
{
bAutoSize = autoSize ;
RefreshSize() ;
}
 
function RefreshSize()
{
if ( bAutoSize )
{
var oInnerDoc = document.getElementById('frmMain').contentWindow.document ;
 
var iFrameHeight ;
if ( document.all )
iFrameHeight = oInnerDoc.body.offsetHeight ;
else
iFrameHeight = document.getElementById('frmMain').contentWindow.innerHeight ;
 
var iInnerHeight = oInnerDoc.body.scrollHeight ;
 
var iDiff = iInnerHeight - iFrameHeight ;
 
if ( iDiff > 0 )
{
if ( document.all )
window.dialogHeight = ( parseInt( window.dialogHeight ) + iDiff ) + 'px' ;
else
window.resizeBy( 0, iDiff ) ;
}
}
}
 
function Ok()
{
if ( window.frames["frmMain"].Ok && window.frames["frmMain"].Ok() )
Cancel() ;
}
 
function Cancel( dontFireChange )
{
if ( !dontFireChange )
{
// All dialog windows, by default, will fire the "OnSelectionChange"
// event, no matter the Ok or Cancel button has been pressed.
window.dialogArguments.Editor.FCK.Events.FireEvent( 'OnSelectionChange' ) ;
}
window.close() ;
}
 
// Object that holds all available tabs.
var oTabs = new Object() ;
 
function TabDiv_OnClick()
{
SetSelectedTab( this.TabCode ) ;
}
 
function AddTab( tabCode, tabText, startHidden )
{
if ( typeof( oTabs[ tabCode ] ) != 'undefined' )
return ;
 
var eTabsRow = document.getElementById( 'Tabs' ) ;
 
var oCell = eTabsRow.insertCell( eTabsRow.cells.length - 1 ) ;
oCell.noWrap = true ;
 
var oDiv = document.createElement( 'DIV' ) ;
oDiv.className = 'PopupTab' ;
oDiv.innerHTML = tabText ;
oDiv.TabCode = tabCode ;
oDiv.onclick = TabDiv_OnClick ;
 
if ( startHidden )
oDiv.style.display = 'none' ;
 
eTabsRow = document.getElementById( 'TabsRow' ) ;
 
oCell.appendChild( oDiv ) ;
 
if ( eTabsRow.style.display == 'none' )
{
var eTitleArea = document.getElementById( 'TitleArea' ) ;
eTitleArea.className = 'PopupTitle' ;
 
oDiv.className = 'PopupTabSelected' ;
eTabsRow.style.display = '' ;
 
if ( ! window.dialogArguments.Editor.FCKBrowserInfo.IsIE )
window.onresize() ;
}
 
oTabs[ tabCode ] = oDiv ;
oTabs[ tabCode ].Index = oTabs.length - 1 ;
}
 
function SetSelectedTab( tabCode )
{
for ( var sCode in oTabs )
{
if ( sCode == tabCode )
oTabs[sCode].className = 'PopupTabSelected' ;
else
oTabs[sCode].className = 'PopupTab' ;
}
 
if ( typeof( window.frames["frmMain"].OnDialogTabChange ) == 'function' )
window.frames["frmMain"].OnDialogTabChange( tabCode ) ;
}
 
function SetTabVisibility( tabCode, isVisible )
{
var oTab = oTabs[ tabCode ] ;
oTab.style.display = isVisible ? '' : 'none' ;
 
if ( ! isVisible && oTab.className == 'PopupTabSelected' )
{
for ( var sCode in oTabs )
{
if ( oTabs[sCode].style.display != 'none' )
{
SetSelectedTab( sCode ) ;
break ;
}
}
}
}
 
function SetOnKeyDown( targetDocument )
{
targetDocument.onkeydown = function ( e )
{
e = e || event || this.parentWindow.event ;
switch ( e.keyCode )
{
case 13 : // ENTER
var oTarget = e.srcElement || e.target ;
if ( oTarget.tagName == 'TEXTAREA' ) return ;
Ok() ;
return false ;
case 27 : // ESC
Cancel() ;
return false ;
break ;
}
return true ;
}
}
SetOnKeyDown( document ) ;
 
function DisableContextMenu( targetDocument )
{
if ( window.dialogArguments.Editor.FCKBrowserInfo.IsIE ) return ;
 
// Disable Right-Click
var oOnContextMenu = function( e )
{
var sTagName = e.target.tagName ;
if ( ! ( ( sTagName == "INPUT" && e.target.type == "text" ) || sTagName == "TEXTAREA" ) )
e.preventDefault() ;
}
targetDocument.addEventListener( 'contextmenu', oOnContextMenu, true ) ;
}
DisableContextMenu( document ) ;
 
if ( ! window.dialogArguments.Editor.FCKBrowserInfo.IsIE )
{
window.onresize = function()
{
var oFrame = document.getElementById("frmMain") ;
 
if ( ! oFrame )
return ;
 
oFrame.height = 0 ;
 
var oCell = document.getElementById("FrameCell") ;
var iHeight = oCell.offsetHeight ;
 
oFrame.height = iHeight - 2 ;
}
}
 
if ( window.dialogArguments.Editor.FCKBrowserInfo.IsIE )
{
function Window_OnBeforeUnload()
{
for ( var t in oTabs )
oTabs[t] = null ;
 
window.dialogArguments.Editor = null ;
}
window.attachEvent( "onbeforeunload", Window_OnBeforeUnload ) ;
}
 
function Window_OnClose()
{
window.dialogArguments.Editor.FCKFocusManager.Unlock() ;
}
 
if ( window.addEventListener )
window.addEventListener( 'unload', Window_OnClose, false ) ;
 
</script>
</head>
<body onload="LoadInnerDialog();" class="PopupBody">
<table height="100%" cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td id="TitleArea" class="PopupTitle PopupTitleBorder">
<script type="text/javascript">
document.write( sTitle ) ;
</script>
</td>
</tr>
<tr id="TabsRow" style="DISPLAY: none">
<td class="PopupTabArea">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr id="Tabs" onselectstart="return false;">
<td class="PopupTabEmptyArea">&nbsp;</td>
<td class="PopupTabEmptyArea" width="100%">&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr>
<td id="FrameCell" height="100%" valign="top">
<iframe id="frmMain" src="fckblank.html" name="frmMain" frameborder="0" height="100%" width="100%" scrolling="auto">
</iframe>
</td>
</tr>
<tr>
<td class="PopupButtons">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="100%">&nbsp;</td>
<td nowrap="nowrap">
<input id="btnOk" style="VISIBILITY: hidden; WIDTH: 100px" type="button" value="Ok" class="Button"
onclick="Ok();" fckLang="DlgBtnOK" />&nbsp; <input type="button" value="Cancel" class="Button" onclick="Cancel();" fckLang="DlgBtnCancel" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/office2003/fck_strip.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/office2003/fck_strip.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/office2003/fck_dialog.css
New file
0,0 → 1,129
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_dialog.css
* Styles used by the dialog boxes.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
body
{
margin: 0px;
padding: 10px;
background-color: #f7f8fd;
}
 
body, td, input, select, textarea
{
font-size: 11px;
font-family: 'Microsoft Sans Serif' , Arial, Helvetica, Verdana;
}
 
body, .BackColor
{
background-color: #f7f8fd;
}
 
.PopupBody
{
margin: 0px;
padding: 0px;
}
 
.PopupTitle
{
font-weight: bold;
font-size: 14pt;
color: #0e3460;
background-color: #8cb2fd;
padding: 3px 10px 3px 10px;
}
 
.PopupButtons
{
border-top: #466ca6 1px solid;
background-color: #8cb2fd;
padding: 7px 10px 7px 10px;
}
 
.Button
{
border: #1c3460 1px solid;
color: #000a28;
background-color: #7096d3;
}
 
.DarkBackground
{
background-color: #d7d79f;
}
 
.LightBackground
{
background-color: #ffffbe;
}
 
.PopupTitleBorder
{
border-bottom: #d5d59d 1px solid;
}
 
.PopupTabArea
{
color: #0e3460;
background-color: #8cb2fd;
}
 
.PopupTabEmptyArea
{
padding-left: 10px ;
border-bottom: #466ca6 1px solid;
}
 
.PopupTab, .PopupTabSelected
{
border-right: #466ca6 1px solid;
border-top: #466ca6 1px solid;
border-left: #466ca6 1px solid;
padding-right: 5px;
padding-left: 5px;
padding-bottom: 3px;
padding-top: 3px;
color: #0e3460;
}
 
.PopupTab
{
margin-top: 1px;
border-bottom: #466ca6 1px solid;
cursor: pointer;
cursor: hand;
}
 
.PopupTabSelected
{
font-weight:bold;
cursor: default;
padding-top: 4px;
border-bottom: #f7f8fd 1px solid;
background-color: #f7f8fd;
}
 
.PopupSelectionBox
{
border: #1e90ff 1px solid !important;
background-color: #add8e6 !important;
cursor: pointer;
cursor: hand;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/office2003/fck_editor.css
New file
0,0 → 1,472
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_editor.css
* Styles used by the editor IFRAME and Toolbar.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
/*
### Basic Editor IFRAME Styles.
*/
 
body
{
padding: 1px 1px 1px 1px;
margin: 0px 0px 0px 0px;
}
 
#xEditingArea
{
border: #696969 1px solid;
}
 
.SourceField
{
padding: 5px;
margin: 0px;
font-family: Monospace;
}
 
/*
Toolbar
*/
 
.TB_ToolbarSet, .TB_Expand, .TB_Collapse
{
cursor: default;
background-color: #f7f8fd;
}
 
.TB_ToolbarSet
{
border-top: #f7f8fd 1px outset;
border-bottom: #f7f8fd 1px outset;
}
 
.TB_ToolbarSet TD
{
font-size: 11px;
font-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif;
}
 
.TB_Toolbar
{
background-color: #d6dff7;
background-image: url(images/toolbar.bg.gif);
background-repeat: repeat-x;
display: inline-table;
}
 
.TB_Separator
{
width: 1px;
height: 16px;
margin: 2px;
background-color: #B2CBFF;
}
 
.TB_Start
{
background-image: url(images/toolbar.start.gif);
background-repeat: no-repeat;
background-position: center center;
margin: 0px;
width: 7px;
height: 24px;
}
 
.TB_End
{
background-image: url(images/toolbar.end.gif);
background-repeat: no-repeat;
background-position: center left;
height: 24px;
width: 12px;
}
 
.TB_ExpandImg
{
background-image: url(images/toolbar.expand.gif);
background-repeat: no-repeat;
}
 
.TB_CollapseImg
{
background-image: url(images/toolbar.collapse.gif);
background-repeat: no-repeat;
}
 
.TB_SideBorder
{
background-color: #696969;
}
 
.TB_Expand, .TB_Collapse
{
padding: 2px 2px 2px 2px;
border: #f7f8fd 1px outset;
}
 
.TB_Collapse
{
width: 5px;
}
 
.TB_Break
{
height: 24px; /* IE needs the height to be set, otherwise no break */
}
 
/*
Toolbar Button
*/
 
.TB_Button_On, .TB_Button_Off, .TB_Button_On_Over, .TB_Button_Off_Over, .TB_Button_Disabled
{
margin: 1px;
height: 22px; /* The height is necessary, otherwise IE will not apply the alpha */
}
 
.TB_Button_On
{
margin: 0px;
border: #316ac5 1px solid;
background-color: #c1d2ee;
}
 
.TB_Button_On_Over, .TB_Button_Off_Over
{
margin: 0px ;
border: #316ac5 1px solid;
background-color: #dff1ff;
}
 
.TB_Button_Off
{
filter: alpha(opacity=70); /* IE */
opacity: 0.70; /* Safari, Opera and Mozilla */
}
 
.TB_Button_Disabled
{
filter: gray() alpha(opacity=30); /* IE */
opacity: 0.30; /* Safari, Opera and Mozilla */
}
 
.TB_Button_Padding
{
visibility: hidden;
width: 3px;
height: 22px;
}
 
.TB_Button_Image
{
overflow: hidden;
width: 16px;
height: 16px;
margin: 3px;
background-repeat: no-repeat;
}
 
.TB_Button_Image img
{
position: relative;
}
 
.TB_Button_Off .TB_Button_Text
{
background-color: #d6dff7; /* Needed because of a bug on ClearType */
background-image: url(images/toolbar.bg.gif);
background-repeat: repeat-x;
}
 
.TB_ConnectionLine
{
background-color: #f7f8fd;
height: 1px;
margin-left: 1px; /* ltr */
margin-right: 1px; /* rtl */
}
 
.TB_Button_Off .TB_Text
{
background-color: #d6dff7; /* Needed because of a bug on ClearType */
background-image: url(images/toolbar.bg.gif);
background-repeat: repeat-x;
}
 
.TB_Button_On_Over .TB_Text
{
background-color: #dff1ff ; /* Needed because of a bug on ClearType */
}
 
/*
Menu
*/
 
.MN_Menu
{
border: 1px solid #8f8f73;
padding: 2px;
background-color: #f7f8fd;
cursor: default;
}
 
.MN_Menu, .MN_Menu .MN_Label
{
font-size: 11px;
font-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif;
}
 
.MN_Item_Padding
{
visibility: hidden;
width: 3px;
height: 20px;
}
 
.MN_Icon
{
background-color: #d6dff7;
text-align: center;
height: 20px;
}
 
.MN_Label
{
padding-left: 3px;
padding-right: 3px;
}
 
.MN_Separator
{
height: 3px;
}
 
.MN_Separator_Line
{
border-top: #b9b99d 1px solid;
}
 
.MN_Item .MN_Icon IMG
{
filter: alpha(opacity=70);
opacity: 0.70;
}
 
.MN_Item_Over
{
color: #ffffff;
background-color: #7096FA;
}
 
.MN_Item_Over .MN_Icon
{
background-color: #466ca6;
}
 
.MN_Item_Disabled IMG
{
filter: gray() alpha(opacity=30); /* IE */
opacity: 0.30; /* Safari, Opera and Mozilla */
}
 
.MN_Item_Disabled .MN_Label
{
color: #b7b7b7;
}
 
.MN_Arrow
{
padding-right: 3px;
padding-left: 3px;
}
 
.MN_ConnectionLine
{
background-color: #f7f8fd;
}
 
.Menu .TB_Button_On, .Menu .TB_Button_On_Over
{
border: #8f8f73 1px solid;
background-color: #f7f8fd;
}
 
/*
### Panel Styles
*/
 
.FCK_Panel
{
border: #8f8f73 1px solid;
padding: 2px;
background-color: #f7f8fd;
}
 
.FCK_Panel, .FCK_Panel TD
{
font-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif;
font-size: 11px;
}
 
/*
### Special Combos
*/
 
.SC_Panel
{
overflow: auto;
white-space: nowrap;
cursor: default;
border: 1px solid #8f8f73;
padding-left: 2px;
padding-right: 2px;
background-color: #ffffff;
}
 
.SC_Panel, .SC_Panel TD
{
font-size: 11px;
font-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif;
}
 
.SC_Item, .SC_ItemSelected
{
margin-top: 2px;
margin-bottom: 2px;
background-position: left center;
padding-left: 11px;
padding-right: 3px;
padding-top: 2px;
padding-bottom: 2px;
text-overflow: ellipsis;
overflow: hidden;
background-repeat: no-repeat;
border: #dddddd 1px solid;
}
 
.SC_Item *, .SC_ItemSelected *
{
margin-top: 0px;
margin-bottom: 0px;
}
 
.SC_ItemSelected
{
border: #9a9afb 1px solid;
background-image: url(images/toolbar.arrowright.gif);
}
 
.SC_ItemOver
{
border: #316ac5 1px solid;
}
 
.SC_Field
{
margin-top: 2px ;
border: #b7b7a6 1px solid;
cursor: default;
}
 
.SC_FieldCaption
{
overflow: visible;
padding-right: 5px;
padding-left: 5px;
opacity: 0.75; /* Safari, Opera and Mozilla */
filter: alpha(opacity=70); /* IE */ /* -moz-opacity: 0.75; Mozilla (Old) */
height: 23px;
background-color: #d6dff7; /* Needed because of a bug on ClearType */
background-image: url(images/toolbar.bg.gif);
background-repeat: repeat-x;
/* background-color: inherit; Maybe this is needed wait to check */
}
 
.SC_FieldLabel
{
white-space: nowrap;
padding: 2px;
width: 100%;
cursor: default;
background-color: #ffffff;
text-overflow: ellipsis;
overflow: hidden;
}
 
.SC_FieldButton
{
background-position: center center;
background-image: url(images/toolbar.buttonarrow.gif);
border-left: #b7b7a6 1px solid;
width: 14px;
background-repeat: no-repeat;
}
 
.SC_FieldDisabled .SC_FieldButton, .SC_FieldDisabled .SC_FieldCaption
{
opacity: 0.30; /* Safari, Opera and Mozilla */
filter: gray() alpha(opacity=30); /* IE */ /* -moz-opacity: 0.30; Mozilla (Old) */
}
 
.SC_FieldOver
{
border: #316ac5 1px solid;
}
 
.SC_FieldOver .SC_FieldButton
{
border-left: #316ac5 1px solid;
}
 
/*
### Color Selector Panel
*/
 
.ColorBoxBorder
{
border: #808080 1px solid;
position: static;
}
 
.ColorBox
{
font-size: 1px;
width: 10px;
position: static;
height: 10px;
}
 
.ColorDeselected, .ColorSelected
{
cursor: default;
}
 
.ColorDeselected
{
border: #ffffff 1px solid;
padding: 2px;
float: left;
}
 
.ColorSelected
{
border: #330066 1px solid;
padding: 2px;
float: left;
background-color: #c4cdd6;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/office2003/images/toolbar.start.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/office2003/images/toolbar.start.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/office2003/images/toolbar.expand.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/office2003/images/toolbar.expand.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/office2003/images/toolbar.separator.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/office2003/images/toolbar.separator.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/office2003/images/toolbar.collapse.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/office2003/images/toolbar.collapse.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/office2003/images/toolbar.buttonarrow.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/office2003/images/toolbar.buttonarrow.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/office2003/images/toolbar.end.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/office2003/images/toolbar.end.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/office2003/images/toolbar.arrowright.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/office2003/images/toolbar.arrowright.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/office2003/images/toolbar.bg.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/office2003/images/toolbar.bg.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/default/fck_editor.css
New file
0,0 → 1,459
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_editor.css
* Styles used by the editor IFRAME and Toolbar.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
/*
### Basic Editor IFRAME Styles.
*/
 
body
{
padding: 1px 1px 1px 1px;
margin: 0px 0px 0px 0px;
}
 
#xEditingArea
{
border: #696969 1px solid;
}
 
.SourceField
{
padding: 5px;
margin: 0px;
font-family: Monospace;
}
 
/*
Toolbar
*/
 
.TB_ToolbarSet, .TB_Expand, .TB_Collapse
{
cursor: default;
background-color: #efefde;
}
 
.TB_ToolbarSet
{
border-top: #efefde 1px outset;
border-bottom: #efefde 1px outset;
}
 
.TB_ToolbarSet TD
{
font-size: 11px;
font-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif;
}
 
.TB_Toolbar
{
display: inline-table; /* inline = Opera jumping buttons bug */
}
 
.TB_Separator
{
width: 1px;
height: 16px;
margin: 2px;
background-color: #999966;
}
 
.TB_Start
{
background-image: url(images/toolbar.start.gif);
margin: 2px;
width: 3px;
background-repeat: no-repeat;
height: 16px;
}
 
.TB_End
{
display: none;
}
 
.TB_ExpandImg
{
background-image: url(images/toolbar.expand.gif);
background-repeat: no-repeat;
}
 
.TB_CollapseImg
{
background-image: url(images/toolbar.collapse.gif);
background-repeat: no-repeat;
}
 
.TB_SideBorder
{
background-color: #696969;
}
 
.TB_Expand, .TB_Collapse
{
padding: 2px 2px 2px 2px;
border: #efefde 1px outset;
}
 
.TB_Collapse
{
width: 5px;
}
 
.TB_Break
{
height: 24px; /* IE needs the height to be set, otherwise no break */
}
 
/*
Toolbar Button
*/
 
.TB_Button_On, .TB_Button_Off, .TB_Button_On_Over, .TB_Button_Off_Over, .TB_Button_Disabled
{
border: #efefde 1px solid; /* This is the default border */
height: 22px; /* The height is necessary, otherwise IE will not apply the alpha */
}
 
.TB_Button_On
{
border: #316ac5 1px solid;
background-color: #c1d2ee;
}
 
.TB_Button_On_Over, .TB_Button_Off_Over
{
border: #316ac5 1px solid;
background-color: #dff1ff;
}
 
.TB_Button_Off
{
filter: alpha(opacity=70); /* IE */
opacity: 0.70; /* Safari, Opera and Mozilla */
}
 
.TB_Button_Disabled
{
filter: gray() alpha(opacity=30); /* IE */
opacity: 0.30; /* Safari, Opera and Mozilla */
}
 
.TB_Button_Padding
{
visibility: hidden;
width: 3px;
height: 22px;
}
 
.TB_Button_Image
{
overflow: hidden;
width: 16px;
height: 16px;
margin: 3px;
background-repeat: no-repeat;
}
 
.TB_Button_Image img
{
position: relative;
}
 
.TB_Button_Off .TB_Button_Text
{
background-color: #efefde; /* Needed because of a bug on Clear Type */
}
 
.TB_ConnectionLine
{
background-color: #ffffff;
height: 1px;
margin-left: 1px; /* ltr */
margin-right: 1px; /* rtl */
}
 
.TB_Text
{
height: 22px;
}
 
.TB_Button_Off .TB_Text
{
background-color: #efefde ; /* Needed because of a bug on ClearType */
}
 
.TB_Button_On_Over .TB_Text
{
background-color: #dff1ff ; /* Needed because of a bug on ClearType */
}
 
/*
Menu
*/
 
.MN_Menu
{
border: 1px solid #8f8f73;
padding: 2px;
background-color: #ffffff;
cursor: default;
}
 
.MN_Menu, .MN_Menu .MN_Label
{
font-size: 11px;
font-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif;
}
 
.MN_Item_Padding
{
visibility: hidden;
width: 3px;
height: 20px;
}
 
.MN_Icon
{
background-color: #e3e3c7;
text-align: center;
height: 20px;
}
 
.MN_Label
{
padding-left: 3px;
padding-right: 3px;
}
 
.MN_Separator
{
height: 3px;
}
 
.MN_Separator_Line
{
border-top: #b9b99d 1px solid;
}
 
.MN_Item .MN_Icon IMG
{
filter: alpha(opacity=70);
opacity: 0.70;
}
 
.MN_Item_Over
{
color: #ffffff;
background-color: #8f8f73;
}
 
.MN_Item_Over .MN_Icon
{
background-color: #737357;
}
 
.MN_Item_Disabled IMG
{
filter: gray() alpha(opacity=30); /* IE */
opacity: 0.30; /* Safari, Opera and Mozilla */
}
 
.MN_Item_Disabled .MN_Label
{
color: #b7b7b7;
}
 
.MN_Arrow
{
padding-right: 3px;
padding-left: 3px;
}
 
.MN_ConnectionLine
{
background-color: #ffffff;
}
 
.Menu .TB_Button_On, .Menu .TB_Button_On_Over
{
border: #8f8f73 1px solid;
background-color: #ffffff;
}
 
/*
### Panel Styles
*/
 
.FCK_Panel
{
border: #8f8f73 1px solid;
padding: 2px;
background-color: #ffffff;
}
 
.FCK_Panel, .FCK_Panel TD
{
font-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif;
font-size: 11px;
}
 
/*
### Special Combos
*/
 
.SC_Panel
{
overflow: auto;
white-space: nowrap;
cursor: default;
border: 1px solid #8f8f73;
padding-left: 2px;
padding-right: 2px;
background-color: #ffffff;
}
 
.SC_Panel, .SC_Panel TD
{
font-size: 11px;
font-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif;
}
 
.SC_Item, .SC_ItemSelected
{
margin-top: 2px;
margin-bottom: 2px;
background-position: left center;
padding-left: 11px;
padding-right: 3px;
padding-top: 2px;
padding-bottom: 2px;
text-overflow: ellipsis;
overflow: hidden;
background-repeat: no-repeat;
border: #dddddd 1px solid;
}
 
.SC_Item *, .SC_ItemSelected *
{
margin-top: 0px;
margin-bottom: 0px;
}
 
.SC_ItemSelected
{
border: #9a9afb 1px solid;
background-image: url(images/toolbar.arrowright.gif);
}
 
.SC_ItemOver
{
border: #316ac5 1px solid;
}
 
.SC_Field
{
border: #b7b7a6 1px solid;
cursor: default;
}
 
.SC_FieldCaption
{
overflow: visible;
padding-right: 5px;
padding-left: 5px;
opacity: 0.75; /* Safari, Opera and Mozilla */
filter: alpha(opacity=70); /* IE */ /* -moz-opacity: 0.75; Mozilla (Old) */
height: 23px;
background-color: #efefde;
}
 
.SC_FieldLabel
{
white-space: nowrap;
padding: 2px;
width: 100%;
cursor: default;
background-color: #ffffff;
text-overflow: ellipsis;
overflow: hidden;
}
 
.SC_FieldButton
{
background-position: center center;
background-image: url(images/toolbar.buttonarrow.gif);
border-left: #b7b7a6 1px solid;
width: 14px;
background-repeat: no-repeat;
}
 
.SC_FieldDisabled .SC_FieldButton, .SC_FieldDisabled .SC_FieldCaption
{
opacity: 0.30; /* Safari, Opera and Mozilla */
filter: gray() alpha(opacity=30); /* IE */ /* -moz-opacity: 0.30; Mozilla (Old) */
}
 
.SC_FieldOver
{
border: #316ac5 1px solid;
}
 
.SC_FieldOver .SC_FieldButton
{
border-left: #316ac5 1px solid;
}
 
/*
### Color Selector Panel
*/
 
.ColorBoxBorder
{
border: #808080 1px solid;
position: static;
}
 
.ColorBox
{
font-size: 1px;
width: 10px;
position: static;
height: 10px;
}
 
.ColorDeselected, .ColorSelected
{
cursor: default;
}
 
.ColorDeselected
{
border: #ffffff 1px solid;
padding: 2px;
float: left;
}
 
.ColorSelected
{
border: #330066 1px solid;
padding: 2px;
float: left;
background-color: #c4cdd6;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/default/images/toolbar.arrowright.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/default/images/toolbar.arrowright.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/default/images/toolbar.start.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/default/images/toolbar.start.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/default/images/toolbar.expand.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/default/images/toolbar.expand.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/default/images/toolbar.separator.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/default/images/toolbar.separator.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/default/images/toolbar.collapse.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/default/images/toolbar.collapse.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/default/images/toolbar.buttonarrow.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/default/images/toolbar.buttonarrow.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/default/images/toolbar.end.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/default/images/toolbar.end.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/default/fck_strip.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/default/fck_strip.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/default/fck_dialog.css
New file
0,0 → 1,131
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_dialog.css
* Styles used by the dialog boxes.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
body
{
margin: 0px;
padding: 10px;
}
 
body, td, input, select, textarea
{
font-size: 11px;
font-family: 'Microsoft Sans Serif' , Arial, Helvetica, Verdana;
}
 
body, .BackColor
{
background-color: #f1f1e3;
}
 
.PopupBody
{
margin: 0px;
padding: 0px;
}
 
.PopupTitle
{
font-weight: bold;
font-size: 14pt;
color: #737357;
background-color: #e3e3c7;
padding: 3px 10px 3px 10px;
}
 
.PopupButtons
{
border-top: #d5d59d 1px solid;
background-color: #e3e3c7;
padding: 7px 10px 7px 10px;
}
 
.Button
{
border-right: #737357 1px solid;
border-top: #737357 1px solid;
border-left: #737357 1px solid;
color: #3b3b1f;
border-bottom: #737357 1px solid;
background-color: #c7c78f;
}
 
.DarkBackground
{
background-color: #d7d79f;
}
 
.LightBackground
{
background-color: #ffffbe;
}
 
.PopupTitleBorder
{
border-bottom: #d5d59d 1px solid;
}
 
.PopupTabArea
{
color: #737357;
background-color: #e3e3c7;
}
 
.PopupTabEmptyArea
{
padding-left: 10px ;
border-bottom: #d5d59d 1px solid;
}
 
.PopupTab, .PopupTabSelected
{
border-right: #d5d59d 1px solid;
border-top: #d5d59d 1px solid;
border-left: #d5d59d 1px solid;
padding-right: 5px;
padding-left: 5px;
padding-bottom: 3px;
padding-top: 3px;
color: #737357;
}
 
.PopupTab
{
margin-top: 1px;
border-bottom: #d5d59d 1px solid;
cursor: pointer;
cursor: hand;
}
 
.PopupTabSelected
{
font-weight:bold;
cursor: default;
padding-top: 4px;
border-bottom: #f1f1e3 1px solid;
background-color: #f1f1e3;
}
 
.PopupSelectionBox
{
border: #ff9933 1px solid !important;
background-color: #fffacd !important;
cursor: pointer;
cursor: hand;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/silver/images/toolbar.arrowright.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/silver/images/toolbar.arrowright.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/silver/images/toolbar.start.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/silver/images/toolbar.start.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/silver/images/toolbar.expand.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/silver/images/toolbar.expand.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/silver/images/toolbar.separator.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/silver/images/toolbar.separator.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/silver/images/toolbar.collapse.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/silver/images/toolbar.collapse.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/silver/images/toolbar.buttonbg.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/silver/images/toolbar.buttonbg.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/silver/images/toolbar.buttonarrow.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/silver/images/toolbar.buttonarrow.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/silver/images/toolbar.end.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/silver/images/toolbar.end.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/silver/fck_strip.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/silver/fck_strip.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/silver/fck_dialog.css
New file
0,0 → 1,132
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_dialog.css
* Styles used by the dialog boxes.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
body
{
margin: 0px;
padding: 10px;
background-color: #f7f7f7;
}
 
body, td, input, select, textarea
{
font-size: 11px;
font-family: 'Microsoft Sans Serif' , Arial, Helvetica, Verdana;
}
 
body, .BackColor
{
background-color: #f7f7f7;
}
 
.PopupBody
{
margin: 0px;
padding: 0px;
}
 
.PopupTitle
{
padding-right: 10px;
padding-left: 10px;
font-weight: bold;
font-size: 14pt;
padding-bottom: 3px;
color: #504845;
padding-top: 3px;
background-color: #dedede;
}
 
.PopupButtons
{
border-top: #cec6b5 1px solid;
background-color: #DEDEDE;
padding: 7px 10px 7px 10px;
}
 
.Button
{
border: #7a7261 1px solid;
color: #504845;
background-color: #cec6b5;
}
 
.DarkBackground
{
background-color: #d7d79f;
}
 
.LightBackground
{
background-color: #ffffbe;
}
 
.PopupTitleBorder
{
border-bottom: #cec6b5 1px solid;
}
 
.PopupTabArea
{
color: #504845;
background-color: #DEDEDE;
}
 
.PopupTabEmptyArea
{
padding-left: 10px ;
border-bottom: #cec6b5 1px solid;
}
 
.PopupTab, .PopupTabSelected
{
border-right: #cec6b5 1px solid;
border-top: #cec6b5 1px solid;
border-left: #cec6b5 1px solid;
padding-right: 5px;
padding-left: 5px;
padding-bottom: 3px;
padding-top: 3px;
color: #504845;
}
 
.PopupTab
{
margin-top: 1px;
border-bottom: #cec6b5 1px solid;
cursor: pointer;
cursor: hand;
}
 
.PopupTabSelected
{
font-weight:bold;
cursor: default;
padding-top: 4px;
border-bottom: #f1f1e3 1px solid;
background-color: #f7f7f7;
}
 
.PopupSelectionBox
{
border: #a9a9a9 1px solid !important;
background-color: #dcdcdc !important;
cursor: pointer;
cursor: hand;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/silver/fck_editor.css
New file
0,0 → 1,470
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_editor.css
* Styles used by the editor IFRAME and Toolbar.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
* gazou[Fr]
*/
 
/*
### Basic Editor IFRAME Styles.
*/
 
body
{
padding: 1px 1px 1px 1px;
margin: 0px 0px 0px 0px;
}
 
#xEditingArea
{
border: #696969 1px solid;
}
 
.SourceField
{
padding: 5px;
margin: 0px;
font-family: Monospace;
}
 
/*
Toolbar
*/
 
.TB_ToolbarSet, .TB_Expand, .TB_Collapse
{
cursor: default;
background-color: #f7f7f7;
}
 
.TB_ToolbarSet
{
padding: 1px;
border-top: #efefde 1px outset;
border-bottom: #efefde 1px outset;
}
 
.TB_ToolbarSet TD
{
font-size: 11px;
font-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif;
}
 
.TB_Toolbar
{
display: inline-table;
}
 
.TB_Separator
{
width: 1px;
height: 21px;
margin: 2px;
background-color: #C6C3BD;
}
 
.TB_Start
{
background-image: url(images/toolbar.start.gif);
margin-left: 2px;
margin-right: 2px;
width: 3px;
background-repeat: no-repeat;
height: 27px;
background-position: center center;
}
 
.TB_End
{
display: none;
}
 
.TB_ExpandImg
{
background-image: url(images/toolbar.expand.gif);
background-repeat: no-repeat;
}
 
.TB_CollapseImg
{
background-image: url(images/toolbar.collapse.gif);
background-repeat: no-repeat;
}
 
.TB_SideBorder
{
background-color: #696969;
}
 
.TB_Expand, .TB_Collapse
{
padding: 2px 2px 2px 2px;
border: #efefde 1px outset;
}
 
.TB_Collapse
{
border: #efefde 1px outset;
width: 5px;
}
 
.TB_Break
{
height: 27px;
}
 
/*
Toolbar Button
*/
 
.TB_Button_On, .TB_Button_Off, .TB_Button_On_Over, .TB_Button_Off_Over, .TB_Button_Disabled
{
padding: 1px ;
margin:1px;
height: 21px;
}
 
.TB_Button_On, .TB_Button_Off, .TB_Button_On_Over, .TB_Button_Off_Over, .TB_Button_Disabled
{
border: #cec6b5 1px solid;
}
 
.TB_Button_On
{
border-color: #316ac5;
background-color: #c1d2ee;
}
 
.TB_Button_On_Over, .TB_Button_Off_Over
{
border: #316ac5 1px solid;
background-color: #dff1ff;
}
 
.TB_Button_Off
{
background: #efefef url(images/toolbar.buttonbg.gif) repeat-x;
}
 
.TB_Button_Off, .TB_Combo_Off
{
opacity: 0.70; /* Safari, Opera and Mozilla */
filter: alpha(opacity=70); /* IE */
/* -moz-opacity: 0.70; Mozilla (Old) */
}
 
.TB_Button_Disabled
{
opacity: 0.30; /* Safari, Opera and Mozilla */
filter: gray() alpha(opacity=30); /* IE */
}
 
.TB_Button_Padding
{
visibility: hidden;
width: 3px;
height: 21px;
}
 
.TB_Button_Image
{
overflow: hidden;
width: 16px;
height: 16px;
margin: 3px;
margin-top: 4px;
margin-bottom: 2px;
background-repeat: no-repeat;
}
 
/* For composed button ( icon + text, icon + arrow ), we must compensate the table */
.TB_Button_On TABLE .TB_Button_Image,
.TB_Button_Off TABLE .TB_Button_Image,
.TB_Button_On_Over TABLE .TB_Button_Image,
.TB_Button_Off_Over TABLE .TB_Button_Image,
.TB_Button_Disabled TABLE .TB_Button_Image
{
margin-top: 3px;
}
 
.TB_Button_Image img
{
position: relative;
}
 
.TB_ConnectionLine
{
background-color: #ffffff;
height: 1px;
margin-left: 1px; /* ltr */
margin-right: 1px; /* rtl */
}
 
/*
Menu
*/
 
.MN_Menu
{
border: 1px solid #8f8f73;
padding: 2px;
background-color: #f7f7f7;
cursor: default;
}
 
.MN_Menu, .MN_Menu .MN_Label
{
font-size: 11px;
font-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif;
}
 
.MN_Item_Padding
{
visibility: hidden;
width: 3px;
height: 20px;
}
 
.MN_Icon
{
background-color: #dedede;
text-align: center;
height: 20px;
}
 
.MN_Label
{
padding-left: 3px;
padding-right: 3px;
}
 
.MN_Separator
{
height: 3px;
}
 
.MN_Separator_Line
{
border-top: #b9b99d 1px solid;
}
 
.MN_Item .MN_Icon IMG
{
filter: alpha(opacity=70);
opacity: 0.70;
}
 
.MN_Item_Over
{
color: #ffffff;
background-color: #8a857d;
}
 
.MN_Item_Over .MN_Icon
{
background-color: #6c6761;
}
 
.MN_Item_Disabled IMG
{
filter: gray() alpha(opacity=30); /* IE */
opacity: 0.30; /* Safari, Opera and Mozilla */
}
 
.MN_Item_Disabled .MN_Label
{
color: #b7b7b7;
}
 
.MN_Arrow
{
padding-right: 3px;
padding-left: 3px;
}
 
.MN_ConnectionLine
{
background-color: #ffffff;
}
 
.Menu .TB_Button_On, .Menu .TB_Button_On_Over
{
border: #8f8f73 1px solid;
background-color: #ffffff;
}
 
/*
### Panel Styles
*/
 
.FCK_Panel
{
border: #8f8f73 1px solid;
padding: 2px;
background-color: #ffffff;
}
 
.FCK_Panel, .FCK_Panel TD
{
font-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif;
font-size: 11px;
}
 
/*
### Special Combos
*/
 
.SC_Panel
{
overflow: auto;
white-space: nowrap;
cursor: default;
border: 1px solid #8f8f73;
padding-left: 2px;
padding-right: 2px;
background-color: #ffffff;
}
 
.SC_Panel, .SC_Panel TD
{
font-size: 11px;
font-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif;
}
 
.SC_Item, .SC_ItemSelected
{
margin-top: 2px;
margin-bottom: 2px;
background-position: left center;
padding-left: 11px;
padding-right: 3px;
padding-top: 2px;
padding-bottom: 2px;
text-overflow: ellipsis;
overflow: hidden;
background-repeat: no-repeat;
border: #dddddd 1px solid;
}
 
.SC_Item *, .SC_ItemSelected *
{
margin-top: 0px;
margin-bottom: 0px;
}
 
.SC_ItemSelected
{
border: #9a9afb 1px solid;
background-image: url(images/toolbar.arrowright.gif);
}
 
.SC_ItemOver
{
border: #316ac5 1px solid;
}
 
.SC_Field
{
margin-top:1px ;
border: #b7b7a6 1px solid;
cursor: default;
}
 
.SC_FieldCaption
{
padding-top: 1px ;
overflow: visible;
padding-right: 5px;
padding-left: 5px;
opacity: 0.75; /* Safari, Opera and Mozilla */
filter: alpha(opacity=70); /* IE */ /* -moz-opacity: 0.75; Mozilla (Old) */
height: 23px;
background-color: #f7f7f7;
}
 
.SC_FieldLabel
{
white-space: nowrap;
padding: 2px;
width: 100%;
cursor: default;
background-color: #ffffff;
text-overflow: ellipsis;
overflow: hidden;
}
 
.SC_FieldButton
{
background-position: center center;
background-image: url(images/toolbar.buttonarrow.gif);
border-left: #b7b7a6 1px solid;
width: 14px;
background-repeat: no-repeat;
}
 
.SC_FieldDisabled .SC_FieldButton, .SC_FieldDisabled .SC_FieldCaption
{
opacity: 0.30; /* Safari, Opera and Mozilla */
filter: gray() alpha(opacity=30); /* IE */ /* -moz-opacity: 0.30; Mozilla (Old) */
}
 
.SC_FieldOver
{
border: #316ac5 1px solid;
}
 
.SC_FieldOver .SC_FieldButton
{
border-left: #316ac5 1px solid;
}
 
/*
### Color Selector Panel
*/
 
.ColorBoxBorder
{
border: #808080 1px solid;
position: static;
}
 
.ColorBox
{
font-size: 1px;
width: 10px;
position: static;
height: 10px;
}
 
.ColorDeselected, .ColorSelected
{
cursor: default;
}
 
.ColorDeselected
{
border: #ffffff 1px solid;
padding: 2px;
float: left;
}
 
.ColorSelected
{
border: #316ac5 1px solid;
padding: 2px;
float: left;
background-color: #c1d2ee;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/skins/_fckviewstrips.html
New file
0,0 → 1,118
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: _fckviewstrips.html
* Useful page that enumerates all icons in the skins strips.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>FCKeditor - View Icons Strips</title>
<style type="text/css">
.TB_Button_Image
{
overflow: hidden;
width: 16px;
height: 16px;
margin: 3px;
background-repeat: no-repeat;
}
 
.TB_Button_Image img
{
position: relative;
}
</style>
<script type="text/javascript">
 
window.onload = function()
{
var eImg1 = document.createElement( 'img' ) ;
eImg1.onreadystatechange = Img_OnReadyStateChange ;
eImg1.src = 'default/fck_strip.gif' ;
 
var eImg2 = document.createElement( 'img' ) ;
eImg2.onreadystatechange = Img_OnReadyStateChange ;
eImg2.src = 'office2003/fck_strip.gif' ;
 
var eImg3 = document.createElement( 'img' ) ;
eImg3.onreadystatechange = Img_OnReadyStateChange ;
eImg3.src = 'silver/fck_strip.gif' ;
}
 
var iTotalStrips = 3 ;
var iMaxHeight = 0 ;
 
function Img_OnReadyStateChange()
{
if ( this.readyState == 'complete' )
{
if ( iMaxHeight < this.height )
iMaxHeight = this.height ;
iTotalStrips-- ;
if ( iTotalStrips == 0 )
LoadIcons( iMaxHeight / 16 ) ;
}
}
 
function LoadIcons( total )
{
for ( var i = 0 ; i < total ; i++ )
{
var eRow = xIconsTable.insertRow(-1) ;
var eCell = eRow.insertCell(-1) ;
eCell.innerHTML = i + 1 ;
eCell = eRow.insertCell(-1) ;
eCell.align = 'center' ;
eCell.style.border = '#dcdcdc 1px solid' ;
eCell.innerHTML = '<div class="TB_Button_Image"><img src="default/fck_strip.gif" style="top=-' + ( i * 16 ) + 'px;"></div>' ;
 
eCell = eRow.insertCell(-1) ;
eCell.align = 'center' ;
eCell.style.border = '#dcdcdc 1px solid' ;
eCell.innerHTML = '<div class="TB_Button_Image"><img src="office2003/fck_strip.gif" style="top=-' + ( i * 16 ) + 'px;"></div>' ;
 
eCell = eRow.insertCell(-1) ;
eCell.align = 'center' ;
eCell.style.border = '#dcdcdc 1px solid' ;
eCell.innerHTML = '<div class="TB_Button_Image"><img src="silver/fck_strip.gif" style="top=-' + ( i * 16 ) + 'px;"></div>' ;
}
}
 
</script>
</head>
<body>
<table id="xIconsTable">
<tr>
<td rowspan="2">
Index</td>
<td align="center" colspan="3">
Skins</td>
</tr>
<tr>
<td width="80" align="center">
default</td>
<td width="80" align="center">
office2003</td>
<td width="80" align="center">
silver</td>
</tr>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/css/images/fck_anchor.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/css/images/fck_anchor.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/css/images/fck_flashlogo.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/css/images/fck_flashlogo.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/css/images/fck_pagebreak.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/css/images/fck_pagebreak.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/css/fck_internal.css
New file
0,0 → 1,88
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_internal.css
* This CSS Style Sheet defines rules used by the editor for its internal use.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
/* Fix to allow putting the caret at the end of the
content in Firefox if clicking below the content */
html
{
min-height:100%;
}
 
 
table.FCK__ShowTableBorders, table.FCK__ShowTableBorders td, table.FCK__ShowTableBorders th
{
border: #d3d3d3 1px solid;
}
 
form
{
border: 1px dotted #FF0000;
padding: 2px;
}
 
.FCK__Flash
{
border: darkgray 1px solid;
background-position: center center;
background-image: url(images/fck_flashlogo.gif);
background-repeat: no-repeat;
width: 80px;
height: 80px;
}
 
.FCK__Anchor
{
background-position: center center;
background-image: url(images/fck_anchor.gif);
background-repeat: no-repeat;
width: 16px;
height: 15px;
}
 
.FCK__PageBreak
{
background-position: center center;
background-image: url(images/fck_pagebreak.gif);
background-repeat: no-repeat;
clear: both;
display: block;
float: none;
width: 100%;
border-top: #999999 1px dotted;
border-bottom: #999999 1px dotted;
border-right: 0px;
border-left: 0px;
height: 5px;
}
 
input[type="hidden"]
{
display: inline;
width:20px;
height:20px;
border:1px dotted #FF0000 ;
background-image: url(behaviors/hiddenfield.gif);
background-repeat: no-repeat;
}
 
input[type="hidden"]:after
{
padding-left: 20px;
content: "" ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/css/fck_editorarea.css
New file
0,0 → 1,92
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_editorarea.css
* This is the default CSS file used by the editor area. It defines the
* initial font of the editor and background color.
*
* A user can configure the editor to use another CSS file. Just change
* the value of the FCKConfig.EditorAreaCSS key in the configuration
* file.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
/*
The "body" styles should match your editor web site, mainly regarding
background color and font family and size.
*/
 
body
{
background-color: #ffffff;
padding: 5px 5px 5px 5px;
margin: 0px;
}
 
body, td
{
font-family: Arial, Verdana, Sans-Serif;
font-size: 12px;
}
 
a
{
color: #0000FF !important; /* For Firefox... mark as important, otherwise it becomes black */
}
 
h3
{
color: #000080;
}
 
/*
Just uncomment the following block if you want to avoid spaces between
paragraphs. Remember to apply the same style in your output front end page.
*/
 
/*
P, UL, LI
{
margin-top: 0px;
margin-bottom: 0px;
}
*/
 
/*
The following are some sample styles used in the "Styles" toolbar command.
You should instead remove them, and include the styles used by the site
you are using the editor in.
*/
 
.Bold
{
font-weight: bold;
}
 
.Title
{
font-weight: bold;
font-size: 18px;
color: #cc3300;
}
 
.Code
{
border: #8b4513 1px solid;
padding-right: 5px;
padding-left: 5px;
color: #000066;
font-family: 'Courier New' , Monospace;
background-color: #ff9933;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/css/fck_showtableborders_gecko.css
New file
0,0 → 1,38
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_showtableborders_gecko.css
* This CSS Style Sheet defines the rules to show table borders on Gecko.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
/* For tables with the "border" attribute set to "0" */
table[border="0"],
table[border="0"] > tr > td, table[border="0"] > tr > th,
table[border="0"] > tbody > tr > td, table[border="0"] > tbody > tr > th,
table[border="0"] > thead > tr > td, table[border="0"] > thead > tr > th,
table[border="0"] > tfoot > tr > td, table[border="0"] > tfoot > tr > th
{
border: #d3d3d3 1px dotted ;
}
 
/* For tables with no "border" attribute set */
table:not([border]),
table:not([border]) > tr > td, table:not([border]) > tr > th,
table:not([border]) > tbody > tr > td, table:not([border]) > tbody > tr > th,
table:not([border]) > thead > tr > td, table:not([border]) > thead > tr > th,
table:not([border]) > tfoot > tr > td, table:not([border]) > tfoot > tr > th
{
border: #d3d3d3 1px dotted ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/css/behaviors/showtableborders.htc
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/css/behaviors/showtableborders.htc
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/css/behaviors/hiddenfield.htc
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/css/behaviors/hiddenfield.htc
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/css/behaviors/disablehandles.htc
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/css/behaviors/disablehandles.htc
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/css/behaviors/hiddenfield.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/css/behaviors/hiddenfield.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/frmresourcetype.html
New file
0,0 → 1,61
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: frmresourcetype.html
* This page shows the list of available resource types.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="browser.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="js/common.js"></script>
<script language="javascript">
 
function SetResourceType( type )
{
window.parent.frames["frmFolders"].SetResourceType( type ) ;
}
 
var aTypes = [
['File','File'],
['Image','Image'],
['Flash','Flash'],
['Media','Media']
] ;
 
window.onload = function()
{
for ( var i = 0 ; i < aTypes.length ; i++ )
{
if ( oConnector.ShowAllTypes || aTypes[i][0] == oConnector.ResourceType )
AddSelectOption( document.getElementById('cmbType'), aTypes[i][1], aTypes[i][0] ) ;
}
}
 
</script>
</head>
<body bottomMargin="0" topMargin="0">
<table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr>
<td nowrap>
Resource Type<BR>
<select id="cmbType" style="WIDTH: 100%" onchange="SetResourceType(this.value);">
</select>
</td>
</tr>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/ButtonArrow.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/ButtonArrow.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/FolderOpened.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/FolderOpened.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/vsd.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/vsd.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/swf.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/swf.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/mp3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/mp3.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/xml.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/xml.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/zip.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/zip.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/fla.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/fla.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/mdb.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/mdb.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/ppt.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/ppt.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/html.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/html.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/gif.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/gif.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/doc.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/doc.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/cs.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/cs.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/xls.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/xls.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/pdf.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/pdf.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/dll.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/dll.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/default.icon.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/default.icon.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/js.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/js.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/swt.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/swt.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/bmp.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/bmp.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/avi.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/avi.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/txt.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/txt.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/exe.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/exe.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/rdp.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/rdp.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/htm.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/htm.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/ai.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/ai.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/vsd.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/vsd.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/swf.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/swf.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/mp3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/mp3.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/xml.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/xml.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/zip.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/zip.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/fla.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/fla.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/mdb.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/mdb.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/ppt.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/ppt.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/html.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/html.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/cs.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/cs.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/doc.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/doc.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/gif.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/gif.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/xls.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/xls.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/pdf.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/pdf.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/dll.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/dll.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/default.icon.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/default.icon.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/js.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/js.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/swt.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/swt.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/bmp.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/bmp.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/avi.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/avi.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/txt.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/txt.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/jpg.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/32/jpg.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/jpg.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/jpg.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/exe.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/exe.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/rdp.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/rdp.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/htm.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/htm.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/ai.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/icons/ai.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/Folder.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/Folder.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/FolderOpened32.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/FolderOpened32.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/spacer.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/spacer.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/Folder32.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/Folder32.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/FolderUp.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/images/FolderUp.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/browser.html
New file
0,0 → 1,148
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: browser.html
* This page compose the File Browser dialog frameset.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>FCKeditor - Resources Browser</title>
<link href="browser.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="js/fckxml.js"></script>
<script language="javascript">
 
function GetUrlParam( paramName )
{
var oRegex = new RegExp( '[\?&]' + paramName + '=([^&]+)', 'i' ) ;
var oMatch = oRegex.exec( window.top.location.search ) ;
if ( oMatch && oMatch.length > 1 )
return unescape( oMatch[1] ) ;
else
return '' ;
}
 
var oConnector = new Object() ;
oConnector.CurrentFolder = '/' ;
 
var sConnUrl = GetUrlParam( 'Connector' ) ;
 
// Gecko has some problems when using relative URLs (not starting with slash).
if ( sConnUrl.substr(0,1) != '/' && sConnUrl.indexOf( '://' ) < 0 )
sConnUrl = window.location.href.replace( /browser.html.*$/, '' ) + sConnUrl ;
 
oConnector.ConnectorUrl = sConnUrl + ( sConnUrl.indexOf('?') != -1 ? '&' : '?' ) ;
 
var sServerPath = GetUrlParam( 'ServerPath' ) ;
if ( sServerPath.length > 0 )
oConnector.ConnectorUrl += 'ServerPath=' + escape( sServerPath ) + '&' ;
 
oConnector.ResourceType = GetUrlParam( 'Type' ) ;
oConnector.ShowAllTypes = ( oConnector.ResourceType.length == 0 ) ;
 
if ( oConnector.ShowAllTypes )
oConnector.ResourceType = 'File' ;
 
oConnector.SendCommand = function( command, params, callBackFunction )
{
var sUrl = this.ConnectorUrl + 'Command=' + command ;
sUrl += '&Type=' + this.ResourceType ;
sUrl += '&CurrentFolder=' + escape( this.CurrentFolder ) ;
if ( params ) sUrl += '&' + params ;
 
var oXML = new FCKXml() ;
if ( callBackFunction )
oXML.LoadUrl( sUrl, callBackFunction ) ; // Asynchronous load.
else
return oXML.LoadUrl( sUrl ) ;
}
 
oConnector.CheckError = function( responseXml )
{
var iErrorNumber = 0
var oErrorNode = responseXml.SelectSingleNode( 'Connector/Error' ) ;
if ( oErrorNode )
{
iErrorNumber = parseInt( oErrorNode.attributes.getNamedItem('number').value ) ;
switch ( iErrorNumber )
{
case 0 :
break ;
case 1 : // Custom error. Message placed in the "text" attribute.
alert( oErrorNode.attributes.getNamedItem('text').value ) ;
break ;
case 101 :
alert( 'Folder already exists' ) ;
break ;
case 102 :
alert( 'Invalid folder name' ) ;
break ;
case 103 :
alert( 'You have no permissions to create the folder' ) ;
break ;
case 110 :
alert( 'Unknown error creating folder' ) ;
break ;
default :
alert( 'Error on your request. Error number: ' + iErrorNumber ) ;
break ;
}
}
return iErrorNumber ;
}
 
var oIcons = new Object() ;
 
oIcons.AvailableIconsArray = [
'ai','avi','bmp','cs','dll','doc','exe','fla','gif','htm','html','jpg','js',
'mdb','mp3','pdf','ppt','rdp','swf','swt','txt','vsd','xls','xml','zip' ] ;
oIcons.AvailableIcons = new Object() ;
 
for ( var i = 0 ; i < oIcons.AvailableIconsArray.length ; i++ )
oIcons.AvailableIcons[ oIcons.AvailableIconsArray[i] ] = true ;
 
oIcons.GetIcon = function( fileName )
{
var sExtension = fileName.substr( fileName.lastIndexOf('.') + 1 ).toLowerCase() ;
 
if ( this.AvailableIcons[ sExtension ] == true )
return sExtension ;
else
return 'default.icon' ;
}
</script>
</head>
<frameset cols="150,*" class="Frame" framespacing="3" bordercolor="#f1f1e3" frameborder="1">
<frameset rows="50,*" framespacing="0">
<frame src="frmresourcetype.html" scrolling="no" frameborder="0">
<frame name="frmFolders" src="frmfolders.html" scrolling="auto" frameborder="1">
</frameset>
<frameset rows="50,*,50" framespacing="0">
<frame name="frmActualFolder" src="frmactualfolder.html" scrolling="no" frameborder="0">
<frame name="frmResourcesList" src="frmresourceslist.html" scrolling="auto" frameborder="1">
<frameset cols="150,*,0" framespacing="0" frameborder="0">
<frame name="frmCreateFolder" src="frmcreatefolder.html" scrolling="no" frameborder="0">
<frame name="frmUpload" src="frmupload.html" scrolling="no" frameborder="0">
<frame name="frmUploadWorker" src="../../../fckblank.html" scrolling="no" frameborder="0">
</frameset>
</frameset>
</frameset>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/frmfolders.html
New file
0,0 → 1,192
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: frmfolders.html
* This page shows the list of folders available in the parent folder
* of the current folder.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link href="browser.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="js/common.js"></script>
<script language="javascript">
 
var sActiveFolder ;
 
var bIsLoaded = false ;
var iIntervalId ;
 
var oListManager = new Object() ;
 
oListManager.Init = function()
{
this.Table = document.getElementById('tableFiles') ;
this.UpRow = document.getElementById('trUp') ;
 
this.TableRows = new Object() ;
}
 
oListManager.Clear = function()
{
// Remove all other rows available.
while ( this.Table.rows.length > 1 )
this.Table.deleteRow(1) ;
 
// Reset the TableRows collection.
this.TableRows = new Object() ;
}
 
oListManager.AddItem = function( folderName, folderPath )
{
// Create the new row.
var oRow = this.Table.insertRow(-1) ;
oRow.className = 'FolderListFolder' ;
 
// Build the link to view the folder.
var sLink = '<a href="#" onclick="OpenFolder(\'' + folderPath + '\');return false;">' ;
 
// Add the folder icon cell.
var oCell = oRow.insertCell(-1) ;
oCell.width = 16 ;
oCell.innerHTML = sLink + '<img alt="" src="images/spacer.gif" width="16" height="16" border="0"></a>' ;
 
// Add the folder name cell.
oCell = oRow.insertCell(-1) ;
oCell.noWrap = true ;
oCell.innerHTML = '&nbsp;' + sLink + folderName + '</a>' ;
this.TableRows[ folderPath ] = oRow ;
}
 
oListManager.ShowUpFolder = function( upFolderPath )
{
this.UpRow.style.display = ( upFolderPath != null ? '' : 'none' ) ;
if ( upFolderPath != null )
{
document.getElementById('linkUpIcon').onclick = document.getElementById('linkUp').onclick = function()
{
LoadFolders( upFolderPath ) ;
return false ;
}
}
}
 
function CheckLoaded()
{
if ( window.top.IsLoadedActualFolder
&& window.top.IsLoadedCreateFolder
&& window.top.IsLoadedUpload
&& window.top.IsLoadedResourcesList )
{
window.clearInterval( iIntervalId ) ;
bIsLoaded = true ;
OpenFolder( sActiveFolder ) ;
}
}
 
function OpenFolder( folderPath )
{
sActiveFolder = folderPath ;
 
if ( ! bIsLoaded )
{
if ( ! iIntervalId )
iIntervalId = window.setInterval( CheckLoaded, 100 ) ;
return ;
}
 
// Change the style for the select row (to show the opened folder).
for ( var sFolderPath in oListManager.TableRows )
{
oListManager.TableRows[ sFolderPath ].className =
( sFolderPath == folderPath ? 'FolderListCurrentFolder' : 'FolderListFolder' ) ;
}
 
// Set the current folder in all frames.
window.parent.frames['frmActualFolder'].SetCurrentFolder( oConnector.ResourceType, folderPath ) ;
window.parent.frames['frmCreateFolder'].SetCurrentFolder( oConnector.ResourceType, folderPath ) ;
window.parent.frames['frmUpload'].SetCurrentFolder( oConnector.ResourceType, folderPath ) ;
// Load the resources list for this folder.
window.parent.frames['frmResourcesList'].LoadResources( oConnector.ResourceType, folderPath ) ;
}
 
function LoadFolders( folderPath )
{
// Clear the folders list.
oListManager.Clear() ;
 
// Get the parent folder path.
var sParentFolderPath ;
if ( folderPath != '/' )
sParentFolderPath = folderPath.substring( 0, folderPath.lastIndexOf( '/', folderPath.length - 2 ) + 1 ) ;
 
// Show/Hide the Up Folder.
oListManager.ShowUpFolder( sParentFolderPath ) ;
if ( folderPath != '/' )
{
sActiveFolder = folderPath ;
oConnector.CurrentFolder = sParentFolderPath
oConnector.SendCommand( 'GetFolders', null, GetFoldersCallBack ) ;
}
else
OpenFolder( '/' ) ;
}
 
function GetFoldersCallBack( fckXml )
{
if ( oConnector.CheckError( fckXml ) != 0 )
return ;
// Get the current folder path.
var oNode = fckXml.SelectSingleNode( 'Connector/CurrentFolder' ) ;
var sCurrentFolderPath = oNode.attributes.getNamedItem('path').value ;
var oNodes = fckXml.SelectNodes( 'Connector/Folders/Folder' ) ;
for ( var i = 0 ; i < oNodes.length ; i++ )
{
var sFolderName = oNodes[i].attributes.getNamedItem('name').value ;
oListManager.AddItem( sFolderName, sCurrentFolderPath + sFolderName + "/" ) ;
}
OpenFolder( sActiveFolder ) ;
}
 
function SetResourceType( type )
{
oConnector.ResourceType = type ;
LoadFolders( '/' ) ;
}
 
window.onload = function()
{
oListManager.Init() ;
LoadFolders( '/' ) ;
}
</script>
</head>
<body class="FileArea" bottomMargin="10" leftMargin="10" topMargin="10" rightMargin="10">
<table id="tableFiles" cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr id="trUp" style="DISPLAY: none">
<td width="16"><a id="linkUpIcon" href="#"><img alt="" src="images/FolderUp.gif" width="16" height="16" border="0"></a></td>
<td nowrap width="100%">&nbsp;<a id="linkUp" href="#">..</a></td>
</tr>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/frmcreatefolder.html
New file
0,0 → 1,109
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: frmcreatefolder.html
* Page used to create new folders in the current folder.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="browser.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="js/common.js"></script>
<script language="javascript">
 
function SetCurrentFolder( resourceType, folderPath )
{
oConnector.ResourceType = resourceType ;
oConnector.CurrentFolder = folderPath
}
 
function CreateFolder()
{
var sFolderName ;
while ( true )
{
sFolderName = prompt( 'Type the name of the new folder:', '' ) ;
if ( sFolderName == null )
return ;
else if ( sFolderName.length == 0 )
alert( 'Please type the folder name' ) ;
else
break ;
}
oConnector.SendCommand( 'CreateFolder', 'NewFolderName=' + escape( sFolderName) , CreateFolderCallBack ) ;
}
 
function CreateFolderCallBack( fckXml )
{
if ( oConnector.CheckError( fckXml ) == 0 )
window.parent.frames['frmResourcesList'].Refresh() ;
/*
// Get the current folder path.
var oNode = fckXml.SelectSingleNode( 'Connector/Error' ) ;
var iErrorNumber = parseInt( oNode.attributes.getNamedItem('number').value ) ;
switch ( iErrorNumber )
{
case 0 :
window.parent.frames['frmResourcesList'].Refresh() ;
break ;
case 101 :
alert( 'Folder already exists' ) ;
break ;
case 102 :
alert( 'Invalid folder name' ) ;
break ;
case 103 :
alert( 'You have no permissions to create the folder' ) ;
break ;
case 110 :
alert( 'Unknown error creating folder' ) ;
break ;
default :
alert( 'Error creating folder. Error number: ' + iErrorNumber ) ;
break ;
}
*/
}
 
window.onload = function()
{
window.top.IsLoadedCreateFolder = true ;
}
</script>
</head>
<body bottomMargin="0" topMargin="0">
<table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr>
<td>
<button type="button" style="WIDTH: 100%" onclick="CreateFolder();">
<table cellSpacing="0" cellPadding="0" border="0">
<tr>
<td><img height="16" alt="" src="images/Folder.gif" width="16"></td>
<td>&nbsp;</td>
<td nowrap>Create New Folder</td>
</tr>
</table>
</button>
</td>
</tr>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/browser.css
New file
0,0 → 1,84
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: browser.css
* CSS styles used by all pages that compose the File Browser.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
body
{
background-color: #f1f1e3;
}
 
form
{
margin: 0px 0px 0px 0px ;
padding: 0px 0px 0px 0px ;
}
 
.Frame
{
background-color: #f1f1e3;
border-color: #f1f1e3;
border-right: thin inset;
border-top: thin inset;
border-left: thin inset;
border-bottom: thin inset;
}
 
body.FileArea
{
 
background-color: #ffffff;
}
 
body, td, input, select
{
font-size: 11px;
font-family: 'Microsoft Sans Serif' , Arial, Helvetica, Verdana;
}
 
.ActualFolder
{
font-weight: bold;
font-size: 14px;
}
 
.PopupButtons
{
border-top: #d5d59d 1px solid;
background-color: #e3e3c7;
padding: 7px 10px 7px 10px;
}
 
.Button, button
{
border-right: #737357 1px solid;
border-top: #737357 1px solid;
border-left: #737357 1px solid;
color: #3b3b1f;
border-bottom: #737357 1px solid;
background-color: #c7c78f;
}
 
.FolderListCurrentFolder img
{
background-image: url(images/FolderOpened.gif);
}
 
.FolderListFolder img
{
background-image: url(images/Folder.gif);
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/frmupload.html
New file
0,0 → 1,109
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: frmupload.html
* Page used to upload new files in the current folder.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="browser.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript">
 
function SetCurrentFolder( resourceType, folderPath )
{
var sUrl = oConnector.ConnectorUrl + 'Command=FileUpload' ;
sUrl += '&Type=' + resourceType ;
sUrl += '&CurrentFolder=' + escape( folderPath ) ;
document.getElementById('frmUpload').action = sUrl ;
}
 
function OnSubmit()
{
if ( document.getElementById('NewFile').value.length == 0 )
{
alert( 'Please select a file from your computer' ) ;
return false ;
}
 
// Set the interface elements.
document.getElementById('eUploadMessage').innerHTML = 'Upload a new file in this folder (Upload in progress, please wait...)' ;
document.getElementById('btnUpload').disabled = true ;
return true ;
}
 
function OnUploadCompleted( errorNumber, data )
{
// Reset the Upload Worker Frame.
window.parent.frames['frmUploadWorker'].location = '../../../../../fckblank.html' ;
// Reset the upload form (On IE we must do a little trick to avout problems).
if ( document.all )
document.getElementById('NewFile').outerHTML = '<input id="NewFile" name="NewFile" style="WIDTH: 100%" type="file">' ;
else
document.getElementById('frmUpload').reset() ;
// Reset the interface elements.
document.getElementById('eUploadMessage').innerHTML = 'Upload a new file in this folder' ;
document.getElementById('btnUpload').disabled = false ;
switch ( errorNumber )
{
case 0 :
window.parent.frames['frmResourcesList'].Refresh() ;
break ;
case 1 : // Custom error.
alert( data ) ;
break ;
case 201 :
window.parent.frames['frmResourcesList'].Refresh() ;
alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + data + '"' ) ;
break ;
case 202 :
alert( 'Invalid file' ) ;
break ;
default :
alert( 'Error on file upload. Error number: ' + errorNumber ) ;
break ;
}
}
 
window.onload = function()
{
window.top.IsLoadedUpload = true ;
}
</script>
</head>
<body bottommargin="0" topmargin="0">
<form id="frmUpload" action="" target="frmUploadWorker" method="post" enctype="multipart/form-data" onsubmit="return OnSubmit();">
<table height="100%" cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td nowrap="nowrap">
<span id="eUploadMessage">Upload a new file in this folder</span><br>
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td width="100%"><input id="NewFile" name="NewFile" style="WIDTH: 100%" type="file"></td>
<td nowrap="nowrap">&nbsp;<input id="btnUpload" type="submit" value="Upload"></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/js/fckxml.js
New file
0,0 → 1,116
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckxml.js
* Defines the FCKXml object that is used for XML data calls
* and XML processing.
* This script is shared by almost all pages that compose the
* File Browser frameset.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKXml = function()
{}
 
FCKXml.prototype.GetHttpRequest = function()
{
// Gecko / IE7
if ( typeof(XMLHttpRequest) != 'undefined' )
return new XMLHttpRequest() ;
 
// IE6
try { return new ActiveXObject("Msxml2.XMLHTTP") ; }
catch(e) {}
 
// IE5
try { return new ActiveXObject("Microsoft.XMLHTTP") ; }
catch(e) {}
}
 
FCKXml.prototype.LoadUrl = function( urlToCall, asyncFunctionPointer )
{
var oFCKXml = this ;
 
var bAsync = ( typeof(asyncFunctionPointer) == 'function' ) ;
 
var oXmlHttp = this.GetHttpRequest() ;
oXmlHttp.open( "GET", urlToCall, bAsync ) ;
if ( bAsync )
{
oXmlHttp.onreadystatechange = function()
{
if ( oXmlHttp.readyState == 4 )
{
oFCKXml.DOMDocument = oXmlHttp.responseXML ;
if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 )
asyncFunctionPointer( oFCKXml ) ;
else
alert( 'XML request error: ' + oXmlHttp.statusText + ' (' + oXmlHttp.status + ')' ) ;
}
}
}
oXmlHttp.send( null ) ;
if ( ! bAsync )
{
if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 )
this.DOMDocument = oXmlHttp.responseXML ;
else
{
alert( 'XML request error: ' + oXmlHttp.statusText + ' (' + oXmlHttp.status + ')' ) ;
}
}
}
 
FCKXml.prototype.SelectNodes = function( xpath )
{
if ( navigator.userAgent.indexOf('MSIE') >= 0 ) // IE
return this.DOMDocument.selectNodes( xpath ) ;
else // Gecko
{
var aNodeArray = new Array();
 
var xPathResult = this.DOMDocument.evaluate( xpath, this.DOMDocument,
this.DOMDocument.createNSResolver(this.DOMDocument.documentElement), XPathResult.ORDERED_NODE_ITERATOR_TYPE, null) ;
if ( xPathResult )
{
var oNode = xPathResult.iterateNext() ;
while( oNode )
{
aNodeArray[aNodeArray.length] = oNode ;
oNode = xPathResult.iterateNext();
}
}
return aNodeArray ;
}
}
 
FCKXml.prototype.SelectSingleNode = function( xpath )
{
if ( navigator.userAgent.indexOf('MSIE') >= 0 ) // IE
return this.DOMDocument.selectSingleNode( xpath ) ;
else // Gecko
{
var xPathResult = this.DOMDocument.evaluate( xpath, this.DOMDocument,
this.DOMDocument.createNSResolver(this.DOMDocument.documentElement), 9, null);
 
if ( xPathResult && xPathResult.singleNodeValue )
return xPathResult.singleNodeValue ;
else
return null ;
}
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/js/common.js
New file
0,0 → 1,51
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: common.js
* Common objects and functions shared by all pages that compose the
* File Browser dialog window.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
function AddSelectOption( selectElement, optionText, optionValue )
{
var oOption = document.createElement("OPTION") ;
 
oOption.text = optionText ;
oOption.value = optionValue ;
 
selectElement.options.add(oOption) ;
 
return oOption ;
}
 
var oConnector = window.parent.oConnector ;
var oIcons = window.parent.oIcons ;
 
 
function StringBuilder( value )
{
this._Strings = new Array( value || '' ) ;
}
 
StringBuilder.prototype.Append = function( value )
{
if ( value )
this._Strings.push( value ) ;
}
 
StringBuilder.prototype.ToString = function()
{
return this._Strings.join( '' ) ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/py/connector.py
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/py/connector.py
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/lasso/config.lasso
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/lasso/config.lasso
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/lasso/connector.lasso
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/lasso/connector.lasso
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/perl/commands.pl
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/perl/commands.pl
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/perl/connector.cgi
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/perl/connector.cgi
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/perl/io.pl
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/perl/io.pl
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/perl/upload_fck.pl
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/perl/upload_fck.pl
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/perl/basexml.pl
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/perl/basexml.pl
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/perl/util.pl
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/perl/util.pl
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/test.html
New file
0,0 → 1,177
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: test.html
* Test page for the File Browser connectors.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>FCKeditor - Connectors Tests</title>
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" />
<script type="text/javascript">
 
function BuildBaseUrl( command )
{
var sUrl =
document.getElementById('cmbConnector').value +
'?Command=' + command +
'&Type=' + document.getElementById('cmbType').value +
'&CurrentFolder=' + document.getElementById('txtFolder').value ;
return sUrl ;
}
 
function SetFrameUrl( url )
{
if ( document.all )
eRunningFrame.document.location = url ;
else
document.getElementById('eRunningFrame').src = url ;
document.getElementById('eUrl').innerHTML = url ;
}
 
function GetFolders()
{
SetFrameUrl( BuildBaseUrl( 'GetFolders' ) ) ;
return false ;
}
 
function GetFoldersAndFiles()
{
SetFrameUrl( BuildBaseUrl( 'GetFoldersAndFiles' ) ) ;
return false ;
}
 
function CreateFolder()
{
var sFolder = prompt( 'Type the folder name:', 'Test Folder' ) ;
if ( ! sFolder )
return ;
var sUrl = BuildBaseUrl( 'CreateFolder' ) ;
sUrl += '&NewFolderName=' + escape( sFolder ) ;
 
SetFrameUrl( sUrl ) ;
return false ;
}
 
function OnUploadCompleted( errorNumber, fileName )
{
switch ( errorNumber )
{
case 0 :
alert( 'File uploaded with no errors' ) ;
break ;
case 201 :
GetFoldersAndFiles()
alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + fileName + '"' ) ;
break ;
case 202 :
alert( 'Invalid file' ) ;
break ;
default :
alert( 'Error on file upload. Error number: ' + errorNumber ) ;
break ;
}
}
 
this.frames.frmUpload = this ;
 
function SetAction()
{
var sUrl = BuildBaseUrl( 'FileUpload' ) ;
document.getElementById('eUrl').innerHTML = sUrl ;
document.getElementById('frmUpload').action = sUrl ;
}
 
</script>
</head>
<body>
<table height="100%" cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
Connector:<br />
<select id="cmbConnector" name="cmbConnector">
<option value="asp/connector.asp" selected="selected">ASP</option>
<option value="aspx/connector.aspx">ASP.Net</option>
<option value="cfm/connector.cfm">ColdFusion</option>
<option value="lasso/connector.lasso">Lasso</option>
<option value="perl/connector.cgi">Perl</option>
<option value="php/connector.php">PHP</option>
<option value="py/connector.py">Python</option>
</select>
</td>
<td>
&nbsp;&nbsp;&nbsp;</td>
<td>
Current Folder<br />
<input id="txtFolder" type="text" value="/" name="txtFolder" /></td>
<td>
&nbsp;&nbsp;&nbsp;</td>
<td>
Resource Type<br />
<select id="cmbType" name="cmbType">
<option value="File" selected="selected">File</option>
<option value="Image">Image</option>
<option value="Flash">Flash</option>
<option value="Media">Media</option>
<option value="Invalid">Invalid Type (for testing)</option>
</select>
</td>
</tr>
</table>
<br />
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td valign="top">
<a href="#" onclick="GetFolders();">Get Folders</a></td>
<td>
&nbsp;&nbsp;&nbsp;</td>
<td valign="top">
<a href="#" onclick="GetFoldersAndFiles();">Get Folders and Files</a></td>
<td>
&nbsp;&nbsp;&nbsp;</td>
<td valign="top">
<a href="#" onclick="CreateFolder();">Create Folder</a></td>
<td>
&nbsp;&nbsp;&nbsp;</td>
<td valign="top">
<form id="frmUpload" action="" target="eRunningFrame" method="post" enctype="multipart/form-data">
File Upload<br />
<input id="txtFileUpload" type="file" name="NewFile" />
<input type="submit" value="Upload" onclick="SetAction();" />
</form>
</td>
</tr>
</table>
<br />
URL: <span id="eUrl"></span>
</td>
</tr>
<tr>
<td height="100%" valign="top">
<iframe id="eRunningFrame" src="../../../../fckblank.html" name="eRunningFrame" width="100%"
height="100%"></iframe>
</td>
</tr>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/asp/util.asp
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/asp/util.asp
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/asp/commands.asp
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/asp/commands.asp
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/asp/config.asp
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/asp/config.asp
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/asp/io.asp
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/asp/io.asp
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/asp/class_upload.asp
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/asp/class_upload.asp
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/asp/connector.asp
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/asp/connector.asp
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/asp/basexml.asp
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/asp/basexml.asp
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/cfm/config.cfm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/cfm/config.cfm
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/cfm/connector.cfm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/cfm/connector.cfm
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/php/connector.php
New file
0,0 → 1,109
<?php
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: connector.php
* This is the File Manager Connector for PHP.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
ob_start() ;
 
include('config.php') ;
include('util.php') ;
include('io.php') ;
include('basexml.php') ;
include('commands.php') ;
 
if ( !$Config['Enabled'] )
SendError( 1, 'This connector is disabled. Please check the "editor/filemanager/browser/default/connectors/php/config.php" file' ) ;
 
// Get the "UserFiles" path.
$GLOBALS["UserFilesPath"] = '' ;
 
if ( isset( $Config['UserFilesPath'] ) )
$GLOBALS["UserFilesPath"] = $Config['UserFilesPath'] ;
else if ( isset( $_GET['ServerPath'] ) )
$GLOBALS["UserFilesPath"] = $_GET['ServerPath'] ;
else
$GLOBALS["UserFilesPath"] = '/UserFiles/' ;
 
if ( ! ereg( '/$', $GLOBALS["UserFilesPath"] ) )
$GLOBALS["UserFilesPath"] .= '/' ;
 
if ( strlen( $Config['UserFilesAbsolutePath'] ) > 0 )
{
$GLOBALS["UserFilesDirectory"] = $Config['UserFilesAbsolutePath'] ;
 
if ( ! ereg( '/$', $GLOBALS["UserFilesDirectory"] ) )
$GLOBALS["UserFilesDirectory"] .= '/' ;
}
else
{
// Map the "UserFiles" path to a local directory.
$GLOBALS["UserFilesDirectory"] = GetRootPath() . $GLOBALS["UserFilesPath"] ;
}
 
DoResponse() ;
 
function DoResponse()
{
if ( !isset( $_GET['Command'] ) || !isset( $_GET['Type'] ) || !isset( $_GET['CurrentFolder'] ) )
return ;
 
// Get the main request informaiton.
$sCommand = $_GET['Command'] ;
$sResourceType = $_GET['Type'] ;
$sCurrentFolder = $_GET['CurrentFolder'] ;
 
// Check if it is an allowed type.
if ( !in_array( $sResourceType, array('File','Image','Flash','Media') ) )
return ;
 
// Check the current folder syntax (must begin and start with a slash).
if ( ! ereg( '/$', $sCurrentFolder ) ) $sCurrentFolder .= '/' ;
if ( strpos( $sCurrentFolder, '/' ) !== 0 ) $sCurrentFolder = '/' . $sCurrentFolder ;
// Check for invalid folder paths (..)
if ( strpos( $sCurrentFolder, '..' ) )
SendError( 102, "" ) ;
 
// File Upload doesn't have to Return XML, so it must be intercepted before anything.
if ( $sCommand == 'FileUpload' )
{
FileUpload( $sResourceType, $sCurrentFolder ) ;
return ;
}
 
CreateXmlHeader( $sCommand, $sResourceType, $sCurrentFolder ) ;
 
// Execute the required command.
switch ( $sCommand )
{
case 'GetFolders' :
GetFolders( $sResourceType, $sCurrentFolder ) ;
break ;
case 'GetFoldersAndFiles' :
GetFoldersAndFiles( $sResourceType, $sCurrentFolder ) ;
break ;
case 'CreateFolder' :
CreateFolder( $sResourceType, $sCurrentFolder ) ;
break ;
}
 
CreateXmlFooter() ;
 
exit ;
}
?>
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/php/basexml.php
New file
0,0 → 1,71
<?php
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: basexml.php
* These functions define the base of the XML response sent by the PHP
* connector.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
function SetXmlHeaders()
{
ob_end_clean() ;
 
// Prevent the browser from caching the result.
// Date in the past
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT') ;
// always modified
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT') ;
// HTTP/1.1
header('Cache-Control: no-store, no-cache, must-revalidate') ;
header('Cache-Control: post-check=0, pre-check=0', false) ;
// HTTP/1.0
header('Pragma: no-cache') ;
 
// Set the response format.
header( 'Content-Type:text/xml; charset=utf-8' ) ;
}
 
function CreateXmlHeader( $command, $resourceType, $currentFolder )
{
SetXmlHeaders() ;
// Create the XML document header.
echo '<?xml version="1.0" encoding="utf-8" ?>' ;
 
// Create the main "Connector" node.
echo '<Connector command="' . $command . '" resourceType="' . $resourceType . '">' ;
// Add the current folder node.
echo '<CurrentFolder path="' . ConvertToXmlAttribute( $currentFolder ) . '" url="' . ConvertToXmlAttribute( GetUrlFromPath( $resourceType, $currentFolder ) ) . '" />' ;
}
 
function CreateXmlFooter()
{
echo '</Connector>' ;
}
 
function SendError( $number, $text )
{
SetXmlHeaders() ;
// Create the XML document header
echo '<?xml version="1.0" encoding="utf-8" ?>' ;
echo '<Connector><Error number="' . $number . '" text="' . htmlspecialchars( $text ) . '" /></Connector>' ;
exit ;
}
?>
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/php/util.php
New file
0,0 → 1,37
<?php
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: util.php
* This is the File Manager Connector for ASP.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
function RemoveFromStart( $sourceString, $charToRemove )
{
$sPattern = '|^' . $charToRemove . '+|' ;
return preg_replace( $sPattern, '', $sourceString ) ;
}
 
function RemoveFromEnd( $sourceString, $charToRemove )
{
$sPattern = '|' . $charToRemove . '+$|' ;
return preg_replace( $sPattern, '', $sourceString ) ;
}
 
function ConvertToXmlAttribute( $value )
{
return utf8_encode( htmlspecialchars( $value ) ) ;
}
?>
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/php/commands.php
New file
0,0 → 1,218
<?php
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: commands.php
* This is the File Manager Connector for PHP.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
function GetFolders( $resourceType, $currentFolder )
{
// Map the virtual path to the local server path.
$sServerDir = ServerMapFolder( $resourceType, $currentFolder ) ;
 
// Array that will hold the folders names.
$aFolders = array() ;
 
$oCurrentFolder = opendir( $sServerDir ) ;
 
while ( $sFile = readdir( $oCurrentFolder ) )
{
if ( $sFile != '.' && $sFile != '..' && is_dir( $sServerDir . $sFile ) )
$aFolders[] = '<Folder name="' . ConvertToXmlAttribute( $sFile ) . '" />' ;
}
 
closedir( $oCurrentFolder ) ;
 
// Open the "Folders" node.
echo "<Folders>" ;
natcasesort( $aFolders ) ;
foreach ( $aFolders as $sFolder )
echo $sFolder ;
 
// Close the "Folders" node.
echo "</Folders>" ;
}
 
function GetFoldersAndFiles( $resourceType, $currentFolder )
{
// Map the virtual path to the local server path.
$sServerDir = ServerMapFolder( $resourceType, $currentFolder ) ;
 
// Arrays that will hold the folders and files names.
$aFolders = array() ;
$aFiles = array() ;
 
$oCurrentFolder = opendir( $sServerDir ) ;
 
while ( $sFile = readdir( $oCurrentFolder ) )
{
if ( $sFile != '.' && $sFile != '..' )
{
if ( is_dir( $sServerDir . $sFile ) )
$aFolders[] = '<Folder name="' . ConvertToXmlAttribute( $sFile ) . '" />' ;
else
{
$iFileSize = filesize( $sServerDir . $sFile ) ;
if ( $iFileSize > 0 )
{
$iFileSize = round( $iFileSize / 1024 ) ;
if ( $iFileSize < 1 ) $iFileSize = 1 ;
}
 
$aFiles[] = '<File name="' . ConvertToXmlAttribute( $sFile ) . '" size="' . $iFileSize . '" />' ;
}
}
}
 
// Send the folders
natcasesort( $aFolders ) ;
echo '<Folders>' ;
 
foreach ( $aFolders as $sFolder )
echo $sFolder ;
 
echo '</Folders>' ;
 
// Send the files
natcasesort( $aFiles ) ;
echo '<Files>' ;
 
foreach ( $aFiles as $sFiles )
echo $sFiles ;
 
echo '</Files>' ;
}
 
function CreateFolder( $resourceType, $currentFolder )
{
$sErrorNumber = '0' ;
$sErrorMsg = '' ;
 
if ( isset( $_GET['NewFolderName'] ) )
{
$sNewFolderName = $_GET['NewFolderName'] ;
 
if ( strpos( $sNewFolderName, '..' ) !== FALSE )
$sErrorNumber = '102' ; // Invalid folder name.
else
{
// Map the virtual path to the local server path of the current folder.
$sServerDir = ServerMapFolder( $resourceType, $currentFolder ) ;
 
if ( is_writable( $sServerDir ) )
{
$sServerDir .= $sNewFolderName ;
 
$sErrorMsg = CreateServerFolder( $sServerDir ) ;
 
switch ( $sErrorMsg )
{
case '' :
$sErrorNumber = '0' ;
break ;
case 'Invalid argument' :
case 'No such file or directory' :
$sErrorNumber = '102' ; // Path too long.
break ;
default :
$sErrorNumber = '110' ;
break ;
}
}
else
$sErrorNumber = '103' ;
}
}
else
$sErrorNumber = '102' ;
 
// Create the "Error" node.
echo '<Error number="' . $sErrorNumber . '" originalDescription="' . ConvertToXmlAttribute( $sErrorMsg ) . '" />' ;
}
 
function FileUpload( $resourceType, $currentFolder )
{
$sErrorNumber = '0' ;
$sFileName = '' ;
 
if ( isset( $_FILES['NewFile'] ) && !is_null( $_FILES['NewFile']['tmp_name'] ) )
{
global $Config ;
 
$oFile = $_FILES['NewFile'] ;
 
// Map the virtual path to the local server path.
$sServerDir = ServerMapFolder( $resourceType, $currentFolder ) ;
 
// Get the uploaded file name.
$sFileName = $oFile['name'] ;
// Replace dots in the name with underscores (only one dot can be there... security issue).
if ( $Config['ForceSingleExtension'] )
$sFileName = preg_replace( '/\\.(?![^.]*$)/', '_', $sFileName ) ;
 
$sOriginalFileName = $sFileName ;
 
// Get the extension.
$sExtension = substr( $sFileName, ( strrpos($sFileName, '.') + 1 ) ) ;
$sExtension = strtolower( $sExtension ) ;
 
$arAllowed = $Config['AllowedExtensions'][$resourceType] ;
$arDenied = $Config['DeniedExtensions'][$resourceType] ;
 
if ( ( count($arAllowed) == 0 || in_array( $sExtension, $arAllowed ) ) && ( count($arDenied) == 0 || !in_array( $sExtension, $arDenied ) ) )
{
$iCounter = 0 ;
 
while ( true )
{
$sFilePath = $sServerDir . $sFileName ;
 
if ( is_file( $sFilePath ) )
{
$iCounter++ ;
$sFileName = RemoveExtension( $sOriginalFileName ) . '(' . $iCounter . ').' . $sExtension ;
$sErrorNumber = '201' ;
}
else
{
move_uploaded_file( $oFile['tmp_name'], $sFilePath ) ;
 
if ( is_file( $sFilePath ) )
{
$oldumask = umask(0) ;
chmod( $sFilePath, 0777 ) ;
umask( $oldumask ) ;
}
 
break ;
}
}
}
else
$sErrorNumber = '202' ;
}
else
$sErrorNumber = '202' ;
 
echo '<script type="text/javascript">' ;
echo 'window.parent.frames["frmUpload"].OnUploadCompleted(' . $sErrorNumber . ',"' . str_replace( '"', '\\"', $sFileName ) . '") ;' ;
echo '</script>' ;
 
exit ;
}
?>
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/php/config.php
New file
0,0 → 1,51
<?php
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: config.php
* Configuration file for the File Manager Connector for PHP.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
global $Config ;
 
// SECURITY: You must explicitelly enable this "connector". (Set it to "true").
$Config['Enabled'] = false ;
 
// Path to user files relative to the document root.
$Config['UserFilesPath'] = '/UserFiles/' ;
 
// Fill the following value it you prefer to specify the absolute path for the
// user files directory. Usefull if you are using a virtual directory, symbolic
// link or alias. Examples: 'C:\\MySite\\UserFiles\\' or '/root/mysite/UserFiles/'.
// Attention: The above 'UserFilesPath' must point to the same directory.
$Config['UserFilesAbsolutePath'] = '' ;
 
// Due to security issues with Apache modules, it is reccomended to leave the
// following setting enabled.
$Config['ForceSingleExtension'] = true ;
 
$Config['AllowedExtensions']['File'] = array() ;
$Config['DeniedExtensions']['File'] = array('php','php2','php3','php4','php5','phtml','pwml','inc','asp','aspx','ascx','jsp','cfm','cfc','pl','bat','exe','com','dll','vbs','js','reg','cgi','htaccess') ;
 
$Config['AllowedExtensions']['Image'] = array('jpg','gif','jpeg','png') ;
$Config['DeniedExtensions']['Image'] = array() ;
 
$Config['AllowedExtensions']['Flash'] = array('swf','fla') ;
$Config['DeniedExtensions']['Flash'] = array() ;
 
$Config['AllowedExtensions']['Media'] = array('swf','fla','jpg','gif','jpeg','png','avi','mpg','mpeg') ;
$Config['DeniedExtensions']['Media'] = array() ;
 
?>
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/connectors/php/io.php
New file
0,0 → 1,97
<?php
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: io.php
* This is the File Manager Connector for ASP.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
function GetUrlFromPath( $resourceType, $folderPath )
{
if ( $resourceType == '' )
return RemoveFromEnd( $GLOBALS["UserFilesPath"], '/' ) . $folderPath ;
else
return $GLOBALS["UserFilesPath"] . $resourceType . $folderPath ;
}
 
function RemoveExtension( $fileName )
{
return substr( $fileName, 0, strrpos( $fileName, '.' ) ) ;
}
 
function ServerMapFolder( $resourceType, $folderPath )
{
// Get the resource type directory.
$sResourceTypePath = $GLOBALS["UserFilesDirectory"] . $resourceType . '/' ;
 
// Ensure that the directory exists.
CreateServerFolder( $sResourceTypePath ) ;
 
// Return the resource type directory combined with the required path.
return $sResourceTypePath . RemoveFromStart( $folderPath, '/' ) ;
}
 
function GetParentFolder( $folderPath )
{
$sPattern = "-[/\\\\][^/\\\\]+[/\\\\]?$-" ;
return preg_replace( $sPattern, '', $folderPath ) ;
}
 
function CreateServerFolder( $folderPath )
{
$sParent = GetParentFolder( $folderPath ) ;
 
// Check if the parent exists, or create it.
if ( !file_exists( $sParent ) )
{
$sErrorMsg = CreateServerFolder( $sParent ) ;
if ( $sErrorMsg != '' )
return $sErrorMsg ;
}
 
if ( !file_exists( $folderPath ) )
{
// Turn off all error reporting.
error_reporting( 0 ) ;
// Enable error tracking to catch the error.
ini_set( 'track_errors', '1' ) ;
 
// To create the folder with 0777 permissions, we need to set umask to zero.
$oldumask = umask(0) ;
mkdir( $folderPath, 0777 ) ;
umask( $oldumask ) ;
 
$sErrorMsg = $php_errormsg ;
 
// Restore the configurations.
ini_restore( 'track_errors' ) ;
ini_restore( 'error_reporting' ) ;
 
return $sErrorMsg ;
}
else
return '' ;
}
 
function GetRootPath()
{
$sRealPath = realpath( './' ) ;
 
$sSelfPath = $_SERVER['PHP_SELF'] ;
$sSelfPath = substr( $sSelfPath, 0, strrpos( $sSelfPath, '/' ) ) ;
 
return substr( $sRealPath, 0, strlen( $sRealPath ) - strlen( $sSelfPath ) ) ;
}
?>
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/frmactualfolder.html
New file
0,0 → 1,63
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: frmactualfolder.html
* This page shows the actual folder path.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link href="browser.css" type="text/css" rel="stylesheet">
<script type="text/javascript">
 
function OnResize()
{
divName.style.width = "1px" ;
divName.style.width = tdName.offsetWidth + "px" ;
}
 
function SetCurrentFolder( resourceType, folderPath )
{
document.getElementById('tdName').innerHTML = folderPath ;
}
 
window.onload = function()
{
window.top.IsLoadedActualFolder = true ;
}
 
</script>
</head>
<body bottomMargin="0" topMargin="0">
<table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr>
<td>
<button style="WIDTH: 100%" type="button">
<table cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr>
<td><img height="32" alt="" src="images/FolderOpened32.gif" width="32"></td>
<td>&nbsp;</td>
<td id="tdName" width="100%" nowrap class="ActualFolder">/</td>
<td>&nbsp;</td>
<td><img height="8" src="images/ButtonArrow.gif" width="12"></td>
<td>&nbsp;</td>
</tr>
</table>
</button>
</td>
</tr>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/browser/default/frmresourceslist.html
New file
0,0 → 1,150
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: frmresourceslist.html
* This page shows all resources available in a folder in the File Browser.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="browser.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript">
 
var oListManager = new Object() ;
 
oListManager.Clear = function()
{
document.body.innerHTML = '' ;
}
 
oListManager.GetFolderRowHtml = function( folderName, folderPath )
{
// Build the link to view the folder.
var sLink = '<a href="#" onclick="OpenFolder(\'' + folderPath.replace( /'/g, '\\\'') + '\');return false;">' ;
 
return '<tr>' +
'<td width="16">' +
sLink +
'<img alt="" src="images/Folder.gif" width="16" height="16" border="0"></a>' +
'</td><td nowrap colspan="2">&nbsp;' +
sLink +
folderName +
'</a>' +
'</td></tr>' ;
}
 
oListManager.GetFileRowHtml = function( fileName, fileUrl, fileSize )
{
// Build the link to view the folder.
var sLink = '<a href="#" onclick="OpenFile(\'' + fileUrl.replace( /'/g, '\\\'') + '\');return false;">' ;
 
// Get the file icon.
var sIcon = oIcons.GetIcon( fileName ) ;
 
return '<tr>' +
'<td width="16">' +
sLink +
'<img alt="" src="images/icons/' + sIcon + '.gif" width="16" height="16" border="0"></a>' +
'</td><td>&nbsp;' +
sLink +
fileName +
'</a>' +
'</td><td align="right" nowrap>&nbsp;' +
fileSize +
' KB' +
'</td></tr>' ;
}
 
function OpenFolder( folderPath )
{
// Load the resources list for this folder.
window.parent.frames['frmFolders'].LoadFolders( folderPath ) ;
}
 
function OpenFile( fileUrl )
{
window.top.opener.SetUrl( fileUrl ) ;
window.top.close() ;
window.top.opener.focus() ;
}
 
function LoadResources( resourceType, folderPath )
{
oListManager.Clear() ;
oConnector.ResourceType = resourceType ;
oConnector.CurrentFolder = folderPath ;
oConnector.SendCommand( 'GetFoldersAndFiles', null, GetFoldersAndFilesCallBack ) ;
}
 
function Refresh()
{
LoadResources( oConnector.ResourceType, oConnector.CurrentFolder ) ;
}
 
function GetFoldersAndFilesCallBack( fckXml )
{
if ( oConnector.CheckError( fckXml ) != 0 )
return ;
 
// Get the current folder path.
var oNode = fckXml.SelectSingleNode( 'Connector/CurrentFolder' ) ;
var sCurrentFolderPath = oNode.attributes.getNamedItem('path').value ;
var sCurrentFolderUrl = oNode.attributes.getNamedItem('url').value ;
 
// var dTimer = new Date() ;
 
var oHtml = new StringBuilder( '<table id="tableFiles" cellspacing="1" cellpadding="0" width="100%" border="0">' ) ;
 
// Add the Folders.
var oNodes = fckXml.SelectNodes( 'Connector/Folders/Folder' ) ;
for ( var i = 0 ; i < oNodes.length ; i++ )
{
var sFolderName = oNodes[i].attributes.getNamedItem('name').value ;
oHtml.Append( oListManager.GetFolderRowHtml( sFolderName, sCurrentFolderPath + sFolderName + "/" ) ) ;
}
 
// Add the Files.
var oNodes = fckXml.SelectNodes( 'Connector/Files/File' ) ;
for ( var i = 0 ; i < oNodes.length ; i++ )
{
var oNode = oNodes[i] ;
var sFileName = oNode.attributes.getNamedItem('name').value ;
var sFileSize = oNode.attributes.getNamedItem('size').value ;
 
// Get the optional "url" attribute. If not available, build the url.
var oFileUrlAtt = oNodes[i].attributes.getNamedItem('url') ;
var sFileUrl = oFileUrlAtt != null ? oFileUrlAtt.value : sCurrentFolderUrl + sFileName ;
oHtml.Append( oListManager.GetFileRowHtml( sFileName, sFileUrl, sFileSize ) ) ;
}
 
oHtml.Append( '</table>' ) ;
document.body.innerHTML = oHtml.ToString() ;
 
// window.top.document.title = 'Finished processing in ' + ( ( ( new Date() ) - dTimer ) / 1000 ) + ' seconds' ;
 
}
 
window.onload = function()
{
window.top.IsLoadedResourcesList = true ;
}
</script>
</head>
<body class="FileArea" bottommargin="10" leftmargin="10" topmargin="10" rightmargin="10">
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/upload/php/upload.php
New file
0,0 → 1,120
<?php
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: upload.php
* This is the "File Uploader" for PHP.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
require('config.php') ;
require('util.php') ;
 
// This is the function that sends the results of the uploading process.
function SendResults( $errorNumber, $fileUrl = '', $fileName = '', $customMsg = '' )
{
echo '<script type="text/javascript">' ;
echo 'window.parent.OnUploadCompleted(' . $errorNumber . ',"' . str_replace( '"', '\\"', $fileUrl ) . '","' . str_replace( '"', '\\"', $fileName ) . '", "' . str_replace( '"', '\\"', $customMsg ) . '") ;' ;
echo '</script>' ;
exit ;
}
 
// Check if this uploader has been enabled.
if ( !$Config['Enabled'] )
SendResults( '1', '', '', 'This file uploader is disabled. Please check the "editor/filemanager/upload/php/config.php" file' ) ;
 
// Check if the file has been correctly uploaded.
if ( !isset( $_FILES['NewFile'] ) || is_null( $_FILES['NewFile']['tmp_name'] ) || $_FILES['NewFile']['name'] == '' )
SendResults( '202' ) ;
 
// Get the posted file.
$oFile = $_FILES['NewFile'] ;
 
// Get the uploaded file name extension.
$sFileName = $oFile['name'] ;
 
// Replace dots in the name with underscores (only one dot can be there... security issue).
if ( $Config['ForceSingleExtension'] )
$sFileName = preg_replace( '/\\.(?![^.]*$)/', '_', $sFileName ) ;
 
$sOriginalFileName = $sFileName ;
 
// Get the extension.
$sExtension = substr( $sFileName, ( strrpos($sFileName, '.') + 1 ) ) ;
$sExtension = strtolower( $sExtension ) ;
 
// The the file type (from the QueryString, by default 'File').
$sType = isset( $_GET['Type'] ) ? $_GET['Type'] : 'File' ;
 
// Check if it is an allowed type.
if ( !in_array( $sType, array('File','Image','Flash','Media') ) )
SendResults( 1, '', '', 'Invalid type specified' ) ;
 
// Get the allowed and denied extensions arrays.
$arAllowed = $Config['AllowedExtensions'][$sType] ;
$arDenied = $Config['DeniedExtensions'][$sType] ;
 
// Check if it is an allowed extension.
if ( ( count($arAllowed) > 0 && !in_array( $sExtension, $arAllowed ) ) || ( count($arDenied) > 0 && in_array( $sExtension, $arDenied ) ) )
SendResults( '202' ) ;
 
$sErrorNumber = '0' ;
$sFileUrl = '' ;
 
// Initializes the counter used to rename the file, if another one with the same name already exists.
$iCounter = 0 ;
 
// Get the target directory.
if ( isset( $Config['UserFilesAbsolutePath'] ) && strlen( $Config['UserFilesAbsolutePath'] ) > 0 )
$sServerDir = $Config['UserFilesAbsolutePath'] ;
else
$sServerDir = GetRootPath() . $Config["UserFilesPath"] ;
 
if ( $Config['UseFileType'] )
$sServerDir .= $sType . '/' ;
 
while ( true )
{
// Compose the file path.
$sFilePath = $sServerDir . $sFileName ;
 
// If a file with that name already exists.
if ( is_file( $sFilePath ) )
{
$iCounter++ ;
$sFileName = RemoveExtension( $sOriginalFileName ) . '(' . $iCounter . ').' . $sExtension ;
$sErrorNumber = '201' ;
}
else
{
move_uploaded_file( $oFile['tmp_name'], $sFilePath ) ;
 
if ( is_file( $sFilePath ) )
{
$oldumask = umask(0) ;
chmod( $sFilePath, 0777 ) ;
umask( $oldumask ) ;
}
if ( $Config['UseFileType'] )
$sFileUrl = $Config["UserFilesPath"] . $sType . '/' . $sFileName ;
else
$sFileUrl = $Config["UserFilesPath"] . $sFileName ;
 
break ;
}
}
 
SendResults( $sErrorNumber, $sFileUrl, $sFileName ) ;
?>
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/upload/php/config.php
New file
0,0 → 1,52
<?php
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: config.php
* Configuration file for the PHP File Uploader.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
global $Config ;
 
// SECURITY: You must explicitelly enable this "uploader".
$Config['Enabled'] = false ;
 
// Set if the file type must be considere in the target path.
// Ex: /UserFiles/Image/ or /UserFiles/File/
$Config['UseFileType'] = false ;
 
// Path to uploaded files relative to the document root.
$Config['UserFilesPath'] = '/UserFiles/' ;
 
// Fill the following value it you prefer to specify the absolute path for the
// user files directory. Usefull if you are using a virtual directory, symbolic
// link or alias. Examples: 'C:\\MySite\\UserFiles\\' or '/root/mysite/UserFiles/'.
// Attention: The above 'UserFilesPath' must point to the same directory.
$Config['UserFilesAbsolutePath'] = '' ;
 
// Due to security issues with Apache modules, it is reccomended to leave the
// following setting enabled.
$Config['ForceSingleExtension'] = true ;
 
$Config['AllowedExtensions']['File'] = array() ;
$Config['DeniedExtensions']['File'] = array('php','php2','php3','php4','php5','phtml','pwml','inc','asp','aspx','ascx','jsp','cfm','cfc','pl','bat','exe','com','dll','vbs','js','reg','cgi') ;
 
$Config['AllowedExtensions']['Image'] = array('jpg','gif','jpeg','png') ;
$Config['DeniedExtensions']['Image'] = array() ;
 
$Config['AllowedExtensions']['Flash'] = array('swf','fla') ;
$Config['DeniedExtensions']['Flash'] = array() ;
 
?>
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/upload/php/util.php
New file
0,0 → 1,36
<?php
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: util.php
* This is the File Manager Connector for ASP.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
function RemoveExtension( $fileName )
{
return substr( $fileName, 0, strrpos( $fileName, '.' ) ) ;
}
 
function GetRootPath()
{
$sRealPath = realpath( './' ) ;
 
$sSelfPath = $_SERVER['PHP_SELF'] ;
$sSelfPath = substr( $sSelfPath, 0, strrpos( $sSelfPath, '/' ) ) ;
 
return substr( $sRealPath, 0, strlen( $sRealPath ) - strlen( $sSelfPath ) ) ;
}
 
?>
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/upload/aspx/upload.aspx
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/upload/aspx/upload.aspx
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/upload/lasso/upload.lasso
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/upload/lasso/upload.lasso
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/upload/lasso/config.lasso
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/upload/lasso/config.lasso
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/upload/test.html
New file
0,0 → 1,129
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: test.html
* Test page for the "File Uploaders".
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<html>
<head>
<title>FCKeditor - Uploaders Tests</title>
<script language="javascript">
 
function SendFile()
{
var sUploaderUrl = cmbUploaderUrl.value ;
if ( sUploaderUrl.length == 0 )
sUploaderUrl = txtCustomUrl.value ;
if ( sUploaderUrl.length == 0 )
{
alert( 'Please provide your custom URL or select a default one' ) ;
return ;
}
eURL.innerHTML = sUploaderUrl ;
txtUrl.value = '' ;
frmUpload.action = sUploaderUrl ;
frmUpload.submit() ;
}
 
function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
{
switch ( errorNumber )
{
case 0 : // No errors
txtUrl.value = fileUrl ;
alert( 'File uploaded with no errors' ) ;
break ;
case 1 : // Custom error
alert( customMsg ) ;
break ;
case 10 : // Custom warning
txtUrl.value = fileUrl ;
alert( customMsg ) ;
break ;
case 201 :
txtUrl.value = fileUrl ;
alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + fileName + '"' ) ;
break ;
case 202 :
alert( 'Invalid file' ) ;
break ;
case 203 :
alert( "Security error. You probably don't have enough permissions to upload. Please check your server." ) ;
break ;
default :
alert( 'Error on file upload. Error number: ' + errorNumber ) ;
break ;
}
}
 
</script>
</head>
<body>
<table cellSpacing="0" cellPadding="0" width="100%" border="0" height="100%">
<tr>
<td>
<table cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr>
<td nowrap>
Select the "File Uploader" to use:<br>
<select id="cmbUploaderUrl">
<option selected value="asp/upload.asp">ASP</option>
<option value="aspx/upload.aspx">ASP.Net</option>
<option value="cfm/upload.cfm">ColdFusion</option>
<option value="lasso/upload.lasso">Lasso</option>
<option value="php/upload.php">PHP</option>
<option value="">(Custom)</option>
</select>
</td>
<td nowrap>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td width="100%">
Custom Uploader URL:<BR>
<input id="txtCustomUrl" style="WIDTH: 100%; BACKGROUND-COLOR: #dcdcdc" disabled type="text">
</td>
</tr>
</table>
<br>
<table cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr>
<td noWrap>
<form id="frmUpload" target="UploadWindow" enctype="multipart/form-data" action="" method="post">
Upload a new file:<br>
<input type="file" name="NewFile"><br>
<input type="button" value="Send it to the Server" onclick="SendFile();">
</form>
</td>
<td style="WIDTH: 16px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td vAlign="top" width="100%">
Uploaded File URL:<br>
<INPUT id="txtUrl" style="WIDTH: 100%" readonly type="text">
</td>
</tr>
</table>
<br>
Post URL: <span id="eURL">&nbsp;</span>
</td>
</tr>
<tr>
<td height="100%">
<iframe name="UploadWindow" width="100%" height="100%" src="../../fckblank.html"></iframe>
</td>
</tr>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/upload/asp/upload.asp
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/upload/asp/upload.asp
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/upload/asp/config.asp
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/upload/asp/config.asp
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/upload/asp/io.asp
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/upload/asp/io.asp
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/upload/asp/class_upload.asp
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/upload/asp/class_upload.asp
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/upload/cfm/upload.cfm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/upload/cfm/upload.cfm
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/upload/cfm/config.cfm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/filemanager/upload/cfm/config.cfm
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/js/fckeditorcode_gecko.js
New file
0,0 → 1,80
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* This file has been compacted for best loading performance.
*/
var FCK_STATUS_NOTLOADED=window.parent.FCK_STATUS_NOTLOADED=0;var FCK_STATUS_ACTIVE=window.parent.FCK_STATUS_ACTIVE=1;var FCK_STATUS_COMPLETE=window.parent.FCK_STATUS_COMPLETE=2;var FCK_TRISTATE_OFF=window.parent.FCK_TRISTATE_OFF=0;var FCK_TRISTATE_ON=window.parent.FCK_TRISTATE_ON=1;var FCK_TRISTATE_DISABLED=window.parent.FCK_TRISTATE_DISABLED=-1;var FCK_UNKNOWN=window.parent.FCK_UNKNOWN=-9;var FCK_TOOLBARITEM_ONLYICON=window.parent.FCK_TOOLBARITEM_ONLYICON=0;var FCK_TOOLBARITEM_ONLYTEXT=window.parent.FCK_TOOLBARITEM_ONLYTEXT=1;var FCK_TOOLBARITEM_ICONTEXT=window.parent.FCK_TOOLBARITEM_ICONTEXT=2;var FCK_EDITMODE_WYSIWYG=window.parent.FCK_EDITMODE_WYSIWYG=0;var FCK_EDITMODE_SOURCE=window.parent.FCK_EDITMODE_SOURCE=1;var FCK_IMAGES_PATH='images/';var FCK_SPACER_PATH='images/spacer.gif';
String.prototype.Contains=function(A){return (this.indexOf(A)>-1);};String.prototype.Equals=function(){for (var i=0;i<arguments.length;i++) if (this==arguments[i]) return true;return false;};String.prototype.ReplaceAll=function(A,B){var C=this;for (var i=0;i<A.length;i++){C=C.replace(A[i],B[i]);};return C;};Array.prototype.AddItem=function(A){var i=this.length;this[i]=A;return i;};Array.prototype.indexOf=function(A){for (var i=0;i<this.length;i++){if (this[i]==A) return i;};return-1;};String.prototype.startsWith=function(A){return (this.substr(0,A.length)==A);};String.prototype.endsWith=function(A,B){var C=this.length;var D=A.length;if (D>C) return false;if (B){var E=new RegExp(A+'$','i');return E.test(this);}else return (D==0||this.substr(C-D,D)==A);};String.prototype.remove=function(A,B){var s='';if (A>0) s=this.substring(0,A);if (A+B<this.length) s+=this.substring(A+B,this.length);return s;};String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,'');};String.prototype.ltrim=function(){return this.replace(/^\s*/g,'');};String.prototype.rtrim=function(){return this.replace(/\s*$/g,'');};String.prototype.replaceNewLineChars=function(A){return this.replace(/\n/g,A);}
var s=navigator.userAgent.toLowerCase();var FCKBrowserInfo={IsIE:s.Contains('msie'),IsIE7:s.Contains('msie 7'),IsGecko:s.Contains('gecko/'),IsSafari:s.Contains('safari'),IsOpera:s.Contains('opera')};FCKBrowserInfo.IsGeckoLike=FCKBrowserInfo.IsGecko||FCKBrowserInfo.IsSafari||FCKBrowserInfo.IsOpera;if (FCKBrowserInfo.IsGecko){var sGeckoVersion=s.match(/gecko\/(\d+)/)[1];FCKBrowserInfo.IsGecko10=sGeckoVersion<20051111;}
var FCKURLParams=new Object();var aParams=document.location.search.substr(1).split('&');for (var i=0;i<aParams.length;i++){var aParam=aParams[i].split('=');var sParamName=aParam[0];var sParamValue=aParam[1];FCKURLParams[sParamName]=sParamValue;}
var FCK=new Object();FCK.Name=FCKURLParams['InstanceName'];FCK.Status=FCK_STATUS_NOTLOADED;FCK.EditMode=FCK_EDITMODE_WYSIWYG;FCK.LoadLinkedFile=function(){var A=window.parent.document;var B=A.getElementById(FCK.Name);var C=A.getElementsByName(FCK.Name);var i=0;while (B||i==0){if (B&&(B.tagName.toLowerCase()=='input'||B.tagName.toLowerCase()=='textarea')){FCK.LinkedField=B;break;};B=C[i++];}};FCK.LoadLinkedFile();var FCKTempBin=new Object();FCKTempBin.Elements=new Array();FCKTempBin.AddElement=function(A){var B=this.Elements.length;this.Elements[B]=A;return B;};FCKTempBin.RemoveElement=function(A){var e=this.Elements[A];this.Elements[A]=null;return e;};FCKTempBin.Reset=function(){var i=0;while (i<this.Elements.length) this.Elements[i++]==null;this.Elements.length=0;}
var FCKConfig=FCK.Config=new Object();if (document.location.protocol=='file:'){FCKConfig.BasePath=unescape(document.location.pathname.substr(1));FCKConfig.BasePath=FCKConfig.BasePath.replace(/\\/gi, '/');FCKConfig.BasePath='file://'+FCKConfig.BasePath.substring(0,FCKConfig.BasePath.lastIndexOf('/')+1);FCKConfig.FullBasePath=FCKConfig.BasePath;}else{FCKConfig.BasePath=document.location.pathname.substring(0,document.location.pathname.lastIndexOf('/')+1);FCKConfig.FullBasePath=document.location.protocol+'//'+document.location.host+FCKConfig.BasePath;};FCKConfig.EditorPath=FCKConfig.BasePath.replace(/editor\/$/,'');try{FCKConfig.ScreenWidth=screen.width;FCKConfig.ScreenHeight=screen.height;}catch (e){FCKConfig.ScreenWidth=800;FCKConfig.ScreenHeight=600;};FCKConfig.ProcessHiddenField=function(){this.PageConfig=new Object();var A=window.parent.document.getElementById(FCK.Name+'___Config');if (!A) return;var B=A.value.split('&');for (var i=0;i<B.length;i++){if (B[i].length==0) continue;var C=B[i].split('=');var D=unescape(C[0]);var E=unescape(C[1]);if (D=='CustomConfigurationsPath') FCKConfig[D]=E;else if (E.toLowerCase()=="true") this.PageConfig[D]=true;else if (E.toLowerCase()=="false") this.PageConfig[D]=false;else if (E.length>0&&!isNaN(E)) this.PageConfig[D]=parseInt(E);else this.PageConfig[D]=E;}};function FCKConfig_LoadPageConfig(){var oPageConfig=FCKConfig.PageConfig;for (var sKey in oPageConfig) FCKConfig[sKey]=oPageConfig[sKey];};function FCKConfig_PreProcess(){var oConfig=FCKConfig;if (oConfig.AllowQueryStringDebug){try{if ((/fckdebug=true/i).test(window.top.location.search)) oConfig.Debug=true;}catch (e) { /* Ignore it. Much probably we are inside a FRAME where the "top" is in another domain (security error). */ }};if (!oConfig.PluginsPath.endsWith('/')) oConfig.PluginsPath+='/';if (typeof(oConfig.EditorAreaCSS)=='string') oConfig.EditorAreaCSS=[oConfig.EditorAreaCSS];var sComboPreviewCSS=oConfig.ToolbarComboPreviewCSS;if (!sComboPreviewCSS||sComboPreviewCSS.length==0) oConfig.ToolbarComboPreviewCSS=oConfig.EditorAreaCSS;else if (typeof(sComboPreviewCSS)=='string') oConfig.ToolbarComboPreviewCSS=[sComboPreviewCSS];};FCKConfig.ToolbarSets=new Object();FCKConfig.Plugins=new Object();FCKConfig.Plugins.Items=new Array();FCKConfig.Plugins.Add=function(A,B,C){FCKConfig.Plugins.Items.AddItem([A,B,C]);};FCKConfig.ProtectedSource=new Object();FCKConfig.ProtectedSource.RegexEntries=[/<!--[\s\S]*?-->/g,/<script[\s\S]*?<\/script>/gi,/<noscript[\s\S]*?<\/noscript>/gi];FCKConfig.ProtectedSource.Add=function(A){this.RegexEntries.AddItem(A);};FCKConfig.ProtectedSource.Protect=function(A){function _Replace(protectedSource){var B=FCKTempBin.AddElement(protectedSource);return '<!--{PS..'+B+'}-->';};for (var i=0;i<this.RegexEntries.length;i++){A=A.replace(this.RegexEntries[i],_Replace);};return A;};FCKConfig.ProtectedSource.Revert=function(A,B){function _Replace(m,opener,index){var C=B?FCKTempBin.RemoveElement(index):FCKTempBin.Elements[index];return FCKConfig.ProtectedSource.Revert(C,B);};return A.replace(/(<|&lt;)!--\{PS..(\d+)\}--(>|&gt;)/g,_Replace);}
var FCKDebug=new Object();FCKDebug.Output=function(A,B,C){if (!FCKConfig.Debug) return;if (!C&&A!=null&&isNaN(A)) A=A.replace(/</g,"&lt;");if (!this.DebugWindow||this.DebugWindow.closed) this.DebugWindow=window.open(FCKConfig.BasePath+'fckdebug.html','FCKeditorDebug','menubar=no,scrollbars=no,resizable=yes,location=no,toolbar=no,width=600,height=500',true);if (this.DebugWindow&&this.DebugWindow.Output){try{this.DebugWindow.Output(A,B);}catch (e) {}}};FCKDebug.OutputObject=function(A,B){if (!FCKConfig.Debug) return;var C;if (A!=null){C='Properties of: '+A+'</b><blockquote>';for (var D in A){try{var E=A[D]?A[D]+'':'[null]';C+='<b>'+D+'</b> : '+E.replace(/</g,'&lt;')+'<br>';}catch (e){try{C+='<b>'+D+'</b> : ['+typeof(A[D])+']<br>';}catch (e){C+='<b>'+D+'</b> : [-error-]<br>';}}};C+='</blockquote><b>';} else C='OutputObject : Object is "null".';FCKDebug.Output(C,B,true);}
var FCKTools=new Object();FCKTools.AppendStyleSheet=function(A,B){if (typeof(B)=='string') return this._AppendStyleSheet(A,B);else{for (var i=0;i<B.length;i++) this._AppendStyleSheet(A,B[i]);}};FCKTools.GetLinkedFieldValue=function(){return FCK.LinkedField.value;};FCKTools.AttachToLinkedFieldFormSubmit=function(A){var B=FCK.LinkedField.form;if (!B) return;if (FCKBrowserInfo.IsIE) B.attachEvent("onsubmit",A);else B.addEventListener('submit',A,false);if (!B.updateFCKeditor) B.updateFCKeditor=new Array();B.updateFCKeditor[B.updateFCKeditor.length]=A;if (!B.originalSubmit&&(typeof(B.submit)=='function'||(!B.submit.tagName&&!B.submit.length))){B.originalSubmit=B.submit;B.submit=FCKTools_SubmitReplacer;}};function FCKTools_SubmitReplacer(){if (this.updateFCKeditor){for (var i=0;i<this.updateFCKeditor.length;i++) this.updateFCKeditor[i]();};this.originalSubmit();};FCKTools.GetElementWindow=function(A){return this.GetDocumentWindow(this.GetElementDocument(A));};FCKTools.GetDocumentWindow=function(A){if (FCKBrowserInfo.IsSafari&&!A.parentWindow) this.FixDocumentParentWindow(window.top);return A.parentWindow||A.defaultView;};FCKTools.FixDocumentParentWindow=function(A){A.document.parentWindow=A;for (var i=0;i<A.frames.length;i++) FCKTools.FixDocumentParentWindow(A.frames[i]);};FCKTools.GetParentWindow=function(A){return A.contentWindow?A.contentWindow:A.parentWindow;};FCKTools.HTMLEncode=function(A){if (!A) return '';A=A.replace(/&/g,'&amp;');A=A.replace(/</g,'&lt;');A=A.replace(/>/g,'&gt;');return A;};FCKTools.AddSelectOption=function(A,B,C){var D=FCKTools.GetElementDocument(A).createElement("OPTION");D.text=B;D.value=C;A.options.add(D);return D;};FCKTools.RunFunction=function(A,B,C,D){if (A) this.SetTimeout(A,0,B,C,D);};FCKTools.SetTimeout=function(A,B,C,D,E){return (E||window).setTimeout(function(){if (D) A.apply(C,[].concat(D));else A.apply(C);},B);};FCKTools.SetInterval=function(A,B,C,D,E){return (E||window).setInterval(function(){A.apply(C,D||[]);},B);};FCKTools.ConvertStyleSizeToHtml=function(A){return A.endsWith('%')?A:parseInt(A);};FCKTools.ConvertHtmlSizeToStyle=function(A){return A.endsWith('%')?A:(A+'px');};FCKTools.GetElementAscensor=function(A,B){var e=A;var C=","+B.toUpperCase()+",";while (e){if (C.indexOf(","+e.nodeName.toUpperCase()+",")!=-1) return e;e=e.parentNode;};return null;};FCKTools.CreateEventListener=function(A,B){var f=function(){var C=[];for (var i=0;i<arguments.length;i++) C.push(arguments[i]);A.apply(this,C.concat(B));};return f;};FCKTools.GetElementDocument=function (A){return A.ownerDocument||A.document;}
var GECKO_BOGUS=FCKBrowserInfo.IsGecko?'<br _moz_editor_bogus_node="TRUE">':'';FCKTools.CancelEvent=function(e){if (e) e.preventDefault();};FCKTools.DisableSelection=function(A){if (FCKBrowserInfo.IsGecko) A.style.MozUserSelect='none';else A.style.userSelect='none';};FCKTools._AppendStyleSheet=function(A,B){var e=A.createElement('LINK');e.rel='stylesheet';e.type='text/css';e.href=B;A.getElementsByTagName("HEAD")[0].appendChild(e);return e;};FCKTools.ClearElementAttributes=function(A){for (var i=0;i<A.attributes.length;i++){A.removeAttribute(A.attributes[i].name,0);}};FCKTools.GetAllChildrenIds=function(A){var B=new Array();var C=function(parent){for (var i=0;i<parent.childNodes.length;i++){var D=parent.childNodes[i].id;if (D&&D.length>0) B[B.length]=D;C(parent.childNodes[i]);}};C(A);return B;};FCKTools.RemoveOuterTags=function(e){var A=e.ownerDocument.createDocumentFragment();for (var i=0;i<e.childNodes.length;i++) A.appendChild(e.childNodes[i]);e.parentNode.replaceChild(A,e);};FCKTools.CreateXmlObject=function(A){switch (A){case 'XmlHttp':return new XMLHttpRequest();case 'DOMDocument':return document.implementation.createDocument('','',null);};return null;};FCKTools.GetScrollPosition=function(A){return { X:A.pageXOffset,Y:A.pageYOffset };};FCKTools.AddEventListener=function(A,B,C){A.addEventListener(B,C,false);};FCKTools.RemoveEventListener=function(A,B,C){A.removeEventListener(B,C,false);};FCKTools.AddEventListenerEx=function(A,B,C,D){A.addEventListener(B,function(e){C.apply(A,[e].concat(D||[]));},false);};FCKTools.GetViewPaneSize=function(A){return { Width:A.innerWidth,Height:A.innerHeight };};FCKTools.SaveStyles=function(A){var B=new Object();if (A.className.length>0){B.Class=A.className;A.className='';};var C=A.getAttribute('style');if (C&&C.length>0){B.Inline=C;A.setAttribute('style','',0);};return B;};FCKTools.RestoreStyles=function(A,B){A.className=B.Class||'';if (B.Inline) A.setAttribute('style',B.Inline,0);else A.removeAttribute('style',0);};FCKTools.RegisterDollarFunction=function(A){A.$=function(id){return this.document.getElementById(id);};};FCKTools.AppendElement=function(A,B){return A.appendChild(A.ownerDocument.createElement(B));};FCKTools.GetElementPosition=function(A,B){var c={ X:0,Y:0 };var C=B||window;var D=FCKTools.GetElementWindow(A);while (A){var E=D.getComputedStyle(A,'').position;if (E&&E!='static'&&A.style.zIndex!=FCKConfig.FloatingPanelsZIndex) break;c.X+=A.offsetLeft-A.scrollLeft;c.Y+=A.offsetTop-A.scrollTop;if (A.offsetParent) A=A.offsetParent;else{if (D!=C){if (A=D.frameElement) D=FCKTools.GetElementWindow(A);}else{c.X+=A.scrollLeft;c.Y+=A.scrollTop;break;}}};return c;}
var FCKeditorAPI;function InitializeAPI(){if (!(FCKeditorAPI=window.parent.FCKeditorAPI)){var sScript='\ var FCKeditorAPI={\ Version:\'2.3.2\',\ VersionBuild:\'1082\',\ __Instances:new Object(),\ GetInstance:function(instanceName)\{\ return this.__Instances[instanceName];\},\ _FunctionQueue:{\ Functions:new Array(),\ IsRunning:false,\ Add:function(functionToAdd)\{\ this.Functions.push(functionToAdd);\ if (!this.IsRunning)\ this.StartNext();\},\ StartNext:function()\{\ var aQueue=this.Functions;\ if (aQueue.length>0)\{\ this.IsRunning=true;\ aQueue[0].call();\}\ else\ this.IsRunning=false;\},\ Remove:function(func)\{\ var aQueue=this.Functions;\ var i=0,fFunc;\ while(fFunc=aQueue[i])\{\ if (fFunc==func)\ aQueue.splice(i,1);\ i++;\}\ this.StartNext();\}\}\}';if (window.parent.execScript) window.parent.execScript(sScript,'JavaScript');else{if (FCKBrowserInfo.IsGecko10){eval.call(window.parent,sScript);}else window.parent.eval(sScript);};FCKeditorAPI=window.parent.FCKeditorAPI;};FCKeditorAPI.__Instances[FCK.Name]=FCK;};function FCKeditorAPI_Cleanup(){FCKeditorAPI.__Instances[FCK.Name]=null;};FCKTools.AddEventListener(window,'unload',FCKeditorAPI_Cleanup);
var FCKRegexLib={AposEntity:/&apos;/gi,ObjectElements:/^(?:IMG|TABLE|TR|TD|TH|INPUT|SELECT|TEXTAREA|HR|OBJECT|A|UL|OL|LI)$/i,BlockElements:/^(?:P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TD|TH)$/i,EmptyElements:/^(?:BASE|META|LINK|HR|BR|PARAM|IMG|AREA|INPUT)$/i,NamedCommands:/^(?:Cut|Copy|Paste|Print|SelectAll|RemoveFormat|Unlink|Undo|Redo|Bold|Italic|Underline|StrikeThrough|Subscript|Superscript|JustifyLeft|JustifyCenter|JustifyRight|JustifyFull|Outdent|Indent|InsertOrderedList|InsertUnorderedList|InsertHorizontalRule)$/i,BodyContents:/([\s\S]*\<body[^\>]*\>)([\s\S]*)(\<\/body\>[\s\S]*)/i,ToReplace:/___fcktoreplace:([\w]+)/ig,MetaHttpEquiv:/http-equiv\s*=\s*["']?([^"' ]+)/i,HasBaseTag:/<base /i,HtmlOpener:/<html\s?[^>]*>/i,HeadOpener:/<head\s?[^>]*>/i,HeadCloser:/<\/head\s*>/i,TableBorderClass:/\s*FCK__ShowTableBorders\s*/,ElementName:/(^[A-Za-z_:][\w.\-:]*\w$)|(^[A-Za-z_]$)/,ForceSimpleAmpersand:/___FCKAmp___/g,SpaceNoClose:/\/>/g,EmptyParagraph:/^<(p|div)>\s*<\/\1>$/i,TagBody:/></,StrongOpener:/<STRONG([ \>])/gi,StrongCloser:/<\/STRONG>/gi,EmOpener:/<EM([ \>])/gi,EmCloser:/<\/EM>/gi,AbbrOpener:/<ABBR([ \>])/gi,AbbrCloser:/<\/ABBR>/gi,GeckoEntitiesMarker:/#\?-\:/g,ProtectUrlsImg:/(?:(<img(?=\s).*?\ssrc=)("|')(.*?)\2)|(?:(<img\s.*?src=)([^"'][^ >]+))/gi,ProtectUrlsA:/(?:(<a(?=\s).*?\shref=)("|')(.*?)\2)|(?:(<a\s.*?href=)([^"'][^ >]+))/gi,Html4DocType:/HTML 4\.0 Transitional/i,DocTypeTag:/<!DOCTYPE[^>]*>/i,TagsWithEvent:/<[^\>]+ on\w+[\s\r\n]*=[\s\r\n]*?('|")[\s\S]+?\>/g,EventAttributes:/\s(on\w+)[\s\r\n]*=[\s\r\n]*?('|")([\s\S]*?)\2/g,ProtectedEvents:/\s\w+_fckprotectedatt="([^"]+)"/g}
var FCKLanguageManager=FCK.Language=new Object();FCKLanguageManager.AvailableLanguages={'ar':'Arabic','bg':'Bulgarian','bn':'Bengali/Bangla','bs':'Bosnian','ca':'Catalan','cs':'Czech','da':'Danish','de':'German','el':'Greek','en':'English','en-au':'English (Australia)','en-ca':'English (Canadian)','en-uk':'English (United Kingdom)','eo':'Esperanto','es':'Spanish','et':'Estonian','eu':'Basque','fa':'Persian','fi':'Finnish','fo':'Faroese','fr':'French','gl':'Galician','he':'Hebrew','hi':'Hindi','hr':'Croatian','hu':'Hungarian','it':'Italian','ja':'Japanese','km':'Khmer','ko':'Korean','lt':'Lithuanian','lv':'Latvian','mn':'Mongolian','ms':'Malay','nb':'Norwegian Bokmal','nl':'Dutch','no':'Norwegian','pl':'Polish','pt':'Portuguese (Portugal)','pt-br':'Portuguese (Brazil)','ro':'Romanian','ru':'Russian','sk':'Slovak','sl':'Slovenian','sr':'Serbian (Cyrillic)','sr-latn':'Serbian (Latin)','sv':'Swedish','th':'Thai','tr':'Turkish','uk':'Ukrainian','vi':'Vietnamese','zh':'Chinese Traditional','zh-cn':'Chinese Simplified'};FCKLanguageManager.GetActiveLanguage=function(){if (FCKConfig.AutoDetectLanguage){var A;if (navigator.userLanguage) A=navigator.userLanguage.toLowerCase();else if (navigator.language) A=navigator.language.toLowerCase();else{return FCKConfig.DefaultLanguage;};if (A.length>=5){A=A.substr(0,5);if (this.AvailableLanguages[A]) return A;};if (A.length>=2){A=A.substr(0,2);if (this.AvailableLanguages[A]) return A;}};return this.DefaultLanguage;};FCKLanguageManager.TranslateElements=function(A,B,C,D){var e=A.getElementsByTagName(B);var E,s;for (var i=0;i<e.length;i++){if (E=e[i].getAttribute('fckLang')){if (s=FCKLang[E]){if (D) s=FCKTools.HTMLEncode(s);eval('e[i].'+C+' = s');}}}};FCKLanguageManager.TranslatePage=function(A){this.TranslateElements(A,'INPUT','value');this.TranslateElements(A,'SPAN','innerHTML');this.TranslateElements(A,'LABEL','innerHTML');this.TranslateElements(A,'OPTION','innerHTML',true);};FCKLanguageManager.Initialize=function(){if (this.AvailableLanguages[FCKConfig.DefaultLanguage]) this.DefaultLanguage=FCKConfig.DefaultLanguage;else this.DefaultLanguage='en';this.ActiveLanguage=new Object();this.ActiveLanguage.Code=this.GetActiveLanguage();this.ActiveLanguage.Name=this.AvailableLanguages[this.ActiveLanguage.Code];}
var FCKEvents;FCKEvents=function(A){this.Owner=A;this.RegisteredEvents=new Object();};FCKEvents.prototype.AttachEvent=function(A,B){var C;if (!(C=this.RegisteredEvents[A])) this.RegisteredEvents[A]=[B];else C.push(B);};FCKEvents.prototype.FireEvent=function(A,B){var C=true;var D=this.RegisteredEvents[A];if (D){for (var i=0;i<D.length;i++) C=(D[i](this.Owner,B)&&C);};return C;}
var FCKXHtmlEntities=new Object();FCKXHtmlEntities.Initialize=function(){if (FCKXHtmlEntities.Entities) return;var A='';if (FCKConfig.ProcessHTMLEntities){FCKXHtmlEntities.Entities={' ':'nbsp','¡':'iexcl','¢':'cent','£':'pound','¤':'curren','¥':'yen','¦':'brvbar','§':'sect','¨':'uml','©':'copy','ª':'ordf','«':'laquo','¬':'not','­':'shy','®':'reg','¯':'macr','°':'deg','±':'plusmn','²':'sup2','³':'sup3','´':'acute','µ':'micro','¶':'para','·':'middot','¸':'cedil','¹':'sup1','º':'ordm','»':'raquo','¼':'frac14','½':'frac12','¾':'frac34','¿':'iquest','×':'times','÷':'divide','ƒ':'fnof','•':'bull','…':'hellip','′':'prime','″':'Prime','‾':'oline','⁄':'frasl','℘':'weierp','ℑ':'image','ℜ':'real','™':'trade','ℵ':'alefsym','←':'larr','↑':'uarr','→':'rarr','↓':'darr','↔':'harr','↵':'crarr','⇐':'lArr','⇑':'uArr','⇒':'rArr','⇓':'dArr','⇔':'hArr','∀':'forall','∂':'part','∃':'exist','∅':'empty','∇':'nabla','∈':'isin','∉':'notin','∋':'ni','∏':'prod','∑':'sum','−':'minus','∗':'lowast','√':'radic','∝':'prop','∞':'infin','∠':'ang','∧':'and','∨':'or','∩':'cap','∪':'cup','∫':'int','∴':'there4','∼':'sim','≅':'cong','≈':'asymp','≠':'ne','≡':'equiv','≤':'le','≥':'ge','⊂':'sub','⊃':'sup','⊄':'nsub','⊆':'sube','⊇':'supe','⊕':'oplus','⊗':'otimes','⊥':'perp','⋅':'sdot','◊':'loz','♠':'spades','♣':'clubs','♥':'hearts','♦':'diams','"':'quot','ˆ':'circ','˜':'tilde',' ':'ensp',' ':'emsp',' ':'thinsp','‌':'zwnj','‍':'zwj','‎':'lrm','‏':'rlm','–':'ndash','—':'mdash','‘':'lsquo','’':'rsquo','‚':'sbquo','“':'ldquo','”':'rdquo','„':'bdquo','†':'dagger','‡':'Dagger','‰':'permil','‹':'lsaquo','›':'rsaquo','¤':'euro'};for (var e in FCKXHtmlEntities.Entities) A+=e;if (FCKConfig.IncludeLatinEntities){var B={'À':'Agrave','Á':'Aacute','Â':'Acirc','Ã':'Atilde','Ä':'Auml','Å':'Aring','Æ':'AElig','Ç':'Ccedil','È':'Egrave','É':'Eacute','Ê':'Ecirc','Ë':'Euml','Ì':'Igrave','Í':'Iacute','Î':'Icirc','Ï':'Iuml','Ð':'ETH','Ñ':'Ntilde','Ò':'Ograve','Ó':'Oacute','Ô':'Ocirc','Õ':'Otilde','Ö':'Ouml','Ø':'Oslash','Ù':'Ugrave','Ú':'Uacute','Û':'Ucirc','Ü':'Uuml','Ý':'Yacute','Þ':'THORN','ß':'szlig','à':'agrave','á':'aacute','â':'acirc','ã':'atilde','ä':'auml','å':'aring','æ':'aelig','ç':'ccedil','è':'egrave','é':'eacute','ê':'ecirc','ë':'euml','ì':'igrave','í':'iacute','î':'icirc','ï':'iuml','ð':'eth','ñ':'ntilde','ò':'ograve','ó':'oacute','ô':'ocirc','õ':'otilde','ö':'ouml','ø':'oslash','ù':'ugrave','ú':'uacute','û':'ucirc','ü':'uuml','ý':'yacute','þ':'thorn','ÿ':'yuml','Œ':'OElig','œ':'oelig','Å ':'Scaron','Å¡':'scaron','¾':'Yuml'};for (var e in B){FCKXHtmlEntities.Entities[e]=B[e];A+=e;};B=null;};if (FCKConfig.IncludeGreekEntities){var B={'Α':'Alpha','Β':'Beta','Γ':'Gamma','Δ':'Delta','Ε':'Epsilon','Ζ':'Zeta','Η':'Eta','Θ':'Theta','Ι':'Iota','Κ':'Kappa','Λ':'Lambda','Μ':'Mu','Ν':'Nu','Ξ':'Xi','Ο':'Omicron','Π':'Pi','Ρ':'Rho','Σ':'Sigma','Τ':'Tau','Î¥':'Upsilon','Φ':'Phi','Χ':'Chi','Ψ':'Psi','Ω':'Omega','α':'alpha','β':'beta','γ':'gamma','δ':'delta','ε':'epsilon','ζ':'zeta','η':'eta','θ':'theta','ι':'iota','κ':'kappa','λ':'lambda','μ':'mu','ν':'nu','ξ':'xi','ο':'omicron','π':'pi','ρ':'rho','ς':'sigmaf','σ':'sigma','τ':'tau','υ':'upsilon','φ':'phi','χ':'chi','ψ':'psi','ω':'omega'};for (var e in B){FCKXHtmlEntities.Entities[e]=B[e];A+=e;};B=null;}}else{FCKXHtmlEntities.Entities={};A=' ';};var D='['+A+']';if (FCKConfig.ProcessNumericEntities) D='[^ -~]|'+D;var E=FCKConfig.AdditionalNumericEntities;if (E||E.length>0) D+='|'+FCKConfig.AdditionalNumericEntities;FCKXHtmlEntities.EntitiesRegex=new RegExp(D,'g');}
var FCKXHtml=new Object();FCKXHtml.CurrentJobNum=0;FCKXHtml.GetXHTML=function(A,B,C){FCKXHtmlEntities.Initialize();var D=FCK.IsDirty();this._CreateNode=FCKConfig.ForceStrongEm?FCKXHtml_CreateNode_StrongEm:FCKXHtml_CreateNode_Normal;FCKXHtml.SpecialBlocks=new Array();this.XML=FCKTools.CreateXmlObject('DOMDocument');this.MainNode=this.XML.appendChild(this.XML.createElement('xhtml'));FCKXHtml.CurrentJobNum++;if (B) this._AppendNode(this.MainNode,A);else this._AppendChildNodes(this.MainNode,A,false);var E=this._GetMainXmlString();this.XML=null;E=E.substr(7,E.length-15).trim();if (FCKBrowserInfo.IsGecko) E=E.replace(/<br\/>$/,'');E=E.replace(FCKRegexLib.SpaceNoClose,' />');if (FCKConfig.ForceSimpleAmpersand) E=E.replace(FCKRegexLib.ForceSimpleAmpersand,'&');if (C) E=FCKCodeFormatter.Format(E);for (var i=0;i<FCKXHtml.SpecialBlocks.length;i++){var F=new RegExp('___FCKsi___'+i);E=E.replace(F,FCKXHtml.SpecialBlocks[i]);};E=E.replace(FCKRegexLib.GeckoEntitiesMarker,'&');if (!D) FCK.ResetIsDirty();return E};FCKXHtml._AppendAttribute=function(A,B,C){if (FCKConfig.ForceSimpleAmpersand&&C.replace) C=C.replace(/&/g,'___FCKAmp___');try{var D=this.XML.createAttribute(B);D.value=C?C:'';A.attributes.setNamedItem(D);}catch (e){}};FCKXHtml._AppendChildNodes=function(A,B,C){var D=0;var E=B.firstChild;while (E){if (this._AppendNode(A,E)) D++;E=E.nextSibling;};if (D==0){if (C&&FCKConfig.FillEmptyBlocks){this._AppendEntity(A,'nbsp');return;};if (!FCKRegexLib.EmptyElements.test(B.nodeName)) A.appendChild(this.XML.createTextNode(''));}};FCKXHtml._AppendNode=function(A,B){if (!B) return;switch (B.nodeType){case 1:if (B.getAttribute('_fckfakelement')) return FCKXHtml._AppendNode(A,FCK.GetRealElement(B));if (FCKBrowserInfo.IsGecko&&B.hasAttribute('_moz_editor_bogus_node')) return false;if (B.getAttribute('_fcktemp')) return false;var C=B.nodeName;if (FCKBrowserInfo.IsIE&&B.scopeName&&B.scopeName!='HTML'&&B.scopeName!='FCK') C=B.scopeName+':'+C;if (!FCKRegexLib.ElementName.test(C)) return false;C=C.toLowerCase();if (FCKBrowserInfo.IsGecko&&C=='br'&&B.hasAttribute('type')&&B.getAttribute('type',2)=='_moz') return false;if (B._fckxhtmljob&&B._fckxhtmljob==FCKXHtml.CurrentJobNum) return false;var D=this._CreateNode(C);FCKXHtml._AppendAttributes(A,B,D,C);B._fckxhtmljob=FCKXHtml.CurrentJobNum;var E=FCKXHtml.TagProcessors[C];if (E){D=E(D,B,A);if (!D) break;}else this._AppendChildNodes(D,B,FCKRegexLib.BlockElements.test(C));A.appendChild(D);break;case 3:this._AppendTextNode(A,B.nodeValue.replaceNewLineChars(' '));break;case 8:if (FCKBrowserInfo.IsIE&&!B.innerHTML) break;try { A.appendChild(this.XML.createComment(B.nodeValue));}catch (e) { /* Do nothing... probably this is a wrong format comment. */};break;default:A.appendChild(this.XML.createComment("Element not supported - Type: "+B.nodeType+" Name: "+B.nodeName));break;};return true;};function FCKXHtml_CreateNode_StrongEm(nodeName){switch (nodeName){case 'b':nodeName='strong';break;case 'i':nodeName='em';break;};return this.XML.createElement(nodeName);};function FCKXHtml_CreateNode_Normal(nodeName){return this.XML.createElement(nodeName);};FCKXHtml._AppendSpecialItem=function(A){return '___FCKsi___'+FCKXHtml.SpecialBlocks.AddItem(A);};FCKXHtml._AppendEntity=function(A,B){A.appendChild(this.XML.createTextNode('#?-:'+B+';'));};FCKXHtml._AppendTextNode=function(A,B){A.appendChild(this.XML.createTextNode(B.replace(FCKXHtmlEntities.EntitiesRegex,FCKXHtml_GetEntity)));return;};function FCKXHtml_GetEntity(character){var sEntity=FCKXHtmlEntities.Entities[character]||('#'+character.charCodeAt(0));return '#?-:'+sEntity+';';};FCKXHtml.TagProcessors=new Object();FCKXHtml.TagProcessors['img']=function(A,B){if (!A.attributes.getNamedItem('alt')) FCKXHtml._AppendAttribute(A,'alt','');var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'src',C);return A;};FCKXHtml.TagProcessors['a']=function(A,B){var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'href',C);FCKXHtml._AppendChildNodes(A,B,false);if (A.childNodes.length==0&&!A.getAttribute('name')) return false;return A;};FCKXHtml.TagProcessors['script']=function(A,B){if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text/javascript');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(B.text)));return A;};FCKXHtml.TagProcessors['style']=function(A,B){if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text/css');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(B.innerHTML)));return A;};FCKXHtml.TagProcessors['title']=function(A,B){A.appendChild(FCKXHtml.XML.createTextNode(FCK.EditorDocument.title));return A;};FCKXHtml.TagProcessors['table']=function(A,B){var C=A.attributes.getNamedItem('class');if (C&&FCKRegexLib.TableBorderClass.test(C.nodeValue)){var D=C.nodeValue.replace(FCKRegexLib.TableBorderClass,'');if (D.length==0) A.attributes.removeNamedItem('class');else FCKXHtml._AppendAttribute(A,'class',D);};FCKXHtml._AppendChildNodes(A,B,false);return A;};FCKXHtml.TagProcessors['ol']=FCKXHtml.TagProcessors['ul']=function(A,B,C){if (B.innerHTML.trim().length==0) return;var D=C.lastChild;if (D&&D.nodeType==3) D=D.previousSibling;if (D&&D.nodeName.toUpperCase()=='LI'){B._fckxhtmljob=null;FCKXHtml._AppendNode(D,B);return;};FCKXHtml._AppendChildNodes(A,B);return A;};FCKXHtml.TagProcessors['span']=function(A,B){if (B.innerHTML.length==0) return false;FCKXHtml._AppendChildNodes(A,B,false);return A;}
FCKXHtml._GetMainXmlString=function(){var A=new XMLSerializer();return A.serializeToString(this.MainNode);};FCKXHtml._AppendAttributes=function(A,B,C){var D=B.attributes;for (var n=0;n<D.length;n++){var E=D[n];if (E.specified){var F=E.nodeName.toLowerCase();var G;if (F.startsWith('_fck')) continue;else if (F.indexOf('_moz')==0) continue;else if (F=='class') G=E.nodeValue;else if (E.nodeValue===true) G=F;else G=B.getAttribute(F,2);this._AppendAttribute(C,F,G);}}}
var FCKCodeFormatter=new Object();FCKCodeFormatter.Init=function(){var A=this.Regex=new Object();A.BlocksOpener=/\<(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi;A.BlocksCloser=/\<\/(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi;A.NewLineTags=/\<(BR|HR)[^\>]*\>/gi;A.MainTags=/\<\/?(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR)[^\>]*\>/gi;A.LineSplitter=/\s*\n+\s*/g;A.IncreaseIndent=/^\<(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL)[ \/\>]/i;A.DecreaseIndent=/^\<\/(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL)[ \>]/i;A.FormatIndentatorRemove=new RegExp('^'+FCKConfig.FormatIndentator);A.ProtectedTags=/(<PRE[^>]*>)([\s\S]*?)(<\/PRE>)/gi;};FCKCodeFormatter._ProtectData=function(A,B,C,D){return B+'___FCKpd___'+FCKCodeFormatter.ProtectedData.AddItem(C)+D;};FCKCodeFormatter.Format=function(A){if (!this.Regex) this.Init();FCKCodeFormatter.ProtectedData=new Array();var B=A.replace(this.Regex.ProtectedTags,FCKCodeFormatter._ProtectData);B=B.replace(this.Regex.BlocksOpener,'\n$&');;B=B.replace(this.Regex.BlocksCloser,'$&\n');B=B.replace(this.Regex.NewLineTags,'$&\n');B=B.replace(this.Regex.MainTags,'\n$&\n');var C='';var D=B.split(this.Regex.LineSplitter);B='';for (var i=0;i<D.length;i++){var E=D[i];if (E.length==0) continue;if (this.Regex.DecreaseIndent.test(E)) C=C.replace(this.Regex.FormatIndentatorRemove,'');B+=C+E+'\n';if (this.Regex.IncreaseIndent.test(E)) C+=FCKConfig.FormatIndentator;};for (var i=0;i<FCKCodeFormatter.ProtectedData.length;i++){var F=new RegExp('___FCKpd___'+i);B=B.replace(F,FCKCodeFormatter.ProtectedData[i].replace(/\$/g,'$$$$'));};return B.trim();}
var FCKUndo=new Object();FCKUndo.SaveUndoStep=function(){}
var FCKEditingArea=function(A){this.TargetElement=A;this.Mode=FCK_EDITMODE_WYSIWYG;if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKEditingArea_Cleanup);};FCKEditingArea.prototype.Start=function(A,B){var C=this.TargetElement;var D=FCKTools.GetElementDocument(C);while(C.childNodes.length>0) C.removeChild(C.childNodes[0]);if (this.Mode==FCK_EDITMODE_WYSIWYG){if (FCKBrowserInfo.IsGecko) A=A.replace(/(<body[^>]*>)\s*(<\/body>)/i,'$1'+GECKO_BOGUS+'$2');var E=this.IFrame=D.createElement('iframe');E.src='javascript:void(0)';E.frameBorder=0;E.width=E.height='100%';C.appendChild(E);if (FCKBrowserInfo.IsIE) A=A.replace(/(<base[^>]*?)\s*\/?>(?!\s*<\/base>)/gi,'$1></base>');this.Window=E.contentWindow;var F=this.Document=this.Window.document;F.open();F.write(A);F.close();if (FCKBrowserInfo.IsGecko10&&!B){this.Start(A,true);return;};this.Window._FCKEditingArea=this;if (FCKBrowserInfo.IsGecko10) this.Window.setTimeout(FCKEditingArea_CompleteStart,500);else FCKEditingArea_CompleteStart.call(this.Window);}else{var G=this.Textarea=D.createElement('textarea');G.className='SourceField';G.dir='ltr';G.style.width=G.style.height='100%';G.style.border='none';C.appendChild(G);G.value=A;FCKTools.RunFunction(this.OnLoad);}};function FCKEditingArea_CompleteStart(){if (!this.document.body){this.setTimeout(FCKEditingArea_CompleteStart,50);return;};var oEditorArea=this._FCKEditingArea;oEditorArea.MakeEditable();FCKTools.RunFunction(oEditorArea.OnLoad);};FCKEditingArea.prototype.MakeEditable=function(){var A=this.Document;if (FCKBrowserInfo.IsIE) A.body.contentEditable=true;else{try{A.designMode='on';A.execCommand('useCSS',false,!FCKConfig.GeckoUseSPAN);A.execCommand('enableObjectResizing',false,!FCKConfig.DisableObjectResizing);A.execCommand('enableInlineTableEditing',false,!FCKConfig.DisableFFTableHandles);}catch (e) {}}};FCKEditingArea.prototype.Focus=function(){try{if (this.Mode==FCK_EDITMODE_WYSIWYG){if (FCKBrowserInfo.IsSafari) this.IFrame.focus();else this.Window.focus();}else this.Textarea.focus();}catch(e) {}};function FCKEditingArea_Cleanup(){this.TargetElement=null;this.IFrame=null;this.Document=null;this.Textarea=null;if (this.Window){this.Window._FCKEditingArea=null;this.Window=null;}}
var FCKDocumentProcessor=new Object();FCKDocumentProcessor._Items=new Array();FCKDocumentProcessor.AppendNew=function(){var A=new Object();this._Items.AddItem(A);return A;};FCKDocumentProcessor.Process=function(A){var B,i=0;while((B=this._Items[i++])) B.ProcessDocument(A);};var FCKDocumentProcessor_CreateFakeImage=function(A,B){var C=FCK.EditorDocument.createElement('IMG');C.className=A;C.src=FCKConfig.FullBasePath+'images/spacer.gif';C.setAttribute('_fckfakelement','true',0);C.setAttribute('_fckrealelement',FCKTempBin.AddElement(B),0);return C;};var FCKAnchorsProcessor=FCKDocumentProcessor.AppendNew();FCKAnchorsProcessor.ProcessDocument=function(A){var B=A.getElementsByTagName('A');var C;var i=B.length-1;while (i>=0&&(C=B[i--])){if (C.name.length>0&&(!C.getAttribute('href')||C.getAttribute('href').length==0)){var D=FCKDocumentProcessor_CreateFakeImage('FCK__Anchor',C.cloneNode(true));D.setAttribute('_fckanchor','true',0);C.parentNode.insertBefore(D,C);C.parentNode.removeChild(C);}}};var FCKPageBreaksProcessor=FCKDocumentProcessor.AppendNew();FCKPageBreaksProcessor.ProcessDocument=function(A){var B=A.getElementsByTagName('DIV');var C;var i=B.length-1;while (i>=0&&(C=B[i--])){if (C.style.pageBreakAfter=='always'&&C.childNodes.length==1&&C.childNodes[0].style&&C.childNodes[0].style.display=='none'){var D=FCKDocumentProcessor_CreateFakeImage('FCK__PageBreak',C.cloneNode(true));C.parentNode.insertBefore(D,C);C.parentNode.removeChild(C);}}};var FCKFlashProcessor=FCKDocumentProcessor.AppendNew();FCKFlashProcessor.ProcessDocument=function(A){var B=A.getElementsByTagName('EMBED');var C;var i=B.length-1;while (i>=0&&(C=B[i--])){if (C.src.endsWith('.swf',true)){var D=C.cloneNode(true);if (FCKBrowserInfo.IsIE){var E;if (E=C.getAttribute('scale')) D.setAttribute('scale',E);if (E=C.getAttribute('play')) D.setAttribute('play',E);if (E=C.getAttribute('loop')) D.setAttribute('loop',E);if (E=C.getAttribute('menu')) D.setAttribute('menu',E);if (E=C.getAttribute('wmode')) D.setAttribute('wmode',E);if (E=C.getAttribute('quality')) D.setAttribute('quality',E);};var F=FCKDocumentProcessor_CreateFakeImage('FCK__Flash',D);F.setAttribute('_fckflash','true',0);FCKFlashProcessor.RefreshView(F,C);C.parentNode.insertBefore(F,C);C.parentNode.removeChild(C);}}};FCKFlashProcessor.RefreshView=function(A,B){if (B.width>0) A.style.width=FCKTools.ConvertHtmlSizeToStyle(B.width);if (B.height>0) A.style.height=FCKTools.ConvertHtmlSizeToStyle(B.height);};FCK.GetRealElement=function(A){var e=FCKTempBin.Elements[A.getAttribute('_fckrealelement')];if (A.getAttribute('_fckflash')){if (A.style.width.length>0) e.width=FCKTools.ConvertStyleSizeToHtml(A.style.width);if (A.style.height.length>0) e.height=FCKTools.ConvertStyleSizeToHtml(A.style.height);};return e;};
var FCK_StartupValue;FCK.Events=new FCKEvents(FCK);FCK.Toolbar=null;FCK.HasFocus=false;FCK.StartEditor=function(){FCK.TempBaseTag=FCKConfig.BaseHref.length>0?'<base href="'+FCKConfig.BaseHref+'" _fcktemp="true"></base>':'';FCK.EditingArea=new FCKEditingArea(document.getElementById('xEditingArea'));this.SetHTML(FCKTools.GetLinkedFieldValue());};FCK.Focus=function(){FCK.EditingArea.Focus();};FCK.SetStatus=function(A){this.Status=A;if (A==FCK_STATUS_ACTIVE){FCKFocusManager.AddWindow(window,true);if (FCKBrowserInfo.IsIE) FCKFocusManager.AddWindow(window.frameElement,true);if (FCKConfig.StartupFocus) FCK.Focus();};this.Events.FireEvent('OnStatusChange',A);};FCK.GetHTML=FCK.GetXHTML=function(A){if (FCK.EditMode==FCK_EDITMODE_SOURCE) return FCK.EditingArea.Textarea.value;var B;var C=FCK.EditorDocument;if (FCKConfig.FullPage) B=FCKXHtml.GetXHTML(C.getElementsByTagName('html')[0],true,A);else{if (FCKConfig.IgnoreEmptyParagraphValue&&C.body.innerHTML=='<P>&nbsp;</P>') B='';else B=FCKXHtml.GetXHTML(C.body,false,A);};B=FCK.ProtectEventsRestore(B);if (FCKBrowserInfo.IsIE) B=B.replace(FCKRegexLib.ToReplace,'$1');if (FCK.DocTypeDeclaration&&FCK.DocTypeDeclaration.length>0) B=FCK.DocTypeDeclaration+'\n'+B;if (FCK.XmlDeclaration&&FCK.XmlDeclaration.length>0) B=FCK.XmlDeclaration+'\n'+B;return FCKConfig.ProtectedSource.Revert(B);};FCK.UpdateLinkedField=function(){FCK.LinkedField.value=FCK.GetXHTML(FCKConfig.FormatOutput);FCK.Events.FireEvent('OnAfterLinkedFieldUpdate');};FCK.RegisteredDoubleClickHandlers=new Object();FCK.OnDoubleClick=function(A){var B=FCK.RegisteredDoubleClickHandlers[A.tagName];if (B) B(A);};FCK.RegisterDoubleClickHandler=function(A,B){FCK.RegisteredDoubleClickHandlers[B.toUpperCase()]=A;};FCK.OnAfterSetHTML=function(){FCKDocumentProcessor.Process(FCK.EditorDocument);FCKUndo.SaveUndoStep();FCK.Events.FireEvent('OnSelectionChange');FCK.Events.FireEvent('OnAfterSetHTML');};FCK.ProtectUrls=function(A){A=A.replace(FCKRegexLib.ProtectUrlsA,'$1$4$2$3$5$2 _fcksavedurl=$2$3$5$2');A=A.replace(FCKRegexLib.ProtectUrlsImg,'$1$4$2$3$5$2 _fcksavedurl=$2$3$5$2');return A;};FCK.ProtectEvents=function(A){return A.replace(FCKRegexLib.TagsWithEvent,_FCK_ProtectEvents_ReplaceTags);};function _FCK_ProtectEvents_ReplaceTags(tagMatch){return tagMatch.replace(FCKRegexLib.EventAttributes,_FCK_ProtectEvents_ReplaceEvents);};function _FCK_ProtectEvents_ReplaceEvents(eventMatch,attName){return ' '+attName+'_fckprotectedatt="'+eventMatch.ReplaceAll([/&/g,/'/g,/"/g,/=/g,/</g,/>/g,/\r/g,/\n/g],['&apos;','&#39;','&quot;','&#61;','&lt;','&gt;','&#10;','&#13;'])+'"';};FCK.ProtectEventsRestore=function(A){return A.replace(FCKRegexLib.ProtectedEvents,_FCK_ProtectEvents_RestoreEvents);};function _FCK_ProtectEvents_RestoreEvents(match,encodedOriginal){return encodedOriginal.ReplaceAll([/&#39;/g,/&quot;/g,/&#61;/g,/&lt;/g,/&gt;/g,/&#10;/g,/&#13;/g,/&apos;/g],["'",'"','=','<','>','\r','\n','&']);};FCK.IsDirty=function(){return (FCK_StartupValue!=FCK.EditorDocument.body.innerHTML);};FCK.ResetIsDirty=function(){if (FCK.EditorDocument.body) FCK_StartupValue=FCK.EditorDocument.body.innerHTML;};FCK.SetHTML=function(A){this.EditingArea.Mode=FCK.EditMode;if (FCK.EditMode==FCK_EDITMODE_WYSIWYG){A=FCKConfig.ProtectedSource.Protect(A);A=FCK.ProtectEvents(A);A=FCK.ProtectUrls(A);if (FCKBrowserInfo.IsGecko){A=A.replace(FCKRegexLib.StrongOpener,'<b$1');A=A.replace(FCKRegexLib.StrongCloser,'<\/b>');A=A.replace(FCKRegexLib.EmOpener,'<i$1');A=A.replace(FCKRegexLib.EmCloser,'<\/i>');}else if (FCKBrowserInfo.IsIE){A=A.replace(FCKRegexLib.AbbrOpener,'<FCK:abbr$1');A=A.replace(FCKRegexLib.AbbrCloser,'<\/FCK:abbr>');};var B='';if (FCKConfig.FullPage){if (!FCKRegexLib.HeadOpener.test(A)){if (!FCKRegexLib.HtmlOpener.test(A)) A='<html dir="'+FCKConfig.ContentLangDirection+'">'+A+'</html>';A=A.replace(FCKRegexLib.HtmlOpener,'$&<head></head>');};FCK.DocTypeDeclaration=A.match(FCKRegexLib.DocTypeTag);if (FCKBrowserInfo.IsIE) B=FCK._GetBehaviorsStyle();else if (FCKConfig.ShowBorders) B='<link href="'+FCKConfig.FullBasePath+'css/fck_showtableborders_gecko.css" rel="stylesheet" type="text/css" _fcktemp="true" />';B+='<link href="'+FCKConfig.FullBasePath+'css/fck_internal.css'+'" rel="stylesheet" type="text/css" _fcktemp="true" />';B=A.replace(FCKRegexLib.HeadCloser,B+'$&');if (FCK.TempBaseTag.length>0&&!FCKRegexLib.HasBaseTag.test(A)) B=B.replace(FCKRegexLib.HeadOpener,'$&'+FCK.TempBaseTag);}else{B=FCKConfig.DocType+'<html dir="'+FCKConfig.ContentLangDirection+'"';if (FCKBrowserInfo.IsIE&&!FCKRegexLib.Html4DocType.test(FCKConfig.DocType)) B+=' style="overflow-y: scroll"';B+='><head><title></title>'+this._GetEditorAreaStyleTags()+'<link href="'+FCKConfig.FullBasePath+'css/fck_internal.css'+'" rel="stylesheet" type="text/css" _fcktemp="true" />';if (FCKBrowserInfo.IsIE) B+=FCK._GetBehaviorsStyle();else if (FCKConfig.ShowBorders) B+='<link href="'+FCKConfig.FullBasePath+'css/fck_showtableborders_gecko.css" rel="stylesheet" type="text/css" _fcktemp="true" />';B+=FCK.TempBaseTag;B+='</head><body>';if (FCKBrowserInfo.IsGecko&&(A.length==0||FCKRegexLib.EmptyParagraph.test(A))) B+=GECKO_BOGUS;else B+=A;B+='</body></html>';};this.EditingArea.OnLoad=FCK_EditingArea_OnLoad;this.EditingArea.Start(B);}else{this.EditingArea.OnLoad=null;this.EditingArea.Start(A);this.EditingArea.Textarea._FCKShowContextMenu=true;};if (FCKBrowserInfo.IsGecko) window.onresize();};function FCK_EditingArea_OnLoad(){FCK.EditorWindow=FCK.EditingArea.Window;FCK.EditorDocument=FCK.EditingArea.Document;FCK.InitializeBehaviors();FCK.OnAfterSetHTML();if (FCK.Status!=FCK_STATUS_NOTLOADED) return;FCK.ResetIsDirty();FCKTools.AttachToLinkedFieldFormSubmit(FCK.UpdateLinkedField);FCK.SetStatus(FCK_STATUS_ACTIVE);};FCK._GetEditorAreaStyleTags=function(){var A='';var B=FCKConfig.EditorAreaCSS;for (var i=0;i<B.length;i++) A+='<link href="'+B[i]+'" rel="stylesheet" type="text/css" />';return A;};var FCKFocusManager=FCK.FocusManager=new Object();FCKFocusManager.IsLocked=false;FCK.HasFocus=false;FCKFocusManager.AddWindow=function(A,B){var C;if (FCKBrowserInfo.IsIE) C=A.nodeType==1?A:A.frameElement?A.frameElement:A.document;else C=A.document;FCKTools.AddEventListener(C,'blur',FCKFocusManager_Win_OnBlur);FCKTools.AddEventListener(C,'focus',B?FCKFocusManager_Win_OnFocus_Area:FCKFocusManager_Win_OnFocus);};FCKFocusManager.RemoveWindow=function(A){if (FCKBrowserInfo.IsIE) oTarget=A.nodeType==1?A:A.frameElement?A.frameElement:A.document;else oTarget=A.document;FCKTools.RemoveEventListener(oTarget,'blur',FCKFocusManager_Win_OnBlur);FCKTools.RemoveEventListener(oTarget,'focus',FCKFocusManager_Win_OnFocus_Area);FCKTools.RemoveEventListener(oTarget,'focus',FCKFocusManager_Win_OnFocus);};FCKFocusManager.Lock=function(){this.IsLocked=true;};FCKFocusManager.Unlock=function(){if (this._HasPendingBlur) FCKFocusManager._Timer=window.setTimeout(FCKFocusManager_FireOnBlur,100);this.IsLocked=false;};FCKFocusManager._ResetTimer=function(){this._HasPendingBlur=false;if (this._Timer){window.clearTimeout(this._Timer);delete this._Timer;}};function FCKFocusManager_Win_OnBlur(){if (typeof(FCK)!='undefined'&&FCK.HasFocus){FCKFocusManager._ResetTimer();FCKFocusManager._Timer=window.setTimeout(FCKFocusManager_FireOnBlur,100);}};function FCKFocusManager_FireOnBlur(){if (FCKFocusManager.IsLocked) FCKFocusManager._HasPendingBlur=true;else{FCK.HasFocus=false;FCK.Events.FireEvent("OnBlur");}};function FCKFocusManager_Win_OnFocus_Area(){FCKFocusManager_Win_OnFocus();FCK.Focus();};function FCKFocusManager_Win_OnFocus(){FCKFocusManager._ResetTimer();if (!FCK.HasFocus&&!FCKFocusManager.IsLocked){FCK.HasFocus=true;FCK.Events.FireEvent("OnFocus");}}
FCK.Description="FCKeditor for Gecko Browsers";FCK.InitializeBehaviors=function(){Window_OnResize();FCKFocusManager.AddWindow(this.EditorWindow);var A=function(e){var B;if (e.ctrlKey&&!e.shiftKey&&!e.altKey){switch (e.which){case 66:case 98:FCK.ExecuteNamedCommand('bold');B=true;break;case 105:case 73:FCK.ExecuteNamedCommand('italic');B=true;break;case 117:case 85:FCK.ExecuteNamedCommand('underline');B=true;break;case 86:case 118:B=(FCK.Status!=FCK_STATUS_COMPLETE||!FCK.Events.FireEvent("OnPaste"));break;}}else if (e.shiftKey&&!e.ctrlKey&&!e.altKey&&e.keyCode==45) B=(FCK.Status!=FCK_STATUS_COMPLETE||!FCK.Events.FireEvent("OnPaste"));if (B){e.preventDefault();e.stopPropagation();}};this.EditorDocument.addEventListener('keypress',A,true);this.ExecOnSelectionChange=function(){FCK.Events.FireEvent("OnSelectionChange");};this.ExecOnSelectionChangeTimer=function(){if (FCK.LastOnChangeTimer) window.clearTimeout(FCK.LastOnChangeTimer);FCK.LastOnChangeTimer=window.setTimeout(FCK.ExecOnSelectionChange,100);};this.EditorDocument.addEventListener('mouseup',this.ExecOnSelectionChange,false);this.EditorDocument.addEventListener('keyup',this.ExecOnSelectionChangeTimer,false);this._DblClickListener=function(e){FCK.OnDoubleClick(e.target);e.stopPropagation();};this.EditorDocument.addEventListener('dblclick',this._DblClickListener,true);FCK.ContextMenu._InnerContextMenu.SetMouseClickWindow(FCK.EditorWindow);FCK.ContextMenu._InnerContextMenu.AttachToElement(FCK.EditorDocument);};FCK.MakeEditable=function(){this.EditingArea.MakeEditable();};function Document_OnContextMenu(e){if (!e.target._FCKShowContextMenu) e.preventDefault();};document.oncontextmenu=Document_OnContextMenu;
FCK.RedirectNamedCommands=new Object();FCK.ExecuteNamedCommand=function(A,B,C){FCKUndo.SaveUndoStep();if (!C&&FCK.RedirectNamedCommands[A]!=null) FCK.ExecuteRedirectedNamedCommand(A,B);else{FCK.Focus();FCK.EditorDocument.execCommand(A,false,B);FCK.Events.FireEvent('OnSelectionChange');};FCKUndo.SaveUndoStep();};FCK.GetNamedCommandState=function(A){try{if (!FCK.EditorDocument.queryCommandEnabled(A)) return FCK_TRISTATE_DISABLED;else return FCK.EditorDocument.queryCommandState(A)?FCK_TRISTATE_ON:FCK_TRISTATE_OFF;}catch (e){return FCK_TRISTATE_OFF;}};FCK.GetNamedCommandValue=function(A){var B='';var C=FCK.GetNamedCommandState(A);if (C==FCK_TRISTATE_DISABLED) return null;try{B=this.EditorDocument.queryCommandValue(A);}catch(e) {};return B?B:'';};FCK.PasteFromWord=function(){FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.PasteFromWord,'dialog/fck_paste.html',400,330,'Word');};FCK.Preview=function(){var A=FCKConfig.ScreenWidth*0.8;var B=FCKConfig.ScreenHeight*0.7;var C=(FCKConfig.ScreenWidth-A)/2;var D=window.open('',null,'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+A+',height='+B+',left='+C);var E;if (FCKConfig.FullPage){if (FCK.TempBaseTag.length>0) E=FCK.TempBaseTag+FCK.GetXHTML();else E=FCK.GetXHTML();}else{E=FCKConfig.DocType+'<html dir="'+FCKConfig.ContentLangDirection+'">'+'<head>'+FCK.TempBaseTag+'<title>'+FCKLang.Preview+'</title>'+FCK._GetEditorAreaStyleTags()+'</head><body>'+FCK.GetXHTML()+'</body></html>';};D.document.write(E);D.document.close();};FCK.SwitchEditMode=function(A){var B=(FCK.EditMode==FCK_EDITMODE_WYSIWYG);var C;if (B){if (!A&&FCKBrowserInfo.IsIE) FCKUndo.SaveUndoStep();C=FCK.GetXHTML(FCKConfig.FormatSource);}else C=this.EditingArea.Textarea.value;FCK.EditMode=B?FCK_EDITMODE_SOURCE:FCK_EDITMODE_WYSIWYG;FCK.SetHTML(C);FCK.Focus();FCKTools.RunFunction(FCK.ToolbarSet.RefreshModeState,FCK.ToolbarSet);};FCK.CreateElement=function(A){var e=FCK.EditorDocument.createElement(A);return FCK.InsertElementAndGetIt(e);};FCK.InsertElementAndGetIt=function(e){e.setAttribute('FCKTempLabel','true');this.InsertElement(e);var A=FCK.EditorDocument.getElementsByTagName(e.tagName);for (var i=0;i<A.length;i++){if (A[i].getAttribute('FCKTempLabel')){A[i].removeAttribute('FCKTempLabel');return A[i];}};return null;};
FCK._BaseGetNamedCommandState=FCK.GetNamedCommandState;FCK.GetNamedCommandState=function(A){switch (A){case 'Unlink':return FCKSelection.HasAncestorNode('A')?FCK_TRISTATE_OFF:FCK_TRISTATE_DISABLED;default:return FCK._BaseGetNamedCommandState(A);}};FCK.RedirectNamedCommands={Print:true,Paste:true,Cut:true,Copy:true};FCK.ExecuteRedirectedNamedCommand=function(A,B){switch (A){case 'Print':FCK.EditorWindow.print();break;case 'Paste':try { if (FCK.Paste()) FCK.ExecuteNamedCommand('Paste',null,true);}catch (e) { alert(FCKLang.PasteErrorPaste);};break;case 'Cut':try { FCK.ExecuteNamedCommand('Cut',null,true);}catch (e) { alert(FCKLang.PasteErrorCut);};break;case 'Copy':try { FCK.ExecuteNamedCommand('Copy',null,true);}catch (e) { alert(FCKLang.PasteErrorCopy);};break;default:FCK.ExecuteNamedCommand(A,B);}};FCK.AttachToOnSelectionChange=function(A){this.Events.AttachEvent('OnSelectionChange',A);};FCK.Paste=function(){if (FCKConfig.ForcePasteAsPlainText){FCK.PasteAsPlainText();return false;}else return true;};FCK.InsertHtml=function(A){A=FCKConfig.ProtectedSource.Protect(A);A=FCK.ProtectUrls(A);var B=FCKSelection.Delete();var C=B.getRangeAt(0);var D=C.createContextualFragment(A);var E=D.lastChild;C.insertNode(D);FCKSelection.SelectNode(E);FCKSelection.Collapse(false);this.Focus();};FCK.InsertElement=function(A){var B=FCKSelection.Delete();var C=B.getRangeAt(0);C.insertNode(A);FCKSelection.SelectNode(A);FCKSelection.Collapse(false);this.Focus();};FCK.PasteAsPlainText=function(){FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.PasteAsText,'dialog/fck_paste.html',400,330,'PlainText');};FCK.GetClipboardHTML=function(){return '';};FCK.CreateLink=function(A){FCK.ExecuteNamedCommand('Unlink');if (A.length>0){var B='javascript:void(0);/*'+(new Date().getTime())+'*/';FCK.ExecuteNamedCommand('CreateLink',B);var C=document.evaluate("//a[@href='"+B+"']",this.EditorDocument.body,null,9,null).singleNodeValue;if (C){C.href=A;return C;}}};
var FCKSelection=FCK.Selection=new Object();
FCKSelection.GetType=function(){this._Type='Text';var A;try { A=FCK.EditorWindow.getSelection();}catch (e) {};if (A&&A.rangeCount==1){var B=A.getRangeAt(0);if (B.startContainer==B.endContainer&&(B.endOffset-B.startOffset)==1&&B.startContainer.nodeType!=Node.TEXT_NODE) this._Type='Control';};return this._Type;};FCKSelection.GetSelectedElement=function(){if (this.GetType()=='Control'){var A=FCK.EditorWindow.getSelection();return A.anchorNode.childNodes[A.anchorOffset];}};FCKSelection.GetParentElement=function(){if (this.GetType()=='Control') return FCKSelection.GetSelectedElement().parentNode;else{var A=FCK.EditorWindow.getSelection();if (A){var B=A.anchorNode;while (B&&B.nodeType!=1) B=B.parentNode;return B;}}};FCKSelection.SelectNode=function(A){var B=FCK.EditorDocument.createRange();B.selectNode(A);var C=FCK.EditorWindow.getSelection();C.removeAllRanges();C.addRange(B);};FCKSelection.Collapse=function(A){var B=FCK.EditorWindow.getSelection();if (A==null||A===true) B.collapseToStart();else B.collapseToEnd();};FCKSelection.HasAncestorNode=function(A){var B=this.GetSelectedElement();if (!B&&FCK.EditorWindow){try { B=FCK.EditorWindow.getSelection().getRangeAt(0).startContainer;}catch(e){}};while (B){if (B.nodeType==1&&B.tagName==A) return true;B=B.parentNode;};return false;};FCKSelection.MoveToAncestorNode=function(A){var B;var C=this.GetSelectedElement();if (!C) C=FCK.EditorWindow.getSelection().getRangeAt(0).startContainer;while (C){if (C.tagName==A) return C;C=C.parentNode;};return null;};FCKSelection.Delete=function(){var A=FCK.EditorWindow.getSelection();for (var i=0;i<A.rangeCount;i++){A.getRangeAt(i).deleteContents();};return A;};
var FCKTableHandler=new Object();FCKTableHandler.InsertRow=function(){var A=FCKSelection.MoveToAncestorNode("TR");if (!A) return;var B=A.cloneNode(true);A.parentNode.insertBefore(B,A);FCKTableHandler.ClearRow(A);};FCKTableHandler.DeleteRows=function(A){if (!A) A=FCKSelection.MoveToAncestorNode("TR");if (!A) return;var B=FCKTools.GetElementAscensor(A,'TABLE');if (B.rows.length==1){FCKTableHandler.DeleteTable(B);return;};A.parentNode.removeChild(A);};FCKTableHandler.DeleteTable=function(A){if (!A){var A=FCKSelection.GetSelectedElement();if (!A||A.tagName!='TABLE') A=FCKSelection.MoveToAncestorNode("TABLE");};if (!A) return;FCKSelection.SelectNode(A);FCKSelection.Collapse();A.parentNode.removeChild(A);};FCKTableHandler.InsertColumn=function(){var A=FCKSelection.MoveToAncestorNode("TD");if (!A) A=FCKSelection.MoveToAncestorNode("TH");if (!A) return;var B=FCKTools.GetElementAscensor(A,'TABLE');var C=A.cellIndex+1;for (var i=0;i<B.rows.length;i++){var D=B.rows[i];if (D.cells.length<C) continue;A=D.cells[C-1].cloneNode(false);if (FCKBrowserInfo.IsGecko) A.innerHTML=GECKO_BOGUS;var E=D.cells[C];if (E) D.insertBefore(A,E);else D.appendChild(A);}};FCKTableHandler.DeleteColumns=function(){var A=FCKSelection.MoveToAncestorNode('TD')||FCKSelection.MoveToAncestorNode('TH');if (!A) return;var B=FCKTools.GetElementAscensor(A,'TABLE');var C=A.cellIndex;for (var i=B.rows.length-1;i>=0;i--){var D=B.rows[i];if (C==0&&D.cells.length==1){FCKTableHandler.DeleteRows(D);continue;};if (D.cells[C]) D.removeChild(D.cells[C]);}};FCKTableHandler.InsertCell=function(A){var B=A?A:FCKSelection.MoveToAncestorNode("TD");if (!B) return;var C=FCK.EditorDocument.createElement("TD");if (FCKBrowserInfo.IsGecko) C.innerHTML=GECKO_BOGUS;if (B.cellIndex==B.parentNode.cells.length-1){B.parentNode.appendChild(C);}else{B.parentNode.insertBefore(C,B.nextSibling);};return C;};FCKTableHandler.DeleteCell=function(A){if (A.parentNode.cells.length==1){FCKTableHandler.DeleteRows(FCKTools.GetElementAscensor(A,'TR'));return;};A.parentNode.removeChild(A);};FCKTableHandler.DeleteCells=function(){var A=FCKTableHandler.GetSelectedCells();for (var i=A.length-1;i>=0;i--){FCKTableHandler.DeleteCell(A[i]);}};FCKTableHandler.MergeCells=function(){var A=FCKTableHandler.GetSelectedCells();if (A.length<2) return;if (A[0].parentNode!=A[A.length-1].parentNode) return;var B=isNaN(A[0].colSpan)?1:A[0].colSpan;var C='';var D=FCK.EditorDocument.createDocumentFragment();for (var i=A.length-1;i>=0;i--){var E=A[i];for (var c=E.childNodes.length-1;c>=0;c--){var F=E.removeChild(E.childNodes[c]);if ((F.hasAttribute&&F.hasAttribute('_moz_editor_bogus_node'))||(F.getAttribute&&F.getAttribute('type',2)=='_moz')) continue;D.insertBefore(F,D.firstChild);};if (i>0){B+=isNaN(E.colSpan)?1:E.colSpan;FCKTableHandler.DeleteCell(E);}};A[0].colSpan=B;if (FCKBrowserInfo.IsGecko&&D.childNodes.length==0) A[0].innerHTML=GECKO_BOGUS;else A[0].appendChild(D);};FCKTableHandler.SplitCell=function(){var A=FCKTableHandler.GetSelectedCells();if (A.length!=1) return;var B=this._CreateTableMap(A[0].parentNode.parentNode);var C=FCKTableHandler._GetCellIndexSpan(B,A[0].parentNode.rowIndex,A[0]);var D=this._GetCollumnCells(B,C);for (var i=0;i<D.length;i++){if (D[i]==A[0]){var E=this.InsertCell(A[0]);if (!isNaN(A[0].rowSpan)&&A[0].rowSpan>1) E.rowSpan=A[0].rowSpan;}else{if (isNaN(D[i].colSpan)) D[i].colSpan=2;else D[i].colSpan+=1;}}};FCKTableHandler._GetCellIndexSpan=function(A,B,C){if (A.length<B+1) return null;var D=A[B];for (var c=0;c<D.length;c++){if (D[c]==C) return c;};return null;};FCKTableHandler._GetCollumnCells=function(A,B){var C=new Array();for (var r=0;r<A.length;r++){var D=A[r][B];if (D&&(C.length==0||C[C.length-1]!=D)) C[C.length]=D;};return C;};FCKTableHandler._CreateTableMap=function(A){var B=A.rows;var r=-1;var C=new Array();for (var i=0;i<B.length;i++){r++;if (!C[r]) C[r]=new Array();var c=-1;for (var j=0;j<B[i].cells.length;j++){var D=B[i].cells[j];c++;while (C[r][c]) c++;var E=isNaN(D.colSpan)?1:D.colSpan;var F=isNaN(D.rowSpan)?1:D.rowSpan;for (var G=0;G<F;G++){if (!C[r+G]) C[r+G]=new Array();for (var H=0;H<E;H++){C[r+G][c+H]=B[i].cells[j];}};c+=E-1;}};return C;};FCKTableHandler.ClearRow=function(A){var B=A.cells;for (var i=0;i<B.length;i++){if (FCKBrowserInfo.IsGecko) B[i].innerHTML=GECKO_BOGUS;else B[i].innerHTML='';}};
FCKTableHandler.GetSelectedCells=function(){var A=new Array();var B=FCK.EditorWindow.getSelection();if (B.rangeCount==1&&B.anchorNode.nodeType==3){var C=FCKTools.GetElementAscensor(B.anchorNode,'TD,TH');if (C){A[0]=C;return A;}};for (var i=0;i<B.rangeCount;i++){var D=B.getRangeAt(i);var E;if (D.startContainer.tagName.Equals('TD','TH')) E=D.startContainer;else E=D.startContainer.childNodes[D.startOffset];if (E.tagName.Equals('TD','TH')) A[A.length]=E;};return A;};
var FCKXml=function(){};FCKXml.prototype.LoadUrl=function(A){var B=this;var C=FCKTools.CreateXmlObject('XmlHttp');C.open("GET",A,false);C.send(null);if (C.status==200||C.status==304) this.DOMDocument=C.responseXML;else if (C.status==0&&C.readyState==4) this.DOMDocument=C.responseXML;else alert('Error loading "'+A+'"');};FCKXml.prototype.SelectNodes=function(A,B){var C=new Array();var D=this.DOMDocument.evaluate(A,B?B:this.DOMDocument,this.DOMDocument.createNSResolver(this.DOMDocument.documentElement),XPathResult.ORDERED_NODE_ITERATOR_TYPE,null);if (D){var E=D.iterateNext();while(E){C[C.length]=E;E=D.iterateNext();}};return C;};FCKXml.prototype.SelectSingleNode=function(A,B){var C=this.DOMDocument.evaluate(A,B?B:this.DOMDocument,this.DOMDocument.createNSResolver(this.DOMDocument.documentElement),9,null);if (C&&C.singleNodeValue) return C.singleNodeValue;else return null;}
var FCKStyleDef=function(A,B){this.Name=A;this.Element=B.toUpperCase();this.IsObjectElement=FCKRegexLib.ObjectElements.test(this.Element);this.Attributes=new Object();};FCKStyleDef.prototype.AddAttribute=function(A,B){this.Attributes[A]=B;};FCKStyleDef.prototype.GetOpenerTag=function(){var s='<'+this.Element;for (var a in this.Attributes) s+=' '+a+'="'+this.Attributes[a]+'"';return s+'>';};FCKStyleDef.prototype.GetCloserTag=function(){return '</'+this.Element+'>';};FCKStyleDef.prototype.RemoveFromSelection=function(){if (FCKSelection.GetType()=='Control') this._RemoveMe(FCK.ToolbarSet.CurrentInstance.Selection.GetSelectedElement());else this._RemoveMe(FCK.ToolbarSet.CurrentInstance.Selection.GetParentElement());}
FCKStyleDef.prototype.ApplyToSelection=function(){if (FCKSelection.GetType()=='Text'&&!this.IsObjectElement){var A=FCK.ToolbarSet.CurrentInstance.EditorWindow.getSelection();var e=FCK.ToolbarSet.CurrentInstance.EditorDocument.createElement(this.Element);for (var i=0;i<A.rangeCount;i++){e.appendChild(A.getRangeAt(i).extractContents());};this._AddAttributes(e);this._RemoveDuplicates(e);var B=A.getRangeAt(0);B.insertNode(e);}else{var C=FCK.ToolbarSet.CurrentInstance.Selection.GetSelectedElement();if (C.tagName==this.Element) this._AddAttributes(C);}};FCKStyleDef.prototype._AddAttributes=function(A){for (var a in this.Attributes){switch (a.toLowerCase()){case 'src':A.setAttribute('_fcksavedurl',this.Attributes[a],0);default:A.setAttribute(a,this.Attributes[a],0);}}};FCKStyleDef.prototype._RemoveDuplicates=function(A){for (var i=0;i<A.childNodes.length;i++){var B=A.childNodes[i];if (B.nodeType!=1) continue;this._RemoveDuplicates(B);if (this.IsEqual(B)) FCKTools.RemoveOuterTags(B);}};FCKStyleDef.prototype.IsEqual=function(e){if (e.tagName!=this.Element) return false;for (var a in this.Attributes){if (e.getAttribute(a)!=this.Attributes[a]) return false;};return true;};FCKStyleDef.prototype._RemoveMe=function(A){if (!A) return;var B=A.parentNode;if (A.nodeType==1&&this.IsEqual(A)){if (this.IsObjectElement){for (var a in this.Attributes) A.removeAttribute(a,0);return;}else FCKTools.RemoveOuterTags(A);};this._RemoveMe(B);}
var FCKStylesLoader=function(){this.Styles=new Object();this.StyleGroups=new Object();this.Loaded=false;this.HasObjectElements=false;};FCKStylesLoader.prototype.Load=function(A){var B=new FCKXml();B.LoadUrl(A);var C=B.SelectNodes('Styles/Style');for (var i=0;i<C.length;i++){var D=C[i].attributes.getNamedItem('element').value.toUpperCase();var E=new FCKStyleDef(C[i].attributes.getNamedItem('name').value,D);if (E.IsObjectElement) this.HasObjectElements=true;var F=B.SelectNodes('Attribute',C[i]);for (var j=0;j<F.length;j++){var G=F[j].attributes.getNamedItem('name').value;var H=F[j].attributes.getNamedItem('value').value;if (G.toLowerCase()=='style'){var I=document.createElement('SPAN');I.style.cssText=H;H=I.style.cssText;};E.AddAttribute(G,H);};this.Styles[E.Name]=E;var J=this.StyleGroups[D];if (J==null){this.StyleGroups[D]=new Array();J=this.StyleGroups[D];};J[J.length]=E;};this.Loaded=true;}
var FCKNamedCommand=function(A){this.Name=A;};FCKNamedCommand.prototype.Execute=function(){FCK.ExecuteNamedCommand(this.Name);};FCKNamedCommand.prototype.GetState=function(){return FCK.GetNamedCommandState(this.Name);};
var FCKDialogCommand=function(A,B,C,D,E,F,G){this.Name=A;this.Title=B;this.Url=C;this.Width=D;this.Height=E;this.GetStateFunction=F;this.GetStateParam=G;};FCKDialogCommand.prototype.Execute=function(){FCKDialog.OpenDialog('FCKDialog_'+this.Name,this.Title,this.Url,this.Width,this.Height);};FCKDialogCommand.prototype.GetState=function(){if (this.GetStateFunction) return this.GetStateFunction(this.GetStateParam);else return FCK_TRISTATE_OFF;};var FCKUndefinedCommand=function(){this.Name='Undefined';};FCKUndefinedCommand.prototype.Execute=function(){alert(FCKLang.NotImplemented);};FCKUndefinedCommand.prototype.GetState=function(){return FCK_TRISTATE_OFF;};var FCKFontNameCommand=function(){this.Name='FontName';};FCKFontNameCommand.prototype.Execute=function(A){if (A==null||A==""){}else FCK.ExecuteNamedCommand('FontName',A);};FCKFontNameCommand.prototype.GetState=function(){return FCK.GetNamedCommandValue('FontName');};var FCKFontSizeCommand=function(){this.Name='FontSize';};FCKFontSizeCommand.prototype.Execute=function(A){if (typeof(A)=='string') A=parseInt(A);if (A==null||A==''){FCK.ExecuteNamedCommand('FontSize',3);}else FCK.ExecuteNamedCommand('FontSize',A);};FCKFontSizeCommand.prototype.GetState=function(){return FCK.GetNamedCommandValue('FontSize');};var FCKFormatBlockCommand=function(){this.Name='FormatBlock';};FCKFormatBlockCommand.prototype.Execute=function(A){if (A==null||A=='') FCK.ExecuteNamedCommand('FormatBlock','<P>');else if (A=='div'&&FCKBrowserInfo.IsGecko) FCK.ExecuteNamedCommand('FormatBlock','div');else FCK.ExecuteNamedCommand('FormatBlock','<'+A+'>');};FCKFormatBlockCommand.prototype.GetState=function(){return FCK.GetNamedCommandValue('FormatBlock');};var FCKPreviewCommand=function(){this.Name='Preview';};FCKPreviewCommand.prototype.Execute=function(){FCK.Preview();};FCKPreviewCommand.prototype.GetState=function(){return FCK_TRISTATE_OFF;};var FCKSaveCommand=function(){this.Name='Save';};FCKSaveCommand.prototype.Execute=function(){var A=FCK.LinkedField.form;if (typeof(A.onsubmit)=='function'){var B=A.onsubmit();if (B!=null&&B===false) return;};A.submit();};FCKSaveCommand.prototype.GetState=function(){return FCK_TRISTATE_OFF;};var FCKNewPageCommand=function(){this.Name='NewPage';};FCKNewPageCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();FCK.SetHTML('');FCKUndo.Typing=true;};FCKNewPageCommand.prototype.GetState=function(){return FCK_TRISTATE_OFF;};var FCKSourceCommand=function(){this.Name='Source';};FCKSourceCommand.prototype.Execute=function(){if (FCKConfig.SourcePopup){var A=FCKConfig.ScreenWidth*0.65;var B=FCKConfig.ScreenHeight*0.65;FCKDialog.OpenDialog('FCKDialog_Source',FCKLang.Source,'dialog/fck_source.html',A,B,null,null,true);}else FCK.SwitchEditMode();};FCKSourceCommand.prototype.GetState=function(){return (FCK.EditMode==FCK_EDITMODE_WYSIWYG?FCK_TRISTATE_OFF:FCK_TRISTATE_ON);};var FCKUndoCommand=function(){this.Name='Undo';};FCKUndoCommand.prototype.Execute=function(){if (FCKBrowserInfo.IsIE) FCKUndo.Undo();else FCK.ExecuteNamedCommand('Undo');};FCKUndoCommand.prototype.GetState=function(){if (FCKBrowserInfo.IsIE) return (FCKUndo.CheckUndoState()?FCK_TRISTATE_OFF:FCK_TRISTATE_DISABLED);else return FCK.GetNamedCommandState('Undo');};var FCKRedoCommand=function(){this.Name='Redo';};FCKRedoCommand.prototype.Execute=function(){if (FCKBrowserInfo.IsIE) FCKUndo.Redo();else FCK.ExecuteNamedCommand('Redo');};FCKRedoCommand.prototype.GetState=function(){if (FCKBrowserInfo.IsIE) return (FCKUndo.CheckRedoState()?FCK_TRISTATE_OFF:FCK_TRISTATE_DISABLED);else return FCK.GetNamedCommandState('Redo');};var FCKPageBreakCommand=function(){this.Name='PageBreak';};FCKPageBreakCommand.prototype.Execute=function(){var e=FCK.EditorDocument.createElement('DIV');e.style.pageBreakAfter='always';e.innerHTML='<span style="DISPLAY:none">&nbsp;</span>';var A=FCKDocumentProcessor_CreateFakeImage('FCK__PageBreak',e);A=FCK.InsertElement(A);};FCKPageBreakCommand.prototype.GetState=function(){return 0;};var FCKUnlinkCommand=function(){this.Name='Unlink';};FCKUnlinkCommand.prototype.Execute=function(){if (FCKBrowserInfo.IsGecko){var A=FCK.Selection.MoveToAncestorNode('A');if (A) FCK.Selection.SelectNode(A);};FCK.ExecuteNamedCommand(this.Name);if (FCKBrowserInfo.IsGecko) FCK.Selection.Collapse(true);};FCKUnlinkCommand.prototype.GetState=function(){return FCK.GetNamedCommandState(this.Name);}
var FCKSpellCheckCommand=function(){this.Name='SpellCheck';this.IsEnabled=(FCKConfig.SpellChecker=='SpellerPages');};FCKSpellCheckCommand.prototype.Execute=function(){FCKDialog.OpenDialog('FCKDialog_SpellCheck','Spell Check','dialog/fck_spellerpages.html',440,480);};FCKSpellCheckCommand.prototype.GetState=function(){return this.IsEnabled?FCK_TRISTATE_OFF:FCK_TRISTATE_DISABLED;}
var FCKTextColorCommand=function(A){this.Name=A=='ForeColor'?'TextColor':'BGColor';this.Type=A;var B;if (FCKBrowserInfo.IsIE) B=window;else if (FCK.ToolbarSet._IFrame) B=FCKTools.GetElementWindow(FCK.ToolbarSet._IFrame);else B=window.parent;this._Panel=new FCKPanel(B,true);this._Panel.AppendStyleSheet(FCKConfig.SkinPath+'fck_editor.css');this._Panel.MainNode.className='FCK_Panel';this._CreatePanelBody(this._Panel.Document,this._Panel.MainNode);FCKTools.DisableSelection(this._Panel.Document.body);};FCKTextColorCommand.prototype.Execute=function(A,B,C){FCK._ActiveColorPanelType=this.Type;this._Panel.Show(A,B,C);};FCKTextColorCommand.prototype.SetColor=function(A){if (FCK._ActiveColorPanelType=='ForeColor') FCK.ExecuteNamedCommand('ForeColor',A);else if (FCKBrowserInfo.IsGeckoLike){if (FCKBrowserInfo.IsGecko&&!FCKConfig.GeckoUseSPAN) FCK.EditorDocument.execCommand('useCSS',false,false);FCK.ExecuteNamedCommand('hilitecolor',A);if (FCKBrowserInfo.IsGecko&&!FCKConfig.GeckoUseSPAN) FCK.EditorDocument.execCommand('useCSS',false,true);}else FCK.ExecuteNamedCommand('BackColor',A);delete FCK._ActiveColorPanelType;};FCKTextColorCommand.prototype.GetState=function(){return FCK_TRISTATE_OFF;};function FCKTextColorCommand_OnMouseOver() { this.className='ColorSelected';};function FCKTextColorCommand_OnMouseOut() { this.className='ColorDeselected';};function FCKTextColorCommand_OnClick(){this.className='ColorDeselected';this.Command.SetColor('#'+this.Color);this.Command._Panel.Hide();};function FCKTextColorCommand_AutoOnClick(){this.className='ColorDeselected';this.Command.SetColor('');this.Command._Panel.Hide();};function FCKTextColorCommand_MoreOnClick(){this.className='ColorDeselected';this.Command._Panel.Hide();FCKDialog.OpenDialog('FCKDialog_Color',FCKLang.DlgColorTitle,'dialog/fck_colorselector.html',400,330,this.Command.SetColor);};FCKTextColorCommand.prototype._CreatePanelBody=function(A,B){function CreateSelectionDiv(){var C=A.createElement("DIV");C.className='ColorDeselected';C.onmouseover=FCKTextColorCommand_OnMouseOver;C.onmouseout=FCKTextColorCommand_OnMouseOut;return C;};var D=B.appendChild(A.createElement("TABLE"));D.className='ForceBaseFont';D.style.tableLayout='fixed';D.cellPadding=0;D.cellSpacing=0;D.border=0;D.width=150;var E=D.insertRow(-1).insertCell(-1);E.colSpan=8;var C=E.appendChild(CreateSelectionDiv());C.innerHTML='<table cellspacing="0" cellpadding="0" width="100%" border="0">\<tr>\<td><div class="ColorBoxBorder"><div class="ColorBox" style="background-color: #000000"></div></div></td>\<td nowrap width="100%" align="center">' + FCKLang.ColorAutomatic + '</td>\</tr>\</table>';C.Command=this;C.onclick=FCKTextColorCommand_AutoOnClick;var G=FCKConfig.FontColors.toString().split(',');var H=0;while (H<G.length){var I=D.insertRow(-1);for (var i=0;i<8&&H<G.length;i++,H++){C=I.insertCell(-1).appendChild(CreateSelectionDiv());C.Color=G[H];C.innerHTML='<div class="ColorBoxBorder"><div class="ColorBox" style="background-color: #'+G[H]+'"></div></div>';C.Command=this;C.onclick=FCKTextColorCommand_OnClick;}};E=D.insertRow(-1).insertCell(-1);E.colSpan=8;C=E.appendChild(CreateSelectionDiv());C.innerHTML='<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td nowrap align="center">'+FCKLang.ColorMoreColors+'</td></tr></table>';C.Command=this;C.onclick=FCKTextColorCommand_MoreOnClick;}
var FCKPastePlainTextCommand=function(){this.Name='PasteText';};FCKPastePlainTextCommand.prototype.Execute=function(){FCK.PasteAsPlainText();};FCKPastePlainTextCommand.prototype.GetState=function(){return FCK.GetNamedCommandState('Paste');};
var FCKPasteWordCommand=function(){this.Name='PasteWord';};FCKPasteWordCommand.prototype.Execute=function(){FCK.PasteFromWord();};FCKPasteWordCommand.prototype.GetState=function(){if (FCKConfig.ForcePasteAsPlainText) return FCK_TRISTATE_DISABLED;else return FCK.GetNamedCommandState('Paste');};
var FCKTableCommand=function(A){this.Name=A;};FCKTableCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();switch (this.Name){case 'TableInsertRow':FCKTableHandler.InsertRow();break;case 'TableDeleteRows':FCKTableHandler.DeleteRows();break;case 'TableInsertColumn':FCKTableHandler.InsertColumn();break;case 'TableDeleteColumns':FCKTableHandler.DeleteColumns();break;case 'TableInsertCell':FCKTableHandler.InsertCell();break;case 'TableDeleteCells':FCKTableHandler.DeleteCells();break;case 'TableMergeCells':FCKTableHandler.MergeCells();break;case 'TableSplitCell':FCKTableHandler.SplitCell();break;case 'TableDelete':FCKTableHandler.DeleteTable();break;default:alert(FCKLang.UnknownCommand.replace(/%1/g,this.Name));}};FCKTableCommand.prototype.GetState=function(){return FCK_TRISTATE_OFF;}
var FCKStyleCommand=function(){this.Name='Style';this.StylesLoader=new FCKStylesLoader();this.StylesLoader.Load(FCKConfig.StylesXmlPath);this.Styles=this.StylesLoader.Styles;};FCKStyleCommand.prototype.Execute=function(A,B){FCKUndo.SaveUndoStep();if (B.Selected) B.Style.RemoveFromSelection();else B.Style.ApplyToSelection();FCKUndo.SaveUndoStep();FCK.Focus();FCK.Events.FireEvent("OnSelectionChange");};FCKStyleCommand.prototype.GetState=function(){if (!FCK.EditorDocument) return FCK_TRISTATE_DISABLED;var A=FCK.EditorDocument.selection;if (FCKSelection.GetType()=='Control'){var e=FCKSelection.GetSelectedElement();if (e) return this.StylesLoader.StyleGroups[e.tagName]?FCK_TRISTATE_OFF:FCK_TRISTATE_DISABLED;};return FCK_TRISTATE_OFF;};FCKStyleCommand.prototype.GetActiveStyles=function(){var A=new Array();if (FCKSelection.GetType()=='Control') this._CheckStyle(FCKSelection.GetSelectedElement(),A,false);else this._CheckStyle(FCKSelection.GetParentElement(),A,true);return A;};FCKStyleCommand.prototype._CheckStyle=function(A,B,C){if (!A) return;if (A.nodeType==1){var D=this.StylesLoader.StyleGroups[A.tagName];if (D){for (var i=0;i<D.length;i++){if (D[i].IsEqual(A)) B[B.length]=D[i];}}};if (C) this._CheckStyle(A.parentNode,B,C);}
var FCKFitWindow=function(){this.Name='FitWindow';};FCKFitWindow.prototype.Execute=function(){var A=window.frameElement;var B=A.style;var C=parent;var D=C.document.documentElement;var E=C.document.body;var F=E.style;if (!this.IsMaximized){if(FCKBrowserInfo.IsIE) C.attachEvent('onresize',FCKFitWindow_Resize);else C.addEventListener('resize',FCKFitWindow_Resize,true);this._ScrollPos=FCKTools.GetScrollPosition(C);var G=A;while(G=G.parentNode){if (G.nodeType==1) G._fckSavedStyles=FCKTools.SaveStyles(G);};if (FCKBrowserInfo.IsIE){this.documentElementOverflow=D.style.overflow;D.style.overflow='hidden';F.overflow='hidden';}else{F.overflow='hidden';F.width='0px';F.height='0px';};this._EditorFrameStyles=FCKTools.SaveStyles(A);var H=FCKTools.GetViewPaneSize(C);B.position="absolute";B.zIndex=FCKConfig.FloatingPanelsZIndex-1;B.left="0px";B.top="0px";B.width=H.Width+"px";B.height=H.Height+"px";if (!FCKBrowserInfo.IsIE){B.borderRight=B.borderBottom="9999px solid white";B.backgroundColor="white";};C.scrollTo(0,0);this.IsMaximized=true;}else{if(FCKBrowserInfo.IsIE) C.detachEvent("onresize",FCKFitWindow_Resize);else C.removeEventListener("resize",FCKFitWindow_Resize,true);var G=A;while(G=G.parentNode){if (G._fckSavedStyles){FCKTools.RestoreStyles(G,G._fckSavedStyles);G._fckSavedStyles=null;}};if (FCKBrowserInfo.IsIE) D.style.overflow=this.documentElementOverflow;FCKTools.RestoreStyles(A,this._EditorFrameStyles);C.scrollTo(this._ScrollPos.X,this._ScrollPos.Y);this.IsMaximized=false;};FCKToolbarItems.GetItem('FitWindow').RefreshState();FCK.EditingArea.MakeEditable();FCK.Focus();};FCKFitWindow.prototype.GetState=function(){if (FCKConfig.ToolbarLocation!='In') return FCK_TRISTATE_DISABLED;else return (this.IsMaximized?FCK_TRISTATE_ON:FCK_TRISTATE_OFF);};function FCKFitWindow_Resize(){var oViewPaneSize=FCKTools.GetViewPaneSize(parent);var eEditorFrameStyle=window.frameElement.style;eEditorFrameStyle.width=oViewPaneSize.Width+'px';eEditorFrameStyle.height=oViewPaneSize.Height+'px';};
var FCKCommands=FCK.Commands=new Object();FCKCommands.LoadedCommands=new Object();FCKCommands.RegisterCommand=function(A,B){this.LoadedCommands[A]=B;};FCKCommands.GetCommand=function(A){var B=FCKCommands.LoadedCommands[A];if (B) return B;switch (A){case 'DocProps':B=new FCKDialogCommand('DocProps',FCKLang.DocProps,'dialog/fck_docprops.html',400,390,FCKCommands.GetFullPageState);break;case 'Templates':B=new FCKDialogCommand('Templates',FCKLang.DlgTemplatesTitle,'dialog/fck_template.html',380,450);break;case 'Link':B=new FCKDialogCommand('Link',FCKLang.DlgLnkWindowTitle,'dialog/fck_link.html',400,330,FCK.GetNamedCommandState,'CreateLink');break;case 'Unlink':B=new FCKUnlinkCommand();break;case 'Anchor':B=new FCKDialogCommand('Anchor',FCKLang.DlgAnchorTitle,'dialog/fck_anchor.html',370,170);break;case 'BulletedList':B=new FCKDialogCommand('BulletedList',FCKLang.BulletedListProp,'dialog/fck_listprop.html',370,170);break;case 'NumberedList':B=new FCKDialogCommand('NumberedList',FCKLang.NumberedListProp,'dialog/fck_listprop.html',370,170);break;case 'About':B=new FCKDialogCommand('About',FCKLang.About,'dialog/fck_about.html',400,330);break;case 'Find':B=new FCKDialogCommand('Find',FCKLang.DlgFindTitle,'dialog/fck_find.html',340,170);break;case 'Replace':B=new FCKDialogCommand('Replace',FCKLang.DlgReplaceTitle,'dialog/fck_replace.html',340,200);break;case 'Image':B=new FCKDialogCommand('Image',FCKLang.DlgImgTitle,'dialog/fck_image.html',450,400);break;case 'Flash':B=new FCKDialogCommand('Flash',FCKLang.DlgFlashTitle,'dialog/fck_flash.html',450,400);break;case 'SpecialChar':B=new FCKDialogCommand('SpecialChar',FCKLang.DlgSpecialCharTitle,'dialog/fck_specialchar.html',400,320);break;case 'Smiley':B=new FCKDialogCommand('Smiley',FCKLang.DlgSmileyTitle,'dialog/fck_smiley.html',FCKConfig.SmileyWindowWidth,FCKConfig.SmileyWindowHeight);break;case 'Table':B=new FCKDialogCommand('Table',FCKLang.DlgTableTitle,'dialog/fck_table.html',450,250);break;case 'TableProp':B=new FCKDialogCommand('Table',FCKLang.DlgTableTitle,'dialog/fck_table.html?Parent',400,250);break;case 'TableCellProp':B=new FCKDialogCommand('TableCell',FCKLang.DlgCellTitle,'dialog/fck_tablecell.html',550,250);break;case 'UniversalKey':B=new FCKDialogCommand('UniversalKey',FCKLang.UniversalKeyboard,'dialog/fck_universalkey.html',415,300);break;case 'Style':B=new FCKStyleCommand();break;case 'FontName':B=new FCKFontNameCommand();break;case 'FontSize':B=new FCKFontSizeCommand();break;case 'FontFormat':B=new FCKFormatBlockCommand();break;case 'Source':B=new FCKSourceCommand();break;case 'Preview':B=new FCKPreviewCommand();break;case 'Save':B=new FCKSaveCommand();break;case 'NewPage':B=new FCKNewPageCommand();break;case 'PageBreak':B=new FCKPageBreakCommand();break;case 'TextColor':B=new FCKTextColorCommand('ForeColor');break;case 'BGColor':B=new FCKTextColorCommand('BackColor');break;case 'PasteText':B=new FCKPastePlainTextCommand();break;case 'PasteWord':B=new FCKPasteWordCommand();break;case 'TableInsertRow':B=new FCKTableCommand('TableInsertRow');break;case 'TableDeleteRows':B=new FCKTableCommand('TableDeleteRows');break;case 'TableInsertColumn':B=new FCKTableCommand('TableInsertColumn');break;case 'TableDeleteColumns':B=new FCKTableCommand('TableDeleteColumns');break;case 'TableInsertCell':B=new FCKTableCommand('TableInsertCell');break;case 'TableDeleteCells':B=new FCKTableCommand('TableDeleteCells');break;case 'TableMergeCells':B=new FCKTableCommand('TableMergeCells');break;case 'TableSplitCell':B=new FCKTableCommand('TableSplitCell');break;case 'TableDelete':B=new FCKTableCommand('TableDelete');break;case 'Form':B=new FCKDialogCommand('Form',FCKLang.Form,'dialog/fck_form.html',380,230);break;case 'Checkbox':B=new FCKDialogCommand('Checkbox',FCKLang.Checkbox,'dialog/fck_checkbox.html',380,230);break;case 'Radio':B=new FCKDialogCommand('Radio',FCKLang.RadioButton,'dialog/fck_radiobutton.html',380,230);break;case 'TextField':B=new FCKDialogCommand('TextField',FCKLang.TextField,'dialog/fck_textfield.html',380,230);break;case 'Textarea':B=new FCKDialogCommand('Textarea',FCKLang.Textarea,'dialog/fck_textarea.html',380,230);break;case 'HiddenField':B=new FCKDialogCommand('HiddenField',FCKLang.HiddenField,'dialog/fck_hiddenfield.html',380,230);break;case 'Button':B=new FCKDialogCommand('Button',FCKLang.Button,'dialog/fck_button.html',380,230);break;case 'Select':B=new FCKDialogCommand('Select',FCKLang.SelectionField,'dialog/fck_select.html',400,380);break;case 'ImageButton':B=new FCKDialogCommand('ImageButton',FCKLang.ImageButton,'dialog/fck_image.html?ImageButton',450,400);break;case 'SpellCheck':B=new FCKSpellCheckCommand();break;case 'FitWindow':B=new FCKFitWindow();break;case 'Undo':B=new FCKUndoCommand();break;case 'Redo':B=new FCKRedoCommand();break;case 'Undefined':B=new FCKUndefinedCommand();break;default:if (FCKRegexLib.NamedCommands.test(A)) B=new FCKNamedCommand(A);else{alert(FCKLang.UnknownCommand.replace(/%1/g,A));return null;}};FCKCommands.LoadedCommands[A]=B;return B;};FCKCommands.GetFullPageState=function(){return FCKConfig.FullPage?FCK_TRISTATE_OFF:FCK_TRISTATE_DISABLED;};
var FCKPanel=function(A){this.IsRTL=(FCKLang.Dir=='rtl');this.IsContextMenu=false;this._LockCounter=0;this._Window=A||window;var B;if (FCKBrowserInfo.IsIE){this._Popup=this._Window.createPopup();B=this.Document=this._Popup.document;}else{var C=this._IFrame=this._Window.document.createElement('iframe');C.src='javascript:void(0)';C.allowTransparency=true;C.frameBorder='0';C.scrolling='no';C.style.position='absolute';C.style.zIndex=FCKConfig.FloatingPanelsZIndex;C.width=C.height=0;if (this._Window==window.parent&&window.frameElement) window.frameElement.parentNode.insertBefore(C,window.frameElement);else this._Window.document.body.appendChild(C);var D=C.contentWindow;B=this.Document=D.document;B.open();B.write('<html><head></head><body style="margin:0px;padding:0px;"><\/body><\/html>');B.close();FCKTools.AddEventListenerEx(D,'focus',FCKPanel_Window_OnFocus,this);FCKTools.AddEventListenerEx(D,'blur',FCKPanel_Window_OnBlur,this);};B.dir=FCKLang.Dir;B.oncontextmenu=FCKTools.CancelEvent;this.MainNode=B.body.appendChild(B.createElement('DIV'));this.MainNode.style.cssFloat=this.IsRTL?'right':'left';if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKPanel_Cleanup);};FCKPanel.prototype.AppendStyleSheet=function(A){FCKTools.AppendStyleSheet(this.Document,A);};FCKPanel.prototype.Preload=function(x,y,A){if (this._Popup) this._Popup.show(x,y,0,0,A);};FCKPanel.prototype.Show=function(x,y,A,B,C){if (this._Popup){this._Popup.show(x,y,0,0,A);this.MainNode.style.width=B?B+'px':'';this.MainNode.style.height=C?C+'px':'';var D=this.MainNode.offsetWidth;if (this.IsRTL){if (this.IsContextMenu) x=x-D+1;else if (A) x=(x*-1)+A.offsetWidth-D;};this._Popup.show(x,y,D,this.MainNode.offsetHeight,A);if (this.OnHide){if (this._Timer) CheckPopupOnHide.call(this,true);this._Timer=FCKTools.SetInterval(CheckPopupOnHide,100,this);}}else{if (typeof(FCKFocusManager)!='undefined') FCKFocusManager.Lock();if (this.ParentPanel) this.ParentPanel.Lock();this.MainNode.style.width=B?B+'px':'';this.MainNode.style.height=C?C+'px':'';var D=this.MainNode.offsetWidth;if (!B) this._IFrame.width=1;if (!C) this._IFrame.height=1;D=this.MainNode.offsetWidth;var F=FCKTools.GetElementPosition((A.nodeType==9?A.body:A),this._Window);if (this.IsRTL&&!this.IsContextMenu) x=(x*-1);x+=F.X;y+=F.Y;if (this.IsRTL){if (this.IsContextMenu) x=x-D+1;else if (A) x=x+A.offsetWidth-D;}else{var G=FCKTools.GetViewPaneSize(this._Window);var H=FCKTools.GetScrollPosition(this._Window);var I=G.Height+H.Y;var J=G.Width+H.X;if ((x+D)>J) x-=x+D-J;if ((y+this.MainNode.offsetHeight)>I) y-=y+this.MainNode.offsetHeight-I;};if (x<0) x=0;this._IFrame.style.left=x+'px';this._IFrame.style.top=y+'px';var K=D;var L=this.MainNode.offsetHeight;this._IFrame.width=K;this._IFrame.height=L;this._IFrame.contentWindow.focus();};this._IsOpened=true;FCKTools.RunFunction(this.OnShow,this);};FCKPanel.prototype.Hide=function(A){if (this._Popup) this._Popup.hide();else{if (!this._IsOpened) return;if (typeof(FCKFocusManager)!='undefined') FCKFocusManager.Unlock();this._IFrame.width=this._IFrame.height=0;this._IsOpened=false;if (this.ParentPanel) this.ParentPanel.Unlock();if (!A) FCKTools.RunFunction(this.OnHide,this);}};FCKPanel.prototype.CheckIsOpened=function(){if (this._Popup) return this._Popup.isOpen;else return this._IsOpened;};FCKPanel.prototype.CreateChildPanel=function(){var A=this._Popup?FCKTools.GetParentWindow(this.Document):this._Window;var B=new FCKPanel(A,true);B.ParentPanel=this;return B;};FCKPanel.prototype.Lock=function(){this._LockCounter++;};FCKPanel.prototype.Unlock=function(){if (--this._LockCounter==0&&!this.HasFocus) this.Hide();};/* Events */ function FCKPanel_Window_OnFocus(e,panel){panel.HasFocus=true;};function FCKPanel_Window_OnBlur(e,panel){panel.HasFocus=false;if (panel._LockCounter==0) FCKTools.RunFunction(panel.Hide,panel);};function CheckPopupOnHide(forceHide){if (forceHide||!this._Popup.isOpen){window.clearInterval(this._Timer);this._Timer=null;FCKTools.RunFunction(this.OnHide,this);}};function FCKPanel_Cleanup(){this._Popup=null;this._Window=null;this.Document=null;this.MainNode=null;}
var FCKIcon=function(A){var B=A?typeof(A):'undefined';switch (B){case 'number':this.Path=FCKConfig.SkinPath+'fck_strip.gif';this.Size=16;this.Position=A;break;case 'undefined':this.Path=FCK_SPACER_PATH;break;case 'string':this.Path=A;break;default:this.Path=A[0];this.Size=A[1];this.Position=A[2];}};FCKIcon.prototype.CreateIconElement=function(A){var B;if (this.Position){var C='-'+((this.Position-1)*this.Size)+'px';if (FCKBrowserInfo.IsIE){B=A.createElement('DIV');var D=B.appendChild(A.createElement('IMG'));D.src=this.Path;D.style.top=C;}else{B=A.createElement('IMG');B.src=FCK_SPACER_PATH;B.style.backgroundPosition='0px '+C;B.style.backgroundImage='url('+this.Path+')';}}else{B=A.createElement('DIV');var D=B.appendChild(A.createElement('IMG'));D.src=this.Path?this.Path:FCK_SPACER_PATH;};B.className='TB_Button_Image';return B;}
var FCKToolbarButtonUI=function(A,B,C,D,E,F){this.Name=A;this.Label=B||A;this.Tooltip=C||this.Label;this.Style=E||FCK_TOOLBARITEM_ONLYICON;this.State=F||FCK_TRISTATE_OFF;this.Icon=new FCKIcon(D);if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKToolbarButtonUI_Cleanup);};FCKToolbarButtonUI.prototype._CreatePaddingElement=function(A){var B=A.createElement('IMG');B.className='TB_Button_Padding';B.src=FCK_SPACER_PATH;return B;};FCKToolbarButtonUI.prototype.Create=function(A){var B=this.MainElement;if (B){FCKToolbarButtonUI_Cleanup.call(this);if (B.parentNode) B.parentNode.removeChild(B);B=this.MainElement=null;};var C=FCKTools.GetElementDocument(A);B=this.MainElement=C.createElement('DIV');B._FCKButton=this;B.title=this.Tooltip;if (FCKBrowserInfo.IsGecko) B.onmousedown=FCKTools.CancelEvent;this.ChangeState(this.State,true);if (this.Style==FCK_TOOLBARITEM_ONLYICON&&!this.ShowArrow){B.appendChild(this.Icon.CreateIconElement(C));}else{var D=B.appendChild(C.createElement('TABLE'));D.cellPadding=0;D.cellSpacing=0;var E=D.insertRow(-1);var F=E.insertCell(-1);if (this.Style==FCK_TOOLBARITEM_ONLYICON||this.Style==FCK_TOOLBARITEM_ICONTEXT) F.appendChild(this.Icon.CreateIconElement(C));else F.appendChild(this._CreatePaddingElement(C));if (this.Style==FCK_TOOLBARITEM_ONLYTEXT||this.Style==FCK_TOOLBARITEM_ICONTEXT){F=E.insertCell(-1);F.className='TB_Button_Text';F.noWrap=true;F.appendChild(C.createTextNode(this.Label));};if (this.ShowArrow){if (this.Style!=FCK_TOOLBARITEM_ONLYICON){E.insertCell(-1).appendChild(this._CreatePaddingElement(C));};F=E.insertCell(-1);var G=F.appendChild(C.createElement('IMG'));G.src=FCKConfig.SkinPath+'images/toolbar.buttonarrow.gif';G.width=5;G.height=3;};F=E.insertCell(-1);F.appendChild(this._CreatePaddingElement(C));};A.appendChild(B);};FCKToolbarButtonUI.prototype.ChangeState=function(A,B){if (!B&&this.State==A) return;var e=this.MainElement;switch (parseInt(A)){case FCK_TRISTATE_OFF:e.className='TB_Button_Off';e.onmouseover=FCKToolbarButton_OnMouseOverOff;e.onmouseout=FCKToolbarButton_OnMouseOutOff;e.onclick=FCKToolbarButton_OnClick;break;case FCK_TRISTATE_ON:e.className='TB_Button_On';e.onmouseover=FCKToolbarButton_OnMouseOverOn;e.onmouseout=FCKToolbarButton_OnMouseOutOn;e.onclick=FCKToolbarButton_OnClick;break;case FCK_TRISTATE_DISABLED:e.className='TB_Button_Disabled';e.onmouseover=null;e.onmouseout=null;e.onclick=null;bEnableEvents=false;break;};this.State=A;};function FCKToolbarButtonUI_Cleanup(){if (this.MainElement){this.MainElement._FCKButton=null;this.MainElement=null;}};function FCKToolbarButton_OnMouseOverOn(){this.className='TB_Button_On_Over';};function FCKToolbarButton_OnMouseOutOn(){this.className='TB_Button_On';};function FCKToolbarButton_OnMouseOverOff(){this.className='TB_Button_Off_Over';};function FCKToolbarButton_OnMouseOutOff(){this.className='TB_Button_Off';};function FCKToolbarButton_OnClick(e){if (this._FCKButton.OnClick) this._FCKButton.OnClick(this._FCKButton);};
var FCKToolbarButton=function(A,B,C,D,E,F,G){this.CommandName=A;this.Label=B;this.Tooltip=C;this.Style=D;this.SourceView=E?true:false;this.ContextSensitive=F?true:false;if (G==null) this.IconPath=FCKConfig.SkinPath+'toolbar/'+A.toLowerCase()+'.gif';else if (typeof(G)=='number') this.IconPath=[FCKConfig.SkinPath+'fck_strip.gif',16,G];};FCKToolbarButton.prototype.Create=function(A){this._UIButton=new FCKToolbarButtonUI(this.CommandName,this.Label,this.Tooltip,this.IconPath,this.Style);this._UIButton.OnClick=this.Click;this._UIButton._ToolbarButton=this;this._UIButton.Create(A);};FCKToolbarButton.prototype.RefreshState=function(){var A=FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName).GetState();if (A==this._UIButton.State) return;this._UIButton.ChangeState(A);};FCKToolbarButton.prototype.Click=function(){var A=this._ToolbarButton||this;FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(A.CommandName).Execute();};FCKToolbarButton.prototype.Enable=function(){this.RefreshState();};FCKToolbarButton.prototype.Disable=function(){this._UIButton.ChangeState(FCK_TRISTATE_DISABLED);}
var FCKSpecialCombo=function(A,B,C,D,E){this.FieldWidth=B||100;this.PanelWidth=C||150;this.PanelMaxHeight=D||150;this.Label='&nbsp;';this.Caption=A;this.Tooltip=A;this.Style=FCK_TOOLBARITEM_ICONTEXT;this.Enabled=true;this.Items=new Object();this._Panel=new FCKPanel(E||window,true);this._Panel.AppendStyleSheet(FCKConfig.SkinPath+'fck_editor.css');this._PanelBox=this._Panel.MainNode.appendChild(this._Panel.Document.createElement('DIV'));this._PanelBox.className='SC_Panel';this._PanelBox.style.width=this.PanelWidth+'px';this._PanelBox.innerHTML='<table cellpadding="0" cellspacing="0" width="100%" style="TABLE-LAYOUT: fixed"><tr><td nowrap></td></tr></table>';this._ItemsHolderEl=this._PanelBox.getElementsByTagName('TD')[0];if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKSpecialCombo_Cleanup);};function FCKSpecialCombo_ItemOnMouseOver(){this.className+=' SC_ItemOver';};function FCKSpecialCombo_ItemOnMouseOut(){this.className=this.originalClass;};function FCKSpecialCombo_ItemOnClick(){this.className=this.originalClass;this.FCKSpecialCombo._Panel.Hide();this.FCKSpecialCombo.SetLabel(this.FCKItemLabel);if (typeof(this.FCKSpecialCombo.OnSelect)=='function') this.FCKSpecialCombo.OnSelect(this.FCKItemID,this);};FCKSpecialCombo.prototype.AddItem=function(A,B,C,D){var E=this._ItemsHolderEl.appendChild(this._Panel.Document.createElement('DIV'));E.className=E.originalClass='SC_Item';E.innerHTML=B;E.FCKItemID=A;E.FCKItemLabel=C||A;E.FCKSpecialCombo=this;E.Selected=false;if (FCKBrowserInfo.IsIE) E.style.width='100%';if (D) E.style.backgroundColor=D;E.onmouseover=FCKSpecialCombo_ItemOnMouseOver;E.onmouseout=FCKSpecialCombo_ItemOnMouseOut;E.onclick=FCKSpecialCombo_ItemOnClick;this.Items[A.toString().toLowerCase()]=E;return E;};FCKSpecialCombo.prototype.SelectItem=function(A){A=A?A.toString().toLowerCase():'';var B=this.Items[A];if (B){B.className=B.originalClass='SC_ItemSelected';B.Selected=true;}};FCKSpecialCombo.prototype.SelectItemByLabel=function(A,B){for (var C in this.Items){var D=this.Items[C];if (D.FCKItemLabel==A){D.className=D.originalClass='SC_ItemSelected';D.Selected=true;if (B) this.SetLabel(A);}}};FCKSpecialCombo.prototype.DeselectAll=function(A){for (var i in this.Items){this.Items[i].className=this.Items[i].originalClass='SC_Item';this.Items[i].Selected=false;};if (A) this.SetLabel('');};FCKSpecialCombo.prototype.SetLabelById=function(A){A=A?A.toString().toLowerCase():'';var B=this.Items[A];this.SetLabel(B?B.FCKItemLabel:'');};FCKSpecialCombo.prototype.SetLabel=function(A){this.Label=A.length==0?'&nbsp;':A;if (this._LabelEl) this._LabelEl.innerHTML=this.Label;};FCKSpecialCombo.prototype.SetEnabled=function(A){this.Enabled=A;this._OuterTable.className=A?'':'SC_FieldDisabled';};FCKSpecialCombo.prototype.Create=function(A){var B=FCKTools.GetElementDocument(A);var C=this._OuterTable=A.appendChild(B.createElement('TABLE'));C.cellPadding=0;C.cellSpacing=0;C.insertRow(-1);var D;var E;switch (this.Style){case FCK_TOOLBARITEM_ONLYICON:D='TB_ButtonType_Icon';E=false;break;case FCK_TOOLBARITEM_ONLYTEXT:D='TB_ButtonType_Text';E=false;break;case FCK_TOOLBARITEM_ICONTEXT:E=true;break;};if (this.Caption&&this.Caption.length>0&&E){var F=C.rows[0].insertCell(-1);F.innerHTML=this.Caption;F.className='SC_FieldCaption';};var G=FCKTools.AppendElement(C.rows[0].insertCell(-1),'div');if (E){G.className='SC_Field';G.style.width=this.FieldWidth+'px';G.innerHTML='<table width="100%" cellpadding="0" cellspacing="0" style="TABLE-LAYOUT: fixed;"><tbody><tr><td class="SC_FieldLabel"><label>&nbsp;</label></td><td class="SC_FieldButton">&nbsp;</td></tr></tbody></table>';this._LabelEl=G.getElementsByTagName('label')[0];this._LabelEl.innerHTML=this.Label;}else{G.className='TB_Button_Off';G.innerHTML='<table title="'+this.Tooltip+'" class="'+D+'" cellspacing="0" cellpadding="0" border="0">'+'<tr>'+'<td><img class="TB_Button_Padding" src="'+FCK_SPACER_PATH+'" /></td>'+'<td class="TB_Text">'+this.Caption+'</td>'+'<td><img class="TB_Button_Padding" src="'+FCK_SPACER_PATH+'" /></td>'+'<td class="TB_ButtonArrow"><img src="'+FCKConfig.SkinPath+'images/toolbar.buttonarrow.gif" width="5" height="3"></td>'+'<td><img class="TB_Button_Padding" src="'+FCK_SPACER_PATH+'" /></td>'+'</tr>'+'</table>';};G.SpecialCombo=this;G.onmouseover=FCKSpecialCombo_OnMouseOver;G.onmouseout=FCKSpecialCombo_OnMouseOut;G.onclick=FCKSpecialCombo_OnClick;FCKTools.DisableSelection(this._Panel.Document.body);};function FCKSpecialCombo_Cleanup(){this._LabelEl=null;this._OuterTable=null;this._ItemsHolderEl=null;this._PanelBox=null;if (this.Items){for (var key in this.Items) this.Items[key]=null;}};function FCKSpecialCombo_OnMouseOver(){if (this.SpecialCombo.Enabled){switch (this.SpecialCombo.Style){case FCK_TOOLBARITEM_ONLYICON:this.className='TB_Button_On_Over';break;case FCK_TOOLBARITEM_ONLYTEXT:this.className='TB_Button_On_Over';break;case FCK_TOOLBARITEM_ICONTEXT:this.className='SC_Field SC_FieldOver';break;}}};function FCKSpecialCombo_OnMouseOut(){switch (this.SpecialCombo.Style){case FCK_TOOLBARITEM_ONLYICON:this.className='TB_Button_Off';break;case FCK_TOOLBARITEM_ONLYTEXT:this.className='TB_Button_Off';break;case FCK_TOOLBARITEM_ICONTEXT:this.className='SC_Field';break;}};function FCKSpecialCombo_OnClick(e){var oSpecialCombo=this.SpecialCombo;if (oSpecialCombo.Enabled){var oPanel=oSpecialCombo._Panel;var oPanelBox=oSpecialCombo._PanelBox;var oItemsHolder=oSpecialCombo._ItemsHolderEl;var iMaxHeight=oSpecialCombo.PanelMaxHeight;if (oSpecialCombo.OnBeforeClick) oSpecialCombo.OnBeforeClick(oSpecialCombo);if (FCKBrowserInfo.IsIE) oPanel.Preload(0,this.offsetHeight,this);if (oItemsHolder.offsetHeight>iMaxHeight) oPanelBox.style.height=iMaxHeight+'px';else oPanelBox.style.height='';oPanel.Show(0,this.offsetHeight,this);}};
var FCKToolbarSpecialCombo=function(){this.SourceView=false;this.ContextSensitive=true;};function FCKToolbarSpecialCombo_OnSelect(itemId,item){FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName).Execute(itemId,item);};FCKToolbarSpecialCombo.prototype.Create=function(A){this._Combo=new FCKSpecialCombo(this.GetLabel(),this.FieldWidth,this.PanelWidth,this.PanelMaxHeight,FCKBrowserInfo.IsIE?window:FCKTools.GetElementWindow(A).parent);this._Combo.Tooltip=this.Tooltip;this._Combo.Style=this.Style;this.CreateItems(this._Combo);this._Combo.Create(A);this._Combo.CommandName=this.CommandName;this._Combo.OnSelect=FCKToolbarSpecialCombo_OnSelect;};function FCKToolbarSpecialCombo_RefreshActiveItems(combo,value){combo.DeselectAll();combo.SelectItem(value);combo.SetLabelById(value);};FCKToolbarSpecialCombo.prototype.RefreshState=function(){var A;var B=FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName).GetState();if (B!=FCK_TRISTATE_DISABLED){A=FCK_TRISTATE_ON;if (this.RefreshActiveItems) this.RefreshActiveItems(this._Combo,B);else{if (this._LastValue!=B){this._LastValue=B;FCKToolbarSpecialCombo_RefreshActiveItems(this._Combo,B);}}}else A=FCK_TRISTATE_DISABLED;if (A==this.State) return;if (A==FCK_TRISTATE_DISABLED){this._Combo.DeselectAll();this._Combo.SetLabel('');};this.State=A;this._Combo.SetEnabled(A!=FCK_TRISTATE_DISABLED);};FCKToolbarSpecialCombo.prototype.Enable=function(){this.RefreshState();};FCKToolbarSpecialCombo.prototype.Disable=function(){this.State=FCK_TRISTATE_DISABLED;this._Combo.DeselectAll();this._Combo.SetLabel('');this._Combo.SetEnabled(false);}
var FCKToolbarFontsCombo=function(A,B){this.CommandName='FontName';this.Label=this.GetLabel();this.Tooltip=A?A:this.Label;this.Style=B?B:FCK_TOOLBARITEM_ICONTEXT;};FCKToolbarFontsCombo.prototype=new FCKToolbarSpecialCombo;FCKToolbarFontsCombo.prototype.GetLabel=function(){return FCKLang.Font;};FCKToolbarFontsCombo.prototype.CreateItems=function(A){var B=FCKConfig.FontNames.split(';');for (var i=0;i<B.length;i++) this._Combo.AddItem(B[i],'<font face="'+B[i]+'" style="font-size: 12px">'+B[i]+'</font>');}
var FCKToolbarFontSizeCombo=function(A,B){this.CommandName='FontSize';this.Label=this.GetLabel();this.Tooltip=A?A:this.Label;this.Style=B?B:FCK_TOOLBARITEM_ICONTEXT;};FCKToolbarFontSizeCombo.prototype=new FCKToolbarSpecialCombo;FCKToolbarFontSizeCombo.prototype.GetLabel=function(){return FCKLang.FontSize;};FCKToolbarFontSizeCombo.prototype.CreateItems=function(A){A.FieldWidth=70;var B=FCKConfig.FontSizes.split(';');for (var i=0;i<B.length;i++){var C=B[i].split('/');this._Combo.AddItem(C[0],'<font size="'+C[0]+'">'+C[1]+'</font>',C[1]);}}
var FCKToolbarFontFormatCombo=function(A,B){this.CommandName='FontFormat';this.Label=this.GetLabel();this.Tooltip=A?A:this.Label;this.Style=B?B:FCK_TOOLBARITEM_ICONTEXT;this.NormalLabel='Normal';this.PanelWidth=190;};FCKToolbarFontFormatCombo.prototype=new FCKToolbarSpecialCombo;FCKToolbarFontFormatCombo.prototype.GetLabel=function(){return FCKLang.FontFormat;};FCKToolbarFontFormatCombo.prototype.CreateItems=function(A){FCKTools.AppendStyleSheet(A._Panel.Document,FCKConfig.ToolbarComboPreviewCSS);var B=FCKLang['FontFormats'].split(';');var C={p:B[0],pre:B[1],address:B[2],h1:B[3],h2:B[4],h3:B[5],h4:B[6],h5:B[7],h6:B[8],div:B[9]};var D=FCKConfig.FontFormats.split(';');for (var i=0;i<D.length;i++){var E=D[i];var F=C[E];if (E=='p') this.NormalLabel=F;this._Combo.AddItem(E,'<div class="BaseFont"><'+E+'>'+F+'</'+E+'></div>',F);}};if (FCKBrowserInfo.IsIE){FCKToolbarFontFormatCombo.prototype.RefreshActiveItems=function(A,B){if (B==this.NormalLabel){if (A.Label!='&nbsp;') A.DeselectAll(true);}else{if (this._LastValue==B) return;A.SelectItemByLabel(B,true);};this._LastValue=B;}}
var FCKToolbarStyleCombo=function(A,B){this.CommandName='Style';this.Label=this.GetLabel();this.Tooltip=A?A:this.Label;this.Style=B?B:FCK_TOOLBARITEM_ICONTEXT;};FCKToolbarStyleCombo.prototype=new FCKToolbarSpecialCombo;FCKToolbarStyleCombo.prototype.GetLabel=function(){return FCKLang.Style;};FCKToolbarStyleCombo.prototype.CreateItems=function(A){var B=A._Panel.Document;FCKTools.AppendStyleSheet(B,FCKConfig.ToolbarComboPreviewCSS);B.body.className+=' ForceBaseFont';if (!FCKBrowserInfo.IsGecko) A.OnBeforeClick=this.RefreshVisibleItems;var C=FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName).Styles;for (var s in C){var D=C[s];var E;if (D.IsObjectElement) E=A.AddItem(s,s);else E=A.AddItem(s,D.GetOpenerTag()+s+D.GetCloserTag());E.Style=D;}};FCKToolbarStyleCombo.prototype.RefreshActiveItems=function(A){A.DeselectAll();var B=FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName).GetActiveStyles();if (B.length>0){for (var i=0;i<B.length;i++) A.SelectItem(B[i].Name);A.SetLabelById(B[0].Name);}else A.SetLabel('');};FCKToolbarStyleCombo.prototype.RefreshVisibleItems=function(A){if (FCKSelection.GetType()=='Control') var B=FCKSelection.GetSelectedElement().tagName;for (var i in A.Items){var C=A.Items[i];if ((B&&C.Style.Element==B)||(!B&&!C.Style.IsObjectElement)) C.style.display='';else C.style.display='none';}}
var FCKToolbarPanelButton=function(A,B,C,D,E){this.CommandName=A;var F;if (E==null) F=FCKConfig.SkinPath+'toolbar/'+A.toLowerCase()+'.gif';else if (typeof(E)=='number') F=[FCKConfig.SkinPath+'fck_strip.gif',16,E];var G=this._UIButton=new FCKToolbarButtonUI(A,B,C,F,D);G._FCKToolbarPanelButton=this;G.ShowArrow=true;G.OnClick=FCKToolbarPanelButton_OnButtonClick;};FCKToolbarPanelButton.prototype.TypeName='FCKToolbarPanelButton';FCKToolbarPanelButton.prototype.Create=function(A){A.className+='Menu';this._UIButton.Create(A);var B=FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName)._Panel;B._FCKToolbarPanelButton=this;var C=B.Document.body.appendChild(B.Document.createElement('div'));C.style.position='absolute';C.style.top='0px';var D=this.LineImg=C.appendChild(B.Document.createElement('IMG'));D.className='TB_ConnectionLine';D.src=FCK_SPACER_PATH;B.OnHide=FCKToolbarPanelButton_OnPanelHide;};function FCKToolbarPanelButton_OnButtonClick(toolbarButton){var oButton=this._FCKToolbarPanelButton;var e=oButton._UIButton.MainElement;oButton._UIButton.ChangeState(FCK_TRISTATE_ON);oButton.LineImg.style.width=(e.offsetWidth-2)+'px';FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(oButton.CommandName).Execute(0,e.offsetHeight-1,e);};function FCKToolbarPanelButton_OnPanelHide(){var oMenuButton=this._FCKToolbarPanelButton;oMenuButton._UIButton.ChangeState(FCK_TRISTATE_OFF);};FCKToolbarPanelButton.prototype.RefreshState=FCKToolbarButton.prototype.RefreshState;FCKToolbarPanelButton.prototype.Enable=FCKToolbarButton.prototype.Enable;FCKToolbarPanelButton.prototype.Disable=FCKToolbarButton.prototype.Disable;
var FCKToolbarItems=new Object();FCKToolbarItems.LoadedItems=new Object();FCKToolbarItems.RegisterItem=function(A,B){this.LoadedItems[A]=B;};FCKToolbarItems.GetItem=function(A){var B=FCKToolbarItems.LoadedItems[A];if (B) return B;switch (A){case 'Source':B=new FCKToolbarButton('Source',FCKLang.Source,null,FCK_TOOLBARITEM_ICONTEXT,true,true,1);break;case 'DocProps':B=new FCKToolbarButton('DocProps',FCKLang.DocProps,null,null,null,null,2);break;case 'Save':B=new FCKToolbarButton('Save',FCKLang.Save,null,null,true,null,3);break;case 'NewPage':B=new FCKToolbarButton('NewPage',FCKLang.NewPage,null,null,true,null,4);break;case 'Preview':B=new FCKToolbarButton('Preview',FCKLang.Preview,null,null,true,null,5);break;case 'Templates':B=new FCKToolbarButton('Templates',FCKLang.Templates,null,null,null,null,6);break;case 'About':B=new FCKToolbarButton('About',FCKLang.About,null,null,true,null,47);break;case 'Cut':B=new FCKToolbarButton('Cut',FCKLang.Cut,null,null,false,true,7);break;case 'Copy':B=new FCKToolbarButton('Copy',FCKLang.Copy,null,null,false,true,8);break;case 'Paste':B=new FCKToolbarButton('Paste',FCKLang.Paste,null,null,false,true,9);break;case 'PasteText':B=new FCKToolbarButton('PasteText',FCKLang.PasteText,null,null,false,true,10);break;case 'PasteWord':B=new FCKToolbarButton('PasteWord',FCKLang.PasteWord,null,null,false,true,11);break;case 'Print':B=new FCKToolbarButton('Print',FCKLang.Print,null,null,false,true,12);break;case 'SpellCheck':B=new FCKToolbarButton('SpellCheck',FCKLang.SpellCheck,null,null,null,null,13);break;case 'Undo':B=new FCKToolbarButton('Undo',FCKLang.Undo,null,null,false,true,14);break;case 'Redo':B=new FCKToolbarButton('Redo',FCKLang.Redo,null,null,false,true,15);break;case 'SelectAll':B=new FCKToolbarButton('SelectAll',FCKLang.SelectAll,null,null,null,null,18);break;case 'RemoveFormat':B=new FCKToolbarButton('RemoveFormat',FCKLang.RemoveFormat,null,null,false,true,19);break;case 'FitWindow':B=new FCKToolbarButton('FitWindow',FCKLang.FitWindow,null,null,true,true,66);break;case 'Bold':B=new FCKToolbarButton('Bold',FCKLang.Bold,null,null,false,true,20);break;case 'Italic':B=new FCKToolbarButton('Italic',FCKLang.Italic,null,null,false,true,21);break;case 'Underline':B=new FCKToolbarButton('Underline',FCKLang.Underline,null,null,false,true,22);break;case 'StrikeThrough':B=new FCKToolbarButton('StrikeThrough',FCKLang.StrikeThrough,null,null,false,true,23);break;case 'Subscript':B=new FCKToolbarButton('Subscript',FCKLang.Subscript,null,null,false,true,24);break;case 'Superscript':B=new FCKToolbarButton('Superscript',FCKLang.Superscript,null,null,false,true,25);break;case 'OrderedList':B=new FCKToolbarButton('InsertOrderedList',FCKLang.NumberedListLbl,FCKLang.NumberedList,null,false,true,26);break;case 'UnorderedList':B=new FCKToolbarButton('InsertUnorderedList',FCKLang.BulletedListLbl,FCKLang.BulletedList,null,false,true,27);break;case 'Outdent':B=new FCKToolbarButton('Outdent',FCKLang.DecreaseIndent,null,null,false,true,28);break;case 'Indent':B=new FCKToolbarButton('Indent',FCKLang.IncreaseIndent,null,null,false,true,29);break;case 'Link':B=new FCKToolbarButton('Link',FCKLang.InsertLinkLbl,FCKLang.InsertLink,null,false,true,34);break;case 'Unlink':B=new FCKToolbarButton('Unlink',FCKLang.RemoveLink,null,null,false,true,35);break;case 'Anchor':B=new FCKToolbarButton('Anchor',FCKLang.Anchor,null,null,null,null,36);break;case 'Image':B=new FCKToolbarButton('Image',FCKLang.InsertImageLbl,FCKLang.InsertImage,null,false,true,37);break;case 'Flash':B=new FCKToolbarButton('Flash',FCKLang.InsertFlashLbl,FCKLang.InsertFlash,null,false,true,38);break;case 'Table':B=new FCKToolbarButton('Table',FCKLang.InsertTableLbl,FCKLang.InsertTable,null,false,true,39);break;case 'SpecialChar':B=new FCKToolbarButton('SpecialChar',FCKLang.InsertSpecialCharLbl,FCKLang.InsertSpecialChar,null,false,true,42);break;case 'Smiley':B=new FCKToolbarButton('Smiley',FCKLang.InsertSmileyLbl,FCKLang.InsertSmiley,null,false,true,41);break;case 'PageBreak':B=new FCKToolbarButton('PageBreak',FCKLang.PageBreakLbl,FCKLang.PageBreak,null,false,true,43);break;case 'UniversalKey':B=new FCKToolbarButton('UniversalKey',FCKLang.UniversalKeyboard,null,null,false,true,44);break;case 'Rule':B=new FCKToolbarButton('InsertHorizontalRule',FCKLang.InsertLineLbl,FCKLang.InsertLine,null,false,true,40);break;case 'JustifyLeft':B=new FCKToolbarButton('JustifyLeft',FCKLang.LeftJustify,null,null,false,true,30);break;case 'JustifyCenter':B=new FCKToolbarButton('JustifyCenter',FCKLang.CenterJustify,null,null,false,true,31);break;case 'JustifyRight':B=new FCKToolbarButton('JustifyRight',FCKLang.RightJustify,null,null,false,true,32);break;case 'JustifyFull':B=new FCKToolbarButton('JustifyFull',FCKLang.BlockJustify,null,null,false,true,33);break;case 'Style':B=new FCKToolbarStyleCombo();break;case 'FontName':B=new FCKToolbarFontsCombo();break;case 'FontSize':B=new FCKToolbarFontSizeCombo();break;case 'FontFormat':B=new FCKToolbarFontFormatCombo();break;case 'TextColor':B=new FCKToolbarPanelButton('TextColor',FCKLang.TextColor,null,null,45);break;case 'BGColor':B=new FCKToolbarPanelButton('BGColor',FCKLang.BGColor,null,null,46);break;case 'Find':B=new FCKToolbarButton('Find',FCKLang.Find,null,null,null,null,16);break;case 'Replace':B=new FCKToolbarButton('Replace',FCKLang.Replace,null,null,null,null,17);break;case 'Form':B=new FCKToolbarButton('Form',FCKLang.Form,null,null,null,null,48);break;case 'Checkbox':B=new FCKToolbarButton('Checkbox',FCKLang.Checkbox,null,null,null,null,49);break;case 'Radio':B=new FCKToolbarButton('Radio',FCKLang.RadioButton,null,null,null,null,50);break;case 'TextField':B=new FCKToolbarButton('TextField',FCKLang.TextField,null,null,null,null,51);break;case 'Textarea':B=new FCKToolbarButton('Textarea',FCKLang.Textarea,null,null,null,null,52);break;case 'HiddenField':B=new FCKToolbarButton('HiddenField',FCKLang.HiddenField,null,null,null,null,56);break;case 'Button':B=new FCKToolbarButton('Button',FCKLang.Button,null,null,null,null,54);break;case 'Select':B=new FCKToolbarButton('Select',FCKLang.SelectionField,null,null,null,null,53);break;case 'ImageButton':B=new FCKToolbarButton('ImageButton',FCKLang.ImageButton,null,null,null,null,55);break;default:alert(FCKLang.UnknownToolbarItem.replace(/%1/g,A));return null;};FCKToolbarItems.LoadedItems[A]=B;return B;}
var FCKToolbar=function(){this.Items=new Array();if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKToolbar_Cleanup);};FCKToolbar.prototype.AddItem=function(A){return this.Items[this.Items.length]=A;};FCKToolbar.prototype.AddButton=function(A,B,C,D,E,F){if (typeof(D)=='number') D=[this.DefaultIconsStrip,this.DefaultIconSize,D];var G=new FCKToolbarButtonUI(A,B,C,D,E,F);G._FCKToolbar=this;G.OnClick=FCKToolbar_OnItemClick;return this.AddItem(G);};function FCKToolbar_OnItemClick(item){var oToolbar=item._FCKToolbar;if (oToolbar.OnItemClick) oToolbar.OnItemClick(oToolbar,item);};FCKToolbar.prototype.AddSeparator=function(){this.AddItem(new FCKToolbarSeparator());};FCKToolbar.prototype.Create=function(A){if (this.MainElement){if (this.MainElement.parentNode) this.MainElement.parentNode.removeChild(this.MainElement);this.MainElement=null;};var B=FCKTools.GetElementDocument(A);var e=this.MainElement=B.createElement('table');e.className='TB_Toolbar';e.style.styleFloat=e.style.cssFloat=(FCKLang.Dir=='ltr'?'left':'right');e.dir=FCKLang.Dir;e.cellPadding=0;e.cellSpacing=0;this.RowElement=e.insertRow(-1);var C;if (!this.HideStart){C=this.RowElement.insertCell(-1);C.appendChild(B.createElement('div')).className='TB_Start';};for (var i=0;i<this.Items.length;i++){this.Items[i].Create(this.RowElement.insertCell(-1));};if (!this.HideEnd){C=this.RowElement.insertCell(-1);C.appendChild(B.createElement('div')).className='TB_End';};A.appendChild(e);};function FCKToolbar_Cleanup(){this.MainElement=null;this.RowElement=null;};var FCKToolbarSeparator=function(){};FCKToolbarSeparator.prototype.Create=function(A){FCKTools.AppendElement(A,'div').className='TB_Separator';}
var FCKToolbarBreak=function(){};FCKToolbarBreak.prototype.Create=function(A){var B=A.ownerDocument.createElement('div');B.style.clear=B.style.cssFloat=FCKLang.Dir=='rtl'?'right':'left';A.appendChild(B);}
function FCKToolbarSet_Create(overhideLocation){var oToolbarSet;var sLocation=overhideLocation||FCKConfig.ToolbarLocation;switch (sLocation){case 'In':document.getElementById('xToolbarRow').style.display='';oToolbarSet=new FCKToolbarSet(document);break;default:FCK.Events.AttachEvent('OnBlur',FCK_OnBlur);FCK.Events.AttachEvent('OnFocus',FCK_OnFocus);var eToolbarTarget;var oOutMatch=sLocation.match(/^Out:(.+)\((\w+)\)$/);if (oOutMatch){eToolbarTarget=eval('parent.'+oOutMatch[1]).document.getElementById(oOutMatch[2]);}else{oOutMatch=sLocation.match(/^Out:(\w+)$/);if (oOutMatch) eToolbarTarget=parent.document.getElementById(oOutMatch[1]);};if (!eToolbarTarget){alert('Invalid value for "ToolbarLocation"');return this._Init('In');};if (oToolbarSet=eToolbarTarget.__FCKToolbarSet) break;var eToolbarIFrame=FCKTools.GetElementDocument(eToolbarTarget).createElement('iframe');eToolbarIFrame.frameBorder=0;eToolbarIFrame.width='100%';eToolbarIFrame.height='10';eToolbarTarget.appendChild(eToolbarIFrame);eToolbarIFrame.unselectable='on';var eTargetDocument=eToolbarIFrame.contentWindow.document;eTargetDocument.open();eTargetDocument.write('<html><head><script type="text/javascript"> window.onload = window.onresize = function() { window.frameElement.height = document.body.scrollHeight ; } </script></head><body style="overflow: hidden">'+document.getElementById('xToolbarSpace').innerHTML+'</body></html>');eTargetDocument.close();eTargetDocument.oncontextmenu=FCKTools.CancelEvent;FCKTools.AppendStyleSheet(eTargetDocument,FCKConfig.SkinPath+'fck_editor.css');oToolbarSet=eToolbarTarget.__FCKToolbarSet=new FCKToolbarSet(eTargetDocument);oToolbarSet._IFrame=eToolbarIFrame;if (FCK.IECleanup) FCK.IECleanup.AddItem(eToolbarTarget,FCKToolbarSet_Target_Cleanup);};oToolbarSet.CurrentInstance=FCK;FCK.AttachToOnSelectionChange(oToolbarSet.RefreshItemsState);return oToolbarSet;};function FCK_OnBlur(editorInstance){var eToolbarSet=editorInstance.ToolbarSet;if (eToolbarSet.CurrentInstance==editorInstance) eToolbarSet.Disable();};function FCK_OnFocus(editorInstance){var oToolbarset=editorInstance.ToolbarSet;var oInstance=editorInstance||FCK;oToolbarset.CurrentInstance.FocusManager.RemoveWindow(oToolbarset._IFrame.contentWindow);oToolbarset.CurrentInstance=oInstance;oInstance.FocusManager.AddWindow(oToolbarset._IFrame.contentWindow,true);oToolbarset.Enable();};function FCKToolbarSet_Cleanup(){this._TargetElement=null;this._IFrame=null;};function FCKToolbarSet_Target_Cleanup(){this.__FCKToolbarSet=null;};var FCKToolbarSet=function(A){this._Document=A;this._TargetElement=A.getElementById('xToolbar');var B=A.getElementById('xExpandHandle');var C=A.getElementById('xCollapseHandle');B.title=FCKLang.ToolbarExpand;B.onclick=FCKToolbarSet_Expand_OnClick;C.title=FCKLang.ToolbarCollapse;C.onclick=FCKToolbarSet_Collapse_OnClick;if (!FCKConfig.ToolbarCanCollapse||FCKConfig.ToolbarStartExpanded) this.Expand();else this.Collapse();C.style.display=FCKConfig.ToolbarCanCollapse?'':'none';if (FCKConfig.ToolbarCanCollapse) C.style.display='';else A.getElementById('xTBLeftBorder').style.display='';this.Toolbars=new Array();this.IsLoaded=false;if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKToolbarSet_Cleanup);};function FCKToolbarSet_Expand_OnClick(){FCK.ToolbarSet.Expand();};function FCKToolbarSet_Collapse_OnClick(){FCK.ToolbarSet.Collapse();};FCKToolbarSet.prototype.Expand=function(){this._ChangeVisibility(false);};FCKToolbarSet.prototype.Collapse=function(){this._ChangeVisibility(true);};FCKToolbarSet.prototype._ChangeVisibility=function(A){this._Document.getElementById('xCollapsed').style.display=A?'':'none';this._Document.getElementById('xExpanded').style.display=A?'none':'';if (FCKBrowserInfo.IsGecko){FCKTools.RunFunction(window.onresize);}};FCKToolbarSet.prototype.Load=function(A){this.Name=A;this.Items=new Array();this.ItemsWysiwygOnly=new Array();this.ItemsContextSensitive=new Array();this._TargetElement.innerHTML='';var B=FCKConfig.ToolbarSets[A];if (!B){alert(FCKLang.UnknownToolbarSet.replace(/%1/g,A));return;};this.Toolbars=new Array();for (var x=0;x<B.length;x++){var C=B[x];var D;if (typeof(C)=='string'){if (C=='/') D=new FCKToolbarBreak();}else{D=new FCKToolbar();for (var j=0;j<C.length;j++){var E=C[j];if (E=='-') D.AddSeparator();else{var F=FCKToolbarItems.GetItem(E);if (F){D.AddItem(F);this.Items.push(F);if (!F.SourceView) this.ItemsWysiwygOnly.push(F);if (F.ContextSensitive) this.ItemsContextSensitive.push(F);}}}};D.Create(this._TargetElement);this.Toolbars[this.Toolbars.length]=D;};FCKTools.DisableSelection(this._Document.getElementById('xCollapseHandle').parentNode);if (FCK.Status!=FCK_STATUS_COMPLETE) FCK.Events.AttachEvent('OnStatusChange',this.RefreshModeState);else this.RefreshModeState();this.IsLoaded=true;this.IsEnabled=true;FCKTools.RunFunction(this.OnLoad);};FCKToolbarSet.prototype.Enable=function(){if (this.IsEnabled) return;this.IsEnabled=true;var A=this.Items;for (var i=0;i<A.length;i++) A[i].RefreshState();};FCKToolbarSet.prototype.Disable=function(){if (!this.IsEnabled) return;this.IsEnabled=false;var A=this.Items;for (var i=0;i<A.length;i++) A[i].Disable();};FCKToolbarSet.prototype.RefreshModeState=function(A){if (FCK.Status!=FCK_STATUS_COMPLETE) return;var B=A?A.ToolbarSet:this;var C=B.ItemsWysiwygOnly;if (FCK.EditMode==FCK_EDITMODE_WYSIWYG){for (var i=0;i<C.length;i++) C[i].Enable();B.RefreshItemsState(A);}else{B.RefreshItemsState(A);for (var i=0;i<C.length;i++) C[i].Disable();}};FCKToolbarSet.prototype.RefreshItemsState=function(A){var B=(A?A.ToolbarSet:this).ItemsContextSensitive;for (var i=0;i<B.length;i++) B[i].RefreshState();};
var FCKDialog=new Object();FCKDialog.OpenDialog=function(A,B,C,D,E,F,G,H){var I=new Object();I.Title=B;I.Page=C;I.Editor=window;I.CustomValue=F;var J=FCKConfig.BasePath+'fckdialog.html';this.Show(I,A,J,D,E,G,H);};
FCKDialog.Show=function(A,B,C,D,E,F,G){var H=(FCKConfig.ScreenHeight-E)/2;var I=(FCKConfig.ScreenWidth-D)/2;var J="location=no,menubar=no,toolbar=no,dependent=yes,dialog=yes,minimizable=no,modal=yes,alwaysRaised=yes"+",resizable="+(G?'yes':'no')+",width="+D+",height="+E+",top="+H+",left="+I;if (!F) F=window;FCKFocusManager.Lock();var K=F.open('','FCKeditorDialog_'+B,J,true);if (!K){alert(FCKLang.DialogBlocked);FCKFocusManager.Unlock();return;};K.moveTo(I,H);K.resizeTo(D,E);K.focus();K.location.href=C;K.dialogArguments=A;F.FCKLastDialogInfo=A;this.Window=K;try{window.top.captureEvents(Event.CLICK|Event.MOUSEDOWN|Event.MOUSEUP|Event.FOCUS);window.top.parent.addEventListener('mousedown',this.CheckFocus,true);window.top.parent.addEventListener('mouseup',this.CheckFocus,true);window.top.parent.addEventListener('click',this.CheckFocus,true);window.top.parent.addEventListener('focus',this.CheckFocus,true);}catch (e){}};FCKDialog.CheckFocus=function(){if (typeof(FCKDialog)!="object") return false;if (FCKDialog.Window&&!FCKDialog.Window.closed) FCKDialog.Window.focus();else{try{window.top.releaseEvents(Event.CLICK|Event.MOUSEDOWN|Event.MOUSEUP|Event.FOCUS);window.top.parent.removeEventListener('onmousedown',FCKDialog.CheckFocus,true);window.top.parent.removeEventListener('mouseup',FCKDialog.CheckFocus,true);window.top.parent.removeEventListener('click',FCKDialog.CheckFocus,true);window.top.parent.removeEventListener('onfocus',FCKDialog.CheckFocus,true);}catch (e){}};return false;};
var FCKMenuItem=function(A,B,C,D,E){this.Name=B;this.Label=C||B;this.IsDisabled=E;this.Icon=new FCKIcon(D);this.SubMenu=new FCKMenuBlockPanel();this.SubMenu.Parent=A;this.SubMenu.OnClick=FCKTools.CreateEventListener(FCKMenuItem_SubMenu_OnClick,this);if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKMenuItem_Cleanup);};FCKMenuItem.prototype.AddItem=function(A,B,C,D){this.HasSubMenu=true;return this.SubMenu.AddItem(A,B,C,D);};FCKMenuItem.prototype.AddSeparator=function(){this.SubMenu.AddSeparator();};FCKMenuItem.prototype.Create=function(A){var B=this.HasSubMenu;var C=FCKTools.GetElementDocument(A);var r=this.MainElement=A.insertRow(-1);r.className=this.IsDisabled?'MN_Item_Disabled':'MN_Item';if (!this.IsDisabled){FCKTools.AddEventListenerEx(r,'mouseover',FCKMenuItem_OnMouseOver,[this]);FCKTools.AddEventListenerEx(r,'click',FCKMenuItem_OnClick,[this]);if (!B) FCKTools.AddEventListenerEx(r,'mouseout',FCKMenuItem_OnMouseOut,[this]);};var D=r.insertCell(-1);D.className='MN_Icon';D.appendChild(this.Icon.CreateIconElement(C));D=r.insertCell(-1);D.className='MN_Label';D.noWrap=true;D.appendChild(C.createTextNode(this.Label));D=r.insertCell(-1);if (B){D.className='MN_Arrow';var E=D.appendChild(C.createElement('IMG'));E.src=FCK_IMAGES_PATH+'arrow_'+FCKLang.Dir+'.gif';E.width=4;E.height=7;this.SubMenu.Create();this.SubMenu.Panel.OnHide=FCKTools.CreateEventListener(FCKMenuItem_SubMenu_OnHide,this);}};FCKMenuItem.prototype.Activate=function(){this.MainElement.className='MN_Item_Over';if (this.HasSubMenu){this.SubMenu.Show(this.MainElement.offsetWidth+2,-2,this.MainElement);};FCKTools.RunFunction(this.OnActivate,this);};FCKMenuItem.prototype.Deactivate=function(){this.MainElement.className='MN_Item';if (this.HasSubMenu) this.SubMenu.Hide();};/* Events */ function FCKMenuItem_SubMenu_OnClick(clickedItem,listeningItem){FCKTools.RunFunction(listeningItem.OnClick,listeningItem,[clickedItem]);};function FCKMenuItem_SubMenu_OnHide(menuItem){menuItem.Deactivate();};function FCKMenuItem_OnClick(ev,menuItem){if (menuItem.HasSubMenu) menuItem.Activate();else{menuItem.Deactivate();FCKTools.RunFunction(menuItem.OnClick,menuItem,[menuItem]);}};function FCKMenuItem_OnMouseOver(ev,menuItem){menuItem.Activate();};function FCKMenuItem_OnMouseOut(ev,menuItem){menuItem.Deactivate();};function FCKMenuItem_Cleanup(){this.MainElement=null;}
var FCKMenuBlock=function(){this._Items=new Array();};FCKMenuBlock.prototype.Count=function(){return this._Items.length;};FCKMenuBlock.prototype.AddItem=function(A,B,C,D){var E=new FCKMenuItem(this,A,B,C,D);E.OnClick=FCKTools.CreateEventListener(FCKMenuBlock_Item_OnClick,this);E.OnActivate=FCKTools.CreateEventListener(FCKMenuBlock_Item_OnActivate,this);this._Items.push(E);return E;};FCKMenuBlock.prototype.AddSeparator=function(){this._Items.push(new FCKMenuSeparator());};FCKMenuBlock.prototype.RemoveAllItems=function(){this._Items=new Array();var A=this._ItemsTable;if (A){while (A.rows.length>0) A.deleteRow(0);}};FCKMenuBlock.prototype.Create=function(A){if (!this._ItemsTable){if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKMenuBlock_Cleanup);this._Window=FCKTools.GetElementWindow(A);var B=FCKTools.GetElementDocument(A);var C=A.appendChild(B.createElement('table'));C.cellPadding=0;C.cellSpacing=0;FCKTools.DisableSelection(C);var D=C.insertRow(-1).insertCell(-1);D.className='MN_Menu';var E=this._ItemsTable=D.appendChild(B.createElement('table'));E.cellPadding=0;E.cellSpacing=0;};for (var i=0;i<this._Items.length;i++) this._Items[i].Create(this._ItemsTable);};/* Events */ function FCKMenuBlock_Item_OnClick(clickedItem,menuBlock){FCKTools.RunFunction(menuBlock.OnClick,menuBlock,[clickedItem]);};function FCKMenuBlock_Item_OnActivate(menuBlock){var oActiveItem=menuBlock._ActiveItem;if (oActiveItem&&oActiveItem!=this){if (!FCKBrowserInfo.IsIE&&oActiveItem.HasSubMenu&&!this.HasSubMenu) menuBlock._Window.focus();oActiveItem.Deactivate();};menuBlock._ActiveItem=this;};function FCKMenuBlock_Cleanup(){this._Window=null;this._ItemsTable=null;};var FCKMenuSeparator=function(){};FCKMenuSeparator.prototype.Create=function(A){var B=FCKTools.GetElementDocument(A);var r=A.insertRow(-1);var C=r.insertCell(-1);C.className='MN_Separator MN_Icon';C=r.insertCell(-1);C.className='MN_Separator';C.appendChild(B.createElement('DIV')).className='MN_Separator_Line';C=r.insertCell(-1);C.className='MN_Separator';C.appendChild(B.createElement('DIV')).className='MN_Separator_Line';}
var FCKMenuBlockPanel=function(){FCKMenuBlock.call(this);};FCKMenuBlockPanel.prototype=new FCKMenuBlock();FCKMenuBlockPanel.prototype.Create=function(){var A=this.Panel=(this.Parent&&this.Parent.Panel?this.Parent.Panel.CreateChildPanel():new FCKPanel());A.AppendStyleSheet(FCKConfig.SkinPath+'fck_editor.css');FCKMenuBlock.prototype.Create.call(this,A.MainNode);};FCKMenuBlockPanel.prototype.Show=function(x,y,A){if (!this.Panel.CheckIsOpened()) this.Panel.Show(x,y,A);};FCKMenuBlockPanel.prototype.Hide=function(){if (this.Panel.CheckIsOpened()) this.Panel.Hide();}
var FCKContextMenu=function(A,B,C){var D=this._Panel=new FCKPanel(A,true);D.AppendStyleSheet(FCKConfig.SkinPath+'fck_editor.css');D.IsContextMenu=true;var E=this._MenuBlock=new FCKMenuBlock();E.Panel=D;E.OnClick=FCKTools.CreateEventListener(FCKContextMenu_MenuBlock_OnClick,this);this._Redraw=true;this.SetMouseClickWindow(B||A);};FCKContextMenu.prototype.SetMouseClickWindow=function(A){if (!FCKBrowserInfo.IsIE){this._Document=A.document;this._Document.addEventListener('contextmenu',FCKContextMenu_Document_OnContextMenu,false);}};FCKContextMenu.prototype.AddItem=function(A,B,C,D){var E=this._MenuBlock.AddItem(A,B,C,D);this._Redraw=true;return E;};FCKContextMenu.prototype.AddSeparator=function(){this._MenuBlock.AddSeparator();this._Redraw=true;};FCKContextMenu.prototype.RemoveAllItems=function(){this._MenuBlock.RemoveAllItems();this._Redraw=true;};FCKContextMenu.prototype.AttachToElement=function(A){if (FCKBrowserInfo.IsIE) FCKTools.AddEventListenerEx(A,'contextmenu',FCKContextMenu_AttachedElement_OnContextMenu,this);else A._FCKContextMenu=this;};function FCKContextMenu_Document_OnContextMenu(e){var el=e.target;while (el){if (el._FCKContextMenu){FCKTools.CancelEvent(e);FCKContextMenu_AttachedElement_OnContextMenu(e,el._FCKContextMenu,el);};el=el.parentNode;}};function FCKContextMenu_AttachedElement_OnContextMenu(ev,fckContextMenu,el){var eTarget=el||this;if (fckContextMenu.OnBeforeOpen) fckContextMenu.OnBeforeOpen.call(fckContextMenu,eTarget);if (fckContextMenu._MenuBlock.Count()==0) return false;if (fckContextMenu._Redraw){fckContextMenu._MenuBlock.Create(fckContextMenu._Panel.MainNode);fckContextMenu._Redraw=false;};fckContextMenu._Panel.Show(ev.pageX||ev.screenX,ev.pageY||ev.screenY,ev.currentTarget||null);return false;};function FCKContextMenu_MenuBlock_OnClick(menuItem,contextMenu){contextMenu._Panel.Hide();FCKTools.RunFunction(contextMenu.OnItemClick,contextMenu,menuItem);}
FCK.ContextMenu=new Object();FCK.ContextMenu.Listeners=new Array();FCK.ContextMenu.RegisterListener=function(A){if (A) this.Listeners.push(A);};function FCK_ContextMenu_Init(){var oInnerContextMenu=FCK.ContextMenu._InnerContextMenu=new FCKContextMenu(FCKBrowserInfo.IsIE?window:window.parent,FCK.EditorWindow,FCKLang.Dir);oInnerContextMenu.OnBeforeOpen=FCK_ContextMenu_OnBeforeOpen;oInnerContextMenu.OnItemClick=FCK_ContextMenu_OnItemClick;var oMenu=FCK.ContextMenu;for (var i=0;i<FCKConfig.ContextMenu.length;i++) oMenu.RegisterListener(FCK_ContextMenu_GetListener(FCKConfig.ContextMenu[i]));};function FCK_ContextMenu_GetListener(listenerName){switch (listenerName){case 'Generic':return {AddItems:function(A,B,C){A.AddItem('Cut',FCKLang.Cut,7,FCKCommands.GetCommand('Cut').GetState()==FCK_TRISTATE_DISABLED);A.AddItem('Copy',FCKLang.Copy,8,FCKCommands.GetCommand('Copy').GetState()==FCK_TRISTATE_DISABLED);A.AddItem('Paste',FCKLang.Paste,9,FCKCommands.GetCommand('Paste').GetState()==FCK_TRISTATE_DISABLED);}};case 'Table':return {AddItems:function(A,B,C){var D=(C=='TABLE');var E=(!D&&FCKSelection.HasAncestorNode('TABLE'));if (E){A.AddSeparator();var F=A.AddItem('Cell',FCKLang.CellCM);F.AddItem('TableInsertCell',FCKLang.InsertCell,58);F.AddItem('TableDeleteCells',FCKLang.DeleteCells,59);F.AddItem('TableMergeCells',FCKLang.MergeCells,60);F.AddItem('TableSplitCell',FCKLang.SplitCell,61);F.AddSeparator();F.AddItem('TableCellProp',FCKLang.CellProperties,57);A.AddSeparator();F=A.AddItem('Row',FCKLang.RowCM);F.AddItem('TableInsertRow',FCKLang.InsertRow,62);F.AddItem('TableDeleteRows',FCKLang.DeleteRows,63);A.AddSeparator();F=A.AddItem('Column',FCKLang.ColumnCM);F.AddItem('TableInsertColumn',FCKLang.InsertColumn,64);F.AddItem('TableDeleteColumns',FCKLang.DeleteColumns,65);};if (D||E){A.AddSeparator();A.AddItem('TableDelete',FCKLang.TableDelete);A.AddItem('TableProp',FCKLang.TableProperties,39);}}};case 'Link':return {AddItems:function(A,B,C){var D=(C=='A'||FCKSelection.HasAncestorNode('A'));if (D||FCK.GetNamedCommandState('Unlink')!=FCK_TRISTATE_DISABLED){A.AddSeparator();if (D) A.AddItem('Link',FCKLang.EditLink,34);A.AddItem('Unlink',FCKLang.RemoveLink,35);}}};case 'Image':return {AddItems:function(A,B,C){if (C=='IMG'&&!B.getAttribute('_fckfakelement')){A.AddSeparator();A.AddItem('Image',FCKLang.ImageProperties,37);}}};case 'Anchor':return {AddItems:function(A,B,C){if (C=='IMG'&&B.getAttribute('_fckanchor')){A.AddSeparator();A.AddItem('Anchor',FCKLang.AnchorProp,36);}}};case 'Flash':return {AddItems:function(A,B,C){if (C=='IMG'&&B.getAttribute('_fckflash')){A.AddSeparator();A.AddItem('Flash',FCKLang.FlashProperties,38);}}};case 'Form':return {AddItems:function(A,B,C){if (FCKSelection.HasAncestorNode('FORM')){A.AddSeparator();A.AddItem('Form',FCKLang.FormProp,48);}}};case 'Checkbox':return {AddItems:function(A,B,C){if (C=='INPUT'&&B.type=='checkbox'){A.AddSeparator();A.AddItem('Checkbox',FCKLang.CheckboxProp,49);}}};case 'Radio':return {AddItems:function(A,B,C){if (C=='INPUT'&&B.type=='radio'){A.AddSeparator();A.AddItem('Radio',FCKLang.RadioButtonProp,50);}}};case 'TextField':return {AddItems:function(A,B,C){if (C=='INPUT'&&(B.type=='text'||B.type=='password')){A.AddSeparator();A.AddItem('TextField',FCKLang.TextFieldProp,51);}}};case 'HiddenField':return {AddItems:function(A,B,C){if (C=='INPUT'&&B.type=='hidden'){A.AddSeparator();A.AddItem('HiddenField',FCKLang.HiddenFieldProp,56);}}};case 'ImageButton':return {AddItems:function(A,B,C){if (C=='INPUT'&&B.type=='image'){A.AddSeparator();A.AddItem('ImageButton',FCKLang.ImageButtonProp,55);}}};case 'Button':return {AddItems:function(A,B,C){if (C=='INPUT'&&(B.type=='button'||B.type=='submit'||B.type=='reset')){A.AddSeparator();A.AddItem('Button',FCKLang.ButtonProp,54);}}};case 'Select':return {AddItems:function(A,B,C){if (C=='SELECT'){A.AddSeparator();A.AddItem('Select',FCKLang.SelectionFieldProp,53);}}};case 'Textarea':return {AddItems:function(A,B,C){if (C=='TEXTAREA'){A.AddSeparator();A.AddItem('Textarea',FCKLang.TextareaProp,52);}}};case 'BulletedList':return {AddItems:function(A,B,C){if (FCKSelection.HasAncestorNode('UL')){A.AddSeparator();A.AddItem('BulletedList',FCKLang.BulletedListProp,27);}}};case 'NumberedList':return {AddItems:function(A,B,C){if (FCKSelection.HasAncestorNode('OL')){A.AddSeparator();A.AddItem('NumberedList',FCKLang.NumberedListProp,26);}}};}};function FCK_ContextMenu_OnBeforeOpen(){FCK.Events.FireEvent("OnSelectionChange");var oTag,sTagName;if (oTag=FCKSelection.GetSelectedElement()) sTagName=oTag.tagName;var oMenu=FCK.ContextMenu._InnerContextMenu;oMenu.RemoveAllItems();var aListeners=FCK.ContextMenu.Listeners;for (var i=0;i<aListeners.length;i++) aListeners[i].AddItems(oMenu,oTag,sTagName);};function FCK_ContextMenu_OnItemClick(item){FCK.Focus();FCKCommands.GetCommand(item.Name).Execute();}
var FCKPlugin=function(A,B,C){this.Name=A;this.BasePath=C?C:FCKConfig.PluginsPath;this.Path=this.BasePath+A+'/';if (!B||B.length==0) this.AvailableLangs=new Array();else this.AvailableLangs=B.split(',');};FCKPlugin.prototype.Load=function(){if (this.AvailableLangs.length>0){var A;if (this.AvailableLangs.indexOf(FCKLanguageManager.ActiveLanguage.Code)>=0) A=FCKLanguageManager.ActiveLanguage.Code;else A=this.AvailableLangs[0];LoadScript(this.Path+'lang/'+A+'.js');};LoadScript(this.Path+'fckplugin.js');}
var FCKPlugins=FCK.Plugins=new Object();FCKPlugins.ItemsCount=0;FCKPlugins.Items=new Object();FCKPlugins.Load=function(){var A=FCKPlugins.Items;for (var i=0;i<FCKConfig.Plugins.Items.length;i++){var B=FCKConfig.Plugins.Items[i];var C=A[B[0]]=new FCKPlugin(B[0],B[1],B[2]);FCKPlugins.ItemsCount++;};for (var s in A) A[s].Load();FCKPlugins.Load=null;}
/tags/Racine_livraison_narmer/api/fckeditor/editor/js/fckeditorcode_ie.js
New file
0,0 → 1,81
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* This file has been compacted for best loading performance.
*/
var FCK_STATUS_NOTLOADED=window.parent.FCK_STATUS_NOTLOADED=0;var FCK_STATUS_ACTIVE=window.parent.FCK_STATUS_ACTIVE=1;var FCK_STATUS_COMPLETE=window.parent.FCK_STATUS_COMPLETE=2;var FCK_TRISTATE_OFF=window.parent.FCK_TRISTATE_OFF=0;var FCK_TRISTATE_ON=window.parent.FCK_TRISTATE_ON=1;var FCK_TRISTATE_DISABLED=window.parent.FCK_TRISTATE_DISABLED=-1;var FCK_UNKNOWN=window.parent.FCK_UNKNOWN=-9;var FCK_TOOLBARITEM_ONLYICON=window.parent.FCK_TOOLBARITEM_ONLYICON=0;var FCK_TOOLBARITEM_ONLYTEXT=window.parent.FCK_TOOLBARITEM_ONLYTEXT=1;var FCK_TOOLBARITEM_ICONTEXT=window.parent.FCK_TOOLBARITEM_ICONTEXT=2;var FCK_EDITMODE_WYSIWYG=window.parent.FCK_EDITMODE_WYSIWYG=0;var FCK_EDITMODE_SOURCE=window.parent.FCK_EDITMODE_SOURCE=1;var FCK_IMAGES_PATH='images/';var FCK_SPACER_PATH='images/spacer.gif';
String.prototype.Contains=function(A){return (this.indexOf(A)>-1);};String.prototype.Equals=function(){for (var i=0;i<arguments.length;i++) if (this==arguments[i]) return true;return false;};String.prototype.ReplaceAll=function(A,B){var C=this;for (var i=0;i<A.length;i++){C=C.replace(A[i],B[i]);};return C;};Array.prototype.AddItem=function(A){var i=this.length;this[i]=A;return i;};Array.prototype.indexOf=function(A){for (var i=0;i<this.length;i++){if (this[i]==A) return i;};return-1;};String.prototype.startsWith=function(A){return (this.substr(0,A.length)==A);};String.prototype.endsWith=function(A,B){var C=this.length;var D=A.length;if (D>C) return false;if (B){var E=new RegExp(A+'$','i');return E.test(this);}else return (D==0||this.substr(C-D,D)==A);};String.prototype.remove=function(A,B){var s='';if (A>0) s=this.substring(0,A);if (A+B<this.length) s+=this.substring(A+B,this.length);return s;};String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,'');};String.prototype.ltrim=function(){return this.replace(/^\s*/g,'');};String.prototype.rtrim=function(){return this.replace(/\s*$/g,'');};String.prototype.replaceNewLineChars=function(A){return this.replace(/\n/g,A);}
var FCKIECleanup=function(A){this.Items=new Array();A._FCKCleanupObj=this;A.attachEvent('onunload',FCKIECleanup_Cleanup);};FCKIECleanup.prototype.AddItem=function(A,B){this.Items.push([A,B]);};function FCKIECleanup_Cleanup(){var aItems=this._FCKCleanupObj.Items;var iLenght=aItems.length;for (var i=0;i<iLenght;i++){var oItem=aItems[i];oItem[1].call(oItem[0]);aItems[i]=null;};this._FCKCleanupObj=null;if (CollectGarbage) CollectGarbage();}
var s=navigator.userAgent.toLowerCase();var FCKBrowserInfo={IsIE:s.Contains('msie'),IsIE7:s.Contains('msie 7'),IsGecko:s.Contains('gecko/'),IsSafari:s.Contains('safari'),IsOpera:s.Contains('opera')};FCKBrowserInfo.IsGeckoLike=FCKBrowserInfo.IsGecko||FCKBrowserInfo.IsSafari||FCKBrowserInfo.IsOpera;if (FCKBrowserInfo.IsGecko){var sGeckoVersion=s.match(/gecko\/(\d+)/)[1];FCKBrowserInfo.IsGecko10=sGeckoVersion<20051111;}
var FCKURLParams=new Object();var aParams=document.location.search.substr(1).split('&');for (var i=0;i<aParams.length;i++){var aParam=aParams[i].split('=');var sParamName=aParam[0];var sParamValue=aParam[1];FCKURLParams[sParamName]=sParamValue;}
var FCK=new Object();FCK.Name=FCKURLParams['InstanceName'];FCK.Status=FCK_STATUS_NOTLOADED;FCK.EditMode=FCK_EDITMODE_WYSIWYG;FCK.LoadLinkedFile=function(){var A=window.parent.document;var B=A.getElementById(FCK.Name);var C=A.getElementsByName(FCK.Name);var i=0;while (B||i==0){if (B&&(B.tagName.toLowerCase()=='input'||B.tagName.toLowerCase()=='textarea')){FCK.LinkedField=B;break;};B=C[i++];}};FCK.LoadLinkedFile();var FCKTempBin=new Object();FCKTempBin.Elements=new Array();FCKTempBin.AddElement=function(A){var B=this.Elements.length;this.Elements[B]=A;return B;};FCKTempBin.RemoveElement=function(A){var e=this.Elements[A];this.Elements[A]=null;return e;};FCKTempBin.Reset=function(){var i=0;while (i<this.Elements.length) this.Elements[i++]==null;this.Elements.length=0;}
var FCKConfig=FCK.Config=new Object();if (document.location.protocol=='file:'){FCKConfig.BasePath=unescape(document.location.pathname.substr(1));FCKConfig.BasePath=FCKConfig.BasePath.replace(/\\/gi, '/');FCKConfig.BasePath='file://'+FCKConfig.BasePath.substring(0,FCKConfig.BasePath.lastIndexOf('/')+1);FCKConfig.FullBasePath=FCKConfig.BasePath;}else{FCKConfig.BasePath=document.location.pathname.substring(0,document.location.pathname.lastIndexOf('/')+1);FCKConfig.FullBasePath=document.location.protocol+'//'+document.location.host+FCKConfig.BasePath;};FCKConfig.EditorPath=FCKConfig.BasePath.replace(/editor\/$/,'');try{FCKConfig.ScreenWidth=screen.width;FCKConfig.ScreenHeight=screen.height;}catch (e){FCKConfig.ScreenWidth=800;FCKConfig.ScreenHeight=600;};FCKConfig.ProcessHiddenField=function(){this.PageConfig=new Object();var A=window.parent.document.getElementById(FCK.Name+'___Config');if (!A) return;var B=A.value.split('&');for (var i=0;i<B.length;i++){if (B[i].length==0) continue;var C=B[i].split('=');var D=unescape(C[0]);var E=unescape(C[1]);if (D=='CustomConfigurationsPath') FCKConfig[D]=E;else if (E.toLowerCase()=="true") this.PageConfig[D]=true;else if (E.toLowerCase()=="false") this.PageConfig[D]=false;else if (E.length>0&&!isNaN(E)) this.PageConfig[D]=parseInt(E);else this.PageConfig[D]=E;}};function FCKConfig_LoadPageConfig(){var oPageConfig=FCKConfig.PageConfig;for (var sKey in oPageConfig) FCKConfig[sKey]=oPageConfig[sKey];};function FCKConfig_PreProcess(){var oConfig=FCKConfig;if (oConfig.AllowQueryStringDebug){try{if ((/fckdebug=true/i).test(window.top.location.search)) oConfig.Debug=true;}catch (e) { /* Ignore it. Much probably we are inside a FRAME where the "top" is in another domain (security error). */ }};if (!oConfig.PluginsPath.endsWith('/')) oConfig.PluginsPath+='/';if (typeof(oConfig.EditorAreaCSS)=='string') oConfig.EditorAreaCSS=[oConfig.EditorAreaCSS];var sComboPreviewCSS=oConfig.ToolbarComboPreviewCSS;if (!sComboPreviewCSS||sComboPreviewCSS.length==0) oConfig.ToolbarComboPreviewCSS=oConfig.EditorAreaCSS;else if (typeof(sComboPreviewCSS)=='string') oConfig.ToolbarComboPreviewCSS=[sComboPreviewCSS];};FCKConfig.ToolbarSets=new Object();FCKConfig.Plugins=new Object();FCKConfig.Plugins.Items=new Array();FCKConfig.Plugins.Add=function(A,B,C){FCKConfig.Plugins.Items.AddItem([A,B,C]);};FCKConfig.ProtectedSource=new Object();FCKConfig.ProtectedSource.RegexEntries=[/<!--[\s\S]*?-->/g,/<script[\s\S]*?<\/script>/gi,/<noscript[\s\S]*?<\/noscript>/gi];FCKConfig.ProtectedSource.Add=function(A){this.RegexEntries.AddItem(A);};FCKConfig.ProtectedSource.Protect=function(A){function _Replace(protectedSource){var B=FCKTempBin.AddElement(protectedSource);return '<!--{PS..'+B+'}-->';};for (var i=0;i<this.RegexEntries.length;i++){A=A.replace(this.RegexEntries[i],_Replace);};return A;};FCKConfig.ProtectedSource.Revert=function(A,B){function _Replace(m,opener,index){var C=B?FCKTempBin.RemoveElement(index):FCKTempBin.Elements[index];return FCKConfig.ProtectedSource.Revert(C,B);};return A.replace(/(<|&lt;)!--\{PS..(\d+)\}--(>|&gt;)/g,_Replace);}
var FCKDebug=new Object();FCKDebug.Output=function(A,B,C){if (!FCKConfig.Debug) return;if (!C&&A!=null&&isNaN(A)) A=A.replace(/</g,"&lt;");if (!this.DebugWindow||this.DebugWindow.closed) this.DebugWindow=window.open(FCKConfig.BasePath+'fckdebug.html','FCKeditorDebug','menubar=no,scrollbars=no,resizable=yes,location=no,toolbar=no,width=600,height=500',true);if (this.DebugWindow&&this.DebugWindow.Output){try{this.DebugWindow.Output(A,B);}catch (e) {}}};FCKDebug.OutputObject=function(A,B){if (!FCKConfig.Debug) return;var C;if (A!=null){C='Properties of: '+A+'</b><blockquote>';for (var D in A){try{var E=A[D]?A[D]+'':'[null]';C+='<b>'+D+'</b> : '+E.replace(/</g,'&lt;')+'<br>';}catch (e){try{C+='<b>'+D+'</b> : ['+typeof(A[D])+']<br>';}catch (e){C+='<b>'+D+'</b> : [-error-]<br>';}}};C+='</blockquote><b>';} else C='OutputObject : Object is "null".';FCKDebug.Output(C,B,true);}
var FCKTools=new Object();FCKTools.AppendStyleSheet=function(A,B){if (typeof(B)=='string') return this._AppendStyleSheet(A,B);else{for (var i=0;i<B.length;i++) this._AppendStyleSheet(A,B[i]);}};FCKTools.GetLinkedFieldValue=function(){return FCK.LinkedField.value;};FCKTools.AttachToLinkedFieldFormSubmit=function(A){var B=FCK.LinkedField.form;if (!B) return;if (FCKBrowserInfo.IsIE) B.attachEvent("onsubmit",A);else B.addEventListener('submit',A,false);if (!B.updateFCKeditor) B.updateFCKeditor=new Array();B.updateFCKeditor[B.updateFCKeditor.length]=A;if (!B.originalSubmit&&(typeof(B.submit)=='function'||(!B.submit.tagName&&!B.submit.length))){B.originalSubmit=B.submit;B.submit=FCKTools_SubmitReplacer;}};function FCKTools_SubmitReplacer(){if (this.updateFCKeditor){for (var i=0;i<this.updateFCKeditor.length;i++) this.updateFCKeditor[i]();};this.originalSubmit();};FCKTools.GetElementWindow=function(A){return this.GetDocumentWindow(this.GetElementDocument(A));};FCKTools.GetDocumentWindow=function(A){if (FCKBrowserInfo.IsSafari&&!A.parentWindow) this.FixDocumentParentWindow(window.top);return A.parentWindow||A.defaultView;};FCKTools.FixDocumentParentWindow=function(A){A.document.parentWindow=A;for (var i=0;i<A.frames.length;i++) FCKTools.FixDocumentParentWindow(A.frames[i]);};FCKTools.GetParentWindow=function(A){return A.contentWindow?A.contentWindow:A.parentWindow;};FCKTools.HTMLEncode=function(A){if (!A) return '';A=A.replace(/&/g,'&amp;');A=A.replace(/</g,'&lt;');A=A.replace(/>/g,'&gt;');return A;};FCKTools.AddSelectOption=function(A,B,C){var D=FCKTools.GetElementDocument(A).createElement("OPTION");D.text=B;D.value=C;A.options.add(D);return D;};FCKTools.RunFunction=function(A,B,C,D){if (A) this.SetTimeout(A,0,B,C,D);};FCKTools.SetTimeout=function(A,B,C,D,E){return (E||window).setTimeout(function(){if (D) A.apply(C,[].concat(D));else A.apply(C);},B);};FCKTools.SetInterval=function(A,B,C,D,E){return (E||window).setInterval(function(){A.apply(C,D||[]);},B);};FCKTools.ConvertStyleSizeToHtml=function(A){return A.endsWith('%')?A:parseInt(A);};FCKTools.ConvertHtmlSizeToStyle=function(A){return A.endsWith('%')?A:(A+'px');};FCKTools.GetElementAscensor=function(A,B){var e=A;var C=","+B.toUpperCase()+",";while (e){if (C.indexOf(","+e.nodeName.toUpperCase()+",")!=-1) return e;e=e.parentNode;};return null;};FCKTools.CreateEventListener=function(A,B){var f=function(){var C=[];for (var i=0;i<arguments.length;i++) C.push(arguments[i]);A.apply(this,C.concat(B));};return f;};FCKTools.GetElementDocument=function (A){return A.ownerDocument||A.document;}
FCKTools.CancelEvent=function(e){return false;};FCKTools._AppendStyleSheet=function(A,B){return A.createStyleSheet(B).owningElement;};FCKTools.ClearElementAttributes=function(A){A.clearAttributes();};FCKTools.GetAllChildrenIds=function(A){var B=new Array();for (var i=0;i<A.all.length;i++){var C=A.all[i].id;if (C&&C.length>0) B[B.length]=C;};return B;};FCKTools.RemoveOuterTags=function(e){e.insertAdjacentHTML('beforeBegin',e.innerHTML);e.parentNode.removeChild(e);};FCKTools.CreateXmlObject=function(A){var B;switch (A){case 'XmlHttp':B=['MSXML2.XmlHttp','Microsoft.XmlHttp'];break;case 'DOMDocument':B=['MSXML2.DOMDocument','Microsoft.XmlDom'];break;};for (var i=0;i<2;i++){try { return new ActiveXObject(B[i]);}catch (e){}};if (FCKLang.NoActiveX){alert(FCKLang.NoActiveX);FCKLang.NoActiveX=null;}};FCKTools.DisableSelection=function(A){A.unselectable='on';var e,i=0;while (e=A.all[i++]){switch (e.tagName){case 'IFRAME':case 'TEXTAREA':case 'INPUT':case 'SELECT':/* Ignore the above tags */ break;default:e.unselectable='on';}}};FCKTools.GetScrollPosition=function(A){var B=A.document;var C={ X:B.documentElement.scrollLeft,Y:B.documentElement.scrollTop };if (C.X>0||C.Y>0) return C;return { X:B.body.scrollLeft,Y:B.body.scrollTop };};FCKTools.AddEventListener=function(A,B,C){A.attachEvent('on'+B,C);};FCKTools.RemoveEventListener=function(A,B,C){A.detachEvent('on'+B,C);};FCKTools.AddEventListenerEx=function(A,B,C,D){var o=new Object();o.Source=A;o.Params=D||[];o.Listener=function(ev){return C.apply(o.Source,[ev].concat(o.Params));};if (FCK.IECleanup) FCK.IECleanup.AddItem(null,function() { o.Source=null;o.Params=null;});A.attachEvent('on'+B,o.Listener);A=null;D=null;};FCKTools.GetViewPaneSize=function(A){var B;var C=A.document.documentElement;if (C&&C.clientWidth) B=C;else B=top.document.body;if (B) return { Width:B.clientWidth,Height:B.clientHeight };else return { Width:0,Height:0 };};FCKTools.SaveStyles=function(A){var B=new Object();if (A.className.length>0){B.Class=A.className;A.className='';};var C=A.style.cssText;if (C.length>0){B.Inline=C;A.style.cssText='';};return B;};FCKTools.RestoreStyles=function(A,B){A.className=B.Class||'';A.style.cssText=B.Inline||'';};FCKTools.RegisterDollarFunction=function(A){A.$=A.document.getElementById;};FCKTools.AppendElement=function(A,B){return A.appendChild(this.GetElementDocument(A).createElement(B));}
var FCKeditorAPI;function InitializeAPI(){if (!(FCKeditorAPI=window.parent.FCKeditorAPI)){var sScript='\ var FCKeditorAPI={\ Version:\'2.3.2\',\ VersionBuild:\'1082\',\ __Instances:new Object(),\ GetInstance:function(instanceName)\{\ return this.__Instances[instanceName];\},\ _FunctionQueue:{\ Functions:new Array(),\ IsRunning:false,\ Add:function(functionToAdd)\{\ this.Functions.push(functionToAdd);\ if (!this.IsRunning)\ this.StartNext();\},\ StartNext:function()\{\ var aQueue=this.Functions;\ if (aQueue.length>0)\{\ this.IsRunning=true;\ aQueue[0].call();\}\ else\ this.IsRunning=false;\},\ Remove:function(func)\{\ var aQueue=this.Functions;\ var i=0,fFunc;\ while(fFunc=aQueue[i])\{\ if (fFunc==func)\ aQueue.splice(i,1);\ i++;\}\ this.StartNext();\}\}\}';if (window.parent.execScript) window.parent.execScript(sScript,'JavaScript');else{if (FCKBrowserInfo.IsGecko10){eval.call(window.parent,sScript);}else window.parent.eval(sScript);};FCKeditorAPI=window.parent.FCKeditorAPI;};FCKeditorAPI.__Instances[FCK.Name]=FCK;};function FCKeditorAPI_Cleanup(){FCKeditorAPI.__Instances[FCK.Name]=null;};FCKTools.AddEventListener(window,'unload',FCKeditorAPI_Cleanup);
var FCKRegexLib={AposEntity:/&apos;/gi,ObjectElements:/^(?:IMG|TABLE|TR|TD|TH|INPUT|SELECT|TEXTAREA|HR|OBJECT|A|UL|OL|LI)$/i,BlockElements:/^(?:P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TD|TH)$/i,EmptyElements:/^(?:BASE|META|LINK|HR|BR|PARAM|IMG|AREA|INPUT)$/i,NamedCommands:/^(?:Cut|Copy|Paste|Print|SelectAll|RemoveFormat|Unlink|Undo|Redo|Bold|Italic|Underline|StrikeThrough|Subscript|Superscript|JustifyLeft|JustifyCenter|JustifyRight|JustifyFull|Outdent|Indent|InsertOrderedList|InsertUnorderedList|InsertHorizontalRule)$/i,BodyContents:/([\s\S]*\<body[^\>]*\>)([\s\S]*)(\<\/body\>[\s\S]*)/i,ToReplace:/___fcktoreplace:([\w]+)/ig,MetaHttpEquiv:/http-equiv\s*=\s*["']?([^"' ]+)/i,HasBaseTag:/<base /i,HtmlOpener:/<html\s?[^>]*>/i,HeadOpener:/<head\s?[^>]*>/i,HeadCloser:/<\/head\s*>/i,TableBorderClass:/\s*FCK__ShowTableBorders\s*/,ElementName:/(^[A-Za-z_:][\w.\-:]*\w$)|(^[A-Za-z_]$)/,ForceSimpleAmpersand:/___FCKAmp___/g,SpaceNoClose:/\/>/g,EmptyParagraph:/^<(p|div)>\s*<\/\1>$/i,TagBody:/></,StrongOpener:/<STRONG([ \>])/gi,StrongCloser:/<\/STRONG>/gi,EmOpener:/<EM([ \>])/gi,EmCloser:/<\/EM>/gi,AbbrOpener:/<ABBR([ \>])/gi,AbbrCloser:/<\/ABBR>/gi,GeckoEntitiesMarker:/#\?-\:/g,ProtectUrlsImg:/(?:(<img(?=\s).*?\ssrc=)("|')(.*?)\2)|(?:(<img\s.*?src=)([^"'][^ >]+))/gi,ProtectUrlsA:/(?:(<a(?=\s).*?\shref=)("|')(.*?)\2)|(?:(<a\s.*?href=)([^"'][^ >]+))/gi,Html4DocType:/HTML 4\.0 Transitional/i,DocTypeTag:/<!DOCTYPE[^>]*>/i,TagsWithEvent:/<[^\>]+ on\w+[\s\r\n]*=[\s\r\n]*?('|")[\s\S]+?\>/g,EventAttributes:/\s(on\w+)[\s\r\n]*=[\s\r\n]*?('|")([\s\S]*?)\2/g,ProtectedEvents:/\s\w+_fckprotectedatt="([^"]+)"/g}
var FCKLanguageManager=FCK.Language=new Object();FCKLanguageManager.AvailableLanguages={'ar':'Arabic','bg':'Bulgarian','bn':'Bengali/Bangla','bs':'Bosnian','ca':'Catalan','cs':'Czech','da':'Danish','de':'German','el':'Greek','en':'English','en-au':'English (Australia)','en-ca':'English (Canadian)','en-uk':'English (United Kingdom)','eo':'Esperanto','es':'Spanish','et':'Estonian','eu':'Basque','fa':'Persian','fi':'Finnish','fo':'Faroese','fr':'French','gl':'Galician','he':'Hebrew','hi':'Hindi','hr':'Croatian','hu':'Hungarian','it':'Italian','ja':'Japanese','km':'Khmer','ko':'Korean','lt':'Lithuanian','lv':'Latvian','mn':'Mongolian','ms':'Malay','nb':'Norwegian Bokmal','nl':'Dutch','no':'Norwegian','pl':'Polish','pt':'Portuguese (Portugal)','pt-br':'Portuguese (Brazil)','ro':'Romanian','ru':'Russian','sk':'Slovak','sl':'Slovenian','sr':'Serbian (Cyrillic)','sr-latn':'Serbian (Latin)','sv':'Swedish','th':'Thai','tr':'Turkish','uk':'Ukrainian','vi':'Vietnamese','zh':'Chinese Traditional','zh-cn':'Chinese Simplified'};FCKLanguageManager.GetActiveLanguage=function(){if (FCKConfig.AutoDetectLanguage){var A;if (navigator.userLanguage) A=navigator.userLanguage.toLowerCase();else if (navigator.language) A=navigator.language.toLowerCase();else{return FCKConfig.DefaultLanguage;};if (A.length>=5){A=A.substr(0,5);if (this.AvailableLanguages[A]) return A;};if (A.length>=2){A=A.substr(0,2);if (this.AvailableLanguages[A]) return A;}};return this.DefaultLanguage;};FCKLanguageManager.TranslateElements=function(A,B,C,D){var e=A.getElementsByTagName(B);var E,s;for (var i=0;i<e.length;i++){if (E=e[i].getAttribute('fckLang')){if (s=FCKLang[E]){if (D) s=FCKTools.HTMLEncode(s);eval('e[i].'+C+' = s');}}}};FCKLanguageManager.TranslatePage=function(A){this.TranslateElements(A,'INPUT','value');this.TranslateElements(A,'SPAN','innerHTML');this.TranslateElements(A,'LABEL','innerHTML');this.TranslateElements(A,'OPTION','innerHTML',true);};FCKLanguageManager.Initialize=function(){if (this.AvailableLanguages[FCKConfig.DefaultLanguage]) this.DefaultLanguage=FCKConfig.DefaultLanguage;else this.DefaultLanguage='en';this.ActiveLanguage=new Object();this.ActiveLanguage.Code=this.GetActiveLanguage();this.ActiveLanguage.Name=this.AvailableLanguages[this.ActiveLanguage.Code];}
var FCKEvents;FCKEvents=function(A){this.Owner=A;this.RegisteredEvents=new Object();};FCKEvents.prototype.AttachEvent=function(A,B){var C;if (!(C=this.RegisteredEvents[A])) this.RegisteredEvents[A]=[B];else C.push(B);};FCKEvents.prototype.FireEvent=function(A,B){var C=true;var D=this.RegisteredEvents[A];if (D){for (var i=0;i<D.length;i++) C=(D[i](this.Owner,B)&&C);};return C;}
var FCKXHtmlEntities=new Object();FCKXHtmlEntities.Initialize=function(){if (FCKXHtmlEntities.Entities) return;var A='';if (FCKConfig.ProcessHTMLEntities){FCKXHtmlEntities.Entities={' ':'nbsp','¡':'iexcl','¢':'cent','£':'pound','¤':'curren','¥':'yen','¦':'brvbar','§':'sect','¨':'uml','©':'copy','ª':'ordf','«':'laquo','¬':'not','­':'shy','®':'reg','¯':'macr','°':'deg','±':'plusmn','²':'sup2','³':'sup3','´':'acute','µ':'micro','¶':'para','·':'middot','¸':'cedil','¹':'sup1','º':'ordm','»':'raquo','¼':'frac14','½':'frac12','¾':'frac34','¿':'iquest','×':'times','÷':'divide','ƒ':'fnof','•':'bull','…':'hellip','′':'prime','″':'Prime','‾':'oline','⁄':'frasl','℘':'weierp','ℑ':'image','ℜ':'real','™':'trade','ℵ':'alefsym','←':'larr','↑':'uarr','→':'rarr','↓':'darr','↔':'harr','↵':'crarr','⇐':'lArr','⇑':'uArr','⇒':'rArr','⇓':'dArr','⇔':'hArr','∀':'forall','∂':'part','∃':'exist','∅':'empty','∇':'nabla','∈':'isin','∉':'notin','∋':'ni','∏':'prod','∑':'sum','−':'minus','∗':'lowast','√':'radic','∝':'prop','∞':'infin','∠':'ang','∧':'and','∨':'or','∩':'cap','∪':'cup','∫':'int','∴':'there4','∼':'sim','≅':'cong','≈':'asymp','≠':'ne','≡':'equiv','≤':'le','≥':'ge','⊂':'sub','⊃':'sup','⊄':'nsub','⊆':'sube','⊇':'supe','⊕':'oplus','⊗':'otimes','⊥':'perp','⋅':'sdot','◊':'loz','♠':'spades','♣':'clubs','♥':'hearts','♦':'diams','"':'quot','ˆ':'circ','˜':'tilde',' ':'ensp',' ':'emsp',' ':'thinsp','‌':'zwnj','‍':'zwj','‎':'lrm','‏':'rlm','–':'ndash','—':'mdash','‘':'lsquo','’':'rsquo','‚':'sbquo','“':'ldquo','”':'rdquo','„':'bdquo','†':'dagger','‡':'Dagger','‰':'permil','‹':'lsaquo','›':'rsaquo','¤':'euro'};for (var e in FCKXHtmlEntities.Entities) A+=e;if (FCKConfig.IncludeLatinEntities){var B={'À':'Agrave','Á':'Aacute','Â':'Acirc','Ã':'Atilde','Ä':'Auml','Å':'Aring','Æ':'AElig','Ç':'Ccedil','È':'Egrave','É':'Eacute','Ê':'Ecirc','Ë':'Euml','Ì':'Igrave','Í':'Iacute','Î':'Icirc','Ï':'Iuml','Ð':'ETH','Ñ':'Ntilde','Ò':'Ograve','Ó':'Oacute','Ô':'Ocirc','Õ':'Otilde','Ö':'Ouml','Ø':'Oslash','Ù':'Ugrave','Ú':'Uacute','Û':'Ucirc','Ü':'Uuml','Ý':'Yacute','Þ':'THORN','ß':'szlig','à':'agrave','á':'aacute','â':'acirc','ã':'atilde','ä':'auml','å':'aring','æ':'aelig','ç':'ccedil','è':'egrave','é':'eacute','ê':'ecirc','ë':'euml','ì':'igrave','í':'iacute','î':'icirc','ï':'iuml','ð':'eth','ñ':'ntilde','ò':'ograve','ó':'oacute','ô':'ocirc','õ':'otilde','ö':'ouml','ø':'oslash','ù':'ugrave','ú':'uacute','û':'ucirc','ü':'uuml','ý':'yacute','þ':'thorn','ÿ':'yuml','Œ':'OElig','œ':'oelig','Å ':'Scaron','Å¡':'scaron','¾':'Yuml'};for (var e in B){FCKXHtmlEntities.Entities[e]=B[e];A+=e;};B=null;};if (FCKConfig.IncludeGreekEntities){var B={'Α':'Alpha','Β':'Beta','Γ':'Gamma','Δ':'Delta','Ε':'Epsilon','Ζ':'Zeta','Η':'Eta','Θ':'Theta','Ι':'Iota','Κ':'Kappa','Λ':'Lambda','Μ':'Mu','Ν':'Nu','Ξ':'Xi','Ο':'Omicron','Π':'Pi','Ρ':'Rho','Σ':'Sigma','Τ':'Tau','Î¥':'Upsilon','Φ':'Phi','Χ':'Chi','Ψ':'Psi','Ω':'Omega','α':'alpha','β':'beta','γ':'gamma','δ':'delta','ε':'epsilon','ζ':'zeta','η':'eta','θ':'theta','ι':'iota','κ':'kappa','λ':'lambda','μ':'mu','ν':'nu','ξ':'xi','ο':'omicron','π':'pi','ρ':'rho','ς':'sigmaf','σ':'sigma','τ':'tau','υ':'upsilon','φ':'phi','χ':'chi','ψ':'psi','ω':'omega'};for (var e in B){FCKXHtmlEntities.Entities[e]=B[e];A+=e;};B=null;}}else{FCKXHtmlEntities.Entities={};A=' ';};var D='['+A+']';if (FCKConfig.ProcessNumericEntities) D='[^ -~]|'+D;var E=FCKConfig.AdditionalNumericEntities;if (E||E.length>0) D+='|'+FCKConfig.AdditionalNumericEntities;FCKXHtmlEntities.EntitiesRegex=new RegExp(D,'g');}
var FCKXHtml=new Object();FCKXHtml.CurrentJobNum=0;FCKXHtml.GetXHTML=function(A,B,C){FCKXHtmlEntities.Initialize();var D=FCK.IsDirty();this._CreateNode=FCKConfig.ForceStrongEm?FCKXHtml_CreateNode_StrongEm:FCKXHtml_CreateNode_Normal;FCKXHtml.SpecialBlocks=new Array();this.XML=FCKTools.CreateXmlObject('DOMDocument');this.MainNode=this.XML.appendChild(this.XML.createElement('xhtml'));FCKXHtml.CurrentJobNum++;if (B) this._AppendNode(this.MainNode,A);else this._AppendChildNodes(this.MainNode,A,false);var E=this._GetMainXmlString();this.XML=null;E=E.substr(7,E.length-15).trim();if (FCKBrowserInfo.IsGecko) E=E.replace(/<br\/>$/,'');E=E.replace(FCKRegexLib.SpaceNoClose,' />');if (FCKConfig.ForceSimpleAmpersand) E=E.replace(FCKRegexLib.ForceSimpleAmpersand,'&');if (C) E=FCKCodeFormatter.Format(E);for (var i=0;i<FCKXHtml.SpecialBlocks.length;i++){var F=new RegExp('___FCKsi___'+i);E=E.replace(F,FCKXHtml.SpecialBlocks[i]);};E=E.replace(FCKRegexLib.GeckoEntitiesMarker,'&');if (!D) FCK.ResetIsDirty();return E};FCKXHtml._AppendAttribute=function(A,B,C){if (FCKConfig.ForceSimpleAmpersand&&C.replace) C=C.replace(/&/g,'___FCKAmp___');try{var D=this.XML.createAttribute(B);D.value=C?C:'';A.attributes.setNamedItem(D);}catch (e){}};FCKXHtml._AppendChildNodes=function(A,B,C){var D=0;var E=B.firstChild;while (E){if (this._AppendNode(A,E)) D++;E=E.nextSibling;};if (D==0){if (C&&FCKConfig.FillEmptyBlocks){this._AppendEntity(A,'nbsp');return;};if (!FCKRegexLib.EmptyElements.test(B.nodeName)) A.appendChild(this.XML.createTextNode(''));}};FCKXHtml._AppendNode=function(A,B){if (!B) return;switch (B.nodeType){case 1:if (B.getAttribute('_fckfakelement')) return FCKXHtml._AppendNode(A,FCK.GetRealElement(B));if (FCKBrowserInfo.IsGecko&&B.hasAttribute('_moz_editor_bogus_node')) return false;if (B.getAttribute('_fcktemp')) return false;var C=B.nodeName;if (FCKBrowserInfo.IsIE&&B.scopeName&&B.scopeName!='HTML'&&B.scopeName!='FCK') C=B.scopeName+':'+C;if (!FCKRegexLib.ElementName.test(C)) return false;C=C.toLowerCase();if (FCKBrowserInfo.IsGecko&&C=='br'&&B.hasAttribute('type')&&B.getAttribute('type',2)=='_moz') return false;if (B._fckxhtmljob&&B._fckxhtmljob==FCKXHtml.CurrentJobNum) return false;var D=this._CreateNode(C);FCKXHtml._AppendAttributes(A,B,D,C);B._fckxhtmljob=FCKXHtml.CurrentJobNum;var E=FCKXHtml.TagProcessors[C];if (E){D=E(D,B,A);if (!D) break;}else this._AppendChildNodes(D,B,FCKRegexLib.BlockElements.test(C));A.appendChild(D);break;case 3:this._AppendTextNode(A,B.nodeValue.replaceNewLineChars(' '));break;case 8:if (FCKBrowserInfo.IsIE&&!B.innerHTML) break;try { A.appendChild(this.XML.createComment(B.nodeValue));}catch (e) { /* Do nothing... probably this is a wrong format comment. */};break;default:A.appendChild(this.XML.createComment("Element not supported - Type: "+B.nodeType+" Name: "+B.nodeName));break;};return true;};function FCKXHtml_CreateNode_StrongEm(nodeName){switch (nodeName){case 'b':nodeName='strong';break;case 'i':nodeName='em';break;};return this.XML.createElement(nodeName);};function FCKXHtml_CreateNode_Normal(nodeName){return this.XML.createElement(nodeName);};FCKXHtml._AppendSpecialItem=function(A){return '___FCKsi___'+FCKXHtml.SpecialBlocks.AddItem(A);};FCKXHtml._AppendEntity=function(A,B){A.appendChild(this.XML.createTextNode('#?-:'+B+';'));};FCKXHtml._AppendTextNode=function(A,B){A.appendChild(this.XML.createTextNode(B.replace(FCKXHtmlEntities.EntitiesRegex,FCKXHtml_GetEntity)));return;};function FCKXHtml_GetEntity(character){var sEntity=FCKXHtmlEntities.Entities[character]||('#'+character.charCodeAt(0));return '#?-:'+sEntity+';';};FCKXHtml.TagProcessors=new Object();FCKXHtml.TagProcessors['img']=function(A,B){if (!A.attributes.getNamedItem('alt')) FCKXHtml._AppendAttribute(A,'alt','');var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'src',C);return A;};FCKXHtml.TagProcessors['a']=function(A,B){var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'href',C);FCKXHtml._AppendChildNodes(A,B,false);if (A.childNodes.length==0&&!A.getAttribute('name')) return false;return A;};FCKXHtml.TagProcessors['script']=function(A,B){if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text/javascript');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(B.text)));return A;};FCKXHtml.TagProcessors['style']=function(A,B){if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text/css');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(B.innerHTML)));return A;};FCKXHtml.TagProcessors['title']=function(A,B){A.appendChild(FCKXHtml.XML.createTextNode(FCK.EditorDocument.title));return A;};FCKXHtml.TagProcessors['table']=function(A,B){var C=A.attributes.getNamedItem('class');if (C&&FCKRegexLib.TableBorderClass.test(C.nodeValue)){var D=C.nodeValue.replace(FCKRegexLib.TableBorderClass,'');if (D.length==0) A.attributes.removeNamedItem('class');else FCKXHtml._AppendAttribute(A,'class',D);};FCKXHtml._AppendChildNodes(A,B,false);return A;};FCKXHtml.TagProcessors['ol']=FCKXHtml.TagProcessors['ul']=function(A,B,C){if (B.innerHTML.trim().length==0) return;var D=C.lastChild;if (D&&D.nodeType==3) D=D.previousSibling;if (D&&D.nodeName.toUpperCase()=='LI'){B._fckxhtmljob=null;FCKXHtml._AppendNode(D,B);return;};FCKXHtml._AppendChildNodes(A,B);return A;};FCKXHtml.TagProcessors['span']=function(A,B){if (B.innerHTML.length==0) return false;FCKXHtml._AppendChildNodes(A,B,false);return A;}
FCKXHtml._GetMainXmlString=function(){return this.MainNode.xml;};FCKXHtml._AppendAttributes=function(A,B,C,D){var E=B.attributes;for (var n=0;n<E.length;n++){var F=E[n];if (F.specified){var G=F.nodeName.toLowerCase();var H;if (G.startsWith('_fck')) continue;else if (G=='style') H=B.style.cssText;else if (G=='class'||G.indexOf('on')==0) H=F.nodeValue;else if (D=='body'&&G=='contenteditable') continue;else if (F.nodeValue===true) H=G;else if (!(H=B.getAttribute(G,2))) H=F.nodeValue;this._AppendAttribute(C,G,H);}}};FCKXHtml.TagProcessors['meta']=function(A,B){var C=A.attributes.getNamedItem('http-equiv');if (C==null||C.value.length==0){var D=B.outerHTML.match(FCKRegexLib.MetaHttpEquiv);if (D){D=D[1];FCKXHtml._AppendAttribute(A,'http-equiv',D);}};return A;};FCKXHtml.TagProcessors['font']=function(A,B){if (A.attributes.length==0) A=FCKXHtml.XML.createDocumentFragment();FCKXHtml._AppendChildNodes(A,B);return A;};FCKXHtml.TagProcessors['input']=function(A,B){if (B.name) FCKXHtml._AppendAttribute(A,'name',B.name);if (B.value&&!A.attributes.getNamedItem('value')) FCKXHtml._AppendAttribute(A,'value',B.value);if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text');return A;};FCKXHtml.TagProcessors['option']=function(A,B){if (B.selected&&!A.attributes.getNamedItem('selected')) FCKXHtml._AppendAttribute(A,'selected','selected');FCKXHtml._AppendChildNodes(A,B);return A;};FCKXHtml.TagProcessors['area']=function(A,B){if (!A.attributes.getNamedItem('coords')){var C=B.getAttribute('coords',2);if (C&&C!='0,0,0') FCKXHtml._AppendAttribute(A,'coords',C);};if (!A.attributes.getNamedItem('shape')){var C=B.getAttribute('shape',2);if (C&&C.length>0) FCKXHtml._AppendAttribute(A,'shape',C);};return A;};FCKXHtml.TagProcessors['label']=function(A,B){if (B.htmlFor.length>0) FCKXHtml._AppendAttribute(A,'for',B.htmlFor);FCKXHtml._AppendChildNodes(A,B);return A;};FCKXHtml.TagProcessors['form']=function(A,B){if (B.acceptCharset&&B.acceptCharset.length>0&&B.acceptCharset!='UNKNOWN') FCKXHtml._AppendAttribute(A,'accept-charset',B.acceptCharset);if (B.name) FCKXHtml._AppendAttribute(A,'name',B.name);FCKXHtml._AppendChildNodes(A,B);return A;};FCKXHtml.TagProcessors['textarea']=FCKXHtml.TagProcessors['select']=function(A,B){if (B.name) FCKXHtml._AppendAttribute(A,'name',B.name);FCKXHtml._AppendChildNodes(A,B);return A;};FCKXHtml.TagProcessors['div']=function(A,B){if (B.align.length>0) FCKXHtml._AppendAttribute(A,'align',B.align);FCKXHtml._AppendChildNodes(A,B);return A;}
var FCKCodeFormatter=new Object();FCKCodeFormatter.Init=function(){var A=this.Regex=new Object();A.BlocksOpener=/\<(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi;A.BlocksCloser=/\<\/(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi;A.NewLineTags=/\<(BR|HR)[^\>]*\>/gi;A.MainTags=/\<\/?(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR)[^\>]*\>/gi;A.LineSplitter=/\s*\n+\s*/g;A.IncreaseIndent=/^\<(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL)[ \/\>]/i;A.DecreaseIndent=/^\<\/(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL)[ \>]/i;A.FormatIndentatorRemove=new RegExp('^'+FCKConfig.FormatIndentator);A.ProtectedTags=/(<PRE[^>]*>)([\s\S]*?)(<\/PRE>)/gi;};FCKCodeFormatter._ProtectData=function(A,B,C,D){return B+'___FCKpd___'+FCKCodeFormatter.ProtectedData.AddItem(C)+D;};FCKCodeFormatter.Format=function(A){if (!this.Regex) this.Init();FCKCodeFormatter.ProtectedData=new Array();var B=A.replace(this.Regex.ProtectedTags,FCKCodeFormatter._ProtectData);B=B.replace(this.Regex.BlocksOpener,'\n$&');;B=B.replace(this.Regex.BlocksCloser,'$&\n');B=B.replace(this.Regex.NewLineTags,'$&\n');B=B.replace(this.Regex.MainTags,'\n$&\n');var C='';var D=B.split(this.Regex.LineSplitter);B='';for (var i=0;i<D.length;i++){var E=D[i];if (E.length==0) continue;if (this.Regex.DecreaseIndent.test(E)) C=C.replace(this.Regex.FormatIndentatorRemove,'');B+=C+E+'\n';if (this.Regex.IncreaseIndent.test(E)) C+=FCKConfig.FormatIndentator;};for (var i=0;i<FCKCodeFormatter.ProtectedData.length;i++){var F=new RegExp('___FCKpd___'+i);B=B.replace(F,FCKCodeFormatter.ProtectedData[i].replace(/\$/g,'$$$$'));};return B.trim();}
var FCKUndo=new Object();FCKUndo.SavedData=new Array();FCKUndo.CurrentIndex=-1;FCKUndo.TypesCount=FCKUndo.MaxTypes=25;FCKUndo.Typing=false;FCKUndo.SaveUndoStep=function(){if (FCK.EditMode!=FCK_EDITMODE_WYSIWYG) return;FCKUndo.SavedData=FCKUndo.SavedData.slice(0,FCKUndo.CurrentIndex+1);var A=FCK.EditorDocument.body.innerHTML;if (FCKUndo.CurrentIndex>=0&&A==FCKUndo.SavedData[FCKUndo.CurrentIndex][0]) return;if (FCKUndo.CurrentIndex+1>=FCKConfig.MaxUndoLevels) FCKUndo.SavedData.shift();else FCKUndo.CurrentIndex++;var B;if (FCK.EditorDocument.selection.type=='Text') B=FCK.EditorDocument.selection.createRange().getBookmark();FCKUndo.SavedData[FCKUndo.CurrentIndex]=[A,B];FCK.Events.FireEvent("OnSelectionChange");};FCKUndo.CheckUndoState=function(){return (FCKUndo.Typing||FCKUndo.CurrentIndex>0);};FCKUndo.CheckRedoState=function(){return (!FCKUndo.Typing&&FCKUndo.CurrentIndex<(FCKUndo.SavedData.length-1));};FCKUndo.Undo=function(){if (FCKUndo.CheckUndoState()){if (FCKUndo.CurrentIndex==(FCKUndo.SavedData.length-1)){FCKUndo.SaveUndoStep();};FCKUndo._ApplyUndoLevel(--FCKUndo.CurrentIndex);FCK.Events.FireEvent("OnSelectionChange");}};FCKUndo.Redo=function(){if (FCKUndo.CheckRedoState()){FCKUndo._ApplyUndoLevel(++FCKUndo.CurrentIndex);FCK.Events.FireEvent("OnSelectionChange");}};FCKUndo._ApplyUndoLevel=function(A){var B=FCKUndo.SavedData[A];if (!B) return;FCK.SetInnerHtml(B[0]);if (B[1]){var C=FCK.EditorDocument.selection.createRange();C.moveToBookmark(B[1]);C.select();};FCKUndo.TypesCount=0;FCKUndo.Typing=false;}
var FCKEditingArea=function(A){this.TargetElement=A;this.Mode=FCK_EDITMODE_WYSIWYG;if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKEditingArea_Cleanup);};FCKEditingArea.prototype.Start=function(A,B){var C=this.TargetElement;var D=FCKTools.GetElementDocument(C);while(C.childNodes.length>0) C.removeChild(C.childNodes[0]);if (this.Mode==FCK_EDITMODE_WYSIWYG){if (FCKBrowserInfo.IsGecko) A=A.replace(/(<body[^>]*>)\s*(<\/body>)/i,'$1'+GECKO_BOGUS+'$2');var E=this.IFrame=D.createElement('iframe');E.src='javascript:void(0)';E.frameBorder=0;E.width=E.height='100%';C.appendChild(E);if (FCKBrowserInfo.IsIE) A=A.replace(/(<base[^>]*?)\s*\/?>(?!\s*<\/base>)/gi,'$1></base>');this.Window=E.contentWindow;var F=this.Document=this.Window.document;F.open();F.write(A);F.close();if (FCKBrowserInfo.IsGecko10&&!B){this.Start(A,true);return;};this.Window._FCKEditingArea=this;if (FCKBrowserInfo.IsGecko10) this.Window.setTimeout(FCKEditingArea_CompleteStart,500);else FCKEditingArea_CompleteStart.call(this.Window);}else{var G=this.Textarea=D.createElement('textarea');G.className='SourceField';G.dir='ltr';G.style.width=G.style.height='100%';G.style.border='none';C.appendChild(G);G.value=A;FCKTools.RunFunction(this.OnLoad);}};function FCKEditingArea_CompleteStart(){if (!this.document.body){this.setTimeout(FCKEditingArea_CompleteStart,50);return;};var oEditorArea=this._FCKEditingArea;oEditorArea.MakeEditable();FCKTools.RunFunction(oEditorArea.OnLoad);};FCKEditingArea.prototype.MakeEditable=function(){var A=this.Document;if (FCKBrowserInfo.IsIE) A.body.contentEditable=true;else{try{A.designMode='on';A.execCommand('useCSS',false,!FCKConfig.GeckoUseSPAN);A.execCommand('enableObjectResizing',false,!FCKConfig.DisableObjectResizing);A.execCommand('enableInlineTableEditing',false,!FCKConfig.DisableFFTableHandles);}catch (e) {}}};FCKEditingArea.prototype.Focus=function(){try{if (this.Mode==FCK_EDITMODE_WYSIWYG){if (FCKBrowserInfo.IsSafari) this.IFrame.focus();else this.Window.focus();}else this.Textarea.focus();}catch(e) {}};function FCKEditingArea_Cleanup(){this.TargetElement=null;this.IFrame=null;this.Document=null;this.Textarea=null;if (this.Window){this.Window._FCKEditingArea=null;this.Window=null;}}
var FCKDocumentProcessor=new Object();FCKDocumentProcessor._Items=new Array();FCKDocumentProcessor.AppendNew=function(){var A=new Object();this._Items.AddItem(A);return A;};FCKDocumentProcessor.Process=function(A){var B,i=0;while((B=this._Items[i++])) B.ProcessDocument(A);};var FCKDocumentProcessor_CreateFakeImage=function(A,B){var C=FCK.EditorDocument.createElement('IMG');C.className=A;C.src=FCKConfig.FullBasePath+'images/spacer.gif';C.setAttribute('_fckfakelement','true',0);C.setAttribute('_fckrealelement',FCKTempBin.AddElement(B),0);return C;};var FCKAnchorsProcessor=FCKDocumentProcessor.AppendNew();FCKAnchorsProcessor.ProcessDocument=function(A){var B=A.getElementsByTagName('A');var C;var i=B.length-1;while (i>=0&&(C=B[i--])){if (C.name.length>0&&(!C.getAttribute('href')||C.getAttribute('href').length==0)){var D=FCKDocumentProcessor_CreateFakeImage('FCK__Anchor',C.cloneNode(true));D.setAttribute('_fckanchor','true',0);C.parentNode.insertBefore(D,C);C.parentNode.removeChild(C);}}};var FCKPageBreaksProcessor=FCKDocumentProcessor.AppendNew();FCKPageBreaksProcessor.ProcessDocument=function(A){var B=A.getElementsByTagName('DIV');var C;var i=B.length-1;while (i>=0&&(C=B[i--])){if (C.style.pageBreakAfter=='always'&&C.childNodes.length==1&&C.childNodes[0].style&&C.childNodes[0].style.display=='none'){var D=FCKDocumentProcessor_CreateFakeImage('FCK__PageBreak',C.cloneNode(true));C.parentNode.insertBefore(D,C);C.parentNode.removeChild(C);}}};var FCKFlashProcessor=FCKDocumentProcessor.AppendNew();FCKFlashProcessor.ProcessDocument=function(A){var B=A.getElementsByTagName('EMBED');var C;var i=B.length-1;while (i>=0&&(C=B[i--])){if (C.src.endsWith('.swf',true)){var D=C.cloneNode(true);if (FCKBrowserInfo.IsIE){var E;if (E=C.getAttribute('scale')) D.setAttribute('scale',E);if (E=C.getAttribute('play')) D.setAttribute('play',E);if (E=C.getAttribute('loop')) D.setAttribute('loop',E);if (E=C.getAttribute('menu')) D.setAttribute('menu',E);if (E=C.getAttribute('wmode')) D.setAttribute('wmode',E);if (E=C.getAttribute('quality')) D.setAttribute('quality',E);};var F=FCKDocumentProcessor_CreateFakeImage('FCK__Flash',D);F.setAttribute('_fckflash','true',0);FCKFlashProcessor.RefreshView(F,C);C.parentNode.insertBefore(F,C);C.parentNode.removeChild(C);}}};FCKFlashProcessor.RefreshView=function(A,B){if (B.width>0) A.style.width=FCKTools.ConvertHtmlSizeToStyle(B.width);if (B.height>0) A.style.height=FCKTools.ConvertHtmlSizeToStyle(B.height);};FCK.GetRealElement=function(A){var e=FCKTempBin.Elements[A.getAttribute('_fckrealelement')];if (A.getAttribute('_fckflash')){if (A.style.width.length>0) e.width=FCKTools.ConvertStyleSizeToHtml(A.style.width);if (A.style.height.length>0) e.height=FCKTools.ConvertStyleSizeToHtml(A.style.height);};return e;};
var FCK_StartupValue;FCK.Events=new FCKEvents(FCK);FCK.Toolbar=null;FCK.HasFocus=false;FCK.StartEditor=function(){FCK.TempBaseTag=FCKConfig.BaseHref.length>0?'<base href="'+FCKConfig.BaseHref+'" _fcktemp="true"></base>':'';FCK.EditingArea=new FCKEditingArea(document.getElementById('xEditingArea'));this.SetHTML(FCKTools.GetLinkedFieldValue());};FCK.Focus=function(){FCK.EditingArea.Focus();};FCK.SetStatus=function(A){this.Status=A;if (A==FCK_STATUS_ACTIVE){FCKFocusManager.AddWindow(window,true);if (FCKBrowserInfo.IsIE) FCKFocusManager.AddWindow(window.frameElement,true);if (FCKConfig.StartupFocus) FCK.Focus();};this.Events.FireEvent('OnStatusChange',A);};FCK.GetHTML=FCK.GetXHTML=function(A){if (FCK.EditMode==FCK_EDITMODE_SOURCE) return FCK.EditingArea.Textarea.value;var B;var C=FCK.EditorDocument;if (FCKConfig.FullPage) B=FCKXHtml.GetXHTML(C.getElementsByTagName('html')[0],true,A);else{if (FCKConfig.IgnoreEmptyParagraphValue&&C.body.innerHTML=='<P>&nbsp;</P>') B='';else B=FCKXHtml.GetXHTML(C.body,false,A);};B=FCK.ProtectEventsRestore(B);if (FCKBrowserInfo.IsIE) B=B.replace(FCKRegexLib.ToReplace,'$1');if (FCK.DocTypeDeclaration&&FCK.DocTypeDeclaration.length>0) B=FCK.DocTypeDeclaration+'\n'+B;if (FCK.XmlDeclaration&&FCK.XmlDeclaration.length>0) B=FCK.XmlDeclaration+'\n'+B;return FCKConfig.ProtectedSource.Revert(B);};FCK.UpdateLinkedField=function(){FCK.LinkedField.value=FCK.GetXHTML(FCKConfig.FormatOutput);FCK.Events.FireEvent('OnAfterLinkedFieldUpdate');};FCK.RegisteredDoubleClickHandlers=new Object();FCK.OnDoubleClick=function(A){var B=FCK.RegisteredDoubleClickHandlers[A.tagName];if (B) B(A);};FCK.RegisterDoubleClickHandler=function(A,B){FCK.RegisteredDoubleClickHandlers[B.toUpperCase()]=A;};FCK.OnAfterSetHTML=function(){FCKDocumentProcessor.Process(FCK.EditorDocument);FCKUndo.SaveUndoStep();FCK.Events.FireEvent('OnSelectionChange');FCK.Events.FireEvent('OnAfterSetHTML');};FCK.ProtectUrls=function(A){A=A.replace(FCKRegexLib.ProtectUrlsA,'$1$4$2$3$5$2 _fcksavedurl=$2$3$5$2');A=A.replace(FCKRegexLib.ProtectUrlsImg,'$1$4$2$3$5$2 _fcksavedurl=$2$3$5$2');return A;};FCK.ProtectEvents=function(A){return A.replace(FCKRegexLib.TagsWithEvent,_FCK_ProtectEvents_ReplaceTags);};function _FCK_ProtectEvents_ReplaceTags(tagMatch){return tagMatch.replace(FCKRegexLib.EventAttributes,_FCK_ProtectEvents_ReplaceEvents);};function _FCK_ProtectEvents_ReplaceEvents(eventMatch,attName){return ' '+attName+'_fckprotectedatt="'+eventMatch.ReplaceAll([/&/g,/'/g,/"/g,/=/g,/</g,/>/g,/\r/g,/\n/g],['&apos;','&#39;','&quot;','&#61;','&lt;','&gt;','&#10;','&#13;'])+'"';};FCK.ProtectEventsRestore=function(A){return A.replace(FCKRegexLib.ProtectedEvents,_FCK_ProtectEvents_RestoreEvents);};function _FCK_ProtectEvents_RestoreEvents(match,encodedOriginal){return encodedOriginal.ReplaceAll([/&#39;/g,/&quot;/g,/&#61;/g,/&lt;/g,/&gt;/g,/&#10;/g,/&#13;/g,/&apos;/g],["'",'"','=','<','>','\r','\n','&']);};FCK.IsDirty=function(){return (FCK_StartupValue!=FCK.EditorDocument.body.innerHTML);};FCK.ResetIsDirty=function(){if (FCK.EditorDocument.body) FCK_StartupValue=FCK.EditorDocument.body.innerHTML;};FCK.SetHTML=function(A){this.EditingArea.Mode=FCK.EditMode;if (FCK.EditMode==FCK_EDITMODE_WYSIWYG){A=FCKConfig.ProtectedSource.Protect(A);A=FCK.ProtectEvents(A);A=FCK.ProtectUrls(A);if (FCKBrowserInfo.IsGecko){A=A.replace(FCKRegexLib.StrongOpener,'<b$1');A=A.replace(FCKRegexLib.StrongCloser,'<\/b>');A=A.replace(FCKRegexLib.EmOpener,'<i$1');A=A.replace(FCKRegexLib.EmCloser,'<\/i>');}else if (FCKBrowserInfo.IsIE){A=A.replace(FCKRegexLib.AbbrOpener,'<FCK:abbr$1');A=A.replace(FCKRegexLib.AbbrCloser,'<\/FCK:abbr>');};var B='';if (FCKConfig.FullPage){if (!FCKRegexLib.HeadOpener.test(A)){if (!FCKRegexLib.HtmlOpener.test(A)) A='<html dir="'+FCKConfig.ContentLangDirection+'">'+A+'</html>';A=A.replace(FCKRegexLib.HtmlOpener,'$&<head></head>');};FCK.DocTypeDeclaration=A.match(FCKRegexLib.DocTypeTag);if (FCKBrowserInfo.IsIE) B=FCK._GetBehaviorsStyle();else if (FCKConfig.ShowBorders) B='<link href="'+FCKConfig.FullBasePath+'css/fck_showtableborders_gecko.css" rel="stylesheet" type="text/css" _fcktemp="true" />';B+='<link href="'+FCKConfig.FullBasePath+'css/fck_internal.css'+'" rel="stylesheet" type="text/css" _fcktemp="true" />';B=A.replace(FCKRegexLib.HeadCloser,B+'$&');if (FCK.TempBaseTag.length>0&&!FCKRegexLib.HasBaseTag.test(A)) B=B.replace(FCKRegexLib.HeadOpener,'$&'+FCK.TempBaseTag);}else{B=FCKConfig.DocType+'<html dir="'+FCKConfig.ContentLangDirection+'"';if (FCKBrowserInfo.IsIE&&!FCKRegexLib.Html4DocType.test(FCKConfig.DocType)) B+=' style="overflow-y: scroll"';B+='><head><title></title>'+this._GetEditorAreaStyleTags()+'<link href="'+FCKConfig.FullBasePath+'css/fck_internal.css'+'" rel="stylesheet" type="text/css" _fcktemp="true" />';if (FCKBrowserInfo.IsIE) B+=FCK._GetBehaviorsStyle();else if (FCKConfig.ShowBorders) B+='<link href="'+FCKConfig.FullBasePath+'css/fck_showtableborders_gecko.css" rel="stylesheet" type="text/css" _fcktemp="true" />';B+=FCK.TempBaseTag;B+='</head><body>';if (FCKBrowserInfo.IsGecko&&(A.length==0||FCKRegexLib.EmptyParagraph.test(A))) B+=GECKO_BOGUS;else B+=A;B+='</body></html>';};this.EditingArea.OnLoad=FCK_EditingArea_OnLoad;this.EditingArea.Start(B);}else{this.EditingArea.OnLoad=null;this.EditingArea.Start(A);this.EditingArea.Textarea._FCKShowContextMenu=true;};if (FCKBrowserInfo.IsGecko) window.onresize();};function FCK_EditingArea_OnLoad(){FCK.EditorWindow=FCK.EditingArea.Window;FCK.EditorDocument=FCK.EditingArea.Document;FCK.InitializeBehaviors();FCK.OnAfterSetHTML();if (FCK.Status!=FCK_STATUS_NOTLOADED) return;FCK.ResetIsDirty();FCKTools.AttachToLinkedFieldFormSubmit(FCK.UpdateLinkedField);FCK.SetStatus(FCK_STATUS_ACTIVE);};FCK._GetEditorAreaStyleTags=function(){var A='';var B=FCKConfig.EditorAreaCSS;for (var i=0;i<B.length;i++) A+='<link href="'+B[i]+'" rel="stylesheet" type="text/css" />';return A;};var FCKFocusManager=FCK.FocusManager=new Object();FCKFocusManager.IsLocked=false;FCK.HasFocus=false;FCKFocusManager.AddWindow=function(A,B){var C;if (FCKBrowserInfo.IsIE) C=A.nodeType==1?A:A.frameElement?A.frameElement:A.document;else C=A.document;FCKTools.AddEventListener(C,'blur',FCKFocusManager_Win_OnBlur);FCKTools.AddEventListener(C,'focus',B?FCKFocusManager_Win_OnFocus_Area:FCKFocusManager_Win_OnFocus);};FCKFocusManager.RemoveWindow=function(A){if (FCKBrowserInfo.IsIE) oTarget=A.nodeType==1?A:A.frameElement?A.frameElement:A.document;else oTarget=A.document;FCKTools.RemoveEventListener(oTarget,'blur',FCKFocusManager_Win_OnBlur);FCKTools.RemoveEventListener(oTarget,'focus',FCKFocusManager_Win_OnFocus_Area);FCKTools.RemoveEventListener(oTarget,'focus',FCKFocusManager_Win_OnFocus);};FCKFocusManager.Lock=function(){this.IsLocked=true;};FCKFocusManager.Unlock=function(){if (this._HasPendingBlur) FCKFocusManager._Timer=window.setTimeout(FCKFocusManager_FireOnBlur,100);this.IsLocked=false;};FCKFocusManager._ResetTimer=function(){this._HasPendingBlur=false;if (this._Timer){window.clearTimeout(this._Timer);delete this._Timer;}};function FCKFocusManager_Win_OnBlur(){if (typeof(FCK)!='undefined'&&FCK.HasFocus){FCKFocusManager._ResetTimer();FCKFocusManager._Timer=window.setTimeout(FCKFocusManager_FireOnBlur,100);}};function FCKFocusManager_FireOnBlur(){if (FCKFocusManager.IsLocked) FCKFocusManager._HasPendingBlur=true;else{FCK.HasFocus=false;FCK.Events.FireEvent("OnBlur");}};function FCKFocusManager_Win_OnFocus_Area(){FCKFocusManager_Win_OnFocus();FCK.Focus();};function FCKFocusManager_Win_OnFocus(){FCKFocusManager._ResetTimer();if (!FCK.HasFocus&&!FCKFocusManager.IsLocked){FCK.HasFocus=true;FCK.Events.FireEvent("OnFocus");}}
FCK.Description="FCKeditor for Internet Explorer 5.5+";FCK._GetBehaviorsStyle=function(){if (!FCK._BehaviorsStyle){var A=FCKConfig.FullBasePath;var B='';var C;C='<style type="text/css" _fcktemp="true">'+'INPUT { behavior: url('+A+'css/behaviors/hiddenfield.htc) ; }';if (FCKConfig.ShowBorders) B='url('+A+'css/behaviors/showtableborders.htc)';C+='INPUT,TEXTAREA,SELECT,.FCK__Anchor,.FCK__PageBreak';if (FCKConfig.DisableObjectResizing){C+=',IMG';B+=' url('+A+'css/behaviors/disablehandles.htc)';};C+=' { behavior: url('+A+'css/behaviors/disablehandles.htc) ; }';if (B.length>0) C+='TABLE { behavior: '+B+' ; }';C+='</style>';FCK._BehaviorsStyle=C;};return FCK._BehaviorsStyle;};function Doc_OnMouseUp(){if (FCK.EditorWindow.event.srcElement.tagName=='HTML'){FCK.Focus();FCK.EditorWindow.event.cancelBubble=true;FCK.EditorWindow.event.returnValue=false;}};function Doc_OnPaste(){if (FCK.Status==FCK_STATUS_COMPLETE) FCK.Events.FireEvent("OnPaste");return false;};function Doc_OnKeyDown(){var e=FCK.EditorWindow.event;switch (e.keyCode){case 13:if (FCKConfig.UseBROnCarriageReturn&&!(e.ctrlKey||e.altKey||e.shiftKey)){Doc_OnKeyDownUndo();if (FCK.EditorDocument.queryCommandState('InsertOrderedList')||FCK.EditorDocument.queryCommandState('InsertUnorderedList')) return true;FCK.InsertHtml('<br>&nbsp;');var oRange=FCK.EditorDocument.selection.createRange();oRange.moveStart('character',-1);oRange.select();FCK.EditorDocument.selection.clear();return false;};break;case 8:if (FCKSelection.GetType()=='Control'){FCKSelection.Delete();return false;};break;case 9:if (FCKConfig.TabSpaces>0&&!(e.ctrlKey||e.altKey||e.shiftKey)){Doc_OnKeyDownUndo();FCK.InsertHtml(window.FCKTabHTML);return false;};break;case 90:if (e.ctrlKey&&!(e.altKey||e.shiftKey)){FCKUndo.Undo();return false;};break;case 89:if (e.ctrlKey&&!(e.altKey||e.shiftKey)){FCKUndo.Redo();return false;};break;};if (!(e.keyCode>=16&&e.keyCode<=18)) Doc_OnKeyDownUndo();return true;};function Doc_OnKeyDownUndo(){if (!FCKUndo.Typing){FCKUndo.SaveUndoStep();FCKUndo.Typing=true;FCK.Events.FireEvent("OnSelectionChange");};FCKUndo.TypesCount++;if (FCKUndo.TypesCount>FCKUndo.MaxTypes){FCKUndo.TypesCount=0;FCKUndo.SaveUndoStep();}};function Doc_OnDblClick(){FCK.OnDoubleClick(FCK.EditorWindow.event.srcElement);FCK.EditorWindow.event.cancelBubble=true;};function Doc_OnSelectionChange(){FCK.Events.FireEvent("OnSelectionChange");};FCK.InitializeBehaviors=function(A){this.EditorDocument.attachEvent('onmouseup',Doc_OnMouseUp);this.EditorDocument.body.attachEvent('onpaste',Doc_OnPaste);FCK.ContextMenu._InnerContextMenu.AttachToElement(FCK.EditorDocument.body);if (FCKConfig.TabSpaces>0){window.FCKTabHTML='';for (i=0;i<FCKConfig.TabSpaces;i++) window.FCKTabHTML+="&nbsp;";};this.EditorDocument.attachEvent("onkeydown",Doc_OnKeyDown);this.EditorDocument.attachEvent("ondblclick",Doc_OnDblClick);this.EditorDocument.attachEvent("onselectionchange",Doc_OnSelectionChange);};FCK.InsertHtml=function(A){A=FCKConfig.ProtectedSource.Protect(A);A=FCK.ProtectUrls(A);FCK.Focus();FCKUndo.SaveUndoStep();var B=FCK.EditorDocument.selection;if (B.type.toLowerCase()=='control') B.clear();B.createRange().pasteHTML(A);FCKDocumentProcessor.Process(FCK.EditorDocument);};FCK.SetInnerHtml=function(A){var B=FCK.EditorDocument;B.body.innerHTML='<div id="__fakeFCKRemove__">&nbsp;</div>'+A;B.getElementById('__fakeFCKRemove__').removeNode(true);};var FCK_PreloadImages_Count=0;var FCK_PreloadImages_Images=new Array();function FCK_PreloadImages(){var aImages=FCKConfig.PreloadImages||[];if (typeof(aImages)=='string') aImages=aImages.split(';');aImages.push(FCKConfig.SkinPath+'fck_strip.gif');FCK_PreloadImages_Count=aImages.length;var aImageElements=new Array();for (var i=0;i<aImages.length;i++){var eImg=document.createElement('img');eImg.onload=eImg.onerror=FCK_PreloadImages_OnImage;eImg.src=aImages[i];FCK_PreloadImages_Images[i]=eImg;}};function FCK_PreloadImages_OnImage(){if ((--FCK_PreloadImages_Count)==0) FCKTools.RunFunction(LoadToolbarSetup);};function Document_OnContextMenu(){return (event.srcElement._FCKShowContextMenu==true);};document.oncontextmenu=Document_OnContextMenu;function FCK_Cleanup(){this.EditorWindow=null;this.EditorDocument=null;}
FCK.RedirectNamedCommands=new Object();FCK.ExecuteNamedCommand=function(A,B,C){FCKUndo.SaveUndoStep();if (!C&&FCK.RedirectNamedCommands[A]!=null) FCK.ExecuteRedirectedNamedCommand(A,B);else{FCK.Focus();FCK.EditorDocument.execCommand(A,false,B);FCK.Events.FireEvent('OnSelectionChange');};FCKUndo.SaveUndoStep();};FCK.GetNamedCommandState=function(A){try{if (!FCK.EditorDocument.queryCommandEnabled(A)) return FCK_TRISTATE_DISABLED;else return FCK.EditorDocument.queryCommandState(A)?FCK_TRISTATE_ON:FCK_TRISTATE_OFF;}catch (e){return FCK_TRISTATE_OFF;}};FCK.GetNamedCommandValue=function(A){var B='';var C=FCK.GetNamedCommandState(A);if (C==FCK_TRISTATE_DISABLED) return null;try{B=this.EditorDocument.queryCommandValue(A);}catch(e) {};return B?B:'';};FCK.PasteFromWord=function(){FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.PasteFromWord,'dialog/fck_paste.html',400,330,'Word');};FCK.Preview=function(){var A=FCKConfig.ScreenWidth*0.8;var B=FCKConfig.ScreenHeight*0.7;var C=(FCKConfig.ScreenWidth-A)/2;var D=window.open('',null,'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+A+',height='+B+',left='+C);var E;if (FCKConfig.FullPage){if (FCK.TempBaseTag.length>0) E=FCK.TempBaseTag+FCK.GetXHTML();else E=FCK.GetXHTML();}else{E=FCKConfig.DocType+'<html dir="'+FCKConfig.ContentLangDirection+'">'+'<head>'+FCK.TempBaseTag+'<title>'+FCKLang.Preview+'</title>'+FCK._GetEditorAreaStyleTags()+'</head><body>'+FCK.GetXHTML()+'</body></html>';};D.document.write(E);D.document.close();};FCK.SwitchEditMode=function(A){var B=(FCK.EditMode==FCK_EDITMODE_WYSIWYG);var C;if (B){if (!A&&FCKBrowserInfo.IsIE) FCKUndo.SaveUndoStep();C=FCK.GetXHTML(FCKConfig.FormatSource);}else C=this.EditingArea.Textarea.value;FCK.EditMode=B?FCK_EDITMODE_SOURCE:FCK_EDITMODE_WYSIWYG;FCK.SetHTML(C);FCK.Focus();FCKTools.RunFunction(FCK.ToolbarSet.RefreshModeState,FCK.ToolbarSet);};FCK.CreateElement=function(A){var e=FCK.EditorDocument.createElement(A);return FCK.InsertElementAndGetIt(e);};FCK.InsertElementAndGetIt=function(e){e.setAttribute('FCKTempLabel','true');this.InsertElement(e);var A=FCK.EditorDocument.getElementsByTagName(e.tagName);for (var i=0;i<A.length;i++){if (A[i].getAttribute('FCKTempLabel')){A[i].removeAttribute('FCKTempLabel');return A[i];}};return null;};
FCK.Paste=function(){if (FCKConfig.ForcePasteAsPlainText){FCK.PasteAsPlainText();return;};var A=FCK.GetClipboardHTML();if (FCKConfig.AutoDetectPasteFromWord){var B=/<\w[^>]*(( class="?MsoNormal"?)|(="mso-))/gi;if (B.test(A)){if (confirm(FCKLang["PasteWordConfirm"])){FCK.PasteFromWord();return;}}};FCK.InsertHtml(A);};FCK.PasteAsPlainText=function(){var A=FCKTools.HTMLEncode(clipboardData.getData("Text"));A=A.replace(/\n/g,'<BR>');this.InsertHtml(A);};FCK.InsertElement=function(A){FCK.InsertHtml(A.outerHTML);};FCK.GetClipboardHTML=function(){var A=document.getElementById('___FCKHiddenDiv');if (!A){var A=document.createElement('DIV');A.id='___FCKHiddenDiv';A.style.visibility='hidden';A.style.overflow='hidden';A.style.position='absolute';A.style.width=1;A.style.height=1;document.body.appendChild(A);};A.innerHTML='';var C=document.body.createTextRange();C.moveToElementText(A);C.execCommand('Paste');var D=A.innerHTML;A.innerHTML='';return D;};FCK.AttachToOnSelectionChange=function(A){this.Events.AttachEvent('OnSelectionChange',A);};FCK.CreateLink=function(A){FCK.ExecuteNamedCommand('Unlink');if (A.length>0){var B='javascript:void(0);/*'+(new Date().getTime())+'*/';FCK.ExecuteNamedCommand('CreateLink',B);var C=this.EditorDocument.links;for (i=0;i<C.length;i++){var D=C[i];if (D.href==B){var E=D.innerHTML;D.href=A;D.innerHTML=E;return D;}}}};
var FCKSelection=FCK.Selection=new Object();
FCKSelection.GetType=function(){return FCK.EditorDocument.selection.type;};FCKSelection.GetSelectedElement=function(){if (this.GetType()=='Control'){var A=FCK.EditorDocument.selection.createRange();if (A&&A.item) return FCK.EditorDocument.selection.createRange().item(0);}};FCKSelection.GetParentElement=function(){switch (this.GetType()){case 'Control':return FCKSelection.GetSelectedElement().parentElement;case 'None':return;default:return FCK.EditorDocument.selection.createRange().parentElement();}};FCKSelection.SelectNode=function(A){FCK.Focus();FCK.EditorDocument.selection.empty();try{var B=FCK.EditorDocument.body.createControlRange();B.addElement(A);}catch(e){var B=FCK.EditorDocument.selection.createRange();B.moveToElementText(A);};B.select();};FCKSelection.Collapse=function(A){FCK.Focus();if (this.GetType()=='Text'){var B=FCK.EditorDocument.selection.createRange();B.collapse(A==null||A===true);B.select();}};FCKSelection.HasAncestorNode=function(A){var B;if (FCK.EditorDocument.selection.type=="Control"){B=this.GetSelectedElement();}else{var C=FCK.EditorDocument.selection.createRange();B=C.parentElement();};while (B){if (B.tagName==A) return true;B=B.parentNode;};return false;};FCKSelection.MoveToAncestorNode=function(A){var B;if (FCK.EditorDocument.selection.type=="Control"){var C=FCK.EditorDocument.selection.createRange();for (i=0;i<C.length;i++){if (C(i).parentNode){B=C(i).parentNode;break;}}}else{var C=FCK.EditorDocument.selection.createRange();B=C.parentElement();};while (B&&B.nodeName!=A) B=B.parentNode;return B;};FCKSelection.Delete=function(){var A=FCK.EditorDocument.selection;if (A.type.toLowerCase()!="none"){A.clear();};return A;};
var FCKTableHandler=new Object();FCKTableHandler.InsertRow=function(){var A=FCKSelection.MoveToAncestorNode("TR");if (!A) return;var B=A.cloneNode(true);A.parentNode.insertBefore(B,A);FCKTableHandler.ClearRow(A);};FCKTableHandler.DeleteRows=function(A){if (!A) A=FCKSelection.MoveToAncestorNode("TR");if (!A) return;var B=FCKTools.GetElementAscensor(A,'TABLE');if (B.rows.length==1){FCKTableHandler.DeleteTable(B);return;};A.parentNode.removeChild(A);};FCKTableHandler.DeleteTable=function(A){if (!A){var A=FCKSelection.GetSelectedElement();if (!A||A.tagName!='TABLE') A=FCKSelection.MoveToAncestorNode("TABLE");};if (!A) return;FCKSelection.SelectNode(A);FCKSelection.Collapse();A.parentNode.removeChild(A);};FCKTableHandler.InsertColumn=function(){var A=FCKSelection.MoveToAncestorNode("TD");if (!A) A=FCKSelection.MoveToAncestorNode("TH");if (!A) return;var B=FCKTools.GetElementAscensor(A,'TABLE');var C=A.cellIndex+1;for (var i=0;i<B.rows.length;i++){var D=B.rows[i];if (D.cells.length<C) continue;A=D.cells[C-1].cloneNode(false);if (FCKBrowserInfo.IsGecko) A.innerHTML=GECKO_BOGUS;var E=D.cells[C];if (E) D.insertBefore(A,E);else D.appendChild(A);}};FCKTableHandler.DeleteColumns=function(){var A=FCKSelection.MoveToAncestorNode('TD')||FCKSelection.MoveToAncestorNode('TH');if (!A) return;var B=FCKTools.GetElementAscensor(A,'TABLE');var C=A.cellIndex;for (var i=B.rows.length-1;i>=0;i--){var D=B.rows[i];if (C==0&&D.cells.length==1){FCKTableHandler.DeleteRows(D);continue;};if (D.cells[C]) D.removeChild(D.cells[C]);}};FCKTableHandler.InsertCell=function(A){var B=A?A:FCKSelection.MoveToAncestorNode("TD");if (!B) return;var C=FCK.EditorDocument.createElement("TD");if (FCKBrowserInfo.IsGecko) C.innerHTML=GECKO_BOGUS;if (B.cellIndex==B.parentNode.cells.length-1){B.parentNode.appendChild(C);}else{B.parentNode.insertBefore(C,B.nextSibling);};return C;};FCKTableHandler.DeleteCell=function(A){if (A.parentNode.cells.length==1){FCKTableHandler.DeleteRows(FCKTools.GetElementAscensor(A,'TR'));return;};A.parentNode.removeChild(A);};FCKTableHandler.DeleteCells=function(){var A=FCKTableHandler.GetSelectedCells();for (var i=A.length-1;i>=0;i--){FCKTableHandler.DeleteCell(A[i]);}};FCKTableHandler.MergeCells=function(){var A=FCKTableHandler.GetSelectedCells();if (A.length<2) return;if (A[0].parentNode!=A[A.length-1].parentNode) return;var B=isNaN(A[0].colSpan)?1:A[0].colSpan;var C='';var D=FCK.EditorDocument.createDocumentFragment();for (var i=A.length-1;i>=0;i--){var E=A[i];for (var c=E.childNodes.length-1;c>=0;c--){var F=E.removeChild(E.childNodes[c]);if ((F.hasAttribute&&F.hasAttribute('_moz_editor_bogus_node'))||(F.getAttribute&&F.getAttribute('type',2)=='_moz')) continue;D.insertBefore(F,D.firstChild);};if (i>0){B+=isNaN(E.colSpan)?1:E.colSpan;FCKTableHandler.DeleteCell(E);}};A[0].colSpan=B;if (FCKBrowserInfo.IsGecko&&D.childNodes.length==0) A[0].innerHTML=GECKO_BOGUS;else A[0].appendChild(D);};FCKTableHandler.SplitCell=function(){var A=FCKTableHandler.GetSelectedCells();if (A.length!=1) return;var B=this._CreateTableMap(A[0].parentNode.parentNode);var C=FCKTableHandler._GetCellIndexSpan(B,A[0].parentNode.rowIndex,A[0]);var D=this._GetCollumnCells(B,C);for (var i=0;i<D.length;i++){if (D[i]==A[0]){var E=this.InsertCell(A[0]);if (!isNaN(A[0].rowSpan)&&A[0].rowSpan>1) E.rowSpan=A[0].rowSpan;}else{if (isNaN(D[i].colSpan)) D[i].colSpan=2;else D[i].colSpan+=1;}}};FCKTableHandler._GetCellIndexSpan=function(A,B,C){if (A.length<B+1) return null;var D=A[B];for (var c=0;c<D.length;c++){if (D[c]==C) return c;};return null;};FCKTableHandler._GetCollumnCells=function(A,B){var C=new Array();for (var r=0;r<A.length;r++){var D=A[r][B];if (D&&(C.length==0||C[C.length-1]!=D)) C[C.length]=D;};return C;};FCKTableHandler._CreateTableMap=function(A){var B=A.rows;var r=-1;var C=new Array();for (var i=0;i<B.length;i++){r++;if (!C[r]) C[r]=new Array();var c=-1;for (var j=0;j<B[i].cells.length;j++){var D=B[i].cells[j];c++;while (C[r][c]) c++;var E=isNaN(D.colSpan)?1:D.colSpan;var F=isNaN(D.rowSpan)?1:D.rowSpan;for (var G=0;G<F;G++){if (!C[r+G]) C[r+G]=new Array();for (var H=0;H<E;H++){C[r+G][c+H]=B[i].cells[j];}};c+=E-1;}};return C;};FCKTableHandler.ClearRow=function(A){var B=A.cells;for (var i=0;i<B.length;i++){if (FCKBrowserInfo.IsGecko) B[i].innerHTML=GECKO_BOGUS;else B[i].innerHTML='';}};
FCKTableHandler.GetSelectedCells=function(){var A=new Array();var B=FCK.EditorDocument.selection.createRange();var C=FCKSelection.GetParentElement();if (C&&C.tagName.Equals('TD','TH')) A[0]=C;else{var C=FCKSelection.MoveToAncestorNode("TABLE");if (C){for (var i=0;i<C.cells.length;i++){var E=FCK.EditorDocument.selection.createRange();E.moveToElementText(C.cells[i]);if (B.inRange(E)||(B.compareEndPoints('StartToStart',E)>=0&&B.compareEndPoints('StartToEnd',E)<=0)||(B.compareEndPoints('EndToStart',E)>=0&&B.compareEndPoints('EndToEnd',E)<=0)){A[A.length]=C.cells[i];}}}};return A;};
var FCKXml=function(){this.Error=false;};FCKXml.prototype.LoadUrl=function(A){this.Error=false;var B=FCKTools.CreateXmlObject('XmlHttp');if (!B){this.Error=true;return;};B.open("GET",A,false);B.send(null);if (B.status==200||B.status==304) this.DOMDocument=B.responseXML;else if (B.status==0&&B.readyState==4){this.DOMDocument=FCKTools.CreateXmlObject('DOMDocument');this.DOMDocument.async=false;this.DOMDocument.resolveExternals=false;this.DOMDocument.loadXML(B.responseText);}else{this.Error=true;alert('Error loading "'+A+'"');}};FCKXml.prototype.SelectNodes=function(A,B){if (this.Error) return new Array();if (B) return B.selectNodes(A);else return this.DOMDocument.selectNodes(A);};FCKXml.prototype.SelectSingleNode=function(A,B){if (this.Error) return;if (B) return B.selectSingleNode(A);else return this.DOMDocument.selectSingleNode(A);}
var FCKStyleDef=function(A,B){this.Name=A;this.Element=B.toUpperCase();this.IsObjectElement=FCKRegexLib.ObjectElements.test(this.Element);this.Attributes=new Object();};FCKStyleDef.prototype.AddAttribute=function(A,B){this.Attributes[A]=B;};FCKStyleDef.prototype.GetOpenerTag=function(){var s='<'+this.Element;for (var a in this.Attributes) s+=' '+a+'="'+this.Attributes[a]+'"';return s+'>';};FCKStyleDef.prototype.GetCloserTag=function(){return '</'+this.Element+'>';};FCKStyleDef.prototype.RemoveFromSelection=function(){if (FCKSelection.GetType()=='Control') this._RemoveMe(FCK.ToolbarSet.CurrentInstance.Selection.GetSelectedElement());else this._RemoveMe(FCK.ToolbarSet.CurrentInstance.Selection.GetParentElement());}
FCKStyleDef.prototype.ApplyToSelection=function(){var A=FCK.ToolbarSet.CurrentInstance.EditorDocument.selection;if (A.type=='Text'){var B=A.createRange();var e=document.createElement(this.Element);e.innerHTML=B.htmlText;this._AddAttributes(e);this._RemoveDuplicates(e);B.pasteHTML(e.outerHTML);}else if (A.type=='Control'){var C=FCK.ToolbarSet.CurrentInstance.Selection.GetSelectedElement();if (C.tagName==this.Element) this._AddAttributes(C);}};FCKStyleDef.prototype._AddAttributes=function(A){for (var a in this.Attributes){switch (a.toLowerCase()){case 'style':A.style.cssText=this.Attributes[a];break;case 'class':A.setAttribute('className',this.Attributes[a],0);break;case 'src':A.setAttribute('_fcksavedurl',this.Attributes[a],0);default:A.setAttribute(a,this.Attributes[a],0);}}};FCKStyleDef.prototype._RemoveDuplicates=function(A){for (var i=0;i<A.children.length;i++){var B=A.children[i];this._RemoveDuplicates(B);if (this.IsEqual(B)) FCKTools.RemoveOuterTags(B);}};FCKStyleDef.prototype.IsEqual=function(e){if (e.tagName!=this.Element) return false;for (var a in this.Attributes){switch (a.toLowerCase()){case 'style':if (e.style.cssText.toLowerCase()!=this.Attributes[a].toLowerCase()) return false;break;case 'class':if (e.getAttribute('className',0)!=this.Attributes[a]) return false;break;default:if (e.getAttribute(a,0)!=this.Attributes[a]) return false;}};return true;};FCKStyleDef.prototype._RemoveMe=function(A){if (!A) return;var B=A.parentElement;if (this.IsEqual(A)){if (this.IsObjectElement){for (var a in this.Attributes){switch (a.toLowerCase()){case 'class':A.removeAttribute('className',0);break;default:A.removeAttribute(a,0);}};return;}else FCKTools.RemoveOuterTags(A);};this._RemoveMe(B);}
var FCKStylesLoader=function(){this.Styles=new Object();this.StyleGroups=new Object();this.Loaded=false;this.HasObjectElements=false;};FCKStylesLoader.prototype.Load=function(A){var B=new FCKXml();B.LoadUrl(A);var C=B.SelectNodes('Styles/Style');for (var i=0;i<C.length;i++){var D=C[i].attributes.getNamedItem('element').value.toUpperCase();var E=new FCKStyleDef(C[i].attributes.getNamedItem('name').value,D);if (E.IsObjectElement) this.HasObjectElements=true;var F=B.SelectNodes('Attribute',C[i]);for (var j=0;j<F.length;j++){var G=F[j].attributes.getNamedItem('name').value;var H=F[j].attributes.getNamedItem('value').value;if (G.toLowerCase()=='style'){var I=document.createElement('SPAN');I.style.cssText=H;H=I.style.cssText;};E.AddAttribute(G,H);};this.Styles[E.Name]=E;var J=this.StyleGroups[D];if (J==null){this.StyleGroups[D]=new Array();J=this.StyleGroups[D];};J[J.length]=E;};this.Loaded=true;}
var FCKNamedCommand=function(A){this.Name=A;};FCKNamedCommand.prototype.Execute=function(){FCK.ExecuteNamedCommand(this.Name);};FCKNamedCommand.prototype.GetState=function(){return FCK.GetNamedCommandState(this.Name);};
var FCKDialogCommand=function(A,B,C,D,E,F,G){this.Name=A;this.Title=B;this.Url=C;this.Width=D;this.Height=E;this.GetStateFunction=F;this.GetStateParam=G;};FCKDialogCommand.prototype.Execute=function(){FCKDialog.OpenDialog('FCKDialog_'+this.Name,this.Title,this.Url,this.Width,this.Height);};FCKDialogCommand.prototype.GetState=function(){if (this.GetStateFunction) return this.GetStateFunction(this.GetStateParam);else return FCK_TRISTATE_OFF;};var FCKUndefinedCommand=function(){this.Name='Undefined';};FCKUndefinedCommand.prototype.Execute=function(){alert(FCKLang.NotImplemented);};FCKUndefinedCommand.prototype.GetState=function(){return FCK_TRISTATE_OFF;};var FCKFontNameCommand=function(){this.Name='FontName';};FCKFontNameCommand.prototype.Execute=function(A){if (A==null||A==""){}else FCK.ExecuteNamedCommand('FontName',A);};FCKFontNameCommand.prototype.GetState=function(){return FCK.GetNamedCommandValue('FontName');};var FCKFontSizeCommand=function(){this.Name='FontSize';};FCKFontSizeCommand.prototype.Execute=function(A){if (typeof(A)=='string') A=parseInt(A);if (A==null||A==''){FCK.ExecuteNamedCommand('FontSize',3);}else FCK.ExecuteNamedCommand('FontSize',A);};FCKFontSizeCommand.prototype.GetState=function(){return FCK.GetNamedCommandValue('FontSize');};var FCKFormatBlockCommand=function(){this.Name='FormatBlock';};FCKFormatBlockCommand.prototype.Execute=function(A){if (A==null||A=='') FCK.ExecuteNamedCommand('FormatBlock','<P>');else if (A=='div'&&FCKBrowserInfo.IsGecko) FCK.ExecuteNamedCommand('FormatBlock','div');else FCK.ExecuteNamedCommand('FormatBlock','<'+A+'>');};FCKFormatBlockCommand.prototype.GetState=function(){return FCK.GetNamedCommandValue('FormatBlock');};var FCKPreviewCommand=function(){this.Name='Preview';};FCKPreviewCommand.prototype.Execute=function(){FCK.Preview();};FCKPreviewCommand.prototype.GetState=function(){return FCK_TRISTATE_OFF;};var FCKSaveCommand=function(){this.Name='Save';};FCKSaveCommand.prototype.Execute=function(){var A=FCK.LinkedField.form;if (typeof(A.onsubmit)=='function'){var B=A.onsubmit();if (B!=null&&B===false) return;};A.submit();};FCKSaveCommand.prototype.GetState=function(){return FCK_TRISTATE_OFF;};var FCKNewPageCommand=function(){this.Name='NewPage';};FCKNewPageCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();FCK.SetHTML('');FCKUndo.Typing=true;};FCKNewPageCommand.prototype.GetState=function(){return FCK_TRISTATE_OFF;};var FCKSourceCommand=function(){this.Name='Source';};FCKSourceCommand.prototype.Execute=function(){if (FCKConfig.SourcePopup){var A=FCKConfig.ScreenWidth*0.65;var B=FCKConfig.ScreenHeight*0.65;FCKDialog.OpenDialog('FCKDialog_Source',FCKLang.Source,'dialog/fck_source.html',A,B,null,null,true);}else FCK.SwitchEditMode();};FCKSourceCommand.prototype.GetState=function(){return (FCK.EditMode==FCK_EDITMODE_WYSIWYG?FCK_TRISTATE_OFF:FCK_TRISTATE_ON);};var FCKUndoCommand=function(){this.Name='Undo';};FCKUndoCommand.prototype.Execute=function(){if (FCKBrowserInfo.IsIE) FCKUndo.Undo();else FCK.ExecuteNamedCommand('Undo');};FCKUndoCommand.prototype.GetState=function(){if (FCKBrowserInfo.IsIE) return (FCKUndo.CheckUndoState()?FCK_TRISTATE_OFF:FCK_TRISTATE_DISABLED);else return FCK.GetNamedCommandState('Undo');};var FCKRedoCommand=function(){this.Name='Redo';};FCKRedoCommand.prototype.Execute=function(){if (FCKBrowserInfo.IsIE) FCKUndo.Redo();else FCK.ExecuteNamedCommand('Redo');};FCKRedoCommand.prototype.GetState=function(){if (FCKBrowserInfo.IsIE) return (FCKUndo.CheckRedoState()?FCK_TRISTATE_OFF:FCK_TRISTATE_DISABLED);else return FCK.GetNamedCommandState('Redo');};var FCKPageBreakCommand=function(){this.Name='PageBreak';};FCKPageBreakCommand.prototype.Execute=function(){var e=FCK.EditorDocument.createElement('DIV');e.style.pageBreakAfter='always';e.innerHTML='<span style="DISPLAY:none">&nbsp;</span>';var A=FCKDocumentProcessor_CreateFakeImage('FCK__PageBreak',e);A=FCK.InsertElement(A);};FCKPageBreakCommand.prototype.GetState=function(){return 0;};var FCKUnlinkCommand=function(){this.Name='Unlink';};FCKUnlinkCommand.prototype.Execute=function(){if (FCKBrowserInfo.IsGecko){var A=FCK.Selection.MoveToAncestorNode('A');if (A) FCK.Selection.SelectNode(A);};FCK.ExecuteNamedCommand(this.Name);if (FCKBrowserInfo.IsGecko) FCK.Selection.Collapse(true);};FCKUnlinkCommand.prototype.GetState=function(){return FCK.GetNamedCommandState(this.Name);}
var FCKSpellCheckCommand=function(){this.Name='SpellCheck';this.IsEnabled=(FCKConfig.SpellChecker=='ieSpell'||FCKConfig.SpellChecker=='SpellerPages');};FCKSpellCheckCommand.prototype.Execute=function(){switch (FCKConfig.SpellChecker){case 'ieSpell':this._RunIeSpell();break;case 'SpellerPages':FCKDialog.OpenDialog('FCKDialog_SpellCheck','Spell Check','dialog/fck_spellerpages.html',440,480);break;}};FCKSpellCheckCommand.prototype._RunIeSpell=function(){try{var A=new ActiveXObject("ieSpell.ieSpellExtension");A.CheckAllLinkedDocuments(FCK.EditorDocument);}catch(e){if(e.number==-2146827859){if (confirm(FCKLang.IeSpellDownload)) window.open(FCKConfig.IeSpellDownloadUrl,'IeSpellDownload');}else alert('Error Loading ieSpell: '+e.message+' ('+e.number+')');}};FCKSpellCheckCommand.prototype.GetState=function(){return this.IsEnabled?FCK_TRISTATE_OFF:FCK_TRISTATE_DISABLED;}
var FCKTextColorCommand=function(A){this.Name=A=='ForeColor'?'TextColor':'BGColor';this.Type=A;var B;if (FCKBrowserInfo.IsIE) B=window;else if (FCK.ToolbarSet._IFrame) B=FCKTools.GetElementWindow(FCK.ToolbarSet._IFrame);else B=window.parent;this._Panel=new FCKPanel(B,true);this._Panel.AppendStyleSheet(FCKConfig.SkinPath+'fck_editor.css');this._Panel.MainNode.className='FCK_Panel';this._CreatePanelBody(this._Panel.Document,this._Panel.MainNode);FCKTools.DisableSelection(this._Panel.Document.body);};FCKTextColorCommand.prototype.Execute=function(A,B,C){FCK._ActiveColorPanelType=this.Type;this._Panel.Show(A,B,C);};FCKTextColorCommand.prototype.SetColor=function(A){if (FCK._ActiveColorPanelType=='ForeColor') FCK.ExecuteNamedCommand('ForeColor',A);else if (FCKBrowserInfo.IsGeckoLike){if (FCKBrowserInfo.IsGecko&&!FCKConfig.GeckoUseSPAN) FCK.EditorDocument.execCommand('useCSS',false,false);FCK.ExecuteNamedCommand('hilitecolor',A);if (FCKBrowserInfo.IsGecko&&!FCKConfig.GeckoUseSPAN) FCK.EditorDocument.execCommand('useCSS',false,true);}else FCK.ExecuteNamedCommand('BackColor',A);delete FCK._ActiveColorPanelType;};FCKTextColorCommand.prototype.GetState=function(){return FCK_TRISTATE_OFF;};function FCKTextColorCommand_OnMouseOver() { this.className='ColorSelected';};function FCKTextColorCommand_OnMouseOut() { this.className='ColorDeselected';};function FCKTextColorCommand_OnClick(){this.className='ColorDeselected';this.Command.SetColor('#'+this.Color);this.Command._Panel.Hide();};function FCKTextColorCommand_AutoOnClick(){this.className='ColorDeselected';this.Command.SetColor('');this.Command._Panel.Hide();};function FCKTextColorCommand_MoreOnClick(){this.className='ColorDeselected';this.Command._Panel.Hide();FCKDialog.OpenDialog('FCKDialog_Color',FCKLang.DlgColorTitle,'dialog/fck_colorselector.html',400,330,this.Command.SetColor);};FCKTextColorCommand.prototype._CreatePanelBody=function(A,B){function CreateSelectionDiv(){var C=A.createElement("DIV");C.className='ColorDeselected';C.onmouseover=FCKTextColorCommand_OnMouseOver;C.onmouseout=FCKTextColorCommand_OnMouseOut;return C;};var D=B.appendChild(A.createElement("TABLE"));D.className='ForceBaseFont';D.style.tableLayout='fixed';D.cellPadding=0;D.cellSpacing=0;D.border=0;D.width=150;var E=D.insertRow(-1).insertCell(-1);E.colSpan=8;var C=E.appendChild(CreateSelectionDiv());C.innerHTML='<table cellspacing="0" cellpadding="0" width="100%" border="0">\<tr>\<td><div class="ColorBoxBorder"><div class="ColorBox" style="background-color: #000000"></div></div></td>\<td nowrap width="100%" align="center">' + FCKLang.ColorAutomatic + '</td>\</tr>\</table>';C.Command=this;C.onclick=FCKTextColorCommand_AutoOnClick;var G=FCKConfig.FontColors.toString().split(',');var H=0;while (H<G.length){var I=D.insertRow(-1);for (var i=0;i<8&&H<G.length;i++,H++){C=I.insertCell(-1).appendChild(CreateSelectionDiv());C.Color=G[H];C.innerHTML='<div class="ColorBoxBorder"><div class="ColorBox" style="background-color: #'+G[H]+'"></div></div>';C.Command=this;C.onclick=FCKTextColorCommand_OnClick;}};E=D.insertRow(-1).insertCell(-1);E.colSpan=8;C=E.appendChild(CreateSelectionDiv());C.innerHTML='<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td nowrap align="center">'+FCKLang.ColorMoreColors+'</td></tr></table>';C.Command=this;C.onclick=FCKTextColorCommand_MoreOnClick;}
var FCKPastePlainTextCommand=function(){this.Name='PasteText';};FCKPastePlainTextCommand.prototype.Execute=function(){FCK.PasteAsPlainText();};FCKPastePlainTextCommand.prototype.GetState=function(){return FCK.GetNamedCommandState('Paste');};
var FCKPasteWordCommand=function(){this.Name='PasteWord';};FCKPasteWordCommand.prototype.Execute=function(){FCK.PasteFromWord();};FCKPasteWordCommand.prototype.GetState=function(){if (FCKConfig.ForcePasteAsPlainText) return FCK_TRISTATE_DISABLED;else return FCK.GetNamedCommandState('Paste');};
var FCKTableCommand=function(A){this.Name=A;};FCKTableCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();switch (this.Name){case 'TableInsertRow':FCKTableHandler.InsertRow();break;case 'TableDeleteRows':FCKTableHandler.DeleteRows();break;case 'TableInsertColumn':FCKTableHandler.InsertColumn();break;case 'TableDeleteColumns':FCKTableHandler.DeleteColumns();break;case 'TableInsertCell':FCKTableHandler.InsertCell();break;case 'TableDeleteCells':FCKTableHandler.DeleteCells();break;case 'TableMergeCells':FCKTableHandler.MergeCells();break;case 'TableSplitCell':FCKTableHandler.SplitCell();break;case 'TableDelete':FCKTableHandler.DeleteTable();break;default:alert(FCKLang.UnknownCommand.replace(/%1/g,this.Name));}};FCKTableCommand.prototype.GetState=function(){return FCK_TRISTATE_OFF;}
var FCKStyleCommand=function(){this.Name='Style';this.StylesLoader=new FCKStylesLoader();this.StylesLoader.Load(FCKConfig.StylesXmlPath);this.Styles=this.StylesLoader.Styles;};FCKStyleCommand.prototype.Execute=function(A,B){FCKUndo.SaveUndoStep();if (B.Selected) B.Style.RemoveFromSelection();else B.Style.ApplyToSelection();FCKUndo.SaveUndoStep();FCK.Focus();FCK.Events.FireEvent("OnSelectionChange");};FCKStyleCommand.prototype.GetState=function(){if (!FCK.EditorDocument) return FCK_TRISTATE_DISABLED;var A=FCK.EditorDocument.selection;if (FCKSelection.GetType()=='Control'){var e=FCKSelection.GetSelectedElement();if (e) return this.StylesLoader.StyleGroups[e.tagName]?FCK_TRISTATE_OFF:FCK_TRISTATE_DISABLED;};return FCK_TRISTATE_OFF;};FCKStyleCommand.prototype.GetActiveStyles=function(){var A=new Array();if (FCKSelection.GetType()=='Control') this._CheckStyle(FCKSelection.GetSelectedElement(),A,false);else this._CheckStyle(FCKSelection.GetParentElement(),A,true);return A;};FCKStyleCommand.prototype._CheckStyle=function(A,B,C){if (!A) return;if (A.nodeType==1){var D=this.StylesLoader.StyleGroups[A.tagName];if (D){for (var i=0;i<D.length;i++){if (D[i].IsEqual(A)) B[B.length]=D[i];}}};if (C) this._CheckStyle(A.parentNode,B,C);}
var FCKFitWindow=function(){this.Name='FitWindow';};FCKFitWindow.prototype.Execute=function(){var A=window.frameElement;var B=A.style;var C=parent;var D=C.document.documentElement;var E=C.document.body;var F=E.style;if (!this.IsMaximized){if(FCKBrowserInfo.IsIE) C.attachEvent('onresize',FCKFitWindow_Resize);else C.addEventListener('resize',FCKFitWindow_Resize,true);this._ScrollPos=FCKTools.GetScrollPosition(C);var G=A;while(G=G.parentNode){if (G.nodeType==1) G._fckSavedStyles=FCKTools.SaveStyles(G);};if (FCKBrowserInfo.IsIE){this.documentElementOverflow=D.style.overflow;D.style.overflow='hidden';F.overflow='hidden';}else{F.overflow='hidden';F.width='0px';F.height='0px';};this._EditorFrameStyles=FCKTools.SaveStyles(A);var H=FCKTools.GetViewPaneSize(C);B.position="absolute";B.zIndex=FCKConfig.FloatingPanelsZIndex-1;B.left="0px";B.top="0px";B.width=H.Width+"px";B.height=H.Height+"px";if (!FCKBrowserInfo.IsIE){B.borderRight=B.borderBottom="9999px solid white";B.backgroundColor="white";};C.scrollTo(0,0);this.IsMaximized=true;}else{if(FCKBrowserInfo.IsIE) C.detachEvent("onresize",FCKFitWindow_Resize);else C.removeEventListener("resize",FCKFitWindow_Resize,true);var G=A;while(G=G.parentNode){if (G._fckSavedStyles){FCKTools.RestoreStyles(G,G._fckSavedStyles);G._fckSavedStyles=null;}};if (FCKBrowserInfo.IsIE) D.style.overflow=this.documentElementOverflow;FCKTools.RestoreStyles(A,this._EditorFrameStyles);C.scrollTo(this._ScrollPos.X,this._ScrollPos.Y);this.IsMaximized=false;};FCKToolbarItems.GetItem('FitWindow').RefreshState();FCK.EditingArea.MakeEditable();FCK.Focus();};FCKFitWindow.prototype.GetState=function(){if (FCKConfig.ToolbarLocation!='In') return FCK_TRISTATE_DISABLED;else return (this.IsMaximized?FCK_TRISTATE_ON:FCK_TRISTATE_OFF);};function FCKFitWindow_Resize(){var oViewPaneSize=FCKTools.GetViewPaneSize(parent);var eEditorFrameStyle=window.frameElement.style;eEditorFrameStyle.width=oViewPaneSize.Width+'px';eEditorFrameStyle.height=oViewPaneSize.Height+'px';};
var FCKCommands=FCK.Commands=new Object();FCKCommands.LoadedCommands=new Object();FCKCommands.RegisterCommand=function(A,B){this.LoadedCommands[A]=B;};FCKCommands.GetCommand=function(A){var B=FCKCommands.LoadedCommands[A];if (B) return B;switch (A){case 'DocProps':B=new FCKDialogCommand('DocProps',FCKLang.DocProps,'dialog/fck_docprops.html',400,390,FCKCommands.GetFullPageState);break;case 'Templates':B=new FCKDialogCommand('Templates',FCKLang.DlgTemplatesTitle,'dialog/fck_template.html',380,450);break;case 'Link':B=new FCKDialogCommand('Link',FCKLang.DlgLnkWindowTitle,'dialog/fck_link.html',400,330,FCK.GetNamedCommandState,'CreateLink');break;case 'Unlink':B=new FCKUnlinkCommand();break;case 'Anchor':B=new FCKDialogCommand('Anchor',FCKLang.DlgAnchorTitle,'dialog/fck_anchor.html',370,170);break;case 'BulletedList':B=new FCKDialogCommand('BulletedList',FCKLang.BulletedListProp,'dialog/fck_listprop.html',370,170);break;case 'NumberedList':B=new FCKDialogCommand('NumberedList',FCKLang.NumberedListProp,'dialog/fck_listprop.html',370,170);break;case 'About':B=new FCKDialogCommand('About',FCKLang.About,'dialog/fck_about.html',400,330);break;case 'Find':B=new FCKDialogCommand('Find',FCKLang.DlgFindTitle,'dialog/fck_find.html',340,170);break;case 'Replace':B=new FCKDialogCommand('Replace',FCKLang.DlgReplaceTitle,'dialog/fck_replace.html',340,200);break;case 'Image':B=new FCKDialogCommand('Image',FCKLang.DlgImgTitle,'dialog/fck_image.html',450,400);break;case 'Flash':B=new FCKDialogCommand('Flash',FCKLang.DlgFlashTitle,'dialog/fck_flash.html',450,400);break;case 'SpecialChar':B=new FCKDialogCommand('SpecialChar',FCKLang.DlgSpecialCharTitle,'dialog/fck_specialchar.html',400,320);break;case 'Smiley':B=new FCKDialogCommand('Smiley',FCKLang.DlgSmileyTitle,'dialog/fck_smiley.html',FCKConfig.SmileyWindowWidth,FCKConfig.SmileyWindowHeight);break;case 'Table':B=new FCKDialogCommand('Table',FCKLang.DlgTableTitle,'dialog/fck_table.html',450,250);break;case 'TableProp':B=new FCKDialogCommand('Table',FCKLang.DlgTableTitle,'dialog/fck_table.html?Parent',400,250);break;case 'TableCellProp':B=new FCKDialogCommand('TableCell',FCKLang.DlgCellTitle,'dialog/fck_tablecell.html',550,250);break;case 'UniversalKey':B=new FCKDialogCommand('UniversalKey',FCKLang.UniversalKeyboard,'dialog/fck_universalkey.html',415,300);break;case 'Style':B=new FCKStyleCommand();break;case 'FontName':B=new FCKFontNameCommand();break;case 'FontSize':B=new FCKFontSizeCommand();break;case 'FontFormat':B=new FCKFormatBlockCommand();break;case 'Source':B=new FCKSourceCommand();break;case 'Preview':B=new FCKPreviewCommand();break;case 'Save':B=new FCKSaveCommand();break;case 'NewPage':B=new FCKNewPageCommand();break;case 'PageBreak':B=new FCKPageBreakCommand();break;case 'TextColor':B=new FCKTextColorCommand('ForeColor');break;case 'BGColor':B=new FCKTextColorCommand('BackColor');break;case 'PasteText':B=new FCKPastePlainTextCommand();break;case 'PasteWord':B=new FCKPasteWordCommand();break;case 'TableInsertRow':B=new FCKTableCommand('TableInsertRow');break;case 'TableDeleteRows':B=new FCKTableCommand('TableDeleteRows');break;case 'TableInsertColumn':B=new FCKTableCommand('TableInsertColumn');break;case 'TableDeleteColumns':B=new FCKTableCommand('TableDeleteColumns');break;case 'TableInsertCell':B=new FCKTableCommand('TableInsertCell');break;case 'TableDeleteCells':B=new FCKTableCommand('TableDeleteCells');break;case 'TableMergeCells':B=new FCKTableCommand('TableMergeCells');break;case 'TableSplitCell':B=new FCKTableCommand('TableSplitCell');break;case 'TableDelete':B=new FCKTableCommand('TableDelete');break;case 'Form':B=new FCKDialogCommand('Form',FCKLang.Form,'dialog/fck_form.html',380,230);break;case 'Checkbox':B=new FCKDialogCommand('Checkbox',FCKLang.Checkbox,'dialog/fck_checkbox.html',380,230);break;case 'Radio':B=new FCKDialogCommand('Radio',FCKLang.RadioButton,'dialog/fck_radiobutton.html',380,230);break;case 'TextField':B=new FCKDialogCommand('TextField',FCKLang.TextField,'dialog/fck_textfield.html',380,230);break;case 'Textarea':B=new FCKDialogCommand('Textarea',FCKLang.Textarea,'dialog/fck_textarea.html',380,230);break;case 'HiddenField':B=new FCKDialogCommand('HiddenField',FCKLang.HiddenField,'dialog/fck_hiddenfield.html',380,230);break;case 'Button':B=new FCKDialogCommand('Button',FCKLang.Button,'dialog/fck_button.html',380,230);break;case 'Select':B=new FCKDialogCommand('Select',FCKLang.SelectionField,'dialog/fck_select.html',400,380);break;case 'ImageButton':B=new FCKDialogCommand('ImageButton',FCKLang.ImageButton,'dialog/fck_image.html?ImageButton',450,400);break;case 'SpellCheck':B=new FCKSpellCheckCommand();break;case 'FitWindow':B=new FCKFitWindow();break;case 'Undo':B=new FCKUndoCommand();break;case 'Redo':B=new FCKRedoCommand();break;case 'Undefined':B=new FCKUndefinedCommand();break;default:if (FCKRegexLib.NamedCommands.test(A)) B=new FCKNamedCommand(A);else{alert(FCKLang.UnknownCommand.replace(/%1/g,A));return null;}};FCKCommands.LoadedCommands[A]=B;return B;};FCKCommands.GetFullPageState=function(){return FCKConfig.FullPage?FCK_TRISTATE_OFF:FCK_TRISTATE_DISABLED;};
var FCKPanel=function(A){this.IsRTL=(FCKLang.Dir=='rtl');this.IsContextMenu=false;this._LockCounter=0;this._Window=A||window;var B;if (FCKBrowserInfo.IsIE){this._Popup=this._Window.createPopup();B=this.Document=this._Popup.document;}else{var C=this._IFrame=this._Window.document.createElement('iframe');C.src='javascript:void(0)';C.allowTransparency=true;C.frameBorder='0';C.scrolling='no';C.style.position='absolute';C.style.zIndex=FCKConfig.FloatingPanelsZIndex;C.width=C.height=0;if (this._Window==window.parent&&window.frameElement) window.frameElement.parentNode.insertBefore(C,window.frameElement);else this._Window.document.body.appendChild(C);var D=C.contentWindow;B=this.Document=D.document;B.open();B.write('<html><head></head><body style="margin:0px;padding:0px;"><\/body><\/html>');B.close();FCKTools.AddEventListenerEx(D,'focus',FCKPanel_Window_OnFocus,this);FCKTools.AddEventListenerEx(D,'blur',FCKPanel_Window_OnBlur,this);};B.dir=FCKLang.Dir;B.oncontextmenu=FCKTools.CancelEvent;this.MainNode=B.body.appendChild(B.createElement('DIV'));this.MainNode.style.cssFloat=this.IsRTL?'right':'left';if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKPanel_Cleanup);};FCKPanel.prototype.AppendStyleSheet=function(A){FCKTools.AppendStyleSheet(this.Document,A);};FCKPanel.prototype.Preload=function(x,y,A){if (this._Popup) this._Popup.show(x,y,0,0,A);};FCKPanel.prototype.Show=function(x,y,A,B,C){if (this._Popup){this._Popup.show(x,y,0,0,A);this.MainNode.style.width=B?B+'px':'';this.MainNode.style.height=C?C+'px':'';var D=this.MainNode.offsetWidth;if (this.IsRTL){if (this.IsContextMenu) x=x-D+1;else if (A) x=(x*-1)+A.offsetWidth-D;};this._Popup.show(x,y,D,this.MainNode.offsetHeight,A);if (this.OnHide){if (this._Timer) CheckPopupOnHide.call(this,true);this._Timer=FCKTools.SetInterval(CheckPopupOnHide,100,this);}}else{if (typeof(FCKFocusManager)!='undefined') FCKFocusManager.Lock();if (this.ParentPanel) this.ParentPanel.Lock();this.MainNode.style.width=B?B+'px':'';this.MainNode.style.height=C?C+'px':'';var D=this.MainNode.offsetWidth;if (!B) this._IFrame.width=1;if (!C) this._IFrame.height=1;D=this.MainNode.offsetWidth;var F=FCKTools.GetElementPosition((A.nodeType==9?A.body:A),this._Window);if (this.IsRTL&&!this.IsContextMenu) x=(x*-1);x+=F.X;y+=F.Y;if (this.IsRTL){if (this.IsContextMenu) x=x-D+1;else if (A) x=x+A.offsetWidth-D;}else{var G=FCKTools.GetViewPaneSize(this._Window);var H=FCKTools.GetScrollPosition(this._Window);var I=G.Height+H.Y;var J=G.Width+H.X;if ((x+D)>J) x-=x+D-J;if ((y+this.MainNode.offsetHeight)>I) y-=y+this.MainNode.offsetHeight-I;};if (x<0) x=0;this._IFrame.style.left=x+'px';this._IFrame.style.top=y+'px';var K=D;var L=this.MainNode.offsetHeight;this._IFrame.width=K;this._IFrame.height=L;this._IFrame.contentWindow.focus();};this._IsOpened=true;FCKTools.RunFunction(this.OnShow,this);};FCKPanel.prototype.Hide=function(A){if (this._Popup) this._Popup.hide();else{if (!this._IsOpened) return;if (typeof(FCKFocusManager)!='undefined') FCKFocusManager.Unlock();this._IFrame.width=this._IFrame.height=0;this._IsOpened=false;if (this.ParentPanel) this.ParentPanel.Unlock();if (!A) FCKTools.RunFunction(this.OnHide,this);}};FCKPanel.prototype.CheckIsOpened=function(){if (this._Popup) return this._Popup.isOpen;else return this._IsOpened;};FCKPanel.prototype.CreateChildPanel=function(){var A=this._Popup?FCKTools.GetParentWindow(this.Document):this._Window;var B=new FCKPanel(A,true);B.ParentPanel=this;return B;};FCKPanel.prototype.Lock=function(){this._LockCounter++;};FCKPanel.prototype.Unlock=function(){if (--this._LockCounter==0&&!this.HasFocus) this.Hide();};/* Events */ function FCKPanel_Window_OnFocus(e,panel){panel.HasFocus=true;};function FCKPanel_Window_OnBlur(e,panel){panel.HasFocus=false;if (panel._LockCounter==0) FCKTools.RunFunction(panel.Hide,panel);};function CheckPopupOnHide(forceHide){if (forceHide||!this._Popup.isOpen){window.clearInterval(this._Timer);this._Timer=null;FCKTools.RunFunction(this.OnHide,this);}};function FCKPanel_Cleanup(){this._Popup=null;this._Window=null;this.Document=null;this.MainNode=null;}
var FCKIcon=function(A){var B=A?typeof(A):'undefined';switch (B){case 'number':this.Path=FCKConfig.SkinPath+'fck_strip.gif';this.Size=16;this.Position=A;break;case 'undefined':this.Path=FCK_SPACER_PATH;break;case 'string':this.Path=A;break;default:this.Path=A[0];this.Size=A[1];this.Position=A[2];}};FCKIcon.prototype.CreateIconElement=function(A){var B;if (this.Position){var C='-'+((this.Position-1)*this.Size)+'px';if (FCKBrowserInfo.IsIE){B=A.createElement('DIV');var D=B.appendChild(A.createElement('IMG'));D.src=this.Path;D.style.top=C;}else{B=A.createElement('IMG');B.src=FCK_SPACER_PATH;B.style.backgroundPosition='0px '+C;B.style.backgroundImage='url('+this.Path+')';}}else{B=A.createElement('DIV');var D=B.appendChild(A.createElement('IMG'));D.src=this.Path?this.Path:FCK_SPACER_PATH;};B.className='TB_Button_Image';return B;}
var FCKToolbarButtonUI=function(A,B,C,D,E,F){this.Name=A;this.Label=B||A;this.Tooltip=C||this.Label;this.Style=E||FCK_TOOLBARITEM_ONLYICON;this.State=F||FCK_TRISTATE_OFF;this.Icon=new FCKIcon(D);if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKToolbarButtonUI_Cleanup);};FCKToolbarButtonUI.prototype._CreatePaddingElement=function(A){var B=A.createElement('IMG');B.className='TB_Button_Padding';B.src=FCK_SPACER_PATH;return B;};FCKToolbarButtonUI.prototype.Create=function(A){var B=this.MainElement;if (B){FCKToolbarButtonUI_Cleanup.call(this);if (B.parentNode) B.parentNode.removeChild(B);B=this.MainElement=null;};var C=FCKTools.GetElementDocument(A);B=this.MainElement=C.createElement('DIV');B._FCKButton=this;B.title=this.Tooltip;if (FCKBrowserInfo.IsGecko) B.onmousedown=FCKTools.CancelEvent;this.ChangeState(this.State,true);if (this.Style==FCK_TOOLBARITEM_ONLYICON&&!this.ShowArrow){B.appendChild(this.Icon.CreateIconElement(C));}else{var D=B.appendChild(C.createElement('TABLE'));D.cellPadding=0;D.cellSpacing=0;var E=D.insertRow(-1);var F=E.insertCell(-1);if (this.Style==FCK_TOOLBARITEM_ONLYICON||this.Style==FCK_TOOLBARITEM_ICONTEXT) F.appendChild(this.Icon.CreateIconElement(C));else F.appendChild(this._CreatePaddingElement(C));if (this.Style==FCK_TOOLBARITEM_ONLYTEXT||this.Style==FCK_TOOLBARITEM_ICONTEXT){F=E.insertCell(-1);F.className='TB_Button_Text';F.noWrap=true;F.appendChild(C.createTextNode(this.Label));};if (this.ShowArrow){if (this.Style!=FCK_TOOLBARITEM_ONLYICON){E.insertCell(-1).appendChild(this._CreatePaddingElement(C));};F=E.insertCell(-1);var G=F.appendChild(C.createElement('IMG'));G.src=FCKConfig.SkinPath+'images/toolbar.buttonarrow.gif';G.width=5;G.height=3;};F=E.insertCell(-1);F.appendChild(this._CreatePaddingElement(C));};A.appendChild(B);};FCKToolbarButtonUI.prototype.ChangeState=function(A,B){if (!B&&this.State==A) return;var e=this.MainElement;switch (parseInt(A)){case FCK_TRISTATE_OFF:e.className='TB_Button_Off';e.onmouseover=FCKToolbarButton_OnMouseOverOff;e.onmouseout=FCKToolbarButton_OnMouseOutOff;e.onclick=FCKToolbarButton_OnClick;break;case FCK_TRISTATE_ON:e.className='TB_Button_On';e.onmouseover=FCKToolbarButton_OnMouseOverOn;e.onmouseout=FCKToolbarButton_OnMouseOutOn;e.onclick=FCKToolbarButton_OnClick;break;case FCK_TRISTATE_DISABLED:e.className='TB_Button_Disabled';e.onmouseover=null;e.onmouseout=null;e.onclick=null;bEnableEvents=false;break;};this.State=A;};function FCKToolbarButtonUI_Cleanup(){if (this.MainElement){this.MainElement._FCKButton=null;this.MainElement=null;}};function FCKToolbarButton_OnMouseOverOn(){this.className='TB_Button_On_Over';};function FCKToolbarButton_OnMouseOutOn(){this.className='TB_Button_On';};function FCKToolbarButton_OnMouseOverOff(){this.className='TB_Button_Off_Over';};function FCKToolbarButton_OnMouseOutOff(){this.className='TB_Button_Off';};function FCKToolbarButton_OnClick(e){if (this._FCKButton.OnClick) this._FCKButton.OnClick(this._FCKButton);};
var FCKToolbarButton=function(A,B,C,D,E,F,G){this.CommandName=A;this.Label=B;this.Tooltip=C;this.Style=D;this.SourceView=E?true:false;this.ContextSensitive=F?true:false;if (G==null) this.IconPath=FCKConfig.SkinPath+'toolbar/'+A.toLowerCase()+'.gif';else if (typeof(G)=='number') this.IconPath=[FCKConfig.SkinPath+'fck_strip.gif',16,G];};FCKToolbarButton.prototype.Create=function(A){this._UIButton=new FCKToolbarButtonUI(this.CommandName,this.Label,this.Tooltip,this.IconPath,this.Style);this._UIButton.OnClick=this.Click;this._UIButton._ToolbarButton=this;this._UIButton.Create(A);};FCKToolbarButton.prototype.RefreshState=function(){var A=FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName).GetState();if (A==this._UIButton.State) return;this._UIButton.ChangeState(A);};FCKToolbarButton.prototype.Click=function(){var A=this._ToolbarButton||this;FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(A.CommandName).Execute();};FCKToolbarButton.prototype.Enable=function(){this.RefreshState();};FCKToolbarButton.prototype.Disable=function(){this._UIButton.ChangeState(FCK_TRISTATE_DISABLED);}
var FCKSpecialCombo=function(A,B,C,D,E){this.FieldWidth=B||100;this.PanelWidth=C||150;this.PanelMaxHeight=D||150;this.Label='&nbsp;';this.Caption=A;this.Tooltip=A;this.Style=FCK_TOOLBARITEM_ICONTEXT;this.Enabled=true;this.Items=new Object();this._Panel=new FCKPanel(E||window,true);this._Panel.AppendStyleSheet(FCKConfig.SkinPath+'fck_editor.css');this._PanelBox=this._Panel.MainNode.appendChild(this._Panel.Document.createElement('DIV'));this._PanelBox.className='SC_Panel';this._PanelBox.style.width=this.PanelWidth+'px';this._PanelBox.innerHTML='<table cellpadding="0" cellspacing="0" width="100%" style="TABLE-LAYOUT: fixed"><tr><td nowrap></td></tr></table>';this._ItemsHolderEl=this._PanelBox.getElementsByTagName('TD')[0];if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKSpecialCombo_Cleanup);};function FCKSpecialCombo_ItemOnMouseOver(){this.className+=' SC_ItemOver';};function FCKSpecialCombo_ItemOnMouseOut(){this.className=this.originalClass;};function FCKSpecialCombo_ItemOnClick(){this.className=this.originalClass;this.FCKSpecialCombo._Panel.Hide();this.FCKSpecialCombo.SetLabel(this.FCKItemLabel);if (typeof(this.FCKSpecialCombo.OnSelect)=='function') this.FCKSpecialCombo.OnSelect(this.FCKItemID,this);};FCKSpecialCombo.prototype.AddItem=function(A,B,C,D){var E=this._ItemsHolderEl.appendChild(this._Panel.Document.createElement('DIV'));E.className=E.originalClass='SC_Item';E.innerHTML=B;E.FCKItemID=A;E.FCKItemLabel=C||A;E.FCKSpecialCombo=this;E.Selected=false;if (FCKBrowserInfo.IsIE) E.style.width='100%';if (D) E.style.backgroundColor=D;E.onmouseover=FCKSpecialCombo_ItemOnMouseOver;E.onmouseout=FCKSpecialCombo_ItemOnMouseOut;E.onclick=FCKSpecialCombo_ItemOnClick;this.Items[A.toString().toLowerCase()]=E;return E;};FCKSpecialCombo.prototype.SelectItem=function(A){A=A?A.toString().toLowerCase():'';var B=this.Items[A];if (B){B.className=B.originalClass='SC_ItemSelected';B.Selected=true;}};FCKSpecialCombo.prototype.SelectItemByLabel=function(A,B){for (var C in this.Items){var D=this.Items[C];if (D.FCKItemLabel==A){D.className=D.originalClass='SC_ItemSelected';D.Selected=true;if (B) this.SetLabel(A);}}};FCKSpecialCombo.prototype.DeselectAll=function(A){for (var i in this.Items){this.Items[i].className=this.Items[i].originalClass='SC_Item';this.Items[i].Selected=false;};if (A) this.SetLabel('');};FCKSpecialCombo.prototype.SetLabelById=function(A){A=A?A.toString().toLowerCase():'';var B=this.Items[A];this.SetLabel(B?B.FCKItemLabel:'');};FCKSpecialCombo.prototype.SetLabel=function(A){this.Label=A.length==0?'&nbsp;':A;if (this._LabelEl) this._LabelEl.innerHTML=this.Label;};FCKSpecialCombo.prototype.SetEnabled=function(A){this.Enabled=A;this._OuterTable.className=A?'':'SC_FieldDisabled';};FCKSpecialCombo.prototype.Create=function(A){var B=FCKTools.GetElementDocument(A);var C=this._OuterTable=A.appendChild(B.createElement('TABLE'));C.cellPadding=0;C.cellSpacing=0;C.insertRow(-1);var D;var E;switch (this.Style){case FCK_TOOLBARITEM_ONLYICON:D='TB_ButtonType_Icon';E=false;break;case FCK_TOOLBARITEM_ONLYTEXT:D='TB_ButtonType_Text';E=false;break;case FCK_TOOLBARITEM_ICONTEXT:E=true;break;};if (this.Caption&&this.Caption.length>0&&E){var F=C.rows[0].insertCell(-1);F.innerHTML=this.Caption;F.className='SC_FieldCaption';};var G=FCKTools.AppendElement(C.rows[0].insertCell(-1),'div');if (E){G.className='SC_Field';G.style.width=this.FieldWidth+'px';G.innerHTML='<table width="100%" cellpadding="0" cellspacing="0" style="TABLE-LAYOUT: fixed;"><tbody><tr><td class="SC_FieldLabel"><label>&nbsp;</label></td><td class="SC_FieldButton">&nbsp;</td></tr></tbody></table>';this._LabelEl=G.getElementsByTagName('label')[0];this._LabelEl.innerHTML=this.Label;}else{G.className='TB_Button_Off';G.innerHTML='<table title="'+this.Tooltip+'" class="'+D+'" cellspacing="0" cellpadding="0" border="0">'+'<tr>'+'<td><img class="TB_Button_Padding" src="'+FCK_SPACER_PATH+'" /></td>'+'<td class="TB_Text">'+this.Caption+'</td>'+'<td><img class="TB_Button_Padding" src="'+FCK_SPACER_PATH+'" /></td>'+'<td class="TB_ButtonArrow"><img src="'+FCKConfig.SkinPath+'images/toolbar.buttonarrow.gif" width="5" height="3"></td>'+'<td><img class="TB_Button_Padding" src="'+FCK_SPACER_PATH+'" /></td>'+'</tr>'+'</table>';};G.SpecialCombo=this;G.onmouseover=FCKSpecialCombo_OnMouseOver;G.onmouseout=FCKSpecialCombo_OnMouseOut;G.onclick=FCKSpecialCombo_OnClick;FCKTools.DisableSelection(this._Panel.Document.body);};function FCKSpecialCombo_Cleanup(){this._LabelEl=null;this._OuterTable=null;this._ItemsHolderEl=null;this._PanelBox=null;if (this.Items){for (var key in this.Items) this.Items[key]=null;}};function FCKSpecialCombo_OnMouseOver(){if (this.SpecialCombo.Enabled){switch (this.SpecialCombo.Style){case FCK_TOOLBARITEM_ONLYICON:this.className='TB_Button_On_Over';break;case FCK_TOOLBARITEM_ONLYTEXT:this.className='TB_Button_On_Over';break;case FCK_TOOLBARITEM_ICONTEXT:this.className='SC_Field SC_FieldOver';break;}}};function FCKSpecialCombo_OnMouseOut(){switch (this.SpecialCombo.Style){case FCK_TOOLBARITEM_ONLYICON:this.className='TB_Button_Off';break;case FCK_TOOLBARITEM_ONLYTEXT:this.className='TB_Button_Off';break;case FCK_TOOLBARITEM_ICONTEXT:this.className='SC_Field';break;}};function FCKSpecialCombo_OnClick(e){var oSpecialCombo=this.SpecialCombo;if (oSpecialCombo.Enabled){var oPanel=oSpecialCombo._Panel;var oPanelBox=oSpecialCombo._PanelBox;var oItemsHolder=oSpecialCombo._ItemsHolderEl;var iMaxHeight=oSpecialCombo.PanelMaxHeight;if (oSpecialCombo.OnBeforeClick) oSpecialCombo.OnBeforeClick(oSpecialCombo);if (FCKBrowserInfo.IsIE) oPanel.Preload(0,this.offsetHeight,this);if (oItemsHolder.offsetHeight>iMaxHeight) oPanelBox.style.height=iMaxHeight+'px';else oPanelBox.style.height='';oPanel.Show(0,this.offsetHeight,this);}};
var FCKToolbarSpecialCombo=function(){this.SourceView=false;this.ContextSensitive=true;};function FCKToolbarSpecialCombo_OnSelect(itemId,item){FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName).Execute(itemId,item);};FCKToolbarSpecialCombo.prototype.Create=function(A){this._Combo=new FCKSpecialCombo(this.GetLabel(),this.FieldWidth,this.PanelWidth,this.PanelMaxHeight,FCKBrowserInfo.IsIE?window:FCKTools.GetElementWindow(A).parent);this._Combo.Tooltip=this.Tooltip;this._Combo.Style=this.Style;this.CreateItems(this._Combo);this._Combo.Create(A);this._Combo.CommandName=this.CommandName;this._Combo.OnSelect=FCKToolbarSpecialCombo_OnSelect;};function FCKToolbarSpecialCombo_RefreshActiveItems(combo,value){combo.DeselectAll();combo.SelectItem(value);combo.SetLabelById(value);};FCKToolbarSpecialCombo.prototype.RefreshState=function(){var A;var B=FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName).GetState();if (B!=FCK_TRISTATE_DISABLED){A=FCK_TRISTATE_ON;if (this.RefreshActiveItems) this.RefreshActiveItems(this._Combo,B);else{if (this._LastValue!=B){this._LastValue=B;FCKToolbarSpecialCombo_RefreshActiveItems(this._Combo,B);}}}else A=FCK_TRISTATE_DISABLED;if (A==this.State) return;if (A==FCK_TRISTATE_DISABLED){this._Combo.DeselectAll();this._Combo.SetLabel('');};this.State=A;this._Combo.SetEnabled(A!=FCK_TRISTATE_DISABLED);};FCKToolbarSpecialCombo.prototype.Enable=function(){this.RefreshState();};FCKToolbarSpecialCombo.prototype.Disable=function(){this.State=FCK_TRISTATE_DISABLED;this._Combo.DeselectAll();this._Combo.SetLabel('');this._Combo.SetEnabled(false);}
var FCKToolbarFontsCombo=function(A,B){this.CommandName='FontName';this.Label=this.GetLabel();this.Tooltip=A?A:this.Label;this.Style=B?B:FCK_TOOLBARITEM_ICONTEXT;};FCKToolbarFontsCombo.prototype=new FCKToolbarSpecialCombo;FCKToolbarFontsCombo.prototype.GetLabel=function(){return FCKLang.Font;};FCKToolbarFontsCombo.prototype.CreateItems=function(A){var B=FCKConfig.FontNames.split(';');for (var i=0;i<B.length;i++) this._Combo.AddItem(B[i],'<font face="'+B[i]+'" style="font-size: 12px">'+B[i]+'</font>');}
var FCKToolbarFontSizeCombo=function(A,B){this.CommandName='FontSize';this.Label=this.GetLabel();this.Tooltip=A?A:this.Label;this.Style=B?B:FCK_TOOLBARITEM_ICONTEXT;};FCKToolbarFontSizeCombo.prototype=new FCKToolbarSpecialCombo;FCKToolbarFontSizeCombo.prototype.GetLabel=function(){return FCKLang.FontSize;};FCKToolbarFontSizeCombo.prototype.CreateItems=function(A){A.FieldWidth=70;var B=FCKConfig.FontSizes.split(';');for (var i=0;i<B.length;i++){var C=B[i].split('/');this._Combo.AddItem(C[0],'<font size="'+C[0]+'">'+C[1]+'</font>',C[1]);}}
var FCKToolbarFontFormatCombo=function(A,B){this.CommandName='FontFormat';this.Label=this.GetLabel();this.Tooltip=A?A:this.Label;this.Style=B?B:FCK_TOOLBARITEM_ICONTEXT;this.NormalLabel='Normal';this.PanelWidth=190;};FCKToolbarFontFormatCombo.prototype=new FCKToolbarSpecialCombo;FCKToolbarFontFormatCombo.prototype.GetLabel=function(){return FCKLang.FontFormat;};FCKToolbarFontFormatCombo.prototype.CreateItems=function(A){FCKTools.AppendStyleSheet(A._Panel.Document,FCKConfig.ToolbarComboPreviewCSS);var B=FCKLang['FontFormats'].split(';');var C={p:B[0],pre:B[1],address:B[2],h1:B[3],h2:B[4],h3:B[5],h4:B[6],h5:B[7],h6:B[8],div:B[9]};var D=FCKConfig.FontFormats.split(';');for (var i=0;i<D.length;i++){var E=D[i];var F=C[E];if (E=='p') this.NormalLabel=F;this._Combo.AddItem(E,'<div class="BaseFont"><'+E+'>'+F+'</'+E+'></div>',F);}};if (FCKBrowserInfo.IsIE){FCKToolbarFontFormatCombo.prototype.RefreshActiveItems=function(A,B){if (B==this.NormalLabel){if (A.Label!='&nbsp;') A.DeselectAll(true);}else{if (this._LastValue==B) return;A.SelectItemByLabel(B,true);};this._LastValue=B;}}
var FCKToolbarStyleCombo=function(A,B){this.CommandName='Style';this.Label=this.GetLabel();this.Tooltip=A?A:this.Label;this.Style=B?B:FCK_TOOLBARITEM_ICONTEXT;};FCKToolbarStyleCombo.prototype=new FCKToolbarSpecialCombo;FCKToolbarStyleCombo.prototype.GetLabel=function(){return FCKLang.Style;};FCKToolbarStyleCombo.prototype.CreateItems=function(A){var B=A._Panel.Document;FCKTools.AppendStyleSheet(B,FCKConfig.ToolbarComboPreviewCSS);B.body.className+=' ForceBaseFont';if (!FCKBrowserInfo.IsGecko) A.OnBeforeClick=this.RefreshVisibleItems;var C=FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName).Styles;for (var s in C){var D=C[s];var E;if (D.IsObjectElement) E=A.AddItem(s,s);else E=A.AddItem(s,D.GetOpenerTag()+s+D.GetCloserTag());E.Style=D;}};FCKToolbarStyleCombo.prototype.RefreshActiveItems=function(A){A.DeselectAll();var B=FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName).GetActiveStyles();if (B.length>0){for (var i=0;i<B.length;i++) A.SelectItem(B[i].Name);A.SetLabelById(B[0].Name);}else A.SetLabel('');};FCKToolbarStyleCombo.prototype.RefreshVisibleItems=function(A){if (FCKSelection.GetType()=='Control') var B=FCKSelection.GetSelectedElement().tagName;for (var i in A.Items){var C=A.Items[i];if ((B&&C.Style.Element==B)||(!B&&!C.Style.IsObjectElement)) C.style.display='';else C.style.display='none';}}
var FCKToolbarPanelButton=function(A,B,C,D,E){this.CommandName=A;var F;if (E==null) F=FCKConfig.SkinPath+'toolbar/'+A.toLowerCase()+'.gif';else if (typeof(E)=='number') F=[FCKConfig.SkinPath+'fck_strip.gif',16,E];var G=this._UIButton=new FCKToolbarButtonUI(A,B,C,F,D);G._FCKToolbarPanelButton=this;G.ShowArrow=true;G.OnClick=FCKToolbarPanelButton_OnButtonClick;};FCKToolbarPanelButton.prototype.TypeName='FCKToolbarPanelButton';FCKToolbarPanelButton.prototype.Create=function(A){A.className+='Menu';this._UIButton.Create(A);var B=FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName)._Panel;B._FCKToolbarPanelButton=this;var C=B.Document.body.appendChild(B.Document.createElement('div'));C.style.position='absolute';C.style.top='0px';var D=this.LineImg=C.appendChild(B.Document.createElement('IMG'));D.className='TB_ConnectionLine';D.src=FCK_SPACER_PATH;B.OnHide=FCKToolbarPanelButton_OnPanelHide;};function FCKToolbarPanelButton_OnButtonClick(toolbarButton){var oButton=this._FCKToolbarPanelButton;var e=oButton._UIButton.MainElement;oButton._UIButton.ChangeState(FCK_TRISTATE_ON);oButton.LineImg.style.width=(e.offsetWidth-2)+'px';FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(oButton.CommandName).Execute(0,e.offsetHeight-1,e);};function FCKToolbarPanelButton_OnPanelHide(){var oMenuButton=this._FCKToolbarPanelButton;oMenuButton._UIButton.ChangeState(FCK_TRISTATE_OFF);};FCKToolbarPanelButton.prototype.RefreshState=FCKToolbarButton.prototype.RefreshState;FCKToolbarPanelButton.prototype.Enable=FCKToolbarButton.prototype.Enable;FCKToolbarPanelButton.prototype.Disable=FCKToolbarButton.prototype.Disable;
var FCKToolbarItems=new Object();FCKToolbarItems.LoadedItems=new Object();FCKToolbarItems.RegisterItem=function(A,B){this.LoadedItems[A]=B;};FCKToolbarItems.GetItem=function(A){var B=FCKToolbarItems.LoadedItems[A];if (B) return B;switch (A){case 'Source':B=new FCKToolbarButton('Source',FCKLang.Source,null,FCK_TOOLBARITEM_ICONTEXT,true,true,1);break;case 'DocProps':B=new FCKToolbarButton('DocProps',FCKLang.DocProps,null,null,null,null,2);break;case 'Save':B=new FCKToolbarButton('Save',FCKLang.Save,null,null,true,null,3);break;case 'NewPage':B=new FCKToolbarButton('NewPage',FCKLang.NewPage,null,null,true,null,4);break;case 'Preview':B=new FCKToolbarButton('Preview',FCKLang.Preview,null,null,true,null,5);break;case 'Templates':B=new FCKToolbarButton('Templates',FCKLang.Templates,null,null,null,null,6);break;case 'About':B=new FCKToolbarButton('About',FCKLang.About,null,null,true,null,47);break;case 'Cut':B=new FCKToolbarButton('Cut',FCKLang.Cut,null,null,false,true,7);break;case 'Copy':B=new FCKToolbarButton('Copy',FCKLang.Copy,null,null,false,true,8);break;case 'Paste':B=new FCKToolbarButton('Paste',FCKLang.Paste,null,null,false,true,9);break;case 'PasteText':B=new FCKToolbarButton('PasteText',FCKLang.PasteText,null,null,false,true,10);break;case 'PasteWord':B=new FCKToolbarButton('PasteWord',FCKLang.PasteWord,null,null,false,true,11);break;case 'Print':B=new FCKToolbarButton('Print',FCKLang.Print,null,null,false,true,12);break;case 'SpellCheck':B=new FCKToolbarButton('SpellCheck',FCKLang.SpellCheck,null,null,null,null,13);break;case 'Undo':B=new FCKToolbarButton('Undo',FCKLang.Undo,null,null,false,true,14);break;case 'Redo':B=new FCKToolbarButton('Redo',FCKLang.Redo,null,null,false,true,15);break;case 'SelectAll':B=new FCKToolbarButton('SelectAll',FCKLang.SelectAll,null,null,null,null,18);break;case 'RemoveFormat':B=new FCKToolbarButton('RemoveFormat',FCKLang.RemoveFormat,null,null,false,true,19);break;case 'FitWindow':B=new FCKToolbarButton('FitWindow',FCKLang.FitWindow,null,null,true,true,66);break;case 'Bold':B=new FCKToolbarButton('Bold',FCKLang.Bold,null,null,false,true,20);break;case 'Italic':B=new FCKToolbarButton('Italic',FCKLang.Italic,null,null,false,true,21);break;case 'Underline':B=new FCKToolbarButton('Underline',FCKLang.Underline,null,null,false,true,22);break;case 'StrikeThrough':B=new FCKToolbarButton('StrikeThrough',FCKLang.StrikeThrough,null,null,false,true,23);break;case 'Subscript':B=new FCKToolbarButton('Subscript',FCKLang.Subscript,null,null,false,true,24);break;case 'Superscript':B=new FCKToolbarButton('Superscript',FCKLang.Superscript,null,null,false,true,25);break;case 'OrderedList':B=new FCKToolbarButton('InsertOrderedList',FCKLang.NumberedListLbl,FCKLang.NumberedList,null,false,true,26);break;case 'UnorderedList':B=new FCKToolbarButton('InsertUnorderedList',FCKLang.BulletedListLbl,FCKLang.BulletedList,null,false,true,27);break;case 'Outdent':B=new FCKToolbarButton('Outdent',FCKLang.DecreaseIndent,null,null,false,true,28);break;case 'Indent':B=new FCKToolbarButton('Indent',FCKLang.IncreaseIndent,null,null,false,true,29);break;case 'Link':B=new FCKToolbarButton('Link',FCKLang.InsertLinkLbl,FCKLang.InsertLink,null,false,true,34);break;case 'Unlink':B=new FCKToolbarButton('Unlink',FCKLang.RemoveLink,null,null,false,true,35);break;case 'Anchor':B=new FCKToolbarButton('Anchor',FCKLang.Anchor,null,null,null,null,36);break;case 'Image':B=new FCKToolbarButton('Image',FCKLang.InsertImageLbl,FCKLang.InsertImage,null,false,true,37);break;case 'Flash':B=new FCKToolbarButton('Flash',FCKLang.InsertFlashLbl,FCKLang.InsertFlash,null,false,true,38);break;case 'Table':B=new FCKToolbarButton('Table',FCKLang.InsertTableLbl,FCKLang.InsertTable,null,false,true,39);break;case 'SpecialChar':B=new FCKToolbarButton('SpecialChar',FCKLang.InsertSpecialCharLbl,FCKLang.InsertSpecialChar,null,false,true,42);break;case 'Smiley':B=new FCKToolbarButton('Smiley',FCKLang.InsertSmileyLbl,FCKLang.InsertSmiley,null,false,true,41);break;case 'PageBreak':B=new FCKToolbarButton('PageBreak',FCKLang.PageBreakLbl,FCKLang.PageBreak,null,false,true,43);break;case 'UniversalKey':B=new FCKToolbarButton('UniversalKey',FCKLang.UniversalKeyboard,null,null,false,true,44);break;case 'Rule':B=new FCKToolbarButton('InsertHorizontalRule',FCKLang.InsertLineLbl,FCKLang.InsertLine,null,false,true,40);break;case 'JustifyLeft':B=new FCKToolbarButton('JustifyLeft',FCKLang.LeftJustify,null,null,false,true,30);break;case 'JustifyCenter':B=new FCKToolbarButton('JustifyCenter',FCKLang.CenterJustify,null,null,false,true,31);break;case 'JustifyRight':B=new FCKToolbarButton('JustifyRight',FCKLang.RightJustify,null,null,false,true,32);break;case 'JustifyFull':B=new FCKToolbarButton('JustifyFull',FCKLang.BlockJustify,null,null,false,true,33);break;case 'Style':B=new FCKToolbarStyleCombo();break;case 'FontName':B=new FCKToolbarFontsCombo();break;case 'FontSize':B=new FCKToolbarFontSizeCombo();break;case 'FontFormat':B=new FCKToolbarFontFormatCombo();break;case 'TextColor':B=new FCKToolbarPanelButton('TextColor',FCKLang.TextColor,null,null,45);break;case 'BGColor':B=new FCKToolbarPanelButton('BGColor',FCKLang.BGColor,null,null,46);break;case 'Find':B=new FCKToolbarButton('Find',FCKLang.Find,null,null,null,null,16);break;case 'Replace':B=new FCKToolbarButton('Replace',FCKLang.Replace,null,null,null,null,17);break;case 'Form':B=new FCKToolbarButton('Form',FCKLang.Form,null,null,null,null,48);break;case 'Checkbox':B=new FCKToolbarButton('Checkbox',FCKLang.Checkbox,null,null,null,null,49);break;case 'Radio':B=new FCKToolbarButton('Radio',FCKLang.RadioButton,null,null,null,null,50);break;case 'TextField':B=new FCKToolbarButton('TextField',FCKLang.TextField,null,null,null,null,51);break;case 'Textarea':B=new FCKToolbarButton('Textarea',FCKLang.Textarea,null,null,null,null,52);break;case 'HiddenField':B=new FCKToolbarButton('HiddenField',FCKLang.HiddenField,null,null,null,null,56);break;case 'Button':B=new FCKToolbarButton('Button',FCKLang.Button,null,null,null,null,54);break;case 'Select':B=new FCKToolbarButton('Select',FCKLang.SelectionField,null,null,null,null,53);break;case 'ImageButton':B=new FCKToolbarButton('ImageButton',FCKLang.ImageButton,null,null,null,null,55);break;default:alert(FCKLang.UnknownToolbarItem.replace(/%1/g,A));return null;};FCKToolbarItems.LoadedItems[A]=B;return B;}
var FCKToolbar=function(){this.Items=new Array();if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKToolbar_Cleanup);};FCKToolbar.prototype.AddItem=function(A){return this.Items[this.Items.length]=A;};FCKToolbar.prototype.AddButton=function(A,B,C,D,E,F){if (typeof(D)=='number') D=[this.DefaultIconsStrip,this.DefaultIconSize,D];var G=new FCKToolbarButtonUI(A,B,C,D,E,F);G._FCKToolbar=this;G.OnClick=FCKToolbar_OnItemClick;return this.AddItem(G);};function FCKToolbar_OnItemClick(item){var oToolbar=item._FCKToolbar;if (oToolbar.OnItemClick) oToolbar.OnItemClick(oToolbar,item);};FCKToolbar.prototype.AddSeparator=function(){this.AddItem(new FCKToolbarSeparator());};FCKToolbar.prototype.Create=function(A){if (this.MainElement){if (this.MainElement.parentNode) this.MainElement.parentNode.removeChild(this.MainElement);this.MainElement=null;};var B=FCKTools.GetElementDocument(A);var e=this.MainElement=B.createElement('table');e.className='TB_Toolbar';e.style.styleFloat=e.style.cssFloat=(FCKLang.Dir=='ltr'?'left':'right');e.dir=FCKLang.Dir;e.cellPadding=0;e.cellSpacing=0;this.RowElement=e.insertRow(-1);var C;if (!this.HideStart){C=this.RowElement.insertCell(-1);C.appendChild(B.createElement('div')).className='TB_Start';};for (var i=0;i<this.Items.length;i++){this.Items[i].Create(this.RowElement.insertCell(-1));};if (!this.HideEnd){C=this.RowElement.insertCell(-1);C.appendChild(B.createElement('div')).className='TB_End';};A.appendChild(e);};function FCKToolbar_Cleanup(){this.MainElement=null;this.RowElement=null;};var FCKToolbarSeparator=function(){};FCKToolbarSeparator.prototype.Create=function(A){FCKTools.AppendElement(A,'div').className='TB_Separator';}
var FCKToolbarBreak=function(){};FCKToolbarBreak.prototype.Create=function(A){var B=FCKTools.GetElementDocument(A).createElement('div');B.className='TB_Break';B.style.clear=FCKLang.Dir=='rtl'?'left':'right';A.appendChild(B);}
function FCKToolbarSet_Create(overhideLocation){var oToolbarSet;var sLocation=overhideLocation||FCKConfig.ToolbarLocation;switch (sLocation){case 'In':document.getElementById('xToolbarRow').style.display='';oToolbarSet=new FCKToolbarSet(document);break;default:FCK.Events.AttachEvent('OnBlur',FCK_OnBlur);FCK.Events.AttachEvent('OnFocus',FCK_OnFocus);var eToolbarTarget;var oOutMatch=sLocation.match(/^Out:(.+)\((\w+)\)$/);if (oOutMatch){eToolbarTarget=eval('parent.'+oOutMatch[1]).document.getElementById(oOutMatch[2]);}else{oOutMatch=sLocation.match(/^Out:(\w+)$/);if (oOutMatch) eToolbarTarget=parent.document.getElementById(oOutMatch[1]);};if (!eToolbarTarget){alert('Invalid value for "ToolbarLocation"');return this._Init('In');};if (oToolbarSet=eToolbarTarget.__FCKToolbarSet) break;var eToolbarIFrame=FCKTools.GetElementDocument(eToolbarTarget).createElement('iframe');eToolbarIFrame.frameBorder=0;eToolbarIFrame.width='100%';eToolbarIFrame.height='10';eToolbarTarget.appendChild(eToolbarIFrame);eToolbarIFrame.unselectable='on';var eTargetDocument=eToolbarIFrame.contentWindow.document;eTargetDocument.open();eTargetDocument.write('<html><head><script type="text/javascript"> window.onload = window.onresize = function() { window.frameElement.height = document.body.scrollHeight ; } </script></head><body style="overflow: hidden">'+document.getElementById('xToolbarSpace').innerHTML+'</body></html>');eTargetDocument.close();eTargetDocument.oncontextmenu=FCKTools.CancelEvent;FCKTools.AppendStyleSheet(eTargetDocument,FCKConfig.SkinPath+'fck_editor.css');oToolbarSet=eToolbarTarget.__FCKToolbarSet=new FCKToolbarSet(eTargetDocument);oToolbarSet._IFrame=eToolbarIFrame;if (FCK.IECleanup) FCK.IECleanup.AddItem(eToolbarTarget,FCKToolbarSet_Target_Cleanup);};oToolbarSet.CurrentInstance=FCK;FCK.AttachToOnSelectionChange(oToolbarSet.RefreshItemsState);return oToolbarSet;};function FCK_OnBlur(editorInstance){var eToolbarSet=editorInstance.ToolbarSet;if (eToolbarSet.CurrentInstance==editorInstance) eToolbarSet.Disable();};function FCK_OnFocus(editorInstance){var oToolbarset=editorInstance.ToolbarSet;var oInstance=editorInstance||FCK;oToolbarset.CurrentInstance.FocusManager.RemoveWindow(oToolbarset._IFrame.contentWindow);oToolbarset.CurrentInstance=oInstance;oInstance.FocusManager.AddWindow(oToolbarset._IFrame.contentWindow,true);oToolbarset.Enable();};function FCKToolbarSet_Cleanup(){this._TargetElement=null;this._IFrame=null;};function FCKToolbarSet_Target_Cleanup(){this.__FCKToolbarSet=null;};var FCKToolbarSet=function(A){this._Document=A;this._TargetElement=A.getElementById('xToolbar');var B=A.getElementById('xExpandHandle');var C=A.getElementById('xCollapseHandle');B.title=FCKLang.ToolbarExpand;B.onclick=FCKToolbarSet_Expand_OnClick;C.title=FCKLang.ToolbarCollapse;C.onclick=FCKToolbarSet_Collapse_OnClick;if (!FCKConfig.ToolbarCanCollapse||FCKConfig.ToolbarStartExpanded) this.Expand();else this.Collapse();C.style.display=FCKConfig.ToolbarCanCollapse?'':'none';if (FCKConfig.ToolbarCanCollapse) C.style.display='';else A.getElementById('xTBLeftBorder').style.display='';this.Toolbars=new Array();this.IsLoaded=false;if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKToolbarSet_Cleanup);};function FCKToolbarSet_Expand_OnClick(){FCK.ToolbarSet.Expand();};function FCKToolbarSet_Collapse_OnClick(){FCK.ToolbarSet.Collapse();};FCKToolbarSet.prototype.Expand=function(){this._ChangeVisibility(false);};FCKToolbarSet.prototype.Collapse=function(){this._ChangeVisibility(true);};FCKToolbarSet.prototype._ChangeVisibility=function(A){this._Document.getElementById('xCollapsed').style.display=A?'':'none';this._Document.getElementById('xExpanded').style.display=A?'none':'';if (FCKBrowserInfo.IsGecko){FCKTools.RunFunction(window.onresize);}};FCKToolbarSet.prototype.Load=function(A){this.Name=A;this.Items=new Array();this.ItemsWysiwygOnly=new Array();this.ItemsContextSensitive=new Array();this._TargetElement.innerHTML='';var B=FCKConfig.ToolbarSets[A];if (!B){alert(FCKLang.UnknownToolbarSet.replace(/%1/g,A));return;};this.Toolbars=new Array();for (var x=0;x<B.length;x++){var C=B[x];var D;if (typeof(C)=='string'){if (C=='/') D=new FCKToolbarBreak();}else{D=new FCKToolbar();for (var j=0;j<C.length;j++){var E=C[j];if (E=='-') D.AddSeparator();else{var F=FCKToolbarItems.GetItem(E);if (F){D.AddItem(F);this.Items.push(F);if (!F.SourceView) this.ItemsWysiwygOnly.push(F);if (F.ContextSensitive) this.ItemsContextSensitive.push(F);}}}};D.Create(this._TargetElement);this.Toolbars[this.Toolbars.length]=D;};FCKTools.DisableSelection(this._Document.getElementById('xCollapseHandle').parentNode);if (FCK.Status!=FCK_STATUS_COMPLETE) FCK.Events.AttachEvent('OnStatusChange',this.RefreshModeState);else this.RefreshModeState();this.IsLoaded=true;this.IsEnabled=true;FCKTools.RunFunction(this.OnLoad);};FCKToolbarSet.prototype.Enable=function(){if (this.IsEnabled) return;this.IsEnabled=true;var A=this.Items;for (var i=0;i<A.length;i++) A[i].RefreshState();};FCKToolbarSet.prototype.Disable=function(){if (!this.IsEnabled) return;this.IsEnabled=false;var A=this.Items;for (var i=0;i<A.length;i++) A[i].Disable();};FCKToolbarSet.prototype.RefreshModeState=function(A){if (FCK.Status!=FCK_STATUS_COMPLETE) return;var B=A?A.ToolbarSet:this;var C=B.ItemsWysiwygOnly;if (FCK.EditMode==FCK_EDITMODE_WYSIWYG){for (var i=0;i<C.length;i++) C[i].Enable();B.RefreshItemsState(A);}else{B.RefreshItemsState(A);for (var i=0;i<C.length;i++) C[i].Disable();}};FCKToolbarSet.prototype.RefreshItemsState=function(A){var B=(A?A.ToolbarSet:this).ItemsContextSensitive;for (var i=0;i<B.length;i++) B[i].RefreshState();};
var FCKDialog=new Object();FCKDialog.OpenDialog=function(A,B,C,D,E,F,G,H){var I=new Object();I.Title=B;I.Page=C;I.Editor=window;I.CustomValue=F;var J=FCKConfig.BasePath+'fckdialog.html';this.Show(I,A,J,D,E,G,H);};
FCKDialog.Show=function(A,B,C,D,E,F){if (!F) F=window;FCKFocusManager.Lock();var G;try{G=F.showModalDialog(C,A,"dialogWidth:"+D+"px;dialogHeight:"+E+"px;help:no;scroll:no;status:no");}catch(e){};if (!G) alert(FCKLang.DialogBlocked);FCKFocusManager.Unlock();};
var FCKMenuItem=function(A,B,C,D,E){this.Name=B;this.Label=C||B;this.IsDisabled=E;this.Icon=new FCKIcon(D);this.SubMenu=new FCKMenuBlockPanel();this.SubMenu.Parent=A;this.SubMenu.OnClick=FCKTools.CreateEventListener(FCKMenuItem_SubMenu_OnClick,this);if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKMenuItem_Cleanup);};FCKMenuItem.prototype.AddItem=function(A,B,C,D){this.HasSubMenu=true;return this.SubMenu.AddItem(A,B,C,D);};FCKMenuItem.prototype.AddSeparator=function(){this.SubMenu.AddSeparator();};FCKMenuItem.prototype.Create=function(A){var B=this.HasSubMenu;var C=FCKTools.GetElementDocument(A);var r=this.MainElement=A.insertRow(-1);r.className=this.IsDisabled?'MN_Item_Disabled':'MN_Item';if (!this.IsDisabled){FCKTools.AddEventListenerEx(r,'mouseover',FCKMenuItem_OnMouseOver,[this]);FCKTools.AddEventListenerEx(r,'click',FCKMenuItem_OnClick,[this]);if (!B) FCKTools.AddEventListenerEx(r,'mouseout',FCKMenuItem_OnMouseOut,[this]);};var D=r.insertCell(-1);D.className='MN_Icon';D.appendChild(this.Icon.CreateIconElement(C));D=r.insertCell(-1);D.className='MN_Label';D.noWrap=true;D.appendChild(C.createTextNode(this.Label));D=r.insertCell(-1);if (B){D.className='MN_Arrow';var E=D.appendChild(C.createElement('IMG'));E.src=FCK_IMAGES_PATH+'arrow_'+FCKLang.Dir+'.gif';E.width=4;E.height=7;this.SubMenu.Create();this.SubMenu.Panel.OnHide=FCKTools.CreateEventListener(FCKMenuItem_SubMenu_OnHide,this);}};FCKMenuItem.prototype.Activate=function(){this.MainElement.className='MN_Item_Over';if (this.HasSubMenu){this.SubMenu.Show(this.MainElement.offsetWidth+2,-2,this.MainElement);};FCKTools.RunFunction(this.OnActivate,this);};FCKMenuItem.prototype.Deactivate=function(){this.MainElement.className='MN_Item';if (this.HasSubMenu) this.SubMenu.Hide();};/* Events */ function FCKMenuItem_SubMenu_OnClick(clickedItem,listeningItem){FCKTools.RunFunction(listeningItem.OnClick,listeningItem,[clickedItem]);};function FCKMenuItem_SubMenu_OnHide(menuItem){menuItem.Deactivate();};function FCKMenuItem_OnClick(ev,menuItem){if (menuItem.HasSubMenu) menuItem.Activate();else{menuItem.Deactivate();FCKTools.RunFunction(menuItem.OnClick,menuItem,[menuItem]);}};function FCKMenuItem_OnMouseOver(ev,menuItem){menuItem.Activate();};function FCKMenuItem_OnMouseOut(ev,menuItem){menuItem.Deactivate();};function FCKMenuItem_Cleanup(){this.MainElement=null;}
var FCKMenuBlock=function(){this._Items=new Array();};FCKMenuBlock.prototype.Count=function(){return this._Items.length;};FCKMenuBlock.prototype.AddItem=function(A,B,C,D){var E=new FCKMenuItem(this,A,B,C,D);E.OnClick=FCKTools.CreateEventListener(FCKMenuBlock_Item_OnClick,this);E.OnActivate=FCKTools.CreateEventListener(FCKMenuBlock_Item_OnActivate,this);this._Items.push(E);return E;};FCKMenuBlock.prototype.AddSeparator=function(){this._Items.push(new FCKMenuSeparator());};FCKMenuBlock.prototype.RemoveAllItems=function(){this._Items=new Array();var A=this._ItemsTable;if (A){while (A.rows.length>0) A.deleteRow(0);}};FCKMenuBlock.prototype.Create=function(A){if (!this._ItemsTable){if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKMenuBlock_Cleanup);this._Window=FCKTools.GetElementWindow(A);var B=FCKTools.GetElementDocument(A);var C=A.appendChild(B.createElement('table'));C.cellPadding=0;C.cellSpacing=0;FCKTools.DisableSelection(C);var D=C.insertRow(-1).insertCell(-1);D.className='MN_Menu';var E=this._ItemsTable=D.appendChild(B.createElement('table'));E.cellPadding=0;E.cellSpacing=0;};for (var i=0;i<this._Items.length;i++) this._Items[i].Create(this._ItemsTable);};/* Events */ function FCKMenuBlock_Item_OnClick(clickedItem,menuBlock){FCKTools.RunFunction(menuBlock.OnClick,menuBlock,[clickedItem]);};function FCKMenuBlock_Item_OnActivate(menuBlock){var oActiveItem=menuBlock._ActiveItem;if (oActiveItem&&oActiveItem!=this){if (!FCKBrowserInfo.IsIE&&oActiveItem.HasSubMenu&&!this.HasSubMenu) menuBlock._Window.focus();oActiveItem.Deactivate();};menuBlock._ActiveItem=this;};function FCKMenuBlock_Cleanup(){this._Window=null;this._ItemsTable=null;};var FCKMenuSeparator=function(){};FCKMenuSeparator.prototype.Create=function(A){var B=FCKTools.GetElementDocument(A);var r=A.insertRow(-1);var C=r.insertCell(-1);C.className='MN_Separator MN_Icon';C=r.insertCell(-1);C.className='MN_Separator';C.appendChild(B.createElement('DIV')).className='MN_Separator_Line';C=r.insertCell(-1);C.className='MN_Separator';C.appendChild(B.createElement('DIV')).className='MN_Separator_Line';}
var FCKMenuBlockPanel=function(){FCKMenuBlock.call(this);};FCKMenuBlockPanel.prototype=new FCKMenuBlock();FCKMenuBlockPanel.prototype.Create=function(){var A=this.Panel=(this.Parent&&this.Parent.Panel?this.Parent.Panel.CreateChildPanel():new FCKPanel());A.AppendStyleSheet(FCKConfig.SkinPath+'fck_editor.css');FCKMenuBlock.prototype.Create.call(this,A.MainNode);};FCKMenuBlockPanel.prototype.Show=function(x,y,A){if (!this.Panel.CheckIsOpened()) this.Panel.Show(x,y,A);};FCKMenuBlockPanel.prototype.Hide=function(){if (this.Panel.CheckIsOpened()) this.Panel.Hide();}
var FCKContextMenu=function(A,B,C){var D=this._Panel=new FCKPanel(A,true);D.AppendStyleSheet(FCKConfig.SkinPath+'fck_editor.css');D.IsContextMenu=true;var E=this._MenuBlock=new FCKMenuBlock();E.Panel=D;E.OnClick=FCKTools.CreateEventListener(FCKContextMenu_MenuBlock_OnClick,this);this._Redraw=true;this.SetMouseClickWindow(B||A);};FCKContextMenu.prototype.SetMouseClickWindow=function(A){if (!FCKBrowserInfo.IsIE){this._Document=A.document;this._Document.addEventListener('contextmenu',FCKContextMenu_Document_OnContextMenu,false);}};FCKContextMenu.prototype.AddItem=function(A,B,C,D){var E=this._MenuBlock.AddItem(A,B,C,D);this._Redraw=true;return E;};FCKContextMenu.prototype.AddSeparator=function(){this._MenuBlock.AddSeparator();this._Redraw=true;};FCKContextMenu.prototype.RemoveAllItems=function(){this._MenuBlock.RemoveAllItems();this._Redraw=true;};FCKContextMenu.prototype.AttachToElement=function(A){if (FCKBrowserInfo.IsIE) FCKTools.AddEventListenerEx(A,'contextmenu',FCKContextMenu_AttachedElement_OnContextMenu,this);else A._FCKContextMenu=this;};function FCKContextMenu_Document_OnContextMenu(e){var el=e.target;while (el){if (el._FCKContextMenu){FCKTools.CancelEvent(e);FCKContextMenu_AttachedElement_OnContextMenu(e,el._FCKContextMenu,el);};el=el.parentNode;}};function FCKContextMenu_AttachedElement_OnContextMenu(ev,fckContextMenu,el){var eTarget=el||this;if (fckContextMenu.OnBeforeOpen) fckContextMenu.OnBeforeOpen.call(fckContextMenu,eTarget);if (fckContextMenu._MenuBlock.Count()==0) return false;if (fckContextMenu._Redraw){fckContextMenu._MenuBlock.Create(fckContextMenu._Panel.MainNode);fckContextMenu._Redraw=false;};fckContextMenu._Panel.Show(ev.pageX||ev.screenX,ev.pageY||ev.screenY,ev.currentTarget||null);return false;};function FCKContextMenu_MenuBlock_OnClick(menuItem,contextMenu){contextMenu._Panel.Hide();FCKTools.RunFunction(contextMenu.OnItemClick,contextMenu,menuItem);}
FCK.ContextMenu=new Object();FCK.ContextMenu.Listeners=new Array();FCK.ContextMenu.RegisterListener=function(A){if (A) this.Listeners.push(A);};function FCK_ContextMenu_Init(){var oInnerContextMenu=FCK.ContextMenu._InnerContextMenu=new FCKContextMenu(FCKBrowserInfo.IsIE?window:window.parent,FCK.EditorWindow,FCKLang.Dir);oInnerContextMenu.OnBeforeOpen=FCK_ContextMenu_OnBeforeOpen;oInnerContextMenu.OnItemClick=FCK_ContextMenu_OnItemClick;var oMenu=FCK.ContextMenu;for (var i=0;i<FCKConfig.ContextMenu.length;i++) oMenu.RegisterListener(FCK_ContextMenu_GetListener(FCKConfig.ContextMenu[i]));};function FCK_ContextMenu_GetListener(listenerName){switch (listenerName){case 'Generic':return {AddItems:function(A,B,C){A.AddItem('Cut',FCKLang.Cut,7,FCKCommands.GetCommand('Cut').GetState()==FCK_TRISTATE_DISABLED);A.AddItem('Copy',FCKLang.Copy,8,FCKCommands.GetCommand('Copy').GetState()==FCK_TRISTATE_DISABLED);A.AddItem('Paste',FCKLang.Paste,9,FCKCommands.GetCommand('Paste').GetState()==FCK_TRISTATE_DISABLED);}};case 'Table':return {AddItems:function(A,B,C){var D=(C=='TABLE');var E=(!D&&FCKSelection.HasAncestorNode('TABLE'));if (E){A.AddSeparator();var F=A.AddItem('Cell',FCKLang.CellCM);F.AddItem('TableInsertCell',FCKLang.InsertCell,58);F.AddItem('TableDeleteCells',FCKLang.DeleteCells,59);F.AddItem('TableMergeCells',FCKLang.MergeCells,60);F.AddItem('TableSplitCell',FCKLang.SplitCell,61);F.AddSeparator();F.AddItem('TableCellProp',FCKLang.CellProperties,57);A.AddSeparator();F=A.AddItem('Row',FCKLang.RowCM);F.AddItem('TableInsertRow',FCKLang.InsertRow,62);F.AddItem('TableDeleteRows',FCKLang.DeleteRows,63);A.AddSeparator();F=A.AddItem('Column',FCKLang.ColumnCM);F.AddItem('TableInsertColumn',FCKLang.InsertColumn,64);F.AddItem('TableDeleteColumns',FCKLang.DeleteColumns,65);};if (D||E){A.AddSeparator();A.AddItem('TableDelete',FCKLang.TableDelete);A.AddItem('TableProp',FCKLang.TableProperties,39);}}};case 'Link':return {AddItems:function(A,B,C){var D=(C=='A'||FCKSelection.HasAncestorNode('A'));if (D||FCK.GetNamedCommandState('Unlink')!=FCK_TRISTATE_DISABLED){A.AddSeparator();if (D) A.AddItem('Link',FCKLang.EditLink,34);A.AddItem('Unlink',FCKLang.RemoveLink,35);}}};case 'Image':return {AddItems:function(A,B,C){if (C=='IMG'&&!B.getAttribute('_fckfakelement')){A.AddSeparator();A.AddItem('Image',FCKLang.ImageProperties,37);}}};case 'Anchor':return {AddItems:function(A,B,C){if (C=='IMG'&&B.getAttribute('_fckanchor')){A.AddSeparator();A.AddItem('Anchor',FCKLang.AnchorProp,36);}}};case 'Flash':return {AddItems:function(A,B,C){if (C=='IMG'&&B.getAttribute('_fckflash')){A.AddSeparator();A.AddItem('Flash',FCKLang.FlashProperties,38);}}};case 'Form':return {AddItems:function(A,B,C){if (FCKSelection.HasAncestorNode('FORM')){A.AddSeparator();A.AddItem('Form',FCKLang.FormProp,48);}}};case 'Checkbox':return {AddItems:function(A,B,C){if (C=='INPUT'&&B.type=='checkbox'){A.AddSeparator();A.AddItem('Checkbox',FCKLang.CheckboxProp,49);}}};case 'Radio':return {AddItems:function(A,B,C){if (C=='INPUT'&&B.type=='radio'){A.AddSeparator();A.AddItem('Radio',FCKLang.RadioButtonProp,50);}}};case 'TextField':return {AddItems:function(A,B,C){if (C=='INPUT'&&(B.type=='text'||B.type=='password')){A.AddSeparator();A.AddItem('TextField',FCKLang.TextFieldProp,51);}}};case 'HiddenField':return {AddItems:function(A,B,C){if (C=='INPUT'&&B.type=='hidden'){A.AddSeparator();A.AddItem('HiddenField',FCKLang.HiddenFieldProp,56);}}};case 'ImageButton':return {AddItems:function(A,B,C){if (C=='INPUT'&&B.type=='image'){A.AddSeparator();A.AddItem('ImageButton',FCKLang.ImageButtonProp,55);}}};case 'Button':return {AddItems:function(A,B,C){if (C=='INPUT'&&(B.type=='button'||B.type=='submit'||B.type=='reset')){A.AddSeparator();A.AddItem('Button',FCKLang.ButtonProp,54);}}};case 'Select':return {AddItems:function(A,B,C){if (C=='SELECT'){A.AddSeparator();A.AddItem('Select',FCKLang.SelectionFieldProp,53);}}};case 'Textarea':return {AddItems:function(A,B,C){if (C=='TEXTAREA'){A.AddSeparator();A.AddItem('Textarea',FCKLang.TextareaProp,52);}}};case 'BulletedList':return {AddItems:function(A,B,C){if (FCKSelection.HasAncestorNode('UL')){A.AddSeparator();A.AddItem('BulletedList',FCKLang.BulletedListProp,27);}}};case 'NumberedList':return {AddItems:function(A,B,C){if (FCKSelection.HasAncestorNode('OL')){A.AddSeparator();A.AddItem('NumberedList',FCKLang.NumberedListProp,26);}}};}};function FCK_ContextMenu_OnBeforeOpen(){FCK.Events.FireEvent("OnSelectionChange");var oTag,sTagName;if (oTag=FCKSelection.GetSelectedElement()) sTagName=oTag.tagName;var oMenu=FCK.ContextMenu._InnerContextMenu;oMenu.RemoveAllItems();var aListeners=FCK.ContextMenu.Listeners;for (var i=0;i<aListeners.length;i++) aListeners[i].AddItems(oMenu,oTag,sTagName);};function FCK_ContextMenu_OnItemClick(item){FCK.Focus();FCKCommands.GetCommand(item.Name).Execute();}
var FCKPlugin=function(A,B,C){this.Name=A;this.BasePath=C?C:FCKConfig.PluginsPath;this.Path=this.BasePath+A+'/';if (!B||B.length==0) this.AvailableLangs=new Array();else this.AvailableLangs=B.split(',');};FCKPlugin.prototype.Load=function(){if (this.AvailableLangs.length>0){var A;if (this.AvailableLangs.indexOf(FCKLanguageManager.ActiveLanguage.Code)>=0) A=FCKLanguageManager.ActiveLanguage.Code;else A=this.AvailableLangs[0];LoadScript(this.Path+'lang/'+A+'.js');};LoadScript(this.Path+'fckplugin.js');}
var FCKPlugins=FCK.Plugins=new Object();FCKPlugins.ItemsCount=0;FCKPlugins.Items=new Object();FCKPlugins.Load=function(){var A=FCKPlugins.Items;for (var i=0;i<FCKConfig.Plugins.Items.length;i++){var B=FCKConfig.Plugins.Items[i];var C=A[B[0]]=new FCKPlugin(B[0],B[1],B[2]);FCKPlugins.ItemsCount++;};for (var s in A) A[s].Load();FCKPlugins.Load=null;}
/tags/Racine_livraison_narmer/api/fckeditor/editor/fckdebug.html
New file
0,0 → 1,111
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckdebug.html
* This is the Debug window.
* It automatically popups if the Debug = true in the configuration file.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>FCKeditor Debug Window</title>
<meta name="robots" content="noindex, nofollow" />
<script type="text/javascript">
 
var oWindow ;
var oDiv ;
 
if ( !window.FCKMessages )
window.FCKMessages = new Array() ;
 
window.onload = function()
{
oWindow = document.getElementById('xOutput').contentWindow ;
oWindow.document.open() ;
oWindow.document.write( '<div id="divMsg"><\/div>' ) ;
oWindow.document.close() ;
oDiv = oWindow.document.getElementById('divMsg') ;
}
 
function Output( message, color )
{
if ( color )
message = '<font color="' + color + '">' + message + '<\/font>' ;
window.FCKMessages[ window.FCKMessages.length ] = message ;
StartTimer() ;
}
 
function StartTimer()
{
window.setTimeout( 'CheckMessages()', 100 ) ;
}
 
function CheckMessages()
{
if ( window.FCKMessages.length > 0 )
{
// Get the first item in the queue
var sMessage = window.FCKMessages[0] ;
// Removes the first item from the queue
var oTempArray = new Array() ;
for ( i = 1 ; i < window.FCKMessages.length ; i++ )
oTempArray[ i - 1 ] = window.FCKMessages[ i ] ;
window.FCKMessages = oTempArray ;
var d = new Date() ;
var sTime =
( d.getHours() + 100 + '' ).substr( 1,2 ) + ':' +
( d.getMinutes() + 100 + '' ).substr( 1,2 ) + ':' +
( d.getSeconds() + 100 + '' ).substr( 1,2 ) + ':' +
( d.getMilliseconds() + 1000 + '' ).substr( 1,3 ) ;
 
var oMsgDiv = oWindow.document.createElement( 'div' ) ;
oMsgDiv.innerHTML = sTime + ': <b>' + sMessage + '<\/b>' ;
oDiv.appendChild( oMsgDiv ) ;
oMsgDiv.scrollIntoView() ;
}
}
 
function Clear()
{
oDiv.innerHTML = '' ;
}
</script>
</head>
<body style="margin: 10px">
<table style="height: 100%" cellspacing="5" cellpadding="0" width="100%" border="0">
<tr>
<td>
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td style="font-weight: bold; font-size: 1.2em;">
FCKeditor Debug Window</td>
<td align="right">
<input type="button" value="Clear" onclick="Clear();" /></td>
</tr>
</table>
</td>
</tr>
<tr style="height: 100%">
<td style="border: #696969 1px solid">
<iframe id="xOutput" width="100%" height="100%" scrolling="auto" src="fckblank.html"
frameborder="0"></iframe>
</td>
</tr>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/fckeditor.html
New file
0,0 → 1,210
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckeditor.html
* Main page that holds the editor.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>FCKeditor</title>
<meta name="robots" content="noindex, nofollow" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Cache-Control" content="public" />
<script type="text/javascript">
 
// Instead of loading scripts and CSSs using inline tags, all scripts are
// loaded by code. In this way we can guarantee the correct processing order,
// otherwise external scripts and inline scripts could be executed in an
// unwanted order (IE).
 
function LoadScript( url )
{
document.write( '<script type="text/javascript" src="' + url + '" onerror="alert(\'Error loading \' + this.src);"><\/script>' ) ;
}
 
function LoadCss( url )
{
document.write( '<link href="' + url + '" type="text/css" rel="stylesheet" onerror="alert(\'Error loading \' + this.src);" />' ) ;
}
 
// Main editor scripts.
var sSuffix = /msie/.test( navigator.userAgent.toLowerCase() ) ? 'ie' : 'gecko' ;
 
LoadScript( 'js/fckeditorcode_' + sSuffix + '.js' ) ;
 
// Base configuration file.
LoadScript( '../fckconfig.js' ) ;
 
</script>
<script type="text/javascript">
 
// Create the default cleanup object used by the editor.
if ( FCKBrowserInfo.IsIE )
{
FCK.IECleanup = new FCKIECleanup( window ) ;
FCK.IECleanup.AddItem( FCKTempBin, FCKTempBin.Reset ) ;
FCK.IECleanup.AddItem( FCK, FCK_Cleanup ) ;
}
 
// The config hidden field is processed immediately, because
// CustomConfigurationsPath may be set in the page.
FCKConfig.ProcessHiddenField() ;
 
// Load the custom configurations file (if defined).
if ( FCKConfig.CustomConfigurationsPath.length > 0 )
LoadScript( FCKConfig.CustomConfigurationsPath ) ;
 
</script>
<script type="text/javascript">
 
// Load configurations defined at page level.
FCKConfig_LoadPageConfig() ;
 
FCKConfig_PreProcess() ;
 
// Load the active skin CSS.
LoadCss( FCKConfig.SkinPath + 'fck_editor.css' ) ;
 
// Load the language file.
FCKLanguageManager.Initialize() ;
LoadScript( 'lang/' + FCKLanguageManager.ActiveLanguage.Code + '.js' ) ;
 
</script>
<script type="text/javascript">
 
// Initialize the editing area context menu.
FCK_ContextMenu_Init() ;
 
FCKPlugins.Load() ;
 
</script>
<script type="text/javascript">
// Set the editor interface direction.
window.document.dir = FCKLang.Dir ;
 
// Activate pasting operations.
if ( FCKConfig.ForcePasteAsPlainText || FCKConfig.AutoDetectPasteFromWord )
FCK.Events.AttachEvent( "OnPaste", FCK.Paste ) ;
 
</script>
<script type="text/javascript">
 
window.onload = function()
{
InitializeAPI() ;
 
if ( FCKBrowserInfo.IsIE )
FCK_PreloadImages() ;
else
LoadToolbarSetup() ;
}
 
function LoadToolbarSetup()
{
FCKeditorAPI._FunctionQueue.Add( LoadToolbar ) ;
}
 
function LoadToolbar()
{
var oToolbarSet = FCK.ToolbarSet = FCKToolbarSet_Create() ;
if ( oToolbarSet.IsLoaded )
StartEditor() ;
else
{
oToolbarSet.OnLoad = StartEditor ;
oToolbarSet.Load( FCKURLParams['Toolbar'] || 'Default' ) ;
}
}
 
function StartEditor()
{
// Remove the onload listener.
FCK.ToolbarSet.OnLoad = null ;
 
FCKeditorAPI._FunctionQueue.Remove( LoadToolbar ) ;
 
FCK.Events.AttachEvent( 'OnStatusChange', WaitForActive ) ;
 
// Start the editor.
FCK.StartEditor() ;
}
 
function WaitForActive( editorInstance, newStatus )
{
if ( newStatus == FCK_STATUS_ACTIVE )
{
if ( FCKBrowserInfo.IsGecko )
FCKTools.RunFunction( window.onresize ) ;
 
FCK.SetStatus( FCK_STATUS_COMPLETE ) ;
 
// Call the special "FCKeditor_OnComplete" function that should be present in
// the HTML page where the editor is located.
if ( typeof( window.parent.FCKeditor_OnComplete ) == 'function' )
window.parent.FCKeditor_OnComplete( FCK ) ;
}
}
 
// Gecko browsers doens't calculate well that IFRAME size so we must
// recalculate it every time the window size changes.
if ( FCKBrowserInfo.IsGecko )
{
function Window_OnResize()
{
if ( FCKBrowserInfo.IsOpera )
return ;
 
var oCell = document.getElementById( 'xEditingArea' ) ;
 
var eInnerElement ;
if ( eInnerElement = oCell.firstChild )
{
eInnerElement.style.height = 0 ;
eInnerElement.style.height = oCell.scrollHeight - 2 ;
}
}
window.onresize = Window_OnResize ;
}
 
</script>
</head>
<body>
<table width="100%" cellpadding="0" cellspacing="0" style="height: 100%; table-layout: fixed">
<tr id="xToolbarRow" style="display: none">
<td id="xToolbarSpace" style="overflow: hidden">
<table width="100%" cellpadding="0" cellspacing="0">
<tr id="xCollapsed" style="display: none">
<td id="xExpandHandle" class="TB_Expand" colspan="3">
<img class="TB_ExpandImg" alt="" src="images/spacer.gif" width="8" height="4" /></td>
</tr>
<tr id="xExpanded" style="display: none">
<td id="xTBLeftBorder" class="TB_SideBorder" style="width: 1px; display: none;"></td>
<td id="xCollapseHandle" style="display: none" class="TB_Collapse" valign="bottom">
<img class="TB_CollapseImg" alt="" src="images/spacer.gif" width="8" height="4" /></td>
<td id="xToolbar" class="TB_ToolbarSet"></td>
<td class="TB_SideBorder" style="width: 1px"></td>
</tr>
</table>
</td>
</tr>
<tr style="height: 100%">
<td id="xEditingArea" valign="top"></td>
</tr>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/fckblank.html
New file
0,0 → 1,5
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head><title></title></head>
<body></body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/fckjscoreextensions.js
New file
0,0 → 1,120
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckjscoreextensions.js
* Extensions to the JavaScript Core.
*
* All custom extentions functions are PascalCased to differ from the standard
* camelCased ones.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
String.prototype.Contains = function( textToCheck )
{
return ( this.indexOf( textToCheck ) > -1 ) ;
}
 
String.prototype.Equals = function()
{
for ( var i = 0 ; i < arguments.length ; i++ )
if ( this == arguments[i] )
return true ;
return false ;
}
 
String.prototype.ReplaceAll = function( searchArray, replaceArray )
{
var replaced = this ;
for ( var i = 0 ; i < searchArray.length ; i++ )
{
replaced = replaced.replace( searchArray[i], replaceArray[i] ) ;
}
return replaced ;
}
 
Array.prototype.AddItem = function( item )
{
var i = this.length ;
this[ i ] = item ;
return i ;
}
 
Array.prototype.indexOf = function( value )
{
for ( var i = 0 ; i < this.length ; i++ )
{
if ( this[i] == value )
return i ;
}
return -1 ;
}
 
String.prototype.startsWith = function( value )
{
return ( this.substr( 0, value.length ) == value ) ;
}
 
// Extends the String object, creating a "endsWith" method on it.
String.prototype.endsWith = function( value, ignoreCase )
{
var L1 = this.length ;
var L2 = value.length ;
if ( L2 > L1 )
return false ;
 
if ( ignoreCase )
{
var oRegex = new RegExp( value + '$' , 'i' ) ;
return oRegex.test( this ) ;
}
else
return ( L2 == 0 || this.substr( L1 - L2, L2 ) == value ) ;
}
 
String.prototype.remove = function( start, length )
{
var s = '' ;
if ( start > 0 )
s = this.substring( 0, start ) ;
if ( start + length < this.length )
s += this.substring( start + length , this.length ) ;
return s ;
}
 
String.prototype.trim = function()
{
return this.replace( /(^\s*)|(\s*$)/g, '' ) ;
}
 
String.prototype.ltrim = function()
{
return this.replace( /^\s*/g, '' ) ;
}
 
String.prototype.rtrim = function()
{
return this.replace( /\s*$/g, '' ) ;
}
 
String.prototype.replaceNewLineChars = function( replacement )
{
return this.replace( /\n/g, replacement ) ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/fckconstants.js
New file
0,0 → 1,44
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckconstants.js
* Defines some constants used by the editor. These constants are also
* globally available in the page where the editor is placed.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
// Editor Instance Status.
var FCK_STATUS_NOTLOADED = window.parent.FCK_STATUS_NOTLOADED = 0 ;
var FCK_STATUS_ACTIVE = window.parent.FCK_STATUS_ACTIVE = 1 ;
var FCK_STATUS_COMPLETE = window.parent.FCK_STATUS_COMPLETE = 2 ;
 
// Tristate Operations.
var FCK_TRISTATE_OFF = window.parent.FCK_TRISTATE_OFF = 0 ;
var FCK_TRISTATE_ON = window.parent.FCK_TRISTATE_ON = 1 ;
var FCK_TRISTATE_DISABLED = window.parent.FCK_TRISTATE_DISABLED = -1 ;
 
// For unknown values.
var FCK_UNKNOWN = window.parent.FCK_UNKNOWN = -9 ;
 
// Toolbar Items Style.
var FCK_TOOLBARITEM_ONLYICON = window.parent.FCK_TOOLBARITEM_ONLYICON = 0 ;
var FCK_TOOLBARITEM_ONLYTEXT = window.parent.FCK_TOOLBARITEM_ONLYTEXT = 1 ;
var FCK_TOOLBARITEM_ICONTEXT = window.parent.FCK_TOOLBARITEM_ICONTEXT = 2 ;
 
// Edit Mode
var FCK_EDITMODE_WYSIWYG = window.parent.FCK_EDITMODE_WYSIWYG = 0 ;
var FCK_EDITMODE_SOURCE = window.parent.FCK_EDITMODE_SOURCE = 1 ;
 
var FCK_IMAGES_PATH = 'images/' ; // Check usage.
var FCK_SPACER_PATH = 'images/spacer.gif' ;
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/commandclasses/fckstylecommand.js
New file
0,0 → 1,95
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckstylecommand.js
* FCKStyleCommand Class: represents the "Style" command.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKStyleCommand = function()
{
this.Name = 'Style' ;
 
// Load the Styles defined in the XML file.
this.StylesLoader = new FCKStylesLoader() ;
this.StylesLoader.Load( FCKConfig.StylesXmlPath ) ;
this.Styles = this.StylesLoader.Styles ;
}
 
FCKStyleCommand.prototype.Execute = function( styleName, styleComboItem )
{
FCKUndo.SaveUndoStep() ;
 
if ( styleComboItem.Selected )
styleComboItem.Style.RemoveFromSelection() ;
else
styleComboItem.Style.ApplyToSelection() ;
 
FCKUndo.SaveUndoStep() ;
 
FCK.Focus() ;
FCK.Events.FireEvent( "OnSelectionChange" ) ;
}
 
FCKStyleCommand.prototype.GetState = function()
{
if ( !FCK.EditorDocument )
return FCK_TRISTATE_DISABLED ;
 
var oSelection = FCK.EditorDocument.selection ;
if ( FCKSelection.GetType() == 'Control' )
{
var e = FCKSelection.GetSelectedElement() ;
if ( e )
return this.StylesLoader.StyleGroups[ e.tagName ] ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ;
}
 
return FCK_TRISTATE_OFF ;
}
 
FCKStyleCommand.prototype.GetActiveStyles = function()
{
var aActiveStyles = new Array() ;
if ( FCKSelection.GetType() == 'Control' )
this._CheckStyle( FCKSelection.GetSelectedElement(), aActiveStyles, false ) ;
else
this._CheckStyle( FCKSelection.GetParentElement(), aActiveStyles, true ) ;
return aActiveStyles ;
}
 
FCKStyleCommand.prototype._CheckStyle = function( element, targetArray, checkParent )
{
if ( ! element )
return ;
 
if ( element.nodeType == 1 )
{
var aStyleGroup = this.StylesLoader.StyleGroups[ element.tagName ] ;
if ( aStyleGroup )
{
for ( var i = 0 ; i < aStyleGroup.length ; i++ )
{
if ( aStyleGroup[i].IsEqual( element ) )
targetArray[ targetArray.length ] = aStyleGroup[i] ;
}
}
}
if ( checkParent )
this._CheckStyle( element.parentNode, targetArray, checkParent ) ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/commandclasses/fck_othercommands.js
New file
0,0 → 1,309
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_othercommands.js
* Definition of other commands that are not available internaly in the
* browser (see FCKNamedCommand).
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
// ### General Dialog Box Commands.
var FCKDialogCommand = function( name, title, url, width, height, getStateFunction, getStateParam )
{
this.Name = name ;
this.Title = title ;
this.Url = url ;
this.Width = width ;
this.Height = height ;
 
this.GetStateFunction = getStateFunction ;
this.GetStateParam = getStateParam ;
}
 
FCKDialogCommand.prototype.Execute = function()
{
FCKDialog.OpenDialog( 'FCKDialog_' + this.Name , this.Title, this.Url, this.Width, this.Height ) ;
}
 
FCKDialogCommand.prototype.GetState = function()
{
if ( this.GetStateFunction )
return this.GetStateFunction( this.GetStateParam ) ;
else
return FCK_TRISTATE_OFF ;
}
 
// Generic Undefined command (usually used when a command is under development).
var FCKUndefinedCommand = function()
{
this.Name = 'Undefined' ;
}
 
FCKUndefinedCommand.prototype.Execute = function()
{
alert( FCKLang.NotImplemented ) ;
}
 
FCKUndefinedCommand.prototype.GetState = function()
{
return FCK_TRISTATE_OFF ;
}
 
// ### FontName
var FCKFontNameCommand = function()
{
this.Name = 'FontName' ;
}
 
FCKFontNameCommand.prototype.Execute = function( fontName )
{
if (fontName == null || fontName == "")
{
// TODO: Remove font name attribute.
}
else
FCK.ExecuteNamedCommand( 'FontName', fontName ) ;
}
 
FCKFontNameCommand.prototype.GetState = function()
{
return FCK.GetNamedCommandValue( 'FontName' ) ;
}
 
// ### FontSize
var FCKFontSizeCommand = function()
{
this.Name = 'FontSize' ;
}
 
FCKFontSizeCommand.prototype.Execute = function( fontSize )
{
if ( typeof( fontSize ) == 'string' ) fontSize = parseInt(fontSize) ;
 
if ( fontSize == null || fontSize == '' )
{
// TODO: Remove font size attribute (Now it works with size 3. Will it work forever?)
FCK.ExecuteNamedCommand( 'FontSize', 3 ) ;
}
else
FCK.ExecuteNamedCommand( 'FontSize', fontSize ) ;
}
 
FCKFontSizeCommand.prototype.GetState = function()
{
return FCK.GetNamedCommandValue( 'FontSize' ) ;
}
 
// ### FormatBlock
var FCKFormatBlockCommand = function()
{
this.Name = 'FormatBlock' ;
}
 
FCKFormatBlockCommand.prototype.Execute = function( formatName )
{
if ( formatName == null || formatName == '' )
FCK.ExecuteNamedCommand( 'FormatBlock', '<P>' ) ;
else if ( formatName == 'div' && FCKBrowserInfo.IsGecko )
FCK.ExecuteNamedCommand( 'FormatBlock', 'div' ) ;
else
FCK.ExecuteNamedCommand( 'FormatBlock', '<' + formatName + '>' ) ;
}
 
FCKFormatBlockCommand.prototype.GetState = function()
{
return FCK.GetNamedCommandValue( 'FormatBlock' ) ;
}
 
// ### Preview
var FCKPreviewCommand = function()
{
this.Name = 'Preview' ;
}
 
FCKPreviewCommand.prototype.Execute = function()
{
FCK.Preview() ;
}
 
FCKPreviewCommand.prototype.GetState = function()
{
return FCK_TRISTATE_OFF ;
}
 
// ### Save
var FCKSaveCommand = function()
{
this.Name = 'Save' ;
}
 
FCKSaveCommand.prototype.Execute = function()
{
// Get the linked field form.
var oForm = FCK.LinkedField.form ;
 
if ( typeof( oForm.onsubmit ) == 'function' )
{
var bRet = oForm.onsubmit() ;
if ( bRet != null && bRet === false )
return ;
}
 
// Submit the form.
oForm.submit() ;
}
 
FCKSaveCommand.prototype.GetState = function()
{
return FCK_TRISTATE_OFF ;
}
 
// ### NewPage
var FCKNewPageCommand = function()
{
this.Name = 'NewPage' ;
}
 
FCKNewPageCommand.prototype.Execute = function()
{
FCKUndo.SaveUndoStep() ;
FCK.SetHTML( '' ) ;
FCKUndo.Typing = true ;
// FCK.SetHTML( FCKBrowserInfo.IsGecko ? '&nbsp;' : '' ) ;
// FCK.SetHTML( FCKBrowserInfo.IsGecko ? GECKO_BOGUS : '' ) ;
}
 
FCKNewPageCommand.prototype.GetState = function()
{
return FCK_TRISTATE_OFF ;
}
 
// ### Source button
var FCKSourceCommand = function()
{
this.Name = 'Source' ;
}
 
FCKSourceCommand.prototype.Execute = function()
{
if ( FCKConfig.SourcePopup ) // Until v2.2, it was mandatory for FCKBrowserInfo.IsGecko.
{
var iWidth = FCKConfig.ScreenWidth * 0.65 ;
var iHeight = FCKConfig.ScreenHeight * 0.65 ;
FCKDialog.OpenDialog( 'FCKDialog_Source', FCKLang.Source, 'dialog/fck_source.html', iWidth, iHeight, null, null, true ) ;
}
else
FCK.SwitchEditMode() ;
}
 
FCKSourceCommand.prototype.GetState = function()
{
return ( FCK.EditMode == FCK_EDITMODE_WYSIWYG ? FCK_TRISTATE_OFF : FCK_TRISTATE_ON ) ;
}
 
// ### Undo
var FCKUndoCommand = function()
{
this.Name = 'Undo' ;
}
 
FCKUndoCommand.prototype.Execute = function()
{
if ( FCKBrowserInfo.IsIE )
FCKUndo.Undo() ;
else
FCK.ExecuteNamedCommand( 'Undo' ) ;
}
 
FCKUndoCommand.prototype.GetState = function()
{
if ( FCKBrowserInfo.IsIE )
return ( FCKUndo.CheckUndoState() ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ) ;
else
return FCK.GetNamedCommandState( 'Undo' ) ;
}
 
// ### Redo
var FCKRedoCommand = function()
{
this.Name = 'Redo' ;
}
 
FCKRedoCommand.prototype.Execute = function()
{
if ( FCKBrowserInfo.IsIE )
FCKUndo.Redo() ;
else
FCK.ExecuteNamedCommand( 'Redo' ) ;
}
 
FCKRedoCommand.prototype.GetState = function()
{
if ( FCKBrowserInfo.IsIE )
return ( FCKUndo.CheckRedoState() ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ) ;
else
return FCK.GetNamedCommandState( 'Redo' ) ;
}
 
// ### Page Break
var FCKPageBreakCommand = function()
{
this.Name = 'PageBreak' ;
}
 
FCKPageBreakCommand.prototype.Execute = function()
{
// var e = FCK.EditorDocument.createElement( 'CENTER' ) ;
// e.style.pageBreakAfter = 'always' ;
 
// Tidy was removing the empty CENTER tags, so the following solution has
// been found. It also validates correctly as XHTML 1.0 Strict.
var e = FCK.EditorDocument.createElement( 'DIV' ) ;
e.style.pageBreakAfter = 'always' ;
e.innerHTML = '<span style="DISPLAY:none">&nbsp;</span>' ;
var oFakeImage = FCKDocumentProcessor_CreateFakeImage( 'FCK__PageBreak', e ) ;
oFakeImage = FCK.InsertElement( oFakeImage ) ;
}
 
FCKPageBreakCommand.prototype.GetState = function()
{
return 0 ; // FCK_TRISTATE_OFF
}
 
// FCKUnlinkCommand - by Johnny Egeland (johnny@coretrek.com)
var FCKUnlinkCommand = function()
{
this.Name = 'Unlink' ;
}
 
FCKUnlinkCommand.prototype.Execute = function()
{
if ( FCKBrowserInfo.IsGecko )
{
var oLink = FCK.Selection.MoveToAncestorNode( 'A' ) ;
if ( oLink )
FCK.Selection.SelectNode( oLink ) ;
}
FCK.ExecuteNamedCommand( this.Name ) ;
 
if ( FCKBrowserInfo.IsGecko )
FCK.Selection.Collapse( true ) ;
}
 
FCKUnlinkCommand.prototype.GetState = function()
{
return FCK.GetNamedCommandState( this.Name ) ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/commandclasses/fcktextcolorcommand.js
New file
0,0 → 1,171
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktextcolorcommand.js
* FCKTextColorCommand Class: represents the text color comand. It shows the
* color selection panel.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
// FCKTextColorCommand Contructor
// type: can be 'ForeColor' or 'BackColor'.
var FCKTextColorCommand = function( type )
{
this.Name = type == 'ForeColor' ? 'TextColor' : 'BGColor' ;
this.Type = type ;
 
var oWindow ;
if ( FCKBrowserInfo.IsIE )
oWindow = window ;
else if ( FCK.ToolbarSet._IFrame )
oWindow = FCKTools.GetElementWindow( FCK.ToolbarSet._IFrame ) ;
else
oWindow = window.parent ;
 
this._Panel = new FCKPanel( oWindow, true ) ;
this._Panel.AppendStyleSheet( FCKConfig.SkinPath + 'fck_editor.css' ) ;
this._Panel.MainNode.className = 'FCK_Panel' ;
this._CreatePanelBody( this._Panel.Document, this._Panel.MainNode ) ;
FCKTools.DisableSelection( this._Panel.Document.body ) ;
}
 
FCKTextColorCommand.prototype.Execute = function( panelX, panelY, relElement )
{
// We must "cache" the actual panel type to be used in the SetColor method.
FCK._ActiveColorPanelType = this.Type ;
 
// Show the Color Panel at the desired position.
this._Panel.Show( panelX, panelY, relElement ) ;
}
 
FCKTextColorCommand.prototype.SetColor = function( color )
{
if ( FCK._ActiveColorPanelType == 'ForeColor' )
FCK.ExecuteNamedCommand( 'ForeColor', color ) ;
else if ( FCKBrowserInfo.IsGeckoLike )
{
if ( FCKBrowserInfo.IsGecko && !FCKConfig.GeckoUseSPAN )
FCK.EditorDocument.execCommand( 'useCSS', false, false ) ;
FCK.ExecuteNamedCommand( 'hilitecolor', color ) ;
 
if ( FCKBrowserInfo.IsGecko && !FCKConfig.GeckoUseSPAN )
FCK.EditorDocument.execCommand( 'useCSS', false, true ) ;
}
else
FCK.ExecuteNamedCommand( 'BackColor', color ) ;
// Delete the "cached" active panel type.
delete FCK._ActiveColorPanelType ;
}
 
FCKTextColorCommand.prototype.GetState = function()
{
return FCK_TRISTATE_OFF ;
}
 
function FCKTextColorCommand_OnMouseOver() { this.className='ColorSelected' ; }
 
function FCKTextColorCommand_OnMouseOut() { this.className='ColorDeselected' ; }
 
function FCKTextColorCommand_OnClick()
{
this.className = 'ColorDeselected' ;
this.Command.SetColor( '#' + this.Color ) ;
this.Command._Panel.Hide() ;
}
 
function FCKTextColorCommand_AutoOnClick()
{
this.className = 'ColorDeselected' ;
this.Command.SetColor( '' ) ;
this.Command._Panel.Hide() ;
}
 
function FCKTextColorCommand_MoreOnClick()
{
this.className = 'ColorDeselected' ;
this.Command._Panel.Hide() ;
FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, this.Command.SetColor ) ;
}
 
FCKTextColorCommand.prototype._CreatePanelBody = function( targetDocument, targetDiv )
{
function CreateSelectionDiv()
{
var oDiv = targetDocument.createElement( "DIV" ) ;
oDiv.className = 'ColorDeselected' ;
oDiv.onmouseover = FCKTextColorCommand_OnMouseOver ;
oDiv.onmouseout = FCKTextColorCommand_OnMouseOut ;
return oDiv ;
}
 
// Create the Table that will hold all colors.
var oTable = targetDiv.appendChild( targetDocument.createElement( "TABLE" ) ) ;
oTable.className = 'ForceBaseFont' ; // Firefox 1.5 Bug.
oTable.style.tableLayout = 'fixed' ;
oTable.cellPadding = 0 ;
oTable.cellSpacing = 0 ;
oTable.border = 0 ;
oTable.width = 150 ;
 
var oCell = oTable.insertRow(-1).insertCell(-1) ;
oCell.colSpan = 8 ;
 
// Create the Button for the "Automatic" color selection.
var oDiv = oCell.appendChild( CreateSelectionDiv() ) ;
oDiv.innerHTML =
'<table cellspacing="0" cellpadding="0" width="100%" border="0">\
<tr>\
<td><div class="ColorBoxBorder"><div class="ColorBox" style="background-color: #000000"></div></div></td>\
<td nowrap width="100%" align="center">' + FCKLang.ColorAutomatic + '</td>\
</tr>\
</table>' ;
 
oDiv.Command = this ;
oDiv.onclick = FCKTextColorCommand_AutoOnClick ;
 
// Create an array of colors based on the configuration file.
var aColors = FCKConfig.FontColors.toString().split(',') ;
 
// Create the colors table based on the array.
var iCounter = 0 ;
while ( iCounter < aColors.length )
{
var oRow = oTable.insertRow(-1) ;
for ( var i = 0 ; i < 8 && iCounter < aColors.length ; i++, iCounter++ )
{
oDiv = oRow.insertCell(-1).appendChild( CreateSelectionDiv() ) ;
oDiv.Color = aColors[iCounter] ;
oDiv.innerHTML = '<div class="ColorBoxBorder"><div class="ColorBox" style="background-color: #' + aColors[iCounter] + '"></div></div>' ;
 
oDiv.Command = this ;
oDiv.onclick = FCKTextColorCommand_OnClick ;
}
}
 
// Create the Row and the Cell for the "More Colors..." button.
oCell = oTable.insertRow(-1).insertCell(-1) ;
oCell.colSpan = 8 ;
 
oDiv = oCell.appendChild( CreateSelectionDiv() ) ;
oDiv.innerHTML = '<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td nowrap align="center">' + FCKLang.ColorMoreColors + '</td></tr></table>' ;
 
oDiv.Command = this ;
oDiv.onclick = FCKTextColorCommand_MoreOnClick ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/commandclasses/fcknamedcommand.js
New file
0,0 → 1,33
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcknamedcommand.js
* FCKNamedCommand Class: represents an internal browser command.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKNamedCommand = function( commandName )
{
this.Name = commandName ;
}
 
FCKNamedCommand.prototype.Execute = function()
{
FCK.ExecuteNamedCommand( this.Name ) ;
}
 
FCKNamedCommand.prototype.GetState = function()
{
return FCK.GetNamedCommandState( this.Name ) ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/commandclasses/fckpasteplaintextcommand.js
New file
0,0 → 1,34
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckpasteplaintextcommand.js
* FCKPastePlainTextCommand Class: represents the
* "Paste as Plain Text" command.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKPastePlainTextCommand = function()
{
this.Name = 'PasteText' ;
}
 
FCKPastePlainTextCommand.prototype.Execute = function()
{
FCK.PasteAsPlainText() ;
}
 
FCKPastePlainTextCommand.prototype.GetState = function()
{
return FCK.GetNamedCommandState( 'Paste' ) ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/commandclasses/fckspellcheckcommand_gecko.js
New file
0,0 → 1,35
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckspellcheckcommand_gecko.js
* FCKStyleCommand Class: represents the "Spell Check" command.
* (Gecko specific implementation)
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKSpellCheckCommand = function()
{
this.Name = 'SpellCheck' ;
this.IsEnabled = ( FCKConfig.SpellChecker == 'SpellerPages' ) ;
}
 
FCKSpellCheckCommand.prototype.Execute = function()
{
FCKDialog.OpenDialog( 'FCKDialog_SpellCheck', 'Spell Check', 'dialog/fck_spellerpages.html', 440, 480 ) ;
}
 
FCKSpellCheckCommand.prototype.GetState = function()
{
return this.IsEnabled ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/commandclasses/fcktablecommand.js
New file
0,0 → 1,67
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktablecommand.js
* FCKPastePlainTextCommand Class: represents the
* "Paste as Plain Text" command.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKTableCommand = function( command )
{
this.Name = command ;
}
 
FCKTableCommand.prototype.Execute = function()
{
FCKUndo.SaveUndoStep() ;
switch ( this.Name )
{
case 'TableInsertRow' :
FCKTableHandler.InsertRow() ;
break ;
case 'TableDeleteRows' :
FCKTableHandler.DeleteRows() ;
break ;
case 'TableInsertColumn' :
FCKTableHandler.InsertColumn() ;
break ;
case 'TableDeleteColumns' :
FCKTableHandler.DeleteColumns() ;
break ;
case 'TableInsertCell' :
FCKTableHandler.InsertCell() ;
break ;
case 'TableDeleteCells' :
FCKTableHandler.DeleteCells() ;
break ;
case 'TableMergeCells' :
FCKTableHandler.MergeCells() ;
break ;
case 'TableSplitCell' :
FCKTableHandler.SplitCell() ;
break ;
case 'TableDelete' :
FCKTableHandler.DeleteTable() ;
break ;
default :
alert( FCKLang.UnknownCommand.replace( /%1/g, this.Name ) ) ;
}
}
 
FCKTableCommand.prototype.GetState = function()
{
return FCK_TRISTATE_OFF ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/commandclasses/fckpastewordcommand.js
New file
0,0 → 1,36
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckpastewordcommand.js
* FCKPasteWordCommand Class: represents the "Paste from Word" command.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKPasteWordCommand = function()
{
this.Name = 'PasteWord' ;
}
 
FCKPasteWordCommand.prototype.Execute = function()
{
FCK.PasteFromWord() ;
}
 
FCKPasteWordCommand.prototype.GetState = function()
{
if ( FCKConfig.ForcePasteAsPlainText )
return FCK_TRISTATE_DISABLED ;
else
return FCK.GetNamedCommandState( 'Paste' ) ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/commandclasses/fckspellcheckcommand_ie.js
New file
0,0 → 1,63
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckspellcheckcommand_ie.js
* FCKStyleCommand Class: represents the "Spell Check" command.
* (IE specific implementation)
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKSpellCheckCommand = function()
{
this.Name = 'SpellCheck' ;
this.IsEnabled = ( FCKConfig.SpellChecker == 'ieSpell' || FCKConfig.SpellChecker == 'SpellerPages' ) ;
}
 
FCKSpellCheckCommand.prototype.Execute = function()
{
switch ( FCKConfig.SpellChecker )
{
case 'ieSpell' :
this._RunIeSpell() ;
break ;
case 'SpellerPages' :
FCKDialog.OpenDialog( 'FCKDialog_SpellCheck', 'Spell Check', 'dialog/fck_spellerpages.html', 440, 480 ) ;
break ;
}
}
 
FCKSpellCheckCommand.prototype._RunIeSpell = function()
{
try
{
var oIeSpell = new ActiveXObject( "ieSpell.ieSpellExtension" ) ;
oIeSpell.CheckAllLinkedDocuments( FCK.EditorDocument ) ;
}
catch( e )
{
if( e.number == -2146827859 )
{
if ( confirm( FCKLang.IeSpellDownload ) )
window.open( FCKConfig.IeSpellDownloadUrl , 'IeSpellDownload' ) ;
}
else
alert( 'Error Loading ieSpell: ' + e.message + ' (' + e.number + ')' ) ;
}
}
 
FCKSpellCheckCommand.prototype.GetState = function()
{
return this.IsEnabled ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/commandclasses/fckfitwindow.js
New file
0,0 → 1,164
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckfitwindow.js
* Stretch the editor to full window size and back.
*
* File Authors:
* Paul Moers (mail@saulmade.nl)
* Thanks to Christian Fecteau (webmaster@christianfecteau.com)
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKFitWindow = function()
{
this.Name = 'FitWindow' ;
}
 
FCKFitWindow.prototype.Execute = function()
{
var eEditorFrame = window.frameElement ;
var eEditorFrameStyle = eEditorFrame.style ;
 
var eMainWindow = parent ;
var eDocEl = eMainWindow.document.documentElement ;
var eBody = eMainWindow.document.body ;
var eBodyStyle = eBody.style ;
 
// No original style properties known? Go fullscreen.
if ( !this.IsMaximized )
{
// Registering an event handler when the window gets resized.
if( FCKBrowserInfo.IsIE )
eMainWindow.attachEvent( 'onresize', FCKFitWindow_Resize ) ;
else
eMainWindow.addEventListener( 'resize', FCKFitWindow_Resize, true ) ;
 
// Save the scrollbars position.
this._ScrollPos = FCKTools.GetScrollPosition( eMainWindow ) ;
// Save and reset the styles for the entire node tree. They could interfere in the result.
var eParent = eEditorFrame ;
while( eParent = eParent.parentNode )
{
if ( eParent.nodeType == 1 )
eParent._fckSavedStyles = FCKTools.SaveStyles( eParent ) ;
}
 
// Hide IE scrollbars (in strict mode).
if ( FCKBrowserInfo.IsIE )
{
this.documentElementOverflow = eDocEl.style.overflow ;
eDocEl.style.overflow = 'hidden' ;
eBodyStyle.overflow = 'hidden' ;
}
else
{
// Hide the scroolbars in Firefox.
eBodyStyle.overflow = 'hidden' ;
eBodyStyle.width = '0px' ;
eBodyStyle.height = '0px' ;
}
// Save the IFRAME styles.
this._EditorFrameStyles = FCKTools.SaveStyles( eEditorFrame ) ;
// Resize.
var oViewPaneSize = FCKTools.GetViewPaneSize( eMainWindow ) ;
 
eEditorFrameStyle.position = "absolute";
eEditorFrameStyle.zIndex = FCKConfig.FloatingPanelsZIndex - 1;
eEditorFrameStyle.left = "0px";
eEditorFrameStyle.top = "0px";
eEditorFrameStyle.width = oViewPaneSize.Width + "px";
eEditorFrameStyle.height = oViewPaneSize.Height + "px";
// Giving the frame some (huge) borders on his right and bottom
// side to hide the background that would otherwise show when the
// editor is in fullsize mode and the window is increased in size
// not for IE, because IE immediately adapts the editor on resize,
// without showing any of the background oddly in firefox, the
// editor seems not to fill the whole frame, so just setting the
// background of it to white to cover the page laying behind it anyway.
if ( !FCKBrowserInfo.IsIE )
{
eEditorFrameStyle.borderRight = eEditorFrameStyle.borderBottom = "9999px solid white" ;
eEditorFrameStyle.backgroundColor = "white";
}
 
// Scroll to top left.
eMainWindow.scrollTo(0, 0);
 
this.IsMaximized = true ;
}
else // Resize to original size.
{
// Remove the event handler of window resizing.
if( FCKBrowserInfo.IsIE )
eMainWindow.detachEvent( "onresize", FCKFitWindow_Resize ) ;
else
eMainWindow.removeEventListener( "resize", FCKFitWindow_Resize, true ) ;
 
// Restore the CSS position for the entire node tree.
var eParent = eEditorFrame ;
while( eParent = eParent.parentNode )
{
if ( eParent._fckSavedStyles )
{
FCKTools.RestoreStyles( eParent, eParent._fckSavedStyles ) ;
eParent._fckSavedStyles = null ;
}
}
// Restore IE scrollbars
if ( FCKBrowserInfo.IsIE )
eDocEl.style.overflow = this.documentElementOverflow ;
 
// Restore original size
FCKTools.RestoreStyles( eEditorFrame, this._EditorFrameStyles ) ;
// Restore the window scroll position.
eMainWindow.scrollTo( this._ScrollPos.X, this._ScrollPos.Y ) ;
 
this.IsMaximized = false ;
}
FCKToolbarItems.GetItem('FitWindow').RefreshState() ;
 
// It seams that Firefox restarts the editing area when making this changes.
// On FF 1.0.x, the area is not anymore editable. On FF 1.5+, the special
//configuration, like DisableFFTableHandles and DisableObjectResizing get
//lost, so we must reset it. Also, the cursor position and selection are
//also lost, even if you comment the following line (MakeEditable).
// if ( FCKBrowserInfo.IsGecko10 ) // Initially I thought it was a FF 1.0 only problem.
FCK.EditingArea.MakeEditable() ;
FCK.Focus() ;
}
 
FCKFitWindow.prototype.GetState = function()
{
if ( FCKConfig.ToolbarLocation != 'In' )
return FCK_TRISTATE_DISABLED ;
else
return ( this.IsMaximized ? FCK_TRISTATE_ON : FCK_TRISTATE_OFF );
}
 
function FCKFitWindow_Resize()
{
var oViewPaneSize = FCKTools.GetViewPaneSize( parent ) ;
 
var eEditorFrameStyle = window.frameElement.style ;
 
eEditorFrameStyle.width = oViewPaneSize.Width + 'px' ;
eEditorFrameStyle.height = oViewPaneSize.Height + 'px' ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/classes/fckstyledef_ie.js
New file
0,0 → 1,139
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckstyledef_ie.js
* FCKStyleDef Class: represents a single stylke definition. (IE specific)
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
FCKStyleDef.prototype.ApplyToSelection = function()
{
var oSelection = FCK.ToolbarSet.CurrentInstance.EditorDocument.selection ;
if ( oSelection.type == 'Text' )
{
var oRange = oSelection.createRange() ;
// Create the main element.
var e = document.createElement( this.Element ) ;
e.innerHTML = oRange.htmlText ;
// Set the attributes.
this._AddAttributes( e ) ;
// Remove the duplicated elements.
this._RemoveDuplicates( e ) ;
// Replace the selection with the resulting HTML.
oRange.pasteHTML( e.outerHTML ) ;
}
else if ( oSelection.type == 'Control' )
{
var oControl = FCK.ToolbarSet.CurrentInstance.Selection.GetSelectedElement() ;
if ( oControl.tagName == this.Element )
this._AddAttributes( oControl ) ;
}
}
 
FCKStyleDef.prototype._AddAttributes = function( targetElement )
{
for ( var a in this.Attributes )
{
switch ( a.toLowerCase() )
{
case 'style' :
targetElement.style.cssText = this.Attributes[a] ;
break ;
 
case 'class' :
targetElement.setAttribute( 'className', this.Attributes[a], 0 ) ;
break ;
 
case 'src' :
targetElement.setAttribute( '_fcksavedurl', this.Attributes[a], 0 ) ;
 
default :
targetElement.setAttribute( a, this.Attributes[a], 0 ) ;
}
}
}
 
FCKStyleDef.prototype._RemoveDuplicates = function( parent )
{
for ( var i = 0 ; i < parent.children.length ; i++ )
{
var oChild = parent.children[i] ;
this._RemoveDuplicates( oChild ) ;
if ( this.IsEqual( oChild ) )
FCKTools.RemoveOuterTags( oChild ) ;
}
}
 
FCKStyleDef.prototype.IsEqual = function( e )
{
if ( e.tagName != this.Element )
return false ;
for ( var a in this.Attributes )
{
switch ( a.toLowerCase() )
{
case 'style' :
if ( e.style.cssText.toLowerCase() != this.Attributes[a].toLowerCase() )
return false ;
break ;
case 'class' :
if ( e.getAttribute( 'className', 0 ) != this.Attributes[a] )
return false ;
break ;
default :
if ( e.getAttribute( a, 0 ) != this.Attributes[a] )
return false ;
}
}
return true ;
}
 
FCKStyleDef.prototype._RemoveMe = function( elementToCheck )
{
if ( ! elementToCheck )
return ;
 
var oParent = elementToCheck.parentElement ;
 
if ( this.IsEqual( elementToCheck ) )
{
if ( this.IsObjectElement )
{
for ( var a in this.Attributes )
{
switch ( a.toLowerCase() )
{
case 'class' :
elementToCheck.removeAttribute( 'className', 0 ) ;
break ;
default :
elementToCheck.removeAttribute( a, 0 ) ;
}
}
return ;
}
else
FCKTools.RemoveOuterTags( elementToCheck ) ;
}
this._RemoveMe( oParent ) ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/classes/fcktoolbarbuttonui.js
New file
0,0 → 1,218
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktoolbarbuttonui.js
* FCKToolbarButtonUI Class: interface representation of a toolbar button.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKToolbarButtonUI = function( name, label, tooltip, iconPathOrStripInfoArray, style, state )
{
this.Name = name ;
this.Label = label || name ;
this.Tooltip = tooltip || this.Label ;
this.Style = style || FCK_TOOLBARITEM_ONLYICON ;
this.State = state || FCK_TRISTATE_OFF ;
this.Icon = new FCKIcon( iconPathOrStripInfoArray ) ;
 
if ( FCK.IECleanup )
FCK.IECleanup.AddItem( this, FCKToolbarButtonUI_Cleanup ) ;
}
 
 
FCKToolbarButtonUI.prototype._CreatePaddingElement = function( document )
{
var oImg = document.createElement( 'IMG' ) ;
oImg.className = 'TB_Button_Padding' ;
oImg.src = FCK_SPACER_PATH ;
return oImg ;
}
 
FCKToolbarButtonUI.prototype.Create = function( parentElement )
{
var oMainElement = this.MainElement ;
if ( oMainElement )
{
FCKToolbarButtonUI_Cleanup.call(this) ;
if ( oMainElement.parentNode )
oMainElement.parentNode.removeChild( oMainElement ) ;
oMainElement = this.MainElement = null ;
}
 
var oDoc = FCKTools.GetElementDocument( parentElement ) ;
// Create the Main Element.
oMainElement = this.MainElement = oDoc.createElement( 'DIV' ) ;
oMainElement._FCKButton = this ; // IE Memory Leak (Circular reference).
oMainElement.title = this.Tooltip ;
 
// The following will prevent the button from catching the focus.
if ( FCKBrowserInfo.IsGecko )
oMainElement.onmousedown = FCKTools.CancelEvent ;
 
this.ChangeState( this.State, true ) ;
 
if ( this.Style == FCK_TOOLBARITEM_ONLYICON && !this.ShowArrow )
{
// <td><div class="TB_Button_On" title="Smiley">{Image}</div></td>
oMainElement.appendChild( this.Icon.CreateIconElement( oDoc ) ) ;
}
else
{
// <td><div class="TB_Button_On" title="Smiley"><table cellpadding="0" cellspacing="0"><tr><td>{Image}</td><td nowrap>Toolbar Button</td><td><img class="TB_Button_Padding"></td></tr></table></div></td>
// <td><div class="TB_Button_On" title="Smiley"><table cellpadding="0" cellspacing="0"><tr><td><img class="TB_Button_Padding"></td><td nowrap>Toolbar Button</td><td><img class="TB_Button_Padding"></td></tr></table></div></td>
var oTable = oMainElement.appendChild( oDoc.createElement( 'TABLE' ) ) ;
oTable.cellPadding = 0 ;
oTable.cellSpacing = 0 ;
 
var oRow = oTable.insertRow(-1) ;
// The Image cell (icon or padding).
var oCell = oRow.insertCell(-1) ;
if ( this.Style == FCK_TOOLBARITEM_ONLYICON || this.Style == FCK_TOOLBARITEM_ICONTEXT )
oCell.appendChild( this.Icon.CreateIconElement( oDoc ) ) ;
else
oCell.appendChild( this._CreatePaddingElement( oDoc ) ) ;
if ( this.Style == FCK_TOOLBARITEM_ONLYTEXT || this.Style == FCK_TOOLBARITEM_ICONTEXT )
{
// The Text cell.
oCell = oRow.insertCell(-1) ;
oCell.className = 'TB_Button_Text' ;
oCell.noWrap = true ;
oCell.appendChild( oDoc.createTextNode( this.Label ) ) ;
}
if ( this.ShowArrow )
{
if ( this.Style != FCK_TOOLBARITEM_ONLYICON )
{
// A padding cell.
oRow.insertCell(-1).appendChild( this._CreatePaddingElement( oDoc ) ) ;
}
oCell = oRow.insertCell(-1) ;
var eImg = oCell.appendChild( oDoc.createElement( 'IMG' ) ) ;
eImg.src = FCKConfig.SkinPath + 'images/toolbar.buttonarrow.gif' ;
eImg.width = 5 ;
eImg.height = 3 ;
}
 
// The last padding cell.
oCell = oRow.insertCell(-1) ;
oCell.appendChild( this._CreatePaddingElement( oDoc ) ) ;
}
parentElement.appendChild( oMainElement ) ;
}
 
FCKToolbarButtonUI.prototype.ChangeState = function( newState, force )
{
if ( !force && this.State == newState )
return ;
 
var e = this.MainElement ;
 
switch ( parseInt( newState ) )
{
case FCK_TRISTATE_OFF :
e.className = 'TB_Button_Off' ;
e.onmouseover = FCKToolbarButton_OnMouseOverOff ;
e.onmouseout = FCKToolbarButton_OnMouseOutOff ;
e.onclick = FCKToolbarButton_OnClick ;
break ;
case FCK_TRISTATE_ON :
e.className = 'TB_Button_On' ;
e.onmouseover = FCKToolbarButton_OnMouseOverOn ;
e.onmouseout = FCKToolbarButton_OnMouseOutOn ;
e.onclick = FCKToolbarButton_OnClick ;
break ;
 
case FCK_TRISTATE_DISABLED :
e.className = 'TB_Button_Disabled' ;
e.onmouseover = null ;
e.onmouseout = null ;
e.onclick = null ;
bEnableEvents = false ;
break ;
}
 
this.State = newState ;
}
 
function FCKToolbarButtonUI_Cleanup()
{
if ( this.MainElement )
{
this.MainElement._FCKButton = null ;
this.MainElement = null ;
}
}
 
// Event Handlers.
 
function FCKToolbarButton_OnMouseOverOn()
{
this.className = 'TB_Button_On_Over' ;
}
 
function FCKToolbarButton_OnMouseOutOn()
{
this.className = 'TB_Button_On' ;
}
 
function FCKToolbarButton_OnMouseOverOff()
{
this.className = 'TB_Button_Off_Over' ;
}
 
function FCKToolbarButton_OnMouseOutOff()
{
this.className = 'TB_Button_Off' ;
}
 
function FCKToolbarButton_OnClick( e )
{
if ( this._FCKButton.OnClick )
this._FCKButton.OnClick( this._FCKButton ) ;
}
 
/*
Sample outputs:
 
This is the base structure. The variation is the image that is marked as {Image}:
<td><div class="TB_Button_On" title="Smiley">{Image}</div></td>
<td><div class="TB_Button_On" title="Smiley"><table cellpadding="0" cellspacing="0"><tr><td>{Image}</td><td nowrap>Toolbar Button</td><td><img class="TB_Button_Padding"></td></tr></table></div></td>
<td><div class="TB_Button_On" title="Smiley"><table cellpadding="0" cellspacing="0"><tr><td><img class="TB_Button_Padding"></td><td nowrap>Toolbar Button</td><td><img class="TB_Button_Padding"></td></tr></table></div></td>
 
These are samples of possible {Image} values:
Strip - IE version:
<div class="TB_Button_Image"><img src="strip.gif" style="top:-16px"></div>
Strip : Firefox, Safari and Opera version
<img class="TB_Button_Image" style="background-position: 0px -16px;background-image: url(strip.gif);">
No-Strip : Browser independent:
<img class="TB_Button_Image" src="smiley.gif">
*/
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/classes/fcktoolbarfontscombo.js
New file
0,0 → 1,43
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktoolbarfontscombo.js
* FCKToolbarPanelButton Class: Handles the Fonts combo selector.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKToolbarFontsCombo = function( tooltip, style )
{
this.CommandName = 'FontName' ;
this.Label = this.GetLabel() ;
this.Tooltip = tooltip ? tooltip : this.Label ;
this.Style = style ? style : FCK_TOOLBARITEM_ICONTEXT ;
}
 
// Inherit from FCKToolbarSpecialCombo.
FCKToolbarFontsCombo.prototype = new FCKToolbarSpecialCombo ;
 
 
FCKToolbarFontsCombo.prototype.GetLabel = function()
{
return FCKLang.Font ;
}
 
FCKToolbarFontsCombo.prototype.CreateItems = function( targetSpecialCombo )
{
var aFonts = FCKConfig.FontNames.split(';') ;
for ( var i = 0 ; i < aFonts.length ; i++ )
this._Combo.AddItem( aFonts[i], '<font face="' + aFonts[i] + '" style="font-size: 12px">' + aFonts[i] + '</font>' ) ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/classes/fckplugin.js
New file
0,0 → 1,52
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckplugin.js
* FCKPlugin Class: Represents a single plugin.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKPlugin = function( name, availableLangs, basePath )
{
this.Name = name ;
this.BasePath = basePath ? basePath : FCKConfig.PluginsPath ;
this.Path = this.BasePath + name + '/' ;
if ( !availableLangs || availableLangs.length == 0 )
this.AvailableLangs = new Array() ;
else
this.AvailableLangs = availableLangs.split(',') ;
}
 
FCKPlugin.prototype.Load = function()
{
// Load the language file, if defined.
if ( this.AvailableLangs.length > 0 )
{
var sLang ;
// Check if the plugin has the language file for the active language.
if ( this.AvailableLangs.indexOf( FCKLanguageManager.ActiveLanguage.Code ) >= 0 )
sLang = FCKLanguageManager.ActiveLanguage.Code ;
else
// Load the default language file (first one) if the current one is not available.
sLang = this.AvailableLangs[0] ;
// Add the main plugin script.
LoadScript( this.Path + 'lang/' + sLang + '.js' ) ;
}
// Add the main plugin script.
LoadScript( this.Path + 'fckplugin.js' ) ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/classes/fcktoolbarbutton.js
New file
0,0 → 1,70
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktoolbarbutton.js
* FCKToolbarButton Class: represents a button in the toolbar.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKToolbarButton = function( commandName, label, tooltip, style, sourceView, contextSensitive, icon )
{
this.CommandName = commandName ;
this.Label = label ;
this.Tooltip = tooltip ;
this.Style = style ;
this.SourceView = sourceView ? true : false ;
this.ContextSensitive = contextSensitive ? true : false ;
 
if ( icon == null )
this.IconPath = FCKConfig.SkinPath + 'toolbar/' + commandName.toLowerCase() + '.gif' ;
else if ( typeof( icon ) == 'number' )
this.IconPath = [ FCKConfig.SkinPath + 'fck_strip.gif', 16, icon ] ;
}
 
FCKToolbarButton.prototype.Create = function( targetElement )
{
this._UIButton = new FCKToolbarButtonUI( this.CommandName, this.Label, this.Tooltip, this.IconPath, this.Style ) ;
this._UIButton.OnClick = this.Click ;
this._UIButton._ToolbarButton = this ;
this._UIButton.Create( targetElement ) ;
}
 
FCKToolbarButton.prototype.RefreshState = function()
{
// Gets the actual state.
var eState = FCK.ToolbarSet.CurrentInstance.Commands.GetCommand( this.CommandName ).GetState() ;
// If there are no state changes than do nothing and return.
if ( eState == this._UIButton.State ) return ;
// Sets the actual state.
this._UIButton.ChangeState( eState ) ;
}
 
FCKToolbarButton.prototype.Click = function()
{
var oToolbarButton = this._ToolbarButton || this ;
FCK.ToolbarSet.CurrentInstance.Commands.GetCommand( oToolbarButton.CommandName ).Execute() ;
}
 
FCKToolbarButton.prototype.Enable = function()
{
this.RefreshState() ;
}
 
FCKToolbarButton.prototype.Disable = function()
{
// Sets the actual state.
this._UIButton.ChangeState( FCK_TRISTATE_DISABLED ) ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/classes/fckpanel.js
New file
0,0 → 1,295
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckpanel.js
* Component that creates floating panels. It is used by many
* other components, like the toolbar items, context menu, etc...
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
 
var FCKPanel = function( parentWindow )
{
this.IsRTL = ( FCKLang.Dir == 'rtl' ) ;
this.IsContextMenu = false ;
this._LockCounter = 0 ;
this._Window = parentWindow || window ;
var oDocument ;
if ( FCKBrowserInfo.IsIE )
{
// Create the Popup that will hold the panel.
this._Popup = this._Window.createPopup() ;
oDocument = this.Document = this._Popup.document ;
}
else
{
var oIFrame = this._IFrame = this._Window.document.createElement('iframe') ;
oIFrame.src = 'javascript:void(0)' ;
oIFrame.allowTransparency = true ;
oIFrame.frameBorder = '0' ;
oIFrame.scrolling = 'no' ;
oIFrame.style.position = 'absolute';
oIFrame.style.zIndex = FCKConfig.FloatingPanelsZIndex ;
oIFrame.width = oIFrame.height = 0 ;
 
if ( this._Window == window.parent && window.frameElement )
window.frameElement.parentNode.insertBefore( oIFrame, window.frameElement ) ;
else
this._Window.document.body.appendChild( oIFrame ) ;
var oIFrameWindow = oIFrame.contentWindow ;
oDocument = this.Document = oIFrameWindow.document ;
 
// Initialize the IFRAME document body.
oDocument.open() ;
oDocument.write( '<html><head></head><body style="margin:0px;padding:0px;"><\/body><\/html>' ) ;
oDocument.close() ;
 
FCKTools.AddEventListenerEx( oIFrameWindow, 'focus', FCKPanel_Window_OnFocus, this ) ;
FCKTools.AddEventListenerEx( oIFrameWindow, 'blur', FCKPanel_Window_OnBlur, this ) ;
}
 
oDocument.dir = FCKLang.Dir ;
oDocument.oncontextmenu = FCKTools.CancelEvent ;
 
 
// Create the main DIV that is used as the panel base.
this.MainNode = oDocument.body.appendChild( oDocument.createElement('DIV') ) ;
 
// The "float" property must be set so Firefox calculates the size correcly.
this.MainNode.style.cssFloat = this.IsRTL ? 'right' : 'left' ;
 
if ( FCK.IECleanup )
FCK.IECleanup.AddItem( this, FCKPanel_Cleanup ) ;
}
 
 
FCKPanel.prototype.AppendStyleSheet = function( styleSheet )
{
FCKTools.AppendStyleSheet( this.Document, styleSheet ) ;
}
 
FCKPanel.prototype.Preload = function( x, y, relElement )
{
// The offsetWidth and offsetHeight properties are not available if the
// element is not visible. So we must "show" the popup with no size to
// be able to use that values in the second call (IE only).
if ( this._Popup )
this._Popup.show( x, y, 0, 0, relElement ) ;
}
 
FCKPanel.prototype.Show = function( x, y, relElement, width, height )
{
if ( this._Popup )
{
// The offsetWidth and offsetHeight properties are not available if the
// element is not visible. So we must "show" the popup with no size to
// be able to use that values in the second call.
this._Popup.show( x, y, 0, 0, relElement ) ;
 
// The following lines must be place after the above "show", otherwise it
// doesn't has the desired effect.
this.MainNode.style.width = width ? width + 'px' : '' ;
this.MainNode.style.height = height ? height + 'px' : '' ;
var iMainWidth = this.MainNode.offsetWidth ;
 
if ( this.IsRTL )
{
if ( this.IsContextMenu )
x = x - iMainWidth + 1 ;
else if ( relElement )
x = ( x * -1 ) + relElement.offsetWidth - iMainWidth ;
}
// Second call: Show the Popup at the specified location, with the correct size.
this._Popup.show( x, y, iMainWidth, this.MainNode.offsetHeight, relElement ) ;
if ( this.OnHide )
{
if ( this._Timer )
CheckPopupOnHide.call( this, true ) ;
 
this._Timer = FCKTools.SetInterval( CheckPopupOnHide, 100, this ) ;
}
}
else
{
// Do not fire OnBlur while the panel is opened.
if ( typeof( FCKFocusManager ) != 'undefined' )
FCKFocusManager.Lock() ;
 
if ( this.ParentPanel )
this.ParentPanel.Lock() ;
 
this.MainNode.style.width = width ? width + 'px' : '' ;
this.MainNode.style.height = height ? height + 'px' : '' ;
 
var iMainWidth = this.MainNode.offsetWidth ;
 
if ( !width ) this._IFrame.width = 1 ;
if ( !height ) this._IFrame.height = 1 ;
 
// This is weird... but with Firefox, we must get the offsetWidth before
// setting the _IFrame size (which returns "0"), and then after that,
// to return the correct width. Remove the first step and it will not
// work when the editor is in RTL.
iMainWidth = this.MainNode.offsetWidth ;
 
var oPos = FCKTools.GetElementPosition( ( relElement.nodeType == 9 ? relElement.body : relElement), this._Window ) ;
 
if ( this.IsRTL && !this.IsContextMenu )
x = ( x * -1 ) ;
 
x += oPos.X ;
y += oPos.Y ;
 
if ( this.IsRTL )
{
if ( this.IsContextMenu )
x = x - iMainWidth + 1 ;
else if ( relElement )
x = x + relElement.offsetWidth - iMainWidth ;
}
else
{
var oViewPaneSize = FCKTools.GetViewPaneSize( this._Window ) ;
var oScrollPosition = FCKTools.GetScrollPosition( this._Window ) ;
var iViewPaneHeight = oViewPaneSize.Height + oScrollPosition.Y ;
var iViewPaneWidth = oViewPaneSize.Width + oScrollPosition.X ;
 
if ( ( x + iMainWidth ) > iViewPaneWidth )
x -= x + iMainWidth - iViewPaneWidth ;
 
if ( ( y + this.MainNode.offsetHeight ) > iViewPaneHeight )
y -= y + this.MainNode.offsetHeight - iViewPaneHeight ;
}
if ( x < 0 )
x = 0 ;
 
// Set the context menu DIV in the specified location.
this._IFrame.style.left = x + 'px' ;
this._IFrame.style.top = y + 'px' ;
var iWidth = iMainWidth ;
var iHeight = this.MainNode.offsetHeight ;
this._IFrame.width = iWidth ;
this._IFrame.height = iHeight ;
 
// Move the focus to the IFRAME so we catch the "onblur".
this._IFrame.contentWindow.focus() ;
}
 
this._IsOpened = true ;
 
FCKTools.RunFunction( this.OnShow, this ) ;
}
 
FCKPanel.prototype.Hide = function( ignoreOnHide )
{
if ( this._Popup )
this._Popup.hide() ;
else
{
if ( !this._IsOpened )
return ;
// Enable the editor to fire the "OnBlur".
if ( typeof( FCKFocusManager ) != 'undefined' )
FCKFocusManager.Unlock() ;
 
// It is better to set the sizes to 0, otherwise Firefox would have
// rendering problems.
this._IFrame.width = this._IFrame.height = 0 ;
 
this._IsOpened = false ;
if ( this.ParentPanel )
this.ParentPanel.Unlock() ;
 
if ( !ignoreOnHide )
FCKTools.RunFunction( this.OnHide, this ) ;
}
}
 
FCKPanel.prototype.CheckIsOpened = function()
{
if ( this._Popup )
return this._Popup.isOpen ;
else
return this._IsOpened ;
}
 
FCKPanel.prototype.CreateChildPanel = function()
{
var oWindow = this._Popup ? FCKTools.GetParentWindow( this.Document ) : this._Window ;
 
var oChildPanel = new FCKPanel( oWindow, true ) ;
oChildPanel.ParentPanel = this ;
return oChildPanel ;
}
 
FCKPanel.prototype.Lock = function()
{
this._LockCounter++ ;
}
 
FCKPanel.prototype.Unlock = function()
{
if ( --this._LockCounter == 0 && !this.HasFocus )
this.Hide() ;
}
 
/* Events */
 
function FCKPanel_Window_OnFocus( e, panel )
{
panel.HasFocus = true ;
}
 
function FCKPanel_Window_OnBlur( e, panel )
{
panel.HasFocus = false ;
if ( panel._LockCounter == 0 )
FCKTools.RunFunction( panel.Hide, panel ) ;
}
 
function CheckPopupOnHide( forceHide )
{
if ( forceHide || !this._Popup.isOpen )
{
window.clearInterval( this._Timer ) ;
this._Timer = null ;
FCKTools.RunFunction( this.OnHide, this ) ;
}
}
 
function FCKPanel_Cleanup()
{
this._Popup = null ;
this._Window = null ;
this.Document = null ;
this.MainNode = null ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/classes/fckmenublockpanel.js
New file
0,0 → 1,51
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckmenublockpanel.js
* This class is a menu block that behaves like a panel. It's a mix of the
* FCKMenuBlock and FCKPanel classes.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
 
var FCKMenuBlockPanel = function()
{
// Call the "base" constructor.
FCKMenuBlock.call( this ) ;
}
 
FCKMenuBlockPanel.prototype = new FCKMenuBlock() ;
 
 
// Override the create method.
FCKMenuBlockPanel.prototype.Create = function()
{
var oPanel = this.Panel = ( this.Parent && this.Parent.Panel ? this.Parent.Panel.CreateChildPanel() : new FCKPanel() ) ;
oPanel.AppendStyleSheet( FCKConfig.SkinPath + 'fck_editor.css' ) ;
 
// Call the "base" implementation.
FCKMenuBlock.prototype.Create.call( this, oPanel.MainNode ) ;
}
 
FCKMenuBlockPanel.prototype.Show = function( x, y, relElement )
{
if ( !this.Panel.CheckIsOpened() )
this.Panel.Show( x, y, relElement ) ;
}
 
FCKMenuBlockPanel.prototype.Hide = function()
{
if ( this.Panel.CheckIsOpened() )
this.Panel.Hide() ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/classes/fckspecialcombo.js
New file
0,0 → 1,351
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckspecialcombo.js
* FCKSpecialCombo Class: represents a special combo.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKSpecialCombo = function( caption, fieldWidth, panelWidth, panelMaxHeight, parentWindow )
{
// Default properties values.
this.FieldWidth = fieldWidth || 100 ;
this.PanelWidth = panelWidth || 150 ;
this.PanelMaxHeight = panelMaxHeight || 150 ;
this.Label = '&nbsp;' ;
this.Caption = caption ;
this.Tooltip = caption ;
this.Style = FCK_TOOLBARITEM_ICONTEXT ;
 
this.Enabled = true ;
this.Items = new Object() ;
this._Panel = new FCKPanel( parentWindow || window, true ) ;
this._Panel.AppendStyleSheet( FCKConfig.SkinPath + 'fck_editor.css' ) ;
this._PanelBox = this._Panel.MainNode.appendChild( this._Panel.Document.createElement( 'DIV' ) ) ;
this._PanelBox.className = 'SC_Panel' ;
this._PanelBox.style.width = this.PanelWidth + 'px' ;
 
this._PanelBox.innerHTML = '<table cellpadding="0" cellspacing="0" width="100%" style="TABLE-LAYOUT: fixed"><tr><td nowrap></td></tr></table>' ;
this._ItemsHolderEl = this._PanelBox.getElementsByTagName('TD')[0] ;
 
if ( FCK.IECleanup )
FCK.IECleanup.AddItem( this, FCKSpecialCombo_Cleanup ) ;
 
// this._Panel.StyleSheet = FCKConfig.SkinPath + 'fck_contextmenu.css' ;
// this._Panel.Create() ;
// this._Panel.PanelDiv.className += ' SC_Panel' ;
// this._Panel.PanelDiv.innerHTML = '<table cellpadding="0" cellspacing="0" width="100%" style="TABLE-LAYOUT: fixed"><tr><td nowrap></td></tr></table>' ;
// this._ItemsHolderEl = this._Panel.PanelDiv.getElementsByTagName('TD')[0] ;
}
 
function FCKSpecialCombo_ItemOnMouseOver()
{
this.className += ' SC_ItemOver' ;
}
 
function FCKSpecialCombo_ItemOnMouseOut()
{
this.className = this.originalClass ;
}
 
function FCKSpecialCombo_ItemOnClick()
{
this.className = this.originalClass ;
 
this.FCKSpecialCombo._Panel.Hide() ;
 
this.FCKSpecialCombo.SetLabel( this.FCKItemLabel ) ;
 
if ( typeof( this.FCKSpecialCombo.OnSelect ) == 'function' )
this.FCKSpecialCombo.OnSelect( this.FCKItemID, this ) ;
}
 
FCKSpecialCombo.prototype.AddItem = function( id, html, label, bgColor )
{
// <div class="SC_Item" onmouseover="this.className='SC_Item SC_ItemOver';" onmouseout="this.className='SC_Item';"><b>Bold 1</b></div>
var oDiv = this._ItemsHolderEl.appendChild( this._Panel.Document.createElement( 'DIV' ) ) ;
oDiv.className = oDiv.originalClass = 'SC_Item' ;
oDiv.innerHTML = html ;
oDiv.FCKItemID = id ;
oDiv.FCKItemLabel = label || id ;
oDiv.FCKSpecialCombo = this ;
oDiv.Selected = false ;
 
// In IE, the width must be set so the borders are shown correctly when the content overflows.
if ( FCKBrowserInfo.IsIE )
oDiv.style.width = '100%' ;
if ( bgColor )
oDiv.style.backgroundColor = bgColor ;
 
oDiv.onmouseover = FCKSpecialCombo_ItemOnMouseOver ;
oDiv.onmouseout = FCKSpecialCombo_ItemOnMouseOut ;
oDiv.onclick = FCKSpecialCombo_ItemOnClick ;
this.Items[ id.toString().toLowerCase() ] = oDiv ;
return oDiv ;
}
 
FCKSpecialCombo.prototype.SelectItem = function( itemId )
{
itemId = itemId ? itemId.toString().toLowerCase() : '' ;
var oDiv = this.Items[ itemId ] ;
if ( oDiv )
{
oDiv.className = oDiv.originalClass = 'SC_ItemSelected' ;
oDiv.Selected = true ;
}
}
 
FCKSpecialCombo.prototype.SelectItemByLabel = function( itemLabel, setLabel )
{
for ( var id in this.Items )
{
var oDiv = this.Items[id] ;
 
if ( oDiv.FCKItemLabel == itemLabel )
{
oDiv.className = oDiv.originalClass = 'SC_ItemSelected' ;
oDiv.Selected = true ;
if ( setLabel )
this.SetLabel( itemLabel ) ;
}
}
}
 
FCKSpecialCombo.prototype.DeselectAll = function( clearLabel )
{
for ( var i in this.Items )
{
this.Items[i].className = this.Items[i].originalClass = 'SC_Item' ;
this.Items[i].Selected = false ;
}
if ( clearLabel )
this.SetLabel( '' ) ;
}
 
FCKSpecialCombo.prototype.SetLabelById = function( id )
{
id = id ? id.toString().toLowerCase() : '' ;
var oDiv = this.Items[ id ] ;
this.SetLabel( oDiv ? oDiv.FCKItemLabel : '' ) ;
}
 
FCKSpecialCombo.prototype.SetLabel = function( text )
{
this.Label = text.length == 0 ? '&nbsp;' : text ;
 
if ( this._LabelEl )
this._LabelEl.innerHTML = this.Label ;
}
 
FCKSpecialCombo.prototype.SetEnabled = function( isEnabled )
{
this.Enabled = isEnabled ;
this._OuterTable.className = isEnabled ? '' : 'SC_FieldDisabled' ;
}
 
FCKSpecialCombo.prototype.Create = function( targetElement )
{
var oDoc = FCKTools.GetElementDocument( targetElement ) ;
var eOuterTable = this._OuterTable = targetElement.appendChild( oDoc.createElement( 'TABLE' ) ) ;
eOuterTable.cellPadding = 0 ;
eOuterTable.cellSpacing = 0 ;
eOuterTable.insertRow(-1) ;
var sClass ;
var bShowLabel ;
switch ( this.Style )
{
case FCK_TOOLBARITEM_ONLYICON :
sClass = 'TB_ButtonType_Icon' ;
bShowLabel = false;
break ;
case FCK_TOOLBARITEM_ONLYTEXT :
sClass = 'TB_ButtonType_Text' ;
bShowLabel = false;
break ;
case FCK_TOOLBARITEM_ICONTEXT :
bShowLabel = true;
break ;
}
 
if ( this.Caption && this.Caption.length > 0 && bShowLabel )
{
var oCaptionCell = eOuterTable.rows[0].insertCell(-1) ;
oCaptionCell.innerHTML = this.Caption ;
oCaptionCell.className = 'SC_FieldCaption' ;
}
// Create the main DIV element.
var oField = FCKTools.AppendElement( eOuterTable.rows[0].insertCell(-1), 'div' ) ;
if ( bShowLabel )
{
oField.className = 'SC_Field' ;
oField.style.width = this.FieldWidth + 'px' ;
oField.innerHTML = '<table width="100%" cellpadding="0" cellspacing="0" style="TABLE-LAYOUT: fixed;"><tbody><tr><td class="SC_FieldLabel"><label>&nbsp;</label></td><td class="SC_FieldButton">&nbsp;</td></tr></tbody></table>' ;
 
this._LabelEl = oField.getElementsByTagName('label')[0] ; // Memory Leak
this._LabelEl.innerHTML = this.Label ;
}
else
{
oField.className = 'TB_Button_Off' ;
//oField.innerHTML = '<span className="SC_FieldCaption">' + this.Caption + '<table cellpadding="0" cellspacing="0" style="TABLE-LAYOUT: fixed;"><tbody><tr><td class="SC_FieldButton" style="border-left: none;">&nbsp;</td></tr></tbody></table>' ;
//oField.innerHTML = '<table cellpadding="0" cellspacing="0" style="TABLE-LAYOUT: fixed;"><tbody><tr><td class="SC_FieldButton" style="border-left: none;">&nbsp;</td></tr></tbody></table>' ;
// Gets the correct CSS class to use for the specified style (param).
oField.innerHTML = '<table title="' + this.Tooltip + '" class="' + sClass + '" cellspacing="0" cellpadding="0" border="0">' +
'<tr>' +
//'<td class="TB_Icon"><img src="' + FCKConfig.SkinPath + 'toolbar/' + this.Command.Name.toLowerCase() + '.gif" width="21" height="21"></td>' +
'<td><img class="TB_Button_Padding" src="' + FCK_SPACER_PATH + '" /></td>' +
'<td class="TB_Text">' + this.Caption + '</td>' +
'<td><img class="TB_Button_Padding" src="' + FCK_SPACER_PATH + '" /></td>' +
'<td class="TB_ButtonArrow"><img src="' + FCKConfig.SkinPath + 'images/toolbar.buttonarrow.gif" width="5" height="3"></td>' +
'<td><img class="TB_Button_Padding" src="' + FCK_SPACER_PATH + '" /></td>' +
'</tr>' +
'</table>' ;
}
 
 
// Events Handlers
 
oField.SpecialCombo = this ;
oField.onmouseover = FCKSpecialCombo_OnMouseOver ;
oField.onmouseout = FCKSpecialCombo_OnMouseOut ;
oField.onclick = FCKSpecialCombo_OnClick ;
FCKTools.DisableSelection( this._Panel.Document.body ) ;
}
 
function FCKSpecialCombo_Cleanup()
{
this._LabelEl = null ;
this._OuterTable = null ;
this._ItemsHolderEl = null ;
this._PanelBox = null ;
if ( this.Items )
{
for ( var key in this.Items )
this.Items[key] = null ;
}
}
 
function FCKSpecialCombo_OnMouseOver()
{
if ( this.SpecialCombo.Enabled )
{
switch ( this.SpecialCombo.Style )
{
case FCK_TOOLBARITEM_ONLYICON :
this.className = 'TB_Button_On_Over';
break ;
case FCK_TOOLBARITEM_ONLYTEXT :
this.className = 'TB_Button_On_Over';
break ;
case FCK_TOOLBARITEM_ICONTEXT :
this.className = 'SC_Field SC_FieldOver' ;
break ;
}
}
}
function FCKSpecialCombo_OnMouseOut()
{
switch ( this.SpecialCombo.Style )
{
case FCK_TOOLBARITEM_ONLYICON :
this.className = 'TB_Button_Off';
break ;
case FCK_TOOLBARITEM_ONLYTEXT :
this.className = 'TB_Button_Off';
break ;
case FCK_TOOLBARITEM_ICONTEXT :
this.className='SC_Field' ;
break ;
}
}
function FCKSpecialCombo_OnClick( e )
{
// For Mozilla we must stop the event propagation to avoid it hiding
// the panel because of a click outside of it.
// if ( e )
// {
// e.stopPropagation() ;
// FCKPanelEventHandlers.OnDocumentClick( e ) ;
// }
var oSpecialCombo = this.SpecialCombo ;
 
if ( oSpecialCombo.Enabled )
{
var oPanel = oSpecialCombo._Panel ;
var oPanelBox = oSpecialCombo._PanelBox ;
var oItemsHolder = oSpecialCombo._ItemsHolderEl ;
var iMaxHeight = oSpecialCombo.PanelMaxHeight ;
if ( oSpecialCombo.OnBeforeClick )
oSpecialCombo.OnBeforeClick( oSpecialCombo ) ;
 
// This is a tricky thing. We must call the "Load" function, otherwise
// it will not be possible to retrieve "oItemsHolder.offsetHeight" (IE only).
if ( FCKBrowserInfo.IsIE )
oPanel.Preload( 0, this.offsetHeight, this ) ;
 
if ( oItemsHolder.offsetHeight > iMaxHeight )
// {
oPanelBox.style.height = iMaxHeight + 'px' ;
 
// if ( FCKBrowserInfo.IsGecko )
// oPanelBox.style.overflow = '-moz-scrollbars-vertical' ;
// }
else
oPanelBox.style.height = '' ;
// oPanel.PanelDiv.style.width = oSpecialCombo.PanelWidth + 'px' ;
 
oPanel.Show( 0, this.offsetHeight, this ) ;
}
 
// return false ;
}
 
/*
Sample Combo Field HTML output:
 
<div class="SC_Field" style="width: 80px;">
<table width="100%" cellpadding="0" cellspacing="0" style="table-layout: fixed;">
<tbody>
<tr>
<td class="SC_FieldLabel"><label>&nbsp;</label></td>
<td class="SC_FieldButton">&nbsp;</td>
</tr>
</tbody>
</table>
</div>
*/
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/classes/fcktoolbar.js
New file
0,0 → 1,116
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktoolbar.js
* FCKToolbar Class: represents a toolbar in the toolbarset. It is a group of
* toolbar items.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKToolbar = function()
{
this.Items = new Array() ;
 
if ( FCK.IECleanup )
FCK.IECleanup.AddItem( this, FCKToolbar_Cleanup ) ;
}
 
FCKToolbar.prototype.AddItem = function( item )
{
return this.Items[ this.Items.length ] = item ;
}
 
FCKToolbar.prototype.AddButton = function( name, label, tooltip, iconPathOrStripInfoArrayOrIndex, style, state )
{
if ( typeof( iconPathOrStripInfoArrayOrIndex ) == 'number' )
iconPathOrStripInfoArrayOrIndex = [ this.DefaultIconsStrip, this.DefaultIconSize, iconPathOrStripInfoArrayOrIndex ] ;
 
var oButton = new FCKToolbarButtonUI( name, label, tooltip, iconPathOrStripInfoArrayOrIndex, style, state ) ;
oButton._FCKToolbar = this ;
oButton.OnClick = FCKToolbar_OnItemClick ;
return this.AddItem( oButton ) ;
}
 
function FCKToolbar_OnItemClick( item )
{
var oToolbar = item._FCKToolbar ;
if ( oToolbar.OnItemClick )
oToolbar.OnItemClick( oToolbar, item ) ;
}
 
FCKToolbar.prototype.AddSeparator = function()
{
this.AddItem( new FCKToolbarSeparator() ) ;
}
 
FCKToolbar.prototype.Create = function( parentElement )
{
if ( this.MainElement )
{
// this._Cleanup() ;
if ( this.MainElement.parentNode )
this.MainElement.parentNode.removeChild( this.MainElement ) ;
this.MainElement = null ;
}
 
var oDoc = FCKTools.GetElementDocument( parentElement ) ;
 
var e = this.MainElement = oDoc.createElement( 'table' ) ;
e.className = 'TB_Toolbar' ;
e.style.styleFloat = e.style.cssFloat = ( FCKLang.Dir == 'ltr' ? 'left' : 'right' ) ;
e.dir = FCKLang.Dir ;
e.cellPadding = 0 ;
e.cellSpacing = 0 ;
this.RowElement = e.insertRow(-1) ;
// Insert the start cell.
var eCell ;
if ( !this.HideStart )
{
eCell = this.RowElement.insertCell(-1) ;
eCell.appendChild( oDoc.createElement( 'div' ) ).className = 'TB_Start' ;
}
for ( var i = 0 ; i < this.Items.length ; i++ )
{
this.Items[i].Create( this.RowElement.insertCell(-1) ) ;
}
// Insert the ending cell.
if ( !this.HideEnd )
{
eCell = this.RowElement.insertCell(-1) ;
eCell.appendChild( oDoc.createElement( 'div' ) ).className = 'TB_End' ;
}
 
parentElement.appendChild( e ) ;
}
 
function FCKToolbar_Cleanup()
{
this.MainElement = null ;
this.RowElement = null ;
}
 
var FCKToolbarSeparator = function()
{}
 
FCKToolbarSeparator.prototype.Create = function( parentElement )
{
FCKTools.AppendElement( parentElement, 'div' ).className = 'TB_Separator' ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/classes/fcktoolbarstylecombo.js
New file
0,0 → 1,99
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktoolbarstylecombo.js
* FCKToolbarPanelButton Class: Handles the Fonts combo selector.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKToolbarStyleCombo = function( tooltip, style )
{
this.CommandName = 'Style' ;
this.Label = this.GetLabel() ;
this.Tooltip = tooltip ? tooltip : this.Label ;
this.Style = style ? style : FCK_TOOLBARITEM_ICONTEXT ;
}
 
// Inherit from FCKToolbarSpecialCombo.
FCKToolbarStyleCombo.prototype = new FCKToolbarSpecialCombo ;
 
 
FCKToolbarStyleCombo.prototype.GetLabel = function()
{
return FCKLang.Style ;
}
 
FCKToolbarStyleCombo.prototype.CreateItems = function( targetSpecialCombo )
{
var oTargetDoc = targetSpecialCombo._Panel.Document ;
// Add the Editor Area CSS to the panel so the style classes are previewed correctly.
FCKTools.AppendStyleSheet( oTargetDoc, FCKConfig.ToolbarComboPreviewCSS ) ;
oTargetDoc.body.className += ' ForceBaseFont' ;
 
// For some reason Gecko is blocking inside the "RefreshVisibleItems" function.
if ( ! FCKBrowserInfo.IsGecko )
targetSpecialCombo.OnBeforeClick = this.RefreshVisibleItems ;
 
// Add the styles to the special combo.
var aCommandStyles = FCK.ToolbarSet.CurrentInstance.Commands.GetCommand( this.CommandName ).Styles ;
for ( var s in aCommandStyles )
{
var oStyle = aCommandStyles[s] ;
var oItem ;
if ( oStyle.IsObjectElement )
oItem = targetSpecialCombo.AddItem( s, s ) ;
else
oItem = targetSpecialCombo.AddItem( s, oStyle.GetOpenerTag() + s + oStyle.GetCloserTag() ) ;
oItem.Style = oStyle ;
}
}
 
FCKToolbarStyleCombo.prototype.RefreshActiveItems = function( targetSpecialCombo )
{
// Clear the actual selection.
targetSpecialCombo.DeselectAll() ;
// Get the active styles.
var aStyles = FCK.ToolbarSet.CurrentInstance.Commands.GetCommand( this.CommandName ).GetActiveStyles() ;
if ( aStyles.length > 0 )
{
// Select the active styles in the combo.
for ( var i = 0 ; i < aStyles.length ; i++ )
targetSpecialCombo.SelectItem( aStyles[i].Name ) ;
 
// Set the combo label to the first style in the collection.
targetSpecialCombo.SetLabelById( aStyles[0].Name ) ;
}
else
targetSpecialCombo.SetLabel('') ;
}
 
FCKToolbarStyleCombo.prototype.RefreshVisibleItems = function( targetSpecialCombo )
{
if ( FCKSelection.GetType() == 'Control' )
var sTagName = FCKSelection.GetSelectedElement().tagName ;
 
for ( var i in targetSpecialCombo.Items )
{
var oItem = targetSpecialCombo.Items[i] ;
if ( ( sTagName && oItem.Style.Element == sTagName ) || ( ! sTagName && ! oItem.Style.IsObjectElement ) )
oItem.style.display = '' ;
else
oItem.style.display = 'none' ; // For some reason Gecko is blocking here.
}
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/classes/fckevents.js
New file
0,0 → 1,51
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckevents.js
* FCKEvents Class: used to handle events is a advanced way.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKEvents ;
 
FCKEvents = function( eventsOwner )
{
this.Owner = eventsOwner ;
this.RegisteredEvents = new Object() ;
}
 
FCKEvents.prototype.AttachEvent = function( eventName, functionPointer )
{
var aTargets ;
 
if ( !( aTargets = this.RegisteredEvents[ eventName ] ) )
this.RegisteredEvents[ eventName ] = [ functionPointer ] ;
else
aTargets.push( functionPointer ) ;
}
 
FCKEvents.prototype.FireEvent = function( eventName, params )
{
var bReturnValue = true ;
 
var oCalls = this.RegisteredEvents[ eventName ] ;
 
if ( oCalls )
{
for ( var i = 0 ; i < oCalls.length ; i++ )
bReturnValue = ( oCalls[ i ]( this.Owner, params ) && bReturnValue ) ;
}
 
return bReturnValue ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/classes/fcktoolbarfontsizecombo.js
New file
0,0 → 1,48
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktoolbarfontsizecombo.js
* FCKToolbarPanelButton Class: Handles the Fonts combo selector.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKToolbarFontSizeCombo = function( tooltip, style )
{
this.CommandName = 'FontSize' ;
this.Label = this.GetLabel() ;
this.Tooltip = tooltip ? tooltip : this.Label ;
this.Style = style ? style : FCK_TOOLBARITEM_ICONTEXT ;
}
 
// Inherit from FCKToolbarSpecialCombo.
FCKToolbarFontSizeCombo.prototype = new FCKToolbarSpecialCombo ;
 
 
FCKToolbarFontSizeCombo.prototype.GetLabel = function()
{
return FCKLang.FontSize ;
}
 
FCKToolbarFontSizeCombo.prototype.CreateItems = function( targetSpecialCombo )
{
targetSpecialCombo.FieldWidth = 70 ;
var aSizes = FCKConfig.FontSizes.split(';') ;
for ( var i = 0 ; i < aSizes.length ; i++ )
{
var aSizeParts = aSizes[i].split('/') ;
this._Combo.AddItem( aSizeParts[0], '<font size="' + aSizeParts[0] + '">' + aSizeParts[1] + '</font>', aSizeParts[1] ) ;
}
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/classes/fckiecleanup.js
New file
0,0 → 1,51
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckiecleanup.js
* FCKIECleanup Class: a generic class used as a tool to remove IE leaks.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
 
var FCKIECleanup = function( attachWindow )
{
 
this.Items = new Array() ;
 
attachWindow._FCKCleanupObj = this ;
attachWindow.attachEvent( 'onunload', FCKIECleanup_Cleanup ) ;
}
FCKIECleanup.prototype.AddItem = function( dirtyItem, cleanupFunction )
{
this.Items.push( [ dirtyItem, cleanupFunction ] ) ;
}
function FCKIECleanup_Cleanup()
{
var aItems = this._FCKCleanupObj.Items ;
var iLenght = aItems.length ;
 
for ( var i = 0 ; i < iLenght ; i++ )
{
var oItem = aItems[i] ;
oItem[1].call( oItem[0] ) ;
aItems[i] = null ;
}
this._FCKCleanupObj = null ;
if ( CollectGarbage )
CollectGarbage() ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/classes/fckxml_gecko.js
New file
0,0 → 1,66
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckxml_gecko.js
* FCKXml Class: class to load and manipulate XML files.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKXml = function()
{}
 
FCKXml.prototype.LoadUrl = function( urlToCall )
{
var oFCKXml = this ;
 
var oXmlHttp = FCKTools.CreateXmlObject( 'XmlHttp' ) ;
oXmlHttp.open( "GET", urlToCall, false ) ;
oXmlHttp.send( null ) ;
if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 )
this.DOMDocument = oXmlHttp.responseXML ;
else if ( oXmlHttp.status == 0 && oXmlHttp.readyState == 4 )
this.DOMDocument = oXmlHttp.responseXML ;
else
alert( 'Error loading "' + urlToCall + '"' ) ;
}
 
FCKXml.prototype.SelectNodes = function( xpath, contextNode )
{
var aNodeArray = new Array();
 
var xPathResult = this.DOMDocument.evaluate( xpath, contextNode ? contextNode : this.DOMDocument,
this.DOMDocument.createNSResolver(this.DOMDocument.documentElement), XPathResult.ORDERED_NODE_ITERATOR_TYPE, null) ;
if ( xPathResult )
{
var oNode = xPathResult.iterateNext() ;
while( oNode )
{
aNodeArray[aNodeArray.length] = oNode ;
oNode = xPathResult.iterateNext();
}
}
return aNodeArray ;
}
 
FCKXml.prototype.SelectSingleNode = function( xpath, contextNode )
{
var xPathResult = this.DOMDocument.evaluate( xpath, contextNode ? contextNode : this.DOMDocument,
this.DOMDocument.createNSResolver(this.DOMDocument.documentElement), 9, null);
 
if ( xPathResult && xPathResult.singleNodeValue )
return xPathResult.singleNodeValue ;
else
return null ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/classes/fckcontextmenu.js
New file
0,0 → 1,123
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckcontextmenu.js
* FCKContextMenu Class: renders an control a context menu.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKContextMenu = function( parentWindow, mouseClickWindow, langDir )
{
var oPanel = this._Panel = new FCKPanel( parentWindow, true ) ;
oPanel.AppendStyleSheet( FCKConfig.SkinPath + 'fck_editor.css' ) ;
oPanel.IsContextMenu = true ;
var oMenuBlock = this._MenuBlock = new FCKMenuBlock() ;
oMenuBlock.Panel = oPanel ;
oMenuBlock.OnClick = FCKTools.CreateEventListener( FCKContextMenu_MenuBlock_OnClick, this ) ;
this._Redraw = true ;
this.SetMouseClickWindow( mouseClickWindow || parentWindow ) ;
}
 
 
FCKContextMenu.prototype.SetMouseClickWindow = function( mouseClickWindow )
{
if ( !FCKBrowserInfo.IsIE )
{
this._Document = mouseClickWindow.document ;
this._Document.addEventListener( 'contextmenu', FCKContextMenu_Document_OnContextMenu, false ) ;
}
}
 
FCKContextMenu.prototype.AddItem = function( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled )
{
var oItem = this._MenuBlock.AddItem( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled) ;
this._Redraw = true ;
return oItem ;
}
 
FCKContextMenu.prototype.AddSeparator = function()
{
this._MenuBlock.AddSeparator() ;
this._Redraw = true ;
}
 
FCKContextMenu.prototype.RemoveAllItems = function()
{
this._MenuBlock.RemoveAllItems() ;
this._Redraw = true ;
}
 
FCKContextMenu.prototype.AttachToElement = function( element )
{
if ( FCKBrowserInfo.IsIE )
FCKTools.AddEventListenerEx( element, 'contextmenu', FCKContextMenu_AttachedElement_OnContextMenu, this ) ;
else
element._FCKContextMenu = this ;
 
// element.onmouseup = FCKContextMenu_AttachedElement_OnMouseUp ;
}
 
function FCKContextMenu_Document_OnContextMenu( e )
{
var el = e.target ;
while ( el )
{
if ( el._FCKContextMenu )
{
FCKTools.CancelEvent( e ) ;
FCKContextMenu_AttachedElement_OnContextMenu( e, el._FCKContextMenu, el ) ;
}
el = el.parentNode ;
}
}
 
function FCKContextMenu_AttachedElement_OnContextMenu( ev, fckContextMenu, el )
{
// var iButton = e ? e.which - 1 : event.button ;
 
// if ( iButton != 2 )
// return ;
 
var eTarget = el || this ;
 
if ( fckContextMenu.OnBeforeOpen )
fckContextMenu.OnBeforeOpen.call( fckContextMenu, eTarget ) ;
 
if ( fckContextMenu._MenuBlock.Count() == 0 )
return false ;
if ( fckContextMenu._Redraw )
{
fckContextMenu._MenuBlock.Create( fckContextMenu._Panel.MainNode ) ;
fckContextMenu._Redraw = false ;
}
 
fckContextMenu._Panel.Show(
ev.pageX || ev.screenX,
ev.pageY || ev.screenY,
ev.currentTarget || null
) ;
return false ;
}
 
function FCKContextMenu_MenuBlock_OnClick( menuItem, contextMenu )
{
contextMenu._Panel.Hide() ;
FCKTools.RunFunction( contextMenu.OnItemClick, contextMenu, menuItem ) ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/classes/fckstylesloader.js
New file
0,0 → 1,84
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckstylesloader.js
* FCKStylesLoader Class: this class define objects that are responsible
* for loading the styles defined in the XML file.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKStylesLoader = function()
{
this.Styles = new Object() ;
this.StyleGroups = new Object() ;
this.Loaded = false ;
this.HasObjectElements = false ;
}
 
FCKStylesLoader.prototype.Load = function( stylesXmlUrl )
{
// Load the XML file into a FCKXml object.
var oXml = new FCKXml() ;
oXml.LoadUrl( stylesXmlUrl ) ;
// Get the "Style" nodes defined in the XML file.
var aStyleNodes = oXml.SelectNodes( 'Styles/Style' ) ;
// Add each style to our "Styles" collection.
for ( var i = 0 ; i < aStyleNodes.length ; i++ )
{
var sElement = aStyleNodes[i].attributes.getNamedItem('element').value.toUpperCase() ;
// Create the style definition object.
var oStyleDef = new FCKStyleDef( aStyleNodes[i].attributes.getNamedItem('name').value, sElement ) ;
if ( oStyleDef.IsObjectElement )
this.HasObjectElements = true ;
// Get the attributes defined for the style (if any).
var aAttNodes = oXml.SelectNodes( 'Attribute', aStyleNodes[i] ) ;
// Add the attributes to the style definition object.
for ( var j = 0 ; j < aAttNodes.length ; j++ )
{
var sAttName = aAttNodes[j].attributes.getNamedItem('name').value ;
var sAttValue = aAttNodes[j].attributes.getNamedItem('value').value ;
 
// IE changes the "style" attribute value when applied to an element
// so we must get the final resulting value (for comparision issues).
if ( sAttName.toLowerCase() == 'style' )
{
var oTempE = document.createElement( 'SPAN' ) ;
oTempE.style.cssText = sAttValue ;
sAttValue = oTempE.style.cssText ;
}
oStyleDef.AddAttribute( sAttName, sAttValue ) ;
}
 
// Add the style to the "Styles" collection using it's name as the key.
this.Styles[ oStyleDef.Name ] = oStyleDef ;
// Add the style to the "StyleGroups" collection.
var aGroup = this.StyleGroups[sElement] ;
if ( aGroup == null )
{
this.StyleGroups[sElement] = new Array() ;
aGroup = this.StyleGroups[sElement] ;
}
aGroup[aGroup.length] = oStyleDef ;
}
this.Loaded = true ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/classes/fckeditingarea.js
New file
0,0 → 1,190
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckeditingarea.js
* FCKEditingArea Class: renders an editable area.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
/**
* @constructor
* @param {String} targetElement The element that will hold the editing area. Any child element present in the target will be deleted.
*/
var FCKEditingArea = function( targetElement )
{
this.TargetElement = targetElement ;
this.Mode = FCK_EDITMODE_WYSIWYG ;
 
if ( FCK.IECleanup )
FCK.IECleanup.AddItem( this, FCKEditingArea_Cleanup ) ;
}
 
 
/**
* @param {String} html The complete HTML for the page, including DOCTYPE and the <html> tag.
*/
FCKEditingArea.prototype.Start = function( html, secondCall )
{
var eTargetElement = this.TargetElement ;
var oTargetDocument = FCKTools.GetElementDocument( eTargetElement ) ;
// Remove all child nodes from the target.
while( eTargetElement.childNodes.length > 0 )
eTargetElement.removeChild( eTargetElement.childNodes[0] ) ;
 
if ( this.Mode == FCK_EDITMODE_WYSIWYG )
{
if ( FCKBrowserInfo.IsGecko )
html = html.replace( /(<body[^>]*>)\s*(<\/body>)/i, '$1' + GECKO_BOGUS + '$2' ) ;
// Create the editing area IFRAME.
var oIFrame = this.IFrame = oTargetDocument.createElement( 'iframe' ) ;
oIFrame.src = 'javascript:void(0)' ;
oIFrame.frameBorder = 0 ;
oIFrame.width = oIFrame.height = '100%' ;
// Append the new IFRAME to the target.
eTargetElement.appendChild( oIFrame ) ;
// IE has a bug with the <base> tag... it must have a </base> closer,
// otherwise the all sucessive tags will be set as children nodes of the <base>.
if ( FCKBrowserInfo.IsIE )
html = html.replace( /(<base[^>]*?)\s*\/?>(?!\s*<\/base>)/gi, '$1></base>' ) ;
 
// Get the window and document objects used to interact with the newly created IFRAME.
this.Window = oIFrame.contentWindow ;
// IE: Avoid JavaScript errors thrown by the editing are source (like tags events).
// TODO: This error handler is not being fired.
// this.Window.onerror = function() { alert( 'Error!' ) ; return true ; }
 
var oDoc = this.Document = this.Window.document ;
oDoc.open() ;
oDoc.write( html ) ;
oDoc.close() ;
// Firefox 1.0.x is buggy... ohh yes... so let's do it two times and it
// will magicaly work.
if ( FCKBrowserInfo.IsGecko10 && !secondCall )
{
this.Start( html, true ) ;
return ;
}
this.Window._FCKEditingArea = this ;
// FF 1.0.x is buggy... we must wait a lot to enable editing because
// sometimes the content simply disappears, for example when pasting
// "bla1!<img src='some_url'>!bla2" in the source and then switching
// back to design.
if ( FCKBrowserInfo.IsGecko10 )
this.Window.setTimeout( FCKEditingArea_CompleteStart, 500 ) ;
else
FCKEditingArea_CompleteStart.call( this.Window ) ;
}
else
{
var eTextarea = this.Textarea = oTargetDocument.createElement( 'textarea' ) ;
eTextarea.className = 'SourceField' ;
eTextarea.dir = 'ltr' ;
eTextarea.style.width = eTextarea.style.height = '100%' ;
eTextarea.style.border = 'none' ;
eTargetElement.appendChild( eTextarea ) ;
 
eTextarea.value = html ;
 
// Fire the "OnLoad" event.
FCKTools.RunFunction( this.OnLoad ) ;
}
}
 
// "this" here is FCKEditingArea.Window
function FCKEditingArea_CompleteStart()
{
// Of Firefox, the DOM takes a little to become available. So we must wait for it in a loop.
if ( !this.document.body )
{
this.setTimeout( FCKEditingArea_CompleteStart, 50 ) ;
return ;
}
var oEditorArea = this._FCKEditingArea ;
oEditorArea.MakeEditable() ;
// Fire the "OnLoad" event.
FCKTools.RunFunction( oEditorArea.OnLoad ) ;
}
 
FCKEditingArea.prototype.MakeEditable = function()
{
var oDoc = this.Document ;
 
if ( FCKBrowserInfo.IsIE )
oDoc.body.contentEditable = true ;
else
{
try
{
oDoc.designMode = 'on' ;
 
// Tell Gecko to use or not the <SPAN> tag for the bold, italic and underline.
oDoc.execCommand( 'useCSS', false, !FCKConfig.GeckoUseSPAN ) ;
 
// Analysing Firefox 1.5 source code, it seams that there is support for a
// "insertBrOnReturn" command. Applying it gives no error, but it doesn't
// gives the same behavior that you have with IE. It works only if you are
// already inside a paragraph and it doesn't render correctly in the first enter.
// oDoc.execCommand( 'insertBrOnReturn', false, false ) ;
 
// Tell Gecko (Firefox 1.5+) to enable or not live resizing of objects (by Alfonso Martinez)
oDoc.execCommand( 'enableObjectResizing', false, !FCKConfig.DisableObjectResizing ) ;
// Disable the standard table editing features of Firefox.
oDoc.execCommand( 'enableInlineTableEditing', false, !FCKConfig.DisableFFTableHandles ) ;
}
catch (e) {}
}
}
 
FCKEditingArea.prototype.Focus = function()
{
try
{
if ( this.Mode == FCK_EDITMODE_WYSIWYG )
{
if ( FCKBrowserInfo.IsSafari )
this.IFrame.focus() ;
else
this.Window.focus() ;
}
else
this.Textarea.focus() ;
}
catch(e) {}
}
 
function FCKEditingArea_Cleanup()
{
this.TargetElement = null ;
this.IFrame = null ;
this.Document = null ;
this.Textarea = null ;
if ( this.Window )
{
this.Window._FCKEditingArea = null ;
this.Window = null ;
}
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/classes/fckxml_ie.js
New file
0,0 → 1,78
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckxml_ie.js
* FCKXml Class: class to load and manipulate XML files.
* (IE specific implementation)
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKXml = function()
{
this.Error = false ;
}
 
FCKXml.prototype.LoadUrl = function( urlToCall )
{
this.Error = false ;
 
var oXmlHttp = FCKTools.CreateXmlObject( 'XmlHttp' ) ;
 
if ( !oXmlHttp )
{
this.Error = true ;
return ;
}
 
oXmlHttp.open( "GET", urlToCall, false ) ;
oXmlHttp.send( null ) ;
if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 )
this.DOMDocument = oXmlHttp.responseXML ;
else if ( oXmlHttp.status == 0 && oXmlHttp.readyState == 4 )
{
this.DOMDocument = FCKTools.CreateXmlObject( 'DOMDocument' ) ;
this.DOMDocument.async = false ;
this.DOMDocument.resolveExternals = false ;
this.DOMDocument.loadXML( oXmlHttp.responseText ) ;
}
else
{
this.Error = true ;
alert( 'Error loading "' + urlToCall + '"' ) ;
}
}
 
FCKXml.prototype.SelectNodes = function( xpath, contextNode )
{
if ( this.Error )
return new Array() ;
 
if ( contextNode )
return contextNode.selectNodes( xpath ) ;
else
return this.DOMDocument.selectNodes( xpath ) ;
}
 
FCKXml.prototype.SelectSingleNode = function( xpath, contextNode )
{
if ( this.Error )
return ;
if ( contextNode )
return contextNode.selectSingleNode( xpath ) ;
else
return this.DOMDocument.selectSingleNode( xpath ) ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/classes/fcktoolbarpanelbutton.js
New file
0,0 → 1,87
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktoolbarpanelbutton.js
* FCKToolbarPanelButton Class: represents a special button in the toolbar
* that shows a panel when pressed.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKToolbarPanelButton = function( commandName, label, tooltip, style, icon )
{
this.CommandName = commandName ;
 
var oIcon ;
if ( icon == null )
oIcon = FCKConfig.SkinPath + 'toolbar/' + commandName.toLowerCase() + '.gif' ;
else if ( typeof( icon ) == 'number' )
oIcon = [ FCKConfig.SkinPath + 'fck_strip.gif', 16, icon ] ;
var oUIButton = this._UIButton = new FCKToolbarButtonUI( commandName, label, tooltip, oIcon, style ) ;
oUIButton._FCKToolbarPanelButton = this ;
oUIButton.ShowArrow = true ;
oUIButton.OnClick = FCKToolbarPanelButton_OnButtonClick ;
}
 
FCKToolbarPanelButton.prototype.TypeName = 'FCKToolbarPanelButton' ;
 
FCKToolbarPanelButton.prototype.Create = function( parentElement )
{
parentElement.className += 'Menu' ;
 
this._UIButton.Create( parentElement ) ;
var oPanel = FCK.ToolbarSet.CurrentInstance.Commands.GetCommand( this.CommandName )._Panel ;
oPanel._FCKToolbarPanelButton = this ;
var eLineDiv = oPanel.Document.body.appendChild( oPanel.Document.createElement( 'div' ) ) ;
eLineDiv.style.position = 'absolute' ;
eLineDiv.style.top = '0px' ;
var eLine = this.LineImg = eLineDiv.appendChild( oPanel.Document.createElement( 'IMG' ) ) ;
eLine.className = 'TB_ConnectionLine' ;
// eLine.style.backgroundColor = 'Red' ;
eLine.src = FCK_SPACER_PATH ;
 
oPanel.OnHide = FCKToolbarPanelButton_OnPanelHide ;
}
 
/*
Events
*/
 
function FCKToolbarPanelButton_OnButtonClick( toolbarButton )
{
var oButton = this._FCKToolbarPanelButton ;
var e = oButton._UIButton.MainElement ;
oButton._UIButton.ChangeState( FCK_TRISTATE_ON ) ;
oButton.LineImg.style.width = ( e.offsetWidth - 2 ) + 'px' ;
 
FCK.ToolbarSet.CurrentInstance.Commands.GetCommand( oButton.CommandName ).Execute( 0, e.offsetHeight - 1, e ) ; // -1 to be over the border
}
 
function FCKToolbarPanelButton_OnPanelHide()
{
var oMenuButton = this._FCKToolbarPanelButton ;
oMenuButton._UIButton.ChangeState( FCK_TRISTATE_OFF ) ;
}
 
// The Panel Button works like a normal button so the refresh state functions
// defined for the normal button can be reused here.
FCKToolbarPanelButton.prototype.RefreshState = FCKToolbarButton.prototype.RefreshState ;
FCKToolbarPanelButton.prototype.Enable = FCKToolbarButton.prototype.Enable ;
FCKToolbarPanelButton.prototype.Disable = FCKToolbarButton.prototype.Disable ;
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/classes/fcktoolbarbreak_gecko.js
New file
0,0 → 1,32
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktoolbarbreak_gecko.js
* FCKToolbarBreak Class: breaks the toolbars.
* It makes it possible to force the toolbar to break to a new line.
* This is the Gecko specific implementation.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKToolbarBreak = function()
{}
 
FCKToolbarBreak.prototype.Create = function( targetElement )
{
var oBreakDiv = targetElement.ownerDocument.createElement( 'div' ) ;
oBreakDiv.style.clear = oBreakDiv.style.cssFloat = FCKLang.Dir == 'rtl' ? 'right' : 'left' ;
targetElement.appendChild( oBreakDiv ) ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/classes/fckmenublock.js
New file
0,0 → 1,140
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckmenublock.js
* Renders a list of menu items.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
 
var FCKMenuBlock = function()
{
this._Items = new Array() ;
}
 
 
FCKMenuBlock.prototype.Count = function()
{
return this._Items.length ;
}
 
FCKMenuBlock.prototype.AddItem = function( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled )
{
var oItem = new FCKMenuItem( this, name, label, iconPathOrStripInfoArrayOrIndex, isDisabled ) ;
oItem.OnClick = FCKTools.CreateEventListener( FCKMenuBlock_Item_OnClick, this ) ;
oItem.OnActivate = FCKTools.CreateEventListener( FCKMenuBlock_Item_OnActivate, this ) ;
this._Items.push( oItem ) ;
 
return oItem ;
}
 
FCKMenuBlock.prototype.AddSeparator = function()
{
this._Items.push( new FCKMenuSeparator() ) ;
}
 
FCKMenuBlock.prototype.RemoveAllItems = function()
{
this._Items = new Array() ;
var eItemsTable = this._ItemsTable ;
if ( eItemsTable )
{
while ( eItemsTable.rows.length > 0 )
eItemsTable.deleteRow( 0 ) ;
}
}
 
FCKMenuBlock.prototype.Create = function( parentElement )
{
if ( !this._ItemsTable )
{
if ( FCK.IECleanup )
FCK.IECleanup.AddItem( this, FCKMenuBlock_Cleanup ) ;
 
this._Window = FCKTools.GetElementWindow( parentElement ) ;
 
var oDoc = FCKTools.GetElementDocument( parentElement ) ;
 
var eTable = parentElement.appendChild( oDoc.createElement( 'table' ) ) ;
eTable.cellPadding = 0 ;
eTable.cellSpacing = 0 ;
 
FCKTools.DisableSelection( eTable ) ;
var oMainElement = eTable.insertRow(-1).insertCell(-1) ;
oMainElement.className = 'MN_Menu' ;
var eItemsTable = this._ItemsTable = oMainElement.appendChild( oDoc.createElement( 'table' ) ) ;
eItemsTable.cellPadding = 0 ;
eItemsTable.cellSpacing = 0 ;
}
for ( var i = 0 ; i < this._Items.length ; i++ )
this._Items[i].Create( this._ItemsTable ) ;
}
 
/* Events */
 
function FCKMenuBlock_Item_OnClick( clickedItem, menuBlock )
{
FCKTools.RunFunction( menuBlock.OnClick, menuBlock, [ clickedItem ] ) ;
}
 
function FCKMenuBlock_Item_OnActivate( menuBlock )
{
var oActiveItem = menuBlock._ActiveItem ;
if ( oActiveItem && oActiveItem != this )
{
// Set the focus to this menu block window (to fire OnBlur on opened panels).
if ( !FCKBrowserInfo.IsIE && oActiveItem.HasSubMenu && !this.HasSubMenu )
menuBlock._Window.focus() ;
 
oActiveItem.Deactivate() ;
}
 
menuBlock._ActiveItem = this ;
}
 
function FCKMenuBlock_Cleanup()
{
this._Window = null ;
this._ItemsTable = null ;
}
 
// ################# //
 
var FCKMenuSeparator = function()
{}
 
FCKMenuSeparator.prototype.Create = function( parentTable )
{
var oDoc = FCKTools.GetElementDocument( parentTable ) ;
 
var r = parentTable.insertRow(-1) ;
var eCell = r.insertCell(-1) ;
eCell.className = 'MN_Separator MN_Icon' ;
 
eCell = r.insertCell(-1) ;
eCell.className = 'MN_Separator' ;
eCell.appendChild( oDoc.createElement( 'DIV' ) ).className = 'MN_Separator_Line' ;
 
eCell = r.insertCell(-1) ;
eCell.className = 'MN_Separator' ;
eCell.appendChild( oDoc.createElement( 'DIV' ) ).className = 'MN_Separator_Line' ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/classes/fckstyledef.js
New file
0,0 → 1,55
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckstyledef.js
* FCKStyleDef Class: represents a single style definition.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKStyleDef = function( name, element )
{
this.Name = name ;
this.Element = element.toUpperCase() ;
this.IsObjectElement = FCKRegexLib.ObjectElements.test( this.Element ) ;
this.Attributes = new Object() ;
}
 
FCKStyleDef.prototype.AddAttribute = function( name, value )
{
this.Attributes[ name ] = value ;
}
 
FCKStyleDef.prototype.GetOpenerTag = function()
{
var s = '<' + this.Element ;
for ( var a in this.Attributes )
s += ' ' + a + '="' + this.Attributes[a] + '"' ;
return s + '>' ;
}
 
FCKStyleDef.prototype.GetCloserTag = function()
{
return '</' + this.Element + '>' ;
}
 
 
FCKStyleDef.prototype.RemoveFromSelection = function()
{
if ( FCKSelection.GetType() == 'Control' )
this._RemoveMe( FCK.ToolbarSet.CurrentInstance.Selection.GetSelectedElement() ) ;
else
this._RemoveMe( FCK.ToolbarSet.CurrentInstance.Selection.GetParentElement() ) ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/classes/fcktoolbarfontformatcombo.js
New file
0,0 → 1,102
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktoolbarfontformatcombo.js
* FCKToolbarPanelButton Class: Handles the Fonts combo selector.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKToolbarFontFormatCombo = function( tooltip, style )
{
this.CommandName = 'FontFormat' ;
this.Label = this.GetLabel() ;
this.Tooltip = tooltip ? tooltip : this.Label ;
this.Style = style ? style : FCK_TOOLBARITEM_ICONTEXT ;
this.NormalLabel = 'Normal' ;
this.PanelWidth = 190 ;
}
 
// Inherit from FCKToolbarSpecialCombo.
FCKToolbarFontFormatCombo.prototype = new FCKToolbarSpecialCombo ;
 
 
FCKToolbarFontFormatCombo.prototype.GetLabel = function()
{
return FCKLang.FontFormat ;
}
 
FCKToolbarFontFormatCombo.prototype.CreateItems = function( targetSpecialCombo )
{
// Add the Editor Area CSS to the panel to create a realistic preview.
FCKTools.AppendStyleSheet( targetSpecialCombo._Panel.Document, FCKConfig.ToolbarComboPreviewCSS ) ;
 
// Get the format names from the language file.
var aNames = FCKLang['FontFormats'].split(';') ;
var oNames = {
p : aNames[0],
pre : aNames[1],
address : aNames[2],
h1 : aNames[3],
h2 : aNames[4],
h3 : aNames[5],
h4 : aNames[6],
h5 : aNames[7],
h6 : aNames[8],
div : aNames[9]
} ;
 
// Get the available formats from the configuration file.
var aTags = FCKConfig.FontFormats.split(';') ;
for ( var i = 0 ; i < aTags.length ; i++ )
{
// Support for DIV in Firefox has been reintroduced on version 2.2.
// if ( aTags[i] == 'div' && FCKBrowserInfo.IsGecko )
// continue ;
var sTag = aTags[i] ;
var sLabel = oNames[sTag] ;
if ( sTag == 'p' )
this.NormalLabel = sLabel ;
this._Combo.AddItem( sTag, '<div class="BaseFont"><' + sTag + '>' + sLabel + '</' + sTag + '></div>', sLabel ) ;
}
}
 
if ( FCKBrowserInfo.IsIE )
{
FCKToolbarFontFormatCombo.prototype.RefreshActiveItems = function( combo, value )
{
// FCKDebug.Output( 'FCKToolbarFontFormatCombo Value: ' + value ) ;
 
// IE returns normal for DIV and P, so to avoid confusion, we will not show it if normal.
if ( value == this.NormalLabel )
{
if ( combo.Label != '&nbsp;' )
combo.DeselectAll(true) ;
}
else
{
if ( this._LastValue == value )
return ;
 
combo.SelectItemByLabel( value, true ) ;
}
 
this._LastValue = value ;
}
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/classes/fcktoolbarspecialcombo.js
New file
0,0 → 1,129
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktoolbarspecialcombo.js
* FCKToolbarSpecialCombo Class: This is a "abstract" base class to be used
* by the special combo toolbar elements like font name, font size, paragraph format, etc...
*
* The following properties and methods must be implemented when inheriting from
* this class:
* - Property: CommandName [ The command name to be executed ]
* - Method: GetLabel() [ Returns the label ]
* - CreateItems( targetSpecialCombo ) [ Add all items in the special combo ]
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKToolbarSpecialCombo = function()
{
this.SourceView = false ;
this.ContextSensitive = true ;
}
 
 
function FCKToolbarSpecialCombo_OnSelect( itemId, item )
{
FCK.ToolbarSet.CurrentInstance.Commands.GetCommand( this.CommandName ).Execute( itemId, item ) ;
}
 
FCKToolbarSpecialCombo.prototype.Create = function( targetElement )
{
this._Combo = new FCKSpecialCombo( this.GetLabel(), this.FieldWidth, this.PanelWidth, this.PanelMaxHeight, FCKBrowserInfo.IsIE ? window : FCKTools.GetElementWindow( targetElement ).parent ) ;
/*
this._Combo.FieldWidth = this.FieldWidth != null ? this.FieldWidth : 100 ;
this._Combo.PanelWidth = this.PanelWidth != null ? this.PanelWidth : 150 ;
this._Combo.PanelMaxHeight = this.PanelMaxHeight != null ? this.PanelMaxHeight : 150 ;
*/
//this._Combo.Command.Name = this.Command.Name;
// this._Combo.Label = this.Label ;
this._Combo.Tooltip = this.Tooltip ;
this._Combo.Style = this.Style ;
this.CreateItems( this._Combo ) ;
 
this._Combo.Create( targetElement ) ;
 
this._Combo.CommandName = this.CommandName ;
this._Combo.OnSelect = FCKToolbarSpecialCombo_OnSelect ;
}
 
function FCKToolbarSpecialCombo_RefreshActiveItems( combo, value )
{
combo.DeselectAll() ;
combo.SelectItem( value ) ;
combo.SetLabelById( value ) ;
}
 
FCKToolbarSpecialCombo.prototype.RefreshState = function()
{
// Gets the actual state.
var eState ;
// if ( FCK.EditMode == FCK_EDITMODE_SOURCE && ! this.SourceView )
// eState = FCK_TRISTATE_DISABLED ;
// else
// {
var sValue = FCK.ToolbarSet.CurrentInstance.Commands.GetCommand( this.CommandName ).GetState() ;
 
// FCKDebug.Output( 'RefreshState of Special Combo "' + this.TypeOf + '" - State: ' + sValue ) ;
 
if ( sValue != FCK_TRISTATE_DISABLED )
{
eState = FCK_TRISTATE_ON ;
if ( this.RefreshActiveItems )
this.RefreshActiveItems( this._Combo, sValue ) ;
else
{
if ( this._LastValue != sValue )
{
this._LastValue = sValue ;
FCKToolbarSpecialCombo_RefreshActiveItems( this._Combo, sValue ) ;
}
}
}
else
eState = FCK_TRISTATE_DISABLED ;
// }
// If there are no state changes then do nothing and return.
if ( eState == this.State ) return ;
if ( eState == FCK_TRISTATE_DISABLED )
{
this._Combo.DeselectAll() ;
this._Combo.SetLabel( '' ) ;
}
 
// Sets the actual state.
this.State = eState ;
 
// Updates the graphical state.
this._Combo.SetEnabled( eState != FCK_TRISTATE_DISABLED ) ;
}
 
FCKToolbarSpecialCombo.prototype.Enable = function()
{
this.RefreshState() ;
}
 
FCKToolbarSpecialCombo.prototype.Disable = function()
{
this.State = FCK_TRISTATE_DISABLED ;
this._Combo.DeselectAll() ;
this._Combo.SetLabel( '' ) ;
this._Combo.SetEnabled( false ) ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/classes/fckmenuitem.js
New file
0,0 → 1,157
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckmenuitem.js
* Defines and renders a menu items in a menu block.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
 
var FCKMenuItem = function( parentMenuBlock, name, label, iconPathOrStripInfoArray, isDisabled )
{
this.Name = name ;
this.Label = label || name ;
this.IsDisabled = isDisabled ;
this.Icon = new FCKIcon( iconPathOrStripInfoArray ) ;
this.SubMenu = new FCKMenuBlockPanel() ;
this.SubMenu.Parent = parentMenuBlock ;
this.SubMenu.OnClick = FCKTools.CreateEventListener( FCKMenuItem_SubMenu_OnClick, this ) ;
 
if ( FCK.IECleanup )
FCK.IECleanup.AddItem( this, FCKMenuItem_Cleanup ) ;
}
 
 
FCKMenuItem.prototype.AddItem = function( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled )
{
this.HasSubMenu = true ;
return this.SubMenu.AddItem( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled ) ;
}
 
FCKMenuItem.prototype.AddSeparator = function()
{
this.SubMenu.AddSeparator() ;
}
 
FCKMenuItem.prototype.Create = function( parentTable )
{
var bHasSubMenu = this.HasSubMenu ;
var oDoc = FCKTools.GetElementDocument( parentTable ) ;
 
// Add a row in the table to hold the menu item.
var r = this.MainElement = parentTable.insertRow(-1) ;
r.className = this.IsDisabled ? 'MN_Item_Disabled' : 'MN_Item' ;
 
// Set the row behavior.
if ( !this.IsDisabled )
{
FCKTools.AddEventListenerEx( r, 'mouseover', FCKMenuItem_OnMouseOver, [ this ] ) ;
FCKTools.AddEventListenerEx( r, 'click', FCKMenuItem_OnClick, [ this ] ) ;
 
if ( !bHasSubMenu )
FCKTools.AddEventListenerEx( r, 'mouseout', FCKMenuItem_OnMouseOut, [ this ] ) ;
}
// Create the icon cell.
var eCell = r.insertCell(-1) ;
eCell.className = 'MN_Icon' ;
eCell.appendChild( this.Icon.CreateIconElement( oDoc ) ) ;
 
// Create the label cell.
eCell = r.insertCell(-1) ;
eCell.className = 'MN_Label' ;
eCell.noWrap = true ;
eCell.appendChild( oDoc.createTextNode( this.Label ) ) ;
// Create the arrow cell and setup the sub menu panel (if needed).
eCell = r.insertCell(-1) ;
if ( bHasSubMenu )
{
eCell.className = 'MN_Arrow' ;
 
// The arrow is a fixed size image.
var eArrowImg = eCell.appendChild( oDoc.createElement( 'IMG' ) ) ;
eArrowImg.src = FCK_IMAGES_PATH + 'arrow_' + FCKLang.Dir + '.gif' ;
eArrowImg.width = 4 ;
eArrowImg.height = 7 ;
this.SubMenu.Create() ;
this.SubMenu.Panel.OnHide = FCKTools.CreateEventListener( FCKMenuItem_SubMenu_OnHide, this ) ;
}
}
 
FCKMenuItem.prototype.Activate = function()
{
this.MainElement.className = 'MN_Item_Over' ;
 
if ( this.HasSubMenu )
{
// Show the child menu block. The ( +2, -2 ) correction is done because
// of the padding in the skin. It is not a good solution because one
// could change the skin and so the final result would not be accurate.
// For now it is ok because we are controlling the skin.
this.SubMenu.Show( this.MainElement.offsetWidth + 2, -2, this.MainElement ) ;
}
 
FCKTools.RunFunction( this.OnActivate, this ) ;
}
 
FCKMenuItem.prototype.Deactivate = function()
{
this.MainElement.className = 'MN_Item' ;
 
if ( this.HasSubMenu )
this.SubMenu.Hide() ;
}
 
/* Events */
 
function FCKMenuItem_SubMenu_OnClick( clickedItem, listeningItem )
{
FCKTools.RunFunction( listeningItem.OnClick, listeningItem, [ clickedItem ] ) ;
}
 
function FCKMenuItem_SubMenu_OnHide( menuItem )
{
menuItem.Deactivate() ;
}
 
function FCKMenuItem_OnClick( ev, menuItem )
{
if ( menuItem.HasSubMenu )
menuItem.Activate() ;
else
{
menuItem.Deactivate() ;
FCKTools.RunFunction( menuItem.OnClick, menuItem, [ menuItem ] ) ;
}
}
 
function FCKMenuItem_OnMouseOver( ev, menuItem )
{
menuItem.Activate() ;
}
 
function FCKMenuItem_OnMouseOut( ev, menuItem )
{
menuItem.Deactivate() ;
}
 
function FCKMenuItem_Cleanup()
{
this.MainElement = null ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/classes/fcktoolbarbreak_ie.js
New file
0,0 → 1,34
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktoolbarbreak_ie.js
* FCKToolbarBreak Class: breaks the toolbars.
* It makes it possible to force the toolbar to brak to a new line.
* This is the IE specific implementation.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKToolbarBreak = function()
{}
 
FCKToolbarBreak.prototype.Create = function( targetElement )
{
var oBreakDiv = FCKTools.GetElementDocument( targetElement ).createElement( 'div' ) ;
oBreakDiv.className = 'TB_Break' ;
oBreakDiv.style.clear = FCKLang.Dir == 'rtl' ? 'left' : 'right' ;
targetElement.appendChild( oBreakDiv ) ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/classes/fckstyledef_gecko.js
New file
0,0 → 1,116
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckstyledef_gecko.js
* FCKStyleDef Class: represents a single stylke definition. (Gecko specific)
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
FCKStyleDef.prototype.ApplyToSelection = function()
{
if ( FCKSelection.GetType() == 'Text' && !this.IsObjectElement )
{
var oSelection = FCK.ToolbarSet.CurrentInstance.EditorWindow.getSelection() ;
// Create the main element.
var e = FCK.ToolbarSet.CurrentInstance.EditorDocument.createElement( this.Element ) ;
for ( var i = 0 ; i < oSelection.rangeCount ; i++ )
{
e.appendChild( oSelection.getRangeAt(i).extractContents() ) ;
}
// Set the attributes.
this._AddAttributes( e ) ;
// Remove the duplicated elements.
this._RemoveDuplicates( e ) ;
 
var oRange = oSelection.getRangeAt(0) ;
oRange.insertNode( e ) ;
}
else
{
var oControl = FCK.ToolbarSet.CurrentInstance.Selection.GetSelectedElement() ;
if ( oControl.tagName == this.Element )
this._AddAttributes( oControl ) ;
}
}
 
FCKStyleDef.prototype._AddAttributes = function( targetElement )
{
for ( var a in this.Attributes )
{
switch ( a.toLowerCase() )
{
case 'src' :
targetElement.setAttribute( '_fcksavedurl', this.Attributes[a], 0 ) ;
default :
targetElement.setAttribute( a, this.Attributes[a], 0 ) ;
}
}
}
 
FCKStyleDef.prototype._RemoveDuplicates = function( parent )
{
for ( var i = 0 ; i < parent.childNodes.length ; i++ )
{
var oChild = parent.childNodes[i] ;
if ( oChild.nodeType != 1 )
continue ;
this._RemoveDuplicates( oChild ) ;
if ( this.IsEqual( oChild ) )
FCKTools.RemoveOuterTags( oChild ) ;
}
}
 
FCKStyleDef.prototype.IsEqual = function( e )
{
if ( e.tagName != this.Element )
return false ;
for ( var a in this.Attributes )
{
if ( e.getAttribute( a ) != this.Attributes[a] )
return false ;
}
return true ;
}
 
FCKStyleDef.prototype._RemoveMe = function( elementToCheck )
{
if ( ! elementToCheck )
return ;
 
var oParent = elementToCheck.parentNode ;
 
if ( elementToCheck.nodeType == 1 && this.IsEqual( elementToCheck ) )
{
if ( this.IsObjectElement )
{
for ( var a in this.Attributes )
elementToCheck.removeAttribute( a, 0 ) ;
return ;
}
else
FCKTools.RemoveOuterTags( elementToCheck ) ;
}
this._RemoveMe( oParent ) ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/classes/fckicon.js
New file
0,0 → 1,94
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckicon.js
* FCKIcon Class: renders an icon from a single image, a strip or even a
* spacer.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKIcon = function( iconPathOrStripInfoArray )
{
var sTypeOf = iconPathOrStripInfoArray ? typeof( iconPathOrStripInfoArray ) : 'undefined' ;
switch ( sTypeOf )
{
case 'number' :
this.Path = FCKConfig.SkinPath + 'fck_strip.gif' ;
this.Size = 16 ;
this.Position = iconPathOrStripInfoArray ;
break ;
case 'undefined' :
this.Path = FCK_SPACER_PATH ;
break ;
case 'string' :
this.Path = iconPathOrStripInfoArray ;
break ;
default :
// It is an array in the format [ StripFilePath, IconSize, IconPosition ]
this.Path = iconPathOrStripInfoArray[0] ;
this.Size = iconPathOrStripInfoArray[1] ;
this.Position = iconPathOrStripInfoArray[2] ;
}
}
 
FCKIcon.prototype.CreateIconElement = function( document )
{
var eIcon ;
if ( this.Position ) // It is using an icons strip image.
{
var sPos = '-' + ( ( this.Position - 1 ) * this.Size ) + 'px' ;
if ( FCKBrowserInfo.IsIE )
{
// <div class="TB_Button_Image"><img src="strip.gif" style="top:-16px"></div>
eIcon = document.createElement( 'DIV' ) ;
var eIconImage = eIcon.appendChild( document.createElement( 'IMG' ) ) ;
eIconImage.src = this.Path ;
eIconImage.style.top = sPos ;
}
else
{
// <img class="TB_Button_Image" src="spacer.gif" style="background-position: 0px -16px;background-image: url(strip.gif);">
eIcon = document.createElement( 'IMG' ) ;
eIcon.src = FCK_SPACER_PATH ;
eIcon.style.backgroundPosition = '0px ' + sPos ;
eIcon.style.backgroundImage = 'url(' + this.Path + ')' ;
}
}
else // It is using a single icon image.
{
// This is not working well with IE. See notes bellow.
// <img class="TB_Button_Image" src="smiley.gif">
// eIcon = document.createElement( 'IMG' ) ;
// eIcon.src = this.Path ? this.Path : FCK_SPACER_PATH ;
 
// IE makes the button 1px higher if using the <img> directly, so we
// are changing to the <div> system to clip the image correctly.
eIcon = document.createElement( 'DIV' ) ;
var eIconImage = eIcon.appendChild( document.createElement( 'IMG' ) ) ;
eIconImage.src = this.Path ? this.Path : FCK_SPACER_PATH ;
}
eIcon.className = 'TB_Button_Image' ;
 
return eIcon ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/fckeditorapi.js
New file
0,0 → 1,104
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckeditorapi.js
* Create the FCKeditorAPI object that is available as a global object in
* the page where the editor is placed in.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKeditorAPI ;
 
function InitializeAPI()
{
if ( !( FCKeditorAPI = window.parent.FCKeditorAPI ) )
{
// Make the FCKeditorAPI object available in the parent window. Use
// eval so it is independent from this window and so it will still be
// available if the editor instance is removed ("Can't execute code
// from a freed script" error).
var sScript = '\
var FCKeditorAPI = {\
Version : \'2.3.2\',\
VersionBuild : \'1082\',\
__Instances : new Object(),\
GetInstance : function( instanceName )\
{\
return this.__Instances[ instanceName ] ;\
},\
_FunctionQueue : {\
Functions : new Array(),\
IsRunning : false,\
Add : function( functionToAdd )\
{\
this.Functions.push( functionToAdd ) ;\
if ( !this.IsRunning )\
this.StartNext() ;\
},\
StartNext : function()\
{\
var aQueue = this.Functions ;\
if ( aQueue.length > 0 )\
{\
this.IsRunning = true ;\
aQueue[0].call() ;\
}\
else\
this.IsRunning = false ;\
},\
Remove : function( func )\
{\
var aQueue = this.Functions ;\
var i = 0, fFunc ;\
while( fFunc = aQueue[ i ] )\
{\
if ( fFunc == func )\
aQueue.splice( i,1 ) ;\
i++ ;\
}\
this.StartNext() ;\
}\
}\
}' ;
// In IE, the "eval" function is not always available (it works with
// the JavaScript samples, but not with the ASP ones, for example).
// So, let's use the execScript instead.
if ( window.parent.execScript )
window.parent.execScript( sScript, 'JavaScript' ) ;
else
{
if ( FCKBrowserInfo.IsGecko10 )
{
// FF 1.0.4 gives an error with the above request. The
// following seams to work well. It could become to official
// implementation for all browsers, but we need to check it.
eval.call( window.parent, sScript ) ;
}
else
window.parent.eval( sScript ) ;
}
FCKeditorAPI = window.parent.FCKeditorAPI ;
}
 
// Add the current instance to the FCKeditorAPI's instances collection.
FCKeditorAPI.__Instances[ FCK.Name ] = FCK ;
}
 
function FCKeditorAPI_Cleanup()
{
FCKeditorAPI.__Instances[ FCK.Name ] = null ;
}
FCKTools.AddEventListener( window, 'unload', FCKeditorAPI_Cleanup ) ;
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fcktoolbaritems.js
New file
0,0 → 1,118
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktoolbaritems.js
* Toolbar items definitions.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKToolbarItems = new Object() ;
FCKToolbarItems.LoadedItems = new Object() ;
 
FCKToolbarItems.RegisterItem = function( itemName, item )
{
this.LoadedItems[ itemName ] = item ;
}
 
FCKToolbarItems.GetItem = function( itemName )
{
var oItem = FCKToolbarItems.LoadedItems[ itemName ] ;
 
if ( oItem )
return oItem ;
 
switch ( itemName )
{
case 'Source' : oItem = new FCKToolbarButton( 'Source' , FCKLang.Source, null, FCK_TOOLBARITEM_ICONTEXT, true, true, 1 ) ; break ;
case 'DocProps' : oItem = new FCKToolbarButton( 'DocProps' , FCKLang.DocProps, null, null, null, null, 2 ) ; break ;
case 'Save' : oItem = new FCKToolbarButton( 'Save' , FCKLang.Save, null, null, true, null, 3 ) ; break ;
case 'NewPage' : oItem = new FCKToolbarButton( 'NewPage' , FCKLang.NewPage, null, null, true, null, 4 ) ; break ;
case 'Preview' : oItem = new FCKToolbarButton( 'Preview' , FCKLang.Preview, null, null, true, null, 5 ) ; break ;
case 'Templates' : oItem = new FCKToolbarButton( 'Templates' , FCKLang.Templates, null, null, null, null, 6 ) ; break ;
case 'About' : oItem = new FCKToolbarButton( 'About' , FCKLang.About, null, null, true, null, 47 ) ; break ;
 
case 'Cut' : oItem = new FCKToolbarButton( 'Cut' , FCKLang.Cut, null, null, false, true, 7 ) ; break ;
case 'Copy' : oItem = new FCKToolbarButton( 'Copy' , FCKLang.Copy, null, null, false, true, 8 ) ; break ;
case 'Paste' : oItem = new FCKToolbarButton( 'Paste' , FCKLang.Paste, null, null, false, true, 9 ) ; break ;
case 'PasteText' : oItem = new FCKToolbarButton( 'PasteText' , FCKLang.PasteText, null, null, false, true, 10 ) ; break ;
case 'PasteWord' : oItem = new FCKToolbarButton( 'PasteWord' , FCKLang.PasteWord, null, null, false, true, 11 ) ; break ;
case 'Print' : oItem = new FCKToolbarButton( 'Print' , FCKLang.Print, null, null, false, true, 12 ) ; break ;
case 'SpellCheck' : oItem = new FCKToolbarButton( 'SpellCheck', FCKLang.SpellCheck, null, null, null, null, 13 ) ; break ;
case 'Undo' : oItem = new FCKToolbarButton( 'Undo' , FCKLang.Undo, null, null, false, true, 14 ) ; break ;
case 'Redo' : oItem = new FCKToolbarButton( 'Redo' , FCKLang.Redo, null, null, false, true, 15 ) ; break ;
case 'SelectAll' : oItem = new FCKToolbarButton( 'SelectAll' , FCKLang.SelectAll, null, null, null, null, 18 ) ; break ;
case 'RemoveFormat' : oItem = new FCKToolbarButton( 'RemoveFormat', FCKLang.RemoveFormat, null, null, false, true, 19 ) ; break ;
case 'FitWindow' : oItem = new FCKToolbarButton( 'FitWindow' , FCKLang.FitWindow, null, null, true, true, 66 ) ; break ;
 
case 'Bold' : oItem = new FCKToolbarButton( 'Bold' , FCKLang.Bold, null, null, false, true, 20 ) ; break ;
case 'Italic' : oItem = new FCKToolbarButton( 'Italic' , FCKLang.Italic, null, null, false, true, 21 ) ; break ;
case 'Underline' : oItem = new FCKToolbarButton( 'Underline' , FCKLang.Underline, null, null, false, true, 22 ) ; break ;
case 'StrikeThrough' : oItem = new FCKToolbarButton( 'StrikeThrough' , FCKLang.StrikeThrough, null, null, false, true, 23 ) ; break ;
case 'Subscript' : oItem = new FCKToolbarButton( 'Subscript' , FCKLang.Subscript, null, null, false, true, 24 ) ; break ;
case 'Superscript' : oItem = new FCKToolbarButton( 'Superscript' , FCKLang.Superscript, null, null, false, true, 25 ) ; break ;
 
case 'OrderedList' : oItem = new FCKToolbarButton( 'InsertOrderedList' , FCKLang.NumberedListLbl, FCKLang.NumberedList, null, false, true, 26 ) ; break ;
case 'UnorderedList' : oItem = new FCKToolbarButton( 'InsertUnorderedList' , FCKLang.BulletedListLbl, FCKLang.BulletedList, null, false, true, 27 ) ; break ;
case 'Outdent' : oItem = new FCKToolbarButton( 'Outdent' , FCKLang.DecreaseIndent, null, null, false, true, 28 ) ; break ;
case 'Indent' : oItem = new FCKToolbarButton( 'Indent' , FCKLang.IncreaseIndent, null, null, false, true, 29 ) ; break ;
 
case 'Link' : oItem = new FCKToolbarButton( 'Link' , FCKLang.InsertLinkLbl, FCKLang.InsertLink, null, false, true, 34 ) ; break ;
case 'Unlink' : oItem = new FCKToolbarButton( 'Unlink' , FCKLang.RemoveLink, null, null, false, true, 35 ) ; break ;
case 'Anchor' : oItem = new FCKToolbarButton( 'Anchor' , FCKLang.Anchor, null, null, null, null, 36 ) ; break ;
 
case 'Image' : oItem = new FCKToolbarButton( 'Image' , FCKLang.InsertImageLbl, FCKLang.InsertImage, null, false, true, 37 ) ; break ;
case 'Flash' : oItem = new FCKToolbarButton( 'Flash' , FCKLang.InsertFlashLbl, FCKLang.InsertFlash, null, false, true, 38 ) ; break ;
case 'Table' : oItem = new FCKToolbarButton( 'Table' , FCKLang.InsertTableLbl, FCKLang.InsertTable, null, false, true, 39 ) ; break ;
case 'SpecialChar' : oItem = new FCKToolbarButton( 'SpecialChar' , FCKLang.InsertSpecialCharLbl, FCKLang.InsertSpecialChar, null, false, true, 42 ) ; break ;
case 'Smiley' : oItem = new FCKToolbarButton( 'Smiley' , FCKLang.InsertSmileyLbl, FCKLang.InsertSmiley, null, false, true, 41 ) ; break ;
case 'PageBreak' : oItem = new FCKToolbarButton( 'PageBreak' , FCKLang.PageBreakLbl, FCKLang.PageBreak, null, false, true, 43 ) ; break ;
case 'UniversalKey' : oItem = new FCKToolbarButton( 'UniversalKey' , FCKLang.UniversalKeyboard , null, null, false, true, 44) ; break ;
 
case 'Rule' : oItem = new FCKToolbarButton( 'InsertHorizontalRule', FCKLang.InsertLineLbl, FCKLang.InsertLine, null, false, true, 40 ) ; break ;
 
case 'JustifyLeft' : oItem = new FCKToolbarButton( 'JustifyLeft' , FCKLang.LeftJustify, null, null, false, true, 30 ) ; break ;
case 'JustifyCenter' : oItem = new FCKToolbarButton( 'JustifyCenter' , FCKLang.CenterJustify, null, null, false, true, 31 ) ; break ;
case 'JustifyRight' : oItem = new FCKToolbarButton( 'JustifyRight' , FCKLang.RightJustify, null, null, false, true, 32 ) ; break ;
case 'JustifyFull' : oItem = new FCKToolbarButton( 'JustifyFull' , FCKLang.BlockJustify, null, null, false, true, 33 ) ; break ;
 
case 'Style' : oItem = new FCKToolbarStyleCombo() ; break ;
case 'FontName' : oItem = new FCKToolbarFontsCombo() ; break ;
case 'FontSize' : oItem = new FCKToolbarFontSizeCombo() ; break ;
case 'FontFormat' : oItem = new FCKToolbarFontFormatCombo() ; break ;
 
case 'TextColor' : oItem = new FCKToolbarPanelButton( 'TextColor', FCKLang.TextColor, null, null, 45 ) ; break ;
case 'BGColor' : oItem = new FCKToolbarPanelButton( 'BGColor' , FCKLang.BGColor, null, null, 46 ) ; break ;
 
case 'Find' : oItem = new FCKToolbarButton( 'Find' , FCKLang.Find, null, null, null, null, 16 ) ; break ;
case 'Replace' : oItem = new FCKToolbarButton( 'Replace' , FCKLang.Replace, null, null, null, null, 17 ) ; break ;
 
case 'Form' : oItem = new FCKToolbarButton( 'Form' , FCKLang.Form, null, null, null, null, 48 ) ; break ;
case 'Checkbox' : oItem = new FCKToolbarButton( 'Checkbox' , FCKLang.Checkbox, null, null, null, null, 49 ) ; break ;
case 'Radio' : oItem = new FCKToolbarButton( 'Radio' , FCKLang.RadioButton, null, null, null, null, 50 ) ; break ;
case 'TextField' : oItem = new FCKToolbarButton( 'TextField' , FCKLang.TextField, null, null, null, null, 51 ) ; break ;
case 'Textarea' : oItem = new FCKToolbarButton( 'Textarea' , FCKLang.Textarea, null, null, null, null, 52 ) ; break ;
case 'HiddenField' : oItem = new FCKToolbarButton( 'HiddenField' , FCKLang.HiddenField, null, null, null, null, 56 ) ; break ;
case 'Button' : oItem = new FCKToolbarButton( 'Button' , FCKLang.Button, null, null, null, null, 54 ) ; break ;
case 'Select' : oItem = new FCKToolbarButton( 'Select' , FCKLang.SelectionField, null, null, null, null, 53 ) ; break ;
case 'ImageButton' : oItem = new FCKToolbarButton( 'ImageButton' , FCKLang.ImageButton, null, null, null, null, 55 ) ; break ;
 
default:
alert( FCKLang.UnknownToolbarItem.replace( /%1/g, itemName ) ) ;
return null ;
}
 
FCKToolbarItems.LoadedItems[ itemName ] = oItem ;
 
return oItem ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fckconfig.js
New file
0,0 → 1,195
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckconfig.js
* Creates and initializes the FCKConfig object.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKConfig = FCK.Config = new Object() ;
 
/*
For the next major version (probably 3.0) we should move all this stuff to
another dedicated object and leave FCKConfig as a holder object for settings only).
*/
 
// Editor Base Path
if ( document.location.protocol == 'file:' )
{
FCKConfig.BasePath = unescape( document.location.pathname.substr(1) ) ;
FCKConfig.BasePath = FCKConfig.BasePath.replace( /\\/gi, '/' ) ;
FCKConfig.BasePath = 'file://' + FCKConfig.BasePath.substring(0,FCKConfig.BasePath.lastIndexOf('/')+1) ;
FCKConfig.FullBasePath = FCKConfig.BasePath ;
}
else
{
FCKConfig.BasePath = document.location.pathname.substring(0,document.location.pathname.lastIndexOf('/')+1) ;
FCKConfig.FullBasePath = document.location.protocol + '//' + document.location.host + FCKConfig.BasePath ;
}
 
FCKConfig.EditorPath = FCKConfig.BasePath.replace( /editor\/$/, '' ) ;
 
// There is a bug in Gecko. If the editor is hidden on startup, an error is
// thrown when trying to get the screen dimentions.
try
{
FCKConfig.ScreenWidth = screen.width ;
FCKConfig.ScreenHeight = screen.height ;
}
catch (e)
{
FCKConfig.ScreenWidth = 800 ;
FCKConfig.ScreenHeight = 600 ;
}
 
// Override the actual configuration values with the values passed throw the
// hidden field "<InstanceName>___Config".
FCKConfig.ProcessHiddenField = function()
{
this.PageConfig = new Object() ;
 
// Get the hidden field.
var oConfigField = window.parent.document.getElementById( FCK.Name + '___Config' ) ;
// Do nothing if the config field was not defined.
if ( ! oConfigField ) return ;
 
var aCouples = oConfigField.value.split('&') ;
 
for ( var i = 0 ; i < aCouples.length ; i++ )
{
if ( aCouples[i].length == 0 )
continue ;
 
var aConfig = aCouples[i].split( '=' ) ;
var sKey = unescape( aConfig[0] ) ;
var sVal = unescape( aConfig[1] ) ;
 
if ( sKey == 'CustomConfigurationsPath' ) // The Custom Config File path must be loaded immediately.
FCKConfig[ sKey ] = sVal ;
 
else if ( sVal.toLowerCase() == "true" ) // If it is a boolean TRUE.
this.PageConfig[ sKey ] = true ;
 
else if ( sVal.toLowerCase() == "false" ) // If it is a boolean FALSE.
this.PageConfig[ sKey ] = false ;
 
else if ( sVal.length > 0 && !isNaN( sVal ) ) // If it is a number.
this.PageConfig[ sKey ] = parseInt( sVal ) ;
 
else // In any other case it is a string.
this.PageConfig[ sKey ] = sVal ;
}
}
 
function FCKConfig_LoadPageConfig()
{
var oPageConfig = FCKConfig.PageConfig ;
for ( var sKey in oPageConfig )
FCKConfig[ sKey ] = oPageConfig[ sKey ] ;
}
 
function FCKConfig_PreProcess()
{
var oConfig = FCKConfig ;
// Force debug mode if fckdebug=true in the QueryString (main page).
if ( oConfig.AllowQueryStringDebug )
{
try
{
if ( (/fckdebug=true/i).test( window.top.location.search ) )
oConfig.Debug = true ;
}
catch (e) { /* Ignore it. Much probably we are inside a FRAME where the "top" is in another domain (security error). */ }
}
 
// Certifies that the "PluginsPath" configuration ends with a slash.
if ( !oConfig.PluginsPath.endsWith('/') )
oConfig.PluginsPath += '/' ;
 
// EditorAreaCSS accepts an array of paths or a single path (as string).
// In the last case, transform it in an array.
if ( typeof( oConfig.EditorAreaCSS ) == 'string' )
oConfig.EditorAreaCSS = [ oConfig.EditorAreaCSS ] ;
 
var sComboPreviewCSS = oConfig.ToolbarComboPreviewCSS ;
if ( !sComboPreviewCSS || sComboPreviewCSS.length == 0 )
oConfig.ToolbarComboPreviewCSS = oConfig.EditorAreaCSS ;
else if ( typeof( sComboPreviewCSS ) == 'string' )
oConfig.ToolbarComboPreviewCSS = [ sComboPreviewCSS ] ;
}
 
// Define toolbar sets collection.
FCKConfig.ToolbarSets = new Object() ;
 
// Defines the plugins collection.
FCKConfig.Plugins = new Object() ;
FCKConfig.Plugins.Items = new Array() ;
 
FCKConfig.Plugins.Add = function( name, langs, path )
{
FCKConfig.Plugins.Items.AddItem( [name, langs, path] ) ;
}
 
// FCKConfig.ProtectedSource: object that holds a collection of Regular
// Expressions that defined parts of the raw HTML that must remain untouched
// like custom tags, scripts, server side code, etc...
FCKConfig.ProtectedSource = new Object() ;
 
// Initialize the regex array with the default ones.
FCKConfig.ProtectedSource.RegexEntries = [
// First of any other protection, we must protect all comments to avoid
// loosing them (of course, IE related).
/<!--[\s\S]*?-->/g ,
 
// Script tags will also be forced to be protected, otherwise IE will execute them.
/<script[\s\S]*?<\/script>/gi,
// <noscript> tags (get lost in IE and messed up in FF).
/<noscript[\s\S]*?<\/noscript>/gi
] ;
 
FCKConfig.ProtectedSource.Add = function( regexPattern )
{
this.RegexEntries.AddItem( regexPattern ) ;
}
 
FCKConfig.ProtectedSource.Protect = function( html )
{
function _Replace( protectedSource )
{
var index = FCKTempBin.AddElement( protectedSource ) ;
return '<!--{PS..' + index + '}-->' ;
}
for ( var i = 0 ; i < this.RegexEntries.length ; i++ )
{
html = html.replace( this.RegexEntries[i], _Replace ) ;
}
return html ;
}
 
FCKConfig.ProtectedSource.Revert = function( html, clearBin )
{
function _Replace( m, opener, index )
{
var protectedValue = clearBin ? FCKTempBin.RemoveElement( index ) : FCKTempBin.Elements[ index ] ;
// There could be protected source inside another one.
return FCKConfig.ProtectedSource.Revert( protectedValue, clearBin ) ;
}
 
return html.replace( /(<|&lt;)!--\{PS..(\d+)\}--(>|&gt;)/g, _Replace ) ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fckurlparams.js
New file
0,0 → 1,32
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckurlparams.js
* Defines the FCKURLParams object that is used to get all parameters
* passed by the URL QueryString (after the "?").
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
// #### URLParams: holds all URL passed parameters (like ?Param1=Value1&Param2=Value2)
var FCKURLParams = new Object() ;
 
var aParams = document.location.search.substr(1).split('&') ;
for ( var i = 0 ; i < aParams.length ; i++ )
{
var aParam = aParams[i].split('=') ;
var sParamName = aParam[0] ;
var sParamValue = aParam[1] ;
 
FCKURLParams[ sParamName ] = sParamValue ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fckdialog_gecko.js
New file
0,0 → 1,101
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckdialog_gecko.js
* Dialog windows operations. (Gecko specific implementations)
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
FCKDialog.Show = function( dialogInfo, dialogName, pageUrl, dialogWidth, dialogHeight, parentWindow, resizable )
{
var iTop = (FCKConfig.ScreenHeight - dialogHeight) / 2 ;
var iLeft = (FCKConfig.ScreenWidth - dialogWidth) / 2 ;
 
var sOption = "location=no,menubar=no,toolbar=no,dependent=yes,dialog=yes,minimizable=no,modal=yes,alwaysRaised=yes" +
",resizable=" + ( resizable ? 'yes' : 'no' ) +
",width=" + dialogWidth +
",height=" + dialogHeight +
",top=" + iTop +
",left=" + iLeft ;
 
if ( !parentWindow )
parentWindow = window ;
FCKFocusManager.Lock() ;
var oWindow = parentWindow.open( '', 'FCKeditorDialog_' + dialogName, sOption, true ) ;
if ( !oWindow )
{
alert( FCKLang.DialogBlocked ) ;
FCKFocusManager.Unlock() ;
return ;
}
oWindow.moveTo( iLeft, iTop ) ;
oWindow.resizeTo( dialogWidth, dialogHeight ) ;
oWindow.focus() ;
oWindow.location.href = pageUrl ;
oWindow.dialogArguments = dialogInfo ;
// On some Gecko browsers (probably over slow connections) the
// "dialogArguments" are not set to the target window so we must
// put it in the opener window so it can be used by the target one.
parentWindow.FCKLastDialogInfo = dialogInfo ;
this.Window = oWindow ;
// Try/Catch must be used to avoit an error when using a frameset
// on a different domain:
// "Permission denied to get property Window.releaseEvents".
try
{
window.top.captureEvents( Event.CLICK | Event.MOUSEDOWN | Event.MOUSEUP | Event.FOCUS ) ;
window.top.parent.addEventListener( 'mousedown', this.CheckFocus, true ) ;
window.top.parent.addEventListener( 'mouseup', this.CheckFocus, true ) ;
window.top.parent.addEventListener( 'click', this.CheckFocus, true ) ;
window.top.parent.addEventListener( 'focus', this.CheckFocus, true ) ;
}
catch (e)
{}
}
 
FCKDialog.CheckFocus = function()
{
// It is strange, but we have to check the FCKDialog existence to avoid a
// random error: "FCKDialog is not defined".
if ( typeof( FCKDialog ) != "object" )
return false ;
if ( FCKDialog.Window && !FCKDialog.Window.closed )
FCKDialog.Window.focus() ;
else
{
// Try/Catch must be used to avoit an error when using a frameset
// on a different domain:
// "Permission denied to get property Window.releaseEvents".
try
{
window.top.releaseEvents(Event.CLICK | Event.MOUSEDOWN | Event.MOUSEUP | Event.FOCUS) ;
window.top.parent.removeEventListener( 'onmousedown', FCKDialog.CheckFocus, true ) ;
window.top.parent.removeEventListener( 'mouseup', FCKDialog.CheckFocus, true ) ;
window.top.parent.removeEventListener( 'click', FCKDialog.CheckFocus, true ) ;
window.top.parent.removeEventListener( 'onfocus', FCKDialog.CheckFocus, true ) ;
}
catch (e)
{}
}
return false ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fck_1_gecko.js
New file
0,0 → 1,112
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_1_gecko.js
* This is the first part of the "FCK" object creation. This is the main
* object that represents an editor instance.
* (Gecko specific implementations)
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
FCK.Description = "FCKeditor for Gecko Browsers" ;
 
FCK.InitializeBehaviors = function()
{
// When calling "SetHTML", the editing area IFRAME gets a fixed height. So we must recaulculate it.
Window_OnResize() ;
 
FCKFocusManager.AddWindow( this.EditorWindow ) ;
 
// Handle pasting operations.
var oOnKeyDown = function( e )
{
 
var bPrevent ;
 
if ( e.ctrlKey && !e.shiftKey && !e.altKey )
{
switch ( e.which )
{
case 66 : // B
case 98 : // b
FCK.ExecuteNamedCommand( 'bold' ) ; bPrevent = true ;
break;
case 105 : // i
case 73 : // I
FCK.ExecuteNamedCommand( 'italic' ) ; bPrevent = true ;
break;
case 117 : // u
case 85 : // U
FCK.ExecuteNamedCommand( 'underline' ) ; bPrevent = true ;
break;
case 86 : // V
case 118 : // v
bPrevent = ( FCK.Status != FCK_STATUS_COMPLETE || !FCK.Events.FireEvent( "OnPaste" ) ) ;
break ;
}
}
else if ( e.shiftKey && !e.ctrlKey && !e.altKey && e.keyCode == 45 ) // SHIFT + <INS>
bPrevent = ( FCK.Status != FCK_STATUS_COMPLETE || !FCK.Events.FireEvent( "OnPaste" ) ) ;
if ( bPrevent )
{
e.preventDefault() ;
e.stopPropagation() ;
}
}
this.EditorDocument.addEventListener( 'keypress', oOnKeyDown, true ) ;
 
this.ExecOnSelectionChange = function()
{
FCK.Events.FireEvent( "OnSelectionChange" ) ;
}
 
this.ExecOnSelectionChangeTimer = function()
{
if ( FCK.LastOnChangeTimer )
window.clearTimeout( FCK.LastOnChangeTimer ) ;
 
FCK.LastOnChangeTimer = window.setTimeout( FCK.ExecOnSelectionChange, 100 ) ;
}
 
this.EditorDocument.addEventListener( 'mouseup', this.ExecOnSelectionChange, false ) ;
 
// On Gecko, firing the "OnSelectionChange" event on every key press started to be too much
// slow. So, a timer has been implemented to solve performance issues when tipying to quickly.
this.EditorDocument.addEventListener( 'keyup', this.ExecOnSelectionChangeTimer, false ) ;
 
this._DblClickListener = function( e )
{
FCK.OnDoubleClick( e.target ) ;
e.stopPropagation() ;
}
this.EditorDocument.addEventListener( 'dblclick', this._DblClickListener, true ) ;
 
// Reset the context menu.
FCK.ContextMenu._InnerContextMenu.SetMouseClickWindow( FCK.EditorWindow ) ;
FCK.ContextMenu._InnerContextMenu.AttachToElement( FCK.EditorDocument ) ;
}
 
FCK.MakeEditable = function()
{
this.EditingArea.MakeEditable() ;
}
 
// Disable the context menu in the editor (outside the editing area).
function Document_OnContextMenu( e )
{
if ( !e.target._FCKShowContextMenu )
e.preventDefault() ;
}
document.oncontextmenu = Document_OnContextMenu ;
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fckxhtml_ie.js
New file
0,0 → 1,184
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckxhtml_ie.js
* Defines the FCKXHtml object, responsible for the XHTML operations.
* IE specific.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
FCKXHtml._GetMainXmlString = function()
{
return this.MainNode.xml ;
}
 
FCKXHtml._AppendAttributes = function( xmlNode, htmlNode, node, nodeName )
{
var aAttributes = htmlNode.attributes ;
 
for ( var n = 0 ; n < aAttributes.length ; n++ )
{
var oAttribute = aAttributes[n] ;
 
if ( oAttribute.specified )
{
var sAttName = oAttribute.nodeName.toLowerCase() ;
var sAttValue ;
 
// Ignore any attribute starting with "_fck".
if ( sAttName.startsWith( '_fck' ) )
continue ;
// The following must be done because of a bug on IE regarding the style
// attribute. It returns "null" for the nodeValue.
else if ( sAttName == 'style' )
sAttValue = htmlNode.style.cssText ;
// There are two cases when the oAttribute.nodeValue must be used:
// - for the "class" attribute
// - for events attributes (on IE only).
else if ( sAttName == 'class' || sAttName.indexOf('on') == 0 )
sAttValue = oAttribute.nodeValue ;
else if ( nodeName == 'body' && sAttName == 'contenteditable' )
continue ;
// XHTML doens't support attribute minimization like "CHECKED". It must be trasformed to cheched="checked".
else if ( oAttribute.nodeValue === true )
sAttValue = sAttName ;
// We must use getAttribute to get it exactly as it is defined.
else if ( ! (sAttValue = htmlNode.getAttribute( sAttName, 2 ) ) )
sAttValue = oAttribute.nodeValue ;
 
this._AppendAttribute( node, sAttName, sAttValue ) ;
}
}
}
 
FCKXHtml.TagProcessors['meta'] = function( node, htmlNode )
{
var oHttpEquiv = node.attributes.getNamedItem( 'http-equiv' ) ;
 
if ( oHttpEquiv == null || oHttpEquiv.value.length == 0 )
{
// Get the http-equiv value from the outerHTML.
var sHttpEquiv = htmlNode.outerHTML.match( FCKRegexLib.MetaHttpEquiv ) ;
 
if ( sHttpEquiv )
{
sHttpEquiv = sHttpEquiv[1] ;
FCKXHtml._AppendAttribute( node, 'http-equiv', sHttpEquiv ) ;
}
}
 
return node ;
}
 
// IE automaticaly changes <FONT> tags to <FONT size=+0>.
FCKXHtml.TagProcessors['font'] = function( node, htmlNode )
{
if ( node.attributes.length == 0 )
node = FCKXHtml.XML.createDocumentFragment() ;
 
FCKXHtml._AppendChildNodes( node, htmlNode ) ;
 
return node ;
}
 
// IE doens't see the value attribute as an attribute for the <INPUT> tag.
FCKXHtml.TagProcessors['input'] = function( node, htmlNode )
{
if ( htmlNode.name )
FCKXHtml._AppendAttribute( node, 'name', htmlNode.name ) ;
 
if ( htmlNode.value && !node.attributes.getNamedItem( 'value' ) )
FCKXHtml._AppendAttribute( node, 'value', htmlNode.value ) ;
 
if ( !node.attributes.getNamedItem( 'type' ) )
FCKXHtml._AppendAttribute( node, 'type', 'text' ) ;
 
return node ;
}
 
// IE ignores the "SELECTED" attribute so we must add it manually.
FCKXHtml.TagProcessors['option'] = function( node, htmlNode )
{
if ( htmlNode.selected && !node.attributes.getNamedItem( 'selected' ) )
FCKXHtml._AppendAttribute( node, 'selected', 'selected' ) ;
 
FCKXHtml._AppendChildNodes( node, htmlNode ) ;
 
return node ;
}
 
// IE ignores the "COORDS" and "SHAPE" attribute so we must add it manually.
FCKXHtml.TagProcessors['area'] = function( node, htmlNode )
{
if ( ! node.attributes.getNamedItem( 'coords' ) )
{
var sCoords = htmlNode.getAttribute( 'coords', 2 ) ;
if ( sCoords && sCoords != '0,0,0' )
FCKXHtml._AppendAttribute( node, 'coords', sCoords ) ;
}
 
if ( ! node.attributes.getNamedItem( 'shape' ) )
{
var sCoords = htmlNode.getAttribute( 'shape', 2 ) ;
if ( sCoords && sCoords.length > 0 )
FCKXHtml._AppendAttribute( node, 'shape', sCoords ) ;
}
 
return node ;
}
 
FCKXHtml.TagProcessors['label'] = function( node, htmlNode )
{
if ( htmlNode.htmlFor.length > 0 )
FCKXHtml._AppendAttribute( node, 'for', htmlNode.htmlFor ) ;
 
FCKXHtml._AppendChildNodes( node, htmlNode ) ;
 
return node ;
}
 
FCKXHtml.TagProcessors['form'] = function( node, htmlNode )
{
if ( htmlNode.acceptCharset && htmlNode.acceptCharset.length > 0 && htmlNode.acceptCharset != 'UNKNOWN' )
FCKXHtml._AppendAttribute( node, 'accept-charset', htmlNode.acceptCharset ) ;
 
if ( htmlNode.name )
FCKXHtml._AppendAttribute( node, 'name', htmlNode.name ) ;
 
FCKXHtml._AppendChildNodes( node, htmlNode ) ;
 
return node ;
}
 
// IE doens't hold the name attribute as an attribute for the <TEXTAREA> and <SELECT> tags.
FCKXHtml.TagProcessors['textarea'] = FCKXHtml.TagProcessors['select'] = function( node, htmlNode )
{
if ( htmlNode.name )
FCKXHtml._AppendAttribute( node, 'name', htmlNode.name ) ;
 
FCKXHtml._AppendChildNodes( node, htmlNode ) ;
return node ;
}
 
// On very rare cases, IE is loosing the "align" attribute for DIV. (right align and apply bulleted list)
FCKXHtml.TagProcessors['div'] = function( node, htmlNode )
{
if ( htmlNode.align.length > 0 )
FCKXHtml._AppendAttribute( node, 'align', htmlNode.align ) ;
 
FCKXHtml._AppendChildNodes( node, htmlNode ) ;
 
return node ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fck_1_ie.js
New file
0,0 → 1,294
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_1_ie.js
* This is the first part of the "FCK" object creation. This is the main
* object that represents an editor instance.
* (IE specific implementations)
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
FCK.Description = "FCKeditor for Internet Explorer 5.5+" ;
 
FCK._GetBehaviorsStyle = function()
{
if ( !FCK._BehaviorsStyle )
{
var sBasePath = FCKConfig.FullBasePath ;
var sTableBehavior = '' ;
var sStyle ;
// The behaviors should be pointed using the FullBasePath to avoid security
// errors when using a differente BaseHref.
sStyle =
'<style type="text/css" _fcktemp="true">' +
'INPUT { behavior: url(' + sBasePath + 'css/behaviors/hiddenfield.htc) ; }' ;
 
if ( FCKConfig.ShowBorders )
sTableBehavior = 'url(' + sBasePath + 'css/behaviors/showtableborders.htc)' ;
 
// Disable resize handlers.
sStyle += 'INPUT,TEXTAREA,SELECT,.FCK__Anchor,.FCK__PageBreak' ;
 
if ( FCKConfig.DisableObjectResizing )
{
sStyle += ',IMG' ;
sTableBehavior += ' url(' + sBasePath + 'css/behaviors/disablehandles.htc)' ;
}
sStyle += ' { behavior: url(' + sBasePath + 'css/behaviors/disablehandles.htc) ; }' ;
 
if ( sTableBehavior.length > 0 )
sStyle += 'TABLE { behavior: ' + sTableBehavior + ' ; }' ;
 
sStyle += '</style>' ;
FCK._BehaviorsStyle = sStyle ;
}
return FCK._BehaviorsStyle ;
}
 
function Doc_OnMouseUp()
{
if ( FCK.EditorWindow.event.srcElement.tagName == 'HTML' )
{
FCK.Focus() ;
FCK.EditorWindow.event.cancelBubble = true ;
FCK.EditorWindow.event.returnValue = false ;
}
}
 
function Doc_OnPaste()
{
if ( FCK.Status == FCK_STATUS_COMPLETE )
FCK.Events.FireEvent( "OnPaste" ) ;
 
return false ;
}
 
/*
function Doc_OnContextMenu()
{
var e = FCK.EditorWindow.event ;
FCK.ShowContextMenu( e.screenX, e.screenY ) ;
return false ;
}
*/
 
function Doc_OnKeyDown()
{
var e = FCK.EditorWindow.event ;
 
 
switch ( e.keyCode )
{
case 13 : // ENTER
if ( FCKConfig.UseBROnCarriageReturn && !(e.ctrlKey || e.altKey || e.shiftKey) )
{
Doc_OnKeyDownUndo() ;
// We must ignore it if we are inside a List.
if ( FCK.EditorDocument.queryCommandState( 'InsertOrderedList' ) || FCK.EditorDocument.queryCommandState( 'InsertUnorderedList' ) )
return true ;
 
// Insert the <BR> (The &nbsp; must be also inserted to make it work)
FCK.InsertHtml( '<br>&nbsp;' ) ;
 
// Remove the &nbsp;
var oRange = FCK.EditorDocument.selection.createRange() ;
oRange.moveStart( 'character', -1 ) ;
oRange.select() ;
FCK.EditorDocument.selection.clear() ;
 
return false ;
}
break ;
case 8 : // BACKSPACE
// We must delete a control selection by code and cancels the
// keystroke, otherwise IE will execute the browser's "back" button.
if ( FCKSelection.GetType() == 'Control' )
{
FCKSelection.Delete() ;
return false ;
}
break ;
case 9 : // TAB
if ( FCKConfig.TabSpaces > 0 && !(e.ctrlKey || e.altKey || e.shiftKey) )
{
Doc_OnKeyDownUndo() ;
FCK.InsertHtml( window.FCKTabHTML ) ;
return false ;
}
break ;
case 90 : // Z
if ( e.ctrlKey && !(e.altKey || e.shiftKey) )
{
FCKUndo.Undo() ;
return false ;
}
break ;
case 89 : // Y
if ( e.ctrlKey && !(e.altKey || e.shiftKey) )
{
FCKUndo.Redo() ;
return false ;
}
break ;
}
if ( !( e.keyCode >=16 && e.keyCode <= 18 ) )
Doc_OnKeyDownUndo() ;
return true ;
}
 
function Doc_OnKeyDownUndo()
{
if ( !FCKUndo.Typing )
{
FCKUndo.SaveUndoStep() ;
FCKUndo.Typing = true ;
FCK.Events.FireEvent( "OnSelectionChange" ) ;
}
FCKUndo.TypesCount++ ;
 
if ( FCKUndo.TypesCount > FCKUndo.MaxTypes )
{
FCKUndo.TypesCount = 0 ;
FCKUndo.SaveUndoStep() ;
}
}
 
function Doc_OnDblClick()
{
FCK.OnDoubleClick( FCK.EditorWindow.event.srcElement ) ;
FCK.EditorWindow.event.cancelBubble = true ;
}
 
function Doc_OnSelectionChange()
{
FCK.Events.FireEvent( "OnSelectionChange" ) ;
}
 
FCK.InitializeBehaviors = function( dontReturn )
{
// Set the focus to the editable area when clicking in the document area.
// TODO: The cursor must be positioned at the end.
this.EditorDocument.attachEvent( 'onmouseup', Doc_OnMouseUp ) ;
 
// Intercept pasting operations
this.EditorDocument.body.attachEvent( 'onpaste', Doc_OnPaste ) ;
 
// Reset the context menu.
FCK.ContextMenu._InnerContextMenu.AttachToElement( FCK.EditorDocument.body ) ;
 
// Build the "TAB" key replacement (if necessary).
if ( FCKConfig.TabSpaces > 0 )
{
window.FCKTabHTML = '' ;
for ( i = 0 ; i < FCKConfig.TabSpaces ; i++ )
window.FCKTabHTML += "&nbsp;" ;
}
this.EditorDocument.attachEvent("onkeydown", Doc_OnKeyDown ) ;
 
this.EditorDocument.attachEvent("ondblclick", Doc_OnDblClick ) ;
 
// Catch cursor movements
this.EditorDocument.attachEvent("onselectionchange", Doc_OnSelectionChange ) ;
 
//Enable editing
// this.EditorDocument.body.contentEditable = true ;
}
 
FCK.InsertHtml = function( html )
{
html = FCKConfig.ProtectedSource.Protect( html ) ;
html = FCK.ProtectUrls( html ) ;
 
FCK.Focus() ;
 
FCKUndo.SaveUndoStep() ;
 
// Gets the actual selection.
var oSel = FCK.EditorDocument.selection ;
 
// Deletes the actual selection contents.
if ( oSel.type.toLowerCase() == 'control' )
oSel.clear() ;
 
// Insert the HTML.
oSel.createRange().pasteHTML( html ) ;
FCKDocumentProcessor.Process( FCK.EditorDocument ) ;
}
 
FCK.SetInnerHtml = function( html ) // IE Only
{
var oDoc = FCK.EditorDocument ;
// Using the following trick, any comment in the begining of the HTML will
// be preserved.
oDoc.body.innerHTML = '<div id="__fakeFCKRemove__">&nbsp;</div>' + html ;
oDoc.getElementById('__fakeFCKRemove__').removeNode( true ) ;
}
 
var FCK_PreloadImages_Count = 0 ;
var FCK_PreloadImages_Images = new Array() ;
 
function FCK_PreloadImages()
{
// Get the images to preload.
var aImages = FCKConfig.PreloadImages || [] ;
if ( typeof( aImages ) == 'string' )
aImages = aImages.split( ';' ) ;
 
// Add the skin icons strip.
aImages.push( FCKConfig.SkinPath + 'fck_strip.gif' ) ;
FCK_PreloadImages_Count = aImages.length ;
 
var aImageElements = new Array() ;
for ( var i = 0 ; i < aImages.length ; i++ )
{
var eImg = document.createElement( 'img' ) ;
eImg.onload = eImg.onerror = FCK_PreloadImages_OnImage ;
eImg.src = aImages[i] ;
FCK_PreloadImages_Images[i] = eImg ;
}
}
 
function FCK_PreloadImages_OnImage()
{
if ( (--FCK_PreloadImages_Count) == 0 )
FCKTools.RunFunction( LoadToolbarSetup ) ;
}
 
// Disable the context menu in the editor (outside the editing area).
function Document_OnContextMenu()
{
return ( event.srcElement._FCKShowContextMenu == true ) ;
}
document.oncontextmenu = Document_OnContextMenu ;
 
function FCK_Cleanup()
{
this.EditorWindow = null ;
this.EditorDocument = null ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fckdialog_ie.js
New file
0,0 → 1,40
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckdialog_ie.js
* Dialog windows operations. (IE specific implementations)
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
FCKDialog.Show = function( dialogInfo, dialogName, pageUrl, dialogWidth, dialogHeight, parentWindow )
{
if ( !parentWindow )
parentWindow = window ;
 
FCKFocusManager.Lock() ;
var oReturn ;
try
{
oReturn = parentWindow.showModalDialog( pageUrl, dialogInfo, "dialogWidth:" + dialogWidth + "px;dialogHeight:" + dialogHeight + "px;help:no;scroll:no;status:no") ;
}
catch( e )
{}
if ( !oReturn )
alert( FCKLang.DialogBlocked ) ;
 
FCKFocusManager.Unlock() ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fck_2_ie.js
New file
0,0 → 1,164
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_2_ie.js
* This is the second part of the "FCK" object creation. This is the main
* object that represents an editor instance.
* (IE specific implementations)
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
/*
if ( FCKConfig.UseBROnCarriageReturn )
{
// Named commands to be handled by this browsers specific implementation.
FCK.RedirectNamedCommands =
{
InsertOrderedList : true,
InsertUnorderedList : true
}
 
FCK.ExecuteRedirectedNamedCommand = function( commandName, commandParameter )
{
if ( commandName == 'InsertOrderedList' || commandName == 'InsertUnorderedList' )
{
if ( !(FCK.EditorDocument.queryCommandState( 'InsertOrderedList' ) || FCK.EditorDocument.queryCommandState( 'InsertUnorderedList' )) )
{
}
}
 
FCK.ExecuteNamedCommand( commandName, commandParameter ) ;
}
}
*/
 
FCK.Paste = function()
{
if ( FCKConfig.ForcePasteAsPlainText )
{
FCK.PasteAsPlainText() ;
return ;
}
 
var sHTML = FCK.GetClipboardHTML() ;
 
if ( FCKConfig.AutoDetectPasteFromWord )
{
var re = /<\w[^>]*(( class="?MsoNormal"?)|(="mso-))/gi ;
if ( re.test( sHTML ) )
{
if ( confirm( FCKLang["PasteWordConfirm"] ) )
{
FCK.PasteFromWord() ;
return ;
}
}
}
 
FCK.InsertHtml( sHTML ) ;
}
 
FCK.PasteAsPlainText = function()
{
// Get the data available in the clipboard and encodes it in HTML.
var sText = FCKTools.HTMLEncode( clipboardData.getData("Text") ) ;
 
// Replace the carriage returns with <BR>
sText = sText.replace( /\n/g, '<BR>' ) ;
// Insert the resulting data in the editor.
this.InsertHtml( sText ) ;
}
/*
FCK.PasteFromWord = function()
{
FCK.CleanAndPaste( FCK.GetClipboardHTML() ) ;
}
*/
FCK.InsertElement = function( element )
{
FCK.InsertHtml( element.outerHTML ) ;
}
 
FCK.GetClipboardHTML = function()
{
var oDiv = document.getElementById( '___FCKHiddenDiv' ) ;
if ( !oDiv )
{
var oDiv = document.createElement( 'DIV' ) ;
oDiv.id = '___FCKHiddenDiv' ;
oDiv.style.visibility = 'hidden' ;
oDiv.style.overflow = 'hidden' ;
oDiv.style.position = 'absolute' ;
oDiv.style.width = 1 ;
oDiv.style.height = 1 ;
document.body.appendChild( oDiv ) ;
}
oDiv.innerHTML = '' ;
var oTextRange = document.body.createTextRange() ;
oTextRange.moveToElementText( oDiv ) ;
oTextRange.execCommand( 'Paste' ) ;
var sData = oDiv.innerHTML ;
oDiv.innerHTML = '' ;
return sData ;
}
 
FCK.AttachToOnSelectionChange = function( functionPointer )
{
this.Events.AttachEvent( 'OnSelectionChange', functionPointer ) ;
}
 
/*
FCK.AttachToOnSelectionChange = function( functionPointer )
{
FCK.EditorDocument.attachEvent( 'onselectionchange', functionPointer ) ;
}
*/
 
FCK.CreateLink = function( url )
{
// Remove any existing link in the selection.
FCK.ExecuteNamedCommand( 'Unlink' ) ;
 
if ( url.length > 0 )
{
// Generate a temporary name for the link.
var sTempUrl = 'javascript:void(0);/*' + ( new Date().getTime() ) + '*/' ;
// Use the internal "CreateLink" command to create the link.
FCK.ExecuteNamedCommand( 'CreateLink', sTempUrl ) ;
 
// Look for the just create link.
var oLinks = this.EditorDocument.links ;
 
for ( i = 0 ; i < oLinks.length ; i++ )
{
var oLink = oLinks[i] ;
if ( oLink.href == sTempUrl )
{
var sInnerHtml = oLink.innerHTML ; // Save the innerHTML (IE changes it if it is like an URL).
oLink.href = url ;
oLink.innerHTML = sInnerHtml ; // Restore the innerHTML.
return oLink ;
}
}
}
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fcktools_ie.js
New file
0,0 → 1,202
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktools_ie.js
* Utility functions. (IE version).
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
FCKTools.CancelEvent = function( e )
{
return false ;
}
 
// Appends one or more CSS files to a document.
FCKTools._AppendStyleSheet = function( documentElement, cssFileUrl )
{
return documentElement.createStyleSheet( cssFileUrl ).owningElement ;
}
 
// Removes all attributes and values from the element.
FCKTools.ClearElementAttributes = function( element )
{
element.clearAttributes() ;
}
 
FCKTools.GetAllChildrenIds = function( parentElement )
{
var aIds = new Array() ;
for ( var i = 0 ; i < parentElement.all.length ; i++ )
{
var sId = parentElement.all[i].id ;
if ( sId && sId.length > 0 )
aIds[ aIds.length ] = sId ;
}
return aIds ;
}
 
FCKTools.RemoveOuterTags = function( e )
{
e.insertAdjacentHTML( 'beforeBegin', e.innerHTML ) ;
e.parentNode.removeChild( e ) ;
}
 
FCKTools.CreateXmlObject = function( object )
{
var aObjs ;
switch ( object )
{
case 'XmlHttp' :
aObjs = [ 'MSXML2.XmlHttp', 'Microsoft.XmlHttp' ] ;
break ;
case 'DOMDocument' :
aObjs = [ 'MSXML2.DOMDocument', 'Microsoft.XmlDom' ] ;
break ;
}
 
for ( var i = 0 ; i < 2 ; i++ )
{
try { return new ActiveXObject( aObjs[i] ) ; }
catch (e)
{}
}
if ( FCKLang.NoActiveX )
{
alert( FCKLang.NoActiveX ) ;
FCKLang.NoActiveX = null ;
}
}
 
FCKTools.DisableSelection = function( element )
{
element.unselectable = 'on' ;
 
var e, i = 0 ;
while ( e = element.all[ i++ ] )
{
switch ( e.tagName )
{
case 'IFRAME' :
case 'TEXTAREA' :
case 'INPUT' :
case 'SELECT' :
/* Ignore the above tags */
break ;
default :
e.unselectable = 'on' ;
}
}
}
 
FCKTools.GetScrollPosition = function( relativeWindow )
{
var oDoc = relativeWindow.document ;
 
// Try with the doc element.
var oPos = { X : oDoc.documentElement.scrollLeft, Y : oDoc.documentElement.scrollTop } ;
if ( oPos.X > 0 || oPos.Y > 0 )
return oPos ;
 
// If no scroll, try with the body.
return { X : oDoc.body.scrollLeft, Y : oDoc.body.scrollTop } ;
}
 
FCKTools.AddEventListener = function( sourceObject, eventName, listener )
{
sourceObject.attachEvent( 'on' + eventName, listener ) ;
}
 
FCKTools.RemoveEventListener = function( sourceObject, eventName, listener )
{
sourceObject.detachEvent( 'on' + eventName, listener ) ;
}
 
// Listeners attached with this function cannot be detached.
FCKTools.AddEventListenerEx = function( sourceObject, eventName, listener, paramsArray )
{
// Ok... this is a closures party, but is the only way to make it clean of memory leaks.
var o = new Object() ;
o.Source = sourceObject ;
o.Params = paramsArray || [] ; // Memory leak if we have DOM objects here.
o.Listener = function( ev )
{
return listener.apply( o.Source, [ ev ].concat( o.Params ) ) ;
}
if ( FCK.IECleanup )
FCK.IECleanup.AddItem( null, function() { o.Source = null ; o.Params = null ; } ) ;
sourceObject.attachEvent( 'on' + eventName, o.Listener ) ;
 
sourceObject = null ; // Memory leak cleaner (because of the above closure).
paramsArray = null ; // Memory leak cleaner (because of the above closure).
}
 
// Returns and object with the "Width" and "Height" properties.
FCKTools.GetViewPaneSize = function( win )
{
var oSizeSource ;
var oDoc = win.document.documentElement ;
if ( oDoc && oDoc.clientWidth ) // IE6 Strict Mode
oSizeSource = oDoc ;
else
oSizeSource = top.document.body ; // Other IEs
if ( oSizeSource )
return { Width : oSizeSource.clientWidth, Height : oSizeSource.clientHeight } ;
else
return { Width : 0, Height : 0 } ;
}
 
FCKTools.SaveStyles = function( element )
{
var oSavedStyles = new Object() ;
if ( element.className.length > 0 )
{
oSavedStyles.Class = element.className ;
element.className = '' ;
}
 
var sInlineStyle = element.style.cssText ;
 
if ( sInlineStyle.length > 0 )
{
oSavedStyles.Inline = sInlineStyle ;
element.style.cssText = '' ;
}
return oSavedStyles ;
}
 
FCKTools.RestoreStyles = function( element, savedStyles )
{
element.className = savedStyles.Class || '' ;
element.style.cssText = savedStyles.Inline || '' ;
}
 
FCKTools.RegisterDollarFunction = function( targetWindow )
{
targetWindow.$ = targetWindow.document.getElementById ;
}
 
FCKTools.AppendElement = function( target, elementName )
{
return target.appendChild( this.GetElementDocument( target ).createElement( elementName ) ) ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fcklanguagemanager.js
New file
0,0 → 1,152
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcklanguagemanager.js
* Defines the FCKLanguageManager object that is used for language
* operations.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKLanguageManager = FCK.Language = new Object() ;
 
FCKLanguageManager.AvailableLanguages =
{
'ar' : 'Arabic',
'bg' : 'Bulgarian',
'bn' : 'Bengali/Bangla',
'bs' : 'Bosnian',
'ca' : 'Catalan',
'cs' : 'Czech',
'da' : 'Danish',
'de' : 'German',
'el' : 'Greek',
'en' : 'English',
'en-au' : 'English (Australia)',
'en-ca' : 'English (Canadian)',
'en-uk' : 'English (United Kingdom)',
'eo' : 'Esperanto',
'es' : 'Spanish',
'et' : 'Estonian',
'eu' : 'Basque',
'fa' : 'Persian',
'fi' : 'Finnish',
'fo' : 'Faroese',
'fr' : 'French',
'gl' : 'Galician',
'he' : 'Hebrew',
'hi' : 'Hindi',
'hr' : 'Croatian',
'hu' : 'Hungarian',
'it' : 'Italian',
'ja' : 'Japanese',
'km' : 'Khmer',
'ko' : 'Korean',
'lt' : 'Lithuanian',
'lv' : 'Latvian',
'mn' : 'Mongolian',
'ms' : 'Malay',
'nb' : 'Norwegian Bokmal',
'nl' : 'Dutch',
'no' : 'Norwegian',
'pl' : 'Polish',
'pt' : 'Portuguese (Portugal)',
'pt-br' : 'Portuguese (Brazil)',
'ro' : 'Romanian',
'ru' : 'Russian',
'sk' : 'Slovak',
'sl' : 'Slovenian',
'sr' : 'Serbian (Cyrillic)',
'sr-latn' : 'Serbian (Latin)',
'sv' : 'Swedish',
'th' : 'Thai',
'tr' : 'Turkish',
'uk' : 'Ukrainian',
'vi' : 'Vietnamese',
'zh' : 'Chinese Traditional',
'zh-cn' : 'Chinese Simplified'
}
 
FCKLanguageManager.GetActiveLanguage = function()
{
if ( FCKConfig.AutoDetectLanguage )
{
var sUserLang ;
// IE accepts "navigator.userLanguage" while Gecko "navigator.language".
if ( navigator.userLanguage )
sUserLang = navigator.userLanguage.toLowerCase() ;
else if ( navigator.language )
sUserLang = navigator.language.toLowerCase() ;
else
{
// Firefox 1.0 PR has a bug: it doens't support the "language" property.
return FCKConfig.DefaultLanguage ;
}
// Some language codes are set in 5 characters,
// like "pt-br" for Brasilian Portuguese.
if ( sUserLang.length >= 5 )
{
sUserLang = sUserLang.substr(0,5) ;
if ( this.AvailableLanguages[sUserLang] ) return sUserLang ;
}
// If the user's browser is set to, for example, "pt-br" but only the
// "pt" language file is available then get that file.
if ( sUserLang.length >= 2 )
{
sUserLang = sUserLang.substr(0,2) ;
if ( this.AvailableLanguages[sUserLang] ) return sUserLang ;
}
}
return this.DefaultLanguage ;
}
 
FCKLanguageManager.TranslateElements = function( targetDocument, tag, propertyToSet, encode )
{
var e = targetDocument.getElementsByTagName(tag) ;
var sKey, s ;
for ( var i = 0 ; i < e.length ; i++ )
{
if ( sKey = e[i].getAttribute( 'fckLang' ) )
{
if ( s = FCKLang[ sKey ] )
{
if ( encode )
s = FCKTools.HTMLEncode( s ) ;
eval( 'e[i].' + propertyToSet + ' = s' ) ;
}
}
}
}
 
FCKLanguageManager.TranslatePage = function( targetDocument )
{
this.TranslateElements( targetDocument, 'INPUT', 'value' ) ;
this.TranslateElements( targetDocument, 'SPAN', 'innerHTML' ) ;
this.TranslateElements( targetDocument, 'LABEL', 'innerHTML' ) ;
this.TranslateElements( targetDocument, 'OPTION', 'innerHTML', true ) ;
}
 
FCKLanguageManager.Initialize = function()
{
if ( this.AvailableLanguages[ FCKConfig.DefaultLanguage ] )
this.DefaultLanguage = FCKConfig.DefaultLanguage ;
else
this.DefaultLanguage = 'en' ;
 
this.ActiveLanguage = new Object() ;
this.ActiveLanguage.Code = this.GetActiveLanguage() ;
this.ActiveLanguage.Name = this.AvailableLanguages[ this.ActiveLanguage.Code ] ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fckdocumentprocessor.js
New file
0,0 → 1,175
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckdocumentprocessor.js
* Advanced document processors.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKDocumentProcessor = new Object() ;
FCKDocumentProcessor._Items = new Array() ;
 
FCKDocumentProcessor.AppendNew = function()
{
var oNewItem = new Object() ;
this._Items.AddItem( oNewItem ) ;
return oNewItem ;
}
 
FCKDocumentProcessor.Process = function( document )
{
var oProcessor, i = 0 ;
while( ( oProcessor = this._Items[i++] ) )
oProcessor.ProcessDocument( document ) ;
}
 
var FCKDocumentProcessor_CreateFakeImage = function( fakeClass, realElement )
{
var oImg = FCK.EditorDocument.createElement( 'IMG' ) ;
oImg.className = fakeClass ;
oImg.src = FCKConfig.FullBasePath + 'images/spacer.gif' ;
oImg.setAttribute( '_fckfakelement', 'true', 0 ) ;
oImg.setAttribute( '_fckrealelement', FCKTempBin.AddElement( realElement ), 0 ) ;
return oImg ;
}
 
// Link Anchors
var FCKAnchorsProcessor = FCKDocumentProcessor.AppendNew() ;
FCKAnchorsProcessor.ProcessDocument = function( document )
{
var aLinks = document.getElementsByTagName( 'A' ) ;
 
var oLink ;
var i = aLinks.length - 1 ;
while ( i >= 0 && ( oLink = aLinks[i--] ) )
{
// If it is anchor.
if ( oLink.name.length > 0 && ( !oLink.getAttribute('href') || oLink.getAttribute('href').length == 0 ) )
{
var oImg = FCKDocumentProcessor_CreateFakeImage( 'FCK__Anchor', oLink.cloneNode(true) ) ;
oImg.setAttribute( '_fckanchor', 'true', 0 ) ;
oLink.parentNode.insertBefore( oImg, oLink ) ;
oLink.parentNode.removeChild( oLink ) ;
}
}
}
 
// Page Breaks
var FCKPageBreaksProcessor = FCKDocumentProcessor.AppendNew() ;
FCKPageBreaksProcessor.ProcessDocument = function( document )
{
var aDIVs = document.getElementsByTagName( 'DIV' ) ;
 
var eDIV ;
var i = aDIVs.length - 1 ;
while ( i >= 0 && ( eDIV = aDIVs[i--] ) )
{
if ( eDIV.style.pageBreakAfter == 'always' && eDIV.childNodes.length == 1 && eDIV.childNodes[0].style && eDIV.childNodes[0].style.display == 'none' )
{
var oFakeImage = FCKDocumentProcessor_CreateFakeImage( 'FCK__PageBreak', eDIV.cloneNode(true) ) ;
eDIV.parentNode.insertBefore( oFakeImage, eDIV ) ;
eDIV.parentNode.removeChild( eDIV ) ;
}
}
/*
var aCenters = document.getElementsByTagName( 'CENTER' ) ;
 
var oCenter ;
var i = aCenters.length - 1 ;
while ( i >= 0 && ( oCenter = aCenters[i--] ) )
{
if ( oCenter.style.pageBreakAfter == 'always' && oCenter.innerHTML.trim().length == 0 )
{
var oFakeImage = FCKDocumentProcessor_CreateFakeImage( 'FCK__PageBreak', oCenter.cloneNode(true) ) ;
oCenter.parentNode.insertBefore( oFakeImage, oCenter ) ;
oCenter.parentNode.removeChild( oCenter ) ;
}
}
*/
}
 
// Flash Embeds.
var FCKFlashProcessor = FCKDocumentProcessor.AppendNew() ;
FCKFlashProcessor.ProcessDocument = function( document )
{
/*
Sample code:
This is some <embed src="/UserFiles/Flash/Yellow_Runners.swf"></embed><strong>sample text</strong>. You are&nbsp;<a name="fred"></a> using <a href="http://www.fckeditor.net/">FCKeditor</a>.
*/
 
var aEmbeds = document.getElementsByTagName( 'EMBED' ) ;
 
var oEmbed ;
var i = aEmbeds.length - 1 ;
while ( i >= 0 && ( oEmbed = aEmbeds[i--] ) )
{
if ( oEmbed.src.endsWith( '.swf', true ) )
{
var oCloned = oEmbed.cloneNode( true ) ;
// On IE, some properties are not getting clonned properly, so we
// must fix it. Thanks to Alfonso Martinez.
if ( FCKBrowserInfo.IsIE )
{
var oAtt ;
if ( oAtt = oEmbed.getAttribute( 'scale' ) ) oCloned.setAttribute( 'scale', oAtt ) ;
if ( oAtt = oEmbed.getAttribute( 'play' ) ) oCloned.setAttribute( 'play', oAtt ) ;
if ( oAtt = oEmbed.getAttribute( 'loop' ) ) oCloned.setAttribute( 'loop', oAtt ) ;
if ( oAtt = oEmbed.getAttribute( 'menu' ) ) oCloned.setAttribute( 'menu', oAtt ) ;
if ( oAtt = oEmbed.getAttribute( 'wmode' ) ) oCloned.setAttribute( 'wmode', oAtt ) ;
if ( oAtt = oEmbed.getAttribute( 'quality' ) ) oCloned.setAttribute( 'quality', oAtt ) ;
}
var oImg = FCKDocumentProcessor_CreateFakeImage( 'FCK__Flash', oCloned ) ;
oImg.setAttribute( '_fckflash', 'true', 0 ) ;
FCKFlashProcessor.RefreshView( oImg, oEmbed ) ;
 
oEmbed.parentNode.insertBefore( oImg, oEmbed ) ;
oEmbed.parentNode.removeChild( oEmbed ) ;
 
// oEmbed.setAttribute( '_fcktemp', 'true', 0) ;
// oEmbed.style.display = 'none' ;
// oEmbed.hidden = true ;
}
}
}
 
FCKFlashProcessor.RefreshView = function( placholderImage, originalEmbed )
{
if ( originalEmbed.width > 0 )
placholderImage.style.width = FCKTools.ConvertHtmlSizeToStyle( originalEmbed.width ) ;
if ( originalEmbed.height > 0 )
placholderImage.style.height = FCKTools.ConvertHtmlSizeToStyle( originalEmbed.height ) ;
}
 
FCK.GetRealElement = function( fakeElement )
{
var e = FCKTempBin.Elements[ fakeElement.getAttribute('_fckrealelement') ] ;
 
if ( fakeElement.getAttribute('_fckflash') )
{
if ( fakeElement.style.width.length > 0 )
e.width = FCKTools.ConvertStyleSizeToHtml( fakeElement.style.width ) ;
if ( fakeElement.style.height.length > 0 )
e.height = FCKTools.ConvertStyleSizeToHtml( fakeElement.style.height ) ;
}
return e ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fck.js
New file
0,0 → 1,77
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck.js
* Creation and initialization of the "FCK" object. This is the main object
* that represents an editor instance.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
// FCK represents the active editor instance
var FCK = new Object() ;
FCK.Name = FCKURLParams[ 'InstanceName' ] ;
 
FCK.Status = FCK_STATUS_NOTLOADED ;
FCK.EditMode = FCK_EDITMODE_WYSIWYG ;
 
FCK.LoadLinkedFile = function()
{
// There is a bug on IE... getElementById returns any META tag that has the
// name set to the ID you are looking for. So the best way in to get the array
// by names and look for the correct one.
// As ASP.Net generates a ID that is different from the Name, we must also
// look for the field based on the ID (the first one is the ID).
var oDocument = window.parent.document ;
 
var eLinkedField = oDocument.getElementById( FCK.Name ) ;
var colElementsByName = oDocument.getElementsByName( FCK.Name ) ;
 
var i = 0;
while ( eLinkedField || i == 0 )
{
if ( eLinkedField && ( eLinkedField.tagName.toLowerCase() == 'input' || eLinkedField.tagName.toLowerCase() == 'textarea' ) )
{
FCK.LinkedField = eLinkedField ;
break ;
}
eLinkedField = colElementsByName[i++] ;
}
}
FCK.LoadLinkedFile() ;
 
var FCKTempBin = new Object() ;
FCKTempBin.Elements = new Array() ;
 
FCKTempBin.AddElement = function( element )
{
var iIndex = this.Elements.length ;
this.Elements[ iIndex ] = element ;
return iIndex ;
}
 
FCKTempBin.RemoveElement = function( index )
{
var e = this.Elements[ index ] ;
this.Elements[ index ] = null ;
return e ;
}
 
FCKTempBin.Reset = function()
{
var i = 0 ;
while ( i < this.Elements.length )
this.Elements[ i++ ] == null ;
this.Elements.length = 0 ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fckplugins.js
New file
0,0 → 1,42
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckplugins.js
* Defines the FCKPlugins object that is responsible for loading the Plugins.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKPlugins = FCK.Plugins = new Object() ;
FCKPlugins.ItemsCount = 0 ;
FCKPlugins.Items = new Object() ;
FCKPlugins.Load = function()
{
var oItems = FCKPlugins.Items ;
 
// build the plugins collection.
for ( var i = 0 ; i < FCKConfig.Plugins.Items.length ; i++ )
{
var oItem = FCKConfig.Plugins.Items[i] ;
var oPlugin = oItems[ oItem[0] ] = new FCKPlugin( oItem[0], oItem[1], oItem[2] ) ;
FCKPlugins.ItemsCount++ ;
}
 
// Load all items in the plugins collection.
for ( var s in oItems )
oItems[s].Load() ;
 
// This is a self destroyable function (must be called once).
FCKPlugins.Load = null ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fckselection.js
New file
0,0 → 1,20
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckselection.js
* Active selection functions.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKSelection = FCK.Selection = new Object() ;
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fcktablehandler.js
New file
0,0 → 1,383
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktablehandler.js
* Manage table operations.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKTableHandler = new Object() ;
 
FCKTableHandler.InsertRow = function()
{
// Get the row where the selection is placed in.
var oRow = FCKSelection.MoveToAncestorNode("TR") ;
if ( !oRow ) return ;
 
// Create a clone of the row.
var oNewRow = oRow.cloneNode( true ) ;
 
// Insert the new row (copy) before of it.
oRow.parentNode.insertBefore( oNewRow, oRow ) ;
 
// Clean the row (it seems that the new row has been added after it).
FCKTableHandler.ClearRow( oRow ) ;
}
 
FCKTableHandler.DeleteRows = function( row )
{
// If no row has been passed as a parameer,
// then get the row where the selection is placed in.
if ( !row )
row = FCKSelection.MoveToAncestorNode("TR") ;
if ( !row ) return ;
 
// Get the row's table.
var oTable = FCKTools.GetElementAscensor( row, 'TABLE' ) ;
 
// If just one row is available then delete the entire table.
if ( oTable.rows.length == 1 )
{
FCKTableHandler.DeleteTable( oTable ) ;
return ;
}
 
// Delete the row.
row.parentNode.removeChild( row ) ;
}
 
FCKTableHandler.DeleteTable = function( table )
{
// If no table has been passed as a parameer,
// then get the table where the selection is placed in.
if ( !table )
{
var table = FCKSelection.GetSelectedElement() ;
if ( !table || table.tagName != 'TABLE' )
table = FCKSelection.MoveToAncestorNode("TABLE") ;
}
if ( !table ) return ;
 
// Delete the table.
FCKSelection.SelectNode( table ) ;
FCKSelection.Collapse();
table.parentNode.removeChild( table ) ;
}
 
FCKTableHandler.InsertColumn = function()
{
// Get the cell where the selection is placed in.
var oCell = FCKSelection.MoveToAncestorNode("TD") ;
if ( !oCell )
oCell = FCKSelection.MoveToAncestorNode("TH") ;
 
if ( !oCell ) return ;
// Get the cell's table.
var oTable = FCKTools.GetElementAscensor( oCell, 'TABLE' ) ;
 
// Get the index of the column to be created (based on the cell).
var iIndex = oCell.cellIndex + 1 ;
 
// Loop throw all rows available in the table.
for ( var i = 0 ; i < oTable.rows.length ; i++ )
{
// Get the row.
var oRow = oTable.rows[i] ;
// If the row doens't have enought cells, ignore it.
if ( oRow.cells.length < iIndex )
continue ;
oCell = oRow.cells[iIndex-1].cloneNode(false) ;
if ( FCKBrowserInfo.IsGecko )
oCell.innerHTML = GECKO_BOGUS ;
// Get the cell that is placed in the new cell place.
var oBaseCell = oRow.cells[iIndex] ;
 
// If the cell is available (we are not in the last cell of the row).
if ( oBaseCell )
oRow.insertBefore( oCell, oBaseCell ) ; // Insert the new cell just before of it.
else
oRow.appendChild( oCell ) ; // Append the cell at the end of the row.
}
}
 
FCKTableHandler.DeleteColumns = function()
{
// Get the cell where the selection is placed in.
var oCell = FCKSelection.MoveToAncestorNode('TD') || FCKSelection.MoveToAncestorNode('TH') ;
 
if ( !oCell ) return ;
// Get the cell's table.
var oTable = FCKTools.GetElementAscensor( oCell, 'TABLE' ) ;
 
// Get the cell index.
var iIndex = oCell.cellIndex ;
 
// Loop throw all rows (from down to up, because it's possible that some
// rows will be deleted).
for ( var i = oTable.rows.length - 1 ; i >= 0 ; i-- )
{
// Get the row.
var oRow = oTable.rows[i] ;
// If the cell to be removed is the first one and the row has just one cell.
if ( iIndex == 0 && oRow.cells.length == 1 )
{
// Remove the entire row.
FCKTableHandler.DeleteRows( oRow ) ;
continue ;
}
// If the cell to be removed exists the delete it.
if ( oRow.cells[iIndex] )
oRow.removeChild( oRow.cells[iIndex] ) ;
}
}
 
FCKTableHandler.InsertCell = function( cell )
{
// Get the cell where the selection is placed in.
var oCell = cell ? cell : FCKSelection.MoveToAncestorNode("TD") ;
if ( !oCell ) return ;
 
// Create the new cell element to be added.
var oNewCell = FCK.EditorDocument.createElement("TD");
if ( FCKBrowserInfo.IsGecko )
oNewCell.innerHTML = GECKO_BOGUS ;
// oNewCell.innerHTML = "&nbsp;" ;
 
// If it is the last cell in the row.
if ( oCell.cellIndex == oCell.parentNode.cells.length - 1 )
{
// Add the new cell at the end of the row.
oCell.parentNode.appendChild( oNewCell ) ;
}
else
{
// Add the new cell before the next cell (after the active one).
oCell.parentNode.insertBefore( oNewCell, oCell.nextSibling ) ;
}
return oNewCell ;
}
 
FCKTableHandler.DeleteCell = function( cell )
{
// If this is the last cell in the row.
if ( cell.parentNode.cells.length == 1 )
{
// Delete the entire row.
FCKTableHandler.DeleteRows( FCKTools.GetElementAscensor( cell, 'TR' ) ) ;
return ;
}
 
// Delete the cell from the row.
cell.parentNode.removeChild( cell ) ;
}
 
FCKTableHandler.DeleteCells = function()
{
var aCells = FCKTableHandler.GetSelectedCells() ;
for ( var i = aCells.length - 1 ; i >= 0 ; i-- )
{
FCKTableHandler.DeleteCell( aCells[i] ) ;
}
}
 
FCKTableHandler.MergeCells = function()
{
// Get all selected cells.
var aCells = FCKTableHandler.GetSelectedCells() ;
// At least 2 cells must be selected.
if ( aCells.length < 2 )
return ;
// The merge can occour only if the selected cells are from the same row.
if ( aCells[0].parentNode != aCells[aCells.length-1].parentNode )
return ;
 
// Calculate the new colSpan for the first cell.
var iColSpan = isNaN( aCells[0].colSpan ) ? 1 : aCells[0].colSpan ;
 
var sHtml = '' ;
var oCellsContents = FCK.EditorDocument.createDocumentFragment() ;
for ( var i = aCells.length - 1 ; i >= 0 ; i-- )
{
var eCell = aCells[i] ;
// Move its contents to the document fragment.
for ( var c = eCell.childNodes.length - 1 ; c >= 0 ; c-- )
{
var eChild = eCell.removeChild( eCell.childNodes[c] ) ;
if ( ( eChild.hasAttribute && eChild.hasAttribute('_moz_editor_bogus_node') ) || ( eChild.getAttribute && eChild.getAttribute( 'type', 2 ) == '_moz' ) )
continue ;
oCellsContents.insertBefore( eChild, oCellsContents.firstChild ) ;
}
if ( i > 0 )
{
// Accumulate the colspan of the cell.
iColSpan += isNaN( eCell.colSpan ) ? 1 : eCell.colSpan ;
 
// Delete the cell.
FCKTableHandler.DeleteCell( eCell ) ;
}
}
// Set the innerHTML of the remaining cell (the first one).
aCells[0].colSpan = iColSpan ;
if ( FCKBrowserInfo.IsGecko && oCellsContents.childNodes.length == 0 )
aCells[0].innerHTML = GECKO_BOGUS ;
else
aCells[0].appendChild( oCellsContents ) ;
}
 
FCKTableHandler.SplitCell = function()
{
// Check that just one cell is selected, otherwise return.
var aCells = FCKTableHandler.GetSelectedCells() ;
if ( aCells.length != 1 )
return ;
var aMap = this._CreateTableMap( aCells[0].parentNode.parentNode ) ;
var iCellIndex = FCKTableHandler._GetCellIndexSpan( aMap, aCells[0].parentNode.rowIndex , aCells[0] ) ;
var aCollCells = this._GetCollumnCells( aMap, iCellIndex ) ;
for ( var i = 0 ; i < aCollCells.length ; i++ )
{
if ( aCollCells[i] == aCells[0] )
{
var oNewCell = this.InsertCell( aCells[0] ) ;
if ( !isNaN( aCells[0].rowSpan ) && aCells[0].rowSpan > 1 )
oNewCell.rowSpan = aCells[0].rowSpan ;
}
else
{
if ( isNaN( aCollCells[i].colSpan ) )
aCollCells[i].colSpan = 2 ;
else
aCollCells[i].colSpan += 1 ;
}
}
}
 
// Get the cell index from a TableMap.
FCKTableHandler._GetCellIndexSpan = function( tableMap, rowIndex, cell )
{
if ( tableMap.length < rowIndex + 1 )
return null ;
var oRow = tableMap[ rowIndex ] ;
for ( var c = 0 ; c < oRow.length ; c++ )
{
if ( oRow[c] == cell )
return c ;
}
return null ;
}
 
// Get the cells available in a collumn of a TableMap.
FCKTableHandler._GetCollumnCells = function( tableMap, collumnIndex )
{
var aCollCells = new Array() ;
 
for ( var r = 0 ; r < tableMap.length ; r++ )
{
var oCell = tableMap[r][collumnIndex] ;
if ( oCell && ( aCollCells.length == 0 || aCollCells[ aCollCells.length - 1 ] != oCell ) )
aCollCells[ aCollCells.length ] = oCell ;
}
return aCollCells ;
}
 
// This function is quite hard to explain. It creates a matrix representing all cells in a table.
// The difference here is that the "spanned" cells (colSpan and rowSpan) are duplicated on the matrix
// cells that are "spanned". For example, a row with 3 cells where the second cell has colSpan=2 and rowSpan=3
// will produce a bi-dimensional matrix with the following values (representing the cells):
// Cell1, Cell2, Cell2, Cell 3
// Cell4, Cell2, Cell2, Cell 5
FCKTableHandler._CreateTableMap = function( table )
{
var aRows = table.rows ;
// Row and Collumn counters.
var r = -1 ;
var aMap = new Array() ;
for ( var i = 0 ; i < aRows.length ; i++ )
{
r++ ;
if ( !aMap[r] )
aMap[r] = new Array() ;
var c = -1 ;
for ( var j = 0 ; j < aRows[i].cells.length ; j++ )
{
var oCell = aRows[i].cells[j] ;
c++ ;
while ( aMap[r][c] )
c++ ;
var iColSpan = isNaN( oCell.colSpan ) ? 1 : oCell.colSpan ;
var iRowSpan = isNaN( oCell.rowSpan ) ? 1 : oCell.rowSpan ;
 
for ( var rs = 0 ; rs < iRowSpan ; rs++ )
{
if ( !aMap[r + rs] )
aMap[r + rs] = new Array() ;
for ( var cs = 0 ; cs < iColSpan ; cs++ )
{
aMap[r + rs][c + cs] = aRows[i].cells[j] ;
}
}
c += iColSpan - 1 ;
}
}
return aMap ;
}
 
FCKTableHandler.ClearRow = function( tr )
{
// Get the array of row's cells.
var aCells = tr.cells ;
 
// Replace the contents of each cell with "nothing".
for ( var i = 0 ; i < aCells.length ; i++ )
{
if ( FCKBrowserInfo.IsGecko )
aCells[i].innerHTML = GECKO_BOGUS ;
else
aCells[i].innerHTML = '' ;
}
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fckdebug.js
New file
0,0 → 1,77
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckdebug.js
* Debug window control and operations.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKDebug = new Object() ;
 
FCKDebug.Output = function( message, color, noParse )
{
if ( ! FCKConfig.Debug ) return ;
if ( !noParse && message != null && isNaN( message ) )
message = message.replace(/</g, "&lt;") ;
 
if ( !this.DebugWindow || this.DebugWindow.closed )
this.DebugWindow = window.open( FCKConfig.BasePath + 'fckdebug.html', 'FCKeditorDebug', 'menubar=no,scrollbars=no,resizable=yes,location=no,toolbar=no,width=600,height=500', true ) ;
if ( this.DebugWindow && this.DebugWindow.Output)
{
try
{
this.DebugWindow.Output( message, color ) ;
}
catch ( e ) {} // Ignore errors
}
}
 
FCKDebug.OutputObject = function( anyObject, color )
{
if ( ! FCKConfig.Debug ) return ;
 
var message ;
if ( anyObject != null )
{
message = 'Properties of: ' + anyObject + '</b><blockquote>' ;
for (var prop in anyObject)
{
try
{
var sVal = anyObject[ prop ] ? anyObject[ prop ] + '' : '[null]' ;
message += '<b>' + prop + '</b> : ' + sVal.replace(/</g, '&lt;') + '<br>' ;
}
catch (e)
{
try
{
message += '<b>' + prop + '</b> : [' + typeof( anyObject[ prop ] ) + ']<br>' ;
}
catch (e)
{
message += '<b>' + prop + '</b> : [-error-]<br>' ;
}
}
}
 
message += '</blockquote><b>' ;
} else
message = 'OutputObject : Object is "null".' ;
FCKDebug.Output( message, color, true ) ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fckxhtml.js
New file
0,0 → 1,390
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckxhtml.js
* Defines the FCKXHtml object, responsible for the XHTML operations.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKXHtml = new Object() ;
 
FCKXHtml.CurrentJobNum = 0 ;
 
FCKXHtml.GetXHTML = function( node, includeNode, format )
{
FCKXHtmlEntities.Initialize() ;
// Save the current IsDirty state. The XHTML processor may change the
// original HTML, dirtying it.
var bIsDirty = FCK.IsDirty() ;
this._CreateNode = FCKConfig.ForceStrongEm ? FCKXHtml_CreateNode_StrongEm : FCKXHtml_CreateNode_Normal ;
 
// Special blocks are blocks of content that remain untouched during the
// process. It is used for SCRIPTs and STYLEs.
FCKXHtml.SpecialBlocks = new Array() ;
 
// Create the XML DOMDocument object.
this.XML = FCKTools.CreateXmlObject( 'DOMDocument' ) ;
 
// Add a root element that holds all child nodes.
this.MainNode = this.XML.appendChild( this.XML.createElement( 'xhtml' ) ) ;
 
FCKXHtml.CurrentJobNum++ ;
 
if ( includeNode )
this._AppendNode( this.MainNode, node ) ;
else
this._AppendChildNodes( this.MainNode, node, false ) ;
 
// Get the resulting XHTML as a string.
var sXHTML = this._GetMainXmlString() ;
 
this.XML = null ;
// Strip the "XHTML" root node.
sXHTML = sXHTML.substr( 7, sXHTML.length - 15 ).trim() ;
// Remove the trailing <br> added by Gecko.
if ( FCKBrowserInfo.IsGecko )
sXHTML = sXHTML.replace( /<br\/>$/, '' ) ;
 
// Add a space in the tags with no closing tags, like <br/> -> <br />
sXHTML = sXHTML.replace( FCKRegexLib.SpaceNoClose, ' />');
 
if ( FCKConfig.ForceSimpleAmpersand )
sXHTML = sXHTML.replace( FCKRegexLib.ForceSimpleAmpersand, '&' ) ;
 
if ( format )
sXHTML = FCKCodeFormatter.Format( sXHTML ) ;
 
// Now we put back the SpecialBlocks contents.
for ( var i = 0 ; i < FCKXHtml.SpecialBlocks.length ; i++ )
{
var oRegex = new RegExp( '___FCKsi___' + i ) ;
sXHTML = sXHTML.replace( oRegex, FCKXHtml.SpecialBlocks[i] ) ;
}
// Replace entities marker with the ampersand.
sXHTML = sXHTML.replace( FCKRegexLib.GeckoEntitiesMarker, '&' ) ;
 
// Restore the IsDirty state if it was not dirty.
if ( !bIsDirty )
FCK.ResetIsDirty() ;
 
return sXHTML
}
 
FCKXHtml._AppendAttribute = function( xmlNode, attributeName, attributeValue )
{
if ( FCKConfig.ForceSimpleAmpersand && attributeValue.replace )
attributeValue = attributeValue.replace( /&/g, '___FCKAmp___' ) ;
try
{
// Create the attribute.
var oXmlAtt = this.XML.createAttribute( attributeName ) ;
 
oXmlAtt.value = attributeValue ? attributeValue : '' ;
 
// Set the attribute in the node.
xmlNode.attributes.setNamedItem( oXmlAtt ) ;
}
catch (e)
{}
}
 
FCKXHtml._AppendChildNodes = function( xmlNode, htmlNode, isBlockElement )
{
var iCount = 0 ;
var oNode = htmlNode.firstChild ;
 
while ( oNode )
{
if ( this._AppendNode( xmlNode, oNode ) )
iCount++ ;
 
oNode = oNode.nextSibling ;
}
if ( iCount == 0 )
{
if ( isBlockElement && FCKConfig.FillEmptyBlocks )
{
this._AppendEntity( xmlNode, 'nbsp' ) ;
return ;
}
 
// We can't use short representation of empty elements that are not marked
// as empty in th XHTML DTD.
if ( !FCKRegexLib.EmptyElements.test( htmlNode.nodeName ) )
xmlNode.appendChild( this.XML.createTextNode('') ) ;
}
}
 
FCKXHtml._AppendNode = function( xmlNode, htmlNode )
{
if ( !htmlNode )
return ;
 
switch ( htmlNode.nodeType )
{
// Element Node.
case 1 :
 
// Here we found an element that is not the real element, but a
// fake one (like the Flash placeholder image), so we must get the real one.
if ( htmlNode.getAttribute('_fckfakelement') )
return FCKXHtml._AppendNode( xmlNode, FCK.GetRealElement( htmlNode ) ) ;
// Mozilla insert custom nodes in the DOM.
if ( FCKBrowserInfo.IsGecko && htmlNode.hasAttribute('_moz_editor_bogus_node') )
return false ;
// This is for elements that are instrumental to FCKeditor and
// must be removed from the final HTML.
if ( htmlNode.getAttribute('_fcktemp') )
return false ;
 
// Get the element name.
var sNodeName = htmlNode.nodeName ;
//Add namespace:
if ( FCKBrowserInfo.IsIE && htmlNode.scopeName && htmlNode.scopeName != 'HTML' && htmlNode.scopeName != 'FCK' )
sNodeName = htmlNode.scopeName + ':' + sNodeName ;
 
// Check if the node name is valid, otherwise ignore this tag.
// If the nodeName starts with a slash, it is a orphan closing tag.
// On some strange cases, the nodeName is empty, even if the node exists.
if ( !FCKRegexLib.ElementName.test( sNodeName ) )
return false ;
 
sNodeName = sNodeName.toLowerCase() ;
 
if ( FCKBrowserInfo.IsGecko && sNodeName == 'br' && htmlNode.hasAttribute('type') && htmlNode.getAttribute( 'type', 2 ) == '_moz' )
return false ;
 
// The already processed nodes must be marked to avoid then to be duplicated (bad formatted HTML).
// So here, the "mark" is checked... if the element is Ok, then mark it.
if ( htmlNode._fckxhtmljob && htmlNode._fckxhtmljob == FCKXHtml.CurrentJobNum )
return false ;
 
var oNode = this._CreateNode( sNodeName ) ;
// Add all attributes.
FCKXHtml._AppendAttributes( xmlNode, htmlNode, oNode, sNodeName ) ;
htmlNode._fckxhtmljob = FCKXHtml.CurrentJobNum ;
 
// Tag specific processing.
var oTagProcessor = FCKXHtml.TagProcessors[ sNodeName ] ;
 
if ( oTagProcessor )
{
oNode = oTagProcessor( oNode, htmlNode, xmlNode ) ;
if ( !oNode ) break ;
}
else
this._AppendChildNodes( oNode, htmlNode, FCKRegexLib.BlockElements.test( sNodeName ) ) ;
 
xmlNode.appendChild( oNode ) ;
 
break ;
 
// Text Node.
case 3 :
this._AppendTextNode( xmlNode, htmlNode.nodeValue.replaceNewLineChars(' ') ) ;
break ;
 
// Comment
case 8 :
// IE catches the <!DOTYPE ... > as a comment, but it has no
// innerHTML, so we can catch it, and ignore it.
if ( FCKBrowserInfo.IsIE && !htmlNode.innerHTML )
break ;
 
try { xmlNode.appendChild( this.XML.createComment( htmlNode.nodeValue ) ) ; }
catch (e) { /* Do nothing... probably this is a wrong format comment. */ }
break ;
 
// Unknown Node type.
default :
xmlNode.appendChild( this.XML.createComment( "Element not supported - Type: " + htmlNode.nodeType + " Name: " + htmlNode.nodeName ) ) ;
break ;
}
return true ;
}
 
function FCKXHtml_CreateNode_StrongEm( nodeName )
{
switch ( nodeName )
{
case 'b' :
nodeName = 'strong' ;
break ;
case 'i' :
nodeName = 'em' ;
break ;
}
return this.XML.createElement( nodeName ) ;
}
 
function FCKXHtml_CreateNode_Normal( nodeName )
{
return this.XML.createElement( nodeName ) ;
}
 
// Append an item to the SpecialBlocks array and returns the tag to be used.
FCKXHtml._AppendSpecialItem = function( item )
{
return '___FCKsi___' + FCKXHtml.SpecialBlocks.AddItem( item ) ;
}
 
FCKXHtml._AppendEntity = function( xmlNode, entity )
{
xmlNode.appendChild( this.XML.createTextNode( '#?-:' + entity + ';' ) ) ;
}
 
FCKXHtml._AppendTextNode = function( targetNode, textValue )
{
targetNode.appendChild( this.XML.createTextNode( textValue.replace( FCKXHtmlEntities.EntitiesRegex, FCKXHtml_GetEntity ) ) ) ;
return ;
}
 
// Retrieves a entity (internal format) for a given character.
function FCKXHtml_GetEntity( character )
{
// We cannot simply place the entities in the text, because the XML parser
// will translate & to &amp;. So we use a temporary marker which is replaced
// in the end of the processing.
var sEntity = FCKXHtmlEntities.Entities[ character ] || ( '#' + character.charCodeAt(0) ) ;
return '#?-:' + sEntity + ';' ;
}
 
// An object that hold tag specific operations.
FCKXHtml.TagProcessors = new Object() ;
 
FCKXHtml.TagProcessors['img'] = function( node, htmlNode )
{
// The "ALT" attribute is required in XHTML.
if ( ! node.attributes.getNamedItem( 'alt' ) )
FCKXHtml._AppendAttribute( node, 'alt', '' ) ;
 
var sSavedUrl = htmlNode.getAttribute( '_fcksavedurl' ) ;
if ( sSavedUrl != null )
FCKXHtml._AppendAttribute( node, 'src', sSavedUrl ) ;
 
return node ;
}
 
FCKXHtml.TagProcessors['a'] = function( node, htmlNode )
{
var sSavedUrl = htmlNode.getAttribute( '_fcksavedurl' ) ;
if ( sSavedUrl != null )
FCKXHtml._AppendAttribute( node, 'href', sSavedUrl ) ;
 
FCKXHtml._AppendChildNodes( node, htmlNode, false ) ;
 
// Firefox may create empty tags when deleting the selection in some special cases (SF-BUG 1556878).
if ( node.childNodes.length == 0 && !node.getAttribute( 'name' ) )
return false ;
 
return node ;
}
 
FCKXHtml.TagProcessors['script'] = function( node, htmlNode )
{
// The "TYPE" attribute is required in XHTML.
if ( ! node.attributes.getNamedItem( 'type' ) )
FCKXHtml._AppendAttribute( node, 'type', 'text/javascript' ) ;
 
node.appendChild( FCKXHtml.XML.createTextNode( FCKXHtml._AppendSpecialItem( htmlNode.text ) ) ) ;
 
return node ;
}
 
FCKXHtml.TagProcessors['style'] = function( node, htmlNode )
{
// The "TYPE" attribute is required in XHTML.
if ( ! node.attributes.getNamedItem( 'type' ) )
FCKXHtml._AppendAttribute( node, 'type', 'text/css' ) ;
 
node.appendChild( FCKXHtml.XML.createTextNode( FCKXHtml._AppendSpecialItem( htmlNode.innerHTML ) ) ) ;
 
return node ;
}
 
FCKXHtml.TagProcessors['title'] = function( node, htmlNode )
{
node.appendChild( FCKXHtml.XML.createTextNode( FCK.EditorDocument.title ) ) ;
 
return node ;
}
 
FCKXHtml.TagProcessors['table'] = function( node, htmlNode )
{
// There is a trick to show table borders when border=0. We add to the
// table class the FCK__ShowTableBorders rule. So now we must remove it.
 
var oClassAtt = node.attributes.getNamedItem( 'class' ) ;
 
if ( oClassAtt && FCKRegexLib.TableBorderClass.test( oClassAtt.nodeValue ) )
{
var sClass = oClassAtt.nodeValue.replace( FCKRegexLib.TableBorderClass, '' ) ;
 
if ( sClass.length == 0 )
node.attributes.removeNamedItem( 'class' ) ;
else
FCKXHtml._AppendAttribute( node, 'class', sClass ) ;
}
 
FCKXHtml._AppendChildNodes( node, htmlNode, false ) ;
 
return node ;
}
 
// Fix nested <ul> and <ol>.
FCKXHtml.TagProcessors['ol'] = FCKXHtml.TagProcessors['ul'] = function( node, htmlNode, targetNode )
{
if ( htmlNode.innerHTML.trim().length == 0 )
return ;
 
var ePSibling = targetNode.lastChild ;
if ( ePSibling && ePSibling.nodeType == 3 )
ePSibling = ePSibling.previousSibling ;
if ( ePSibling && ePSibling.nodeName.toUpperCase() == 'LI' )
{
htmlNode._fckxhtmljob = null ;
FCKXHtml._AppendNode( ePSibling, htmlNode ) ;
return ;
}
 
FCKXHtml._AppendChildNodes( node, htmlNode ) ;
 
return node ;
}
 
FCKXHtml.TagProcessors['span'] = function( node, htmlNode )
{
// Firefox may create empty tags when deleting the selection in some special cases (SF-BUG 1084404).
if ( htmlNode.innerHTML.length == 0 )
return false ;
FCKXHtml._AppendChildNodes( node, htmlNode, false ) ;
 
return node ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fckselection_gecko.js
New file
0,0 → 1,144
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckselection_gecko.js
* Active selection functions. (Gecko specific implementation)
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
// Get the selection type (like document.select.type in IE).
FCKSelection.GetType = function()
{
// if ( ! this._Type )
// {
// By default set the type to "Text".
this._Type = 'Text' ;
 
// Check if the actual selection is a Control (IMG, TABLE, HR, etc...).
var oSel ;
try { oSel = FCK.EditorWindow.getSelection() ; }
catch (e) {}
if ( oSel && oSel.rangeCount == 1 )
{
var oRange = oSel.getRangeAt(0) ;
if ( oRange.startContainer == oRange.endContainer && (oRange.endOffset - oRange.startOffset) == 1 && oRange.startContainer.nodeType != Node.TEXT_NODE )
this._Type = 'Control' ;
}
// }
return this._Type ;
}
 
// Retrieves the selected element (if any), just in the case that a single
// element (object like and image or a table) is selected.
FCKSelection.GetSelectedElement = function()
{
if ( this.GetType() == 'Control' )
{
var oSel = FCK.EditorWindow.getSelection() ;
return oSel.anchorNode.childNodes[ oSel.anchorOffset ] ;
}
}
 
FCKSelection.GetParentElement = function()
{
if ( this.GetType() == 'Control' )
return FCKSelection.GetSelectedElement().parentNode ;
else
{
var oSel = FCK.EditorWindow.getSelection() ;
if ( oSel )
{
var oNode = oSel.anchorNode ;
 
while ( oNode && oNode.nodeType != 1 )
oNode = oNode.parentNode ;
 
return oNode ;
}
}
}
 
FCKSelection.SelectNode = function( element )
{
// FCK.Focus() ;
 
var oRange = FCK.EditorDocument.createRange() ;
oRange.selectNode( element ) ;
 
var oSel = FCK.EditorWindow.getSelection() ;
oSel.removeAllRanges() ;
oSel.addRange( oRange ) ;
}
 
FCKSelection.Collapse = function( toStart )
{
var oSel = FCK.EditorWindow.getSelection() ;
if ( toStart == null || toStart === true )
oSel.collapseToStart() ;
else
oSel.collapseToEnd() ;
}
 
// The "nodeTagName" parameter must be Upper Case.
FCKSelection.HasAncestorNode = function( nodeTagName )
{
var oContainer = this.GetSelectedElement() ;
if ( ! oContainer && FCK.EditorWindow )
{
try { oContainer = FCK.EditorWindow.getSelection().getRangeAt(0).startContainer ; }
catch(e){}
}
 
while ( oContainer )
{
if ( oContainer.nodeType == 1 && oContainer.tagName == nodeTagName ) return true ;
oContainer = oContainer.parentNode ;
}
 
return false ;
}
 
// The "nodeTagName" parameter must be Upper Case.
FCKSelection.MoveToAncestorNode = function( nodeTagName )
{
var oNode ;
 
var oContainer = this.GetSelectedElement() ;
if ( ! oContainer )
oContainer = FCK.EditorWindow.getSelection().getRangeAt(0).startContainer ;
 
while ( oContainer )
{
if ( oContainer.tagName == nodeTagName )
return oContainer ;
oContainer = oContainer.parentNode ;
}
return null ;
}
 
FCKSelection.Delete = function()
{
// Gets the actual selection.
var oSel = FCK.EditorWindow.getSelection() ;
 
// Deletes the actual selection contents.
for ( var i = 0 ; i < oSel.rangeCount ; i++ )
{
oSel.getRangeAt(i).deleteContents() ;
}
 
return oSel ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fcktablehandler_gecko.js
New file
0,0 → 1,53
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktablehandler_gecko.js
* Manage table operations (IE specific).
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
FCKTableHandler.GetSelectedCells = function()
{
var aCells = new Array() ;
 
var oSelection = FCK.EditorWindow.getSelection() ;
 
// If the selection is a text.
if ( oSelection.rangeCount == 1 && oSelection.anchorNode.nodeType == 3 )
{
var oParent = FCKTools.GetElementAscensor( oSelection.anchorNode, 'TD,TH' ) ;
if ( oParent )
{
aCells[0] = oParent ;
return aCells ;
}
}
 
for ( var i = 0 ; i < oSelection.rangeCount ; i++ )
{
var oRange = oSelection.getRangeAt(i) ;
var oCell ;
if ( oRange.startContainer.tagName.Equals( 'TD', 'TH' ) )
oCell = oRange.startContainer ;
else
oCell = oRange.startContainer.childNodes[ oRange.startOffset ] ;
if ( oCell.tagName.Equals( 'TD', 'TH' ) )
aCells[aCells.length] = oCell ;
}
 
return aCells ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fckcodeformatter.js
New file
0,0 → 1,96
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckcodeformatter.js
* Format the HTML.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKCodeFormatter = new Object() ;
 
FCKCodeFormatter.Init = function()
{
var oRegex = this.Regex = new Object() ;
 
// Regex for line breaks.
oRegex.BlocksOpener = /\<(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi ;
oRegex.BlocksCloser = /\<\/(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi ;
 
oRegex.NewLineTags = /\<(BR|HR)[^\>]*\>/gi ;
 
oRegex.MainTags = /\<\/?(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR)[^\>]*\>/gi ;
 
oRegex.LineSplitter = /\s*\n+\s*/g ;
 
// Regex for indentation.
oRegex.IncreaseIndent = /^\<(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL)[ \/\>]/i ;
oRegex.DecreaseIndent = /^\<\/(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL)[ \>]/i ;
oRegex.FormatIndentatorRemove = new RegExp( '^' + FCKConfig.FormatIndentator ) ;
 
oRegex.ProtectedTags = /(<PRE[^>]*>)([\s\S]*?)(<\/PRE>)/gi ;
}
 
FCKCodeFormatter._ProtectData = function( outer, opener, data, closer )
{
return opener + '___FCKpd___' + FCKCodeFormatter.ProtectedData.AddItem( data ) + closer ;
}
 
FCKCodeFormatter.Format = function( html )
{
if ( !this.Regex )
this.Init() ;
 
// Protected content that remain untouched during the
// process go in the following array.
FCKCodeFormatter.ProtectedData = new Array() ;
var sFormatted = html.replace( this.Regex.ProtectedTags, FCKCodeFormatter._ProtectData ) ;
// Line breaks.
sFormatted = sFormatted.replace( this.Regex.BlocksOpener, '\n$&' ) ; ;
sFormatted = sFormatted.replace( this.Regex.BlocksCloser, '$&\n' ) ;
sFormatted = sFormatted.replace( this.Regex.NewLineTags, '$&\n' ) ;
sFormatted = sFormatted.replace( this.Regex.MainTags, '\n$&\n' ) ;
 
// Indentation.
var sIndentation = '' ;
var asLines = sFormatted.split( this.Regex.LineSplitter ) ;
sFormatted = '' ;
for ( var i = 0 ; i < asLines.length ; i++ )
{
var sLine = asLines[i] ;
if ( sLine.length == 0 )
continue ;
if ( this.Regex.DecreaseIndent.test( sLine ) )
sIndentation = sIndentation.replace( this.Regex.FormatIndentatorRemove, '' ) ;
 
sFormatted += sIndentation + sLine + '\n' ;
if ( this.Regex.IncreaseIndent.test( sLine ) )
sIndentation += FCKConfig.FormatIndentator ;
}
// Now we put back the protected data.
for ( var i = 0 ; i < FCKCodeFormatter.ProtectedData.length ; i++ )
{
var oRegex = new RegExp( '___FCKpd___' + i ) ;
sFormatted = sFormatted.replace( oRegex, FCKCodeFormatter.ProtectedData[i].replace( /\$/g, '$$$$' ) ) ;
}
 
return sFormatted.trim() ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fcktools.js
New file
0,0 → 1,236
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktools.js
* Utility functions.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKTools = new Object() ;
 
FCKTools.AppendStyleSheet = function( documentElement, cssFileUrlOrArray )
{
if ( typeof( cssFileUrlOrArray ) == 'string' )
return this._AppendStyleSheet( documentElement, cssFileUrlOrArray ) ;
else
{
for ( var i = 0 ; i < cssFileUrlOrArray.length ; i++ )
this._AppendStyleSheet( documentElement, cssFileUrlOrArray[i] ) ;
}
}
 
/**
* Gets the value of the hidden INPUT element that is associated to the editor.
* This element has its ID set to the editor's instance name so the user refers
* to the instance name when getting the posted data.
*/
FCKTools.GetLinkedFieldValue = function()
{
return FCK.LinkedField.value ;
}
 
/**
* Attachs a function call to the submit event of the linked field form. This
* function us generally used to update the linked field value before
* submitting the form.
*/
FCKTools.AttachToLinkedFieldFormSubmit = function( functionPointer )
{
// Gets the linked field form
var oForm = FCK.LinkedField.form ;
// Return now if no form is available
if (!oForm) return ;
 
// Attaches the functionPointer call to the onsubmit event
if ( FCKBrowserInfo.IsIE )
oForm.attachEvent( "onsubmit", functionPointer ) ;
else
oForm.addEventListener( 'submit', functionPointer, false ) ;
//**
// Attaches the functionPointer call to the submit method
// This is done because IE doesn't fire onsubmit when the submit method is called
// BEGIN --
// Creates a Array in the form object that will hold all Attached function call
// (in the case there are more than one editor in the same page)
if (! oForm.updateFCKeditor) oForm.updateFCKeditor = new Array() ;
// Adds the function pointer to the array of functions to call when "submit" is called
oForm.updateFCKeditor[oForm.updateFCKeditor.length] = functionPointer ;
 
// Switches the original submit method with a new one that first call all functions
// on the above array and the call the original submit
// IE sees it oForm.submit function as an 'object'.
if (! oForm.originalSubmit && ( typeof( oForm.submit ) == 'function' || ( !oForm.submit.tagName && !oForm.submit.length ) ) )
{
// Creates a copy of the original submit
oForm.originalSubmit = oForm.submit ;
// Creates our replacement for the submit
oForm.submit = FCKTools_SubmitReplacer ;
}
// END --
}
 
function FCKTools_SubmitReplacer()
{
if (this.updateFCKeditor)
{
// Calls all functions in the functions array
for (var i = 0 ; i < this.updateFCKeditor.length ; i++)
this.updateFCKeditor[i]() ;
}
// Calls the original "submit"
this.originalSubmit() ;
}
 
// Get the window object where the element is placed in.
FCKTools.GetElementWindow = function( element )
{
return this.GetDocumentWindow( this.GetElementDocument( element ) ) ;
}
 
FCKTools.GetDocumentWindow = function( doc )
{
// With Safari, there is not way to retrieve the window from the document, so we must fix it.
if ( FCKBrowserInfo.IsSafari && !doc.parentWindow )
this.FixDocumentParentWindow( window.top ) ;
return doc.parentWindow || doc.defaultView ;
}
 
/*
This is a Safari specific function that fix the reference to the parent
window from the document object.
*/
FCKTools.FixDocumentParentWindow = function( targetWindow )
{
targetWindow.document.parentWindow = targetWindow ;
for ( var i = 0 ; i < targetWindow.frames.length ; i++ )
FCKTools.FixDocumentParentWindow( targetWindow.frames[i] ) ;
}
 
FCKTools.GetParentWindow = function( document )
{
return document.contentWindow ? document.contentWindow : document.parentWindow ;
}
 
FCKTools.HTMLEncode = function( text )
{
if ( !text )
return '' ;
 
text = text.replace( /&/g, '&amp;' ) ;
text = text.replace( /</g, '&lt;' ) ;
text = text.replace( />/g, '&gt;' ) ;
 
return text ;
}
 
/**
* Adds an option to a SELECT element.
*/
FCKTools.AddSelectOption = function( selectElement, optionText, optionValue )
{
var oOption = FCKTools.GetElementDocument( selectElement ).createElement( "OPTION" ) ;
 
oOption.text = optionText ;
oOption.value = optionValue ;
 
selectElement.options.add(oOption) ;
 
return oOption ;
}
 
FCKTools.RunFunction = function( func, thisObject, paramsArray, timerWindow )
{
if ( func )
this.SetTimeout( func, 0, thisObject, paramsArray, timerWindow ) ;
}
 
FCKTools.SetTimeout = function( func, milliseconds, thisObject, paramsArray, timerWindow )
{
return ( timerWindow || window ).setTimeout(
function()
{
if ( paramsArray )
func.apply( thisObject, [].concat( paramsArray ) ) ;
else
func.apply( thisObject ) ;
},
milliseconds ) ;
}
 
FCKTools.SetInterval = function( func, milliseconds, thisObject, paramsArray, timerWindow )
{
return ( timerWindow || window ).setInterval(
function()
{
func.apply( thisObject, paramsArray || [] ) ;
},
milliseconds ) ;
}
 
FCKTools.ConvertStyleSizeToHtml = function( size )
{
return size.endsWith( '%' ) ? size : parseInt( size ) ;
}
 
FCKTools.ConvertHtmlSizeToStyle = function( size )
{
return size.endsWith( '%' ) ? size : ( size + 'px' ) ;
}
 
// START iCM MODIFICATIONS
// Amended to accept a list of one or more ascensor tag names
// Amended to check the element itself before working back up through the parent hierarchy
FCKTools.GetElementAscensor = function( element, ascensorTagNames )
{
// var e = element.parentNode ;
var e = element ;
var lstTags = "," + ascensorTagNames.toUpperCase() + "," ;
 
while ( e )
{
if ( lstTags.indexOf( "," + e.nodeName.toUpperCase() + "," ) != -1 )
return e ;
 
e = e.parentNode ;
}
return null ;
}
// END iCM MODIFICATIONS
 
FCKTools.CreateEventListener = function( func, params )
{
var f = function()
{
var aAllParams = [] ;
for ( var i = 0 ; i < arguments.length ; i++ )
aAllParams.push( arguments[i] ) ;
 
func.apply( this, aAllParams.concat( params ) ) ;
}
 
return f ;
}
 
FCKTools.GetElementDocument = function ( element )
{
return element.ownerDocument || element.document ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fck_2.js
New file
0,0 → 1,162
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_2.js
* This is the second part of the "FCK" object creation. This is the main
* object that represents an editor instance.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
// This collection is used by the browser specific implementations to tell
// wich named commands must be handled separately.
FCK.RedirectNamedCommands = new Object() ;
 
FCK.ExecuteNamedCommand = function( commandName, commandParameter, noRedirect )
{
FCKUndo.SaveUndoStep() ;
 
if ( !noRedirect && FCK.RedirectNamedCommands[ commandName ] != null )
FCK.ExecuteRedirectedNamedCommand( commandName, commandParameter ) ;
else
{
FCK.Focus() ;
FCK.EditorDocument.execCommand( commandName, false, commandParameter ) ;
FCK.Events.FireEvent( 'OnSelectionChange' ) ;
}
FCKUndo.SaveUndoStep() ;
}
 
FCK.GetNamedCommandState = function( commandName )
{
try
{
if ( !FCK.EditorDocument.queryCommandEnabled( commandName ) )
return FCK_TRISTATE_DISABLED ;
else
return FCK.EditorDocument.queryCommandState( commandName ) ? FCK_TRISTATE_ON : FCK_TRISTATE_OFF ;
}
catch ( e )
{
return FCK_TRISTATE_OFF ;
}
}
 
FCK.GetNamedCommandValue = function( commandName )
{
var sValue = '' ;
var eState = FCK.GetNamedCommandState( commandName ) ;
if ( eState == FCK_TRISTATE_DISABLED )
return null ;
try
{
sValue = this.EditorDocument.queryCommandValue( commandName ) ;
}
catch(e) {}
return sValue ? sValue : '' ;
}
 
FCK.PasteFromWord = function()
{
FCKDialog.OpenDialog( 'FCKDialog_Paste', FCKLang.PasteFromWord, 'dialog/fck_paste.html', 400, 330, 'Word' ) ;
}
 
FCK.Preview = function()
{
var iWidth = FCKConfig.ScreenWidth * 0.8 ;
var iHeight = FCKConfig.ScreenHeight * 0.7 ;
var iLeft = ( FCKConfig.ScreenWidth - iWidth ) / 2 ;
var oWindow = window.open( '', null, 'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=' + iWidth + ',height=' + iHeight + ',left=' + iLeft ) ;
var sHTML ;
if ( FCKConfig.FullPage )
{
if ( FCK.TempBaseTag.length > 0 )
sHTML = FCK.TempBaseTag + FCK.GetXHTML() ;
else
sHTML = FCK.GetXHTML() ;
}
else
{
sHTML =
FCKConfig.DocType +
'<html dir="' + FCKConfig.ContentLangDirection + '">' +
'<head>' +
FCK.TempBaseTag +
'<title>' + FCKLang.Preview + '</title>' +
FCK._GetEditorAreaStyleTags() +
'</head><body>' +
FCK.GetXHTML() +
'</body></html>' ;
}
oWindow.document.write( sHTML );
oWindow.document.close();
}
 
FCK.SwitchEditMode = function( noUndo )
{
var bIsWysiwyg = ( FCK.EditMode == FCK_EDITMODE_WYSIWYG ) ;
var sHtml ;
// Update the HTML in the view output to show.
if ( bIsWysiwyg )
{
if ( !noUndo && FCKBrowserInfo.IsIE )
FCKUndo.SaveUndoStep() ;
 
sHtml = FCK.GetXHTML( FCKConfig.FormatSource ) ;
}
else
sHtml = this.EditingArea.Textarea.value ;
 
FCK.EditMode = bIsWysiwyg ? FCK_EDITMODE_SOURCE : FCK_EDITMODE_WYSIWYG ;
 
FCK.SetHTML( sHtml ) ;
 
// Set the Focus.
FCK.Focus() ;
 
// Update the toolbar (Running it directly causes IE to fail).
FCKTools.RunFunction( FCK.ToolbarSet.RefreshModeState, FCK.ToolbarSet ) ;
}
 
FCK.CreateElement = function( tag )
{
var e = FCK.EditorDocument.createElement( tag ) ;
return FCK.InsertElementAndGetIt( e ) ;
}
 
FCK.InsertElementAndGetIt = function( e )
{
e.setAttribute( 'FCKTempLabel', 'true' ) ;
this.InsertElement( e ) ;
var aEls = FCK.EditorDocument.getElementsByTagName( e.tagName ) ;
for ( var i = 0 ; i < aEls.length ; i++ )
{
if ( aEls[i].getAttribute( 'FCKTempLabel' ) )
{
aEls[i].removeAttribute( 'FCKTempLabel' ) ;
return aEls[i] ;
}
}
return null ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fckxhtmlentities.js
New file
0,0 → 1,340
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckxhtmlentities.js
* This file define the HTML entities handled by the editor.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKXHtmlEntities = new Object() ;
 
FCKXHtmlEntities.Initialize = function()
{
if ( FCKXHtmlEntities.Entities )
return ;
 
var sChars = '' ;
 
if ( FCKConfig.ProcessHTMLEntities )
{
FCKXHtmlEntities.Entities = {
// Latin-1 Entities
' ':'nbsp',
'¡':'iexcl',
'¢':'cent',
'£':'pound',
'¤':'curren',
'¥':'yen',
'¦':'brvbar',
'§':'sect',
'¨':'uml',
'©':'copy',
'ª':'ordf',
'«':'laquo',
'¬':'not',
'­':'shy',
'®':'reg',
'¯':'macr',
'°':'deg',
'±':'plusmn',
'²':'sup2',
'³':'sup3',
'´':'acute',
'µ':'micro',
'¶':'para',
'·':'middot',
'¸':'cedil',
'¹':'sup1',
'º':'ordm',
'»':'raquo',
'¼':'frac14',
'½':'frac12',
'¾':'frac34',
'¿':'iquest',
'×':'times',
'÷':'divide',
 
// Symbols
 
'ƒ':'fnof',
'•':'bull',
'…':'hellip',
'′':'prime',
'″':'Prime',
'‾':'oline',
'⁄':'frasl',
'℘':'weierp',
'ℑ':'image',
'ℜ':'real',
'™':'trade',
'ℵ':'alefsym',
'←':'larr',
'↑':'uarr',
'→':'rarr',
'↓':'darr',
'↔':'harr',
'↵':'crarr',
'⇐':'lArr',
'⇑':'uArr',
'⇒':'rArr',
'⇓':'dArr',
'⇔':'hArr',
'∀':'forall',
'∂':'part',
'∃':'exist',
'∅':'empty',
'∇':'nabla',
'∈':'isin',
'∉':'notin',
'∋':'ni',
'∏':'prod',
'∑':'sum',
'−':'minus',
'∗':'lowast',
'√':'radic',
'∝':'prop',
'∞':'infin',
'∠':'ang',
'∧':'and',
'∨':'or',
'∩':'cap',
'∪':'cup',
'∫':'int',
'∴':'there4',
'∼':'sim',
'≅':'cong',
'≈':'asymp',
'≠':'ne',
'≡':'equiv',
'≤':'le',
'≥':'ge',
'⊂':'sub',
'⊃':'sup',
'⊄':'nsub',
'⊆':'sube',
'⊇':'supe',
'⊕':'oplus',
'⊗':'otimes',
'⊥':'perp',
'⋅':'sdot',
'◊':'loz',
'♠':'spades',
'♣':'clubs',
'♥':'hearts',
'♦':'diams',
 
// Other Special Characters
 
'"':'quot',
// '&':'amp', // This entity is automatically handled by the XHTML parser.
// '<':'lt', // This entity is automatically handled by the XHTML parser.
// '>':'gt', // This entity is automatically handled by the XHTML parser.
'ˆ':'circ',
'˜':'tilde',
' ':'ensp',
' ':'emsp',
' ':'thinsp',
'‌':'zwnj',
'‍':'zwj',
'‎':'lrm',
'‏':'rlm',
'–':'ndash',
'—':'mdash',
'‘':'lsquo',
'’':'rsquo',
'‚':'sbquo',
'“':'ldquo',
'”':'rdquo',
'„':'bdquo',
'†':'dagger',
'‡':'Dagger',
'‰':'permil',
'‹':'lsaquo',
'›':'rsaquo',
'¤':'euro'
} ;
 
// Process Base Entities.
for ( var e in FCKXHtmlEntities.Entities )
sChars += e ;
 
// Include Latin Letters Entities.
if ( FCKConfig.IncludeLatinEntities )
{
var oEntities = {
'À':'Agrave',
'Á':'Aacute',
'Â':'Acirc',
'Ã':'Atilde',
'Ä':'Auml',
'Å':'Aring',
'Æ':'AElig',
'Ç':'Ccedil',
'È':'Egrave',
'É':'Eacute',
'Ê':'Ecirc',
'Ë':'Euml',
'Ì':'Igrave',
'Í':'Iacute',
'Î':'Icirc',
'Ï':'Iuml',
'Ð':'ETH',
'Ñ':'Ntilde',
'Ò':'Ograve',
'Ó':'Oacute',
'Ô':'Ocirc',
'Õ':'Otilde',
'Ö':'Ouml',
'Ø':'Oslash',
'Ù':'Ugrave',
'Ú':'Uacute',
'Û':'Ucirc',
'Ü':'Uuml',
'Ý':'Yacute',
'Þ':'THORN',
'ß':'szlig',
'à':'agrave',
'á':'aacute',
'â':'acirc',
'ã':'atilde',
'ä':'auml',
'å':'aring',
'æ':'aelig',
'ç':'ccedil',
'è':'egrave',
'é':'eacute',
'ê':'ecirc',
'ë':'euml',
'ì':'igrave',
'í':'iacute',
'î':'icirc',
'ï':'iuml',
'ð':'eth',
'ñ':'ntilde',
'ò':'ograve',
'ó':'oacute',
'ô':'ocirc',
'õ':'otilde',
'ö':'ouml',
'ø':'oslash',
'ù':'ugrave',
'ú':'uacute',
'û':'ucirc',
'ü':'uuml',
'ý':'yacute',
'þ':'thorn',
'ÿ':'yuml',
'Œ':'OElig',
'œ':'oelig',
'Š':'Scaron',
'š':'scaron',
'¾':'Yuml'
} ;
for ( var e in oEntities )
{
FCKXHtmlEntities.Entities[ e ] = oEntities[ e ] ;
sChars += e ;
}
oEntities = null ;
}
 
// Include Greek Letters Entities.
if ( FCKConfig.IncludeGreekEntities )
{
var oEntities = {
'Α':'Alpha',
'Β':'Beta',
'Γ':'Gamma',
'Δ':'Delta',
'Ε':'Epsilon',
'Ζ':'Zeta',
'Η':'Eta',
'Θ':'Theta',
'Ι':'Iota',
'Κ':'Kappa',
'Λ':'Lambda',
'Μ':'Mu',
'Ν':'Nu',
'Ξ':'Xi',
'Ο':'Omicron',
'Π':'Pi',
'Ρ':'Rho',
'Σ':'Sigma',
'Τ':'Tau',
'Υ':'Upsilon',
'Φ':'Phi',
'Χ':'Chi',
'Ψ':'Psi',
'Ω':'Omega',
'α':'alpha',
'β':'beta',
'γ':'gamma',
'δ':'delta',
'ε':'epsilon',
'ζ':'zeta',
'η':'eta',
'θ':'theta',
'ι':'iota',
'κ':'kappa',
'λ':'lambda',
'μ':'mu',
'ν':'nu',
'ξ':'xi',
'ο':'omicron',
'π':'pi',
'ρ':'rho',
'ς':'sigmaf',
'σ':'sigma',
'τ':'tau',
'υ':'upsilon',
'φ':'phi',
'χ':'chi',
'ψ':'psi',
'ω':'omega'
} ;
 
for ( var e in oEntities )
{
FCKXHtmlEntities.Entities[ e ] = oEntities[ e ] ;
sChars += e ;
}
 
oEntities = null ;
}
}
else
{
FCKXHtmlEntities.Entities = {} ;
 
// Even if we are not processing the entities, we must render the &nbsp;
// correctly. As we don't want HTML entities, let's use its numeric
// representation (&#160).
sChars = ' ' ;
}
 
// Create the Regex used to find entities in the text.
var sRegexPattern = '[' + sChars + ']' ;
if ( FCKConfig.ProcessNumericEntities )
sRegexPattern = '[^ -~]|' + sRegexPattern ;
 
var sAdditional = FCKConfig.AdditionalNumericEntities ;
 
if ( sAdditional || sAdditional.length > 0 )
sRegexPattern += '|' + FCKConfig.AdditionalNumericEntities ;
 
FCKXHtmlEntities.EntitiesRegex = new RegExp( sRegexPattern, 'g' ) ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fckregexlib.js
New file
0,0 → 1,87
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckregexlib.js
* These are some Regular Expresions used by the editor.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKRegexLib = {
 
// This is the Regular expression used by the SetHTML method for the "&apos;" entity.
AposEntity : /&apos;/gi ,
 
// Used by the Styles combo to identify styles that can't be applied to text.
ObjectElements : /^(?:IMG|TABLE|TR|TD|TH|INPUT|SELECT|TEXTAREA|HR|OBJECT|A|UL|OL|LI)$/i ,
 
BlockElements : /^(?:P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TD|TH)$/i ,
 
// Elements marked as empty "Empty" in the XHTML DTD.
EmptyElements : /^(?:BASE|META|LINK|HR|BR|PARAM|IMG|AREA|INPUT)$/i ,
 
// List all named commands (commands that can be interpreted by the browser "execCommand" method.
NamedCommands : /^(?:Cut|Copy|Paste|Print|SelectAll|RemoveFormat|Unlink|Undo|Redo|Bold|Italic|Underline|StrikeThrough|Subscript|Superscript|JustifyLeft|JustifyCenter|JustifyRight|JustifyFull|Outdent|Indent|InsertOrderedList|InsertUnorderedList|InsertHorizontalRule)$/i ,
 
BodyContents : /([\s\S]*\<body[^\>]*\>)([\s\S]*)(\<\/body\>[\s\S]*)/i ,
 
// Temporary text used to solve some browser specific limitations.
ToReplace : /___fcktoreplace:([\w]+)/ig ,
 
// Get the META http-equiv attribute from the tag.
MetaHttpEquiv : /http-equiv\s*=\s*["']?([^"' ]+)/i ,
 
HasBaseTag : /<base /i ,
 
HtmlOpener : /<html\s?[^>]*>/i ,
HeadOpener : /<head\s?[^>]*>/i ,
HeadCloser : /<\/head\s*>/i ,
 
TableBorderClass : /\s*FCK__ShowTableBorders\s*/ ,
 
// Validate element names.
ElementName : /(^[A-Za-z_:][\w.\-:]*\w$)|(^[A-Za-z_]$)/ ,
 
// Used in conjuction with the FCKConfig.ForceSimpleAmpersand configuration option.
ForceSimpleAmpersand : /___FCKAmp___/g ,
 
// Get the closing parts of the tags with no closing tags, like <br/>... gets the "/>" part.
SpaceNoClose : /\/>/g ,
 
EmptyParagraph : /^<(p|div)>\s*<\/\1>$/i ,
 
TagBody : /></ ,
 
StrongOpener : /<STRONG([ \>])/gi ,
StrongCloser : /<\/STRONG>/gi ,
EmOpener : /<EM([ \>])/gi ,
EmCloser : /<\/EM>/gi ,
AbbrOpener : /<ABBR([ \>])/gi ,
AbbrCloser : /<\/ABBR>/gi ,
 
GeckoEntitiesMarker : /#\?-\:/g ,
 
// We look for the "src" and href attribute with the " or ' or whithout one of
// them. We have to do all in one, otherwhise we will have problems with URLs
// like "thumbnail.php?src=someimage.jpg" (SF-BUG 1554141).
ProtectUrlsImg : /(?:(<img(?=\s).*?\ssrc=)("|')(.*?)\2)|(?:(<img\s.*?src=)([^"'][^ >]+))/gi ,
ProtectUrlsA : /(?:(<a(?=\s).*?\shref=)("|')(.*?)\2)|(?:(<a\s.*?href=)([^"'][^ >]+))/gi ,
 
Html4DocType : /HTML 4\.0 Transitional/i ,
DocTypeTag : /<!DOCTYPE[^>]*>/i ,
 
// These regex are used to save the original event attributes in the HTML.
TagsWithEvent : /<[^\>]+ on\w+[\s\r\n]*=[\s\r\n]*?('|")[\s\S]+?\>/g ,
EventAttributes : /\s(on\w+)[\s\r\n]*=[\s\r\n]*?('|")([\s\S]*?)\2/g,
ProtectedEvents : /\s\w+_fckprotectedatt="([^"]+)"/g
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fcktablehandler_ie.js
New file
0,0 → 1,54
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktablehandler_ie.js
* Manage table operations (IE specific).
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
FCKTableHandler.GetSelectedCells = function()
{
var aCells = new Array() ;
 
var oRange = FCK.EditorDocument.selection.createRange() ;
// var oParent = oRange.parentElement() ;
var oParent = FCKSelection.GetParentElement() ;
if ( oParent && oParent.tagName.Equals( 'TD', 'TH' ) )
aCells[0] = oParent ;
else
{
var oParent = FCKSelection.MoveToAncestorNode( "TABLE" ) ;
if ( oParent )
{
// Loops throw all cells checking if the cell is, or part of it, is inside the selection
// and then add it to the selected cells collection.
for ( var i = 0 ; i < oParent.cells.length ; i++ )
{
var oCellRange = FCK.EditorDocument.selection.createRange() ;
oCellRange.moveToElementText( oParent.cells[i] ) ;
if ( oRange.inRange( oCellRange )
|| ( oRange.compareEndPoints('StartToStart',oCellRange) >= 0 && oRange.compareEndPoints('StartToEnd',oCellRange) <= 0 )
|| ( oRange.compareEndPoints('EndToStart',oCellRange) >= 0 && oRange.compareEndPoints('EndToEnd',oCellRange) <= 0 ) )
{
aCells[aCells.length] = oParent.cells[i] ;
}
}
}
}
return aCells ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fckselection_ie.js
New file
0,0 → 1,151
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckselection_ie.js
* Active selection functions. (IE specific implementation)
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
// Get the selection type.
FCKSelection.GetType = function()
{
return FCK.EditorDocument.selection.type ;
}
 
// Retrieves the selected element (if any), just in the case that a single
// element (object like and image or a table) is selected.
FCKSelection.GetSelectedElement = function()
{
if ( this.GetType() == 'Control' )
{
var oRange = FCK.EditorDocument.selection.createRange() ;
 
if ( oRange && oRange.item )
return FCK.EditorDocument.selection.createRange().item(0) ;
}
}
 
FCKSelection.GetParentElement = function()
{
switch ( this.GetType() )
{
case 'Control' :
return FCKSelection.GetSelectedElement().parentElement ;
case 'None' :
return ;
default :
return FCK.EditorDocument.selection.createRange().parentElement() ;
}
}
 
FCKSelection.SelectNode = function( node )
{
FCK.Focus() ;
FCK.EditorDocument.selection.empty() ;
 
try
{
// Try to select the node as a control.
var oRange = FCK.EditorDocument.body.createControlRange() ;
oRange.addElement( node ) ;
}
catch(e)
{
// If failed, select it as a text range.
var oRange = FCK.EditorDocument.selection.createRange() ;
oRange.moveToElementText( node ) ;
}
 
oRange.select() ;
}
 
FCKSelection.Collapse = function( toStart )
{
FCK.Focus() ;
if ( this.GetType() == 'Text' )
{
var oRange = FCK.EditorDocument.selection.createRange() ;
oRange.collapse( toStart == null || toStart === true ) ;
oRange.select() ;
}
}
 
// The "nodeTagName" parameter must be Upper Case.
FCKSelection.HasAncestorNode = function( nodeTagName )
{
var oContainer ;
 
if ( FCK.EditorDocument.selection.type == "Control" )
{
oContainer = this.GetSelectedElement() ;
}
else
{
var oRange = FCK.EditorDocument.selection.createRange() ;
oContainer = oRange.parentElement() ;
}
 
while ( oContainer )
{
if ( oContainer.tagName == nodeTagName ) return true ;
oContainer = oContainer.parentNode ;
}
 
return false ;
}
 
// The "nodeTagName" parameter must be UPPER CASE.
FCKSelection.MoveToAncestorNode = function( nodeTagName )
{
var oNode ;
 
if ( FCK.EditorDocument.selection.type == "Control" )
{
var oRange = FCK.EditorDocument.selection.createRange() ;
for ( i = 0 ; i < oRange.length ; i++ )
{
if (oRange(i).parentNode)
{
oNode = oRange(i).parentNode ;
break ;
}
}
}
else
{
var oRange = FCK.EditorDocument.selection.createRange() ;
oNode = oRange.parentElement() ;
}
 
while ( oNode && oNode.nodeName != nodeTagName )
oNode = oNode.parentNode ;
 
return oNode ;
}
 
FCKSelection.Delete = function()
{
// Gets the actual selection.
var oSel = FCK.EditorDocument.selection ;
 
// Deletes the actual selection contents.
if ( oSel.type.toLowerCase() != "none" )
{
oSel.clear() ;
}
 
return oSel ;
}
 
 
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fckxhtml_gecko.js
New file
0,0 → 1,62
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckxhtml_gecko.js
* Defines the FCKXHtml object, responsible for the XHTML operations.
* Gecko specific.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
FCKXHtml._GetMainXmlString = function()
{
// Create the XMLSerializer.
var oSerializer = new XMLSerializer() ;
 
// Return the serialized XML as a string.
return oSerializer.serializeToString( this.MainNode ) ;
}
 
FCKXHtml._AppendAttributes = function( xmlNode, htmlNode, node )
{
var aAttributes = htmlNode.attributes ;
for ( var n = 0 ; n < aAttributes.length ; n++ )
{
var oAttribute = aAttributes[n] ;
if ( oAttribute.specified )
{
var sAttName = oAttribute.nodeName.toLowerCase() ;
var sAttValue ;
 
// Ignore any attribute starting with "_fck".
if ( sAttName.startsWith( '_fck' ) )
continue ;
// There is a bug in Mozilla that returns '_moz_xxx' attributes as specified.
else if ( sAttName.indexOf( '_moz' ) == 0 )
continue ;
// There are one cases (on Gecko) when the oAttribute.nodeValue must be used:
// - for the "class" attribute
else if ( sAttName == 'class' )
sAttValue = oAttribute.nodeValue ;
// XHTML doens't support attribute minimization like "CHECKED". It must be trasformed to cheched="checked".
else if ( oAttribute.nodeValue === true )
sAttValue = sAttName ;
else
sAttValue = htmlNode.getAttribute( sAttName, 2 ) ; // We must use getAttribute to get it exactly as it is defined.
 
this._AppendAttribute( node, sAttName, sAttValue ) ;
}
}
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fcktools_gecko.js
New file
0,0 → 1,231
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktools_gecko.js
* Utility functions. (Gecko version).
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
// Constant for the Gecko Bogus Node.
var GECKO_BOGUS = FCKBrowserInfo.IsGecko ? '<br _moz_editor_bogus_node="TRUE">' : '' ;
 
FCKTools.CancelEvent = function( e )
{
if ( e )
e.preventDefault() ;
}
 
FCKTools.DisableSelection = function( element )
{
if ( FCKBrowserInfo.IsGecko )
element.style.MozUserSelect = 'none' ; // Gecko only.
else
element.style.userSelect = 'none' ; // CSS3 (not supported yet).
}
 
// Appends a CSS file to a document.
FCKTools._AppendStyleSheet = function( documentElement, cssFileUrl )
{
var e = documentElement.createElement( 'LINK' ) ;
e.rel = 'stylesheet' ;
e.type = 'text/css' ;
e.href = cssFileUrl ;
documentElement.getElementsByTagName("HEAD")[0].appendChild( e ) ;
return e ;
}
 
// Removes all attributes and values from the element.
FCKTools.ClearElementAttributes = function( element )
{
// Loop throw all attributes in the element
for ( var i = 0 ; i < element.attributes.length ; i++ )
{
// Remove the element by name.
element.removeAttribute( element.attributes[i].name, 0 ) ; // 0 : Case Insensitive
}
}
 
// Returns an Array of strings with all defined in the elements inside another element.
FCKTools.GetAllChildrenIds = function( parentElement )
{
// Create the array that will hold all Ids.
var aIds = new Array() ;
// Define a recursive function that search for the Ids.
var fGetIds = function( parent )
{
for ( var i = 0 ; i < parent.childNodes.length ; i++ )
{
var sId = parent.childNodes[i].id ;
// Check if the Id is defined for the element.
if ( sId && sId.length > 0 ) aIds[ aIds.length ] = sId ;
// Recursive call.
fGetIds( parent.childNodes[i] ) ;
}
}
// Start the recursive calls.
fGetIds( parentElement ) ;
 
return aIds ;
}
 
FCKTools.RemoveOuterTags = function( e )
{
var oFragment = e.ownerDocument.createDocumentFragment() ;
for ( var i = 0 ; i < e.childNodes.length ; i++ )
oFragment.appendChild( e.childNodes[i] ) ;
e.parentNode.replaceChild( oFragment, e ) ;
}
 
FCKTools.CreateXmlObject = function( object )
{
switch ( object )
{
case 'XmlHttp' :
return new XMLHttpRequest() ;
case 'DOMDocument' :
return document.implementation.createDocument( '', '', null ) ;
}
return null ;
}
 
FCKTools.GetScrollPosition = function( relativeWindow )
{
return { X : relativeWindow.pageXOffset, Y : relativeWindow.pageYOffset } ;
}
 
FCKTools.AddEventListener = function( sourceObject, eventName, listener )
{
sourceObject.addEventListener( eventName, listener, false ) ;
}
 
FCKTools.RemoveEventListener = function( sourceObject, eventName, listener )
{
sourceObject.removeEventListener( eventName, listener, false ) ;
}
 
// Listeners attached with this function cannot be detached.
FCKTools.AddEventListenerEx = function( sourceObject, eventName, listener, paramsArray )
{
sourceObject.addEventListener(
eventName,
function( e )
{
listener.apply( sourceObject, [ e ].concat( paramsArray || [] ) ) ;
},
false
) ;
}
 
// Returns and object with the "Width" and "Height" properties.
FCKTools.GetViewPaneSize = function( win )
{
return { Width : win.innerWidth, Height : win.innerHeight } ;
}
 
FCKTools.SaveStyles = function( element )
{
var oSavedStyles = new Object() ;
if ( element.className.length > 0 )
{
oSavedStyles.Class = element.className ;
element.className = '' ;
}
 
var sInlineStyle = element.getAttribute( 'style' ) ;
 
if ( sInlineStyle && sInlineStyle.length > 0 )
{
oSavedStyles.Inline = sInlineStyle ;
element.setAttribute( 'style', '', 0 ) ; // 0 : Case Insensitive
}
 
return oSavedStyles ;
}
 
FCKTools.RestoreStyles = function( element, savedStyles )
{
element.className = savedStyles.Class || '' ;
 
if ( savedStyles.Inline )
element.setAttribute( 'style', savedStyles.Inline, 0 ) ; // 0 : Case Insensitive
else
element.removeAttribute( 'style', 0 ) ;
}
 
FCKTools.RegisterDollarFunction = function( targetWindow )
{
targetWindow.$ = function( id )
{
return this.document.getElementById( id ) ;
} ;
}
 
FCKTools.AppendElement = function( target, elementName )
{
return target.appendChild( target.ownerDocument.createElement( elementName ) ) ;
}
 
// Get the coordinates of an element.
// @el : The element to get the position.
// @relativeWindow: The window to which we want the coordinates relative to.
FCKTools.GetElementPosition = function( el, relativeWindow )
{
// Initializes the Coordinates object that will be returned by the function.
var c = { X:0, Y:0 } ;
var oWindow = relativeWindow || window ;
 
var oOwnerWindow = FCKTools.GetElementWindow( el ) ;
 
// Loop throw the offset chain.
while ( el )
{
var sPosition = oOwnerWindow.getComputedStyle(el, '').position ;
 
// Check for non "static" elements.
// 'FCKConfig.FloatingPanelsZIndex' -- Submenus are under a positioned IFRAME.
if ( sPosition && sPosition != 'static' && el.style.zIndex != FCKConfig.FloatingPanelsZIndex )
break ;
 
c.X += el.offsetLeft - el.scrollLeft ;
c.Y += el.offsetTop - el.scrollTop ;
 
if ( el.offsetParent )
el = el.offsetParent ;
else
{
if ( oOwnerWindow != oWindow )
{
if ( el = oOwnerWindow.frameElement )
oOwnerWindow = FCKTools.GetElementWindow( el ) ;
}
else
{
c.X += el.scrollLeft ;
c.Y += el.scrollTop ;
break ;
}
}
}
 
// Return the Coordinates object
return c ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fck_2_gecko.js
New file
0,0 → 1,196
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_2_gecko.js
* This is the second part of the "FCK" object creation. This is the main
* object that represents an editor instance.
* (Gecko specific implementations)
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
// GetNamedCommandState overload for Gecko.
FCK._BaseGetNamedCommandState = FCK.GetNamedCommandState ;
FCK.GetNamedCommandState = function( commandName )
{
switch ( commandName )
{
case 'Unlink' :
return FCKSelection.HasAncestorNode('A') ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ;
default :
return FCK._BaseGetNamedCommandState( commandName ) ;
}
}
 
// Named commands to be handled by this browsers specific implementation.
FCK.RedirectNamedCommands =
{
Print : true,
Paste : true,
Cut : true,
Copy : true
}
 
// ExecuteNamedCommand overload for Gecko.
FCK.ExecuteRedirectedNamedCommand = function( commandName, commandParameter )
{
switch ( commandName )
{
case 'Print' :
FCK.EditorWindow.print() ;
break ;
case 'Paste' :
try { if ( FCK.Paste() ) FCK.ExecuteNamedCommand( 'Paste', null, true ) ; }
catch (e) { alert(FCKLang.PasteErrorPaste) ; }
break ;
case 'Cut' :
try { FCK.ExecuteNamedCommand( 'Cut', null, true ) ; }
catch (e) { alert(FCKLang.PasteErrorCut) ; }
break ;
case 'Copy' :
try { FCK.ExecuteNamedCommand( 'Copy', null, true ) ; }
catch (e) { alert(FCKLang.PasteErrorCopy) ; }
break ;
default :
FCK.ExecuteNamedCommand( commandName, commandParameter ) ;
}
}
 
FCK.AttachToOnSelectionChange = function( functionPointer )
{
this.Events.AttachEvent( 'OnSelectionChange', functionPointer ) ;
}
 
FCK.Paste = function()
{
if ( FCKConfig.ForcePasteAsPlainText )
{
FCK.PasteAsPlainText() ;
return false ;
}
/* For now, the AutoDetectPasteFromWord feature is IE only.
else if ( FCKConfig.AutoDetectPasteFromWord )
{
var sHTML = FCK.GetClipboardHTML() ;
var re = /<\w[^>]* class="?MsoNormal"?/gi ;
if ( re.test( sHTML ) )
{
if ( confirm( FCKLang["PasteWordConfirm"] ) )
{
FCK.PasteFromWord() ;
return false ;
}
}
}
*/
else
return true ;
}
 
//**
// FCK.InsertHtml: Inserts HTML at the current cursor location. Deletes the
// selected content if any.
FCK.InsertHtml = function( html )
{
html = FCKConfig.ProtectedSource.Protect( html ) ;
html = FCK.ProtectUrls( html ) ;
 
// Delete the actual selection.
var oSel = FCKSelection.Delete() ;
// Get the first available range.
var oRange = oSel.getRangeAt(0) ;
// Create a fragment with the input HTML.
var oFragment = oRange.createContextualFragment( html ) ;
// Get the last available node.
var oLastNode = oFragment.lastChild ;
 
// Insert the fragment in the range.
oRange.insertNode(oFragment) ;
// Set the cursor after the inserted fragment.
FCKSelection.SelectNode( oLastNode ) ;
FCKSelection.Collapse( false ) ;
this.Focus() ;
}
 
FCK.InsertElement = function( element )
{
// Deletes the actual selection.
var oSel = FCKSelection.Delete() ;
// Gets the first available range.
var oRange = oSel.getRangeAt(0) ;
// Inserts the element in the range.
oRange.insertNode( element ) ;
// Set the cursor after the inserted fragment.
FCKSelection.SelectNode( element ) ;
FCKSelection.Collapse( false ) ;
 
this.Focus() ;
}
 
FCK.PasteAsPlainText = function()
{
// TODO: Implement the "Paste as Plain Text" code.
FCKDialog.OpenDialog( 'FCKDialog_Paste', FCKLang.PasteAsText, 'dialog/fck_paste.html', 400, 330, 'PlainText' ) ;
/*
var sText = FCKTools.HTMLEncode( clipboardData.getData("Text") ) ;
sText = sText.replace( /\n/g, '<BR>' ) ;
this.InsertHtml( sText ) ;
*/
}
/*
FCK.PasteFromWord = function()
{
// TODO: Implement the "Paste as Plain Text" code.
FCKDialog.OpenDialog( 'FCKDialog_Paste', FCKLang.PasteFromWord, 'dialog/fck_paste.html', 400, 330, 'Word' ) ;
 
// FCK.CleanAndPaste( FCK.GetClipboardHTML() ) ;
}
*/
FCK.GetClipboardHTML = function()
{
return '' ;
}
 
FCK.CreateLink = function( url )
{
FCK.ExecuteNamedCommand( 'Unlink' ) ;
if ( url.length > 0 )
{
// Generate a temporary name for the link.
var sTempUrl = 'javascript:void(0);/*' + ( new Date().getTime() ) + '*/' ;
// Use the internal "CreateLink" command to create the link.
FCK.ExecuteNamedCommand( 'CreateLink', sTempUrl ) ;
 
// Retrieve the just created link using XPath.
var oLink = document.evaluate("//a[@href='" + sTempUrl + "']", this.EditorDocument.body, null, 9, null).singleNodeValue ;
if ( oLink )
{
oLink.href = url ;
return oLink ;
}
}
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fck_contextmenu.js
New file
0,0 → 1,290
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_contextmenu.js
* Defines the FCK.ContextMenu object that is responsible for all
* Context Menu operations in the editing area.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
FCK.ContextMenu = new Object() ;
FCK.ContextMenu.Listeners = new Array() ;
 
FCK.ContextMenu.RegisterListener = function( listener )
{
if ( listener )
this.Listeners.push( listener ) ;
}
 
function FCK_ContextMenu_Init()
{
var oInnerContextMenu = FCK.ContextMenu._InnerContextMenu = new FCKContextMenu( FCKBrowserInfo.IsIE ? window : window.parent, FCK.EditorWindow, FCKLang.Dir ) ;
oInnerContextMenu.OnBeforeOpen = FCK_ContextMenu_OnBeforeOpen ;
oInnerContextMenu.OnItemClick = FCK_ContextMenu_OnItemClick ;
 
// Get the registering function.
var oMenu = FCK.ContextMenu ;
 
// Register all configured context menu listeners.
for ( var i = 0 ; i < FCKConfig.ContextMenu.length ; i++ )
oMenu.RegisterListener( FCK_ContextMenu_GetListener( FCKConfig.ContextMenu[i] ) ) ;
}
 
function FCK_ContextMenu_GetListener( listenerName )
{
switch ( listenerName )
{
case 'Generic' :
return {
AddItems : function( menu, tag, tagName )
{
menu.AddItem( 'Cut' , FCKLang.Cut , 7, FCKCommands.GetCommand( 'Cut' ).GetState() == FCK_TRISTATE_DISABLED ) ;
menu.AddItem( 'Copy' , FCKLang.Copy , 8, FCKCommands.GetCommand( 'Copy' ).GetState() == FCK_TRISTATE_DISABLED ) ;
menu.AddItem( 'Paste' , FCKLang.Paste , 9, FCKCommands.GetCommand( 'Paste' ).GetState() == FCK_TRISTATE_DISABLED ) ;
}} ;
 
case 'Table' :
return {
AddItems : function( menu, tag, tagName )
{
var bIsTable = ( tagName == 'TABLE' ) ;
var bIsCell = ( !bIsTable && FCKSelection.HasAncestorNode( 'TABLE' ) ) ;
if ( bIsCell )
{
menu.AddSeparator() ;
var oItem = menu.AddItem( 'Cell' , FCKLang.CellCM ) ;
oItem.AddItem( 'TableInsertCell' , FCKLang.InsertCell, 58 ) ;
oItem.AddItem( 'TableDeleteCells' , FCKLang.DeleteCells, 59 ) ;
oItem.AddItem( 'TableMergeCells' , FCKLang.MergeCells, 60 ) ;
oItem.AddItem( 'TableSplitCell' , FCKLang.SplitCell, 61 ) ;
oItem.AddSeparator() ;
oItem.AddItem( 'TableCellProp' , FCKLang.CellProperties, 57 ) ;
 
menu.AddSeparator() ;
oItem = menu.AddItem( 'Row' , FCKLang.RowCM ) ;
oItem.AddItem( 'TableInsertRow' , FCKLang.InsertRow, 62 ) ;
oItem.AddItem( 'TableDeleteRows' , FCKLang.DeleteRows, 63 ) ;
menu.AddSeparator() ;
oItem = menu.AddItem( 'Column' , FCKLang.ColumnCM ) ;
oItem.AddItem( 'TableInsertColumn' , FCKLang.InsertColumn, 64 ) ;
oItem.AddItem( 'TableDeleteColumns' , FCKLang.DeleteColumns, 65 ) ;
}
 
if ( bIsTable || bIsCell )
{
menu.AddSeparator() ;
menu.AddItem( 'TableDelete' , FCKLang.TableDelete ) ;
menu.AddItem( 'TableProp' , FCKLang.TableProperties, 39 ) ;
}
}} ;
 
case 'Link' :
return {
AddItems : function( menu, tag, tagName )
{
var bInsideLink = ( tagName == 'A' || FCKSelection.HasAncestorNode( 'A' ) ) ;
 
if ( bInsideLink || FCK.GetNamedCommandState( 'Unlink' ) != FCK_TRISTATE_DISABLED )
{
menu.AddSeparator() ;
if ( bInsideLink )
menu.AddItem( 'Link', FCKLang.EditLink , 34 ) ;
menu.AddItem( 'Unlink' , FCKLang.RemoveLink , 35 ) ;
}
}} ;
 
case 'Image' :
return {
AddItems : function( menu, tag, tagName )
{
if ( tagName == 'IMG' && !tag.getAttribute( '_fckfakelement' ) )
{
menu.AddSeparator() ;
menu.AddItem( 'Image', FCKLang.ImageProperties, 37 ) ;
}
}} ;
 
case 'Anchor' :
return {
AddItems : function( menu, tag, tagName )
{
if ( tagName == 'IMG' && tag.getAttribute( '_fckanchor' ) )
{
menu.AddSeparator() ;
menu.AddItem( 'Anchor', FCKLang.AnchorProp, 36 ) ;
}
}} ;
 
case 'Flash' :
return {
AddItems : function( menu, tag, tagName )
{
if ( tagName == 'IMG' && tag.getAttribute( '_fckflash' ) )
{
menu.AddSeparator() ;
menu.AddItem( 'Flash', FCKLang.FlashProperties, 38 ) ;
}
}} ;
 
case 'Form' :
return {
AddItems : function( menu, tag, tagName )
{
if ( FCKSelection.HasAncestorNode('FORM') )
{
menu.AddSeparator() ;
menu.AddItem( 'Form', FCKLang.FormProp, 48 ) ;
}
}} ;
 
case 'Checkbox' :
return {
AddItems : function( menu, tag, tagName )
{
if ( tagName == 'INPUT' && tag.type == 'checkbox' )
{
menu.AddSeparator() ;
menu.AddItem( 'Checkbox', FCKLang.CheckboxProp, 49 ) ;
}
}} ;
 
case 'Radio' :
return {
AddItems : function( menu, tag, tagName )
{
if ( tagName == 'INPUT' && tag.type == 'radio' )
{
menu.AddSeparator() ;
menu.AddItem( 'Radio', FCKLang.RadioButtonProp, 50 ) ;
}
}} ;
 
case 'TextField' :
return {
AddItems : function( menu, tag, tagName )
{
if ( tagName == 'INPUT' && ( tag.type == 'text' || tag.type == 'password' ) )
{
menu.AddSeparator() ;
menu.AddItem( 'TextField', FCKLang.TextFieldProp, 51 ) ;
}
}} ;
 
case 'HiddenField' :
return {
AddItems : function( menu, tag, tagName )
{
if ( tagName == 'INPUT' && tag.type == 'hidden' )
{
menu.AddSeparator() ;
menu.AddItem( 'HiddenField', FCKLang.HiddenFieldProp, 56 ) ;
}
}} ;
 
case 'ImageButton' :
return {
AddItems : function( menu, tag, tagName )
{
if ( tagName == 'INPUT' && tag.type == 'image' )
{
menu.AddSeparator() ;
menu.AddItem( 'ImageButton', FCKLang.ImageButtonProp, 55 ) ;
}
}} ;
 
case 'Button' :
return {
AddItems : function( menu, tag, tagName )
{
if ( tagName == 'INPUT' && ( tag.type == 'button' || tag.type == 'submit' || tag.type == 'reset' ) )
{
menu.AddSeparator() ;
menu.AddItem( 'Button', FCKLang.ButtonProp, 54 ) ;
}
}} ;
 
case 'Select' :
return {
AddItems : function( menu, tag, tagName )
{
if ( tagName == 'SELECT' )
{
menu.AddSeparator() ;
menu.AddItem( 'Select', FCKLang.SelectionFieldProp, 53 ) ;
}
}} ;
 
case 'Textarea' :
return {
AddItems : function( menu, tag, tagName )
{
if ( tagName == 'TEXTAREA' )
{
menu.AddSeparator() ;
menu.AddItem( 'Textarea', FCKLang.TextareaProp, 52 ) ;
}
}} ;
 
case 'BulletedList' :
return {
AddItems : function( menu, tag, tagName )
{
if ( FCKSelection.HasAncestorNode('UL') )
{
menu.AddSeparator() ;
menu.AddItem( 'BulletedList', FCKLang.BulletedListProp, 27 ) ;
}
}} ;
 
case 'NumberedList' :
return {
AddItems : function( menu, tag, tagName )
{
if ( FCKSelection.HasAncestorNode('OL') )
{
menu.AddSeparator() ;
menu.AddItem( 'NumberedList', FCKLang.NumberedListProp, 26 ) ;
}
}} ;
}
}
 
function FCK_ContextMenu_OnBeforeOpen()
{
// Update the UI.
FCK.Events.FireEvent( "OnSelectionChange" ) ;
 
// Get the actual selected tag (if any).
var oTag, sTagName ;
if ( oTag = FCKSelection.GetSelectedElement() )
sTagName = oTag.tagName ;
 
// Cleanup the current menu items.
var oMenu = FCK.ContextMenu._InnerContextMenu ;
oMenu.RemoveAllItems() ;
 
// Loop through the listeners.
var aListeners = FCK.ContextMenu.Listeners ;
for ( var i = 0 ; i < aListeners.length ; i++ )
aListeners[i].AddItems( oMenu, oTag, sTagName ) ;
}
 
function FCK_ContextMenu_OnItemClick( item )
{
FCK.Focus() ;
FCKCommands.GetCommand( item.Name ).Execute() ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fckundo_gecko.js
New file
0,0 → 1,23
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckundo_gecko.js
* Fake implementation to ignore calls on Gecko.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKUndo = new Object() ;
 
FCKUndo.SaveUndoStep = function()
{}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fcktoolbarset.js
New file
0,0 → 1,352
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktoolbarset.js
* Defines the FCKToolbarSet object that is used to load and draw the
* toolbar.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
function FCKToolbarSet_Create( overhideLocation )
{
var oToolbarSet ;
var sLocation = overhideLocation || FCKConfig.ToolbarLocation ;
switch ( sLocation )
{
case 'In' :
document.getElementById( 'xToolbarRow' ).style.display = '' ;
oToolbarSet = new FCKToolbarSet( document ) ;
break ;
// case 'OutTop' :
// Not supported.
default :
FCK.Events.AttachEvent( 'OnBlur', FCK_OnBlur ) ;
FCK.Events.AttachEvent( 'OnFocus', FCK_OnFocus ) ;
 
var eToolbarTarget ;
// Out:[TargetWindow]([TargetId])
var oOutMatch = sLocation.match( /^Out:(.+)\((\w+)\)$/ ) ;
if ( oOutMatch )
{
eToolbarTarget = eval( 'parent.' + oOutMatch[1] ).document.getElementById( oOutMatch[2] ) ;
}
else
{
// Out:[TargetId]
oOutMatch = sLocation.match( /^Out:(\w+)$/ ) ;
if ( oOutMatch )
eToolbarTarget = parent.document.getElementById( oOutMatch[1] ) ;
}
if ( !eToolbarTarget )
{
alert( 'Invalid value for "ToolbarLocation"' ) ;
return this._Init( 'In' ) ;
}
// If it is a shared toolbar, it may be already available in the target element.
if ( oToolbarSet = eToolbarTarget.__FCKToolbarSet )
break ;
 
// Create the IFRAME that will hold the toolbar inside the target element.
var eToolbarIFrame = FCKTools.GetElementDocument( eToolbarTarget ).createElement( 'iframe' ) ;
eToolbarIFrame.frameBorder = 0 ;
eToolbarIFrame.width = '100%' ;
eToolbarIFrame.height = '10' ;
eToolbarTarget.appendChild( eToolbarIFrame ) ;
eToolbarIFrame.unselectable = 'on' ;
// Write the basic HTML for the toolbar (copy from the editor main page).
var eTargetDocument = eToolbarIFrame.contentWindow.document ;
eTargetDocument.open() ;
eTargetDocument.write( '<html><head><script type="text/javascript"> window.onload = window.onresize = function() { window.frameElement.height = document.body.scrollHeight ; } </script></head><body style="overflow: hidden">' + document.getElementById( 'xToolbarSpace' ).innerHTML + '</body></html>' ) ;
eTargetDocument.close() ;
eTargetDocument.oncontextmenu = FCKTools.CancelEvent ;
 
// Load external resources (must be done here, otherwise Firefox will not
// have the document DOM ready to be used right away.
FCKTools.AppendStyleSheet( eTargetDocument, FCKConfig.SkinPath + 'fck_editor.css' ) ;
oToolbarSet = eToolbarTarget.__FCKToolbarSet = new FCKToolbarSet( eTargetDocument ) ;
oToolbarSet._IFrame = eToolbarIFrame ;
 
if ( FCK.IECleanup )
FCK.IECleanup.AddItem( eToolbarTarget, FCKToolbarSet_Target_Cleanup ) ;
}
oToolbarSet.CurrentInstance = FCK ;
 
FCK.AttachToOnSelectionChange( oToolbarSet.RefreshItemsState ) ;
 
return oToolbarSet ;
}
 
function FCK_OnBlur( editorInstance )
{
var eToolbarSet = editorInstance.ToolbarSet ;
if ( eToolbarSet.CurrentInstance == editorInstance )
eToolbarSet.Disable() ;
}
 
function FCK_OnFocus( editorInstance )
{
var oToolbarset = editorInstance.ToolbarSet ;
var oInstance = editorInstance || FCK ;
// Unregister the toolbar window from the current instance.
oToolbarset.CurrentInstance.FocusManager.RemoveWindow( oToolbarset._IFrame.contentWindow ) ;
// Set the new current instance.
oToolbarset.CurrentInstance = oInstance ;
// Register the toolbar window in the current instance.
oInstance.FocusManager.AddWindow( oToolbarset._IFrame.contentWindow, true ) ;
 
oToolbarset.Enable() ;
}
 
function FCKToolbarSet_Cleanup()
{
this._TargetElement = null ;
this._IFrame = null ;
}
 
function FCKToolbarSet_Target_Cleanup()
{
this.__FCKToolbarSet = null ;
}
 
var FCKToolbarSet = function( targetDocument )
{
this._Document = targetDocument ;
 
// Get the element that will hold the elements structure.
this._TargetElement = targetDocument.getElementById( 'xToolbar' ) ;
// Setup the expand and collapse handlers.
var eExpandHandle = targetDocument.getElementById( 'xExpandHandle' ) ;
var eCollapseHandle = targetDocument.getElementById( 'xCollapseHandle' ) ;
 
eExpandHandle.title = FCKLang.ToolbarExpand ;
eExpandHandle.onclick = FCKToolbarSet_Expand_OnClick ;
eCollapseHandle.title = FCKLang.ToolbarCollapse ;
eCollapseHandle.onclick = FCKToolbarSet_Collapse_OnClick ;
 
// Set the toolbar state at startup.
if ( !FCKConfig.ToolbarCanCollapse || FCKConfig.ToolbarStartExpanded )
this.Expand() ;
else
this.Collapse() ;
 
// Enable/disable the collapse handler
eCollapseHandle.style.display = FCKConfig.ToolbarCanCollapse ? '' : 'none' ;
 
if ( FCKConfig.ToolbarCanCollapse )
eCollapseHandle.style.display = '' ;
else
targetDocument.getElementById( 'xTBLeftBorder' ).style.display = '' ;
// Set the default properties.
this.Toolbars = new Array() ;
this.IsLoaded = false ;
 
if ( FCK.IECleanup )
FCK.IECleanup.AddItem( this, FCKToolbarSet_Cleanup ) ;
}
 
function FCKToolbarSet_Expand_OnClick()
{
FCK.ToolbarSet.Expand() ;
}
 
function FCKToolbarSet_Collapse_OnClick()
{
FCK.ToolbarSet.Collapse() ;
}
 
FCKToolbarSet.prototype.Expand = function()
{
this._ChangeVisibility( false ) ;
}
 
FCKToolbarSet.prototype.Collapse = function()
{
this._ChangeVisibility( true ) ;
}
 
FCKToolbarSet.prototype._ChangeVisibility = function( collapse )
{
this._Document.getElementById( 'xCollapsed' ).style.display = collapse ? '' : 'none' ;
this._Document.getElementById( 'xExpanded' ).style.display = collapse ? 'none' : '' ;
if ( FCKBrowserInfo.IsGecko )
{
// I had to use "setTimeout" because Gecko was not responding in a right
// way when calling window.onresize() directly.
FCKTools.RunFunction( window.onresize ) ;
}
}
 
FCKToolbarSet.prototype.Load = function( toolbarSetName )
{
this.Name = toolbarSetName ;
 
this.Items = new Array() ;
// Reset the array of toolbat items that are active only on WYSIWYG mode.
this.ItemsWysiwygOnly = new Array() ;
 
// Reset the array of toolbar items that are sensitive to the cursor position.
this.ItemsContextSensitive = new Array() ;
// Cleanup the target element.
this._TargetElement.innerHTML = '' ;
var ToolbarSet = FCKConfig.ToolbarSets[toolbarSetName] ;
if ( !ToolbarSet )
{
alert( FCKLang.UnknownToolbarSet.replace( /%1/g, toolbarSetName ) ) ;
return ;
}
this.Toolbars = new Array() ;
for ( var x = 0 ; x < ToolbarSet.length ; x++ )
{
var oToolbarItems = ToolbarSet[x] ;
var oToolbar ;
if ( typeof( oToolbarItems ) == 'string' )
{
if ( oToolbarItems == '/' )
oToolbar = new FCKToolbarBreak() ;
}
else
{
oToolbar = new FCKToolbar() ;
for ( var j = 0 ; j < oToolbarItems.length ; j++ )
{
var sItem = oToolbarItems[j] ;
if ( sItem == '-')
oToolbar.AddSeparator() ;
else
{
var oItem = FCKToolbarItems.GetItem( sItem ) ;
if ( oItem )
{
oToolbar.AddItem( oItem ) ;
 
this.Items.push( oItem ) ;
 
if ( !oItem.SourceView )
this.ItemsWysiwygOnly.push( oItem ) ;
if ( oItem.ContextSensitive )
this.ItemsContextSensitive.push( oItem ) ;
}
}
}
// oToolbar.AddTerminator() ;
}
oToolbar.Create( this._TargetElement ) ;
 
this.Toolbars[ this.Toolbars.length ] = oToolbar ;
}
FCKTools.DisableSelection( this._Document.getElementById( 'xCollapseHandle' ).parentNode ) ;
 
if ( FCK.Status != FCK_STATUS_COMPLETE )
FCK.Events.AttachEvent( 'OnStatusChange', this.RefreshModeState ) ;
else
this.RefreshModeState() ;
 
this.IsLoaded = true ;
this.IsEnabled = true ;
 
FCKTools.RunFunction( this.OnLoad ) ;
}
 
FCKToolbarSet.prototype.Enable = function()
{
if ( this.IsEnabled )
return ;
 
this.IsEnabled = true ;
 
var aItems = this.Items ;
for ( var i = 0 ; i < aItems.length ; i++ )
aItems[i].RefreshState() ;
}
 
FCKToolbarSet.prototype.Disable = function()
{
if ( !this.IsEnabled )
return ;
 
this.IsEnabled = false ;
 
var aItems = this.Items ;
for ( var i = 0 ; i < aItems.length ; i++ )
aItems[i].Disable() ;
}
 
FCKToolbarSet.prototype.RefreshModeState = function( editorInstance )
{
if ( FCK.Status != FCK_STATUS_COMPLETE )
return ;
 
var oToolbarSet = editorInstance ? editorInstance.ToolbarSet : this ;
var aItems = oToolbarSet.ItemsWysiwygOnly ;
if ( FCK.EditMode == FCK_EDITMODE_WYSIWYG )
{
// Enable all buttons that are available on WYSIWYG mode only.
for ( var i = 0 ; i < aItems.length ; i++ )
aItems[i].Enable() ;
 
// Refresh the buttons state.
oToolbarSet.RefreshItemsState( editorInstance ) ;
}
else
{
// Refresh the buttons state.
oToolbarSet.RefreshItemsState( editorInstance ) ;
 
// Disable all buttons that are available on WYSIWYG mode only.
for ( var i = 0 ; i < aItems.length ; i++ )
aItems[i].Disable() ;
}
}
 
FCKToolbarSet.prototype.RefreshItemsState = function( editorInstance )
{
var aItems = ( editorInstance ? editorInstance.ToolbarSet : this ).ItemsContextSensitive ;
for ( var i = 0 ; i < aItems.length ; i++ )
aItems[i].RefreshState() ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fckundo_ie.js
New file
0,0 → 1,119
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckundo_ie.js
* IE specific implementation for the Undo/Redo system.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKUndo = new Object() ;
 
FCKUndo.SavedData = new Array() ;
FCKUndo.CurrentIndex = -1 ;
FCKUndo.TypesCount = FCKUndo.MaxTypes = 25 ;
FCKUndo.Typing = false ;
 
FCKUndo.SaveUndoStep = function()
{
if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
return ;
 
// Shrink the array to the current level.
FCKUndo.SavedData = FCKUndo.SavedData.slice( 0, FCKUndo.CurrentIndex + 1 ) ;
 
// Get the Actual HTML.
var sHtml = FCK.EditorDocument.body.innerHTML ;
 
// Cancel operation if the new step is identical to the previous one.
if ( FCKUndo.CurrentIndex >= 0 && sHtml == FCKUndo.SavedData[ FCKUndo.CurrentIndex ][0] )
return ;
 
// If we reach the Maximun number of undo levels, we must remove the first
// entry of the list shifting all elements.
if ( FCKUndo.CurrentIndex + 1 >= FCKConfig.MaxUndoLevels )
FCKUndo.SavedData.shift() ;
else
FCKUndo.CurrentIndex++ ;
 
// Get the actual selection.
var sBookmark ;
if ( FCK.EditorDocument.selection.type == 'Text' )
sBookmark = FCK.EditorDocument.selection.createRange().getBookmark() ;
 
// Save the new level in front of the actual position.
FCKUndo.SavedData[ FCKUndo.CurrentIndex ] = [ sHtml, sBookmark ] ;
 
FCK.Events.FireEvent( "OnSelectionChange" ) ;
}
 
FCKUndo.CheckUndoState = function()
{
return ( FCKUndo.Typing || FCKUndo.CurrentIndex > 0 ) ;
}
 
FCKUndo.CheckRedoState = function()
{
return ( !FCKUndo.Typing && FCKUndo.CurrentIndex < ( FCKUndo.SavedData.length - 1 ) ) ;
}
 
FCKUndo.Undo = function()
{
if ( FCKUndo.CheckUndoState() )
{
// If it is the first step.
if ( FCKUndo.CurrentIndex == ( FCKUndo.SavedData.length - 1 ) )
{
// Save the actual state for a possible "Redo" call.
FCKUndo.SaveUndoStep() ;
}
 
// Go a step back.
FCKUndo._ApplyUndoLevel( --FCKUndo.CurrentIndex ) ;
 
FCK.Events.FireEvent( "OnSelectionChange" ) ;
}
}
 
FCKUndo.Redo = function()
{
if ( FCKUndo.CheckRedoState() )
{
// Go a step forward.
FCKUndo._ApplyUndoLevel( ++FCKUndo.CurrentIndex ) ;
 
FCK.Events.FireEvent( "OnSelectionChange" ) ;
}
}
 
FCKUndo._ApplyUndoLevel = function(level)
{
var oData = FCKUndo.SavedData[ level ] ;
if ( !oData )
return ;
 
// Update the editor contents with that step data.
FCK.SetInnerHtml( oData[0] ) ;
// FCK.EditorDocument.body.innerHTML = oData[0] ;
 
if ( oData[1] )
{
var oRange = FCK.EditorDocument.selection.createRange() ;
oRange.moveToBookmark( oData[1] ) ;
oRange.select() ;
}
FCKUndo.TypesCount = 0 ;
FCKUndo.Typing = false ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fckdialog.js
New file
0,0 → 1,34
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckdialog.js
* Dialog windows operations.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKDialog = new Object() ;
 
// This method opens a dialog window using the standard dialog template.
FCKDialog.OpenDialog = function( dialogName, dialogTitle, dialogPage, width, height, customValue, parentWindow, resizable )
{
// Setup the dialog info.
var oDialogInfo = new Object() ;
oDialogInfo.Title = dialogTitle ;
oDialogInfo.Page = dialogPage ;
oDialogInfo.Editor = window ;
oDialogInfo.CustomValue = customValue ; // Optional
var sUrl = FCKConfig.BasePath + 'fckdialog.html' ;
this.Show( oDialogInfo, dialogName, sUrl, width, height, parentWindow, resizable ) ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fck_1.js
New file
0,0 → 1,410
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_1.js
* This is the first part of the "FCK" object creation. This is the main
* object that represents an editor instance.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCK_StartupValue ;
 
FCK.Events = new FCKEvents( FCK ) ;
FCK.Toolbar = null ;
FCK.HasFocus = false ;
 
FCK.StartEditor = function()
{
FCK.TempBaseTag = FCKConfig.BaseHref.length > 0 ? '<base href="' + FCKConfig.BaseHref + '" _fcktemp="true"></base>' : '' ;
 
FCK.EditingArea = new FCKEditingArea( document.getElementById( 'xEditingArea' ) ) ;
 
// Set the editor's startup contents
this.SetHTML( FCKTools.GetLinkedFieldValue() ) ;
}
 
FCK.Focus = function()
{
FCK.EditingArea.Focus() ;
}
 
FCK.SetStatus = function( newStatus )
{
this.Status = newStatus ;
 
if ( newStatus == FCK_STATUS_ACTIVE )
{
FCKFocusManager.AddWindow( window, true ) ;
if ( FCKBrowserInfo.IsIE )
FCKFocusManager.AddWindow( window.frameElement, true ) ;
 
// Force the focus in the editor.
if ( FCKConfig.StartupFocus )
FCK.Focus() ;
}
 
this.Events.FireEvent( 'OnStatusChange', newStatus ) ;
}
 
// GetHTML is Deprecated : returns the same value as GetXHTML.
FCK.GetHTML = FCK.GetXHTML = function( format )
{
// We assume that if the user is in source editing, the editor value must
// represent the exact contents of the source, as the user wanted it to be.
if ( FCK.EditMode == FCK_EDITMODE_SOURCE )
return FCK.EditingArea.Textarea.value ;
 
var sXHTML ;
var oDoc = FCK.EditorDocument ;
 
if ( FCKConfig.FullPage )
sXHTML = FCKXHtml.GetXHTML( oDoc.getElementsByTagName( 'html' )[0], true, format ) ;
else
{
if ( FCKConfig.IgnoreEmptyParagraphValue && oDoc.body.innerHTML == '<P>&nbsp;</P>' )
sXHTML = '' ;
else
sXHTML = FCKXHtml.GetXHTML( oDoc.body, false, format ) ;
}
// Restore protected attributes.
sXHTML = FCK.ProtectEventsRestore( sXHTML ) ;
 
if ( FCKBrowserInfo.IsIE )
sXHTML = sXHTML.replace( FCKRegexLib.ToReplace, '$1' ) ;
 
if ( FCK.DocTypeDeclaration && FCK.DocTypeDeclaration.length > 0 )
sXHTML = FCK.DocTypeDeclaration + '\n' + sXHTML ;
 
if ( FCK.XmlDeclaration && FCK.XmlDeclaration.length > 0 )
sXHTML = FCK.XmlDeclaration + '\n' + sXHTML ;
 
return FCKConfig.ProtectedSource.Revert( sXHTML ) ;
}
 
FCK.UpdateLinkedField = function()
{
FCK.LinkedField.value = FCK.GetXHTML( FCKConfig.FormatOutput ) ;
FCK.Events.FireEvent( 'OnAfterLinkedFieldUpdate' ) ;
}
 
FCK.RegisteredDoubleClickHandlers = new Object() ;
 
FCK.OnDoubleClick = function( element )
{
var oHandler = FCK.RegisteredDoubleClickHandlers[ element.tagName ] ;
if ( oHandler )
oHandler( element ) ;
}
 
// Register objects that can handle double click operations.
FCK.RegisterDoubleClickHandler = function( handlerFunction, tag )
{
FCK.RegisteredDoubleClickHandlers[ tag.toUpperCase() ] = handlerFunction ;
}
 
FCK.OnAfterSetHTML = function()
{
FCKDocumentProcessor.Process( FCK.EditorDocument ) ;
FCKUndo.SaveUndoStep() ;
FCK.Events.FireEvent( 'OnSelectionChange' ) ;
FCK.Events.FireEvent( 'OnAfterSetHTML' ) ;
}
 
// Saves URLs on links and images on special attributes, so they don't change when
// moving around.
FCK.ProtectUrls = function( html )
{
// <A> href
html = html.replace( FCKRegexLib.ProtectUrlsA , '$1$4$2$3$5$2 _fcksavedurl=$2$3$5$2' ) ;
 
// <IMG> src
html = html.replace( FCKRegexLib.ProtectUrlsImg , '$1$4$2$3$5$2 _fcksavedurl=$2$3$5$2' ) ;
return html ;
}
 
// Saves event attributes (like onclick) so they don't get executed while
// editing.
FCK.ProtectEvents = function( html )
{
return html.replace( FCKRegexLib.TagsWithEvent, _FCK_ProtectEvents_ReplaceTags ) ;
}
 
// Replace all events attributes (like onclick).
function _FCK_ProtectEvents_ReplaceTags( tagMatch )
{
return tagMatch.replace( FCKRegexLib.EventAttributes, _FCK_ProtectEvents_ReplaceEvents ) ;
}
 
// Replace an event attribute with its respective __fckprotectedatt attribute.
// The original event markup will be encoded and saved as the value of the new
// attribute.
function _FCK_ProtectEvents_ReplaceEvents( eventMatch, attName )
{
return ' ' + attName + '_fckprotectedatt="' + eventMatch.ReplaceAll( [/&/g,/'/g,/"/g,/=/g,/</g,/>/g,/\r/g,/\n/g], ['&apos;','&#39;','&quot;','&#61;','&lt;','&gt;','&#10;','&#13;'] ) + '"' ;
}
 
FCK.ProtectEventsRestore = function( html )
{
return html.replace( FCKRegexLib.ProtectedEvents, _FCK_ProtectEvents_RestoreEvents ) ;
}
 
function _FCK_ProtectEvents_RestoreEvents( match, encodedOriginal )
{
return encodedOriginal.ReplaceAll( [/&#39;/g,/&quot;/g,/&#61;/g,/&lt;/g,/&gt;/g,/&#10;/g,/&#13;/g,/&apos;/g], ["'",'"','=','<','>','\r','\n','&'] ) ;
}
 
FCK.IsDirty = function()
{
return ( FCK_StartupValue != FCK.EditorDocument.body.innerHTML ) ;
}
 
FCK.ResetIsDirty = function()
{
if ( FCK.EditorDocument.body )
FCK_StartupValue = FCK.EditorDocument.body.innerHTML ;
}
 
FCK.SetHTML = function( html )
{
this.EditingArea.Mode = FCK.EditMode ;
 
if ( FCK.EditMode == FCK_EDITMODE_WYSIWYG )
{
html = FCKConfig.ProtectedSource.Protect( html ) ;
html = FCK.ProtectEvents( html ) ;
html = FCK.ProtectUrls( html ) ;
 
// Firefox can't handle correctly the editing of the STRONG and EM tags.
// We must replace them with B and I.
if ( FCKBrowserInfo.IsGecko )
{
html = html.replace( FCKRegexLib.StrongOpener, '<b$1' ) ;
html = html.replace( FCKRegexLib.StrongCloser, '<\/b>' ) ;
html = html.replace( FCKRegexLib.EmOpener, '<i$1' ) ;
html = html.replace( FCKRegexLib.EmCloser, '<\/i>' ) ;
}
else if ( FCKBrowserInfo.IsIE )
{
// IE doesn't support <abbr> and it breaks it. Let's protect it.
html = html.replace( FCKRegexLib.AbbrOpener, '<FCK:abbr$1' ) ;
html = html.replace( FCKRegexLib.AbbrCloser, '<\/FCK:abbr>' ) ;
}
 
var sHtml = '' ;
 
if ( FCKConfig.FullPage )
{
// The HTML must be fixed if the <head> is not available.
if ( !FCKRegexLib.HeadOpener.test( html ) )
{
// Check if the <html> is available.
if ( !FCKRegexLib.HtmlOpener.test( html ) )
html = '<html dir="' + FCKConfig.ContentLangDirection + '">' + html + '</html>' ;
// Add the <head>.
html = html.replace( FCKRegexLib.HtmlOpener, '$&<head></head>' ) ;
}
// Save the DOCTYPE.
FCK.DocTypeDeclaration = html.match( FCKRegexLib.DocTypeTag ) ;
if ( FCKBrowserInfo.IsIE )
sHtml = FCK._GetBehaviorsStyle() ;
else if ( FCKConfig.ShowBorders )
sHtml = '<link href="' + FCKConfig.FullBasePath + 'css/fck_showtableborders_gecko.css" rel="stylesheet" type="text/css" _fcktemp="true" />' ;
 
sHtml += '<link href="' + FCKConfig.FullBasePath + 'css/fck_internal.css' + '" rel="stylesheet" type="text/css" _fcktemp="true" />' ;
 
sHtml = html.replace( FCKRegexLib.HeadCloser, sHtml + '$&' ) ;
 
// Insert the base tag (FCKConfig.BaseHref), if not exists in the source.
if ( FCK.TempBaseTag.length > 0 && !FCKRegexLib.HasBaseTag.test( html ) )
sHtml = sHtml.replace( FCKRegexLib.HeadOpener, '$&' + FCK.TempBaseTag ) ;
}
else
{
sHtml =
FCKConfig.DocType +
'<html dir="' + FCKConfig.ContentLangDirection + '"' ;
// On IE, if you are use a DOCTYPE differenft of HTML 4 (like
// XHTML), you must force the vertical scroll to show, otherwise
// the horizontal one may appear when the page needs vertical scrolling.
if ( FCKBrowserInfo.IsIE && !FCKRegexLib.Html4DocType.test( FCKConfig.DocType ) )
sHtml += ' style="overflow-y: scroll"' ;
sHtml +=
'><head><title></title>' +
this._GetEditorAreaStyleTags() +
'<link href="' + FCKConfig.FullBasePath + 'css/fck_internal.css' + '" rel="stylesheet" type="text/css" _fcktemp="true" />' ;
 
if ( FCKBrowserInfo.IsIE )
sHtml += FCK._GetBehaviorsStyle() ;
else if ( FCKConfig.ShowBorders )
sHtml += '<link href="' + FCKConfig.FullBasePath + 'css/fck_showtableborders_gecko.css" rel="stylesheet" type="text/css" _fcktemp="true" />' ;
 
sHtml += FCK.TempBaseTag ;
sHtml += '</head><body>' ;
if ( FCKBrowserInfo.IsGecko && ( html.length == 0 || FCKRegexLib.EmptyParagraph.test( html ) ) )
sHtml += GECKO_BOGUS ;
else
sHtml += html ;
sHtml += '</body></html>' ;
}
 
this.EditingArea.OnLoad = FCK_EditingArea_OnLoad ;
this.EditingArea.Start( sHtml ) ;
}
else
{
this.EditingArea.OnLoad = null ;
this.EditingArea.Start( html ) ;
// Enables the context menu in the textarea.
this.EditingArea.Textarea._FCKShowContextMenu = true ;
}
 
if ( FCKBrowserInfo.IsGecko )
window.onresize() ;
}
 
function FCK_EditingArea_OnLoad()
{
// Get the editor's window and document (DOM)
FCK.EditorWindow = FCK.EditingArea.Window ;
FCK.EditorDocument = FCK.EditingArea.Document ;
 
FCK.InitializeBehaviors() ;
 
FCK.OnAfterSetHTML() ;
 
// Check if it is not a startup call, otherwise complete the startup.
if ( FCK.Status != FCK_STATUS_NOTLOADED )
return ;
 
// Save the startup value for the "IsDirty()" check.
FCK.ResetIsDirty() ;
 
// Attach the editor to the form onsubmit event
FCKTools.AttachToLinkedFieldFormSubmit( FCK.UpdateLinkedField ) ;
 
FCK.SetStatus( FCK_STATUS_ACTIVE ) ;
}
 
FCK._GetEditorAreaStyleTags = function()
{
var sTags = '' ;
var aCSSs = FCKConfig.EditorAreaCSS ;
for ( var i = 0 ; i < aCSSs.length ; i++ )
sTags += '<link href="' + aCSSs[i] + '" rel="stylesheet" type="text/css" />' ;
return sTags ;
}
 
// # Focus Manager: Manages the focus in the editor.
var FCKFocusManager = FCK.FocusManager = new Object() ;
FCKFocusManager.IsLocked = false ;
FCK.HasFocus = false ;
 
FCKFocusManager.AddWindow = function( win, sendToEditingArea )
{
var oTarget ;
if ( FCKBrowserInfo.IsIE )
oTarget = win.nodeType == 1 ? win : win.frameElement ? win.frameElement : win.document ;
else
oTarget = win.document ;
FCKTools.AddEventListener( oTarget, 'blur', FCKFocusManager_Win_OnBlur ) ;
FCKTools.AddEventListener( oTarget, 'focus', sendToEditingArea ? FCKFocusManager_Win_OnFocus_Area : FCKFocusManager_Win_OnFocus ) ;
}
 
FCKFocusManager.RemoveWindow = function( win )
{
if ( FCKBrowserInfo.IsIE )
oTarget = win.nodeType == 1 ? win : win.frameElement ? win.frameElement : win.document ;
else
oTarget = win.document ;
 
FCKTools.RemoveEventListener( oTarget, 'blur', FCKFocusManager_Win_OnBlur ) ;
FCKTools.RemoveEventListener( oTarget, 'focus', FCKFocusManager_Win_OnFocus_Area ) ;
FCKTools.RemoveEventListener( oTarget, 'focus', FCKFocusManager_Win_OnFocus ) ;
}
 
FCKFocusManager.Lock = function()
{
this.IsLocked = true ;
}
 
FCKFocusManager.Unlock = function()
{
if ( this._HasPendingBlur )
FCKFocusManager._Timer = window.setTimeout( FCKFocusManager_FireOnBlur, 100 ) ;
this.IsLocked = false ;
}
 
FCKFocusManager._ResetTimer = function()
{
this._HasPendingBlur = false ;
 
if ( this._Timer )
{
window.clearTimeout( this._Timer ) ;
delete this._Timer ;
}
}
 
function FCKFocusManager_Win_OnBlur()
{
if ( typeof(FCK) != 'undefined' && FCK.HasFocus )
{
FCKFocusManager._ResetTimer() ;
FCKFocusManager._Timer = window.setTimeout( FCKFocusManager_FireOnBlur, 100 ) ;
}
}
 
function FCKFocusManager_FireOnBlur()
{
if ( FCKFocusManager.IsLocked )
FCKFocusManager._HasPendingBlur = true ;
else
{
FCK.HasFocus = false ;
FCK.Events.FireEvent( "OnBlur" ) ;
}
}
 
function FCKFocusManager_Win_OnFocus_Area()
{
FCKFocusManager_Win_OnFocus() ;
FCK.Focus() ;
}
 
function FCKFocusManager_Win_OnFocus()
{
FCKFocusManager._ResetTimer() ;
 
if ( !FCK.HasFocus && !FCKFocusManager.IsLocked )
{
FCK.HasFocus = true ;
FCK.Events.FireEvent( "OnFocus" ) ;
}
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fckbrowserinfo.js
New file
0,0 → 1,37
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckbrowserinfo.js
* Contains browser detection information.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var s = navigator.userAgent.toLowerCase() ;
 
var FCKBrowserInfo =
{
IsIE : s.Contains('msie'),
IsIE7 : s.Contains('msie 7'),
IsGecko : s.Contains('gecko/'),
IsSafari : s.Contains('safari'),
IsOpera : s.Contains('opera')
}
 
FCKBrowserInfo.IsGeckoLike = FCKBrowserInfo.IsGecko || FCKBrowserInfo.IsSafari || FCKBrowserInfo.IsOpera ;
 
if ( FCKBrowserInfo.IsGecko )
{
var sGeckoVersion = s.match( /gecko\/(\d+)/ )[1] ;
FCKBrowserInfo.IsGecko10 = sGeckoVersion < 20051111 ; // Actually "10" refers to versions before Firefox 1.5, where Gecko 20051111 has been released.
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/_source/internals/fckcommands.js
New file
0,0 → 1,126
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckcommands.js
* Define all commands available in the editor.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKCommands = FCK.Commands = new Object() ;
FCKCommands.LoadedCommands = new Object() ;
 
FCKCommands.RegisterCommand = function( commandName, command )
{
this.LoadedCommands[ commandName ] = command ;
}
 
FCKCommands.GetCommand = function( commandName )
{
var oCommand = FCKCommands.LoadedCommands[ commandName ] ;
if ( oCommand )
return oCommand ;
 
switch ( commandName )
{
case 'DocProps' : oCommand = new FCKDialogCommand( 'DocProps' , FCKLang.DocProps , 'dialog/fck_docprops.html' , 400, 390, FCKCommands.GetFullPageState ) ; break ;
case 'Templates' : oCommand = new FCKDialogCommand( 'Templates' , FCKLang.DlgTemplatesTitle , 'dialog/fck_template.html' , 380, 450 ) ; break ;
case 'Link' : oCommand = new FCKDialogCommand( 'Link' , FCKLang.DlgLnkWindowTitle , 'dialog/fck_link.html' , 400, 330, FCK.GetNamedCommandState, 'CreateLink' ) ; break ;
case 'Unlink' : oCommand = new FCKUnlinkCommand() ; break ;
case 'Anchor' : oCommand = new FCKDialogCommand( 'Anchor' , FCKLang.DlgAnchorTitle , 'dialog/fck_anchor.html' , 370, 170 ) ; break ;
case 'BulletedList' : oCommand = new FCKDialogCommand( 'BulletedList', FCKLang.BulletedListProp , 'dialog/fck_listprop.html' , 370, 170 ) ; break ;
case 'NumberedList' : oCommand = new FCKDialogCommand( 'NumberedList', FCKLang.NumberedListProp , 'dialog/fck_listprop.html' , 370, 170 ) ; break ;
case 'About' : oCommand = new FCKDialogCommand( 'About' , FCKLang.About , 'dialog/fck_about.html' , 400, 330 ) ; break ;
 
case 'Find' : oCommand = new FCKDialogCommand( 'Find' , FCKLang.DlgFindTitle , 'dialog/fck_find.html' , 340, 170 ) ; break ;
case 'Replace' : oCommand = new FCKDialogCommand( 'Replace' , FCKLang.DlgReplaceTitle , 'dialog/fck_replace.html' , 340, 200 ) ; break ;
 
case 'Image' : oCommand = new FCKDialogCommand( 'Image' , FCKLang.DlgImgTitle , 'dialog/fck_image.html' , 450, 400 ) ; break ;
case 'Flash' : oCommand = new FCKDialogCommand( 'Flash' , FCKLang.DlgFlashTitle , 'dialog/fck_flash.html' , 450, 400 ) ; break ;
case 'SpecialChar' : oCommand = new FCKDialogCommand( 'SpecialChar', FCKLang.DlgSpecialCharTitle , 'dialog/fck_specialchar.html' , 400, 320 ) ; break ;
case 'Smiley' : oCommand = new FCKDialogCommand( 'Smiley' , FCKLang.DlgSmileyTitle , 'dialog/fck_smiley.html' , FCKConfig.SmileyWindowWidth, FCKConfig.SmileyWindowHeight ) ; break ;
case 'Table' : oCommand = new FCKDialogCommand( 'Table' , FCKLang.DlgTableTitle , 'dialog/fck_table.html' , 450, 250 ) ; break ;
case 'TableProp' : oCommand = new FCKDialogCommand( 'Table' , FCKLang.DlgTableTitle , 'dialog/fck_table.html?Parent', 400, 250 ) ; break ;
case 'TableCellProp': oCommand = new FCKDialogCommand( 'TableCell' , FCKLang.DlgCellTitle , 'dialog/fck_tablecell.html' , 550, 250 ) ; break ;
case 'UniversalKey' : oCommand = new FCKDialogCommand( 'UniversalKey', FCKLang.UniversalKeyboard , 'dialog/fck_universalkey.html', 415, 300 ) ; break ;
 
case 'Style' : oCommand = new FCKStyleCommand() ; break ;
 
case 'FontName' : oCommand = new FCKFontNameCommand() ; break ;
case 'FontSize' : oCommand = new FCKFontSizeCommand() ; break ;
case 'FontFormat' : oCommand = new FCKFormatBlockCommand() ; break ;
 
case 'Source' : oCommand = new FCKSourceCommand() ; break ;
case 'Preview' : oCommand = new FCKPreviewCommand() ; break ;
case 'Save' : oCommand = new FCKSaveCommand() ; break ;
case 'NewPage' : oCommand = new FCKNewPageCommand() ; break ;
case 'PageBreak' : oCommand = new FCKPageBreakCommand() ; break ;
 
case 'TextColor' : oCommand = new FCKTextColorCommand('ForeColor') ; break ;
case 'BGColor' : oCommand = new FCKTextColorCommand('BackColor') ; break ;
 
case 'PasteText' : oCommand = new FCKPastePlainTextCommand() ; break ;
case 'PasteWord' : oCommand = new FCKPasteWordCommand() ; break ;
 
case 'TableInsertRow' : oCommand = new FCKTableCommand('TableInsertRow') ; break ;
case 'TableDeleteRows' : oCommand = new FCKTableCommand('TableDeleteRows') ; break ;
case 'TableInsertColumn' : oCommand = new FCKTableCommand('TableInsertColumn') ; break ;
case 'TableDeleteColumns' : oCommand = new FCKTableCommand('TableDeleteColumns') ; break ;
case 'TableInsertCell' : oCommand = new FCKTableCommand('TableInsertCell') ; break ;
case 'TableDeleteCells' : oCommand = new FCKTableCommand('TableDeleteCells') ; break ;
case 'TableMergeCells' : oCommand = new FCKTableCommand('TableMergeCells') ; break ;
case 'TableSplitCell' : oCommand = new FCKTableCommand('TableSplitCell') ; break ;
case 'TableDelete' : oCommand = new FCKTableCommand('TableDelete') ; break ;
 
case 'Form' : oCommand = new FCKDialogCommand( 'Form' , FCKLang.Form , 'dialog/fck_form.html' , 380, 230 ) ; break ;
case 'Checkbox' : oCommand = new FCKDialogCommand( 'Checkbox' , FCKLang.Checkbox , 'dialog/fck_checkbox.html' , 380, 230 ) ; break ;
case 'Radio' : oCommand = new FCKDialogCommand( 'Radio' , FCKLang.RadioButton , 'dialog/fck_radiobutton.html' , 380, 230 ) ; break ;
case 'TextField' : oCommand = new FCKDialogCommand( 'TextField' , FCKLang.TextField , 'dialog/fck_textfield.html' , 380, 230 ) ; break ;
case 'Textarea' : oCommand = new FCKDialogCommand( 'Textarea' , FCKLang.Textarea , 'dialog/fck_textarea.html' , 380, 230 ) ; break ;
case 'HiddenField' : oCommand = new FCKDialogCommand( 'HiddenField', FCKLang.HiddenField , 'dialog/fck_hiddenfield.html' , 380, 230 ) ; break ;
case 'Button' : oCommand = new FCKDialogCommand( 'Button' , FCKLang.Button , 'dialog/fck_button.html' , 380, 230 ) ; break ;
case 'Select' : oCommand = new FCKDialogCommand( 'Select' , FCKLang.SelectionField, 'dialog/fck_select.html' , 400, 380 ) ; break ;
case 'ImageButton' : oCommand = new FCKDialogCommand( 'ImageButton', FCKLang.ImageButton , 'dialog/fck_image.html?ImageButton', 450, 400 ) ; break ;
 
case 'SpellCheck' : oCommand = new FCKSpellCheckCommand() ; break ;
case 'FitWindow' : oCommand = new FCKFitWindow() ; break ;
 
case 'Undo' : oCommand = new FCKUndoCommand() ; break ;
case 'Redo' : oCommand = new FCKRedoCommand() ; break ;
 
// Generic Undefined command (usually used when a command is under development).
case 'Undefined' : oCommand = new FCKUndefinedCommand() ; break ;
// By default we assume that it is a named command.
default:
if ( FCKRegexLib.NamedCommands.test( commandName ) )
oCommand = new FCKNamedCommand( commandName ) ;
else
{
alert( FCKLang.UnknownCommand.replace( /%1/g, commandName ) ) ;
return null ;
}
}
FCKCommands.LoadedCommands[ commandName ] = oCommand ;
return oCommand ;
}
 
// Gets the state of the "Document Properties" button. It must be enabled only
// when "Full Page" editing is available.
FCKCommands.GetFullPageState = function()
{
return FCKConfig.FullPage ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controls.html
New file
0,0 → 1,153
<html>
<head>
<link rel="stylesheet" type="text/css" href="spellerStyle.css" />
<script src="controlWindow.js"></script>
<script>
var spellerObject;
var controlWindowObj;
 
if( parent.opener ) {
spellerObject = parent.opener.speller;
}
 
function ignore_word() {
if( spellerObject ) {
spellerObject.ignoreWord();
}
}
 
function ignore_all() {
if( spellerObject ) {
spellerObject.ignoreAll();
}
}
 
function replace_word() {
if( spellerObject ) {
spellerObject.replaceWord();
}
}
 
function replace_all() {
if( spellerObject ) {
spellerObject.replaceAll();
}
}
 
function end_spell() {
if( spellerObject ) {
spellerObject.terminateSpell();
}
}
 
function undo() {
if( spellerObject ) {
spellerObject.undo();
}
}
 
function suggText() {
if( controlWindowObj ) {
controlWindowObj.setSuggestedText();
}
}
 
var FCKLang = window.parent.parent.FCKLang ; // by FredCK
 
function init_spell() {
// By FredCK (fckLang attributes have been added to the HTML source of this page)
window.parent.parent.OnSpellerControlsLoad( this ) ;
 
var controlForm = document.spellcheck;
 
// create a new controlWindow object
controlWindowObj = new controlWindow( controlForm );
 
// call the init_spell() function in the parent frameset
if( parent.frames.length ) {
parent.init_spell( controlWindowObj );
} else {
alert( 'This page was loaded outside of a frameset. It might not display properly' );
}
}
 
</script>
</head>
<body class="controlWindowBody" onLoad="init_spell();" style="OVERFLOW: hidden" scroll="no"> <!-- by FredCK -->
<form name="spellcheck">
<table border="0" cellpadding="0" cellspacing="0" border="0" align="center">
<tr>
<td colspan="3" class="normalLabel"><span fckLang="DlgSpellNotInDic">Not in dictionary:</span></td>
</tr>
<tr>
<td colspan="3"><input class="readonlyInput" type="text" name="misword" readonly /></td>
</tr>
<tr>
<td colspan="3" height="5"></td>
</tr>
<tr>
<td class="normalLabel"><span fckLang="DlgSpellChangeTo">Change to:</span></td>
</tr>
<tr valign="top">
<td>
<table border="0" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="normalLabel">
<input class="textDefault" type="text" name="txtsugg" />
</td>
</tr>
<tr>
<td>
<select class="suggSlct" name="sugg" size="7" onChange="suggText();" onDblClick="replace_word();">
<option></option>
</select>
</td>
</tr>
</table>
</td>
<td>&nbsp;&nbsp;</td>
<td>
<table border="0" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<input class="buttonDefault" type="button" fckLang="DlgSpellBtnIgnore" value="Ignore" onClick="ignore_word();">
</td>
<td>&nbsp;&nbsp;</td>
<td>
<input class="buttonDefault" type="button" fckLang="DlgSpellBtnIgnoreAll" value="Ignore All" onClick="ignore_all();">
</td>
</tr>
<tr>
<td colspan="3" height="5"></td>
</tr>
<tr>
<td>
<input class="buttonDefault" type="button" fckLang="DlgSpellBtnReplace" value="Replace" onClick="replace_word();">
</td>
<td>&nbsp;&nbsp;</td>
<td>
<input class="buttonDefault" type="button" fckLang="DlgSpellBtnReplaceAll" value="Replace All" onClick="replace_all();">
</td>
</tr>
<tr>
<td colspan="3" height="5"></td>
</tr>
<tr>
<td>
<input class="buttonDefault" type="button" name="btnUndo" fckLang="DlgSpellBtnUndo" value="Undo" onClick="undo();"
disabled>
</td>
<td>&nbsp;&nbsp;</td>
<td>
<!-- by FredCK
<input class="buttonDefault" type="button" value="Close" onClick="end_spell();">
-->
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellchecker.html
New file
0,0 → 1,71
 
<script>
 
var wordWindow = null;
var controlWindow = null;
 
function init_spell( spellerWindow ) {
 
if( spellerWindow ) {
if( spellerWindow.windowType == "wordWindow" ) {
wordWindow = spellerWindow;
} else if ( spellerWindow.windowType == "controlWindow" ) {
controlWindow = spellerWindow;
}
}
 
if( controlWindow && wordWindow ) {
// populate the speller object and start it off!
var speller = opener.speller;
wordWindow.speller = speller;
speller.startCheck( wordWindow, controlWindow );
}
}
 
// encodeForPost
function encodeForPost( str ) {
var s = new String( str );
s = encodeURIComponent( s );
// additionally encode single quotes to evade any PHP
// magic_quotes_gpc setting (it inserts escape characters and
// therefore skews the btye positions of misspelled words)
return s.replace( /\'/g, '%27' );
}
 
// post the text area data to the script that populates the speller
function postWords() {
var bodyDoc = window.frames[0].document;
bodyDoc.open();
bodyDoc.write('<html>');
bodyDoc.write('<meta http-equiv="Content-Type" content="text/html; charset=utf-8">');
bodyDoc.write('<link rel="stylesheet" type="text/css" href="spellerStyle.css"/>');
if (opener) {
var speller = opener.speller;
bodyDoc.write('<body class="normalText" onLoad="document.forms[0].submit();">');
bodyDoc.write('<p>' + window.parent.FCKLang.DlgSpellProgress + '<\/p>'); // by FredCK
bodyDoc.write('<form action="'+speller.spellCheckScript+'" method="post">');
for( var i = 0; i < speller.textInputs.length; i++ ) {
bodyDoc.write('<input type="hidden" name="textinputs[]" value="'+encodeForPost(speller.textInputs[i].value)+'">');
}
bodyDoc.write('<\/form>');
bodyDoc.write('<\/body>');
} else {
bodyDoc.write('<body class="normalText">');
bodyDoc.write('<p><b>This page cannot be displayed<\/b><\/p><p>The window was not opened from another window.<\/p>');
bodyDoc.write('<\/body>');
}
bodyDoc.write('<\/html>');
bodyDoc.close();
}
</script>
 
<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<head>
<title>Speller Pages</title>
</head>
<frameset rows="*,201" onLoad="postWords();">
<frame src="blank.html">
<frame src="controls.html">
</frameset>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_spellerpages/spellerpages/blank.html
--- fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.php (revision 0)
+++ fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.php (revision 1371)
@@ -0,0 +1,193 @@
+<?php
+header('Content-type: text/html; charset=utf-8');
+
+//$spellercss = '/speller/spellerStyle.css'; // by FredCK
+$spellercss = '../spellerStyle.css'; // by FredCK
+//$word_win_src = '/speller/wordWindow.js'; // by FredCK
+$word_win_src = '../wordWindow.js'; // by FredCK
+$textinputs = $_POST['textinputs']; # array
+//$aspell_prog = 'aspell'; // by FredCK (for Linux)
+$aspell_prog = '"C:\Program Files\Aspell\bin\aspell.exe"'; // by FredCK (for Windows)
+$lang = 'en_US';
+//$aspell_opts = "-a --lang=$lang --encoding=utf-8"; // by FredCK
+$aspell_opts = "-a --lang=$lang --encoding=utf-8 -H"; // by FredCK
+$tempfiledir = "./";
+$input_separator = "A";
+
+# set the JavaScript variable to the submitted text.
+# textinputs is an array, each element corresponding to the (url-encoded)
+# value of the text control submitted for spell-checking
+function print_textinputs_var() {
+ global $textinputs;
+ foreach( $textinputs as $key=>$val ) {
+ # $val = str_replace( "'", "%27", $val );
+ echo "textinputs[$key] = decodeURIComponent(\"" . $val . "\");\n";
+ }
+}
+
+# make declarations for the text input index
+function print_textindex_decl( $text_input_idx ) {
+ echo "words[$text_input_idx] = [];\n";
+ echo "suggs[$text_input_idx] = [];\n";
+}
+
+# set an element of the JavaScript 'words' array to a misspelled word
+function print_words_elem( $word, $index, $text_input_idx ) {
+ echo "words[$text_input_idx][$index] = '" . escape_quote( $word ) . "';\n";
+}
+
+
+# set an element of the JavaScript 'suggs' array to a list of suggestions
+function print_suggs_elem( $suggs, $index, $text_input_idx ) {
+ echo "suggs[$text_input_idx][$index] = [";
+ foreach( $suggs as $key=>$val ) {
+ if( $val ) {
+ echo "'" . escape_quote( $val ) . "'";
+ if ( $key+1 < count( $suggs )) {
+ echo ", ";
+ }
+ }
+ }
+ echo "];\n";
+}
+
+# escape single quote
+function escape_quote( $str ) {
+ return preg_replace ( "/'/", "\\'", $str );
+}
+
+
+# handle a server-side error.
+function error_handler( $err ) {
+ echo "error = '" . escape_quote( $err ) . "';\n";
+}
+
+## get the list of misspelled words. Put the results in the javascript words array
+## for each misspelled word, get suggestions and put in the javascript suggs array
+function print_checker_results() {
+
+ global $aspell_prog;
+ global $aspell_opts;
+ global $tempfiledir;
+ global $textinputs;
+ global $input_separator;
+ $aspell_err = "";
+ # create temp file
+ $tempfile = tempnam( $tempfiledir, 'aspell_data_' );
+
+ # open temp file, add the submitted text.
+ if( $fh = fopen( $tempfile, 'w' )) {
+ for( $i = 0; $i < count( $textinputs ); $i++ ) {
+ $text = urldecode( $textinputs[$i] );
+ $lines = explode( "\n", $text );
+ fwrite ( $fh, "%\n" ); # exit terse mode
+ fwrite ( $fh, "^$input_separator\n" );
+ fwrite ( $fh, "!\n" ); # enter terse mode
+ foreach( $lines as $key=>$value ) {
+ # use carat on each line to escape possible aspell commands
+ fwrite( $fh, "^$value\n" );
+ }
+ }
+ fclose( $fh );
+
+ # exec aspell command - redirect STDERR to STDOUT
+ $cmd = "$aspell_prog $aspell_opts < $tempfile 2>&1";
+ if( $aspellret = shell_exec( $cmd )) {
+ $linesout = explode( "\n", $aspellret );
+ $index = 0;
+ $text_input_index = -1;
+ # parse each line of aspell return
+ foreach( $linesout as $key=>$val ) {
+ $chardesc = substr( $val, 0, 1 );
+ # if '&', then not in dictionary but has suggestions
+ # if '#', then not in dictionary and no suggestions
+ # if '*', then it is a delimiter between text inputs
+ # if '@' then version info
+ if( $chardesc == '&' || $chardesc == '#' ) {
+ $line = explode( " ", $val, 5 );
+ print_words_elem( $line[1], $index, $text_input_index );
+ if( isset( $line[4] )) {
+ $suggs = explode( ", ", $line[4] );
+ } else {
+ $suggs = array();
+ }
+ print_suggs_elem( $suggs, $index, $text_input_index );
+ $index++;
+ } elseif( $chardesc == '*' ) {
+ $text_input_index++;
+ print_textindex_decl( $text_input_index );
+ $index = 0;
+ } elseif( $chardesc != '@' && $chardesc != "" ) {
+ # assume this is error output
+ $aspell_err .= $val;
+ }
+ }
+ if( $aspell_err ) {
+ $aspell_err = "Error executing `$cmd`\\n$aspell_err";
+ error_handler( $aspell_err );
+ }
+ } else {
+ error_handler( "System error: Aspell program execution failed (`$cmd`)" );
+ }
+ } else {
+ error_handler( "System error: Could not open file '$tempfile' for writing" );
+ }
+
+ # close temp file, delete file
+ unlink( $tempfile );
+}
+
+
+?>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel="stylesheet" type="text/css" href="<?php echo $spellercss ?>" />
+<script language="javascript" src="<?php echo $word_win_src ?>"></script>
+<script language="javascript">
+var suggs = new Array();
+var words = new Array();
+var textinputs = new Array();
+var error;
+<?php
+
+print_textinputs_var();
+
+print_checker_results();
+
+?>
+
+var wordWindowObj = new wordWindow();
+wordWindowObj.originalSpellings = words;
+wordWindowObj.suggestions = suggs;
+wordWindowObj.textInputs = textinputs;
+
+function init_spell() {
+ // check if any error occured during server-side processing
+ if( error ) {
+ alert( error );
+ } else {
+ // call the init_spell() function in the parent frameset
+ if (parent.frames.length) {
+ parent.init_spell( wordWindowObj );
+ } else {
+ alert('This page was loaded outside of a frameset. It might not display properly');
+ }
+ }
+}
+
+
+
+</script>
+
+</head>
+<!-- <body onLoad="init_spell();"> by FredCK -->
+<body onLoad="init_spell();" bgcolor="#ffffff">
+
+<script type="text/javascript">
+wordWindowObj.writeBody();
+</script>
+
+</body>
+</html>
+
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.cfm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.cfm
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellerStyle.css
New file
0,0 → 1,49
.blend {
font-family: courier new;
font-size: 10pt;
border: 0;
margin-bottom:-1;
}
.normalLabel {
font-size:8pt;
}
.normalText {
font-family:arial, helvetica, sans-serif;
font-size:10pt;
color:000000;
background-color:FFFFFF;
}
.plainText {
font-family: courier new, courier, monospace;
font-size: 10pt;
color:000000;
background-color:FFFFFF;
}
.controlWindowBody {
font-family:arial, helvetica, sans-serif;
font-size:8pt;
padding: 7px ; /* by FredCK */
margin: 0px ; /* by FredCK */
/* color:000000; by FredCK */
/* background-color:DADADA; by FredCK */
}
.readonlyInput {
background-color:DADADA;
color:000000;
font-size:8pt;
width:392px;
}
.textDefault {
font-size:8pt;
width: 200px;
}
.buttonDefault {
width:90px;
height:22px;
font-size:8pt;
}
.suggSlct {
width:200px;
margin-top:2;
font-size:8pt;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_spellerpages/spellerpages/wordWindow.js
New file
0,0 → 1,271
////////////////////////////////////////////////////
// wordWindow object
////////////////////////////////////////////////////
function wordWindow() {
// private properties
this._forms = [];
 
// private methods
this._getWordObject = _getWordObject;
//this._getSpellerObject = _getSpellerObject;
this._wordInputStr = _wordInputStr;
this._adjustIndexes = _adjustIndexes;
this._isWordChar = _isWordChar;
this._lastPos = _lastPos;
// public properties
this.wordChar = /[a-zA-Z]/;
this.windowType = "wordWindow";
this.originalSpellings = new Array();
this.suggestions = new Array();
this.checkWordBgColor = "pink";
this.normWordBgColor = "white";
this.text = "";
this.textInputs = new Array();
this.indexes = new Array();
//this.speller = this._getSpellerObject();
 
// public methods
this.resetForm = resetForm;
this.totalMisspellings = totalMisspellings;
this.totalWords = totalWords;
this.totalPreviousWords = totalPreviousWords;
//this.getTextObjectArray = getTextObjectArray;
this.getTextVal = getTextVal;
this.setFocus = setFocus;
this.removeFocus = removeFocus;
this.setText = setText;
//this.getTotalWords = getTotalWords;
this.writeBody = writeBody;
this.printForHtml = printForHtml;
}
 
function resetForm() {
if( this._forms ) {
for( var i = 0; i < this._forms.length; i++ ) {
this._forms[i].reset();
}
}
return true;
}
 
function totalMisspellings() {
var total_words = 0;
for( var i = 0; i < this.textInputs.length; i++ ) {
total_words += this.totalWords( i );
}
return total_words;
}
 
function totalWords( textIndex ) {
return this.originalSpellings[textIndex].length;
}
 
function totalPreviousWords( textIndex, wordIndex ) {
var total_words = 0;
for( var i = 0; i <= textIndex; i++ ) {
for( var j = 0; j < this.totalWords( i ); j++ ) {
if( i == textIndex && j == wordIndex ) {
break;
} else {
total_words++;
}
}
}
return total_words;
}
 
//function getTextObjectArray() {
// return this._form.elements;
//}
 
function getTextVal( textIndex, wordIndex ) {
var word = this._getWordObject( textIndex, wordIndex );
if( word ) {
return word.value;
}
}
 
function setFocus( textIndex, wordIndex ) {
var word = this._getWordObject( textIndex, wordIndex );
if( word ) {
if( word.type == "text" ) {
word.focus();
word.style.backgroundColor = this.checkWordBgColor;
}
}
}
 
function removeFocus( textIndex, wordIndex ) {
var word = this._getWordObject( textIndex, wordIndex );
if( word ) {
if( word.type == "text" ) {
word.blur();
word.style.backgroundColor = this.normWordBgColor;
}
}
}
 
function setText( textIndex, wordIndex, newText ) {
var word = this._getWordObject( textIndex, wordIndex );
var beginStr;
var endStr;
if( word ) {
var pos = this.indexes[textIndex][wordIndex];
var oldText = word.value;
// update the text given the index of the string
beginStr = this.textInputs[textIndex].substring( 0, pos );
endStr = this.textInputs[textIndex].substring(
pos + oldText.length,
this.textInputs[textIndex].length
);
this.textInputs[textIndex] = beginStr + newText + endStr;
// adjust the indexes on the stack given the differences in
// length between the new word and old word.
var lengthDiff = newText.length - oldText.length;
this._adjustIndexes( textIndex, wordIndex, lengthDiff );
word.size = newText.length;
word.value = newText;
this.removeFocus( textIndex, wordIndex );
}
}
 
 
function writeBody() {
var d = window.document;
var is_html = false;
 
d.open();
 
// iterate through each text input.
for( var txtid = 0; txtid < this.textInputs.length; txtid++ ) {
var end_idx = 0;
var begin_idx = 0;
d.writeln( '<form name="textInput'+txtid+'">' );
var wordtxt = this.textInputs[txtid];
this.indexes[txtid] = [];
 
if( wordtxt ) {
var orig = this.originalSpellings[txtid];
if( !orig ) break;
 
//!!! plain text, or HTML mode?
d.writeln( '<div class="plainText">' );
// iterate through each occurrence of a misspelled word.
for( var i = 0; i < orig.length; i++ ) {
// find the position of the current misspelled word,
// starting at the last misspelled word.
// and keep looking if it's a substring of another word
do {
begin_idx = wordtxt.indexOf( orig[i], end_idx );
end_idx = begin_idx + orig[i].length;
// word not found? messed up!
if( begin_idx == -1 ) break;
// look at the characters immediately before and after
// the word. If they are word characters we'll keep looking.
var before_char = wordtxt.charAt( begin_idx - 1 );
var after_char = wordtxt.charAt( end_idx );
} while (
this._isWordChar( before_char )
|| this._isWordChar( after_char )
);
 
// keep track of its position in the original text.
this.indexes[txtid][i] = begin_idx;
 
// write out the characters before the current misspelled word
for( var j = this._lastPos( txtid, i ); j < begin_idx; j++ ) {
// !!! html mode? make it html compatible
d.write( this.printForHtml( wordtxt.charAt( j )));
}
 
// write out the misspelled word.
d.write( this._wordInputStr( orig[i] ));
 
// if it's the last word, write out the rest of the text
if( i == orig.length-1 ){
d.write( printForHtml( wordtxt.substr( end_idx )));
}
}
 
d.writeln( '</div>' );
}
d.writeln( '</form>' );
}
//for ( var j = 0; j < d.forms.length; j++ ) {
// alert( d.forms[j].name );
// for( var k = 0; k < d.forms[j].elements.length; k++ ) {
// alert( d.forms[j].elements[k].name + ": " + d.forms[j].elements[k].value );
// }
//}
// set the _forms property
this._forms = d.forms;
d.close();
}
 
// return the character index in the full text after the last word we evaluated
function _lastPos( txtid, idx ) {
if( idx > 0 )
return this.indexes[txtid][idx-1] + this.originalSpellings[txtid][idx-1].length;
else
return 0;
}
 
function printForHtml( n ) {
return n ; // by FredCK
var htmlstr = n;
if( htmlstr.length == 1 ) {
// do simple case statement if it's just one character
switch ( n ) {
case "\n":
htmlstr = '<br/>';
break;
case "<":
htmlstr = '&lt;';
break;
case ">":
htmlstr = '&gt;';
break;
}
return htmlstr;
} else {
htmlstr = htmlstr.replace( /</g, '&lt' );
htmlstr = htmlstr.replace( />/g, '&gt' );
htmlstr = htmlstr.replace( /\n/g, '<br/>' );
return htmlstr;
}
}
 
function _isWordChar( letter ) {
if( letter.search( this.wordChar ) == -1 ) {
return false;
} else {
return true;
}
}
 
function _getWordObject( textIndex, wordIndex ) {
if( this._forms[textIndex] ) {
if( this._forms[textIndex].elements[wordIndex] ) {
return this._forms[textIndex].elements[wordIndex];
}
}
return null;
}
 
function _wordInputStr( word ) {
var str = '<input readonly ';
str += 'class="blend" type="text" value="' + word + '" size="' + word.length + '">';
return str;
}
 
function _adjustIndexes( textIndex, wordIndex, lengthDiff ) {
for( var i = wordIndex + 1; i < this.originalSpellings[textIndex].length; i++ ) {
this.indexes[textIndex][i] = this.indexes[textIndex][i] + lengthDiff;
}
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellChecker.js
New file
0,0 → 1,458
////////////////////////////////////////////////////
// spellChecker.js
//
// spellChecker object
//
// This file is sourced on web pages that have a textarea object to evaluate
// for spelling. It includes the implementation for the spellCheckObject.
//
////////////////////////////////////////////////////
 
 
// constructor
function spellChecker( textObject ) {
 
// public properties - configurable
// this.popUpUrl = '/speller/spellchecker.html'; // by FredCK
this.popUpUrl = 'fck_spellerpages/spellerpages/spellchecker.html'; // by FredCK
this.popUpName = 'spellchecker';
// this.popUpProps = "menu=no,width=440,height=350,top=70,left=120,resizable=yes,status=yes"; // by FredCK
this.popUpProps = null ; // by FredCK
// this.spellCheckScript = '/speller/server-scripts/spellchecker.php'; // by FredCK
this.spellCheckScript = 'server-scripts/spellchecker.php'; // by FredCK
//this.spellCheckScript = '/cgi-bin/spellchecker.pl';
 
// values used to keep track of what happened to a word
this.replWordFlag = "R"; // single replace
this.ignrWordFlag = "I"; // single ignore
this.replAllFlag = "RA"; // replace all occurances
this.ignrAllFlag = "IA"; // ignore all occurances
this.fromReplAll = "~RA"; // an occurance of a "replace all" word
this.fromIgnrAll = "~IA"; // an occurance of a "ignore all" word
// properties set at run time
this.wordFlags = new Array();
this.currentTextIndex = 0;
this.currentWordIndex = 0;
this.spellCheckerWin = null;
this.controlWin = null;
this.wordWin = null;
this.textArea = textObject; // deprecated
this.textInputs = arguments;
 
// private methods
this._spellcheck = _spellcheck;
this._getSuggestions = _getSuggestions;
this._setAsIgnored = _setAsIgnored;
this._getTotalReplaced = _getTotalReplaced;
this._setWordText = _setWordText;
this._getFormInputs = _getFormInputs;
 
// public methods
this.openChecker = openChecker;
this.startCheck = startCheck;
this.checkTextBoxes = checkTextBoxes;
this.checkTextAreas = checkTextAreas;
this.spellCheckAll = spellCheckAll;
this.ignoreWord = ignoreWord;
this.ignoreAll = ignoreAll;
this.replaceWord = replaceWord;
this.replaceAll = replaceAll;
this.terminateSpell = terminateSpell;
this.undo = undo;
 
// set the current window's "speller" property to the instance of this class.
// this object can now be referenced by child windows/frames.
window.speller = this;
}
 
// call this method to check all text boxes (and only text boxes) in the HTML document
function checkTextBoxes() {
this.textInputs = this._getFormInputs( "^text$" );
this.openChecker();
}
 
// call this method to check all textareas (and only textareas ) in the HTML document
function checkTextAreas() {
this.textInputs = this._getFormInputs( "^textarea$" );
this.openChecker();
}
 
// call this method to check all text boxes and textareas in the HTML document
function spellCheckAll() {
this.textInputs = this._getFormInputs( "^text(area)?$" );
this.openChecker();
}
 
// call this method to check text boxe(s) and/or textarea(s) that were passed in to the
// object's constructor or to the textInputs property
function openChecker() {
this.spellCheckerWin = window.open( this.popUpUrl, this.popUpName, this.popUpProps );
if( !this.spellCheckerWin.opener ) {
this.spellCheckerWin.opener = window;
}
}
 
function startCheck( wordWindowObj, controlWindowObj ) {
 
// set properties from args
this.wordWin = wordWindowObj;
this.controlWin = controlWindowObj;
// reset properties
this.wordWin.resetForm();
this.controlWin.resetForm();
this.currentTextIndex = 0;
this.currentWordIndex = 0;
// initialize the flags to an array - one element for each text input
this.wordFlags = new Array( this.wordWin.textInputs.length );
// each element will be an array that keeps track of each word in the text
for( var i=0; i<this.wordFlags.length; i++ ) {
this.wordFlags[i] = [];
}
 
// start
this._spellcheck();
return true;
}
 
function ignoreWord() {
var wi = this.currentWordIndex;
var ti = this.currentTextIndex;
if( !this.wordWin ) {
alert( 'Error: Word frame not available.' );
return false;
}
if( !this.wordWin.getTextVal( ti, wi )) {
alert( 'Error: "Not in dictionary" text is missing.' );
return false;
}
// set as ignored
if( this._setAsIgnored( ti, wi, this.ignrWordFlag )) {
this.currentWordIndex++;
this._spellcheck();
}
}
 
function ignoreAll() {
var wi = this.currentWordIndex;
var ti = this.currentTextIndex;
if( !this.wordWin ) {
alert( 'Error: Word frame not available.' );
return false;
}
// get the word that is currently being evaluated.
var s_word_to_repl = this.wordWin.getTextVal( ti, wi );
if( !s_word_to_repl ) {
alert( 'Error: "Not in dictionary" text is missing' );
return false;
}
 
// set this word as an "ignore all" word.
this._setAsIgnored( ti, wi, this.ignrAllFlag );
 
// loop through all the words after this word
for( var i = ti; i < this.wordWin.textInputs.length; i++ ) {
for( var j = 0; j < this.wordWin.totalWords( i ); j++ ) {
if(( i == ti && j > wi ) || i > ti ) {
// future word: set as "from ignore all" if
// 1) do not already have a flag and
// 2) have the same value as current word
if(( this.wordWin.getTextVal( i, j ) == s_word_to_repl )
&& ( !this.wordFlags[i][j] )) {
this._setAsIgnored( i, j, this.fromIgnrAll );
}
}
}
}
 
// finally, move on
this.currentWordIndex++;
this._spellcheck();
}
 
function replaceWord() {
var wi = this.currentWordIndex;
var ti = this.currentTextIndex;
if( !this.wordWin ) {
alert( 'Error: Word frame not available.' );
return false;
}
if( !this.wordWin.getTextVal( ti, wi )) {
alert( 'Error: "Not in dictionary" text is missing' );
return false;
}
if( !this.controlWin.replacementText ) {
return;
}
var txt = this.controlWin.replacementText;
if( txt.value ) {
var newspell = new String( txt.value );
if( this._setWordText( ti, wi, newspell, this.replWordFlag )) {
this.currentWordIndex++;
this._spellcheck();
}
}
}
 
function replaceAll() {
var ti = this.currentTextIndex;
var wi = this.currentWordIndex;
if( !this.wordWin ) {
alert( 'Error: Word frame not available.' );
return false;
}
var s_word_to_repl = this.wordWin.getTextVal( ti, wi );
if( !s_word_to_repl ) {
alert( 'Error: "Not in dictionary" text is missing' );
return false;
}
var txt = this.controlWin.replacementText;
if( !txt.value ) return;
var newspell = new String( txt.value );
 
// set this word as a "replace all" word.
this._setWordText( ti, wi, newspell, this.replAllFlag );
 
// loop through all the words after this word
for( var i = ti; i < this.wordWin.textInputs.length; i++ ) {
for( var j = 0; j < this.wordWin.totalWords( i ); j++ ) {
if(( i == ti && j > wi ) || i > ti ) {
// future word: set word text to s_word_to_repl if
// 1) do not already have a flag and
// 2) have the same value as s_word_to_repl
if(( this.wordWin.getTextVal( i, j ) == s_word_to_repl )
&& ( !this.wordFlags[i][j] )) {
this._setWordText( i, j, newspell, this.fromReplAll );
}
}
}
}
// finally, move on
this.currentWordIndex++;
this._spellcheck();
}
 
function terminateSpell() {
// called when we have reached the end of the spell checking.
var msg = ""; // by FredCK
var numrepl = this._getTotalReplaced();
if( numrepl == 0 ) {
// see if there were no misspellings to begin with
if( !this.wordWin ) {
msg = "";
} else {
if( this.wordWin.totalMisspellings() ) {
// msg += "No words changed."; // by FredCK
msg += FCKLang.DlgSpellNoChanges ; // by FredCK
} else {
// msg += "No misspellings found."; // by FredCK
msg += FCKLang.DlgSpellNoMispell ; // by FredCK
}
}
} else if( numrepl == 1 ) {
// msg += "One word changed."; // by FredCK
msg += FCKLang.DlgSpellOneChange ; // by FredCK
} else {
// msg += numrepl + " words changed."; // by FredCK
msg += FCKLang.DlgSpellManyChanges.replace( /%1/g, numrepl ) ;
}
if( msg ) {
// msg += "\n"; // by FredCK
alert( msg );
}
 
if( numrepl > 0 ) {
// update the text field(s) on the opener window
for( var i = 0; i < this.textInputs.length; i++ ) {
// this.textArea.value = this.wordWin.text;
if( this.wordWin ) {
if( this.wordWin.textInputs[i] ) {
this.textInputs[i].value = this.wordWin.textInputs[i];
}
}
}
}
 
// return back to the calling window
// this.spellCheckerWin.close(); // by FredCK
if ( typeof( this.OnFinished ) == 'function' ) // by FredCK
this.OnFinished(numrepl) ; // by FredCK
 
return true;
}
 
function undo() {
// skip if this is the first word!
var ti = this.currentTextIndex;
var wi = this.currentWordIndex
if( this.wordWin.totalPreviousWords( ti, wi ) > 0 ) {
this.wordWin.removeFocus( ti, wi );
 
// go back to the last word index that was acted upon
do {
// if the current word index is zero then reset the seed
if( this.currentWordIndex == 0 && this.currentTextIndex > 0 ) {
this.currentTextIndex--;
this.currentWordIndex = this.wordWin.totalWords( this.currentTextIndex )-1;
if( this.currentWordIndex < 0 ) this.currentWordIndex = 0;
} else {
if( this.currentWordIndex > 0 ) {
this.currentWordIndex--;
}
}
} while (
this.wordWin.totalWords( this.currentTextIndex ) == 0
|| this.wordFlags[this.currentTextIndex][this.currentWordIndex] == this.fromIgnrAll
|| this.wordFlags[this.currentTextIndex][this.currentWordIndex] == this.fromReplAll
);
 
var text_idx = this.currentTextIndex;
var idx = this.currentWordIndex;
var preReplSpell = this.wordWin.originalSpellings[text_idx][idx];
// if we got back to the first word then set the Undo button back to disabled
if( this.wordWin.totalPreviousWords( text_idx, idx ) == 0 ) {
this.controlWin.disableUndo();
}
// examine what happened to this current word.
switch( this.wordFlags[text_idx][idx] ) {
// replace all: go through this and all the future occurances of the word
// and revert them all to the original spelling and clear their flags
case this.replAllFlag :
for( var i = text_idx; i < this.wordWin.textInputs.length; i++ ) {
for( var j = 0; j < this.wordWin.totalWords( i ); j++ ) {
if(( i == text_idx && j >= idx ) || i > text_idx ) {
var origSpell = this.wordWin.originalSpellings[i][j];
if( origSpell == preReplSpell ) {
this._setWordText ( i, j, origSpell, undefined );
}
}
}
}
break;
// ignore all: go through all the future occurances of the word
// and clear their flags
case this.ignrAllFlag :
for( var i = text_idx; i < this.wordWin.textInputs.length; i++ ) {
for( var j = 0; j < this.wordWin.totalWords( i ); j++ ) {
if(( i == text_idx && j >= idx ) || i > text_idx ) {
var origSpell = this.wordWin.originalSpellings[i][j];
if( origSpell == preReplSpell ) {
this.wordFlags[i][j] = undefined;
}
}
}
}
break;
// replace: revert the word to its original spelling
case this.replWordFlag :
this._setWordText ( text_idx, idx, preReplSpell, undefined );
break;
}
 
// For all four cases, clear the wordFlag of this word. re-start the process
this.wordFlags[text_idx][idx] = undefined;
this._spellcheck();
}
}
 
function _spellcheck() {
var ww = this.wordWin;
// check if this is the last word in the current text element
if( this.currentWordIndex == ww.totalWords( this.currentTextIndex) ) {
this.currentTextIndex++;
this.currentWordIndex = 0;
// keep going if we're not yet past the last text element
if( this.currentTextIndex < this.wordWin.textInputs.length ) {
this._spellcheck();
return;
} else {
this.terminateSpell();
return;
}
}
// if this is after the first one make sure the Undo button is enabled
if( this.currentWordIndex > 0 ) {
this.controlWin.enableUndo();
}
 
// skip the current word if it has already been worked on
if( this.wordFlags[this.currentTextIndex][this.currentWordIndex] ) {
// increment the global current word index and move on.
this.currentWordIndex++;
this._spellcheck();
} else {
var evalText = ww.getTextVal( this.currentTextIndex, this.currentWordIndex );
if( evalText ) {
this.controlWin.evaluatedText.value = evalText;
ww.setFocus( this.currentTextIndex, this.currentWordIndex );
this._getSuggestions( this.currentTextIndex, this.currentWordIndex );
}
}
}
 
function _getSuggestions( text_num, word_num ) {
this.controlWin.clearSuggestions();
// add suggestion in list for each suggested word.
// get the array of suggested words out of the
// three-dimensional array containing all suggestions.
var a_suggests = this.wordWin.suggestions[text_num][word_num];
if( a_suggests ) {
// got an array of suggestions.
for( var ii = 0; ii < a_suggests.length; ii++ ) {
this.controlWin.addSuggestion( a_suggests[ii] );
}
}
this.controlWin.selectDefaultSuggestion();
}
 
function _setAsIgnored( text_num, word_num, flag ) {
// set the UI
this.wordWin.removeFocus( text_num, word_num );
// do the bookkeeping
this.wordFlags[text_num][word_num] = flag;
return true;
}
 
function _getTotalReplaced() {
var i_replaced = 0;
for( var i = 0; i < this.wordFlags.length; i++ ) {
for( var j = 0; j < this.wordFlags[i].length; j++ ) {
if(( this.wordFlags[i][j] == this.replWordFlag )
|| ( this.wordFlags[i][j] == this.replAllFlag )
|| ( this.wordFlags[i][j] == this.fromReplAll )) {
i_replaced++;
}
}
}
return i_replaced;
}
 
function _setWordText( text_num, word_num, newText, flag ) {
// set the UI and form inputs
this.wordWin.setText( text_num, word_num, newText );
// keep track of what happened to this word:
this.wordFlags[text_num][word_num] = flag;
return true;
}
 
function _getFormInputs( inputPattern ) {
var inputs = new Array();
for( var i = 0; i < document.forms.length; i++ ) {
for( var j = 0; j < document.forms[i].elements.length; j++ ) {
if( document.forms[i].elements[j].type.match( inputPattern )) {
inputs[inputs.length] = document.forms[i].elements[j];
}
}
}
return inputs;
}
 
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controlWindow.js
New file
0,0 → 1,87
////////////////////////////////////////////////////
// controlWindow object
////////////////////////////////////////////////////
function controlWindow( controlForm ) {
// private properties
this._form = controlForm;
 
// public properties
this.windowType = "controlWindow";
// this.noSuggestionSelection = "- No suggestions -"; // by FredCK
this.noSuggestionSelection = FCKLang.DlgSpellNoSuggestions ;
// set up the properties for elements of the given control form
this.suggestionList = this._form.sugg;
this.evaluatedText = this._form.misword;
this.replacementText = this._form.txtsugg;
this.undoButton = this._form.btnUndo;
 
// public methods
this.addSuggestion = addSuggestion;
this.clearSuggestions = clearSuggestions;
this.selectDefaultSuggestion = selectDefaultSuggestion;
this.resetForm = resetForm;
this.setSuggestedText = setSuggestedText;
this.enableUndo = enableUndo;
this.disableUndo = disableUndo;
}
 
function resetForm() {
if( this._form ) {
this._form.reset();
}
}
 
function setSuggestedText() {
var slct = this.suggestionList;
var txt = this.replacementText;
var str = "";
if( (slct.options[0].text) && slct.options[0].text != this.noSuggestionSelection ) {
str = slct.options[slct.selectedIndex].text;
}
txt.value = str;
}
 
function selectDefaultSuggestion() {
var slct = this.suggestionList;
var txt = this.replacementText;
if( slct.options.length == 0 ) {
this.addSuggestion( this.noSuggestionSelection );
} else {
slct.options[0].selected = true;
}
this.setSuggestedText();
}
 
function addSuggestion( sugg_text ) {
var slct = this.suggestionList;
if( sugg_text ) {
var i = slct.options.length;
var newOption = new Option( sugg_text, 'sugg_text'+i );
slct.options[i] = newOption;
}
}
 
function clearSuggestions() {
var slct = this.suggestionList;
for( var j = slct.length - 1; j > -1; j-- ) {
if( slct.options[j] ) {
slct.options[j] = null;
}
}
}
 
function enableUndo() {
if( this.undoButton ) {
if( this.undoButton.disabled == true ) {
this.undoButton.disabled = false;
}
}
}
 
function disableUndo() {
if( this.undoButton ) {
if( this.undoButton.disabled == false ) {
this.undoButton.disabled = true;
}
}
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_spellerpages.html
New file
0,0 → 1,59
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_spellerpages.html
* Spell Check dialog window.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<html>
<head>
<title>Spell Check</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta content="noindex, nofollow" name="robots">
<script src="fck_spellerpages/spellerpages/spellChecker.js"></script>
<script type="text/javascript">
 
var oEditor = window.parent.InnerDialogLoaded() ;
var FCKLang = oEditor.FCKLang ;
 
window.onload = function()
{
document.getElementById('txtHtml').value = oEditor.FCK.EditorDocument.body.innerHTML ;
 
var oSpeller = new spellChecker( document.getElementById('txtHtml') ) ;
oSpeller.OnFinished = oSpeller_OnFinished ;
oSpeller.openChecker() ;
}
 
function OnSpellerControlsLoad( controlsWindow )
{
// Translate the dialog box texts
oEditor.FCKLanguageManager.TranslatePage( controlsWindow.document ) ;
}
 
function oSpeller_OnFinished( numberOCorrections )
{
if ( numberOCorrections > 0 )
oEditor.FCK.SetHTML( document.getElementById('txtHtml').value ) ;
window.parent.Cancel() ;
}
 
</script>
</head>
<body style="OVERFLOW: hidden" scroll="no" style="padding:0px;">
<input type="hidden" id="txtHtml" value="">
<iframe id="frmSpell" src="../fckblank.html" name="spellchecker" width="100%" height="100%" frameborder="0"></iframe>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_checkbox.html
New file
0,0 → 1,103
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_checkbox.html
* Checkbox dialog window.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<html>
<head>
<title>Checkbox Properties</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta content="noindex, nofollow" name="robots">
<script src="common/fck_dialog_common.js" type="text/javascript"></script>
<script type="text/javascript">
 
var oEditor = window.parent.InnerDialogLoaded() ;
 
// Gets the document DOM
var oDOM = oEditor.FCK.EditorDocument ;
 
var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
 
window.onload = function()
{
// First of all, translate the dialog box texts
oEditor.FCKLanguageManager.TranslatePage(document) ;
 
if ( oActiveEl && oActiveEl.tagName == 'INPUT' && oActiveEl.type == 'checkbox' )
{
GetE('txtName').value = oActiveEl.name ;
GetE('txtValue').value = oEditor.FCKBrowserInfo.IsIE ? oActiveEl.value : GetAttribute( oActiveEl, 'value' ) ;
GetE('txtSelected').checked = oActiveEl.checked ;
}
else
oActiveEl = null ;
 
window.parent.SetOkButton( true ) ;
}
 
function Ok()
{
if ( !oActiveEl )
{
oActiveEl = oEditor.FCK.EditorDocument.createElement( 'INPUT' ) ;
oActiveEl.type = 'checkbox' ;
oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ;
}
 
if ( GetE('txtName').value.length > 0 )
oActiveEl.name = GetE('txtName').value ;
if ( oEditor.FCKBrowserInfo.IsIE )
oActiveEl.value = GetE('txtValue').value ;
else
SetAttribute( oActiveEl, 'value', GetE('txtValue').value ) ;
 
var bIsChecked = GetE('txtSelected').checked ;
SetAttribute( oActiveEl, 'checked', bIsChecked ? 'checked' : null ) ; // For Firefox
oActiveEl.checked = bIsChecked ;
 
return true ;
}
 
</script>
</head>
<body style="OVERFLOW: hidden" scroll="no">
<table height="100%" width="100%">
<tr>
<td align="center">
<table border="0" cellpadding="0" cellspacing="0" width="80%">
<tr>
<td>
<span fckLang="DlgCheckboxName">Name</span><br>
<input type="text" size="20" id="txtName" style="WIDTH: 100%">
</td>
</tr>
<tr>
<td>
<span fckLang="DlgCheckboxValue">Value</span><br>
<input type="text" size="20" id="txtValue" style="WIDTH: 100%">
</td>
</tr>
<tr>
<td><input type="checkbox" id="txtSelected"><label for="txtSelected" fckLang="DlgCheckboxSelected">Checked</label></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_docprops/fck_document_preview.html
New file
0,0 → 1,109
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_document_preview.html
* Preview shown in the "Document Properties" dialog window.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<html>
<head>
<title>Document Properties - Preview</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow">
<script language="javascript">
 
var eBase = parent.FCK.EditorDocument.getElementsByTagName( 'BASE' ) ;
if ( eBase.length > 0 && eBase[0].href.length > 0 )
{
document.write( '<base href="' + eBase[0].href + '">' ) ;
}
 
window.onload = function()
{
if ( typeof( parent.OnPreviewLoad ) == 'function' )
parent.OnPreviewLoad( window, document.body ) ;
}
 
function SetBaseHRef( baseHref )
{
var eBase = document.createElement( 'BASE' ) ;
eBase.href = baseHref ;
 
var eHead = document.getElementsByTagName( 'HEAD' )[0] ;
eHead.appendChild( eBase ) ;
}
 
function SetLinkColor( color )
{
if ( color && color.length > 0 )
document.getElementById('eLink').style.color = color ;
else
document.getElementById('eLink').style.color = window.document.linkColor ;
}
 
function SetVisitedColor( color )
{
if ( color && color.length > 0 )
document.getElementById('eVisited').style.color = color ;
else
document.getElementById('eVisited').style.color = window.document.vlinkColor ;
}
 
function SetActiveColor( color )
{
if ( color && color.length > 0 )
document.getElementById('eActive').style.color = color ;
else
document.getElementById('eActive').style.color = window.document.alinkColor ;
}
</script>
</head>
<body>
<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="center" valign="middle">
Normal Text
</td>
<td id="eLink" align="center" valign="middle">
<u>Link Text</u>
</td>
</tr>
<tr>
<td id="eVisited" valign="middle" align="center">
<u>Visited Link</u>
</td>
<td id="eActive" valign="middle" align="center">
<u>Active Link</u>
</td>
</tr>
</table>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_flash/fck_flash.js
New file
0,0 → 1,284
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_flash.js
* Scripts related to the Flash dialog window (see fck_flash.html).
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var oEditor = window.parent.InnerDialogLoaded() ;
var FCK = oEditor.FCK ;
var FCKLang = oEditor.FCKLang ;
var FCKConfig = oEditor.FCKConfig ;
 
//#### Dialog Tabs
 
// Set the dialog tabs.
window.parent.AddTab( 'Info', oEditor.FCKLang.DlgInfoTab ) ;
 
if ( FCKConfig.FlashUpload )
window.parent.AddTab( 'Upload', FCKLang.DlgLnkUpload ) ;
 
if ( !FCKConfig.FlashDlgHideAdvanced )
window.parent.AddTab( 'Advanced', oEditor.FCKLang.DlgAdvancedTag ) ;
 
// Function called when a dialog tag is selected.
function OnDialogTabChange( tabCode )
{
ShowE('divInfo' , ( tabCode == 'Info' ) ) ;
ShowE('divUpload' , ( tabCode == 'Upload' ) ) ;
ShowE('divAdvanced' , ( tabCode == 'Advanced' ) ) ;
}
 
// Get the selected flash embed (if available).
var oFakeImage = FCK.Selection.GetSelectedElement() ;
var oEmbed ;
 
if ( oFakeImage )
{
if ( oFakeImage.tagName == 'IMG' && oFakeImage.getAttribute('_fckflash') )
oEmbed = FCK.GetRealElement( oFakeImage ) ;
else
oFakeImage = null ;
}
 
window.onload = function()
{
// Translate the dialog box texts.
oEditor.FCKLanguageManager.TranslatePage(document) ;
 
// Load the selected element information (if any).
LoadSelection() ;
 
// Show/Hide the "Browse Server" button.
GetE('tdBrowse').style.display = FCKConfig.FlashBrowser ? '' : 'none' ;
 
// Set the actual uploader URL.
if ( FCKConfig.FlashUpload )
GetE('frmUpload').action = FCKConfig.FlashUploadURL ;
 
window.parent.SetAutoSize( true ) ;
 
// Activate the "OK" button.
window.parent.SetOkButton( true ) ;
}
 
function LoadSelection()
{
if ( ! oEmbed ) return ;
 
var sUrl = GetAttribute( oEmbed, 'src', '' ) ;
 
GetE('txtUrl').value = GetAttribute( oEmbed, 'src', '' ) ;
GetE('txtWidth').value = GetAttribute( oEmbed, 'width', '' ) ;
GetE('txtHeight').value = GetAttribute( oEmbed, 'height', '' ) ;
 
// Get Advances Attributes
GetE('txtAttId').value = oEmbed.id ;
GetE('chkAutoPlay').checked = GetAttribute( oEmbed, 'play', 'true' ) == 'true' ;
GetE('chkLoop').checked = GetAttribute( oEmbed, 'loop', 'true' ) == 'true' ;
GetE('chkMenu').checked = GetAttribute( oEmbed, 'menu', 'true' ) == 'true' ;
GetE('cmbScale').value = GetAttribute( oEmbed, 'scale', '' ).toLowerCase() ;
GetE('txtAttTitle').value = oEmbed.title ;
 
if ( oEditor.FCKBrowserInfo.IsIE )
{
GetE('txtAttClasses').value = oEmbed.getAttribute('className') || '' ;
GetE('txtAttStyle').value = oEmbed.style.cssText ;
}
else
{
GetE('txtAttClasses').value = oEmbed.getAttribute('class',2) || '' ;
GetE('txtAttStyle').value = oEmbed.getAttribute('style',2) ;
}
 
UpdatePreview() ;
}
 
//#### The OK button was hit.
function Ok()
{
if ( GetE('txtUrl').value.length == 0 )
{
window.parent.SetSelectedTab( 'Info' ) ;
GetE('txtUrl').focus() ;
 
alert( oEditor.FCKLang.DlgAlertUrl ) ;
 
return false ;
}
 
if ( !oEmbed )
{
oEmbed = FCK.EditorDocument.createElement( 'EMBED' ) ;
oFakeImage = null ;
}
UpdateEmbed( oEmbed ) ;
if ( !oFakeImage )
{
oFakeImage = oEditor.FCKDocumentProcessor_CreateFakeImage( 'FCK__Flash', oEmbed ) ;
oFakeImage.setAttribute( '_fckflash', 'true', 0 ) ;
oFakeImage = FCK.InsertElementAndGetIt( oFakeImage ) ;
}
else
oEditor.FCKUndo.SaveUndoStep() ;
oEditor.FCKFlashProcessor.RefreshView( oFakeImage, oEmbed ) ;
 
return true ;
}
 
function UpdateEmbed( e )
{
SetAttribute( e, 'type' , 'application/x-shockwave-flash' ) ;
SetAttribute( e, 'pluginspage' , 'http://www.macromedia.com/go/getflashplayer' ) ;
 
e.src = GetE('txtUrl').value ;
SetAttribute( e, "width" , GetE('txtWidth').value ) ;
SetAttribute( e, "height", GetE('txtHeight').value ) ;
// Advances Attributes
 
SetAttribute( e, 'id' , GetE('txtAttId').value ) ;
SetAttribute( e, 'scale', GetE('cmbScale').value ) ;
SetAttribute( e, 'play', GetE('chkAutoPlay').checked ? 'true' : 'false' ) ;
SetAttribute( e, 'loop', GetE('chkLoop').checked ? 'true' : 'false' ) ;
SetAttribute( e, 'menu', GetE('chkMenu').checked ? 'true' : 'false' ) ;
 
SetAttribute( e, 'title' , GetE('txtAttTitle').value ) ;
 
if ( oEditor.FCKBrowserInfo.IsIE )
{
SetAttribute( e, 'className', GetE('txtAttClasses').value ) ;
e.style.cssText = GetE('txtAttStyle').value ;
}
else
{
SetAttribute( e, 'class', GetE('txtAttClasses').value ) ;
SetAttribute( e, 'style', GetE('txtAttStyle').value ) ;
}
}
 
var ePreview ;
 
function SetPreviewElement( previewEl )
{
ePreview = previewEl ;
if ( GetE('txtUrl').value.length > 0 )
UpdatePreview() ;
}
 
function UpdatePreview()
{
if ( !ePreview )
return ;
while ( ePreview.firstChild )
ePreview.removeChild( ePreview.firstChild ) ;
 
if ( GetE('txtUrl').value.length == 0 )
ePreview.innerHTML = '&nbsp;' ;
else
{
var oDoc = ePreview.ownerDocument || ePreview.document ;
var e = oDoc.createElement( 'EMBED' ) ;
e.src = GetE('txtUrl').value ;
e.type = 'application/x-shockwave-flash' ;
e.width = '100%' ;
e.height = '100%' ;
ePreview.appendChild( e ) ;
}
}
 
// <embed id="ePreview" src="fck_flash/claims.swf" width="100%" height="100%" style="visibility:hidden" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
 
function BrowseServer()
{
OpenFileBrowser( FCKConfig.FlashBrowserURL, FCKConfig.FlashBrowserWindowWidth, FCKConfig.FlashBrowserWindowHeight ) ;
}
 
function SetUrl( url, width, height )
{
GetE('txtUrl').value = url ;
if ( width )
GetE('txtWidth').value = width ;
if ( height )
GetE('txtHeight').value = height ;
 
UpdatePreview() ;
 
window.parent.SetSelectedTab( 'Info' ) ;
}
 
function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
{
switch ( errorNumber )
{
case 0 : // No errors
alert( 'Your file has been successfully uploaded' ) ;
break ;
case 1 : // Custom error
alert( customMsg ) ;
return ;
case 101 : // Custom warning
alert( customMsg ) ;
break ;
case 201 :
alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + fileName + '"' ) ;
break ;
case 202 :
alert( 'Invalid file type' ) ;
return ;
case 203 :
alert( "Security error. You probably don't have enough permissions to upload. Please check your server." ) ;
return ;
default :
alert( 'Error on file upload. Error number: ' + errorNumber ) ;
return ;
}
 
SetUrl( fileUrl ) ;
GetE('frmUpload').reset() ;
}
 
var oUploadAllowedExtRegex = new RegExp( FCKConfig.FlashUploadAllowedExtensions, 'i' ) ;
var oUploadDeniedExtRegex = new RegExp( FCKConfig.FlashUploadDeniedExtensions, 'i' ) ;
 
function CheckUpload()
{
var sFile = GetE('txtUploadFile').value ;
if ( sFile.length == 0 )
{
alert( 'Please select a file to upload' ) ;
return false ;
}
if ( ( FCKConfig.FlashUploadAllowedExtensions.length > 0 && !oUploadAllowedExtRegex.test( sFile ) ) ||
( FCKConfig.FlashUploadDeniedExtensions.length > 0 && oUploadDeniedExtRegex.test( sFile ) ) )
{
OnUploadCompleted( 202 ) ;
return false ;
}
return true ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_flash/fck_flash_preview.html
New file
0,0 → 1,42
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_flash_preview.html
* Preview page for the Flash dialog window.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow">
<link href="../common/fck_dialog_common.css" rel="stylesheet" type="text/css" />
<script language="javascript">
 
// Sets the Skin CSS
document.write( '<link href="' + window.parent.FCKConfig.SkinPath + 'fck_dialog.css" type="text/css" rel="stylesheet">' ) ;
 
if ( window.parent.FCKConfig.BaseHref.length > 0 )
document.write( '<base href="' + window.parent.FCKConfig.BaseHref + '">' ) ;
 
window.onload = function()
{
window.parent.SetPreviewElement( document.body ) ;
}
 
</script>
</head>
<body style="COLOR: #000000; BACKGROUND-COLOR: #ffffff"></body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_link.html
New file
0,0 → 1,289
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_link.html
* Link dialog window.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Link Properties</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex, nofollow" />
<script src="common/fck_dialog_common.js" type="text/javascript"></script>
<script src="fck_link/fck_link.js" type="text/javascript"></script>
</head>
<body scroll="no" style="OVERFLOW: hidden">
<div id="divInfo" style="DISPLAY: none">
<span fckLang="DlgLnkType">Link Type</span><br />
<select id="cmbLinkType" onchange="SetLinkType(this.value);">
<option value="url" fckLang="DlgLnkTypeURL" selected="selected">URL</option>
<option value="anchor" fckLang="DlgLnkTypeAnchor">Anchor in this page</option>
<option value="email" fckLang="DlgLnkTypeEMail">E-Mail</option>
</select>
<br />
<br />
<div id="divLinkTypeUrl">
<table cellspacing="0" cellpadding="0" width="100%" border="0" dir="ltr">
<tr>
<td nowrap="nowrap">
<span fckLang="DlgLnkProto">Protocol</span><br />
<select id="cmbLinkProtocol">
<option value="http://" selected="selected">http://</option>
<option value="https://">https://</option>
<option value="ftp://">ftp://</option>
<option value="news://">news://</option>
<option value="" fckLang="DlgLnkProtoOther">&lt;other&gt;</option>
</select>
</td>
<td nowrap="nowrap">&nbsp;</td>
<td nowrap="nowrap" width="100%">
<span fckLang="DlgLnkURL">URL</span><br />
<input id="txtUrl" style="WIDTH: 100%" type="text" onkeyup="OnUrlChange();" onchange="OnUrlChange();" />
</td>
</tr>
</table>
<br />
<div id="divBrowseServer">
<input type="button" value="Browse Server" fckLang="DlgBtnBrowseServer" onclick="BrowseServer();" />
</div>
</div>
<div id="divLinkTypeAnchor" style="DISPLAY: none" align="center">
<div id="divSelAnchor" style="DISPLAY: none">
<table cellspacing="0" cellpadding="0" border="0" width="70%">
<tr>
<td colspan="3">
<span fckLang="DlgLnkAnchorSel">Select an Anchor</span>
</td>
</tr>
<tr>
<td width="50%">
<span fckLang="DlgLnkAnchorByName">By Anchor Name</span><br />
<select id="cmbAnchorName" onchange="GetE('cmbAnchorId').value='';" style="WIDTH: 100%">
<option value="" selected="selected"></option>
</select>
</td>
<td>&nbsp;&nbsp;&nbsp;</td>
<td width="50%">
<span fckLang="DlgLnkAnchorById">By Element Id</span><br />
<select id="cmbAnchorId" onchange="GetE('cmbAnchorName').value='';" style="WIDTH: 100%">
<option value="" selected="selected"></option>
</select>
</td>
</tr>
</table>
</div>
<div id="divNoAnchor" style="DISPLAY: none">
<span fckLang="DlgLnkNoAnchors">&lt;No anchors available in the document&gt;</span>
</div>
</div>
<div id="divLinkTypeEMail" style="DISPLAY: none">
<span fckLang="DlgLnkEMail">E-Mail Address</span><br />
<input id="txtEMailAddress" style="WIDTH: 100%" type="text" /><br />
<span fckLang="DlgLnkEMailSubject">Message Subject</span><br />
<input id="txtEMailSubject" style="WIDTH: 100%" type="text" /><br />
<span fckLang="DlgLnkEMailBody">Message Body</span><br />
<textarea id="txtEMailBody" style="WIDTH: 100%" rows="3" cols="20"></textarea>
</div>
</div>
<div id="divUpload" style="DISPLAY: none">
<form id="frmUpload" method="post" target="UploadWindow" enctype="multipart/form-data" action="" onsubmit="return CheckUpload();">
<span fckLang="DlgLnkUpload">Upload</span><br />
<input id="txtUploadFile" style="WIDTH: 100%" type="file" size="40" name="NewFile" /><br />
<br />
<input id="btnUpload" type="submit" value="Send it to the Server" fckLang="DlgLnkBtnUpload" />
<iframe name="UploadWindow" style="DISPLAY: none" src="../fckblank.html"></iframe>
</form>
</div>
<div id="divTarget" style="DISPLAY: none">
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td nowrap="nowrap">
<span fckLang="DlgLnkTarget">Target</span><br />
<select id="cmbTarget" onchange="SetTarget(this.value);">
<option value="" fckLang="DlgGenNotSet" selected="selected">&lt;not set&gt;</option>
<option value="frame" fckLang="DlgLnkTargetFrame">&lt;frame&gt;</option>
<option value="popup" fckLang="DlgLnkTargetPopup">&lt;popup window&gt;</option>
<option value="_blank" fckLang="DlgLnkTargetBlank">New Window (_blank)</option>
<option value="_top" fckLang="DlgLnkTargetTop">Topmost Window (_top)</option>
<option value="_self" fckLang="DlgLnkTargetSelf">Same Window (_self)</option>
<option value="_parent" fckLang="DlgLnkTargetParent">Parent Window (_parent)</option>
</select>
</td>
<td>&nbsp;</td>
<td id="tdTargetFrame" nowrap="nowrap" width="100%">
<span fckLang="DlgLnkTargetFrameName">Target Frame Name</span><br />
<input id="txtTargetFrame" style="WIDTH: 100%" type="text" onkeyup="OnTargetNameChange();"
onchange="OnTargetNameChange();" />
</td>
<td id="tdPopupName" style="DISPLAY: none" nowrap="nowrap" width="100%">
<span fckLang="DlgLnkPopWinName">Popup Window Name</span><br />
<input id="txtPopupName" style="WIDTH: 100%" type="text" />
</td>
</tr>
</table>
<br />
<table id="tablePopupFeatures" style="DISPLAY: none" cellspacing="0" cellpadding="0" align="center"
border="0">
<tr>
<td>
<span fckLang="DlgLnkPopWinFeat">Popup Window Features</span><br />
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td valign="top" nowrap="nowrap" width="50%">
<input id="chkPopupResizable" name="chkFeature" value="resizable" type="checkbox" /><label for="chkPopupResizable" fckLang="DlgLnkPopResize">Resizable</label><br />
<input id="chkPopupLocationBar" name="chkFeature" value="location" type="checkbox" /><label for="chkPopupLocationBar" fckLang="DlgLnkPopLocation">Location
Bar</label><br />
<input id="chkPopupManuBar" name="chkFeature" value="menubar" type="checkbox" /><label for="chkPopupManuBar" fckLang="DlgLnkPopMenu">Menu
Bar</label><br />
<input id="chkPopupScrollBars" name="chkFeature" value="scrollbars" type="checkbox" /><label for="chkPopupScrollBars" fckLang="DlgLnkPopScroll">Scroll
Bars</label>
</td>
<td></td>
<td valign="top" nowrap="nowrap" width="50%">
<input id="chkPopupStatusBar" name="chkFeature" value="status" type="checkbox" /><label for="chkPopupStatusBar" fckLang="DlgLnkPopStatus">Status
Bar</label><br />
<input id="chkPopupToolbar" name="chkFeature" value="toolbar" type="checkbox" /><label for="chkPopupToolbar" fckLang="DlgLnkPopToolbar">Toolbar</label><br />
<input id="chkPopupFullScreen" name="chkFeature" value="fullscreen" type="checkbox" /><label for="chkPopupFullScreen" fckLang="DlgLnkPopFullScrn">Full
Screen (IE)</label><br />
<input id="chkPopupDependent" name="chkFeature" value="dependent" type="checkbox" /><label for="chkPopupDependent" fckLang="DlgLnkPopDependent">Dependent
(Netscape)</label>
</td>
</tr>
<tr>
<td valign="top" nowrap="nowrap" width="50%">&nbsp;</td>
<td></td>
<td valign="top" nowrap="nowrap" width="50%"></td>
</tr>
<tr>
<td valign="top">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td nowrap="nowrap"><span fckLang="DlgLnkPopWidth">Width</span></td>
<td>&nbsp;<input id="txtPopupWidth" type="text" maxlength="4" size="4" /></td>
</tr>
<tr>
<td nowrap="nowrap"><span fckLang="DlgLnkPopHeight">Height</span></td>
<td>&nbsp;<input id="txtPopupHeight" type="text" maxlength="4" size="4" /></td>
</tr>
</table>
</td>
<td>&nbsp;&nbsp;</td>
<td valign="top">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td nowrap="nowrap"><span fckLang="DlgLnkPopLeft">Left Position</span></td>
<td>&nbsp;<input id="txtPopupLeft" type="text" maxlength="4" size="4" /></td>
</tr>
<tr>
<td nowrap="nowrap"><span fckLang="DlgLnkPopTop">Top Position</span></td>
<td>&nbsp;<input id="txtPopupTop" type="text" maxlength="4" size="4" /></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div id="divAttribs" style="DISPLAY: none">
<table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
<tr>
<td valign="top" width="50%">
<span fckLang="DlgGenId">Id</span><br />
<input id="txtAttId" style="WIDTH: 100%" type="text" />
</td>
<td width="1"></td>
<td valign="top">
<table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
<tr>
<td width="60%">
<span fckLang="DlgGenLangDir">Language Direction</span><br />
<select id="cmbAttLangDir" style="WIDTH: 100%">
<option value="" fckLang="DlgGenNotSet" selected>&lt;not set&gt;</option>
<option value="ltr" fckLang="DlgGenLangDirLtr">Left to Right (LTR)</option>
<option value="rtl" fckLang="DlgGenLangDirRtl">Right to Left (RTL)</option>
</select>
</td>
<td width="1%">&nbsp;&nbsp;&nbsp;</td>
<td nowrap="nowrap"><span fckLang="DlgGenAccessKey">Access Key</span><br />
<input id="txtAttAccessKey" style="WIDTH: 100%" type="text" maxlength="1" size="1" />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top" width="50%">
<span fckLang="DlgGenName">Name</span><br />
<input id="txtAttName" style="WIDTH: 100%" type="text" />
</td>
<td width="1"></td>
<td valign="top">
<table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
<tr>
<td width="60%">
<span fckLang="DlgGenLangCode">Language Code</span><br />
<input id="txtAttLangCode" style="WIDTH: 100%" type="text" />
</td>
<td width="1%">&nbsp;&nbsp;&nbsp;</td>
<td nowrap="nowrap">
<span fckLang="DlgGenTabIndex">Tab Index</span><br />
<input id="txtAttTabIndex" style="WIDTH: 100%" type="text" maxlength="5" size="5" />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top" width="50%">&nbsp;</td>
<td width="1"></td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top" width="50%">
<span fckLang="DlgGenTitle">Advisory Title</span><br />
<input id="txtAttTitle" style="WIDTH: 100%" type="text" />
</td>
<td width="1">&nbsp;&nbsp;&nbsp;</td>
<td valign="top">
<span fckLang="DlgGenContType">Advisory Content Type</span><br />
<input id="txtAttContentType" style="WIDTH: 100%" type="text" />
</td>
</tr>
<tr>
<td valign="top">
<span fckLang="DlgGenClass">Stylesheet Classes</span><br />
<input id="txtAttClasses" style="WIDTH: 100%" type="text" />
</td>
<td></td>
<td valign="top">
<span fckLang="DlgGenLinkCharset">Linked Resource Charset</span><br />
<input id="txtAttCharSet" style="WIDTH: 100%" type="text" />
</td>
</tr>
</table>
<table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
<tr>
<td>
<span fckLang="DlgGenStyle">Style</span><br />
<input id="txtAttStyle" style="WIDTH: 100%" type="text" />
</td>
</tr>
</table>
</div>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_form.html
New file
0,0 → 1,101
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_form.html
* Form dialog window.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta content="noindex, nofollow" name="robots" />
<script src="common/fck_dialog_common.js" type="text/javascript"></script>
<script type="text/javascript">
 
var oEditor = window.parent.InnerDialogLoaded() ;
 
// Gets the document DOM
var oDOM = oEditor.FCK.EditorDocument ;
 
var oActiveEl = oEditor.FCKSelection.MoveToAncestorNode( 'FORM' ) ;
 
window.onload = function()
{
// First of all, translate the dialog box texts
oEditor.FCKLanguageManager.TranslatePage(document) ;
 
if ( oActiveEl )
{
GetE('txtName').value = oActiveEl.name ;
GetE('txtAction').value = oActiveEl.getAttribute( 'action', 2 ) ;
GetE('txtMethod').value = oActiveEl.method ;
}
else
oActiveEl = null ;
 
window.parent.SetOkButton( true ) ;
}
 
function Ok()
{
if ( !oActiveEl )
{
oActiveEl = oEditor.FCK.EditorDocument.createElement( 'FORM' ) ;
oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ;
oActiveEl.innerHTML = '&nbsp;' ;
}
oActiveEl.name = GetE('txtName').value ;
SetAttribute( oActiveEl, 'action' , GetE('txtAction').value ) ;
oActiveEl.method = GetE('txtMethod').value ;
 
return true ;
}
 
</script>
</head>
<body style="overflow: hidden">
<table width="100%" style="height: 100%">
<tr>
<td align="center">
<table cellspacing="0" cellpadding="0" width="80%" border="0">
<tr>
<td>
<span fcklang="DlgFormName">Name</span><br />
<input style="width: 100%" type="text" id="txtName" />
</td>
</tr>
<tr>
<td>
<span fcklang="DlgFormAction">Action</span><br />
<input style="width: 100%" type="text" id="txtAction" />
</td>
</tr>
<tr>
<td>
<span fcklang="DlgFormMethod">Method</span><br />
<select id="txtMethod">
<option value="get" selected="selected">GET</option>
<option value="post">POST</option>
</select>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_about/logo_fckeditor.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_about/logo_fckeditor.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_about/lgpl.html
New file
0,0 → 1,434
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>GNU Lesser General Public License</title>
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<STYLE>
BODY { FONT-SIZE: 12px }
</STYLE>
</head>
<body>
<H3>GNU Lesser General Public License</H3>
<TT>
<P>Version 2.1, February 1999</P>
<BLOCKQUOTE>
<P>Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite
330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute
verbatim copies of this license document, but changing it is not allowed.</P>
<P>[This is the first released version of the Lesser GPL. It also counts as the
successor of the GNU Library Public License, version 2, hence the version
number 2.1.]</P>
</BLOCKQUOTE>
<H4>Preamble</H4>
<P>The licenses for most software are designed to take away your freedom to share
and change it. By contrast, the GNU General Public Licenses are intended to
guarantee your freedom to share and change free software--to make sure the
software is free for all its users.
</P>
<P>This license, the Lesser General Public License, applies to some specially
designated software packages--typically libraries--of the Free Software
Foundation and other authors who decide to use it. You can use it too, but we
suggest you first think carefully about whether this license or the ordinary
General Public License is the better strategy to use in any particular case,
based on the explanations below.
</P>
<P>When we speak of free software, we are referring to freedom of use, not price.
Our General Public Licenses are designed to make sure that you have the freedom
to distribute copies of free software (and charge for this service if you
wish); that you receive source code or can get it if you want it; that you can
change the software and use pieces of it in new free programs; and that you are
informed that you can do these things.</P>
<P>To protect your rights, we need to make restrictions that forbid distributors to
deny you these rights or to ask you to surrender these rights. These
restrictions translate to certain responsibilities for you if you distribute
copies of the library or if you modify it.
</P>
<P>For example, if you distribute copies of the library, whether gratis or for a
fee, you must give the recipients all the rights that we gave you. You must
make sure that they, too, receive or can get the source code. If you link other
code with the library, you must provide complete object files to the
recipients, so that they can relink them with the library after making changes
to the library and recompiling it. And you must show them these terms so they
know their rights.
</P>
<P>We protect your rights with a two-step method: (1) we copyright the library, and
(2) we offer you this license, which gives you legal permission to copy,
distribute and/or modify the library.
</P>
<P>To protect each distributor, we want to make it very clear that there is no
warranty for the free library. Also, if the library is modified by someone else
and passed on, the recipients should know that what they have is not the
original version, so that the original author's reputation will not be affected
by problems that might be introduced by others.
</P>
<P>Finally, software patents pose a constant threat to the existence of any free
program. We wish to make sure that a company cannot effectively restrict the
users of a free program by obtaining a restrictive license from a patent
holder. Therefore, we insist that any patent license obtained for a version of
the library must be consistent with the full freedom of use specified in this
license.
</P>
<P>Most GNU software, including some libraries, is covered by the ordinary GNU
General Public License. This license, the GNU Lesser General Public License,
applies to certain designated libraries, and is quite different from the
ordinary General Public License. We use this license for certain libraries in
order to permit linking those libraries into non-free programs.
</P>
<P>When a program is linked with a library, whether statically or using a shared
library, the combination of the two is legally speaking a combined work, a
derivative of the original library. The ordinary General Public License
therefore permits such linking only if the entire combination fits its criteria
of freedom. The Lesser General Public License permits more lax criteria for
linking other code with the library.
</P>
<P>We call this license the "Lesser" General Public License because it does Less to
protect the user's freedom than the ordinary General Public License. It also
provides other free software developers Less of an advantage over competing
non-free programs. These disadvantages are the reason we use the ordinary
General Public License for many libraries. However, the Lesser license provides
advantages in certain special circumstances.
</P>
<P>For example, on rare occasions, there may be a special need to encourage the
widest possible use of a certain library, so that it becomes a de-facto
standard. To achieve this, non-free programs must be allowed to use the
library. A more frequent case is that a free library does the same job as
widely used non-free libraries. In this case, there is little to gain by
limiting the free library to free software only, so we use the Lesser General
Public License.
</P>
<P>In other cases, permission to use a particular library in non-free programs
enables a greater number of people to use a large body of free software. For
example, permission to use the GNU C Library in non-free programs enables many
more people to use the whole GNU operating system, as well as its variant, the
GNU/Linux operating system.
</P>
<P>Although the Lesser General Public License is Less protective of the users'
freedom, it does ensure that the user of a program that is linked with the
Library has the freedom and the wherewithal to run that program using a
modified version of the Library.
</P>
<P>The precise terms and conditions for copying, distribution and modification
follow. Pay close attention to the difference between a "work based on the
library" and a "work that uses the library". The former contains code derived
from the library, whereas the latter must be combined with the library in order
to run.
</P>
<H4>TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</H4>
<P><STRONG>0.</STRONG> This License Agreement applies to any software library or
other program which contains a notice placed by the copyright holder or other
authorized party saying it may be distributed under the terms of this Lesser
General Public License (also called "this License"). Each licensee is addressed
as "you".</P>
<P>A "library" means a collection of software functions and/or data prepared so as
to be conveniently linked with application programs (which use some of those
functions and data) to form executables.
</P>
<P>The "Library", below, refers to any such software library or work which has been
distributed under these terms. A "work based on the Library" means either the
Library or any derivative work under copyright law: that is to say, a work
containing the Library or a portion of it, either verbatim or with
modifications and/or translated straightforwardly into another language.
(Hereinafter, translation is included without limitation in the term
"modification".)
</P>
<P>"Source code" for a work means the preferred form of the work for making
modifications to it. For a library, complete source code means all the source
code for all modules it contains, plus any associated interface definition
files, plus the scripts used to control compilation and installation of the
library.</P>
<P>Activities other than copying, distribution and modification are not covered by
this License; they are outside its scope. The act of running a program using
the Library is not restricted, and output from such a program is covered only
if its contents constitute a work based on the Library (independent of the use
of the Library in a tool for writing it). Whether that is true depends on what
the Library does and what the program that uses the Library does.
</P>
<P><STRONG>1.</STRONG> You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate copyright
notice and disclaimer of warranty; keep intact all the notices that refer to
this License and to the absence of any warranty; and distribute a copy of this
License along with the Library.
</P>
<P>You may charge a fee for the physical act of transferring a copy, and you may at
your option offer warranty protection in exchange for a fee.
</P>
<P><STRONG>2.</STRONG> You may modify your copy or copies of the Library or any
portion of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1 above,
provided that you also meet all of these conditions:
</P>
<BLOCKQUOTE>
<P>a) The modified work must itself be a software library.
</P>
<P>b) You must cause the files modified to carry prominent notices stating that you
changed the files and the date of any change.</P>
<P>c) You must cause the whole of the work to be licensed at no charge to all third
parties under the terms of this License.
</P>
<P>d) If a facility in the modified Library refers to a function or a table of data
to be supplied by an application program that uses the facility, other than as
an argument passed when the facility is invoked, then you must make a good
faith effort to ensure that, in the event an application does not supply such
function or table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
</P>
<P>(For example, a function in a library to compute square roots has a purpose that
is entirely well-defined independent of the application. Therefore, Subsection
2d requires that any application-supplied function or table used by this
function must be optional: if the application does not supply it, the square
root function must still compute square roots.)
</P>
<P>These requirements apply to the modified work as a whole. If identifiable
sections of that work are not derived from the Library, and can be reasonably
considered independent and separate works in themselves, then this License, and
its terms, do not apply to those sections when you distribute them as separate
works. But when you distribute the same sections as part of a whole which is a
work based on the Library, the distribution of the whole must be on the terms
of this License, whose permissions for other licensees extend to the entire
whole, and thus to each and every part regardless of who wrote it.
</P>
<P>Thus, it is not the intent of this section to claim rights or contest your
rights to work written entirely by you; rather, the intent is to exercise the
right to control the distribution of derivative or collective works based on
the Library.
</P>
<P>In addition, mere aggregation of another work not based on the Library with the
Library (or with a work based on the Library) on a volume of a storage or
distribution medium does not bring the other work under the scope of this
License.
</P>
</BLOCKQUOTE>
<P><STRONG>3.</STRONG> You may opt to apply the terms of the ordinary GNU General
Public License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so that they
refer to the ordinary GNU General Public License, version 2, instead of to this
License. (If a newer version than version 2 of the ordinary GNU General Public
License has appeared, then you can specify that version instead if you wish.)
Do not make any other change in these notices.
</P>
<P>Once this change is made in a given copy, it is irreversible for that copy, so
the ordinary GNU General Public License applies to all subsequent copies and
derivative works made from that copy.
</P>
<P>This option is useful when you wish to copy part of the code of the Library into
a program that is not a library.
</P>
<P><STRONG>4.</STRONG> You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form under the
terms of Sections 1 and 2 above provided that you accompany it with the
complete corresponding machine-readable source code, which must be distributed
under the terms of Sections 1 and 2 above on a medium customarily used for
software interchange.
</P>
<P>If distribution of object code is made by offering access to copy from a
designated place, then offering equivalent access to copy the source code from
the same place satisfies the requirement to distribute the source code, even
though third parties are not compelled to copy the source along with the object
code.</P>
<P><STRONG>5.</STRONG> A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or linked
with it, is called a "work that uses the Library". Such a work, in isolation,
is not a derivative work of the Library, and therefore falls outside the scope
of this License.
</P>
<P>However, linking a "work that uses the Library" with the Library creates an
executable that is a derivative of the Library (because it contains portions of
the Library), rather than a "work that uses the library". The executable is
therefore covered by this License. Section 6 states terms for distribution of
such executables.
</P>
<P>When a "work that uses the Library" uses material from a header file that is
part of the Library, the object code for the work may be a derivative work of
the Library even though the source code is not. Whether this is true is
especially significant if the work can be linked without the Library, or if the
work is itself a library. The threshold for this to be true is not precisely
defined by law.
</P>
<P>If such an object file uses only numerical parameters, data structure layouts
and accessors, and small macros and small inline functions (ten lines or less
in length), then the use of the object file is unrestricted, regardless of
whether it is legally a derivative work. (Executables containing this object
code plus portions of the Library will still fall under Section 6.)
</P>
<P>Otherwise, if the work is a derivative of the Library, you may distribute the
object code for the work under the terms of Section 6. Any executables
containing that work also fall under Section 6, whether or not they are linked
directly with the Library itself.
</P>
<P><STRONG>6.</STRONG> As an exception to the Sections above, you may also combine
or link a "work that uses the Library" with the Library to produce a work
containing portions of the Library, and distribute that work under terms of
your choice, provided that the terms permit modification of the work for the
customer's own use and reverse engineering for debugging such modifications.
</P>
<P>You must give prominent notice with each copy of the work that the Library is
used in it and that the Library and its use are covered by this License. You
must supply a copy of this License. If the work during execution displays
copyright notices, you must include the copyright notice for the Library among
them, as well as a reference directing the user to the copy of this License.
Also, you must do one of these things:
</P>
<BLOCKQUOTE>
<P>a) Accompany the work with the complete corresponding machine-readable source
code for the Library including whatever changes were used in the work (which
must be distributed under Sections 1 and 2 above); and, if the work is an
executable linked with the Library, with the complete machine-readable "work
that uses the Library", as object code and/or source code, so that the user can
modify the Library and then relink to produce a modified executable containing
the modified Library. (It is understood that the user who changes the contents
of definitions files in the Library will not necessarily be able to recompile
the application to use the modified definitions.)
</P>
<P>b) Use a suitable shared library mechanism for linking with the Library. A
suitable mechanism is one that (1) uses at run time a copy of the library
already present on the user's computer system, rather than copying library
functions into the executable, and (2) will operate properly with a modified
version of the library, if the user installs one, as long as the modified
version is interface-compatible with the version that the work was made with.
</P>
<P>c) Accompany the work with a written offer, valid for at least three years, to
give the same user the materials specified in Subsection 6a, above, for a
charge no more than the cost of performing this distribution.
</P>
<P>d) If distribution of the work is made by offering access to copy from a
designated place, offer equivalent access to copy the above specified materials
from the same place.
</P>
<P>e) Verify that the user has already received a copy of these materials or that
you have already sent this user a copy.</P>
</BLOCKQUOTE>
<P>For an executable, the required form of the "work that uses the Library" must
include any data and utility programs needed for reproducing the executable
from it. However, as a special exception, the materials to be distributed need
not include anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the operating
system on which the executable runs, unless that component itself accompanies
the executable.
</P>
<P>It may happen that this requirement contradicts the license restrictions of
other proprietary libraries that do not normally accompany the operating
system. Such a contradiction means you cannot use both them and the Library
together in an executable that you distribute.
</P>
<P><STRONG>7.</STRONG> You may place library facilities that are a work based on
the Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined library,
provided that the separate distribution of the work based on the Library and of
the other library facilities is otherwise permitted, and provided that you do
these two things:
</P>
<BLOCKQUOTE>
<P>a) Accompany the combined library with a copy of the same work based on the
Library, uncombined with any other library facilities. This must be distributed
under the terms of the Sections above.
</P>
<P>b) Give prominent notice with the combined library of the fact that part of it
is a work based on the Library, and explaining where to find the accompanying
uncombined form of the same work.</P>
</BLOCKQUOTE>
<P><STRONG>8.</STRONG> You may not copy, modify, sublicense, link with, or
distribute the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or distribute the
Library is void, and will automatically terminate your rights under this
License. However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such parties
remain in full compliance.
</P>
<P><STRONG>9.</STRONG> You are not required to accept this License, since you have
not signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are prohibited by
law if you do not accept this License. Therefore, by modifying or distributing
the Library (or any work based on the Library), you indicate your acceptance of
this License to do so, and all its terms and conditions for copying,
distributing or modifying the Library or works based on it.
</P>
<P><STRONG>10.</STRONG> Each time you redistribute the Library (or any work based
on the Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library subject
to these terms and conditions. You may not impose any further restrictions on
the recipients' exercise of the rights granted herein. You are not responsible
for enforcing compliance by third parties with this License.
</P>
<P><STRONG>11.</STRONG> If, as a consequence of a court judgment or allegation of
patent infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or otherwise)
that contradict the conditions of this License, they do not excuse you from the
conditions of this License. If you cannot distribute so as to satisfy
simultaneously your obligations under this License and any other pertinent
obligations, then as a consequence you may not distribute the Library at all.
For example, if a patent license would not permit royalty-free redistribution
of the Library by all those who receive copies directly or indirectly through
you, then the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
</P>
<P>If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply, and
the section as a whole is intended to apply in other circumstances.
</P>
<P>It is not the purpose of this section to induce you to infringe any patents or
other property right claims or to contest validity of any such claims; this
section has the sole purpose of protecting the integrity of the free software
distribution system which is implemented by public license practices. Many
people have made generous contributions to the wide range of software
distributed through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing to
distribute software through any other system and a licensee cannot impose that
choice.
</P>
<P>This section is intended to make thoroughly clear what is believed to be a
consequence of the rest of this License.
</P>
<P><STRONG>12.</STRONG> If the distribution and/or use of the Library is restricted
in certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add an
explicit geographical distribution limitation excluding those countries, so
that distribution is permitted only in or among countries not thus excluded. In
such case, this License incorporates the limitation as if written in the body
of this License.
</P>
<P><STRONG>13.</STRONG> The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may differ in
detail to address new problems or concerns.</P>
<P>Each version is given a distinguishing version number. If the Library specifies
a version number of this License which applies to it and "any later version",
you have the option of following the terms and conditions either of that
version or of any later version published by the Free Software Foundation. If
the Library does not specify a license version number, you may choose any
version ever published by the Free Software Foundation.
</P>
<P><STRONG>14.</STRONG> If you wish to incorporate parts of the Library into other
free programs whose distribution conditions are incompatible with these, write
to the author to ask for permission. For software which is copyrighted by the
Free Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals of
preserving the free status of all derivatives of our free software and of
promoting the sharing and reuse of software generally.
</P>
<P>NO WARRANTY
</P>
<P><STRONG>15. </STRONG>BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT
WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE
QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
CORRECTION.
</P>
<P><STRONG>16.</STRONG> IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO
IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT
OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS
OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN
IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
</P>
<H4><STRONG>END OF TERMS AND CONDITIONS</STRONG></H4>
</TT>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_about/logo_fredck.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_about/logo_fredck.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_about.html
New file
0,0 → 1,145
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_about.html
* "About" dialog window.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow">
<script src="common/fck_dialog_common.js" type="text/javascript"></script>
<script language="javascript">
 
var oEditor = window.parent.InnerDialogLoaded() ;
var FCKLang = oEditor.FCKLang ;
 
window.parent.AddTab( 'About', FCKLang.DlgAboutAboutTab ) ;
window.parent.AddTab( 'License', FCKLang.DlgAboutLicenseTab ) ;
window.parent.AddTab( 'BrowserInfo', FCKLang.DlgAboutBrowserInfoTab ) ;
 
// Function called when a dialog tag is selected.
function OnDialogTabChange( tabCode )
{
ShowE('divAbout', ( tabCode == 'About' ) ) ;
ShowE('divLicense', ( tabCode == 'License' ) ) ;
ShowE('divInfo' , ( tabCode == 'BrowserInfo' ) ) ;
}
 
function SendEMail()
{
var eMail = 'mailto:' ;
eMail += 'fredck' ;
eMail += '@' ;
eMail += 'fckeditor' ;
eMail += '.' ;
eMail += 'net' ;
 
window.location = eMail ;
}
 
window.onload = function()
{
// Translate the dialog box texts.
oEditor.FCKLanguageManager.TranslatePage(document) ;
 
window.parent.SetAutoSize( true ) ;
}
 
</script>
</head>
<body scroll="no" style="OVERFLOW: hidden">
<div id="divAbout">
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
<tr>
<td>
<img alt="" src="fck_about/logo_fckeditor.gif" width="236" height="41" align="left">
<table width="80" border="0" cellspacing="0" cellpadding="5" bgcolor="#ffffff" align="right">
<tr>
<td align="center" nowrap style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid">
<span fckLang="DlgAboutVersion">version</span>
<br>
<b>2.3.2</b><br />
Build 1082</td>
</tr>
</table>
</td>
</tr>
<tr height="100%">
<td align="center">
&nbsp;<br>
<span style="FONT-SIZE: 14px" dir="ltr"><br>
<b><a href="http://www.fckeditor.net/?about" target="_blank" title="Visit the FCKeditor web site">
Support <b>Open Source</b> Software</a></b> </span>
<br><br><br>
<span fckLang="DlgAboutInfo">For further information go to</span> <a href="http://www.fckeditor.net/?About" target="_blank">
http://www.fckeditor.net/</a>.
<br>
Copyright &copy; 2003-2006 <a href="#" onclick="SendEMail();">Frederico Caldeira
Knabben</a>
</td>
</tr>
<tr>
<td align="center">
<img alt="" src="fck_about/logo_fredck.gif" width="87" height="36">
</td>
</tr>
</table>
</div>
<div id="divLicense" style="DISPLAY: none">
<table height="100%" width="100%">
<tr>
<td>
<span fckLang="DlgAboutLicense">Licensed under the terms of the GNU Lesser General
Public License</span>
<br>
<a href="http://www.opensource.org/licenses/lgpl-license.php" target="_blank">http://www.opensource.org/licenses/lgpl-license.php</a>
<br>
</td>
</tr>
<tr>
<td height="100%">
<iframe height="100%" width="100%" src="fck_about/lgpl.html"></iframe>
</td>
</tr>
</table>
</div>
<div id="divInfo" style="DISPLAY: none" dir="ltr">
<table align="center" width="80%" border="0">
<tr>
<td>
<script language="javascript">
<!--
document.write( '<b>User Agent<\/b><br>' + window.navigator.userAgent + '<br><br>' ) ;
document.write( '<b>Browser<\/b><br>' + window.navigator.appName + ' ' + window.navigator.appVersion + '<br><br>' ) ;
document.write( '<b>Platform<\/b><br>' + window.navigator.platform + '<br><br>' ) ;
 
var sUserLang = '?' ;
 
if ( window.navigator.language )
sUserLang = window.navigator.language.toLowerCase() ;
else if ( window.navigator.userLanguage )
sUserLang = window.navigator.userLanguage.toLowerCase() ;
 
document.write( '<b>User Language<\/b><br>' + sUserLang ) ;
//-->
</script>
</td>
</tr>
</table>
</div>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_anchor.html
New file
0,0 → 1,98
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_anchor.html
* Anchor dialog window.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<html>
<head>
<title>Anchor Properties</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta content="noindex, nofollow" name="robots">
<script src="common/fck_dialog_common.js" type="text/javascript"></script>
<script type="text/javascript">
 
var oEditor = window.parent.InnerDialogLoaded() ;
var FCK = oEditor.FCK ;
 
// Gets the document DOM
var oDOM = oEditor.FCK.EditorDocument ;
 
var oFakeImage = FCK.Selection.GetSelectedElement() ;
var oAnchor ;
 
if ( oFakeImage )
{
if ( oFakeImage.tagName == 'IMG' && oFakeImage.getAttribute('_fckanchor') )
oAnchor = FCK.GetRealElement( oFakeImage ) ;
else
oFakeImage = null ;
}
 
window.onload = function()
{
// First of all, translate the dialog box texts
oEditor.FCKLanguageManager.TranslatePage(document) ;
 
if ( oAnchor )
GetE('txtName').value = oAnchor.name ;
else
oAnchor = null ;
 
window.parent.SetOkButton( true ) ;
}
 
function Ok()
{
if ( GetE('txtName').value.length == 0 )
{
alert( oEditor.FCKLang.DlgAnchorErrorName ) ;
return false ;
}
oEditor.FCKUndo.SaveUndoStep() ;
oAnchor = FCK.EditorDocument.createElement( 'DIV' ) ;
oAnchor.innerHTML = '<a name="' + GetE('txtName').value + '"><\/a>' ;
oAnchor = oAnchor.firstChild ;
 
oFakeImage = oEditor.FCKDocumentProcessor_CreateFakeImage( 'FCK__Anchor', oAnchor ) ;
oFakeImage.setAttribute( '_fckanchor', 'true', 0 ) ;
oFakeImage = FCK.InsertElementAndGetIt( oFakeImage ) ;
 
// oEditor.FCK.InsertHtml( '<a name="' + GetE('txtName').value + '"><\/a>' ) ;
return true ;
}
 
</script>
</head>
<body style="OVERFLOW: hidden" scroll="no">
<table height="100%" width="100%">
<tr>
<td align="center">
<table border="0" cellpadding="0" cellspacing="0" width="80%">
<tr>
<td>
<span fckLang="DlgAnchorName">Anchor Name</span><BR>
<input id="txtName" style="WIDTH: 100%" type="text">
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_template.html
New file
0,0 → 1,236
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_template.html
* Template selection dialog window.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex, nofollow" />
<style type="text/css">
.TplList
{
border: #dcdcdc 2px solid;
background-color: #ffffff;
overflow: auto;
width: 90%;
}
 
.TplItem
{
margin: 5px;
padding: 7px;
border: #eeeeee 1px solid;
}
 
.TplItem TABLE
{
display: inline;
}
 
.TplTitle
{
font-weight: bold;
}
</style>
<script src="common/fck_dialog_common.js" type="text/javascript"></script>
<script type="text/javascript">
 
var oEditor = window.parent.InnerDialogLoaded() ;
var FCK = oEditor.FCK ;
var FCKLang = oEditor.FCKLang ;
var FCKConfig = oEditor.FCKConfig ;
 
window.onload = function()
{
// Set the right box height (browser dependent).
GetE('eList').style.height = document.all ? '100%' : '295px' ;
 
// Translate the dialog box texts.
oEditor.FCKLanguageManager.TranslatePage(document) ;
GetE('xChkReplaceAll').checked = ( FCKConfig.TemplateReplaceAll !== false ) ;
if ( FCKConfig.TemplateReplaceCheckbox !== false )
GetE('xReplaceBlock').style.display = '' ;
 
window.parent.SetAutoSize( true ) ;
 
LoadTemplatesXml() ;
}
 
function LoadTemplatesXml()
{
if ( !FCK._Templates )
{
GetE('eLoading').style.display = '' ;
 
// Create the Templates array.
FCK._Templates = new Array() ;
 
// Load the XML file.
var oXml = new oEditor.FCKXml() ;
oXml.LoadUrl( FCKConfig.TemplatesXmlPath ) ;
 
// Get the Images Base Path.
var oAtt = oXml.SelectSingleNode( 'Templates/@imagesBasePath' ) ;
var sImagesBasePath = oAtt ? oAtt.value : '' ;
 
// Get the "Template" nodes defined in the XML file.
var aTplNodes = oXml.SelectNodes( 'Templates/Template' ) ;
 
for ( var i = 0 ; i < aTplNodes.length ; i++ )
{
var oNode = aTplNodes[i]
 
var oTemplate = new Object() ;
 
var oPart ;
 
// Get the Template Title.
if ( oPart = oNode.attributes.getNamedItem('title') )
oTemplate.Title = oPart.value ;
else
oTemplate.Title = 'Template ' + ( i + 1 ) ;
 
// Get the Template Description.
if ( oPart = oXml.SelectSingleNode( 'Description', oNode ) )
oTemplate.Description = oPart.text ? oPart.text : oPart.textContent ;
 
// Get the Template Image.
if ( oPart = oNode.attributes.getNamedItem('image') )
oTemplate.Image = sImagesBasePath + oPart.value ;
 
// Get the Template HTML.
if ( oPart = oXml.SelectSingleNode( 'Html', oNode ) )
oTemplate.Html = oPart.text ? oPart.text : oPart.textContent ;
else
{
alert( 'No HTML defined for template index ' + i + '. Please review the "' + FCKConfig.TemplatesXmlPath + '" file.' ) ;
continue ;
}
 
FCK._Templates[ FCK._Templates.length ] = oTemplate ;
}
 
GetE('eLoading').style.display = 'none' ;
}
 
if ( FCK._Templates.length == 0 )
GetE('eEmpty').style.display = '' ;
else
{
for ( var i = 0 ; i < FCK._Templates.length ; i++ )
{
var oTemplate = FCK._Templates[i] ;
 
var oItemDiv = GetE('eList').appendChild( document.createElement( 'DIV' ) ) ;
oItemDiv.TplIndex = i ;
oItemDiv.className = 'TplItem' ;
 
// Build the inner HTML of our new item DIV.
var sInner = '<table><tr>' ;
 
if ( oTemplate.Image )
sInner += '<td valign="top"><img src="' + oTemplate.Image + '"><\/td>' ;
 
sInner += '<td valign="top"><div class="TplTitle">' + oTemplate.Title + '<\/div>' ;
 
if ( oTemplate.Description )
sInner += '<div>' + oTemplate.Description + '<\/div>' ;
 
sInner += '<\/td><\/tr><\/table>' ;
 
oItemDiv.innerHTML = sInner ;
oItemDiv.onmouseover = ItemDiv_OnMouseOver ;
oItemDiv.onmouseout = ItemDiv_OnMouseOut ;
oItemDiv.onclick = ItemDiv_OnClick ;
}
}
}
 
function ItemDiv_OnMouseOver()
{
this.className += ' PopupSelectionBox' ;
}
 
function ItemDiv_OnMouseOut()
{
this.className = this.className.replace( /\s*PopupSelectionBox\s*/, '' ) ;
}
 
function ItemDiv_OnClick()
{
SelectTemplate( this.TplIndex ) ;
}
 
function SelectTemplate( index )
{
oEditor.FCKUndo.SaveUndoStep() ;
 
if ( GetE('xChkReplaceAll').checked )
FCK.SetHTML( FCK._Templates[index].Html ) ;
else
FCK.InsertHtml( FCK._Templates[index].Html ) ;
 
window.parent.Cancel( true ) ;
}
 
</script>
</head>
<body style="overflow: hidden">
<table width="100%" style="height: 100%">
<tr>
<td align="center">
<span fcklang="DlgTemplatesSelMsg">Please select the template to open in the editor<br />
(the actual contents will be lost):</span>
</td>
</tr>
<tr>
<td height="100%" align="center">
<div id="eList" align="left" class="TplList">
<div id="eLoading" align="center" style="display: none">
<br />
<span fcklang="DlgTemplatesLoading">Loading templates list. Please wait...</span>
</div>
<div id="eEmpty" align="center" style="display: none">
<br />
<span fcklang="DlgTemplatesNoTpl">(No templates defined)</span>
</div>
</div>
</td>
</tr>
<tr id="xReplaceBlock" style="display: none">
<td>
<table cellpadding="0" cellspacing="0">
<tr>
<td>
<input id="xChkReplaceAll" type="checkbox" /></td>
<td>
&nbsp;</td>
<td>
<label for="xChkReplaceAll" fcklang="DlgTemplatesReplace">
Replace actual contents</label></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_button.html
New file
0,0 → 1,103
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_button.html
* Button dialog window.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Button Properties</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta content="noindex, nofollow" name="robots" />
<script src="common/fck_dialog_common.js" type="text/javascript"></script>
<script type="text/javascript">
 
var oEditor = window.parent.InnerDialogLoaded() ;
 
// Gets the document DOM
var oDOM = oEditor.FCK.EditorDocument ;
 
var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
 
window.onload = function()
{
// First of all, translate the dialog box texts
oEditor.FCKLanguageManager.TranslatePage(document) ;
 
if ( oActiveEl && oActiveEl.tagName.toUpperCase() == "INPUT" && ( oActiveEl.type == "button" || oActiveEl.type == "submit" || oActiveEl.type == "reset" ) )
{
GetE('txtName').value = oActiveEl.name ;
GetE('txtValue').value = oActiveEl.value ;
GetE('txtType').value = oActiveEl.type ;
 
GetE('txtType').disabled = true ;
}
else
oActiveEl = null ;
 
window.parent.SetOkButton( true ) ;
}
 
function Ok()
{
if ( !oActiveEl )
{
oActiveEl = oEditor.FCK.EditorDocument.createElement( 'INPUT' ) ;
oActiveEl.type = GetE('txtType').value ;
oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ;
}
 
oActiveEl.name = GetE('txtName').value ;
SetAttribute( oActiveEl, 'value', GetE('txtValue').value ) ;
 
return true ;
}
 
</script>
</head>
<body style="overflow: hidden">
<table width="100%" style="height: 100%">
<tr>
<td align="center">
<table border="0" cellpadding="0" cellspacing="0" width="80%">
<tr>
<td colspan="">
<span fcklang="DlgCheckboxName">Name</span><br />
<input type="text" size="20" id="txtName" style="width: 100%" />
</td>
</tr>
<tr>
<td>
<span fcklang="DlgButtonText">Text (Value)</span><br />
<input type="text" id="txtValue" style="width: 100%" />
</td>
</tr>
<tr>
<td>
<span fcklang="DlgButtonType">Type</span><br />
<select id="txtType">
<option fcklang="DlgButtonTypeBtn" value="button" selected="selected">Button</option>
<option fcklang="DlgButtonTypeSbm" value="submit">Submit</option>
<option fcklang="DlgButtonTypeRst" value="reset">Reset</option>
</select>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_replace.html
New file
0,0 → 1,153
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_replace.html
* "Replace" dialog box window.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
* Abdul-Aziz A. Al-Oraij (aziz.oraij.com)
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta content="noindex, nofollow" name="robots" />
<script type="text/javascript">
 
var oEditor = window.parent.InnerDialogLoaded() ;
 
function OnLoad()
{
// First of all, translate the dialog box texts
oEditor.FCKLanguageManager.TranslatePage( document ) ;
 
window.parent.SetAutoSize( true ) ;
 
oEditor.FCKUndo.SaveUndoStep() ;
}
 
function btnStat(frm)
{
document.getElementById('btnReplace').disabled =
document.getElementById('btnReplaceAll').disabled =
( document.getElementById('txtFind').value.length == 0 ) ;
}
 
function ReplaceTextNodes( parentNode, regex, replaceValue, replaceAll, hasFound )
{
for ( var i = 0 ; i < parentNode.childNodes.length ; i++ )
{
var oNode = parentNode.childNodes[i] ;
if ( oNode.nodeType == 3 )
{
var sReplaced = oNode.nodeValue.replace( regex, replaceValue ) ;
if ( oNode.nodeValue != sReplaced )
{
oNode.nodeValue = sReplaced ;
if ( ! replaceAll )
return true ;
hasFound = true ;
}
}
 
hasFound = ReplaceTextNodes( oNode, regex, replaceValue, replaceAll, hasFound ) ;
if ( ! replaceAll && hasFound )
return true ;
}
return hasFound ;
}
 
function GetRegexExpr()
{
var sExpr = EscapeRegexString( document.getElementById('txtFind').value ) ;
 
if ( document.getElementById('chkWord').checked )
sExpr = '\\b' + sExpr + '\\b' ;
 
return sExpr ;
}
 
function GetCase()
{
return ( document.getElementById('chkCase').checked ? '' : 'i' ) ;
}
 
function GetReplacement()
{
return document.getElementById('txtReplace').value.replace( /\$/g, '$$$$' ) ;
}
 
function EscapeRegexString( str )
{
return str.replace( /[\\\^\$\*\+\?\{\}\.\(\)\!\|\[\]\-]/g, '\\$&' ) ;
}
 
function Replace()
{
var oRegex = new RegExp( GetRegexExpr(), GetCase() ) ;
if ( !ReplaceTextNodes( oEditor.FCK.EditorDocument.body, oRegex, GetReplacement(), false, false ) )
alert( oEditor.FCKLang.DlgFindNotFoundMsg ) ;
}
 
function ReplaceAll()
{
var oRegex = new RegExp( GetRegexExpr(), GetCase() + 'g' ) ;
if ( !ReplaceTextNodes( oEditor.FCK.EditorDocument.body, oRegex, GetReplacement(), true, false ) )
alert( oEditor.FCKLang.DlgFindNotFoundMsg ) ;
window.parent.Cancel() ;
}
</script>
</head>
<body onload="OnLoad()" style="overflow: hidden">
<table cellspacing="3" cellpadding="2" width="100%" border="0">
<tr>
<td nowrap="nowrap">
<label for="txtFind" fcklang="DlgReplaceFindLbl">
Find what:</label>
</td>
<td width="100%">
<input id="txtFind" onkeyup="btnStat(this.form)" style="width: 100%" tabindex="1"
type="text" />
</td>
<td>
<input id="btnReplace" style="width: 100%" disabled="disabled" onclick="Replace();"
type="button" value="Replace" fcklang="DlgReplaceReplaceBtn" />
</td>
</tr>
<tr>
<td valign="top" nowrap="nowrap">
<label for="txtReplace" fcklang="DlgReplaceReplaceLbl">
Replace with:</label>
</td>
<td valign="top">
<input id="txtReplace" style="width: 100%" tabindex="2" type="text" />
</td>
<td>
<input id="btnReplaceAll" disabled="disabled" onclick="ReplaceAll()" type="button"
value="Replace All" fcklang="DlgReplaceReplAllBtn" />
</td>
</tr>
<tr>
<td valign="bottom" colspan="3">
&nbsp;<input id="chkCase" tabindex="3" type="checkbox" /><label for="chkCase" fcklang="DlgReplaceCaseChk">Match
case</label>
<br />
&nbsp;<input id="chkWord" tabindex="4" type="checkbox" /><label for="chkWord" fcklang="DlgReplaceWordChk">Match
whole word</label>
</td>
</tr>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_paste.html
New file
0,0 → 1,230
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_paste.html
* This dialog is shown when, for some reason (usually security settings),
* the user is not able to paste data from the clipboard to the editor using
* the toolbar buttons or the context menu.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex, nofollow" />
<script type="text/javascript">
var oEditor = window.parent.InnerDialogLoaded() ;
 
window.onload = function ()
{
// First of all, translate the dialog box texts
oEditor.FCKLanguageManager.TranslatePage(document) ;
if ( window.parent.dialogArguments.CustomValue == 'Word' )
{
var oFrame = document.getElementById('frmData')
oFrame.style.display = '' ;
if ( oFrame.contentDocument )
oFrame.contentDocument.designMode = 'on' ;
else
oFrame.contentWindow.document.body.contentEditable = true ;
}
else
{
document.getElementById('txtData').style.display = '' ;
document.getElementById('oWordCommands').style.display = 'none' ;
}
 
window.parent.SetOkButton( true ) ;
window.parent.SetAutoSize( true ) ;
}
 
function Ok()
{
var sHtml ;
if ( window.parent.dialogArguments.CustomValue == 'Word' )
{
var oFrame = document.getElementById('frmData') ;
if ( oFrame.contentDocument )
sHtml = oFrame.contentDocument.body.innerHTML ;
else
sHtml = oFrame.contentWindow.document.body.innerHTML ;
 
sHtml = CleanWord( sHtml ) ;
}
else
{
var sHtml = oEditor.FCKTools.HTMLEncode( document.getElementById('txtData').value ) ;
sHtml = sHtml.replace( /\n/g, '<BR>' ) ;
}
oEditor.FCK.InsertHtml( sHtml ) ;
return true ;
}
 
function CleanUpBox()
{
var oFrame = document.getElementById('frmData') ;
if ( oFrame.contentDocument )
oFrame.contentDocument.body.innerHTML = '' ;
else
oFrame.contentWindow.document.body.innerHTML = '' ;
}
 
function CleanWord( html )
{
var bIgnoreFont = document.getElementById('chkRemoveFont').checked ;
var bRemoveStyles = document.getElementById('chkRemoveStyles').checked ;
 
html = html.replace(/<o:p>\s*<\/o:p>/g, "") ;
html = html.replace(/<o:p>.*?<\/o:p>/g, "&nbsp;") ;
// Remove mso-xxx styles.
html = html.replace( /\s*mso-[^:]+:[^;"]+;?/gi, "" ) ;
 
// Remove margin styles.
html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*;/gi, "" ) ;
html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*"/gi, "\"" ) ;
 
html = html.replace( /\s*TEXT-INDENT: 0cm\s*;/gi, "" ) ;
html = html.replace( /\s*TEXT-INDENT: 0cm\s*"/gi, "\"" ) ;
 
html = html.replace( /\s*TEXT-ALIGN: [^\s;]+;?"/gi, "\"" ) ;
 
html = html.replace( /\s*PAGE-BREAK-BEFORE: [^\s;]+;?"/gi, "\"" ) ;
 
html = html.replace( /\s*FONT-VARIANT: [^\s;]+;?"/gi, "\"" ) ;
 
html = html.replace( /\s*tab-stops:[^;"]*;?/gi, "" ) ;
html = html.replace( /\s*tab-stops:[^"]*/gi, "" ) ;
 
// Remove FONT face attributes.
if ( bIgnoreFont )
{
html = html.replace( /\s*face="[^"]*"/gi, "" ) ;
html = html.replace( /\s*face=[^ >]*/gi, "" ) ;
 
html = html.replace( /\s*FONT-FAMILY:[^;"]*;?/gi, "" ) ;
}
// Remove Class attributes
html = html.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3") ;
 
// Remove styles.
if ( bRemoveStyles )
html = html.replace( /<(\w[^>]*) style="([^\"]*)"([^>]*)/gi, "<$1$3" ) ;
 
// Remove empty styles.
html = html.replace( /\s*style="\s*"/gi, '' ) ;
html = html.replace( /<SPAN\s*[^>]*>\s*&nbsp;\s*<\/SPAN>/gi, '&nbsp;' ) ;
html = html.replace( /<SPAN\s*[^>]*><\/SPAN>/gi, '' ) ;
// Remove Lang attributes
html = html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ;
html = html.replace( /<SPAN\s*>(.*?)<\/SPAN>/gi, '$1' ) ;
html = html.replace( /<FONT\s*>(.*?)<\/FONT>/gi, '$1' ) ;
 
// Remove XML elements and declarations
html = html.replace(/<\\?\?xml[^>]*>/gi, "") ;
// Remove Tags with XML namespace declarations: <o:p><\/o:p>
html = html.replace(/<\/?\w+:[^>]*>/gi, "") ;
// Remove comments [SF BUG-1481861].
html = html.replace(/<\!--.*-->/g, "") ;
html = html.replace( /<H\d>\s*<\/H\d>/gi, '' ) ;
 
html = html.replace( /<H1([^>]*)>/gi, '<div$1><b><font size="6">' ) ;
html = html.replace( /<H2([^>]*)>/gi, '<div$1><b><font size="5">' ) ;
html = html.replace( /<H3([^>]*)>/gi, '<div$1><b><font size="4">' ) ;
html = html.replace( /<H4([^>]*)>/gi, '<div$1><b><font size="3">' ) ;
html = html.replace( /<H5([^>]*)>/gi, '<div$1><b><font size="2">' ) ;
html = html.replace( /<H6([^>]*)>/gi, '<div$1><b><font size="1">' ) ;
 
html = html.replace( /<\/H\d>/gi, '<\/font><\/b><\/div>' ) ;
html = html.replace( /<(U|I|STRIKE)>&nbsp;<\/\1>/g, '&nbsp;' ) ;
 
// Remove empty tags (three times, just to be sure).
html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ;
html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ;
html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ;
 
// Transform <P> to <DIV>
var re = new RegExp( "(<P)([^>]*>.*?)(<\/P>)", "gi" ) ; // Different because of a IE 5.0 error
html = html.replace( re, "<div$2<\/div>" ) ;
// Fix relative anchor URLs (IE automatically adds the current page URL).
re = new RegExp( window.location + "#", "g" ) ;
html = html.replace( re, '#') ;
 
return html ;
}
 
</script>
</head>
<body style="overflow: hidden">
<table cellspacing="0" cellpadding="0" width="100%" border="0" style="height: 98%">
<tr>
<td>
<span fcklang="DlgPasteMsg2">Please paste inside the following box using the keyboard
(<strong>Ctrl+V</strong>) and hit <strong>OK</strong>.</span>
<br />
&nbsp;
</td>
</tr>
<tr>
<td valign="top" height="100%" style="border-right: #000000 1px solid; border-top: #000000 1px solid;
border-left: #000000 1px solid; border-bottom: #000000 1px solid">
<textarea id="txtData" cols="80" rows="5" style="border: #000000 1px; display: none;
width: 99%; height: 98%"></textarea>
<iframe id="frmData" src="javascript:void(0)" height="98%" width="99%" frameborder="0"
style="border-right: #000000 1px; border-top: #000000 1px; display: none; border-left: #000000 1px;
border-bottom: #000000 1px; background-color: #ffffff"></iframe>
</td>
</tr>
<tr id="oWordCommands">
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td nowrap="nowrap">
<input id="chkRemoveFont" type="checkbox" checked="checked" />
<label for="chkRemoveFont" fcklang="DlgPasteIgnoreFont">
Ignore Font Face definitions</label>
<br />
<input id="chkRemoveStyles" type="checkbox" />
<label for="chkRemoveStyles" fcklang="DlgPasteRemoveStyles">
Remove Styles definitions</label>
</td>
<td align="right" valign="top">
<input type="button" fcklang="DlgPasteCleanBox" value="Clean Up Box" onclick="CleanUpBox()" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_specialchar.html
New file
0,0 → 1,109
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_specialchar.html
* Special Chars Selector dialog window.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
<meta name="robots" content="noindex, nofollow">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
.Hand
{
cursor: pointer ;
cursor: hand ;
}
.Sample { font-size: 24px; }
</style>
<script type="text/javascript">
 
var oEditor = window.parent.InnerDialogLoaded() ;
 
var oSample ;
 
function insertChar(charValue)
{
oEditor.FCK.InsertHtml( charValue || "" ) ;
window.parent.Cancel() ;
}
 
function over(td)
{
oSample.innerHTML = td.innerHTML ;
td.className = 'LightBackground SpecialCharsOver Hand' ;
}
 
function out(td)
{
oSample.innerHTML = "&nbsp;" ;
td.className = 'DarkBackground SpecialCharsOut Hand' ;
}
 
function setDefaults()
{
// Gets the sample placeholder.
oSample = document.getElementById("SampleTD") ;
 
// First of all, translates the dialog box texts.
oEditor.FCKLanguageManager.TranslatePage(document) ;
}
 
</script>
</HEAD>
<BODY onload="setDefaults()" scroll="no">
<table cellpadding="0" cellspacing="0" width="100%" height="100%">
<tr>
<td width="100%">
<table cellpadding="1" cellspacing="1" align="center" border="0" width="100%" height="100%">
<script type="text/javascript">
var aChars = ["!","&quot;","#","$","%","&amp;","\\'","(",")","*","+","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","&lt;","=","&gt;","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","&euro;","&lsquo;","&rsquo;","&rsquo;","&ldquo;","&rdquo;","&ndash;","&mdash;","&iexcl;","&cent;","&pound;","&curren;","&yen;","&brvbar;","&sect;","&uml;","&copy;","&ordf;","&laquo;","&not;","&reg;","&macr;","&deg;","&plusmn;","&sup2;","&sup3;","&acute;","&micro;","&para;","&middot;","&cedil;","&sup1;","&ordm;","&raquo;","&frac14;","&frac12;","&frac34;","&iquest;","&Agrave;","&Aacute;","&Acirc;","&Atilde;","&Auml;","&Aring;","&AElig;","&Ccedil;","&Egrave;","&Eacute;","&Ecirc;","&Euml;","&Igrave;","&Iacute;","&Icirc;","&Iuml;","&ETH;","&Ntilde;","&Ograve;","&Oacute;","&Ocirc;","&Otilde;","&Ouml;","&times;","&Oslash;","&Ugrave;","&Uacute;","&Ucirc;","&Uuml;","&Yacute;","&THORN;","&szlig;","&agrave;","&aacute;","&acirc;","&atilde;","&auml;","&aring;","&aelig;","&ccedil;","&egrave;","&eacute;","&ecirc;","&euml;","&igrave;","&iacute;","&icirc;","&iuml;","&eth;","&ntilde;","&ograve;","&oacute;","&ocirc;","&otilde;","&ouml;","&divide;","&oslash;","&ugrave;","&uacute;","&ucirc;","&uuml;","&uuml;","&yacute;","&thorn;","&yuml;","&OElig;","&oelig;","&sbquo;","&#8219;","&bdquo;","&hellip;","&trade;","&#9658;","&bull;","&rarr;","&rArr;","&hArr;","&diams;","&asymp;"] ;
 
var cols = 20 ;
 
var i = 0 ;
while (i < aChars.length)
{
document.write("<TR>") ;
for(var j = 0 ; j < cols ; j++)
{
if (aChars[i])
{
document.write('<TD width="1%" class="DarkBackground SpecialCharsOut Hand" align="center" onclick="insertChar(\'' + aChars[i].replace(/&/g, "&amp;") + '\')" onmouseover="over(this)" onmouseout="out(this)">') ;
document.write(aChars[i]) ;
}
else
document.write("<TD class='DarkBackground SpecialCharsOut'>&nbsp;") ;
document.write("<\/TD>") ;
i++ ;
}
document.write("<\/TR>") ;
}
</script>
</table>
</td>
<td nowrap>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td valign="top">
<table width="40" cellpadding="0" cellspacing="0" border="0">
<tr>
<td id="SampleTD" width="40" height="40" align="center" class="DarkBackground SpecialCharsOut Sample">&nbsp;</td>
</tr>
</table>
</td>
</tr>
</table>
</BODY>
</HTML>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_image/fck_image_preview.html
New file
0,0 → 1,61
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_image_preview.html
* Preview page for the Image dialog window.
* Curiosity: http://en.wikipedia.org/wiki/Lorem_ipsum
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex, nofollow" />
<link href="../common/fck_dialog_common.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
 
// Sets the Skin CSS
document.write( '<link href="' + window.parent.FCKConfig.SkinPath + 'fck_dialog.css" type="text/css" rel="stylesheet">' ) ;
 
if ( window.parent.FCKConfig.BaseHref.length > 0 )
document.write( '<base href="' + window.parent.FCKConfig.BaseHref + '">' ) ;
 
window.onload = function()
{
window.parent.SetPreviewElements(
document.getElementById( 'imgPreview' ),
document.getElementById( 'lnkPreview' ) ) ;
}
 
</script>
</head>
<body style="color: #000000; background-color: #ffffff">
<a id="lnkPreview" onclick="return false;" style="cursor: default">
<img id="imgPreview" onload="window.parent.UpdateOriginal();" style="display: none" /></a>Lorem
ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas feugiat consequat diam.
Maecenas metus. Vivamus diam purus, cursus a, commodo non, facilisis vitae, nulla.
Aenean dictum lacinia tortor. Nunc iaculis, nibh non iaculis aliquam, orci felis
euismod neque, sed ornare massa mauris sed velit. Nulla pretium mi et risus. Fusce
mi pede, tempor id, cursus ac, ullamcorper nec, enim. Sed tortor. Curabitur molestie.
Duis velit augue, condimentum at, ultrices a, luctus ut, orci. Donec pellentesque
egestas eros. Integer cursus, augue in cursus faucibus, eros pede bibendum sem,
in tempus tellus justo quis ligula. Etiam eget tortor. Vestibulum rutrum, est ut
placerat elementum, lectus nisl aliquam velit, tempor aliquam eros nunc nonummy
metus. In eros metus, gravida a, gravida sed, lobortis id, turpis. Ut ultrices,
ipsum at venenatis fringilla, sem nulla lacinia tellus, eget aliquet turpis mauris
non enim. Nam turpis. Suspendisse lacinia. Curabitur ac tortor ut ipsum egestas
elementum. Nunc imperdiet gravida mauris.
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_image/fck_image.js
New file
0,0 → 1,477
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_image.js
* Scripts related to the Image dialog window (see fck_image.html).
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var oEditor = window.parent.InnerDialogLoaded() ;
var FCK = oEditor.FCK ;
var FCKLang = oEditor.FCKLang ;
var FCKConfig = oEditor.FCKConfig ;
var FCKDebug = oEditor.FCKDebug ;
 
var bImageButton = ( document.location.search.length > 0 && document.location.search.substr(1) == 'ImageButton' ) ;
 
//#### Dialog Tabs
 
// Set the dialog tabs.
window.parent.AddTab( 'Info', FCKLang.DlgImgInfoTab ) ;
 
if ( !bImageButton && !FCKConfig.ImageDlgHideLink )
window.parent.AddTab( 'Link', FCKLang.DlgImgLinkTab ) ;
 
if ( FCKConfig.ImageUpload )
window.parent.AddTab( 'Upload', FCKLang.DlgLnkUpload ) ;
 
if ( !FCKConfig.ImageDlgHideAdvanced )
window.parent.AddTab( 'Advanced', FCKLang.DlgAdvancedTag ) ;
 
// Function called when a dialog tag is selected.
function OnDialogTabChange( tabCode )
{
ShowE('divInfo' , ( tabCode == 'Info' ) ) ;
ShowE('divLink' , ( tabCode == 'Link' ) ) ;
ShowE('divUpload' , ( tabCode == 'Upload' ) ) ;
ShowE('divAdvanced' , ( tabCode == 'Advanced' ) ) ;
}
 
// Get the selected image (if available).
var oImage = FCK.Selection.GetSelectedElement() ;
 
if ( oImage && oImage.tagName != 'IMG' && !( oImage.tagName == 'INPUT' && oImage.type == 'image' ) )
oImage = null ;
 
// Get the active link.
var oLink = FCK.Selection.MoveToAncestorNode( 'A' ) ;
 
var oImageOriginal ;
 
function UpdateOriginal( resetSize )
{
if ( !eImgPreview )
return ;
if ( GetE('txtUrl').value.length == 0 )
{
oImageOriginal = null ;
return ;
}
oImageOriginal = document.createElement( 'IMG' ) ; // new Image() ;
 
if ( resetSize )
{
oImageOriginal.onload = function()
{
this.onload = null ;
ResetSizes() ;
}
}
 
oImageOriginal.src = eImgPreview.src ;
}
 
var bPreviewInitialized ;
 
window.onload = function()
{
// Translate the dialog box texts.
oEditor.FCKLanguageManager.TranslatePage(document) ;
 
GetE('btnLockSizes').title = FCKLang.DlgImgLockRatio ;
GetE('btnResetSize').title = FCKLang.DlgBtnResetSize ;
 
// Load the selected element information (if any).
LoadSelection() ;
 
// Show/Hide the "Browse Server" button.
GetE('tdBrowse').style.display = FCKConfig.ImageBrowser ? '' : 'none' ;
GetE('divLnkBrowseServer').style.display = FCKConfig.LinkBrowser ? '' : 'none' ;
 
UpdateOriginal() ;
 
// Set the actual uploader URL.
if ( FCKConfig.ImageUpload )
GetE('frmUpload').action = FCKConfig.ImageUploadURL ;
 
window.parent.SetAutoSize( true ) ;
 
// Activate the "OK" button.
window.parent.SetOkButton( true ) ;
}
 
function LoadSelection()
{
if ( ! oImage ) return ;
 
var sUrl = oImage.getAttribute( '_fcksavedurl' ) ;
if ( sUrl == null )
sUrl = GetAttribute( oImage, 'src', '' ) ;
 
GetE('txtUrl').value = sUrl ;
GetE('txtAlt').value = GetAttribute( oImage, 'alt', '' ) ;
GetE('txtVSpace').value = GetAttribute( oImage, 'vspace', '' ) ;
GetE('txtHSpace').value = GetAttribute( oImage, 'hspace', '' ) ;
GetE('txtBorder').value = GetAttribute( oImage, 'border', '' ) ;
GetE('cmbAlign').value = GetAttribute( oImage, 'align', '' ) ;
 
var iWidth, iHeight ;
 
var regexSize = /^\s*(\d+)px\s*$/i ;
if ( oImage.style.width )
{
var aMatch = oImage.style.width.match( regexSize ) ;
if ( aMatch )
{
iWidth = aMatch[1] ;
oImage.style.width = '' ;
}
}
 
if ( oImage.style.height )
{
var aMatch = oImage.style.height.match( regexSize ) ;
if ( aMatch )
{
iHeight = aMatch[1] ;
oImage.style.height = '' ;
}
}
 
GetE('txtWidth').value = iWidth ? iWidth : GetAttribute( oImage, "width", '' ) ;
GetE('txtHeight').value = iHeight ? iHeight : GetAttribute( oImage, "height", '' ) ;
 
// Get Advances Attributes
GetE('txtAttId').value = oImage.id ;
GetE('cmbAttLangDir').value = oImage.dir ;
GetE('txtAttLangCode').value = oImage.lang ;
GetE('txtAttTitle').value = oImage.title ;
GetE('txtAttClasses').value = oImage.getAttribute('class',2) || '' ;
GetE('txtLongDesc').value = oImage.longDesc ;
 
if ( oEditor.FCKBrowserInfo.IsIE )
GetE('txtAttStyle').value = oImage.style.cssText ;
else
GetE('txtAttStyle').value = oImage.getAttribute('style',2) ;
 
if ( oLink )
{
var sUrl = oLink.getAttribute( '_fcksavedurl' ) ;
if ( sUrl == null )
sUrl = oLink.getAttribute('href',2) ;
GetE('txtLnkUrl').value = sUrl ;
GetE('cmbLnkTarget').value = oLink.target ;
}
 
UpdatePreview() ;
}
 
//#### The OK button was hit.
function Ok()
{
if ( GetE('txtUrl').value.length == 0 )
{
window.parent.SetSelectedTab( 'Info' ) ;
GetE('txtUrl').focus() ;
 
alert( FCKLang.DlgImgAlertUrl ) ;
 
return false ;
}
 
var bHasImage = ( oImage != null ) ;
 
if ( bHasImage && bImageButton && oImage.tagName == 'IMG' )
{
if ( confirm( 'Do you want to transform the selected image on a image button?' ) )
oImage = null ;
}
else if ( bHasImage && !bImageButton && oImage.tagName == 'INPUT' )
{
if ( confirm( 'Do you want to transform the selected image button on a simple image?' ) )
oImage = null ;
}
if ( !bHasImage )
{
if ( bImageButton )
{
oImage = FCK.EditorDocument.createElement( 'INPUT' ) ;
oImage.type = 'image' ;
oImage = FCK.InsertElementAndGetIt( oImage ) ;
}
else
oImage = FCK.CreateElement( 'IMG' ) ;
}
else
oEditor.FCKUndo.SaveUndoStep() ;
UpdateImage( oImage ) ;
 
var sLnkUrl = GetE('txtLnkUrl').value.trim() ;
 
if ( sLnkUrl.length == 0 )
{
if ( oLink )
FCK.ExecuteNamedCommand( 'Unlink' ) ;
}
else
{
if ( oLink ) // Modifying an existent link.
oLink.href = sLnkUrl ;
else // Creating a new link.
{
if ( !bHasImage )
oEditor.FCKSelection.SelectNode( oImage ) ;
 
oLink = oEditor.FCK.CreateLink( sLnkUrl ) ;
 
if ( !bHasImage )
{
oEditor.FCKSelection.SelectNode( oLink ) ;
oEditor.FCKSelection.Collapse( false ) ;
}
}
 
SetAttribute( oLink, '_fcksavedurl', sLnkUrl ) ;
SetAttribute( oLink, 'target', GetE('cmbLnkTarget').value ) ;
}
 
return true ;
}
 
function UpdateImage( e, skipId )
{
e.src = GetE('txtUrl').value ;
SetAttribute( e, "_fcksavedurl", GetE('txtUrl').value ) ;
SetAttribute( e, "alt" , GetE('txtAlt').value ) ;
SetAttribute( e, "width" , GetE('txtWidth').value ) ;
SetAttribute( e, "height", GetE('txtHeight').value ) ;
SetAttribute( e, "vspace", GetE('txtVSpace').value ) ;
SetAttribute( e, "hspace", GetE('txtHSpace').value ) ;
SetAttribute( e, "border", GetE('txtBorder').value ) ;
SetAttribute( e, "align" , GetE('cmbAlign').value ) ;
 
// Advances Attributes
 
if ( ! skipId )
SetAttribute( e, 'id', GetE('txtAttId').value ) ;
 
SetAttribute( e, 'dir' , GetE('cmbAttLangDir').value ) ;
SetAttribute( e, 'lang' , GetE('txtAttLangCode').value ) ;
SetAttribute( e, 'title' , GetE('txtAttTitle').value ) ;
SetAttribute( e, 'class' , GetE('txtAttClasses').value ) ;
SetAttribute( e, 'longDesc' , GetE('txtLongDesc').value ) ;
 
if ( oEditor.FCKBrowserInfo.IsIE )
e.style.cssText = GetE('txtAttStyle').value ;
else
SetAttribute( e, 'style', GetE('txtAttStyle').value ) ;
}
 
var eImgPreview ;
var eImgPreviewLink ;
 
function SetPreviewElements( imageElement, linkElement )
{
eImgPreview = imageElement ;
eImgPreviewLink = linkElement ;
 
UpdatePreview() ;
UpdateOriginal() ;
bPreviewInitialized = true ;
}
 
function UpdatePreview()
{
if ( !eImgPreview || !eImgPreviewLink )
return ;
 
if ( GetE('txtUrl').value.length == 0 )
eImgPreviewLink.style.display = 'none' ;
else
{
UpdateImage( eImgPreview, true ) ;
 
if ( GetE('txtLnkUrl').value.trim().length > 0 )
eImgPreviewLink.href = 'javascript:void(null);' ;
else
SetAttribute( eImgPreviewLink, 'href', '' ) ;
 
eImgPreviewLink.style.display = '' ;
}
}
 
var bLockRatio = true ;
 
function SwitchLock( lockButton )
{
bLockRatio = !bLockRatio ;
lockButton.className = bLockRatio ? 'BtnLocked' : 'BtnUnlocked' ;
lockButton.title = bLockRatio ? 'Lock sizes' : 'Unlock sizes' ;
 
if ( bLockRatio )
{
if ( GetE('txtWidth').value.length > 0 )
OnSizeChanged( 'Width', GetE('txtWidth').value ) ;
else
OnSizeChanged( 'Height', GetE('txtHeight').value ) ;
}
}
 
// Fired when the width or height input texts change
function OnSizeChanged( dimension, value )
{
// Verifies if the aspect ration has to be mantained
if ( oImageOriginal && bLockRatio )
{
var e = dimension == 'Width' ? GetE('txtHeight') : GetE('txtWidth') ;
if ( value.length == 0 || isNaN( value ) )
{
e.value = '' ;
return ;
}
 
if ( dimension == 'Width' )
value = value == 0 ? 0 : Math.round( oImageOriginal.height * ( value / oImageOriginal.width ) ) ;
else
value = value == 0 ? 0 : Math.round( oImageOriginal.width * ( value / oImageOriginal.height ) ) ;
 
if ( !isNaN( value ) )
e.value = value ;
}
 
UpdatePreview() ;
}
 
// Fired when the Reset Size button is clicked
function ResetSizes()
{
if ( ! oImageOriginal ) return ;
 
GetE('txtWidth').value = oImageOriginal.width ;
GetE('txtHeight').value = oImageOriginal.height ;
 
UpdatePreview() ;
}
 
function BrowseServer()
{
OpenServerBrowser(
'Image',
FCKConfig.ImageBrowserURL,
FCKConfig.ImageBrowserWindowWidth,
FCKConfig.ImageBrowserWindowHeight ) ;
}
 
function LnkBrowseServer()
{
OpenServerBrowser(
'Link',
FCKConfig.LinkBrowserURL,
FCKConfig.LinkBrowserWindowWidth,
FCKConfig.LinkBrowserWindowHeight ) ;
}
 
function OpenServerBrowser( type, url, width, height )
{
sActualBrowser = type ;
OpenFileBrowser( url, width, height ) ;
}
 
var sActualBrowser ;
 
function SetUrl( url, width, height, alt )
{
if ( sActualBrowser == 'Link' )
{
GetE('txtLnkUrl').value = url ;
UpdatePreview() ;
}
else
{
GetE('txtUrl').value = url ;
GetE('txtWidth').value = width ? width : '' ;
GetE('txtHeight').value = height ? height : '' ;
 
if ( alt )
GetE('txtAlt').value = alt;
 
UpdatePreview() ;
UpdateOriginal( true ) ;
}
window.parent.SetSelectedTab( 'Info' ) ;
}
 
function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
{
switch ( errorNumber )
{
case 0 : // No errors
alert( 'Your file has been successfully uploaded' ) ;
break ;
case 1 : // Custom error
alert( customMsg ) ;
return ;
case 101 : // Custom warning
alert( customMsg ) ;
break ;
case 201 :
alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + fileName + '"' ) ;
break ;
case 202 :
alert( 'Invalid file type' ) ;
return ;
case 203 :
alert( "Security error. You probably don't have enough permissions to upload. Please check your server." ) ;
return ;
default :
alert( 'Error on file upload. Error number: ' + errorNumber ) ;
return ;
}
 
sActualBrowser = ''
SetUrl( fileUrl ) ;
GetE('frmUpload').reset() ;
}
 
var oUploadAllowedExtRegex = new RegExp( FCKConfig.ImageUploadAllowedExtensions, 'i' ) ;
var oUploadDeniedExtRegex = new RegExp( FCKConfig.ImageUploadDeniedExtensions, 'i' ) ;
 
function CheckUpload()
{
var sFile = GetE('txtUploadFile').value ;
if ( sFile.length == 0 )
{
alert( 'Please select a file to upload' ) ;
return false ;
}
if ( ( FCKConfig.ImageUploadAllowedExtensions.length > 0 && !oUploadAllowedExtRegex.test( sFile ) ) ||
( FCKConfig.ImageUploadDeniedExtensions.length > 0 && oUploadDeniedExtRegex.test( sFile ) ) )
{
OnUploadCompleted( 202 ) ;
return false ;
}
return true ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_colorselector.html
New file
0,0 → 1,167
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_colorselector.html
* Color Selection dialog window.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex, nofollow" />
<style TYPE="text/css">
#ColorTable { cursor: pointer ; cursor: hand ; }
#hicolor { height: 74px ; width: 74px ; border-width: 1px ; border-style: solid ; }
#hicolortext { width: 75px ; text-align: right ; margin-bottom: 7px ; }
#selhicolor { height: 20px ; width: 74px ; border-width: 1px ; border-style: solid ; }
#selcolor { width: 75px ; height: 20px ; margin-top: 0px ; margin-bottom: 7px ; }
#btnClear { width: 75px ; height: 22px ; margin-bottom: 6px ; }
.ColorCell { height: 15px ; width: 15px ; }
</style>
<script type="text/javascript">
var oEditor = window.parent.InnerDialogLoaded() ;
 
function OnLoad()
{
// First of all, translate the dialog box texts
oEditor.FCKLanguageManager.TranslatePage(document) ;
CreateColorTable() ;
window.parent.SetOkButton( true ) ;
window.parent.SetAutoSize( true ) ;
}
 
function CreateColorTable()
{
// Get the target table.
var oTable = document.getElementById('ColorTable') ;
 
// Create the base colors array.
var aColors = ['00','33','66','99','cc','ff'] ;
 
// This function combines two ranges of three values from the color array into a row.
function AppendColorRow( rangeA, rangeB )
{
for ( var i = rangeA ; i < rangeA + 3 ; i++ )
{
var oRow = oTable.insertRow(-1) ;
 
for ( var j = rangeB ; j < rangeB + 3 ; j++ )
{
for ( var n = 0 ; n < 6 ; n++ )
{
AppendColorCell( oRow, '#' + aColors[j] + aColors[n] + aColors[i] ) ;
}
}
}
}
 
// This function create a single color cell in the color table.
function AppendColorCell( targetRow, color )
{
var oCell = targetRow.insertCell(-1) ;
oCell.className = 'ColorCell' ;
oCell.bgColor = color ;
oCell.onmouseover = function()
{
document.getElementById('hicolor').style.backgroundColor = this.bgColor ;
document.getElementById('hicolortext').innerHTML = this.bgColor ;
}
oCell.onclick = function()
{
document.getElementById('selhicolor').style.backgroundColor = this.bgColor ;
document.getElementById('selcolor').value = this.bgColor ;
}
}
 
AppendColorRow( 0, 0 ) ;
AppendColorRow( 3, 0 ) ;
AppendColorRow( 0, 3 ) ;
AppendColorRow( 3, 3 ) ;
 
// Create the last row.
var oRow = oTable.insertRow(-1) ;
// Create the gray scale colors cells.
for ( var n = 0 ; n < 6 ; n++ )
{
AppendColorCell( oRow, '#' + aColors[n] + aColors[n] + aColors[n] ) ;
}
// Fill the row with black cells.
for ( var i = 0 ; i < 12 ; i++ )
{
AppendColorCell( oRow, '#000000' ) ;
}
}
 
function Clear()
{
document.getElementById('selhicolor').style.backgroundColor = '' ;
document.getElementById('selcolor').value = '' ;
}
 
function ClearActual()
{
document.getElementById('hicolor').style.backgroundColor = '' ;
document.getElementById('hicolortext').innerHTML = '&nbsp;' ;
}
 
function UpdateColor()
{
try { document.getElementById('selhicolor').style.backgroundColor = document.getElementById('selcolor').value ; }
catch (e) { Clear() ; }
}
 
function Ok()
{
if ( typeof(window.parent.dialogArguments.CustomValue) == 'function' )
window.parent.dialogArguments.CustomValue( document.getElementById('selcolor').value ) ;
 
return true ;
}
</script>
</head>
<body onload="OnLoad()" scroll="no" style="OVERFLOW: hidden">
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
<tr>
<td align="center" valign="middle">
<table border="0" cellspacing="5" cellpadding="0" width="100%">
<tr>
<td valign="top" align="center" nowrap width="100%">
<table id="ColorTable" border="0" cellspacing="0" cellpadding="0" width="270" onmouseout="ClearActual();">
</table>
</td>
<td valign="top" align="left" nowrap>
<span fckLang="DlgColorHighlight">Highlight</span>
<div id="hicolor"></div>
<div id="hicolortext">&nbsp;</div>
<span fckLang="DlgColorSelected">Selected</span>
<div id="selhicolor"></div>
<input id="selcolor" type="text" maxlength="20" onchange="UpdateColor();">
<br>
<input id="btnClear" type="button" fckLang="DlgColorBtnClear" value="Clear" onclick="Clear();" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_select.html
New file
0,0 → 1,172
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_select.html
* Select dialog window.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<html>
<head>
<title>Select Properties</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta content="noindex, nofollow" name="robots">
<script src="common/fck_dialog_common.js" type="text/javascript"></script>
<script type="text/javascript" src="fck_select/fck_select.js"></script>
<script type="text/javascript">
 
var oEditor = window.parent.InnerDialogLoaded() ;
 
// Gets the document DOM
var oDOM = oEditor.FCK.EditorDocument ;
 
var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
 
var oListText ;
var oListValue ;
 
window.onload = function()
{
// First of all, translate the dialog box texts
oEditor.FCKLanguageManager.TranslatePage(document) ;
 
oListText = document.getElementById( 'cmbText' ) ;
oListValue = document.getElementById( 'cmbValue' ) ;
 
if ( oActiveEl && oActiveEl.tagName == 'SELECT' )
{
GetE('txtName').value = oActiveEl.name ;
GetE('txtSelValue').value = oActiveEl.value ;
GetE('txtLines').value = GetAttribute( oActiveEl, 'size' ) ;
GetE('chkMultiple').checked = oActiveEl.multiple ;
 
// Load the actual options
for ( var i = 0 ; i < oActiveEl.options.length ; i++ )
{
var sText = oActiveEl.options[i].innerHTML ;
var sValue = oActiveEl.options[i].value ;
 
AddComboOption( oListText, sText, sText ) ;
AddComboOption( oListValue, sValue, sValue ) ;
}
}
else
oActiveEl = null ;
 
window.parent.SetOkButton( true ) ;
}
 
function Ok()
{
var sSize = GetE('txtLines').value ;
if ( sSize == null || isNaN( sSize ) || sSize <= 1 )
sSize = '' ;
 
if ( !oActiveEl )
{
oActiveEl = oEditor.FCK.EditorDocument.createElement( 'SELECT' ) ;
oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ;
}
 
SetAttribute( oActiveEl, 'name' , GetE('txtName').value ) ;
SetAttribute( oActiveEl, 'size' , sSize ) ;
oActiveEl.multiple = ( sSize.length > 0 && GetE('chkMultiple').checked ) ;
 
// Remove all options.
while ( oActiveEl.options.length > 0 )
oActiveEl.remove(0) ;
 
// Add all available options.
for ( var i = 0 ; i < oListText.options.length ; i++ )
{
var sText = oListText.options[i].value ;
var sValue = oListValue.options[i].value ;
if ( sValue.length == 0 ) sValue = sText ;
 
var oOption = AddComboOption( oActiveEl, sText, sValue, oDOM ) ;
 
if ( sValue == GetE('txtSelValue').value )
{
SetAttribute( oOption, 'selected', 'selected' ) ;
oOption.selected = true ;
}
}
 
return true ;
}
 
</script>
</head>
<body style='OVERFLOW: hidden' scroll='no'>
<table width="100%" height="100%">
<tr>
<td>
<table width="100%">
<tr>
<td nowrap><span fckLang="DlgSelectName">Name</span>&nbsp;</td>
<td width="100%" colSpan="2"><input id="txtName" style="WIDTH: 100%" type="text"></td>
</tr>
<tr>
<td nowrap><span fckLang="DlgSelectValue">Value</span>&nbsp;</td>
<td width="100%" colSpan="2"><input id="txtSelValue" style="WIDTH: 100%; BACKGROUND-COLOR: buttonface" type="text" readonly></td>
</tr>
<tr>
<td nowrap><span fckLang="DlgSelectSize">Size</span>&nbsp;</td>
<td nowrap><input id="txtLines" type="text" size="2" value="">&nbsp;<span fckLang="DlgSelectLines">lines</span></td>
<td nowrap align="right"><input id="chkMultiple" name="chkMultiple" type="checkbox"><label for="chkMultiple" fckLang="DlgSelectChkMulti">Allow
multiple selections</label></td>
</tr>
</table>
<br>
<hr style="POSITION: absolute">
<span style="LEFT: 10px; POSITION: relative; TOP: -7px" class="BackColor">&nbsp;<span fckLang="DlgSelectOpAvail">Available
Options</span>&nbsp;</span>
<table width="100%">
<tr>
<td width="50%"><span fckLang="DlgSelectOpText">Text</span><br>
<input id="txtText" style="WIDTH: 100%" type="text" name="txtText">
</td>
<td width="50%"><span fckLang="DlgSelectOpValue">Value</span><br>
<input id="txtValue" style="WIDTH: 100%" type="text" name="txtValue">
</td>
<td vAlign="bottom"><input onclick="Add();" type="button" fckLang="DlgSelectBtnAdd" value="Add"></td>
<td vAlign="bottom"><input onclick="Modify();" type="button" fckLang="DlgSelectBtnModify" value="Modify"></td>
</tr>
<tr>
<td rowSpan="2"><select id="cmbText" style="WIDTH: 100%" onchange="GetE('cmbValue').selectedIndex = this.selectedIndex;Select(this);"
size="5" name="cmbText"></select>
</td>
<td rowSpan="2"><select id="cmbValue" style="WIDTH: 100%" onchange="GetE('cmbText').selectedIndex = this.selectedIndex;Select(this);"
size="5" name="cmbValue"></select>
</td>
<td vAlign="top" colSpan="2">
</td>
</tr>
<tr>
<td vAlign="bottom" colSpan="2"><input style="WIDTH: 100%" onclick="Move(-1);" type="button" fckLang="DlgSelectBtnUp" value="Up">
<br>
<input style="WIDTH: 100%" onclick="Move(1);" type="button" fckLang="DlgSelectBtnDown"
value="Down">
</td>
</tr>
<TR>
<TD vAlign="bottom" colSpan="4"><INPUT onclick="SetSelectedValue();" type="button" fckLang="DlgSelectBtnSetValue" value="Set as selected value">&nbsp;&nbsp;
<input onclick="Delete();" type="button" fckLang="DlgSelectBtnDelete" value="Delete"></TD>
</TR>
</table>
</td>
</tr>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_find.html
New file
0,0 → 1,167
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_find.html
* "Find" dialog window.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta content="noindex, nofollow" name="robots" />
<script type="text/javascript">
 
var oEditor = window.parent.InnerDialogLoaded() ;
 
function OnLoad()
{
// Whole word is available on IE only.
if ( oEditor.FCKBrowserInfo.IsIE )
document.getElementById('divWord').style.display = '' ;
 
// First of all, translate the dialog box texts.
oEditor.FCKLanguageManager.TranslatePage( document ) ;
 
window.parent.SetAutoSize( true ) ;
}
 
function btnStat(frm)
{
document.getElementById('btnFind').disabled =
( document.getElementById('txtFind').value.length == 0 ) ;
}
 
function ReplaceTextNodes( parentNode, regex, replaceValue, replaceAll )
{
for ( var i = 0 ; i < parentNode.childNodes.length ; i++ )
{
var oNode = parentNode.childNodes[i] ;
if ( oNode.nodeType == 3 )
{
var sReplaced = oNode.nodeValue.replace( regex, replaceValue ) ;
if ( oNode.nodeValue != sReplaced )
{
oNode.nodeValue = sReplaced ;
if ( ! replaceAll )
return true ;
}
}
else
{
if ( ReplaceTextNodes( oNode, regex, replaceValue ) )
return true ;
}
}
return false ;
}
 
function GetRegexExpr()
{
if ( document.getElementById('chkWord').checked )
var sExpr = '\\b' + document.getElementById('txtFind').value + '\\b' ;
else
var sExpr = document.getElementById('txtFind').value ;
 
return sExpr ;
}
 
function GetCase()
{
return ( document.getElementById('chkCase').checked ? '' : 'i' ) ;
}
 
function Ok()
{
if ( document.getElementById('txtFind').value.length == 0 )
return ;
 
if ( oEditor.FCKBrowserInfo.IsIE )
FindIE() ;
else
FindGecko() ;
}
 
var oRange ;
 
if ( oEditor.FCKBrowserInfo.IsIE )
oRange = oEditor.FCK.EditorDocument.body.createTextRange() ;
 
function FindIE()
{
var iFlags = 0 ;
 
if ( chkCase.checked )
iFlags = iFlags | 4 ;
 
if ( chkWord.checked )
iFlags = iFlags | 2 ;
 
var bFound = oRange.findText( document.getElementById('txtFind').value, 1, iFlags ) ;
 
if ( bFound )
{
oRange.scrollIntoView() ;
oRange.select() ;
oRange.collapse(false) ;
oLastRangeFound = oRange ;
}
else
{
oRange = oEditor.FCK.EditorDocument.body.createTextRange() ;
alert( oEditor.FCKLang.DlgFindNotFoundMsg ) ;
}
}
 
function FindGecko()
{
var bCase = document.getElementById('chkCase').checked ;
var bWord = document.getElementById('chkWord').checked ;
 
// window.find( searchString, caseSensitive, backwards, wrapAround, wholeWord, searchInFrames, showDialog ) ;
if ( !oEditor.FCK.EditorWindow.find( document.getElementById('txtFind').value, bCase, false, false, bWord, false, false ) )
alert( oEditor.FCKLang.DlgFindNotFoundMsg ) ;
}
</script>
</head>
<body onload="OnLoad()" style="overflow: hidden">
<table cellspacing="3" cellpadding="2" width="100%" border="0">
<tr>
<td nowrap="nowrap">
<label for="txtFind" fcklang="DlgReplaceFindLbl">
Find what:</label>&nbsp;
</td>
<td width="100%">
<input id="txtFind" style="width: 100%" tabindex="1" type="text" />
</td>
<td>
<input id="btnFind" style="padding-right: 5px; padding-left: 5px" onclick="Ok();"
type="button" value="Find" fcklang="DlgFindFindBtn" />
</td>
</tr>
<tr>
<td valign="bottom" colspan="3">
&nbsp;<input id="chkCase" tabindex="3" type="checkbox" /><label for="chkCase" fcklang="DlgReplaceCaseChk">Match
case</label>
<br />
<div id="divWord" style="display: none">
&nbsp;<input id="chkWord" tabindex="4" type="checkbox" /><label for="chkWord" fcklang="DlgReplaceWordChk">Match
whole word</label>
</div>
</td>
</tr>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_universalkey.html
New file
0,0 → 1,63
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_universalkey.html
* Unicode Keyboard dialog window.
*
* File Authors:
* Abdul-Aziz Al-Oraij (top7up@hotmail.com)
* Michel Staelens
* Bernadette Cierzniak
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<html>
<head>
<title>Universal Keyboard</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta content="noindex, nofollow" name="robots">
<link rel="stylesheet" type="text/css" href="fck_universalkey/fck_universalkey.css" />
<script type="text/javascript">
 
var oEditor = window.parent.InnerDialogLoaded() ;
 
window.onload = function()
{
document.body.style.padding = '0px' ;
 
// First of all, translate the dialog box texts
oEditor.FCKLanguageManager.TranslatePage(document) ;
 
window.parent.SetOkButton( true ) ;
window.parent.SetAutoSize( true ) ;
}
 
function Ok()
{
var oArea = document.getElementById( 'uni_area' ) ;
 
if ( oArea.value.length > 0 )
oEditor.FCK.InsertHtml( oArea.value ) ;
 
return true ;
}
 
</script>
</head>
<body style="OVERFLOW: hidden" scroll="no">
<textarea id="uni_area" cols="40" rows="4" style="width:100%;height:60px;"></textarea>
<script type="text/javascript" src="fck_universalkey/data.js"></script>
<script type="text/javascript" src="fck_universalkey/diacritic.js"></script>
<script type="text/javascript" src="fck_universalkey/dialogue.js"></script>
<script type="text/javascript" src="fck_universalkey/multihexa.js"></script>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_image.html
New file
0,0 → 1,248
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_image.html
* Image Properties dialog window.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Image Properties</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex, nofollow" />
<script src="common/fck_dialog_common.js" type="text/javascript"></script>
<script src="fck_image/fck_image.js" type="text/javascript"></script>
<link href="common/fck_dialog_common.css" rel="stylesheet" type="text/css" />
</head>
<body scroll="no" style="overflow: hidden">
<div id="divInfo">
<table cellspacing="1" cellpadding="1" border="0" width="100%" height="100%">
<tr>
<td>
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td width="100%">
<span fcklang="DlgImgURL">URL</span>
</td>
<td id="tdBrowse" style="display: none" nowrap="nowrap" rowspan="2">
&nbsp;
<input id="btnBrowse" onclick="BrowseServer();" type="button" value="Browse Server"
fcklang="DlgBtnBrowseServer" />
</td>
</tr>
<tr>
<td valign="top">
<input id="txtUrl" style="width: 100%" type="text" onblur="UpdatePreview();" />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<span fcklang="DlgImgAlt">Short Description</span><br />
<input id="txtAlt" style="width: 100%" type="text" /><br />
</td>
</tr>
<tr height="100%">
<td valign="top">
<table cellspacing="0" cellpadding="0" width="100%" border="0" height="100%">
<tr>
<td valign="top">
<br />
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td nowrap="nowrap">
<span fcklang="DlgImgWidth">Width</span>&nbsp;</td>
<td>
<input type="text" size="3" id="txtWidth" onkeyup="OnSizeChanged('Width',this.value);" /></td>
<td rowspan="2">
<div id="btnLockSizes" class="BtnLocked" onmouseover="this.className = (bLockRatio ? 'BtnLocked' : 'BtnUnlocked' ) + ' BtnOver';"
onmouseout="this.className = (bLockRatio ? 'BtnLocked' : 'BtnUnlocked' );" title="Lock Sizes"
onclick="SwitchLock(this);">
</div>
</td>
<td rowspan="2">
<div id="btnResetSize" class="BtnReset" onmouseover="this.className='BtnReset BtnOver';"
onmouseout="this.className='BtnReset';" title="Reset Size" onclick="ResetSizes();">
</div>
</td>
</tr>
<tr>
<td nowrap="nowrap">
<span fcklang="DlgImgHeight">Height</span>&nbsp;</td>
<td>
<input type="text" size="3" id="txtHeight" onkeyup="OnSizeChanged('Height',this.value);" /></td>
</tr>
</table>
<br />
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td nowrap="nowrap">
<span fcklang="DlgImgBorder">Border</span>&nbsp;</td>
<td>
<input type="text" size="2" value="" id="txtBorder" onkeyup="UpdatePreview();" /></td>
</tr>
<tr>
<td nowrap="nowrap">
<span fcklang="DlgImgHSpace">HSpace</span>&nbsp;</td>
<td>
<input type="text" size="2" id="txtHSpace" onkeyup="UpdatePreview();" /></td>
</tr>
<tr>
<td nowrap="nowrap">
<span fcklang="DlgImgVSpace">VSpace</span>&nbsp;</td>
<td>
<input type="text" size="2" id="txtVSpace" onkeyup="UpdatePreview();" /></td>
</tr>
<tr>
<td nowrap="nowrap">
<span fcklang="DlgImgAlign">Align</span>&nbsp;</td>
<td>
<select id="cmbAlign" onchange="UpdatePreview();">
<option value="" selected="selected"></option>
<option fcklang="DlgImgAlignLeft" value="left">Left</option>
<option fcklang="DlgImgAlignAbsBottom" value="absBottom">Abs Bottom</option>
<option fcklang="DlgImgAlignAbsMiddle" value="absMiddle">Abs Middle</option>
<option fcklang="DlgImgAlignBaseline" value="baseline">Baseline</option>
<option fcklang="DlgImgAlignBottom" value="bottom">Bottom</option>
<option fcklang="DlgImgAlignMiddle" value="middle">Middle</option>
<option fcklang="DlgImgAlignRight" value="right">Right</option>
<option fcklang="DlgImgAlignTextTop" value="textTop">Text Top</option>
<option fcklang="DlgImgAlignTop" value="top">Top</option>
</select>
</td>
</tr>
</table>
</td>
<td>
&nbsp;&nbsp;&nbsp;</td>
<td width="100%" valign="top">
<table cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed">
<tr>
<td>
<span fcklang="DlgImgPreview">Preview</span></td>
</tr>
<tr>
<td valign="top">
<iframe class="ImagePreviewArea" src="fck_image/fck_image_preview.html" frameborder="0"
marginheight="0" marginwidth="0"></iframe>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div id="divUpload" style="display: none">
<form id="frmUpload" method="post" target="UploadWindow" enctype="multipart/form-data"
action="" onsubmit="return CheckUpload();">
<span fcklang="DlgLnkUpload">Upload</span><br />
<input id="txtUploadFile" style="width: 100%" type="file" size="40" name="NewFile" /><br />
<br />
<input id="btnUpload" type="submit" value="Send it to the Server" fcklang="DlgLnkBtnUpload" />
<iframe name="UploadWindow" style="display: none" src="../fckblank.html"></iframe>
</form>
</div>
<div id="divLink" style="display: none">
<table cellspacing="1" cellpadding="1" border="0" width="100%">
<tr>
<td>
<div>
<span fcklang="DlgLnkURL">URL</span><br />
<input id="txtLnkUrl" style="width: 100%" type="text" onblur="UpdatePreview();" />
</div>
<div id="divLnkBrowseServer" align="right">
<input type="button" value="Browse Server" fcklang="DlgBtnBrowseServer" onclick="LnkBrowseServer();" />
</div>
<div>
<span fcklang="DlgLnkTarget">Target</span><br />
<select id="cmbLnkTarget">
<option value="" fcklang="DlgGenNotSet" selected="selected">&lt;not set&gt;</option>
<option value="_blank" fcklang="DlgLnkTargetBlank">New Window (_blank)</option>
<option value="_top" fcklang="DlgLnkTargetTop">Topmost Window (_top)</option>
<option value="_self" fcklang="DlgLnkTargetSelf">Same Window (_self)</option>
<option value="_parent" fcklang="DlgLnkTargetParent">Parent Window (_parent)</option>
</select>
</div>
</td>
</tr>
</table>
</div>
<div id="divAdvanced" style="display: none">
<table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
<tr>
<td valign="top" width="50%">
<span fcklang="DlgGenId">Id</span><br />
<input id="txtAttId" style="width: 100%" type="text" />
</td>
<td width="1">
&nbsp;&nbsp;</td>
<td valign="top">
<table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
<tr>
<td width="60%">
<span fcklang="DlgGenLangDir">Language Direction</span><br />
<select id="cmbAttLangDir" style="width: 100%">
<option value="" fcklang="DlgGenNotSet" selected="selected">&lt;not set&gt;</option>
<option value="ltr" fcklang="DlgGenLangDirLtr">Left to Right (LTR)</option>
<option value="rtl" fcklang="DlgGenLangDirRtl">Right to Left (RTL)</option>
</select>
</td>
<td width="1%">
&nbsp;&nbsp;</td>
<td nowrap="nowrap">
<span fcklang="DlgGenLangCode">Language Code</span><br />
<input id="txtAttLangCode" style="width: 100%" type="text" />&nbsp;
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="3">
&nbsp;</td>
</tr>
<tr>
<td colspan="3">
<span fcklang="DlgGenLongDescr">Long Description URL</span><br />
<input id="txtLongDesc" style="width: 100%" type="text" />
</td>
</tr>
<tr>
<td colspan="3">
&nbsp;</td>
</tr>
<tr>
<td valign="top">
<span fcklang="DlgGenClass">Stylesheet Classes</span><br />
<input id="txtAttClasses" style="width: 100%" type="text" />
</td>
<td>
</td>
<td valign="top">
&nbsp;<span fcklang="DlgGenTitle">Advisory Title</span><br />
<input id="txtAttTitle" style="width: 100%" type="text" />
</td>
</tr>
</table>
<span fcklang="DlgGenStyle">Style</span><br />
<input id="txtAttStyle" style="width: 100%" type="text" />
</div>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_table.html
New file
0,0 → 1,316
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_table.html
* Table dialog window.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Table Properties</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex, nofollow" />
<script type="text/javascript">
 
var oEditor = window.parent.InnerDialogLoaded() ;
 
// Gets the document DOM
var oDOM = oEditor.FCK.EditorDocument ;
 
// Gets the table if there is one selected.
var table ;
var e = oEditor.FCKSelection.GetSelectedElement() ;
 
if ( ( !e && document.location.search.substr(1) == 'Parent' ) || ( e && e.tagName != 'TABLE' ) )
e = oEditor.FCKSelection.MoveToAncestorNode( 'TABLE' ) ;
 
if ( e && e.tagName == "TABLE" )
table = e ;
 
// Fired when the window loading process is finished. It sets the fields with the
// actual values if a table is selected in the editor.
window.onload = function()
{
// First of all, translate the dialog box texts
oEditor.FCKLanguageManager.TranslatePage(document) ;
 
if (table)
{
document.getElementById('txtRows').value = table.rows.length ;
document.getElementById('txtColumns').value = table.rows[0].cells.length ;
 
// Gets the value from the Width or the Style attribute
var iWidth = (table.style.width ? table.style.width : table.width ) ;
var iHeight = (table.style.height ? table.style.height : table.height ) ;
 
if (iWidth.indexOf('%') >= 0) // Percentual = %
{
iWidth = parseInt( iWidth.substr(0,iWidth.length - 1) ) ;
document.getElementById('selWidthType').value = "percent" ;
}
else if (iWidth.indexOf('px') >= 0) // Style Pixel = px
{ //
iWidth = iWidth.substr(0,iWidth.length - 2);
document.getElementById('selWidthType').value = "pixels" ;
}
if (iHeight && iHeight.indexOf('px') >= 0) // Style Pixel = px
iHeight = iHeight.substr(0,iHeight.length - 2);
document.getElementById('txtWidth').value = iWidth ;
document.getElementById('txtHeight').value = iHeight ;
document.getElementById('txtBorder').value = table.border ;
document.getElementById('selAlignment').value = table.align ;
document.getElementById('txtCellPadding').value = table.cellPadding ;
document.getElementById('txtCellSpacing').value = table.cellSpacing ;
document.getElementById('txtSummary').value = table.summary;
// document.getElementById('cmbFontStyle').value = table.className ;
 
if (table.caption) document.getElementById('txtCaption').value = table.caption.innerHTML ;
document.getElementById('txtRows').disabled = true ;
document.getElementById('txtColumns').disabled = true ;
}
window.parent.SetOkButton( true ) ;
window.parent.SetAutoSize( true ) ;
}
 
// Fired when the user press the OK button
function Ok()
{
var bExists = ( table != null ) ;
if ( ! bExists )
{
table = oEditor.FCK.EditorDocument.createElement( "TABLE" ) ;
}
 
// Removes the Width and Height styles
if ( bExists && table.style.width ) table.style.width = null ; //.removeAttribute("width") ;
if ( bExists && table.style.height ) table.style.height = null ; //.removeAttribute("height") ;
table.width = document.getElementById('txtWidth').value + ( document.getElementById('selWidthType').value == "percent" ? "%" : "") ;
table.height = document.getElementById('txtHeight').value ;
table.border = document.getElementById('txtBorder').value ;
table.align = document.getElementById('selAlignment').value ;
table.cellPadding = document.getElementById('txtCellPadding').value ;
table.cellSpacing = document.getElementById('txtCellSpacing').value ;
table.summary = document.getElementById('txtSummary').value ;
// table.className = cmbFontStyle.value ;
if ( document.getElementById('txtCaption').value != '')
{
if (! table.caption) table.createCaption() ;
table.caption.innerHTML = document.getElementById('txtCaption').value ;
}
else if ( bExists && table.caption )
{
if ( document.all )
table.caption.innerHTML = '' ; // TODO: It causes an IE internal error if using removeChild.
else
table.caption.parentNode.removeChild( table.caption ) ;
}
if (! bExists)
{
var iRows = document.getElementById('txtRows').value ;
var iCols = document.getElementById('txtColumns').value ;
for ( var r = 0 ; r < iRows ; r++ )
{
var oRow = table.insertRow(-1) ;
for ( var c = 0 ; c < iCols ; c++ )
{
var oCell = oRow.insertCell(-1) ;
if ( oEditor.FCKBrowserInfo.IsGecko )
oCell.innerHTML = '<br _moz_editor_bogus_node="TRUE">' ;
//oCell.innerHTML = "&nbsp;" ;
}
}
oEditor.FCKUndo.SaveUndoStep() ;
// START iCM MODIFICATIONS
// Amended to ensure that newly inserted tables are not incorrectly nested in P tags, etc
// We insert the table first and then rectify any nestings afterwards so we can re-use the
// FCKTablesProcessor function that corrects tables on SetHTML()
/*
table = oEditor.FCK.InsertElementAndGetIt( table ) ;
if ( !oEditor.FCKConfig.UseBROnCarriageReturn )
{
oEditor.FCKTablesProcessor.CheckTableNesting( table ) ;
}
*/
// END iCM MODIFICATIONS
oEditor.FCK.InsertElement( table ) ;
}
return true ;
}
 
function IsDigit( e )
{
e = e || event ;
var iCode = ( e.keyCode || e.charCode ) ;
return
(
( iCode >= 48 && iCode <= 57 ) // Numbers
|| (iCode >= 37 && iCode <= 40) // Arrows
|| iCode == 8 // Backspace
|| iCode == 46 // Delete
) ;
}
 
</script>
</head>
<body style="overflow: hidden">
<table id="otable" cellspacing="0" cellpadding="0" width="100%" border="0" style="height: 100%">
<tr>
<td>
<table cellspacing="1" cellpadding="1" width="100%" border="0">
<tr>
<td valign="top">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<span fcklang="DlgTableRows">Rows</span>:</td>
<td>
&nbsp;<input id="txtRows" type="text" maxlength="3" size="2" value="3" name="txtRows"
onkeypress="return IsDigit(event);" /></td>
</tr>
<tr>
<td>
<span fcklang="DlgTableColumns">Columns</span>:</td>
<td>
&nbsp;<input id="txtColumns" type="text" maxlength="2" size="2" value="2" name="txtColumns"
onkeypress="return IsDigit(event);" /></td>
</tr>
<tr>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td>
<span fcklang="DlgTableBorder">Border size</span>:</td>
<td>
&nbsp;<input id="txtBorder" type="text" maxlength="2" size="2" value="1" name="txtBorder"
onkeypress="return IsDigit(event);" /></td>
</tr>
<tr>
<td>
<span fcklang="DlgTableAlign">Alignment</span>:</td>
<td>
&nbsp;<select id="selAlignment" name="selAlignment">
<option fcklang="DlgTableAlignNotSet" value="" selected="selected">&lt;Not set&gt;</option>
<option fcklang="DlgTableAlignLeft" value="left">Left</option>
<option fcklang="DlgTableAlignCenter" value="center">Center</option>
<option fcklang="DlgTableAlignRight" value="right">Right</option>
</select></td>
</tr>
</table>
</td>
<td>
&nbsp;&nbsp;&nbsp;</td>
<td align="right" valign="top">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<span fcklang="DlgTableWidth">Width</span>:</td>
<td>
&nbsp;<input id="txtWidth" type="text" maxlength="4" size="3" value="200" name="txtWidth"
onkeypress="return IsDigit(event);" /></td>
<td>
&nbsp;<select id="selWidthType" name="selWidthType">
<option fcklang="DlgTableWidthPx" value="pixels" selected="selected">pixels</option>
<option fcklang="DlgTableWidthPc" value="percent">percent</option>
</select></td>
</tr>
<tr>
<td>
<span fcklang="DlgTableHeight">Height</span>:</td>
<td>
&nbsp;<input id="txtHeight" type="text" maxlength="4" size="3" name="txtHeight" onkeypress="return IsDigit(event);" /></td>
<td>
&nbsp;<span fcklang="DlgTableWidthPx">pixels</span></td>
</tr>
<tr>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td nowrap="nowrap">
<span fcklang="DlgTableCellSpace">Cell spacing</span>:</td>
<td>
&nbsp;<input id="txtCellSpacing" type="text" maxlength="2" size="2" value="1" name="txtCellSpacing"
onkeypress="return IsDigit(event);" /></td>
<td>
&nbsp;</td>
</tr>
<tr>
<td nowrap="nowrap">
<span fcklang="DlgTableCellPad">Cell padding</span>:</td>
<td>
&nbsp;<input id="txtCellPadding" type="text" maxlength="2" size="2" value="1" name="txtCellPadding"
onkeypress="return IsDigit(event);" /></td>
<td>
&nbsp;</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<!--
<tr>
<td nowrap>
<span fcklang="DlgClassName">Class Name</span>:</td>
<td>&nbsp;</td>
<td>
<script type="text/javascript">
// var tbstyles = new TBCombo( "FontStyle" , "null" , "", oEditor.config.StyleNames, oEditor.config.StyleValues, 'CheckStyle("cmbFontStyle")');
// document.write(tbstyles.GetHTML());
</script></td>
</tr>
-->
<tr>
<td nowrap="nowrap">
<span fcklang="DlgTableCaption">Caption</span>:&nbsp;</td>
<td>
&nbsp;</td>
<td width="100%" nowrap="nowrap">
<input id="txtCaption" type="text" style="width: 100%" /></td>
</tr>
<tr>
<td nowrap="nowrap">
<span fcklang="DlgTableSummary">Summary</span>:&nbsp;</td>
<td>
&nbsp;</td>
<td width="100%" nowrap="nowrap">
<input id="txtSummary" type="text" style="width: 100%" /></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_tablecell.html
New file
0,0 → 1,251
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_tablecell.html
* Cell properties dialog window.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Table Cell Properties</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex, nofollow" />
<script src="common/fck_dialog_common.js" type="text/javascript"></script>
<script type="text/javascript">
 
var oEditor = window.parent.InnerDialogLoaded() ;
 
// Gets the document DOM
var oDOM = oEditor.FCK.EditorDocument ;
 
// Array of selected Cells
var aCells = oEditor.FCKTableHandler.GetSelectedCells() ;
 
window.onload = function()
{
// First of all, translate the dialog box texts
oEditor.FCKLanguageManager.TranslatePage( document ) ;
 
SetStartupValue() ;
 
window.parent.SetOkButton( true ) ;
window.parent.SetAutoSize( true ) ;
}
 
function SetStartupValue()
{
if ( aCells.length > 0 )
{
var oCell = aCells[0] ;
var iWidth = GetAttribute( oCell, 'width' ) ;
 
if ( iWidth.indexOf && iWidth.indexOf( '%' ) >= 0 )
{
iWidth = iWidth.substr( 0, iWidth.length - 1 ) ;
GetE('selWidthType').value = 'percent' ;
}
 
if ( oCell.attributes['noWrap'] != null && oCell.attributes['noWrap'].specified )
GetE('selWordWrap').value = !oCell.noWrap ;
 
GetE('txtWidth').value = iWidth ;
GetE('txtHeight').value = GetAttribute( oCell, 'height' ) ;
GetE('selHAlign').value = GetAttribute( oCell, 'align' ) ;
GetE('selVAlign').value = GetAttribute( oCell, 'vAlign' ) ;
GetE('txtRowSpan').value = GetAttribute( oCell, 'rowSpan' ) ;
GetE('txtCollSpan').value = GetAttribute( oCell, 'colSpan' ) ;
GetE('txtBackColor').value = GetAttribute( oCell, 'bgColor' ) ;
GetE('txtBorderColor').value = GetAttribute( oCell, 'borderColor' ) ;
// GetE('cmbFontStyle').value = oCell.className ;
}
}
 
// Fired when the user press the OK button
function Ok()
{
for( i = 0 ; i < aCells.length ; i++ )
{
if ( GetE('txtWidth').value.length > 0 )
aCells[i].width = GetE('txtWidth').value + ( GetE('selWidthType').value == 'percent' ? '%' : '') ;
else
aCells[i].removeAttribute( 'width', 0 ) ;
 
if ( GetE('selWordWrap').value == 'false' )
aCells[i].noWrap = true ;
else
aCells[i].removeAttribute( 'noWrap' ) ;
 
SetAttribute( aCells[i], 'height' , GetE('txtHeight').value ) ;
SetAttribute( aCells[i], 'align' , GetE('selHAlign').value ) ;
SetAttribute( aCells[i], 'vAlign' , GetE('selVAlign').value ) ;
SetAttribute( aCells[i], 'rowSpan' , GetE('txtRowSpan').value ) ;
SetAttribute( aCells[i], 'colSpan' , GetE('txtCollSpan').value ) ;
SetAttribute( aCells[i], 'bgColor' , GetE('txtBackColor').value ) ;
SetAttribute( aCells[i], 'borderColor' , GetE('txtBorderColor').value ) ;
// SetAttribute( aCells[i], 'className' , GetE('cmbFontStyle').value ) ;
}
 
return true ;
}
 
function SelectBackColor( color )
{
if ( color && color.length > 0 )
GetE('txtBackColor').value = color ;
}
 
function SelectBorderColor( color )
{
if ( color && color.length > 0 )
GetE('txtBorderColor').value = color ;
}
 
function SelectColor( wich )
{
oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', oEditor.FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, wich == 'Back' ? SelectBackColor : SelectBorderColor, window ) ;
}
 
</script>
</head>
<body scroll="no" style="overflow: hidden">
<table cellspacing="0" cellpadding="0" width="100%" border="0" height="100%">
<tr>
<td>
<table cellspacing="1" cellpadding="1" width="100%" border="0">
<tr>
<td>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td nowrap="nowrap">
<span fcklang="DlgCellWidth">Width</span>:</td>
<td>
&nbsp;<input onkeypress="return IsDigit(event);" id="txtWidth" type="text" maxlength="4"
size="3" name="txtWidth" />&nbsp;<select id="selWidthType" name="selWidthType">
<option fcklang="DlgCellWidthPx" value="pixels" selected="selected">pixels</option>
<option fcklang="DlgCellWidthPc" value="percent">percent</option>
</select></td>
</tr>
<tr>
<td nowrap="nowrap">
<span fcklang="DlgCellHeight">Height</span>:</td>
<td>
&nbsp;<input id="txtHeight" type="text" maxlength="4" size="3" name="txtHeight" onkeypress="return IsDigit(event);" />&nbsp;<span
fcklang="DlgCellWidthPx">pixels</span></td>
</tr>
<tr>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td nowrap="nowrap">
<span fcklang="DlgCellWordWrap">Word Wrap</span>:</td>
<td>
&nbsp;<select id="selWordWrap" name="selAlignment">
<option fcklang="DlgCellWordWrapYes" value="true" selected="selected">Yes</option>
<option fcklang="DlgCellWordWrapNo" value="false">No</option>
</select></td>
</tr>
<tr>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td nowrap="nowrap">
<span fcklang="DlgCellHorAlign">Horizontal Alignment</span>:</td>
<td>
&nbsp;<select id="selHAlign" name="selAlignment">
<option fcklang="DlgCellHorAlignNotSet" value="" selected>&lt;Not set&gt;</option>
<option fcklang="DlgCellHorAlignLeft" value="left">Left</option>
<option fcklang="DlgCellHorAlignCenter" value="center">Center</option>
<option fcklang="DlgCellHorAlignRight" value="right">Right</option>
</select></td>
</tr>
<tr>
<td nowrap="nowrap">
<span fcklang="DlgCellVerAlign">Vertical Alignment</span>:</td>
<td>
&nbsp;<select id="selVAlign" name="selAlignment">
<option fcklang="DlgCellVerAlignNotSet" value="" selected>&lt;Not set&gt;</option>
<option fcklang="DlgCellVerAlignTop" value="top">Top</option>
<option fcklang="DlgCellVerAlignMiddle" value="middle">Middle</option>
<option fcklang="DlgCellVerAlignBottom" value="bottom">Bottom</option>
<option fcklang="DlgCellVerAlignBaseline" value="baseline">Baseline</option>
</select></td>
</tr>
</table>
</td>
<td>
&nbsp;&nbsp;&nbsp;</td>
<td align="right">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td nowrap="nowrap">
<span fcklang="DlgCellRowSpan">Rows Span</span>:</td>
<td>
&nbsp;
<input onkeypress="return IsDigit(event);" id="txtRowSpan" type="text" maxlength="3" size="2"
name="txtRows"></td>
<td>
</td>
</tr>
<tr>
<td nowrap="nowrap">
<span fcklang="DlgCellCollSpan">Columns Span</span>:</td>
<td>
&nbsp;
<input onkeypress="return IsDigit(event);" id="txtCollSpan" type="text" maxlength="2"
size="2" name="txtColumns"></td>
<td>
</td>
</tr>
<tr>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td nowrap="nowrap">
<span fcklang="DlgCellBackColor">Background Color</span>:</td>
<td>
&nbsp;<input id="txtBackColor" type="text" size="8" name="txtCellSpacing"></td>
<td>
&nbsp;
<input type="button" fcklang="DlgCellBtnSelect" value="Select..." onclick="SelectColor( 'Back' )"></td>
</tr>
<tr>
<td nowrap="nowrap">
<span fcklang="DlgCellBorderColor">Border Color</span>:</td>
<td>
&nbsp;<input id="txtBorderColor" type="text" size="8" name="txtCellPadding" /></td>
<td>
&nbsp;
<input type="button" fcklang="DlgCellBtnSelect" value="Select..." onclick="SelectColor( 'Border' )" /></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_textfield.html
New file
0,0 → 1,135
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_textfield.html
* Text field dialog window.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta content="noindex, nofollow" name="robots" />
<script src="common/fck_dialog_common.js" type="text/javascript"></script>
<script type="text/javascript">
 
var oEditor = window.parent.InnerDialogLoaded() ;
 
// Gets the document DOM
var oDOM = oEditor.FCK.EditorDocument ;
 
var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
 
window.onload = function()
{
// First of all, translate the dialog box texts
oEditor.FCKLanguageManager.TranslatePage(document) ;
 
if ( oActiveEl && oActiveEl.tagName == 'INPUT' && ( oActiveEl.type == 'text' || oActiveEl.type == 'password' ) )
{
GetE('txtName').value = oActiveEl.name ;
GetE('txtValue').value = oActiveEl.value ;
GetE('txtSize').value = GetAttribute( oActiveEl, 'size' ) ;
GetE('txtMax').value = GetAttribute( oActiveEl, 'maxLength' ) ;
GetE('txtType').value = oActiveEl.type ;
 
GetE('txtType').disabled = true ;
}
else
oActiveEl = null ;
 
window.parent.SetOkButton( true ) ;
}
 
function Ok()
{
if ( isNaN( GetE('txtMax').value ) || GetE('txtMax').value < 0 )
{
alert( "Maximum characters must be a positive number." ) ;
GetE('txtMax').focus() ;
return false ;
}
else if( isNaN( GetE('txtSize').value ) || GetE('txtSize').value < 0 )
{
alert( "Width must be a positive number." ) ;
GetE('txtSize').focus() ;
return false ;
}
 
if ( !oActiveEl )
{
oActiveEl = oEditor.FCK.EditorDocument.createElement( 'INPUT' ) ;
oActiveEl.type = GetE('txtType').value ;
oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ;
}
 
oActiveEl.name = GetE('txtName').value ;
SetAttribute( oActiveEl, 'value' , GetE('txtValue').value ) ;
SetAttribute( oActiveEl, 'size' , GetE('txtSize').value ) ;
SetAttribute( oActiveEl, 'maxlength', GetE('txtMax').value ) ;
 
return true ;
}
 
</script>
</head>
<body style="overflow: hidden">
<table width="100%" style="height: 100%">
<tr>
<td align="center">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<span fcklang="DlgTextName">Name</span><br />
<input id="txtName" type="text" size="20" />
</td>
<td>
</td>
<td>
<span fcklang="DlgTextValue">Value</span><br />
<input id="txtValue" type="text" size="25" />
</td>
</tr>
<tr>
<td>
<span fcklang="DlgTextCharWidth">Character Width</span><br />
<input id="txtSize" type="text" size="5" />
</td>
<td>
</td>
<td>
<span fcklang="DlgTextMaxChars">Maximum Characters</span><br />
<input id="txtMax" type="text" size="5" />
</td>
</tr>
<tr>
<td>
<span fcklang="DlgTextType">Type</span><br />
<select id="txtType">
<option value="text" selected="selected" fcklang="DlgTextTypeText">Text</option>
<option value="password" fcklang="DlgTextTypePass">Password</option>
</select>
</td>
<td>
&nbsp;</td>
<td>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_docprops.html
New file
0,0 → 1,591
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_docprops.html
* Link dialog window.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta content="noindex, nofollow" name="robots" />
<script src="common/fck_dialog_common.js" type="text/javascript"></script>
<script type="text/javascript">
 
var oEditor = window.parent.InnerDialogLoaded() ;
var FCK = oEditor.FCK ;
var FCKLang = oEditor.FCKLang ;
var FCKConfig = oEditor.FCKConfig ;
 
//#### Dialog Tabs
 
// Set the dialog tabs.
window.parent.AddTab( 'General' , FCKLang.DlgDocGeneralTab ) ;
window.parent.AddTab( 'Background' , FCKLang.DlgDocBackTab ) ;
window.parent.AddTab( 'Colors' , FCKLang.DlgDocColorsTab ) ;
window.parent.AddTab( 'Meta' , FCKLang.DlgDocMetaTab ) ;
 
// Function called when a dialog tag is selected.
function OnDialogTabChange( tabCode )
{
ShowE( 'divGeneral' , ( tabCode == 'General' ) ) ;
ShowE( 'divBackground' , ( tabCode == 'Background' ) ) ;
ShowE( 'divColors' , ( tabCode == 'Colors' ) ) ;
ShowE( 'divMeta' , ( tabCode == 'Meta' ) ) ;
 
ShowE( 'ePreview' , ( tabCode == 'Background' || tabCode == 'Colors' ) ) ;
}
 
//#### Get Base elements from the document: BEGIN
 
// The HTML element of the document.
var oHTML = FCK.EditorDocument.getElementsByTagName('html')[0] ;
 
// The HEAD element of the document.
var oHead = oHTML.getElementsByTagName('head')[0] ;
 
var oBody = FCK.EditorDocument.body ;
 
// This object contains all META tags defined in the document.
var oMetaTags = new Object() ;
 
// Get all META tags defined in the document.
var aMetas = oHead.getElementsByTagName('meta') ;
 
// Loop throw all METAs and put it in the HashTable.
for ( var i = 0 ; i < aMetas.length ; i++ )
{
// Try to get the "name" attribute.
var sName = GetAttribute( aMetas[i], 'name', GetAttribute( aMetas[i], '___fcktoreplace:name', '' ) ) ;
 
// If no "name", try with the "http-equiv" attribute.
if ( sName.length == 0 )
{
if ( document.all )
{
// Get the http-equiv value from the outerHTML.
var oHttpEquivMatch = aMetas[i].outerHTML.match( oEditor.FCKRegexLib.MetaHttpEquiv ) ;
if ( oHttpEquivMatch )
sName = oHttpEquivMatch[1] ;
}
else
sName = GetAttribute( aMetas[i], 'http-equiv', '' ) ;
}
 
if ( sName.length > 0 )
oMetaTags[ sName.toLowerCase() ] = aMetas[i] ;
}
 
//#### END
 
// Set a META tag in the document.
function SetMetadata( name, content, isHttp )
{
if ( content.length == 0 )
{
RemoveMetadata( name ) ;
return ;
}
 
var oMeta = oMetaTags[ name.toLowerCase() ] ;
 
if ( !oMeta )
{
oMeta = oHead.appendChild( FCK.EditorDocument.createElement('META') ) ;
 
if ( isHttp )
SetAttribute( oMeta, 'http-equiv', name ) ;
else
{
// On IE, it is not possible to set the "name" attribute of the META tag.
// So a temporary attribute is used and it is replaced when getting the
// editor's HTML/XHTML value. This is sad, I know :(
if ( document.all )
SetAttribute( oMeta, '___fcktoreplace:name', name ) ;
else
SetAttribute( oMeta, 'name', name ) ;
}
 
oMetaTags[ name.toLowerCase() ] = oMeta ;
}
 
oMeta.content = content ;
}
 
function RemoveMetadata( name )
{
var oMeta = oMetaTags[ name.toLowerCase() ] ;
 
if ( oMeta && oMeta != null )
{
oMeta.parentNode.removeChild( oMeta ) ;
oMetaTags[ name.toLowerCase() ] = null ;
}
}
 
function GetMetadata( name )
{
var oMeta = oMetaTags[ name.toLowerCase() ] ;
 
if ( oMeta && oMeta != null )
return oMeta.content ;
else
return '' ;
}
 
window.onload = function ()
{
// Show/Hide the "Browse Server" button.
GetE('tdBrowse').style.display = oEditor.FCKConfig.ImageBrowser ? "" : "none";
 
// First of all, translate the dialog box texts
oEditor.FCKLanguageManager.TranslatePage( document ) ;
 
FillFields() ;
 
UpdatePreview() ;
 
// Show the "Ok" button.
window.parent.SetOkButton( true ) ;
 
window.parent.SetAutoSize( true ) ;
}
 
function FillFields()
{
// ### General Info
GetE('txtPageTitle').value = FCK.EditorDocument.title ;
 
GetE('selDirection').value = GetAttribute( oHTML, 'dir', '' ) ;
GetE('txtLang').value = GetAttribute( oHTML, 'xml:lang', GetAttribute( oHTML, 'lang', '' ) ) ; // "xml:lang" takes precedence to "lang".
 
// Character Set Encoding.
// if ( document.all )
// var sCharSet = FCK.EditorDocument.charset ;
// else
var sCharSet = GetMetadata( 'Content-Type' ) ;
 
if ( sCharSet != null && sCharSet.length > 0 )
{
// if ( !document.all )
sCharSet = sCharSet.match( /[^=]*$/ ) ;
 
GetE('selCharSet').value = sCharSet ;
 
if ( GetE('selCharSet').selectedIndex == -1 )
{
GetE('selCharSet').value = '...' ;
GetE('txtCustomCharSet').value = sCharSet ;
 
CheckOther( GetE('selCharSet'), 'txtCustomCharSet' ) ;
}
}
 
// Document Type.
if ( FCK.DocTypeDeclaration && FCK.DocTypeDeclaration.length > 0 )
{
GetE('selDocType').value = FCK.DocTypeDeclaration ;
 
if ( GetE('selDocType').selectedIndex == -1 )
{
GetE('selDocType').value = '...' ;
GetE('txtDocType').value = FCK.DocTypeDeclaration ;
 
CheckOther( GetE('selDocType'), 'txtDocType' ) ;
}
}
 
// Document Type.
GetE('chkIncXHTMLDecl').checked = ( FCK.XmlDeclaration && FCK.XmlDeclaration.length > 0 ) ;
 
// ### Background
GetE('txtBackColor').value = GetAttribute( oBody, 'bgColor' , '' ) ;
GetE('txtBackImage').value = GetAttribute( oBody, 'background' , '' ) ;
GetE('chkBackNoScroll').checked = ( GetAttribute( oBody, 'bgProperties', '' ).toLowerCase() == 'fixed' ) ;
 
// ### Colors
GetE('txtColorText').value = GetAttribute( oBody, 'text' , '' ) ;
GetE('txtColorLink').value = GetAttribute( oBody, 'link' , '' ) ;
GetE('txtColorVisited').value = GetAttribute( oBody, 'vLink' , '' ) ;
GetE('txtColorActive').value = GetAttribute( oBody, 'aLink' , '' ) ;
 
// ### Margins
GetE('txtMarginTop').value = GetAttribute( oBody, 'topMargin' , '' ) ;
GetE('txtMarginLeft').value = GetAttribute( oBody, 'leftMargin' , '' ) ;
GetE('txtMarginRight').value = GetAttribute( oBody, 'rightMargin' , '' ) ;
GetE('txtMarginBottom').value = GetAttribute( oBody, 'bottomMargin' , '' ) ;
 
// ### Meta Data
GetE('txtMetaKeywords').value = GetMetadata( 'keywords' ) ;
GetE('txtMetaDescription').value = GetMetadata( 'description' ) ;
GetE('txtMetaAuthor').value = GetMetadata( 'author' ) ;
GetE('txtMetaCopyright').value = GetMetadata( 'copyright' ) ;
}
 
// Called when the "Ok" button is clicked.
function Ok()
{
// ### General Info
FCK.EditorDocument.title = GetE('txtPageTitle').value ;
 
var oHTML = FCK.EditorDocument.getElementsByTagName('html')[0] ;
 
SetAttribute( oHTML, 'dir' , GetE('selDirection').value ) ;
SetAttribute( oHTML, 'lang' , GetE('txtLang').value ) ;
SetAttribute( oHTML, 'xml:lang' , GetE('txtLang').value ) ;
 
// Character Set Enconding.
var sCharSet = GetE('selCharSet').value ;
if ( sCharSet == '...' )
sCharSet = GetE('txtCustomCharSet').value ;
 
if ( sCharSet.length > 0 )
sCharSet = 'text/html; charset=' + sCharSet ;
 
// if ( document.all )
// FCK.EditorDocument.charset = sCharSet ;
// else
SetMetadata( 'Content-Type', sCharSet, true ) ;
 
// Document Type
var sDocType = GetE('selDocType').value ;
if ( sDocType == '...' )
sDocType = GetE('txtDocType').value ;
 
FCK.DocTypeDeclaration = sDocType ;
 
// XHTML Declarations.
if ( GetE('chkIncXHTMLDecl').checked )
{
if ( sCharSet.length == 0 )
sCharSet = 'utf-8' ;
 
FCK.XmlDeclaration = '<?xml version="1.0" encoding="' + sCharSet + '"?>' ;
 
SetAttribute( oHTML, 'xmlns', 'http://www.w3.org/1999/xhtml' ) ;
}
else
{
FCK.XmlDeclaration = null ;
oHTML.removeAttribute( 'xmlns', 0 ) ;
}
 
// ### Background
SetAttribute( oBody, 'bgcolor' , GetE('txtBackColor').value ) ;
SetAttribute( oBody, 'background' , GetE('txtBackImage').value ) ;
SetAttribute( oBody, 'bgproperties' , GetE('chkBackNoScroll').checked ? 'fixed' : '' ) ;
 
// ### Colors
SetAttribute( oBody, 'text' , GetE('txtColorText').value ) ;
SetAttribute( oBody, 'link' , GetE('txtColorLink').value ) ;
SetAttribute( oBody, 'vlink', GetE('txtColorVisited').value ) ;
SetAttribute( oBody, 'alink', GetE('txtColorActive').value ) ;
 
// ### Margins
SetAttribute( oBody, 'topmargin' , GetE('txtMarginTop').value ) ;
SetAttribute( oBody, 'leftmargin' , GetE('txtMarginLeft').value ) ;
SetAttribute( oBody, 'rightmargin' , GetE('txtMarginRight').value ) ;
SetAttribute( oBody, 'bottommargin' , GetE('txtMarginBottom').value ) ;
 
// ### Meta data
SetMetadata( 'keywords' , GetE('txtMetaKeywords').value ) ;
SetMetadata( 'description' , GetE('txtMetaDescription').value ) ;
SetMetadata( 'author' , GetE('txtMetaAuthor').value ) ;
SetMetadata( 'copyright' , GetE('txtMetaCopyright').value ) ;
 
return true ;
}
 
var bPreviewIsLoaded = false ;
var oPreviewWindow ;
var oPreviewBody ;
 
// Called by the Preview page when loaded.
function OnPreviewLoad( previewWindow, previewBody )
{
oPreviewWindow = previewWindow ;
oPreviewBody = previewBody ;
 
bPreviewIsLoaded = true ;
UpdatePreview() ;
}
 
function UpdatePreview()
{
if ( !bPreviewIsLoaded )
return ;
 
// ### Background
SetAttribute( oPreviewBody, 'bgcolor' , GetE('txtBackColor').value ) ;
SetAttribute( oPreviewBody, 'background' , GetE('txtBackImage').value ) ;
SetAttribute( oPreviewBody, 'bgproperties' , GetE('chkBackNoScroll').checked ? 'fixed' : '' ) ;
 
// ### Colors
SetAttribute( oPreviewBody, 'text', GetE('txtColorText').value ) ;
 
oPreviewWindow.SetLinkColor( GetE('txtColorLink').value ) ;
oPreviewWindow.SetVisitedColor( GetE('txtColorVisited').value ) ;
oPreviewWindow.SetActiveColor( GetE('txtColorActive').value ) ;
}
 
function CheckOther( combo, txtField )
{
var bNotOther = ( combo.value != '...' ) ;
 
GetE(txtField).style.backgroundColor = ( bNotOther ? '#cccccc' : '' ) ;
GetE(txtField).disabled = bNotOther ;
}
 
function SetColor( inputId, color )
{
GetE( inputId ).value = color + '' ;
UpdatePreview() ;
}
 
function SelectBackColor( color ) { SetColor('txtBackColor', color ) ; }
function SelectColorText( color ) { SetColor('txtColorText', color ) ; }
function SelectColorLink( color ) { SetColor('txtColorLink', color ) ; }
function SelectColorVisited( color ) { SetColor('txtColorVisited', color ) ; }
function SelectColorActive( color ) { SetColor('txtColorActive', color ) ; }
 
function SelectColor( wich )
{
switch ( wich )
{
case 'Back' : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectBackColor, window ) ; return ;
case 'ColorText' : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectColorText, window ) ; return ;
case 'ColorLink' : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectColorLink, window ) ; return ;
case 'ColorVisited' : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectColorVisited, window ) ; return ;
case 'ColorActive' : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectColorActive, window ) ; return ;
}
}
 
function BrowseServerBack()
{
OpenFileBrowser( FCKConfig.ImageBrowserURL, FCKConfig.ImageBrowserWindowWidth, FCKConfig.ImageBrowserWindowHeight ) ;
}
 
function SetUrl( url )
{
GetE('txtBackImage').value = url ;
UpdatePreview() ;
}
 
</script>
</head>
<body style="overflow: hidden">
<table cellspacing="0" cellpadding="0" width="100%" border="0" style="height: 100%">
<tr>
<td valign="top" style="height: 100%">
<div id="divGeneral">
<span fcklang="DlgDocPageTitle">Page Title</span><br />
<input id="txtPageTitle" style="width: 100%" type="text" />
<br />
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<span fcklang="DlgDocLangDir">Language Direction</span><br />
<select id="selDirection">
<option value="" selected="selected"></option>
<option value="ltr" fcklang="DlgDocLangDirLTR">Left to Right (LTR)</option>
<option value="rtl" fcklang="DlgDocLangDirRTL">Right to Left (RTL)</option>
</select>
</td>
<td>
&nbsp;&nbsp;&nbsp;</td>
<td>
<span fcklang="DlgDocLangCode">Language Code</span><br />
<input id="txtLang" type="text" />
</td>
</tr>
</table>
<br />
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td style="white-space: nowrap">
<span fcklang="DlgDocCharSet">Character Set Encoding</span><br />
<select id="selCharSet" onchange="CheckOther( this, 'txtCustomCharSet' );">
<option value="" selected="selected"></option>
<option value="us-ascii">ASCII</option>
<option fcklang="DlgDocCharSetCE" value="iso-8859-2">Central European</option>
<option fcklang="DlgDocCharSetCT" value="big5">Chinese Traditional (Big5)</option>
<option fcklang="DlgDocCharSetCR" value="iso-8859-5">Cyrillic</option>
<option fcklang="DlgDocCharSetGR" value="iso-8859-7">Greek</option>
<option fcklang="DlgDocCharSetJP" value="iso-2022-jp">Japanese</option>
<option fcklang="DlgDocCharSetKR" value="iso-2022-kr">Korean</option>
<option fcklang="DlgDocCharSetTR" value="iso-8859-9">Turkish</option>
<option fcklang="DlgDocCharSetUN" value="utf-8">Unicode (UTF-8)</option>
<option fcklang="DlgDocCharSetWE" value="iso-8859-1">Western European</option>
<option fcklang="DlgOpOther" value="...">&lt;Other&gt;</option>
</select>
</td>
<td>
&nbsp;&nbsp;&nbsp;</td>
<td width="100%">
<span fcklang="DlgDocCharSetOther">Other Character Set Encoding</span><br />
<input id="txtCustomCharSet" style="width: 100%; background-color: #cccccc" disabled="disabled"
type="text" />
</td>
</tr>
<tr>
<td colspan="3">
&nbsp;</td>
</tr>
<tr>
<td nowrap="nowrap">
<span fcklang="DlgDocDocType">Document Type Heading</span><br />
<select id="selDocType" name="selDocType" onchange="CheckOther( this, 'txtDocType' );">
<option value="" selected="selected"></option>
<option value='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'>HTML
4.01 Transitional</option>
<option value='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">'>
HTML 4.01 Strict</option>
<option value='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">'>
HTML 4.01 Frameset</option>
<option value='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'>
XHTML 1.0 Transitional</option>
<option value='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'>
XHTML 1.0 Strict</option>
<option value='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">'>
XHTML 1.0 Frameset</option>
<option value='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'>
XHTML 1.1</option>
<option value='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">'>HTML 3.2</option>
<option value='<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">'>HTML 2.0</option>
<option value="..." fcklang="DlgOpOther">&lt;Other&gt;</option>
</select>
</td>
<td>
</td>
<td width="100%">
<span fcklang="DlgDocDocTypeOther">Other Document Type Heading</span><br />
<input id="txtDocType" style="width: 100%; background-color: #cccccc" disabled="disabled"
type="text" />
</td>
</tr>
</table>
<br />
<input id="chkIncXHTMLDecl" type="checkbox" />
<label for="chkIncXHTMLDecl" fcklang="DlgDocIncXHTML">
Include XHTML Declarations</label>
</div>
<div id="divBackground" style="display: none">
<span fcklang="DlgDocBgColor">Background Color</span><br />
<input id="txtBackColor" type="text" onchange="UpdatePreview();" onkeyup="UpdatePreview();" />&nbsp;<input
id="btnSelBackColor" onclick="SelectColor( 'Back' )" type="button" value="Select..."
fcklang="DlgCellBtnSelect" /><br />
<br />
<span fcklang="DlgDocBgImage">Background Image URL</span><br />
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td width="100%">
<input id="txtBackImage" style="width: 100%" type="text" onchange="UpdatePreview();"
onkeyup="UpdatePreview();" /></td>
<td id="tdBrowse" nowrap="nowrap">
&nbsp;<input id="btnBrowse" onclick="BrowseServerBack();" type="button" fcklang="DlgBtnBrowseServer"
value="Browse Server" /></td>
</tr>
</table>
<input id="chkBackNoScroll" type="checkbox" onclick="UpdatePreview();" />
<label for="chkBackNoScroll" fcklang="DlgDocBgNoScroll">
Nonscrolling Background</label>
</div>
<div id="divColors" style="display: none">
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td>
<span fcklang="DlgDocCText">Text</span><br />
<input id="txtColorText" type="text" onchange="UpdatePreview();" onkeyup="UpdatePreview();" /><input
onclick="SelectColor( 'ColorText' )" type="button" value="Select..." fcklang="DlgCellBtnSelect" />
<br />
<span fcklang="DlgDocCLink">Link</span><br />
<input id="txtColorLink" type="text" onchange="UpdatePreview();" onkeyup="UpdatePreview();" /><input
onclick="SelectColor( 'ColorLink' )" type="button" value="Select..." fcklang="DlgCellBtnSelect" />
<br />
<span fcklang="DlgDocCVisited">Visited Link</span><br />
<input id="txtColorVisited" type="text" onchange="UpdatePreview();" onkeyup="UpdatePreview();" /><input
onclick="SelectColor( 'ColorVisited' )" type="button" value="Select..." fcklang="DlgCellBtnSelect" />
<br />
<span fcklang="DlgDocCActive">Active Link</span><br />
<input id="txtColorActive" type="text" onchange="UpdatePreview();" onkeyup="UpdatePreview();" /><input
onclick="SelectColor( 'ColorActive' )" type="button" value="Select..." fcklang="DlgCellBtnSelect" />
</td>
<td valign="middle" align="center">
<table cellspacing="2" cellpadding="0" border="0">
<tr>
<td>
<span fcklang="DlgDocMargins">Page Margins</span></td>
</tr>
<tr>
<td style="border: #000000 1px solid; padding: 5px">
<table cellpadding="0" cellspacing="0" border="0" dir="ltr">
<tr>
<td align="center" colspan="3">
<span fcklang="DlgDocMaTop">Top</span><br />
<input id="txtMarginTop" type="text" size="3" />
</td>
</tr>
<tr>
<td align="left">
<span fcklang="DlgDocMaLeft">Left</span><br />
<input id="txtMarginLeft" type="text" size="3" />
</td>
<td>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td align="right">
<span fcklang="DlgDocMaRight">Right</span><br />
<input id="txtMarginRight" type="text" size="3" />
</td>
</tr>
<tr>
<td align="center" colspan="3">
<span fcklang="DlgDocMaBottom">Bottom</span><br />
<input id="txtMarginBottom" type="text" size="3" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div id="divMeta" style="display: none">
<span fcklang="DlgDocMeIndex">Document Indexing Keywords (comma separated)</span><br />
<textarea id="txtMetaKeywords" style="width: 100%" rows="2" cols="20"></textarea>
<br />
<span fcklang="DlgDocMeDescr">Document Description</span><br />
<textarea id="txtMetaDescription" style="width: 100%" rows="4" cols="20"></textarea>
<br />
<span fcklang="DlgDocMeAuthor">Author</span><br />
<input id="txtMetaAuthor" style="width: 100%" type="text" /><br />
<br />
<span fcklang="DlgDocMeCopy">Copyright</span><br />
<input id="txtMetaCopyright" type="text" style="width: 100%" />
</div>
</td>
</tr>
<tr id="ePreview" style="display: none">
<td>
<span fcklang="DlgDocPreview">Preview</span><br />
<iframe id="frmPreview" src="fck_docprops/fck_document_preview.html" width="100%"
height="100"></iframe>
</td>
</tr>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_link/fck_link.js
New file
0,0 → 1,630
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_link.js
* Scripts related to the Link dialog window (see fck_link.html).
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
* Dominik Pesch ?dom? (empty selection patch) (d.pesch@11com7.de)
*/
 
var oEditor = window.parent.InnerDialogLoaded() ;
var FCK = oEditor.FCK ;
var FCKLang = oEditor.FCKLang ;
var FCKConfig = oEditor.FCKConfig ;
 
//#### Dialog Tabs
 
// Set the dialog tabs.
window.parent.AddTab( 'Info', FCKLang.DlgLnkInfoTab ) ;
 
if ( !FCKConfig.LinkDlgHideTarget )
window.parent.AddTab( 'Target', FCKLang.DlgLnkTargetTab, true ) ;
 
if ( FCKConfig.LinkUpload )
window.parent.AddTab( 'Upload', FCKLang.DlgLnkUpload, true ) ;
 
if ( !FCKConfig.LinkDlgHideAdvanced )
window.parent.AddTab( 'Advanced', FCKLang.DlgAdvancedTag ) ;
 
// Function called when a dialog tag is selected.
function OnDialogTabChange( tabCode )
{
ShowE('divInfo' , ( tabCode == 'Info' ) ) ;
ShowE('divTarget' , ( tabCode == 'Target' ) ) ;
ShowE('divUpload' , ( tabCode == 'Upload' ) ) ;
ShowE('divAttribs' , ( tabCode == 'Advanced' ) ) ;
 
window.parent.SetAutoSize( true ) ;
}
 
//#### Regular Expressions library.
var oRegex = new Object() ;
 
oRegex.UriProtocol = new RegExp('') ;
oRegex.UriProtocol.compile( '^(((http|https|ftp|news):\/\/)|mailto:)', 'gi' ) ;
 
oRegex.UrlOnChangeProtocol = new RegExp('') ;
oRegex.UrlOnChangeProtocol.compile( '^(http|https|ftp|news)://(?=.)', 'gi' ) ;
 
oRegex.UrlOnChangeTestOther = new RegExp('') ;
//oRegex.UrlOnChangeTestOther.compile( '^(javascript:|#|/)', 'gi' ) ;
oRegex.UrlOnChangeTestOther.compile( '^((javascript:)|[#/\.])', 'gi' ) ;
 
oRegex.ReserveTarget = new RegExp('') ;
oRegex.ReserveTarget.compile( '^_(blank|self|top|parent)$', 'i' ) ;
 
oRegex.PopupUri = new RegExp('') ;
oRegex.PopupUri.compile( "^javascript:void\\(\\s*window.open\\(\\s*'([^']+)'\\s*,\\s*(?:'([^']*)'|null)\\s*,\\s*'([^']*)'\\s*\\)\\s*\\)\\s*$" ) ;
 
oRegex.PopupFeatures = new RegExp('') ;
oRegex.PopupFeatures.compile( '(?:^|,)([^=]+)=(\\d+|yes|no)', 'gi' ) ;
 
//#### Parser Functions
 
var oParser = new Object() ;
 
oParser.ParseEMailUrl = function( emailUrl )
{
// Initializes the EMailInfo object.
var oEMailInfo = new Object() ;
oEMailInfo.Address = '' ;
oEMailInfo.Subject = '' ;
oEMailInfo.Body = '' ;
 
var oParts = emailUrl.match( /^([^\?]+)\??(.+)?/ ) ;
if ( oParts )
{
// Set the e-mail address.
oEMailInfo.Address = oParts[1] ;
 
// Look for the optional e-mail parameters.
if ( oParts[2] )
{
var oMatch = oParts[2].match( /(^|&)subject=([^&]+)/i ) ;
if ( oMatch ) oEMailInfo.Subject = unescape( oMatch[2] ) ;
 
oMatch = oParts[2].match( /(^|&)body=([^&]+)/i ) ;
if ( oMatch ) oEMailInfo.Body = unescape( oMatch[2] ) ;
}
}
 
return oEMailInfo ;
}
 
oParser.CreateEMailUri = function( address, subject, body )
{
var sBaseUri = 'mailto:' + address ;
 
var sParams = '' ;
 
if ( subject.length > 0 )
sParams = '?subject=' + escape( subject ) ;
 
if ( body.length > 0 )
{
sParams += ( sParams.length == 0 ? '?' : '&' ) ;
sParams += 'body=' + escape( body ) ;
}
 
return sBaseUri + sParams ;
}
 
//#### Initialization Code
 
// oLink: The actual selected link in the editor.
var oLink = FCK.Selection.MoveToAncestorNode( 'A' ) ;
if ( oLink )
FCK.Selection.SelectNode( oLink ) ;
 
window.onload = function()
{
// Translate the dialog box texts.
oEditor.FCKLanguageManager.TranslatePage(document) ;
 
// Fill the Anchor Names and Ids combos.
LoadAnchorNamesAndIds() ;
 
// Load the selected link information (if any).
LoadSelection() ;
 
// Update the dialog box.
SetLinkType( GetE('cmbLinkType').value ) ;
 
// Show/Hide the "Browse Server" button.
GetE('divBrowseServer').style.display = FCKConfig.LinkBrowser ? '' : 'none' ;
 
// Show the initial dialog content.
GetE('divInfo').style.display = '' ;
 
// Set the actual uploader URL.
if ( FCKConfig.LinkUpload )
GetE('frmUpload').action = FCKConfig.LinkUploadURL ;
 
// Activate the "OK" button.
window.parent.SetOkButton( true ) ;
}
 
var bHasAnchors ;
 
function LoadAnchorNamesAndIds()
{
// Since version 2.0, the anchors are replaced in the DOM by IMGs so the user see the icon
// to edit them. So, we must look for that images now.
var aAnchors = new Array() ;
var oImages = oEditor.FCK.EditorDocument.getElementsByTagName( 'IMG' ) ;
for( var i = 0 ; i < oImages.length ; i++ )
{
if ( oImages[i].getAttribute('_fckanchor') )
aAnchors[ aAnchors.length ] = oEditor.FCK.GetRealElement( oImages[i] ) ;
}
var aIds = oEditor.FCKTools.GetAllChildrenIds( oEditor.FCK.EditorDocument.body ) ;
 
bHasAnchors = ( aAnchors.length > 0 || aIds.length > 0 ) ;
 
for ( var i = 0 ; i < aAnchors.length ; i++ )
{
var sName = aAnchors[i].name ;
if ( sName && sName.length > 0 )
oEditor.FCKTools.AddSelectOption( GetE('cmbAnchorName'), sName, sName ) ;
}
 
for ( var i = 0 ; i < aIds.length ; i++ )
{
oEditor.FCKTools.AddSelectOption( GetE('cmbAnchorId'), aIds[i], aIds[i] ) ;
}
 
ShowE( 'divSelAnchor' , bHasAnchors ) ;
ShowE( 'divNoAnchor' , !bHasAnchors ) ;
}
 
function LoadSelection()
{
if ( !oLink ) return ;
 
var sType = 'url' ;
 
// Get the actual Link href.
var sHRef = oLink.getAttribute( '_fcksavedurl' ) ;
if ( sHRef == null )
sHRef = oLink.getAttribute( 'href' , 2 ) + '' ;
// Look for a popup javascript link.
var oPopupMatch = oRegex.PopupUri.exec( sHRef ) ;
if( oPopupMatch )
{
GetE('cmbTarget').value = 'popup' ;
sHRef = oPopupMatch[1] ;
FillPopupFields( oPopupMatch[2], oPopupMatch[3] ) ;
SetTarget( 'popup' ) ;
}
 
// Search for the protocol.
var sProtocol = oRegex.UriProtocol.exec( sHRef ) ;
 
if ( sProtocol )
{
sProtocol = sProtocol[0].toLowerCase() ;
GetE('cmbLinkProtocol').value = sProtocol ;
 
// Remove the protocol and get the remainig URL.
var sUrl = sHRef.replace( oRegex.UriProtocol, '' ) ;
 
if ( sProtocol == 'mailto:' ) // It is an e-mail link.
{
sType = 'email' ;
 
var oEMailInfo = oParser.ParseEMailUrl( sUrl ) ;
GetE('txtEMailAddress').value = oEMailInfo.Address ;
GetE('txtEMailSubject').value = oEMailInfo.Subject ;
GetE('txtEMailBody').value = oEMailInfo.Body ;
}
else // It is a normal link.
{
sType = 'url' ;
GetE('txtUrl').value = sUrl ;
}
}
else if ( sHRef.substr(0,1) == '#' && sHRef.length > 1 ) // It is an anchor link.
{
sType = 'anchor' ;
GetE('cmbAnchorName').value = GetE('cmbAnchorId').value = sHRef.substr(1) ;
}
else // It is another type of link.
{
sType = 'url' ;
 
GetE('cmbLinkProtocol').value = '' ;
GetE('txtUrl').value = sHRef ;
}
 
if ( !oPopupMatch )
{
// Get the target.
var sTarget = oLink.target ;
 
if ( sTarget && sTarget.length > 0 )
{
if ( oRegex.ReserveTarget.test( sTarget ) )
{
sTarget = sTarget.toLowerCase() ;
GetE('cmbTarget').value = sTarget ;
}
else
GetE('cmbTarget').value = 'frame' ;
GetE('txtTargetFrame').value = sTarget ;
}
}
 
// Get Advances Attributes
GetE('txtAttId').value = oLink.id ;
GetE('txtAttName').value = oLink.name ;
GetE('cmbAttLangDir').value = oLink.dir ;
GetE('txtAttLangCode').value = oLink.lang ;
GetE('txtAttAccessKey').value = oLink.accessKey ;
GetE('txtAttTabIndex').value = oLink.tabIndex <= 0 ? '' : oLink.tabIndex ;
GetE('txtAttTitle').value = oLink.title ;
GetE('txtAttContentType').value = oLink.type ;
GetE('txtAttCharSet').value = oLink.charset ;
 
if ( oEditor.FCKBrowserInfo.IsIE )
{
GetE('txtAttClasses').value = oLink.getAttribute('className',2) || '' ;
GetE('txtAttStyle').value = oLink.style.cssText ;
}
else
{
GetE('txtAttClasses').value = oLink.getAttribute('class',2) || '' ;
GetE('txtAttStyle').value = oLink.getAttribute('style',2) ;
}
 
// Update the Link type combo.
GetE('cmbLinkType').value = sType ;
}
 
//#### Link type selection.
function SetLinkType( linkType )
{
ShowE('divLinkTypeUrl' , (linkType == 'url') ) ;
ShowE('divLinkTypeAnchor' , (linkType == 'anchor') ) ;
ShowE('divLinkTypeEMail' , (linkType == 'email') ) ;
 
if ( !FCKConfig.LinkDlgHideTarget )
window.parent.SetTabVisibility( 'Target' , (linkType == 'url') ) ;
 
if ( FCKConfig.LinkUpload )
window.parent.SetTabVisibility( 'Upload' , (linkType == 'url') ) ;
 
if ( !FCKConfig.LinkDlgHideAdvanced )
window.parent.SetTabVisibility( 'Advanced' , (linkType != 'anchor' || bHasAnchors) ) ;
 
if ( linkType == 'email' )
window.parent.SetAutoSize( true ) ;
}
 
//#### Target type selection.
function SetTarget( targetType )
{
GetE('tdTargetFrame').style.display = ( targetType == 'popup' ? 'none' : '' ) ;
GetE('tdPopupName').style.display =
GetE('tablePopupFeatures').style.display = ( targetType == 'popup' ? '' : 'none' ) ;
 
switch ( targetType )
{
case "_blank" :
case "_self" :
case "_parent" :
case "_top" :
GetE('txtTargetFrame').value = targetType ;
break ;
case "" :
GetE('txtTargetFrame').value = '' ;
break ;
}
 
if ( targetType == 'popup' )
window.parent.SetAutoSize( true ) ;
}
 
//#### Called while the user types the URL.
function OnUrlChange()
{
var sUrl = GetE('txtUrl').value ;
var sProtocol = oRegex.UrlOnChangeProtocol.exec( sUrl ) ;
 
if ( sProtocol )
{
sUrl = sUrl.substr( sProtocol[0].length ) ;
GetE('txtUrl').value = sUrl ;
GetE('cmbLinkProtocol').value = sProtocol[0].toLowerCase() ;
}
else if ( oRegex.UrlOnChangeTestOther.test( sUrl ) )
{
GetE('cmbLinkProtocol').value = '' ;
}
}
 
//#### Called while the user types the target name.
function OnTargetNameChange()
{
var sFrame = GetE('txtTargetFrame').value ;
 
if ( sFrame.length == 0 )
GetE('cmbTarget').value = '' ;
else if ( oRegex.ReserveTarget.test( sFrame ) )
GetE('cmbTarget').value = sFrame.toLowerCase() ;
else
GetE('cmbTarget').value = 'frame' ;
}
 
//#### Builds the javascript URI to open a popup to the specified URI.
function BuildPopupUri( uri )
{
var oReg = new RegExp( "'", "g" ) ;
var sWindowName = "'" + GetE('txtPopupName').value.replace(oReg, "\\'") + "'" ;
 
var sFeatures = '' ;
var aChkFeatures = document.getElementsByName('chkFeature') ;
for ( var i = 0 ; i < aChkFeatures.length ; i++ )
{
if ( i > 0 ) sFeatures += ',' ;
sFeatures += aChkFeatures[i].value + '=' + ( aChkFeatures[i].checked ? 'yes' : 'no' ) ;
}
 
if ( GetE('txtPopupWidth').value.length > 0 ) sFeatures += ',width=' + GetE('txtPopupWidth').value ;
if ( GetE('txtPopupHeight').value.length > 0 ) sFeatures += ',height=' + GetE('txtPopupHeight').value ;
if ( GetE('txtPopupLeft').value.length > 0 ) sFeatures += ',left=' + GetE('txtPopupLeft').value ;
if ( GetE('txtPopupTop').value.length > 0 ) sFeatures += ',top=' + GetE('txtPopupTop').value ;
 
return ( "javascript:void(window.open('" + uri + "'," + sWindowName + ",'" + sFeatures + "'))" ) ;
}
 
//#### Fills all Popup related fields.
function FillPopupFields( windowName, features )
{
if ( windowName )
GetE('txtPopupName').value = windowName ;
 
var oFeatures = new Object() ;
var oFeaturesMatch ;
while( ( oFeaturesMatch = oRegex.PopupFeatures.exec( features ) ) != null )
{
var sValue = oFeaturesMatch[2] ;
if ( sValue == ( 'yes' || '1' ) )
oFeatures[ oFeaturesMatch[1] ] = true ;
else if ( ! isNaN( sValue ) && sValue != 0 )
oFeatures[ oFeaturesMatch[1] ] = sValue ;
}
 
// Update all features check boxes.
var aChkFeatures = document.getElementsByName('chkFeature') ;
for ( var i = 0 ; i < aChkFeatures.length ; i++ )
{
if ( oFeatures[ aChkFeatures[i].value ] )
aChkFeatures[i].checked = true ;
}
 
// Update position and size text boxes.
if ( oFeatures['width'] ) GetE('txtPopupWidth').value = oFeatures['width'] ;
if ( oFeatures['height'] ) GetE('txtPopupHeight').value = oFeatures['height'] ;
if ( oFeatures['left'] ) GetE('txtPopupLeft').value = oFeatures['left'] ;
if ( oFeatures['top'] ) GetE('txtPopupTop').value = oFeatures['top'] ;
}
 
//#### The OK button was hit.
function Ok()
{
var sUri, sInnerHtml ;
 
switch ( GetE('cmbLinkType').value )
{
case 'url' :
sUri = GetE('txtUrl').value ;
 
if ( sUri.length == 0 )
{
alert( FCKLang.DlnLnkMsgNoUrl ) ;
return false ;
}
 
sUri = GetE('cmbLinkProtocol').value + sUri ;
 
if( GetE('cmbTarget').value == 'popup' )
{
// Check the window name, according to http://www.w3.org/TR/html4/types.html#type-frame-target (IE throw erros with spaces).
if ( /(^[^a-zA-Z])|(\s)/.test( GetE('txtPopupName').value ) )
{
alert( FCKLang.DlnLnkMsgInvPopName ) ;
return false ;
}
sUri = BuildPopupUri( sUri ) ;
}
 
break ;
 
case 'email' :
sUri = GetE('txtEMailAddress').value ;
 
if ( sUri.length == 0 )
{
alert( FCKLang.DlnLnkMsgNoEMail ) ;
return false ;
}
 
sUri = oParser.CreateEMailUri(
sUri,
GetE('txtEMailSubject').value,
GetE('txtEMailBody').value ) ;
break ;
 
case 'anchor' :
var sAnchor = GetE('cmbAnchorName').value ;
if ( sAnchor.length == 0 ) sAnchor = GetE('cmbAnchorId').value ;
 
if ( sAnchor.length == 0 )
{
alert( FCKLang.DlnLnkMsgNoAnchor ) ;
return false ;
}
 
sUri = '#' + sAnchor ;
break ;
}
 
// No link selected, so try to create one.
if ( !oLink )
oLink = oEditor.FCK.CreateLink( sUri ) ;
if ( oLink )
sInnerHtml = oLink.innerHTML ; // Save the innerHTML (IE changes it if it is like an URL).
else
{
// If no selection, use the uri as the link text (by dom, 2006-05-26)
 
sInnerHtml = sUri;
 
// Built a better text for empty links.
switch ( GetE('cmbLinkType').value )
{
// anchor: use old behavior --> return true
case 'anchor':
sInnerHtml = sInnerHtml.replace( /^#/, '' ) ;
break ;
 
// url: try to get path
case 'url':
var oLinkPathRegEx = new RegExp("//?([^?\"']+)([?].*)?$") ;
var asLinkPath = oLinkPathRegEx.exec( sUri ) ;
if (asLinkPath != null)
sInnerHtml = asLinkPath[1]; // use matched path
break ;
 
// mailto: try to get email address
case 'email':
sInnerHtml = GetE('txtEMailAddress').value ;
break ;
}
 
// Create a new (empty) anchor.
oLink = oEditor.FCK.CreateElement( 'a' ) ;
}
 
oEditor.FCKUndo.SaveUndoStep() ;
 
oLink.href = sUri ;
SetAttribute( oLink, '_fcksavedurl', sUri ) ;
 
oLink.innerHTML = sInnerHtml ; // Set (or restore) the innerHTML
 
// Target
if( GetE('cmbTarget').value != 'popup' )
SetAttribute( oLink, 'target', GetE('txtTargetFrame').value ) ;
else
SetAttribute( oLink, 'target', null ) ;
 
// Advances Attributes
SetAttribute( oLink, 'id' , GetE('txtAttId').value ) ;
SetAttribute( oLink, 'name' , GetE('txtAttName').value ) ; // No IE. Set but doesnt't update the outerHTML.
SetAttribute( oLink, 'dir' , GetE('cmbAttLangDir').value ) ;
SetAttribute( oLink, 'lang' , GetE('txtAttLangCode').value ) ;
SetAttribute( oLink, 'accesskey', GetE('txtAttAccessKey').value ) ;
SetAttribute( oLink, 'tabindex' , ( GetE('txtAttTabIndex').value > 0 ? GetE('txtAttTabIndex').value : null ) ) ;
SetAttribute( oLink, 'title' , GetE('txtAttTitle').value ) ;
SetAttribute( oLink, 'type' , GetE('txtAttContentType').value ) ;
SetAttribute( oLink, 'charset' , GetE('txtAttCharSet').value ) ;
 
if ( oEditor.FCKBrowserInfo.IsIE )
{
SetAttribute( oLink, 'className', GetE('txtAttClasses').value ) ;
oLink.style.cssText = GetE('txtAttStyle').value ;
}
else
{
SetAttribute( oLink, 'class', GetE('txtAttClasses').value ) ;
SetAttribute( oLink, 'style', GetE('txtAttStyle').value ) ;
}
 
// Select the link.
oEditor.FCKSelection.SelectNode(oLink);
return true ;
}
 
function BrowseServer()
{
OpenFileBrowser( FCKConfig.LinkBrowserURL, FCKConfig.LinkBrowserWindowWidth, FCKConfig.LinkBrowserWindowHeight ) ;
}
 
function SetUrl( url )
{
document.getElementById('txtUrl').value = url ;
OnUrlChange() ;
window.parent.SetSelectedTab( 'Info' ) ;
}
 
function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
{
switch ( errorNumber )
{
case 0 : // No errors
alert( 'Your file has been successfully uploaded' ) ;
break ;
case 1 : // Custom error
alert( customMsg ) ;
return ;
case 101 : // Custom warning
alert( customMsg ) ;
break ;
case 201 :
alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + fileName + '"' ) ;
break ;
case 202 :
alert( 'Invalid file type' ) ;
return ;
case 203 :
alert( "Security error. You probably don't have enough permissions to upload. Please check your server." ) ;
return ;
default :
alert( 'Error on file upload. Error number: ' + errorNumber ) ;
return ;
}
 
SetUrl( fileUrl ) ;
GetE('frmUpload').reset() ;
}
 
var oUploadAllowedExtRegex = new RegExp( FCKConfig.LinkUploadAllowedExtensions, 'i' ) ;
var oUploadDeniedExtRegex = new RegExp( FCKConfig.LinkUploadDeniedExtensions, 'i' ) ;
 
function CheckUpload()
{
var sFile = GetE('txtUploadFile').value ;
if ( sFile.length == 0 )
{
alert( 'Please select a file to upload' ) ;
return false ;
}
if ( ( FCKConfig.LinkUploadAllowedExtensions.length > 0 && !oUploadAllowedExtRegex.test( sFile ) ) ||
( FCKConfig.LinkUploadDeniedExtensions.length > 0 && oUploadDeniedExtRegex.test( sFile ) ) )
{
OnUploadCompleted( 202 ) ;
return false ;
}
return true ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_radiobutton.html
New file
0,0 → 1,103
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_radiobutton.html
* Radio Button dialog window.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<html>
<head>
<title>Radio Button Properties</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta content="noindex, nofollow" name="robots">
<script src="common/fck_dialog_common.js" type="text/javascript"></script>
<script type="text/javascript">
 
var oEditor = window.parent.InnerDialogLoaded() ;
 
// Gets the document DOM
var oDOM = oEditor.FCK.EditorDocument ;
 
var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
 
window.onload = function()
{
// First of all, translate the dialog box texts
oEditor.FCKLanguageManager.TranslatePage(document) ;
 
if ( oActiveEl && oActiveEl.tagName.toUpperCase() == 'INPUT' && oActiveEl.type == 'radio' )
{
GetE('txtName').value = oActiveEl.name ;
GetE('txtValue').value = oEditor.FCKBrowserInfo.IsIE ? oActiveEl.value : GetAttribute( oActiveEl, 'value' ) ;
GetE('txtSelected').checked = oActiveEl.checked ;
}
else
oActiveEl = null ;
 
window.parent.SetOkButton( true ) ;
}
 
function Ok()
{
if ( !oActiveEl )
{
oActiveEl = oEditor.FCK.EditorDocument.createElement( 'INPUT' ) ;
oActiveEl.type = 'radio' ;
oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ;
}
 
if ( GetE('txtName').value.length > 0 )
oActiveEl.name = GetE('txtName').value ;
if ( oEditor.FCKBrowserInfo.IsIE )
oActiveEl.value = GetE('txtValue').value ;
else
SetAttribute( oActiveEl, 'value', GetE('txtValue').value ) ;
 
var bIsChecked = GetE('txtSelected').checked ;
SetAttribute( oActiveEl, 'checked', bIsChecked ? 'checked' : null ) ; // For Firefox
oActiveEl.checked = bIsChecked ;
 
return true ;
}
 
</script>
</head>
<body style="OVERFLOW: hidden" scroll="no">
<table height="100%" width="100%">
<tr>
<td align="center">
<table border="0" cellpadding="0" cellspacing="0" width="80%">
<tr>
<td>
<span fckLang="DlgCheckboxName">Name</span><br>
<input type="text" size="20" id="txtName" style="WIDTH: 100%">
</td>
</tr>
<tr>
<td>
<span fckLang="DlgCheckboxValue">Value</span><br>
<input type="text" size="20" id="txtValue" style="WIDTH: 100%">
</td>
</tr>
<tr>
<td><input type="checkbox" id="txtSelected"><label for="txtSelected" fckLang="DlgCheckboxSelected">Checked</label></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_flash.html
New file
0,0 → 1,142
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_flash.html
* Flash Properties dialog window.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<html>
<head>
<title>Flash Properties</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta content="noindex, nofollow" name="robots">
<script src="common/fck_dialog_common.js" type="text/javascript"></script>
<script src="fck_flash/fck_flash.js" type="text/javascript"></script>
<link href="common/fck_dialog_common.css" type="text/css" rel="stylesheet">
</head>
<body scroll="no" style="OVERFLOW: hidden">
<div id="divInfo">
<table cellSpacing="1" cellPadding="1" width="100%" border="0">
<tr>
<td>
<table cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr>
<td width="100%"><span fckLang="DlgImgURL">URL</span>
</td>
<td id="tdBrowse" style="DISPLAY: none" noWrap rowSpan="2">&nbsp; <input id="btnBrowse" onclick="BrowseServer();" type="button" value="Browse Server" fckLang="DlgBtnBrowseServer">
</td>
</tr>
<tr>
<td vAlign="top"><input id="txtUrl" onblur="UpdatePreview();" style="WIDTH: 100%" type="text">
</td>
</tr>
</table>
</td>
</tr>
<TR>
<TD>
<table cellSpacing="0" cellPadding="0" border="0">
<TR>
<TD nowrap>
<span fckLang="DlgImgWidth">Width</span><br>
<input id="txtWidth" class="FCK__FieldNumeric" type="text" size="3">
</TD>
<TD>&nbsp;</TD>
<TD>
<span fckLang="DlgImgHeight">Height</span><br>
<input id="txtHeight" class="FCK__FieldNumeric" type="text" size="3">
</TD>
</TR>
</table>
</TD>
</TR>
<tr>
<td vAlign="top">
<table cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr>
<td valign="top" width="100%">
<table cellSpacing="0" cellPadding="0" width="100%">
<tr>
<td><span fckLang="DlgImgPreview">Preview</span></td>
</tr>
<tr>
<td id="ePreviewCell" valign="top" class="FlashPreviewArea"><iframe src="fck_flash/fck_flash_preview.html" frameborder="0" marginheight="0" marginwidth="0"></iframe></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div id="divUpload" style="DISPLAY: none">
<form id="frmUpload" method="post" target="UploadWindow" enctype="multipart/form-data" action="" onsubmit="return CheckUpload();">
<span fckLang="DlgLnkUpload">Upload</span><br />
<input id="txtUploadFile" style="WIDTH: 100%" type="file" size="40" name="NewFile" /><br />
<br />
<input id="btnUpload" type="submit" value="Send it to the Server" fckLang="DlgLnkBtnUpload" />
<iframe name="UploadWindow" style="DISPLAY: none" src="../fckblank.html"></iframe>
</form>
</div>
<div id="divAdvanced" style="DISPLAY: none">
<TABLE cellSpacing="0" cellPadding="0" border="0">
<TR>
<TD nowrap>
<span fckLang="DlgFlashScale">Scale</span><BR>
<select id="cmbScale">
<option value="" selected></option>
<option value="showall" fckLang="DlgFlashScaleAll">Show all</option>
<option value="noborder" fckLang="DlgFlashScaleNoBorder">No Border</option>
<option value="exactfit" fckLang="DlgFlashScaleFit">Exact Fit</option>
</select></TD>
<TD>&nbsp;&nbsp;&nbsp; &nbsp;
</TD>
<td valign="bottom">
<table>
<tr>
<td><input id="chkAutoPlay" type="checkbox" checked></td>
<td><label for="chkAutoPlay" nowrap fckLang="DlgFlashChkPlay">Auto Play</label>&nbsp;&nbsp;</td>
<td><input id="chkLoop" type="checkbox" checked></td>
<td><label for="chkLoop" nowrap fckLang="DlgFlashChkLoop">Loop</label>&nbsp;&nbsp;</td>
<td><input id="chkMenu" type="checkbox" checked></td>
<td><label for="chkMenu" nowrap fckLang="DlgFlashChkMenu">Enable Flash Menu</label></td>
</tr>
</table>
</td>
</TR>
</TABLE>
<br>
&nbsp;
<table cellSpacing="0" cellPadding="0" width="100%" align="center" border="0">
<tr>
<td vAlign="top" width="50%"><span fckLang="DlgGenId">Id</span><br>
<input id="txtAttId" style="WIDTH: 100%" type="text">
</td>
<td>&nbsp;&nbsp;</td>
<td vAlign="top" nowrap><span fckLang="DlgGenClass">Stylesheet Classes</span><br>
<input id="txtAttClasses" style="WIDTH: 100%" type="text">
</td>
<td>&nbsp;&nbsp;</td>
<td vAlign="top" nowrap width="50%">&nbsp;<span fckLang="DlgGenTitle">Advisory Title</span><br>
<input id="txtAttTitle" style="WIDTH: 100%" type="text">
</td>
</tr>
</table>
<span fckLang="DlgGenStyle">Style</span><br>
<input id="txtAttStyle" style="WIDTH: 100%" type="text">
</div>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_hiddenfield.html
New file
0,0 → 1,91
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_hiddenfield.html
* Hidden Field dialog window.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<html>
<head>
<title>Hidden Field Properties</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta content="noindex, nofollow" name="robots">
<script src="common/fck_dialog_common.js" type="text/javascript"></script>
<script type="text/javascript">
 
var oEditor = window.parent.InnerDialogLoaded() ;
 
// Gets the document DOM
var oDOM = oEditor.FCK.EditorDocument ;
 
var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
 
window.onload = function()
{
// First of all, translate the dialog box texts
oEditor.FCKLanguageManager.TranslatePage(document) ;
 
if ( oActiveEl && oActiveEl.tagName == 'INPUT' && oActiveEl.type == 'hidden' )
{
GetE('txtName').value = oActiveEl.name ;
GetE('txtValue').value = oActiveEl.value ;
}
else
oActiveEl = null ;
 
window.parent.SetOkButton( true ) ;
}
 
 
function Ok()
{
if ( !oActiveEl )
{
oActiveEl = oEditor.FCK.EditorDocument.createElement( 'INPUT' ) ;
oActiveEl.type = 'hidden' ;
oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ;
}
oActiveEl.name = GetE('txtName').value ;
SetAttribute( oActiveEl, 'value', GetE('txtValue').value ) ;
 
return true ;
}
 
</script>
</head>
<body style="OVERFLOW: hidden" scroll="no">
<table height="100%" width="100%">
<tr>
<td align="center">
<table border="0" class="inhoud" cellpadding="0" cellspacing="0" width="80%">
<tr>
<td>
<span fckLang="DlgHiddenName">Name</span><br>
<input type="text" size="20" id="txtName" style="WIDTH: 100%">
</td>
</tr>
<tr>
<td>
<span fckLang="DlgHiddenValue">Value</span><br>
<input type="text" size="30" id="txtValue" style="WIDTH: 100%">
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_source.html
New file
0,0 → 1,61
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_source.html
* Source editor dialog window.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
<title>Source</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow">
<link href="common/fck_dialog_common.css" rel="stylesheet" type="text/css" />
<script language="javascript">
var oEditor = window.parent.InnerDialogLoaded() ;
var FCK = oEditor.FCK ;
var FCKConfig = oEditor.FCKConfig ;
 
window.onload = function()
{
// EnableXHTML and EnableSourceXHTML has been deprecated
// document.getElementById('txtSource').value = ( FCKConfig.EnableXHTML && FCKConfig.EnableSourceXHTML ? FCK.GetXHTML( FCKConfig.FormatSource ) : FCK.GetHTML( FCKConfig.FormatSource ) ) ;
document.getElementById('txtSource').value = FCK.GetXHTML( FCKConfig.FormatSource ) ;
 
// Activate the "OK" button.
window.parent.SetOkButton( true ) ;
}
 
//#### The OK button was hit.
function Ok()
{
if ( oEditor.FCKBrowserInfo.IsIE )
oEditor.FCKUndo.SaveUndoStep() ;
FCK.SetHTML( document.getElementById('txtSource').value, false ) ;
return true ;
}
</script>
</head>
<body scroll="no" style="OVERFLOW: hidden">
<table width="100%" height="100%">
<tr>
<td height="100%"><textarea id="txtSource" dir="ltr" style="PADDING-RIGHT: 5px; PADDING-LEFT: 5px; FONT-SIZE: 14px; PADDING-BOTTOM: 5px; WIDTH: 100%; PADDING-TOP: 5px; FONT-FAMILY: Monospace; HEIGHT: 100%">Loading. Please wait...</textarea></td>
</tr>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_smiley.html
New file
0,0 → 1,101
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_smiley.html
* Smileys (emoticons) dialog window.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex, nofollow" />
<style type="text/css">
.Hand
{
cursor: pointer;
cursor: hand;
}
</style>
<script type="text/javascript">
 
var oEditor = window.parent.InnerDialogLoaded() ;
 
window.onload = function ()
{
// First of all, translate the dialog box texts
oEditor.FCKLanguageManager.TranslatePage(document) ;
}
 
function InsertSmiley( url )
{
var oImg = oEditor.FCK.CreateElement( 'IMG' ) ;
oImg.src = url ;
oImg.setAttribute( '_fcksavedurl', url ) ;
// For long smileys list, it seams that IE continues loading the images in
// the background when you quickly select one image. so, let's clear
// everything before closing.
document.body.innerHTML = '' ;
 
window.parent.Cancel() ;
}
 
function over(td)
{
td.className = 'LightBackground Hand' ;
}
 
function out(td)
{
td.className = 'DarkBackground Hand' ;
}
</script>
</head>
<body scroll="no">
<table cellpadding="2" cellspacing="2" align="center" border="0" width="100%" height="100%">
<script type="text/javascript">
 
var FCKConfig = oEditor.FCKConfig ;
 
var sBasePath = FCKConfig.SmileyPath ;
var aImages = FCKConfig.SmileyImages ;
var iCols = FCKConfig.SmileyColumns ;
var iColWidth = parseInt( 100 / iCols ) ;
 
var i = 0 ;
while (i < aImages.length)
{
document.write( '<tr>' ) ;
for(var j = 0 ; j < iCols ; j++)
{
if (aImages[i])
{
var sUrl = sBasePath + aImages[i] ;
document.write( '<td width="' + iColWidth + '%" align="center" class="DarkBackground Hand" onclick="InsertSmiley(\'' + sUrl.replace(/'/g, "\\'" ) + '\')" onmouseover="over(this)" onmouseout="out(this)">' ) ;
document.write( '<img src="' + sUrl + '" border="0" />' ) ;
}
else
document.write( '<td width="' + iColWidth + '%" class="DarkBackground">&nbsp;' ) ;
document.write( '<\/td>' ) ;
i++ ;
}
document.write('<\/tr>') ;
}
 
</script>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/common/fck_dialog_common.js
New file
0,0 → 1,148
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_dialog_common.js
* Useful functions used by almost all dialog window pages.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
// Gets a element by its Id. Used for shorter coding.
function GetE( elementId )
{
return document.getElementById( elementId ) ;
}
 
function ShowE( element, isVisible )
{
if ( typeof( element ) == 'string' )
element = GetE( element ) ;
element.style.display = isVisible ? '' : 'none' ;
}
 
function SetAttribute( element, attName, attValue )
{
if ( attValue == null || attValue.length == 0 )
element.removeAttribute( attName, 0 ) ; // 0 : Case Insensitive
else
element.setAttribute( attName, attValue, 0 ) ; // 0 : Case Insensitive
}
 
function GetAttribute( element, attName, valueIfNull )
{
var oAtt = element.attributes[attName] ;
 
if ( oAtt == null || !oAtt.specified )
return valueIfNull ? valueIfNull : '' ;
 
var oValue ;
if ( !( oValue = element.getAttribute( attName, 2 ) ) )
oValue = oAtt.nodeValue ;
 
return ( oValue == null ? valueIfNull : oValue ) ;
}
 
// Functions used by text fiels to accept numbers only.
function IsDigit( e )
{
if ( !e )
e = event ;
 
var iCode = ( e.keyCode || e.charCode ) ;
return (
( iCode >= 48 && iCode <= 57 ) // Numbers
|| (iCode >= 37 && iCode <= 40) // Arrows
|| iCode == 8 // Backspace
|| iCode == 46 // Delete
) ;
}
 
String.prototype.trim = function()
{
return this.replace( /(^\s*)|(\s*$)/g, '' ) ;
}
 
String.prototype.startsWith = function( value )
{
return ( this.substr( 0, value.length ) == value ) ;
}
 
String.prototype.remove = function( start, length )
{
var s = '' ;
 
if ( start > 0 )
s = this.substring( 0, start ) ;
 
if ( start + length < this.length )
s += this.substring( start + length , this.length ) ;
 
return s ;
}
 
String.prototype.ReplaceAll = function( searchArray, replaceArray )
{
var replaced = this ;
for ( var i = 0 ; i < searchArray.length ; i++ )
{
replaced = replaced.replace( searchArray[i], replaceArray[i] ) ;
}
return replaced ;
}
 
function OpenFileBrowser( url, width, height )
{
// oEditor must be defined.
var iLeft = ( oEditor.FCKConfig.ScreenWidth - width ) / 2 ;
var iTop = ( oEditor.FCKConfig.ScreenHeight - height ) / 2 ;
 
var sOptions = "toolbar=no,status=no,resizable=yes,dependent=yes,scrollbars=yes" ;
sOptions += ",width=" + width ;
sOptions += ",height=" + height ;
sOptions += ",left=" + iLeft ;
sOptions += ",top=" + iTop ;
 
// The "PreserveSessionOnFileBrowser" because the above code could be
// blocked by popup blockers.
if ( oEditor.FCKConfig.PreserveSessionOnFileBrowser && oEditor.FCKBrowserInfo.IsIE )
{
// The following change has been made otherwise IE will open the file
// browser on a different server session (on some cases):
// http://support.microsoft.com/default.aspx?scid=kb;en-us;831678
// by Simone Chiaretta.
var oWindow = oEditor.window.open( url, 'FCKBrowseWindow', sOptions ) ;
if ( oWindow )
{
// Detect Yahoo popup blocker.
try
{
var sTest = oWindow.name ; // Yahoo returns "something", but we can't access it, so detect that and avoid strange errors for the user.
oWindow.opener = window ;
}
catch(e)
{
alert( oEditor.FCKLang.BrowseServerBlocked ) ;
}
}
else
alert( oEditor.FCKLang.BrowseServerBlocked ) ;
}
else
window.open( url, 'FCKBrowseWindow', sOptions ) ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/common/images/reset.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/common/images/reset.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/common/images/unlocked.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/common/images/unlocked.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/common/images/locked.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/common/images/locked.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/common/fcknumericfield.htc
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/common/fcknumericfield.htc
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/common/moz-bindings.xml
New file
0,0 → 1,30
<?xml version="1.0" encoding="utf-8" ?>
<bindings xmlns="http://www.mozilla.org/xbl">
<binding id="numericfield">
<implementation>
<constructor>
this.keypress = CheckIsDigit ;
</constructor>
<method name="CheckIsDigit">
<body>
<![CDATA[
var iCode = keyCode ;
 
var bAccepted =
(
( iCode >= 48 && iCode <= 57 ) // Numbers
|| (iCode >= 37 && iCode <= 40) // Arrows
|| iCode == 8 // Backspace
|| iCode == 46 // Delete
) ;
 
return bAccepted ;
]]>
</body>
</method>
</implementation>
<events>
<event type="keypress" value="CheckIsDigit()" />
</events>
</binding>
</bindings>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/common/fck_dialog_common.css
New file
0,0 → 1,79
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_dialog_common.css
* This is the CSS file used for interface details in some dialog
* windows.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
.ImagePreviewArea
{
border: #000000 1px solid;
overflow: auto;
width: 100%;
height: 170px;
background-color: #ffffff;
}
 
.FlashPreviewArea
{
border: #000000 1px solid;
padding: 5px;
overflow: auto;
width: 100%;
height: 170px;
background-color: #ffffff;
}
 
.BtnReset
{
float: left;
background-position: center center;
background-image: url(images/reset.gif);
width: 16px;
height: 16px;
background-repeat: no-repeat;
border: 1px none;
font-size: 1px ;
}
 
.BtnLocked, .BtnUnlocked
{
float: left;
background-position: center center;
background-image: url(images/locked.gif);
width: 16px;
height: 16px;
background-repeat: no-repeat;
border: none 1px;
font-size: 1px ;
}
 
.BtnUnlocked
{
background-image: url(images/unlocked.gif);
}
 
.BtnOver
{
border: outset 1px;
cursor: pointer;
cursor: hand;
}
 
.FCK__FieldNumeric
{
behavior: url(common/fcknumericfield.htc) ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_template/images/template1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_template/images/template1.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_template/images/template2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_template/images/template2.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_template/images/template3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_template/images/template3.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_select/fck_select.js
New file
0,0 → 1,165
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_select.js
* Scripts for the fck_select.html page.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
function Select( combo )
{
var iIndex = combo.selectedIndex ;
 
oListText.selectedIndex = iIndex ;
oListValue.selectedIndex = iIndex ;
 
var oTxtText = document.getElementById( "txtText" ) ;
var oTxtValue = document.getElementById( "txtValue" ) ;
 
oTxtText.value = oListText.value ;
oTxtValue.value = oListValue.value ;
}
 
function Add()
{
var oTxtText = document.getElementById( "txtText" ) ;
var oTxtValue = document.getElementById( "txtValue" ) ;
 
AddComboOption( oListText, oTxtText.value, oTxtText.value ) ;
AddComboOption( oListValue, oTxtValue.value, oTxtValue.value ) ;
 
oListText.selectedIndex = oListText.options.length - 1 ;
oListValue.selectedIndex = oListValue.options.length - 1 ;
 
oTxtText.value = '' ;
oTxtValue.value = '' ;
 
oTxtText.focus() ;
}
 
function Modify()
{
var iIndex = oListText.selectedIndex ;
 
if ( iIndex < 0 ) return ;
 
var oTxtText = document.getElementById( "txtText" ) ;
var oTxtValue = document.getElementById( "txtValue" ) ;
 
oListText.options[ iIndex ].innerHTML = oTxtText.value ;
oListText.options[ iIndex ].value = oTxtText.value ;
 
oListValue.options[ iIndex ].innerHTML = oTxtValue.value ;
oListValue.options[ iIndex ].value = oTxtValue.value ;
 
oTxtText.value = '' ;
oTxtValue.value = '' ;
 
oTxtText.focus() ;
}
 
function Move( steps )
{
ChangeOptionPosition( oListText, steps ) ;
ChangeOptionPosition( oListValue, steps ) ;
}
 
function Delete()
{
RemoveSelectedOptions( oListText ) ;
RemoveSelectedOptions( oListValue ) ;
}
 
function SetSelectedValue()
{
var iIndex = oListValue.selectedIndex ;
if ( iIndex < 0 ) return ;
 
var oTxtValue = document.getElementById( "txtSelValue" ) ;
 
oTxtValue.value = oListValue.options[ iIndex ].value ;
}
 
// Moves the selected option by a number of steps (also negative)
function ChangeOptionPosition( combo, steps )
{
var iActualIndex = combo.selectedIndex ;
 
if ( iActualIndex < 0 )
return ;
 
var iFinalIndex = iActualIndex + steps ;
 
if ( iFinalIndex < 0 )
iFinalIndex = 0 ;
 
if ( iFinalIndex > ( combo.options.length - 1 ) )
iFinalIndex = combo.options.length - 1 ;
 
if ( iActualIndex == iFinalIndex )
return ;
 
var oOption = combo.options[ iActualIndex ] ;
var sText = oOption.innerHTML ;
var sValue = oOption.value ;
 
combo.remove( iActualIndex ) ;
 
oOption = AddComboOption( combo, sText, sValue, null, iFinalIndex ) ;
 
oOption.selected = true ;
}
 
// Remove all selected options from a SELECT object
function RemoveSelectedOptions(combo)
{
// Save the selected index
var iSelectedIndex = combo.selectedIndex ;
 
var oOptions = combo.options ;
 
// Remove all selected options
for ( var i = oOptions.length - 1 ; i >= 0 ; i-- )
{
if (oOptions[i].selected) combo.remove(i) ;
}
 
// Reset the selection based on the original selected index
if ( combo.options.length > 0 )
{
if ( iSelectedIndex >= combo.options.length ) iSelectedIndex = combo.options.length - 1 ;
combo.selectedIndex = iSelectedIndex ;
}
}
 
// Add a new option to a SELECT object (combo or list)
function AddComboOption( combo, optionText, optionValue, documentObject, index )
{
var oOption ;
 
if ( documentObject )
oOption = documentObject.createElement("OPTION") ;
else
oOption = document.createElement("OPTION") ;
 
if ( index != null )
combo.options.add( oOption, index ) ;
else
combo.options.add( oOption ) ;
 
oOption.innerHTML = optionText.length > 0 ? optionText : '&nbsp;' ;
oOption.value = optionValue ;
 
return oOption ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_listprop.html
New file
0,0 → 1,113
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_listprop.html
* Bulleted List dialog window.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
* Marcel J Bennett (start attribute)
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta content="noindex, nofollow" name="robots" />
<script src="common/fck_dialog_common.js" type="text/javascript"></script>
<script type="text/javascript">
 
var oEditor = window.parent.InnerDialogLoaded() ;
 
// Gets the document DOM
var oDOM = oEditor.FCK.EditorDocument ;
 
var oActiveEl = oEditor.FCKSelection.MoveToAncestorNode( 'UL' ) ;
var oActiveSel ;
 
window.onload = function()
{
// First of all, translate the dialog box texts
oEditor.FCKLanguageManager.TranslatePage(document) ;
 
if ( oActiveEl )
oActiveSel = GetE('selBulleted') ;
else
{
oActiveEl = oEditor.FCKSelection.MoveToAncestorNode( 'OL' ) ;
if ( oActiveEl )
{
oActiveSel = GetE('selNumbered') ;
GetE('eStart').style.display = '' ;
GetE('txtStartPosition').value = GetAttribute( oActiveEl, 'start' ) ;
}
}
 
oActiveSel.style.display = '' ;
 
if ( oActiveEl )
{
if ( oActiveEl.getAttribute('type') )
oActiveSel.value = oActiveEl.getAttribute('type').toLowerCase() ;
}
 
window.parent.SetOkButton( true ) ;
}
 
function Ok()
{
if ( oActiveEl ){
SetAttribute( oActiveEl, 'type' , oActiveSel.value ) ;
if(oActiveEl.tagName == 'OL')
SetAttribute( oActiveEl, 'start', GetE('txtStartPosition').value ) ;
}
 
return true ;
}
 
</script>
</head>
<body style="overflow: hidden">
<table width="100%" style="height: 100%">
<tr>
<td style="text-align:center">
<table cellspacing="0" cellpadding="0" border="0" style="margin-left: auto; margin-right: auto;">
<tr>
<td id="eStart" style="display: none; padding-right: 5px; padding-left: 5px">
<span fcklang="DlgLstStart">Start</span><br />
<input type="text" id="txtStartPosition" size="5" />
</td>
<td style="padding-right: 5px; padding-left: 5px">
<span fcklang="DlgLstType">List Type</span><br />
<select id="selBulleted" style="display: none">
<option value="" selected="selected"></option>
<option value="circle" fcklang="DlgLstTypeCircle">Circle</option>
<option value="disc" fcklang="DlgLstTypeDisc">Disc</option>
<option value="square" fcklang="DlgLstTypeSquare">Square</option>
</select>
<select id="selNumbered" style="display: none">
<option value="" selected="selected"></option>
<option value="1" fcklang="DlgLstTypeNumbers">Numbers (1, 2, 3)</option>
<option value="a" fcklang="DlgLstTypeLCase">Lowercase Letters (a, b, c)</option>
<option value="A" fcklang="DlgLstTypeUCase">Uppercase Letters (A, B, C)</option>
<option value="i" fcklang="DlgLstTypeSRoman">Small Roman Numerals (i, ii, iii)</option>
<option value="I" fcklang="DlgLstTypeLRoman">Large Roman Numerals (I, II, III)</option>
</select>
&nbsp;
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_textarea.html
New file
0,0 → 1,90
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_textarea.html
* Text Area dialog window.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<html>
<head>
<title>Text Area Properties</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta content="noindex, nofollow" name="robots">
<script src="common/fck_dialog_common.js" type="text/javascript"></script>
<script type="text/javascript">
 
var oEditor = window.parent.InnerDialogLoaded() ;
 
// Gets the document DOM
var oDOM = oEditor.FCK.EditorDocument ;
 
var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
 
window.onload = function()
{
// First of all, translate the dialog box texts
oEditor.FCKLanguageManager.TranslatePage(document) ;
 
if ( oActiveEl && oActiveEl.tagName == 'TEXTAREA' )
{
GetE('txtName').value = oActiveEl.name ;
GetE('txtCols').value = GetAttribute( oActiveEl, 'cols' ) ;
GetE('txtRows').value = GetAttribute( oActiveEl, 'rows' ) ;
}
else
oActiveEl = null ;
 
window.parent.SetOkButton( true ) ;
}
 
function Ok()
{
if ( !oActiveEl )
{
oActiveEl = oEditor.FCK.EditorDocument.createElement( 'TEXTAREA' ) ;
oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ;
}
 
oActiveEl.name = GetE('txtName').value ;
SetAttribute( oActiveEl, 'cols', GetE('txtCols').value ) ;
SetAttribute( oActiveEl, 'rows', GetE('txtRows').value ) ;
 
return true ;
}
 
</script>
</head>
<body style='OVERFLOW: hidden' scroll='no'>
<table height="100%" width="100%">
<tr>
<td align="center">
<table border="0" cellpadding="0" cellspacing="0" width="80%">
<tr>
<td>
<span fckLang="DlgTextareaName">Name</span><br>
<input type="text" id="txtName" style="WIDTH: 100%">
<span fckLang="DlgTextareaCols">Collumns</span><br>
<input id="txtCols" type="text" size="5">
<br>
<span fckLang="DlgTextareaRows">Rows</span><br>
<input id="txtRows" type="text" size="5">
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_universalkey/keyboard_layout.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_universalkey/keyboard_layout.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_universalkey/00.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_universalkey/00.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_universalkey/data.js
New file
0,0 → 1,73
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: data.js
* Scripts for the fck_universalkey.html page.
* Definition des 104 caracteres en hexa unicode.
*
* File Authors:
* Michel Staelens (michel.staelens@wanadoo.fr)
* Abdul-Aziz Al-Oraij (top7up@hotmail.com)
* Bo Brandt (bbr@dynamicweb.dk)
*/
 
var Maj = new Array() ;
var Min = new Array() ;
 
Maj["Arabic"] ="0651|0021|0040|0023|0024|0025|005E|0026|002A|0029|0028|005F|002B|064E|064B|064F|064C|0625|0625|2018|00F7|00D7|061B|003C|003E|0650|064D|005D|005B|0623|0623|0640|060C|002F|003A|0022|007E|0652|007D|007B|0622|0622|2019|002C|002E|061F|007C|0020|0020|0020|0020|0020" ;
Min["Arabic"] ="0630|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002D|003D|0636|0635|062B|0642|0641|063A|0639|0647|062E|062D|062C|062F|0634|0633|064A|0628|0644|0627|062A|0646|0645|0643|0637|0626|0621|0624|0631|0644|0627|0649|0629|0648|0632|0638|005C|0020|0020|0020|0020" ;
Maj["Belarusian (C)"] ="0401|0021|0022|2116|003B|0025|003A|003F|002A|0028|0029|005F|002B|0419|0426|0423|041A|0415|041D|0413|0428|040E|0417|0425|0027|0424|042B|0412|0410|041F|0420|041E|041B|0414|0416|042D|042F|0427|0421|041C|0406|0422|042C|0411|042E|002C|0020|0020|0020|0020|0020|0020" ;
Min["Belarusian (C)"] ="0451|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002D|003D|0439|0446|0443|043A|0435|043D|0433|0448|045E|0437|0445|0027|0444|044B|0432|0430|043F|0440|043E|043B|0434|0436|044D|044F|0447|0441|043C|0456|0442|044C|0431|044E|002E|0020|0020|0020|0020|0020|0020" ;
Maj["Bulgarian (C)"] ="007E|0021|003F|002B|0022|0025|003D|003A|002F|005F|2116|0406|0056|044B|0423|0415|0418|0428|0429|041A|0421|0414|0417|0426|00A7|042C|042F|0410|041E|0416|0413|0422|041D|0412|041C|0427|042E|0419|042A|042D|0424|0425|041F|0420|041B|0411|0029|0020|0020|0020|0020|0020" ;
Min["Bulgarian (C)"] ="0060|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002D|002E|002C|0443|0435|0438|0448|0449|043A|0441|0434|0437|0446|003B|044C|044F|0430|043E|0436|0433|0442|043D|0432|043C|0447|044E|0439|044A|044D|0444|0445|043F|0440|043B|0431|0028|0020|0020|0020|0020|0020" ;
Maj["Croatian (L)"] ="00B8|0021|0022|0023|0024|0025|0026|002F|0028|0029|003D|003F|00A8|0051|0057|0045|0052|0054|005A|0055|0049|004F|0050|0160|0110|0041|0053|0044|0046|0047|0048|004A|004B|004C|010C|0106|0059|0058|0043|0056|0042|004E|004D|017D|003B|003A|003C|003E|005F|002D|002A|002B" ;
Min["Croatian (L)"] ="00B8|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|0027|00A8|0071|0077|0065|0072|0074|007A|0075|0069|006F|0070|0161|0111|0061|0073|0064|0066|0067|0068|006A|006B|006C|010D|0107|0079|0078|0063|0076|0062|006E|006D|017E|002C|002E|003C|003E|005F|002D|002A|002B" ;
Maj["Czech (L)"] ="00B0|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|0025|02C7|0051|0057|0045|0052|0054|005A|0055|0049|004F|0050|002F|0028|0041|0053|0044|0046|0047|0048|004A|004B|004C|0022|0027|0059|0058|0043|0056|0042|004E|004D|003F|003A|005F|005B|007B|0021|0020|0148|010F" ;
Min["Czech (L)"] ="003B|002B|011B|0161|010D|0159|017E|00FD|00E1|00ED|00E9|003D|00B4|0071|0077|0065|0072|0074|007A|0075|0069|006F|0070|00FA|0029|0061|0073|0064|0066|0067|0068|006A|006B|006C|016F|00A7|0079|0078|0063|0076|0062|006E|006D|002C|002E|002D|005D|007D|00A8|0040|00F3|0165" ;
Maj["Danish (L)"] ="00A7|0021|0022|0023|00A4|0025|0026|002F|0028|0029|003D|003F|0060|0051|0057|0045|0052|0054|0059|0055|0049|004F|0050|00C5|005E|0041|0053|0044|0046|0047|0048|004A|004B|004C|00C6|00D8|003E|005A|0058|0043|0056|0042|004E|004D|003B|003A|002A|005F|007B|007D|005C|007E" ;
Min["Danish (L)"] ="00BD|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002B|00B4|0071|0077|0065|0072|0074|0079|0075|0069|006F|0070|00E5|00A8|0061|0073|0064|0066|0067|0068|006A|006B|006C|00E6|00F8|003C|007A|0078|0063|0076|0062|006E|006D|002C|002E|0027|002D|005B|005D|007C|0040" ;
Maj["Diacritical (L)"] ="0060|00B4|005E|00A8|007E|00B0|00B7|00B8|00AF|02D9|02DB|02C7|02D8|0051|0057|0045|0052|0054|005A|0055|0049|004F|0050|00C6|02DD|0041|0053|0044|0046|0047|0048|004A|004B|004C|0141|0152|0059|0058|0043|0056|0042|004E|004D|01A0|01AF|00D8|0126|0110|0132|00DE|00D0|00DF" ;
Min["Diacritical (L)"] ="0060|00B4|005E|00A8|007E|00B0|00B7|00B8|00AF|02D9|02DB|02C7|02D8|0071|0077|0065|0072|0074|007A|0075|0069|006F|0070|00E6|02DD|0061|0073|0064|0066|0067|0068|006A|006B|006C|0142|0153|0079|0078|0063|0076|0062|006E|006D|01A1|01B0|00F8|0127|0111|0133|00FE|00F0|00DF" ;
Maj["Finnish (L)"] ="00A7|0021|0022|0023|00A4|0025|0026|002F|0028|0029|003D|003F|0060|0051|0057|0045|0052|0054|0059|0055|0049|004F|0050|00C5|005E|0041|0053|0044|0046|0047|0048|004A|004B|004C|00D6|00C4|003E|005A|0058|0043|0056|0042|004E|004D|003B|003A|002A|005F|007B|007D|005C|007E" ;
Min["Finnish (L)"] ="00BD|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002B|00B4|0071|0077|0065|0072|0074|0079|0075|0069|006F|0070|00E5|00A8|0061|0073|0064|0066|0067|0068|006A|006B|006C|00F6|00E4|003C|007A|0078|0063|0076|0062|006E|006D|002C|002E|0027|002D|005B|005D|007C|0040" ;
Maj["French (L)"] ="0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|00B0|002B|0023|0041|005A|0045|0052|0054|0059|0055|0049|004F|0050|00A8|0025|0051|0053|0044|0046|0047|0048|004A|004B|004C|004D|00B5|0057|0058|0043|0056|0042|004E|003F|002E|002F|00A7|003C|005B|007B|00A3|007E|0020" ;
Min["French (L)"] ="0026|00E9|0022|0027|0028|002D|00E8|005F|00E7|00E0|0029|003D|0040|0061|007A|0065|0072|0074|0079|0075|0069|006F|0070|005E|00F9|0071|0073|0064|0066|0067|0068|006A|006B|006C|006D|002A|0077|0078|0063|0076|0062|006E|002C|003B|003A|0021|003E|005D|007D|0024|007E|0020" ;
Maj["Greek"] ="007E|0021|0040|0023|0024|0025|0390|0026|03B0|0028|0029|005F|002B|003A|03A3|0395|03A1|03A4|03A5|0398|0399|039F|03A0|0386|038F|0391|03A3|0394|03A6|0393|0397|039E|039A|039B|038C|0022|0396|03A7|03A8|03A9|0392|039D|039C|003C|003E|003F|0388|0389|038A|03AA|03AB|038E" ;
Min["Greek"] ="0060|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002D|003D|003B|03C2|03B5|03C1|03C4|03C5|03B8|03B9|03BF|03C0|03AC|03CE|03B1|03C3|03B4|03C6|03B3|03B7|03BE|03BA|03BB|03CC|0027|03B6|03C7|03C8|03C9|03B2|03BD|03BC|002C|002E|002F|03AD|03AE|03AF|03CA|03CB|03CD" ;
Maj["Hebrew"] ="007E|0021|0040|0023|0024|0025|005E|0026|002A|0028|0029|005F|002B|0051|0057|0045|0052|0054|0059|0055|0049|004F|0050|007B|007D|0041|0053|0044|0046|0047|0048|004A|004B|004C|003A|0022|005A|0058|0043|0056|0042|004E|004D|003C|003E|003F|0020|0020|0020|0020|0020|0020" ;
Min["Hebrew"] ="0060|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002D|003D|002F|0027|05E7|05E8|05D0|05D8|05D5|05DF|05DD|05E4|005B|005D|05E9|05D3|05D2|05DB|05E2|05D9|05D7|05DC|05DA|05E3|002C|05D6|05E1|05D1|05D4|05E0|05DE|05E6|05EA|05E5|002E|0020|0020|0020|0020|0020|0020" ;
Maj["Hungarian (L)"] ="00A7|0027|0022|002B|0021|0025|002F|003D|0028|0029|00ED|00DC|00D3|0051|0057|0045|0052|0054|005A|0055|0049|004F|0050|0150|00DA|0041|0053|0044|0046|0047|0048|004A|004B|004C|00C9|00C1|0170|00CD|0059|0058|0043|0056|0042|004E|004D|003F|002E|003A|002D|005F|007B|007D" ;
Min["Hungarian (L)"] ="0030|0031|0032|0033|0034|0035|0036|0037|0038|0039|00F6|00FC|00F3|0071|0077|0065|0072|0074|007A|0075|0069|006F|0070|0151|00FA|0061|0073|0064|0066|0067|0068|006A|006B|006C|00E9|00E1|0171|00ED|0079|0078|0063|0076|0062|006E|006D|002C|002E|003A|002D|005F|007B|007D" ;
Maj["Macedonian (C)"] ="007E|0021|201E|201C|2019|0025|2018|0026|002A|0028|0029|005F|002B|0409|040A|0415|0420|0422|0405|0423|0418|041E|041F|0428|0403|0410|0421|0414|0424|0413|0425|0408|041A|041B|0427|040C|0401|0417|040F|0426|0412|0411|041D|041C|0416|003B|003A|003F|002A|005F|007B|007D" ;
Min["Macedonian (C)"] ="0060|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002D|003D|0459|045A|0435|0440|0442|0455|0443|0438|043E|043F|0448|0453|0430|0441|0434|0444|0433|0445|0458|043A|043B|0447|045C|0451|0437|045F|0446|0432|0431|043D|043C|0436|002C|002E|002F|0027|002D|005B|005D" ;
Maj["Norwegian (L)"] ="00A7|0021|0022|0023|00A4|0025|0026|002F|0028|0029|003D|003F|0060|0051|0057|0045|0052|0054|0059|0055|0049|004F|0050|00C5|005E|0041|0053|0044|0046|0047|0048|004A|004B|00D8|00C6|00C4|003E|005A|0058|0043|0056|0042|004E|004D|003B|003A|002A|005F|007B|007D|005C|007E" ;
Min["Norwegian (L)"] ="00BD|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002B|00B4|0071|0077|0065|0072|0074|0079|0075|0069|006F|0070|00E5|00A8|0061|0073|0064|0066|0067|0068|006A|006B|00F8|00E6|00E4|003C|007A|0078|0063|0076|0062|006E|006D|002C|002E|0027|002D|005B|005D|007C|0040" ;
Maj["Persian"] ="200D|0021|066C|066B|FDFC|066A|00D7|060C|002A|0029|0028|0640|002B|0652|064C|064D|064B|064F|0650|064E|0651|005D|005B|007D|007B|0624|0626|064A|0625|0623|0622|0629|00BB|00AB|003A|061B|0643|0020|0698|0670|200C|0654|0621|003E|003C|061F|007C|0020|0020|0020|0020|0020" ;
Min["Persian"] ="200D|06F1|06F2|06F3|06F4|06F5|06F6|06F7|06F8|06F9|06F0|002D|003D|0636|0635|062B|0642|0641|063A|0639|0647|062E|062D|062C|0686|0634|0633|06CC|0628|0644|0627|062A|0646|0645|06A9|06AF|0638|0637|0632|0631|0630|062F|067E|0648|002E|002F|005C|0020|0020|0020|0020|0020" ;
Maj["Polish (L)"] ="002A|0021|0022|0023|00A4|0025|0026|002F|0028|0029|003D|003F|017A|0051|0057|0045|0052|0054|005A|0055|0049|004F|0050|0144|0107|0041|0053|0044|0046|0047|0048|004A|004B|004C|0141|0119|0059|0058|0043|0056|0042|004E|004D|003B|003A|005F|003C|005B|007B|02D9|00B4|02DB" ;
Min["Polish (L)"] ="0027|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002B|00F3|0071|0077|0065|0072|0074|007A|0075|0069|006F|0070|017C|015B|0061|0073|0064|0066|0067|0068|006A|006B|006C|0142|0105|0079|0078|0063|0076|0062|006E|006D|002C|002E|002D|003E|005D|007D|02D9|00B4|02DB" ;
Maj["Portuguese (L)"] ="007C|0021|0022|0023|0024|0025|0026|002F|0028|0029|003D|003F|00BB|0051|0057|0045|0052|0054|0059|0055|0049|004F|0050|002A|0060|0041|0053|0044|0046|0047|0048|004A|004B|004C|00C7|00AA|003E|005A|0058|0043|0056|0042|004E|004D|003B|003A|005E|007B|007D|00A7|20AC|005F" ;
Min["Portuguese (L)"] ="005C|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|0027|00AB|0071|0077|0065|0072|0074|0079|0075|0069|006F|0070|002B|00B4|0061|0073|0064|0066|0067|0068|006A|006B|006C|00E7|00BA|003C|007A|0078|0063|0076|0062|006E|006D|002C|002E|007E|005B|005D|00A8|0040|002D" ;
Maj["Russian (C)"] ="0401|0021|0040|0023|2116|0025|005E|0026|002A|0028|0029|005F|002B|0419|0426|0423|041A|0415|041D|0413|0428|0429|0417|0425|042A|0424|042B|0412|0410|041F|0420|041E|041B|0414|0416|042D|042F|0427|0421|041C|0418|0422|042C|0411|042E|003E|002E|003A|0022|005B|005D|003F" ;
Min["Russian (C)"] ="0451|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002D|003D|0439|0446|0443|043A|0435|043D|0433|0448|0449|0437|0445|044A|0444|044B|0432|0430|043F|0440|043E|043B|0434|0436|044D|044F|0447|0441|043C|0438|0442|044C|0431|044E|003C|002C|003B|0027|007B|007D|002F" ;
Maj["Serbian (C)"] ="007E|0021|0022|0023|0024|0025|0026|002F|0028|0029|003D|003F|002A|0409|040A|0415|0420|0422|0417|0423|0418|041E|041F|0428|0402|0410|0421|0414|0424|0413|0425|0408|041A|041B|0427|040B|003E|0405|040F|0426|0412|0411|041D|041C|0416|003A|005F|002E|003A|0022|005B|005D" ;
Min["Serbian (C)"] ="0060|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|0027|002B|0459|045A|0435|0440|0442|0437|0443|0438|043E|043F|0448|0452|0430|0441|0434|0444|0433|0445|0458|043A|043B|0447|045B|003C|0455|045F|0446|0432|0431|043D|043C|0436|002E|002D|002C|003B|0027|007B|007D" ;
Maj["Serbian (L)"] ="007E|0021|0022|0023|0024|0025|0026|002F|0028|0029|003D|003F|002A|0051|0057|0045|0052|0054|005A|0055|0049|004F|0050|0160|0110|0041|0053|0044|0046|0047|0048|004A|004B|004C|010C|0106|003E|0059|0058|0043|0056|0042|004E|004D|017D|003A|005F|002E|003A|0022|005B|005D" ;
Min["Serbian (L)"] ="201A|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|0027|002B|0071|0077|0065|0072|0074|007A|0075|0069|006F|0070|0161|0111|0061|0073|0064|0066|0067|0068|006A|006B|006C|010D|0107|003C|0079|0078|0063|0076|0062|006E|006D|017E|002E|002D|002C|003B|0027|007B|007D" ;
Maj["Slovak (L)"] ="00B0|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|0025|02C7|0051|0057|0045|0052|0054|005A|0055|0049|004F|0050|002F|0028|0041|0053|0044|0046|0047|0048|004A|004B|004C|0022|0021|0059|0058|0043|0056|0042|004E|004D|003F|003A|005F|003C|005B|010F|0029|002A|0020" ;
Min["Slovak (L)"] ="003B|002B|013E|0161|010D|0165|017E|00FD|00E1|00ED|00E9|003D|00B4|0071|0077|0065|0072|0074|007A|0075|0069|006F|0070|00FA|00E4|0061|0073|0064|0066|0067|0068|006A|006B|006C|00F4|00A7|0079|0078|0063|0076|0062|006E|006D|002C|002E|002D|003E|005D|00F3|0148|0026|0020" ;
Maj["Spanish (L)"] ="00AA|0021|0022|00B7|0024|0025|0026|002F|0028|0029|003D|003F|00BF|0051|0057|0045|0052|0054|0059|0055|0049|004F|0050|005E|00A8|0041|0053|0044|0046|0047|0048|004A|004B|004C|00D1|00C7|005A|0058|0043|0056|0042|004E|004D|003B|003A|005F|003E|007C|0040|0023|007E|002A" ;
Min["Spanish (L)"] ="00BA|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|0027|00A1|0071|0077|0065|0072|0074|0079|0075|0069|006F|0070|0060|00B4|0061|0073|0064|0066|0067|0068|006A|006B|006C|00F1|00E7|007A|0078|0063|0076|0062|006E|006D|002C|002E|002D|003C|005C|0040|0023|007E|002B" ;
Maj["Ukrainian (C)"] ="0401|0021|0040|0023|2116|0025|005E|0026|002A|0028|0029|005F|002B|0419|0426|0423|041A|0415|041D|0413|0428|0429|0417|0425|0407|0424|0406|0412|0410|041F|0420|041E|041B|0414|0416|0404|0490|042F|0427|0421|041C|0418|0422|042C|0411|042E|002E|003A|0022|003C|003E|003F" ;
Min["Ukrainian (C)"] ="0451|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002D|003D|0439|0446|0443|043A|0435|043D|0433|0448|0449|0437|0445|0457|0444|0456|0432|0430|043F|0440|043E|043B|0434|0436|0454|0491|044F|0447|0441|043C|0438|0442|044C|0431|044E|002C|003B|0027|007B|007D|002F" ;
Maj["Vietnamese (L)"] ="007E|0021|0040|0023|0024|0025|005E|0026|002A|0028|0029|005F|002B|0051|0057|0045|0052|0054|0059|0055|0049|004F|0050|01AF|01A0|0041|0053|0044|0046|0047|0048|004A|004B|004C|0102|00C2|005A|0058|0043|0056|0042|004E|004D|00CA|00D4|0110|003C|003E|003F|007D|003A|0022" ;
Min["Vietnamese (L)"] ="20AB|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002D|003D|0071|0077|0065|0072|0074|0079|0075|0069|006F|0070|01B0|01A1|0061|0073|0064|0066|0067|0068|006A|006B|006C|0103|00E2|007A|0078|0063|0076|0062|006E|006D|00EA|00F4|0111|002C|002E|002F|007B|003B|0027" ;
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_universalkey/dialogue.js
New file
0,0 → 1,31
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: dialogue.js
* Scripts for the fck_universalkey.html page.
*
* File Authors:
* Michel Staelens (michel.staelens@wanadoo.fr)
* Bernadette Cierzniak
* Abdul-Aziz Al-Oraij (top7up@hotmail.com)
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
function afficher(txt)
{
document.getElementById( 'uni_area' ).value = txt ;
}
 
function rechercher()
{
return document.getElementById( 'uni_area' ).value ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_universalkey/diacritic.js
New file
0,0 → 1,65
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: diacritic.js
* Scripts for the fck_universalkey.html page.
*
* File Authors:
* Michel Staelens (michel.staelens@wanadoo.fr)
* Abdul-Aziz Al-Oraij (top7up@hotmail.com)
*/
 
var dia = new Array()
 
dia["0060"]=new Array();dia["00B4"]=new Array();dia["005E"]=new Array();dia["00A8"]=new Array();dia["007E"]=new Array();dia["00B0"]=new Array();dia["00B7"]=new Array();dia["00B8"]=new Array();dia["00AF"]=new Array();dia["02D9"]=new Array();dia["02DB"]=new Array();dia["02C7"]=new Array();dia["02D8"]=new Array();dia["02DD"]=new Array();dia["031B"]=new Array();
dia["0060"]["0061"]="00E0";dia["00B4"]["0061"]="00E1";dia["005E"]["0061"]="00E2";dia["00A8"]["0061"]="00E4";dia["007E"]["0061"]="00E3";dia["00B0"]["0061"]="00E5";dia["00AF"]["0061"]="0101";dia["02DB"]["0061"]="0105";dia["02D8"]["0061"]="0103";
dia["00B4"]["0063"]="0107";dia["005E"]["0063"]="0109";dia["00B8"]["0063"]="00E7";dia["02D9"]["0063"]="010B";dia["02C7"]["0063"]="010D";
dia["02C7"]["0064"]="010F";
dia["0060"]["0065"]="00E8";dia["00B4"]["0065"]="00E9";dia["005E"]["0065"]="00EA";dia["00A8"]["0065"]="00EB";dia["00AF"]["0065"]="0113";dia["02D9"]["0065"]="0117";dia["02DB"]["0065"]="0119";dia["02C7"]["0065"]="011B";dia["02D8"]["0065"]="0115";
dia["005E"]["0067"]="011D";dia["00B8"]["0067"]="0123";dia["02D9"]["0067"]="0121";dia["02D8"]["0067"]="011F";
dia["005E"]["0068"]="0125";
dia["0060"]["0069"]="00EC";dia["00B4"]["0069"]="00ED";dia["005E"]["0069"]="00EE";dia["00A8"]["0069"]="00EF";dia["007E"]["0069"]="0129";dia["00AF"]["0069"]="012B";dia["02DB"]["0069"]="012F";dia["02D8"]["0069"]="012D";
dia["005E"]["006A"]="0135";
dia["00B8"]["006B"]="0137";
dia["00B4"]["006C"]="013A";dia["00B7"]["006C"]="0140";dia["00B8"]["006C"]="013C";dia["02C7"]["006C"]="013E";
dia["00B4"]["006E"]="0144";dia["007E"]["006E"]="00F1";dia["00B8"]["006E"]="0146";dia["02D8"]["006E"]="0148";
dia["0060"]["006F"]="00F2";dia["00B4"]["006F"]="00F3";dia["005E"]["006F"]="00F4";dia["00A8"]["006F"]="00F6";dia["007E"]["006F"]="00F5";dia["00AF"]["006F"]="014D";dia["02D8"]["006F"]="014F";dia["02DD"]["006F"]="0151";dia["031B"]["006F"]="01A1";
dia["00B4"]["0072"]="0155";dia["00B8"]["0072"]="0157";dia["02C7"]["0072"]="0159";
dia["00B4"]["0073"]="015B";dia["005E"]["0073"]="015D";dia["00B8"]["0073"]="015F";dia["02C7"]["0073"]="0161";
dia["00B8"]["0074"]="0163";dia["02C7"]["0074"]="0165";
dia["0060"]["0075"]="00F9";dia["00B4"]["0075"]="00FA";dia["005E"]["0075"]="00FB";dia["00A8"]["0075"]="00FC";dia["007E"]["0075"]="0169";dia["00B0"]["0075"]="016F";dia["00AF"]["0075"]="016B";dia["02DB"]["0075"]="0173";dia["02D8"]["0075"]="016D";dia["02DD"]["0075"]="0171";dia["031B"]["0075"]="01B0";
dia["005E"]["0077"]="0175";
dia["00B4"]["0079"]="00FD";dia["005E"]["0079"]="0177";dia["00A8"]["0079"]="00FF";
dia["00B4"]["007A"]="017A";dia["02D9"]["007A"]="017C";dia["02C7"]["007A"]="017E";
dia["00B4"]["00E6"]="01FD";
dia["00B4"]["00F8"]="01FF";
dia["0060"]["0041"]="00C0";dia["00B4"]["0041"]="00C1";dia["005E"]["0041"]="00C2";dia["00A8"]["0041"]="00C4";dia["007E"]["0041"]="00C3";dia["00B0"]["0041"]="00C5";dia["00AF"]["0041"]="0100";dia["02DB"]["0041"]="0104";dia["02D8"]["0041"]="0102";
dia["00B4"]["0043"]="0106";dia["005E"]["0043"]="0108";dia["00B8"]["0043"]="00C7";dia["02D9"]["0043"]="010A";dia["02C7"]["0043"]="010C";
dia["02C7"]["0044"]="010E";
dia["0060"]["0045"]="00C8";dia["00B4"]["0045"]="00C9";dia["005E"]["0045"]="00CA";dia["00A8"]["0045"]="00CB";dia["00AF"]["0045"]="0112";dia["02D9"]["0045"]="0116";dia["02DB"]["0045"]="0118";dia["02C7"]["0045"]="011A";dia["02D8"]["0045"]="0114";
dia["005E"]["0047"]="011C";dia["00B8"]["0047"]="0122";dia["02D9"]["0047"]="0120";dia["02D8"]["0047"]="011E";
dia["005E"]["0048"]="0124";
dia["0060"]["0049"]="00CC";dia["00B4"]["0049"]="00CD";dia["005E"]["0049"]="00CE";dia["00A8"]["0049"]="00CF";dia["007E"]["0049"]="0128";dia["00AF"]["0049"]="012A";dia["02D9"]["0049"]="0130";dia["02DB"]["0049"]="012E";dia["02D8"]["0049"]="012C";
dia["005E"]["004A"]="0134";
dia["00B8"]["004B"]="0136";
dia["00B4"]["004C"]="0139";dia["00B7"]["004C"]="013F";dia["00B8"]["004C"]="013B";dia["02C7"]["004C"]="013D";
dia["00B4"]["004E"]="0143";dia["007E"]["004E"]="00D1";dia["00B8"]["004E"]="0145";dia["02D8"]["004E"]="0147";
dia["0060"]["004F"]="00D2";dia["00B4"]["004F"]="00D3";dia["005E"]["004F"]="00D4";dia["00A8"]["004F"]="00D6";dia["007E"]["004F"]="00D5";dia["00AF"]["004F"]="014C";dia["02D8"]["004F"]="014E";dia["02DD"]["004F"]="0150";dia["031B"]["004F"]="01A0";
dia["00B4"]["0052"]="0154";dia["00B8"]["0052"]="0156";dia["02C7"]["0052"]="0158";
dia["00B4"]["0053"]="015A";dia["005E"]["0053"]="015C";dia["00B8"]["0053"]="015E";dia["02C7"]["0053"]="0160";
dia["00B8"]["0054"]="0162";dia["02C7"]["0054"]="0164";
dia["0060"]["0055"]="00D9";dia["00B4"]["0055"]="00DA";dia["005E"]["0055"]="00DB";dia["00A8"]["0055"]="00DC";dia["007E"]["0055"]="0168";dia["00B0"]["0055"]="016E";dia["00AF"]["0055"]="016A";dia["02DB"]["0055"]="0172";dia["02D8"]["0055"]="016C";dia["02DD"]["0055"]="0170";dia["031B"]["0055"]="01AF";
dia["005E"]["0057"]="0174";
dia["00B4"]["0059"]="00DD";dia["005E"]["0059"]="0176";dia["00A8"]["0059"]="0178";
dia["00B4"]["005A"]="0179";dia["02D9"]["005A"]="017B";dia["02C7"]["005A"]="017D";
dia["00B4"]["00C6"]="01FC";
dia["00B4"]["00D8"]="01FE";
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_universalkey/fck_universalkey.css
New file
0,0 → 1,62
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_universalkey.css
* CSS styles for the Universal Keyboard.
*
* File Authors:
* Michel Staelens (michel.staelens@wanadoo.fr)
* Bernadette Cierzniak
* Abdul-Aziz Al-Oraij (top7up@hotmail.com)
*/
 
BODY, TEXTAREA, INPUT, TD, SELECT
{
font-family: Tahoma,verdana,arial,sans-serif;
}
DIV
{
position: absolute;
}
.simple
{
font-size: 11pt;
}
.double
{
font-size: 9pt;
}
.simpledia
{
color: red;
font-size: 11pt;
}
.doubledia
{
color: red;
font-size: 9pt;
}
.action
{
color: white;
font-size: 7pt;
}
.clavier
{
color: blue;
font-size: 7pt;
}
.sign
{
color: gray;
font-size: 7pt;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/dialog/fck_universalkey/multihexa.js
New file
0,0 → 1,309
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: multihexa.js
* Scripts for the fck_universalkey.html page.
* Definition des 104 caracteres en hexa unicode.
*
* File Authors:
* Michel Staelens (michel.staelens@wanadoo.fr)
* Bernadette Cierzniak
* Abdul-Aziz Al-Oraij (top7up@hotmail.com)
*/
 
var caps=0, lock=0, hexchars="0123456789ABCDEF", accent="0000", keydeb=0
var key=new Array();j=0;for (i in Maj){key[j]=i;j++}
var ns6=((!document.all)&&(document.getElementById))
var ie=document.all
 
var langue=getCk();
if (langue==""){
langue=key[keydeb]
}
CarMaj=Maj[langue].split("|");CarMin=Min[langue].split("|")
 
/*unikey*/
var posUniKeyLeft=0, posUniKeyTop=0
if (ns6){posUniKeyLeft=0;posUniKeyTop=60}
else if (ie){posUniKeyLeft=0;posUniKeyTop=60}
tracer("fond",posUniKeyLeft,posUniKeyTop,'<img src="fck_universalkey/keyboard_layout.gif" width=404 height=152 border="0"><br />',"sign")
/*touches*/
var posX=new Array(0,28,56,84,112,140,168,196,224,252,280,308,336,42,70,98,126,154,182,210,238,266,294,322,350,50,78,106,134,162,190,218,246,274,302,330,64,92,120,148,176,204,232,260,288,316,28,56,84,294,322,350)
var posY=new Array(14,14,14,14,14,14,14,14,14,14,14,14,14,42,42,42,42,42,42,42,42,42,42,42,42,70,70,70,70,70,70,70,70,70,70,70,98,98,98,98,98,98,98,98,98,98,126,126,126,126,126,126)
var nbTouches=52
for (i=0;i<nbTouches;i++){
CarMaj[i]=((CarMaj[i]!="0000")?(fromhexby4tocar(CarMaj[i])):"")
CarMin[i]=((CarMin[i]!="0000")?(fromhexby4tocar(CarMin[i])):"")
if (CarMaj[i]==CarMin[i].toUpperCase()){
cecar=((lock==0)&&(caps==0)?CarMin[i]:CarMaj[i])
tracer("car"+i,posUniKeyLeft+6+posX[i],posUniKeyTop+3+posY[i],cecar,((dia[hexa(cecar)]!=null)?"simpledia":"simple"))
tracer("majus"+i,posUniKeyLeft+15+posX[i],posUniKeyTop+1+posY[i],"&nbsp;","double")
tracer("minus"+i,posUniKeyLeft+3+posX[i],posUniKeyTop+9+posY[i],"&nbsp;","double")
}
else{
tracer("car"+i,posUniKeyLeft+6+posX[i],posUniKeyTop+3+posY[i],"&nbsp;","simple")
cecar=CarMin[i]
tracer("minus"+i,posUniKeyLeft+3+posX[i],posUniKeyTop+9+posY[i],cecar,((dia[hexa(cecar)]!=null)?"doubledia":"double"))
cecar=CarMaj[i]
tracer("majus"+i,posUniKeyLeft+15+posX[i],posUniKeyTop+1+posY[i],cecar,((dia[hexa(cecar)]!=null)?"doubledia":"double"))
}
}
/*touches de fonctions*/
var actC1=new Array(0,371,364,0,378,0,358,0,344,0,112,378)
var actC2=new Array(0,0,14,42,42,70,70,98,98,126,126,126)
var actC3=new Array(32,403,403,39,403,47,403,61,403,25,291,403)
var actC4=new Array(11,11,39,67,67,95,95,123,123,151,151,151)
var act =new Array(" « KB"," KB » ","Delete","Clear","Back","Caps<br> Lock","Enter","Shift","Shift","<|<","Space",">|>")
var effet=new Array("keyscroll(-3)","keyscroll(3)","faire(\"del\")","RAZ()","faire(\"bck\")","bloq()","faire(\"\\n\")","haut()","haut()","faire(\"ar\")","faire(\" \")","faire(\"av\")")
var nbActions=12
for (i=0;i<nbActions;i++){
tracer("act"+i,posUniKeyLeft+1+actC1[i],posUniKeyTop-1+actC2[i],act[i],"action")
}
/*navigation*/
var keyC1=new Array(35,119,203,287)
var keyC2=new Array(0,0,0,0)
var keyC3=new Array(116,200,284,368)
var keyC4=new Array(11,11,11,11)
for (i=0;i<4;i++){
tracer("key"+i,posUniKeyLeft+5+keyC1[i],posUniKeyTop-1+keyC2[i],key[i],"unikey")
}
/*zones reactives*/
tracer("masque",posUniKeyLeft,posUniKeyTop,'<img src="fck_universalkey/00.gif" width=404 height=152 border="0" usemap="#unikey">')
document.write('<map name="unikey">')
for (i=0;i<nbTouches;i++){
document.write('<area coords="'+posX[i]+','+posY[i]+','+(posX[i]+25)+','+(posY[i]+25)+'" href=# onClick=\'javascript:ecrire('+i+')\'>')
}
for (i=0;i<nbActions;i++){
document.write('<area coords="'+actC1[i]+','+actC2[i]+','+actC3[i]+','+actC4[i]+'" href=# onClick=\'javascript:'+effet[i]+'\'>')
}
for (i=0;i<4;i++){
document.write('<area coords="'+keyC1[i]+','+keyC2[i]+','+keyC3[i]+','+keyC4[i]+'" onclick=\'javascript:charger('+i+')\'>')
}
document.write('</map>')
 
/*fonctions*/
function ecrire(i){
txt=rechercher()+"|";subtxt=txt.split("|")
ceci=(lock==1)?CarMaj[i]:((caps==1)?CarMaj[i]:CarMin[i])
if (test(ceci)){subtxt[0]+=cardia(ceci);distinguer(false)}
else if(dia[accent]!=null&&dia[hexa(ceci)]!=null){distinguer(false);accent=hexa(ceci);distinguer(true)}
else if(dia[accent]!=null){subtxt[0]+=fromhexby4tocar(accent)+ceci;distinguer(false)}
else if(dia[hexa(ceci)]!=null){accent=hexa(ceci);distinguer(true)}
else {subtxt[0]+=ceci}
txt=subtxt[0]+"|"+subtxt[1]
afficher(txt)
if (caps==1){caps=0;MinusMajus()}
}
function faire(ceci){
txt=rechercher()+"|";subtxt=txt.split("|")
l0=subtxt[0].length
l1=subtxt[1].length
c1=subtxt[0].substring(0,(l0-2))
c2=subtxt[0].substring(0,(l0-1))
c3=subtxt[1].substring(0,1)
c4=subtxt[1].substring(0,2)
c5=subtxt[0].substring((l0-2),l0)
c6=subtxt[0].substring((l0-1),l0)
c7=subtxt[1].substring(1,l1)
c8=subtxt[1].substring(2,l1)
if(dia[accent]!=null){if(ceci==" "){ceci=fromhexby4tocar(accent)}distinguer(false)}
switch (ceci){
case("av") :if(escape(c4)!="%0D%0A"){txt=subtxt[0]+c3+"|"+c7}else{txt=subtxt[0]+c4+"|"+c8}break
case("ar") :if(escape(c5)!="%0D%0A"){txt=c2+"|"+c6+subtxt[1]}else{txt=c1+"|"+c5+subtxt[1]}break
case("bck"):if(escape(c5)!="%0D%0A"){txt=c2+"|"+subtxt[1]}else{txt=c1+"|"+subtxt[1]}break
case("del"):if(escape(c4)!="%0D%0A"){txt=subtxt[0]+"|"+c7}else{txt=subtxt[0]+"|"+c8}break
default:txt=subtxt[0]+ceci+"|"+subtxt[1];break
}
afficher(txt)
}
function RAZ(){txt="";if(dia[accent]!=null){distinguer(false)}afficher(txt)}
function haut(){caps=1;MinusMajus()}
function bloq(){lock=(lock==1)?0:1;MinusMajus()}
 
/*fonctions de traitement du unikey*/
function tracer(nom,gauche,haut,ceci,classe){ceci="<span class="+classe+">"+ceci+"</span>";document.write('<div id="'+nom+'" >'+ceci+'</div>');if (ns6){document.getElementById(nom).style.left=gauche+"px";document.getElementById(nom).style.top=haut+"px";}else if (ie){document.all(nom).style.left=gauche;document.all(nom).style.top=haut}}
function retracer(nom,ceci,classe){ceci="<span class="+classe+">"+ceci+"</span>";if (ns6){document.getElementById(nom).innerHTML=ceci}else if (ie){doc=document.all(nom);doc.innerHTML=ceci}}
function keyscroll(n){
keydeb+=n
if (keydeb<0){
keydeb=0
}
if (keydeb>key.length-4){
keydeb=key.length-4
}
for (i=keydeb;i<keydeb+4;i++){
retracer("key"+(i-keydeb),key[i],"unikey")
}
if (keydeb==0){
retracer("act0","&nbsp;","action")
}else {
retracer("act0",act[0],"action")
}
if (keydeb==key.length-4){
retracer("act1","&nbsp;","action")
}else {
retracer("act1",act[1],"action")
}
}
function charger(i){
langue=key[i+keydeb];setCk(langue);accent="0000"
CarMaj=Maj[langue].split("|");CarMin=Min[langue].split("|")
for (i=0;i<nbTouches;i++){
CarMaj[i]=((CarMaj[i]!="0000")?(fromhexby4tocar(CarMaj[i])):"")
CarMin[i]=((CarMin[i]!="0000")?(fromhexby4tocar(CarMin[i])):"")
if (CarMaj[i]==CarMin[i].toUpperCase()){
cecar=((lock==0)&&(caps==0)?CarMin[i]:CarMaj[i])
retracer("car"+i,cecar,((dia[hexa(cecar)]!=null)?"simpledia":"simple"))
retracer("minus"+i,"&nbsp;")
retracer("majus"+i,"&nbsp;")
}
else{
retracer("car"+i,"&nbsp;")
cecar=CarMin[i]
retracer("minus"+i,cecar,((dia[hexa(cecar)]!=null)?"doubledia":"double"))
cecar=CarMaj[i]
retracer("majus"+i,cecar,((dia[hexa(cecar)]!=null)?"doubledia":"double"))
}
}
}
function distinguer(oui){
for (i=0;i<nbTouches;i++){
if (CarMaj[i]==CarMin[i].toUpperCase()){
cecar=((lock==0)&&(caps==0)?CarMin[i]:CarMaj[i])
if(test(cecar)){retracer("car"+i,oui?(cardia(cecar)):cecar,oui?"simpledia":"simple")}
}
else{
cecar=CarMin[i]
if(test(cecar)){retracer("minus"+i,oui?(cardia(cecar)):cecar,oui?"doubledia":"double")}
cecar=CarMaj[i]
if(test(cecar)){retracer("majus"+i,oui?(cardia(cecar)):cecar,oui?"doubledia":"double")}
}
}
if (!oui){accent="0000"}
}
function MinusMajus(){
for (i=0;i<nbTouches;i++){
if (CarMaj[i]==CarMin[i].toUpperCase()){
cecar=((lock==0)&&(caps==0)?CarMin[i]:CarMaj[i])
retracer("car"+i,(test(cecar)?cardia(cecar):cecar),((dia[hexa(cecar)]!=null||test(cecar))?"simpledia":"simple"))
}
}
}
function test(cecar){return(dia[accent]!=null&&dia[accent][hexa(cecar)]!=null)}
function cardia(cecar){return(fromhexby4tocar(dia[accent][hexa(cecar)]))}
function fromhex(inval){out=0;for (a=inval.length-1;a>=0;a--){out+=Math.pow(16,inval.length-a-1)*hexchars.indexOf(inval.charAt(a))}return out}
function fromhexby4tocar(ceci){out4=new String();for (l=0;l<ceci.length;l+=4){out4+=String.fromCharCode(fromhex(ceci.substring(l,l+4)))}return out4}
function tohex(inval){return hexchars.charAt(inval/16)+hexchars.charAt(inval%16)}
function tohex2(inval){return tohex(inval/256)+tohex(inval%256)}
function hexa(ceci){out="";for (k=0;k<ceci.length;k++){out+=(tohex2(ceci.charCodeAt(k)))}return out}
function getCk(){
fromN=document.cookie.indexOf("langue=")+0;
if((fromN)!=-1){
fromN+=7;
toN=document.cookie.indexOf(";",fromN)+0;
if(toN==-1){
toN=document.cookie.length
}
return unescape(document.cookie.substring(fromN,toN))
}
return ""
}
function setCk(inval){
if(inval!=null){
exp=new Date();
time=365*60*60*24*1000;
exp.setTime(exp.getTime()+time);
document.cookie=escape("langue")+"="+escape(inval)+"; "+"expires="+exp.toGMTString()
}
}
 
// Arabic Keystroke Translator
function arkey(e) {
if ((document.layers)|(navigator.userAgent.indexOf("MSIE 4")>-1)|(langue!="Arabic")) return true;
 
if (!e) var e = window.event;
if (e.keyCode) keyCode = e.keyCode;
else if (e.which) keyCode = e.which;
var character = String.fromCharCode(keyCode);
 
entry = true;
cont=e.srcElement || e.currentTarget || e.target;
if (keyCode>64 && keyCode<91) {
entry=false;
source='ش لاؤ ي ث ب ل ا ه ت ن م ة ى خ ح ض ق س ف ع ر ص ء غ ئ ';
shsource='ِ لآ} ] ُ [ لأأ ÷ ـ ، / Ø¢ × Ø› َ ٌ ٍ لإ { ً ْ Ø¥ ~';
 
if (e.shiftKey) cont.value += shsource.substr((keyCode-64)*2-2,2);
else
cont.value += source.substr((keyCode-64)*2-2,2);
if (cont.value.substr(cont.value.length-1,1)==' ') cont.value=cont.value.substr(0,cont.value.length-1);
}
if (e.shiftKey) {
if (keyCode==186) {cont.value += ':';entry=false;}
if (keyCode==188) {cont.value += ',';entry=false;}
if (keyCode==190) {cont.value += '.';entry=false;}
if (keyCode==191) {cont.value += '؟';entry=false;}
if (keyCode==192) {cont.value += 'ّ';entry=false;}
if (keyCode==219) {cont.value += '<';entry=false;}
if (keyCode==221) {cont.value += '>';entry=false;}
} else {
if (keyCode==186||keyCode==59) {cont.value += 'ك';entry=false;}
if (keyCode==188) {cont.value += 'و';entry=false;}
if (keyCode==190) {cont.value += 'ز';entry=false;}
if (keyCode==191) {cont.value += 'ظ';entry=false;}
if (keyCode==192) {cont.value += 'ذ';entry=false;}
if (keyCode==219) {cont.value += 'ج';entry=false;}
if (keyCode==221) {cont.value += 'د';entry=false;}
if (keyCode==222) {cont.value += 'ط';entry=false;}
}
return entry;
}
function hold_it(e){
if ((document.layers)|(navigator.userAgent.indexOf("MSIE 4")>-1)|(langue!="Arabic")) return true;
 
var keyCode;
if (!e) var e = window.event;
if (e.keyCode) keyCode = e.keyCode;
else if (e.which) keyCode = e.which;
var character = String.fromCharCode(keyCode);
switch(keyCode){
case 186:
case 188:
case 190:
case 191:
case 192:
case 219:
case 221:
case 222:
case 116:
case 59:
case 47:
case 46:
case 44:
case 39:
return false;
case 92:
return true;
}
if (keyCode<63) return true;
return false;
}
 
var obj = document.getElementById( 'uni_area' );
if ( obj && langue=="Arabic"){
with (navigator) {
if (appName=="Netscape")
obj.onkeypress = hold_it;
}
obj.onkeydown = arkey;
}
// Arabic Keystroke Translator End
/tags/Racine_livraison_narmer/api/fckeditor/editor/fckeditor.original.html
New file
0,0 → 1,292
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckeditor.original.html
* Main page that holds the editor.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>FCKeditor</title>
<meta name="robots" content="noindex, nofollow" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- @Packager.RemoveLine
<meta http-equiv="Cache-Control" content="public" />
@Packager.RemoveLine -->
<script type="text/javascript">
 
// Instead of loading scripts and CSSs using inline tags, all scripts are
// loaded by code. In this way we can guarantee the correct processing order,
// otherwise external scripts and inline scripts could be executed in an
// unwanted order (IE).
 
function LoadScript( url )
{
document.write( '<script type="text/javascript" src="' + url + '" onerror="alert(\'Error loading \' + this.src);"><\/script>' ) ;
}
 
function LoadCss( url )
{
document.write( '<link href="' + url + '" type="text/css" rel="stylesheet" onerror="alert(\'Error loading \' + this.src);" />' ) ;
}
 
// Main editor scripts.
var sSuffix = /msie/.test( navigator.userAgent.toLowerCase() ) ? 'ie' : 'gecko' ;
 
/* @Packager.RemoveLine
LoadScript( 'js/fckeditorcode_' + sSuffix + '.js' ) ;
@Packager.RemoveLine */
// @Packager.Remove.Start
 
LoadScript( '_source/fckconstants.js' ) ;
LoadScript( '_source/fckjscoreextensions.js' ) ;
 
if ( sSuffix == 'ie' )
LoadScript( '_source/classes/fckiecleanup.js' ) ;
 
LoadScript( '_source/internals/fckbrowserinfo.js' ) ;
LoadScript( '_source/internals/fckurlparams.js' ) ;
LoadScript( '_source/internals/fck.js' ) ;
LoadScript( '_source/internals/fckconfig.js' ) ;
 
LoadScript( '_source/internals/fckdebug.js' ) ;
LoadScript( '_source/internals/fcktools.js' ) ;
LoadScript( '_source/internals/fcktools_' + sSuffix + '.js' ) ;
LoadScript( '_source/fckeditorapi.js' ) ;
LoadScript( '_source/internals/fckregexlib.js' ) ;
LoadScript( '_source/internals/fcklanguagemanager.js' ) ;
LoadScript( '_source/classes/fckevents.js' ) ;
LoadScript( '_source/internals/fckxhtmlentities.js' ) ;
LoadScript( '_source/internals/fckxhtml.js' ) ;
LoadScript( '_source/internals/fckxhtml_' + sSuffix + '.js' ) ;
LoadScript( '_source/internals/fckcodeformatter.js' ) ;
LoadScript( '_source/internals/fckundo_' + sSuffix + '.js' ) ;
LoadScript( '_source/classes/fckeditingarea.js' ) ;
LoadScript( '_source/internals/fckdocumentprocessor.js' ) ;
LoadScript( '_source/internals/fck_1.js' ) ;
LoadScript( '_source/internals/fck_1_' + sSuffix + '.js' ) ;
LoadScript( '_source/internals/fck_2.js' ) ;
LoadScript( '_source/internals/fck_2_' + sSuffix + '.js' ) ;
LoadScript( '_source/internals/fckselection.js' ) ;
LoadScript( '_source/internals/fckselection_' + sSuffix + '.js' ) ;
 
LoadScript( '_source/internals/fcktablehandler.js' ) ;
LoadScript( '_source/internals/fcktablehandler_' + sSuffix + '.js' ) ;
LoadScript( '_source/classes/fckxml_' + sSuffix + '.js' ) ;
LoadScript( '_source/classes/fckstyledef.js' ) ;
LoadScript( '_source/classes/fckstyledef_' + sSuffix + '.js' ) ;
LoadScript( '_source/classes/fckstylesloader.js' ) ;
 
LoadScript( '_source/commandclasses/fcknamedcommand.js' ) ;
LoadScript( '_source/commandclasses/fck_othercommands.js' ) ;
LoadScript( '_source/commandclasses/fckspellcheckcommand_' + sSuffix + '.js' ) ;
LoadScript( '_source/commandclasses/fcktextcolorcommand.js' ) ;
LoadScript( '_source/commandclasses/fckpasteplaintextcommand.js' ) ;
LoadScript( '_source/commandclasses/fckpastewordcommand.js' ) ;
LoadScript( '_source/commandclasses/fcktablecommand.js' ) ;
LoadScript( '_source/commandclasses/fckstylecommand.js' ) ;
LoadScript( '_source/commandclasses/fckfitwindow.js' ) ;
LoadScript( '_source/internals/fckcommands.js' ) ;
 
LoadScript( '_source/classes/fckpanel.js' ) ;
LoadScript( '_source/classes/fckicon.js' ) ;
LoadScript( '_source/classes/fcktoolbarbuttonui.js' ) ;
LoadScript( '_source/classes/fcktoolbarbutton.js' ) ;
LoadScript( '_source/classes/fckspecialcombo.js' ) ;
LoadScript( '_source/classes/fcktoolbarspecialcombo.js' ) ;
LoadScript( '_source/classes/fcktoolbarfontscombo.js' ) ;
LoadScript( '_source/classes/fcktoolbarfontsizecombo.js' ) ;
LoadScript( '_source/classes/fcktoolbarfontformatcombo.js' ) ;
LoadScript( '_source/classes/fcktoolbarstylecombo.js' ) ;
LoadScript( '_source/classes/fcktoolbarpanelbutton.js' ) ;
LoadScript( '_source/internals/fcktoolbaritems.js' ) ;
LoadScript( '_source/classes/fcktoolbar.js' ) ;
LoadScript( '_source/classes/fcktoolbarbreak_' + sSuffix + '.js' ) ;
LoadScript( '_source/internals/fcktoolbarset.js' ) ;
LoadScript( '_source/internals/fckdialog.js' ) ;
LoadScript( '_source/internals/fckdialog_' + sSuffix + '.js' ) ;
LoadScript( '_source/classes/fckmenuitem.js' ) ;
LoadScript( '_source/classes/fckmenublock.js' ) ;
LoadScript( '_source/classes/fckmenublockpanel.js' ) ;
LoadScript( '_source/classes/fckcontextmenu.js' ) ;
LoadScript( '_source/internals/fck_contextmenu.js' ) ;
LoadScript( '_source/classes/fckplugin.js' ) ;
LoadScript( '_source/internals/fckplugins.js' ) ;
 
// @Packager.Remove.End
 
// Base configuration file.
LoadScript( '../fckconfig.js' ) ;
 
</script>
<script type="text/javascript">
 
// Create the default cleanup object used by the editor.
if ( FCKBrowserInfo.IsIE )
{
FCK.IECleanup = new FCKIECleanup( window ) ;
FCK.IECleanup.AddItem( FCKTempBin, FCKTempBin.Reset ) ;
FCK.IECleanup.AddItem( FCK, FCK_Cleanup ) ;
}
 
// The config hidden field is processed immediately, because
// CustomConfigurationsPath may be set in the page.
FCKConfig.ProcessHiddenField() ;
 
// Load the custom configurations file (if defined).
if ( FCKConfig.CustomConfigurationsPath.length > 0 )
LoadScript( FCKConfig.CustomConfigurationsPath ) ;
 
</script>
<script type="text/javascript">
 
// Load configurations defined at page level.
FCKConfig_LoadPageConfig() ;
 
FCKConfig_PreProcess() ;
 
// Load the active skin CSS.
LoadCss( FCKConfig.SkinPath + 'fck_editor.css' ) ;
 
// Load the language file.
FCKLanguageManager.Initialize() ;
LoadScript( 'lang/' + FCKLanguageManager.ActiveLanguage.Code + '.js' ) ;
 
</script>
<script type="text/javascript">
 
// Initialize the editing area context menu.
FCK_ContextMenu_Init() ;
 
FCKPlugins.Load() ;
 
</script>
<script type="text/javascript">
// Set the editor interface direction.
window.document.dir = FCKLang.Dir ;
 
// Activate pasting operations.
if ( FCKConfig.ForcePasteAsPlainText || FCKConfig.AutoDetectPasteFromWord )
FCK.Events.AttachEvent( "OnPaste", FCK.Paste ) ;
 
</script>
<script type="text/javascript">
 
window.onload = function()
{
InitializeAPI() ;
 
if ( FCKBrowserInfo.IsIE )
FCK_PreloadImages() ;
else
LoadToolbarSetup() ;
}
 
function LoadToolbarSetup()
{
FCKeditorAPI._FunctionQueue.Add( LoadToolbar ) ;
}
 
function LoadToolbar()
{
var oToolbarSet = FCK.ToolbarSet = FCKToolbarSet_Create() ;
if ( oToolbarSet.IsLoaded )
StartEditor() ;
else
{
oToolbarSet.OnLoad = StartEditor ;
oToolbarSet.Load( FCKURLParams['Toolbar'] || 'Default' ) ;
}
}
 
function StartEditor()
{
// Remove the onload listener.
FCK.ToolbarSet.OnLoad = null ;
 
FCKeditorAPI._FunctionQueue.Remove( LoadToolbar ) ;
 
FCK.Events.AttachEvent( 'OnStatusChange', WaitForActive ) ;
 
// Start the editor.
FCK.StartEditor() ;
}
 
function WaitForActive( editorInstance, newStatus )
{
if ( newStatus == FCK_STATUS_ACTIVE )
{
if ( FCKBrowserInfo.IsGecko )
FCKTools.RunFunction( window.onresize ) ;
 
FCK.SetStatus( FCK_STATUS_COMPLETE ) ;
 
// Call the special "FCKeditor_OnComplete" function that should be present in
// the HTML page where the editor is located.
if ( typeof( window.parent.FCKeditor_OnComplete ) == 'function' )
window.parent.FCKeditor_OnComplete( FCK ) ;
}
}
 
// Gecko browsers doens't calculate well that IFRAME size so we must
// recalculate it every time the window size changes.
if ( FCKBrowserInfo.IsGecko )
{
function Window_OnResize()
{
if ( FCKBrowserInfo.IsOpera )
return ;
 
var oCell = document.getElementById( 'xEditingArea' ) ;
 
var eInnerElement ;
if ( eInnerElement = oCell.firstChild )
{
eInnerElement.style.height = 0 ;
eInnerElement.style.height = oCell.scrollHeight - 2 ;
}
}
window.onresize = Window_OnResize ;
}
 
</script>
</head>
<body>
<table width="100%" cellpadding="0" cellspacing="0" style="height: 100%; table-layout: fixed">
<tr id="xToolbarRow" style="display: none">
<td id="xToolbarSpace" style="overflow: hidden">
<table width="100%" cellpadding="0" cellspacing="0">
<tr id="xCollapsed" style="display: none">
<td id="xExpandHandle" class="TB_Expand" colspan="3">
<img class="TB_ExpandImg" alt="" src="images/spacer.gif" width="8" height="4" /></td>
</tr>
<tr id="xExpanded" style="display: none">
<td id="xTBLeftBorder" class="TB_SideBorder" style="width: 1px; display: none;"></td>
<td id="xCollapseHandle" style="display: none" class="TB_Collapse" valign="bottom">
<img class="TB_CollapseImg" alt="" src="images/spacer.gif" width="8" height="4" /></td>
<td id="xToolbar" class="TB_ToolbarSet"></td>
<td class="TB_SideBorder" style="width: 1px"></td>
</tr>
</table>
</td>
</tr>
<tr style="height: 100%">
<td id="xEditingArea" valign="top"></td>
</tr>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/mn.js
New file
0,0 → 1,501
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: mn.js
* Mongolian language file.
*
* File Authors:
* Lkamtseren ODONBAATAR (odonbaatarl@yahoo.com)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Багажны хэсэг эвдэх",
ToolbarExpand : "Багажны хэсэг өргөтгөх",
 
// Toolbar Items and Context Menu
Save : "Хадгалах",
NewPage : "Шинэ хуудас",
Preview : "Уридчлан харах",
Cut : "Хайчлах",
Copy : "Хуулах",
Paste : "Буулгах",
PasteText : "plain text-ээс буулгах",
PasteWord : "Word-оос буулгах",
Print : "Хэвлэх",
SelectAll : "Бүгдийг нь сонгох",
RemoveFormat : "Формат авч хаях",
InsertLinkLbl : "Линк",
InsertLink : "Линк Оруулах/Засварлах",
RemoveLink : "Линк авч хаях",
Anchor : "Insert/Edit Anchor", //MISSING
InsertImageLbl : "Зураг",
InsertImage : "Зураг Оруулах/Засварлах",
InsertFlashLbl : "Flash", //MISSING
InsertFlash : "Insert/Edit Flash", //MISSING
InsertTableLbl : "Хүснэгт",
InsertTable : "Хүснэгт Оруулах/Засварлах",
InsertLineLbl : "Зураас",
InsertLine : "Хөндлөн зураас оруулах",
InsertSpecialCharLbl: "Онцгой тэмдэгт",
InsertSpecialChar : "Онцгой тэмдэгт оруулах",
InsertSmileyLbl : "Тодорхойлолт",
InsertSmiley : "Тодорхойлолт оруулах",
About : "FCKeditor-н тухай",
Bold : "Тод бүдүүн",
Italic : "Налуу",
Underline : "Доогуур нь зураастай болгох",
StrikeThrough : "Дундуур нь зураастай болгох",
Subscript : "Суурь болгох",
Superscript : "Зэрэг болгох",
LeftJustify : "Зүүн талд байрлуулах",
CenterJustify : "Төвд байрлуулах",
RightJustify : "Баруун талд байрлуулах",
BlockJustify : "Блок хэлбэрээр байрлуулах",
DecreaseIndent : "Догол мөр нэмэх",
IncreaseIndent : "Догол мөр хасах",
Undo : "Хүчингүй болгох",
Redo : "Өмнөх үйлдлээ сэргээх",
NumberedListLbl : "Дугаарлагдсан жагсаалт",
NumberedList : "Дугаарлагдсан жагсаалт Оруулах/Авах",
BulletedListLbl : "Цэгтэй жагсаалт",
BulletedList : "Цэгтэй жагсаалт Оруулах/Авах",
ShowTableBorders : "Хүснэгтийн хүрээг үзүүлэх",
ShowDetails : "Деталчлан үзүүлэх",
Style : "Загвар",
FontFormat : "Формат",
Font : "Фонт",
FontSize : "Хэмжээ",
TextColor : "Фонтны өнгө",
BGColor : "Фонны өнгө",
Source : "Код",
Find : "Хайх",
Replace : "Солих",
SpellCheck : "Check Spelling", //MISSING
UniversalKeyboard : "Universal Keyboard", //MISSING
PageBreakLbl : "Page Break", //MISSING
PageBreak : "Insert Page Break", //MISSING
 
Form : "Form", //MISSING
Checkbox : "Checkbox", //MISSING
RadioButton : "Radio Button", //MISSING
TextField : "Text Field", //MISSING
Textarea : "Textarea", //MISSING
HiddenField : "Hidden Field", //MISSING
Button : "Button", //MISSING
SelectionField : "Selection Field", //MISSING
ImageButton : "Image Button", //MISSING
 
FitWindow : "Maximize the editor size", //MISSING
 
// Context Menu
EditLink : "Холбоос засварлах",
CellCM : "Cell", //MISSING
RowCM : "Row", //MISSING
ColumnCM : "Column", //MISSING
InsertRow : "Мөр оруулах",
DeleteRows : "Мөр устгах",
InsertColumn : "Багана оруулах",
DeleteColumns : "Багана устгах",
InsertCell : "Нүх оруулах",
DeleteCells : "Нүх устгах",
MergeCells : "Нүх нэгтэх",
SplitCell : "Нүх тусгайрлах",
TableDelete : "Delete Table", //MISSING
CellProperties : "Хоосон зайн шинж чанар",
TableProperties : "Хүснэгт",
ImageProperties : "Зураг",
FlashProperties : "Flash Properties", //MISSING
 
AnchorProp : "Anchor Properties", //MISSING
ButtonProp : "Button Properties", //MISSING
CheckboxProp : "Checkbox Properties", //MISSING
HiddenFieldProp : "Hidden Field Properties", //MISSING
RadioButtonProp : "Radio Button Properties", //MISSING
ImageButtonProp : "Image Button Properties", //MISSING
TextFieldProp : "Text Field Properties", //MISSING
SelectionFieldProp : "Selection Field Properties", //MISSING
TextareaProp : "Textarea Properties", //MISSING
FormProp : "Form Properties", //MISSING
 
FontFormats : "Хэвийн;Formatted;Хаяг;Heading 1;Heading 2;Heading 3;Heading 4;Heading 5;Heading 6;Paragraph (DIV)",
 
// Alerts and Messages
ProcessingXHTML : "XHTML үйл явц явагдаж байна. Хүлээнэ үү...",
Done : "Хийх",
PasteWordConfirm : "Word-оос хуулсан текстээ санаж байгааг нь буулгахыг та хүсч байна уу. Та текст-ээ буулгахын өмнө цэвэрлэх үү?",
NotCompatiblePaste : "Энэ комманд Internet Explorer-ын 5.5 буюу түүнээс дээш хувилбарт идвэхшинэ. Та цэвэрлэхгүйгээр буулгахыг хүсч байна?",
UnknownToolbarItem : "Багажны хэсгийн \"%1\" item мэдэгдэхгүй байна",
UnknownCommand : "\"%1\" комманд нэр мэдагдэхгүй байна",
NotImplemented : "Зөвшөөрөгдөхгүй комманд",
UnknownToolbarSet : "Багажны хэсэгт \"%1\" оноох, үүсээгүй байна",
NoActiveX : "Your browser's security settings could limit some features of the editor. You must enable the option \"Run ActiveX controls and plug-ins\". You may experience errors and notice missing features.", //MISSING
BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.", //MISSING
DialogBlocked : "It was not possible to open the dialog window. Make sure all popup blockers are disabled.", //MISSING
 
// Dialogs
DlgBtnOK : "OK",
DlgBtnCancel : "Болих",
DlgBtnClose : "Хаах",
DlgBtnBrowseServer : "Browse Server", //MISSING
DlgAdvancedTag : "Нэмэлт",
DlgOpOther : "<Other>", //MISSING
DlgInfoTab : "Info", //MISSING
DlgAlertUrl : "Please insert the URL", //MISSING
 
// General Dialogs Labels
DlgGenNotSet : "<Оноохгүй>",
DlgGenId : "Id",
DlgGenLangDir : "Хэлний чиглэл",
DlgGenLangDirLtr : "Зүүнээс баруун (LTR)",
DlgGenLangDirRtl : "Баруунаас зүүн (RTL)",
DlgGenLangCode : "Хэлний код",
DlgGenAccessKey : "Холбох түлхүүр",
DlgGenName : "Нэр",
DlgGenTabIndex : "Tab индекс",
DlgGenLongDescr : "URL-ын тайлбар",
DlgGenClass : "Stylesheet классууд",
DlgGenTitle : "Зөвлөлдөх гарчиг",
DlgGenContType : "Зөвлөлдөх төрлийн агуулга",
DlgGenLinkCharset : "Тэмдэгт оноох нөөцөд холбогдсон",
DlgGenStyle : "Загвар",
 
// Image Dialog
DlgImgTitle : "Зураг",
DlgImgInfoTab : "Зурагны мэдээлэл",
DlgImgBtnUpload : "Үүнийг сервэррүү илгээ",
DlgImgURL : "URL",
DlgImgUpload : "Хуулах",
DlgImgAlt : "Тайлбар текст",
DlgImgWidth : "Өргөн",
DlgImgHeight : "Өндөр",
DlgImgLockRatio : "Lock Ratio",
DlgBtnResetSize : "хэмжээ дахин оноох",
DlgImgBorder : "Хүрээ",
DlgImgHSpace : "Хөндлөн зай",
DlgImgVSpace : "Босоо зай",
DlgImgAlign : "Эгнээ",
DlgImgAlignLeft : "Зүүн",
DlgImgAlignAbsBottom: "Abs доод талд",
DlgImgAlignAbsMiddle: "Abs Дунд талд",
DlgImgAlignBaseline : "Baseline",
DlgImgAlignBottom : "Доод талд",
DlgImgAlignMiddle : "Дунд талд",
DlgImgAlignRight : "Баруун",
DlgImgAlignTextTop : "Текст дээр",
DlgImgAlignTop : "Дээд талд",
DlgImgPreview : "Уридчлан харах",
DlgImgAlertUrl : "Зурагны URL-ын төрлийн сонгоно уу",
DlgImgLinkTab : "Link", //MISSING
 
// Flash Dialog
DlgFlashTitle : "Flash Properties", //MISSING
DlgFlashChkPlay : "Auto Play", //MISSING
DlgFlashChkLoop : "Loop", //MISSING
DlgFlashChkMenu : "Enable Flash Menu", //MISSING
DlgFlashScale : "Scale", //MISSING
DlgFlashScaleAll : "Show all", //MISSING
DlgFlashScaleNoBorder : "No Border", //MISSING
DlgFlashScaleFit : "Exact Fit", //MISSING
 
// Link Dialog
DlgLnkWindowTitle : "Линк",
DlgLnkInfoTab : "Линкийн мэдээлэл",
DlgLnkTargetTab : "Байрлал",
 
DlgLnkType : "Линкийн төрөл",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Энэ хуудасандах холбоос",
DlgLnkTypeEMail : "E-Mail",
DlgLnkProto : "Протокол",
DlgLnkProtoOther : "<бусад>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Холбоос сонгох",
DlgLnkAnchorByName : "Холбоосын нэрээр",
DlgLnkAnchorById : "Элемэнт Id-гаар",
DlgLnkNoAnchors : "<Баримт бичиг холбоосгүй байна>",
DlgLnkEMail : "E-Mail Хаяг",
DlgLnkEMailSubject : "Message Subject",
DlgLnkEMailBody : "Message-ийн агуулга",
DlgLnkUpload : "Хуулах",
DlgLnkBtnUpload : "Үүнийг серверрүү илгээ",
 
DlgLnkTarget : "Байрлал",
DlgLnkTargetFrame : "<Агуулах хүрээ>",
DlgLnkTargetPopup : "<popup цонх>",
DlgLnkTargetBlank : "Шинэ цонх (_blank)",
DlgLnkTargetParent : "Эцэг цонх (_parent)",
DlgLnkTargetSelf : "Төстэй цонх (_self)",
DlgLnkTargetTop : "Хамгийн түрүүн байх цонх (_top)",
DlgLnkTargetFrameName : "Target Frame Name", //MISSING
DlgLnkPopWinName : "Popup цонхны нэр",
DlgLnkPopWinFeat : "Popup цонхны онцлог",
DlgLnkPopResize : "Хэмжээ өөрчлөх",
DlgLnkPopLocation : "Location хэсэг",
DlgLnkPopMenu : "Meню хэсэг",
DlgLnkPopScroll : "Скрол хэсэгүүд",
DlgLnkPopStatus : "Статус хэсэг",
DlgLnkPopToolbar : "Багажны хэсэг",
DlgLnkPopFullScrn : "Цонх дүүргэх (IE)",
DlgLnkPopDependent : "Хамаатай (Netscape)",
DlgLnkPopWidth : "Өргөн",
DlgLnkPopHeight : "Өндөр",
DlgLnkPopLeft : "Зүүн байрлал",
DlgLnkPopTop : "Дээд байрлал",
 
DlnLnkMsgNoUrl : "Линк URL-ээ төрөлжүүлнэ үү",
DlnLnkMsgNoEMail : "Е-mail хаягаа төрөлжүүлнэ үү",
DlnLnkMsgNoAnchor : "Холбоосоо сонгоно уу",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "Өнгө сонгох",
DlgColorBtnClear : "Цэвэрлэх",
DlgColorHighlight : "Өнгө",
DlgColorSelected : "Сонгогдсон",
 
// Smiley Dialog
DlgSmileyTitle : "Тодорхойлолт оруулах",
 
// Special Character Dialog
DlgSpecialCharTitle : "Онцгой тэмдэгт сонгох",
 
// Table Dialog
DlgTableTitle : "Хүснэгт",
DlgTableRows : "Мөр",
DlgTableColumns : "Багана",
DlgTableBorder : "Хүрээний хэмжээ",
DlgTableAlign : "Эгнээ",
DlgTableAlignNotSet : "<Оноохгүй>",
DlgTableAlignLeft : "Зүүн талд",
DlgTableAlignCenter : "Төвд",
DlgTableAlignRight : "Баруун талд",
DlgTableWidth : "Өргөн",
DlgTableWidthPx : "цэг",
DlgTableWidthPc : "хувь",
DlgTableHeight : "Өндөр",
DlgTableCellSpace : "Нүх хоорондын зай",
DlgTableCellPad : "Нүх доторлох",
DlgTableCaption : "Тайлбар",
DlgTableSummary : "Summary", //MISSING
 
// Table Cell Dialog
DlgCellTitle : "Хоосон зайн шинж чанар",
DlgCellWidth : "Өргөн",
DlgCellWidthPx : "цэг",
DlgCellWidthPc : "хувь",
DlgCellHeight : "Өндөр",
DlgCellWordWrap : "Үг таслах",
DlgCellWordWrapNotSet : "<Оноохгүй>",
DlgCellWordWrapYes : "Тийм",
DlgCellWordWrapNo : "Үгүй",
DlgCellHorAlign : "Босоо эгнээ",
DlgCellHorAlignNotSet : "<Оноохгүй>",
DlgCellHorAlignLeft : "Зүүн",
DlgCellHorAlignCenter : "Төв",
DlgCellHorAlignRight: "Баруун",
DlgCellVerAlign : "Хөндлөн эгнээ",
DlgCellVerAlignNotSet : "<Оноохгүй>",
DlgCellVerAlignTop : "Дээд тал",
DlgCellVerAlignMiddle : "Дунд",
DlgCellVerAlignBottom : "Доод тал",
DlgCellVerAlignBaseline : "Baseline",
DlgCellRowSpan : "Нийт мөр",
DlgCellCollSpan : "Нийт багана",
DlgCellBackColor : "Фонны өнгө",
DlgCellBorderColor : "Хүрээний өнгө",
DlgCellBtnSelect : "Сонго...",
 
// Find Dialog
DlgFindTitle : "Хайх",
DlgFindFindBtn : "Хайх",
DlgFindNotFoundMsg : "Хайсан текст олсонгүй.",
 
// Replace Dialog
DlgReplaceTitle : "Солих",
DlgReplaceFindLbl : "Хайх үг/үсэг:",
DlgReplaceReplaceLbl : "Солих үг:",
DlgReplaceCaseChk : "Тэнцэх төлөв",
DlgReplaceReplaceBtn : "Солих",
DlgReplaceReplAllBtn : "Бүгдийг нь Солих",
DlgReplaceWordChk : "Тэнцэх бүтэн үг",
 
// Paste Operations / Dialog
PasteErrorPaste : "Таны browser-ын хамгаалалтын тохиргоо editor-д автоматаар буулгах үйлдэлийг зөвшөөрөхгүй байна. (Ctrl+V) товчны хослолыг ашиглана уу.",
PasteErrorCut : "Таны browser-ын хамгаалалтын тохиргоо editor-д автоматаар хайчлах үйлдэлийг зөвшөөрөхгүй байна. (Ctrl+X) товчны хослолыг ашиглана уу.",
PasteErrorCopy : "Таны browser-ын хамгаалалтын тохиргоо editor-д автоматаар хуулах үйлдэлийг зөвшөөрөхгүй байна. (Ctrl+C) товчны хослолыг ашиглана уу.",
 
PasteAsText : "Plain Text-ээс буулгах",
PasteFromWord : "Word-оос буулгах",
 
DlgPasteMsg2 : "Please paste inside the following box using the keyboard (<STRONG>Ctrl+V</STRONG>) and hit <STRONG>OK</STRONG>.", //MISSING
DlgPasteIgnoreFont : "Ignore Font Face definitions", //MISSING
DlgPasteRemoveStyles : "Remove Styles definitions", //MISSING
DlgPasteCleanBox : "Clean Up Box", //MISSING
 
// Color Picker
ColorAutomatic : "Автоматаар",
ColorMoreColors : "Нэмэлт өнгөнүүд...",
 
// Document Properties
DocProps : "Document Properties", //MISSING
 
// Anchor Dialog
DlgAnchorTitle : "Anchor Properties", //MISSING
DlgAnchorName : "Anchor Name", //MISSING
DlgAnchorErrorName : "Please type the anchor name", //MISSING
 
// Speller Pages Dialog
DlgSpellNotInDic : "Not in dictionary", //MISSING
DlgSpellChangeTo : "Change to", //MISSING
DlgSpellBtnIgnore : "Ignore", //MISSING
DlgSpellBtnIgnoreAll : "Ignore All", //MISSING
DlgSpellBtnReplace : "Replace", //MISSING
DlgSpellBtnReplaceAll : "Replace All", //MISSING
DlgSpellBtnUndo : "Undo", //MISSING
DlgSpellNoSuggestions : "- No suggestions -", //MISSING
DlgSpellProgress : "Spell check in progress...", //MISSING
DlgSpellNoMispell : "Spell check complete: No misspellings found", //MISSING
DlgSpellNoChanges : "Spell check complete: No words changed", //MISSING
DlgSpellOneChange : "Spell check complete: One word changed", //MISSING
DlgSpellManyChanges : "Spell check complete: %1 words changed", //MISSING
 
IeSpellDownload : "Spell checker not installed. Do you want to download it now?", //MISSING
 
// Button Dialog
DlgButtonText : "Text (Value)", //MISSING
DlgButtonType : "Type", //MISSING
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Name", //MISSING
DlgCheckboxValue : "Value", //MISSING
DlgCheckboxSelected : "Selected", //MISSING
 
// Form Dialog
DlgFormName : "Name", //MISSING
DlgFormAction : "Action", //MISSING
DlgFormMethod : "Method", //MISSING
 
// Select Field Dialog
DlgSelectName : "Name", //MISSING
DlgSelectValue : "Value", //MISSING
DlgSelectSize : "Size", //MISSING
DlgSelectLines : "lines", //MISSING
DlgSelectChkMulti : "Allow multiple selections", //MISSING
DlgSelectOpAvail : "Available Options", //MISSING
DlgSelectOpText : "Text", //MISSING
DlgSelectOpValue : "Value", //MISSING
DlgSelectBtnAdd : "Add", //MISSING
DlgSelectBtnModify : "Modify", //MISSING
DlgSelectBtnUp : "Up", //MISSING
DlgSelectBtnDown : "Down", //MISSING
DlgSelectBtnSetValue : "Set as selected value", //MISSING
DlgSelectBtnDelete : "Delete", //MISSING
 
// Textarea Dialog
DlgTextareaName : "Name", //MISSING
DlgTextareaCols : "Columns", //MISSING
DlgTextareaRows : "Rows", //MISSING
 
// Text Field Dialog
DlgTextName : "Name", //MISSING
DlgTextValue : "Value", //MISSING
DlgTextCharWidth : "Character Width", //MISSING
DlgTextMaxChars : "Maximum Characters", //MISSING
DlgTextType : "Type", //MISSING
DlgTextTypeText : "Text", //MISSING
DlgTextTypePass : "Password", //MISSING
 
// Hidden Field Dialog
DlgHiddenName : "Name", //MISSING
DlgHiddenValue : "Value", //MISSING
 
// Bulleted List Dialog
BulletedListProp : "Bulleted List Properties", //MISSING
NumberedListProp : "Numbered List Properties", //MISSING
DlgLstStart : "Start", //MISSING
DlgLstType : "Type", //MISSING
DlgLstTypeCircle : "Circle", //MISSING
DlgLstTypeDisc : "Disc", //MISSING
DlgLstTypeSquare : "Square", //MISSING
DlgLstTypeNumbers : "Numbers (1, 2, 3)", //MISSING
DlgLstTypeLCase : "Lowercase Letters (a, b, c)", //MISSING
DlgLstTypeUCase : "Uppercase Letters (A, B, C)", //MISSING
DlgLstTypeSRoman : "Small Roman Numerals (i, ii, iii)", //MISSING
DlgLstTypeLRoman : "Large Roman Numerals (I, II, III)", //MISSING
 
// Document Properties Dialog
DlgDocGeneralTab : "General", //MISSING
DlgDocBackTab : "Background", //MISSING
DlgDocColorsTab : "Colors and Margins", //MISSING
DlgDocMetaTab : "Meta Data", //MISSING
 
DlgDocPageTitle : "Page Title", //MISSING
DlgDocLangDir : "Language Direction", //MISSING
DlgDocLangDirLTR : "Left to Right (LTR)", //MISSING
DlgDocLangDirRTL : "Right to Left (RTL)", //MISSING
DlgDocLangCode : "Language Code", //MISSING
DlgDocCharSet : "Character Set Encoding", //MISSING
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "Other Character Set Encoding", //MISSING
 
DlgDocDocType : "Document Type Heading", //MISSING
DlgDocDocTypeOther : "Other Document Type Heading", //MISSING
DlgDocIncXHTML : "Include XHTML Declarations", //MISSING
DlgDocBgColor : "Background Color", //MISSING
DlgDocBgImage : "Background Image URL", //MISSING
DlgDocBgNoScroll : "Nonscrolling Background", //MISSING
DlgDocCText : "Text", //MISSING
DlgDocCLink : "Link", //MISSING
DlgDocCVisited : "Visited Link", //MISSING
DlgDocCActive : "Active Link", //MISSING
DlgDocMargins : "Page Margins", //MISSING
DlgDocMaTop : "Top", //MISSING
DlgDocMaLeft : "Left", //MISSING
DlgDocMaRight : "Right", //MISSING
DlgDocMaBottom : "Bottom", //MISSING
DlgDocMeIndex : "Document Indexing Keywords (comma separated)", //MISSING
DlgDocMeDescr : "Document Description", //MISSING
DlgDocMeAuthor : "Author", //MISSING
DlgDocMeCopy : "Copyright", //MISSING
DlgDocPreview : "Preview", //MISSING
 
// Templates Dialog
Templates : "Templates", //MISSING
DlgTemplatesTitle : "Content Templates", //MISSING
DlgTemplatesSelMsg : "Please select the template to open in the editor<br>(the actual contents will be lost):", //MISSING
DlgTemplatesLoading : "Loading templates list. Please wait...", //MISSING
DlgTemplatesNoTpl : "(No templates defined)", //MISSING
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "About", //MISSING
DlgAboutBrowserInfoTab : "Browser Info", //MISSING
DlgAboutLicenseTab : "License", //MISSING
DlgAboutVersion : "Хувилбар",
DlgAboutLicense : "GNU цөөн ерөнхий нийтийн лицензийн ангилалд багтсан зөвшөөрөлтэй",
DlgAboutInfo : "Мэдээллээр туслах"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/th.js
New file
0,0 → 1,502
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: th.js
* Thai language file.
*
* File Authors:
* Audy Charin Arsakit (arsakit@gmail.com)
* Joy Piyanoot Promnuan (piyanoot@gmail.com)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "ซ่อนแถบเครื่องมือ",
ToolbarExpand : "แสดงแถบเครื่องมือ",
 
// Toolbar Items and Context Menu
Save : "บันทึก",
NewPage : "สร้างหน้าเอกสารใหม่",
Preview : "ดูหน้าเอกสารตัวอย่าง",
Cut : "ตัด",
Copy : "สำเนา",
Paste : "วาง",
PasteText : "วางสำเนาจากตัวอักษรธรรมดา",
PasteWord : "วางสำเนาจากตัวอักษรเวิร์ด",
Print : "สั่งพิมพ์",
SelectAll : "เลือกทั้งหมด",
RemoveFormat : "ล้างรูปแบบ",
InsertLinkLbl : "ลิงค์เชื่อมโยงเว็บ อีเมล์ รูปภาพ หรือไฟล์อื่นๆ",
InsertLink : "แทรก/แก้ไข ลิงค์",
RemoveLink : "ลบ ลิงค์",
Anchor : "แทรก/แก้ไข Anchor",
InsertImageLbl : "รูปภาพ",
InsertImage : "แทรก/แก้ไข รูปภาพ",
InsertFlashLbl : "Flash", //MISSING
InsertFlash : "Insert/Edit Flash", //MISSING
InsertTableLbl : "ตาราง",
InsertTable : "แทรก/แก้ไข ตาราง",
InsertLineLbl : "เส้นคั่นบรรทัด",
InsertLine : "แทรกเส้นคั่นบรรทัด",
InsertSpecialCharLbl: "ตัวอักษรพิเศษ",
InsertSpecialChar : "แทรกตัวอักษรพิเศษ",
InsertSmileyLbl : "รูปสื่ออารมณ์",
InsertSmiley : "แทรกรูปสื่ออารมณ์",
About : "เกี่ยวกับโปรแกรม FCKeditor",
Bold : "ตัวหนา",
Italic : "ตัวเอียง",
Underline : "ตัวขีดเส้นใต้",
StrikeThrough : "ตัวขีดเส้นทับ",
Subscript : "ตัวห้อย",
Superscript : "ตัวยก",
LeftJustify : "จัดชิดซ้าย",
CenterJustify : "จัดกึ่งกลาง",
RightJustify : "จัดชิดขวา",
BlockJustify : "จัดพอดีหน้ากระดาษ",
DecreaseIndent : "ลดระยะย่อหน้า",
IncreaseIndent : "เพิ่มระยะย่อหน้า",
Undo : "ยกเลิกคำสั่ง",
Redo : "ทำซ้ำคำสั่ง",
NumberedListLbl : "ลำดับรายการแบบตัวเลข",
NumberedList : "แทรก/แก้ไข ลำดับรายการแบบตัวเลข",
BulletedListLbl : "ลำดับรายการแบบสัญลักษณ์",
BulletedList : "แทรก/แก้ไข ลำดับรายการแบบสัญลักษณ์",
ShowTableBorders : "แสดงขอบของตาราง",
ShowDetails : "แสดงรายละเอียด",
Style : "ลักษณะ",
FontFormat : "รูปแบบ",
Font : "แบบอักษร",
FontSize : "ขนาด",
TextColor : "สีตัวอักษร",
BGColor : "สีพื้นหลัง",
Source : "ดูรหัส HTML",
Find : "ค้นหา",
Replace : "ค้นหาและแทนที่",
SpellCheck : "ตรวจการสะกดคำ",
UniversalKeyboard : "คีย์บอร์ดหลากภาษา",
PageBreakLbl : "Page Break", //MISSING
PageBreak : "Insert Page Break", //MISSING
 
Form : "แบบฟอร์ม",
Checkbox : "เช็คบ๊อก",
RadioButton : "เรดิโอบัตตอน",
TextField : "เท็กซ์ฟิลด์",
Textarea : "เท็กซ์แอเรีย",
HiddenField : "ฮิดเดนฟิลด์",
Button : "ปุ่ม",
SelectionField : "แถบตัวเลือก",
ImageButton : "ปุ่มแบบรูปภาพ",
 
FitWindow : "Maximize the editor size", //MISSING
 
// Context Menu
EditLink : "แก้ไข ลิงค์",
CellCM : "Cell", //MISSING
RowCM : "Row", //MISSING
ColumnCM : "Column", //MISSING
InsertRow : "แทรกแถว",
DeleteRows : "ลบแถว",
InsertColumn : "แทรกสดมน์",
DeleteColumns : "ลบสดมน์",
InsertCell : "แทรกช่อง",
DeleteCells : "ลบช่อง",
MergeCells : "ผสานช่อง",
SplitCell : "แยกช่อง",
TableDelete : "Delete Table", //MISSING
CellProperties : "คุณสมบัติของช่อง",
TableProperties : "คุณสมบัติของตาราง",
ImageProperties : "คุณสมบัติของรูปภาพ",
FlashProperties : "Flash Properties", //MISSING
 
AnchorProp : "รายละเอียด Anchor",
ButtonProp : "รายละเอียดของ ปุ่ม",
CheckboxProp : "คุณสมบัติของ เช็คบ๊อก",
HiddenFieldProp : "คุณสมบัติของ ฮิดเดนฟิลด์",
RadioButtonProp : "คุณสมบัติของ เรดิโอบัตตอน",
ImageButtonProp : "คุณสมบัติของ ปุ่มแบบรูปภาพ",
TextFieldProp : "คุณสมบัติของ เท็กซ์ฟิลด์",
SelectionFieldProp : "คุณสมบัติของ แถบตัวเลือก",
TextareaProp : "คุณสมบัติของ เท็กแอเรีย",
FormProp : "คุณสมบัติของ แบบฟอร์ม",
 
FontFormats : "Normal;Formatted;Address;Heading 1;Heading 2;Heading 3;Heading 4;Heading 5;Heading 6;Paragraph (DIV)",
 
// Alerts and Messages
ProcessingXHTML : "โปรแกรมกำลังทำงานด้วยเทคโนโลยี XHTML กรุณารอสักครู่...",
Done : "โปรแกรมทำงานเสร็จสมบูรณ์",
PasteWordConfirm : "ข้อมูลที่ท่านต้องการวางลงในแผ่นงาน ถูกจัดรูปแบบจากโปรแกรมเวิร์ด. ท่านต้องการล้างรูปแบบที่มาจากโปรแกรมเวิร์ดหรือไม่?",
NotCompatiblePaste : "คำสั่งนี้ทำงานในโปรแกรมท่องเว็บ Internet Explorer version รุ่น 5.5 หรือใหม่กว่าเท่านั้น. ท่านต้องการวางตัวอักษรโดยไม่ล้างรูปแบบที่มาจากโปรแกรมเวิร์ดหรือไม่?",
UnknownToolbarItem : "ไม่สามารถระบุปุ่มเครื่องมือได้ \"%1\"",
UnknownCommand : "ไม่สามารถระบุชื่อคำสั่งได้ \"%1\"",
NotImplemented : "ไม่สามารถใช้งานคำสั่งได้",
UnknownToolbarSet : "ไม่มีการติดตั้งชุดคำสั่งในแถบเครื่องมือ \"%1\" กรุณาติดต่อผู้ดูแลระบบ",
NoActiveX : "Your browser's security settings could limit some features of the editor. You must enable the option \"Run ActiveX controls and plug-ins\". You may experience errors and notice missing features.", //MISSING
BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.", //MISSING
DialogBlocked : "It was not possible to open the dialog window. Make sure all popup blockers are disabled.", //MISSING
 
// Dialogs
DlgBtnOK : "ตกลง",
DlgBtnCancel : "ยกเลิก",
DlgBtnClose : "ปิด",
DlgBtnBrowseServer : "เปิดหน้าต่างจัดการไฟล์อัพโหลด",
DlgAdvancedTag : "ขั้นสูง",
DlgOpOther : "<อื่นๆ>",
DlgInfoTab : "Info", //MISSING
DlgAlertUrl : "Please insert the URL", //MISSING
 
// General Dialogs Labels
DlgGenNotSet : "<ไม่ระบุ>",
DlgGenId : "ไอดี",
DlgGenLangDir : "การเขียน-อ่านภาษา",
DlgGenLangDirLtr : "จากซ้ายไปขวา (LTR)",
DlgGenLangDirRtl : "จากขวามาซ้าย (RTL)",
DlgGenLangCode : "รหัสภาษา",
DlgGenAccessKey : "แอคเซส คีย์",
DlgGenName : "ชื่อ",
DlgGenTabIndex : "ลำดับของ แท็บ",
DlgGenLongDescr : "คำอธิบายประกอบ URL",
DlgGenClass : "คลาสของไฟล์กำหนดลักษณะการแสดงผล",
DlgGenTitle : "คำเกริ่นนำ",
DlgGenContType : "ชนิดของคำเกริ่นนำ",
DlgGenLinkCharset : "ลิงค์เชื่อมโยงไปยังชุดตัวอักษร",
DlgGenStyle : "ลักษณะการแสดงผล",
 
// Image Dialog
DlgImgTitle : "คุณสมบัติของ รูปภาพ",
DlgImgInfoTab : "ข้อมูลของรูปภาพ",
DlgImgBtnUpload : "อัพโหลดไฟล์ไปเก็บไว้ที่เครื่องแม่ข่าย (เซิร์ฟเวอร์)",
DlgImgURL : "ที่อยู่อ้างอิง URL",
DlgImgUpload : "อัพโหลดไฟล์",
DlgImgAlt : "คำประกอบรูปภาพ",
DlgImgWidth : "ความกว้าง",
DlgImgHeight : "ความสูง",
DlgImgLockRatio : "กำหนดอัตราส่วน กว้าง-สูง แบบคงที่",
DlgBtnResetSize : "กำหนดรูปเท่าขนาดจริง",
DlgImgBorder : "ขนาดขอบรูป",
DlgImgHSpace : "ระยะแนวนอน",
DlgImgVSpace : "ระยะแนวตั้ง",
DlgImgAlign : "การจัดวาง",
DlgImgAlignLeft : "ชิดซ้าย",
DlgImgAlignAbsBottom: "ชิดด้านล่างสุด",
DlgImgAlignAbsMiddle: "กึ่งกลาง",
DlgImgAlignBaseline : "ชิดบรรทัด",
DlgImgAlignBottom : "ชิดด้านล่าง",
DlgImgAlignMiddle : "กึ่งกลางแนวตั้ง",
DlgImgAlignRight : "ชิดขวา",
DlgImgAlignTextTop : "ใต้ตัวอักษร",
DlgImgAlignTop : "บนสุด",
DlgImgPreview : "หน้าเอกสารตัวอย่าง",
DlgImgAlertUrl : "กรุณาระบุที่อยู่อ้างอิงออนไลน์ของไฟล์รูปภาพ (URL)",
DlgImgLinkTab : "Link", //MISSING
 
// Flash Dialog
DlgFlashTitle : "Flash Properties", //MISSING
DlgFlashChkPlay : "Auto Play", //MISSING
DlgFlashChkLoop : "Loop", //MISSING
DlgFlashChkMenu : "Enable Flash Menu", //MISSING
DlgFlashScale : "Scale", //MISSING
DlgFlashScaleAll : "Show all", //MISSING
DlgFlashScaleNoBorder : "No Border", //MISSING
DlgFlashScaleFit : "Exact Fit", //MISSING
 
// Link Dialog
DlgLnkWindowTitle : "ลิงค์เชื่อมโยงเว็บ อีเมล์ รูปภาพ หรือไฟล์อื่นๆ",
DlgLnkInfoTab : "รายละเอียด",
DlgLnkTargetTab : "การเปิดหน้าจอ",
 
DlgLnkType : "ประเภทของลิงค์",
DlgLnkTypeURL : "ที่อยู่อ้างอิงออนไลน์ (URL)",
DlgLnkTypeAnchor : "จุดเชื่อมโยง (Anchor)",
DlgLnkTypeEMail : "ส่งอีเมล์ (E-Mail)",
DlgLnkProto : "โปรโตคอล",
DlgLnkProtoOther : "<อื่นๆ>",
DlgLnkURL : "ที่อยู่อ้างอิงออนไลน์ (URL)",
DlgLnkAnchorSel : "ระบุข้อมูลของจุดเชื่อมโยง (Anchor)",
DlgLnkAnchorByName : "ชื่อ",
DlgLnkAnchorById : "ไอดี",
DlgLnkNoAnchors : "<ยังไม่มีจุดเชื่อมโยงภายในหน้าเอกสารนี้>",
DlgLnkEMail : "อีเมล์ (E-Mail)",
DlgLnkEMailSubject : "หัวเรื่อง",
DlgLnkEMailBody : "ข้อความ",
DlgLnkUpload : "อัพโหลดไฟล์",
DlgLnkBtnUpload : "บันทึกไฟล์ไว้บนเซิร์ฟเวอร์",
 
DlgLnkTarget : "การเปิดหน้าลิงค์",
DlgLnkTargetFrame : "<เปิดในเฟรม>",
DlgLnkTargetPopup : "<เปิดหน้าจอเล็ก (Pop-up)>",
DlgLnkTargetBlank : "เปิดหน้าจอใหม่ (_blank)",
DlgLnkTargetParent : "เปิดในหน้าหลัก (_parent)",
DlgLnkTargetSelf : "เปิดในหน้าปัจจุบัน (_self)",
DlgLnkTargetTop : "เปิดในหน้าบนสุด (_top)",
DlgLnkTargetFrameName : "ชื่อทาร์เก็ตเฟรม",
DlgLnkPopWinName : "ระบุชื่อหน้าจอเล็ก (Pop-up)",
DlgLnkPopWinFeat : "คุณสมบัติของหน้าจอเล็ก (Pop-up)",
DlgLnkPopResize : "ปรับขนาดหน้าจอ",
DlgLnkPopLocation : "แสดงที่อยู่ของไฟล์",
DlgLnkPopMenu : "แสดงแถบเมนู",
DlgLnkPopScroll : "แสดงแถบเลื่อน",
DlgLnkPopStatus : "แสดงแถบสถานะ",
DlgLnkPopToolbar : "แสดงแถบเครื่องมือ",
DlgLnkPopFullScrn : "แสดงเต็มหน้าจอ (IE5.5++ เท่านั้น)",
DlgLnkPopDependent : "แสดงเต็มหน้าจอ (Netscape)",
DlgLnkPopWidth : "กว้าง",
DlgLnkPopHeight : "สูง",
DlgLnkPopLeft : "พิกัดซ้าย (Left Position)",
DlgLnkPopTop : "พิกัดบน (Top Position)",
 
DlnLnkMsgNoUrl : "กรุณาระบุที่อยู่อ้างอิงออนไลน์ (URL)",
DlnLnkMsgNoEMail : "กรุณาระบุอีเมล์ (E-mail)",
DlnLnkMsgNoAnchor : "กรุณาระบุจุดเชื่อมโยง (Anchor)",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "เลือกสี",
DlgColorBtnClear : "ล้างค่ารหัสสี",
DlgColorHighlight : "ตัวอย่างสี",
DlgColorSelected : "สีที่เลือก",
 
// Smiley Dialog
DlgSmileyTitle : "แทรกสัญักษณ์สื่ออารมณ์",
 
// Special Character Dialog
DlgSpecialCharTitle : "แทรกตัวอักษรพิเศษ",
 
// Table Dialog
DlgTableTitle : "คุณสมบัติของ ตาราง",
DlgTableRows : "แถว",
DlgTableColumns : "สดมน์",
DlgTableBorder : "ขนาดเส้นขอบ",
DlgTableAlign : "การจัดตำแหน่ง",
DlgTableAlignNotSet : "<ไม่ระบุ>",
DlgTableAlignLeft : "ชิดซ้าย",
DlgTableAlignCenter : "กึ่งกลาง",
DlgTableAlignRight : "ชิดขวา",
DlgTableWidth : "กว้าง",
DlgTableWidthPx : "จุดสี",
DlgTableWidthPc : "เปอร์เซ็น",
DlgTableHeight : "สูง",
DlgTableCellSpace : "ระยะแนวนอนน",
DlgTableCellPad : "ระยะแนวตั้ง",
DlgTableCaption : "หัวเรื่องของตาราง",
DlgTableSummary : "Summary", //MISSING
 
// Table Cell Dialog
DlgCellTitle : "คุณสมบัติของ ช่อง",
DlgCellWidth : "กว้าง",
DlgCellWidthPx : "จุดสี",
DlgCellWidthPc : "เปอร์เซ็น",
DlgCellHeight : "สูง",
DlgCellWordWrap : "ตัดบรรทัดอัตโนมัติ",
DlgCellWordWrapNotSet : "<ไม่ระบุ>",
DlgCellWordWrapYes : "ใ่ช่",
DlgCellWordWrapNo : "ไม่",
DlgCellHorAlign : "การจัดวางแนวนอน",
DlgCellHorAlignNotSet : "<ไม่ระบุ>",
DlgCellHorAlignLeft : "ชิดซ้าย",
DlgCellHorAlignCenter : "กึ่งกลาง",
DlgCellHorAlignRight: "ชิดขวา",
DlgCellVerAlign : "การจัดวางแนวตั้ง",
DlgCellVerAlignNotSet : "<ไม่ระบุ>",
DlgCellVerAlignTop : "บนสุด",
DlgCellVerAlignMiddle : "กึ่งกลาง",
DlgCellVerAlignBottom : "ล่างสุด",
DlgCellVerAlignBaseline : "อิงบรรทัด",
DlgCellRowSpan : "จำนวนแถวที่คร่อมกัน",
DlgCellCollSpan : "จำนวนสดมน์ที่คร่อมกัน",
DlgCellBackColor : "สีพื้นหลัง",
DlgCellBorderColor : "สีเส้นขอบ",
DlgCellBtnSelect : "เลือก..",
 
// Find Dialog
DlgFindTitle : "ค้นหา",
DlgFindFindBtn : "ค้นหา",
DlgFindNotFoundMsg : "ไม่พบคำที่ค้นหา.",
 
// Replace Dialog
DlgReplaceTitle : "ค้นหาและแทนที่",
DlgReplaceFindLbl : "ค้นหาคำว่า:",
DlgReplaceReplaceLbl : "แทนที่ด้วย:",
DlgReplaceCaseChk : "ตัวโหญ่-เล็ก ต้องตรงกัน",
DlgReplaceReplaceBtn : "แทนที่",
DlgReplaceReplAllBtn : "แทนที่ทั้งหมดที่พบ",
DlgReplaceWordChk : "ต้องตรงกันทุกคำ",
 
// Paste Operations / Dialog
PasteErrorPaste : "ไม่สามารถวางข้อความที่สำเนามาได้เนื่องจากการกำหนดค่าระดับความปลอดภัย. กรุณาใช้ปุ่มลัดเพื่อวางข้อความแทน (กดปุ่ม Ctrl และตัว V พร้อมกัน).",
PasteErrorCut : "ไม่สามารถตัดข้อความที่เลือกไว้ได้เนื่องจากการกำหนดค่าระดับความปลอดภัย. กรุณาใช้ปุ่มลัดเพื่อวางข้อความแทน (กดปุ่ม Ctrl และตัว X พร้อมกัน).",
PasteErrorCopy : "ไม่สามารถสำเนาข้อความที่เลือกไว้ได้เนื่องจากการกำหนดค่าระดับความปลอดภัย. กรุณาใช้ปุ่มลัดเพื่อวางข้อความแทน (กดปุ่ม Ctrl และตัว C พร้อมกัน).",
 
PasteAsText : "วางแบบตัวอักษรธรรมดา",
PasteFromWord : "วางแบบตัวอักษรจากโปรแกรมเวิร์ด",
 
DlgPasteMsg2 : "Please paste inside the following box using the keyboard (<STRONG>Ctrl+V</STRONG>) and hit <STRONG>OK</STRONG>.", //MISSING
DlgPasteIgnoreFont : "Ignore Font Face definitions", //MISSING
DlgPasteRemoveStyles : "Remove Styles definitions", //MISSING
DlgPasteCleanBox : "Clean Up Box", //MISSING
 
// Color Picker
ColorAutomatic : "สีอัตโนมัติ",
ColorMoreColors : "เลือกสีอื่นๆ...",
 
// Document Properties
DocProps : "คุณสมบัติของเอกสาร",
 
// Anchor Dialog
DlgAnchorTitle : "คุณสมบัติของ Anchor",
DlgAnchorName : "ชื่อ Anchor",
DlgAnchorErrorName : "กรุณาระบุชื่อของ Anchor",
 
// Speller Pages Dialog
DlgSpellNotInDic : "ไม่พบในดิกชันนารี",
DlgSpellChangeTo : "แก้ไขเป็น",
DlgSpellBtnIgnore : "ยกเว้น",
DlgSpellBtnIgnoreAll : "ยกเว้นทั้งหมด",
DlgSpellBtnReplace : "แทนที่",
DlgSpellBtnReplaceAll : "แทนที่ทั้งหมด",
DlgSpellBtnUndo : "ยกเลิก",
DlgSpellNoSuggestions : "- ไม่มีคำแนะนำใดๆ -",
DlgSpellProgress : "กำลังตรวจสอบคำสะกด...",
DlgSpellNoMispell : "ตรวจสอบคำสะกดเสร็จสิ้น: ไม่พบคำสะกดผิด",
DlgSpellNoChanges : "ตรวจสอบคำสะกดเสร็จสิ้น: ไม่มีการแก้คำใดๆ",
DlgSpellOneChange : "ตรวจสอบคำสะกดเสร็จสิ้น: แก้ไข1คำ",
DlgSpellManyChanges : "ตรวจสอบคำสะกดเสร็จสิ้น:: แก้ไข %1 คำ",
 
IeSpellDownload : "ไม่ได้ติดตั้งระบบตรวจสอบคำสะกด. ต้องการติดตั้งไหมครับ?",
 
// Button Dialog
DlgButtonText : "ข้อความ (ค่าตัวแปร)",
DlgButtonType : "ข้อความ",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "ชื่อ",
DlgCheckboxValue : "ค่าตัวแปร",
DlgCheckboxSelected : "เลือกเป็นค่าเริ่มต้น",
 
// Form Dialog
DlgFormName : "ชื่อ",
DlgFormAction : "แอคชั่น",
DlgFormMethod : "เมธอด",
 
// Select Field Dialog
DlgSelectName : "ชื่อ",
DlgSelectValue : "ค่าตัวแปร",
DlgSelectSize : "ขนาด",
DlgSelectLines : "บรรทัด",
DlgSelectChkMulti : "เลือกหลายค่าได้",
DlgSelectOpAvail : "รายการตัวเลือก",
DlgSelectOpText : "ข้อความ",
DlgSelectOpValue : "ค่าตัวแปร",
DlgSelectBtnAdd : "เพิ่ม",
DlgSelectBtnModify : "แก้ไข",
DlgSelectBtnUp : "บน",
DlgSelectBtnDown : "ล่าง",
DlgSelectBtnSetValue : "เลือกเป็นค่าเริ่มต้น",
DlgSelectBtnDelete : "ลบ",
 
// Textarea Dialog
DlgTextareaName : "ชื่อ",
DlgTextareaCols : "สดมภ์",
DlgTextareaRows : "แถว",
 
// Text Field Dialog
DlgTextName : "ชื่อ",
DlgTextValue : "ค่าตัวแปร",
DlgTextCharWidth : "ความกว้าง",
DlgTextMaxChars : "จำนวนตัวอักษรสูงสุด",
DlgTextType : "ชนิด",
DlgTextTypeText : "ข้อความ",
DlgTextTypePass : "รหัสผ่าน",
 
// Hidden Field Dialog
DlgHiddenName : "ชื่อ",
DlgHiddenValue : "ค่าตัวแปร",
 
// Bulleted List Dialog
BulletedListProp : "คุณสมบัติของ บูลเล็ตลิสต์",
NumberedListProp : "คุณสมบัติของ นัมเบอร์ลิสต์",
DlgLstStart : "Start", //MISSING
DlgLstType : "ชนิด",
DlgLstTypeCircle : "รูปวงกลม",
DlgLstTypeDisc : "Disc", //MISSING
DlgLstTypeSquare : "รูปสี่เหลี่ยม",
DlgLstTypeNumbers : "หมายเลข (1, 2, 3)",
DlgLstTypeLCase : "ตัวพิมพ์เล็ก (a, b, c)",
DlgLstTypeUCase : "ตัวพิมพ์ใหญ่ (A, B, C)",
DlgLstTypeSRoman : "เลขโรมันพิมพ์เล็ก (i, ii, iii)",
DlgLstTypeLRoman : "เลขโรมันพิมพ์ใหญ่ (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "ลักษณะทั่วไปของเอกสาร",
DlgDocBackTab : "พื้นหลัง",
DlgDocColorsTab : "สีและระยะขอบ",
DlgDocMetaTab : "ข้อมูลสำหรับเสิร์ชเอนจิ้น",
 
DlgDocPageTitle : "ชื่อไตเติ้ล",
DlgDocLangDir : "การอ่านภาษา",
DlgDocLangDirLTR : "จากซ้ายไปขวา (LTR)",
DlgDocLangDirRTL : "จากขวาไปซ้าย (RTL)",
DlgDocLangCode : "รหัสภาษา",
DlgDocCharSet : "ชุดตัวอักษร",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "ชุดตัวอักษรอื่นๆ",
 
DlgDocDocType : "ประเภทของเอกสาร",
DlgDocDocTypeOther : "ประเภทเอกสารอื่นๆ",
DlgDocIncXHTML : "รวมเอา XHTML Declarations ไว้ด้วย",
DlgDocBgColor : "สีพื้นหลัง",
DlgDocBgImage : "ที่อยู่อ้างอิงออนไลน์ของรูปพื้นหลัง (Image URL)",
DlgDocBgNoScroll : "พื้นหลังแบบไม่มีแถบเลื่อน",
DlgDocCText : "ข้อความ",
DlgDocCLink : "ลิงค์",
DlgDocCVisited : "ลิงค์ที่เคยคลิ้กแล้ว Visited Link",
DlgDocCActive : "ลิงค์ที่กำลังคลิ้ก Active Link",
DlgDocMargins : "ระยะขอบของหน้าเอกสาร",
DlgDocMaTop : "ด้านบน",
DlgDocMaLeft : "ด้านซ้าย",
DlgDocMaRight : "ด้านขวา",
DlgDocMaBottom : "ด้านล่าง",
DlgDocMeIndex : "คำสำคัญอธิบายเอกสาร (คั่นคำด้วย คอมม่า)",
DlgDocMeDescr : "ประโยคอธิบายเกี่ยวกับเอกสาร",
DlgDocMeAuthor : "ผู้สร้างเอกสาร",
DlgDocMeCopy : "สงวนลิขสิทธิ์",
DlgDocPreview : "ตัวอย่างหน้าเอกสาร",
 
// Templates Dialog
Templates : "Templates", //MISSING
DlgTemplatesTitle : "Content Templates", //MISSING
DlgTemplatesSelMsg : "Please select the template to open in the editor<br>(the actual contents will be lost):", //MISSING
DlgTemplatesLoading : "Loading templates list. Please wait...", //MISSING
DlgTemplatesNoTpl : "(No templates defined)", //MISSING
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "เกี่ยวกับโปรแกรม",
DlgAboutBrowserInfoTab : "โปรแกรมท่องเว็บที่ท่านใช้",
DlgAboutLicenseTab : "License", //MISSING
DlgAboutVersion : "รุ่น",
DlgAboutLicense : "สงวนลิขสิทธิ์ โดยนโยบายลิขสิทธิ์แบบ GNU Lesser General Public License",
DlgAboutInfo : "ข้อมูลเพิ่มเติมภาษาไทยติดต่อ</BR>นาย ชรินทร์ อาษากิจ (อู้ด)</BR><A HREF='mailto:arsakit@gmail.com'>arsakit@gmail.com</A> tel. (+66) 06-9241924</BR>หรือดาวน์โหลดรุ่นภาษาไทยได้ที่เว็บไซต์</BR><A HREF='http://www.thaimall4u.com'>www.Thaimall4u.com</A></BR>ข้อมูลเพิ่มเติมภาษาอังกฤษ กรุณาไปที่นี่"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/pl.js
New file
0,0 → 1,502
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: pl.js
* Polish language file.
*
* File Authors:
* Jakub Boesche (jboesche@gazeta.pl)
* Maciej Bochynski (maciej.bochynski@lubman.pl)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Zwiń pasek narzędzi",
ToolbarExpand : "Rozwiń pasek narzędzi",
 
// Toolbar Items and Context Menu
Save : "Zapisz",
NewPage : "Nowa strona",
Preview : "Podgląd",
Cut : "Wytnij",
Copy : "Kopiuj",
Paste : "Wklej",
PasteText : "Wklej jako czysty tekst",
PasteWord : "Wklej z Worda",
Print : "Drukuj",
SelectAll : "Zaznacz wszystko",
RemoveFormat : "Usuń formatowanie",
InsertLinkLbl : "Hiperłącze",
InsertLink : "Wstaw/edytuj hiperłącze",
RemoveLink : "Usuń hiperłącze",
Anchor : "Wstaw/edytuj kotwicę",
InsertImageLbl : "Obrazek",
InsertImage : "Wstaw/edytuj obrazek",
InsertFlashLbl : "Flash",
InsertFlash : "Dodaj/Edytuj element Flash",
InsertTableLbl : "Tabela",
InsertTable : "Wstaw/edytuj tabelę",
InsertLineLbl : "Linia pozioma",
InsertLine : "Wstaw poziomą linię",
InsertSpecialCharLbl: "Znak specjalny",
InsertSpecialChar : "Wstaw znak specjalny",
InsertSmileyLbl : "Emotikona",
InsertSmiley : "Wstaw emotikonę",
About : "O programie FCKeditor",
Bold : "Pogrubienie",
Italic : "Kursywa",
Underline : "Podkreślenie",
StrikeThrough : "Przekreślenie",
Subscript : "Indeks dolny",
Superscript : "Indeks górny",
LeftJustify : "Wyrównaj do lewej",
CenterJustify : "Wyrównaj do środka",
RightJustify : "Wyrównaj do prawej",
BlockJustify : "Wyrównaj do lewej i prawej",
DecreaseIndent : "Zmniejsz wcięcie",
IncreaseIndent : "Zwiększ wcięcie",
Undo : "Cofnij",
Redo : "Ponów",
NumberedListLbl : "Lista numerowana",
NumberedList : "Wstaw/usuń numerowanie listy",
BulletedListLbl : "Lista wypunktowana",
BulletedList : "Wstaw/usuń wypunktowanie listy",
ShowTableBorders : "Pokazuj ramkę tabeli",
ShowDetails : "Pokaż szczegóły",
Style : "Styl",
FontFormat : "Format",
Font : "Czcionka",
FontSize : "Rozmiar",
TextColor : "Kolor tekstu",
BGColor : "Kolor tła",
Source : "Źródło dokumentu",
Find : "Znajdź",
Replace : "Zamień",
SpellCheck : "Sprawdź pisownię",
UniversalKeyboard : "Klawiatura Uniwersalna",
PageBreakLbl : "Odstęp",
PageBreak : "Wstaw odstęp",
 
Form : "Formularz",
Checkbox : "Checkbox",
RadioButton : "Pole wyboru",
TextField : "Pole tekstowe",
Textarea : "Obszar tekstowy",
HiddenField : "Pole ukryte",
Button : "Przycisk",
SelectionField : "Lista wyboru",
ImageButton : "Przycisk obrazek",
 
FitWindow : "Maksymalizuj rozmiar edytora",
 
// Context Menu
EditLink : "Edytuj hiperłącze",
CellCM : "Komórka",
RowCM : "Wiersz",
ColumnCM : "Kolumna",
InsertRow : "Wstaw wiersz",
DeleteRows : "Usuń wiersze",
InsertColumn : "Wstaw kolumnę",
DeleteColumns : "Usuń kolumny",
InsertCell : "Wstaw komórkę",
DeleteCells : "Usuń komórki",
MergeCells : "Połącz komórki",
SplitCell : "Podziel komórkę",
TableDelete : "Usuń tabelę",
CellProperties : "Właściwości komórki",
TableProperties : "Właściwości tabeli",
ImageProperties : "Właściwości obrazka",
FlashProperties : "Właściwości elementu Flash",
 
AnchorProp : "Właściwości kotwicy",
ButtonProp : "Właściwości przycisku",
CheckboxProp : "Checkbox - właściwości",
HiddenFieldProp : "Właściwości pola ukrytego",
RadioButtonProp : "Właściwości pola wyboru",
ImageButtonProp : "Właściwości przycisku obrazka",
TextFieldProp : "Właściwości pola tekstowego",
SelectionFieldProp : "Właściwości listy wyboru",
TextareaProp : "Właściwości obszaru tekstowego",
FormProp : "Właściwości formularza",
 
FontFormats : "Normalny;Tekst sformatowany;Adres;Nagłówek 1;Nagłówek 2;Nagłówek 3;Nagłówek 4;Nagłówek 5;Nagłówek 6",
 
// Alerts and Messages
ProcessingXHTML : "Przetwarzanie XHTML. Proszę czekać...",
Done : "Gotowe",
PasteWordConfirm : "Tekst, który chcesz wkleić, prawdopodobnie pochodzi z programu Word. Czy chcesz go wyczyścic przed wklejeniem?",
NotCompatiblePaste : "Ta funkcja jest dostępna w programie Internet Explorer w wersji 5.5 lub wyższej. Czy chcesz wkleić tekst bez czyszczenia?",
UnknownToolbarItem : "Nieznany element paska narzędzi \"%1\"",
UnknownCommand : "Nieznana komenda \"%1\"",
NotImplemented : "Komenda niezaimplementowana",
UnknownToolbarSet : "Pasek narzędzi \"%1\" nie istnieje",
NoActiveX : "Ustawienia zabezpieczeń twojej przeglądarki mogą ograniczyć niektóre funkcje edytora. Musisz włączyć opcję \"Uruchamianie formantów Activex i dodatków plugin\". W przeciwnym wypadku mogą pojawiać się błędy.",
BrowseServerBlocked : "Okno menadżera plików nie może zostać otwarte. Upewnij się, że wszystkie blokady popup są wyłączone.",
DialogBlocked : "Nie można otworzyć okna dialogowego. Upewnij się, że wszystkie blokady popup są wyłączone.",
 
// Dialogs
DlgBtnOK : "OK",
DlgBtnCancel : "Anuluj",
DlgBtnClose : "Zamknij",
DlgBtnBrowseServer : "Przeglądaj",
DlgAdvancedTag : "Zaawansowane",
DlgOpOther : "<Inny>",
DlgInfoTab : "Informacje",
DlgAlertUrl : "Proszę podać URL",
 
// General Dialogs Labels
DlgGenNotSet : "<nieustawione>",
DlgGenId : "Id",
DlgGenLangDir : "Kierunek tekstu",
DlgGenLangDirLtr : "Od lewej do prawej (LTR)",
DlgGenLangDirRtl : "Od prawej do lewej (RTL)",
DlgGenLangCode : "Kod języka",
DlgGenAccessKey : "Klawisz dostępu",
DlgGenName : "Nazwa",
DlgGenTabIndex : "Indeks tabeli",
DlgGenLongDescr : "Long Description URL",
DlgGenClass : "Stylesheet Classes",
DlgGenTitle : "Advisory Title",
DlgGenContType : "Advisory Content Type",
DlgGenLinkCharset : "Linked Resource Charset",
DlgGenStyle : "Styl",
 
// Image Dialog
DlgImgTitle : "Właściwości obrazka",
DlgImgInfoTab : "Informacje o obrazku",
DlgImgBtnUpload : "Syślij",
DlgImgURL : "Adres URL",
DlgImgUpload : "Wyślij",
DlgImgAlt : "Tekst zastępczy",
DlgImgWidth : "Szerokość",
DlgImgHeight : "Wysokość",
DlgImgLockRatio : "Zablokuj proporcje",
DlgBtnResetSize : "Przywróć rozmiar",
DlgImgBorder : "Ramka",
DlgImgHSpace : "Odstęp poziomy",
DlgImgVSpace : "Odstęp pionowy",
DlgImgAlign : "Wyrównaj",
DlgImgAlignLeft : "Do lewej",
DlgImgAlignAbsBottom: "Do dołu",
DlgImgAlignAbsMiddle: "Do środka w pionie",
DlgImgAlignBaseline : "Do linii bazowej",
DlgImgAlignBottom : "Do dołu",
DlgImgAlignMiddle : "Do środka",
DlgImgAlignRight : "Do prawej",
DlgImgAlignTextTop : "Do góry tekstu",
DlgImgAlignTop : "Do góry",
DlgImgPreview : "Podgląd",
DlgImgAlertUrl : "Podaj adres obrazka.",
DlgImgLinkTab : "Link",
 
// Flash Dialog
DlgFlashTitle : "Właściwości elementu Flash",
DlgFlashChkPlay : "Auto Odtwarzanie",
DlgFlashChkLoop : "Pętla",
DlgFlashChkMenu : "Włącz menu",
DlgFlashScale : "Skaluj",
DlgFlashScaleAll : "Pokaż wszystko",
DlgFlashScaleNoBorder : "Bez Ramki",
DlgFlashScaleFit : "Dokładne dopasowanie",
 
// Link Dialog
DlgLnkWindowTitle : "Hiperłącze",
DlgLnkInfoTab : "Informacje ",
DlgLnkTargetTab : "Cel",
 
DlgLnkType : "Typ hiperłącza",
DlgLnkTypeURL : "Adres URL",
DlgLnkTypeAnchor : "Odnośnik wewnątrz strony",
DlgLnkTypeEMail : "Adres e-mail",
DlgLnkProto : "Protokół",
DlgLnkProtoOther : "<inny>",
DlgLnkURL : "Adres URL",
DlgLnkAnchorSel : "Wybierz etykietę",
DlgLnkAnchorByName : "Wg etykiety",
DlgLnkAnchorById : "Wg identyfikatora elementu",
DlgLnkNoAnchors : "<W dokumencie nie zdefiniowano żadnych etykiet>",
DlgLnkEMail : "Adres e-mail",
DlgLnkEMailSubject : "Temat",
DlgLnkEMailBody : "Treść",
DlgLnkUpload : "Upload",
DlgLnkBtnUpload : "Wyślij",
 
DlgLnkTarget : "Cel",
DlgLnkTargetFrame : "<ramka>",
DlgLnkTargetPopup : "<wyskakujące okno>",
DlgLnkTargetBlank : "Nowe okno (_blank)",
DlgLnkTargetParent : "Okno nadrzędne (_parent)",
DlgLnkTargetSelf : "To samo okno (_self)",
DlgLnkTargetTop : "Okno najwyższe w hierarchii (_top)",
DlgLnkTargetFrameName : "Nazwa Ramki Docelowej",
DlgLnkPopWinName : "Nazwa wyskakującego okna",
DlgLnkPopWinFeat : "Właściwości wyskakującego okna",
DlgLnkPopResize : "Możliwa zmiana rozmiaru",
DlgLnkPopLocation : "Pasek adresu",
DlgLnkPopMenu : "Pasek menu",
DlgLnkPopScroll : "Paski przewijania",
DlgLnkPopStatus : "Pasek statusu",
DlgLnkPopToolbar : "Pasek narzędzi",
DlgLnkPopFullScrn : "Pełny ekran (IE)",
DlgLnkPopDependent : "Okno zależne (Netscape)",
DlgLnkPopWidth : "Szerokość",
DlgLnkPopHeight : "Wysokość",
DlgLnkPopLeft : "Pozycja w poziomie",
DlgLnkPopTop : "Pozycja w pionie",
 
DlnLnkMsgNoUrl : "Podaj adres URL",
DlnLnkMsgNoEMail : "Podaj adres e-mail",
DlnLnkMsgNoAnchor : "Wybierz etykietę",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "Wybierz kolor",
DlgColorBtnClear : "Wyczyść",
DlgColorHighlight : "Podgląd",
DlgColorSelected : "Wybrane",
 
// Smiley Dialog
DlgSmileyTitle : "Wstaw emotikonę",
 
// Special Character Dialog
DlgSpecialCharTitle : "Wybierz znak specjalny",
 
// Table Dialog
DlgTableTitle : "Właściwości tabeli",
DlgTableRows : "Liczba wierszy",
DlgTableColumns : "Liczba kolumn",
DlgTableBorder : "Grubość ramki",
DlgTableAlign : "Wyrównanie",
DlgTableAlignNotSet : "<brak ustawień>",
DlgTableAlignLeft : "Do lewej",
DlgTableAlignCenter : "Do środka",
DlgTableAlignRight : "Do prawej",
DlgTableWidth : "Szerokość",
DlgTableWidthPx : "piksele",
DlgTableWidthPc : "%",
DlgTableHeight : "Wysokość",
DlgTableCellSpace : "Odstęp pomiędzy komórkami",
DlgTableCellPad : "Margines wewnętrzny komórek",
DlgTableCaption : "Tytuł",
DlgTableSummary : "Podsumowanie",
 
// Table Cell Dialog
DlgCellTitle : "Właściwości komórki",
DlgCellWidth : "Szerokość",
DlgCellWidthPx : "piksele",
DlgCellWidthPc : "%",
DlgCellHeight : "Wysokość",
DlgCellWordWrap : "Zawijanie tekstu",
DlgCellWordWrapNotSet : "<brak ustawień>",
DlgCellWordWrapYes : "Tak",
DlgCellWordWrapNo : "Nie",
DlgCellHorAlign : "Wyrównanie poziome",
DlgCellHorAlignNotSet : "<brak ustawień>",
DlgCellHorAlignLeft : "Do lewej",
DlgCellHorAlignCenter : "Do środka",
DlgCellHorAlignRight: "Do prawej",
DlgCellVerAlign : "Wyrównanie pionowe",
DlgCellVerAlignNotSet : "<brak ustawień>",
DlgCellVerAlignTop : "Do góry",
DlgCellVerAlignMiddle : "Do środka",
DlgCellVerAlignBottom : "Do dołu",
DlgCellVerAlignBaseline : "Do linii bazowej",
DlgCellRowSpan : "Zajętość wierszy",
DlgCellCollSpan : "Zajętość kolumn",
DlgCellBackColor : "Kolor tła",
DlgCellBorderColor : "Kolor ramki",
DlgCellBtnSelect : "Wybierz...",
 
// Find Dialog
DlgFindTitle : "Znajdź",
DlgFindFindBtn : "Znajdź",
DlgFindNotFoundMsg : "Nie znaleziono szukanego hasła.",
 
// Replace Dialog
DlgReplaceTitle : "Zamień",
DlgReplaceFindLbl : "Znajdź:",
DlgReplaceReplaceLbl : "Zastąp przez:",
DlgReplaceCaseChk : "Uwzględnij wielkość liter",
DlgReplaceReplaceBtn : "Zastąp",
DlgReplaceReplAllBtn : "Zastąp wszystko",
DlgReplaceWordChk : "Całe słowa",
 
// Paste Operations / Dialog
PasteErrorPaste : "Ustawienia bezpieczeństwa Twojej przeglądarki nie pozwalają na automatyczne wklejanie tekstu. Użyj skrótu klawiszowego Ctrl+V.",
PasteErrorCut : "Ustawienia bezpieczeństwa Twojej przeglądarki nie pozwalają na automatyczne wycinanie tekstu. Użyj skrótu klawiszowego Ctrl+X.",
PasteErrorCopy : "Ustawienia bezpieczeństwa Twojej przeglądarki nie pozwalają na automatyczne kopiowanie tekstu. Użyj skrótu klawiszowego Ctrl+C.",
 
PasteAsText : "Wklej jako czysty tekst",
PasteFromWord : "Wklej z Worda",
 
DlgPasteMsg2 : "Proszę wkleić w poniższym polu używając klawiaturowego skrótu (<STRONG>Ctrl+V</STRONG>) i kliknąć <STRONG>OK</STRONG>.",
DlgPasteIgnoreFont : "Ignoruj definicje 'Font Face'",
DlgPasteRemoveStyles : "Usuń definicje Stylów",
DlgPasteCleanBox : "Wyczyść",
 
// Color Picker
ColorAutomatic : "Automatycznie",
ColorMoreColors : "Więcej kolorów...",
 
// Document Properties
DocProps : "Właściwości dokumentu",
 
// Anchor Dialog
DlgAnchorTitle : "Właściwości kotwicy",
DlgAnchorName : "Nazwa kotwicy",
DlgAnchorErrorName : "Wpisz nazwę kotwicy",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Słowa nie ma w słowniku",
DlgSpellChangeTo : "Zmień na",
DlgSpellBtnIgnore : "Ignoruj",
DlgSpellBtnIgnoreAll : "Ignoruj wszystkie",
DlgSpellBtnReplace : "Zmień",
DlgSpellBtnReplaceAll : "Zmień wszystkie",
DlgSpellBtnUndo : "Undo",
DlgSpellNoSuggestions : "- Brak sugestii -",
DlgSpellProgress : "Trwa sprawdzanie ...",
DlgSpellNoMispell : "Sprawdzanie zakończone: nie znaleziono błędów",
DlgSpellNoChanges : "Sprawdzanie zakończone: nie zmieniono żadnego słowa",
DlgSpellOneChange : "Sprawdzanie zakończone: zmieniono jedno słowo",
DlgSpellManyChanges : "Sprawdzanie zakończone: zmieniono %l słów",
 
IeSpellDownload : "Słownik nie jest zainstalowany. Chcesz go ściągnąć?",
 
// Button Dialog
DlgButtonText : "Tekst (Wartość)",
DlgButtonType : "Typ",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Nazwa",
DlgCheckboxValue : "Wartość",
DlgCheckboxSelected : "Zaznaczony",
 
// Form Dialog
DlgFormName : "Nazwa",
DlgFormAction : "Akcja",
DlgFormMethod : "Metoda",
 
// Select Field Dialog
DlgSelectName : "Nazwa",
DlgSelectValue : "Wartość",
DlgSelectSize : "Rozmiar",
DlgSelectLines : "linii",
DlgSelectChkMulti : "Wielokrotny wybór",
DlgSelectOpAvail : "Dostępne opcje",
DlgSelectOpText : "Tekst",
DlgSelectOpValue : "Wartość",
DlgSelectBtnAdd : "Dodaj",
DlgSelectBtnModify : "Zmień",
DlgSelectBtnUp : "Do góry",
DlgSelectBtnDown : "Do dołu",
DlgSelectBtnSetValue : "Ustaw wartość zaznaczoną",
DlgSelectBtnDelete : "Usuń",
 
// Textarea Dialog
DlgTextareaName : "Nazwa",
DlgTextareaCols : "Kolumnu",
DlgTextareaRows : "Wiersze",
 
// Text Field Dialog
DlgTextName : "Nazwa",
DlgTextValue : "Wartość",
DlgTextCharWidth : "Szerokość w znakach",
DlgTextMaxChars : "Max. szerokość",
DlgTextType : "Typ",
DlgTextTypeText : "Tekst",
DlgTextTypePass : "Hasło",
 
// Hidden Field Dialog
DlgHiddenName : "Nazwa",
DlgHiddenValue : "Wartość",
 
// Bulleted List Dialog
BulletedListProp : "Właściwości listy punktowanej",
NumberedListProp : "Właściwości listy numerowanej",
DlgLstStart : "Start", //MISSING
DlgLstType : "Typ",
DlgLstTypeCircle : "Koło",
DlgLstTypeDisc : "Dysk",
DlgLstTypeSquare : "Kwadrat",
DlgLstTypeNumbers : "Cyfry (1, 2, 3)",
DlgLstTypeLCase : "Małe litery (a, b, c)",
DlgLstTypeUCase : "Duże litery (A, B, C)",
DlgLstTypeSRoman : "Numeracja rzymska (i, ii, iii)",
DlgLstTypeLRoman : "Numeracja rzymska (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "Ogólne",
DlgDocBackTab : "Tło",
DlgDocColorsTab : "Kolory i marginesy",
DlgDocMetaTab : "Meta Dane",
 
DlgDocPageTitle : "Tytuł strony",
DlgDocLangDir : "Kierunek pisania",
DlgDocLangDirLTR : "Od lewej do prawej (LTR)",
DlgDocLangDirRTL : "Od prawej do lewej (RTL)",
DlgDocLangCode : "Kod języka",
DlgDocCharSet : "Kodowanie znaków",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "Inne kodowanie znaków",
 
DlgDocDocType : "Nagłowek typu dokumentu",
DlgDocDocTypeOther : "Inny typ dokumentu",
DlgDocIncXHTML : "Dołącz deklarację XHTML",
DlgDocBgColor : "Kolor tła",
DlgDocBgImage : "Obrazek tła",
DlgDocBgNoScroll : "Tło nieruchome",
DlgDocCText : "Tekst",
DlgDocCLink : "Hiperłącze",
DlgDocCVisited : "Odwiedzane hiperłącze",
DlgDocCActive : "Aktywne hiperłącze",
DlgDocMargins : "Marginesy strony",
DlgDocMaTop : "Górny",
DlgDocMaLeft : "Lewy",
DlgDocMaRight : "Prawy",
DlgDocMaBottom : "Dolny",
DlgDocMeIndex : "Słowa kluczowe (oddzielone przecinkami)",
DlgDocMeDescr : "Opis dokumentu",
DlgDocMeAuthor : "Autor",
DlgDocMeCopy : "Copyright",
DlgDocPreview : "Podgląd",
 
// Templates Dialog
Templates : "Sablony",
DlgTemplatesTitle : "Szablony zawartości",
DlgTemplatesSelMsg : "Wybierz szablon do otwarcia w edytorze<br>(obecna zawartość okna edytora zostanie utracona):",
DlgTemplatesLoading : "Ładowanie listy szablonów. Proszę czekać...",
DlgTemplatesNoTpl : "(Brak zdefiniowanych szablonów)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "O ...",
DlgAboutBrowserInfoTab : "O przeglądarce",
DlgAboutLicenseTab : "Licencja",
DlgAboutVersion : "wersja",
DlgAboutLicense : "na licencji GNU Lesser General Public License",
DlgAboutInfo : "Więcej informacji uzyskasz pod adresem"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/it.js
New file
0,0 → 1,501
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: it.js
* Italian language file.
*
* File Authors:
* Simone Chiaretta (simone@piyosailing.com)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Nascondi la barra degli strumenti",
ToolbarExpand : "Mostra la barra degli strumenti",
 
// Toolbar Items and Context Menu
Save : "Salva",
NewPage : "Nuova pagina vuota",
Preview : "Anteprima",
Cut : "Taglia",
Copy : "Copia",
Paste : "Incolla",
PasteText : "Incolla come testo semplice",
PasteWord : "Incolla da Word",
Print : "Stampa",
SelectAll : "Seleziona tutto",
RemoveFormat : "Elimina formattazione",
InsertLinkLbl : "Collegamento",
InsertLink : "Inserisci/Modifica collegamento",
RemoveLink : "Elimina collegamento",
Anchor : "Inserisci/Modifica Ancora",
InsertImageLbl : "Immagine",
InsertImage : "Inserisci/Modifica immagine",
InsertFlashLbl : "Oggetto Flash",
InsertFlash : "Inserisci/Modifica Oggetto Flash",
InsertTableLbl : "Tabella",
InsertTable : "Inserisci/Modifica tabella",
InsertLineLbl : "Riga orizzontale",
InsertLine : "Inserisci riga orizzontale",
InsertSpecialCharLbl: "Caratteri speciali",
InsertSpecialChar : "Inserisci carattere speciale",
InsertSmileyLbl : "Emoticon",
InsertSmiley : "Inserisci emoticon",
About : "Informazioni su FCKeditor",
Bold : "Grassetto",
Italic : "Corsivo",
Underline : "Sottolineato",
StrikeThrough : "Barrato",
Subscript : "Pedice",
Superscript : "Apice",
LeftJustify : "Allinea a sinistra",
CenterJustify : "Centra",
RightJustify : "Allinea a destra",
BlockJustify : "Giustifica",
DecreaseIndent : "Riduci rientro",
IncreaseIndent : "Aumenta rientro",
Undo : "Annulla",
Redo : "Ripristina",
NumberedListLbl : "Elenco numerato",
NumberedList : "Inserisci/Modifica elenco numerato",
BulletedListLbl : "Elenco puntato",
BulletedList : "Inserisci/Modifica elenco puntato",
ShowTableBorders : "Mostra bordi tabelle",
ShowDetails : "Mostra dettagli",
Style : "Stile",
FontFormat : "Formato",
Font : "Font",
FontSize : "Dimensione",
TextColor : "Colore testo",
BGColor : "Colore sfondo",
Source : "Codice Sorgente",
Find : "Trova",
Replace : "Sostituisci",
SpellCheck : "Correttore ortografico",
UniversalKeyboard : "Tastiera universale",
PageBreakLbl : "Interruzione di pagina",
PageBreak : "Inserisci interruzione di pagina",
 
Form : "Modulo",
Checkbox : "Checkbox",
RadioButton : "Radio Button",
TextField : "Campo di testo",
Textarea : "Area di testo",
HiddenField : "Campo nascosto",
Button : "Bottone",
SelectionField : "Menu di selezione",
ImageButton : "Bottone immagine",
 
FitWindow : "Massimizza l'area dell'editor",
 
// Context Menu
EditLink : "Modifica collegamento",
CellCM : "Cella",
RowCM : "Riga",
ColumnCM : "Colonna",
InsertRow : "Inserisci riga",
DeleteRows : "Elimina righe",
InsertColumn : "Inserisci colonna",
DeleteColumns : "Elimina colonne",
InsertCell : "Inserisci cella",
DeleteCells : "Elimina celle",
MergeCells : "Unisce celle",
SplitCell : "Dividi celle",
TableDelete : "Cancella Tabella",
CellProperties : "Proprietà cella",
TableProperties : "Proprietà tabella",
ImageProperties : "Proprietà immagine",
FlashProperties : "Proprietà Oggetto Flash",
 
AnchorProp : "Proprietà ancora",
ButtonProp : "Proprietà bottone",
CheckboxProp : "Proprietà checkbox",
HiddenFieldProp : "Proprietà campo nascosto",
RadioButtonProp : "Proprietà radio button",
ImageButtonProp : "Proprietà bottone immagine",
TextFieldProp : "Proprietà campo di testo",
SelectionFieldProp : "Proprietà menu di selezione",
TextareaProp : "Proprietà area di testo",
FormProp : "Proprietà modulo",
 
FontFormats : "Normale;Formattato;Indirizzo;Titolo 1;Titolo 2;Titolo 3;Titolo 4;Titolo 5;Titolo 6;Paragrafo (DIV)",
 
// Alerts and Messages
ProcessingXHTML : "Elaborazione XHTML in corso. Attendere prego...",
Done : "Completato",
PasteWordConfirm : "Il testo da incollare sembra provenire da Word. Desideri pulirlo prima di incollare?",
NotCompatiblePaste : "Questa funzione è disponibile solo per Internet Explorer 5.5 o superiore. Desideri incollare il testo senza pulirlo?",
UnknownToolbarItem : "Elemento della barra strumenti sconosciuto \"%1\"",
UnknownCommand : "Comando sconosciuto \"%1\"",
NotImplemented : "Comando non implementato",
UnknownToolbarSet : "La barra di strumenti \"%1\" non esiste",
NoActiveX : "Le impostazioni di sicurezza del tuo browser potrebbero limitare alcune funzionalità dell'editor. Devi abilitare l'opzione \"Esegui controlli e plug-in ActiveX\". Potresti avere errori e notare funzionalità mancanti.",
BrowseServerBlocked : "Non è possibile aprire la finestra di espolorazione risorse. Verifica che tutti i blocca popup siano bloccati.",
DialogBlocked : "Non è possibile aprire la finestra di dialogo. Verifica che tutti i blocca popup siano bloccati.",
 
// Dialogs
DlgBtnOK : "OK",
DlgBtnCancel : "Annulla",
DlgBtnClose : "Chiudi",
DlgBtnBrowseServer : "Cerca sul server",
DlgAdvancedTag : "Avanzate",
DlgOpOther : "<Altro>",
DlgInfoTab : "Info",
DlgAlertUrl : "Devi inserire l'URL",
 
// General Dialogs Labels
DlgGenNotSet : "<non impostato>",
DlgGenId : "Id",
DlgGenLangDir : "Direzione scrittura",
DlgGenLangDirLtr : "Da Sinistra a Destra (LTR)",
DlgGenLangDirRtl : "Da Destra a Sinistra (RTL)",
DlgGenLangCode : "Codice Lingua",
DlgGenAccessKey : "Scorciatoia<br />da tastiera",
DlgGenName : "Nome",
DlgGenTabIndex : "Ordine di tabulazione",
DlgGenLongDescr : "URL descrizione estesa",
DlgGenClass : "Nome classe CSS",
DlgGenTitle : "Titolo",
DlgGenContType : "Tipo della risorsa collegata",
DlgGenLinkCharset : "Set di caretteri della risorsa collegata",
DlgGenStyle : "Stile",
 
// Image Dialog
DlgImgTitle : "Proprietà immagine",
DlgImgInfoTab : "Informazioni immagine",
DlgImgBtnUpload : "Invia al server",
DlgImgURL : "URL",
DlgImgUpload : "Carica",
DlgImgAlt : "Testo alternativo",
DlgImgWidth : "Larghezza",
DlgImgHeight : "Altezza",
DlgImgLockRatio : "Blocca rapporto",
DlgBtnResetSize : "Reimposta dimensione",
DlgImgBorder : "Bordo",
DlgImgHSpace : "HSpace",
DlgImgVSpace : "VSpace",
DlgImgAlign : "Allineamento",
DlgImgAlignLeft : "Sinistra",
DlgImgAlignAbsBottom: "In basso assoluto",
DlgImgAlignAbsMiddle: "Centrato assoluto",
DlgImgAlignBaseline : "Linea base",
DlgImgAlignBottom : "In Basso",
DlgImgAlignMiddle : "Centrato",
DlgImgAlignRight : "Destra",
DlgImgAlignTextTop : "In alto al testo",
DlgImgAlignTop : "In Alto",
DlgImgPreview : "Anteprima",
DlgImgAlertUrl : "Devi inserire l'URL per l'immagine",
DlgImgLinkTab : "Collegamento",
 
// Flash Dialog
DlgFlashTitle : "Proprietà Oggetto Flash",
DlgFlashChkPlay : "Avvio Automatico",
DlgFlashChkLoop : "Cicla",
DlgFlashChkMenu : "Abilita Menu di Flash",
DlgFlashScale : "Ridimensiona",
DlgFlashScaleAll : "Mostra Tutto",
DlgFlashScaleNoBorder : "Senza Bordo",
DlgFlashScaleFit : "Dimensione Esatta",
 
// Link Dialog
DlgLnkWindowTitle : "Collegamento",
DlgLnkInfoTab : "Informazioni collegamento",
DlgLnkTargetTab : "Destinazione",
 
DlgLnkType : "Tipo di Collegamento",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Ancora nella pagina",
DlgLnkTypeEMail : "E-Mail",
DlgLnkProto : "Protocollo",
DlgLnkProtoOther : "<altro>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Scegli Ancora",
DlgLnkAnchorByName : "Per Nome",
DlgLnkAnchorById : "Per id elemento",
DlgLnkNoAnchors : "<Nessuna ancora disponibile nel documento>",
DlgLnkEMail : "Indirizzo E-Mail",
DlgLnkEMailSubject : "Oggetto del messaggio",
DlgLnkEMailBody : "Corpo del messaggio",
DlgLnkUpload : "Carica",
DlgLnkBtnUpload : "Invia al Server",
 
DlgLnkTarget : "Destinazione",
DlgLnkTargetFrame : "<riquadro>",
DlgLnkTargetPopup : "<finestra popup>",
DlgLnkTargetBlank : "Nuova finestra (_blank)",
DlgLnkTargetParent : "Finestra padre (_parent)",
DlgLnkTargetSelf : "Stessa finestra (_self)",
DlgLnkTargetTop : "Finestra superiore (_top)",
DlgLnkTargetFrameName : "Nome del riquadro di destinazione",
DlgLnkPopWinName : "Nome finestra popup",
DlgLnkPopWinFeat : "Caratteristiche finestra popup",
DlgLnkPopResize : "Ridimensionabile",
DlgLnkPopLocation : "Barra degli indirizzi",
DlgLnkPopMenu : "Barra del menu",
DlgLnkPopScroll : "Barre di scorrimento",
DlgLnkPopStatus : "Barra di stato",
DlgLnkPopToolbar : "Barra degli strumenti",
DlgLnkPopFullScrn : "A tutto schermo (IE)",
DlgLnkPopDependent : "Dipendente (Netscape)",
DlgLnkPopWidth : "Larghezza",
DlgLnkPopHeight : "Altezza",
DlgLnkPopLeft : "Posizione da sinistra",
DlgLnkPopTop : "Posizione dall'alto",
 
DlnLnkMsgNoUrl : "Devi inserire l'URL del collegamento",
DlnLnkMsgNoEMail : "Devi inserire un'indirizzo e-mail",
DlnLnkMsgNoAnchor : "Devi selezionare un'ancora",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "Seleziona colore",
DlgColorBtnClear : "Vuota",
DlgColorHighlight : "Evidenziato",
DlgColorSelected : "Selezionato",
 
// Smiley Dialog
DlgSmileyTitle : "Inserisci emoticon",
 
// Special Character Dialog
DlgSpecialCharTitle : "Seleziona carattere speciale",
 
// Table Dialog
DlgTableTitle : "Proprietà tabella",
DlgTableRows : "Righe",
DlgTableColumns : "Colonne",
DlgTableBorder : "Dimensione bordo",
DlgTableAlign : "Allineamento",
DlgTableAlignNotSet : "<non impostato>",
DlgTableAlignLeft : "Sinistra",
DlgTableAlignCenter : "Centrato",
DlgTableAlignRight : "Destra",
DlgTableWidth : "Larghezza",
DlgTableWidthPx : "pixel",
DlgTableWidthPc : "percento",
DlgTableHeight : "Altezza",
DlgTableCellSpace : "Spaziatura celle",
DlgTableCellPad : "Padding celle",
DlgTableCaption : "Intestazione",
DlgTableSummary : "Indice",
 
// Table Cell Dialog
DlgCellTitle : "Proprietà cella",
DlgCellWidth : "Larghezza",
DlgCellWidthPx : "pixel",
DlgCellWidthPc : "percento",
DlgCellHeight : "Altezza",
DlgCellWordWrap : "A capo automatico",
DlgCellWordWrapNotSet : "<non impostato>",
DlgCellWordWrapYes : "Si",
DlgCellWordWrapNo : "No",
DlgCellHorAlign : "Allineamento orizzontale",
DlgCellHorAlignNotSet : "<non impostato>",
DlgCellHorAlignLeft : "Sinistra",
DlgCellHorAlignCenter : "Centrato",
DlgCellHorAlignRight: "Destra",
DlgCellVerAlign : "Allineamento verticale",
DlgCellVerAlignNotSet : "<non impostato>",
DlgCellVerAlignTop : "In Alto",
DlgCellVerAlignMiddle : "Centrato",
DlgCellVerAlignBottom : "In Basso",
DlgCellVerAlignBaseline : "Linea base",
DlgCellRowSpan : "Righe occupate",
DlgCellCollSpan : "Colonne occupate",
DlgCellBackColor : "Colore sfondo",
DlgCellBorderColor : "Colore bordo",
DlgCellBtnSelect : "Scegli...",
 
// Find Dialog
DlgFindTitle : "Trova",
DlgFindFindBtn : "Trova",
DlgFindNotFoundMsg : "L'elemento cercato non è stato trovato.",
 
// Replace Dialog
DlgReplaceTitle : "Sostituisci",
DlgReplaceFindLbl : "Trova:",
DlgReplaceReplaceLbl : "Sostituisci con:",
DlgReplaceCaseChk : "Maiuscole/minuscole",
DlgReplaceReplaceBtn : "Sostituisci",
DlgReplaceReplAllBtn : "Sostituisci tutto",
DlgReplaceWordChk : "Solo parole intere",
 
// Paste Operations / Dialog
PasteErrorPaste : "Le impostazioni di sicurezza del browser non permettono di incollare automaticamente il testo. Usa la tastiera (Ctrl+V).",
PasteErrorCut : "Le impostazioni di sicurezza del browser non permettono di tagliare automaticamente il testo. Usa la tastiera (Ctrl+X).",
PasteErrorCopy : "Le impostazioni di sicurezza del browser non permettono di copiare automaticamente il testo. Usa la tastiera (Ctrl+C).",
 
PasteAsText : "Incolla come testo semplice",
PasteFromWord : "Incolla da Word",
 
DlgPasteMsg2 : "Incolla il testo all'interno dell'area sottostante usando la scorciatoia di tastiere (<STRONG>Ctrl+V</STRONG>) e premi <STRONG>OK</STRONG>.",
DlgPasteIgnoreFont : "Ignora le definizioni di Font",
DlgPasteRemoveStyles : "Rimuovi le definizioni di Stile",
DlgPasteCleanBox : "Svuota area di testo",
 
// Color Picker
ColorAutomatic : "Automatico",
ColorMoreColors : "Altri colori...",
 
// Document Properties
DocProps : "Proprietà del Documento",
 
// Anchor Dialog
DlgAnchorTitle : "Proprietà ancora",
DlgAnchorName : "Nome ancora",
DlgAnchorErrorName : "Inserici il nome dell'ancora",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Non nel dizionario",
DlgSpellChangeTo : "Cambia in",
DlgSpellBtnIgnore : "Ignora",
DlgSpellBtnIgnoreAll : "Ignora tutto",
DlgSpellBtnReplace : "Cambia",
DlgSpellBtnReplaceAll : "Cambia tutto",
DlgSpellBtnUndo : "Annulla",
DlgSpellNoSuggestions : "- Nessun suggerimento -",
DlgSpellProgress : "Controllo ortografico in corso",
DlgSpellNoMispell : "Controllo ortografico completato: nessun errore trovato",
DlgSpellNoChanges : "Controllo ortografico completato: nessuna parola cambiata",
DlgSpellOneChange : "Controllo ortografico completato: 1 parola cambiata",
DlgSpellManyChanges : "Controllo ortografico completato: %1 parole cambiate",
 
IeSpellDownload : "Contollo ortografico non installato. Lo vuoi scaricare ora?",
 
// Button Dialog
DlgButtonText : "Testo (Value)",
DlgButtonType : "Tipo",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Nome",
DlgCheckboxValue : "Valore",
DlgCheckboxSelected : "Selezionato",
 
// Form Dialog
DlgFormName : "Nome",
DlgFormAction : "Azione",
DlgFormMethod : "Metodo",
 
// Select Field Dialog
DlgSelectName : "Nome",
DlgSelectValue : "Valore",
DlgSelectSize : "Dimensione",
DlgSelectLines : "righe",
DlgSelectChkMulti : "Permetti selezione multipla",
DlgSelectOpAvail : "Opzioni disponibili",
DlgSelectOpText : "Testo",
DlgSelectOpValue : "Valore",
DlgSelectBtnAdd : "Aggiungi",
DlgSelectBtnModify : "Modifica",
DlgSelectBtnUp : "Su",
DlgSelectBtnDown : "Gi",
DlgSelectBtnSetValue : "Imposta come predefinito",
DlgSelectBtnDelete : "Rimuovi",
 
// Textarea Dialog
DlgTextareaName : "Nome",
DlgTextareaCols : "Colonne",
DlgTextareaRows : "Righe",
 
// Text Field Dialog
DlgTextName : "Nome",
DlgTextValue : "Valore",
DlgTextCharWidth : "Larghezza",
DlgTextMaxChars : "Numero massimo di caratteri",
DlgTextType : "Tipo",
DlgTextTypeText : "Testo",
DlgTextTypePass : "Password",
 
// Hidden Field Dialog
DlgHiddenName : "Nome",
DlgHiddenValue : "Valore",
 
// Bulleted List Dialog
BulletedListProp : "Proprietà lista puntata",
NumberedListProp : "Proprietà lista numerata",
DlgLstStart : "Start", //MISSING
DlgLstType : "Tipo",
DlgLstTypeCircle : "Tondo",
DlgLstTypeDisc : "Disco",
DlgLstTypeSquare : "Quadrato",
DlgLstTypeNumbers : "Numeri (1, 2, 3)",
DlgLstTypeLCase : "Caratteri minuscoli (a, b, c)",
DlgLstTypeUCase : "Caratteri maiuscoli (A, B, C)",
DlgLstTypeSRoman : "Numeri Romani minuscoli (i, ii, iii)",
DlgLstTypeLRoman : "Numeri Romani maiuscoli (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "Genarale",
DlgDocBackTab : "Sfondo",
DlgDocColorsTab : "Colori e margini",
DlgDocMetaTab : "Meta Data",
 
DlgDocPageTitle : "Titolo pagina",
DlgDocLangDir : "Direzione scrittura",
DlgDocLangDirLTR : "Da Sinistra a Destra (LTR)",
DlgDocLangDirRTL : "Da Destra a Sinistra (RTL)",
DlgDocLangCode : "Codice Lingua",
DlgDocCharSet : "Set di caretteri",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "Altro set di caretteri",
 
DlgDocDocType : "Intestazione DocType",
DlgDocDocTypeOther : "Altra intestazione DocType",
DlgDocIncXHTML : "Includi dichiarazione XHTML",
DlgDocBgColor : "Colore di sfondo",
DlgDocBgImage : "Immagine di sfondo",
DlgDocBgNoScroll : "Sfondo fissato",
DlgDocCText : "Testo",
DlgDocCLink : "Collegamento",
DlgDocCVisited : "Collegamento visitato",
DlgDocCActive : "Collegamento attivo",
DlgDocMargins : "Margini",
DlgDocMaTop : "In Alto",
DlgDocMaLeft : "A Sinistra",
DlgDocMaRight : "A Destra",
DlgDocMaBottom : "In Basso",
DlgDocMeIndex : "Chiavi di indicizzazione documento (separate da virgola)",
DlgDocMeDescr : "Descrizione documento",
DlgDocMeAuthor : "Autore",
DlgDocMeCopy : "Copyright",
DlgDocPreview : "Anteprima",
 
// Templates Dialog
Templates : "Modelli",
DlgTemplatesTitle : "Contenuto dei modelli",
DlgTemplatesSelMsg : "Seleziona il modello da aprire nell'editor<br />(il contenuto attuale verrà eliminato):",
DlgTemplatesLoading : "Caricamento modelli in corso. Attendere prego...",
DlgTemplatesNoTpl : "(Nessun modello definito)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "Informazioni",
DlgAboutBrowserInfoTab : "Informazioni Browser",
DlgAboutLicenseTab : "Licenza",
DlgAboutVersion : "versione",
DlgAboutLicense : "Rilasciato sotto la licensa GNU Lesser General Public License",
DlgAboutInfo : "Localizzazione in Italiano realizzata da Simone Chiaretta<br /><a target=\"_blank\" href=\"http://www.piyosailing.com/S/\">www.piyosailing.com</a><br /><br />Per maggiori informazioni visitare"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/sl.js
New file
0,0 → 1,501
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: sl.js
* Slovenian language file.
*
* File Authors:
* Boris Volarič (vol@rutka.net)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Zloži orodno vrstico",
ToolbarExpand : "Razširi orodno vrstico",
 
// Toolbar Items and Context Menu
Save : "Shrani",
NewPage : "Nova stran",
Preview : "Predogled",
Cut : "Izreži",
Copy : "Kopiraj",
Paste : "Prilepi",
PasteText : "Prilepi kot golo besedilo",
PasteWord : "Prilepi iz Worda",
Print : "Natisni",
SelectAll : "Izberi vse",
RemoveFormat : "Odstrani oblikovanje",
InsertLinkLbl : "Povezava",
InsertLink : "Vstavi/uredi povezavo",
RemoveLink : "Odstrani povezavo",
Anchor : "Vstavi/uredi zaznamek",
InsertImageLbl : "Slika",
InsertImage : "Vstavi/uredi sliko",
InsertFlashLbl : "Flash",
InsertFlash : "Vstavi/Uredi Flash",
InsertTableLbl : "Tabela",
InsertTable : "Vstavi/uredi tabelo",
InsertLineLbl : "Črta",
InsertLine : "Vstavi vodoravno črto",
InsertSpecialCharLbl: "Posebni znak",
InsertSpecialChar : "Vstavi posebni znak",
InsertSmileyLbl : "Smeško",
InsertSmiley : "Vstavi smeška",
About : "O FCKeditorju",
Bold : "Krepko",
Italic : "Ležeče",
Underline : "Podčrtano",
StrikeThrough : "Prečrtano",
Subscript : "Podpisano",
Superscript : "Nadpisano",
LeftJustify : "Leva poravnava",
CenterJustify : "Sredinska poravnava",
RightJustify : "Desna poravnava",
BlockJustify : "Obojestranska poravnava",
DecreaseIndent : "Zmanjšaj zamik",
IncreaseIndent : "Povečaj zamik",
Undo : "Razveljavi",
Redo : "Ponovi",
NumberedListLbl : "Oštevilčen seznam",
NumberedList : "Vstavi/odstrani oštevilčevanje",
BulletedListLbl : "Označen seznam",
BulletedList : "Vstavi/odstrani označevanje",
ShowTableBorders : "Pokaži meje tabele",
ShowDetails : "Pokaži podrobnosti",
Style : "Slog",
FontFormat : "Oblika",
Font : "Pisava",
FontSize : "Velikost",
TextColor : "Barva besedila",
BGColor : "Barva ozadja",
Source : "Izvorna koda",
Find : "Najdi",
Replace : "Zamenjaj",
SpellCheck : "Preveri črkovanje",
UniversalKeyboard : "Večjezična tipkovnica",
PageBreakLbl : "Prelom strani",
PageBreak : "Vstavi prelom strani",
 
Form : "Obrazec",
Checkbox : "Potrditveno polje",
RadioButton : "Izbirno polje",
TextField : "Vnosno polje",
Textarea : "Vnosno območje",
HiddenField : "Skrito polje",
Button : "Gumb",
SelectionField : "Spustni seznam",
ImageButton : "Gumb s sliko",
 
FitWindow : "Maximize the editor size", //MISSING
 
// Context Menu
EditLink : "Uredi povezavo",
CellCM : "Cell", //MISSING
RowCM : "Row", //MISSING
ColumnCM : "Column", //MISSING
InsertRow : "Vstavi vrstico",
DeleteRows : "Izbriši vrstice",
InsertColumn : "Vstavi stolpec",
DeleteColumns : "Izbriši stolpce",
InsertCell : "Vstavi celico",
DeleteCells : "Izbriši celice",
MergeCells : "Združi celice",
SplitCell : "Razdeli celico",
TableDelete : "Izbriši tabelo",
CellProperties : "Lastnosti celice",
TableProperties : "Lastnosti tabele",
ImageProperties : "Lastnosti slike",
FlashProperties : "Lastnosti Flash",
 
AnchorProp : "Lastnosti zaznamka",
ButtonProp : "Lastnosti gumba",
CheckboxProp : "Lastnosti potrditvenega polja",
HiddenFieldProp : "Lastnosti skritega polja",
RadioButtonProp : "Lastnosti izbirnega polja",
ImageButtonProp : "Lastnosti gumba s sliko",
TextFieldProp : "Lastnosti vnosnega polja",
SelectionFieldProp : "Lastnosti spustnega seznama",
TextareaProp : "Lastnosti vnosnega območja",
FormProp : "Lastnosti obrazca",
 
FontFormats : "Navaden;Oblikovan;Napis;Naslov 1;Naslov 2;Naslov 3;Naslov 4;Naslov 5;Naslov 6",
 
// Alerts and Messages
ProcessingXHTML : "Obdelujem XHTML. Prosim počakajte...",
Done : "Narejeno",
PasteWordConfirm : "Izgleda, da želite prilepiti besedilo iz Worda. Ali ga želite očistiti, preden ga prilepite?",
NotCompatiblePaste : "Ta ukaz deluje le v Internet Explorerje različice 5.5 ali višje. Ali želite prilepiti brez čiščenja?",
UnknownToolbarItem : "Neznan element orodne vrstice \"%1\"",
UnknownCommand : "Neznano ime ukaza \"%1\"",
NotImplemented : "Ukaz ni izdelan",
UnknownToolbarSet : "Skupina orodnih vrstic \"%1\" ne obstoja",
NoActiveX : "Your browser's security settings could limit some features of the editor. You must enable the option \"Run ActiveX controls and plug-ins\". You may experience errors and notice missing features.", //MISSING
BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.", //MISSING
DialogBlocked : "It was not possible to open the dialog window. Make sure all popup blockers are disabled.", //MISSING
 
// Dialogs
DlgBtnOK : "V redu",
DlgBtnCancel : "Prekliči",
DlgBtnClose : "Zapri",
DlgBtnBrowseServer : "Prebrskaj na strežniku",
DlgAdvancedTag : "Napredno",
DlgOpOther : "<Ostalo>",
DlgInfoTab : "Podatki",
DlgAlertUrl : "Prosim vpiši spletni naslov",
 
// General Dialogs Labels
DlgGenNotSet : "<ni postavljen>",
DlgGenId : "Id",
DlgGenLangDir : "Smer jezika",
DlgGenLangDirLtr : "Od leve proti desni (LTR)",
DlgGenLangDirRtl : "Od desne proti levi (RTL)",
DlgGenLangCode : "Oznaka jezika",
DlgGenAccessKey : "Vstopno geslo",
DlgGenName : "Ime",
DlgGenTabIndex : "Številka tabulatorja",
DlgGenLongDescr : "Dolg opis URL-ja",
DlgGenClass : "Razred stilne predloge",
DlgGenTitle : "Predlagani naslov",
DlgGenContType : "Predlagani tip vsebine (content-type)",
DlgGenLinkCharset : "Kodna tabela povezanega vira",
DlgGenStyle : "Slog",
 
// Image Dialog
DlgImgTitle : "Lastnosti slike",
DlgImgInfoTab : "Podatki o sliki",
DlgImgBtnUpload : "Pošlji na strežnik",
DlgImgURL : "URL",
DlgImgUpload : "Pošlji",
DlgImgAlt : "Nadomestno besedilo",
DlgImgWidth : "Širina",
DlgImgHeight : "Višina",
DlgImgLockRatio : "Zakleni razmerje",
DlgBtnResetSize : "Ponastavi velikost",
DlgImgBorder : "Obroba",
DlgImgHSpace : "Vodoravni razmik",
DlgImgVSpace : "Navpični razmik",
DlgImgAlign : "Poravnava",
DlgImgAlignLeft : "Levo",
DlgImgAlignAbsBottom: "Popolnoma na dno",
DlgImgAlignAbsMiddle: "Popolnoma v sredino",
DlgImgAlignBaseline : "Na osnovno črto",
DlgImgAlignBottom : "Na dno",
DlgImgAlignMiddle : "V sredino",
DlgImgAlignRight : "Desno",
DlgImgAlignTextTop : "Besedilo na vrh",
DlgImgAlignTop : "Na vrh",
DlgImgPreview : "Predogled",
DlgImgAlertUrl : "Vnesite URL slike",
DlgImgLinkTab : "Povezava",
 
// Flash Dialog
DlgFlashTitle : "Lastnosti Flash",
DlgFlashChkPlay : "Samodejno predvajaj",
DlgFlashChkLoop : "Ponavljanje",
DlgFlashChkMenu : "Omogoči Flash Meni",
DlgFlashScale : "Povečava",
DlgFlashScaleAll : "Pokaži vse",
DlgFlashScaleNoBorder : "Brez obrobe",
DlgFlashScaleFit : "Natančno prileganje",
 
// Link Dialog
DlgLnkWindowTitle : "Povezava",
DlgLnkInfoTab : "Podatki o povezavi",
DlgLnkTargetTab : "Cilj",
 
DlgLnkType : "Vrsta povezave",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Zaznamek na tej strani",
DlgLnkTypeEMail : "Elektronski naslov",
DlgLnkProto : "Protokol",
DlgLnkProtoOther : "<drugo>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Izberi zaznamek",
DlgLnkAnchorByName : "Po imenu zaznamka",
DlgLnkAnchorById : "Po ID-ju elementa",
DlgLnkNoAnchors : "<V tem dokumentu ni zaznamkov>",
DlgLnkEMail : "Elektronski naslov",
DlgLnkEMailSubject : "Predmet sporočila",
DlgLnkEMailBody : "Vsebina sporočila",
DlgLnkUpload : "Prenesi",
DlgLnkBtnUpload : "Pošlji na strežnik",
 
DlgLnkTarget : "Cilj",
DlgLnkTargetFrame : "<okvir>",
DlgLnkTargetPopup : "<pojavno okno>",
DlgLnkTargetBlank : "Novo okno (_blank)",
DlgLnkTargetParent : "Starševsko okno (_parent)",
DlgLnkTargetSelf : "Isto okno (_self)",
DlgLnkTargetTop : "Najvišje okno (_top)",
DlgLnkTargetFrameName : "Ime ciljnega okvirja",
DlgLnkPopWinName : "Ime pojavnega okna",
DlgLnkPopWinFeat : "Značilnosti pojavnega okna",
DlgLnkPopResize : "Spremenljive velikosti",
DlgLnkPopLocation : "Naslovna vrstica",
DlgLnkPopMenu : "Menijska vrstica",
DlgLnkPopScroll : "Drsniki",
DlgLnkPopStatus : "Vrstica stanja",
DlgLnkPopToolbar : "Orodna vrstica",
DlgLnkPopFullScrn : "Celozaslonska slika (IE)",
DlgLnkPopDependent : "Podokno (Netscape)",
DlgLnkPopWidth : "Širina",
DlgLnkPopHeight : "Višina",
DlgLnkPopLeft : "Lega levo",
DlgLnkPopTop : "Lega na vrhu",
 
DlnLnkMsgNoUrl : "Vnesite URL povezave",
DlnLnkMsgNoEMail : "Vnesite elektronski naslov",
DlnLnkMsgNoAnchor : "Izberite zaznamek",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "Izberite barvo",
DlgColorBtnClear : "Počisti",
DlgColorHighlight : "Označi",
DlgColorSelected : "Izbrano",
 
// Smiley Dialog
DlgSmileyTitle : "Vstavi smeška",
 
// Special Character Dialog
DlgSpecialCharTitle : "Izberi posebni znak",
 
// Table Dialog
DlgTableTitle : "Lastnosti tabele",
DlgTableRows : "Vrstice",
DlgTableColumns : "Stolpci",
DlgTableBorder : "Velikost obrobe",
DlgTableAlign : "Poravnava",
DlgTableAlignNotSet : "<Ni nastavljeno>",
DlgTableAlignLeft : "Levo",
DlgTableAlignCenter : "Sredinsko",
DlgTableAlignRight : "Desno",
DlgTableWidth : "Širina",
DlgTableWidthPx : "pik",
DlgTableWidthPc : "procentov",
DlgTableHeight : "Višina",
DlgTableCellSpace : "Razmik med celicami",
DlgTableCellPad : "Polnilo med celicami",
DlgTableCaption : "Naslov",
DlgTableSummary : "Povzetek",
 
// Table Cell Dialog
DlgCellTitle : "Lastnosti celice",
DlgCellWidth : "Širina",
DlgCellWidthPx : "pik",
DlgCellWidthPc : "procentov",
DlgCellHeight : "Višina",
DlgCellWordWrap : "Pomikanje besedila",
DlgCellWordWrapNotSet : "<Ni nastavljeno>",
DlgCellWordWrapYes : "Da",
DlgCellWordWrapNo : "Ne",
DlgCellHorAlign : "Vodoravna poravnava",
DlgCellHorAlignNotSet : "<Ni nastavljeno>",
DlgCellHorAlignLeft : "Levo",
DlgCellHorAlignCenter : "Sredinsko",
DlgCellHorAlignRight: "Desno",
DlgCellVerAlign : "Navpična poravnava",
DlgCellVerAlignNotSet : "<Ni nastavljeno>",
DlgCellVerAlignTop : "Na vrh",
DlgCellVerAlignMiddle : "V sredino",
DlgCellVerAlignBottom : "Na dno",
DlgCellVerAlignBaseline : "Na osnovno črto",
DlgCellRowSpan : "Spojenih vrstic (row-span)",
DlgCellCollSpan : "Spojenih stolpcev (col-span)",
DlgCellBackColor : "Barva ozadja",
DlgCellBorderColor : "Barva obrobe",
DlgCellBtnSelect : "Izberi...",
 
// Find Dialog
DlgFindTitle : "Najdi",
DlgFindFindBtn : "Najdi",
DlgFindNotFoundMsg : "Navedeno besedilo ni bilo najdeno.",
 
// Replace Dialog
DlgReplaceTitle : "Zamenjaj",
DlgReplaceFindLbl : "Najdi:",
DlgReplaceReplaceLbl : "Zamenjaj z:",
DlgReplaceCaseChk : "Razlikuj velike in male črke",
DlgReplaceReplaceBtn : "Zamenjaj",
DlgReplaceReplAllBtn : "Zamenjaj vse",
DlgReplaceWordChk : "Samo cele besede",
 
// Paste Operations / Dialog
PasteErrorPaste : "Varnostne nastavitve brskalnika ne dopuščajo samodejnega lepljenja. Uporabite kombinacijo tipk na tipkovnici (Ctrl+V).",
PasteErrorCut : "Varnostne nastavitve brskalnika ne dopuščajo samodejnega izrezovanja. Uporabite kombinacijo tipk na tipkovnici (Ctrl+X).",
PasteErrorCopy : "Varnostne nastavitve brskalnika ne dopuščajo samodejnega kopiranja. Uporabite kombinacijo tipk na tipkovnici (Ctrl+C).",
 
PasteAsText : "Prilepi kot golo besedilo",
PasteFromWord : "Prilepi iz Worda",
 
DlgPasteMsg2 : "Prosim prilepite v sleči okvir s pomočjo tipkovnice (<STRONG>Ctrl+V</STRONG>) in pritisnite <STRONG>V redu</STRONG>.",
DlgPasteIgnoreFont : "Prezri obliko pisave",
DlgPasteRemoveStyles : "Odstrani nastavitve stila",
DlgPasteCleanBox : "Počisti okvir",
 
// Color Picker
ColorAutomatic : "Samodejno",
ColorMoreColors : "Več barv...",
 
// Document Properties
DocProps : "Lastnosti dokumenta",
 
// Anchor Dialog
DlgAnchorTitle : "Lastnosti zaznamka",
DlgAnchorName : "Ime zaznamka",
DlgAnchorErrorName : "Prosim vnesite ime zaznamka",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Ni v slovarju",
DlgSpellChangeTo : "Spremeni v",
DlgSpellBtnIgnore : "Prezri",
DlgSpellBtnIgnoreAll : "Prezri vse",
DlgSpellBtnReplace : "Zamenjaj",
DlgSpellBtnReplaceAll : "Zamenjaj vse",
DlgSpellBtnUndo : "Razveljavi",
DlgSpellNoSuggestions : "- Ni predlogov -",
DlgSpellProgress : "Preverjanje črkovanja se izvaja...",
DlgSpellNoMispell : "Črkovanje je končano: Brez napak",
DlgSpellNoChanges : "Črkovanje je končano: Nobena beseda ni bila spremenjena",
DlgSpellOneChange : "Črkovanje je končano: Spremenjena je bila ena beseda",
DlgSpellManyChanges : "Črkovanje je končano: Spremenjenih je bilo %1 besed",
 
IeSpellDownload : "Črkovalnik ni nameščen. Ali ga želite prenesti sedaj?",
 
// Button Dialog
DlgButtonText : "Besedilo (Vrednost)",
DlgButtonType : "Tip",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Ime",
DlgCheckboxValue : "Vrednost",
DlgCheckboxSelected : "Izbrano",
 
// Form Dialog
DlgFormName : "Ime",
DlgFormAction : "Akcija",
DlgFormMethod : "Metoda",
 
// Select Field Dialog
DlgSelectName : "Ime",
DlgSelectValue : "Vrednost",
DlgSelectSize : "Velikost",
DlgSelectLines : "vrstic",
DlgSelectChkMulti : "Dovoli izbor večih vrstic",
DlgSelectOpAvail : "Razpoložljive izbire",
DlgSelectOpText : "Besedilo",
DlgSelectOpValue : "Vrednost",
DlgSelectBtnAdd : "Dodaj",
DlgSelectBtnModify : "Spremeni",
DlgSelectBtnUp : "Gor",
DlgSelectBtnDown : "Dol",
DlgSelectBtnSetValue : "Postavi kot privzeto izbiro",
DlgSelectBtnDelete : "Izbriši",
 
// Textarea Dialog
DlgTextareaName : "Ime",
DlgTextareaCols : "Stolpcev",
DlgTextareaRows : "Vrstic",
 
// Text Field Dialog
DlgTextName : "Ime",
DlgTextValue : "Vrednost",
DlgTextCharWidth : "Dolžina",
DlgTextMaxChars : "Največje število znakov",
DlgTextType : "Tip",
DlgTextTypeText : "Besedilo",
DlgTextTypePass : "Geslo",
 
// Hidden Field Dialog
DlgHiddenName : "Ime",
DlgHiddenValue : "Vrednost",
 
// Bulleted List Dialog
BulletedListProp : "Lastnosti označenega seznama",
NumberedListProp : "Lastnosti oštevilčenega seznama",
DlgLstStart : "Start", //MISSING
DlgLstType : "Tip",
DlgLstTypeCircle : "Pikica",
DlgLstTypeDisc : "Kroglica",
DlgLstTypeSquare : "Kvadratek",
DlgLstTypeNumbers : "Številke (1, 2, 3)",
DlgLstTypeLCase : "Male črke (a, b, c)",
DlgLstTypeUCase : "Velike črke (A, B, C)",
DlgLstTypeSRoman : "Male rimske številke (i, ii, iii)",
DlgLstTypeLRoman : "Velike rimske številke (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "Splošno",
DlgDocBackTab : "Ozadje",
DlgDocColorsTab : "Barve in zamiki",
DlgDocMetaTab : "Meta podatki",
 
DlgDocPageTitle : "Naslov strani",
DlgDocLangDir : "Smer jezika",
DlgDocLangDirLTR : "Od leve proti desni (LTR)",
DlgDocLangDirRTL : "Od desne proti levi (RTL)",
DlgDocLangCode : "Oznaka jezika",
DlgDocCharSet : "Kodna tabela",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "Druga kodna tabela",
 
DlgDocDocType : "Glava tipa dokumenta",
DlgDocDocTypeOther : "Druga glava tipa dokumenta",
DlgDocIncXHTML : "Vstavi XHTML deklaracije",
DlgDocBgColor : "Barva ozadja",
DlgDocBgImage : "URL slike za ozadje",
DlgDocBgNoScroll : "Nepremično ozadje",
DlgDocCText : "Besedilo",
DlgDocCLink : "Povezava",
DlgDocCVisited : "Obiskana povezava",
DlgDocCActive : "Aktivna povezava",
DlgDocMargins : "Zamiki strani",
DlgDocMaTop : "Na vrhu",
DlgDocMaLeft : "Levo",
DlgDocMaRight : "Desno",
DlgDocMaBottom : "Spodaj",
DlgDocMeIndex : "Ključne besede (ločene z vejicami)",
DlgDocMeDescr : "Opis strani",
DlgDocMeAuthor : "Avtor",
DlgDocMeCopy : "Avtorske pravice",
DlgDocPreview : "Predogled",
 
// Templates Dialog
Templates : "Predloge",
DlgTemplatesTitle : "Vsebinske predloge",
DlgTemplatesSelMsg : "Izberite predlogo, ki jo želite odpreti v urejevalniku<br>(trenutna vsebina bo izgubljena):",
DlgTemplatesLoading : "Nalagam seznam predlog. Prosim počakajte...",
DlgTemplatesNoTpl : "(Ni pripravljenih predlog)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "Vizitka",
DlgAboutBrowserInfoTab : "Informacije o brskalniku",
DlgAboutLicenseTab : "License", //MISSING
DlgAboutVersion : "različica",
DlgAboutLicense : "Pravica za uporabo pod pogoji GNU Lesser General Public License",
DlgAboutInfo : "Za več informacij obiščite"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/lt.js
New file
0,0 → 1,501
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: lt.js
* Lithuanian language file.
*
* File Authors:
* Tauras Paliulis (tauras.paliulis@tauras.com)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Sutraukti mygtukų juostą",
ToolbarExpand : "Išplėsti mygtukų juostą",
 
// Toolbar Items and Context Menu
Save : "Išsaugoti",
NewPage : "Naujas puslapis",
Preview : "Peržiūra",
Cut : "Iškirpti",
Copy : "Kopijuoti",
Paste : "Įdėti",
PasteText : "Įdėti kaip gryną tekstą",
PasteWord : "Ä®dėti i¨Word",
Print : "Spausdinti",
SelectAll : "Pažymėti viską",
RemoveFormat : "Panaikinti formatą",
InsertLinkLbl : "Nuoroda",
InsertLink : "Įterpti/taisyti nuorodą",
RemoveLink : "Panaikinti nuorodą",
Anchor : "Įterpti/modifikuoti žymę",
InsertImageLbl : "Vaizdas",
InsertImage : "Įterpti/taisyti vaizdą",
InsertFlashLbl : "Flash",
InsertFlash : "Įterpti/taisyti Flash",
InsertTableLbl : "Lentelė",
InsertTable : "Įterpti/taisyti lentelę",
InsertLineLbl : "Linija",
InsertLine : "Įterpti horizontalią liniją",
InsertSpecialCharLbl: "Spec. simbolis",
InsertSpecialChar : "Įterpti specialų simbolį",
InsertSmileyLbl : "Veideliai",
InsertSmiley : "Įterpti veidelį",
About : "Apie FCKeditor",
Bold : "Pusjuodis",
Italic : "Kursyvas",
Underline : "Pabrauktas",
StrikeThrough : "Perbrauktas",
Subscript : "Apatinis indeksas",
Superscript : "Viršutinis indeksas",
LeftJustify : "Lygiuoti kairę",
CenterJustify : "Centruoti",
RightJustify : "Lygiuoti dešinę",
BlockJustify : "Lygiuoti abi puses",
DecreaseIndent : "Sumažinti įtrauką",
IncreaseIndent : "Padidinti įtrauką",
Undo : "Atšaukti",
Redo : "Atstatyti",
NumberedListLbl : "Numeruotas sąrašas",
NumberedList : "Įterpti/Panaikinti numeruotą sąrašą",
BulletedListLbl : "Suženklintas sąrašas",
BulletedList : "Įterpti/Panaikinti suženklintą sąrašą",
ShowTableBorders : "Rodyti lentelės rėmus",
ShowDetails : "Rodyti detales",
Style : "Stilius",
FontFormat : "Šrifto formatas",
Font : "Šriftas",
FontSize : "Šrifto dydis",
TextColor : "Teksto spalva",
BGColor : "Fono spalva",
Source : "Šaltinis",
Find : "Rasti",
Replace : "Pakeisti",
SpellCheck : "Rašybos tikrinimas",
UniversalKeyboard : "Universali klaviatūra",
PageBreakLbl : "Puslapių skirtukas",
PageBreak : "Įterpti puslapių skirtuką",
 
Form : "Forma",
Checkbox : "Žymimasis langelis",
RadioButton : "Žymimoji akutė",
TextField : "Teksto laukas",
Textarea : "Teksto sritis",
HiddenField : "Nerodomas laukas",
Button : "Mygtukas",
SelectionField : "Atrankos laukas",
ImageButton : "Vaizdinis mygtukas",
 
FitWindow : "Maximize the editor size", //MISSING
 
// Context Menu
EditLink : "Taisyti nuorodą",
CellCM : "Cell", //MISSING
RowCM : "Row", //MISSING
ColumnCM : "Column", //MISSING
InsertRow : "Įterpti eilutę",
DeleteRows : "Šalinti eilutes",
InsertColumn : "Įterpti stulpelį",
DeleteColumns : "Šalinti stulpelius",
InsertCell : "Įterpti langelį",
DeleteCells : "Šalinti langelius",
MergeCells : "Sujungti langelius",
SplitCell : "Skaidyti langelius",
TableDelete : "Šalinti lentelę",
CellProperties : "Langelio savybės",
TableProperties : "Lentelės savybės",
ImageProperties : "Vaizdo savybės",
FlashProperties : "Flash savybės",
 
AnchorProp : "Žymės savybės",
ButtonProp : "Mygtuko savybės",
CheckboxProp : "Žymimojo langelio savybės",
HiddenFieldProp : "Nerodomo lauko savybės",
RadioButtonProp : "Žymimosios akutės savybės",
ImageButtonProp : "Vaizdinio mygtuko savybės",
TextFieldProp : "Teksto lauko savybės",
SelectionFieldProp : "Atrankos lauko savybės",
TextareaProp : "Teksto srities savybės",
FormProp : "Formos savybės",
 
FontFormats : "Normalus;Formuotas;Kreipinio;Antraštinis 1;Antraštinis 2;Antraštinis 3;Antraštinis 4;Antraštinis 5;Antraštinis 6",
 
// Alerts and Messages
ProcessingXHTML : "Apdorojamas XHTML. Prašome palaukti...",
Done : "Baigta",
PasteWordConfirm : "Ä®dedamas tekstas yra panaÅ¡us į kopiją i¨Word. Ar JÅ«s norite prie¨Ä¯dėjimą iÅ¡valyti jį?",
NotCompatiblePaste : "Ši komanda yra prieinama tik per Internet Explorer 5.5 ar aukštesnę versiją. Ar Jūs norite įterpti be valymo?",
UnknownToolbarItem : "Nežinomas mygtukų juosta elementas \"%1\"",
UnknownCommand : "Nežinomas komandos vardas \"%1\"",
NotImplemented : "Komanda nėra įgyvendinta",
UnknownToolbarSet : "Mygtukų juostos rinkinys \"%1\" neegzistuoja",
NoActiveX : "Jūsų naršyklės saugumo nuostatos gali riboti kai kurias redaktoriaus savybes. Jūs turite aktyvuoti opciją \"Run ActiveX controls and plug-ins\". Kitu atveju Jums bus pranešama apie klaidas ir trūkstamas savybes.",
BrowseServerBlocked : "Neįmanoma atidaryti naujo naršyklės lango. Įsitikinkite, kad iškylančių langų blokavimo programos neveiksnios.",
DialogBlocked : "Neįmanoma atidaryti dialogo lango. Įsitikinkite, kad iškylančių langų blokavimo programos neveiksnios.",
 
// Dialogs
DlgBtnOK : "OK",
DlgBtnCancel : "Nutraukti",
DlgBtnClose : "Uždaryti",
DlgBtnBrowseServer : "Naršyti po serverį",
DlgAdvancedTag : "Papildomas",
DlgOpOther : "<Kita>",
DlgInfoTab : "Informacija",
DlgAlertUrl : "Prašome įrašyti URL",
 
// General Dialogs Labels
DlgGenNotSet : "<nėra nustatyta>",
DlgGenId : "Id",
DlgGenLangDir : "Teksto kryptis",
DlgGenLangDirLtr : "I¨kairės į deÅ¡inę (LTR)",
DlgGenLangDirRtl : "I¨deÅ¡inės į kairę (RTL)",
DlgGenLangCode : "Kalbos kodas",
DlgGenAccessKey : "Prieigos raktas",
DlgGenName : "Vardas",
DlgGenTabIndex : "Tabuliavimo indeksas",
DlgGenLongDescr : "Ilgas aprašymas URL",
DlgGenClass : "Stilių lentelės klasės",
DlgGenTitle : "Konsultacinė antraštė",
DlgGenContType : "Konsultacinio turinio tipas",
DlgGenLinkCharset : "Susietų išteklių simbolių lentelė",
DlgGenStyle : "Stilius",
 
// Image Dialog
DlgImgTitle : "Vaizdo savybės",
DlgImgInfoTab : "Vaizdo informacija",
DlgImgBtnUpload : "Siųsti į serverį",
DlgImgURL : "URL",
DlgImgUpload : "Nusiųsti",
DlgImgAlt : "Alternatyvus Tekstas",
DlgImgWidth : "Plotis",
DlgImgHeight : "Aukštis",
DlgImgLockRatio : "Išlaikyti proporciją",
DlgBtnResetSize : "Atstatyti dydį",
DlgImgBorder : "Rėmelis",
DlgImgHSpace : "Hor.Erdvė",
DlgImgVSpace : "Vert.Erdvė",
DlgImgAlign : "Lygiuoti",
DlgImgAlignLeft : "Kairę",
DlgImgAlignAbsBottom: "Absoliučią apačią",
DlgImgAlignAbsMiddle: "Absoliutų vidurį",
DlgImgAlignBaseline : "Apatinę liniją",
DlgImgAlignBottom : "Apačią",
DlgImgAlignMiddle : "Vidurį",
DlgImgAlignRight : "Dešinę",
DlgImgAlignTextTop : "Teksto viršūnę",
DlgImgAlignTop : "Viršūnę",
DlgImgPreview : "Peržiūra",
DlgImgAlertUrl : "Prašome įvesti vaizdo URL",
DlgImgLinkTab : "Nuoroda",
 
// Flash Dialog
DlgFlashTitle : "Flash savybės",
DlgFlashChkPlay : "Automatinis paleidimas",
DlgFlashChkLoop : "Ciklas",
DlgFlashChkMenu : "Leisti Flash meniu",
DlgFlashScale : "Mastelis",
DlgFlashScaleAll : "Rodyti visą",
DlgFlashScaleNoBorder : "Be rėmelio",
DlgFlashScaleFit : "Tikslus atitikimas",
 
// Link Dialog
DlgLnkWindowTitle : "Nuoroda",
DlgLnkInfoTab : "Nuorodos informacija",
DlgLnkTargetTab : "Paskirtis",
 
DlgLnkType : "Nuorodos tipas",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Žymė šiame puslapyje",
DlgLnkTypeEMail : "El.paštas",
DlgLnkProto : "Protokolas",
DlgLnkProtoOther : "<kitas>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Pasirinkite žymę",
DlgLnkAnchorByName : "Pagal žymės vardą",
DlgLnkAnchorById : "Pagal žymės Id",
DlgLnkNoAnchors : "<Šiame dokumente žymių nėra>",
DlgLnkEMail : "El.pašto adresas",
DlgLnkEMailSubject : "Žinutės tema",
DlgLnkEMailBody : "Žinutės turinys",
DlgLnkUpload : "Siųsti",
DlgLnkBtnUpload : "Siųsti į serverį",
 
DlgLnkTarget : "Paskirties vieta",
DlgLnkTargetFrame : "<kadras>",
DlgLnkTargetPopup : "<išskleidžiamas langas>",
DlgLnkTargetBlank : "Naujas langas (_blank)",
DlgLnkTargetParent : "Pirminis langas (_parent)",
DlgLnkTargetSelf : "Tas pats langas (_self)",
DlgLnkTargetTop : "Svarbiausias langas (_top)",
DlgLnkTargetFrameName : "Paskirties kadro vardas",
DlgLnkPopWinName : "Paskirties lango vardas",
DlgLnkPopWinFeat : "Išskleidžiamo lango savybės",
DlgLnkPopResize : "Keičiamas dydis",
DlgLnkPopLocation : "Adreso juosta",
DlgLnkPopMenu : "Meniu juosta",
DlgLnkPopScroll : "Slinkties juostos",
DlgLnkPopStatus : "Būsenos juosta",
DlgLnkPopToolbar : "Mygtukų juosta",
DlgLnkPopFullScrn : "Visas ekranas (IE)",
DlgLnkPopDependent : "Priklausomas (Netscape)",
DlgLnkPopWidth : "Plotis",
DlgLnkPopHeight : "Aukštis",
DlgLnkPopLeft : "Kairė pozicija",
DlgLnkPopTop : "Viršutinė pozicija",
 
DlnLnkMsgNoUrl : "Prašome įvesti nuorodos URL",
DlnLnkMsgNoEMail : "Prašome įvesti el.pašto adresą",
DlnLnkMsgNoAnchor : "Prašome pasirinkti žymę",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "Pasirinkite spalvą",
DlgColorBtnClear : "Trinti",
DlgColorHighlight : "Paryškinta",
DlgColorSelected : "Pažymėta",
 
// Smiley Dialog
DlgSmileyTitle : "Įterpti veidelį",
 
// Special Character Dialog
DlgSpecialCharTitle : "Pasirinkite specialų simbolį",
 
// Table Dialog
DlgTableTitle : "Lentelės savybės",
DlgTableRows : "Eilutės",
DlgTableColumns : "Stulpeliai",
DlgTableBorder : "Rėmelio dydis",
DlgTableAlign : "Lygiuoti",
DlgTableAlignNotSet : "<Nenustatyta>",
DlgTableAlignLeft : "Kairę",
DlgTableAlignCenter : "Centrą",
DlgTableAlignRight : "Dešinę",
DlgTableWidth : "Plotis",
DlgTableWidthPx : "taškais",
DlgTableWidthPc : "procentais",
DlgTableHeight : "Aukštis",
DlgTableCellSpace : "Tarpas tarp langelių",
DlgTableCellPad : "Trapas nuo langelio rėmo iki teksto",
DlgTableCaption : "Antraštė",
DlgTableSummary : "Santrauka",
 
// Table Cell Dialog
DlgCellTitle : "Langelio savybės",
DlgCellWidth : "Plotis",
DlgCellWidthPx : "taškais",
DlgCellWidthPc : "procentais",
DlgCellHeight : "Aukštis",
DlgCellWordWrap : "Teksto laužymas",
DlgCellWordWrapNotSet : "<Nenustatyta>",
DlgCellWordWrapYes : "Taip",
DlgCellWordWrapNo : "Ne",
DlgCellHorAlign : "Horizontaliai lygiuoti",
DlgCellHorAlignNotSet : "<Nenustatyta>",
DlgCellHorAlignLeft : "Kairę",
DlgCellHorAlignCenter : "Centrą",
DlgCellHorAlignRight: "Dešinę",
DlgCellVerAlign : "Vertikaliai lygiuoti",
DlgCellVerAlignNotSet : "<Nenustatyta>",
DlgCellVerAlignTop : "Viršų",
DlgCellVerAlignMiddle : "Vidurį",
DlgCellVerAlignBottom : "Apačią",
DlgCellVerAlignBaseline : "Apatinę liniją",
DlgCellRowSpan : "Eilučių apjungimas",
DlgCellCollSpan : "Stulpelių apjungimas",
DlgCellBackColor : "Fono spalva",
DlgCellBorderColor : "Rėmelio spalva",
DlgCellBtnSelect : "Pažymėti...",
 
// Find Dialog
DlgFindTitle : "Paieška",
DlgFindFindBtn : "Surasti",
DlgFindNotFoundMsg : "Nurodytas tekstas nerastas.",
 
// Replace Dialog
DlgReplaceTitle : "Pakeisti",
DlgReplaceFindLbl : "Surasti tekstą:",
DlgReplaceReplaceLbl : "Pakeisti tekstu:",
DlgReplaceCaseChk : "Skirti didžiąsias ir mažąsias raides",
DlgReplaceReplaceBtn : "Pakeisti",
DlgReplaceReplAllBtn : "Pakeisti viską",
DlgReplaceWordChk : "Atitikti pilną žodį",
 
// Paste Operations / Dialog
PasteErrorPaste : "Jūsų naršyklės saugumo nustatymai neleidžia redaktoriui automatiškai įvykdyti įdėjimo operacijų. Tam prašome naudoti klaviatūrą (Ctrl+V).",
PasteErrorCut : "Jūsų naršyklės saugumo nustatymai neleidžia redaktoriui automatiškai įvykdyti iškirpimo operacijų. Tam prašome naudoti klaviatūrą (Ctrl+X).",
PasteErrorCopy : "Jūsų naršyklės saugumo nustatymai neleidžia redaktoriui automatiškai įvykdyti kopijavimo operacijų. Tam prašome naudoti klaviatūrą (Ctrl+C).",
 
PasteAsText : "Įdėti kaip gryną tekstą",
PasteFromWord : "Ä®dėti i¨Word",
 
DlgPasteMsg2 : "Žemiau esančiame įvedimo lauke įdėkite tekstą, naudodami klaviatūrą (<STRONG>Ctrl+V</STRONG>) ir spūstelkite mygtuką <STRONG>OK</STRONG>.",
DlgPasteIgnoreFont : "Ignoruoti šriftų nustatymus",
DlgPasteRemoveStyles : "Pašalinti stilių nustatymus",
DlgPasteCleanBox : "Trinti įvedimo lauką",
 
// Color Picker
ColorAutomatic : "Automatinis",
ColorMoreColors : "Daugiau spalvų...",
 
// Document Properties
DocProps : "Dokumento savybės",
 
// Anchor Dialog
DlgAnchorTitle : "Žymės savybės",
DlgAnchorName : "Žymės vardas",
DlgAnchorErrorName : "Prašome įvesti žymės vardą",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Žodyne nerastas",
DlgSpellChangeTo : "Pakeisti į",
DlgSpellBtnIgnore : "Ignoruoti",
DlgSpellBtnIgnoreAll : "Ignoruoti visus",
DlgSpellBtnReplace : "Pakeisti",
DlgSpellBtnReplaceAll : "Pakeisti visus",
DlgSpellBtnUndo : "Atšaukti",
DlgSpellNoSuggestions : "- Nėra pasiūlymų -",
DlgSpellProgress : "Vyksta rašybos tikrinimas...",
DlgSpellNoMispell : "Rašybos tikrinimas baigtas: Nerasta rašybos klaidų",
DlgSpellNoChanges : "Rašybos tikrinimas baigtas: Nėra pakeistų žodžių",
DlgSpellOneChange : "Rašybos tikrinimas baigtas: Vienas žodis pakeistas",
DlgSpellManyChanges : "Rašybos tikrinimas baigtas: Pakeista %1 žodžių",
 
IeSpellDownload : "Rašybos tikrinimas neinstaliuotas. Ar Jūs norite jį dabar atsisiųsti?",
 
// Button Dialog
DlgButtonText : "Tekstas (Reikšmė)",
DlgButtonType : "Tipas",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Vardas",
DlgCheckboxValue : "Reikšmė",
DlgCheckboxSelected : "Pažymėtas",
 
// Form Dialog
DlgFormName : "Vardas",
DlgFormAction : "Veiksmas",
DlgFormMethod : "Metodas",
 
// Select Field Dialog
DlgSelectName : "Vardas",
DlgSelectValue : "Reikšmė",
DlgSelectSize : "Dydis",
DlgSelectLines : "eilučių",
DlgSelectChkMulti : "Leisti daugeriopą atranką",
DlgSelectOpAvail : "Galimos parinktys",
DlgSelectOpText : "Tekstas",
DlgSelectOpValue : "Reikšmė",
DlgSelectBtnAdd : "Įtraukti",
DlgSelectBtnModify : "Modifikuoti",
DlgSelectBtnUp : "Aukštyn",
DlgSelectBtnDown : "Žemyn",
DlgSelectBtnSetValue : "Laikyti pažymėta reikšme",
DlgSelectBtnDelete : "Trinti",
 
// Textarea Dialog
DlgTextareaName : "Vardas",
DlgTextareaCols : "Ilgis",
DlgTextareaRows : "Plotis",
 
// Text Field Dialog
DlgTextName : "Vardas",
DlgTextValue : "Reikšmė",
DlgTextCharWidth : "Ilgis simboliais",
DlgTextMaxChars : "Maksimalus simbolių skaičius",
DlgTextType : "Tipas",
DlgTextTypeText : "Tekstas",
DlgTextTypePass : "Slaptažodis",
 
// Hidden Field Dialog
DlgHiddenName : "Vardas",
DlgHiddenValue : "Reikšmė",
 
// Bulleted List Dialog
BulletedListProp : "Suženklinto sąrašo savybės",
NumberedListProp : "Numeruoto sąrašo savybės",
DlgLstStart : "Start", //MISSING
DlgLstType : "Tipas",
DlgLstTypeCircle : "Apskritimas",
DlgLstTypeDisc : "Diskas",
DlgLstTypeSquare : "Kvadratas",
DlgLstTypeNumbers : "Skaičiai (1, 2, 3)",
DlgLstTypeLCase : "Mažosios raidės (a, b, c)",
DlgLstTypeUCase : "Didžiosios raidės (A, B, C)",
DlgLstTypeSRoman : "Romėnų mažieji skaičiai (i, ii, iii)",
DlgLstTypeLRoman : "Romėnų didieji skaičiai (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "Bendros savybės",
DlgDocBackTab : "Fonas",
DlgDocColorsTab : "Spalvos ir kraštinės",
DlgDocMetaTab : "Meta duomenys",
 
DlgDocPageTitle : "Puslapio antraštė",
DlgDocLangDir : "Kalbos kryptis",
DlgDocLangDirLTR : "I¨kairės į deÅ¡inę (LTR)",
DlgDocLangDirRTL : "I¨deÅ¡inės į kairę (RTL)",
DlgDocLangCode : "Kalbos kodas",
DlgDocCharSet : "Simbolių kodavimo lentelė",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "Kita simbolių kodavimo lentelė",
 
DlgDocDocType : "Dokumento tipo antraštė",
DlgDocDocTypeOther : "Kita dokumento tipo antraštė",
DlgDocIncXHTML : "Įtraukti XHTML deklaracijas",
DlgDocBgColor : "Fono spalva",
DlgDocBgImage : "Fono paveikslėlio nuoroda (URL)",
DlgDocBgNoScroll : "Neslenkantis fonas",
DlgDocCText : "Tekstas",
DlgDocCLink : "Nuoroda",
DlgDocCVisited : "Aplankyta nuoroda",
DlgDocCActive : "Aktyvi nuoroda",
DlgDocMargins : "Puslapio kraštinės",
DlgDocMaTop : "Viršuje",
DlgDocMaLeft : "Kairėje",
DlgDocMaRight : "Dešinėje",
DlgDocMaBottom : "Apačioje",
DlgDocMeIndex : "Dokumento indeksavimo raktiniai žodžiai (atskirti kableliais)",
DlgDocMeDescr : "Dokumento apibūdinimas",
DlgDocMeAuthor : "Autorius",
DlgDocMeCopy : "Autorinės teisės",
DlgDocPreview : "Peržiūra",
 
// Templates Dialog
Templates : "Šablonai",
DlgTemplatesTitle : "Turinio šablonai",
DlgTemplatesSelMsg : "Pasirinkite norimą šabloną<br>(<b>Dėmesio!</b> esamas turinys bus prarastas):",
DlgTemplatesLoading : "Įkeliamas šablonų sąrašas. Prašome palaukti...",
DlgTemplatesNoTpl : "(Šablonų sąrašas tuščias)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "Apie",
DlgAboutBrowserInfoTab : "Naršyklės informacija",
DlgAboutLicenseTab : "License", //MISSING
DlgAboutVersion : "versija",
DlgAboutLicense : "Licencijuota pagal GNU mažesnės atsakomybės pagrindinės viešos licencijos sąlygas",
DlgAboutInfo : "Papildomą informaciją galima gauti"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/sr-latn.js
New file
0,0 → 1,501
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: sr-latn.js
* Serbian (Latin) language file.
*
* File Authors:
* Zoran Subic (zoran@tf.zr.ac.yu)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Smanji liniju sa alatkama",
ToolbarExpand : "Proiri liniju sa alatkama",
 
// Toolbar Items and Context Menu
Save : "Sačuvaj",
NewPage : "Nova stranica",
Preview : "Izgled stranice",
Cut : "Iseci",
Copy : "Kopiraj",
Paste : "Zalepi",
PasteText : "Zalepi kao neformatiran tekst",
PasteWord : "Zalepi iz Worda",
Print : "Štampa",
SelectAll : "Označi sve",
RemoveFormat : "Ukloni formatiranje",
InsertLinkLbl : "Link",
InsertLink : "Unesi/izmeni link",
RemoveLink : "Ukloni link",
Anchor : "Unesi/izmeni sidro",
InsertImageLbl : "Slika",
InsertImage : "Unesi/izmeni sliku",
InsertFlashLbl : "Fleš",
InsertFlash : "Unesi/izmeni fleš",
InsertTableLbl : "Tabela",
InsertTable : "Unesi/izmeni tabelu",
InsertLineLbl : "Linija",
InsertLine : "Unesi horizontalnu liniju",
InsertSpecialCharLbl: "Specijalni karakteri",
InsertSpecialChar : "Unesi specijalni karakter",
InsertSmileyLbl : "Smajli",
InsertSmiley : "Unesi smajlija",
About : "O FCKeditoru",
Bold : "Podebljano",
Italic : "Kurziv",
Underline : "Podvučeno",
StrikeThrough : "Precrtano",
Subscript : "Indeks",
Superscript : "Stepen",
LeftJustify : "Levo ravnanje",
CenterJustify : "Centriran tekst",
RightJustify : "Desno ravnanje",
BlockJustify : "Obostrano ravnanje",
DecreaseIndent : "Smanji levu marginu",
IncreaseIndent : "Uvećaj levu marginu",
Undo : "Poniàti akciju",
Redo : "Ponovi akciju",
NumberedListLbl : "Nabrojiva lista",
NumberedList : "Unesi/ukloni nabrojivu listu",
BulletedListLbl : "Nenabrojiva lista",
BulletedList : "Unesi/ukloni nenabrojivu listu",
ShowTableBorders : "Prikaži okvir tabele",
ShowDetails : "Prikaži detalje",
Style : "Stil",
FontFormat : "Format",
Font : "Font",
FontSize : "Veličina fonta",
TextColor : "Boja teksta",
BGColor : "Boja pozadine",
Source : "Kôd",
Find : "Pretraga",
Replace : "Zamena",
SpellCheck : "Proveri spelovanje",
UniversalKeyboard : "Univerzalna tastatura",
PageBreakLbl : "Page Break", //MISSING
PageBreak : "Insert Page Break", //MISSING
 
Form : "Forma",
Checkbox : "Polje za potvrdu",
RadioButton : "Radio-dugme",
TextField : "Tekstualno polje",
Textarea : "Zona teksta",
HiddenField : "Skriveno polje",
Button : "Dugme",
SelectionField : "Izborno polje",
ImageButton : "Dugme sa slikom",
 
FitWindow : "Maximize the editor size", //MISSING
 
// Context Menu
EditLink : "Izmeni link",
CellCM : "Cell", //MISSING
RowCM : "Row", //MISSING
ColumnCM : "Column", //MISSING
InsertRow : "Unesi red",
DeleteRows : "Obriši redove",
InsertColumn : "Unesi kolonu",
DeleteColumns : "Obriši kolone",
InsertCell : "Unesi ćelije",
DeleteCells : "Obriši ćelije",
MergeCells : "Spoj celije",
SplitCell : "Razdvoji celije",
TableDelete : "Delete Table", //MISSING
CellProperties : "Osobine celije",
TableProperties : "Osobine tabele",
ImageProperties : "Osobine slike",
FlashProperties : "Osobine fleša",
 
AnchorProp : "Osobine sidra",
ButtonProp : "Osobine dugmeta",
CheckboxProp : "Osobine polja za potvrdu",
HiddenFieldProp : "Osobine skrivenog polja",
RadioButtonProp : "Osobine radio-dugmeta",
ImageButtonProp : "Osobine dugmeta sa slikom",
TextFieldProp : "Osobine tekstualnog polja",
SelectionFieldProp : "Osobine izbornog polja",
TextareaProp : "Osobine zone teksta",
FormProp : "Osobine forme",
 
FontFormats : "Normal;Formatirano;Adresa;Naslov 1;Naslov 2;Naslov 3;Naslov 4;Naslov 5;Naslov 6",
 
// Alerts and Messages
ProcessingXHTML : "Obradujem XHTML. Malo strpljenja...",
Done : "Završio",
PasteWordConfirm : "Tekst koji želite da nalepite kopiran je iz Worda. Da li želite da bude očišćen od formata pre lepljenja?",
NotCompatiblePaste : "Ova komanda je dostupna samo za Internet Explorer od verzije 5.5. Da li želite da nalepim tekst bez čišćenja?",
UnknownToolbarItem : "Nepoznata stavka toolbara \"%1\"",
UnknownCommand : "Nepoznata naredba \"%1\"",
NotImplemented : "Naredba nije implementirana",
UnknownToolbarSet : "Toolbar \"%1\" ne postoji",
NoActiveX : "Your browser's security settings could limit some features of the editor. You must enable the option \"Run ActiveX controls and plug-ins\". You may experience errors and notice missing features.", //MISSING
BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.", //MISSING
DialogBlocked : "It was not possible to open the dialog window. Make sure all popup blockers are disabled.", //MISSING
 
// Dialogs
DlgBtnOK : "OK",
DlgBtnCancel : "Otkaži",
DlgBtnClose : "Zatvori",
DlgBtnBrowseServer : "Pretraži server",
DlgAdvancedTag : "Napredni tagovi",
DlgOpOther : "<Ostali>",
DlgInfoTab : "Info",
DlgAlertUrl : "Molimo Vas, unesite URL",
 
// General Dialogs Labels
DlgGenNotSet : "<nije postavljeno>",
DlgGenId : "Id",
DlgGenLangDir : "Smer jezika",
DlgGenLangDirLtr : "S leva na desno (LTR)",
DlgGenLangDirRtl : "S desna na levo (RTL)",
DlgGenLangCode : "Kôd jezika",
DlgGenAccessKey : "Pristupni taster",
DlgGenName : "Naziv",
DlgGenTabIndex : "Tab indeks",
DlgGenLongDescr : "Pun opis URL",
DlgGenClass : "Stylesheet klase",
DlgGenTitle : "Advisory naslov",
DlgGenContType : "Advisory vrsta sadržaja",
DlgGenLinkCharset : "Linked Resource Charset",
DlgGenStyle : "Stil",
 
// Image Dialog
DlgImgTitle : "Osobine slika",
DlgImgInfoTab : "Info slike",
DlgImgBtnUpload : "Pošalji na server",
DlgImgURL : "URL",
DlgImgUpload : "Pošalji",
DlgImgAlt : "Alternativni tekst",
DlgImgWidth : "Širina",
DlgImgHeight : "Visina",
DlgImgLockRatio : "Zaključaj odnos",
DlgBtnResetSize : "Resetuj veličinu",
DlgImgBorder : "Okvir",
DlgImgHSpace : "HSpace",
DlgImgVSpace : "VSpace",
DlgImgAlign : "Ravnanje",
DlgImgAlignLeft : "Levo",
DlgImgAlignAbsBottom: "Abs dole",
DlgImgAlignAbsMiddle: "Abs sredina",
DlgImgAlignBaseline : "Bazno",
DlgImgAlignBottom : "Dole",
DlgImgAlignMiddle : "Sredina",
DlgImgAlignRight : "Desno",
DlgImgAlignTextTop : "Vrh teksta",
DlgImgAlignTop : "Vrh",
DlgImgPreview : "Izgled",
DlgImgAlertUrl : "Unesite URL slike",
DlgImgLinkTab : "Link",
 
// Flash Dialog
DlgFlashTitle : "Osobine fleša",
DlgFlashChkPlay : "Automatski start",
DlgFlashChkLoop : "Ponavljaj",
DlgFlashChkMenu : "Uključi fle¨meni",
DlgFlashScale : "Skaliraj",
DlgFlashScaleAll : "Prikaži sve",
DlgFlashScaleNoBorder : "Bez ivice",
DlgFlashScaleFit : "Popuni površinu",
 
// Link Dialog
DlgLnkWindowTitle : "Link",
DlgLnkInfoTab : "Link Info",
DlgLnkTargetTab : "Meta",
 
DlgLnkType : "Vrsta linka",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Sidro na ovoj stranici",
DlgLnkTypeEMail : "E-Mail",
DlgLnkProto : "Protokol",
DlgLnkProtoOther : "<drugo>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Odaberi sidro",
DlgLnkAnchorByName : "Po nazivu sidra",
DlgLnkAnchorById : "Po Id-ju elementa",
DlgLnkNoAnchors : "<Nema dostupnih sidra>",
DlgLnkEMail : "E-Mail adresa",
DlgLnkEMailSubject : "Naslov",
DlgLnkEMailBody : "Sadržaj poruke",
DlgLnkUpload : "Pošalji",
DlgLnkBtnUpload : "Pošalji na server",
 
DlgLnkTarget : "Meta",
DlgLnkTargetFrame : "<okvir>",
DlgLnkTargetPopup : "<popup prozor>",
DlgLnkTargetBlank : "Novi prozor (_blank)",
DlgLnkTargetParent : "Roditeljski prozor (_parent)",
DlgLnkTargetSelf : "Isti prozor (_self)",
DlgLnkTargetTop : "Prozor na vrhu (_top)",
DlgLnkTargetFrameName : "Naziv odredišnog frejma",
DlgLnkPopWinName : "Naziv popup prozora",
DlgLnkPopWinFeat : "Mogućnosti popup prozora",
DlgLnkPopResize : "Promenljiva velicina",
DlgLnkPopLocation : "Lokacija",
DlgLnkPopMenu : "Kontekstni meni",
DlgLnkPopScroll : "Scroll bar",
DlgLnkPopStatus : "Statusna linija",
DlgLnkPopToolbar : "Toolbar",
DlgLnkPopFullScrn : "Prikaz preko celog ekrana (IE)",
DlgLnkPopDependent : "Zavisno (Netscape)",
DlgLnkPopWidth : "Širina",
DlgLnkPopHeight : "Visina",
DlgLnkPopLeft : "Od leve ivice ekrana (px)",
DlgLnkPopTop : "Od vrha ekrana (px)",
 
DlnLnkMsgNoUrl : "Unesite URL linka",
DlnLnkMsgNoEMail : "Otkucajte adresu elektronske pote",
DlnLnkMsgNoAnchor : "Odaberite sidro",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "Odaberite boju",
DlgColorBtnClear : "Obriši",
DlgColorHighlight : "Posvetli",
DlgColorSelected : "Odaberi",
 
// Smiley Dialog
DlgSmileyTitle : "Unesi smajlija",
 
// Special Character Dialog
DlgSpecialCharTitle : "Odaberite specijalni karakter",
 
// Table Dialog
DlgTableTitle : "Osobine tabele",
DlgTableRows : "Redova",
DlgTableColumns : "Kolona",
DlgTableBorder : "Veličina okvira",
DlgTableAlign : "Ravnanje",
DlgTableAlignNotSet : "<nije postavljeno>",
DlgTableAlignLeft : "Levo",
DlgTableAlignCenter : "Sredina",
DlgTableAlignRight : "Desno",
DlgTableWidth : "Širina",
DlgTableWidthPx : "piksela",
DlgTableWidthPc : "procenata",
DlgTableHeight : "Visina",
DlgTableCellSpace : "Ćelijski prostor",
DlgTableCellPad : "Razmak ćelija",
DlgTableCaption : "Naslov tabele",
DlgTableSummary : "Summary", //MISSING
 
// Table Cell Dialog
DlgCellTitle : "Osobine ćelije",
DlgCellWidth : "Širina",
DlgCellWidthPx : "piksela",
DlgCellWidthPc : "procenata",
DlgCellHeight : "Visina",
DlgCellWordWrap : "Deljenje reči",
DlgCellWordWrapNotSet : "<nije postavljeno>",
DlgCellWordWrapYes : "Da",
DlgCellWordWrapNo : "Ne",
DlgCellHorAlign : "Vodoravno ravnanje",
DlgCellHorAlignNotSet : "<nije postavljeno>",
DlgCellHorAlignLeft : "Levo",
DlgCellHorAlignCenter : "Sredina",
DlgCellHorAlignRight: "Desno",
DlgCellVerAlign : "Vertikalno ravnanje",
DlgCellVerAlignNotSet : "<nije postavljeno>",
DlgCellVerAlignTop : "Gornje",
DlgCellVerAlignMiddle : "Sredina",
DlgCellVerAlignBottom : "Donje",
DlgCellVerAlignBaseline : "Bazno",
DlgCellRowSpan : "Spajanje redova",
DlgCellCollSpan : "Spajanje kolona",
DlgCellBackColor : "Boja pozadine",
DlgCellBorderColor : "Boja okvira",
DlgCellBtnSelect : "Odaberi...",
 
// Find Dialog
DlgFindTitle : "Pronađi",
DlgFindFindBtn : "Pronađi",
DlgFindNotFoundMsg : "Traženi tekst nije pronađen.",
 
// Replace Dialog
DlgReplaceTitle : "Zameni",
DlgReplaceFindLbl : "Pronadi:",
DlgReplaceReplaceLbl : "Zameni sa:",
DlgReplaceCaseChk : "Razlikuj mala i velika slova",
DlgReplaceReplaceBtn : "Zameni",
DlgReplaceReplAllBtn : "Zameni sve",
DlgReplaceWordChk : "Uporedi cele reci",
 
// Paste Operations / Dialog
PasteErrorPaste : "Sigurnosna podešavanja Vašeg pretraživača ne dozvoljavaju operacije automatskog lepljenja teksta. Molimo Vas da koristite prečicu sa tastature (Ctrl+V).",
PasteErrorCut : "Sigurnosna podešavanja Vašeg pretraživača ne dozvoljavaju operacije automatskog isecanja teksta. Molimo Vas da koristite prečicu sa tastature (Ctrl+X).",
PasteErrorCopy : "Sigurnosna podešavanja Vašeg pretraživača ne dozvoljavaju operacije automatskog kopiranja teksta. Molimo Vas da koristite prečicu sa tastature (Ctrl+C).",
 
PasteAsText : "Zalepi kao čist tekst",
PasteFromWord : "Zalepi iz Worda",
 
DlgPasteMsg2 : "Molimo Vas da zalepite unutar donje povrine koristeći tastaturnu prečicu (<STRONG>Ctrl+V</STRONG>) i da pritisnete <STRONG>OK</STRONG>.",
DlgPasteIgnoreFont : "Ignoriši definicije fontova",
DlgPasteRemoveStyles : "Ukloni definicije stilova",
DlgPasteCleanBox : "Obriši sve",
 
// Color Picker
ColorAutomatic : "Automatski",
ColorMoreColors : "Više boja...",
 
// Document Properties
DocProps : "Osobine dokumenta",
 
// Anchor Dialog
DlgAnchorTitle : "Osobine sidra",
DlgAnchorName : "Ime sidra",
DlgAnchorErrorName : "Unesite ime sidra",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Nije u rečniku",
DlgSpellChangeTo : "Izmeni",
DlgSpellBtnIgnore : "Ignoriši",
DlgSpellBtnIgnoreAll : "Ignoriši sve",
DlgSpellBtnReplace : "Zameni",
DlgSpellBtnReplaceAll : "Zameni sve",
DlgSpellBtnUndo : "Vrati akciju",
DlgSpellNoSuggestions : "- Bez sugestija -",
DlgSpellProgress : "Provera spelovanja u toku...",
DlgSpellNoMispell : "Provera spelovanja završena: greške nisu pronadene",
DlgSpellNoChanges : "Provera spelovanja završena: Nije izmenjena nijedna rec",
DlgSpellOneChange : "Provera spelovanja završena: Izmenjena je jedna reč",
DlgSpellManyChanges : "Provera spelovanja završena: %1 reč(i) je izmenjeno",
 
IeSpellDownload : "Provera spelovanja nije instalirana. Da li želite da je skinete sa Interneta?",
 
// Button Dialog
DlgButtonText : "Tekst (vrednost)",
DlgButtonType : "Tip",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Naziv",
DlgCheckboxValue : "Vrednost",
DlgCheckboxSelected : "Označeno",
 
// Form Dialog
DlgFormName : "Naziv",
DlgFormAction : "Akcija",
DlgFormMethod : "Metoda",
 
// Select Field Dialog
DlgSelectName : "Naziv",
DlgSelectValue : "Vrednost",
DlgSelectSize : "Veličina",
DlgSelectLines : "linija",
DlgSelectChkMulti : "Dozvoli višestruku selekciju",
DlgSelectOpAvail : "Dostupne opcije",
DlgSelectOpText : "Tekst",
DlgSelectOpValue : "Vrednost",
DlgSelectBtnAdd : "Dodaj",
DlgSelectBtnModify : "Izmeni",
DlgSelectBtnUp : "Gore",
DlgSelectBtnDown : "Dole",
DlgSelectBtnSetValue : "Podesi kao označenu vrednost",
DlgSelectBtnDelete : "Obriši",
 
// Textarea Dialog
DlgTextareaName : "Naziv",
DlgTextareaCols : "Broj kolona",
DlgTextareaRows : "Broj redova",
 
// Text Field Dialog
DlgTextName : "Naziv",
DlgTextValue : "Vrednost",
DlgTextCharWidth : "Širina (karaktera)",
DlgTextMaxChars : "Maksimalno karaktera",
DlgTextType : "Tip",
DlgTextTypeText : "Tekst",
DlgTextTypePass : "Lozinka",
 
// Hidden Field Dialog
DlgHiddenName : "Naziv",
DlgHiddenValue : "Vrednost",
 
// Bulleted List Dialog
BulletedListProp : "Osobine nenabrojive liste",
NumberedListProp : "Osobine nabrojive liste",
DlgLstStart : "Start", //MISSING
DlgLstType : "Tip",
DlgLstTypeCircle : "Krug",
DlgLstTypeDisc : "Disc", //MISSING
DlgLstTypeSquare : "Kvadrat",
DlgLstTypeNumbers : "Brojevi (1, 2, 3)",
DlgLstTypeLCase : "mala slova (a, b, c)",
DlgLstTypeUCase : "VELIKA slova (A, B, C)",
DlgLstTypeSRoman : "Male rimske cifre (i, ii, iii)",
DlgLstTypeLRoman : "Velike rimske cifre (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "Opšte osobine",
DlgDocBackTab : "Pozadina",
DlgDocColorsTab : "Boje i margine",
DlgDocMetaTab : "Metapodaci",
 
DlgDocPageTitle : "Naslov stranice",
DlgDocLangDir : "Smer jezika",
DlgDocLangDirLTR : "Sleva nadesno (LTR)",
DlgDocLangDirRTL : "Zdesna nalevo (RTL)",
DlgDocLangCode : "Šifra jezika",
DlgDocCharSet : "Kodiranje skupa karaktera",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "Ostala kodiranja skupa karaktera",
 
DlgDocDocType : "Zaglavlje tipa dokumenta",
DlgDocDocTypeOther : "Ostala zaglavlja tipa dokumenta",
DlgDocIncXHTML : "Ukljuci XHTML deklaracije",
DlgDocBgColor : "Boja pozadine",
DlgDocBgImage : "URL pozadinske slike",
DlgDocBgNoScroll : "Fiksirana pozadina",
DlgDocCText : "Tekst",
DlgDocCLink : "Link",
DlgDocCVisited : "Posećeni link",
DlgDocCActive : "Aktivni link",
DlgDocMargins : "Margine stranice",
DlgDocMaTop : "Gornja",
DlgDocMaLeft : "Leva",
DlgDocMaRight : "Desna",
DlgDocMaBottom : "Donja",
DlgDocMeIndex : "Ključne reci za indeksiranje dokumenta (razdvojene zarezima)",
DlgDocMeDescr : "Opis dokumenta",
DlgDocMeAuthor : "Autor",
DlgDocMeCopy : "Autorska prava",
DlgDocPreview : "Izgled stranice",
 
// Templates Dialog
Templates : "Obrasci",
DlgTemplatesTitle : "Obrasci za sadržaj",
DlgTemplatesSelMsg : "Molimo Vas da odaberete obrazac koji ce biti primenjen na stranicu (trenutni sadržaj ce biti obrisan):",
DlgTemplatesLoading : "Učitavam listu obrazaca. Malo strpljenja...",
DlgTemplatesNoTpl : "(Nema definisanih obrazaca)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "O editoru",
DlgAboutBrowserInfoTab : "Informacije o pretraživacu",
DlgAboutLicenseTab : "License", //MISSING
DlgAboutVersion : "verzija",
DlgAboutLicense : "Licencirano pod uslovima GNU Lesser General Public License",
DlgAboutInfo : "Za više informacija posetite"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/zh.js
New file
0,0 → 1,501
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: zh.js
* Chinese Traditional language file.
*
* File Authors:
* Zak Fong (zakfong@yahoo.com.tw)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "隱藏面板",
ToolbarExpand : "顯示面板",
 
// Toolbar Items and Context Menu
Save : "儲存",
NewPage : "開新檔案",
Preview : "預覽",
Cut : "剪下",
Copy : "複製",
Paste : "貼上",
PasteText : "貼為純文字格式",
PasteWord : "自 Word 貼上",
Print : "列印",
SelectAll : "全選",
RemoveFormat : "清除格式",
InsertLinkLbl : "超連結",
InsertLink : "插入/編輯超連結",
RemoveLink : "移除超連結",
Anchor : "插入/編輯錨點",
InsertImageLbl : "影像",
InsertImage : "插入/編輯影像",
InsertFlashLbl : "Flash",
InsertFlash : "插入/編輯 Flash",
InsertTableLbl : "表格",
InsertTable : "插入/編輯表格",
InsertLineLbl : "水平線",
InsertLine : "插入水平線",
InsertSpecialCharLbl: "特殊符號",
InsertSpecialChar : "插入特殊符號",
InsertSmileyLbl : "表情符號",
InsertSmiley : "插入表情符號",
About : "關於 FCKeditor",
Bold : "粗體",
Italic : "斜體",
Underline : "底線",
StrikeThrough : "刪除線",
Subscript : "下標",
Superscript : "上標",
LeftJustify : "靠左對齊",
CenterJustify : "置中",
RightJustify : "靠右對齊",
BlockJustify : "左右對齊",
DecreaseIndent : "減少縮排",
IncreaseIndent : "增加縮排",
Undo : "復原",
Redo : "重複",
NumberedListLbl : "編號清單",
NumberedList : "插入/移除編號清單",
BulletedListLbl : "項目清單",
BulletedList : "插入/移除項目清單",
ShowTableBorders : "顯示表格邊框",
ShowDetails : "顯示詳細資料",
Style : "樣式",
FontFormat : "格式",
Font : "字體",
FontSize : "大小",
TextColor : "文字顏色",
BGColor : "背景顏色",
Source : "原始碼",
Find : "尋找",
Replace : "取代",
SpellCheck : "拼字檢查",
UniversalKeyboard : "萬國鍵盤",
PageBreakLbl : "分頁符號",
PageBreak : "插入分頁符號",
 
Form : "表單",
Checkbox : "核取方塊",
RadioButton : "選項按鈕",
TextField : "文字方塊",
Textarea : "文字區域",
HiddenField : "隱藏欄位",
Button : "按鈕",
SelectionField : "清單/選單",
ImageButton : "影像按鈕",
 
FitWindow : "編輯器最大化",
 
// Context Menu
EditLink : "編輯超連結",
CellCM : "儲存格",
RowCM : "列",
ColumnCM : "欄",
InsertRow : "插入列",
DeleteRows : "刪除列",
InsertColumn : "插入欄",
DeleteColumns : "刪除欄",
InsertCell : "插入儲存格",
DeleteCells : "刪除儲存格",
MergeCells : "合併儲存格",
SplitCell : "分割儲存格",
TableDelete : "刪除表格",
CellProperties : "儲存格屬性",
TableProperties : "表格屬性",
ImageProperties : "影像屬性",
FlashProperties : "Flash 屬性",
 
AnchorProp : "錨點屬性",
ButtonProp : "按鈕屬性",
CheckboxProp : "核取方塊屬性",
HiddenFieldProp : "隱藏欄位屬性",
RadioButtonProp : "選項按鈕屬性",
ImageButtonProp : "影像按鈕屬性",
TextFieldProp : "文字方塊屬性",
SelectionFieldProp : "清單/選單屬性",
TextareaProp : "文字區域屬性",
FormProp : "表單屬性",
 
FontFormats : "本文;已格式化;位址;標題 1;標題 2;標題 3;標題 4;標題 5;標題 6;本文 (DIV)",
 
// Alerts and Messages
ProcessingXHTML : "處理 XHTML 中,請稍候…",
Done : "完成",
PasteWordConfirm : "您想貼上的文字似乎是自 Word 複製而來,請問您是否要先清除 Word 的格式後再行貼上?",
NotCompatiblePaste : "此指令僅在 Internet Explorer 5.5 或以上的版本有效。請問您是否同意不清除格式即貼上?",
UnknownToolbarItem : "未知工具列項目 \"%1\"",
UnknownCommand : "未知指令名稱 \"%1\"",
NotImplemented : "尚未安裝此指令",
UnknownToolbarSet : "工具列設定 \"%1\" 不存在",
NoActiveX : "瀏覽器的安全性設定限制了本編輯器的某些功能。您必須啟用安全性設定中的「執行ActiveX控制項與外掛程式」項目,否則本編輯器將會出現錯誤並缺少某些功能",
BrowseServerBlocked : "無法開啟資源瀏覽器,請確定所有快顯視窗封鎖程式是否關閉",
DialogBlocked : "無法開啟對話視窗,請確定所有快顯視窗封鎖程式是否關閉",
 
// Dialogs
DlgBtnOK : "確定",
DlgBtnCancel : "取消",
DlgBtnClose : "關閉",
DlgBtnBrowseServer : "瀏覽伺服器端",
DlgAdvancedTag : "進階",
DlgOpOther : "<其他>",
DlgInfoTab : "資訊",
DlgAlertUrl : "請插入 URL",
 
// General Dialogs Labels
DlgGenNotSet : "<尚未設定>",
DlgGenId : "ID",
DlgGenLangDir : "語言方向",
DlgGenLangDirLtr : "由左而右 (LTR)",
DlgGenLangDirRtl : "由右而左 (RTL)",
DlgGenLangCode : "語言代碼",
DlgGenAccessKey : "存取鍵",
DlgGenName : "名稱",
DlgGenTabIndex : "定位順序",
DlgGenLongDescr : "詳細 URL",
DlgGenClass : "樣式表類別",
DlgGenTitle : "標題",
DlgGenContType : "內容類型",
DlgGenLinkCharset : "連結資源之編碼",
DlgGenStyle : "樣式",
 
// Image Dialog
DlgImgTitle : "影像屬性",
DlgImgInfoTab : "影像資訊",
DlgImgBtnUpload : "上傳至伺服器",
DlgImgURL : "URL",
DlgImgUpload : "上傳",
DlgImgAlt : "替代文字",
DlgImgWidth : "寬度",
DlgImgHeight : "高度",
DlgImgLockRatio : "等比例",
DlgBtnResetSize : "重設為原大小",
DlgImgBorder : "邊框",
DlgImgHSpace : "水平距離",
DlgImgVSpace : "垂直距離",
DlgImgAlign : "對齊",
DlgImgAlignLeft : "靠左對齊",
DlgImgAlignAbsBottom: "絕對下方",
DlgImgAlignAbsMiddle: "絕對中間",
DlgImgAlignBaseline : "基準線",
DlgImgAlignBottom : "靠下對齊",
DlgImgAlignMiddle : "置中對齊",
DlgImgAlignRight : "靠右對齊",
DlgImgAlignTextTop : "文字上方",
DlgImgAlignTop : "靠上對齊",
DlgImgPreview : "預覽",
DlgImgAlertUrl : "請輸入影像 URL",
DlgImgLinkTab : "超連結",
 
// Flash Dialog
DlgFlashTitle : "Flash 屬性",
DlgFlashChkPlay : "自動播放",
DlgFlashChkLoop : "重複",
DlgFlashChkMenu : "開啟選單",
DlgFlashScale : "縮放",
DlgFlashScaleAll : "全部顯示",
DlgFlashScaleNoBorder : "無邊框",
DlgFlashScaleFit : "精確符合",
 
// Link Dialog
DlgLnkWindowTitle : "超連結",
DlgLnkInfoTab : "超連結資訊",
DlgLnkTargetTab : "目標",
 
DlgLnkType : "超連接類型",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "本頁錨點",
DlgLnkTypeEMail : "電子郵件",
DlgLnkProto : "通訊協定",
DlgLnkProtoOther : "<其他>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "請選擇錨點",
DlgLnkAnchorByName : "依錨點名稱",
DlgLnkAnchorById : "依元件 ID",
DlgLnkNoAnchors : "<本文件尚無可用之錨點>",
DlgLnkEMail : "電子郵件",
DlgLnkEMailSubject : "郵件主旨",
DlgLnkEMailBody : "郵件內容",
DlgLnkUpload : "上傳",
DlgLnkBtnUpload : "傳送至伺服器",
 
DlgLnkTarget : "目標",
DlgLnkTargetFrame : "<框架>",
DlgLnkTargetPopup : "<快顯視窗>",
DlgLnkTargetBlank : "新視窗 (_blank)",
DlgLnkTargetParent : "父視窗 (_parent)",
DlgLnkTargetSelf : "本視窗 (_self)",
DlgLnkTargetTop : "最上層視窗 (_top)",
DlgLnkTargetFrameName : "目標框架名稱",
DlgLnkPopWinName : "快顯視窗名稱",
DlgLnkPopWinFeat : "快顯視窗屬性",
DlgLnkPopResize : "可調整大小",
DlgLnkPopLocation : "網址列",
DlgLnkPopMenu : "選單列",
DlgLnkPopScroll : "捲軸",
DlgLnkPopStatus : "狀態列",
DlgLnkPopToolbar : "工具列",
DlgLnkPopFullScrn : "全螢幕 (IE)",
DlgLnkPopDependent : "從屬 (NS)",
DlgLnkPopWidth : "寬",
DlgLnkPopHeight : "高",
DlgLnkPopLeft : "左",
DlgLnkPopTop : "右",
 
DlnLnkMsgNoUrl : "請輸入欲連結的 URL",
DlnLnkMsgNoEMail : "請輸入電子郵件位址",
DlnLnkMsgNoAnchor : "請選擇錨點",
DlnLnkMsgInvPopName : "快顯名稱必須以「英文字母」為開頭,且不得含有空白",
 
// Color Dialog
DlgColorTitle : "請選擇顏色",
DlgColorBtnClear : "清除",
DlgColorHighlight : "預覽",
DlgColorSelected : "選擇",
 
// Smiley Dialog
DlgSmileyTitle : "插入表情符號",
 
// Special Character Dialog
DlgSpecialCharTitle : "請選擇特殊符號",
 
// Table Dialog
DlgTableTitle : "表格屬性",
DlgTableRows : "列數",
DlgTableColumns : "欄數",
DlgTableBorder : "邊框",
DlgTableAlign : "對齊",
DlgTableAlignNotSet : "<未設定>",
DlgTableAlignLeft : "靠左對齊",
DlgTableAlignCenter : "置中",
DlgTableAlignRight : "靠右對齊",
DlgTableWidth : "寬度",
DlgTableWidthPx : "像素",
DlgTableWidthPc : "百分比",
DlgTableHeight : "高度",
DlgTableCellSpace : "間距",
DlgTableCellPad : "內距",
DlgTableCaption : "標題",
DlgTableSummary : "摘要",
 
// Table Cell Dialog
DlgCellTitle : "儲存格屬性",
DlgCellWidth : "寬度",
DlgCellWidthPx : "像素",
DlgCellWidthPc : "百分比",
DlgCellHeight : "高度",
DlgCellWordWrap : "自動換行",
DlgCellWordWrapNotSet : "<尚未設定>",
DlgCellWordWrapYes : "是",
DlgCellWordWrapNo : "否",
DlgCellHorAlign : "水平對齊",
DlgCellHorAlignNotSet : "<尚未設定>",
DlgCellHorAlignLeft : "靠左對齊",
DlgCellHorAlignCenter : "置中",
DlgCellHorAlignRight: "靠右對齊",
DlgCellVerAlign : "垂直對齊",
DlgCellVerAlignNotSet : "<尚未設定>",
DlgCellVerAlignTop : "靠上對齊",
DlgCellVerAlignMiddle : "置中",
DlgCellVerAlignBottom : "靠下對齊",
DlgCellVerAlignBaseline : "基準線",
DlgCellRowSpan : "合併列數",
DlgCellCollSpan : "合併欄数",
DlgCellBackColor : "背景顏色",
DlgCellBorderColor : "邊框顏色",
DlgCellBtnSelect : "請選擇…",
 
// Find Dialog
DlgFindTitle : "尋找",
DlgFindFindBtn : "尋找",
DlgFindNotFoundMsg : "未找到指定的文字。",
 
// Replace Dialog
DlgReplaceTitle : "取代",
DlgReplaceFindLbl : "尋找:",
DlgReplaceReplaceLbl : "取代:",
DlgReplaceCaseChk : "大小寫須相符",
DlgReplaceReplaceBtn : "取代",
DlgReplaceReplAllBtn : "全部取代",
DlgReplaceWordChk : "全字相符",
 
// Paste Operations / Dialog
PasteErrorPaste : "瀏覽器的安全性設定不允許編輯器自動執行貼上動作。請使用快捷鍵 (Ctrl+V) 貼上。",
PasteErrorCut : "瀏覽器的安全性設定不允許編輯器自動執行剪下動作。請使用快捷鍵 (Ctrl+X) 剪下。",
PasteErrorCopy : "瀏覽器的安全性設定不允許編輯器自動執行複製動作。請使用快捷鍵 (Ctrl+C) 複製。",
 
PasteAsText : "貼為純文字格式",
PasteFromWord : "自 Word 貼上",
 
DlgPasteMsg2 : "請使用快捷鍵 (<strong>Ctrl+V</strong>) 貼到下方區域中並按下 <strong>確定</strong>",
DlgPasteIgnoreFont : "移除字型設定",
DlgPasteRemoveStyles : "移除樣式設定",
DlgPasteCleanBox : "清除文字區域",
 
// Color Picker
ColorAutomatic : "自動",
ColorMoreColors : "更多顏色…",
 
// Document Properties
DocProps : "文件屬性",
 
// Anchor Dialog
DlgAnchorTitle : "命名錨點",
DlgAnchorName : "錨點名稱",
DlgAnchorErrorName : "請輸入錨點名稱",
 
// Speller Pages Dialog
DlgSpellNotInDic : "不在字典中",
DlgSpellChangeTo : "更改為",
DlgSpellBtnIgnore : "忽略",
DlgSpellBtnIgnoreAll : "全部忽略",
DlgSpellBtnReplace : "取代",
DlgSpellBtnReplaceAll : "全部取代",
DlgSpellBtnUndo : "復原",
DlgSpellNoSuggestions : "- 無建議值 -",
DlgSpellProgress : "進行拼字檢查中…",
DlgSpellNoMispell : "拼字檢查完成:未發現拼字錯誤",
DlgSpellNoChanges : "拼字檢查完成:未更改任何單字",
DlgSpellOneChange : "拼字檢查完成:更改了 1 個單字",
DlgSpellManyChanges : "拼字檢查完成:更改了 %1 個單字",
 
IeSpellDownload : "尚未安裝拼字檢查元件。您是否想要現在下載?",
 
// Button Dialog
DlgButtonText : "顯示文字 (值)",
DlgButtonType : "類型",
DlgButtonTypeBtn : "按鈕 (Button)",
DlgButtonTypeSbm : "送出 (Submit)",
DlgButtonTypeRst : "重設 (Reset)",
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "名稱",
DlgCheckboxValue : "選取值",
DlgCheckboxSelected : "已選取",
 
// Form Dialog
DlgFormName : "名稱",
DlgFormAction : "動作",
DlgFormMethod : "方法",
 
// Select Field Dialog
DlgSelectName : "名稱",
DlgSelectValue : "選取值",
DlgSelectSize : "大小",
DlgSelectLines : "行",
DlgSelectChkMulti : "可多選",
DlgSelectOpAvail : "可用選項",
DlgSelectOpText : "顯示文字",
DlgSelectOpValue : "值",
DlgSelectBtnAdd : "新增",
DlgSelectBtnModify : "修改",
DlgSelectBtnUp : "上移",
DlgSelectBtnDown : "下移",
DlgSelectBtnSetValue : "設為預設值",
DlgSelectBtnDelete : "刪除",
 
// Textarea Dialog
DlgTextareaName : "名稱",
DlgTextareaCols : "字元寬度",
DlgTextareaRows : "列數",
 
// Text Field Dialog
DlgTextName : "名稱",
DlgTextValue : "值",
DlgTextCharWidth : "字元寬度",
DlgTextMaxChars : "最多字元數",
DlgTextType : "類型",
DlgTextTypeText : "文字",
DlgTextTypePass : "密碼",
 
// Hidden Field Dialog
DlgHiddenName : "名稱",
DlgHiddenValue : "值",
 
// Bulleted List Dialog
BulletedListProp : "項目清單屬性",
NumberedListProp : "編號清單屬性",
DlgLstStart : "起始編號",
DlgLstType : "清單類型",
DlgLstTypeCircle : "圓圈",
DlgLstTypeDisc : "圓點",
DlgLstTypeSquare : "方塊",
DlgLstTypeNumbers : "數字 (1, 2, 3)",
DlgLstTypeLCase : "小寫字母 (a, b, c)",
DlgLstTypeUCase : "大寫字母 (A, B, C)",
DlgLstTypeSRoman : "小寫羅馬數字 (i, ii, iii)",
DlgLstTypeLRoman : "大寫羅馬數字 (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "一般",
DlgDocBackTab : "背景",
DlgDocColorsTab : "顯色與邊界",
DlgDocMetaTab : "Meta 資料",
 
DlgDocPageTitle : "頁面標題",
DlgDocLangDir : "語言方向",
DlgDocLangDirLTR : "由左而右 (LTR)",
DlgDocLangDirRTL : "由右而左 (RTL)",
DlgDocLangCode : "語言代碼",
DlgDocCharSet : "字元編碼",
DlgDocCharSetCE : "中歐語系",
DlgDocCharSetCT : "正體中文 (Big5)",
DlgDocCharSetCR : "斯拉夫文",
DlgDocCharSetGR : "希臘文",
DlgDocCharSetJP : "日文",
DlgDocCharSetKR : "韓文",
DlgDocCharSetTR : "土耳其文",
DlgDocCharSetUN : "Unicode (UTF-8)",
DlgDocCharSetWE : "西歐語系",
DlgDocCharSetOther : "其他字元編碼",
 
DlgDocDocType : "文件類型",
DlgDocDocTypeOther : "其他文件類型",
DlgDocIncXHTML : "包含 XHTML 定義",
DlgDocBgColor : "背景顏色",
DlgDocBgImage : "背景影像",
DlgDocBgNoScroll : "浮水印",
DlgDocCText : "文字",
DlgDocCLink : "超連結",
DlgDocCVisited : "已瀏覽過的超連結",
DlgDocCActive : "作用中的超連結",
DlgDocMargins : "頁面邊界",
DlgDocMaTop : "上",
DlgDocMaLeft : "左",
DlgDocMaRight : "右",
DlgDocMaBottom : "下",
DlgDocMeIndex : "文件索引關鍵字 (用半形逗號[,]分隔)",
DlgDocMeDescr : "文件說明",
DlgDocMeAuthor : "作者",
DlgDocMeCopy : "版權所有",
DlgDocPreview : "預覽",
 
// Templates Dialog
Templates : "樣版",
DlgTemplatesTitle : "內容樣版",
DlgTemplatesSelMsg : "請選擇欲開啟的樣版<br> (原有的內容將會被清除):",
DlgTemplatesLoading : "讀取樣版清單中,請稍候…",
DlgTemplatesNoTpl : "(無樣版)",
DlgTemplatesReplace : "取代原有內容",
 
// About Dialog
DlgAboutAboutTab : "關於",
DlgAboutBrowserInfoTab : "瀏覽器資訊",
DlgAboutLicenseTab : "許可證",
DlgAboutVersion : "版本",
DlgAboutLicense : "依據 GNU 較寬鬆公共許可證(LGPL)發佈",
DlgAboutInfo : "想獲得更多資訊請至 "
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/lv.js
New file
0,0 → 1,502
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: lv.js
* Latvian language file.
*
* File Authors:
* Jānis Kļaviņ¨(janis@4id.lv)
* Slowmo (slowmo@inbox.lv)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Samazināt rīku joslu",
ToolbarExpand : "Paplašināt rīku joslu",
 
// Toolbar Items and Context Menu
Save : "Saglabāt",
NewPage : "Jauna lapa",
Preview : "Pārskatīt",
Cut : "Izgriezt",
Copy : "Kopēt",
Paste : "Ievietot",
PasteText : "Ievietot kā vienkāršu tekstu",
PasteWord : "Ievietot no Worda",
Print : "Drukāt",
SelectAll : "Iezīmēt visu",
RemoveFormat : "Noņemt stilus",
InsertLinkLbl : "Hipersaite",
InsertLink : "Ievietot/Labot hipersaiti",
RemoveLink : "Noņemt hipersaiti",
Anchor : "Ievietot/Labot iezīmi",
InsertImageLbl : "Attēls",
InsertImage : "Ievietot/Labot Attēlu",
InsertFlashLbl : "Flash",
InsertFlash : "Ievietot/Labot Flash",
InsertTableLbl : "Tabula",
InsertTable : "Ievietot/Labot Tabulu",
InsertLineLbl : "Atdalītājsvītra",
InsertLine : "Ievietot horizontālu Atdalītājsvītru",
InsertSpecialCharLbl: "Īpašs simbols",
InsertSpecialChar : "Ievietot speciālo simbolu",
InsertSmileyLbl : "Smaidiņi",
InsertSmiley : "Ievietot smaidiņu",
About : "Īsumā par FCKeditor",
Bold : "Treknu šriftu",
Italic : "Slīprakstā",
Underline : "Apakšsvītra",
StrikeThrough : "Pārsvītrots",
Subscript : "Zemrakstā",
Superscript : "Augšrakstā",
LeftJustify : "Izlīdzināt pa kreisi",
CenterJustify : "Izlīdzināt pret centru",
RightJustify : "Izlīdzināt pa labi",
BlockJustify : "Izlīdzināt malas",
DecreaseIndent : "Samazināt atkāpi",
IncreaseIndent : "Palielināt atkāpi",
Undo : "Atcelt",
Redo : "Atkārtot",
NumberedListLbl : "Numurēts saraksts",
NumberedList : "Ievietot/Noņemt numerēto sarakstu",
BulletedListLbl : "Izcelts saraksts",
BulletedList : "Ievietot/Noņemt izceltu sarakstu",
ShowTableBorders : "Parādīt tabulas robežas",
ShowDetails : "Parādīt sīkāku informāciju",
Style : "Stils",
FontFormat : "Formāts",
Font : "Šrifts",
FontSize : "Izmērs",
TextColor : "Teksta krāsa",
BGColor : "Fona krāsa",
Source : "HTML kods",
Find : "Meklēt",
Replace : "Nomainīt",
SpellCheck : "Pareizrakstības pārbaude",
UniversalKeyboard : "Universāla klaviatūra",
PageBreakLbl : "Lapas pārtraukums",
PageBreak : "Ievietot lapas pārtraukumu",
 
Form : "Forma",
Checkbox : "Atzīmēšanas kastīte",
RadioButton : "Izvēles poga",
TextField : "Teksta rinda",
Textarea : "Teksta laukums",
HiddenField : "Paslēpta teksta rinda",
Button : "Poga",
SelectionField : "Iezīmēšanas lauks",
ImageButton : "Attēlpoga",
 
FitWindow : "Maksimizēt redaktora izmēru",
 
// Context Menu
EditLink : "Labot hipersaiti",
CellCM : "Šūna",
RowCM : "Rinda",
ColumnCM : "Kolonna",
InsertRow : "Ievietot rindu",
DeleteRows : "Dzēst rindas",
InsertColumn : "Ievietot kolonnu",
DeleteColumns : "Dzēst kolonnas",
InsertCell : "Ievietot rūtiņu",
DeleteCells : "Dzēst rūtiņas",
MergeCells : "Apvienot rūtiņas",
SplitCell : "Sadalīt rūtiņu",
TableDelete : "Dzēst tabulu",
CellProperties : "Rūtiņas īpašības",
TableProperties : "Tabulas īpašības",
ImageProperties : "Attēla īpašības",
FlashProperties : "Flash īpašības",
 
AnchorProp : "Iezīmes īpašības",
ButtonProp : "Pogas īpašības",
CheckboxProp : "Atzīmēšanas kastītes īpašības",
HiddenFieldProp : "Paslēptās teksta rindas īpašības",
RadioButtonProp : "Izvēles poga īpašības",
ImageButtonProp : "Attēlpogas īpašības",
TextFieldProp : "Teksta rindas īpašības",
SelectionFieldProp : "Iezīmēšanas lauka īpašības",
TextareaProp : "Teksta laukuma īpašības",
FormProp : "Formas īpašības",
 
FontFormats : "Normāls teksts;Formatēts teksts;Adrese;Virsraksts 1;Virsraksts 2;Virsraksts 3;Virsraksts 4;Virsraksts 5;Virsraksts 6;Rindkopa (DIV)",
 
// Alerts and Messages
ProcessingXHTML : "Tiek apstrādāts XHTML. Lūdzu uzgaidiet...",
Done : "Darīts",
PasteWordConfirm : "Teksta fragments, kas tiek ievietots, izskatās, ka būtu sagatavots Word'ā. Vai vēlaties to apstrādāt pirms ievietošanas?",
NotCompatiblePaste : "Šī darbība ir pieejama Internet Explorer'ī, kas jaunāks par 5.5 versiju. Vai vēlaties ievietot bez apstrādes?",
UnknownToolbarItem : "Nezināms rīku joslas objekts \"%1\"",
UnknownCommand : "Nezināmas darbības nosaukums \"%1\"",
NotImplemented : "Darbība netika paveikta",
UnknownToolbarSet : "Rīku joslas komplekts \"%1\" neeksistē",
NoActiveX : "Interneta pārlūkprogrammas drošības uzstādījumi varētu ietekmēt dažas no redaktora īpašībām. Jābūt aktivizētai sadaļai \"Run ActiveX controls and plug-ins\". Savādāk ir iespējamas kļūdas darbībā un kļūdu paziņojumu parādīšanās.",
BrowseServerBlocked : "Resursu pārlūks nevar tikt atvērts. Pārliecinieties, ka uznirstošo logu bloķētāji ir atslēgti.",
DialogBlocked : "Nav iespējams atvērt dialoglogu. Pārliecinieties, ka uznirstošo logu bloķētāji ir atslēgti.",
 
// Dialogs
DlgBtnOK : "Darīts!",
DlgBtnCancel : "Atcelt",
DlgBtnClose : "Aizvērt",
DlgBtnBrowseServer : "Skatīt servera saturu",
DlgAdvancedTag : "Izvērstais",
DlgOpOther : "<Cits>",
DlgInfoTab : "Informācija",
DlgAlertUrl : "Lūdzu, ievietojiet hipersaiti",
 
// General Dialogs Labels
DlgGenNotSet : "<nav iestatīts>",
DlgGenId : "Id",
DlgGenLangDir : "Valodas lasīšanas virziens",
DlgGenLangDirLtr : "No kreisās uz labo (LTR)",
DlgGenLangDirRtl : "No labās uz kreiso (RTL)",
DlgGenLangCode : "Valodas kods",
DlgGenAccessKey : "Pieejas kods",
DlgGenName : "Nosaukums",
DlgGenTabIndex : "Ciļņu indekss",
DlgGenLongDescr : "Gara apraksta Hipersaite",
DlgGenClass : "Stilu saraksta klases",
DlgGenTitle : "Konsultatīvs virsraksts",
DlgGenContType : "Konsultatīvs satura tips",
DlgGenLinkCharset : "Pievienotā resursa kodu tabula",
DlgGenStyle : "Stils",
 
// Image Dialog
DlgImgTitle : "Attēla īpašības",
DlgImgInfoTab : "Informācija par attēlu",
DlgImgBtnUpload : "Nosūtīt serverim",
DlgImgURL : "URL",
DlgImgUpload : "Augšupielādēt",
DlgImgAlt : "Alternatīvais teksts",
DlgImgWidth : "Platums",
DlgImgHeight : "Augstums",
DlgImgLockRatio : "Nemainīga Augstuma/Platuma attiecība",
DlgBtnResetSize : "Atjaunot sākotnējo izmēru",
DlgImgBorder : "Rāmis",
DlgImgHSpace : "Horizontālā telpa",
DlgImgVSpace : "Vertikālā telpa",
DlgImgAlign : "Nolīdzināt",
DlgImgAlignLeft : "Pa kreisi",
DlgImgAlignAbsBottom: "Absolūti apakšā",
DlgImgAlignAbsMiddle: "Absolūti vertikāli centrēts",
DlgImgAlignBaseline : "Pamatrindā",
DlgImgAlignBottom : "Apakšā",
DlgImgAlignMiddle : "Vertikāli centrēts",
DlgImgAlignRight : "Pa labi",
DlgImgAlignTextTop : "Teksta augšā",
DlgImgAlignTop : "Augšā",
DlgImgPreview : "Pārskats",
DlgImgAlertUrl : "Lūdzu norādīt attēla hipersaiti",
DlgImgLinkTab : "Hipersaite",
 
// Flash Dialog
DlgFlashTitle : "Flash īpašības",
DlgFlashChkPlay : "Automātiska atskaņošana",
DlgFlashChkLoop : "Nepārtraukti",
DlgFlashChkMenu : "Atļaut Flash izvēlni",
DlgFlashScale : "Mainīt izmēru",
DlgFlashScaleAll : "Rādīt visu",
DlgFlashScaleNoBorder : "Bez rāmja",
DlgFlashScaleFit : "Precīzs izmērs",
 
// Link Dialog
DlgLnkWindowTitle : "Hipersaite",
DlgLnkInfoTab : "Hipersaites informācija",
DlgLnkTargetTab : "Mērķis",
 
DlgLnkType : "Hipersaites tips",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Iezīme šajā lapā",
DlgLnkTypeEMail : "E-pasts",
DlgLnkProto : "Protokols",
DlgLnkProtoOther : "<cits>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Izvēlēties iezīmi",
DlgLnkAnchorByName : "Pēc iezīmes nosaukuma",
DlgLnkAnchorById : "Pēc elementa ID",
DlgLnkNoAnchors : "<Šajā dokumentā nav iezīmju>",
DlgLnkEMail : "E-pasta adrese",
DlgLnkEMailSubject : "Ziņas tēma",
DlgLnkEMailBody : "Ziņas saturs",
DlgLnkUpload : "Augšupielādēt",
DlgLnkBtnUpload : "Nosūtīt serverim",
 
DlgLnkTarget : "Mērķis",
DlgLnkTargetFrame : "<ietvars>",
DlgLnkTargetPopup : "<uznirstošā logā>",
DlgLnkTargetBlank : "Jaunā logā (_blank)",
DlgLnkTargetParent : "Esošajā logā (_parent)",
DlgLnkTargetSelf : "Tajā pašā logā (_self)",
DlgLnkTargetTop : "Visredzamākajā logā (_top)",
DlgLnkTargetFrameName : "Mērķa ietvara nosaukums",
DlgLnkPopWinName : "Uznirstošā loga nosaukums",
DlgLnkPopWinFeat : "Uznirstošā loga nosaukums īpašības",
DlgLnkPopResize : "Ar maināmu izmēru",
DlgLnkPopLocation : "Atrašanās vietas josla",
DlgLnkPopMenu : "Izvēlnes josla",
DlgLnkPopScroll : "Ritjoslas",
DlgLnkPopStatus : "Statusa josla",
DlgLnkPopToolbar : "Rīku josla",
DlgLnkPopFullScrn : "Pilnā ekrānā (IE)",
DlgLnkPopDependent : "Atkarīgs (Netscape)",
DlgLnkPopWidth : "Platums",
DlgLnkPopHeight : "Augstums",
DlgLnkPopLeft : "Kreisā koordināte",
DlgLnkPopTop : "Augšējā koordināte",
 
DlnLnkMsgNoUrl : "Lūdzu norādi hipersaiti",
DlnLnkMsgNoEMail : "Lūdzu norādi e-pasta adresi",
DlnLnkMsgNoAnchor : "Lūdzu norādi iezīmi",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "Izvēlies krāsu",
DlgColorBtnClear : "Dzēst",
DlgColorHighlight : "Izcelt",
DlgColorSelected : "Iezīmētais",
 
// Smiley Dialog
DlgSmileyTitle : "Ievietot smaidiņu",
 
// Special Character Dialog
DlgSpecialCharTitle : "Ievietot īpašu simbolu",
 
// Table Dialog
DlgTableTitle : "Tabulas īpašības",
DlgTableRows : "Rindas",
DlgTableColumns : "Kolonnas",
DlgTableBorder : "Rāmja izmērs",
DlgTableAlign : "Novietojums",
DlgTableAlignNotSet : "<nav norādīts>",
DlgTableAlignLeft : "Pa kreisi",
DlgTableAlignCenter : "Centrēti",
DlgTableAlignRight : "Pa labi",
DlgTableWidth : "Platums",
DlgTableWidthPx : "pikseļos",
DlgTableWidthPc : "procentuāli",
DlgTableHeight : "Augstums",
DlgTableCellSpace : "Rūtiņu atstatums",
DlgTableCellPad : "Rūtiņu nobīde",
DlgTableCaption : "Leģenda",
DlgTableSummary : "Anotācija",
 
// Table Cell Dialog
DlgCellTitle : "Rūtiņas īpašības",
DlgCellWidth : "Platums",
DlgCellWidthPx : "pikseļi",
DlgCellWidthPc : "procentos",
DlgCellHeight : "Augstums",
DlgCellWordWrap : "Teksta pārnese",
DlgCellWordWrapNotSet : "<nav norādīta>",
DlgCellWordWrapYes : "Jā",
DlgCellWordWrapNo : "Nē",
DlgCellHorAlign : "Horizontāla novietojums",
DlgCellHorAlignNotSet : "<Nav norādīts>",
DlgCellHorAlignLeft : "Pa kreisi",
DlgCellHorAlignCenter : "Centrēti",
DlgCellHorAlignRight: "Pa labi",
DlgCellVerAlign : "Vertikālais novietojums",
DlgCellVerAlignNotSet : "<nav norādīts>",
DlgCellVerAlignTop : "Augša",
DlgCellVerAlignMiddle : "Vidus",
DlgCellVerAlignBottom : "Apakša",
DlgCellVerAlignBaseline : "Pamatrindā",
DlgCellRowSpan : "Rindu pārnese",
DlgCellCollSpan : "Kolonnu pārnese",
DlgCellBackColor : "Fona krāsa",
DlgCellBorderColor : "Rāmja krāsa",
DlgCellBtnSelect : "Iezīmē...",
 
// Find Dialog
DlgFindTitle : "Meklētājs",
DlgFindFindBtn : "Meklēt",
DlgFindNotFoundMsg : "Norādītā frāze netika atrasta.",
 
// Replace Dialog
DlgReplaceTitle : "Aizvietošana",
DlgReplaceFindLbl : "Meklēt:",
DlgReplaceReplaceLbl : "Nomainīt uz:",
DlgReplaceCaseChk : "Reģistrjūtīgs",
DlgReplaceReplaceBtn : "Aizvietot",
DlgReplaceReplAllBtn : "Aizvietot visu",
DlgReplaceWordChk : "Jāsakrīt pilnībā",
 
// Paste Operations / Dialog
PasteErrorPaste : "Jūsu pārlūkprogrammas drošības iestatījumi nepieļauj editoram automātiski veikt ievietošanas darbību. Lūdzu, izmantojiet (Ctrl+V), lai veiktu šo darbību.",
PasteErrorCut : "Jūsu pārlūkprogrammas drošības iestatījumi nepieļauj editoram automātiski veikt izgriešanas darbību. Lūdzu, izmantojiet (Ctrl+X, lai veiktu šo darbību.",
PasteErrorCopy : "Jūsu pārlūkprogrammas drošības iestatījumi nepieļauj editoram automātiski veikt kopēšanas darbību. Lūdzu, izmantojiet (Ctrl+C), lai veiktu šo darbību.",
 
PasteAsText : "Ievietot kā vienkāršu tekstu",
PasteFromWord : "Ievietot no Worda",
 
DlgPasteMsg2 : "Lūdzu, ievietojiet tekstu šajā laukumā, izmantojot klaviatūru (<STRONG>Ctrl+V</STRONG>) un apstipriniet ar <STRONG>Darīts!</STRONG>.",
DlgPasteIgnoreFont : "Ignorēt iepriek¨norādÄ«tos fontus",
DlgPasteRemoveStyles : "Noņemt norādītos stilus",
DlgPasteCleanBox : "Apstrādāt laukuma saturu",
 
// Color Picker
ColorAutomatic : "Automātiska",
ColorMoreColors : "Plašāka palete...",
 
// Document Properties
DocProps : "Dokumenta īpašības",
 
// Anchor Dialog
DlgAnchorTitle : "Iezīmes īpašības",
DlgAnchorName : "Iezīmes nosaukums",
DlgAnchorErrorName : "Lūdzu norādiet iezīmes nosaukumu",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Netika atrasts vārdnīcā",
DlgSpellChangeTo : "Nomainīt uz",
DlgSpellBtnIgnore : "Ignorēt",
DlgSpellBtnIgnoreAll : "Ignorēt visu",
DlgSpellBtnReplace : "Aizvietot",
DlgSpellBtnReplaceAll : "Aizvietot visu",
DlgSpellBtnUndo : "Atcelt",
DlgSpellNoSuggestions : "- Nav ieteikumu -",
DlgSpellProgress : "Notiek pareizrakstības pārbaude...",
DlgSpellNoMispell : "Pareizrakstības pārbaude pabeigta: kļūdas netika atrastas",
DlgSpellNoChanges : "Pareizrakstības pārbaude pabeigta: nekas netika labots",
DlgSpellOneChange : "Pareizrakstības pārbaude pabeigta: 1 vārds izmainīts",
DlgSpellManyChanges : "Pareizrakstības pārbaude pabeigta: %1 vārdi tika mainīti",
 
IeSpellDownload : "Pareizrakstības pārbaudītājs nav pievienots. Vai vēlaties to lejupielādēt tagad?",
 
// Button Dialog
DlgButtonText : "Teksts (vērtība)",
DlgButtonType : "Tips",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Nosaukums",
DlgCheckboxValue : "Vērtība",
DlgCheckboxSelected : "Iezīmēts",
 
// Form Dialog
DlgFormName : "Nosaukums",
DlgFormAction : "Darbība",
DlgFormMethod : "Metode",
 
// Select Field Dialog
DlgSelectName : "Nosaukums",
DlgSelectValue : "Vērtība",
DlgSelectSize : "Izmērs",
DlgSelectLines : "rindas",
DlgSelectChkMulti : "Atļaut vairākus iezīmējumus",
DlgSelectOpAvail : "Pieejamās iespējas",
DlgSelectOpText : "Teksts",
DlgSelectOpValue : "Vērtība",
DlgSelectBtnAdd : "Pievienot",
DlgSelectBtnModify : "Veikt izmaiņas",
DlgSelectBtnUp : "Augšup",
DlgSelectBtnDown : "Lejup",
DlgSelectBtnSetValue : "Noteikt kā iezīmēto vērtību",
DlgSelectBtnDelete : "Dzēst",
 
// Textarea Dialog
DlgTextareaName : "Nosaukums",
DlgTextareaCols : "Kolonnas",
DlgTextareaRows : "Rindas",
 
// Text Field Dialog
DlgTextName : "Nosaukums",
DlgTextValue : "Vērtība",
DlgTextCharWidth : "Simbolu platums",
DlgTextMaxChars : "Simbolu maksimālais daudzums",
DlgTextType : "Tips",
DlgTextTypeText : "Teksts",
DlgTextTypePass : "Parole",
 
// Hidden Field Dialog
DlgHiddenName : "Nosaukums",
DlgHiddenValue : "Vērtība",
 
// Bulleted List Dialog
BulletedListProp : "Aizzīmju saraksta īpašības",
NumberedListProp : "Numerētā saraksta īpašības",
DlgLstStart : "Start", //MISSING
DlgLstType : "Tips",
DlgLstTypeCircle : "Aplis",
DlgLstTypeDisc : "Disks",
DlgLstTypeSquare : "Kvadrāts",
DlgLstTypeNumbers : "Skaitļi (1, 2, 3)",
DlgLstTypeLCase : "Maziem burtiem (a, b, c)",
DlgLstTypeUCase : "Lieliem burtiem (A, B, C)",
DlgLstTypeSRoman : "Maziem romiešu cipariem (i, ii, iii)",
DlgLstTypeLRoman : "Lieliem romiešu cipariem (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "Vispārīga informācija",
DlgDocBackTab : "Fons",
DlgDocColorsTab : "Krāsas un robežu nobīdes",
DlgDocMetaTab : "META dati",
 
DlgDocPageTitle : "Dokumenta virsraksts <Title>",
DlgDocLangDir : "Valodas lasīšanas virziens",
DlgDocLangDirLTR : "No kreisās uz labo (LTR)",
DlgDocLangDirRTL : "No labās uz kreiso (RTL)",
DlgDocLangCode : "Valodas kods",
DlgDocCharSet : "Simbolu kodējums",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "Cits simbolu kodējums",
 
DlgDocDocType : "Dokumenta tips",
DlgDocDocTypeOther : "Cits dokumenta tips",
DlgDocIncXHTML : "Ietvert XHTML deklarācijas",
DlgDocBgColor : "Fona krāsa",
DlgDocBgImage : "Fona attēla hipersaite",
DlgDocBgNoScroll : "Fona attēls ir fiksēts",
DlgDocCText : "Teksts",
DlgDocCLink : "Hipersaite",
DlgDocCVisited : "Apmeklēta hipersaite",
DlgDocCActive : "Aktīva hipersaite",
DlgDocMargins : "Lapas robežas",
DlgDocMaTop : "Augšā",
DlgDocMaLeft : "Pa kreisi",
DlgDocMaRight : "Pa labi",
DlgDocMaBottom : "Apakšā",
DlgDocMeIndex : "Dokumentu aprakstoši atslēgvārdi (atdalīti ar komatu)",
DlgDocMeDescr : "Dokumenta apraksts",
DlgDocMeAuthor : "Autors",
DlgDocMeCopy : "Autortiesības",
DlgDocPreview : "Priekšskats",
 
// Templates Dialog
Templates : "Sagataves",
DlgTemplatesTitle : "Satura sagataves",
DlgTemplatesSelMsg : "Lūdzu, norādiet sagatavi, ko atvērt editorā<br>(patreizējie dati tiks zaudēti):",
DlgTemplatesLoading : "Notiek sagatavju saraksta ielāde. Lūdzu, uzgaidiet...",
DlgTemplatesNoTpl : "(Nav norādītas sagataves)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "Par",
DlgAboutBrowserInfoTab : "Informācija par pārlūkprogrammu",
DlgAboutLicenseTab : "Licence",
DlgAboutVersion : "versija",
DlgAboutLicense : "Programmatūra lietojama saskaņā ar GNU Lesser General Public License",
DlgAboutInfo : "Papildus informācija ir pieejama"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/ca.js
New file
0,0 → 1,502
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: ca.js
* Catalan language file.
*
* File Authors:
* Jordi Cerdan (nan@myp.ad)
* Marc Folch (mcus21@gmail.com)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Col·lapsa la barra",
ToolbarExpand : "Amplia la barra",
 
// Toolbar Items and Context Menu
Save : "Desa",
NewPage : "Nova Pàgina",
Preview : "Vista Prèvia",
Cut : "Retalla",
Copy : "Copia",
Paste : "Enganxa",
PasteText : "Enganxa com a text no formatat",
PasteWord : "Enganxa des del Word",
Print : "Imprimeix",
SelectAll : "Selecciona-ho tot",
RemoveFormat : "Elimina Format",
InsertLinkLbl : "Enllaç",
InsertLink : "Insereix/Edita enllaç",
RemoveLink : "Elimina enllaç",
Anchor : "Insereix/Edita àncora",
InsertImageLbl : "Imatge",
InsertImage : "Insereix/Edita imatge",
InsertFlashLbl : "Flash",
InsertFlash : "Insereix/Edita Flash",
InsertTableLbl : "Taula",
InsertTable : "Insereix/Edita taula",
InsertLineLbl : "Línia",
InsertLine : "Insereix línia horitzontal",
InsertSpecialCharLbl: "Caràcter Especial",
InsertSpecialChar : "Insereix caràcter especial",
InsertSmileyLbl : "Icona",
InsertSmiley : "Insereix icona",
About : "Quant a FCKeditor",
Bold : "Negreta",
Italic : "Cursiva",
Underline : "Subratllat",
StrikeThrough : "Barrat",
Subscript : "Subíndex",
Superscript : "Superíndex",
LeftJustify : "Aliniament esquerra",
CenterJustify : "Aliniament centrat",
RightJustify : "Aliniament dreta",
BlockJustify : "Justifica",
DecreaseIndent : "Sagna el text",
IncreaseIndent : "Treu el sagnat del text",
Undo : "Desfés",
Redo : "Refés",
NumberedListLbl : "Llista numerada",
NumberedList : "Aplica o elimina la llista numerada",
BulletedListLbl : "Llista de pics",
BulletedList : "Aplica o elimina la llista de pics",
ShowTableBorders : "Mostra les vores de les taules",
ShowDetails : "Mostra detalls",
Style : "Estil",
FontFormat : "Format",
Font : "Tipus de lletra",
FontSize : "Mida",
TextColor : "Color de Text",
BGColor : "Color de Fons",
Source : "Codi font",
Find : "Cerca",
Replace : "Reemplaça",
SpellCheck : "Revisa l'ortografia",
UniversalKeyboard : "Teclat universal",
PageBreakLbl : "Salt de pàgina",
PageBreak : "Insereix salt de pàgina",
 
Form : "Formulari",
Checkbox : "Casella de verificació",
RadioButton : "Botó d'opció",
TextField : "Camp de text",
Textarea : "Àrea de text",
HiddenField : "Camp ocult",
Button : "Botó",
SelectionField : "Camp de selecció",
ImageButton : "Botó d'imatge",
 
FitWindow : "Maximiza la mida de l'editor",
 
// Context Menu
EditLink : "Edita l'enllaç",
CellCM : "Cel·la",
RowCM : "Fila",
ColumnCM : "Columna",
InsertRow : "Insereix una fila",
DeleteRows : "Suprimeix una fila",
InsertColumn : "Afegeix una columna",
DeleteColumns : "Suprimeix una columna",
InsertCell : "Insereix una cel·la",
DeleteCells : "Suprimeix les cel·les",
MergeCells : "Fusiona les cel·les",
SplitCell : "Separa les cel·les",
TableDelete : "Suprimeix la taula",
CellProperties : "Propietats de la cel·la",
TableProperties : "Propietats de la taula",
ImageProperties : "Propietats de la imatge",
FlashProperties : "Propietats del Flash",
 
AnchorProp : "Propietats de l'àncora",
ButtonProp : "Propietats del botó",
CheckboxProp : "Propietats de la casella de verificació",
HiddenFieldProp : "Propietats del camp ocult",
RadioButtonProp : "Propietats del botó d'opció",
ImageButtonProp : "Propietats del botó d'imatge",
TextFieldProp : "Propietats del camp de text",
SelectionFieldProp : "Propietats del camp de selecció",
TextareaProp : "Propietats de l'àrea de text",
FormProp : "Propietats del formulari",
 
FontFormats : "Normal;Formatejat;Adreça;Encapçalament 1;Encapçalament 2;Encapçalament 3;Encapçalament 4;Encapçalament 5;Encapçalament 6",
 
// Alerts and Messages
ProcessingXHTML : "Processant XHTML. Si us plau esperi...",
Done : "Fet",
PasteWordConfirm : "El text que voleu enganxar sembla provenir de Word. Voleu netejar aquest text abans que sigui enganxat?",
NotCompatiblePaste : "Aquesta funció és disponible per a Internet Explorer versió 5.5 o superior. Voleu enganxar sense netejar?",
UnknownToolbarItem : "Element de la barra d'eines desconegut \"%1\"",
UnknownCommand : "Nom de comanda desconegut \"%1\"",
NotImplemented : "Mètode no implementat",
UnknownToolbarSet : "Conjunt de barra d'eines \"%1\" inexistent",
NoActiveX : "Les preferències del navegador poden limitar algunes funcions d'aquest editor. Cal habilitar l'opció \"Executa controls ActiveX i plug-ins\". Poden sorgir errors i poden faltar algunes funcions.",
BrowseServerBlocked : "El visualitzador de recursos no s'ha pogut obrir. Assegura't de que els bloquejos de finestres emergents estan desactivats.",
DialogBlocked : "No ha estat possible obrir una finestra de diàleg. Assegura't de que els bloquejos de finestres emergents estan desactivats.",
 
// Dialogs
DlgBtnOK : "D'acord",
DlgBtnCancel : "Cancel·la",
DlgBtnClose : "Tanca",
DlgBtnBrowseServer : "Veure servidor",
DlgAdvancedTag : "Avançat",
DlgOpOther : "Altres",
DlgInfoTab : "Info",
DlgAlertUrl : "Si us plau, afegiu la URL",
 
// General Dialogs Labels
DlgGenNotSet : "<no definit>",
DlgGenId : "Id",
DlgGenLangDir : "Direcció de l'idioma",
DlgGenLangDirLtr : "D'esquerra a dreta (LTR)",
DlgGenLangDirRtl : "De dreta a esquerra (RTL)",
DlgGenLangCode : "Codi d'idioma",
DlgGenAccessKey : "Clau d'accés",
DlgGenName : "Nom",
DlgGenTabIndex : "Index de Tab",
DlgGenLongDescr : "Descripció llarga de la URL",
DlgGenClass : "Classes del full d'estil",
DlgGenTitle : "Títol consultiu",
DlgGenContType : "Tipus de contingut consultiu",
DlgGenLinkCharset : "Conjunt de caràcters font enllaçat",
DlgGenStyle : "Estil",
 
// Image Dialog
DlgImgTitle : "Propietats de la imatge",
DlgImgInfoTab : "Informació de la imatge",
DlgImgBtnUpload : "Envia-la al servidor",
DlgImgURL : "URL",
DlgImgUpload : "Puja",
DlgImgAlt : "Text alternatiu",
DlgImgWidth : "Amplada",
DlgImgHeight : "Alçada",
DlgImgLockRatio : "Bloqueja les proporcions",
DlgBtnResetSize : "Restaura la mida",
DlgImgBorder : "Vora",
DlgImgHSpace : "Espaiat horit.",
DlgImgVSpace : "Espaiat vert.",
DlgImgAlign : "Alineació",
DlgImgAlignLeft : "Ajusta a l'esquerra",
DlgImgAlignAbsBottom: "Abs Bottom",
DlgImgAlignAbsMiddle: "Abs Middle",
DlgImgAlignBaseline : "Baseline",
DlgImgAlignBottom : "Bottom",
DlgImgAlignMiddle : "Middle",
DlgImgAlignRight : "Ajusta a la dreta",
DlgImgAlignTextTop : "Text Top",
DlgImgAlignTop : "Top",
DlgImgPreview : "Vista prèvia",
DlgImgAlertUrl : "Si us plau, escriviu la URL de la imatge",
DlgImgLinkTab : "Enllaç",
 
// Flash Dialog
DlgFlashTitle : "Propietats del Flash",
DlgFlashChkPlay : "Reprodució automàtica",
DlgFlashChkLoop : "Bucle",
DlgFlashChkMenu : "Habilita menú Flash",
DlgFlashScale : "Escala",
DlgFlashScaleAll : "Mostra-ho tot",
DlgFlashScaleNoBorder : "Sense vores",
DlgFlashScaleFit : "Mida exacta",
 
// Link Dialog
DlgLnkWindowTitle : "Enllaç",
DlgLnkInfoTab : "Informació de l'enllaç",
DlgLnkTargetTab : "Destí",
 
DlgLnkType : "Tipus d'enllaç",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Àncora en aquesta pàgina",
DlgLnkTypeEMail : "E-Mail",
DlgLnkProto : "Protocol",
DlgLnkProtoOther : "<altra>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Selecciona una àncora",
DlgLnkAnchorByName : "Per nom d'àncora",
DlgLnkAnchorById : "Per Id d'element",
DlgLnkNoAnchors : "<No hi ha àncores disponibles en aquest document>",
DlgLnkEMail : "Adreça d'E-Mail",
DlgLnkEMailSubject : "Assumpte del missatge",
DlgLnkEMailBody : "Cos del missatge",
DlgLnkUpload : "Puja",
DlgLnkBtnUpload : "Envia al servidor",
 
DlgLnkTarget : "Destí",
DlgLnkTargetFrame : "<marc>",
DlgLnkTargetPopup : "<finestra emergent>",
DlgLnkTargetBlank : "Nova finestra (_blank)",
DlgLnkTargetParent : "Finestra pare (_parent)",
DlgLnkTargetSelf : "Mateixa finestra (_self)",
DlgLnkTargetTop : "Finestra Major (_top)",
DlgLnkTargetFrameName : "Nom del marc de destí",
DlgLnkPopWinName : "Nom finestra popup",
DlgLnkPopWinFeat : "Característiques finestra popup",
DlgLnkPopResize : "Redimensionable",
DlgLnkPopLocation : "Barra d'adreça",
DlgLnkPopMenu : "Barra de menú",
DlgLnkPopScroll : "Barres d'scroll",
DlgLnkPopStatus : "Barra d'estat",
DlgLnkPopToolbar : "Barra d'eines",
DlgLnkPopFullScrn : "Pantalla completa (IE)",
DlgLnkPopDependent : "Depenent (Netscape)",
DlgLnkPopWidth : "Amplada",
DlgLnkPopHeight : "Alçada",
DlgLnkPopLeft : "Posició esquerra",
DlgLnkPopTop : "Posició dalt",
 
DlnLnkMsgNoUrl : "Si us plau, escrigui l'enllaç URL",
DlnLnkMsgNoEMail : "Si us plau, escrigui l'adreça e-mail",
DlnLnkMsgNoAnchor : "Si us plau, escrigui l'àncora",
DlnLnkMsgInvPopName : "El nom de la finestra emergent ha de començar amb una lletra i no pot tenir espais",
 
// Color Dialog
DlgColorTitle : "Selecciona el color",
DlgColorBtnClear : "Neteja",
DlgColorHighlight : "Realça",
DlgColorSelected : "Selecciona",
 
// Smiley Dialog
DlgSmileyTitle : "Insereix una icona",
 
// Special Character Dialog
DlgSpecialCharTitle : "Selecciona el caràcter especial",
 
// Table Dialog
DlgTableTitle : "Propietats de la taula",
DlgTableRows : "Files",
DlgTableColumns : "Columnes",
DlgTableBorder : "Tamany vora",
DlgTableAlign : "Alineació",
DlgTableAlignNotSet : "<No Definit>",
DlgTableAlignLeft : "Esquerra",
DlgTableAlignCenter : "Centre",
DlgTableAlignRight : "Dreta",
DlgTableWidth : "Amplada",
DlgTableWidthPx : "píxels",
DlgTableWidthPc : "percentatge",
DlgTableHeight : "Alçada",
DlgTableCellSpace : "Espaiat de cel·les",
DlgTableCellPad : "Encoixinament de cel·les",
DlgTableCaption : "Títol",
DlgTableSummary : "Resum",
 
// Table Cell Dialog
DlgCellTitle : "Propietats de la cel·la",
DlgCellWidth : "Amplada",
DlgCellWidthPx : "píxels",
DlgCellWidthPc : "percentatge",
DlgCellHeight : "Alçada",
DlgCellWordWrap : "Ajust de paraula",
DlgCellWordWrapNotSet : "<No Definit>",
DlgCellWordWrapYes : "Si",
DlgCellWordWrapNo : "No",
DlgCellHorAlign : "Alineació horitzontal",
DlgCellHorAlignNotSet : "<No Definit>",
DlgCellHorAlignLeft : "Esquerra",
DlgCellHorAlignCenter : "Centre",
DlgCellHorAlignRight: "Dreta",
DlgCellVerAlign : "Alineació vertical",
DlgCellVerAlignNotSet : "<No definit>",
DlgCellVerAlignTop : "Top",
DlgCellVerAlignMiddle : "Middle",
DlgCellVerAlignBottom : "Bottom",
DlgCellVerAlignBaseline : "Baseline",
DlgCellRowSpan : "Rows Span",
DlgCellCollSpan : "Columns Span",
DlgCellBackColor : "Color de fons",
DlgCellBorderColor : "Color de la vora",
DlgCellBtnSelect : "Seleccioneu...",
 
// Find Dialog
DlgFindTitle : "Cerca",
DlgFindFindBtn : "Cerca",
DlgFindNotFoundMsg : "El text especificat no s'ha trobat.",
 
// Replace Dialog
DlgReplaceTitle : "Reemplaça",
DlgReplaceFindLbl : "Cerca:",
DlgReplaceReplaceLbl : "Remplaça amb:",
DlgReplaceCaseChk : "Sensible a majúscules",
DlgReplaceReplaceBtn : "Reemplaça",
DlgReplaceReplAllBtn : "Reemplaça'ls tots",
DlgReplaceWordChk : "Cerca paraula completa",
 
// Paste Operations / Dialog
PasteErrorPaste : "La seguretat del vostre navegador no permet executar automàticament les operacions d'enganxat. Si us plau, utilitzeu el teclat (Ctrl+V).",
PasteErrorCut : "La seguretat del vostre navegador no permet executar automàticament les operacions de retallar. Si us plau, utilitzeu el teclat (Ctrl+X).",
PasteErrorCopy : "La seguretat del vostre navegador no permet executar automàticament les operacions de copiar. Si us plau, utilitzeu el teclat (Ctrl+C).",
 
PasteAsText : "Enganxa com a text sense format",
PasteFromWord : "Enganxa com a Word",
 
DlgPasteMsg2 : "Si us plau, enganxeu dins del següent camp utilitzant el teclat (<STRONG>Ctrl+V</STRONG>) i premeu <STRONG>OK</STRONG>.",
DlgPasteIgnoreFont : "Ignora definicions de font",
DlgPasteRemoveStyles : "Elimina definicions d'estil",
DlgPasteCleanBox : "Neteja camp",
 
// Color Picker
ColorAutomatic : "Automàtic",
ColorMoreColors : "Més colors...",
 
// Document Properties
DocProps : "Propietats del document",
 
// Anchor Dialog
DlgAnchorTitle : "Propietats de l'àncora",
DlgAnchorName : "Nom de l'àncora",
DlgAnchorErrorName : "Si us plau, escriviu el nom de l'ancora",
 
// Speller Pages Dialog
DlgSpellNotInDic : "No és al diccionari",
DlgSpellChangeTo : "Canvia a",
DlgSpellBtnIgnore : "Ignora",
DlgSpellBtnIgnoreAll : "Ignora-les totes",
DlgSpellBtnReplace : "Canvia",
DlgSpellBtnReplaceAll : "Canvia-les totes",
DlgSpellBtnUndo : "Desfés",
DlgSpellNoSuggestions : "Cap sugerència",
DlgSpellProgress : "Comprovació ortogràfica en progrés",
DlgSpellNoMispell : "Comprovació ortogràfica completada",
DlgSpellNoChanges : "Comprovació ortogràfica: cap paraulada canviada",
DlgSpellOneChange : "Comprovació ortogràfica: una paraula canviada",
DlgSpellManyChanges : "Comprovació ortogràfica %1 paraules canviades",
 
IeSpellDownload : "Comprovació ortogràfica no instal·lada. Voleu descarregar-ho ara?",
 
// Button Dialog
DlgButtonText : "Text (Valor)",
DlgButtonType : "Tipus",
DlgButtonTypeBtn : "Botó",
DlgButtonTypeSbm : "Transmet formulari",
DlgButtonTypeRst : "Reinicia formulari",
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Nom",
DlgCheckboxValue : "Valor",
DlgCheckboxSelected : "Seleccionat",
 
// Form Dialog
DlgFormName : "Nom",
DlgFormAction : "Acció",
DlgFormMethod : "Mètode",
 
// Select Field Dialog
DlgSelectName : "Nom",
DlgSelectValue : "Valor",
DlgSelectSize : "Tamany",
DlgSelectLines : "Línies",
DlgSelectChkMulti : "Permet múltiples seleccions",
DlgSelectOpAvail : "Opcions disponibles",
DlgSelectOpText : "Text",
DlgSelectOpValue : "Valor",
DlgSelectBtnAdd : "Afegeix",
DlgSelectBtnModify : "Modifica",
DlgSelectBtnUp : "Amunt",
DlgSelectBtnDown : "Avall",
DlgSelectBtnSetValue : "Selecciona per defecte",
DlgSelectBtnDelete : "Elimina",
 
// Textarea Dialog
DlgTextareaName : "Nom",
DlgTextareaCols : "Columnes",
DlgTextareaRows : "Files",
 
// Text Field Dialog
DlgTextName : "Nom",
DlgTextValue : "Valor",
DlgTextCharWidth : "Amplada de caràcter",
DlgTextMaxChars : "Màxim de caràcters",
DlgTextType : "Tipus",
DlgTextTypeText : "Text",
DlgTextTypePass : "Contrasenya",
 
// Hidden Field Dialog
DlgHiddenName : "Nom",
DlgHiddenValue : "Valor",
 
// Bulleted List Dialog
BulletedListProp : "Propietats de la llista de pics",
NumberedListProp : "Propietats de llista numerada",
DlgLstStart : "Inici",
DlgLstType : "Tipus",
DlgLstTypeCircle : "Cercle",
DlgLstTypeDisc : "Disc",
DlgLstTypeSquare : "Quadrat",
DlgLstTypeNumbers : "Números (1, 2, 3)",
DlgLstTypeLCase : "Lletres minúscules (a, b, c)",
DlgLstTypeUCase : "Lletres majúscules (A, B, C)",
DlgLstTypeSRoman : "Números romans minúscules (i, ii, iii)",
DlgLstTypeLRoman : "Números romans majúscules (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "General",
DlgDocBackTab : "Fons",
DlgDocColorsTab : "Colors i marges",
DlgDocMetaTab : "Dades Meta",
 
DlgDocPageTitle : "Títol de la pàgina",
DlgDocLangDir : "Direcció llenguatge",
DlgDocLangDirLTR : "Esquerra a dreta (LTR)",
DlgDocLangDirRTL : "Dreta a esquerra (RTL)",
DlgDocLangCode : "Codi de llenguatge",
DlgDocCharSet : "Codificació de conjunt de caràcters",
DlgDocCharSetCE : "Centreeuropeu",
DlgDocCharSetCT : "Xinès tradicional (Big5)",
DlgDocCharSetCR : "Ciríl·lic",
DlgDocCharSetGR : "Grec",
DlgDocCharSetJP : "Japonès",
DlgDocCharSetKR : "Coreà",
DlgDocCharSetTR : "Turc",
DlgDocCharSetUN : "Unicode (UTF-8)",
DlgDocCharSetWE : "Europeu occidental",
DlgDocCharSetOther : "Una altra codificació de caràcters",
 
DlgDocDocType : "Capçalera de tipus de document",
DlgDocDocTypeOther : "Altra Capçalera de tipus de document",
DlgDocIncXHTML : "Incloure declaracions XHTML",
DlgDocBgColor : "Color de fons",
DlgDocBgImage : "URL de la imatge de fons",
DlgDocBgNoScroll : "Fons fixe",
DlgDocCText : "Text",
DlgDocCLink : "Enllaç",
DlgDocCVisited : "Enllaç visitat",
DlgDocCActive : "Enllaç actiu",
DlgDocMargins : "Marges de pàgina",
DlgDocMaTop : "Cap",
DlgDocMaLeft : "Esquerra",
DlgDocMaRight : "Dreta",
DlgDocMaBottom : "Peu",
DlgDocMeIndex : "Mots clau per a indexació (separats per coma)",
DlgDocMeDescr : "Descripció del document",
DlgDocMeAuthor : "Autor",
DlgDocMeCopy : "Copyright",
DlgDocPreview : "Vista prèvia",
 
// Templates Dialog
Templates : "Plantilles",
DlgTemplatesTitle : "Contingut plantilles",
DlgTemplatesSelMsg : "Si us plau, seleccioneu la plantilla per obrir en l'editor<br>(el contingut actual no serà enregistrat):",
DlgTemplatesLoading : "Carregant la llista de plantilles. Si us plau, espereu...",
DlgTemplatesNoTpl : "(No hi ha plantilles definides)",
DlgTemplatesReplace : "Reemplaça el contingut actual",
 
// About Dialog
DlgAboutAboutTab : "Quant a",
DlgAboutBrowserInfoTab : "Informació del navegador",
DlgAboutLicenseTab : "Llicència",
DlgAboutVersion : "versió",
DlgAboutLicense : "Segons els termes de la Llicència GNU Lesser General Public License",
DlgAboutInfo : "Per a més informació aneu a"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/en-ca.js
New file
0,0 → 1,502
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: en-ca.js
* English (Canadian) language file.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
* Kevin Bennett
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Collapse Toolbar",
ToolbarExpand : "Expand Toolbar",
 
// Toolbar Items and Context Menu
Save : "Save",
NewPage : "New Page",
Preview : "Preview",
Cut : "Cut",
Copy : "Copy",
Paste : "Paste",
PasteText : "Paste as plain text",
PasteWord : "Paste from Word",
Print : "Print",
SelectAll : "Select All",
RemoveFormat : "Remove Format",
InsertLinkLbl : "Link",
InsertLink : "Insert/Edit Link",
RemoveLink : "Remove Link",
Anchor : "Insert/Edit Anchor",
InsertImageLbl : "Image",
InsertImage : "Insert/Edit Image",
InsertFlashLbl : "Flash",
InsertFlash : "Insert/Edit Flash",
InsertTableLbl : "Table",
InsertTable : "Insert/Edit Table",
InsertLineLbl : "Line",
InsertLine : "Insert Horizontal Line",
InsertSpecialCharLbl: "Special Character",
InsertSpecialChar : "Insert Special Character",
InsertSmileyLbl : "Smiley",
InsertSmiley : "Insert Smiley",
About : "About FCKeditor",
Bold : "Bold",
Italic : "Italic",
Underline : "Underline",
StrikeThrough : "Strike Through",
Subscript : "Subscript",
Superscript : "Superscript",
LeftJustify : "Left Justify",
CenterJustify : "Centre Justify",
RightJustify : "Right Justify",
BlockJustify : "Block Justify",
DecreaseIndent : "Decrease Indent",
IncreaseIndent : "Increase Indent",
Undo : "Undo",
Redo : "Redo",
NumberedListLbl : "Numbered List",
NumberedList : "Insert/Remove Numbered List",
BulletedListLbl : "Bulleted List",
BulletedList : "Insert/Remove Bulleted List",
ShowTableBorders : "Show Table Borders",
ShowDetails : "Show Details",
Style : "Style",
FontFormat : "Format",
Font : "Font",
FontSize : "Size",
TextColor : "Text Colour",
BGColor : "Background Colour",
Source : "Source",
Find : "Find",
Replace : "Replace",
SpellCheck : "Check Spelling",
UniversalKeyboard : "Universal Keyboard",
PageBreakLbl : "Page Break",
PageBreak : "Insert Page Break",
 
Form : "Form",
Checkbox : "Checkbox",
RadioButton : "Radio Button",
TextField : "Text Field",
Textarea : "Textarea",
HiddenField : "Hidden Field",
Button : "Button",
SelectionField : "Selection Field",
ImageButton : "Image Button",
 
FitWindow : "Maximize the editor size",
 
// Context Menu
EditLink : "Edit Link",
CellCM : "Cell",
RowCM : "Row",
ColumnCM : "Column",
InsertRow : "Insert Row",
DeleteRows : "Delete Rows",
InsertColumn : "Insert Column",
DeleteColumns : "Delete Columns",
InsertCell : "Insert Cell",
DeleteCells : "Delete Cells",
MergeCells : "Merge Cells",
SplitCell : "Split Cell",
TableDelete : "Delete Table",
CellProperties : "Cell Properties",
TableProperties : "Table Properties",
ImageProperties : "Image Properties",
FlashProperties : "Flash Properties",
 
AnchorProp : "Anchor Properties",
ButtonProp : "Button Properties",
CheckboxProp : "Checkbox Properties",
HiddenFieldProp : "Hidden Field Properties",
RadioButtonProp : "Radio Button Properties",
ImageButtonProp : "Image Button Properties",
TextFieldProp : "Text Field Properties",
SelectionFieldProp : "Selection Field Properties",
TextareaProp : "Textarea Properties",
FormProp : "Form Properties",
 
FontFormats : "Normal;Formatted;Address;Heading 1;Heading 2;Heading 3;Heading 4;Heading 5;Heading 6;Normal (DIV)",
 
// Alerts and Messages
ProcessingXHTML : "Processing XHTML. Please wait...",
Done : "Done",
PasteWordConfirm : "The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?",
NotCompatiblePaste : "This command is available for Internet Explorer version 5.5 or more. Do you want to paste without cleaning?",
UnknownToolbarItem : "Unknown toolbar item \"%1\"",
UnknownCommand : "Unknown command name \"%1\"",
NotImplemented : "Command not implemented",
UnknownToolbarSet : "Toolbar set \"%1\" doesn't exist",
NoActiveX : "Your browser's security settings could limit some features of the editor. You must enable the option \"Run ActiveX controls and plug-ins\". You may experience errors and notice missing features.",
BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.",
DialogBlocked : "It was not possible to open the dialog window. Make sure all popup blockers are disabled.",
 
// Dialogs
DlgBtnOK : "OK",
DlgBtnCancel : "Cancel",
DlgBtnClose : "Close",
DlgBtnBrowseServer : "Browse Server",
DlgAdvancedTag : "Advanced",
DlgOpOther : "<Other>",
DlgInfoTab : "Info",
DlgAlertUrl : "Please insert the URL",
 
// General Dialogs Labels
DlgGenNotSet : "<not set>",
DlgGenId : "Id",
DlgGenLangDir : "Language Direction",
DlgGenLangDirLtr : "Left to Right (LTR)",
DlgGenLangDirRtl : "Right to Left (RTL)",
DlgGenLangCode : "Language Code",
DlgGenAccessKey : "Access Key",
DlgGenName : "Name",
DlgGenTabIndex : "Tab Index",
DlgGenLongDescr : "Long Description URL",
DlgGenClass : "Stylesheet Classes",
DlgGenTitle : "Advisory Title",
DlgGenContType : "Advisory Content Type",
DlgGenLinkCharset : "Linked Resource Charset",
DlgGenStyle : "Style",
 
// Image Dialog
DlgImgTitle : "Image Properties",
DlgImgInfoTab : "Image Info",
DlgImgBtnUpload : "Send it to the Server",
DlgImgURL : "URL",
DlgImgUpload : "Upload",
DlgImgAlt : "Alternative Text",
DlgImgWidth : "Width",
DlgImgHeight : "Height",
DlgImgLockRatio : "Lock Ratio",
DlgBtnResetSize : "Reset Size",
DlgImgBorder : "Border",
DlgImgHSpace : "HSpace",
DlgImgVSpace : "VSpace",
DlgImgAlign : "Align",
DlgImgAlignLeft : "Left",
DlgImgAlignAbsBottom: "Abs Bottom",
DlgImgAlignAbsMiddle: "Abs Middle",
DlgImgAlignBaseline : "Baseline",
DlgImgAlignBottom : "Bottom",
DlgImgAlignMiddle : "Middle",
DlgImgAlignRight : "Right",
DlgImgAlignTextTop : "Text Top",
DlgImgAlignTop : "Top",
DlgImgPreview : "Preview",
DlgImgAlertUrl : "Please type the image URL",
DlgImgLinkTab : "Link",
 
// Flash Dialog
DlgFlashTitle : "Flash Properties",
DlgFlashChkPlay : "Auto Play",
DlgFlashChkLoop : "Loop",
DlgFlashChkMenu : "Enable Flash Menu",
DlgFlashScale : "Scale",
DlgFlashScaleAll : "Show all",
DlgFlashScaleNoBorder : "No Border",
DlgFlashScaleFit : "Exact Fit",
 
// Link Dialog
DlgLnkWindowTitle : "Link",
DlgLnkInfoTab : "Link Info",
DlgLnkTargetTab : "Target",
 
DlgLnkType : "Link Type",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Link to anchor in the text",
DlgLnkTypeEMail : "E-Mail",
DlgLnkProto : "Protocol",
DlgLnkProtoOther : "<other>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Select an Anchor",
DlgLnkAnchorByName : "By Anchor Name",
DlgLnkAnchorById : "By Element Id",
DlgLnkNoAnchors : "<No anchors available in the document>",
DlgLnkEMail : "E-Mail Address",
DlgLnkEMailSubject : "Message Subject",
DlgLnkEMailBody : "Message Body",
DlgLnkUpload : "Upload",
DlgLnkBtnUpload : "Send it to the Server",
 
DlgLnkTarget : "Target",
DlgLnkTargetFrame : "<frame>",
DlgLnkTargetPopup : "<popup window>",
DlgLnkTargetBlank : "New Window (_blank)",
DlgLnkTargetParent : "Parent Window (_parent)",
DlgLnkTargetSelf : "Same Window (_self)",
DlgLnkTargetTop : "Topmost Window (_top)",
DlgLnkTargetFrameName : "Target Frame Name",
DlgLnkPopWinName : "Popup Window Name",
DlgLnkPopWinFeat : "Popup Window Features",
DlgLnkPopResize : "Resizable",
DlgLnkPopLocation : "Location Bar",
DlgLnkPopMenu : "Menu Bar",
DlgLnkPopScroll : "Scroll Bars",
DlgLnkPopStatus : "Status Bar",
DlgLnkPopToolbar : "Toolbar",
DlgLnkPopFullScrn : "Full Screen (IE)",
DlgLnkPopDependent : "Dependent (Netscape)",
DlgLnkPopWidth : "Width",
DlgLnkPopHeight : "Height",
DlgLnkPopLeft : "Left Position",
DlgLnkPopTop : "Top Position",
 
DlnLnkMsgNoUrl : "Please type the link URL",
DlnLnkMsgNoEMail : "Please type the e-mail address",
DlnLnkMsgNoAnchor : "Please select an anchor",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces",
 
// Color Dialog
DlgColorTitle : "Select Colour",
DlgColorBtnClear : "Clear",
DlgColorHighlight : "Highlight",
DlgColorSelected : "Selected",
 
// Smiley Dialog
DlgSmileyTitle : "Insert a Smiley",
 
// Special Character Dialog
DlgSpecialCharTitle : "Select Special Character",
 
// Table Dialog
DlgTableTitle : "Table Properties",
DlgTableRows : "Rows",
DlgTableColumns : "Columns",
DlgTableBorder : "Border size",
DlgTableAlign : "Alignment",
DlgTableAlignNotSet : "<Not set>",
DlgTableAlignLeft : "Left",
DlgTableAlignCenter : "Centre",
DlgTableAlignRight : "Right",
DlgTableWidth : "Width",
DlgTableWidthPx : "pixels",
DlgTableWidthPc : "percent",
DlgTableHeight : "Height",
DlgTableCellSpace : "Cell spacing",
DlgTableCellPad : "Cell padding",
DlgTableCaption : "Caption",
DlgTableSummary : "Summary",
 
// Table Cell Dialog
DlgCellTitle : "Cell Properties",
DlgCellWidth : "Width",
DlgCellWidthPx : "pixels",
DlgCellWidthPc : "percent",
DlgCellHeight : "Height",
DlgCellWordWrap : "Word Wrap",
DlgCellWordWrapNotSet : "<Not set>",
DlgCellWordWrapYes : "Yes",
DlgCellWordWrapNo : "No",
DlgCellHorAlign : "Horizontal Alignment",
DlgCellHorAlignNotSet : "<Not set>",
DlgCellHorAlignLeft : "Left",
DlgCellHorAlignCenter : "Centre",
DlgCellHorAlignRight: "Right",
DlgCellVerAlign : "Vertical Alignment",
DlgCellVerAlignNotSet : "<Not set>",
DlgCellVerAlignTop : "Top",
DlgCellVerAlignMiddle : "Middle",
DlgCellVerAlignBottom : "Bottom",
DlgCellVerAlignBaseline : "Baseline",
DlgCellRowSpan : "Rows Span",
DlgCellCollSpan : "Columns Span",
DlgCellBackColor : "Background Colour",
DlgCellBorderColor : "Border Colour",
DlgCellBtnSelect : "Select...",
 
// Find Dialog
DlgFindTitle : "Find",
DlgFindFindBtn : "Find",
DlgFindNotFoundMsg : "The specified text was not found.",
 
// Replace Dialog
DlgReplaceTitle : "Replace",
DlgReplaceFindLbl : "Find what:",
DlgReplaceReplaceLbl : "Replace with:",
DlgReplaceCaseChk : "Match case",
DlgReplaceReplaceBtn : "Replace",
DlgReplaceReplAllBtn : "Replace All",
DlgReplaceWordChk : "Match whole word",
 
// Paste Operations / Dialog
PasteErrorPaste : "Your browser security settings don't permit the editor to automatically execute pasting operations. Please use the keyboard for that (Ctrl+V).",
PasteErrorCut : "Your browser security settings don't permit the editor to automatically execute cutting operations. Please use the keyboard for that (Ctrl+X).",
PasteErrorCopy : "Your browser security settings don't permit the editor to automatically execute copying operations. Please use the keyboard for that (Ctrl+C).",
 
PasteAsText : "Paste as Plain Text",
PasteFromWord : "Paste from Word",
 
DlgPasteMsg2 : "Please paste inside the following box using the keyboard (<STRONG>Ctrl+V</STRONG>) and hit <STRONG>OK</STRONG>.",
DlgPasteIgnoreFont : "Ignore Font Face definitions",
DlgPasteRemoveStyles : "Remove Styles definitions",
DlgPasteCleanBox : "Clean Up Box",
 
// Color Picker
ColorAutomatic : "Automatic",
ColorMoreColors : "More Colours...",
 
// Document Properties
DocProps : "Document Properties",
 
// Anchor Dialog
DlgAnchorTitle : "Anchor Properties",
DlgAnchorName : "Anchor Name",
DlgAnchorErrorName : "Please type the anchor name",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Not in dictionary",
DlgSpellChangeTo : "Change to",
DlgSpellBtnIgnore : "Ignore",
DlgSpellBtnIgnoreAll : "Ignore All",
DlgSpellBtnReplace : "Replace",
DlgSpellBtnReplaceAll : "Replace All",
DlgSpellBtnUndo : "Undo",
DlgSpellNoSuggestions : "- No suggestions -",
DlgSpellProgress : "Spell check in progress...",
DlgSpellNoMispell : "Spell check complete: No misspellings found",
DlgSpellNoChanges : "Spell check complete: No words changed",
DlgSpellOneChange : "Spell check complete: One word changed",
DlgSpellManyChanges : "Spell check complete: %1 words changed",
 
IeSpellDownload : "Spell checker not installed. Do you want to download it now?",
 
// Button Dialog
DlgButtonText : "Text (Value)",
DlgButtonType : "Type",
DlgButtonTypeBtn : "Button",
DlgButtonTypeSbm : "Submit",
DlgButtonTypeRst : "Reset",
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Name",
DlgCheckboxValue : "Value",
DlgCheckboxSelected : "Selected",
 
// Form Dialog
DlgFormName : "Name",
DlgFormAction : "Action",
DlgFormMethod : "Method",
 
// Select Field Dialog
DlgSelectName : "Name",
DlgSelectValue : "Value",
DlgSelectSize : "Size",
DlgSelectLines : "lines",
DlgSelectChkMulti : "Allow multiple selections",
DlgSelectOpAvail : "Available Options",
DlgSelectOpText : "Text",
DlgSelectOpValue : "Value",
DlgSelectBtnAdd : "Add",
DlgSelectBtnModify : "Modify",
DlgSelectBtnUp : "Up",
DlgSelectBtnDown : "Down",
DlgSelectBtnSetValue : "Set as selected value",
DlgSelectBtnDelete : "Delete",
 
// Textarea Dialog
DlgTextareaName : "Name",
DlgTextareaCols : "Columns",
DlgTextareaRows : "Rows",
 
// Text Field Dialog
DlgTextName : "Name",
DlgTextValue : "Value",
DlgTextCharWidth : "Character Width",
DlgTextMaxChars : "Maximum Characters",
DlgTextType : "Type",
DlgTextTypeText : "Text",
DlgTextTypePass : "Password",
 
// Hidden Field Dialog
DlgHiddenName : "Name",
DlgHiddenValue : "Value",
 
// Bulleted List Dialog
BulletedListProp : "Bulleted List Properties",
NumberedListProp : "Numbered List Properties",
DlgLstStart : "Start",
DlgLstType : "Type",
DlgLstTypeCircle : "Circle",
DlgLstTypeDisc : "Disc",
DlgLstTypeSquare : "Square",
DlgLstTypeNumbers : "Numbers (1, 2, 3)",
DlgLstTypeLCase : "Lowercase Letters (a, b, c)",
DlgLstTypeUCase : "Uppercase Letters (A, B, C)",
DlgLstTypeSRoman : "Small Roman Numerals (i, ii, iii)",
DlgLstTypeLRoman : "Large Roman Numerals (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "General",
DlgDocBackTab : "Background",
DlgDocColorsTab : "Colours and Margins",
DlgDocMetaTab : "Meta Data",
 
DlgDocPageTitle : "Page Title",
DlgDocLangDir : "Language Direction",
DlgDocLangDirLTR : "Left to Right (LTR)",
DlgDocLangDirRTL : "Right to Left (RTL)",
DlgDocLangCode : "Language Code",
DlgDocCharSet : "Character Set Encoding",
DlgDocCharSetCE : "Central European",
DlgDocCharSetCT : "Chinese Traditional (Big5)",
DlgDocCharSetCR : "Cyrillic",
DlgDocCharSetGR : "Greek",
DlgDocCharSetJP : "Japanese",
DlgDocCharSetKR : "Korean",
DlgDocCharSetTR : "Turkish",
DlgDocCharSetUN : "Unicode (UTF-8)",
DlgDocCharSetWE : "Western European",
DlgDocCharSetOther : "Other Character Set Encoding",
 
DlgDocDocType : "Document Type Heading",
DlgDocDocTypeOther : "Other Document Type Heading",
DlgDocIncXHTML : "Include XHTML Declarations",
DlgDocBgColor : "Background Colour",
DlgDocBgImage : "Background Image URL",
DlgDocBgNoScroll : "Nonscrolling Background",
DlgDocCText : "Text",
DlgDocCLink : "Link",
DlgDocCVisited : "Visited Link",
DlgDocCActive : "Active Link",
DlgDocMargins : "Page Margins",
DlgDocMaTop : "Top",
DlgDocMaLeft : "Left",
DlgDocMaRight : "Right",
DlgDocMaBottom : "Bottom",
DlgDocMeIndex : "Document Indexing Keywords (comma separated)",
DlgDocMeDescr : "Document Description",
DlgDocMeAuthor : "Author",
DlgDocMeCopy : "Copyright",
DlgDocPreview : "Preview",
 
// Templates Dialog
Templates : "Templates",
DlgTemplatesTitle : "Content Templates",
DlgTemplatesSelMsg : "Please select the template to open in the editor<br>(the actual contents will be lost):",
DlgTemplatesLoading : "Loading templates list. Please wait...",
DlgTemplatesNoTpl : "(No templates defined)",
DlgTemplatesReplace : "Replace actual contents",
 
// About Dialog
DlgAboutAboutTab : "About",
DlgAboutBrowserInfoTab : "Browser Info",
DlgAboutLicenseTab : "License",
DlgAboutVersion : "version",
DlgAboutLicense : "Licensed under the terms of the GNU Lesser General Public License",
DlgAboutInfo : "For further information go to"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/pt.js
New file
0,0 → 1,501
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: pt.js
* Portuguese language file.
*
* File Authors:
* Francisco Pereira (fjpereira@netcabo.pt)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Fechar Barra",
ToolbarExpand : "Expandir Barra",
 
// Toolbar Items and Context Menu
Save : "Guardar",
NewPage : "Nova Página",
Preview : "Pré-visualizar",
Cut : "Cortar",
Copy : "Copiar",
Paste : "Colar",
PasteText : "Colar como texto não formatado",
PasteWord : "Colar do Word",
Print : "Imprimir",
SelectAll : "Seleccionar Tudo",
RemoveFormat : "Eliminar Formato",
InsertLinkLbl : "Hiperligação",
InsertLink : "Inserir/Editar Hiperligação",
RemoveLink : "Eliminar Hiperligação",
Anchor : " Inserir/Editar Âncora",
InsertImageLbl : "Imagem",
InsertImage : "Inserir/Editar Imagem",
InsertFlashLbl : "Flash",
InsertFlash : "Inserir/Editar Flash",
InsertTableLbl : "Tabela",
InsertTable : "Inserir/Editar Tabela",
InsertLineLbl : "Linha",
InsertLine : "Inserir Linha Horizontal",
InsertSpecialCharLbl: "Caracter Especial",
InsertSpecialChar : "Inserir Caracter Especial",
InsertSmileyLbl : "Emoticons",
InsertSmiley : "Inserir Emoticons",
About : "Acerca do FCKeditor",
Bold : "Negrito",
Italic : "Itálico",
Underline : "Sublinhado",
StrikeThrough : "Rasurado",
Subscript : "Superior à Linha",
Superscript : "Inferior à Linha",
LeftJustify : "Alinhar à Esquerda",
CenterJustify : "Alinhar ao Centro",
RightJustify : "Alinhar à Direita",
BlockJustify : "Justificado",
DecreaseIndent : "Diminuir Avanço",
IncreaseIndent : "Aumentar Avanço",
Undo : "Anular",
Redo : "Repetir",
NumberedListLbl : "Numeração",
NumberedList : "Inserir/Eliminar Numeração",
BulletedListLbl : "Marcas",
BulletedList : "Inserir/Eliminar Marcas",
ShowTableBorders : "Mostrar Limites da Tabelas",
ShowDetails : "Mostrar Parágrafo",
Style : "Estilo",
FontFormat : "Formato",
Font : "Tipo de Letra",
FontSize : "Tamanho",
TextColor : "Cor do Texto",
BGColor : "Cor de Fundo",
Source : "Fonte",
Find : "Procurar",
Replace : "Substituir",
SpellCheck : "Verificação Ortográfica",
UniversalKeyboard : "Teclado Universal",
PageBreakLbl : "Quebra de Página",
PageBreak : "Inserir Quebra de Página",
 
Form : "Formulário",
Checkbox : "Caixa de Verificação",
RadioButton : "Botão de Opção",
TextField : "Campo de Texto",
Textarea : "Área de Texto",
HiddenField : "Campo Escondido",
Button : "Botão",
SelectionField : "Caixa de Combinação",
ImageButton : "Botão de Imagem",
 
FitWindow : "Maximizar o tamanho do editor",
 
// Context Menu
EditLink : "Editar Hiperligação",
CellCM : "Célula",
RowCM : "Linha",
ColumnCM : "Coluna",
InsertRow : "Inserir Linha",
DeleteRows : "Eliminar Linhas",
InsertColumn : "Inserir Coluna",
DeleteColumns : "Eliminar Coluna",
InsertCell : "Inserir Célula",
DeleteCells : "Eliminar Célula",
MergeCells : "Unir Células",
SplitCell : "Dividir Célula",
TableDelete : "Eliminar Tabela",
CellProperties : "Propriedades da Célula",
TableProperties : "Propriedades da Tabela",
ImageProperties : "Propriedades da Imagem",
FlashProperties : "Propriedades do Flash",
 
AnchorProp : "Propriedades da Âncora",
ButtonProp : "Propriedades do Botão",
CheckboxProp : "Propriedades da Caixa de Verificação",
HiddenFieldProp : "Propriedades do Campo Escondido",
RadioButtonProp : "Propriedades do Botão de Opção",
ImageButtonProp : "Propriedades do Botão de imagens",
TextFieldProp : "Propriedades do Campo de Texto",
SelectionFieldProp : "Propriedades da Caixa de Combinação",
TextareaProp : "Propriedades da Área de Texto",
FormProp : "Propriedades do Formulário",
 
FontFormats : "Normal;Formatado;Endereço;Título 1;Título 2;Título 3;Título 4;Título 5;Título 6",
 
// Alerts and Messages
ProcessingXHTML : "A Processar XHTML. Por favor, espere...",
Done : "Concluído",
PasteWordConfirm : "O texto que deseja parece ter sido copiado do Word. Deseja limpar a formatação antes de colar?",
NotCompatiblePaste : "Este comando só está disponível para Internet Explorer versão 5.5 ou superior. Deseja colar sem limpar a formatação?",
UnknownToolbarItem : "Item de barra desconhecido \"%1\"",
UnknownCommand : "Nome de comando desconhecido \"%1\"",
NotImplemented : "Comando não implementado",
UnknownToolbarSet : "Nome de barra \"%1\" não definido",
NoActiveX : "As definições de segurança do navegador podem limitar algumas potencalidades do editr. Deve activar a opção \"Executar controlos e extensões ActiveX\". Pode ocorrer erros ou verificar que faltam potencialidades.",
BrowseServerBlocked : "Não foi possível abrir o navegador de recursos. Certifique-se que todos os bloqueadores de popup estão desactivados.",
DialogBlocked : "Não foi possível abrir a janela de diálogo. Certifique-se que todos os bloqueadores de popup estão desactivados.",
 
// Dialogs
DlgBtnOK : "OK",
DlgBtnCancel : "Cancelar",
DlgBtnClose : "Fechar",
DlgBtnBrowseServer : "Navegar no Servidor",
DlgAdvancedTag : "Avançado",
DlgOpOther : "<Outro>",
DlgInfoTab : "Informação",
DlgAlertUrl : "Por favor introduza o URL",
 
// General Dialogs Labels
DlgGenNotSet : "<Não definido>",
DlgGenId : "Id",
DlgGenLangDir : "Orientação de idioma",
DlgGenLangDirLtr : "Esquerda à Direita (LTR)",
DlgGenLangDirRtl : "Direita a Esquerda (RTL)",
DlgGenLangCode : "Código de Idioma",
DlgGenAccessKey : "Chave de Acesso",
DlgGenName : "Nome",
DlgGenTabIndex : "Índice de Tubulação",
DlgGenLongDescr : "Descrição Completa do URL",
DlgGenClass : "Classes de Estilo de Folhas Classes",
DlgGenTitle : "Título",
DlgGenContType : "Tipo de Conteúdo",
DlgGenLinkCharset : "Fonte de caracteres vinculado",
DlgGenStyle : "Estilo",
 
// Image Dialog
DlgImgTitle : "Propriedades da Imagem",
DlgImgInfoTab : "Informação da Imagem",
DlgImgBtnUpload : "Enviar para o Servidor",
DlgImgURL : "URL",
DlgImgUpload : "Carregar",
DlgImgAlt : "Texto Alternativo",
DlgImgWidth : "Largura",
DlgImgHeight : "Altura",
DlgImgLockRatio : "Proporcional",
DlgBtnResetSize : "Tamanho Original",
DlgImgBorder : "Limite",
DlgImgHSpace : "Esp.Horiz",
DlgImgVSpace : "Esp.Vert",
DlgImgAlign : "Alinhamento",
DlgImgAlignLeft : "Esquerda",
DlgImgAlignAbsBottom: "Abs inferior",
DlgImgAlignAbsMiddle: "Abs centro",
DlgImgAlignBaseline : "Linha de base",
DlgImgAlignBottom : "Fundo",
DlgImgAlignMiddle : "Centro",
DlgImgAlignRight : "Direita",
DlgImgAlignTextTop : "Topo do texto",
DlgImgAlignTop : "Topo",
DlgImgPreview : "Pré-visualizar",
DlgImgAlertUrl : "Por favor introduza o URL da imagem",
DlgImgLinkTab : "Hiperligação",
 
// Flash Dialog
DlgFlashTitle : "Propriedades do Flash",
DlgFlashChkPlay : "Reproduzir automaticamente",
DlgFlashChkLoop : "Loop",
DlgFlashChkMenu : "Permitir Menu do Flash",
DlgFlashScale : "Escala",
DlgFlashScaleAll : "Mostrar tudo",
DlgFlashScaleNoBorder : "Sem Limites",
DlgFlashScaleFit : "Tamanho Exacto",
 
// Link Dialog
DlgLnkWindowTitle : "Hiperligação",
DlgLnkInfoTab : "Informação de Hiperligação",
DlgLnkTargetTab : "Destino",
 
DlgLnkType : "Tipo de Hiperligação",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Referência a esta página",
DlgLnkTypeEMail : "E-Mail",
DlgLnkProto : "Protocolo",
DlgLnkProtoOther : "<outro>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Seleccionar una referência",
DlgLnkAnchorByName : "Por Nome de Referência",
DlgLnkAnchorById : "Por ID de elemento",
DlgLnkNoAnchors : "<Não há referências disponíveis no documento>",
DlgLnkEMail : "Endereço de E-Mail",
DlgLnkEMailSubject : "Título de Mensagem",
DlgLnkEMailBody : "Corpo da Mensagem",
DlgLnkUpload : "Carregar",
DlgLnkBtnUpload : "Enviar ao Servidor",
 
DlgLnkTarget : "Destino",
DlgLnkTargetFrame : "<Frame>",
DlgLnkTargetPopup : "<Janela de popup>",
DlgLnkTargetBlank : "Nova Janela(_blank)",
DlgLnkTargetParent : "Janela Pai (_parent)",
DlgLnkTargetSelf : "Mesma janela (_self)",
DlgLnkTargetTop : "Janela primaria (_top)",
DlgLnkTargetFrameName : "Nome do Frame Destino",
DlgLnkPopWinName : "Nome da Janela de Popup",
DlgLnkPopWinFeat : "Características de Janela de Popup",
DlgLnkPopResize : "Ajustável",
DlgLnkPopLocation : "Barra de localização",
DlgLnkPopMenu : "Barra de Menu",
DlgLnkPopScroll : "Barras de deslocamento",
DlgLnkPopStatus : "Barra de Estado",
DlgLnkPopToolbar : "Barra de Ferramentas",
DlgLnkPopFullScrn : "Janela Completa (IE)",
DlgLnkPopDependent : "Dependente (Netscape)",
DlgLnkPopWidth : "Largura",
DlgLnkPopHeight : "Altura",
DlgLnkPopLeft : "Posição Esquerda",
DlgLnkPopTop : "Posição Direita",
 
DlnLnkMsgNoUrl : "Por favor introduza a hiperligação URL",
DlnLnkMsgNoEMail : "Por favor introduza o endereço de e-mail",
DlnLnkMsgNoAnchor : "Por favor seleccione uma referência",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "Seleccionar Cor",
DlgColorBtnClear : "Nenhuma",
DlgColorHighlight : "Destacado",
DlgColorSelected : "Seleccionado",
 
// Smiley Dialog
DlgSmileyTitle : "Inserir um Emoticon",
 
// Special Character Dialog
DlgSpecialCharTitle : "Seleccione um caracter especial",
 
// Table Dialog
DlgTableTitle : "Propriedades da Tabela",
DlgTableRows : "Linhas",
DlgTableColumns : "Colunas",
DlgTableBorder : "Tamanho do Limite",
DlgTableAlign : "Alinhamento",
DlgTableAlignNotSet : "<Não definido>",
DlgTableAlignLeft : "Esquerda",
DlgTableAlignCenter : "Centrado",
DlgTableAlignRight : "Direita",
DlgTableWidth : "Largura",
DlgTableWidthPx : "pixeis",
DlgTableWidthPc : "percentagem",
DlgTableHeight : "Altura",
DlgTableCellSpace : "Esp. e/células",
DlgTableCellPad : "Esp. interior",
DlgTableCaption : "Título",
DlgTableSummary : "Sumário",
 
// Table Cell Dialog
DlgCellTitle : "Propriedades da Célula",
DlgCellWidth : "Largura",
DlgCellWidthPx : "pixeis",
DlgCellWidthPc : "percentagem",
DlgCellHeight : "Altura",
DlgCellWordWrap : "Moldar Texto",
DlgCellWordWrapNotSet : "<Não definido>",
DlgCellWordWrapYes : "Sim",
DlgCellWordWrapNo : "Não",
DlgCellHorAlign : "Alinhamento Horizontal",
DlgCellHorAlignNotSet : "<Não definido>",
DlgCellHorAlignLeft : "Esquerda",
DlgCellHorAlignCenter : "Centrado",
DlgCellHorAlignRight: "Direita",
DlgCellVerAlign : "Alinhamento Vertical",
DlgCellVerAlignNotSet : "<Não definido>",
DlgCellVerAlignTop : "Topo",
DlgCellVerAlignMiddle : "Médio",
DlgCellVerAlignBottom : "Fundi",
DlgCellVerAlignBaseline : "Linha de Base",
DlgCellRowSpan : "Unir Linhas",
DlgCellCollSpan : "Unir Colunas",
DlgCellBackColor : "Cor do Fundo",
DlgCellBorderColor : "Cor do Limite",
DlgCellBtnSelect : "Seleccione...",
 
// Find Dialog
DlgFindTitle : "Procurar",
DlgFindFindBtn : "Procurar",
DlgFindNotFoundMsg : "O texto especificado não foi encontrado.",
 
// Replace Dialog
DlgReplaceTitle : "Substituir",
DlgReplaceFindLbl : "Texto a Procurar:",
DlgReplaceReplaceLbl : "Substituir por:",
DlgReplaceCaseChk : "Maiúsculas/Minúsculas",
DlgReplaceReplaceBtn : "Substituir",
DlgReplaceReplAllBtn : "Substituir Tudo",
DlgReplaceWordChk : "Coincidir com toda a palavra",
 
// Paste Operations / Dialog
PasteErrorPaste : "A configuração de segurança do navegador não permite a execução automática de operações de colar. Por favor use o teclado (Ctrl+V).",
PasteErrorCut : "A configuração de segurança do navegador não permite a execução automática de operações de cortar. Por favor use o teclado (Ctrl+X).",
PasteErrorCopy : "A configuração de segurança do navegador não permite a execução automática de operações de copiar. Por favor use o teclado (Ctrl+C).",
 
PasteAsText : "Colar como Texto Simples",
PasteFromWord : "Colar do Word",
 
DlgPasteMsg2 : "Por favor, cole dentro da seguinte caixa usando o teclado (<STRONG>Ctrl+V</STRONG>) e prima <STRONG>OK</STRONG>.",
DlgPasteIgnoreFont : "Ignorar da definições do Tipo de Letra ",
DlgPasteRemoveStyles : "Remover as definições de Estilos",
DlgPasteCleanBox : "Caixa de Limpeza",
 
// Color Picker
ColorAutomatic : "Automático",
ColorMoreColors : "Mais Cores...",
 
// Document Properties
DocProps : "Propriedades do Documento",
 
// Anchor Dialog
DlgAnchorTitle : "Propriedades da Âncora",
DlgAnchorName : "Nome da Âncora",
DlgAnchorErrorName : "Por favor, introduza o nome da âncora",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Não está num directório",
DlgSpellChangeTo : "Mudar para",
DlgSpellBtnIgnore : "Ignorar",
DlgSpellBtnIgnoreAll : "Ignorar Tudo",
DlgSpellBtnReplace : "Substituir",
DlgSpellBtnReplaceAll : "Substituir Tudo",
DlgSpellBtnUndo : "Anular",
DlgSpellNoSuggestions : "- Sem sugestões -",
DlgSpellProgress : "Verificação ortográfica em progresso…",
DlgSpellNoMispell : "Verificação ortográfica completa: não foram encontrados erros",
DlgSpellNoChanges : "Verificação ortográfica completa: não houve alteração de palavras",
DlgSpellOneChange : "Verificação ortográfica completa: uma palavra alterada",
DlgSpellManyChanges : "Verificação ortográfica completa: %1 palavras alteradas",
 
IeSpellDownload : " Verificação ortográfica não instalada. Quer descarregar agora?",
 
// Button Dialog
DlgButtonText : "Texto (Valor)",
DlgButtonType : "Tipo",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Nome",
DlgCheckboxValue : "Valor",
DlgCheckboxSelected : "Seleccionado",
 
// Form Dialog
DlgFormName : "Nome",
DlgFormAction : "Acção",
DlgFormMethod : "Método",
 
// Select Field Dialog
DlgSelectName : "Nome",
DlgSelectValue : "Valor",
DlgSelectSize : "Tamanho",
DlgSelectLines : "linhas",
DlgSelectChkMulti : "Permitir selecções múltiplas",
DlgSelectOpAvail : "Opções Possíveis",
DlgSelectOpText : "Texto",
DlgSelectOpValue : "Valor",
DlgSelectBtnAdd : "Adicionar",
DlgSelectBtnModify : "Modificar",
DlgSelectBtnUp : "Para cima",
DlgSelectBtnDown : "Para baixo",
DlgSelectBtnSetValue : "Definir um valor por defeito",
DlgSelectBtnDelete : "Apagar",
 
// Textarea Dialog
DlgTextareaName : "Nome",
DlgTextareaCols : "Colunas",
DlgTextareaRows : "Linhas",
 
// Text Field Dialog
DlgTextName : "Nome",
DlgTextValue : "Valor",
DlgTextCharWidth : "Tamanho do caracter",
DlgTextMaxChars : "Nr. Máximo de Caracteres",
DlgTextType : "Tipo",
DlgTextTypeText : "Texto",
DlgTextTypePass : "Palavra-chave",
 
// Hidden Field Dialog
DlgHiddenName : "Nome",
DlgHiddenValue : "Valor",
 
// Bulleted List Dialog
BulletedListProp : "Propriedades da Marca",
NumberedListProp : "Propriedades da Numeração",
DlgLstStart : "Start", //MISSING
DlgLstType : "Tipo",
DlgLstTypeCircle : "Circulo",
DlgLstTypeDisc : "Disco",
DlgLstTypeSquare : "Quadrado",
DlgLstTypeNumbers : "Números (1, 2, 3)",
DlgLstTypeLCase : "Letras Minúsculas (a, b, c)",
DlgLstTypeUCase : "Letras Maiúsculas (A, B, C)",
DlgLstTypeSRoman : "Numeração Romana em Minúsculas (i, ii, iii)",
DlgLstTypeLRoman : "Numeração Romana em Maiúsculas (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "Geral",
DlgDocBackTab : "Fundo",
DlgDocColorsTab : "Cores e Margens",
DlgDocMetaTab : "Meta Data",
 
DlgDocPageTitle : "Título da Página",
DlgDocLangDir : "Orientação de idioma",
DlgDocLangDirLTR : "Esquerda à Direita (LTR)",
DlgDocLangDirRTL : "Direita à Esquerda (RTL)",
DlgDocLangCode : "Código de Idioma",
DlgDocCharSet : "Codificação de Caracteres",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "Outra Codificação de Caracteres",
 
DlgDocDocType : "Tipo de Cabeçalho do Documento",
DlgDocDocTypeOther : "Outro Tipo de Cabeçalho do Documento",
DlgDocIncXHTML : "Incluir Declarações XHTML",
DlgDocBgColor : "Cor de Fundo",
DlgDocBgImage : "Caminho para a Imagem de Fundo",
DlgDocBgNoScroll : "Fundo Fixo",
DlgDocCText : "Texto",
DlgDocCLink : "Hiperligação",
DlgDocCVisited : "Hiperligação Visitada",
DlgDocCActive : "Hiperligação Activa",
DlgDocMargins : "Margem das Páginas",
DlgDocMaTop : "Topo",
DlgDocMaLeft : "Esquerda",
DlgDocMaRight : "Direita",
DlgDocMaBottom : "Fundo",
DlgDocMeIndex : "Palavras de Indexação do Documento (separadas por virgula)",
DlgDocMeDescr : "Descrição do Documento",
DlgDocMeAuthor : "Autor",
DlgDocMeCopy : "Direitos de Autor",
DlgDocPreview : "Pré-visualizar",
 
// Templates Dialog
Templates : "Modelos",
DlgTemplatesTitle : "Modelo de Conteúdo",
DlgTemplatesSelMsg : "Por favor, seleccione o modelo a abrir no editor<br>(o conteúdo actual será perdido):",
DlgTemplatesLoading : "A carregar a lista de modelos. Aguarde por favor...",
DlgTemplatesNoTpl : "(Sem modelos definidos)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "Acerca",
DlgAboutBrowserInfoTab : "Informação do Nevegador",
DlgAboutLicenseTab : "Licença",
DlgAboutVersion : "versão",
DlgAboutLicense : "Licenciado segundo os términos de GNU Lesser General Public License",
DlgAboutInfo : "Para mais informações por favor dirija-se a"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/da.js
New file
0,0 → 1,503
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: da.js
* Danish language file.
*
* File Authors:
* Jørgen Nordstrøm (jn@FirstWeb.dk)
* Jesper Michelsen (jm@i-deVision.dk)
* Bo Brandt (bbr@dynamicweb.dk)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Skjul værktøjslinier",
ToolbarExpand : "Vis værktøjslinier",
 
// Toolbar Items and Context Menu
Save : "Gem",
NewPage : "Ny side",
Preview : "Vis eksempel",
Cut : "Klip",
Copy : "Kopier",
Paste : "Indsæt",
PasteText : "Indsæt som ikke-formateret tekst",
PasteWord : "Indsæt fra Word",
Print : "Udskriv",
SelectAll : "Vælg alt",
RemoveFormat : "Fjern formatering",
InsertLinkLbl : "Hyperlink",
InsertLink : "Indsæt/rediger hyperlink",
RemoveLink : "Fjern hyperlink",
Anchor : "Indsæt/rediger bogmærke",
InsertImageLbl : "Indsæt billede",
InsertImage : "Indsæt/rediger billede",
InsertFlashLbl : "Flash",
InsertFlash : "Indsæt/rediger Flash",
InsertTableLbl : "Table",
InsertTable : "Indsæt/rediger tabel",
InsertLineLbl : "Linie",
InsertLine : "Indsæt vandret linie",
InsertSpecialCharLbl: "Symbol",
InsertSpecialChar : "Indsæt symbol",
InsertSmileyLbl : "Smiley",
InsertSmiley : "Indsæt smiley",
About : "Om FCKeditor",
Bold : "Fed",
Italic : "Kursiv",
Underline : "Understreget",
StrikeThrough : "Overstreget",
Subscript : "Sænket skrift",
Superscript : "Hævet skrift",
LeftJustify : "Venstrestillet",
CenterJustify : "Centreret",
RightJustify : "Højrestillet",
BlockJustify : "Lige margener",
DecreaseIndent : "Formindsk indrykning",
IncreaseIndent : "Forøg indrykning",
Undo : "Fortryd",
Redo : "Annuller fortryd",
NumberedListLbl : "Talopstilling",
NumberedList : "Indsæt/fjern talopstilling",
BulletedListLbl : "Punktopstilling",
BulletedList : "Indsæt/fjern punktopstilling",
ShowTableBorders : "Vis tabelkanter",
ShowDetails : "Vis detaljer",
Style : "Typografi",
FontFormat : "Formatering",
Font : "Skrifttype",
FontSize : "Skriftstørrelse",
TextColor : "Tekstfarve",
BGColor : "Baggrundsfarve",
Source : "Kilde",
Find : "Søg",
Replace : "Erstat",
SpellCheck : "Stavekontrol",
UniversalKeyboard : "Universaltastatur",
PageBreakLbl : "Sidskift",
PageBreak : "Indsæt sideskift",
 
Form : "Indsæt formular",
Checkbox : "Indsæt afkrydsningsfelt",
RadioButton : "Indsæt alternativknap",
TextField : "Indsæt tekstfelt",
Textarea : "Indsæt tekstboks",
HiddenField : "Indsæt skjult felt",
Button : "Indsæt knap",
SelectionField : "Indsæt liste",
ImageButton : "Indsæt billedknap",
 
FitWindow : "Maksimer editor vinduet",
 
// Context Menu
EditLink : "Rediger hyperlink",
CellCM : "Celle",
RowCM : "Række",
ColumnCM : "Kolonne",
InsertRow : "Indsæt række",
DeleteRows : "Slet række",
InsertColumn : "Indsæt kolonne",
DeleteColumns : "Slet kolonne",
InsertCell : "Indsæt celle",
DeleteCells : "Slet celle",
MergeCells : "Flet celler",
SplitCell : "Opdel celle",
TableDelete : "Slet tabel",
CellProperties : "Egenskaber for celle",
TableProperties : "Egenskaber for tabel",
ImageProperties : "Egenskaber for billede",
FlashProperties : "Egenskaber for Flash",
 
AnchorProp : "Egenskaber for bogmærke",
ButtonProp : "Egenskaber for knap",
CheckboxProp : "Egenskaber for afkrydsningsfelt",
HiddenFieldProp : "Egenskaber for skjult felt",
RadioButtonProp : "Egenskaber for alternativknap",
ImageButtonProp : "Egenskaber for billedknap",
TextFieldProp : "Egenskaber for tekstfelt",
SelectionFieldProp : "Egenskaber for liste",
TextareaProp : "Egenskaber for tekstboks",
FormProp : "Egenskaber for formular",
 
FontFormats : "Normal;Formateret;Adresse;Overskrift 1;Overskrift 2;Overskrift 3;Overskrift 4;Overskrift 5;Overskrift 6;Normal (DIV)",
 
// Alerts and Messages
ProcessingXHTML : "Behandler XHTML...",
Done : "Færdig",
PasteWordConfirm : "Den tekst du forsøger at indsætte ser ud til at komme fra Word.<br>Vil du rense teksten før den indsættes?",
NotCompatiblePaste : "Denne kommando er tilgændelig i Internet Explorer 5.5 eller senere.<br>Vil du indsætte teksten uden at rense den ?",
UnknownToolbarItem : "Ukendt værktøjslinjeobjekt \"%1\"!",
UnknownCommand : "Ukendt kommandonavn \"%1\"!",
NotImplemented : "Kommandoen er ikke implementeret!",
UnknownToolbarSet : "Værktøjslinjen \"%1\" eksisterer ikke!",
NoActiveX : "Din browsers sikkerhedsindstillinger begrænser nogle af editorens muligheder.<br>Slå \"Kør ActiveX-objekter og plug-ins\" til, ellers vil du opleve fejl og manglende muligheder.",
BrowseServerBlocked : "Browseren kunne ikke åbne de nødvendige ressourcer!<br>Slå pop-up blokering fra.",
DialogBlocked : "Dialogvinduet kunne ikke åbnes!<br>Slå pop-up blokering fra.",
 
// Dialogs
DlgBtnOK : "OK",
DlgBtnCancel : "Annuller",
DlgBtnClose : "Luk",
DlgBtnBrowseServer : "Gennemse...",
DlgAdvancedTag : "Avanceret",
DlgOpOther : "<Andet>",
DlgInfoTab : "Generelt",
DlgAlertUrl : "Indtast URL",
 
// General Dialogs Labels
DlgGenNotSet : "<intet valgt>",
DlgGenId : "Id",
DlgGenLangDir : "Tekstretning",
DlgGenLangDirLtr : "Fra venstre mod højre (LTR)",
DlgGenLangDirRtl : "Fra højre mod venstre (RTL)",
DlgGenLangCode : "Sprogkode",
DlgGenAccessKey : "Genvejstast",
DlgGenName : "Navn",
DlgGenTabIndex : "Tabulator indeks",
DlgGenLongDescr : "Udvidet beskrivelse",
DlgGenClass : "Typografiark",
DlgGenTitle : "Titel",
DlgGenContType : "Indholdstype",
DlgGenLinkCharset : "Tegnsæt",
DlgGenStyle : "Typografi",
 
// Image Dialog
DlgImgTitle : "Egenskaber for billede",
DlgImgInfoTab : "Generelt",
DlgImgBtnUpload : "Upload",
DlgImgURL : "URL",
DlgImgUpload : "Upload",
DlgImgAlt : "Alternativ tekst",
DlgImgWidth : "Bredde",
DlgImgHeight : "Højde",
DlgImgLockRatio : "Lås størrelsesforhold",
DlgBtnResetSize : "Nulstil størrelse",
DlgImgBorder : "Ramme",
DlgImgHSpace : "HMargen",
DlgImgVSpace : "VMargen",
DlgImgAlign : "Justering",
DlgImgAlignLeft : "Venstre",
DlgImgAlignAbsBottom: "Absolut nederst",
DlgImgAlignAbsMiddle: "Absolut centreret",
DlgImgAlignBaseline : "Grundlinje",
DlgImgAlignBottom : "Nederst",
DlgImgAlignMiddle : "Centreret",
DlgImgAlignRight : "Højre",
DlgImgAlignTextTop : "Toppen af teksten",
DlgImgAlignTop : "Øverst",
DlgImgPreview : "Vis eksempel",
DlgImgAlertUrl : "Indtast stien til billedet",
DlgImgLinkTab : "Hyperlink",
 
// Flash Dialog
DlgFlashTitle : "Egenskaber for Flash",
DlgFlashChkPlay : "Automatisk afspilning",
DlgFlashChkLoop : "Gentagelse",
DlgFlashChkMenu : "Vis Flash menu",
DlgFlashScale : "Skalér",
DlgFlashScaleAll : "Vis alt",
DlgFlashScaleNoBorder : "Ingen ramme",
DlgFlashScaleFit : "Tilpas størrelse",
 
// Link Dialog
DlgLnkWindowTitle : "Egenskaber for hyperlink",
DlgLnkInfoTab : "Generelt",
DlgLnkTargetTab : "Mål",
 
DlgLnkType : "Hyperlink type",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Bogmærke på denne side",
DlgLnkTypeEMail : "E-mail",
DlgLnkProto : "Protokol",
DlgLnkProtoOther : "<anden>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Vælg et anker",
DlgLnkAnchorByName : "Efter anker navn",
DlgLnkAnchorById : "Efter element Id",
DlgLnkNoAnchors : "<Ingen bogmærker dokumentet>",
DlgLnkEMail : "E-mailadresse",
DlgLnkEMailSubject : "Emne",
DlgLnkEMailBody : "Brødtekst",
DlgLnkUpload : "Upload",
DlgLnkBtnUpload : "Upload",
 
DlgLnkTarget : "Mål",
DlgLnkTargetFrame : "<ramme>",
DlgLnkTargetPopup : "<popup vindue>",
DlgLnkTargetBlank : "Nyt vindue (_blank)",
DlgLnkTargetParent : "Overordnet ramme (_parent)",
DlgLnkTargetSelf : "Samme vindue (_self)",
DlgLnkTargetTop : "Hele vinduet (_top)",
DlgLnkTargetFrameName : "Destinationsvinduets navn",
DlgLnkPopWinName : "Pop-up vinduets navn",
DlgLnkPopWinFeat : "Egenskaber for pop-up",
DlgLnkPopResize : "Skalering",
DlgLnkPopLocation : "Adresselinje",
DlgLnkPopMenu : "Menulinje",
DlgLnkPopScroll : "Scrollbars",
DlgLnkPopStatus : "Statuslinje",
DlgLnkPopToolbar : "Værktøjslinje",
DlgLnkPopFullScrn : "Fuld skærm (IE)",
DlgLnkPopDependent : "Koblet/dependent (Netscape)",
DlgLnkPopWidth : "Bredde",
DlgLnkPopHeight : "Højde",
DlgLnkPopLeft : "Position fra venstre",
DlgLnkPopTop : "Position fra toppen",
 
DlnLnkMsgNoUrl : "Indtast hyperlink URL!",
DlnLnkMsgNoEMail : "Indtast e-mailaddresse!",
DlnLnkMsgNoAnchor : "Vælg bogmærke!",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "Vælg farve",
DlgColorBtnClear : "Nulstil",
DlgColorHighlight : "Markeret",
DlgColorSelected : "Valgt",
 
// Smiley Dialog
DlgSmileyTitle : "Vælg smiley",
 
// Special Character Dialog
DlgSpecialCharTitle : "Vælg symbol",
 
// Table Dialog
DlgTableTitle : "Egenskaber for tabel",
DlgTableRows : "Rækker",
DlgTableColumns : "Kolonner",
DlgTableBorder : "Rammebredde",
DlgTableAlign : "Justering",
DlgTableAlignNotSet : "<intet valgt>",
DlgTableAlignLeft : "Venstrestillet",
DlgTableAlignCenter : "Centreret",
DlgTableAlignRight : "Højrestillet",
DlgTableWidth : "Bredde",
DlgTableWidthPx : "pixels",
DlgTableWidthPc : "procent",
DlgTableHeight : "Højde",
DlgTableCellSpace : "Celleafstand",
DlgTableCellPad : "Cellemargen",
DlgTableCaption : "Titel",
DlgTableSummary : "Resume",
 
// Table Cell Dialog
DlgCellTitle : "Egenskaber for celle",
DlgCellWidth : "Bredde",
DlgCellWidthPx : "pixels",
DlgCellWidthPc : "procent",
DlgCellHeight : "Højde",
DlgCellWordWrap : "Orddeling",
DlgCellWordWrapNotSet : "<intet valgt>",
DlgCellWordWrapYes : "Ja",
DlgCellWordWrapNo : "Nej",
DlgCellHorAlign : "Vandret justering",
DlgCellHorAlignNotSet : "<intet valgt>",
DlgCellHorAlignLeft : "Venstrestillet",
DlgCellHorAlignCenter : "Centreret",
DlgCellHorAlignRight: "Højrestillet",
DlgCellVerAlign : "Lodret justering",
DlgCellVerAlignNotSet : "<intet valgt>",
DlgCellVerAlignTop : "Øverst",
DlgCellVerAlignMiddle : "Centreret",
DlgCellVerAlignBottom : "Nederst",
DlgCellVerAlignBaseline : "Grundlinje",
DlgCellRowSpan : "Højde i antal rækker",
DlgCellCollSpan : "Bredde i antal kolonner",
DlgCellBackColor : "Baggrundsfarve",
DlgCellBorderColor : "Rammefarve",
DlgCellBtnSelect : "Vælg...",
 
// Find Dialog
DlgFindTitle : "Find",
DlgFindFindBtn : "Find",
DlgFindNotFoundMsg : "Søgeteksten blev ikke fundet!",
 
// Replace Dialog
DlgReplaceTitle : "Erstat",
DlgReplaceFindLbl : "Søg efter:",
DlgReplaceReplaceLbl : "Erstat med:",
DlgReplaceCaseChk : "Forskel på store og små bogstaver",
DlgReplaceReplaceBtn : "Erstat",
DlgReplaceReplAllBtn : "Erstat alle",
DlgReplaceWordChk : "Kun hele ord",
 
// Paste Operations / Dialog
PasteErrorPaste : "Din browsers sikkerhedsindstillinger tillader ikke editoren at indsætte tekst automatisk!<br>Brug i stedet tastaturet til at indsætte teksten (Ctrl+V).",
PasteErrorCut : "Din browsers sikkerhedsindstillinger tillader ikke editoren at klippe tekst automatisk!<br>Brug i stedet tastaturet til at klippe teksten (Ctrl+X).",
PasteErrorCopy : "Din browsers sikkerhedsindstillinger tillader ikke editoren at kopiere tekst automatisk!<br>Brug i stedet tastaturet til at kopiere teksten (Ctrl+C).",
 
PasteAsText : "Indsæt som ikke-formateret tekst",
PasteFromWord : "Indsæt fra Word",
 
DlgPasteMsg2 : "Indsæt i feltet herunder (<STRONG>Ctrl+V</STRONG>) og klik <STRONG>OK</STRONG>.",
DlgPasteIgnoreFont : "Ignorer font definitioner",
DlgPasteRemoveStyles : "Ignorer typografi",
DlgPasteCleanBox : "Slet indhold",
 
// Color Picker
ColorAutomatic : "Automatisk",
ColorMoreColors : "Flere farver...",
 
// Document Properties
DocProps : "Egenskaber for dokument",
 
// Anchor Dialog
DlgAnchorTitle : "Egenskaber for bogmærke",
DlgAnchorName : "Bogmærke navn",
DlgAnchorErrorName : "Indtast bogmærke navn!",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Ikke i ordbogen",
DlgSpellChangeTo : "Forslag",
DlgSpellBtnIgnore : "Ignorer",
DlgSpellBtnIgnoreAll : "Ignorer alle",
DlgSpellBtnReplace : "Erstat",
DlgSpellBtnReplaceAll : "Erstat alle",
DlgSpellBtnUndo : "Tilbage",
DlgSpellNoSuggestions : "- ingen forslag -",
DlgSpellProgress : "Stavekontrolen arbejder...",
DlgSpellNoMispell : "Stavekontrol færdig: Ingen fejl fundet",
DlgSpellNoChanges : "Stavekontrol færdig: Ingen ord ændret",
DlgSpellOneChange : "Stavekontrol færdig: Et ord ændret",
DlgSpellManyChanges : "Stavekontrol færdig: %1 ord ændret",
 
IeSpellDownload : "Stavekontrol ikke installeret.<br>Vil du hente den nu?",
 
// Button Dialog
DlgButtonText : "Tekst",
DlgButtonType : "Type",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Navn",
DlgCheckboxValue : "Værdi",
DlgCheckboxSelected : "Valgt",
 
// Form Dialog
DlgFormName : "Navn",
DlgFormAction : "Handling",
DlgFormMethod : "Metod",
 
// Select Field Dialog
DlgSelectName : "Navn",
DlgSelectValue : "Værdi",
DlgSelectSize : "Størrelse",
DlgSelectLines : "linier",
DlgSelectChkMulti : "Tillad flere valg",
DlgSelectOpAvail : "Valgmuligheder",
DlgSelectOpText : "Tekst",
DlgSelectOpValue : "Værdi",
DlgSelectBtnAdd : "Tilføj",
DlgSelectBtnModify : "Rediger",
DlgSelectBtnUp : "Op",
DlgSelectBtnDown : "Ned",
DlgSelectBtnSetValue : "Sæt som valgt",
DlgSelectBtnDelete : "Slet",
 
// Textarea Dialog
DlgTextareaName : "Navn",
DlgTextareaCols : "Kolonner",
DlgTextareaRows : "Rækker",
 
// Text Field Dialog
DlgTextName : "Navn",
DlgTextValue : "Værdi",
DlgTextCharWidth : "Bredde (tegn)",
DlgTextMaxChars : "Max antal tegn",
DlgTextType : "Type",
DlgTextTypeText : "Tekst",
DlgTextTypePass : "Adgangskode",
 
// Hidden Field Dialog
DlgHiddenName : "Navn",
DlgHiddenValue : "Værdi",
 
// Bulleted List Dialog
BulletedListProp : "Egenskaber for punktopstilling",
NumberedListProp : "Egenskaber for talopstilling",
DlgLstStart : "Start", //MISSING
DlgLstType : "Type",
DlgLstTypeCircle : "Cirkel",
DlgLstTypeDisc : "Udfyldt cirkel",
DlgLstTypeSquare : "Firkant",
DlgLstTypeNumbers : "Nummereret (1, 2, 3)",
DlgLstTypeLCase : "Små bogstaver (a, b, c)",
DlgLstTypeUCase : "Store bogstaver (A, B, C)",
DlgLstTypeSRoman : "Små romertal (i, ii, iii)",
DlgLstTypeLRoman : "Store romertal (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "Generelt",
DlgDocBackTab : "Baggrund",
DlgDocColorsTab : "Farver og margen",
DlgDocMetaTab : "Metadata",
 
DlgDocPageTitle : "Sidetitel",
DlgDocLangDir : "Sprog",
DlgDocLangDirLTR : "Fra venstre mod højre (LTR)",
DlgDocLangDirRTL : "Fra højre mod venstre (RTL)",
DlgDocLangCode : "Landekode",
DlgDocCharSet : "Tegnsæt kode",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "Anden tegnsæt kode",
 
DlgDocDocType : "Dokumenttype kategori",
DlgDocDocTypeOther : "Anden dokumenttype kategori",
DlgDocIncXHTML : "Inkludere XHTML deklartion",
DlgDocBgColor : "Baggrundsfarve",
DlgDocBgImage : "Baggrundsbillede URL",
DlgDocBgNoScroll : "Fastlåst baggrund",
DlgDocCText : "Tekst",
DlgDocCLink : "Hyperlink",
DlgDocCVisited : "Besøgt hyperlink",
DlgDocCActive : "Aktivt hyperlink",
DlgDocMargins : "Sidemargen",
DlgDocMaTop : "Øverst",
DlgDocMaLeft : "Venstre",
DlgDocMaRight : "Højre",
DlgDocMaBottom : "Nederst",
DlgDocMeIndex : "Dokument index nøgleord (kommasepareret)",
DlgDocMeDescr : "Dokument beskrivelse",
DlgDocMeAuthor : "Forfatter",
DlgDocMeCopy : "Copyright",
DlgDocPreview : "Vis",
 
// Templates Dialog
Templates : "Skabeloner",
DlgTemplatesTitle : "Indholdsskabeloner",
DlgTemplatesSelMsg : "Vælg den skabelon, som skal åbnes i editoren.<br>(Nuværende indhold vil blive overskrevet!):",
DlgTemplatesLoading : "Henter liste over skabeloner...",
DlgTemplatesNoTpl : "(Der er ikke defineret nogen skabelon!)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "Om",
DlgAboutBrowserInfoTab : "Generelt",
DlgAboutLicenseTab : "Licens",
DlgAboutVersion : "version",
DlgAboutLicense : "Licens under vilkår for GNU Lesser General Public License",
DlgAboutInfo : "For yderlig information gå til"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/sr.js
New file
0,0 → 1,501
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: sr.js
* Serbian (Cyrillic) language file.
*
* File Authors:
* Zoran Subić (zoran@tf.zr.ac.yu)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Смањи линију са алаткама",
ToolbarExpand : "Прошири линију са алаткама",
 
// Toolbar Items and Context Menu
Save : "Сачувај",
NewPage : "Нова страница",
Preview : "Изглед странице",
Cut : "Исеци",
Copy : "Копирај",
Paste : "Залепи",
PasteText : "Залепи као неформатиран текст",
PasteWord : "Залепи из Worda",
Print : "Штампа",
SelectAll : "Означи све",
RemoveFormat : "Уклони форматирање",
InsertLinkLbl : "Линк",
InsertLink : "Унеси/измени линк",
RemoveLink : "Уклони линк",
Anchor : "Унеси/измени сидро",
InsertImageLbl : "Слика",
InsertImage : "Унеси/измени слику",
InsertFlashLbl : "Флеш елемент",
InsertFlash : "Унеси/измени флеш",
InsertTableLbl : "Табела",
InsertTable : "Унеси/измени табелу",
InsertLineLbl : "Линија",
InsertLine : "Унеси хоризонталну линију",
InsertSpecialCharLbl: "Специјални карактери",
InsertSpecialChar : "Унеси специјални карактер",
InsertSmileyLbl : "Смајли",
InsertSmiley : "Унеси смајлија",
About : "О ФЦКедитору",
Bold : "Подебљано",
Italic : "Курзив",
Underline : "Подвучено",
StrikeThrough : "Прецртано",
Subscript : "Индекс",
Superscript : "Степен",
LeftJustify : "Лево равнање",
CenterJustify : "Центриран текст",
RightJustify : "Десно равнање",
BlockJustify : "Обострано равнање",
DecreaseIndent : "Смањи леву маргину",
IncreaseIndent : "Увећај леву маргину",
Undo : "Поништи акцију",
Redo : "Понови акцију",
NumberedListLbl : "Набројиву листу",
NumberedList : "Унеси/уклони набројиву листу",
BulletedListLbl : "Ненабројива листа",
BulletedList : "Унеси/уклони ненабројиву листу",
ShowTableBorders : "Прикажи оквир табеле",
ShowDetails : "Прикажи детаље",
Style : "Стил",
FontFormat : "Формат",
Font : "Фонт",
FontSize : "Величина фонта",
TextColor : "Боја текста",
BGColor : "Боја позадине",
Source : "Kôд",
Find : "Претрага",
Replace : "Замена",
SpellCheck : "Провери спеловање",
UniversalKeyboard : "Универзална тастатура",
PageBreakLbl : "Page Break", //MISSING
PageBreak : "Insert Page Break", //MISSING
 
Form : "Форма",
Checkbox : "Поље за потврду",
RadioButton : "Радио-дугме",
TextField : "Текстуално поље",
Textarea : "Зона текста",
HiddenField : "Скривено поље",
Button : "Дугме",
SelectionField : "Изборно поље",
ImageButton : "Дугме са сликом",
 
FitWindow : "Maximize the editor size", //MISSING
 
// Context Menu
EditLink : "Промени линк",
CellCM : "Cell", //MISSING
RowCM : "Row", //MISSING
ColumnCM : "Column", //MISSING
InsertRow : "Унеси ред",
DeleteRows : "Обриши редове",
InsertColumn : "Унеси колону",
DeleteColumns : "Обриши колоне",
InsertCell : "Унеси ћелије",
DeleteCells : "Обриши ћелије",
MergeCells : "Спој ћелије",
SplitCell : "Раздвоји ћелије",
TableDelete : "Delete Table", //MISSING
CellProperties : "Особине ћелије",
TableProperties : "Особине табеле",
ImageProperties : "Особине слике",
FlashProperties : "Особине Флеша",
 
AnchorProp : "Особине сидра",
ButtonProp : "Особине дугмета",
CheckboxProp : "Особине поља за потврду",
HiddenFieldProp : "Особине скривеног поља",
RadioButtonProp : "Особине радио-дугмета",
ImageButtonProp : "Особине дугмета са сликом",
TextFieldProp : "Особине текстуалног поља",
SelectionFieldProp : "Особине изборног поља",
TextareaProp : "Особине зоне текста",
FormProp : "Особине форме",
 
FontFormats : "Normal;Formatirano;Adresa;Heading 1;Heading 2;Heading 3;Heading 4;Heading 5;Heading 6",
 
// Alerts and Messages
ProcessingXHTML : "Обрађујем XHTML. Maлo стрпљења...",
Done : "Завршио",
PasteWordConfirm : "Текст који желите да налепите копиран је из Worda. Да ли желите да буде очишћен од формата пре лепљења?",
NotCompatiblePaste : "Ова команда је доступна само за Интернет Екплорер од верзије 5.5. Да ли желите да налепим текст без чишћења?",
UnknownToolbarItem : "Непозната ставка toolbara \"%1\"",
UnknownCommand : "Непозната наредба \"%1\"",
NotImplemented : "Наредба није имплементирана",
UnknownToolbarSet : "Toolbar \"%1\" не постоји",
NoActiveX : "Your browser's security settings could limit some features of the editor. You must enable the option \"Run ActiveX controls and plug-ins\". You may experience errors and notice missing features.", //MISSING
BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.", //MISSING
DialogBlocked : "It was not possible to open the dialog window. Make sure all popup blockers are disabled.", //MISSING
 
// Dialogs
DlgBtnOK : "OK",
DlgBtnCancel : "Oткажи",
DlgBtnClose : "Затвори",
DlgBtnBrowseServer : "Претражи сервер",
DlgAdvancedTag : "Напредни тагови",
DlgOpOther : "<Остали>",
DlgInfoTab : "Инфо",
DlgAlertUrl : "Молимо Вас, унесите УРЛ",
 
// General Dialogs Labels
DlgGenNotSet : "<није постављено>",
DlgGenId : "Ид",
DlgGenLangDir : "Смер језика",
DlgGenLangDirLtr : "С лева на десно (LTR)",
DlgGenLangDirRtl : "С десна на лево (RTL)",
DlgGenLangCode : "Kôд језика",
DlgGenAccessKey : "Приступни тастер",
DlgGenName : "Назив",
DlgGenTabIndex : "Таб индекс",
DlgGenLongDescr : "Пун опис УРЛ",
DlgGenClass : "Stylesheet класе",
DlgGenTitle : "Advisory наслов",
DlgGenContType : "Advisory врста садржаја",
DlgGenLinkCharset : "Linked Resource Charset",
DlgGenStyle : "Стил",
 
// Image Dialog
DlgImgTitle : "Особине слика",
DlgImgInfoTab : "Инфо слике",
DlgImgBtnUpload : "Пошаљи на сервер",
DlgImgURL : "УРЛ",
DlgImgUpload : "Пошаљи",
DlgImgAlt : "Алтернативни текст",
DlgImgWidth : "Ширина",
DlgImgHeight : "Висина",
DlgImgLockRatio : "Закључај однос",
DlgBtnResetSize : "Ресетуј величину",
DlgImgBorder : "Оквир",
DlgImgHSpace : "HSpace",
DlgImgVSpace : "VSpace",
DlgImgAlign : "Равнање",
DlgImgAlignLeft : "Лево",
DlgImgAlignAbsBottom: "Abs доле",
DlgImgAlignAbsMiddle: "Abs средина",
DlgImgAlignBaseline : "Базно",
DlgImgAlignBottom : "Доле",
DlgImgAlignMiddle : "Средина",
DlgImgAlignRight : "Десно",
DlgImgAlignTextTop : "Врх текста",
DlgImgAlignTop : "Врх",
DlgImgPreview : "Изглед",
DlgImgAlertUrl : "Унесите УРЛ слике",
DlgImgLinkTab : "Линк",
 
// Flash Dialog
DlgFlashTitle : "Особине флеша",
DlgFlashChkPlay : "Аутоматски старт",
DlgFlashChkLoop : "Понављај",
DlgFlashChkMenu : "Укључи флеш мени",
DlgFlashScale : "Скалирај",
DlgFlashScaleAll : "Прикажи све",
DlgFlashScaleNoBorder : "Без ивице",
DlgFlashScaleFit : "Попуни површину",
 
// Link Dialog
DlgLnkWindowTitle : "Линк",
DlgLnkInfoTab : "Линк инфо",
DlgLnkTargetTab : "Мета",
 
DlgLnkType : "Врста линка",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Сидро на овој страници",
DlgLnkTypeEMail : "Eлектронска пошта",
DlgLnkProto : "Протокол",
DlgLnkProtoOther : "<друго>",
DlgLnkURL : "УРЛ",
DlgLnkAnchorSel : "Одабери сидро",
DlgLnkAnchorByName : "По називу сидра",
DlgLnkAnchorById : "Пo Ид-jу елемента",
DlgLnkNoAnchors : "<Нема доступних сидра>",
DlgLnkEMail : "Адреса електронске поште",
DlgLnkEMailSubject : "Наслов",
DlgLnkEMailBody : "Садржај поруке",
DlgLnkUpload : "Пошаљи",
DlgLnkBtnUpload : "Пошаљи на сервер",
 
DlgLnkTarget : "Meтa",
DlgLnkTargetFrame : "<оквир>",
DlgLnkTargetPopup : "<искачући прозор>",
DlgLnkTargetBlank : "Нови прозор (_blank)",
DlgLnkTargetParent : "Родитељски прозор (_parent)",
DlgLnkTargetSelf : "Исти прозор (_self)",
DlgLnkTargetTop : "Прозор на врху (_top)",
DlgLnkTargetFrameName : "Назив одредишног фрејма",
DlgLnkPopWinName : "Назив искачућег прозора",
DlgLnkPopWinFeat : "Могућности искачућег прозора",
DlgLnkPopResize : "Променљива величина",
DlgLnkPopLocation : "Локација",
DlgLnkPopMenu : "Контекстни мени",
DlgLnkPopScroll : "Скрол бар",
DlgLnkPopStatus : "Статусна линија",
DlgLnkPopToolbar : "Toolbar",
DlgLnkPopFullScrn : "Приказ преко целог екрана (ИE)",
DlgLnkPopDependent : "Зависно (Netscape)",
DlgLnkPopWidth : "Ширина",
DlgLnkPopHeight : "Висина",
DlgLnkPopLeft : "Од леве ивице екрана (пиксела)",
DlgLnkPopTop : "Од врха екрана (пиксела)",
 
DlnLnkMsgNoUrl : "Унесите УРЛ линка",
DlnLnkMsgNoEMail : "Откуцајте адресу електронске поште",
DlnLnkMsgNoAnchor : "Одаберите сидро",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "Одаберите боју",
DlgColorBtnClear : "Обриши",
DlgColorHighlight : "Посветли",
DlgColorSelected : "Одабери",
 
// Smiley Dialog
DlgSmileyTitle : "Унеси смајлија",
 
// Special Character Dialog
DlgSpecialCharTitle : "Одаберите специјални карактер",
 
// Table Dialog
DlgTableTitle : "Особине табеле",
DlgTableRows : "Редова",
DlgTableColumns : "Kолона",
DlgTableBorder : "Величина оквира",
DlgTableAlign : "Равнање",
DlgTableAlignNotSet : "<није постављено>",
DlgTableAlignLeft : "Лево",
DlgTableAlignCenter : "Средина",
DlgTableAlignRight : "Десно",
DlgTableWidth : "Ширина",
DlgTableWidthPx : "пиксела",
DlgTableWidthPc : "процената",
DlgTableHeight : "Висина",
DlgTableCellSpace : "Ћелијски простор",
DlgTableCellPad : "Размак ћелија",
DlgTableCaption : "Наслов табеле",
DlgTableSummary : "Summary", //MISSING
 
// Table Cell Dialog
DlgCellTitle : "Особине ћелије",
DlgCellWidth : "Ширина",
DlgCellWidthPx : "пиксела",
DlgCellWidthPc : "процената",
DlgCellHeight : "Висина",
DlgCellWordWrap : "Дељење речи",
DlgCellWordWrapNotSet : "<није постављено>",
DlgCellWordWrapYes : "Да",
DlgCellWordWrapNo : "Не",
DlgCellHorAlign : "Водоравно равнање",
DlgCellHorAlignNotSet : "<није постављено>",
DlgCellHorAlignLeft : "Лево",
DlgCellHorAlignCenter : "Средина",
DlgCellHorAlignRight: "Десно",
DlgCellVerAlign : "Вертикално равнање",
DlgCellVerAlignNotSet : "<није постављено>",
DlgCellVerAlignTop : "Горње",
DlgCellVerAlignMiddle : "Средина",
DlgCellVerAlignBottom : "Доње",
DlgCellVerAlignBaseline : "Базно",
DlgCellRowSpan : "Спајање редова",
DlgCellCollSpan : "Спајање колона",
DlgCellBackColor : "Боја позадине",
DlgCellBorderColor : "Боја оквира",
DlgCellBtnSelect : "Oдабери...",
 
// Find Dialog
DlgFindTitle : "Пронађи",
DlgFindFindBtn : "Пронађи",
DlgFindNotFoundMsg : "Тражени текст није пронађен.",
 
// Replace Dialog
DlgReplaceTitle : "Замени",
DlgReplaceFindLbl : "Пронађи:",
DlgReplaceReplaceLbl : "Замени са:",
DlgReplaceCaseChk : "Разликуј велика и мала слова",
DlgReplaceReplaceBtn : "Замени",
DlgReplaceReplAllBtn : "Замени све",
DlgReplaceWordChk : "Упореди целе речи",
 
// Paste Operations / Dialog
PasteErrorPaste : "Сигурносна подешавања Вашег претраживача не дозвољавају операције аутоматског лепљења текста. Молимо Вас да користите пречицу са тастатуре (Ctrl+V).",
PasteErrorCut : "Сигурносна подешавања Вашег претраживача не дозвољавају операције аутоматског исецања текста. Молимо Вас да користите пречицу са тастатуре (Ctrl+X).",
PasteErrorCopy : "Сигурносна подешавања Вашег претраживача не дозвољавају операције аутоматског копирања текста. Молимо Вас да користите пречицу са тастатуре (Ctrl+C).",
 
PasteAsText : "Залепи као чист текст",
PasteFromWord : "Залепи из Worda",
 
DlgPasteMsg2 : "Молимо Вас да залепите унутар доње површине користећи тастатурну пречицу (<STRONG>Ctrl+V</STRONG>) и да притиснете <STRONG>OK</STRONG>.",
DlgPasteIgnoreFont : "Игнориши Font Face дефиниције",
DlgPasteRemoveStyles : "Уклони дефиниције стилова",
DlgPasteCleanBox : "Обриши све",
 
// Color Picker
ColorAutomatic : "Аутоматски",
ColorMoreColors : "Више боја...",
 
// Document Properties
DocProps : "Особине документа",
 
// Anchor Dialog
DlgAnchorTitle : "Особине сидра",
DlgAnchorName : "Име сидра",
DlgAnchorErrorName : "Молимо Вас да унесете име сидра",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Није у речнику",
DlgSpellChangeTo : "Измени",
DlgSpellBtnIgnore : "Игнориши",
DlgSpellBtnIgnoreAll : "Игнориши све",
DlgSpellBtnReplace : "Замени",
DlgSpellBtnReplaceAll : "Замени све",
DlgSpellBtnUndo : "Врати акцију",
DlgSpellNoSuggestions : "- Без сугестија -",
DlgSpellProgress : "Провера спеловања у току...",
DlgSpellNoMispell : "Провера спеловања завршена: грешке нису пронађене",
DlgSpellNoChanges : "Провера спеловања завршена: Није измењена ниједна реч",
DlgSpellOneChange : "Провера спеловања завршена: Измењена је једна реч",
DlgSpellManyChanges : "Провера спеловања завршена: %1 реч(и) је измењено",
 
IeSpellDownload : "Провера спеловања није инсталирана. Да ли желите да је скинете са Интернета?",
 
// Button Dialog
DlgButtonText : "Текст (вредност)",
DlgButtonType : "Tип",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Назив",
DlgCheckboxValue : "Вредност",
DlgCheckboxSelected : "Означено",
 
// Form Dialog
DlgFormName : "Назив",
DlgFormAction : "Aкција",
DlgFormMethod : "Mетода",
 
// Select Field Dialog
DlgSelectName : "Назив",
DlgSelectValue : "Вредност",
DlgSelectSize : "Величина",
DlgSelectLines : "линија",
DlgSelectChkMulti : "Дозволи вишеструку селекцију",
DlgSelectOpAvail : "Доступне опције",
DlgSelectOpText : "Текст",
DlgSelectOpValue : "Вредност",
DlgSelectBtnAdd : "Додај",
DlgSelectBtnModify : "Измени",
DlgSelectBtnUp : "Горе",
DlgSelectBtnDown : "Доле",
DlgSelectBtnSetValue : "Подеси као означену вредност",
DlgSelectBtnDelete : "Обриши",
 
// Textarea Dialog
DlgTextareaName : "Назив",
DlgTextareaCols : "Број колона",
DlgTextareaRows : "Број редова",
 
// Text Field Dialog
DlgTextName : "Назив",
DlgTextValue : "Вредност",
DlgTextCharWidth : "Ширина (карактера)",
DlgTextMaxChars : "Максимално карактера",
DlgTextType : "Тип",
DlgTextTypeText : "Текст",
DlgTextTypePass : "Лозинка",
 
// Hidden Field Dialog
DlgHiddenName : "Назив",
DlgHiddenValue : "Вредност",
 
// Bulleted List Dialog
BulletedListProp : "Особине Bulleted листе",
NumberedListProp : "Особине набројиве листе",
DlgLstStart : "Start", //MISSING
DlgLstType : "Тип",
DlgLstTypeCircle : "Круг",
DlgLstTypeDisc : "Disc", //MISSING
DlgLstTypeSquare : "Квадрат",
DlgLstTypeNumbers : "Бројеви (1, 2, 3)",
DlgLstTypeLCase : "мала слова (a, b, c)",
DlgLstTypeUCase : "ВЕЛИКА СЛОВА (A, B, C)",
DlgLstTypeSRoman : "Мале римске цифре (i, ii, iii)",
DlgLstTypeLRoman : "Велике римске цифре (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "Опште особине",
DlgDocBackTab : "Позадина",
DlgDocColorsTab : "Боје и маргине",
DlgDocMetaTab : "Метаподаци",
 
DlgDocPageTitle : "Наслов странице",
DlgDocLangDir : "Смер језика",
DlgDocLangDirLTR : "Слева надесно (LTR)",
DlgDocLangDirRTL : "Здесна налево (RTL)",
DlgDocLangCode : "Шифра језика",
DlgDocCharSet : "Кодирање скупа карактера",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "Остала кодирања скупа карактера",
 
DlgDocDocType : "Заглавље типа документа",
DlgDocDocTypeOther : "Остала заглавља типа документа",
DlgDocIncXHTML : "Улључи XHTML декларације",
DlgDocBgColor : "Боја позадине",
DlgDocBgImage : "УРЛ позадинске слике",
DlgDocBgNoScroll : "Фиксирана позадина",
DlgDocCText : "Текст",
DlgDocCLink : "Линк",
DlgDocCVisited : "Посећени линк",
DlgDocCActive : "Активни линк",
DlgDocMargins : "Маргине странице",
DlgDocMaTop : "Горња",
DlgDocMaLeft : "Лева",
DlgDocMaRight : "Десна",
DlgDocMaBottom : "Доња",
DlgDocMeIndex : "Кључне речи за индексирање документа (раздвојене зарезом)",
DlgDocMeDescr : "Опис документа",
DlgDocMeAuthor : "Аутор",
DlgDocMeCopy : "Ауторска права",
DlgDocPreview : "Изглед странице",
 
// Templates Dialog
Templates : "Обрасци",
DlgTemplatesTitle : "Обрасци за садржај",
DlgTemplatesSelMsg : "Молимо Вас да одаберете образац који ће бити примењен на страницу (тренутни садржај ће бити обрисан):",
DlgTemplatesLoading : "Учитавам листу образаца. Мало стрпљења...",
DlgTemplatesNoTpl : "(Нема дефинисаних образаца)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "О едитору",
DlgAboutBrowserInfoTab : "Информације о претраживачу",
DlgAboutLicenseTab : "License", //MISSING
DlgAboutVersion : "верзија",
DlgAboutLicense : "Лиценцирано под условима GNU Lesser General Public License",
DlgAboutInfo : "За више информација посетите"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/tr.js
New file
0,0 → 1,501
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: tr.js
* Turkish language file.
*
* File Authors:
* Bogac Guven (bogacmx@yahoo.com)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Araç Çubugunu Kapat",
ToolbarExpand : "Araç Çubugunu Aç",
 
// Toolbar Items and Context Menu
Save : "Kaydet",
NewPage : "Yeni Sayfa",
Preview : "Ön Ä°zleme",
Cut : "Kes",
Copy : "Kopyala",
Paste : "Yapıştır",
PasteText : "Düzyazı Olarak Yapıştır",
PasteWord : "Word'den Yapıştır",
Print : "Yazdır",
SelectAll : "Tümünü Seç",
RemoveFormat : "Biçimi Kaldır",
InsertLinkLbl : "Köprü",
InsertLink : "Köprü Ekle/Düzenle",
RemoveLink : "Köprü Kaldır",
Anchor : "Çapa Ekle/Düzenle",
InsertImageLbl : "Resim",
InsertImage : "Resim Ekle/Düzenle",
InsertFlashLbl : "Flash",
InsertFlash : "Flash Ekle/Düzenle",
InsertTableLbl : "Tablo",
InsertTable : "Tablo Ekle/Düzenle",
InsertLineLbl : "Satır",
InsertLine : "Yatay Satır Ekle",
InsertSpecialCharLbl: "Özel Karakter",
InsertSpecialChar : "Özel Karakter Ekle",
InsertSmileyLbl : "İfade",
InsertSmiley : "İfade Ekle",
About : "FCKeditor Hakkında",
Bold : "Kalın",
Italic : "İtalik",
Underline : "Altı Çizgili",
StrikeThrough : "Üstü Çizgili",
Subscript : "Alt Simge",
Superscript : "Üst Simge",
LeftJustify : "Sola Dayalı",
CenterJustify : "Ortalanmış",
RightJustify : "Sağa Dayalı",
BlockJustify : "İki Kenara Yaslanmış",
DecreaseIndent : "Sekme Azalt",
IncreaseIndent : "Sekme Arttır",
Undo : "Geri Al",
Redo : "Tekrarla",
NumberedListLbl : "Numaralı Liste",
NumberedList : "Numaralı Liste Ekle/Kaldır",
BulletedListLbl : "Simgeli Liste",
BulletedList : "Simgeli Liste Ekle/Kaldır",
ShowTableBorders : "Tablo Kenarlarını Göster",
ShowDetails : "Detayları Göster",
Style : "Stil",
FontFormat : "Biçim",
Font : "Yazı Tipi",
FontSize : "Boyut",
TextColor : "Yazı Rengi",
BGColor : "Arka Renk",
Source : "Kaynak",
Find : "Bul",
Replace : "Değiştir",
SpellCheck : "Yazım Denetimi",
UniversalKeyboard : "Evrensel Klavye",
PageBreakLbl : "Sayfa sonu",
PageBreak : "Sayfa Sonu Ekle",
 
Form : "Form",
Checkbox : "Onay Kutusu",
RadioButton : "Seçenek Düğmesi",
TextField : "Metin Girişi",
Textarea : "Çok Satırlı Metin",
HiddenField : "Gizli Veri",
Button : "Düğme",
SelectionField : "Seçim Mönüsü",
ImageButton : "Resimli Düğme",
 
FitWindow : "Editör boyutunu büyüt",
 
// Context Menu
EditLink : "Köprü Düzenle",
CellCM : "Hücre",
RowCM : "Satır",
ColumnCM : "Sütun",
InsertRow : "Satır Ekle",
DeleteRows : "Satır Sil",
InsertColumn : "Sütun Ekle",
DeleteColumns : "Sütun Sil",
InsertCell : "Hücre Ekle",
DeleteCells : "Hücre Sil",
MergeCells : "Hücreleri Birleştir",
SplitCell : "Hücre Böl",
TableDelete : "Tabloyu Sil",
CellProperties : "Hücre Özellikleri",
TableProperties : "Tablo Özellikleri",
ImageProperties : "Resim Özellikleri",
FlashProperties : "Flash Özellikleri",
 
AnchorProp : "Çapa Özellikleri",
ButtonProp : "Düğme Özellikleri",
CheckboxProp : "Onay Kutusu Özellikleri",
HiddenFieldProp : "Gizli Veri Özellikleri",
RadioButtonProp : "Seçenek Düğmesi Özellikleri",
ImageButtonProp : "Resimli Düğme Özellikleri",
TextFieldProp : "Metin Girişi Özellikleri",
SelectionFieldProp : "Seçim Mönüsü Özellikleri",
TextareaProp : "Çok Satırlı Metin Özellikleri",
FormProp : "Form Özellikleri",
 
FontFormats : "Normal;Biçimli;Adres;Başlık 1;Başlık 2;Başlık 3;Başlık 4;Başlık 5;Başlık 6;Paragraf (DIV)",
 
// Alerts and Messages
ProcessingXHTML : "XHTML işleniyor. Lütfen bekleyin...",
Done : "Bitti",
PasteWordConfirm : "Yapıştırdığınız yazı Word'den gelmişe benziyor. Yapıştırmadan önce gereksiz eklentileri silmek ister misiniz?",
NotCompatiblePaste : "Bu komut Internet Explorer 5.5 ve ileriki sürümleri için mevcuttur. Temizlenmeden yapıştırılmasını ister misiniz ?",
UnknownToolbarItem : "Bilinmeyen araç çubugu öğesi \"%1\"",
UnknownCommand : "Bilinmeyen komut \"%1\"",
NotImplemented : "Komut uyarlanamadı",
UnknownToolbarSet : "\"%1\" araç çubuğu öğesi mevcut değil",
NoActiveX : "Kullandığınız tarayıcının güvenlik ayarları bazı özelliklerin kullanılmasını engelliyor. Bu özelliklerin çalışması için \"Run ActiveX controls and plug-ins (Activex ve eklentileri çalıştır)\" seçeneğinin aktif yapılması gerekiyor. Kullanılamayan eklentiler ve hatalar konusunda daha fazla bilgi sahibi olun.",
BrowseServerBlocked : "Kaynak tarayıcısı açılamadı. Tüm \"popup blocker\" programlarının devre dışı olduğundan emin olun. (Yahoo toolbar, Msn toolbar, Google toolbar gibi)",
DialogBlocked : "diyalog açmak mümkün olmadı. Tüm \"Popup Blocker\" programlarının devre dışı olduğundan emin olun.",
 
// Dialogs
DlgBtnOK : "Tamam",
DlgBtnCancel : "İptal",
DlgBtnClose : "Kapat",
DlgBtnBrowseServer : "Sunucuyu Gez",
DlgAdvancedTag : "Gelişmiş",
DlgOpOther : "<Diğer>",
DlgInfoTab : "Bilgi",
DlgAlertUrl : "Lütfen URL girin",
 
// General Dialogs Labels
DlgGenNotSet : "<tanımlanmamış>",
DlgGenId : "Kimlik",
DlgGenLangDir : "Lisan Yönü",
DlgGenLangDirLtr : "Soldan Sağa (LTR)",
DlgGenLangDirRtl : "Sağdan Sola (RTL)",
DlgGenLangCode : "Lisan Kodlaması",
DlgGenAccessKey : "Erişim Tuşu",
DlgGenName : "İsim",
DlgGenTabIndex : "Sekme İndeksi",
DlgGenLongDescr : "Uzun Tanımlı URL",
DlgGenClass : "Stil Klasları",
DlgGenTitle : "Danışma Baslığı",
DlgGenContType : "Danışma Ä°çerik Türü",
DlgGenLinkCharset : "Bağlı Kaynak Karakter Gurubu",
DlgGenStyle : "Stil",
 
// Image Dialog
DlgImgTitle : "Resim Özellikleri",
DlgImgInfoTab : "Resim Bilgisi",
DlgImgBtnUpload : "Sunucuya Yolla",
DlgImgURL : "URL",
DlgImgUpload : "Karsıya Yükle",
DlgImgAlt : "Alternatif Yazı",
DlgImgWidth : "Genişlik",
DlgImgHeight : "Yükseklik",
DlgImgLockRatio : "Oranı Kilitle",
DlgBtnResetSize : "Boyutu Başa Döndür",
DlgImgBorder : "Kenar",
DlgImgHSpace : "Yatay Boşluk",
DlgImgVSpace : "Dikey Boşluk",
DlgImgAlign : "Hizalama",
DlgImgAlignLeft : "Sol",
DlgImgAlignAbsBottom: "Tam Altı",
DlgImgAlignAbsMiddle: "Tam Ortası",
DlgImgAlignBaseline : "Taban Çizgisi",
DlgImgAlignBottom : "Alt",
DlgImgAlignMiddle : "Orta",
DlgImgAlignRight : "Sağ",
DlgImgAlignTextTop : "Yazı Tepeye",
DlgImgAlignTop : "Tepe",
DlgImgPreview : "Ön Ä°zleme",
DlgImgAlertUrl : "Lütfen resmin URL'sini yazınız",
DlgImgLinkTab : "Köprü",
 
// Flash Dialog
DlgFlashTitle : "Flash Özellikleri",
DlgFlashChkPlay : "Otomatik Oynat",
DlgFlashChkLoop : "Döngü",
DlgFlashChkMenu : "Flash Mönüsünü Kullan",
DlgFlashScale : "Boyutlandır",
DlgFlashScaleAll : "Hepsini Göster",
DlgFlashScaleNoBorder : "Kenar Yok",
DlgFlashScaleFit : "Tam Sığdır",
 
// Link Dialog
DlgLnkWindowTitle : "Köprü",
DlgLnkInfoTab : "Köprü Bilgisi",
DlgLnkTargetTab : "Hedef",
 
DlgLnkType : "Köprü Türü",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Bu sayfada çapa",
DlgLnkTypeEMail : "E-Posta",
DlgLnkProto : "Protokol",
DlgLnkProtoOther : "<diğer>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Çapa Seç",
DlgLnkAnchorByName : "Çapa Ä°smi ile",
DlgLnkAnchorById : "Eleman Id ile",
DlgLnkNoAnchors : "<Bu dokümanda hiç çapa yok>",
DlgLnkEMail : "E-Posta Adresi",
DlgLnkEMailSubject : "Mesaj Konusu",
DlgLnkEMailBody : "Mesaj Vücudu",
DlgLnkUpload : "Karşıya Yükle",
DlgLnkBtnUpload : "Sunucuya Gönder",
 
DlgLnkTarget : "Hedef",
DlgLnkTargetFrame : "<çerçeve>",
DlgLnkTargetPopup : "<yeni açılan pencere>",
DlgLnkTargetBlank : "Yeni Pencere(_blank)",
DlgLnkTargetParent : "Anne Pencere (_parent)",
DlgLnkTargetSelf : "Kendi Penceresi (_self)",
DlgLnkTargetTop : "En Üst Pencere (_top)",
DlgLnkTargetFrameName : "Hedef Çerçeve Ä°smi",
DlgLnkPopWinName : "Yeni Açılan Pencere Ä°smi",
DlgLnkPopWinFeat : "Yeni Açılan Pencere Özellikleri",
DlgLnkPopResize : "Boyutlandırılabilir",
DlgLnkPopLocation : "Yer Çubuğu",
DlgLnkPopMenu : "Mönü Çubuğu",
DlgLnkPopScroll : "Kaydırma Çubukları",
DlgLnkPopStatus : "Statü Çubuğu",
DlgLnkPopToolbar : "Araç Çubuğu",
DlgLnkPopFullScrn : "Tam Ekran (IE)",
DlgLnkPopDependent : "Bağlı-Dependent- (Netscape)",
DlgLnkPopWidth : "Genişlik",
DlgLnkPopHeight : "Yükseklik",
DlgLnkPopLeft : "Sola Göre Pozisyon",
DlgLnkPopTop : "Yukarıya Göre Pozisyon",
 
DlnLnkMsgNoUrl : "Lütfen köprü URL'sini yazın",
DlnLnkMsgNoEMail : "Lütfen E-posta adresini yazın",
DlnLnkMsgNoAnchor : "Lütfen bir çapa seçin",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "Renk Seç",
DlgColorBtnClear : "Temizle",
DlgColorHighlight : "Belirle",
DlgColorSelected : "Seçilmiş",
 
// Smiley Dialog
DlgSmileyTitle : "İfade Ekle",
 
// Special Character Dialog
DlgSpecialCharTitle : "Özel Karakter Seç",
 
// Table Dialog
DlgTableTitle : "Tablo Özellikleri",
DlgTableRows : "Satırlar",
DlgTableColumns : "Sütunlar",
DlgTableBorder : "Kenar Kalınlığı",
DlgTableAlign : "Hizalama",
DlgTableAlignNotSet : "<Tanımlanmamış>",
DlgTableAlignLeft : "Sol",
DlgTableAlignCenter : "Merkez",
DlgTableAlignRight : "Sağ",
DlgTableWidth : "Genişlik",
DlgTableWidthPx : "piksel",
DlgTableWidthPc : "yüzde",
DlgTableHeight : "Yükseklik",
DlgTableCellSpace : "Izgara kalınlığı",
DlgTableCellPad : "Izgara yazı arası",
DlgTableCaption : "Başlık",
DlgTableSummary : "Özet",
 
// Table Cell Dialog
DlgCellTitle : "Hücre Özellikleri",
DlgCellWidth : "Genişlik",
DlgCellWidthPx : "piksel",
DlgCellWidthPc : "yüzde",
DlgCellHeight : "Yükseklik",
DlgCellWordWrap : "Sözcük Kaydır",
DlgCellWordWrapNotSet : "<Tanımlanmamış>",
DlgCellWordWrapYes : "Evet",
DlgCellWordWrapNo : "Hayır",
DlgCellHorAlign : "Yatay Hizalama",
DlgCellHorAlignNotSet : "<Tanımlanmamış>",
DlgCellHorAlignLeft : "Sol",
DlgCellHorAlignCenter : "Merkez",
DlgCellHorAlignRight: "Sağ",
DlgCellVerAlign : "Dikey Hizalama",
DlgCellVerAlignNotSet : "<Tanımlanmamış>",
DlgCellVerAlignTop : "Tepe",
DlgCellVerAlignMiddle : "Orta",
DlgCellVerAlignBottom : "Alt",
DlgCellVerAlignBaseline : "Taban Çizgisi",
DlgCellRowSpan : "Satır Kapla",
DlgCellCollSpan : "Sütun Kapla",
DlgCellBackColor : "Arka Plan Rengi",
DlgCellBorderColor : "Kenar Rengi",
DlgCellBtnSelect : "Seç...",
 
// Find Dialog
DlgFindTitle : "Bul",
DlgFindFindBtn : "Bul",
DlgFindNotFoundMsg : "Belirtilen yazı bulunamadı.",
 
// Replace Dialog
DlgReplaceTitle : "Değiştir",
DlgReplaceFindLbl : "Aranan:",
DlgReplaceReplaceLbl : "Bununla değiştir:",
DlgReplaceCaseChk : "Büyük/küçük harf duyarlı",
DlgReplaceReplaceBtn : "Değiştir",
DlgReplaceReplAllBtn : "Tümünü Değiştir",
DlgReplaceWordChk : "Kelimenin tamamı uysun",
 
// Paste Operations / Dialog
PasteErrorPaste : "Gezgin yazılımınızın güvenlik ayarları editörün otomatik yapıştırma işlemine izin vermiyor. İşlem için (Ctrl+V) tuşlarını kullanın.",
PasteErrorCut : "Gezgin yazılımınızın güvenlik ayarları editörün otomatik kesme işlemine izin vermiyor. İşlem için (Ctrl+X) tuşlarını kullanın.",
PasteErrorCopy : "Gezgin yazılımınızın güvenlik ayarları editörün otomatik kopyalama işlemine izin vermiyor. İşlem için (Ctrl+C) tuşlarını kullanın.",
 
PasteAsText : "Düz Metin Olarak Yapıştır",
PasteFromWord : "Word'den yapıştır",
 
DlgPasteMsg2 : "Lütfen aşağıdaki kutunun içine yapıştırın. (<STRONG>Ctrl+V</STRONG>) ve <STRONG>Tamam</STRONG> butonunu tıklayın.",
DlgPasteIgnoreFont : "Yazı Tipi tanımlarını yoksay",
DlgPasteRemoveStyles : "Sitil Tanımlarını çıkar",
DlgPasteCleanBox : "Temizlik Kutusu",
 
// Color Picker
ColorAutomatic : "Otomatik",
ColorMoreColors : "Diğer renkler...",
 
// Document Properties
DocProps : "Doküman Özellikleri",
 
// Anchor Dialog
DlgAnchorTitle : "Çapa Özellikleri",
DlgAnchorName : "Çapa Ä°smi",
DlgAnchorErrorName : "Lütfen çapa için isim giriniz",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Sözlükte Yok",
DlgSpellChangeTo : "Şuna değiştir:",
DlgSpellBtnIgnore : "Yoksay",
DlgSpellBtnIgnoreAll : "Tümünü Yoksay",
DlgSpellBtnReplace : "Değiştir",
DlgSpellBtnReplaceAll : "Tümünü Değiştir",
DlgSpellBtnUndo : "Geri Al",
DlgSpellNoSuggestions : "- Öneri Yok -",
DlgSpellProgress : "Yazım denetimi işlemde...",
DlgSpellNoMispell : "Yazım denetimi tamamlandı: Yanlış yazıma rastlanmadı",
DlgSpellNoChanges : "Yazım denetimi tamamlandı: Hiçbir kelime değiştirilmedi",
DlgSpellOneChange : "Yazım denetimi tamamlandı: Bir kelime değiştirildi",
DlgSpellManyChanges : "Yazım denetimi tamamlandı: %1 kelime değiştirildi",
 
IeSpellDownload : "Yazım denetimi yüklenmemiş. Şimdi yüklemek ister misiniz?",
 
// Button Dialog
DlgButtonText : "Metin (Değer)",
DlgButtonType : "Tip",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "İsim",
DlgCheckboxValue : "Değer",
DlgCheckboxSelected : "Seçili",
 
// Form Dialog
DlgFormName : "İsim",
DlgFormAction : "İşlem",
DlgFormMethod : "Metod",
 
// Select Field Dialog
DlgSelectName : "İsim",
DlgSelectValue : "Değer",
DlgSelectSize : "Boyut",
DlgSelectLines : "satır",
DlgSelectChkMulti : "Çoklu seçime izin ver",
DlgSelectOpAvail : "Mevcut Seçenekler",
DlgSelectOpText : "Metin",
DlgSelectOpValue : "Değer",
DlgSelectBtnAdd : "Ekle",
DlgSelectBtnModify : "Düzenle",
DlgSelectBtnUp : "Yukari",
DlgSelectBtnDown : "Aşağı",
DlgSelectBtnSetValue : "Seçili değer olarak ata",
DlgSelectBtnDelete : "Sil",
 
// Textarea Dialog
DlgTextareaName : "İsim",
DlgTextareaCols : "Sütunlar",
DlgTextareaRows : "Satırlar",
 
// Text Field Dialog
DlgTextName : "İsim",
DlgTextValue : "Değer",
DlgTextCharWidth : "Karakter Genişliği",
DlgTextMaxChars : "En Fazla Karakter",
DlgTextType : "Tip",
DlgTextTypeText : "Metin",
DlgTextTypePass : "Şifre",
 
// Hidden Field Dialog
DlgHiddenName : "İsim",
DlgHiddenValue : "Değer",
 
// Bulleted List Dialog
BulletedListProp : "Simgeli Liste Özellikleri",
NumberedListProp : "Numaralı Liste Özellikleri",
DlgLstStart : "Start", //MISSING
DlgLstType : "Tip",
DlgLstTypeCircle : "Çember",
DlgLstTypeDisc : "Disk",
DlgLstTypeSquare : "Kare",
DlgLstTypeNumbers : "Sayılar (1, 2, 3)",
DlgLstTypeLCase : "Küçük Harfler (a, b, c)",
DlgLstTypeUCase : "Büyük Harfler (A, B, C)",
DlgLstTypeSRoman : "Küçük Romen Rakamları (i, ii, iii)",
DlgLstTypeLRoman : "Büyük Romen Rakamları (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "Genel",
DlgDocBackTab : "Arka Plan",
DlgDocColorsTab : "Renkler ve Mesafeler",
DlgDocMetaTab : "Tanım Bilgisi (Meta)",
 
DlgDocPageTitle : "Sayfa Başlığı",
DlgDocLangDir : "Lisan Yönü",
DlgDocLangDirLTR : "Soldan Sağa (LTR)",
DlgDocLangDirRTL : "Sağdan Sola (RTL)",
DlgDocLangCode : "Lisan Kodu",
DlgDocCharSet : "Karakter Kümesi Kodlaması",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "Diğer Karakter Kümesi Kodlaması",
 
DlgDocDocType : "Doküman Türü Başlığı",
DlgDocDocTypeOther : "Diğer Doküman Türü Başlığı",
DlgDocIncXHTML : "XHTML Bildirimlerini Dahil Et",
DlgDocBgColor : "Arka Plan Rengi",
DlgDocBgImage : "Arka Plan Resim URLsi",
DlgDocBgNoScroll : "Sabit Arka Plan",
DlgDocCText : "Metin",
DlgDocCLink : "Köprü",
DlgDocCVisited : "Görülmüs Köprü",
DlgDocCActive : "Aktif Köprü",
DlgDocMargins : "Kenar Boşlukları",
DlgDocMaTop : "Tepe",
DlgDocMaLeft : "Sol",
DlgDocMaRight : "Sağ",
DlgDocMaBottom : "Alt",
DlgDocMeIndex : "Doküman Ä°ndeksleme Anahtar Kelimeleri (virgülle ayrılmış)",
DlgDocMeDescr : "Doküman Tanımı",
DlgDocMeAuthor : "Yazar",
DlgDocMeCopy : "Telif",
DlgDocPreview : "Ön Ä°zleme",
 
// Templates Dialog
Templates : "Düzenler",
DlgTemplatesTitle : "Ä°çerik Düzenleri",
DlgTemplatesSelMsg : "Editörde açmak için lütfen bir düzen seçin.<br>(hali hazırdaki içerik kaybolacaktır.):",
DlgTemplatesLoading : "Düzenler listesi yüklenmekte. Lütfen bekleyiniz...",
DlgTemplatesNoTpl : "(Belirli bir düzen seçilmedi)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "Hakkında",
DlgAboutBrowserInfoTab : "Gezgin Bilgisi",
DlgAboutLicenseTab : "Lisans",
DlgAboutVersion : "versiyon",
DlgAboutLicense : "GNU Kısıtlı Kamu Lisansı (LGPL) koşulları altında lisanslanmıştır",
DlgAboutInfo : "Daha fazla bilgi için:"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/fa.js
New file
0,0 → 1,502
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fa.js
* Persian language file.
*
* File Authors:
* Hamed Taj-Abadi (hamed@ranginkaman.com)
* Pooyan Mahdavi (pooyanmx -@- gmail -.- com)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "rtl",
 
ToolbarCollapse : "برچیدن نوارابزار",
ToolbarExpand : "گستردن نوارابزار",
 
// Toolbar Items and Context Menu
Save : "ذخیره",
NewPage : "برگهٴ تازه",
Preview : "پیش‌نمایش",
Cut : "برش",
Copy : "کپی",
Paste : "چسباندن",
PasteText : "چسباندن به عنوان متن ِساده",
PasteWord : "چسباندن از Word",
Print : "چاپ",
SelectAll : "گزینش همه",
RemoveFormat : "برداشتن فرمت",
InsertLinkLbl : "پیوند",
InsertLink : "گنجاندن/ویرایش ِپیوند",
RemoveLink : "برداشتن پیوند",
Anchor : "گنجاندن/ویرایش ِلنگر",
InsertImageLbl : "تصویر",
InsertImage : "گنجاندن/ویرایش ِتصویر",
InsertFlashLbl : "Flash",
InsertFlash : "گنجاندن/ویرایش ِFlash",
InsertTableLbl : "جدول",
InsertTable : "گنجاندن/ویرایش ِجدول",
InsertLineLbl : "خط",
InsertLine : "گنجاندن خط ِافقی",
InsertSpecialCharLbl: "نویسهٴ ویژه",
InsertSpecialChar : "گنجاندن نویسهٴ ویژه",
InsertSmileyLbl : "خندانک",
InsertSmiley : "گنجاندن خندانک",
About : "دربارهٴ FCKeditor",
Bold : "درشت",
Italic : "خمیده",
Underline : "خط‌زیردار",
StrikeThrough : "میان‌خط",
Subscript : "زیرنویس",
Superscript : "بالانویس",
LeftJustify : "چپ‌چین",
CenterJustify : "میان‌چین",
RightJustify : "راست‌چین",
BlockJustify : "بلوک‌چین",
DecreaseIndent : "کاهش تورفتگی",
IncreaseIndent : "افزایش تورفتگی",
Undo : "واچیدن",
Redo : "بازچیدن",
NumberedListLbl : "فهرست شماره‌دار",
NumberedList : "گنجاندن/برداشتن فهرست شماره‌دار",
BulletedListLbl : "فهرست نقطه‌ای",
BulletedList : "گنجاندن/برداشتن فهرست نقطه‌ای",
ShowTableBorders : "نمایش لبهٴ جدول",
ShowDetails : "نمایش جزئیات",
Style : "سبک",
FontFormat : "فرمت",
Font : "قلم",
FontSize : "اندازه",
TextColor : "رنگ متن",
BGColor : "رنگ پس‌زمینه",
Source : "منبع",
Find : "جستجو",
Replace : "جایگزینی",
SpellCheck : "بررسی املا",
UniversalKeyboard : "صفحه‌کلید جهانی",
PageBreakLbl : "شکستگی ِپایان ِبرگه",
PageBreak : "گنجاندن شکستگی ِپایان ِبرگه",
 
Form : "فرم",
Checkbox : "خانهٴ گزینه‌ای",
RadioButton : "دکمهٴ رادیویی",
TextField : "فیلد متنی",
Textarea : "ناحیهٴ متنی",
HiddenField : "فیلد پنهان",
Button : "دکمه",
SelectionField : "فیلد چندگزینه‌ای",
ImageButton : "دکمهٴ تصویری",
 
FitWindow : "بیشینه‌سازی ِاندازهٴ ویرایشگر",
 
// Context Menu
EditLink : "ویرایش پیوند",
CellCM : "سلول",
RowCM : "سطر",
ColumnCM : "ستون",
InsertRow : "گنجاندن سطر",
DeleteRows : "حذف سطرها",
InsertColumn : "گنجاندن ستون",
DeleteColumns : "حذف ستونها",
InsertCell : "گنجاندن سلول",
DeleteCells : "حذف سلولها",
MergeCells : "ادغام سلولها",
SplitCell : "جداسازی سلول",
TableDelete : "پاک‌کردن جدول",
CellProperties : "ویژگیهای سلول",
TableProperties : "ویژگیهای جدول",
ImageProperties : "ویژگیهای تصویر",
FlashProperties : "ویژگیهای Flash",
 
AnchorProp : "ویژگیهای لنگر",
ButtonProp : "ویژگیهای دکمه",
CheckboxProp : "ویژگیهای خانهٴ گزینه‌ای",
HiddenFieldProp : "ویژگیهای فیلد پنهان",
RadioButtonProp : "ویژگیهای دکمهٴ رادیویی",
ImageButtonProp : "ویژگیهای دکمهٴ تصویری",
TextFieldProp : "ویژگیهای فیلد متنی",
SelectionFieldProp : "ویژگیهای فیلد چندگزینه‌ای",
TextareaProp : "ویژگیهای ناحیهٴ متنی",
FormProp : "ویژگیهای فرم",
 
FontFormats : "نرمال;فرمت‌شده;آدرس;سرنویس 1;سرنویس 2;سرنویس 3;سرنویس 4;سرنویس 5;سرنویس 6;بند;(DIV)",
 
// Alerts and Messages
ProcessingXHTML : "پردازش XHTML. لطفا صبر کنید...",
Done : "انجام شد",
PasteWordConfirm : "کپی شده است. آیا می‌خواهید قبل از چسباندن آن را پاک‌سازی کنید؟ Word متنی که می‌خواهید بچسبانید به نظر می‌رسد از",
NotCompatiblePaste : "این فرمان برای مرورگر Internet Explorer از نگارش 5.5 یا بالاتر در دسترس است. آیا می‌خواهید بدون پاک‌سازی، متن را بچسبانید؟",
UnknownToolbarItem : "فقرهٴ نوارابزار ناشناخته \"%1\"",
UnknownCommand : "نام دستور ناشناخته \"%1\"",
NotImplemented : "دستور پیاده‌سازی‌نشده",
UnknownToolbarSet : "مجموعهٴ نوارابزار \"%1\" وجود ندارد",
NoActiveX : "تنظیمات امنیتی مرورگر شما ممکن است در بعضی از ویژگیهای مرورگر محدودیت ایجاد کند. شما باید گزینهٴ \"Run ActiveX controls and plug-ins\" را فعال کنید. ممکن است شما با خطاهایی روبرو باشید و متوجه کمبود ویژگیهایی شوید.",
BrowseServerBlocked : "توانایی بازگشایی مرورگر منابع فراهم نیست. اطمینان حاصل کنید که تمامی برنامه‌های پیشگیری از نمایش popup را از کار بازداشته‌اید.",
DialogBlocked : "توانایی بازگشایی پنجرهٴ کوچک ِگفتگو فراهم نیست. اطمینان حاصل کنید که تمامی برنامه‌های پیشگیری از نمایش popup را از کار بازداشته‌اید.",
 
// Dialogs
DlgBtnOK : "پذیرش",
DlgBtnCancel : "انصراف",
DlgBtnClose : "بستن",
DlgBtnBrowseServer : "فهرست‌نمایی سرور",
DlgAdvancedTag : "پیشرفته",
DlgOpOther : "<غیره>",
DlgInfoTab : "اطلاعات",
DlgAlertUrl : "لطفاً URL را بنویسید",
 
// General Dialogs Labels
DlgGenNotSet : "<تعین‌نشده>",
DlgGenId : "شناسه",
DlgGenLangDir : "جهت‌نمای زبان",
DlgGenLangDirLtr : "چپ به راست (LTR)",
DlgGenLangDirRtl : "راست به چپ (RTL)",
DlgGenLangCode : "کد زبان",
DlgGenAccessKey : "کلید دستیابی",
DlgGenName : "نام",
DlgGenTabIndex : "نمایهٴ دسترسی با Tab",
DlgGenLongDescr : "URL توصیف طولانی",
DlgGenClass : "کلاسهای شیوه‌نامه(Stylesheet)",
DlgGenTitle : "عنوان کمکی",
DlgGenContType : "نوع محتوای کمکی",
DlgGenLinkCharset : "نویسه‌گان منبع ِپیوندشده",
DlgGenStyle : "شیوه(style)",
 
// Image Dialog
DlgImgTitle : "ویژگیهای تصویر",
DlgImgInfoTab : "اطلاعات تصویر",
DlgImgBtnUpload : "به سرور بفرست",
DlgImgURL : "URL",
DlgImgUpload : "انتقال به سرور",
DlgImgAlt : "متن جایگزین",
DlgImgWidth : "پهنا",
DlgImgHeight : "درازا",
DlgImgLockRatio : "قفل‌کردن ِنسبت",
DlgBtnResetSize : "بازنشانی اندازه",
DlgImgBorder : "لبه",
DlgImgHSpace : "فاصلهٴ افقی",
DlgImgVSpace : "فاصلهٴ عمودی",
DlgImgAlign : "چینش",
DlgImgAlignLeft : "چپ",
DlgImgAlignAbsBottom: "پائین مطلق",
DlgImgAlignAbsMiddle: "وسط مطلق",
DlgImgAlignBaseline : "خط‌پایه",
DlgImgAlignBottom : "پائین",
DlgImgAlignMiddle : "وسط",
DlgImgAlignRight : "راست",
DlgImgAlignTextTop : "متن بالا",
DlgImgAlignTop : "بالا",
DlgImgPreview : "پیش‌نمایش",
DlgImgAlertUrl : "لطفا URL تصویر را بنویسید",
DlgImgLinkTab : "پیوند",
 
// Flash Dialog
DlgFlashTitle : "ویژگیهای Flash",
DlgFlashChkPlay : "آغاز ِخودکار",
DlgFlashChkLoop : "اجرای پیاپی",
DlgFlashChkMenu : "دردسترس‌بودن منوی Flash",
DlgFlashScale : "مقیاس",
DlgFlashScaleAll : "نمایش همه",
DlgFlashScaleNoBorder : "بدون کران",
DlgFlashScaleFit : "جایگیری کامل",
 
// Link Dialog
DlgLnkWindowTitle : "پیوند",
DlgLnkInfoTab : "اطلاعات پیوند",
DlgLnkTargetTab : "مقصد",
 
DlgLnkType : "نوع پیوند",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "لنگر در همین صفحه",
DlgLnkTypeEMail : "پست الکترونیکی",
DlgLnkProto : "پروتکل",
DlgLnkProtoOther : "<دیگر>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "یک لنگر برگزینید",
DlgLnkAnchorByName : "با نام لنگر",
DlgLnkAnchorById : "با شناسهٴ المان",
DlgLnkNoAnchors : "<در این سند لنگری دردسترس نیست>",
DlgLnkEMail : "نشانی پست الکترونیکی",
DlgLnkEMailSubject : "موضوع پیام",
DlgLnkEMailBody : "متن پیام",
DlgLnkUpload : "انتقال به سرور",
DlgLnkBtnUpload : "به سرور بفرست",
 
DlgLnkTarget : "مقصد",
DlgLnkTargetFrame : "<فریم>",
DlgLnkTargetPopup : "<پنجرهٴ پاپاپ>",
DlgLnkTargetBlank : "پنجرهٴ دیگر (_blank)",
DlgLnkTargetParent : "پنجرهٴ والد (_parent)",
DlgLnkTargetSelf : "همان پنجره (_self)",
DlgLnkTargetTop : "بالاترین پنجره (_top)",
DlgLnkTargetFrameName : "نام فریم مقصد",
DlgLnkPopWinName : "نام پنجرهٴ پاپاپ",
DlgLnkPopWinFeat : "ویژگیهای پنجرهٴ پاپاپ",
DlgLnkPopResize : "قابل تغیر اندازه",
DlgLnkPopLocation : "نوار موقعیت",
DlgLnkPopMenu : "نوار منو",
DlgLnkPopScroll : "میله‌های پیمایش",
DlgLnkPopStatus : "نوار وضعیت",
DlgLnkPopToolbar : "نوارابزار",
DlgLnkPopFullScrn : "تمام‌صفحه (IE)",
DlgLnkPopDependent : "وابسته (Netscape)",
DlgLnkPopWidth : "پهنا",
DlgLnkPopHeight : "درازا",
DlgLnkPopLeft : "موقعیت ِچپ",
DlgLnkPopTop : "موقعیت ِبالا",
 
DlnLnkMsgNoUrl : "لطفا URL پیوند را بنویسید",
DlnLnkMsgNoEMail : "لطفا نشانی پست الکترونیکی را بنویسید",
DlnLnkMsgNoAnchor : "لطفا لنگری را برگزینید",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "گزینش رنگ",
DlgColorBtnClear : "پاک‌کردن",
DlgColorHighlight : "نمونه",
DlgColorSelected : "برگزیده",
 
// Smiley Dialog
DlgSmileyTitle : "گنجاندن خندانک",
 
// Special Character Dialog
DlgSpecialCharTitle : "گزینش نویسهٴ‌ویژه",
 
// Table Dialog
DlgTableTitle : "ویژگیهای جدول",
DlgTableRows : "سطرها",
DlgTableColumns : "ستونها",
DlgTableBorder : "اندازهٴ لبه",
DlgTableAlign : "چینش",
DlgTableAlignNotSet : "<تعین‌نشده>",
DlgTableAlignLeft : "چپ",
DlgTableAlignCenter : "وسط",
DlgTableAlignRight : "راست",
DlgTableWidth : "پهنا",
DlgTableWidthPx : "پیکسل",
DlgTableWidthPc : "درصد",
DlgTableHeight : "درازا",
DlgTableCellSpace : "فاصلهٴ میان سلولها",
DlgTableCellPad : "فاصلهٴ پرشده در سلول",
DlgTableCaption : "عنوان",
DlgTableSummary : "خلاصه",
 
// Table Cell Dialog
DlgCellTitle : "ویژگیهای سلول",
DlgCellWidth : "پهنا",
DlgCellWidthPx : "پیکسل",
DlgCellWidthPc : "درصد",
DlgCellHeight : "درازا",
DlgCellWordWrap : "شکستن واژه‌ها",
DlgCellWordWrapNotSet : "<تعین‌نشده>",
DlgCellWordWrapYes : "بله",
DlgCellWordWrapNo : "خیر",
DlgCellHorAlign : "چینش ِافقی",
DlgCellHorAlignNotSet : "<تعین‌نشده>",
DlgCellHorAlignLeft : "چپ",
DlgCellHorAlignCenter : "وسط",
DlgCellHorAlignRight: "راست",
DlgCellVerAlign : "چینش ِعمودی",
DlgCellVerAlignNotSet : "<تعین‌نشده>",
DlgCellVerAlignTop : "بالا",
DlgCellVerAlignMiddle : "میان",
DlgCellVerAlignBottom : "پائین",
DlgCellVerAlignBaseline : "خط‌پایه",
DlgCellRowSpan : "گستردگی سطرها",
DlgCellCollSpan : "گستردگی ستونها",
DlgCellBackColor : "رنگ پس‌زمینه",
DlgCellBorderColor : "رنگ لبه",
DlgCellBtnSelect : "برگزینید...",
 
// Find Dialog
DlgFindTitle : "یافتن",
DlgFindFindBtn : "یافتن",
DlgFindNotFoundMsg : "متن موردنظر یافت نشد.",
 
// Replace Dialog
DlgReplaceTitle : "جایگزینی",
DlgReplaceFindLbl : "چه‌چیز را می‌یابید:",
DlgReplaceReplaceLbl : "جایگزینی با:",
DlgReplaceCaseChk : "همسانی در بزرگی و کوچکی نویسه‌ها",
DlgReplaceReplaceBtn : "جایگزینی",
DlgReplaceReplAllBtn : "جایگزینی همهٴ یافته‌ها",
DlgReplaceWordChk : "همسانی با واژهٴ کامل",
 
// Paste Operations / Dialog
PasteErrorPaste : "تنظیمات امنیتی مرورگر شما اجازه نمی‌دهد که ویرایشگر به طور خودکار عملکردهای چسباندن را انجام دهد. لطفا با دکمه‌های صفحه‌کلید این کار را انجام دهید (Ctrl+V).",
PasteErrorCut : "تنظیمات امنیتی مرورگر شما اجازه نمی‌دهد که ویرایشگر به طور خودکار عملکردهای برش را انجام دهد. لطفا با دکمه‌های صفحه‌کلید این کار را انجام دهید (Ctrl+X).",
PasteErrorCopy : "تنظیمات امنیتی مرورگر شما اجازه نمی‌دهد که ویرایشگر به طور خودکار عملکردهای کپی‌کردن را انجام دهد. لطفا با دکمه‌های صفحه‌کلید این کار را انجام دهید (Ctrl+C).",
 
PasteAsText : "چسباندن به عنوان متن ِساده",
PasteFromWord : "چسباندن از Word",
 
DlgPasteMsg2 : "لطفا متن را با کلیدهای (<STRONG>Ctrl+V</STRONG>) در این جعبهٴ متنی بچسبانید و <STRONG>پذیرش</STRONG> را بزنید.",
DlgPasteIgnoreFont : "چشم‌پوشی از تعاریف نوع قلم",
DlgPasteRemoveStyles : "چشم‌پوشی از تعاریف سبک (style)",
DlgPasteCleanBox : "پاک‌کردن ناحیه",
 
// Color Picker
ColorAutomatic : "خودکار",
ColorMoreColors : "رنگهای بیشتر...",
 
// Document Properties
DocProps : "ویژگیهای سند",
 
// Anchor Dialog
DlgAnchorTitle : "ویژگیهای لنگر",
DlgAnchorName : "نام لنگر",
DlgAnchorErrorName : "لطفا نام لنگر را بنویسید",
 
// Speller Pages Dialog
DlgSpellNotInDic : "در واژه‌نامه موجود نیست",
DlgSpellChangeTo : "تغیر به",
DlgSpellBtnIgnore : "چشم‌پوشی",
DlgSpellBtnIgnoreAll : "چشم‌پوشی همه",
DlgSpellBtnReplace : "جایگزینی",
DlgSpellBtnReplaceAll : "جایگزینی همه",
DlgSpellBtnUndo : "واچینش",
DlgSpellNoSuggestions : "- پیشنهادی نیست -",
DlgSpellProgress : "بررسی املا در حال انجام...",
DlgSpellNoMispell : "بررسی املا انجام شد. هیچ غلط‌املائی یافت نشد",
DlgSpellNoChanges : "بررسی املا انجام شد. هیچ واژه‌ای تغیر نیافت",
DlgSpellOneChange : "بررسی املا انجام شد. یک واژه تغیر یافت",
DlgSpellManyChanges : "بررسی املا انجام شد. %1 واژه تغیر یافت",
 
IeSpellDownload : "بررسی‌کنندهٴ املا نصب نشده است. آیا می‌خواهید آن را هم‌اکنون دریافت کنید؟",
 
// Button Dialog
DlgButtonText : "متن (مقدار)",
DlgButtonType : "نوع",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "نام",
DlgCheckboxValue : "مقدار",
DlgCheckboxSelected : "برگزیده",
 
// Form Dialog
DlgFormName : "نام",
DlgFormAction : "اقدام",
DlgFormMethod : "متد",
 
// Select Field Dialog
DlgSelectName : "نام",
DlgSelectValue : "مقدار",
DlgSelectSize : "اندازه",
DlgSelectLines : "خطوط",
DlgSelectChkMulti : "گزینش چندگانه فراهم باشد",
DlgSelectOpAvail : "گزینه‌های موجود",
DlgSelectOpText : "متن",
DlgSelectOpValue : "مقدار",
DlgSelectBtnAdd : "اضافه",
DlgSelectBtnModify : "ویرایش",
DlgSelectBtnUp : "بالا",
DlgSelectBtnDown : "پائین",
DlgSelectBtnSetValue : "تنظیم به عنوان مقدار ِبرگزیده",
DlgSelectBtnDelete : "حذف",
 
// Textarea Dialog
DlgTextareaName : "نام",
DlgTextareaCols : "ستونها",
DlgTextareaRows : "سطرها",
 
// Text Field Dialog
DlgTextName : "نام",
DlgTextValue : "مقدار",
DlgTextCharWidth : "پهنای نویسه",
DlgTextMaxChars : "بیشینهٴ نویسه‌ها",
DlgTextType : "نوع",
DlgTextTypeText : "متن",
DlgTextTypePass : "گذرواژه",
 
// Hidden Field Dialog
DlgHiddenName : "نام",
DlgHiddenValue : "مقدار",
 
// Bulleted List Dialog
BulletedListProp : "ویژگیهای فهرست نقطه‌ای",
NumberedListProp : "ویژگیهای فهرست شماره‌دار",
DlgLstStart : "Start", //MISSING
DlgLstType : "نوع",
DlgLstTypeCircle : "دایره",
DlgLstTypeDisc : "قرص",
DlgLstTypeSquare : "چهارگوش",
DlgLstTypeNumbers : "شماره‌ها (1، 2، 3)",
DlgLstTypeLCase : "نویسه‌های کوچک (a، b، c)",
DlgLstTypeUCase : "نویسه‌های بزرگ (A، B، C)",
DlgLstTypeSRoman : "شمارگان رومی کوچک (i، ii، iii)",
DlgLstTypeLRoman : "شمارگان رومی بزرگ (I، II، III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "عمومی",
DlgDocBackTab : "پس‌زمینه",
DlgDocColorsTab : "رنگها و حاشیه‌ها",
DlgDocMetaTab : "فراداده",
 
DlgDocPageTitle : "عنوان صفحه",
DlgDocLangDir : "جهت زبان",
DlgDocLangDirLTR : "چپ به راست (LTR(",
DlgDocLangDirRTL : "راست به چپ (RTL(",
DlgDocLangCode : "کد زبان",
DlgDocCharSet : "رمزگذاری نویسه‌گان",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "رمزگذاری نویسه‌گان دیگر",
 
DlgDocDocType : "عنوان نوع سند",
DlgDocDocTypeOther : "عنوان نوع سند دیگر",
DlgDocIncXHTML : "شامل تعاریف XHTML",
DlgDocBgColor : "رنگ پس‌زمینه",
DlgDocBgImage : "URL تصویر پس‌زمینه",
DlgDocBgNoScroll : "پس‌زمینهٴ پیمایش‌ناپذیر",
DlgDocCText : "متن",
DlgDocCLink : "پیوند",
DlgDocCVisited : "پیوند مشاهده‌شده",
DlgDocCActive : "پیوند فعال",
DlgDocMargins : "حاشیه‌های صفحه",
DlgDocMaTop : "بالا",
DlgDocMaLeft : "چپ",
DlgDocMaRight : "راست",
DlgDocMaBottom : "پایین",
DlgDocMeIndex : "کلیدواژگان نمایه‌گذاری سند (با کاما جدا شوند)",
DlgDocMeDescr : "توصیف سند",
DlgDocMeAuthor : "نویسنده",
DlgDocMeCopy : "کپی‌رایت",
DlgDocPreview : "پیش‌نمایش",
 
// Templates Dialog
Templates : "الگوها",
DlgTemplatesTitle : "الگوهای محتویات",
DlgTemplatesSelMsg : "لطفا الگوی موردنظر را برای بازکردن در ویرایشگر برگزینید<br>(محتویات اصلی از دست خواهند رفت):",
DlgTemplatesLoading : "بارگذاری فهرست الگوها. لطفا صبر کنید...",
DlgTemplatesNoTpl : "(الگوئی تعریف نشده است)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "درباره",
DlgAboutBrowserInfoTab : "اطلاعات مرورگر",
DlgAboutLicenseTab : "گواهینامه",
DlgAboutVersion : "نگارش",
DlgAboutLicense : "لیسانس برپایهٴبندهای آیین‌نامهٴ GNU Lesser General Public License",
DlgAboutInfo : "برای آگاهی بیشتر به این نشانی بروید"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/bg.js
New file
0,0 → 1,501
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: bg.js
* Bulgarian language file.
*
* File Authors:
* Miroslav Ivanov (miro@primal-chaos.net)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Скрий панела с инструментите",
ToolbarExpand : "Покажи панела с инструментите",
 
// Toolbar Items and Context Menu
Save : "Запази",
NewPage : "Нова страница",
Preview : "Предварителен изглед",
Cut : "Изрежи",
Copy : "Запамети",
Paste : "Вмъкни",
PasteText : "Вмъкни само текст",
PasteWord : "Вмъкни от MS Word",
Print : "Печат",
SelectAll : "Селектирай всичко",
RemoveFormat : "Изтрий форматирането",
InsertLinkLbl : "Връзка",
InsertLink : "Добави/Редактирай връзка",
RemoveLink : "Изтрий връзка",
Anchor : "Добави/Редактирай котва",
InsertImageLbl : "Изображение",
InsertImage : "Добави/Редактирай изображение",
InsertFlashLbl : "Flash",
InsertFlash : "Добави/Редактиай Flash обект",
InsertTableLbl : "Таблица",
InsertTable : "Добави/Редактирай таблица",
InsertLineLbl : "Линия",
InsertLine : "Вмъкни хоризонтална линия",
InsertSpecialCharLbl: "Специален символ",
InsertSpecialChar : "Вмъкни специален символ",
InsertSmileyLbl : "Усмивка",
InsertSmiley : "Добави усмивка",
About : "За FCKeditor",
Bold : "Удебелен",
Italic : "Курсив",
Underline : "Подчертан",
StrikeThrough : "Зачертан",
Subscript : "Индекс за база",
Superscript : "Индекс за степен",
LeftJustify : "Подравняване в ляво",
CenterJustify : "Подравнявне в средата",
RightJustify : "Подравняване в дясно",
BlockJustify : "Двустранно подравняване",
DecreaseIndent : "Намали отстъпа",
IncreaseIndent : "Увеличи отстъпа",
Undo : "Отмени",
Redo : "Повтори",
NumberedListLbl : "Нумериран списък",
NumberedList : "Добави/Изтрий нумериран списък",
BulletedListLbl : "Ненумериран списък",
BulletedList : "Добави/Изтрий ненумериран списък",
ShowTableBorders : "Покажи рамките на таблицата",
ShowDetails : "Покажи подробности",
Style : "Стил",
FontFormat : "Формат",
Font : "Шрифт",
FontSize : "Размер",
TextColor : "Цвят на текста",
BGColor : "Цвят на фона",
Source : "Код",
Find : "Търси",
Replace : "Замести",
SpellCheck : "Провери правописа",
UniversalKeyboard : "Универсална клавиатура",
PageBreakLbl : "Нов ред",
PageBreak : "Вмъкни нов ред",
 
Form : "Формуляр",
Checkbox : "Поле за отметка",
RadioButton : "Поле за опция",
TextField : "Текстово поле",
Textarea : "Текстова област",
HiddenField : "Скрито поле",
Button : "Бутон",
SelectionField : "Падащо меню с опции",
ImageButton : "Бутон-изображение",
 
FitWindow : "Maximize the editor size", //MISSING
 
// Context Menu
EditLink : "Редактирай връзка",
CellCM : "Cell", //MISSING
RowCM : "Row", //MISSING
ColumnCM : "Column", //MISSING
InsertRow : "Добави ред",
DeleteRows : "Изтрий редовете",
InsertColumn : "Добави колона",
DeleteColumns : "Изтрий колоните",
InsertCell : "Добави клетка",
DeleteCells : "Изтрий клетките",
MergeCells : "Обедини клетките",
SplitCell : "Раздели клетката",
TableDelete : "Изтрий таблицата",
CellProperties : "Параметри на клетката",
TableProperties : "Параметри на таблицата",
ImageProperties : "Параметри на изображението",
FlashProperties : "Параметри на Flash обекта",
 
AnchorProp : "Параметри на котвата",
ButtonProp : "Параметри на бутона",
CheckboxProp : "Параметри на полето за отметка",
HiddenFieldProp : "Параметри на скритото поле",
RadioButtonProp : "Параметри на полето за опция",
ImageButtonProp : "Параметри на бутона-изображение",
TextFieldProp : "Параметри на текстовото-поле",
SelectionFieldProp : "Параметри на падащото меню с опции",
TextareaProp : "Параметри на текстовата област",
FormProp : "Параметри на формуляра",
 
FontFormats : "Нормален;Форматиран;Адрес;Заглавие 1;Заглавие 2;Заглавие 3;Заглавие 4;Заглавие 5;Заглавие 6;Параграф (DIV)",
 
// Alerts and Messages
ProcessingXHTML : "Обработка на XHTML. Моля изчакайте...",
Done : "Готово",
PasteWordConfirm : "Текстът, който искате да вмъкнете е копиран от MS Word. Желаете ли да бъде изчистен преди вмъкването?",
NotCompatiblePaste : "Тази операция изисква MS Internet Explorer версия 5.5 или по-висока. Желаете ли да вмъкнете запаметеното без изчистване?",
UnknownToolbarItem : "Непознат инструмент \"%1\"",
UnknownCommand : "Непозната команда \"%1\"",
NotImplemented : "Командата не е имплементирана",
UnknownToolbarSet : "Панелът \"%1\" не съществува",
NoActiveX : "Your browser's security settings could limit some features of the editor. You must enable the option \"Run ActiveX controls and plug-ins\". You may experience errors and notice missing features.", //MISSING
BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.", //MISSING
DialogBlocked : "It was not possible to open the dialog window. Make sure all popup blockers are disabled.", //MISSING
 
// Dialogs
DlgBtnOK : "ОК",
DlgBtnCancel : "Отказ",
DlgBtnClose : "Затвори",
DlgBtnBrowseServer : "Разгледай сървъра",
DlgAdvancedTag : "Подробности...",
DlgOpOther : "<Друго>",
DlgInfoTab : "Информация",
DlgAlertUrl : "Моля, въведете пълния път (URL)",
 
// General Dialogs Labels
DlgGenNotSet : "<не е настроен>",
DlgGenId : "Идентификатор",
DlgGenLangDir : "посока на речта",
DlgGenLangDirLtr : "От ляво на дясно",
DlgGenLangDirRtl : "От дясно на ляво",
DlgGenLangCode : "Код на езика",
DlgGenAccessKey : "Бърз клавиш",
DlgGenName : "Име",
DlgGenTabIndex : "Ред на достъп",
DlgGenLongDescr : "Описание на връзката",
DlgGenClass : "Клас от стиловите таблици",
DlgGenTitle : "Препоръчително заглавие",
DlgGenContType : "Препоръчителен тип на съдържанието",
DlgGenLinkCharset : "Тип на свързания ресурс",
DlgGenStyle : "Стил",
 
// Image Dialog
DlgImgTitle : "Параметри на изображението",
DlgImgInfoTab : "Информация за изображението",
DlgImgBtnUpload : "Прати към сървъра",
DlgImgURL : "Пълен път (URL)",
DlgImgUpload : "Качи",
DlgImgAlt : "Алтернативен текст",
DlgImgWidth : "Ширина",
DlgImgHeight : "Височина",
DlgImgLockRatio : "Запази пропорцията",
DlgBtnResetSize : "Възстанови размера",
DlgImgBorder : "Рамка",
DlgImgHSpace : "Хоризонтален отстъп",
DlgImgVSpace : "Вертикален отстъп",
DlgImgAlign : "Подравняване",
DlgImgAlignLeft : "Ляво",
DlgImgAlignAbsBottom: "Най-долу",
DlgImgAlignAbsMiddle: "Точно по средата",
DlgImgAlignBaseline : "По базовата линия",
DlgImgAlignBottom : "Долу",
DlgImgAlignMiddle : "По средата",
DlgImgAlignRight : "Дясно",
DlgImgAlignTextTop : "Върху текста",
DlgImgAlignTop : "Отгоре",
DlgImgPreview : "Изглед",
DlgImgAlertUrl : "Моля, въведете пълния път до изображението",
DlgImgLinkTab : "Връзка",
 
// Flash Dialog
DlgFlashTitle : "Параметри на Flash обекта",
DlgFlashChkPlay : "Автоматично стартиране",
DlgFlashChkLoop : "Ново стартиране след завършването",
DlgFlashChkMenu : "Разрешено Flash меню",
DlgFlashScale : "Оразмеряване",
DlgFlashScaleAll : "Покажи целия обект",
DlgFlashScaleNoBorder : "Без рамка",
DlgFlashScaleFit : "Според мястото",
 
// Link Dialog
DlgLnkWindowTitle : "Връзка",
DlgLnkInfoTab : "Информация за връзката",
DlgLnkTargetTab : "Цел",
 
DlgLnkType : "Вид на връзката",
DlgLnkTypeURL : "Пълен път (URL)",
DlgLnkTypeAnchor : "Котва в текущата страница",
DlgLnkTypeEMail : "Е-поща",
DlgLnkProto : "Протокол",
DlgLnkProtoOther : "<друго>",
DlgLnkURL : "Пълен път (URL)",
DlgLnkAnchorSel : "Изберете котва",
DlgLnkAnchorByName : "По име на котвата",
DlgLnkAnchorById : "По идентификатор на елемент",
DlgLnkNoAnchors : "<Няма котви в текущия документ>",
DlgLnkEMail : "Адрес за е-поща",
DlgLnkEMailSubject : "Тема на писмото",
DlgLnkEMailBody : "Текст на писмото",
DlgLnkUpload : "Качи",
DlgLnkBtnUpload : "Прати на сървъра",
 
DlgLnkTarget : "Цел",
DlgLnkTargetFrame : "<рамка>",
DlgLnkTargetPopup : "<дъщерен прозорец>",
DlgLnkTargetBlank : "Нов прозорец (_blank)",
DlgLnkTargetParent : "Родителски прозорец (_parent)",
DlgLnkTargetSelf : "Активния прозорец (_self)",
DlgLnkTargetTop : "Целия прозорец (_top)",
DlgLnkTargetFrameName : "Име на целевия прозорец",
DlgLnkPopWinName : "Име на дъщерния прозорец",
DlgLnkPopWinFeat : "Параметри на дъщерния прозорец",
DlgLnkPopResize : "С променливи размери",
DlgLnkPopLocation : "Поле за адрес",
DlgLnkPopMenu : "Меню",
DlgLnkPopScroll : "Плъзгач",
DlgLnkPopStatus : "Поле за статус",
DlgLnkPopToolbar : "Панел с бутони",
DlgLnkPopFullScrn : "Голям екран (MS IE)",
DlgLnkPopDependent : "Зависим (Netscape)",
DlgLnkPopWidth : "Ширина",
DlgLnkPopHeight : "Височина",
DlgLnkPopLeft : "Координати - X",
DlgLnkPopTop : "Координати - Y",
 
DlnLnkMsgNoUrl : "Моля, напишете пълния път (URL)",
DlnLnkMsgNoEMail : "Моля, напишете адреса за е-поща",
DlnLnkMsgNoAnchor : "Моля, изберете котва",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "Изберете цвят",
DlgColorBtnClear : "Изчисти",
DlgColorHighlight : "Текущ",
DlgColorSelected : "Избран",
 
// Smiley Dialog
DlgSmileyTitle : "Добави усмивка",
 
// Special Character Dialog
DlgSpecialCharTitle : "Изберете специален символ",
 
// Table Dialog
DlgTableTitle : "Параметри на таблицата",
DlgTableRows : "Редове",
DlgTableColumns : "Колони",
DlgTableBorder : "Размер на рамката",
DlgTableAlign : "Подравняване",
DlgTableAlignNotSet : "<Не е избрано>",
DlgTableAlignLeft : "Ляво",
DlgTableAlignCenter : "Център",
DlgTableAlignRight : "Дясно",
DlgTableWidth : "Ширина",
DlgTableWidthPx : "пиксели",
DlgTableWidthPc : "проценти",
DlgTableHeight : "Височина",
DlgTableCellSpace : "Разстояние между клетките",
DlgTableCellPad : "Отстъп на съдържанието в клетките",
DlgTableCaption : "Заглавие",
DlgTableSummary : "Резюме",
 
// Table Cell Dialog
DlgCellTitle : "Параметри на клетката",
DlgCellWidth : "Ширина",
DlgCellWidthPx : "пиксели",
DlgCellWidthPc : "проценти",
DlgCellHeight : "Височина",
DlgCellWordWrap : "пренасяне на нов ред",
DlgCellWordWrapNotSet : "<Не е настроено>",
DlgCellWordWrapYes : "Да",
DlgCellWordWrapNo : "не",
DlgCellHorAlign : "Хоризонтално подравняване",
DlgCellHorAlignNotSet : "<Не е настроено>",
DlgCellHorAlignLeft : "Ляво",
DlgCellHorAlignCenter : "Център",
DlgCellHorAlignRight: "Дясно",
DlgCellVerAlign : "Вертикално подравняване",
DlgCellVerAlignNotSet : "<Не е настроено>",
DlgCellVerAlignTop : "Горе",
DlgCellVerAlignMiddle : "По средата",
DlgCellVerAlignBottom : "Долу",
DlgCellVerAlignBaseline : "По базовата линия",
DlgCellRowSpan : "повече от един ред",
DlgCellCollSpan : "повече от една колона",
DlgCellBackColor : "фонов цвят",
DlgCellBorderColor : "цвят на рамката",
DlgCellBtnSelect : "Изберете...",
 
// Find Dialog
DlgFindTitle : "Търси",
DlgFindFindBtn : "Търси",
DlgFindNotFoundMsg : "Указания текст не беше намерен.",
 
// Replace Dialog
DlgReplaceTitle : "Замести",
DlgReplaceFindLbl : "Търси:",
DlgReplaceReplaceLbl : "Замести с:",
DlgReplaceCaseChk : "Със същия регистър",
DlgReplaceReplaceBtn : "Замести",
DlgReplaceReplAllBtn : "Замести всички",
DlgReplaceWordChk : "Търси същата дума",
 
// Paste Operations / Dialog
PasteErrorPaste : "Настройките за сигурност на вашия бразуър не разрешават на редактора да изпълни вмъкването. За целта използвайте клавиатурата (Ctrl+V).",
PasteErrorCut : "Настройките за сигурност на вашия бразуър не разрешават на редактора да изпълни изрязването. За целта използвайте клавиатурата (Ctrl+X).",
PasteErrorCopy : "Настройките за сигурност на вашия бразуър не разрешават на редактора да изпълни запаметяването. За целта използвайте клавиатурата (Ctrl+C).",
 
PasteAsText : "Вмъкни като чист текст",
PasteFromWord : "Вмъкни от MS Word",
 
DlgPasteMsg2 : "Вмъкнете тук съдъжанието с клавиатуарата (<STRONG>Ctrl+V</STRONG>) и натиснете <STRONG>OK</STRONG>.",
DlgPasteIgnoreFont : "Игнорирай шрифтовите дефиниции",
DlgPasteRemoveStyles : "Изтрий стиловите дефиниции",
DlgPasteCleanBox : "Изчисти",
 
// Color Picker
ColorAutomatic : "По подразбиране",
ColorMoreColors : "Други цветове...",
 
// Document Properties
DocProps : "Параметри на документа",
 
// Anchor Dialog
DlgAnchorTitle : "Параметри на котвата",
DlgAnchorName : "Име на котвата",
DlgAnchorErrorName : "Моля, въведете име на котвата",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Липсва в речника",
DlgSpellChangeTo : "Промени на",
DlgSpellBtnIgnore : "Игнорирай",
DlgSpellBtnIgnoreAll : "Игнорирай всички",
DlgSpellBtnReplace : "Замести",
DlgSpellBtnReplaceAll : "Замести всички",
DlgSpellBtnUndo : "Отмени",
DlgSpellNoSuggestions : "- Няма предложения -",
DlgSpellProgress : "Извършване на проверката за правопис...",
DlgSpellNoMispell : "Проверката за правопис завършена: не са открити правописни грешки",
DlgSpellNoChanges : "Проверката за правопис завършена: няма променени думи",
DlgSpellOneChange : "Проверката за правопис завършена: една дума е променена",
DlgSpellManyChanges : "Проверката за правопис завършена: %1 думи са променени",
 
IeSpellDownload : "Инструментът за проверка на правопис не е инсталиран. Желаете ли да го инсталирате ?",
 
// Button Dialog
DlgButtonText : "Текст (Стойност)",
DlgButtonType : "Тип",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Име",
DlgCheckboxValue : "Стойност",
DlgCheckboxSelected : "Отметнато",
 
// Form Dialog
DlgFormName : "Име",
DlgFormAction : "Действие",
DlgFormMethod : "Метод",
 
// Select Field Dialog
DlgSelectName : "Име",
DlgSelectValue : "Стойност",
DlgSelectSize : "Размер",
DlgSelectLines : "линии",
DlgSelectChkMulti : "Разрешено множествено селектиране",
DlgSelectOpAvail : "Възможни опции",
DlgSelectOpText : "Текст",
DlgSelectOpValue : "Стойност",
DlgSelectBtnAdd : "Добави",
DlgSelectBtnModify : "Промени",
DlgSelectBtnUp : "Нагоре",
DlgSelectBtnDown : "Надолу",
DlgSelectBtnSetValue : "Настрой като избрана стойност",
DlgSelectBtnDelete : "Изтрий",
 
// Textarea Dialog
DlgTextareaName : "Име",
DlgTextareaCols : "Колони",
DlgTextareaRows : "Редове",
 
// Text Field Dialog
DlgTextName : "Име",
DlgTextValue : "Стойност",
DlgTextCharWidth : "Ширина на символите",
DlgTextMaxChars : "Максимум символи",
DlgTextType : "Тип",
DlgTextTypeText : "Текст",
DlgTextTypePass : "Парола",
 
// Hidden Field Dialog
DlgHiddenName : "Име",
DlgHiddenValue : "Стойност",
 
// Bulleted List Dialog
BulletedListProp : "Параметри на ненумерирания списък",
NumberedListProp : "Параметри на нумерирания списък",
DlgLstStart : "Start", //MISSING
DlgLstType : "Тип",
DlgLstTypeCircle : "Окръжност",
DlgLstTypeDisc : "Кръг",
DlgLstTypeSquare : "Квадрат",
DlgLstTypeNumbers : "Числа (1, 2, 3)",
DlgLstTypeLCase : "Малки букви (a, b, c)",
DlgLstTypeUCase : "Големи букви (A, B, C)",
DlgLstTypeSRoman : "Малки римски числа (i, ii, iii)",
DlgLstTypeLRoman : "Големи римски числа (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "Общи",
DlgDocBackTab : "Фон",
DlgDocColorsTab : "Цветове и отстъпи",
DlgDocMetaTab : "Мета данни",
 
DlgDocPageTitle : "Заглавие на страницата",
DlgDocLangDir : "Посока на речта",
DlgDocLangDirLTR : "От ляво на дясно",
DlgDocLangDirRTL : "От дясно на ляво",
DlgDocLangCode : "Код на езика",
DlgDocCharSet : "Кодиране на символите",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "Друго кодиране на символите",
 
DlgDocDocType : "Тип на документа",
DlgDocDocTypeOther : "Друг тип на документа",
DlgDocIncXHTML : "Включи XHTML декларация",
DlgDocBgColor : "Цвят на фона",
DlgDocBgImage : "Пълен път до фоновото изображение",
DlgDocBgNoScroll : "Не-повтарящо се фоново изображение",
DlgDocCText : "Текст",
DlgDocCLink : "Връзка",
DlgDocCVisited : "Посетена връзка",
DlgDocCActive : "Активна връзка",
DlgDocMargins : "Отстъпи на страницата",
DlgDocMaTop : "Горе",
DlgDocMaLeft : "Ляво",
DlgDocMaRight : "Дясно",
DlgDocMaBottom : "Долу",
DlgDocMeIndex : "Ключови думи за документа (разделени със запетаи)",
DlgDocMeDescr : "Описание на документа",
DlgDocMeAuthor : "Автор",
DlgDocMeCopy : "Авторски права",
DlgDocPreview : "Изглед",
 
// Templates Dialog
Templates : "Шаблони",
DlgTemplatesTitle : "Шаблони",
DlgTemplatesSelMsg : "Изберете шаблон <br>(текущото съдържание на редактора ще бъде загубено):",
DlgTemplatesLoading : "Зареждане на списъка с шаблоните. Моля изчакайте...",
DlgTemplatesNoTpl : "(Няма дефинирани шаблони)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "За",
DlgAboutBrowserInfoTab : "Информация за браузъра",
DlgAboutLicenseTab : "License", //MISSING
DlgAboutVersion : "версия",
DlgAboutLicense : "Лиценз по условията на GNU Lesser General Public License",
DlgAboutInfo : "За повече информация посетете"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/de.js
New file
0,0 → 1,502
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: de.js
* German language file.
*
* File Authors:
* Maik Unruh (m.unruh@mm-concept.de)
* Hendrik Kramer (HK@lwd.de)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Symbolleiste einklappen",
ToolbarExpand : "Symbolleiste ausklappen",
 
// Toolbar Items and Context Menu
Save : "Speichern",
NewPage : "Neue Seite",
Preview : "Vorschau",
Cut : "Ausschneiden",
Copy : "Kopieren",
Paste : "Einfügen",
PasteText : "aus Textdatei einfügen",
PasteWord : "aus MS-Word einfügen",
Print : "Drucken",
SelectAll : "Alles auswählen",
RemoveFormat : "Formatierungen entfernen",
InsertLinkLbl : "Link",
InsertLink : "Link einfügen/editieren",
RemoveLink : "Link entfernen",
Anchor : "Anker einfügen/editieren",
InsertImageLbl : "Bild",
InsertImage : "Bild einfügen/editieren",
InsertFlashLbl : "Flash",
InsertFlash : "Flash einfügen/editieren",
InsertTableLbl : "Tabelle",
InsertTable : "Tabelle einfügen/editieren",
InsertLineLbl : "Linie",
InsertLine : "Horizontale Linie einfügen",
InsertSpecialCharLbl: "Sonderzeichen",
InsertSpecialChar : "Sonderzeichen einfügen/editieren",
InsertSmileyLbl : "Smiley",
InsertSmiley : "Smiley einfügen",
About : "Über FCKeditor",
Bold : "Fett",
Italic : "Kursiv",
Underline : "Unterstrichen",
StrikeThrough : "Durchgestrichen",
Subscript : "Tiefgestellt",
Superscript : "Hochgestellt",
LeftJustify : "Linksbündig",
CenterJustify : "Zentriert",
RightJustify : "Rechtsbündig",
BlockJustify : "Blocksatz",
DecreaseIndent : "Einzug verringern",
IncreaseIndent : "Einzug erhöhen",
Undo : "Rückgängig",
Redo : "Wiederherstellen",
NumberedListLbl : "Nummerierte Liste",
NumberedList : "Nummerierte Liste einfügen/entfernen",
BulletedListLbl : "Liste",
BulletedList : "Liste einfügen/entfernen",
ShowTableBorders : "Zeige Tabellenrahmen",
ShowDetails : "Zeige Details",
Style : "Style",
FontFormat : "Format",
Font : "Schriftart",
FontSize : "Size",
TextColor : "Textfarbe",
BGColor : "Hintergrundfarbe",
Source : "Quellcode",
Find : "Finden",
Replace : "Ersetzen",
SpellCheck : "Rechtschreibprüfung",
UniversalKeyboard : "Universal-Tastatur",
PageBreakLbl : "Seitenumbruch",
PageBreak : "Seitenumbruch einfügen",
 
Form : "Formular",
Checkbox : "Checkbox",
RadioButton : "Radiobutton",
TextField : "Textfeld einzeilig",
Textarea : "Textfeld mehrzeilig",
HiddenField : "verstecktes Feld",
Button : "Klickbutton",
SelectionField : "Auswahlfeld",
ImageButton : "Bildbutton",
 
FitWindow : "Editor maximieren",
 
// Context Menu
EditLink : "Link editieren",
CellCM : "Zelle",
RowCM : "Zeile",
ColumnCM : "Spalte",
InsertRow : "Zeile einfügen",
DeleteRows : "Zeile entfernen",
InsertColumn : "Spalte einfügen",
DeleteColumns : "Spalte löschen",
InsertCell : "Zelle einfügen",
DeleteCells : "Zelle löschen",
MergeCells : "Zellen vereinen",
SplitCell : "Zelle teilen",
TableDelete : "Tabelle löschen",
CellProperties : "Zellen Eigenschaften",
TableProperties : "Tabellen Eigenschaften",
ImageProperties : "Bild Eigenschaften",
FlashProperties : "Flash Eigenschaften",
 
AnchorProp : "Anker Eigenschaften",
ButtonProp : "Button Eigenschaften",
CheckboxProp : "Checkbox Eigenschaften",
HiddenFieldProp : "Verstecktes Feld Eigenschaften",
RadioButtonProp : "Optionsfeld Eigenschaften",
ImageButtonProp : "Bildbutton Eigenschaften",
TextFieldProp : "Textfeld (einzeilig) Eigenschaften",
SelectionFieldProp : "Auswahlfeld Eigenschaften",
TextareaProp : "Textfeld (mehrzeilig) Eigenschaften",
FormProp : "Formular Eigenschaften",
 
FontFormats : "Normal;Formatiert;Addresse;Überschrift 1;Überschrift 2;Überschrift 3;Überschrift 4;Überschrift 5;Überschrift 6;Normal (DIV)",
 
// Alerts and Messages
ProcessingXHTML : "Bearbeite XHTML. Bitte warten...",
Done : "Fertig",
PasteWordConfirm : "Der Text, den Sie einfügen möchten, scheint aus MS-Word kopiert zu sein. Möchten Sie ihn zuvor bereinigen lassen?",
NotCompatiblePaste : "Diese Funktion steht nur im Internet Explorer ab Version 5.5 zur Verfügung. Möchten Sie den Text unbereinigt einfügen?",
UnknownToolbarItem : "Unbekanntes Menüleisten-Objekt \"%1\"",
UnknownCommand : "Unbekannter Befehl \"%1\"",
NotImplemented : "Befehl nicht implementiert",
UnknownToolbarSet : "Menüleiste \"%1\" existiert nicht",
NoActiveX : "Die Sicherheitseinstellungen Ihres Browsers beschränken evtl. einige Funktionen des Editors. Aktivieren Sie die Option \"ActiveX-Steuerelemente und Plugins ausführen\" in den Sicherheitseinstellungen, um diese Funktionen nutzen zu können",
BrowseServerBlocked : "Ein Auswahlfenster konnte nicht geöffnet werden. Stellen Sie sicher, das alle Popup-Blocker ausgeschaltet sind.",
DialogBlocked : "Das Dialog-Fenster konnte nicht geöffnet werden. Stellen Sie sicher, das alle Popup-Blocker ausgeschaltet sind.",
 
// Dialogs
DlgBtnOK : "OK",
DlgBtnCancel : "Abbrechen",
DlgBtnClose : "Schließen",
DlgBtnBrowseServer : "Server durchsuchen",
DlgAdvancedTag : "Erweitert",
DlgOpOther : "<andere>",
DlgInfoTab : "Info",
DlgAlertUrl : "Bitte tragen Sie die URL ein",
 
// General Dialogs Labels
DlgGenNotSet : "< nichts >",
DlgGenId : "ID",
DlgGenLangDir : "Schreibrichtung",
DlgGenLangDirLtr : "Links nach Rechts (LTR)",
DlgGenLangDirRtl : "Rechts nach Links (RTL)",
DlgGenLangCode : "Sprachenkürzel",
DlgGenAccessKey : "Schlüssel",
DlgGenName : "Name",
DlgGenTabIndex : "Tab Index",
DlgGenLongDescr : "Langform URL",
DlgGenClass : "Stylesheet Klasse",
DlgGenTitle : "Titel Beschreibung",
DlgGenContType : "Content Beschreibung",
DlgGenLinkCharset : "Ziel-Zeichensatz",
DlgGenStyle : "Style",
 
// Image Dialog
DlgImgTitle : "Bild Eigenschaften",
DlgImgInfoTab : "Bild-Info",
DlgImgBtnUpload : "Zum Server senden",
DlgImgURL : "Bildauswahl",
DlgImgUpload : "Upload",
DlgImgAlt : "Alternativer Text",
DlgImgWidth : "Breite",
DlgImgHeight : "Höhe",
DlgImgLockRatio : "Größenverhältniss beibehalten",
DlgBtnResetSize : "Größe zurücksetzen",
DlgImgBorder : "Rahmen",
DlgImgHSpace : "H-Abstand",
DlgImgVSpace : "V-Abstand",
DlgImgAlign : "Ausrichtung",
DlgImgAlignLeft : "Links",
DlgImgAlignAbsBottom: "Abs Unten",
DlgImgAlignAbsMiddle: "Abs Mitte",
DlgImgAlignBaseline : "Baseline",
DlgImgAlignBottom : "Unten",
DlgImgAlignMiddle : "Mitte",
DlgImgAlignRight : "Rechts",
DlgImgAlignTextTop : "Text Oben",
DlgImgAlignTop : "Oben",
DlgImgPreview : "Vorschau",
DlgImgAlertUrl : "Bitte geben Sie die Bild-URL an",
DlgImgLinkTab : "Link",
 
// Flash Dialog
DlgFlashTitle : "Flash Eigenschaften",
DlgFlashChkPlay : "autom. Abspielen",
DlgFlashChkLoop : "Endlosschleife",
DlgFlashChkMenu : "Flash-Menü aktivieren",
DlgFlashScale : "Skalierung",
DlgFlashScaleAll : "Alles anzeigen",
DlgFlashScaleNoBorder : "ohne Rand",
DlgFlashScaleFit : "Passgenau",
 
// Link Dialog
DlgLnkWindowTitle : "Link",
DlgLnkInfoTab : "Link Info",
DlgLnkTargetTab : "Zielseite",
 
DlgLnkType : "Link-Typ",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Anker in dieser Seite",
DlgLnkTypeEMail : "E-Mail",
DlgLnkProto : "Protokoll",
DlgLnkProtoOther : "<anderes>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Anker auswählen",
DlgLnkAnchorByName : "nach Anker Name",
DlgLnkAnchorById : "nach Element Id",
DlgLnkNoAnchors : "<keine Anker im Dokument vorhanden>",
DlgLnkEMail : "E-Mail Addresse",
DlgLnkEMailSubject : "Betreffzeile",
DlgLnkEMailBody : "Nachrichtentext",
DlgLnkUpload : "Upload",
DlgLnkBtnUpload : "Zum Server senden",
 
DlgLnkTarget : "Zielseite",
DlgLnkTargetFrame : "<Frame>",
DlgLnkTargetPopup : "<Pop-up Fenster>",
DlgLnkTargetBlank : "Neues Fenster (_blank)",
DlgLnkTargetParent : "Oberes Fenster (_parent)",
DlgLnkTargetSelf : "Gleiches Fenster (_self)",
DlgLnkTargetTop : "Oberstes Fenster (_top)",
DlgLnkTargetFrameName : "Ziel-Fenster Name",
DlgLnkPopWinName : "Pop-up Fenster Name",
DlgLnkPopWinFeat : "Pop-up Fenster Eigenschaften",
DlgLnkPopResize : "Vergrößerbar",
DlgLnkPopLocation : "Adress-Leiste",
DlgLnkPopMenu : "Menü-Leiste",
DlgLnkPopScroll : "Rollbalken",
DlgLnkPopStatus : "Statusleiste",
DlgLnkPopToolbar : "Werkzeugleiste",
DlgLnkPopFullScrn : "Vollbild (IE)",
DlgLnkPopDependent : "Abhängig (Netscape)",
DlgLnkPopWidth : "Breite",
DlgLnkPopHeight : "Höhe",
DlgLnkPopLeft : "Linke Position",
DlgLnkPopTop : "Obere Position",
 
DlnLnkMsgNoUrl : "Bitte geben Sie die Link-URL an",
DlnLnkMsgNoEMail : "Bitte geben Sie e-Mail Adresse an",
DlnLnkMsgNoAnchor : "Bitte wählen Sie einen Anker aus",
DlnLnkMsgInvPopName : "Der Name des Popups muss mit einem Buchstaben beginnen und darf keine Leerzeichen enthalten",
 
// Color Dialog
DlgColorTitle : "Farbauswahl",
DlgColorBtnClear : "Keine Farbe",
DlgColorHighlight : "Vorschau",
DlgColorSelected : "Ausgewählt",
 
// Smiley Dialog
DlgSmileyTitle : "Smiley auswählen",
 
// Special Character Dialog
DlgSpecialCharTitle : "Sonderzeichen auswählen",
 
// Table Dialog
DlgTableTitle : "Tabellen Eigenschaften",
DlgTableRows : "Zeile",
DlgTableColumns : "Spalte",
DlgTableBorder : "Rahmen",
DlgTableAlign : "Ausrichtung",
DlgTableAlignNotSet : "<nichts>",
DlgTableAlignLeft : "Links",
DlgTableAlignCenter : "Zentriert",
DlgTableAlignRight : "Rechts",
DlgTableWidth : "Breite",
DlgTableWidthPx : "Pixel",
DlgTableWidthPc : "%",
DlgTableHeight : "Höhe",
DlgTableCellSpace : "Zellenabstand außen",
DlgTableCellPad : "Zellenabstand innen",
DlgTableCaption : "Überschrift",
DlgTableSummary : "Inhaltsübersicht",
 
// Table Cell Dialog
DlgCellTitle : "Zellen-Eigenschaften",
DlgCellWidth : "Breite",
DlgCellWidthPx : "Pixel",
DlgCellWidthPc : "%",
DlgCellHeight : "Höhe",
DlgCellWordWrap : "Umbruch",
DlgCellWordWrapNotSet : "<nichts>",
DlgCellWordWrapYes : "Ja",
DlgCellWordWrapNo : "Nein",
DlgCellHorAlign : "Horizontale Ausrichtung",
DlgCellHorAlignNotSet : "<nichts>",
DlgCellHorAlignLeft : "Links",
DlgCellHorAlignCenter : "Zentriert",
DlgCellHorAlignRight: "Rechts",
DlgCellVerAlign : "Vertikale Ausrichtung",
DlgCellVerAlignNotSet : "<nichts>",
DlgCellVerAlignTop : "Oben",
DlgCellVerAlignMiddle : "Mitte",
DlgCellVerAlignBottom : "Unten",
DlgCellVerAlignBaseline : "Grundlinie",
DlgCellRowSpan : "Zeilen zusammenfassen",
DlgCellCollSpan : "Spalten zusammenfassen",
DlgCellBackColor : "Hintergrundfarbe",
DlgCellBorderColor : "Rahmenfarbe",
DlgCellBtnSelect : "Auswahl...",
 
// Find Dialog
DlgFindTitle : "Finden",
DlgFindFindBtn : "Finden",
DlgFindNotFoundMsg : "Der gesuchte Text wurde nicht gefunden.",
 
// Replace Dialog
DlgReplaceTitle : "Ersetzen",
DlgReplaceFindLbl : "Suche nach:",
DlgReplaceReplaceLbl : "Ersetze mit:",
DlgReplaceCaseChk : "Groß-Kleinschreibung beachten",
DlgReplaceReplaceBtn : "Ersetzen",
DlgReplaceReplAllBtn : "Alle Ersetzen",
DlgReplaceWordChk : "Nur ganze Worte suchen",
 
// Paste Operations / Dialog
PasteErrorPaste : "Die Sicherheitseinstellungen Ihres Browsers lassen es nicht zu, den Text automatisch einzufügen. Bitte benutzen Sie die System-Zwischenablage über STRG-C (kopieren) und STRG-V (einfügen).",
PasteErrorCut : "Die Sicherheitseinstellungen Ihres Browsers lassen es nicht zu, den Text automatisch auszuschneiden. Bitte benutzen Sie die System-Zwischenablage über STRG-X (ausschneiden) und STRG-V (einfügen).",
PasteErrorCopy : "Die Sicherheitseinstellungen Ihres Browsers lassen es nicht zu, den Text automatisch kopieren. Bitte benutzen Sie die System-Zwischenablage über STRG-C (kopieren).",
 
PasteAsText : "Als Text einfügen",
PasteFromWord : "Aus Word einfügen",
 
DlgPasteMsg2 : "Bitte fügen Sie den Text in der folgenden Box über die Tastatur (mit <STRONG>Ctrl+V</STRONG>) ein und bestätigen Sie mit <STRONG>OK</STRONG>.",
DlgPasteIgnoreFont : "Ignoriere Schriftart-Definitionen",
DlgPasteRemoveStyles : "Entferne Style-Definitionen",
DlgPasteCleanBox : "Inhalt aufräumen",
 
// Color Picker
ColorAutomatic : "Automatisch",
ColorMoreColors : "Weitere Farben...",
 
// Document Properties
DocProps : "Dokument Eigenschaften",
 
// Anchor Dialog
DlgAnchorTitle : "Anker Eigenschaften",
DlgAnchorName : "Anker Name",
DlgAnchorErrorName : "Bitte geben Sie den Namen des Ankers ein",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Nicht im Wörterbuch",
DlgSpellChangeTo : "Ändern in",
DlgSpellBtnIgnore : "Ignorieren",
DlgSpellBtnIgnoreAll : "Alle Ignorieren",
DlgSpellBtnReplace : "Ersetzen",
DlgSpellBtnReplaceAll : "Alle Ersetzen",
DlgSpellBtnUndo : "Rückgängig",
DlgSpellNoSuggestions : " - keine Vorschläge - ",
DlgSpellProgress : "Rechtschreibprüfung läuft...",
DlgSpellNoMispell : "Rechtschreibprüfung abgeschlossen - keine Fehler gefunden",
DlgSpellNoChanges : "Rechtschreibprüfung abgeschlossen - keine Worte geändert",
DlgSpellOneChange : "Rechtschreibprüfung abgeschlossen - ein Wort geändert",
DlgSpellManyChanges : "Rechtschreibprüfung abgeschlossen - %1 Wörter geändert",
 
IeSpellDownload : "Rechtschreibprüfung nicht installiert. Möchten Sie sie jetzt herunterladen?",
 
// Button Dialog
DlgButtonText : "Text (Wert)",
DlgButtonType : "Typ",
DlgButtonTypeBtn : "Button",
DlgButtonTypeSbm : "Absenden",
DlgButtonTypeRst : "Zurücksetzen",
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Name",
DlgCheckboxValue : "Wert",
DlgCheckboxSelected : "ausgewählt",
 
// Form Dialog
DlgFormName : "Name",
DlgFormAction : "Action",
DlgFormMethod : "Method",
 
// Select Field Dialog
DlgSelectName : "Name",
DlgSelectValue : "Wert",
DlgSelectSize : "Größe",
DlgSelectLines : "Linien",
DlgSelectChkMulti : "Erlaube Mehrfachauswahl",
DlgSelectOpAvail : "Mögliche Optionen",
DlgSelectOpText : "Text",
DlgSelectOpValue : "Wert",
DlgSelectBtnAdd : "Hinzufügen",
DlgSelectBtnModify : "Ändern",
DlgSelectBtnUp : "Hoch",
DlgSelectBtnDown : "Runter",
DlgSelectBtnSetValue : "Setze als Standardwert",
DlgSelectBtnDelete : "Entfernen",
 
// Textarea Dialog
DlgTextareaName : "Name",
DlgTextareaCols : "Spalten",
DlgTextareaRows : "Reihen",
 
// Text Field Dialog
DlgTextName : "Name",
DlgTextValue : "Wert",
DlgTextCharWidth : "Zeichenbreite",
DlgTextMaxChars : "Max. Zeichen",
DlgTextType : "Typ",
DlgTextTypeText : "Text",
DlgTextTypePass : "Passwort",
 
// Hidden Field Dialog
DlgHiddenName : "Name",
DlgHiddenValue : "Wert",
 
// Bulleted List Dialog
BulletedListProp : "Listen-Eigenschaften",
NumberedListProp : "Nummerierte Listen-Eigenschaften",
DlgLstStart : "Start",
DlgLstType : "Typ",
DlgLstTypeCircle : "Ring",
DlgLstTypeDisc : "Kreis",
DlgLstTypeSquare : "Quadrat",
DlgLstTypeNumbers : "Nummern (1, 2, 3)",
DlgLstTypeLCase : "Kleinbuchstaben (a, b, c)",
DlgLstTypeUCase : "Großbuchstaben (A, B, C)",
DlgLstTypeSRoman : "Kleine römische Zahlen (i, ii, iii)",
DlgLstTypeLRoman : "Große römische Zahlen (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "Allgemein",
DlgDocBackTab : "Hintergrund",
DlgDocColorsTab : "Farben und Abstände",
DlgDocMetaTab : "Metadaten",
 
DlgDocPageTitle : "Seitentitel",
DlgDocLangDir : "Schriftrichtung",
DlgDocLangDirLTR : "Links nach Rechts",
DlgDocLangDirRTL : "rechts nach Links",
DlgDocLangCode : "Sprachkürzel",
DlgDocCharSet : "Zeichenkodierung",
DlgDocCharSetCE : "Zentraleuropäisch",
DlgDocCharSetCT : "traditionell Chinesisch (Big5)",
DlgDocCharSetCR : "Kyrillisch",
DlgDocCharSetGR : "Griechisch",
DlgDocCharSetJP : "Japanisch",
DlgDocCharSetKR : "Koreanisch",
DlgDocCharSetTR : "Türkisch",
DlgDocCharSetUN : "Unicode (UTF-8)",
DlgDocCharSetWE : "Westeuropäisch",
DlgDocCharSetOther : "Andere Zeichenkodierung",
 
DlgDocDocType : "Dokumententyp",
DlgDocDocTypeOther : "Anderer Dokumententyp",
DlgDocIncXHTML : "Beziehe XHTML Deklarationen ein",
DlgDocBgColor : "Hintergrundfarbe",
DlgDocBgImage : "Hintergrundbild URL",
DlgDocBgNoScroll : "feststehender Hintergrund",
DlgDocCText : "Text",
DlgDocCLink : "Link",
DlgDocCVisited : "Besuchter Link",
DlgDocCActive : "Aktiver Link",
DlgDocMargins : "Seitenränder",
DlgDocMaTop : "Oben",
DlgDocMaLeft : "Links",
DlgDocMaRight : "Rechts",
DlgDocMaBottom : "Unten",
DlgDocMeIndex : "Schlüsselwörter (durch Komma getrennt)",
DlgDocMeDescr : "Dokument-Beschreibung",
DlgDocMeAuthor : "Autor",
DlgDocMeCopy : "Copyright",
DlgDocPreview : "Vorschau",
 
// Templates Dialog
Templates : "Vorlagen",
DlgTemplatesTitle : "Vorlagen",
DlgTemplatesSelMsg : "Klicken Sie auf eine Vorlage, um sie im Editor zu öffnen (der aktuelle Inhalt wird dabei gelöscht!):",
DlgTemplatesLoading : "Liste der Vorlagen wird geladen. Bitte warten...",
DlgTemplatesNoTpl : "(keine Vorlagen definiert)",
DlgTemplatesReplace : "Aktuellen Inhalt ersetzen",
 
// About Dialog
DlgAboutAboutTab : "Über",
DlgAboutBrowserInfoTab : "Browser-Info",
DlgAboutLicenseTab : "Lizenz",
DlgAboutVersion : "Version",
DlgAboutLicense : "Lizensiert unter den Richtlinien der GNU Lesser General Public License",
DlgAboutInfo : "Für weitere Informationen siehe"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/sv.js
New file
0,0 → 1,501
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: sv.js
* Swedish language file.
*
* File Authors:
* Kristoffer Malvefors (kristoffer@intema.ws)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Dölj verktygsfält",
ToolbarExpand : "Visa verktygsfält",
 
// Toolbar Items and Context Menu
Save : "Spara",
NewPage : "Ny sida",
Preview : "Förhandsgranska",
Cut : "Klipp ut",
Copy : "Kopiera",
Paste : "Klistra in",
PasteText : "Klistra in som text",
PasteWord : "Klistra in från Word",
Print : "Skriv ut",
SelectAll : "Markera allt",
RemoveFormat : "Radera formatering",
InsertLinkLbl : "Länk",
InsertLink : "Infoga/Redigera länk",
RemoveLink : "Radera länk",
Anchor : "Infoga/Redigera ankarlänk",
InsertImageLbl : "Bild",
InsertImage : "Infoga/Redigera bild",
InsertFlashLbl : "Flash",
InsertFlash : "Infoga/Redigera Flash",
InsertTableLbl : "Tabell",
InsertTable : "Infoga/Redigera tabell",
InsertLineLbl : "Linje",
InsertLine : "Infoga horisontal linje",
InsertSpecialCharLbl: "Utökade tecken",
InsertSpecialChar : "Klistra in utökat tecken",
InsertSmileyLbl : "Smiley",
InsertSmiley : "Infoga Smiley",
About : "Om FCKeditor",
Bold : "Fet",
Italic : "Kursiv",
Underline : "Understruken",
StrikeThrough : "Genomstruken",
Subscript : "Nedsänkta tecken",
Superscript : "Upphöjda tecken",
LeftJustify : "Vänsterjustera",
CenterJustify : "Centrera",
RightJustify : "Högerjustera",
BlockJustify : "Justera till marginaler",
DecreaseIndent : "Minska indrag",
IncreaseIndent : "Öka indrag",
Undo : "Ångra",
Redo : "Gör om",
NumberedListLbl : "Numrerad lista",
NumberedList : "Infoga/Radera numrerad lista",
BulletedListLbl : "Punktlista",
BulletedList : "Infoga/Radera punktlista",
ShowTableBorders : "Visa tabellkant",
ShowDetails : "Visa radbrytningar",
Style : "Anpassad stil",
FontFormat : "Teckenformat",
Font : "Typsnitt",
FontSize : "Storlek",
TextColor : "Textfärg",
BGColor : "Bakgrundsfärg",
Source : "Källa",
Find : "Sök",
Replace : "Ersätt",
SpellCheck : "Stavningskontroll",
UniversalKeyboard : "Universellt tangentbord",
PageBreakLbl : "Sidbrytning",
PageBreak : "Infoga sidbrytning",
 
Form : "Formulär",
Checkbox : "Kryssruta",
RadioButton : "Alternativknapp",
TextField : "Textfält",
Textarea : "Textruta",
HiddenField : "Dolt fält",
Button : "Knapp",
SelectionField : "Flervalslista",
ImageButton : "Bildknapp",
 
FitWindow : "Maximize the editor size", //MISSING
 
// Context Menu
EditLink : "Redigera länk",
CellCM : "Cell", //MISSING
RowCM : "Row", //MISSING
ColumnCM : "Column", //MISSING
InsertRow : "Infoga rad",
DeleteRows : "Radera rad",
InsertColumn : "Infoga kolumn",
DeleteColumns : "Radera kolumn",
InsertCell : "Infoga cell",
DeleteCells : "Radera celler",
MergeCells : "Sammanfoga celler",
SplitCell : "Separera celler",
TableDelete : "Radera tabell",
CellProperties : "Cellegenskaper",
TableProperties : "Tabellegenskaper",
ImageProperties : "Bildegenskaper",
FlashProperties : "Flashegenskaper",
 
AnchorProp : "Egenskaper för ankarlänk",
ButtonProp : "Egenskaper för knapp",
CheckboxProp : "Egenskaper för kryssruta",
HiddenFieldProp : "Egenskaper för dolt fält",
RadioButtonProp : "Egenskaper för alternativknapp",
ImageButtonProp : "Egenskaper för bildknapp",
TextFieldProp : "Egenskaper för textfält",
SelectionFieldProp : "Egenskaper för flervalslista",
TextareaProp : "Egenskaper för textruta",
FormProp : "Egenskaper för formulär",
 
FontFormats : "Normal;Formaterad;Adress;Rubrik 1;Rubrik 2;Rubrik 3;Rubrik 4;Rubrik 5;Rubrik 6",
 
// Alerts and Messages
ProcessingXHTML : "Bearbetar XHTML. Var god vänta...",
Done : "Klar",
PasteWordConfirm : "Texten du vill klistra in verkar vara kopierad från Word. Vill du rensa innan du klistar in?",
NotCompatiblePaste : "Denna åtgärd är inte tillgängligt för Internet Explorer version 5.5 eller högre. Vill du klistra in utan att rensa?",
UnknownToolbarItem : "Okänt verktygsfält \"%1\"",
UnknownCommand : "Okänt kommando \"%1\"",
NotImplemented : "Kommandot finns ej",
UnknownToolbarSet : "Verktygsfält \"%1\" finns ej",
NoActiveX : "Din webläsares säkerhetsinställningar kan begränsa funktionaliteten. Du bör aktivera \"Kör ActiveX kontroller och plug-ins\". Fel och avsaknad av funktioner kan annars uppstå.",
BrowseServerBlocked : "Kunde Ej öppna resursfönstret. Var god och avaktivera alla popup-blockerare.",
DialogBlocked : "Kunde Ej öppna dialogfönstret. Var god och avaktivera alla popup-blockerare.",
 
// Dialogs
DlgBtnOK : "OK",
DlgBtnCancel : "Avbryt",
DlgBtnClose : "Stäng",
DlgBtnBrowseServer : "Bläddra på server",
DlgAdvancedTag : "Avancerad",
DlgOpOther : "Övrigt",
DlgInfoTab : "Information",
DlgAlertUrl : "Var god och ange en URL",
 
// General Dialogs Labels
DlgGenNotSet : "<ej angivet>",
DlgGenId : "Id",
DlgGenLangDir : "Språkriktning",
DlgGenLangDirLtr : "Vänster till Höger (VTH)",
DlgGenLangDirRtl : "Höger till Vänster (HTV)",
DlgGenLangCode : "Språkkod",
DlgGenAccessKey : "Behörighetsnyckel",
DlgGenName : "Namn",
DlgGenTabIndex : "Tabindex",
DlgGenLongDescr : "URL-beskrivning",
DlgGenClass : "Stylesheet class",
DlgGenTitle : "Titel",
DlgGenContType : "Innehållstyp",
DlgGenLinkCharset : "Teckenuppställning",
DlgGenStyle : "Style",
 
// Image Dialog
DlgImgTitle : "Bildegenskaper",
DlgImgInfoTab : "Bildinformation",
DlgImgBtnUpload : "Skicka till server",
DlgImgURL : "URL",
DlgImgUpload : "Ladda upp",
DlgImgAlt : "Alternativ text",
DlgImgWidth : "Bredd",
DlgImgHeight : "Höjd",
DlgImgLockRatio : "Lås höjd/bredd förhållanden",
DlgBtnResetSize : "Återställ storlek",
DlgImgBorder : "Kant",
DlgImgHSpace : "Horis. marginal",
DlgImgVSpace : "Vert. marginal",
DlgImgAlign : "Justering",
DlgImgAlignLeft : "Vänster",
DlgImgAlignAbsBottom: "Absolut nederkant",
DlgImgAlignAbsMiddle: "Absolut centrering",
DlgImgAlignBaseline : "Baslinje",
DlgImgAlignBottom : "Nederkant",
DlgImgAlignMiddle : "Mitten",
DlgImgAlignRight : "Höger",
DlgImgAlignTextTop : "Text överkant",
DlgImgAlignTop : "Överkant",
DlgImgPreview : "Förhandsgranska",
DlgImgAlertUrl : "Var god och ange bildens URL",
DlgImgLinkTab : "Länk",
 
// Flash Dialog
DlgFlashTitle : "Flashegenskaper",
DlgFlashChkPlay : "Automatisk uppspelning",
DlgFlashChkLoop : "Upprepa/Loopa",
DlgFlashChkMenu : "Aktivera Flashmeny",
DlgFlashScale : "Skala",
DlgFlashScaleAll : "Visa allt",
DlgFlashScaleNoBorder : "Ingen ram",
DlgFlashScaleFit : "Exakt passning",
 
// Link Dialog
DlgLnkWindowTitle : "Länk",
DlgLnkInfoTab : "Länkinformation",
DlgLnkTargetTab : "Mål",
 
DlgLnkType : "Länktyp",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Ankare i sidan",
DlgLnkTypeEMail : "E-post",
DlgLnkProto : "Protokoll",
DlgLnkProtoOther : "<övrigt>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Välj ett ankare",
DlgLnkAnchorByName : "efter ankarnamn",
DlgLnkAnchorById : "efter objektid",
DlgLnkNoAnchors : "<Inga ankare kunde hittas>",
DlgLnkEMail : "E-postadress",
DlgLnkEMailSubject : "Ämne",
DlgLnkEMailBody : "Innehåll",
DlgLnkUpload : "Ladda upp",
DlgLnkBtnUpload : "Skicka till servern",
 
DlgLnkTarget : "Mål",
DlgLnkTargetFrame : "<ram>",
DlgLnkTargetPopup : "<popup-fönster>",
DlgLnkTargetBlank : "Nytt fönster (_blank)",
DlgLnkTargetParent : "Föregående Window (_parent)",
DlgLnkTargetSelf : "Detta fönstret (_self)",
DlgLnkTargetTop : "Översta fönstret (_top)",
DlgLnkTargetFrameName : "Målets ramnamn",
DlgLnkPopWinName : "Popup-fönstrets namn",
DlgLnkPopWinFeat : "Popup-fönstrets egenskaper",
DlgLnkPopResize : "Kan ändra storlek",
DlgLnkPopLocation : "Adressfält",
DlgLnkPopMenu : "Menyfält",
DlgLnkPopScroll : "Scrolllista",
DlgLnkPopStatus : "Statusfält",
DlgLnkPopToolbar : "Verktygsfält",
DlgLnkPopFullScrn : "Helskärm (endast IE)",
DlgLnkPopDependent : "Beroende (endest Netscape)",
DlgLnkPopWidth : "Bredd",
DlgLnkPopHeight : "Höjd",
DlgLnkPopLeft : "Position från vänster",
DlgLnkPopTop : "Position från sidans topp",
 
DlnLnkMsgNoUrl : "Var god ange länkens URL",
DlnLnkMsgNoEMail : "Var god ange E-postadress",
DlnLnkMsgNoAnchor : "Var god ange ett ankare",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "Välj färg",
DlgColorBtnClear : "Rensa",
DlgColorHighlight : "Markera",
DlgColorSelected : "Vald",
 
// Smiley Dialog
DlgSmileyTitle : "Infoga smiley",
 
// Special Character Dialog
DlgSpecialCharTitle : "Välj utökat tecken",
 
// Table Dialog
DlgTableTitle : "Tabellegenskaper",
DlgTableRows : "Rader",
DlgTableColumns : "Kolumner",
DlgTableBorder : "Kantstorlek",
DlgTableAlign : "Justering",
DlgTableAlignNotSet : "<ej angivet>",
DlgTableAlignLeft : "Vänster",
DlgTableAlignCenter : "Centrerad",
DlgTableAlignRight : "Höger",
DlgTableWidth : "Bredd",
DlgTableWidthPx : "pixlar",
DlgTableWidthPc : "procent",
DlgTableHeight : "Höjd",
DlgTableCellSpace : "Cellavstånd",
DlgTableCellPad : "Cellutfyllnad",
DlgTableCaption : "Rubrik",
DlgTableSummary : "Sammanfattning",
 
// Table Cell Dialog
DlgCellTitle : "Cellegenskaper",
DlgCellWidth : "Bredd",
DlgCellWidthPx : "pixlar",
DlgCellWidthPc : "procent",
DlgCellHeight : "Höjd",
DlgCellWordWrap : "Automatisk radbrytning",
DlgCellWordWrapNotSet : "<Ej angivet>",
DlgCellWordWrapYes : "Ja",
DlgCellWordWrapNo : "Nej",
DlgCellHorAlign : "Horisontal justering",
DlgCellHorAlignNotSet : "<Ej angivet>",
DlgCellHorAlignLeft : "Vänster",
DlgCellHorAlignCenter : "Centrerad",
DlgCellHorAlignRight: "Höger",
DlgCellVerAlign : "Vertikal justering",
DlgCellVerAlignNotSet : "<Ej angivet>",
DlgCellVerAlignTop : "Topp",
DlgCellVerAlignMiddle : "Mitten",
DlgCellVerAlignBottom : "Nederkant",
DlgCellVerAlignBaseline : "Underst",
DlgCellRowSpan : "Radomfång",
DlgCellCollSpan : "Kolumnomfång",
DlgCellBackColor : "Bakgrundsfärg",
DlgCellBorderColor : "Kantfärg",
DlgCellBtnSelect : "Välj...",
 
// Find Dialog
DlgFindTitle : "Sök",
DlgFindFindBtn : "Sök",
DlgFindNotFoundMsg : "Angiven text kunde ej hittas.",
 
// Replace Dialog
DlgReplaceTitle : "Ersätt",
DlgReplaceFindLbl : "Sök efter:",
DlgReplaceReplaceLbl : "Ersätt med:",
DlgReplaceCaseChk : "Skiftläge",
DlgReplaceReplaceBtn : "Ersätt",
DlgReplaceReplAllBtn : "Ersätt alla",
DlgReplaceWordChk : "Inkludera hela ord",
 
// Paste Operations / Dialog
PasteErrorPaste : "Säkerhetsinställningar i Er webläsare tillåter inte åtgården Klistra in. Använd (Ctrl+V) istället.",
PasteErrorCut : "Säkerhetsinställningar i Er webläsare tillåter inte åtgården Klipp ut. Använd (Ctrl+X) istället.",
PasteErrorCopy : "Säkerhetsinställningar i Er webläsare tillåter inte åtgården Kopiera. Använd (Ctrl+C) istället",
 
PasteAsText : "Klistra in som vanlig text",
PasteFromWord : "Klistra in från Word",
 
DlgPasteMsg2 : "Var god och klistra in Er text i rutan nedan genom att använda (<STRONG>Ctrl+V</STRONG>) klicka sen på <STRONG>OK</STRONG>.",
DlgPasteIgnoreFont : "Ignorera typsnittsdefinitioner",
DlgPasteRemoveStyles : "Radera Stildefinitioner",
DlgPasteCleanBox : "Töm rutans innehåll",
 
// Color Picker
ColorAutomatic : "Automatisk",
ColorMoreColors : "Fler färger...",
 
// Document Properties
DocProps : "Dokumentegenskaper",
 
// Anchor Dialog
DlgAnchorTitle : "Ankaregenskaper",
DlgAnchorName : "Ankarnamn",
DlgAnchorErrorName : "Var god ange ett ankarnamn",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Saknas i ordlistan",
DlgSpellChangeTo : "Ändra till",
DlgSpellBtnIgnore : "Ignorera",
DlgSpellBtnIgnoreAll : "Ignorera alla",
DlgSpellBtnReplace : "Ersätt",
DlgSpellBtnReplaceAll : "Ersätt alla",
DlgSpellBtnUndo : "Ångra",
DlgSpellNoSuggestions : "- Förslag saknas -",
DlgSpellProgress : "Stavningskontroll pågår...",
DlgSpellNoMispell : "Stavningskontroll slutförd: Inga stavfel påträffades.",
DlgSpellNoChanges : "Stavningskontroll slutförd: Inga ord rättades.",
DlgSpellOneChange : "Stavningskontroll slutförd: Ett ord rättades.",
DlgSpellManyChanges : "Stavningskontroll slutförd: %1 ord rättades.",
 
IeSpellDownload : "Stavningskontrollen är ej installerad. Vill du göra det nu?",
 
// Button Dialog
DlgButtonText : "Text (Värde)",
DlgButtonType : "Typ",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Namn",
DlgCheckboxValue : "Värde",
DlgCheckboxSelected : "Vald",
 
// Form Dialog
DlgFormName : "Namn",
DlgFormAction : "Funktion",
DlgFormMethod : "Metod",
 
// Select Field Dialog
DlgSelectName : "Namn",
DlgSelectValue : "Värde",
DlgSelectSize : "Storlek",
DlgSelectLines : "Linjer",
DlgSelectChkMulti : "Tillåt flerval",
DlgSelectOpAvail : "Befintliga val",
DlgSelectOpText : "Text",
DlgSelectOpValue : "Värde",
DlgSelectBtnAdd : "Lägg till",
DlgSelectBtnModify : "Redigera",
DlgSelectBtnUp : "Upp",
DlgSelectBtnDown : "Ner",
DlgSelectBtnSetValue : "Markera som valt värde",
DlgSelectBtnDelete : "Radera",
 
// Textarea Dialog
DlgTextareaName : "Namn",
DlgTextareaCols : "Kolumner",
DlgTextareaRows : "Rader",
 
// Text Field Dialog
DlgTextName : "Namn",
DlgTextValue : "Värde",
DlgTextCharWidth : "Teckenbredd",
DlgTextMaxChars : "Max antal tecken",
DlgTextType : "Typ",
DlgTextTypeText : "Text",
DlgTextTypePass : "Lösenord",
 
// Hidden Field Dialog
DlgHiddenName : "Namn",
DlgHiddenValue : "Värde",
 
// Bulleted List Dialog
BulletedListProp : "Egenskaper för punktlista",
NumberedListProp : "Egenskaper för numrerad lista",
DlgLstStart : "Start", //MISSING
DlgLstType : "Typ",
DlgLstTypeCircle : "Cirkel",
DlgLstTypeDisc : "Punkt",
DlgLstTypeSquare : "Ruta",
DlgLstTypeNumbers : "Nummer (1, 2, 3)",
DlgLstTypeLCase : "Gemener (a, b, c)",
DlgLstTypeUCase : "Versaler (A, B, C)",
DlgLstTypeSRoman : "Små romerska siffror (i, ii, iii)",
DlgLstTypeLRoman : "Stora romerska siffror (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "Allmän",
DlgDocBackTab : "Bakgrund",
DlgDocColorsTab : "Färg och marginal",
DlgDocMetaTab : "Metadata",
 
DlgDocPageTitle : "Sidtitel",
DlgDocLangDir : "Språkriktning",
DlgDocLangDirLTR : "Vänster till Höger",
DlgDocLangDirRTL : "Höger till Vänster",
DlgDocLangCode : "Språkkod",
DlgDocCharSet : "Teckenuppsättningar",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "Övriga teckenuppsättningar",
 
DlgDocDocType : "Sidhuvud",
DlgDocDocTypeOther : "Övriga sidhuvuden",
DlgDocIncXHTML : "Inkludera XHTML deklaration",
DlgDocBgColor : "Bakgrundsfärg",
DlgDocBgImage : "Bakgrundsbildens URL",
DlgDocBgNoScroll : "Fast bakgrund",
DlgDocCText : "Text",
DlgDocCLink : "Länk",
DlgDocCVisited : "Besökt länk",
DlgDocCActive : "Aktiv länk",
DlgDocMargins : "Sidmarginal",
DlgDocMaTop : "Topp",
DlgDocMaLeft : "Vänster",
DlgDocMaRight : "Höger",
DlgDocMaBottom : "Botten",
DlgDocMeIndex : "Sidans nyckelord",
DlgDocMeDescr : "Sidans beskrivning",
DlgDocMeAuthor : "Författare",
DlgDocMeCopy : "Upphovsrätt",
DlgDocPreview : "Förhandsgranska",
 
// Templates Dialog
Templates : "Sidmallar",
DlgTemplatesTitle : "Sidmallar",
DlgTemplatesSelMsg : "Var god välj en mall att använda med editorn<br>(allt nuvarande innehåll raderas):",
DlgTemplatesLoading : "Laddar mallar. Var god vänta...",
DlgTemplatesNoTpl : "(Ingen mall är vald)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "Om",
DlgAboutBrowserInfoTab : "Webläsare",
DlgAboutLicenseTab : "License", //MISSING
DlgAboutVersion : "version",
DlgAboutLicense : "Licensierad under villkoren av GNU Lesser General Public License",
DlgAboutInfo : "För mer information se"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/ja.js
New file
0,0 → 1,501
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: ja.js
* Japanese language file.
*
* File Authors:
* Takashi Yamaguchi (jack@omakase.net)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "ツールバーを隠す",
ToolbarExpand : "ツールバーを表示",
 
// Toolbar Items and Context Menu
Save : "保存",
NewPage : "新しいページ",
Preview : "プレビュー",
Cut : "切り取り",
Copy : "コピー",
Paste : "貼り付け",
PasteText : "プレーンテキスト貼り付け",
PasteWord : "ワード文章から貼り付け",
Print : "印刷",
SelectAll : "すべて選択",
RemoveFormat : "フォーマット削除",
InsertLinkLbl : "リンク",
InsertLink : "リンク挿入/編集",
RemoveLink : "リンク削除",
Anchor : "アンカー挿入/編集",
InsertImageLbl : "イメージ",
InsertImage : "イメージ挿入/編集",
InsertFlashLbl : "Flash",
InsertFlash : "Flash挿入/編集",
InsertTableLbl : "テーブル",
InsertTable : "テーブル挿入/編集",
InsertLineLbl : "ライン",
InsertLine : "横罫線",
InsertSpecialCharLbl: "特殊文字",
InsertSpecialChar : "特殊文字挿入",
InsertSmileyLbl : "絵文字",
InsertSmiley : "絵文字挿入",
About : "FCKeditorヘルプ",
Bold : "太字",
Italic : "斜体",
Underline : "下線",
StrikeThrough : "打ち消し線",
Subscript : "添え字",
Superscript : "上付き文字",
LeftJustify : "左揃え",
CenterJustify : "中央揃え",
RightJustify : "右揃え",
BlockJustify : "両端揃え",
DecreaseIndent : "インデント解除",
IncreaseIndent : "インデント",
Undo : "元に戻す",
Redo : "やり直し",
NumberedListLbl : "段落番号",
NumberedList : "段落番号の追加/削除",
BulletedListLbl : "箇条書き",
BulletedList : "箇条書きの追加/削除",
ShowTableBorders : "テーブルボーダー表示",
ShowDetails : "詳細表示",
Style : "スタイル",
FontFormat : "フォーマット",
Font : "フォント",
FontSize : "サイズ",
TextColor : "テキスト色",
BGColor : "背景色",
Source : "ソース",
Find : "検索",
Replace : "置き換え",
SpellCheck : "スペルチェック",
UniversalKeyboard : "ユニバーサル・キーボード",
PageBreakLbl : "改ページ",
PageBreak : "改ページ挿入",
 
Form : "フォーム",
Checkbox : "チェックボックス",
RadioButton : "ラジオボタン",
TextField : "1行テキスト",
Textarea : "テキストエリア",
HiddenField : "不可視フィールド",
Button : "ボタン",
SelectionField : "選択フィールド",
ImageButton : "画像ボタン",
 
FitWindow : "エディタサイズを最大にします",
 
// Context Menu
EditLink : "リンク編集",
CellCM : "セル",
RowCM : "行",
ColumnCM : "カラム",
InsertRow : "行挿入",
DeleteRows : "行削除",
InsertColumn : "列挿入",
DeleteColumns : "列削除",
InsertCell : "セル挿入",
DeleteCells : "セル削除",
MergeCells : "セル結合",
SplitCell : "セル分割",
TableDelete : "テーブル削除",
CellProperties : "セル プロパティ",
TableProperties : "テーブル プロパティ",
ImageProperties : "イメージ プロパティ",
FlashProperties : "Flash プロパティ",
 
AnchorProp : "アンカー プロパティ",
ButtonProp : "ボタン プロパティ",
CheckboxProp : "チェックボックス プロパティ",
HiddenFieldProp : "不可視フィールド プロパティ",
RadioButtonProp : "ラジオボタン プロパティ",
ImageButtonProp : "画像ボタン プロパティ",
TextFieldProp : "1行テキスト プロパティ",
SelectionFieldProp : "選択フィールド プロパティ",
TextareaProp : "テキストエリア プロパティ",
FormProp : "フォーム プロパティ",
 
FontFormats : "標準;書式付き;アドレス;見出し 1;見出し 2;見出し 3;見出し 4;見出し 5;見出し 6;標準 (DIV)",
 
// Alerts and Messages
ProcessingXHTML : "XHTML処理中. しばらくお待ちください...",
Done : "完了",
PasteWordConfirm : "貼り付けを行うテキストは、ワード文章からコピーされようとしています。貼り付ける前にクリーニングを行いますか?",
NotCompatiblePaste : "このコマンドはインターネット・エクスプローラーバージョン5.5以上で利用可能です。クリーニングしないで貼り付けを行いますか?",
UnknownToolbarItem : "未知のツールバー項目 \"%1\"",
UnknownCommand : "未知のコマンド名 \"%1\"",
NotImplemented : "コマンドはインプリメントされませんでした。",
UnknownToolbarSet : "ツールバー設定 \"%1\" 存在しません。",
NoActiveX : "エラー、警告メッセージなどが発生した場合、ブラウザーのセキュリティ設定によりエディタのいくつかの機能が制限されている可能性があります。セキュリティ設定のオプションで\"ActiveXコントロールとプラグインの実行\"を有効にするにしてください。",
BrowseServerBlocked : "サーバーブラウザーを開くことができませんでした。ポップアップ・ブロック機能が無効になっているか確認してください。",
DialogBlocked : "ダイアログウィンドウを開くことができませんでした。ポップアップ・ブロック機能が無効になっているか確認してください。",
 
// Dialogs
DlgBtnOK : "OK",
DlgBtnCancel : "キャンセル",
DlgBtnClose : "閉じる",
DlgBtnBrowseServer : "サーバーブラウザー",
DlgAdvancedTag : "高度な設定",
DlgOpOther : "<その他>",
DlgInfoTab : "情報",
DlgAlertUrl : "URLを挿入してください",
 
// General Dialogs Labels
DlgGenNotSet : "<なし>",
DlgGenId : "Id",
DlgGenLangDir : "文字表記の方向",
DlgGenLangDirLtr : "左から右 (LTR)",
DlgGenLangDirRtl : "右から左 (RTL)",
DlgGenLangCode : "言語コード",
DlgGenAccessKey : "アクセスキー",
DlgGenName : "Name属性",
DlgGenTabIndex : "タブインデックス",
DlgGenLongDescr : "longdesc属性(長文説明)",
DlgGenClass : "スタイルシートクラス",
DlgGenTitle : "Title属性",
DlgGenContType : "Content Type属性",
DlgGenLinkCharset : "リンクcharset属性",
DlgGenStyle : "スタイルシート",
 
// Image Dialog
DlgImgTitle : "イメージ プロパティ",
DlgImgInfoTab : "イメージ 情報",
DlgImgBtnUpload : "サーバーに送信",
DlgImgURL : "URL",
DlgImgUpload : "アップロード",
DlgImgAlt : "代替テキスト",
DlgImgWidth : "幅",
DlgImgHeight : "高さ",
DlgImgLockRatio : "ロック比率",
DlgBtnResetSize : "サイズリセット",
DlgImgBorder : "ボーダー",
DlgImgHSpace : "横間隔",
DlgImgVSpace : "縦間隔",
DlgImgAlign : "行揃え",
DlgImgAlignLeft : "左",
DlgImgAlignAbsBottom: "下部(絶対的)",
DlgImgAlignAbsMiddle: "中央(絶対的)",
DlgImgAlignBaseline : "ベースライン",
DlgImgAlignBottom : "下",
DlgImgAlignMiddle : "中央",
DlgImgAlignRight : "右",
DlgImgAlignTextTop : "テキスト上部",
DlgImgAlignTop : "上",
DlgImgPreview : "プレビュー",
DlgImgAlertUrl : "イメージのURLを入力してください。",
DlgImgLinkTab : "リンク",
 
// Flash Dialog
DlgFlashTitle : "Flash プロパティ",
DlgFlashChkPlay : "再生",
DlgFlashChkLoop : "ループ再生",
DlgFlashChkMenu : "Flashメニュー可能",
DlgFlashScale : "拡大縮小設定",
DlgFlashScaleAll : "すべて表示",
DlgFlashScaleNoBorder : "外が見えない様に拡大",
DlgFlashScaleFit : "上下左右にフィット",
 
// Link Dialog
DlgLnkWindowTitle : "ハイパーリンク",
DlgLnkInfoTab : "ハイパーリンク 情報",
DlgLnkTargetTab : "ターゲット",
 
DlgLnkType : "リンクタイプ",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "このページのアンカー",
DlgLnkTypeEMail : "E-Mail",
DlgLnkProto : "プロトコル",
DlgLnkProtoOther : "<その他>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "アンカーを選択",
DlgLnkAnchorByName : "アンカー名",
DlgLnkAnchorById : "エレメントID",
DlgLnkNoAnchors : "<ドキュメントにおいて利用可能なアンカーはありません。>",
DlgLnkEMail : "E-Mail アドレス",
DlgLnkEMailSubject : "件名",
DlgLnkEMailBody : "本文",
DlgLnkUpload : "アップロード",
DlgLnkBtnUpload : "サーバーに送信",
 
DlgLnkTarget : "ターゲット",
DlgLnkTargetFrame : "<フレーム>",
DlgLnkTargetPopup : "<ポップアップウィンドウ>",
DlgLnkTargetBlank : "新しいウィンドウ (_blank)",
DlgLnkTargetParent : "親ウィンドウ (_parent)",
DlgLnkTargetSelf : "同じウィンドウ (_self)",
DlgLnkTargetTop : "最上位ウィンドウ (_top)",
DlgLnkTargetFrameName : "目的のフレーム名",
DlgLnkPopWinName : "ポップアップウィンドウ名",
DlgLnkPopWinFeat : "ポップアップウィンドウ特徴",
DlgLnkPopResize : "リサイズ可能",
DlgLnkPopLocation : "ロケーションバー",
DlgLnkPopMenu : "メニューバー",
DlgLnkPopScroll : "スクロールバー",
DlgLnkPopStatus : "ステータスバー",
DlgLnkPopToolbar : "ツールバー",
DlgLnkPopFullScrn : "全画面モード(IE)",
DlgLnkPopDependent : "開いたウィンドウに連動して閉じる (Netscape)",
DlgLnkPopWidth : "幅",
DlgLnkPopHeight : "高さ",
DlgLnkPopLeft : "左端からの座標で指定",
DlgLnkPopTop : "上端からの座標で指定",
 
DlnLnkMsgNoUrl : "リンクURLを入力してください。",
DlnLnkMsgNoEMail : "メールアドレスを入力してください。",
DlnLnkMsgNoAnchor : "アンカーを選択してください。",
DlnLnkMsgInvPopName : "ポップ・アップ名は英字で始まる文字で指定してくだい。ポップ・アップ名にスペースは含めません",
 
// Color Dialog
DlgColorTitle : "色選択",
DlgColorBtnClear : "クリア",
DlgColorHighlight : "ハイライト",
DlgColorSelected : "選択色",
 
// Smiley Dialog
DlgSmileyTitle : "顔文字挿入",
 
// Special Character Dialog
DlgSpecialCharTitle : "特殊文字選択",
 
// Table Dialog
DlgTableTitle : "テーブル プロパティ",
DlgTableRows : "行",
DlgTableColumns : "列",
DlgTableBorder : "ボーダーサイズ",
DlgTableAlign : "キャプションの整列",
DlgTableAlignNotSet : "<なし>",
DlgTableAlignLeft : "左",
DlgTableAlignCenter : "中央",
DlgTableAlignRight : "右",
DlgTableWidth : "テーブル幅",
DlgTableWidthPx : "ピクセル",
DlgTableWidthPc : "パーセント",
DlgTableHeight : "テーブル高さ",
DlgTableCellSpace : "セル内余白",
DlgTableCellPad : "セル内間隔",
DlgTableCaption : "キャプション",
DlgTableSummary : "テーブル目的/構造",
 
// Table Cell Dialog
DlgCellTitle : "セル プロパティ",
DlgCellWidth : "幅",
DlgCellWidthPx : "ピクセル",
DlgCellWidthPc : "パーセント",
DlgCellHeight : "高さ",
DlgCellWordWrap : "折り返し",
DlgCellWordWrapNotSet : "<なし>",
DlgCellWordWrapYes : "Yes",
DlgCellWordWrapNo : "No",
DlgCellHorAlign : "セル横の整列",
DlgCellHorAlignNotSet : "<なし>",
DlgCellHorAlignLeft : "左",
DlgCellHorAlignCenter : "中央",
DlgCellHorAlignRight: "右",
DlgCellVerAlign : "セル縦の整列",
DlgCellVerAlignNotSet : "<なし>",
DlgCellVerAlignTop : "上",
DlgCellVerAlignMiddle : "中央",
DlgCellVerAlignBottom : "下",
DlgCellVerAlignBaseline : "ベースライン",
DlgCellRowSpan : "縦幅(行数)",
DlgCellCollSpan : "横幅(列数)",
DlgCellBackColor : "背景色",
DlgCellBorderColor : "ボーダーカラー",
DlgCellBtnSelect : "選択...",
 
// Find Dialog
DlgFindTitle : "検索",
DlgFindFindBtn : "検索",
DlgFindNotFoundMsg : "指定された文字列は見つかりませんでした。",
 
// Replace Dialog
DlgReplaceTitle : "置き換え",
DlgReplaceFindLbl : "検索する文字列:",
DlgReplaceReplaceLbl : "置換えする文字列:",
DlgReplaceCaseChk : "部分一致",
DlgReplaceReplaceBtn : "置換え",
DlgReplaceReplAllBtn : "すべて置換え",
DlgReplaceWordChk : "単語単位で一致",
 
// Paste Operations / Dialog
PasteErrorPaste : "ブラウザーのセキュリティ設定によりエディタの貼り付け操作が自動で実行することができません。実行するには手動でキーボードの(Ctrl+V)を使用してください。",
PasteErrorCut : "ブラウザーのセキュリティ設定によりエディタの切り取り操作が自動で実行することができません。実行するには手動でキーボードの(Ctrl+X)を使用してください。",
PasteErrorCopy : "ブラウザーのセキュリティ設定によりエディタのコピー操作が自動で実行することができません。実行するには手動でキーボードの(Ctrl+C)を使用してください。",
 
PasteAsText : "プレーンテキスト貼り付け",
PasteFromWord : "ワード文章から貼り付け",
 
DlgPasteMsg2 : "キーボード(<STRONG>Ctrl+V</STRONG>)を使用して、次の入力エリア内で貼って、<STRONG>OK</STRONG>を押してください。",
DlgPasteIgnoreFont : "FontタグのFace属性を無視します。",
DlgPasteRemoveStyles : "スタイル定義を削除します。",
DlgPasteCleanBox : "入力エリアクリア",
 
// Color Picker
ColorAutomatic : "自動",
ColorMoreColors : "その他の色...",
 
// Document Properties
DocProps : "文書 プロパティ",
 
// Anchor Dialog
DlgAnchorTitle : "アンカー プロパティ",
DlgAnchorName : "アンカー名",
DlgAnchorErrorName : "アンカー名を必ず入力してください。",
 
// Speller Pages Dialog
DlgSpellNotInDic : "辞書にありません",
DlgSpellChangeTo : "変更",
DlgSpellBtnIgnore : "無視",
DlgSpellBtnIgnoreAll : "すべて無視",
DlgSpellBtnReplace : "置換",
DlgSpellBtnReplaceAll : "すべて置換",
DlgSpellBtnUndo : "やり直し",
DlgSpellNoSuggestions : "- 該当なし -",
DlgSpellProgress : "スペルチェック処理中...",
DlgSpellNoMispell : "スペルチェック完了: スペルの誤りはありませんでした",
DlgSpellNoChanges : "スペルチェック完了: 語句は変更されませんでした",
DlgSpellOneChange : "スペルチェック完了: 1語句変更されました",
DlgSpellManyChanges : "スペルチェック完了: %1 語句変更されました",
 
IeSpellDownload : "スペルチェッカーがインストールされていません。今すぐダウンロードしますか?",
 
// Button Dialog
DlgButtonText : "テキスト (値)",
DlgButtonType : "タイプ",
DlgButtonTypeBtn : "ボタン",
DlgButtonTypeSbm : "送信",
DlgButtonTypeRst : "リセット",
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "名前",
DlgCheckboxValue : "値",
DlgCheckboxSelected : "選択済み",
 
// Form Dialog
DlgFormName : "フォーム名",
DlgFormAction : "アクション",
DlgFormMethod : "メソッド",
 
// Select Field Dialog
DlgSelectName : "名前",
DlgSelectValue : "値",
DlgSelectSize : "サイズ",
DlgSelectLines : "行",
DlgSelectChkMulti : "複数項目選択を許可",
DlgSelectOpAvail : "利用可能なオプション",
DlgSelectOpText : "選択項目名",
DlgSelectOpValue : "選択項目値",
DlgSelectBtnAdd : "追加",
DlgSelectBtnModify : "編集",
DlgSelectBtnUp : "上へ",
DlgSelectBtnDown : "下へ",
DlgSelectBtnSetValue : "選択した値を設定",
DlgSelectBtnDelete : "削除",
 
// Textarea Dialog
DlgTextareaName : "名前",
DlgTextareaCols : "列",
DlgTextareaRows : "行",
 
// Text Field Dialog
DlgTextName : "名前",
DlgTextValue : "値",
DlgTextCharWidth : "サイズ",
DlgTextMaxChars : "最大長",
DlgTextType : "タイプ",
DlgTextTypeText : "テキスト",
DlgTextTypePass : "パスワード入力",
 
// Hidden Field Dialog
DlgHiddenName : "名前",
DlgHiddenValue : "値",
 
// Bulleted List Dialog
BulletedListProp : "箇条書き プロパティ",
NumberedListProp : "段落番号 プロパティ",
DlgLstStart : "開始文字",
DlgLstType : "タイプ",
DlgLstTypeCircle : "白丸",
DlgLstTypeDisc : "黒丸",
DlgLstTypeSquare : "四角",
DlgLstTypeNumbers : "アラビア数字 (1, 2, 3)",
DlgLstTypeLCase : "英字小文字 (a, b, c)",
DlgLstTypeUCase : "英字大文字 (A, B, C)",
DlgLstTypeSRoman : "ローマ数字小文字 (i, ii, iii)",
DlgLstTypeLRoman : "ローマ数字大文字 (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "全般",
DlgDocBackTab : "背景",
DlgDocColorsTab : "色とマージン",
DlgDocMetaTab : "メタデータ",
 
DlgDocPageTitle : "ページタイトル",
DlgDocLangDir : "言語文字表記の方向",
DlgDocLangDirLTR : "左から右に表記(LTR)",
DlgDocLangDirRTL : "右から左に表記(RTL)",
DlgDocLangCode : "言語コード",
DlgDocCharSet : "文字セット符号化",
DlgDocCharSetCE : "Central European",
DlgDocCharSetCT : "Chinese Traditional (Big5)",
DlgDocCharSetCR : "Cyrillic",
DlgDocCharSetGR : "Greek",
DlgDocCharSetJP : "Japanese",
DlgDocCharSetKR : "Korean",
DlgDocCharSetTR : "Turkish",
DlgDocCharSetUN : "Unicode (UTF-8)",
DlgDocCharSetWE : "Western European",
DlgDocCharSetOther : "他の文字セット符号化",
 
DlgDocDocType : "文書タイプヘッダー",
DlgDocDocTypeOther : "その他文書タイプヘッダー",
DlgDocIncXHTML : "XHTML宣言をインクルード",
DlgDocBgColor : "背景色",
DlgDocBgImage : "背景画像 URL",
DlgDocBgNoScroll : "スクロールしない背景",
DlgDocCText : "テキスト",
DlgDocCLink : "リンク",
DlgDocCVisited : "アクセス済みリンク",
DlgDocCActive : "アクセス中リンク",
DlgDocMargins : "ページ・マージン",
DlgDocMaTop : "上部",
DlgDocMaLeft : "左",
DlgDocMaRight : "右",
DlgDocMaBottom : "下部",
DlgDocMeIndex : "文書のキーワード(カンマ区切り)",
DlgDocMeDescr : "文書の概要",
DlgDocMeAuthor : "文書の作者",
DlgDocMeCopy : "文書の著作権",
DlgDocPreview : "プレビュー",
 
// Templates Dialog
Templates : "テンプレート(雛形)",
DlgTemplatesTitle : "テンプレート内容",
DlgTemplatesSelMsg : "エディターで使用するテンプレートを選択してください。<br>(現在のエディタの内容は失われます):",
DlgTemplatesLoading : "テンプレート一覧読み込み中. しばらくお待ちください...",
DlgTemplatesNoTpl : "(テンプレートが定義されていません)",
DlgTemplatesReplace : "現在のエディタの内容と置換えをします",
 
// About Dialog
DlgAboutAboutTab : "バージョン情報",
DlgAboutBrowserInfoTab : "ブラウザ情報",
DlgAboutLicenseTab : "ライセンス",
DlgAboutVersion : "バージョン",
DlgAboutLicense : "Licensed under the terms of the GNU Lesser General Public License",
DlgAboutInfo : "より詳しい情報はこちらで"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/he.js
New file
0,0 → 1,502
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: he.js
* Hebrew language file.
*
* File Authors:
* Tamir Mordo (tamir@tetitu.co.il)
* Ophir Radnitz (ophir@liqweed.net)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "rtl",
 
ToolbarCollapse : "כיווץ סרגל הכלים",
ToolbarExpand : "פתיחת סרגל הכלים",
 
// Toolbar Items and Context Menu
Save : "שמירה",
NewPage : "דף חדש",
Preview : "תצוגה מקדימה",
Cut : "גזירה",
Copy : "העתקה",
Paste : "הדבקה",
PasteText : "הדבקה כטקסט פשוט",
PasteWord : "הדבקה מ-וורד",
Print : "הדפסה",
SelectAll : "בחירת הכל",
RemoveFormat : "הסרת העיצוב",
InsertLinkLbl : "קישור",
InsertLink : "הוספת/עריכת קישור",
RemoveLink : "הסרת הקישור",
Anchor : "הוספת/עריכת נקודת עיגון",
InsertImageLbl : "תמונה",
InsertImage : "הוספת/עריכת תמונה",
InsertFlashLbl : "פלאש",
InsertFlash : "הוסף/ערוך פלאש",
InsertTableLbl : "טבלה",
InsertTable : "הוספת/עריכת טבלה",
InsertLineLbl : "קו",
InsertLine : "הוספת קו אופקי",
InsertSpecialCharLbl: "תו מיוחד",
InsertSpecialChar : "הוספת תו מיוחד",
InsertSmileyLbl : "סמיילי",
InsertSmiley : "הוספת סמיילי",
About : "אודות FCKeditor",
Bold : "מודגש",
Italic : "נטוי",
Underline : "קו תחתון",
StrikeThrough : "כתיב מחוק",
Subscript : "כתיב תחתון",
Superscript : "כתיב עליון",
LeftJustify : "יישור לשמאל",
CenterJustify : "מרכוז",
RightJustify : "יישור לימין",
BlockJustify : "יישור לשוליים",
DecreaseIndent : "הקטנת אינדנטציה",
IncreaseIndent : "הגדלת אינדנטציה",
Undo : "ביטול צעד אחרון",
Redo : "חזרה על צעד אחרון",
NumberedListLbl : "רשימה ממוספרת",
NumberedList : "הוספת/הסרת רשימה ממוספרת",
BulletedListLbl : "רשימת נקודות",
BulletedList : "הוספת/הסרת רשימת נקודות",
ShowTableBorders : "הצגת מסגרת הטבלה",
ShowDetails : "הצגת פרטים",
Style : "סגנון",
FontFormat : "עיצוב",
Font : "גופן",
FontSize : "גודל",
TextColor : "צבע טקסט",
BGColor : "צבע רקע",
Source : "מקור",
Find : "חיפוש",
Replace : "החלפה",
SpellCheck : "בדיקת איות",
UniversalKeyboard : "מקלדת אוניברסלית",
PageBreakLbl : "שבירת דף",
PageBreak : "הוסף שבירת דף",
 
Form : "טופס",
Checkbox : "תיבת סימון",
RadioButton : "לחצן אפשרויות",
TextField : "שדה טקסט",
Textarea : "איזור טקסט",
HiddenField : "שדה חבוי",
Button : "כפתור",
SelectionField : "שדה בחירה",
ImageButton : "כפתור תמונה",
 
FitWindow : "הגדל את גודל העורך",
 
// Context Menu
EditLink : "עריכת קישור",
CellCM : "תא",
RowCM : "שורה",
ColumnCM : "עמודה",
InsertRow : "הוספת שורה",
DeleteRows : "מחיקת שורות",
InsertColumn : "הוספת עמודה",
DeleteColumns : "מחיקת עמודות",
InsertCell : "הוספת תא",
DeleteCells : "מחיקת תאים",
MergeCells : "מיזוג תאים",
SplitCell : "פיצול תאים",
TableDelete : "מחק טבלה",
CellProperties : "תכונות התא",
TableProperties : "תכונות הטבלה",
ImageProperties : "תכונות התמונה",
FlashProperties : "מאפייני פלאש",
 
AnchorProp : "מאפייני נקודת עיגון",
ButtonProp : "מאפייני כפתור",
CheckboxProp : "מאפייני תיבת סימון",
HiddenFieldProp : "מאפיני שדה חבוי",
RadioButtonProp : "מאפייני לחצן אפשרויות",
ImageButtonProp : "מאפיני כפתור תמונה",
TextFieldProp : "מאפייני שדה טקסט",
SelectionFieldProp : "מאפייני שדה בחירה",
TextareaProp : "מאפיני איזור טקסט",
FormProp : "מאפיני טופס",
 
FontFormats : "נורמלי;קוד;כתובת;כותרת;כותרת 2;כותרת 3;כותרת 4;כותרת 5;כותרת 6",
 
// Alerts and Messages
ProcessingXHTML : "מעבד XHTML, נא להמתין...",
Done : "המשימה הושלמה",
PasteWordConfirm : "נראה הטקסט שבכוונתך להדביק מקורו בקובץ וורד. האם ברצונך לנקות אותו טרם ההדבקה?",
NotCompatiblePaste : "פעולה זו זמינה לדפדפן אינטרנט אקספלורר מגירסא 5.5 ומעלה. האם להמשיך בהדבקה ללא הניקוי?",
UnknownToolbarItem : "פריט לא ידוע בסרגל הכלים \"%1\"",
UnknownCommand : "שם פעולה לא ידוע \"%1\"",
NotImplemented : "הפקודה לא מיושמת",
UnknownToolbarSet : "ערכת סרגל הכלים \"%1\" לא קיימת",
NoActiveX : "הגדרות אבטחה של הדפדפן עלולות לגביל את אפשרויות העריכה.יש לאפשר את האופציה \"הרץ פקדים פעילים ותוספות\". תוכל לחוות טעויות וחיווים של אפשרויות שחסרים.",
BrowseServerBlocked : "לא ניתן לגשת לדפדפן משאבים.אנא וודא שחוסם חלונות הקופצים לא פעיל.",
DialogBlocked : "לא היה ניתן לפתוח חלון דיאלוג. אנא וודא שחוסם חלונות קופצים לא פעיל.",
 
// Dialogs
DlgBtnOK : "אישור",
DlgBtnCancel : "ביטול",
DlgBtnClose : "סגירה",
DlgBtnBrowseServer : "סייר השרת",
DlgAdvancedTag : "אפשרויות מתקדמות",
DlgOpOther : "<אחר>",
DlgInfoTab : "מידע",
DlgAlertUrl : "אנה הזן URL",
 
// General Dialogs Labels
DlgGenNotSet : "<לא נקבע>",
DlgGenId : "זיהוי (Id)",
DlgGenLangDir : "כיוון שפה",
DlgGenLangDirLtr : "שמאל לימין (LTR)",
DlgGenLangDirRtl : "ימין לשמאל (RTL)",
DlgGenLangCode : "קוד שפה",
DlgGenAccessKey : "מקש גישה",
DlgGenName : "שם",
DlgGenTabIndex : "מספר טאב",
DlgGenLongDescr : "קישור לתיאור מפורט",
DlgGenClass : "גיליונות עיצוב קבוצות",
DlgGenTitle : "כותרת מוצעת",
DlgGenContType : "Content Type מוצע",
DlgGenLinkCharset : "קידוד המשאב המקושר",
DlgGenStyle : "סגנון",
 
// Image Dialog
DlgImgTitle : "תכונות התמונה",
DlgImgInfoTab : "מידע על התמונה",
DlgImgBtnUpload : "שליחה לשרת",
DlgImgURL : "כתובת (URL)",
DlgImgUpload : "העלאה",
DlgImgAlt : "טקסט חלופי",
DlgImgWidth : "רוחב",
DlgImgHeight : "גובה",
DlgImgLockRatio : "נעילת היחס",
DlgBtnResetSize : "איפוס הגודל",
DlgImgBorder : "מסגרת",
DlgImgHSpace : "מרווח אופקי",
DlgImgVSpace : "מרווח אנכי",
DlgImgAlign : "יישור",
DlgImgAlignLeft : "לשמאל",
DlgImgAlignAbsBottom: "לתחתית האבסולוטית",
DlgImgAlignAbsMiddle: "מרכוז אבסולוטי",
DlgImgAlignBaseline : "לקו התחתית",
DlgImgAlignBottom : "לתחתית",
DlgImgAlignMiddle : "לאמצע",
DlgImgAlignRight : "לימין",
DlgImgAlignTextTop : "לראש הטקסט",
DlgImgAlignTop : "למעלה",
DlgImgPreview : "תצוגה מקדימה",
DlgImgAlertUrl : "נא להקליד את כתובת התמונה",
DlgImgLinkTab : "קישור",
 
// Flash Dialog
DlgFlashTitle : "מאפיני פלאש",
DlgFlashChkPlay : "נגן אוטומטי",
DlgFlashChkLoop : "לולאה",
DlgFlashChkMenu : "אפשר תפריט פלאש",
DlgFlashScale : "גודל",
DlgFlashScaleAll : "הצג הכל",
DlgFlashScaleNoBorder : "ללא גבולות",
DlgFlashScaleFit : "התאמה מושלמת",
 
// Link Dialog
DlgLnkWindowTitle : "קישור",
DlgLnkInfoTab : "מידע על הקישור",
DlgLnkTargetTab : "מטרה",
 
DlgLnkType : "סוג קישור",
DlgLnkTypeURL : "כתובת (URL)",
DlgLnkTypeAnchor : "עוגן בעמוד זה",
DlgLnkTypeEMail : "דוא''ל",
DlgLnkProto : "פרוטוקול",
DlgLnkProtoOther : "<אחר>",
DlgLnkURL : "כתובת (URL)",
DlgLnkAnchorSel : "בחירת עוגן",
DlgLnkAnchorByName : "עפ''י שם העוגן",
DlgLnkAnchorById : "עפ''י זיהוי (Id) הרכיב",
DlgLnkNoAnchors : "<אין עוגנים זמינים בדף>",
DlgLnkEMail : "כתובת הדוא''ל",
DlgLnkEMailSubject : "נושא ההודעה",
DlgLnkEMailBody : "גוף ההודעה",
DlgLnkUpload : "העלאה",
DlgLnkBtnUpload : "שליחה לשרת",
 
DlgLnkTarget : "מטרה",
DlgLnkTargetFrame : "<מסגרת>",
DlgLnkTargetPopup : "<חלון קופץ>",
DlgLnkTargetBlank : "חלון חדש (_blank)",
DlgLnkTargetParent : "חלון האב (_parent)",
DlgLnkTargetSelf : "באותו החלון (_self)",
DlgLnkTargetTop : "חלון ראשי (_top)",
DlgLnkTargetFrameName : "שם מסגרת היעד",
DlgLnkPopWinName : "שם החלון הקופץ",
DlgLnkPopWinFeat : "תכונות החלון הקופץ",
DlgLnkPopResize : "בעל גודל ניתן לשינוי",
DlgLnkPopLocation : "סרגל כתובת",
DlgLnkPopMenu : "סרגל תפריט",
DlgLnkPopScroll : "ניתן לגלילה",
DlgLnkPopStatus : "סרגל חיווי",
DlgLnkPopToolbar : "סרגל הכלים",
DlgLnkPopFullScrn : "מסך מלא (IE)",
DlgLnkPopDependent : "תלוי (Netscape)",
DlgLnkPopWidth : "רוחב",
DlgLnkPopHeight : "גובה",
DlgLnkPopLeft : "מיקום צד שמאל",
DlgLnkPopTop : "מיקום צד עליון",
 
DlnLnkMsgNoUrl : "נא להקליד את כתובת הקישור (URL)",
DlnLnkMsgNoEMail : "נא להקליד את כתובת הדוא''ל",
DlnLnkMsgNoAnchor : "נא לבחור עוגן במסמך",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "בחירת צבע",
DlgColorBtnClear : "איפוס",
DlgColorHighlight : "נוכחי",
DlgColorSelected : "נבחר",
 
// Smiley Dialog
DlgSmileyTitle : "הוספת סמיילי",
 
// Special Character Dialog
DlgSpecialCharTitle : "בחירת תו מיוחד",
 
// Table Dialog
DlgTableTitle : "תכונות טבלה",
DlgTableRows : "שורות",
DlgTableColumns : "עמודות",
DlgTableBorder : "גודל מסגרת",
DlgTableAlign : "יישור",
DlgTableAlignNotSet : "<לא נקבע>",
DlgTableAlignLeft : "שמאל",
DlgTableAlignCenter : "מרכז",
DlgTableAlignRight : "ימין",
DlgTableWidth : "רוחב",
DlgTableWidthPx : "פיקסלים",
DlgTableWidthPc : "אחוז",
DlgTableHeight : "גובה",
DlgTableCellSpace : "מרווח תא",
DlgTableCellPad : "ריפוד תא",
DlgTableCaption : "כיתוב",
DlgTableSummary : "סיכום",
 
// Table Cell Dialog
DlgCellTitle : "תכונות תא",
DlgCellWidth : "רוחב",
DlgCellWidthPx : "פיקסלים",
DlgCellWidthPc : "אחוז",
DlgCellHeight : "גובה",
DlgCellWordWrap : "גלילת שורות",
DlgCellWordWrapNotSet : "<לא נקבע>",
DlgCellWordWrapYes : "כן",
DlgCellWordWrapNo : "לא",
DlgCellHorAlign : "יישור אופקי",
DlgCellHorAlignNotSet : "<לא נקבע>",
DlgCellHorAlignLeft : "שמאל",
DlgCellHorAlignCenter : "מרכז",
DlgCellHorAlignRight: "ימין",
DlgCellVerAlign : "יישור אנכי",
DlgCellVerAlignNotSet : "<לא נקבע>",
DlgCellVerAlignTop : "למעלה",
DlgCellVerAlignMiddle : "לאמצע",
DlgCellVerAlignBottom : "לתחתית",
DlgCellVerAlignBaseline : "קו תחתית",
DlgCellRowSpan : "טווח שורות",
DlgCellCollSpan : "טווח עמודות",
DlgCellBackColor : "צבע רקע",
DlgCellBorderColor : "צבע מסגרת",
DlgCellBtnSelect : "בחירה...",
 
// Find Dialog
DlgFindTitle : "חיפוש",
DlgFindFindBtn : "חיפוש",
DlgFindNotFoundMsg : "הטקסט המבוקש לא נמצא.",
 
// Replace Dialog
DlgReplaceTitle : "החלפה",
DlgReplaceFindLbl : "חיפוש מחרוזת:",
DlgReplaceReplaceLbl : "החלפה במחרוזת:",
DlgReplaceCaseChk : "התאמת סוג אותיות (Case)",
DlgReplaceReplaceBtn : "החלפה",
DlgReplaceReplAllBtn : "החלפה בכל העמוד",
DlgReplaceWordChk : "התאמה למילה המלאה",
 
// Paste Operations / Dialog
PasteErrorPaste : "הגדרות האבטחה בדפדפן שלך לא מאפשרות לעורך לבצע פעולות הדבקה אוטומטיות. יש להשתמש במקלדת לשם כך (Ctrl+V).",
PasteErrorCut : "הגדרות האבטחה בדפדפן שלך לא מאפשרות לעורך לבצע פעולות גזירה אוטומטיות. יש להשתמש במקלדת לשם כך (Ctrl+X).",
PasteErrorCopy : "הגדרות האבטחה בדפדפן שלך לא מאפשרות לעורך לבצע פעולות העתקה אוטומטיות. יש להשתמש במקלדת לשם כך (Ctrl+C).",
 
PasteAsText : "הדבקה כטקסט פשוט",
PasteFromWord : "הדבקה מ-וורד",
 
DlgPasteMsg2 : "אנא הדבק בתוך הקופסה באמצעות (<STRONG>Ctrl+V</STRONG>) ולחץ על <STRONG>אישור</STRONG>.",
DlgPasteIgnoreFont : "התעלם מהגדרות סוג פונט",
DlgPasteRemoveStyles : "הסר הגדרות סגנון",
DlgPasteCleanBox : "ניקוי קופסה",
 
// Color Picker
ColorAutomatic : "אוטומטי",
ColorMoreColors : "צבעים נוספים...",
 
// Document Properties
DocProps : "מאפיני מסמך",
 
// Anchor Dialog
DlgAnchorTitle : "מאפיני נקודת עיגון",
DlgAnchorName : "שם לנקודת עיגון",
DlgAnchorErrorName : "אנא הזן שם לנקודת עיגון",
 
// Speller Pages Dialog
DlgSpellNotInDic : "לא נמצא במילון",
DlgSpellChangeTo : "שנה ל",
DlgSpellBtnIgnore : "התעלם",
DlgSpellBtnIgnoreAll : "התעלם מהכל",
DlgSpellBtnReplace : "החלף",
DlgSpellBtnReplaceAll : "החלף הכל",
DlgSpellBtnUndo : "החזר",
DlgSpellNoSuggestions : "- אין הצעות -",
DlgSpellProgress : "בדיקות איות בתהליך ....",
DlgSpellNoMispell : "בדיקות איות הסתיימה: לא נמצאו שגיעות כתיב",
DlgSpellNoChanges : "בדיקות איות הסתיימה: לא שונתה אף מילה",
DlgSpellOneChange : "בדיקות איות הסתיימה: שונתה מילה אחת",
DlgSpellManyChanges : "בדיקות איות הסתיימה: %1 מילים שונו",
 
IeSpellDownload : "בודק האיות לא מותקן, האם אתה מעוניין להוריד?",
 
// Button Dialog
DlgButtonText : "טקסט (ערך)",
DlgButtonType : "סוג",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "שם",
DlgCheckboxValue : "ערך",
DlgCheckboxSelected : "בחור",
 
// Form Dialog
DlgFormName : "שם",
DlgFormAction : "שלח אל",
DlgFormMethod : "סוג שליחה",
 
// Select Field Dialog
DlgSelectName : "שם",
DlgSelectValue : "ערך",
DlgSelectSize : "גודל",
DlgSelectLines : "שורות",
DlgSelectChkMulti : "אפשר בחירות מרובות",
DlgSelectOpAvail : "אפשרויות זמינות",
DlgSelectOpText : "טקסט",
DlgSelectOpValue : "ערך",
DlgSelectBtnAdd : "הוסף",
DlgSelectBtnModify : "שנה",
DlgSelectBtnUp : "למעלה",
DlgSelectBtnDown : "למטה",
DlgSelectBtnSetValue : "קבע כברירת מחדל",
DlgSelectBtnDelete : "מחק",
 
// Textarea Dialog
DlgTextareaName : "שם",
DlgTextareaCols : "עמודות",
DlgTextareaRows : "שורות",
 
// Text Field Dialog
DlgTextName : "שם",
DlgTextValue : "ערך",
DlgTextCharWidth : "רוחב באותיות",
DlgTextMaxChars : "מקסימות אותיות",
DlgTextType : "סוג",
DlgTextTypeText : "טקסט",
DlgTextTypePass : "סיסמה",
 
// Hidden Field Dialog
DlgHiddenName : "שם",
DlgHiddenValue : "ערך",
 
// Bulleted List Dialog
BulletedListProp : "מאפייני רשימה",
NumberedListProp : "מאפייני רשימה ממוספרת",
DlgLstStart : "Start", //MISSING
DlgLstType : "סוג",
DlgLstTypeCircle : "עיגול",
DlgLstTypeDisc : "דיסק",
DlgLstTypeSquare : "מרובע",
DlgLstTypeNumbers : "מספרים (1, 2, 3)",
DlgLstTypeLCase : "אותיות קטנות (a, b, c)",
DlgLstTypeUCase : "אותיות גדולות (A, B, C)",
DlgLstTypeSRoman : "ספרות רומאיות קטנות (i, ii, iii)",
DlgLstTypeLRoman : "ספרות רומאיות גדולות (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "כללי",
DlgDocBackTab : "רקע",
DlgDocColorsTab : "צבעים וגבולות",
DlgDocMetaTab : "נתוני META",
 
DlgDocPageTitle : "כותרת דף",
DlgDocLangDir : "כיוון שפה",
DlgDocLangDirLTR : "שמאל לימין (LTR)",
DlgDocLangDirRTL : "ימין לשמאל (RTL)",
DlgDocLangCode : "קוד שפה",
DlgDocCharSet : "קידוד אותיות",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "קידוד אותיות אחר",
 
DlgDocDocType : "הגדרות סוג מסמך",
DlgDocDocTypeOther : "הגדרות סוג מסמך אחרות",
DlgDocIncXHTML : "כלול הגדרות XHTML",
DlgDocBgColor : "צבע רקע",
DlgDocBgImage : "URL לתמונת רקע",
DlgDocBgNoScroll : "רגע ללא גלילה",
DlgDocCText : "טקסט",
DlgDocCLink : "קישור",
DlgDocCVisited : "קישור שבוקר",
DlgDocCActive : " קישור פעיל",
DlgDocMargins : "גבולות דף",
DlgDocMaTop : "למעלה",
DlgDocMaLeft : "שמאלה",
DlgDocMaRight : "ימינה",
DlgDocMaBottom : "למטה",
DlgDocMeIndex : "מפתח עניינים של המסמך )מופרד בפסיק(",
DlgDocMeDescr : "תאור מסמך",
DlgDocMeAuthor : "מחבר",
DlgDocMeCopy : "זכויות יוצרים",
DlgDocPreview : "תצוגה מקדימה",
 
// Templates Dialog
Templates : "תבניות",
DlgTemplatesTitle : "תביות תוכן",
DlgTemplatesSelMsg : "אנא בחר תבנית לפתיחה בעורך <BR>התוכן המקורי ימחק:",
DlgTemplatesLoading : "מעלה רשימת תבניות אנא המתן",
DlgTemplatesNoTpl : "(לא הוגדרו תבניות)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "אודות",
DlgAboutBrowserInfoTab : "גירסת דפדפן",
DlgAboutLicenseTab : "רשיון",
DlgAboutVersion : "גירסא",
DlgAboutLicense : "ברשיון תחת תנאי GNU Lesser General Public License",
DlgAboutInfo : "מידע נוסף ניתן למצוא כאן:"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/fi.js
New file
0,0 → 1,501
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fi.js
* Finnish language file.
*
* File Authors:
* Marko Korhonen (marko.korhonen@datafisher.com)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Piilota työkalurivi",
ToolbarExpand : "Näytä työkalurivi",
 
// Toolbar Items and Context Menu
Save : "Tallenna",
NewPage : "Tyhjennä",
Preview : "Esikatsele",
Cut : "Leikkaa",
Copy : "Kopioi",
Paste : "Liitä",
PasteText : "Liitä tekstinä",
PasteWord : "Liitä Wordista",
Print : "Tulosta",
SelectAll : "Valitse kaikki",
RemoveFormat : "Poista muotoilu",
InsertLinkLbl : "Linkki",
InsertLink : "Lisää linkki/muokkaa linkkiä",
RemoveLink : "Poista linkki",
Anchor : "Lisää ankkuri/muokkaa ankkuria",
InsertImageLbl : "Kuva",
InsertImage : "Lisää kuva/muokkaa kuvaa",
InsertFlashLbl : "Flash",
InsertFlash : "Lisää/muokkaa Flashia",
InsertTableLbl : "Taulu",
InsertTable : "Lisää taulu/muokkaa taulua",
InsertLineLbl : "Murtoviiva",
InsertLine : "Lisää murtoviiva",
InsertSpecialCharLbl: "Erikoismerkki",
InsertSpecialChar : "Lisää erikoismerkki",
InsertSmileyLbl : "Hymiö",
InsertSmiley : "Lisää hymiö",
About : "FCKeditorista",
Bold : "Lihavoitu",
Italic : "Kursivoitu",
Underline : "Alleviivattu",
StrikeThrough : "Yliviivattu",
Subscript : "Alaindeksi",
Superscript : "Yläindeksi",
LeftJustify : "Tasaa vasemmat reunat",
CenterJustify : "Keskitä",
RightJustify : "Tasaa oikeat reunat",
BlockJustify : "Tasaa molemmat reunat",
DecreaseIndent : "Pienennä sisennystä",
IncreaseIndent : "Suurenna sisennystä",
Undo : "Kumoa",
Redo : "Toista",
NumberedListLbl : "Numerointi",
NumberedList : "Lisää/poista numerointi",
BulletedListLbl : "Luottelomerkit",
BulletedList : "Lisää/poista luottelomerkit",
ShowTableBorders : "Näytä taulun rajat",
ShowDetails : "Näytä muotoilu",
Style : "Tyyli",
FontFormat : "Muotoilu",
Font : "Fontti",
FontSize : "Koko",
TextColor : "Tekstiväri",
BGColor : "Taustaväri",
Source : "Koodi",
Find : "Etsi",
Replace : "Korvaa",
SpellCheck : "Tarkista oikeinkirjoitus",
UniversalKeyboard : "Universaali näppäimistö",
PageBreakLbl : "Sivun vaihto",
PageBreak : "Lisää sivun vaihto",
 
Form : "Lomake",
Checkbox : "Valintaruutu",
RadioButton : "Radiopainike",
TextField : "Tekstikenttä",
Textarea : "Tekstilaatikko",
HiddenField : "Piilokenttä",
Button : "Painike",
SelectionField : "Valintakenttä",
ImageButton : "Kuvapainike",
 
FitWindow : "Suurenna editori koko ikkunaan",
 
// Context Menu
EditLink : "Muokkaa linkkiä",
CellCM : "Solu",
RowCM : "Rivi",
ColumnCM : "Sarake",
InsertRow : "Lisää rivi",
DeleteRows : "Poista rivit",
InsertColumn : "Lisää sarake",
DeleteColumns : "Poista sarakkeet",
InsertCell : "Lisää solu",
DeleteCells : "Poista solut",
MergeCells : "Yhdistä solut",
SplitCell : "Jaa solu",
TableDelete : "Poista taulu",
CellProperties : "Solun ominaisuudet",
TableProperties : "Taulun ominaisuudet",
ImageProperties : "Kuvan ominaisuudet",
FlashProperties : "Flash ominaisuudet",
 
AnchorProp : "Ankkurin ominaisuudet",
ButtonProp : "Painikkeen ominaisuudet",
CheckboxProp : "Valintaruudun ominaisuudet",
HiddenFieldProp : "Piilokentän ominaisuudet",
RadioButtonProp : "Radiopainikkeen ominaisuudet",
ImageButtonProp : "Kuvapainikkeen ominaisuudet",
TextFieldProp : "Tekstikentän ominaisuudet",
SelectionFieldProp : "Valintakentän ominaisuudet",
TextareaProp : "Tekstilaatikon ominaisuudet",
FormProp : "Lomakkeen ominaisuudet",
 
FontFormats : "Normaali;Muotoiltu;Osoite;Otsikko 1;Otsikko 2;Otsikko 3;Otsikko 4;Otsikko 5;Otsikko 6",
 
// Alerts and Messages
ProcessingXHTML : "Prosessoidaan XHTML:ää. Odota hetki...",
Done : "Valmis",
PasteWordConfirm : "Teksti, jonka haluat liittää, näyttää olevan kopioitu Wordista. Haluatko puhdistaa sen ennen liittämistä?",
NotCompatiblePaste : "Tämä komento toimii vain Internet Explorer 5.5:ssa tai uudemmassa. Haluatko liittää ilman puhdistusta?",
UnknownToolbarItem : "Tuntemanton työkalu \"%1\"",
UnknownCommand : "Tuntematon komento \"%1\"",
NotImplemented : "Komentoa ei ole liitetty sovellukseen",
UnknownToolbarSet : "Työkalukokonaisuus \"%1\" ei ole olemassa",
NoActiveX : "Selaimesi turvallisuusasetukset voivat rajoittaa joitain editorin ominaisuuksia. Sinun pitää ottaa käyttöön asetuksista \"Suorita ActiveX komponentit ja -plugin-laajennukset\". Saatat kohdata virheitä ja huomata puuttuvia ominaisuuksia.",
BrowseServerBlocked : "Resurssiselainta ei voitu avata. Varmista, että ponnahdusikkunoiden estäjät eivät ole päällä.",
DialogBlocked : "Apuikkunaa ei voitu avaata. Varmista, että ponnahdusikkunoiden estäjät eivät ole päällä.",
 
// Dialogs
DlgBtnOK : "OK",
DlgBtnCancel : "Peruuta",
DlgBtnClose : "Sulje",
DlgBtnBrowseServer : "Selaa palvelinta",
DlgAdvancedTag : "Lisäominaisuudet",
DlgOpOther : "Muut",
DlgInfoTab : "Info",
DlgAlertUrl : "Lisää URL",
 
// General Dialogs Labels
DlgGenNotSet : "<ei asetettu>",
DlgGenId : "Tunniste",
DlgGenLangDir : "Kielen suunta",
DlgGenLangDirLtr : "Vasemmalta oikealle (LTR)",
DlgGenLangDirRtl : "Oikealta vasemmalle (RTL)",
DlgGenLangCode : "Kielikoodi",
DlgGenAccessKey : "Pikanäppäin",
DlgGenName : "Nimi",
DlgGenTabIndex : "Tabulaattori indeksi",
DlgGenLongDescr : "Pitkän kuvauksen URL",
DlgGenClass : "Tyyliluokat",
DlgGenTitle : "Avustava otsikko",
DlgGenContType : "Avustava sisällön tyyppi",
DlgGenLinkCharset : "Linkitetty kirjaimisto",
DlgGenStyle : "Tyyli",
 
// Image Dialog
DlgImgTitle : "Kuvan ominaisuudet",
DlgImgInfoTab : "Kuvan tiedot",
DlgImgBtnUpload : "Lähetä palvelimelle",
DlgImgURL : "Osoite",
DlgImgUpload : "Lisää kuva",
DlgImgAlt : "Vaihtoehtoinen teksti",
DlgImgWidth : "Leveys",
DlgImgHeight : "Korkeus",
DlgImgLockRatio : "Lukitse suhteet",
DlgBtnResetSize : "Alkuperäinen koko",
DlgImgBorder : "Raja",
DlgImgHSpace : "Vaakatila",
DlgImgVSpace : "Pystytila",
DlgImgAlign : "Kohdistus",
DlgImgAlignLeft : "Vasemmalle",
DlgImgAlignAbsBottom: "Aivan alas",
DlgImgAlignAbsMiddle: "Aivan keskelle",
DlgImgAlignBaseline : "Alas (teksti)",
DlgImgAlignBottom : "Alas",
DlgImgAlignMiddle : "Keskelle",
DlgImgAlignRight : "Oikealle",
DlgImgAlignTextTop : "Ylös (teksti)",
DlgImgAlignTop : "Ylös",
DlgImgPreview : "Esikatselu",
DlgImgAlertUrl : "Kirjoita kuvan osoite (URL)",
DlgImgLinkTab : "Linkki",
 
// Flash Dialog
DlgFlashTitle : "Flash ominaisuudet",
DlgFlashChkPlay : "Automaattinen käynnistys",
DlgFlashChkLoop : "Toisto",
DlgFlashChkMenu : "Näytä Flash-valikko",
DlgFlashScale : "Levitä",
DlgFlashScaleAll : "Näytä kaikki",
DlgFlashScaleNoBorder : "Ei rajaa",
DlgFlashScaleFit : "Tarkka koko",
 
// Link Dialog
DlgLnkWindowTitle : "Linkki",
DlgLnkInfoTab : "Linkin tiedot",
DlgLnkTargetTab : "Kohde",
 
DlgLnkType : "Linkkityyppi",
DlgLnkTypeURL : "Osoite",
DlgLnkTypeAnchor : "Ankkuri tässä sivussa",
DlgLnkTypeEMail : "Sähköposti",
DlgLnkProto : "Protokolla",
DlgLnkProtoOther : "<muu>",
DlgLnkURL : "Osoite",
DlgLnkAnchorSel : "Valitse ankkuri",
DlgLnkAnchorByName : "Ankkurin nimen mukaan",
DlgLnkAnchorById : "Ankkurin ID:n mukaan",
DlgLnkNoAnchors : "<Ei ankkureita tässä dokumentissa>",
DlgLnkEMail : "Sähköpostiosoite",
DlgLnkEMailSubject : "Aihe",
DlgLnkEMailBody : "Viesti",
DlgLnkUpload : "Lisää tiedosto",
DlgLnkBtnUpload : "Lähetä palvelimelle",
 
DlgLnkTarget : "Kohde",
DlgLnkTargetFrame : "<kehys>",
DlgLnkTargetPopup : "<popup ikkuna>",
DlgLnkTargetBlank : "Uusi ikkuna (_blank)",
DlgLnkTargetParent : "Emoikkuna (_parent)",
DlgLnkTargetSelf : "Sama ikkuna (_self)",
DlgLnkTargetTop : "Päällimmäisin ikkuna (_top)",
DlgLnkTargetFrameName : "Kohdekehyksen nimi",
DlgLnkPopWinName : "Popup ikkunan nimi",
DlgLnkPopWinFeat : "Popup ikkunan ominaisuudet",
DlgLnkPopResize : "Venytettävä",
DlgLnkPopLocation : "Osoiterivi",
DlgLnkPopMenu : "Valikkorivi",
DlgLnkPopScroll : "Vierityspalkit",
DlgLnkPopStatus : "Tilarivi",
DlgLnkPopToolbar : "Vakiopainikkeet",
DlgLnkPopFullScrn : "Täysi ikkuna (IE)",
DlgLnkPopDependent : "Riippuva (Netscape)",
DlgLnkPopWidth : "Leveys",
DlgLnkPopHeight : "Korkeus",
DlgLnkPopLeft : "Vasemmalta (px)",
DlgLnkPopTop : "Ylhäältä (px)",
 
DlnLnkMsgNoUrl : "Linkille on kirjoitettava URL",
DlnLnkMsgNoEMail : "Kirjoita sähköpostiosoite",
DlnLnkMsgNoAnchor : "Valitse ankkuri",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "Valitse väri",
DlgColorBtnClear : "Tyhjennä",
DlgColorHighlight : "Kohdalla",
DlgColorSelected : "Valittu",
 
// Smiley Dialog
DlgSmileyTitle : "Lisää hymiö",
 
// Special Character Dialog
DlgSpecialCharTitle : "Valitse erikoismerkki",
 
// Table Dialog
DlgTableTitle : "Taulun ominaisuudet",
DlgTableRows : "Rivit",
DlgTableColumns : "Sarakkeet",
DlgTableBorder : "Rajan paksuus",
DlgTableAlign : "Kohdistus",
DlgTableAlignNotSet : "<ei asetettu>",
DlgTableAlignLeft : "Vasemmalle",
DlgTableAlignCenter : "Keskelle",
DlgTableAlignRight : "Oikealle",
DlgTableWidth : "Leveys",
DlgTableWidthPx : "pikseliä",
DlgTableWidthPc : "prosenttia",
DlgTableHeight : "Korkeus",
DlgTableCellSpace : "Solujen väli",
DlgTableCellPad : "Solujen sisennys",
DlgTableCaption : "Otsikko",
DlgTableSummary : "Yhteenveto",
 
// Table Cell Dialog
DlgCellTitle : "Solun ominaisuudet",
DlgCellWidth : "Leveys",
DlgCellWidthPx : "pikseliä",
DlgCellWidthPc : "prosenttia",
DlgCellHeight : "Korkeus",
DlgCellWordWrap : "Tekstikierrätys",
DlgCellWordWrapNotSet : "<Ei asetettu>",
DlgCellWordWrapYes : "Kyllä",
DlgCellWordWrapNo : "Ei",
DlgCellHorAlign : "Vaakakohdistus",
DlgCellHorAlignNotSet : "<Ei asetettu>",
DlgCellHorAlignLeft : "Vasemmalle",
DlgCellHorAlignCenter : "Keskelle",
DlgCellHorAlignRight: "Oikealle",
DlgCellVerAlign : "Pystykohdistus",
DlgCellVerAlignNotSet : "<Ei asetettu>",
DlgCellVerAlignTop : "Ylös",
DlgCellVerAlignMiddle : "Keskelle",
DlgCellVerAlignBottom : "Alas",
DlgCellVerAlignBaseline : "Tekstin alas",
DlgCellRowSpan : "Rivin jatkuvuus",
DlgCellCollSpan : "Sarakkeen jatkuvuus",
DlgCellBackColor : "Taustaväri",
DlgCellBorderColor : "Rajan väri",
DlgCellBtnSelect : "Valitse...",
 
// Find Dialog
DlgFindTitle : "Etsi",
DlgFindFindBtn : "Etsi",
DlgFindNotFoundMsg : "Etsittyä tekstiä ei löytynyt.",
 
// Replace Dialog
DlgReplaceTitle : "Korvaa",
DlgReplaceFindLbl : "Etsi mitä:",
DlgReplaceReplaceLbl : "Korvaa tällä:",
DlgReplaceCaseChk : "Sama kirjainkoko",
DlgReplaceReplaceBtn : "Korvaa",
DlgReplaceReplAllBtn : "Korvaa kaikki",
DlgReplaceWordChk : "Koko sana",
 
// Paste Operations / Dialog
PasteErrorPaste : "Selaimesi turva-asetukset eivät salli editorin toteuttaa liittämistä. Käytä näppäimistöä liittämiseen (Ctrl+V).",
PasteErrorCut : "Selaimesi turva-asetukset eivät salli editorin toteuttaa leikkaamista. Käytä näppäimistöä leikkaamiseen (Ctrl+X).",
PasteErrorCopy : "Selaimesi turva-asetukset eivät salli editorin toteuttaa kopioimista. Käytä näppäimistöä kopioimiseen (Ctrl+C).",
 
PasteAsText : "Liitä tekstinä",
PasteFromWord : "Liitä Wordista",
 
DlgPasteMsg2 : "Liitä painamalla (<STRONG>Ctrl+V</STRONG>) ja painamalla <STRONG>OK</STRONG>.",
DlgPasteIgnoreFont : "Jätä huomioimatta fonttimääritykset",
DlgPasteRemoveStyles : "Poista tyylimääritykset",
DlgPasteCleanBox : "Tyhjennä",
 
// Color Picker
ColorAutomatic : "Automaattinen",
ColorMoreColors : "Lisää värejä...",
 
// Document Properties
DocProps : "Dokumentin ominaisuudet",
 
// Anchor Dialog
DlgAnchorTitle : "Ankkurin ominaisuudet",
DlgAnchorName : "Nimi",
DlgAnchorErrorName : "Ankkurille on kirjoitettava nimi",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Ei sanakirjassa",
DlgSpellChangeTo : "Vaihda",
DlgSpellBtnIgnore : "Jätä huomioimatta",
DlgSpellBtnIgnoreAll : "Jätä kaikki huomioimatta",
DlgSpellBtnReplace : "Korvaa",
DlgSpellBtnReplaceAll : "Korvaa kaikki",
DlgSpellBtnUndo : "Kumoa",
DlgSpellNoSuggestions : "Ei ehdotuksia",
DlgSpellProgress : "Tarkistus käynnissä...",
DlgSpellNoMispell : "Tarkistus valmis: Ei virheitä",
DlgSpellNoChanges : "Tarkistus valmis: Yhtään sanaa ei muutettu",
DlgSpellOneChange : "Tarkistus valmis: Yksi sana muutettiin",
DlgSpellManyChanges : "Tarkistus valmis: %1 sanaa muutettiin",
 
IeSpellDownload : "Oikeinkirjoituksen tarkistusta ei ole asennettu. Haluatko ladata sen nyt?",
 
// Button Dialog
DlgButtonText : "Teksti (arvo)",
DlgButtonType : "Tyyppi",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Nimi",
DlgCheckboxValue : "Arvo",
DlgCheckboxSelected : "Valittu",
 
// Form Dialog
DlgFormName : "Nimi",
DlgFormAction : "Toiminto",
DlgFormMethod : "Tapa",
 
// Select Field Dialog
DlgSelectName : "Nimi",
DlgSelectValue : "Arvo",
DlgSelectSize : "Koko",
DlgSelectLines : "Rivit",
DlgSelectChkMulti : "Salli usea valinta",
DlgSelectOpAvail : "Ominaisuudet",
DlgSelectOpText : "Teksti",
DlgSelectOpValue : "Arvo",
DlgSelectBtnAdd : "Lisää",
DlgSelectBtnModify : "Muuta",
DlgSelectBtnUp : "Ylös",
DlgSelectBtnDown : "Alas",
DlgSelectBtnSetValue : "Aseta valituksi",
DlgSelectBtnDelete : "Poista",
 
// Textarea Dialog
DlgTextareaName : "Nimi",
DlgTextareaCols : "Sarakkeita",
DlgTextareaRows : "Rivejä",
 
// Text Field Dialog
DlgTextName : "Nimi",
DlgTextValue : "Arvo",
DlgTextCharWidth : "Leveys",
DlgTextMaxChars : "Maksimi merkkimäärä",
DlgTextType : "Tyyppi",
DlgTextTypeText : "Teksti",
DlgTextTypePass : "Salasana",
 
// Hidden Field Dialog
DlgHiddenName : "Nimi",
DlgHiddenValue : "Arvo",
 
// Bulleted List Dialog
BulletedListProp : "Luettelon ominaisuudet",
NumberedListProp : "Numeroinnin ominaisuudet",
DlgLstStart : "Start", //MISSING
DlgLstType : "Tyyppi",
DlgLstTypeCircle : "Kehä",
DlgLstTypeDisc : "Ympyrä",
DlgLstTypeSquare : "Neliö",
DlgLstTypeNumbers : "Numerot (1, 2, 3)",
DlgLstTypeLCase : "Pienet kirjaimet (a, b, c)",
DlgLstTypeUCase : "Isot kirjaimet (A, B, C)",
DlgLstTypeSRoman : "Pienet roomalaiset numerot (i, ii, iii)",
DlgLstTypeLRoman : "Isot roomalaiset numerot (Ii, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "Yleiset",
DlgDocBackTab : "Tausta",
DlgDocColorsTab : "Värit ja marginaalit",
DlgDocMetaTab : "Meta-tieto",
 
DlgDocPageTitle : "Sivun nimi",
DlgDocLangDir : "Kielen suunta",
DlgDocLangDirLTR : "Vasemmalta oikealle (LTR)",
DlgDocLangDirRTL : "Oikealta vasemmalle (RTL)",
DlgDocLangCode : "Kielikoodi",
DlgDocCharSet : "Merkistäkoodaus",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "Muu merkistäkoodaus",
 
DlgDocDocType : "Dokumentin tyyppi",
DlgDocDocTypeOther : "Muu dokumentin tyyppi",
DlgDocIncXHTML : "Lisää XHTML julistukset",
DlgDocBgColor : "Taustaväri",
DlgDocBgImage : "Taustakuva",
DlgDocBgNoScroll : "Paikallaanpysyvä tausta",
DlgDocCText : "Teksti",
DlgDocCLink : "Linkki",
DlgDocCVisited : "Vierailtu linkki",
DlgDocCActive : "Aktiivinen linkki",
DlgDocMargins : "Sivun marginaalit",
DlgDocMaTop : "Ylä",
DlgDocMaLeft : "Vasen",
DlgDocMaRight : "Oikea",
DlgDocMaBottom : "Ala",
DlgDocMeIndex : "Hakusanat (pilkulla erotettuna)",
DlgDocMeDescr : "Kuvaus",
DlgDocMeAuthor : "Tekijä",
DlgDocMeCopy : "Tekijänoikeudet",
DlgDocPreview : "Esikatselu",
 
// Templates Dialog
Templates : "Pohjat",
DlgTemplatesTitle : "Sisältöpohjat",
DlgTemplatesSelMsg : "Valitse pohja editoriin<br>(aiempi sisältö menetetään):",
DlgTemplatesLoading : "Ladataan listaa pohjista. Hetkinen...",
DlgTemplatesNoTpl : "(Ei määriteltyjä pohjia)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "Editorista",
DlgAboutBrowserInfoTab : "Selaimen tiedot",
DlgAboutLicenseTab : "Lisenssi",
DlgAboutVersion : "versio",
DlgAboutLicense : "Lisenssi: GNU Lesser General Public License",
DlgAboutInfo : "Lisää tietoa osoitteesta"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/hi.js
New file
0,0 → 1,501
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: hi.js
* Hindi language file.
*
* File Authors:
* Utkarshraj Atmaram (utcursch@gmail.com)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "टूलबार सिमटायें",
ToolbarExpand : "टूलबार का विस्तार करें",
 
// Toolbar Items and Context Menu
Save : "सेव",
NewPage : "नया पेज",
Preview : "प्रीव्यू",
Cut : "कट",
Copy : "कॉपी",
Paste : "पेस्ट",
PasteText : "पेस्ट (सादा टॅक्स्ट)",
PasteWord : "पेस्ट (वर्ड से)",
Print : "प्रिन्ट",
SelectAll : "सब सॅलॅक्ट करें",
RemoveFormat : "फ़ॉर्मैट हटायें",
InsertLinkLbl : "लिंक",
InsertLink : "लिंक इन्सर्ट/संपादन",
RemoveLink : "लिंक हटायें",
Anchor : "ऐंकर इन्सर्ट/संपादन",
InsertImageLbl : "तस्वीर",
InsertImage : "तस्वीर इन्सर्ट/संपादन",
InsertFlashLbl : "फ़्लैश",
InsertFlash : "फ़्लैश इन्सर्ट/संपादन",
InsertTableLbl : "टेबल",
InsertTable : "टेबल इन्सर्ट/संपादन",
InsertLineLbl : "रेखा",
InsertLine : "हॉरिज़ॉन्टल रेखा इन्सर्ट करें",
InsertSpecialCharLbl: "विशेष करॅक्टर",
InsertSpecialChar : "विशेष करॅक्टर इन्सर्ट करें",
InsertSmileyLbl : "स्माइली",
InsertSmiley : "स्माइली इन्सर्ट करें",
About : "FCKeditor के बारे में",
Bold : "बोल्ड",
Italic : "इटैलिक",
Underline : "रेखांकण",
StrikeThrough : "स्ट्राइक थ्रू",
Subscript : "अधोलेख",
Superscript : "अभिलेख",
LeftJustify : "बायीं तरफ",
CenterJustify : "बीच में",
RightJustify : "दायीं तरफ",
BlockJustify : "ब्लॉक जस्टीफ़ाई",
DecreaseIndent : "इन्डॅन्ट कम करें",
IncreaseIndent : "इन्डॅन्ट बढ़ायें",
Undo : "अन्डू",
Redo : "रीडू",
NumberedListLbl : "अंकीय सूची",
NumberedList : "अंकीय सूची इन्सर्ट/संपादन",
BulletedListLbl : "बुलॅट सूची",
BulletedList : "बुलॅट सूची इन्सर्ट/संपादन",
ShowTableBorders : "टेबल बॉर्डरयें दिखायें",
ShowDetails : "ज्यादा दिखायें",
Style : "स्टाइल",
FontFormat : "फ़ॉर्मैट",
Font : "फ़ॉन्ट",
FontSize : "साइज़",
TextColor : "टेक्स्ट रंग",
BGColor : "बैक्ग्राउन्ड रंग",
Source : "सोर्स",
Find : "खोजें",
Replace : "रीप्लेस",
SpellCheck : "वर्तनी (स्पेलिंग) जाँच",
UniversalKeyboard : "यूनीवर्सल कीबोर्ड",
PageBreakLbl : "पेज ब्रेक",
PageBreak : "पेज ब्रेक इन्सर्ट् करें",
 
Form : "फ़ॉर्म",
Checkbox : "चॅक बॉक्स",
RadioButton : "रेडिओ बटन",
TextField : "टेक्स्ट फ़ील्ड",
Textarea : "टेक्स्ट एरिया",
HiddenField : "गुप्त फ़ील्ड",
Button : "बटन",
SelectionField : "चुनाव फ़ील्ड",
ImageButton : "तस्वीर बटन",
 
FitWindow : "एडिटर साइज़ को चरम सीमा तक बढ़ायें",
 
// Context Menu
EditLink : "लिंक संपादन",
CellCM : "खाना",
RowCM : "पंक्ति",
ColumnCM : "कालम",
InsertRow : "पंक्ति इन्सर्ट करें",
DeleteRows : "पंक्तियाँ डिलीट करें",
InsertColumn : "कॉलम इन्सर्ट करें",
DeleteColumns : "कॉलम डिलीट करें",
InsertCell : "सॅल इन्सर्ट करें",
DeleteCells : "सॅल डिलीट करें",
MergeCells : "सॅल मिलायें",
SplitCell : "सॅल अलग करें",
TableDelete : "टेबल डिलीट करें",
CellProperties : "सॅल प्रॉपर्टीज़",
TableProperties : "टेबल प्रॉपर्टीज़",
ImageProperties : "तस्वीर प्रॉपर्टीज़",
FlashProperties : "फ़्लैश प्रॉपर्टीज़",
 
AnchorProp : "ऐंकर प्रॉपर्टीज़",
ButtonProp : "बटन प्रॉपर्टीज़",
CheckboxProp : "चॅक बॉक्स प्रॉपर्टीज़",
HiddenFieldProp : "गुप्त फ़ील्ड प्रॉपर्टीज़",
RadioButtonProp : "रेडिओ बटन प्रॉपर्टीज़",
ImageButtonProp : "तस्वीर बटन प्रॉपर्टीज़",
TextFieldProp : "टेक्स्ट फ़ील्ड प्रॉपर्टीज़",
SelectionFieldProp : "चुनाव फ़ील्ड प्रॉपर्टीज़",
TextareaProp : "टेक्स्त एरिया प्रॉपर्टीज़",
FormProp : "फ़ॉर्म प्रॉपर्टीज़",
 
FontFormats : "साधारण;फ़ॉर्मैटॅड;पता;शीर्षक 1;शीर्षक 2;शीर्षक 3;शीर्षक 4;शीर्षक 5;शीर्षक 6;शीर्षक (DIV)",
 
// Alerts and Messages
ProcessingXHTML : "XHTML प्रोसॅस हो रहा है। ज़रा ठहरें...",
Done : "पूरा हुआ",
PasteWordConfirm : "आप जो टेक्स्ट पेस्ट करना चाहते हैं, वह वर्ड से कॉपी किया हुआ लग रहा है। क्या पेस्ट करने से पहले आप इसे साफ़ करना चाहेंगे?",
NotCompatiblePaste : "यह कमांड इन्टरनॅट एक्स्प्लोरर(Internet Explorer) 5.5 या उसके बाद के वर्ज़न के लिए ही उपलब्ध है। क्या आप बिना साफ़ किए पेस्ट करना चाहेंगे?",
UnknownToolbarItem : "अनजान टूलबार आइटम \"%1\"",
UnknownCommand : "अनजान कमान्ड \"%1\"",
NotImplemented : "कमान्ड इम्प्लीमॅन्ट नहीं किया गया है",
UnknownToolbarSet : "टूलबार सॅट \"%1\" उपलब्ध नहीं है",
NoActiveX : "आपके ब्राउज़र् की सुरक्शा सेटिंग्स् एडिटर की कुछ् फ़ीचरों को सीमित कर् सकती हैं। क्रिपया \"Run ActiveX controls and plug-ins\" विकल्प को एनेबल करें. आपको एरर्स् और गायब फ़ीचर्स् का अनुभव हो सकता है।",
BrowseServerBlocked : "रिसोर्सेज़ ब्राउज़र् नहीं खोला जा सका। क्रिपया सभी पॉप्-अप् ब्लॉकर्स् को डिसेबल करें।",
DialogBlocked : "डायलग विन्डो नहीं खोला जा सका। क्रिपया सभी पॉप्-अप् ब्लॉकर्स् को डिसेबल करें।",
 
// Dialogs
DlgBtnOK : "ठीक है",
DlgBtnCancel : "रद्द करें",
DlgBtnClose : "बन्द करें",
DlgBtnBrowseServer : "सर्वर ब्राउज़ करें",
DlgAdvancedTag : "ऍड्वान्स्ड",
DlgOpOther : "<अन्य>",
DlgInfoTab : "सूचना",
DlgAlertUrl : "URL इन्सर्ट करें",
 
// General Dialogs Labels
DlgGenNotSet : "<सॅट नहीं>",
DlgGenId : "Id",
DlgGenLangDir : "भाषा लिखने की दिशा",
DlgGenLangDirLtr : "बायें से दायें (LTR)",
DlgGenLangDirRtl : "दायें से बायें (RTL)",
DlgGenLangCode : "भाषा कोड",
DlgGenAccessKey : "ऍक्सॅस की",
DlgGenName : "नाम",
DlgGenTabIndex : "टैब इन्डॅक्स",
DlgGenLongDescr : "अधिक विवरण के लिए URL",
DlgGenClass : "स्टाइल-शीट क्लास",
DlgGenTitle : "परामर्श शीर्शक",
DlgGenContType : "परामर्श कन्टॅन्ट प्रकार",
DlgGenLinkCharset : "लिंक रिसोर्स करॅक्टर सॅट",
DlgGenStyle : "स्टाइल",
 
// Image Dialog
DlgImgTitle : "तस्वीर प्रॉपर्टीज़",
DlgImgInfoTab : "तस्वीर की जानकारी",
DlgImgBtnUpload : "इसे सर्वर को भेजें",
DlgImgURL : "URL",
DlgImgUpload : "अपलोड",
DlgImgAlt : "वैकल्पिक टेक्स्ट",
DlgImgWidth : "चौड़ाई",
DlgImgHeight : "ऊँचाई",
DlgImgLockRatio : "लॉक अनुपात",
DlgBtnResetSize : "रीसॅट साइज़",
DlgImgBorder : "बॉर्डर",
DlgImgHSpace : "हॉरिज़ॉन्टल स्पेस",
DlgImgVSpace : "वर्टिकल स्पेस",
DlgImgAlign : "ऍलाइन",
DlgImgAlignLeft : "दायें",
DlgImgAlignAbsBottom: "Abs नीचे",
DlgImgAlignAbsMiddle: "Abs ऊपर",
DlgImgAlignBaseline : "मूल रेखा",
DlgImgAlignBottom : "नीचे",
DlgImgAlignMiddle : "मध्य",
DlgImgAlignRight : "दायें",
DlgImgAlignTextTop : "टेक्स्ट ऊपर",
DlgImgAlignTop : "ऊपर",
DlgImgPreview : "प्रीव्यू",
DlgImgAlertUrl : "तस्वीर का URL टाइप करें ",
DlgImgLinkTab : "लिंक",
 
// Flash Dialog
DlgFlashTitle : "फ़्लैश प्रॉपर्टीज़",
DlgFlashChkPlay : "ऑटो प्ले",
DlgFlashChkLoop : "लूप",
DlgFlashChkMenu : "फ़्लैश मॅन्यू का प्रयोग करें",
DlgFlashScale : "स्केल",
DlgFlashScaleAll : "सभी दिखायें",
DlgFlashScaleNoBorder : "कोई बॉर्डर नहीं",
DlgFlashScaleFit : "बिल्कुल फ़िट",
 
// Link Dialog
DlgLnkWindowTitle : "लिंक",
DlgLnkInfoTab : "लिंक ",
DlgLnkTargetTab : "टार्गेट",
 
DlgLnkType : "लिंक प्रकार",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "इस पेज का ऐंकर",
DlgLnkTypeEMail : "ई-मेल",
DlgLnkProto : "प्रोटोकॉल",
DlgLnkProtoOther : "<अन्य>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "ऐंकर चुनें",
DlgLnkAnchorByName : "ऐंकर नाम से",
DlgLnkAnchorById : "ऍलीमॅन्ट Id से",
DlgLnkNoAnchors : "<डॉक्यूमॅन्ट में ऐंकर्स की संख्या>",
DlgLnkEMail : "ई-मेल पता",
DlgLnkEMailSubject : "संदेश विषय",
DlgLnkEMailBody : "संदेश",
DlgLnkUpload : "अपलोड",
DlgLnkBtnUpload : "इसे सर्वर को भेजें",
 
DlgLnkTarget : "टार्गेट",
DlgLnkTargetFrame : "<फ़्रेम>",
DlgLnkTargetPopup : "<पॉप-अप विन्डो>",
DlgLnkTargetBlank : "नया विन्डो (_blank)",
DlgLnkTargetParent : "मूल विन्डो (_parent)",
DlgLnkTargetSelf : "इसी विन्डो (_self)",
DlgLnkTargetTop : "शीर्ष विन्डो (_top)",
DlgLnkTargetFrameName : "टार्गेट फ़्रेम का नाम",
DlgLnkPopWinName : "पॉप-अप विन्डो का नाम",
DlgLnkPopWinFeat : "पॉप-अप विन्डो फ़ीचर्स",
DlgLnkPopResize : "साइज़ बदला जा सकता है",
DlgLnkPopLocation : "लोकेशन बार",
DlgLnkPopMenu : "मॅन्यू बार",
DlgLnkPopScroll : "स्क्रॉल बार",
DlgLnkPopStatus : "स्टेटस बार",
DlgLnkPopToolbar : "टूल बार",
DlgLnkPopFullScrn : "फ़ुल स्क्रीन (IE)",
DlgLnkPopDependent : "डिपेन्डॅन्ट (Netscape)",
DlgLnkPopWidth : "चौड़ाई",
DlgLnkPopHeight : "ऊँचाई",
DlgLnkPopLeft : "बायीं तरफ",
DlgLnkPopTop : "दायीं तरफ",
 
DlnLnkMsgNoUrl : "लिंक URL टाइप करें",
DlnLnkMsgNoEMail : "ई-मेल पता टाइप करें",
DlnLnkMsgNoAnchor : "ऐंकर चुनें",
DlnLnkMsgInvPopName : "पॉप-अप का नाम अल्फाबेट से शुरू होना चाहिये और उसमें स्पेस नहीं होने चाहिए",
 
// Color Dialog
DlgColorTitle : "रंग चुनें",
DlgColorBtnClear : "साफ़ करें",
DlgColorHighlight : "हाइलाइट",
DlgColorSelected : "सॅलॅक्टॅड",
 
// Smiley Dialog
DlgSmileyTitle : "स्माइली इन्सर्ट करें",
 
// Special Character Dialog
DlgSpecialCharTitle : "विशेष करॅक्टर चुनें",
 
// Table Dialog
DlgTableTitle : "टेबल प्रॉपर्टीज़",
DlgTableRows : "पंक्तियाँ",
DlgTableColumns : "कॉलम",
DlgTableBorder : "बॉर्डर साइज़",
DlgTableAlign : "ऍलाइन्मॅन्ट",
DlgTableAlignNotSet : "<सॅट नहीं>",
DlgTableAlignLeft : "दायें",
DlgTableAlignCenter : "बीच में",
DlgTableAlignRight : "बायें",
DlgTableWidth : "चौड़ाई",
DlgTableWidthPx : "पिक्सॅल",
DlgTableWidthPc : "प्रतिशत",
DlgTableHeight : "ऊँचाई",
DlgTableCellSpace : "सॅल अंतर",
DlgTableCellPad : "सॅल पैडिंग",
DlgTableCaption : "शीर्षक",
DlgTableSummary : "सारांश",
 
// Table Cell Dialog
DlgCellTitle : "सॅल प्रॉपर्टीज़",
DlgCellWidth : "चौड़ाई",
DlgCellWidthPx : "पिक्सॅल",
DlgCellWidthPc : "प्रतिशत",
DlgCellHeight : "ऊँचाई",
DlgCellWordWrap : "वर्ड रैप",
DlgCellWordWrapNotSet : "<सॅट नहीं>",
DlgCellWordWrapYes : "हाँ",
DlgCellWordWrapNo : "नहीं",
DlgCellHorAlign : "हॉरिज़ॉन्टल ऍलाइन्मॅन्ट",
DlgCellHorAlignNotSet : "<सॅट नहीं>",
DlgCellHorAlignLeft : "दायें",
DlgCellHorAlignCenter : "बीच में",
DlgCellHorAlignRight: "बायें",
DlgCellVerAlign : "वर्टिकल ऍलाइन्मॅन्ट",
DlgCellVerAlignNotSet : "<सॅट नहीं>",
DlgCellVerAlignTop : "ऊपर",
DlgCellVerAlignMiddle : "मध्य",
DlgCellVerAlignBottom : "नीचे",
DlgCellVerAlignBaseline : "मूलरेखा",
DlgCellRowSpan : "पंक्ति स्पैन",
DlgCellCollSpan : "कॉलम स्पैन",
DlgCellBackColor : "बैक्ग्राउन्ड रंग",
DlgCellBorderColor : "बॉर्डर का रंग",
DlgCellBtnSelect : "चुनें...",
 
// Find Dialog
DlgFindTitle : "खोजें",
DlgFindFindBtn : "खोजें",
DlgFindNotFoundMsg : "आपके द्वारा दिया गया टेक्स्ट नहीं मिला",
 
// Replace Dialog
DlgReplaceTitle : "रिप्लेस",
DlgReplaceFindLbl : "यह खोजें:",
DlgReplaceReplaceLbl : "इससे रिप्लेस करें:",
DlgReplaceCaseChk : "केस मिलायें",
DlgReplaceReplaceBtn : "रिप्लेस",
DlgReplaceReplAllBtn : "सभी रिप्लेस करें",
DlgReplaceWordChk : "पूरा शब्द मिलायें",
 
// Paste Operations / Dialog
PasteErrorPaste : "आपके ब्रा‌उज़र की सुरक्षा सॅटिन्ग्स ने पेस्ट करने की अनुमति नहीं प्रदान की है। (Ctrl+V) का प्रयोग करें।",
PasteErrorCut : "आपके ब्राउज़र की सुरक्षा सॅटिन्ग्स ने कट करने की अनुमति नहीं प्रदान की है। (Ctrl+X) का प्रयोग करें।",
PasteErrorCopy : "आपके ब्राआउज़र की सुरक्षा सॅटिन्ग्स ने कॉपी करने की अनुमति नहीं प्रदान की है। (Ctrl+C) का प्रयोग करें।",
 
PasteAsText : "पेस्ट (सादा टॅक्स्ट)",
PasteFromWord : "पेस्ट (वर्ड से)",
 
DlgPasteMsg2 : "Ctrl+V का प्रयोग करके पेस्ट करें और ठीक है करें.",
DlgPasteIgnoreFont : "फ़ॉन्ट परिभाषा निकालें",
DlgPasteRemoveStyles : "स्टाइल परिभाषा निकालें",
DlgPasteCleanBox : "बॉक्स साफ़ करें",
 
// Color Picker
ColorAutomatic : "ऑटोमैटिक",
ColorMoreColors : "और रंग...",
 
// Document Properties
DocProps : "डॉक्यूमॅन्ट प्रॉपर्टीज़",
 
// Anchor Dialog
DlgAnchorTitle : "ऐंकर प्रॉपर्टीज़",
DlgAnchorName : "ऐंकर का नाम",
DlgAnchorErrorName : "ऐंकर का नाम टाइप करें",
 
// Speller Pages Dialog
DlgSpellNotInDic : "शब्दकोश में नहीं",
DlgSpellChangeTo : "इसमें बदलें",
DlgSpellBtnIgnore : "इग्नोर",
DlgSpellBtnIgnoreAll : "सभी इग्नोर करें",
DlgSpellBtnReplace : "रिप्लेस",
DlgSpellBtnReplaceAll : "सभी रिप्लेस करें",
DlgSpellBtnUndo : "अन्डू",
DlgSpellNoSuggestions : "- कोई सुझाव नहीं -",
DlgSpellProgress : "वर्तनी की जाँच (स्पॅल-चॅक) जारी है...",
DlgSpellNoMispell : "वर्तनी की जाँच : कोई गलत वर्तनी (स्पॅलिंग) नहीं पाई गई",
DlgSpellNoChanges : "वर्तनी की जाँच :कोई शब्द नहीं बदला गया",
DlgSpellOneChange : "वर्तनी की जाँच : एक शब्द बदला गया",
DlgSpellManyChanges : "वर्तनी की जाँच : %1 शब्द बदले गये",
 
IeSpellDownload : "स्पॅल-चॅकर इन्स्टाल नहीं किया गया है। क्या आप इसे डा‌उनलोड करना चाहेंगे?",
 
// Button Dialog
DlgButtonText : "टेक्स्ट (वैल्यू)",
DlgButtonType : "प्रकार",
DlgButtonTypeBtn : "बटन",
DlgButtonTypeSbm : "सब्मिट",
DlgButtonTypeRst : "रिसेट",
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "नाम",
DlgCheckboxValue : "वैल्यू",
DlgCheckboxSelected : "सॅलॅक्टॅड",
 
// Form Dialog
DlgFormName : "नाम",
DlgFormAction : "ऍक्शन",
DlgFormMethod : "तरीका",
 
// Select Field Dialog
DlgSelectName : "नाम",
DlgSelectValue : "वैल्यू",
DlgSelectSize : "साइज़",
DlgSelectLines : "पंक्तियाँ",
DlgSelectChkMulti : "एक से ज्यादा विकल्प चुनने दें",
DlgSelectOpAvail : "उपलब्ध विकल्प",
DlgSelectOpText : "टेक्स्ट",
DlgSelectOpValue : "वैल्यू",
DlgSelectBtnAdd : "जोड़ें",
DlgSelectBtnModify : "बदलें",
DlgSelectBtnUp : "ऊपर",
DlgSelectBtnDown : "नीचे",
DlgSelectBtnSetValue : "चुनी गई वैल्यू सॅट करें",
DlgSelectBtnDelete : "डिलीट",
 
// Textarea Dialog
DlgTextareaName : "नाम",
DlgTextareaCols : "कॉलम",
DlgTextareaRows : "पंक्तियां",
 
// Text Field Dialog
DlgTextName : "नाम",
DlgTextValue : "वैल्यू",
DlgTextCharWidth : "करॅक्टर की चौढ़ाई",
DlgTextMaxChars : "अधिकतम करॅक्टर",
DlgTextType : "टाइप",
DlgTextTypeText : "टेक्स्ट",
DlgTextTypePass : "पास्वर्ड",
 
// Hidden Field Dialog
DlgHiddenName : "नाम",
DlgHiddenValue : "वैल्यू",
 
// Bulleted List Dialog
BulletedListProp : "बुलॅट सूची प्रॉपर्टीज़",
NumberedListProp : "अंकीय सूची प्रॉपर्टीज़",
DlgLstStart : "प्रारम्भ",
DlgLstType : "प्रकार",
DlgLstTypeCircle : "गोल",
DlgLstTypeDisc : "डिस्क",
DlgLstTypeSquare : "चौकॊण",
DlgLstTypeNumbers : "अंक (1, 2, 3)",
DlgLstTypeLCase : "छोटे अक्षर (a, b, c)",
DlgLstTypeUCase : "बड़े अक्षर (A, B, C)",
DlgLstTypeSRoman : "छोटे रोमन अंक (i, ii, iii)",
DlgLstTypeLRoman : "बड़े रोमन अंक (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "आम",
DlgDocBackTab : "बैक्ग्राउन्ड",
DlgDocColorsTab : "रंग और मार्जिन",
DlgDocMetaTab : "मॅटाडेटा",
 
DlgDocPageTitle : "पेज शीर्षक",
DlgDocLangDir : "भाषा लिखने की दिशा",
DlgDocLangDirLTR : "बायें से दायें (LTR)",
DlgDocLangDirRTL : "दायें से बायें (RTL)",
DlgDocLangCode : "भाषा कोड",
DlgDocCharSet : "करेक्टर सॅट ऍन्कोडिंग",
DlgDocCharSetCE : "मध्य यूरोपीय (Central European)",
DlgDocCharSetCT : "चीनी (Chinese Traditional Big5)",
DlgDocCharSetCR : "सिरीलिक (Cyrillic)",
DlgDocCharSetGR : "यवन (Greek)",
DlgDocCharSetJP : "जापानी (Japanese)",
DlgDocCharSetKR : "कोरीयन (Korean)",
DlgDocCharSetTR : "तुर्की (Turkish)",
DlgDocCharSetUN : "यूनीकोड (UTF-8)",
DlgDocCharSetWE : "पश्चिम यूरोपीय (Western European)",
DlgDocCharSetOther : "अन्य करेक्टर सॅट ऍन्कोडिंग",
 
DlgDocDocType : "डॉक्यूमॅन्ट प्रकार शीर्षक",
DlgDocDocTypeOther : "अन्य डॉक्यूमॅन्ट प्रकार शीर्षक",
DlgDocIncXHTML : "XHTML सूचना सम्मिलित करें",
DlgDocBgColor : "बैक्ग्राउन्ड रंग",
DlgDocBgImage : "बैक्ग्राउन्ड तस्वीर URL",
DlgDocBgNoScroll : "स्क्रॉल न करने वाला बैक्ग्राउन्ड",
DlgDocCText : "टेक्स्ट",
DlgDocCLink : "लिंक",
DlgDocCVisited : "विज़िट किया गया लिंक",
DlgDocCActive : "सक्रिय लिंक",
DlgDocMargins : "पेज मार्जिन",
DlgDocMaTop : "ऊपर",
DlgDocMaLeft : "बायें",
DlgDocMaRight : "दायें",
DlgDocMaBottom : "नीचे",
DlgDocMeIndex : "डॉक्युमॅन्ट इन्डेक्स संकेतशब्द (अल्पविराम से अलग करें)",
DlgDocMeDescr : "डॉक्यूमॅन्ट करॅक्टरन",
DlgDocMeAuthor : "लेखक",
DlgDocMeCopy : "कॉपीराइट",
DlgDocPreview : "प्रीव्यू",
 
// Templates Dialog
Templates : "टॅम्प्लेट",
DlgTemplatesTitle : "कन्टेन्ट टॅम्प्लेट",
DlgTemplatesSelMsg : "ऍडिटर में ओपन करने हेतु टॅम्प्लेट चुनें(वर्तमान कन्टॅन्ट सेव नहीं होंगे):",
DlgTemplatesLoading : "टॅम्प्लेट सूची लोड की जा रही है। ज़रा ठहरें...",
DlgTemplatesNoTpl : "(कोई टॅम्प्लेट डिफ़ाइन नहीं किया गया है)",
DlgTemplatesReplace : "मूल शब्दों को बदलें",
 
// About Dialog
DlgAboutAboutTab : "FCKEditor के बारे में",
DlgAboutBrowserInfoTab : "ब्राउज़र के बारे में",
DlgAboutLicenseTab : "लाइसैन्स",
DlgAboutVersion : "वर्ज़न",
DlgAboutLicense : "लाइसेंस :GNU LGPL",
DlgAboutInfo : "अधिक जानकारी के लिये यहाँ जायें:"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/eo.js
New file
0,0 → 1,501
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: eo.js
* Esperanto language file.
*
* File Authors:
* Tim Morley (timsk@openoffice.org)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Kaŝi Ilobreton",
ToolbarExpand : "Vidigi Ilojn",
 
// Toolbar Items and Context Menu
Save : "Sekurigi",
NewPage : "Nova Paĝo",
Preview : "Vidigi Aspekton",
Cut : "Eltondi",
Copy : "Kopii",
Paste : "Interglui",
PasteText : "Interglui kiel Tekston",
PasteWord : "Interglui el Word",
Print : "Presi",
SelectAll : "Elekti ĉion",
RemoveFormat : "Forigi Formaton",
InsertLinkLbl : "Ligilo",
InsertLink : "Enmeti/Ŝanĝi Ligilon",
RemoveLink : "Forigi Ligilon",
Anchor : "Enmeti/Ŝanĝi Ankron",
InsertImageLbl : "Bildo",
InsertImage : "Enmeti/Ŝanĝi Bildon",
InsertFlashLbl : "Flash", //MISSING
InsertFlash : "Insert/Edit Flash", //MISSING
InsertTableLbl : "Tabelo",
InsertTable : "Enmeti/Ŝanĝi Tabelon",
InsertLineLbl : "Horizonta Linio",
InsertLine : "Enmeti Horizonta Linio",
InsertSpecialCharLbl: "Speciala Signo",
InsertSpecialChar : "Enmeti Specialan Signon",
InsertSmileyLbl : "Mienvinjeto",
InsertSmiley : "Enmeti Mienvinjeton",
About : "Pri FCKeditor",
Bold : "Grasa",
Italic : "Kursiva",
Underline : "Substreko",
StrikeThrough : "Trastreko",
Subscript : "Subskribo",
Superscript : "Superskribo",
LeftJustify : "Maldekstrigi",
CenterJustify : "Centrigi",
RightJustify : "Dekstrigi",
BlockJustify : "Ĝisrandigi Ambaŭflanke",
DecreaseIndent : "Malpligrandigi Krommarĝenon",
IncreaseIndent : "Pligrandigi Krommarĝenon",
Undo : "Malfari",
Redo : "Refari",
NumberedListLbl : "Numera Listo",
NumberedList : "Enmeti/Forigi Numeran Liston",
BulletedListLbl : "Bula Listo",
BulletedList : "Enmeti/Forigi Bulan Liston",
ShowTableBorders : "Vidigi Borderojn de Tabelo",
ShowDetails : "Vidigi Detalojn",
Style : "Stilo",
FontFormat : "Formato",
Font : "Tiparo",
FontSize : "Grando",
TextColor : "Teksta Koloro",
BGColor : "Fona Koloro",
Source : "Fonto",
Find : "Serĉi",
Replace : "Anstataŭigi",
SpellCheck : "Literumada Kontrolilo",
UniversalKeyboard : "Universala Klavaro",
PageBreakLbl : "Page Break", //MISSING
PageBreak : "Insert Page Break", //MISSING
 
Form : "Formularo",
Checkbox : "Markobutono",
RadioButton : "Radiobutono",
TextField : "Teksta kampo",
Textarea : "Teksta Areo",
HiddenField : "Kaŝita Kampo",
Button : "Butono",
SelectionField : "Elekta Kampo",
ImageButton : "Bildbutono",
 
FitWindow : "Maximize the editor size", //MISSING
 
// Context Menu
EditLink : "Modifier Ligilon",
CellCM : "Cell", //MISSING
RowCM : "Row", //MISSING
ColumnCM : "Column", //MISSING
InsertRow : "Enmeti Linion",
DeleteRows : "Forigi Liniojn",
InsertColumn : "Enmeti Kolumnon",
DeleteColumns : "Forigi Kolumnojn",
InsertCell : "Enmeti Ĉelon",
DeleteCells : "Forigi Ĉelojn",
MergeCells : "Kunfandi Ĉelojn",
SplitCell : "Dividi Ĉelojn",
TableDelete : "Delete Table", //MISSING
CellProperties : "Atributoj de Ĉelo",
TableProperties : "Atributoj de Tabelo",
ImageProperties : "Atributoj de Bildo",
FlashProperties : "Flash Properties", //MISSING
 
AnchorProp : "Ankraj Atributoj",
ButtonProp : "Butonaj Atributoj",
CheckboxProp : "Markobutonaj Atributoj",
HiddenFieldProp : "Atributoj de Kaŝita Kampo",
RadioButtonProp : "Radiobutonaj Atributoj",
ImageButtonProp : "Bildbutonaj Atributoj",
TextFieldProp : "Atributoj de Teksta Kampo",
SelectionFieldProp : "Atributoj de Elekta Kampo",
TextareaProp : "Atributoj de Teksta Areo",
FormProp : "Formularaj Atributoj",
 
FontFormats : "Normala;Formatita;Adreso;Titolo 1;Titolo 2;Titolo 3;Titolo 4;Titolo 5;Titolo 6;Paragrafo (DIV)",
 
// Alerts and Messages
ProcessingXHTML : "Traktado de XHTML. Bonvolu pacienci...",
Done : "Finita",
PasteWordConfirm : "La algluota teksto ŝajnas esti Word-devena. Ĉu vi volas purigi ĝin antaŭ ol interglui?",
NotCompatiblePaste : "Tiu ĉi komando bezonas almenaŭ Internet Explorer 5.5. Ĉu vi volas daŭrigi sen purigado?",
UnknownToolbarItem : "Ilobretero nekonata \"%1\"",
UnknownCommand : "Komandonomo nekonata \"%1\"",
NotImplemented : "Komando ne ankoraŭ realigita",
UnknownToolbarSet : "La ilobreto \"%1\" ne ekzistas",
NoActiveX : "Your browser's security settings could limit some features of the editor. You must enable the option \"Run ActiveX controls and plug-ins\". You may experience errors and notice missing features.", //MISSING
BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.", //MISSING
DialogBlocked : "It was not possible to open the dialog window. Make sure all popup blockers are disabled.", //MISSING
 
// Dialogs
DlgBtnOK : "Akcepti",
DlgBtnCancel : "Rezigni",
DlgBtnClose : "Fermi",
DlgBtnBrowseServer : "Foliumi en la Servilo",
DlgAdvancedTag : "Speciala",
DlgOpOther : "<Alia>",
DlgInfoTab : "Info", //MISSING
DlgAlertUrl : "Please insert the URL", //MISSING
 
// General Dialogs Labels
DlgGenNotSet : "<Defaŭlta>",
DlgGenId : "Id",
DlgGenLangDir : "Skribdirekto",
DlgGenLangDirLtr : "De maldekstro dekstren (LTR)",
DlgGenLangDirRtl : "De dekstro maldekstren (RTL)",
DlgGenLangCode : "Lingva Kodo",
DlgGenAccessKey : "Fulmoklavo",
DlgGenName : "Nomo",
DlgGenTabIndex : "Taba Ordo",
DlgGenLongDescr : "URL de Longa Priskribo",
DlgGenClass : "Klasoj de Stilfolioj",
DlgGenTitle : "Indika Titolo",
DlgGenContType : "Indika Enhavotipo",
DlgGenLinkCharset : "Signaro de la Ligita Rimedo",
DlgGenStyle : "Stilo",
 
// Image Dialog
DlgImgTitle : "Atributoj de Bildo",
DlgImgInfoTab : "Informoj pri Bildo",
DlgImgBtnUpload : "Sendu al Servilo",
DlgImgURL : "URL",
DlgImgUpload : "Alŝuti",
DlgImgAlt : "Anstataŭiga Teksto",
DlgImgWidth : "Larĝo",
DlgImgHeight : "Alto",
DlgImgLockRatio : "Konservi Proporcion",
DlgBtnResetSize : "Origina Grando",
DlgImgBorder : "Bordero",
DlgImgHSpace : "HSpaco",
DlgImgVSpace : "VSpaco",
DlgImgAlign : "Ĝisrandigo",
DlgImgAlignLeft : "Maldekstre",
DlgImgAlignAbsBottom: "Abs Malsupre",
DlgImgAlignAbsMiddle: "Abs Centre",
DlgImgAlignBaseline : "Je Malsupro de Teksto",
DlgImgAlignBottom : "Malsupre",
DlgImgAlignMiddle : "Centre",
DlgImgAlignRight : "Dekstre",
DlgImgAlignTextTop : "Je Supro de Teksto",
DlgImgAlignTop : "Supre",
DlgImgPreview : "Vidigi Aspekton",
DlgImgAlertUrl : "Bonvolu tajpi la URL de la bildo",
DlgImgLinkTab : "Link", //MISSING
 
// Flash Dialog
DlgFlashTitle : "Flash Properties", //MISSING
DlgFlashChkPlay : "Auto Play", //MISSING
DlgFlashChkLoop : "Loop", //MISSING
DlgFlashChkMenu : "Enable Flash Menu", //MISSING
DlgFlashScale : "Scale", //MISSING
DlgFlashScaleAll : "Show all", //MISSING
DlgFlashScaleNoBorder : "No Border", //MISSING
DlgFlashScaleFit : "Exact Fit", //MISSING
 
// Link Dialog
DlgLnkWindowTitle : "Ligilo",
DlgLnkInfoTab : "Informoj pri la Ligilo",
DlgLnkTargetTab : "Celo",
 
DlgLnkType : "Tipo de Ligilo",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Ankri en tiu ĉi paĝo",
DlgLnkTypeEMail : "Retpoŝto",
DlgLnkProto : "Protokolo",
DlgLnkProtoOther : "<alia>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Elekti Ankron",
DlgLnkAnchorByName : "Per Ankronomo",
DlgLnkAnchorById : "Per Elementidentigilo",
DlgLnkNoAnchors : "<Ne disponeblas ankroj en la dokumento>",
DlgLnkEMail : "Retadreso",
DlgLnkEMailSubject : "Temlinio",
DlgLnkEMailBody : "Mesaĝa korpo",
DlgLnkUpload : "Alŝuti",
DlgLnkBtnUpload : "Sendi al Servilo",
 
DlgLnkTarget : "Celo",
DlgLnkTargetFrame : "<kadro>",
DlgLnkTargetPopup : "<ŝprucfenestro>",
DlgLnkTargetBlank : "Nova Fenestro (_blank)",
DlgLnkTargetParent : "Gepatra Fenestro (_parent)",
DlgLnkTargetSelf : "Sama Fenestro (_self)",
DlgLnkTargetTop : "Plej Supra Fenestro (_top)",
DlgLnkTargetFrameName : "Nomo de Kadro",
DlgLnkPopWinName : "Nomo de Ŝprucfenestro",
DlgLnkPopWinFeat : "Atributoj de la Ŝprucfenestro",
DlgLnkPopResize : "Grando Ŝanĝebla",
DlgLnkPopLocation : "Adresobreto",
DlgLnkPopMenu : "Menubreto",
DlgLnkPopScroll : "Rulumlisteloj",
DlgLnkPopStatus : "Statobreto",
DlgLnkPopToolbar : "Ilobreto",
DlgLnkPopFullScrn : "Tutekrane (IE)",
DlgLnkPopDependent : "Dependa (Netscape)",
DlgLnkPopWidth : "Larĝo",
DlgLnkPopHeight : "Alto",
DlgLnkPopLeft : "Pozicio de Maldekstro",
DlgLnkPopTop : "Pozicio de Supro",
 
DlnLnkMsgNoUrl : "Bonvolu entajpi la URL-on",
DlnLnkMsgNoEMail : "Bonvolu entajpi la retadreson",
DlnLnkMsgNoAnchor : "Bonvolu elekti ankron",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "Elekti",
DlgColorBtnClear : "Forigi",
DlgColorHighlight : "Emfazi",
DlgColorSelected : "Elektita",
 
// Smiley Dialog
DlgSmileyTitle : "Enmeti Mienvinjeton",
 
// Special Character Dialog
DlgSpecialCharTitle : "Enmeti Specialan Signon",
 
// Table Dialog
DlgTableTitle : "Atributoj de Tabelo",
DlgTableRows : "Linioj",
DlgTableColumns : "Kolumnoj",
DlgTableBorder : "Bordero",
DlgTableAlign : "Ĝisrandigo",
DlgTableAlignNotSet : "<Defaŭlte>",
DlgTableAlignLeft : "Maldekstre",
DlgTableAlignCenter : "Centre",
DlgTableAlignRight : "Dekstre",
DlgTableWidth : "Larĝo",
DlgTableWidthPx : "Bitbilderoj",
DlgTableWidthPc : "elcentoj",
DlgTableHeight : "Alto",
DlgTableCellSpace : "Interspacigo de Ĉeloj",
DlgTableCellPad : "Ĉirkaŭenhava Plenigado",
DlgTableCaption : "Titolo",
DlgTableSummary : "Summary", //MISSING
 
// Table Cell Dialog
DlgCellTitle : "Atributoj de Celo",
DlgCellWidth : "Larĝo",
DlgCellWidthPx : "bitbilderoj",
DlgCellWidthPc : "elcentoj",
DlgCellHeight : "Alto",
DlgCellWordWrap : "Linifaldo",
DlgCellWordWrapNotSet : "<Defaŭlte>",
DlgCellWordWrapYes : "Jes",
DlgCellWordWrapNo : "Ne",
DlgCellHorAlign : "Horizonta Ĝisrandigo",
DlgCellHorAlignNotSet : "<Defaŭlte>",
DlgCellHorAlignLeft : "Maldekstre",
DlgCellHorAlignCenter : "Centre",
DlgCellHorAlignRight: "Dekstre",
DlgCellVerAlign : "Vertikala Ĝisrandigo",
DlgCellVerAlignNotSet : "<Defaŭlte>",
DlgCellVerAlignTop : "Supre",
DlgCellVerAlignMiddle : "Centre",
DlgCellVerAlignBottom : "Malsupre",
DlgCellVerAlignBaseline : "Je Malsupro de Teksto",
DlgCellRowSpan : "Linioj Kunfanditaj",
DlgCellCollSpan : "Kolumnoj Kunfanditaj",
DlgCellBackColor : "Fono",
DlgCellBorderColor : "Bordero",
DlgCellBtnSelect : "Elekti...",
 
// Find Dialog
DlgFindTitle : "Serĉi",
DlgFindFindBtn : "Serĉi",
DlgFindNotFoundMsg : "La celteksto ne estas trovita.",
 
// Replace Dialog
DlgReplaceTitle : "Anstataŭigi",
DlgReplaceFindLbl : "Serĉi:",
DlgReplaceReplaceLbl : "Anstataŭigi per:",
DlgReplaceCaseChk : "Kongruigi Usklecon",
DlgReplaceReplaceBtn : "Anstataŭigi",
DlgReplaceReplAllBtn : "Anstataŭigi Ĉiun",
DlgReplaceWordChk : "Tuta Vorto",
 
// Paste Operations / Dialog
PasteErrorPaste : "La sekurecagordo de via TTT-legilo ne permesas, ke la redaktilo faras intergluajn operaciojn. Bonvolu uzi la klavaron por tio (ctrl-V).",
PasteErrorCut : "La sekurecagordo de via TTT-legilo ne permesas, ke la redaktilo faras eltondajn operaciojn. Bonvolu uzi la klavaron por tio (ctrl-X).",
PasteErrorCopy : "La sekurecagordo de via TTT-legilo ne permesas, ke la redaktilo faras kopiajn operaciojn. Bonvolu uzi la klavaron por tio (ctrl-C).",
 
PasteAsText : "Interglui kiel Tekston",
PasteFromWord : "Interglui el Word",
 
DlgPasteMsg2 : "Please paste inside the following box using the keyboard (<STRONG>Ctrl+V</STRONG>) and hit <STRONG>OK</STRONG>.", //MISSING
DlgPasteIgnoreFont : "Ignore Font Face definitions", //MISSING
DlgPasteRemoveStyles : "Remove Styles definitions", //MISSING
DlgPasteCleanBox : "Clean Up Box", //MISSING
 
// Color Picker
ColorAutomatic : "Aŭtomata",
ColorMoreColors : "Pli da Koloroj...",
 
// Document Properties
DocProps : "Dokumentaj Atributoj",
 
// Anchor Dialog
DlgAnchorTitle : "Ankraj Atributoj",
DlgAnchorName : "Ankra Nomo",
DlgAnchorErrorName : "Bv tajpi la ankran nomon",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Ne trovita en la vortaro",
DlgSpellChangeTo : "Ŝanĝi al",
DlgSpellBtnIgnore : "Malatenti",
DlgSpellBtnIgnoreAll : "Malatenti Ĉiun",
DlgSpellBtnReplace : "Anstataŭigi",
DlgSpellBtnReplaceAll : "Anstataŭigi Ĉiun",
DlgSpellBtnUndo : "Malfari",
DlgSpellNoSuggestions : "- Neniu propono -",
DlgSpellProgress : "Literumkontrolado daŭras...",
DlgSpellNoMispell : "Literumkontrolado finita: neniu fuŝo trovita",
DlgSpellNoChanges : "Literumkontrolado finita: neniu vorto ŝanĝita",
DlgSpellOneChange : "Literumkontrolado finita: unu vorto ŝanĝita",
DlgSpellManyChanges : "Literumkontrolado finita: %1 vortoj ŝanĝitaj",
 
IeSpellDownload : "Literumada Kontrolilo ne instalita. Ĉu vi volas elŝuti ĝin nun?",
 
// Button Dialog
DlgButtonText : "Teksto (Valoro)",
DlgButtonType : "Tipo",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Nomo",
DlgCheckboxValue : "Valoro",
DlgCheckboxSelected : "Elektita",
 
// Form Dialog
DlgFormName : "Nomo",
DlgFormAction : "Ago",
DlgFormMethod : "Metodo",
 
// Select Field Dialog
DlgSelectName : "Nomo",
DlgSelectValue : "Valoro",
DlgSelectSize : "Grando",
DlgSelectLines : "Linioj",
DlgSelectChkMulti : "Permesi Plurajn Elektojn",
DlgSelectOpAvail : "Elektoj Disponeblaj",
DlgSelectOpText : "Teksto",
DlgSelectOpValue : "Valoro",
DlgSelectBtnAdd : "Aldoni",
DlgSelectBtnModify : "Modifi",
DlgSelectBtnUp : "Supren",
DlgSelectBtnDown : "Malsupren",
DlgSelectBtnSetValue : "Agordi kiel Elektitan Valoron",
DlgSelectBtnDelete : "Forigi",
 
// Textarea Dialog
DlgTextareaName : "Nomo",
DlgTextareaCols : "Kolumnoj",
DlgTextareaRows : "Vicoj",
 
// Text Field Dialog
DlgTextName : "Nomo",
DlgTextValue : "Valoro",
DlgTextCharWidth : "Signolarĝo",
DlgTextMaxChars : "Maksimuma Nombro da Signoj",
DlgTextType : "Tipo",
DlgTextTypeText : "Teksto",
DlgTextTypePass : "Pasvorto",
 
// Hidden Field Dialog
DlgHiddenName : "Nomo",
DlgHiddenValue : "Valoro",
 
// Bulleted List Dialog
BulletedListProp : "Atributoj de Bula Listo",
NumberedListProp : "Atributoj de Numera Listo",
DlgLstStart : "Start", //MISSING
DlgLstType : "Tipo",
DlgLstTypeCircle : "Cirklo",
DlgLstTypeDisc : "Disc", //MISSING
DlgLstTypeSquare : "Kvadrato",
DlgLstTypeNumbers : "Ciferoj (1, 2, 3)",
DlgLstTypeLCase : "Minusklaj Literoj (a, b, c)",
DlgLstTypeUCase : "Majusklaj Literoj (A, B, C)",
DlgLstTypeSRoman : "Malgrandaj Romanaj Ciferoj (i, ii, iii)",
DlgLstTypeLRoman : "Grandaj Romanaj Ciferoj (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "Ĝeneralaĵoj",
DlgDocBackTab : "Fono",
DlgDocColorsTab : "Koloroj kaj Marĝenoj",
DlgDocMetaTab : "Metadatumoj",
 
DlgDocPageTitle : "Paĝotitolo",
DlgDocLangDir : "Skribdirekto de la Lingvo",
DlgDocLangDirLTR : "De maldekstro dekstren (LTR)",
DlgDocLangDirRTL : "De dekstro maldekstren (LTR)",
DlgDocLangCode : "Lingvokodo",
DlgDocCharSet : "Signara Kodo",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "Alia Signara Kodo",
 
DlgDocDocType : "Dokumenta Tipo",
DlgDocDocTypeOther : "Alia Dokumenta Tipo",
DlgDocIncXHTML : "Inkluzivi XHTML Deklaroj",
DlgDocBgColor : "Fona Koloro",
DlgDocBgImage : "URL de Fona Bildo",
DlgDocBgNoScroll : "Neruluma Fono",
DlgDocCText : "Teksto",
DlgDocCLink : "Ligilo",
DlgDocCVisited : "Vizitita Ligilo",
DlgDocCActive : "Aktiva Ligilo",
DlgDocMargins : "Paĝaj Marĝenoj",
DlgDocMaTop : "Supra",
DlgDocMaLeft : "Maldekstra",
DlgDocMaRight : "Dekstra",
DlgDocMaBottom : "Malsupra",
DlgDocMeIndex : "Ŝlosilvortoj de la Dokumento (apartigita de komoj)",
DlgDocMeDescr : "Dokumenta Priskribo",
DlgDocMeAuthor : "Verkinto",
DlgDocMeCopy : "Kopirajto",
DlgDocPreview : "Aspekto",
 
// Templates Dialog
Templates : "Templates", //MISSING
DlgTemplatesTitle : "Content Templates", //MISSING
DlgTemplatesSelMsg : "Please select the template to open in the editor<br>(the actual contents will be lost):", //MISSING
DlgTemplatesLoading : "Loading templates list. Please wait...", //MISSING
DlgTemplatesNoTpl : "(No templates defined)", //MISSING
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "Pri",
DlgAboutBrowserInfoTab : "Informoj pri TTT-legilo",
DlgAboutLicenseTab : "License", //MISSING
DlgAboutVersion : "versio",
DlgAboutLicense : "Disdonata laŭ la GNU Lesser General Public License",
DlgAboutInfo : "Por pli da informoj, vizitu"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/fo.js
New file
0,0 → 1,502
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fo.js
* Faroese language file.
*
* File Authors:
* Símin Lassaberg
* Helgi Arnthorsson
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Goym amboðalistan",
ToolbarExpand : "Vís amboðalistan",
 
// Toolbar Items and Context Menu
Save : "Geim",
NewPage : "Nýggj síða",
Preview : "Vís dømi",
Cut : "Klipp",
Copy : "Avrita",
Paste : "Set inn",
PasteText : "Set inn sum reinan tekst",
PasteWord : "Set inn frá Word",
Print : "Prenta",
SelectAll : "Markera alt",
RemoveFormat : "Sletta sniðgeving",
InsertLinkLbl : "Leinkja",
InsertLink : "Seta inn/Broyta Leinkju",
RemoveLink : "Sletta Leinkju",
Anchor : "Seta inn/Broyta staðsetingarmerki",
InsertImageLbl : "Seta inn mynd",
InsertImage : "Seta inn/Broyta mynd",
InsertFlashLbl : "Flash", //MISSING
InsertFlash : "Insert/Edit Flash", //MISSING
InsertTableLbl : "Talva",
InsertTable : "Seta inn/Broyta talvu",
InsertLineLbl : "Linja",
InsertLine : "Seta inn vatnrætta linju",
InsertSpecialCharLbl: "Serlig tekn",
InsertSpecialChar : "Seta inn serligt tekn",
InsertSmileyLbl : "Smiley",
InsertSmiley : "Seta inn Smiley",
About : "Um FCKeditor",
Bold : "Feit",
Italic : "Skástillað",
Underline : "Undirstrikað",
StrikeThrough : "Strikað yvir",
Subscript : "Lækkað skrift",
Superscript : "Hækkað skrift",
LeftJustify : "Vinstristillað",
CenterJustify : "Miðstillað",
RightJustify : "Hægristillað",
BlockJustify : "Beinir tekstkantar",
DecreaseIndent : "Økja innrykk",
IncreaseIndent : "Minka innrykk",
Undo : "Angra",
Redo : "Broyt aftur í upprunamynd",
NumberedListLbl : "Talsettur listi",
NumberedList : "Seta inn/Sletta talsettan lista",
BulletedListLbl : "Punktsettur listi",
BulletedList : "Seta inn/Sletta punktsettan lista",
ShowTableBorders : "Vísa talvukantar ",
ShowDetails : "Vísa detaljur",
Style : "Tekstsnið",
FontFormat : "Sniðgeving",
Font : "Skrift",
FontSize : "Skriftstødd",
TextColor : "Tekstlitur",
BGColor : "Litur aftanfyri",
Source : "Kelda",
Find : "Leita",
Replace : "Set í staðin",
SpellCheck : "Stavseting",
UniversalKeyboard : "Universalt Tastatur",
PageBreakLbl : "Page Break", //MISSING
PageBreak : "Insert Page Break", //MISSING
 
Form : "Seta inn Form",
Checkbox : "Seta inn Avmerkingarboks",
RadioButton : "Seta inn Radioknap",
TextField : "Seta inn Tekstteig",
Textarea : "Seta inn Tekstøki",
HiddenField : "Seta inn GoymdanTeig",
Button : "Seta inn knapp",
SelectionField : "Seta inn Valteig",
ImageButton : "Seta inn Myndaknapp",
 
FitWindow : "Maximize the editor size", //MISSING
 
// Context Menu
EditLink : "Broyt leinkju",
CellCM : "Cell", //MISSING
RowCM : "Row", //MISSING
ColumnCM : "Column", //MISSING
InsertRow : "Seta inn rekkju",
DeleteRows : "Sletta rekkjur",
InsertColumn : "Seta inn søjlur",
DeleteColumns : "Sletta søjlur",
InsertCell : "Seta inn sellu",
DeleteCells : "Sletta sellu",
MergeCells : "Flætta sellur",
SplitCell : "Deila sellur",
TableDelete : "Delete Table", //MISSING
CellProperties : "Eginleikar fyri sellu",
TableProperties : "Eginleikar fyri talvu",
ImageProperties : "Eginleikar fyri mynd",
FlashProperties : "Flash Properties", //MISSING
 
AnchorProp : "Eginleikar fyri staðsetingarpunkt",
ButtonProp : "Eginleikar fyri knapp",
CheckboxProp : "Eginleikar fyri avmerkingarboks",
HiddenFieldProp : "Eginleikar fyri goymdan teig",
RadioButtonProp : "Eginleikar fyri radioknapp",
ImageButtonProp : "Eginleikar fyri myndaknapp",
TextFieldProp : "Eginleikar fyri Tekstateig",
SelectionFieldProp : "Eginleikar fyri Valteig",
TextareaProp : "Eginleikar fyri Tekstaøki",
FormProp : "Eginleikar fyri form",
 
FontFormats : "Normalt;Sniðgevið;Adressa;Yvirskrift 1;Yvirskrift 2;Yvirskrift 3;Yvirskrift 4;Yvirskrift 5;Yvirskrift 6",
 
// Alerts and Messages
ProcessingXHTML : "Viðgerir XHTML. Bíða...",
Done : "Liðugt",
PasteWordConfirm : "Teksturin, tú roynir at seta inn, sýnist at vera frá Word. Vilt tú reinsa tekstin, áðrenn hann verður settur inn?",
NotCompatiblePaste : "Hesin ordri er tøkur í Internet Explorer 5.5 og nýggjari. Vilt tú seta tekstin inn, uttan at reinsa hann?",
UnknownToolbarItem : "Ókendur lutur í amboðalinju \"%1\"",
UnknownCommand : "Kenni ikki ordra \"%1\"",
NotImplemented : "Ordrin er ikki gjørdur virkin",
UnknownToolbarSet : "Amboðalinjan \"%1\" finst ikki",
NoActiveX : "Your browser's security settings could limit some features of the editor. You must enable the option \"Run ActiveX controls and plug-ins\". You may experience errors and notice missing features.", //MISSING
BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.", //MISSING
DialogBlocked : "It was not possible to open the dialog window. Make sure all popup blockers are disabled.", //MISSING
 
// Dialogs
DlgBtnOK : "OK",
DlgBtnCancel : "Angra",
DlgBtnClose : "Lukka",
DlgBtnBrowseServer : "Hyggja á servara",
DlgAdvancedTag : "Útvíðka",
DlgOpOther : "<Annað>",
DlgInfoTab : "Info", //MISSING
DlgAlertUrl : "Please insert the URL", //MISSING
 
// General Dialogs Labels
DlgGenNotSet : "<ikki sett>",
DlgGenId : "Id",
DlgGenLangDir : "Tekstakós",
DlgGenLangDirLtr : "Vinstri móti høgri (LTR)",
DlgGenLangDirRtl : "Høgri móti vinstri (RTL)",
DlgGenLangCode : "Málkoda",
DlgGenAccessKey : "Atgongdslykil",
DlgGenName : "Navn",
DlgGenTabIndex : "Tabulator Indeks",
DlgGenLongDescr : "víðka frágreiðing",
DlgGenClass : "Typografiark",
DlgGenTitle : "Heiti",
DlgGenContType : "Innihaldsslag",
DlgGenLinkCharset : "Teknset",
DlgGenStyle : "Prentlist",
 
// Image Dialog
DlgImgTitle : "Mynd eginleikar",
DlgImgInfoTab : "Mynd info",
DlgImgBtnUpload : "Send til serveren",
DlgImgURL : "URL",
DlgImgUpload : "Upload",
DlgImgAlt : "Annar tekstur",
DlgImgWidth : "Breidd",
DlgImgHeight : "Hædd",
DlgImgLockRatio : "Læs støddarlutfall",
DlgBtnResetSize : "Nulstilla stødd",
DlgImgBorder : "Ramma",
DlgImgHSpace : "HMargin",
DlgImgVSpace : "VMargin",
DlgImgAlign : "Justering",
DlgImgAlignLeft : "Vinstra",
DlgImgAlignAbsBottom: "Abs botnur",
DlgImgAlignAbsMiddle: "Abs Miðja",
DlgImgAlignBaseline : "Botnlinja",
DlgImgAlignBottom : "Botnur",
DlgImgAlignMiddle : "Miðja",
DlgImgAlignRight : "Høgra",
DlgImgAlignTextTop : "Tekstur ovast",
DlgImgAlignTop : "Ovast",
DlgImgPreview : "Vís dømi",
DlgImgAlertUrl : "Slá inn slóðina til myndina",
DlgImgLinkTab : "Leinkja",
 
// Flash Dialog
DlgFlashTitle : "Flash Properties", //MISSING
DlgFlashChkPlay : "Auto Play", //MISSING
DlgFlashChkLoop : "Loop", //MISSING
DlgFlashChkMenu : "Enable Flash Menu", //MISSING
DlgFlashScale : "Scale", //MISSING
DlgFlashScaleAll : "Show all", //MISSING
DlgFlashScaleNoBorder : "No Border", //MISSING
DlgFlashScaleFit : "Exact Fit", //MISSING
 
// Link Dialog
DlgLnkWindowTitle : "Leinkja",
DlgLnkInfoTab : "Leinkju info",
DlgLnkTargetTab : "Mál",
 
DlgLnkType : "Leinkju slag",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Akker á hesari síðuni",
DlgLnkTypeEMail : "Teldupostur",
DlgLnkProto : "Protokoll",
DlgLnkProtoOther : "<onnur>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "VEl eitt akker",
DlgLnkAnchorByName : "Eftir akker navni",
DlgLnkAnchorById : "Eftir element Id",
DlgLnkNoAnchors : "<Tað eru ongi akker tøk í hesum dokumentinum;",
DlgLnkEMail : "Teldupost Adresse",
DlgLnkEMailSubject : "Evni",
DlgLnkEMailBody : "Boð",
DlgLnkUpload : "Upload",
DlgLnkBtnUpload : "Send til servaran",
 
DlgLnkTarget : "Mál",
DlgLnkTargetFrame : "<ramma>",
DlgLnkTargetPopup : "<popup vindeyga>",
DlgLnkTargetBlank : "Nytt vindeyga (_blank)",
DlgLnkTargetParent : "Omaná liggjandi vindeyga (_parent)",
DlgLnkTargetSelf : "Sama vindeyga (_self)",
DlgLnkTargetTop : "ovasta vindeyga (_top)",
DlgLnkTargetFrameName : "vísa vindeygas navn",
DlgLnkPopWinName : "Popup vindeygas navn",
DlgLnkPopWinFeat : "Popup vindeygas eginleikar",
DlgLnkPopResize : "Skalering",
DlgLnkPopLocation : "Lokationslinja",
DlgLnkPopMenu : "Menulinja",
DlgLnkPopScroll : "Scrollbars",
DlgLnkPopStatus : "Statuslinja",
DlgLnkPopToolbar : "Værktøjslinja",
DlgLnkPopFullScrn : "Fullur skermur (IE)",
DlgLnkPopDependent : "Bundin (Netscape)",
DlgLnkPopWidth : "Breidd",
DlgLnkPopHeight : "Hædd",
DlgLnkPopLeft : "Positión frá vinstru",
DlgLnkPopTop : "Positión frá toppinum",
 
DlnLnkMsgNoUrl : "Inntasta leinkju URL",
DlnLnkMsgNoEMail : "Inntasta teldupost addressuna",
DlnLnkMsgNoAnchor : "Vel akker",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "vel farvu",
DlgColorBtnClear : "sletta alt",
DlgColorHighlight : "Markera",
DlgColorSelected : "valt",
 
// Smiley Dialog
DlgSmileyTitle : "Innset ein smiley",
 
// Special Character Dialog
DlgSpecialCharTitle : "vel specialkarakter",
 
// Table Dialog
DlgTableTitle : "Tabel eginleikar",
DlgTableRows : "Rekkjur",
DlgTableColumns : "Kolonnur",
DlgTableBorder : "Rammu stødd",
DlgTableAlign : "Justering",
DlgTableAlignNotSet : "<Ikki sett>",
DlgTableAlignLeft : "Vinstrastilla",
DlgTableAlignCenter : "Miðseta",
DlgTableAlignRight : "Høgrastilla",
DlgTableWidth : "Breidd",
DlgTableWidthPx : "pixels",
DlgTableWidthPc : "prosent",
DlgTableHeight : "Hædd",
DlgTableCellSpace : "Fjarstøða millum sellur",
DlgTableCellPad : "Sellu breddi",
DlgTableCaption : "Heiti",
DlgTableSummary : "Summary", //MISSING
 
// Table Cell Dialog
DlgCellTitle : "Sellu eginleikar",
DlgCellWidth : "Breidd",
DlgCellWidthPx : "pixels",
DlgCellWidthPc : "prosent",
DlgCellHeight : "Hædd",
DlgCellWordWrap : "Orðbýti",
DlgCellWordWrapNotSet : "<Ikki sett>",
DlgCellWordWrapYes : "Ja",
DlgCellWordWrapNo : "Nej",
DlgCellHorAlign : "Horisontal justering",
DlgCellHorAlignNotSet : "<Ikke sat>",
DlgCellHorAlignLeft : "Vinstrastilla",
DlgCellHorAlignCenter : "Miðsett",
DlgCellHorAlignRight: "Høgrastilla",
DlgCellVerAlign : "Lodrøtt Justering",
DlgCellVerAlignNotSet : "<Ikki sett>",
DlgCellVerAlignTop : "Ovast",
DlgCellVerAlignMiddle : "Miðja",
DlgCellVerAlignBottom : "Niðast",
DlgCellVerAlignBaseline : "Botnlinja",
DlgCellRowSpan : "Tal av rekkjum sellan spennur yvir",
DlgCellCollSpan : "Tal av talrøðum sellan spennur yvir",
DlgCellBackColor : "Bakgrundsfarva",
DlgCellBorderColor : "rammufarva",
DlgCellBtnSelect : "Vel...",
 
// Find Dialog
DlgFindTitle : "Finn",
DlgFindFindBtn : "Finn",
DlgFindNotFoundMsg : "Teksturin bleiv ikki funnin",
 
// Replace Dialog
DlgReplaceTitle : "Set í staðin",
DlgReplaceFindLbl : "Finn:",
DlgReplaceReplaceLbl : "Set í staðin við:",
DlgReplaceCaseChk : "Munur á stórum og smáðum stavum",
DlgReplaceReplaceBtn : "Set í staðin",
DlgReplaceReplAllBtn : "Skift alt út",
DlgReplaceWordChk : "Bert heil orð",
 
// Paste Operations / Dialog
PasteErrorPaste : "Leitarans trygdarinstillingar loyva ikki editorinum at innseta tekstin automatiskt. Brúka knappaborðið til at innseta tekstin (Ctrl+V).",
PasteErrorCut : "Leitarans trygdarinstillingar loyva ikki editorinum at klippa tekstin automatiskt. Brúka í staðin knappaborðið til at klippa tekstin (Ctrl+X).",
PasteErrorCopy : "Leitarans trygdarinstillingar loyva ikki editorinum at avrita tekstin automatiskt. Brúka í staðin knappaborðið til at avrita tekstin (Ctrl+V).",
 
PasteAsText : "Seta inn som reinur tekstur",
PasteFromWord : "Seta inn fra Word",
 
DlgPasteMsg2 : "Please paste inside the following box using the keyboard (<STRONG>Ctrl+V</STRONG>) and hit <STRONG>OK</STRONG>.", //MISSING
DlgPasteIgnoreFont : "Ignore Font Face definitions", //MISSING
DlgPasteRemoveStyles : "Remove Styles definitions", //MISSING
DlgPasteCleanBox : "Clean Up Box", //MISSING
 
// Color Picker
ColorAutomatic : "Automatisk",
ColorMoreColors : "Fleiri farvur...",
 
// Document Properties
DocProps : "Dokument eginleikar",
 
// Anchor Dialog
DlgAnchorTitle : "Akker eginleikar",
DlgAnchorName : "Akker navn",
DlgAnchorErrorName : "Slá innn akker navn",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Finnst ikki í orðabókini",
DlgSpellChangeTo : "broyta til",
DlgSpellBtnIgnore : "Ignorera",
DlgSpellBtnIgnoreAll : "Ignorera alt",
DlgSpellBtnReplace : "Skift út",
DlgSpellBtnReplaceAll : "Skift út alt",
DlgSpellBtnUndo : "Aftur",
DlgSpellNoSuggestions : "- Einki uppskot -",
DlgSpellProgress : "Stavarin arbeiðir...",
DlgSpellNoMispell : "Stavarain liðugur: Eingin feilur funnin",
DlgSpellNoChanges : "Stavarain liðugur: Einki orð broytt",
DlgSpellOneChange : "Stavarain liðugur: Eitt orð broytt",
DlgSpellManyChanges : "Stavarain liðugur: %1 orð broytt",
 
IeSpellDownload : "Stavarin ikki lagdur inn. vilt tú heinta hann nú?",
 
// Button Dialog
DlgButtonText : "Tekstur (Virði)",
DlgButtonType : "Slag",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Navn",
DlgCheckboxValue : "Virði",
DlgCheckboxSelected : "Valgt",
 
// Form Dialog
DlgFormName : "Navn",
DlgFormAction : "Gerð",
DlgFormMethod : "Háttur",
 
// Select Field Dialog
DlgSelectName : "Navn",
DlgSelectValue : "Virði",
DlgSelectSize : "Stødd",
DlgSelectLines : "linjir",
DlgSelectChkMulti : "Loyv fleiri valmøguleikar",
DlgSelectOpAvail : "valmøguleikar",
DlgSelectOpText : "Tekstur",
DlgSelectOpValue : "Virði",
DlgSelectBtnAdd : "Legg afturat",
DlgSelectBtnModify : "Broyt",
DlgSelectBtnUp : "Upp",
DlgSelectBtnDown : "Niður",
DlgSelectBtnSetValue : "Set sum útvald",
DlgSelectBtnDelete : "Sletta",
 
// Textarea Dialog
DlgTextareaName : "Navn",
DlgTextareaCols : "talrøð",
DlgTextareaRows : "Rekkja",
 
// Text Field Dialog
DlgTextName : "Navn",
DlgTextValue : "Virði",
DlgTextCharWidth : "Sjónligt tal av bókstavum",
DlgTextMaxChars : "Hægst loyvda tal av bókstavum",
DlgTextType : "Slag",
DlgTextTypeText : "Tekstur",
DlgTextTypePass : "Koduorð",
 
// Hidden Field Dialog
DlgHiddenName : "Navn",
DlgHiddenValue : "Virði",
 
// Bulleted List Dialog
BulletedListProp : "Punktteknsuppsetingar eginleikar",
NumberedListProp : "Taluppsetingar eginleikar",
DlgLstStart : "Start", //MISSING
DlgLstType : "Slag",
DlgLstTypeCircle : "Sirkul",
DlgLstTypeDisc : "Disc", //MISSING
DlgLstTypeSquare : "Fýrakantur",
DlgLstTypeNumbers : "Talmerkt (1, 2, 3)",
DlgLstTypeLCase : "Smáir bókstavir (a, b, c)",
DlgLstTypeUCase : "Stórir bókstavir (A, B, C)",
DlgLstTypeSRoman : "Smá rómaratøl (i, ii, iii)",
DlgLstTypeLRoman : "Stór rómaratøl (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "Generelt",
DlgDocBackTab : "Bakgrund",
DlgDocColorsTab : "Farva og Breddin",
DlgDocMetaTab : "Meta Information",
 
DlgDocPageTitle : "Síðu heiti",
DlgDocLangDir : "Mál",
DlgDocLangDirLTR : "Frá vinstru móti høgru (LTR)",
DlgDocLangDirRTL : "Frá høgru móti vinstru (RTL)",
DlgDocLangCode : "Landakoda",
DlgDocCharSet : "Karakter set kodu",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "Annar karakter set kodu",
 
DlgDocDocType : "Dokument slag kategori",
DlgDocDocTypeOther : "Annað dokument slag kategori",
DlgDocIncXHTML : "Inkludere XHTML deklartion",
DlgDocBgColor : "Bakgrundsfarva",
DlgDocBgImage : "Bakgrundsmynd URL",
DlgDocBgNoScroll : "Ikki scrollbar bakgrund",
DlgDocCText : "Tekstur",
DlgDocCLink : "Leinkja",
DlgDocCVisited : "Vitja leinkja",
DlgDocCActive : "Aktiv leinkja",
DlgDocMargins : "Síðu breddi",
DlgDocMaTop : "Ovast",
DlgDocMaLeft : "Vinstra",
DlgDocMaRight : "Høgra",
DlgDocMaBottom : "Niðast",
DlgDocMeIndex : "Dokument index lyklaorð (komma sundurskilt)",
DlgDocMeDescr : "Dokument lýsing",
DlgDocMeAuthor : "Høvundur",
DlgDocMeCopy : "Copyright",
DlgDocPreview : "Vís",
 
// Templates Dialog
Templates : "Frymlar",
DlgTemplatesTitle : "Innihaldsfrymlar",
DlgTemplatesSelMsg : "Vel tann frymilin, sum skal opnast í editorinum<br>(Tað verður skriva útyvir núverandi innihald):",
DlgTemplatesLoading : "Heintar lista yvir frymlar. Vinarliga bíða...",
DlgTemplatesNoTpl : "(Ongin frymil er valdur)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "Um",
DlgAboutBrowserInfoTab : "Browsara upplýsingar",
DlgAboutLicenseTab : "License", //MISSING
DlgAboutVersion : "versión",
DlgAboutLicense : "Loyvi undir treytum fyri GNU Lesser General Public License",
DlgAboutInfo : "Fleiri upplýsingar, far til"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/bs.js
New file
0,0 → 1,501
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: bs.js
* Bosnian language file.
*
* File Authors:
* Muris Trax (www.elektronika.ba)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Skupi trake sa alatima",
ToolbarExpand : "Otvori trake sa alatima",
 
// Toolbar Items and Context Menu
Save : "Snimi",
NewPage : "Novi dokument",
Preview : "Prikaži",
Cut : "Izreži",
Copy : "Kopiraj",
Paste : "Zalijepi",
PasteText : "Zalijepi kao obièan tekst",
PasteWord : "Zalijepi iz Word-a",
Print : "Štampaj",
SelectAll : "Selektuj sve",
RemoveFormat : "Poništi format",
InsertLinkLbl : "Link",
InsertLink : "Ubaci/Izmjeni link",
RemoveLink : "Izbriši link",
Anchor : "Insert/Edit Anchor", //MISSING
InsertImageLbl : "Slika",
InsertImage : "Ubaci/Izmjeni sliku",
InsertFlashLbl : "Flash", //MISSING
InsertFlash : "Insert/Edit Flash", //MISSING
InsertTableLbl : "Tabela",
InsertTable : "Ubaci/Izmjeni tabelu",
InsertLineLbl : "Linija",
InsertLine : "Ubaci horizontalnu liniju",
InsertSpecialCharLbl: "Specijalni karakter",
InsertSpecialChar : "Ubaci specijalni karater",
InsertSmileyLbl : "Smješko",
InsertSmiley : "Ubaci smješka",
About : "O FCKeditor-u",
Bold : "Boldiraj",
Italic : "Ukosi",
Underline : "Podvuci",
StrikeThrough : "Precrtaj",
Subscript : "Subscript",
Superscript : "Superscript",
LeftJustify : "Lijevo poravnanje",
CenterJustify : "Centralno poravnanje",
RightJustify : "Desno poravnanje",
BlockJustify : "Puno poravnanje",
DecreaseIndent : "Smanji uvod",
IncreaseIndent : "Poveæaj uvod",
Undo : "Vrati",
Redo : "Ponovi",
NumberedListLbl : "Numerisana lista",
NumberedList : "Ubaci/Izmjeni numerisanu listu",
BulletedListLbl : "Lista",
BulletedList : "Ubaci/Izmjeni listu",
ShowTableBorders : "Pokaži okvire tabela",
ShowDetails : "Pokaži detalje",
Style : "Stil",
FontFormat : "Format",
Font : "Font",
FontSize : "Velièina",
TextColor : "Boja teksta",
BGColor : "Boja pozadine",
Source : "HTML kôd",
Find : "Naði",
Replace : "Zamjeni",
SpellCheck : "Check Spelling", //MISSING
UniversalKeyboard : "Universal Keyboard", //MISSING
PageBreakLbl : "Page Break", //MISSING
PageBreak : "Insert Page Break", //MISSING
 
Form : "Form", //MISSING
Checkbox : "Checkbox", //MISSING
RadioButton : "Radio Button", //MISSING
TextField : "Text Field", //MISSING
Textarea : "Textarea", //MISSING
HiddenField : "Hidden Field", //MISSING
Button : "Button", //MISSING
SelectionField : "Selection Field", //MISSING
ImageButton : "Image Button", //MISSING
 
FitWindow : "Maximize the editor size", //MISSING
 
// Context Menu
EditLink : "Izmjeni link",
CellCM : "Cell", //MISSING
RowCM : "Row", //MISSING
ColumnCM : "Column", //MISSING
InsertRow : "Ubaci red",
DeleteRows : "Briši redove",
InsertColumn : "Ubaci kolonu",
DeleteColumns : "Briši kolone",
InsertCell : "Ubaci æeliju",
DeleteCells : "BriÅ¡i æelije",
MergeCells : "Spoji æelije",
SplitCell : "Razdvoji æeliju",
TableDelete : "Delete Table", //MISSING
CellProperties : "Svojstva æelije",
TableProperties : "Svojstva tabele",
ImageProperties : "Svojstva slike",
FlashProperties : "Flash Properties", //MISSING
 
AnchorProp : "Anchor Properties", //MISSING
ButtonProp : "Button Properties", //MISSING
CheckboxProp : "Checkbox Properties", //MISSING
HiddenFieldProp : "Hidden Field Properties", //MISSING
RadioButtonProp : "Radio Button Properties", //MISSING
ImageButtonProp : "Image Button Properties", //MISSING
TextFieldProp : "Text Field Properties", //MISSING
SelectionFieldProp : "Selection Field Properties", //MISSING
TextareaProp : "Textarea Properties", //MISSING
FormProp : "Form Properties", //MISSING
 
FontFormats : "Normal;Formatted;Address;Heading 1;Heading 2;Heading 3;Heading 4;Heading 5;Heading 6",
 
// Alerts and Messages
ProcessingXHTML : "Procesiram XHTML. Molim saèekajte...",
Done : "Gotovo",
PasteWordConfirm : "Tekst koji želite zalijepiti èini se da je kopiran iz Worda. Da li želite da se prvo oèisti?",
NotCompatiblePaste : "Ova komanda je podržana u Internet Explorer-u verzijama 5.5 ili novijim. Da li želite da izvrÅ¡ite lijepljenje teksta bez èiÅ¡æenja?",
UnknownToolbarItem : "Nepoznata stavka sa trake sa alatima \"%1\"",
UnknownCommand : "Nepoznata komanda \"%1\"",
NotImplemented : "Komanda nije implementirana",
UnknownToolbarSet : "Traka sa alatima \"%1\" ne postoji",
NoActiveX : "Your browser's security settings could limit some features of the editor. You must enable the option \"Run ActiveX controls and plug-ins\". You may experience errors and notice missing features.", //MISSING
BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.", //MISSING
DialogBlocked : "It was not possible to open the dialog window. Make sure all popup blockers are disabled.", //MISSING
 
// Dialogs
DlgBtnOK : "OK",
DlgBtnCancel : "Odustani",
DlgBtnClose : "Zatvori",
DlgBtnBrowseServer : "Browse Server", //MISSING
DlgAdvancedTag : "Naprednije",
DlgOpOther : "<Other>", //MISSING
DlgInfoTab : "Info", //MISSING
DlgAlertUrl : "Please insert the URL", //MISSING
 
// General Dialogs Labels
DlgGenNotSet : "<nije podešeno>",
DlgGenId : "Id",
DlgGenLangDir : "Smjer pisanja",
DlgGenLangDirLtr : "S lijeva na desno (LTR)",
DlgGenLangDirRtl : "S desna na lijevo (RTL)",
DlgGenLangCode : "Jezièni kôd",
DlgGenAccessKey : "Pristupna tipka",
DlgGenName : "Naziv",
DlgGenTabIndex : "Tab indeks",
DlgGenLongDescr : "Dugaèki opis URL-a",
DlgGenClass : "Klase CSS stilova",
DlgGenTitle : "Advisory title",
DlgGenContType : "Advisory vrsta sadržaja",
DlgGenLinkCharset : "Linked Resource Charset",
DlgGenStyle : "Stil",
 
// Image Dialog
DlgImgTitle : "Svojstva slike",
DlgImgInfoTab : "Info slike",
DlgImgBtnUpload : "Šalji na server",
DlgImgURL : "URL",
DlgImgUpload : "Šalji",
DlgImgAlt : "Tekst na slici",
DlgImgWidth : "Širina",
DlgImgHeight : "Visina",
DlgImgLockRatio : "Zakljuèaj odnos",
DlgBtnResetSize : "Resetuj dimenzije",
DlgImgBorder : "Okvir",
DlgImgHSpace : "HSpace",
DlgImgVSpace : "VSpace",
DlgImgAlign : "Poravnanje",
DlgImgAlignLeft : "Lijevo",
DlgImgAlignAbsBottom: "Abs dole",
DlgImgAlignAbsMiddle: "Abs sredina",
DlgImgAlignBaseline : "Bazno",
DlgImgAlignBottom : "Dno",
DlgImgAlignMiddle : "Sredina",
DlgImgAlignRight : "Desno",
DlgImgAlignTextTop : "Vrh teksta",
DlgImgAlignTop : "Vrh",
DlgImgPreview : "Prikaz",
DlgImgAlertUrl : "Molimo ukucajte URL od slike.",
DlgImgLinkTab : "Link", //MISSING
 
// Flash Dialog
DlgFlashTitle : "Flash Properties", //MISSING
DlgFlashChkPlay : "Auto Play", //MISSING
DlgFlashChkLoop : "Loop", //MISSING
DlgFlashChkMenu : "Enable Flash Menu", //MISSING
DlgFlashScale : "Scale", //MISSING
DlgFlashScaleAll : "Show all", //MISSING
DlgFlashScaleNoBorder : "No Border", //MISSING
DlgFlashScaleFit : "Exact Fit", //MISSING
 
// Link Dialog
DlgLnkWindowTitle : "Link",
DlgLnkInfoTab : "Link info",
DlgLnkTargetTab : "Prozor",
 
DlgLnkType : "Tip linka",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Sidro na ovoj stranici",
DlgLnkTypeEMail : "E-Mail",
DlgLnkProto : "Protokol",
DlgLnkProtoOther : "<drugi>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Izaberi sidro",
DlgLnkAnchorByName : "Po nazivu sidra",
DlgLnkAnchorById : "Po Id-u elementa",
DlgLnkNoAnchors : "<Nema dostupnih sidra na stranici>",
DlgLnkEMail : "E-Mail Adresa",
DlgLnkEMailSubject : "Subjekt poruke",
DlgLnkEMailBody : "Poruka",
DlgLnkUpload : "Šalji",
DlgLnkBtnUpload : "Šalji na server",
 
DlgLnkTarget : "Prozor",
DlgLnkTargetFrame : "<frejm>",
DlgLnkTargetPopup : "<popup prozor>",
DlgLnkTargetBlank : "Novi prozor (_blank)",
DlgLnkTargetParent : "Glavni prozor (_parent)",
DlgLnkTargetSelf : "Isti prozor (_self)",
DlgLnkTargetTop : "Najgornji prozor (_top)",
DlgLnkTargetFrameName : "Target Frame Name", //MISSING
DlgLnkPopWinName : "Naziv popup prozora",
DlgLnkPopWinFeat : "Moguænosti popup prozora",
DlgLnkPopResize : "Promjenljive velièine",
DlgLnkPopLocation : "Traka za lokaciju",
DlgLnkPopMenu : "Izborna traka",
DlgLnkPopScroll : "Scroll traka",
DlgLnkPopStatus : "Statusna traka",
DlgLnkPopToolbar : "Traka sa alatima",
DlgLnkPopFullScrn : "Cijeli ekran (IE)",
DlgLnkPopDependent : "Ovisno (Netscape)",
DlgLnkPopWidth : "Širina",
DlgLnkPopHeight : "Visina",
DlgLnkPopLeft : "Lijeva pozicija",
DlgLnkPopTop : "Gornja pozicija",
 
DlnLnkMsgNoUrl : "Molimo ukucajte URL link",
DlnLnkMsgNoEMail : "Molimo ukucajte e-mail adresu",
DlnLnkMsgNoAnchor : "Molimo izaberite sidro",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "Izaberi boju",
DlgColorBtnClear : "Oèisti",
DlgColorHighlight : "Igled",
DlgColorSelected : "Selektovana",
 
// Smiley Dialog
DlgSmileyTitle : "Ubaci smješka",
 
// Special Character Dialog
DlgSpecialCharTitle : "Izaberi specijalni karakter",
 
// Table Dialog
DlgTableTitle : "Svojstva tabele",
DlgTableRows : "Redova",
DlgTableColumns : "Kolona",
DlgTableBorder : "Okvir",
DlgTableAlign : "Poravnanje",
DlgTableAlignNotSet : "<Nije podešeno>",
DlgTableAlignLeft : "Lijevo",
DlgTableAlignCenter : "Centar",
DlgTableAlignRight : "Desno",
DlgTableWidth : "Širina",
DlgTableWidthPx : "piksela",
DlgTableWidthPc : "posto",
DlgTableHeight : "Visina",
DlgTableCellSpace : "Razmak æelija",
DlgTableCellPad : "Uvod æelija",
DlgTableCaption : "Naslov",
DlgTableSummary : "Summary", //MISSING
 
// Table Cell Dialog
DlgCellTitle : "Svojstva æelije",
DlgCellWidth : "Širina",
DlgCellWidthPx : "piksela",
DlgCellWidthPc : "posto",
DlgCellHeight : "Visina",
DlgCellWordWrap : "Vrapuj tekst",
DlgCellWordWrapNotSet : "<Nije podešeno>",
DlgCellWordWrapYes : "Da",
DlgCellWordWrapNo : "Ne",
DlgCellHorAlign : "Horizontalno poravnanje",
DlgCellHorAlignNotSet : "<Nije podešeno>",
DlgCellHorAlignLeft : "Lijevo",
DlgCellHorAlignCenter : "Centar",
DlgCellHorAlignRight: "Desno",
DlgCellVerAlign : "Vertikalno poravnanje",
DlgCellVerAlignNotSet : "<Nije podešeno>",
DlgCellVerAlignTop : "Gore",
DlgCellVerAlignMiddle : "Sredina",
DlgCellVerAlignBottom : "Dno",
DlgCellVerAlignBaseline : "Bazno",
DlgCellRowSpan : "Spajanje æelija",
DlgCellCollSpan : "Spajanje kolona",
DlgCellBackColor : "Boja pozadine",
DlgCellBorderColor : "Boja okvira",
DlgCellBtnSelect : "Selektuj...",
 
// Find Dialog
DlgFindTitle : "Naði",
DlgFindFindBtn : "Naði",
DlgFindNotFoundMsg : "Traženi tekst nije pronaðen.",
 
// Replace Dialog
DlgReplaceTitle : "Zamjeni",
DlgReplaceFindLbl : "Naði Å¡ta:",
DlgReplaceReplaceLbl : "Zamjeni sa:",
DlgReplaceCaseChk : "Uporeðuj velika/mala slova",
DlgReplaceReplaceBtn : "Zamjeni",
DlgReplaceReplAllBtn : "Zamjeni sve",
DlgReplaceWordChk : "Uporeðuj samo cijelu rijeè",
 
// Paste Operations / Dialog
PasteErrorPaste : "Sigurnosne postavke vaÅ¡eg pretraživaèa ne dozvoljavaju operacije automatskog lijepljenja. Molimo koristite kraticu na tastaturi (Ctrl+V).",
PasteErrorCut : "Sigurnosne postavke vaÅ¡eg pretraživaèa ne dozvoljavaju operacije automatskog rezanja. Molimo koristite kraticu na tastaturi (Ctrl+X).",
PasteErrorCopy : "Sigurnosne postavke VaÅ¡eg pretraživaèa ne dozvoljavaju operacije automatskog kopiranja. Molimo koristite kraticu na tastaturi (Ctrl+C).",
 
PasteAsText : "Zalijepi kao obièan tekst",
PasteFromWord : "Zalijepi iz Word-a",
 
DlgPasteMsg2 : "Please paste inside the following box using the keyboard (<STRONG>Ctrl+V</STRONG>) and hit <STRONG>OK</STRONG>.", //MISSING
DlgPasteIgnoreFont : "Ignore Font Face definitions", //MISSING
DlgPasteRemoveStyles : "Remove Styles definitions", //MISSING
DlgPasteCleanBox : "Clean Up Box", //MISSING
 
// Color Picker
ColorAutomatic : "Automatska",
ColorMoreColors : "Više boja...",
 
// Document Properties
DocProps : "Document Properties", //MISSING
 
// Anchor Dialog
DlgAnchorTitle : "Anchor Properties", //MISSING
DlgAnchorName : "Anchor Name", //MISSING
DlgAnchorErrorName : "Please type the anchor name", //MISSING
 
// Speller Pages Dialog
DlgSpellNotInDic : "Not in dictionary", //MISSING
DlgSpellChangeTo : "Change to", //MISSING
DlgSpellBtnIgnore : "Ignore", //MISSING
DlgSpellBtnIgnoreAll : "Ignore All", //MISSING
DlgSpellBtnReplace : "Replace", //MISSING
DlgSpellBtnReplaceAll : "Replace All", //MISSING
DlgSpellBtnUndo : "Undo", //MISSING
DlgSpellNoSuggestions : "- No suggestions -", //MISSING
DlgSpellProgress : "Spell check in progress...", //MISSING
DlgSpellNoMispell : "Spell check complete: No misspellings found", //MISSING
DlgSpellNoChanges : "Spell check complete: No words changed", //MISSING
DlgSpellOneChange : "Spell check complete: One word changed", //MISSING
DlgSpellManyChanges : "Spell check complete: %1 words changed", //MISSING
 
IeSpellDownload : "Spell checker not installed. Do you want to download it now?", //MISSING
 
// Button Dialog
DlgButtonText : "Text (Value)", //MISSING
DlgButtonType : "Type", //MISSING
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Name", //MISSING
DlgCheckboxValue : "Value", //MISSING
DlgCheckboxSelected : "Selected", //MISSING
 
// Form Dialog
DlgFormName : "Name", //MISSING
DlgFormAction : "Action", //MISSING
DlgFormMethod : "Method", //MISSING
 
// Select Field Dialog
DlgSelectName : "Name", //MISSING
DlgSelectValue : "Value", //MISSING
DlgSelectSize : "Size", //MISSING
DlgSelectLines : "lines", //MISSING
DlgSelectChkMulti : "Allow multiple selections", //MISSING
DlgSelectOpAvail : "Available Options", //MISSING
DlgSelectOpText : "Text", //MISSING
DlgSelectOpValue : "Value", //MISSING
DlgSelectBtnAdd : "Add", //MISSING
DlgSelectBtnModify : "Modify", //MISSING
DlgSelectBtnUp : "Up", //MISSING
DlgSelectBtnDown : "Down", //MISSING
DlgSelectBtnSetValue : "Set as selected value", //MISSING
DlgSelectBtnDelete : "Delete", //MISSING
 
// Textarea Dialog
DlgTextareaName : "Name", //MISSING
DlgTextareaCols : "Columns", //MISSING
DlgTextareaRows : "Rows", //MISSING
 
// Text Field Dialog
DlgTextName : "Name", //MISSING
DlgTextValue : "Value", //MISSING
DlgTextCharWidth : "Character Width", //MISSING
DlgTextMaxChars : "Maximum Characters", //MISSING
DlgTextType : "Type", //MISSING
DlgTextTypeText : "Text", //MISSING
DlgTextTypePass : "Password", //MISSING
 
// Hidden Field Dialog
DlgHiddenName : "Name", //MISSING
DlgHiddenValue : "Value", //MISSING
 
// Bulleted List Dialog
BulletedListProp : "Bulleted List Properties", //MISSING
NumberedListProp : "Numbered List Properties", //MISSING
DlgLstStart : "Start", //MISSING
DlgLstType : "Type", //MISSING
DlgLstTypeCircle : "Circle", //MISSING
DlgLstTypeDisc : "Disc", //MISSING
DlgLstTypeSquare : "Square", //MISSING
DlgLstTypeNumbers : "Numbers (1, 2, 3)", //MISSING
DlgLstTypeLCase : "Lowercase Letters (a, b, c)", //MISSING
DlgLstTypeUCase : "Uppercase Letters (A, B, C)", //MISSING
DlgLstTypeSRoman : "Small Roman Numerals (i, ii, iii)", //MISSING
DlgLstTypeLRoman : "Large Roman Numerals (I, II, III)", //MISSING
 
// Document Properties Dialog
DlgDocGeneralTab : "General", //MISSING
DlgDocBackTab : "Background", //MISSING
DlgDocColorsTab : "Colors and Margins", //MISSING
DlgDocMetaTab : "Meta Data", //MISSING
 
DlgDocPageTitle : "Page Title", //MISSING
DlgDocLangDir : "Language Direction", //MISSING
DlgDocLangDirLTR : "Left to Right (LTR)", //MISSING
DlgDocLangDirRTL : "Right to Left (RTL)", //MISSING
DlgDocLangCode : "Language Code", //MISSING
DlgDocCharSet : "Character Set Encoding", //MISSING
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "Other Character Set Encoding", //MISSING
 
DlgDocDocType : "Document Type Heading", //MISSING
DlgDocDocTypeOther : "Other Document Type Heading", //MISSING
DlgDocIncXHTML : "Include XHTML Declarations", //MISSING
DlgDocBgColor : "Background Color", //MISSING
DlgDocBgImage : "Background Image URL", //MISSING
DlgDocBgNoScroll : "Nonscrolling Background", //MISSING
DlgDocCText : "Text", //MISSING
DlgDocCLink : "Link", //MISSING
DlgDocCVisited : "Visited Link", //MISSING
DlgDocCActive : "Active Link", //MISSING
DlgDocMargins : "Page Margins", //MISSING
DlgDocMaTop : "Top", //MISSING
DlgDocMaLeft : "Left", //MISSING
DlgDocMaRight : "Right", //MISSING
DlgDocMaBottom : "Bottom", //MISSING
DlgDocMeIndex : "Document Indexing Keywords (comma separated)", //MISSING
DlgDocMeDescr : "Document Description", //MISSING
DlgDocMeAuthor : "Author", //MISSING
DlgDocMeCopy : "Copyright", //MISSING
DlgDocPreview : "Preview", //MISSING
 
// Templates Dialog
Templates : "Templates", //MISSING
DlgTemplatesTitle : "Content Templates", //MISSING
DlgTemplatesSelMsg : "Please select the template to open in the editor<br>(the actual contents will be lost):", //MISSING
DlgTemplatesLoading : "Loading templates list. Please wait...", //MISSING
DlgTemplatesNoTpl : "(No templates defined)", //MISSING
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "About", //MISSING
DlgAboutBrowserInfoTab : "Browser Info", //MISSING
DlgAboutLicenseTab : "License", //MISSING
DlgAboutVersion : "verzija",
DlgAboutLicense : "Licencirano pod uslovima GNU Lesser General Public License",
DlgAboutInfo : "Za više informacija posjetite"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/cs.js
New file
0,0 → 1,503
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: cs.js
* Czech language file.
*
* File Authors:
* David Horák (david.horak@email.cz)
* Petr Plavjaník (plavjanik@gmail.com)
* Dave MacBlack (davemacblack@users.sourceforge.net)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Skrýt panel nástrojů",
ToolbarExpand : "Zobrazit panel nástrojů",
 
// Toolbar Items and Context Menu
Save : "Uložit",
NewPage : "Nová stránka",
Preview : "Náhled",
Cut : "Vyjmout",
Copy : "Kopírovat",
Paste : "Vložit",
PasteText : "Vložit jako čistý text",
PasteWord : "Vložit z Wordu",
Print : "Tisk",
SelectAll : "Vybrat vše",
RemoveFormat : "Odstranit formátování",
InsertLinkLbl : "Odkaz",
InsertLink : "Vložit/změnit odkaz",
RemoveLink : "Odstranit odkaz",
Anchor : "Vložít/změnit záložku",
InsertImageLbl : "Obrázek",
InsertImage : "Vložit/změnit obrázek",
InsertFlashLbl : "Flash",
InsertFlash : "Vložit/Upravit Flash",
InsertTableLbl : "Tabulka",
InsertTable : "Vložit/změnit tabulku",
InsertLineLbl : "Linka",
InsertLine : "Vložit vodorovnou linku",
InsertSpecialCharLbl: "Speciální znaky",
InsertSpecialChar : "Vložit speciální znaky",
InsertSmileyLbl : "Smajlíky",
InsertSmiley : "Vložit smajlík",
About : "O aplikaci FCKeditor",
Bold : "Tučné",
Italic : "Kurzíva",
Underline : "Podtržené",
StrikeThrough : "PřeÅ¡krtnuté",
Subscript : "Dolní index",
Superscript : "Horní index",
LeftJustify : "Zarovnat vlevo",
CenterJustify : "Zarovnat na střed",
RightJustify : "Zarovnat vpravo",
BlockJustify : "Zarovnat do bloku",
DecreaseIndent : "ZmenÅ¡it odsazení",
IncreaseIndent : "ZvětÅ¡it odsazení",
Undo : "Zpět",
Redo : "Znovu",
NumberedListLbl : "Číslování",
NumberedList : "Vložit/odstranit číslovaný seznam",
BulletedListLbl : "Odrážky",
BulletedList : "Vložit/odstranit odrážky",
ShowTableBorders : "Zobrazit okraje tabulek",
ShowDetails : "Zobrazit podrobnosti",
Style : "Styl",
FontFormat : "Formát",
Font : "Písmo",
FontSize : "Velikost",
TextColor : "Barva textu",
BGColor : "Barva pozadí",
Source : "Zdroj",
Find : "Hledat",
Replace : "Nahradit",
SpellCheck : "Zkontrolovat pravopis",
UniversalKeyboard : "Univerzální klávesnice",
PageBreakLbl : "Konec stránky",
PageBreak : "Vložit konec stránky",
 
Form : "Formulář",
Checkbox : "ZaÅ¡krtávací políčko",
RadioButton : "Přepínač",
TextField : "Textové pole",
Textarea : "Textová oblast",
HiddenField : "Skryté pole",
Button : "Tlačítko",
SelectionField : "Seznam",
ImageButton : "Obrázkové tlačítko",
 
FitWindow : "Maximalizovat velikost editoru",
 
// Context Menu
EditLink : "Změnit odkaz",
CellCM : "Buňka",
RowCM : "Řádek",
ColumnCM : "Sloupec",
InsertRow : "Vložit řádek",
DeleteRows : "Smazat řádek",
InsertColumn : "Vložit sloupec",
DeleteColumns : "Smazat sloupec",
InsertCell : "Vložit buňku",
DeleteCells : "Smazat buňky",
MergeCells : "Sloučit buňky",
SplitCell : "Rozdělit buňku",
TableDelete : "Smazat tabulku",
CellProperties : "Vlastnosti buňky",
TableProperties : "Vlastnosti tabulky",
ImageProperties : "Vlastnosti obrázku",
FlashProperties : "Vlastnosti Flashe",
 
AnchorProp : "Vlastnosti záložky",
ButtonProp : "Vlastnosti tlačítka",
CheckboxProp : "Vlastnosti zaÅ¡krtávacího políčka",
HiddenFieldProp : "Vlastnosti skrytého pole",
RadioButtonProp : "Vlastnosti přepínače",
ImageButtonProp : "Vlastností obrázkového tlačítka",
TextFieldProp : "Vlastnosti textového pole",
SelectionFieldProp : "Vlastnosti seznamu",
TextareaProp : "Vlastnosti textové oblasti",
FormProp : "Vlastnosti formuláře",
 
FontFormats : "Normální;Formátovaný;Adresa;Nadpis 1;Nadpis 2;Nadpis 3;Nadpis 4;Nadpis 5;Nadpis 6",
 
// Alerts and Messages
ProcessingXHTML : "Probíhá zpracování XHTML. Prosím čekejte...",
Done : "Hotovo",
PasteWordConfirm : "Jak je vidět, vkládaný text je kopírován z Wordu. Chcete jej před vložením vyčistit?",
NotCompatiblePaste : "Tento příkaz je dostupný pouze v Internet Exploreru verze 5.5 nebo vyÅ¡Å¡í. Chcete vložit text bez vyčiÅ¡tění?",
UnknownToolbarItem : "Neznámá položka panelu nástrojů \"%1\"",
UnknownCommand : "Neznámý příkaz \"%1\"",
NotImplemented : "Příkaz není implementován",
UnknownToolbarSet : "Panel nástrojů \"%1\" neexistuje",
NoActiveX : "Nastavení bezpečnosti VaÅ¡eho prohlížeče omezuje funkčnost některých jeho možností. Je třeba zapnout volbu \"SpouÅ¡tět ovládáací prvky ActiveX a moduly plug-in\", jinak nebude možné využívat vÅ¡echny dosputné schopnosti editoru.",
BrowseServerBlocked : "Průzkumník zdrojů nelze otevřít. Prověřte, zda nemáte aktivováno blokování popup oken.",
DialogBlocked : "Nelze otevřít dialogové okno. Prověřte, zda nemáte aktivováno blokování popup oken.",
 
// Dialogs
DlgBtnOK : "OK",
DlgBtnCancel : "Storno",
DlgBtnClose : "Zavřít",
DlgBtnBrowseServer : "Vybrat na serveru",
DlgAdvancedTag : "RozÅ¡ířené",
DlgOpOther : "<Ostatní>",
DlgInfoTab : "Info",
DlgAlertUrl : "Prosím vložte URL",
 
// General Dialogs Labels
DlgGenNotSet : "<nenastaveno>",
DlgGenId : "Id",
DlgGenLangDir : "Orientace jazyka",
DlgGenLangDirLtr : "Zleva do prava (LTR)",
DlgGenLangDirRtl : "Zprava do leva (RTL)",
DlgGenLangCode : "Kód jazyka",
DlgGenAccessKey : "Přístupový klíč",
DlgGenName : "Jméno",
DlgGenTabIndex : "Pořadí prvku",
DlgGenLongDescr : "Dlouhý popis URL",
DlgGenClass : "Třída stylu",
DlgGenTitle : "Pomocný titulek",
DlgGenContType : "Pomocný typ obsahu",
DlgGenLinkCharset : "Přiřazená znaková sada",
DlgGenStyle : "Styl",
 
// Image Dialog
DlgImgTitle : "Vlastnosti obrázku",
DlgImgInfoTab : "Informace o obrázku",
DlgImgBtnUpload : "Odeslat na server",
DlgImgURL : "URL",
DlgImgUpload : "Odeslat",
DlgImgAlt : "Alternativní text",
DlgImgWidth : "Å ířka",
DlgImgHeight : "VýÅ¡ka",
DlgImgLockRatio : "Zámek",
DlgBtnResetSize : "Původní velikost",
DlgImgBorder : "Okraje",
DlgImgHSpace : "H-mezera",
DlgImgVSpace : "V-mezera",
DlgImgAlign : "Zarovnání",
DlgImgAlignLeft : "Vlevo",
DlgImgAlignAbsBottom: "Zcela dolů",
DlgImgAlignAbsMiddle: "Doprostřed",
DlgImgAlignBaseline : "Na účaří",
DlgImgAlignBottom : "Dolů",
DlgImgAlignMiddle : "Na střed",
DlgImgAlignRight : "Vpravo",
DlgImgAlignTextTop : "Na horní okraj textu",
DlgImgAlignTop : "Nahoru",
DlgImgPreview : "Náhled",
DlgImgAlertUrl : "Zadejte prosím URL obrázku",
DlgImgLinkTab : "Odkaz",
 
// Flash Dialog
DlgFlashTitle : "Vlastnosti Flashe",
DlgFlashChkPlay : "Automatické spuÅ¡tění",
DlgFlashChkLoop : "Opakování",
DlgFlashChkMenu : "Nabídka Flash",
DlgFlashScale : "Zobrazit",
DlgFlashScaleAll : "Zobrazit vše",
DlgFlashScaleNoBorder : "Bez okraje",
DlgFlashScaleFit : "Přizpůsobit",
 
// Link Dialog
DlgLnkWindowTitle : "Odkaz",
DlgLnkInfoTab : "Informace o odkazu",
DlgLnkTargetTab : "Cíl",
 
DlgLnkType : "Typ odkazu",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Kotva v této stránce",
DlgLnkTypeEMail : "E-Mail",
DlgLnkProto : "Protokol",
DlgLnkProtoOther : "<jiný>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Vybrat kotvu",
DlgLnkAnchorByName : "Podle jména kotvy",
DlgLnkAnchorById : "Podle Id objektu",
DlgLnkNoAnchors : "<Ve stránce žádná kotva není definována>",
DlgLnkEMail : "E-Mailová adresa",
DlgLnkEMailSubject : "Předmět zprávy",
DlgLnkEMailBody : "Tělo zprávy",
DlgLnkUpload : "Odeslat",
DlgLnkBtnUpload : "Odeslat na Server",
 
DlgLnkTarget : "Cíl",
DlgLnkTargetFrame : "<rámec>",
DlgLnkTargetPopup : "<vyskakovací okno>",
DlgLnkTargetBlank : "Nové okno (_blank)",
DlgLnkTargetParent : "Rodičovské okno (_parent)",
DlgLnkTargetSelf : "Stejné okno (_self)",
DlgLnkTargetTop : "Hlavní okno (_top)",
DlgLnkTargetFrameName : "Název cílového rámu",
DlgLnkPopWinName : "Název vyskakovacího okna",
DlgLnkPopWinFeat : "Vlastnosti vyskakovacího okna",
DlgLnkPopResize : "Měnitelná velikost",
DlgLnkPopLocation : "Panel umístění",
DlgLnkPopMenu : "Panel nabídky",
DlgLnkPopScroll : "Posuvníky",
DlgLnkPopStatus : "Stavový řádek",
DlgLnkPopToolbar : "Panel nástrojů",
DlgLnkPopFullScrn : "Celá obrazovka (IE)",
DlgLnkPopDependent : "Závislost (Netscape)",
DlgLnkPopWidth : "Å ířka",
DlgLnkPopHeight : "VýÅ¡ka",
DlgLnkPopLeft : "Levý okraj",
DlgLnkPopTop : "Horní okraj",
 
DlnLnkMsgNoUrl : "Zadejte prosím URL odkazu",
DlnLnkMsgNoEMail : "Zadejte prosím e-mailovou adresu",
DlnLnkMsgNoAnchor : "Vyberte prosím kotvu",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "Výběr barvy",
DlgColorBtnClear : "Vymazat",
DlgColorHighlight : "Zvýrazněná",
DlgColorSelected : "Vybraná",
 
// Smiley Dialog
DlgSmileyTitle : "Vkládání smajlíků",
 
// Special Character Dialog
DlgSpecialCharTitle : "Výběr speciálního znaku",
 
// Table Dialog
DlgTableTitle : "Vlastnosti tabulky",
DlgTableRows : "Řádky",
DlgTableColumns : "Sloupce",
DlgTableBorder : "Ohraničení",
DlgTableAlign : "Zarovnání",
DlgTableAlignNotSet : "<nenastaveno>",
DlgTableAlignLeft : "Vlevo",
DlgTableAlignCenter : "Na střed",
DlgTableAlignRight : "Vpravo",
DlgTableWidth : "Å ířka",
DlgTableWidthPx : "bodů",
DlgTableWidthPc : "procent",
DlgTableHeight : "VýÅ¡ka",
DlgTableCellSpace : "Vzdálenost buněk",
DlgTableCellPad : "Odsazení obsahu",
DlgTableCaption : "Popis",
DlgTableSummary : "Souhrn",
 
// Table Cell Dialog
DlgCellTitle : "Vlastnosti buňky",
DlgCellWidth : "Å ířka",
DlgCellWidthPx : "bodů",
DlgCellWidthPc : "procent",
DlgCellHeight : "VýÅ¡ka",
DlgCellWordWrap : "Zalamování",
DlgCellWordWrapNotSet : "<nenanstaveno>",
DlgCellWordWrapYes : "Ano",
DlgCellWordWrapNo : "Ne",
DlgCellHorAlign : "Vodorovné zarovnání",
DlgCellHorAlignNotSet : "<nenastaveno>",
DlgCellHorAlignLeft : "Vlevo",
DlgCellHorAlignCenter : "Na střed",
DlgCellHorAlignRight: "Vpravo",
DlgCellVerAlign : "Svislé zarovnání",
DlgCellVerAlignNotSet : "<nenastaveno>",
DlgCellVerAlignTop : "Nahoru",
DlgCellVerAlignMiddle : "Doprostřed",
DlgCellVerAlignBottom : "Dolů",
DlgCellVerAlignBaseline : "Na účaří",
DlgCellRowSpan : "Sloučené řádky",
DlgCellCollSpan : "Sloučené sloupce",
DlgCellBackColor : "Barva pozadí",
DlgCellBorderColor : "Barva ohraničení",
DlgCellBtnSelect : "Výběr...",
 
// Find Dialog
DlgFindTitle : "Hledat",
DlgFindFindBtn : "Hledat",
DlgFindNotFoundMsg : "Hledaný text nebyl nalezen.",
 
// Replace Dialog
DlgReplaceTitle : "Nahradit",
DlgReplaceFindLbl : "Co hledat:",
DlgReplaceReplaceLbl : "Čím nahradit:",
DlgReplaceCaseChk : "RozliÅ¡ovat velikost písma",
DlgReplaceReplaceBtn : "Nahradit",
DlgReplaceReplAllBtn : "Nahradit vše",
DlgReplaceWordChk : "Pouze celá slova",
 
// Paste Operations / Dialog
PasteErrorPaste : "Bezpečnostní nastavení VaÅ¡eho prohlížeče nedovolují editoru spustit funkci pro vložení textu ze schránky. Prosím vložte text ze schránky pomocí klávesnice (Ctrl+V).",
PasteErrorCut : "Bezpečnostní nastavení VaÅ¡eho prohlížeče nedovolují editoru spustit funkci pro vyjmutí zvoleného textu do schránky. Prosím vyjměte zvolený text do schránky pomocí klávesnice (Ctrl+X).",
PasteErrorCopy : "Bezpečnostní nastavení VaÅ¡eho prohlížeče nedovolují editoru spustit funkci pro kopírování zvoleného textu do schránky. Prosím zkopírujte zvolený text do schránky pomocí klávesnice (Ctrl+C).",
 
PasteAsText : "Vložit jako čistý text",
PasteFromWord : "Vložit text z Wordu",
 
DlgPasteMsg2 : "Do následujícího pole vložte požadovaný obsah pomocí klávesnice (<STRONG>Ctrl+V</STRONG>) a stiskněte <STRONG>OK</STRONG>.",
DlgPasteIgnoreFont : "Ignorovat písmo",
DlgPasteRemoveStyles : "Odstranit styly",
DlgPasteCleanBox : "Vyčistit",
 
// Color Picker
ColorAutomatic : "Automaticky",
ColorMoreColors : "Více barev...",
 
// Document Properties
DocProps : "Vlastnosti dokumentu",
 
// Anchor Dialog
DlgAnchorTitle : "Vlastnosti záložky",
DlgAnchorName : "Název záložky",
DlgAnchorErrorName : "Zadejte prosím název záložky",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Není ve slovníku",
DlgSpellChangeTo : "Změnit na",
DlgSpellBtnIgnore : "Přeskočit",
DlgSpellBtnIgnoreAll : "Přeskakovat vše",
DlgSpellBtnReplace : "Zaměnit",
DlgSpellBtnReplaceAll : "Zaměňovat vše",
DlgSpellBtnUndo : "Zpět",
DlgSpellNoSuggestions : "- žádné návrhy -",
DlgSpellProgress : "Probíhá kontrola pravopisu...",
DlgSpellNoMispell : "Kontrola pravopisu dokončena: Žádné pravopisné chyby nenalezeny",
DlgSpellNoChanges : "Kontrola pravopisu dokončena: Beze změn",
DlgSpellOneChange : "Kontrola pravopisu dokončena: Jedno slovo změněno",
DlgSpellManyChanges : "Kontrola pravopisu dokončena: %1 slov změněno",
 
IeSpellDownload : "Kontrola pravopisu není nainstalována. Chcete ji nyní stáhnout?",
 
// Button Dialog
DlgButtonText : "Popisek",
DlgButtonType : "Typ",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Název",
DlgCheckboxValue : "Hodnota",
DlgCheckboxSelected : "Zaškrtnuto",
 
// Form Dialog
DlgFormName : "Název",
DlgFormAction : "Akce",
DlgFormMethod : "Metoda",
 
// Select Field Dialog
DlgSelectName : "Název",
DlgSelectValue : "Hodnota",
DlgSelectSize : "Velikost",
DlgSelectLines : "Řádků",
DlgSelectChkMulti : "Povolit mnohonásobné výběry",
DlgSelectOpAvail : "Dostupná nastavení",
DlgSelectOpText : "Text",
DlgSelectOpValue : "Hodnota",
DlgSelectBtnAdd : "Přidat",
DlgSelectBtnModify : "Změnit",
DlgSelectBtnUp : "Nahoru",
DlgSelectBtnDown : "Dolů",
DlgSelectBtnSetValue : "Nastavit jako vybranou hodnotu",
DlgSelectBtnDelete : "Smazat",
 
// Textarea Dialog
DlgTextareaName : "Název",
DlgTextareaCols : "Sloupců",
DlgTextareaRows : "Řádků",
 
// Text Field Dialog
DlgTextName : "Název",
DlgTextValue : "Hodnota",
DlgTextCharWidth : "Å ířka ve znacích",
DlgTextMaxChars : "Maximální počet znaků",
DlgTextType : "Typ",
DlgTextTypeText : "Text",
DlgTextTypePass : "Heslo",
 
// Hidden Field Dialog
DlgHiddenName : "Název",
DlgHiddenValue : "Hodnota",
 
// Bulleted List Dialog
BulletedListProp : "Vlastnosti odrážek",
NumberedListProp : "Vlastnosti číslovaného seznamu",
DlgLstStart : "Start", //MISSING
DlgLstType : "Typ",
DlgLstTypeCircle : "Kružnice",
DlgLstTypeDisc : "Kruh",
DlgLstTypeSquare : "Čtverec",
DlgLstTypeNumbers : "Čísla (1, 2, 3)",
DlgLstTypeLCase : "Malá písmena (a, b, c)",
DlgLstTypeUCase : "Velká písmena (A, B, C)",
DlgLstTypeSRoman : "Malé římská číslice (i, ii, iii)",
DlgLstTypeLRoman : "Velké římské číslice (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "Obecné",
DlgDocBackTab : "Pozadí",
DlgDocColorsTab : "Barvy a okraje",
DlgDocMetaTab : "Metadata",
 
DlgDocPageTitle : "Titulek stránky",
DlgDocLangDir : "Směr jazyku",
DlgDocLangDirLTR : "Zleva do prava ",
DlgDocLangDirRTL : "Zprava doleva",
DlgDocLangCode : "Kód jazyku",
DlgDocCharSet : "Znaková sada",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "DalÅ¡í znaková sada",
 
DlgDocDocType : "Typ dokumentu",
DlgDocDocTypeOther : "Jiný typ dokumetu",
DlgDocIncXHTML : "Zahrnou deklarace XHTML",
DlgDocBgColor : "Barva pozadí",
DlgDocBgImage : "URL obrázku na pozadí",
DlgDocBgNoScroll : "Nerolovatelné pozadí",
DlgDocCText : "Text",
DlgDocCLink : "Odkaz",
DlgDocCVisited : "NavÅ¡tívený odkaz",
DlgDocCActive : "Vybraný odkaz",
DlgDocMargins : "Okraje stránky",
DlgDocMaTop : "Horní",
DlgDocMaLeft : "Levý",
DlgDocMaRight : "Pravý",
DlgDocMaBottom : "Dolní",
DlgDocMeIndex : "Klíčová slova (oddělená čárkou)",
DlgDocMeDescr : "Popis dokumentu",
DlgDocMeAuthor : "Autor",
DlgDocMeCopy : "Autorská práva",
DlgDocPreview : "Náhled",
 
// Templates Dialog
Templates : "Šablony",
DlgTemplatesTitle : "Šablony obsahu",
DlgTemplatesSelMsg : "Prosím zvolte Å¡ablonu pro otevření v editoru<br>(aktuální obsah editoru bude ztracen):",
DlgTemplatesLoading : "Nahrávám přeheld Å¡ablon. Prosím čekejte...",
DlgTemplatesNoTpl : "(Není definována žádná Å¡ablona)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "O aplikaci",
DlgAboutBrowserInfoTab : "Informace o prohlížeči",
DlgAboutLicenseTab : "Licence",
DlgAboutVersion : "verze",
DlgAboutLicense : "Licencováno pod GNU Lesser General Public License",
DlgAboutInfo : "Více informací získáte na"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/en-au.js
New file
0,0 → 1,502
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: en-au.js
* English (Australia) language file.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
* Christopher Dawes (fckeditor@dawes.id.au)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Collapse Toolbar",
ToolbarExpand : "Expand Toolbar",
 
// Toolbar Items and Context Menu
Save : "Save",
NewPage : "New Page",
Preview : "Preview",
Cut : "Cut",
Copy : "Copy",
Paste : "Paste",
PasteText : "Paste as plain text",
PasteWord : "Paste from Word",
Print : "Print",
SelectAll : "Select All",
RemoveFormat : "Remove Format",
InsertLinkLbl : "Link",
InsertLink : "Insert/Edit Link",
RemoveLink : "Remove Link",
Anchor : "Insert/Edit Anchor",
InsertImageLbl : "Image",
InsertImage : "Insert/Edit Image",
InsertFlashLbl : "Flash",
InsertFlash : "Insert/Edit Flash",
InsertTableLbl : "Table",
InsertTable : "Insert/Edit Table",
InsertLineLbl : "Line",
InsertLine : "Insert Horizontal Line",
InsertSpecialCharLbl: "Special Character",
InsertSpecialChar : "Insert Special Character",
InsertSmileyLbl : "Smiley",
InsertSmiley : "Insert Smiley",
About : "About FCKeditor",
Bold : "Bold",
Italic : "Italic",
Underline : "Underline",
StrikeThrough : "Strike Through",
Subscript : "Subscript",
Superscript : "Superscript",
LeftJustify : "Left Justify",
CenterJustify : "Centre Justify",
RightJustify : "Right Justify",
BlockJustify : "Block Justify",
DecreaseIndent : "Decrease Indent",
IncreaseIndent : "Increase Indent",
Undo : "Undo",
Redo : "Redo",
NumberedListLbl : "Numbered List",
NumberedList : "Insert/Remove Numbered List",
BulletedListLbl : "Bulleted List",
BulletedList : "Insert/Remove Bulleted List",
ShowTableBorders : "Show Table Borders",
ShowDetails : "Show Details",
Style : "Style",
FontFormat : "Format",
Font : "Font",
FontSize : "Size",
TextColor : "Text Colour",
BGColor : "Background Colour",
Source : "Source",
Find : "Find",
Replace : "Replace",
SpellCheck : "Check Spelling",
UniversalKeyboard : "Universal Keyboard",
PageBreakLbl : "Page Break",
PageBreak : "Insert Page Break",
 
Form : "Form",
Checkbox : "Checkbox",
RadioButton : "Radio Button",
TextField : "Text Field",
Textarea : "Textarea",
HiddenField : "Hidden Field",
Button : "Button",
SelectionField : "Selection Field",
ImageButton : "Image Button",
 
FitWindow : "Maximize the editor size",
 
// Context Menu
EditLink : "Edit Link",
CellCM : "Cell",
RowCM : "Row",
ColumnCM : "Column",
InsertRow : "Insert Row",
DeleteRows : "Delete Rows",
InsertColumn : "Insert Column",
DeleteColumns : "Delete Columns",
InsertCell : "Insert Cell",
DeleteCells : "Delete Cells",
MergeCells : "Merge Cells",
SplitCell : "Split Cell",
TableDelete : "Delete Table",
CellProperties : "Cell Properties",
TableProperties : "Table Properties",
ImageProperties : "Image Properties",
FlashProperties : "Flash Properties",
 
AnchorProp : "Anchor Properties",
ButtonProp : "Button Properties",
CheckboxProp : "Checkbox Properties",
HiddenFieldProp : "Hidden Field Properties",
RadioButtonProp : "Radio Button Properties",
ImageButtonProp : "Image Button Properties",
TextFieldProp : "Text Field Properties",
SelectionFieldProp : "Selection Field Properties",
TextareaProp : "Textarea Properties",
FormProp : "Form Properties",
 
FontFormats : "Normal;Formatted;Address;Heading 1;Heading 2;Heading 3;Heading 4;Heading 5;Heading 6;Normal (DIV)",
 
// Alerts and Messages
ProcessingXHTML : "Processing XHTML. Please wait...",
Done : "Done",
PasteWordConfirm : "The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?",
NotCompatiblePaste : "This command is available for Internet Explorer version 5.5 or more. Do you want to paste without cleaning?",
UnknownToolbarItem : "Unknown toolbar item \"%1\"",
UnknownCommand : "Unknown command name \"%1\"",
NotImplemented : "Command not implemented",
UnknownToolbarSet : "Toolbar set \"%1\" doesn't exist",
NoActiveX : "Your browser's security settings could limit some features of the editor. You must enable the option \"Run ActiveX controls and plug-ins\". You may experience errors and notice missing features.",
BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.",
DialogBlocked : "It was not possible to open the dialog window. Make sure all popup blockers are disabled.",
 
// Dialogs
DlgBtnOK : "OK",
DlgBtnCancel : "Cancel",
DlgBtnClose : "Close",
DlgBtnBrowseServer : "Browse Server",
DlgAdvancedTag : "Advanced",
DlgOpOther : "<Other>",
DlgInfoTab : "Info",
DlgAlertUrl : "Please insert the URL",
 
// General Dialogs Labels
DlgGenNotSet : "<not set>",
DlgGenId : "Id",
DlgGenLangDir : "Language Direction",
DlgGenLangDirLtr : "Left to Right (LTR)",
DlgGenLangDirRtl : "Right to Left (RTL)",
DlgGenLangCode : "Language Code",
DlgGenAccessKey : "Access Key",
DlgGenName : "Name",
DlgGenTabIndex : "Tab Index",
DlgGenLongDescr : "Long Description URL",
DlgGenClass : "Stylesheet Classes",
DlgGenTitle : "Advisory Title",
DlgGenContType : "Advisory Content Type",
DlgGenLinkCharset : "Linked Resource Charset",
DlgGenStyle : "Style",
 
// Image Dialog
DlgImgTitle : "Image Properties",
DlgImgInfoTab : "Image Info",
DlgImgBtnUpload : "Send it to the Server",
DlgImgURL : "URL",
DlgImgUpload : "Upload",
DlgImgAlt : "Alternative Text",
DlgImgWidth : "Width",
DlgImgHeight : "Height",
DlgImgLockRatio : "Lock Ratio",
DlgBtnResetSize : "Reset Size",
DlgImgBorder : "Border",
DlgImgHSpace : "HSpace",
DlgImgVSpace : "VSpace",
DlgImgAlign : "Align",
DlgImgAlignLeft : "Left",
DlgImgAlignAbsBottom: "Abs Bottom",
DlgImgAlignAbsMiddle: "Abs Middle",
DlgImgAlignBaseline : "Baseline",
DlgImgAlignBottom : "Bottom",
DlgImgAlignMiddle : "Middle",
DlgImgAlignRight : "Right",
DlgImgAlignTextTop : "Text Top",
DlgImgAlignTop : "Top",
DlgImgPreview : "Preview",
DlgImgAlertUrl : "Please type the image URL",
DlgImgLinkTab : "Link",
 
// Flash Dialog
DlgFlashTitle : "Flash Properties",
DlgFlashChkPlay : "Auto Play",
DlgFlashChkLoop : "Loop",
DlgFlashChkMenu : "Enable Flash Menu",
DlgFlashScale : "Scale",
DlgFlashScaleAll : "Show all",
DlgFlashScaleNoBorder : "No Border",
DlgFlashScaleFit : "Exact Fit",
 
// Link Dialog
DlgLnkWindowTitle : "Link",
DlgLnkInfoTab : "Link Info",
DlgLnkTargetTab : "Target",
 
DlgLnkType : "Link Type",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Link to anchor in the text",
DlgLnkTypeEMail : "E-Mail",
DlgLnkProto : "Protocol",
DlgLnkProtoOther : "<other>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Select an Anchor",
DlgLnkAnchorByName : "By Anchor Name",
DlgLnkAnchorById : "By Element Id",
DlgLnkNoAnchors : "<No anchors available in the document>",
DlgLnkEMail : "E-Mail Address",
DlgLnkEMailSubject : "Message Subject",
DlgLnkEMailBody : "Message Body",
DlgLnkUpload : "Upload",
DlgLnkBtnUpload : "Send it to the Server",
 
DlgLnkTarget : "Target",
DlgLnkTargetFrame : "<frame>",
DlgLnkTargetPopup : "<popup window>",
DlgLnkTargetBlank : "New Window (_blank)",
DlgLnkTargetParent : "Parent Window (_parent)",
DlgLnkTargetSelf : "Same Window (_self)",
DlgLnkTargetTop : "Topmost Window (_top)",
DlgLnkTargetFrameName : "Target Frame Name",
DlgLnkPopWinName : "Popup Window Name",
DlgLnkPopWinFeat : "Popup Window Features",
DlgLnkPopResize : "Resizable",
DlgLnkPopLocation : "Location Bar",
DlgLnkPopMenu : "Menu Bar",
DlgLnkPopScroll : "Scroll Bars",
DlgLnkPopStatus : "Status Bar",
DlgLnkPopToolbar : "Toolbar",
DlgLnkPopFullScrn : "Full Screen (IE)",
DlgLnkPopDependent : "Dependent (Netscape)",
DlgLnkPopWidth : "Width",
DlgLnkPopHeight : "Height",
DlgLnkPopLeft : "Left Position",
DlgLnkPopTop : "Top Position",
 
DlnLnkMsgNoUrl : "Please type the link URL",
DlnLnkMsgNoEMail : "Please type the e-mail address",
DlnLnkMsgNoAnchor : "Please select an anchor",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces",
 
// Color Dialog
DlgColorTitle : "Select Colour",
DlgColorBtnClear : "Clear",
DlgColorHighlight : "Highlight",
DlgColorSelected : "Selected",
 
// Smiley Dialog
DlgSmileyTitle : "Insert a Smiley",
 
// Special Character Dialog
DlgSpecialCharTitle : "Select Special Character",
 
// Table Dialog
DlgTableTitle : "Table Properties",
DlgTableRows : "Rows",
DlgTableColumns : "Columns",
DlgTableBorder : "Border size",
DlgTableAlign : "Alignment",
DlgTableAlignNotSet : "<Not set>",
DlgTableAlignLeft : "Left",
DlgTableAlignCenter : "Centre",
DlgTableAlignRight : "Right",
DlgTableWidth : "Width",
DlgTableWidthPx : "pixels",
DlgTableWidthPc : "percent",
DlgTableHeight : "Height",
DlgTableCellSpace : "Cell spacing",
DlgTableCellPad : "Cell padding",
DlgTableCaption : "Caption",
DlgTableSummary : "Summary",
 
// Table Cell Dialog
DlgCellTitle : "Cell Properties",
DlgCellWidth : "Width",
DlgCellWidthPx : "pixels",
DlgCellWidthPc : "percent",
DlgCellHeight : "Height",
DlgCellWordWrap : "Word Wrap",
DlgCellWordWrapNotSet : "<Not set>",
DlgCellWordWrapYes : "Yes",
DlgCellWordWrapNo : "No",
DlgCellHorAlign : "Horizontal Alignment",
DlgCellHorAlignNotSet : "<Not set>",
DlgCellHorAlignLeft : "Left",
DlgCellHorAlignCenter : "Centre",
DlgCellHorAlignRight: "Right",
DlgCellVerAlign : "Vertical Alignment",
DlgCellVerAlignNotSet : "<Not set>",
DlgCellVerAlignTop : "Top",
DlgCellVerAlignMiddle : "Middle",
DlgCellVerAlignBottom : "Bottom",
DlgCellVerAlignBaseline : "Baseline",
DlgCellRowSpan : "Rows Span",
DlgCellCollSpan : "Columns Span",
DlgCellBackColor : "Background Colour",
DlgCellBorderColor : "Border Colour",
DlgCellBtnSelect : "Select...",
 
// Find Dialog
DlgFindTitle : "Find",
DlgFindFindBtn : "Find",
DlgFindNotFoundMsg : "The specified text was not found.",
 
// Replace Dialog
DlgReplaceTitle : "Replace",
DlgReplaceFindLbl : "Find what:",
DlgReplaceReplaceLbl : "Replace with:",
DlgReplaceCaseChk : "Match case",
DlgReplaceReplaceBtn : "Replace",
DlgReplaceReplAllBtn : "Replace All",
DlgReplaceWordChk : "Match whole word",
 
// Paste Operations / Dialog
PasteErrorPaste : "Your browser security settings don't permit the editor to automatically execute pasting operations. Please use the keyboard for that (Ctrl+V).",
PasteErrorCut : "Your browser security settings don't permit the editor to automatically execute cutting operations. Please use the keyboard for that (Ctrl+X).",
PasteErrorCopy : "Your browser security settings don't permit the editor to automatically execute copying operations. Please use the keyboard for that (Ctrl+C).",
 
PasteAsText : "Paste as Plain Text",
PasteFromWord : "Paste from Word",
 
DlgPasteMsg2 : "Please paste inside the following box using the keyboard (<STRONG>Ctrl+V</STRONG>) and hit <STRONG>OK</STRONG>.",
DlgPasteIgnoreFont : "Ignore Font Face definitions",
DlgPasteRemoveStyles : "Remove Styles definitions",
DlgPasteCleanBox : "Clean Up Box",
 
// Color Picker
ColorAutomatic : "Automatic",
ColorMoreColors : "More Colours...",
 
// Document Properties
DocProps : "Document Properties",
 
// Anchor Dialog
DlgAnchorTitle : "Anchor Properties",
DlgAnchorName : "Anchor Name",
DlgAnchorErrorName : "Please type the anchor name",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Not in dictionary",
DlgSpellChangeTo : "Change to",
DlgSpellBtnIgnore : "Ignore",
DlgSpellBtnIgnoreAll : "Ignore All",
DlgSpellBtnReplace : "Replace",
DlgSpellBtnReplaceAll : "Replace All",
DlgSpellBtnUndo : "Undo",
DlgSpellNoSuggestions : "- No suggestions -",
DlgSpellProgress : "Spell check in progress...",
DlgSpellNoMispell : "Spell check complete: No misspellings found",
DlgSpellNoChanges : "Spell check complete: No words changed",
DlgSpellOneChange : "Spell check complete: One word changed",
DlgSpellManyChanges : "Spell check complete: %1 words changed",
 
IeSpellDownload : "Spell checker not installed. Do you want to download it now?",
 
// Button Dialog
DlgButtonText : "Text (Value)",
DlgButtonType : "Type",
DlgButtonTypeBtn : "Button",
DlgButtonTypeSbm : "Submit",
DlgButtonTypeRst : "Reset",
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Name",
DlgCheckboxValue : "Value",
DlgCheckboxSelected : "Selected",
 
// Form Dialog
DlgFormName : "Name",
DlgFormAction : "Action",
DlgFormMethod : "Method",
 
// Select Field Dialog
DlgSelectName : "Name",
DlgSelectValue : "Value",
DlgSelectSize : "Size",
DlgSelectLines : "lines",
DlgSelectChkMulti : "Allow multiple selections",
DlgSelectOpAvail : "Available Options",
DlgSelectOpText : "Text",
DlgSelectOpValue : "Value",
DlgSelectBtnAdd : "Add",
DlgSelectBtnModify : "Modify",
DlgSelectBtnUp : "Up",
DlgSelectBtnDown : "Down",
DlgSelectBtnSetValue : "Set as selected value",
DlgSelectBtnDelete : "Delete",
 
// Textarea Dialog
DlgTextareaName : "Name",
DlgTextareaCols : "Columns",
DlgTextareaRows : "Rows",
 
// Text Field Dialog
DlgTextName : "Name",
DlgTextValue : "Value",
DlgTextCharWidth : "Character Width",
DlgTextMaxChars : "Maximum Characters",
DlgTextType : "Type",
DlgTextTypeText : "Text",
DlgTextTypePass : "Password",
 
// Hidden Field Dialog
DlgHiddenName : "Name",
DlgHiddenValue : "Value",
 
// Bulleted List Dialog
BulletedListProp : "Bulleted List Properties",
NumberedListProp : "Numbered List Properties",
DlgLstStart : "Start",
DlgLstType : "Type",
DlgLstTypeCircle : "Circle",
DlgLstTypeDisc : "Disc",
DlgLstTypeSquare : "Square",
DlgLstTypeNumbers : "Numbers (1, 2, 3)",
DlgLstTypeLCase : "Lowercase Letters (a, b, c)",
DlgLstTypeUCase : "Uppercase Letters (A, B, C)",
DlgLstTypeSRoman : "Small Roman Numerals (i, ii, iii)",
DlgLstTypeLRoman : "Large Roman Numerals (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "General",
DlgDocBackTab : "Background",
DlgDocColorsTab : "Colours and Margins",
DlgDocMetaTab : "Meta Data",
 
DlgDocPageTitle : "Page Title",
DlgDocLangDir : "Language Direction",
DlgDocLangDirLTR : "Left to Right (LTR)",
DlgDocLangDirRTL : "Right to Left (RTL)",
DlgDocLangCode : "Language Code",
DlgDocCharSet : "Character Set Encoding",
DlgDocCharSetCE : "Central European",
DlgDocCharSetCT : "Chinese Traditional (Big5)",
DlgDocCharSetCR : "Cyrillic",
DlgDocCharSetGR : "Greek",
DlgDocCharSetJP : "Japanese",
DlgDocCharSetKR : "Korean",
DlgDocCharSetTR : "Turkish",
DlgDocCharSetUN : "Unicode (UTF-8)",
DlgDocCharSetWE : "Western European",
DlgDocCharSetOther : "Other Character Set Encoding",
 
DlgDocDocType : "Document Type Heading",
DlgDocDocTypeOther : "Other Document Type Heading",
DlgDocIncXHTML : "Include XHTML Declarations",
DlgDocBgColor : "Background Colour",
DlgDocBgImage : "Background Image URL",
DlgDocBgNoScroll : "Nonscrolling Background",
DlgDocCText : "Text",
DlgDocCLink : "Link",
DlgDocCVisited : "Visited Link",
DlgDocCActive : "Active Link",
DlgDocMargins : "Page Margins",
DlgDocMaTop : "Top",
DlgDocMaLeft : "Left",
DlgDocMaRight : "Right",
DlgDocMaBottom : "Bottom",
DlgDocMeIndex : "Document Indexing Keywords (comma separated)",
DlgDocMeDescr : "Document Description",
DlgDocMeAuthor : "Author",
DlgDocMeCopy : "Copyright",
DlgDocPreview : "Preview",
 
// Templates Dialog
Templates : "Templates",
DlgTemplatesTitle : "Content Templates",
DlgTemplatesSelMsg : "Please select the template to open in the editor<br>(the actual contents will be lost):",
DlgTemplatesLoading : "Loading templates list. Please wait...",
DlgTemplatesNoTpl : "(No templates defined)",
DlgTemplatesReplace : "Replace actual contents",
 
// About Dialog
DlgAboutAboutTab : "About",
DlgAboutBrowserInfoTab : "Browser Info",
DlgAboutLicenseTab : "License",
DlgAboutVersion : "version",
DlgAboutLicense : "Licensed under the terms of the GNU Lesser General Public License",
DlgAboutInfo : "For further information go to"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/km.js
New file
0,0 → 1,501
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: km.js
* Khmer language file.
*
* File Authors:
* Chay Sengtha (sengtha@e-khmer.com - http://translate.e-khmer.net)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "បង្រួមរបាឧបរកណ៍",
ToolbarExpand : "ពង្រីករបាឧបរណ៍",
 
// Toolbar Items and Context Menu
Save : "រក្សាទុក",
NewPage : "ទំព័រថ្មី",
Preview : "មើលសាកល្បង",
Cut : "កាត់យក",
Copy : "ចំលងយក",
Paste : "ចំលងដាក់",
PasteText : "ចំលងដាក់ជាអត្ថបទធម្មតា",
PasteWord : "ចំលងដាក់ពី Word",
Print : "បោះពុម្ភ",
SelectAll : "ជ្រើសរើសទាំងអស់",
RemoveFormat : "លប់ចោល ការរចនា",
InsertLinkLbl : "ឈ្នាប់",
InsertLink : "បន្ថែម/កែប្រែ ឈ្នាប់",
RemoveLink : "លប់ឈ្នាប់",
Anchor : "បន្ថែម/កែប្រែ យុថ្កា",
InsertImageLbl : "រូបភាព",
InsertImage : "បន្ថែម/កែប្រែ រូបភាព",
InsertFlashLbl : "Flash",
InsertFlash : "បន្ថែម/កែប្រែ Flash",
InsertTableLbl : "តារាង",
InsertTable : "បន្ថែម/កែប្រែ តារាង",
InsertLineLbl : "បន្ទាត់",
InsertLine : "បន្ថែមបន្ទាត់ផ្តេក",
InsertSpecialCharLbl: "អក្សរពិសេស",
InsertSpecialChar : "បន្ថែមអក្សរពិសេស",
InsertSmileyLbl : "រូបភាព",
InsertSmiley : "បន្ថែម រូបភាព",
About : "អំពី FCKeditor",
Bold : "អក្សរដិតធំ",
Italic : "អក្សរផ្តេក",
Underline : "ដិតបន្ទាត់ពីក្រោមអក្សរ",
StrikeThrough : "ដិតបន្ទាត់ពាក់កណ្តាលអក្សរ",
Subscript : "អក្សរតូចក្រោម",
Superscript : "អក្សរតូចលើ",
LeftJustify : "តំរឹមឆ្វេង",
CenterJustify : "តំរឹមកណ្តាល",
RightJustify : "តំរឹមស្តាំ",
BlockJustify : "តំរឹមសងខាង",
DecreaseIndent : "បន្ថយការចូលបន្ទាត់",
IncreaseIndent : "បន្ថែមការចូលបន្ទាត់",
Undo : "សារឡើងវិញ",
Redo : "ធ្វើឡើងវិញ",
NumberedListLbl : "បញ្ជីជាអក្សរ",
NumberedList : "បន្ថែម/លប់ បញ្ជីជាអក្សរ",
BulletedListLbl : "បញ្ជីជារង្វង់មូល",
BulletedList : "បន្ថែម/លប់ បញ្ជីជារង្វង់មូល",
ShowTableBorders : "បង្ហាញស៊ុមតារាង",
ShowDetails : "បង្ហាញពិស្តារ",
Style : "ម៉ូត",
FontFormat : "រចនា",
Font : "ហ្វុង",
FontSize : "ទំហំ",
TextColor : "ពណ៌អក្សរ",
BGColor : "ពណ៌ផ្ទៃខាងក្រោយ",
Source : "កូត",
Find : "ស្វែងរក",
Replace : "ជំនួស",
SpellCheck : "ពិនិត្យអក្ខរាវិរុទ្ធ",
UniversalKeyboard : "ក្តារពុម្ភអក្សរសកល",
PageBreakLbl : "ការផ្តាច់ទំព័រ",
PageBreak : "បន្ថែម ការផ្តាច់ទំព័រ",
 
Form : "បែបបទ",
Checkbox : "ប្រអប់ជ្រើសរើស",
RadioButton : "ប៉ូតុនរង្វង់មូល",
TextField : "ជួរសរសេរអត្ថបទ",
Textarea : "តំបន់សរសេរអត្ថបទ",
HiddenField : "ជួរលាក់",
Button : "ប៉ូតុន",
SelectionField : "ជួរជ្រើសរើស",
ImageButton : "ប៉ូតុនរូបភាព",
 
FitWindow : "Maximize the editor size", //MISSING
 
// Context Menu
EditLink : "កែប្រែឈ្នាប់",
CellCM : "Cell", //MISSING
RowCM : "Row", //MISSING
ColumnCM : "Column", //MISSING
InsertRow : "បន្ថែមជួរផ្តេក",
DeleteRows : "លប់ជួរផ្តេក",
InsertColumn : "បន្ថែមជួរឈរ",
DeleteColumns : "លប់ជួរឈរ",
InsertCell : "បន្ថែម សែល",
DeleteCells : "លប់សែល",
MergeCells : "បញ្ជូលសែល",
SplitCell : "ផ្តាច់សែល",
TableDelete : "លប់តារាង",
CellProperties : "ការកំណត់សែល",
TableProperties : "ការកំណត់តារាង",
ImageProperties : "ការកំណត់រូបភាព",
FlashProperties : "ការកំណត់ Flash",
 
AnchorProp : "ការកំណត់យុថ្កា",
ButtonProp : "ការកំណត់ ប៉ូតុន",
CheckboxProp : "ការកំណត់ប្រអប់ជ្រើសរើស",
HiddenFieldProp : "ការកំណត់ជួរលាក់",
RadioButtonProp : "ការកំណត់ប៉ូតុនរង្វង់",
ImageButtonProp : "ការកំណត់ប៉ូតុនរូបភាព",
TextFieldProp : "ការកំណត់ជួរអត្ថបទ",
SelectionFieldProp : "ការកំណត់ជួរជ្រើសរើស",
TextareaProp : "ការកំណត់កន្លែងសរសេរអត្ថបទ",
FormProp : "ការកំណត់បែបបទ",
 
FontFormats : "Normal;Formatted;Address;Heading 1;Heading 2;Heading 3;Heading 4;Heading 5;Heading 6;Normal (DIV)",
 
// Alerts and Messages
ProcessingXHTML : "កំពុងដំណើរការ XHTML ។ សូមរងចាំ...",
Done : "ចប់រួចរាល់",
PasteWordConfirm : "អត្ថបទដែលលោកអ្នកបំរុងចំលងដាក់ ហាក់បីដូចជាត្រូវចំលងមកពីកម្មវិធី​Word​។ តើលោកអ្នកចង់សំអាតមុនចំលងអត្ថបទដាក់ទេ?",
NotCompatiblePaste : "ពាក្យបញ្ជានេះប្រើបានតែជាមួយ Internet Explorer កំរិត 5.5 រឺ លើសនេះ ។ តើលោកអ្នកចង់ចំលងដាក់ដោយមិនចាំបាច់សំអាតទេ?",
UnknownToolbarItem : "វត្ថុលើរបាឧបរកណ៍ មិនស្គាល់ \"%1\"",
UnknownCommand : "ឈ្មោះពាក្យបញ្ជា មិនស្គាល់ \"%1\"",
NotImplemented : "ពាក្យបញ្ជា មិនបានអនុវត្ត",
UnknownToolbarSet : "របាឧបរកណ៍ \"%1\" ពុំមាន ។",
NoActiveX : "ការកំណត់សុវត្ថភាពរបស់កម្មវិធីរុករករបស់លោកអ្នក នេះ​អាចធ្វើអោយលោកអ្នកមិនអាចប្រើមុខងារខ្លះរបស់កម្មវិធីតាក់តែងអត្ថបទនេះ ។ លោកអ្នកត្រូវកំណត់អោយ \"ActiveX និង​កម្មវិធីជំនួយក្នុង (plug-ins)\" អោយដំណើរការ ។ លោកអ្នកអាចជួបប្រទះនឹង បញ្ហា ព្រមជាមួយនឹងការបាត់បង់មុខងារណាមួយរបស់កម្មវិធីតាក់តែងអត្ថបទនេះ ។",
BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.", //MISSING
DialogBlocked : "វីនដូវមិនអាចបើកបានទេ ។ សូមពិនិត្យចំពោះកម្មវិធីបិទ វីនដូវលោត (popup) ថាតើវាដំណើរការរឺទេ ។",
 
// Dialogs
DlgBtnOK : "យល់ព្រម",
DlgBtnCancel : "មិនយល់ព្រម",
DlgBtnClose : "បិទ",
DlgBtnBrowseServer : "មើល",
DlgAdvancedTag : "កំរិតខ្ពស់",
DlgOpOther : "<ផ្សេងទៅត>",
DlgInfoTab : "ពត៌មាន",
DlgAlertUrl : "សូមសរសេរ URL",
 
// General Dialogs Labels
DlgGenNotSet : "<មិនមែន>",
DlgGenId : "Id",
DlgGenLangDir : "ទិសដៅភាសា",
DlgGenLangDirLtr : "ពីឆ្វេងទៅស្តាំ(LTR)",
DlgGenLangDirRtl : "ពីស្តាំទៅឆ្វេង(RTL)",
DlgGenLangCode : "លេខកូតភាសា",
DlgGenAccessKey : "ឃី សំរាប់ចូល",
DlgGenName : "ឈ្មោះ",
DlgGenTabIndex : "លេខ Tab",
DlgGenLongDescr : "អធិប្បាយ URL វែង",
DlgGenClass : "Stylesheet Classes",
DlgGenTitle : "ចំណងជើង ប្រឹក្សា",
DlgGenContType : "ប្រភេទអត្ថបទ ប្រឹក្សា",
DlgGenLinkCharset : "លេខកូតអក្សររបស់ឈ្នាប់",
DlgGenStyle : "ម៉ូត",
 
// Image Dialog
DlgImgTitle : "ការកំណត់រូបភាព",
DlgImgInfoTab : "ពត៌មានអំពីរូបភាព",
DlgImgBtnUpload : "បញ្ជូនទៅកាន់ម៉ាស៊ីនផ្តល់សេវា",
DlgImgURL : "URL",
DlgImgUpload : "ទាញយក",
DlgImgAlt : "អត្ថបទជំនួស",
DlgImgWidth : "ទទឹង",
DlgImgHeight : "កំពស់",
DlgImgLockRatio : "អត្រាឡុក",
DlgBtnResetSize : "កំណត់ទំហំឡើងវិញ",
DlgImgBorder : "ស៊ុម",
DlgImgHSpace : "គំលាតទទឹង",
DlgImgVSpace : "គំលាតបណ្តោយ",
DlgImgAlign : "កំណត់ទីតាំង",
DlgImgAlignLeft : "ខាងឆ្វង",
DlgImgAlignAbsBottom: "Abs Bottom", //MISSING
DlgImgAlignAbsMiddle: "Abs Middle", //MISSING
DlgImgAlignBaseline : "បន្ទាត់ជាមូលដ្ឋាន",
DlgImgAlignBottom : "ខាងក្រោម",
DlgImgAlignMiddle : "កណ្តាល",
DlgImgAlignRight : "ខាងស្តាំ",
DlgImgAlignTextTop : "លើអត្ថបទ",
DlgImgAlignTop : "ខាងលើ",
DlgImgPreview : "មើលសាកល្បង",
DlgImgAlertUrl : "សូមសរសេរងាស័យដ្ឋានរបស់រូបភាព",
DlgImgLinkTab : "ឈ្នាប់",
 
// Flash Dialog
DlgFlashTitle : "ការកំណត់ Flash",
DlgFlashChkPlay : "លេងដោយស្វ័យប្រវត្ត",
DlgFlashChkLoop : "ចំនួនដង",
DlgFlashChkMenu : "បង្ហាញ មឺនុយរបស់ Flash",
DlgFlashScale : "ទំហំ",
DlgFlashScaleAll : "បង្ហាញទាំងអស់",
DlgFlashScaleNoBorder : "មិនបង្ហាញស៊ុម",
DlgFlashScaleFit : "ត្រូវល្មម",
 
// Link Dialog
DlgLnkWindowTitle : "ឈ្នាប់",
DlgLnkInfoTab : "ពត៌មានអំពីឈ្នាប់",
DlgLnkTargetTab : "គោលដៅ",
 
DlgLnkType : "ប្រភេទឈ្នាប់",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "យុថ្កានៅក្នុងទំព័រនេះ",
DlgLnkTypeEMail : "អ៊ីមែល",
DlgLnkProto : "ប្រូតូកូល",
DlgLnkProtoOther : "<ផ្សេងទៀត>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "ជ្រើសរើសយុថ្កា",
DlgLnkAnchorByName : "តាមឈ្មោះរបស់យុថ្កា",
DlgLnkAnchorById : "តាម Id",
DlgLnkNoAnchors : "<ពុំមានយុថ្កានៅក្នុងឯកសារនេះទេ>",
DlgLnkEMail : "អ៊ីមែល",
DlgLnkEMailSubject : "ចំណងជើងអត្ថបទ",
DlgLnkEMailBody : "អត្ថបទ",
DlgLnkUpload : "ទាញយក",
DlgLnkBtnUpload : "ទាញយក",
 
DlgLnkTarget : "គោលដៅ",
DlgLnkTargetFrame : "<ហ្វ្រេម>",
DlgLnkTargetPopup : "<វីនដូវ លោត>",
DlgLnkTargetBlank : "វីនដូវថ្មី (_blank)",
DlgLnkTargetParent : "វីនដូវមេ (_parent)",
DlgLnkTargetSelf : "វីនដូវដដែល (_self)",
DlgLnkTargetTop : "វីនដូវនៅលើគេ(_top)",
DlgLnkTargetFrameName : "ឈ្មោះហ្រ្វេមដែលជាគោលដៅ",
DlgLnkPopWinName : "ឈ្មោះវីនដូវលោត",
DlgLnkPopWinFeat : "លក្ខណះរបស់វីនដូលលោត",
DlgLnkPopResize : "ទំហំអាចផ្លាស់ប្តូរ",
DlgLnkPopLocation : "របា ទីតាំង",
DlgLnkPopMenu : "របា មឺនុយ",
DlgLnkPopScroll : "របា ទាញ",
DlgLnkPopStatus : "របា ពត៌មាន",
DlgLnkPopToolbar : "របា ឩបករណ៍",
DlgLnkPopFullScrn : "អេក្រុងពេញ(IE)",
DlgLnkPopDependent : "អាស្រ័យលើ (Netscape)",
DlgLnkPopWidth : "ទទឹង",
DlgLnkPopHeight : "កំពស់",
DlgLnkPopLeft : "ទីតាំងខាងឆ្វេង",
DlgLnkPopTop : "ទីតាំងខាងលើ",
 
DlnLnkMsgNoUrl : "សូមសរសេរ អាស័យដ្ឋាន URL",
DlnLnkMsgNoEMail : "សូមសរសេរ អាស័យដ្ឋាន អ៊ីមែល",
DlnLnkMsgNoAnchor : "សូមជ្រើសរើស យុថ្កា",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "ជ្រើសរើស ពណ៌",
DlgColorBtnClear : "លប់",
DlgColorHighlight : "ផាត់ពណ៌",
DlgColorSelected : "បានជ្រើសរើស",
 
// Smiley Dialog
DlgSmileyTitle : "បញ្ជូលរូបភាព",
 
// Special Character Dialog
DlgSpecialCharTitle : "តូអក្សរពិសេស",
 
// Table Dialog
DlgTableTitle : "ការកំណត់ តារាង",
DlgTableRows : "ជួរផ្តេក",
DlgTableColumns : "ជួរឈរ",
DlgTableBorder : "ទំហំស៊ុម",
DlgTableAlign : "ការកំណត់ទីតាំង",
DlgTableAlignNotSet : "<មិនកំណត់>",
DlgTableAlignLeft : "ខាងឆ្វេង",
DlgTableAlignCenter : "កណ្តាល",
DlgTableAlignRight : "ខាងស្តាំ",
DlgTableWidth : "ទទឹង",
DlgTableWidthPx : "ភីកសែល",
DlgTableWidthPc : "ភាគរយ",
DlgTableHeight : "កំពស់",
DlgTableCellSpace : "គំលាតសែល",
DlgTableCellPad : "គែមសែល",
DlgTableCaption : "ចំណងជើង",
DlgTableSummary : "សេចក្តីសង្ខេប",
 
// Table Cell Dialog
DlgCellTitle : "ការកំណត់ សែល",
DlgCellWidth : "ទទឹង",
DlgCellWidthPx : "ភីកសែល",
DlgCellWidthPc : "ភាគរយ",
DlgCellHeight : "កំពស់",
DlgCellWordWrap : "បង្ហាញអត្ថបទទាំងអស់",
DlgCellWordWrapNotSet : "<មិនកំណត់>",
DlgCellWordWrapYes : "បាទ(ចា)",
DlgCellWordWrapNo : "ទេ",
DlgCellHorAlign : "តំរឹមផ្តេក",
DlgCellHorAlignNotSet : "<មិនកំណត់>",
DlgCellHorAlignLeft : "ខាងឆ្វេង",
DlgCellHorAlignCenter : "កណ្តាល",
DlgCellHorAlignRight: "Right", //MISSING
DlgCellVerAlign : "តំរឹមឈរ",
DlgCellVerAlignNotSet : "<មិនកណត់>",
DlgCellVerAlignTop : "ខាងលើ",
DlgCellVerAlignMiddle : "កណ្តាល",
DlgCellVerAlignBottom : "ខាងក្រោម",
DlgCellVerAlignBaseline : "បន្ទាត់ជាមូលដ្ឋាន",
DlgCellRowSpan : "បញ្ជូលជួរផ្តេក",
DlgCellCollSpan : "បញ្ជូលជួរឈរ",
DlgCellBackColor : "ពណ៌ផ្នែកខាងក្រោម",
DlgCellBorderColor : "ពណ៌ស៊ុម",
DlgCellBtnSelect : "ជ្រើសរើស...",
 
// Find Dialog
DlgFindTitle : "ស្វែងរក",
DlgFindFindBtn : "ស្វែងរក",
DlgFindNotFoundMsg : "ពាក្យនេះ រកមិនឃើញទេ ។",
 
// Replace Dialog
DlgReplaceTitle : "ជំនួស",
DlgReplaceFindLbl : "ស្វែងរកអ្វី:",
DlgReplaceReplaceLbl : "ជំនួសជាមួយ:",
DlgReplaceCaseChk : "ករណ៉ត្រូវរក",
DlgReplaceReplaceBtn : "ជំនួស",
DlgReplaceReplAllBtn : "ជំនួសទាំងអស់",
DlgReplaceWordChk : "ត្រូវពាក្យទាំងអស់",
 
// Paste Operations / Dialog
PasteErrorPaste : "Your browser security settings don't permit the editor to automatically execute pasting operations. Please use the keyboard for that (Ctrl+V).", //MISSING
PasteErrorCut : "ការកំណត់សុវត្ថភាពរបស់កម្មវិធីរុករករបស់លោកអ្នក នេះ​មិនអាចធ្វើកម្មវិធីតាក់តែងអត្ថបទ កាត់អត្ថបទយកដោយស្វ័យប្រវត្តបានឡើយ ។ សូមប្រើប្រាស់បន្សំ ឃីដូចនេះ (Ctrl+X) ។",
PasteErrorCopy : "ការកំណត់សុវត្ថភាពរបស់កម្មវិធីរុករករបស់លោកអ្នក នេះ​មិនអាចធ្វើកម្មវិធីតាក់តែងអត្ថបទ ចំលងអត្ថបទយកដោយស្វ័យប្រវត្តបានឡើយ ។ សូមប្រើប្រាស់បន្សំ ឃីដូចនេះ (Ctrl+C)។",
 
PasteAsText : "ចំលងដាក់អត្ថបទធម្មតា",
PasteFromWord : "ចំលងពាក្យពីកម្មវិធី Word",
 
DlgPasteMsg2 : "សូមចំលងអត្ថបទទៅដាក់ក្នុងប្រអប់ដូចខាងក្រោមដោយប្រើប្រាស់ ឃី ​(<STRONG>Ctrl+V</STRONG>) ហើយចុច <STRONG>OK</STRONG> ។",
DlgPasteIgnoreFont : "មិនគិតអំពីប្រភេទពុម្ភអក្សរ",
DlgPasteRemoveStyles : "លប់ម៉ូត",
DlgPasteCleanBox : "លប់អត្ថបទចេញពីប្រអប់",
 
// Color Picker
ColorAutomatic : "ស្វ័យប្រវត្ត",
ColorMoreColors : "ពណ៌ផ្សេងទៀត..",
 
// Document Properties
DocProps : "ការកំណត់ ឯកសារ",
 
// Anchor Dialog
DlgAnchorTitle : "ការកំណត់ចំណងជើងយុទ្ធថ្កា",
DlgAnchorName : "ឈ្មោះយុទ្ធថ្កា",
DlgAnchorErrorName : "សូមសរសេរ ឈ្មោះយុទ្ធថ្កា",
 
// Speller Pages Dialog
DlgSpellNotInDic : "គ្មានក្នុងវចនានុក្រម",
DlgSpellChangeTo : "ផ្លាស់ប្តូរទៅ",
DlgSpellBtnIgnore : "មិនផ្លាស់ប្តូរ",
DlgSpellBtnIgnoreAll : "មិនផ្លាស់ប្តូរ ទាំងអស់",
DlgSpellBtnReplace : "ជំនួស",
DlgSpellBtnReplaceAll : "ជំនួសទាំងអស់",
DlgSpellBtnUndo : "សារឡើងវិញ",
DlgSpellNoSuggestions : "- គ្មានសំណើរ -",
DlgSpellProgress : "កំពុងពិនិត្យអក្ខរាវិរុទ្ធ...",
DlgSpellNoMispell : "ការពិនិត្យអក្ខរាវិរុទ្ធបានចប់: គ្មានកំហុស",
DlgSpellNoChanges : "ការពិនិត្យអក្ខរាវិរុទ្ធបានចប់: ពុំមានផ្លាស់ប្តូរ",
DlgSpellOneChange : "ការពិនិត្យអក្ខរាវិរុទ្ធបានចប់: ពាក្យមួយត្រូចបានផ្លាស់ប្តូរ",
DlgSpellManyChanges : "ការពិនិត្យអក្ខរាវិរុទ្ធបានចប់: %1 ពាក្យបានផ្លាស់ប្តូរ",
 
IeSpellDownload : "ពុំមានកម្មវិធីពិនិត្យអក្ខរាវិរុទ្ធ ។ តើចង់ទាញយកពីណា?",
 
// Button Dialog
DlgButtonText : "អត្ថបទ(តំលៃ)",
DlgButtonType : "ប្រភេទ",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "ឈ្មោះ",
DlgCheckboxValue : "តំលៃ",
DlgCheckboxSelected : "បានជ្រើសរើស",
 
// Form Dialog
DlgFormName : "ឈ្មោះ",
DlgFormAction : "សកម្មភាព",
DlgFormMethod : "វិធី",
 
// Select Field Dialog
DlgSelectName : "ឈ្មោះ",
DlgSelectValue : "តំលៃ",
DlgSelectSize : "ទំហំ",
DlgSelectLines : "បន្ទាត់",
DlgSelectChkMulti : "អនុញ្ញាតអោយជ្រើសរើសច្រើន",
DlgSelectOpAvail : "ការកំណត់ជ្រើសរើស ដែលអាចកំណត់បាន",
DlgSelectOpText : "ពាក្យ",
DlgSelectOpValue : "តំលៃ",
DlgSelectBtnAdd : "បន្ថែម",
DlgSelectBtnModify : "ផ្លាស់ប្តូរ",
DlgSelectBtnUp : "លើ",
DlgSelectBtnDown : "ក្រោម",
DlgSelectBtnSetValue : "Set as selected value", //MISSING
DlgSelectBtnDelete : "លប់",
 
// Textarea Dialog
DlgTextareaName : "ឈ្មោះ",
DlgTextareaCols : "ជូរឈរ",
DlgTextareaRows : "ជូរផ្តេក",
 
// Text Field Dialog
DlgTextName : "ឈ្មោះ",
DlgTextValue : "តំលៃ",
DlgTextCharWidth : "ទទឹង អក្សរ",
DlgTextMaxChars : "អក្សរអតិបរិមា",
DlgTextType : "ប្រភេទ",
DlgTextTypeText : "ពាក្យ",
DlgTextTypePass : "ពាក្យសំងាត់",
 
// Hidden Field Dialog
DlgHiddenName : "ឈ្មោះ",
DlgHiddenValue : "តំលៃ",
 
// Bulleted List Dialog
BulletedListProp : "កំណត់បញ្ជីរង្វង់",
NumberedListProp : "កំណត់បញ្េជីលេខ",
DlgLstStart : "Start", //MISSING
DlgLstType : "ប្រភេទ",
DlgLstTypeCircle : "រង្វង់",
DlgLstTypeDisc : "Disc",
DlgLstTypeSquare : "ការេ",
DlgLstTypeNumbers : "លេខ(1, 2, 3)",
DlgLstTypeLCase : "អក្សរតូច(a, b, c)",
DlgLstTypeUCase : "អក្សរធំ(A, B, C)",
DlgLstTypeSRoman : "អក្សរឡាតាំងតូច(i, ii, iii)",
DlgLstTypeLRoman : "អក្សរឡាតាំងធំ(I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "ទូទៅ",
DlgDocBackTab : "ផ្នែកខាងក្រោយ",
DlgDocColorsTab : "ទំព័រ​និង ស៊ុម",
DlgDocMetaTab : "ទិន្នន័យមេ",
 
DlgDocPageTitle : "ចំណងជើងទំព័រ",
DlgDocLangDir : "ទិសដៅសរសេរភាសា",
DlgDocLangDirLTR : "ពីឆ្វេងទៅស្ដាំ(LTR)",
DlgDocLangDirRTL : "ពីស្ដាំទៅឆ្វេង(RTL)",
DlgDocLangCode : "លេខកូតភាសា",
DlgDocCharSet : "កំណត់លេខកូតភាសា",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "កំណត់លេខកូតភាសាផ្សេងទៀត",
 
DlgDocDocType : "ប្រភេទក្បាលទំព័រ",
DlgDocDocTypeOther : "ប្រភេទក្បាលទំព័រផ្សេងទៀត",
DlgDocIncXHTML : "បញ្ជូល XHTML",
DlgDocBgColor : "ពណ៌ខាងក្រោម",
DlgDocBgImage : "URL របស់រូបភាពខាងក្រោម",
DlgDocBgNoScroll : "ទំព័រក្រោមមិនប្តូរ",
DlgDocCText : "អត្តបទ",
DlgDocCLink : "ឈ្នាប់",
DlgDocCVisited : "ឈ្នាប់មើលហើយ",
DlgDocCActive : "ឈ្នាប់កំពុងមើល",
DlgDocMargins : "ស៊ុមទំព័រ",
DlgDocMaTop : "លើ",
DlgDocMaLeft : "ឆ្វេង",
DlgDocMaRight : "ស្ដាំ",
DlgDocMaBottom : "ក្រោម",
DlgDocMeIndex : "ពាក្យនៅក្នុងឯកសារ (ផ្តាច់ពីគ្នាដោយក្បៀស)",
DlgDocMeDescr : "សេចក្តីអត្ថាធិប្បាយអំពីឯកសារ",
DlgDocMeAuthor : "អ្នកនិពន្ធ",
DlgDocMeCopy : "រក្សាសិទ្ធិ៏",
DlgDocPreview : "មើលសាកល្បង",
 
// Templates Dialog
Templates : "ឯកសារគំរូ",
DlgTemplatesTitle : "ឯកសារគំរូ របស់អត្ថន័យ",
DlgTemplatesSelMsg : "សូមជ្រើសរើសឯកសារគំរូ ដើម្បីបើកនៅក្នុងកម្មវិធីតាក់តែងអត្ថបទ<br>(អត្ថបទនឹងបាត់បង់):",
DlgTemplatesLoading : "កំពុងអានបញ្ជីឯកសារគំរូ ។ សូមរងចាំ...",
DlgTemplatesNoTpl : "(ពុំមានឯកសារគំរូត្រូវបានកំណត់)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "អំពី",
DlgAboutBrowserInfoTab : "ព៌តមានកម្មវិធីរុករក",
DlgAboutLicenseTab : "License", //MISSING
DlgAboutVersion : "ជំនាន់",
DlgAboutLicense : "Licensed under the terms of the GNU Lesser General Public License",
DlgAboutInfo : "សំរាប់ព៌តមានផ្សេងទៀត សូមទាក់ទង"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/es.js
New file
0,0 → 1,501
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: es.js
* Spanish language file.
*
* File Authors:
* Gabriel Schillaci (internetbug@users.sourceforge.net)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Contraer Barra",
ToolbarExpand : "Expandir Barra",
 
// Toolbar Items and Context Menu
Save : "Guardar",
NewPage : "Nueva Página",
Preview : "Vista Previa",
Cut : "Cortar",
Copy : "Copiar",
Paste : "Pegar",
PasteText : "Pegar como texto plano",
PasteWord : "Pegar desde Word",
Print : "Imprimir",
SelectAll : "Seleccionar Todo",
RemoveFormat : "Eliminar Formato",
InsertLinkLbl : "Vínculo",
InsertLink : "Insertar/Editar Vínculo",
RemoveLink : "Eliminar Vínculo",
Anchor : "Referencia",
InsertImageLbl : "Imagen",
InsertImage : "Insertar/Editar Imagen",
InsertFlashLbl : "Flash",
InsertFlash : "Insertar/Editar Flash",
InsertTableLbl : "Tabla",
InsertTable : "Insertar/Editar Tabla",
InsertLineLbl : "Línea",
InsertLine : "Insertar Línea Horizontal",
InsertSpecialCharLbl: "Caracter Especial",
InsertSpecialChar : "Insertar Caracter Especial",
InsertSmileyLbl : "Emoticons",
InsertSmiley : "Insertar Emoticons",
About : "Acerca de FCKeditor",
Bold : "Negrita",
Italic : "Cursiva",
Underline : "Subrayado",
StrikeThrough : "Tachado",
Subscript : "Subíndice",
Superscript : "Superíndice",
LeftJustify : "Alinear a Izquierda",
CenterJustify : "Centrar",
RightJustify : "Alinear a Derecha",
BlockJustify : "Justificado",
DecreaseIndent : "Disminuir Sangría",
IncreaseIndent : "Aumentar Sangría",
Undo : "Deshacer",
Redo : "Rehacer",
NumberedListLbl : "Numeración",
NumberedList : "Insertar/Eliminar Numeración",
BulletedListLbl : "Viñetas",
BulletedList : "Insertar/Eliminar Viñetas",
ShowTableBorders : "Mostrar Bordes de Tablas",
ShowDetails : "Mostrar saltos de Párrafo",
Style : "Estilo",
FontFormat : "Formato",
Font : "Fuente",
FontSize : "Tamaño",
TextColor : "Color de Texto",
BGColor : "Color de Fondo",
Source : "Fuente HTML",
Find : "Buscar",
Replace : "Reemplazar",
SpellCheck : "Ortografía",
UniversalKeyboard : "Teclado Universal",
PageBreakLbl : "Salto de Página",
PageBreak : "Insertar Salto de Página",
 
Form : "Formulario",
Checkbox : "Casilla de Verificación",
RadioButton : "Botones de Radio",
TextField : "Campo de Texto",
Textarea : "Area de Texto",
HiddenField : "Campo Oculto",
Button : "Botón",
SelectionField : "Campo de Selección",
ImageButton : "Botón Imagen",
 
FitWindow : "Maximizar el tamaño del editor",
 
// Context Menu
EditLink : "Editar Vínculo",
CellCM : "Celda",
RowCM : "Fila",
ColumnCM : "Columna",
InsertRow : "Insertar Fila",
DeleteRows : "Eliminar Filas",
InsertColumn : "Insertar Columna",
DeleteColumns : "Eliminar Columnas",
InsertCell : "Insertar Celda",
DeleteCells : "Eliminar Celdas",
MergeCells : "Combinar Celdas",
SplitCell : "Dividir Celda",
TableDelete : "Eliminar Tabla",
CellProperties : "Propiedades de Celda",
TableProperties : "Propiedades de Tabla",
ImageProperties : "Propiedades de Imagen",
FlashProperties : "Propiedades de Flash",
 
AnchorProp : "Propiedades de Referencia",
ButtonProp : "Propiedades de Botón",
CheckboxProp : "Propiedades de Casilla",
HiddenFieldProp : "Propiedades de Campo Oculto",
RadioButtonProp : "Propiedades de Botón de Radio",
ImageButtonProp : "Propiedades de Botón de Imagen",
TextFieldProp : "Propiedades de Campo de Texto",
SelectionFieldProp : "Propiedades de Campo de Selección",
TextareaProp : "Propiedades de Area de Texto",
FormProp : "Propiedades de Formulario",
 
FontFormats : "Normal;Con formato;Dirección;Encabezado 1;Encabezado 2;Encabezado 3;Encabezado 4;Encabezado 5;Encabezado 6;Normal (DIV)",
 
// Alerts and Messages
ProcessingXHTML : "Procesando XHTML. Por favor, espere...",
Done : "Hecho",
PasteWordConfirm : "El texto que desea parece provenir de Word. Desea depurarlo antes de pegarlo?",
NotCompatiblePaste : "Este comando está disponible sólo para Internet Explorer version 5.5 or superior. Desea pegar sin depurar?",
UnknownToolbarItem : "Item de barra desconocido \"%1\"",
UnknownCommand : "Nombre de comando desconocido \"%1\"",
NotImplemented : "Comando no implementado",
UnknownToolbarSet : "Nombre de barra \"%1\" no definido",
NoActiveX : "La configuración de las opciones de seguridad de su navegador puede estar limitando algunas características del editor. Por favor active la opción \"Ejecutar controles y complementos de ActiveX \", de lo contrario puede experimentar errores o ausencia de funcionalidades.",
BrowseServerBlocked : "La ventana de visualización del servidor no pudo ser abierta. Verifique que su navegador no esté bloqueando las ventanas emergentes (pop up).",
DialogBlocked : "No se ha podido abrir la ventana de diálogo. Verifique que su navegador no esté bloqueando las ventanas emergentes (pop up).",
 
// Dialogs
DlgBtnOK : "OK",
DlgBtnCancel : "Cancelar",
DlgBtnClose : "Cerrar",
DlgBtnBrowseServer : "Ver Servidor",
DlgAdvancedTag : "Avanzado",
DlgOpOther : "<Otro>",
DlgInfoTab : "Información",
DlgAlertUrl : "Inserte el URL",
 
// General Dialogs Labels
DlgGenNotSet : "<No definido>",
DlgGenId : "Id",
DlgGenLangDir : "Orientación de idioma",
DlgGenLangDirLtr : "Izquierda a Derecha (LTR)",
DlgGenLangDirRtl : "Derecha a Izquierda (RTL)",
DlgGenLangCode : "Código de idioma",
DlgGenAccessKey : "Clave de Acceso",
DlgGenName : "Nombre",
DlgGenTabIndex : "Indice de tabulación",
DlgGenLongDescr : "Descripción larga URL",
DlgGenClass : "Clases de hojas de estilo",
DlgGenTitle : "Título",
DlgGenContType : "Tipo de Contenido",
DlgGenLinkCharset : "Fuente de caracteres vinculado",
DlgGenStyle : "Estilo",
 
// Image Dialog
DlgImgTitle : "Propiedades de Imagen",
DlgImgInfoTab : "Información de Imagen",
DlgImgBtnUpload : "Enviar al Servidor",
DlgImgURL : "URL",
DlgImgUpload : "Cargar",
DlgImgAlt : "Texto Alternativo",
DlgImgWidth : "Anchura",
DlgImgHeight : "Altura",
DlgImgLockRatio : "Proporcional",
DlgBtnResetSize : "Tamaño Original",
DlgImgBorder : "Borde",
DlgImgHSpace : "Esp.Horiz",
DlgImgVSpace : "Esp.Vert",
DlgImgAlign : "Alineación",
DlgImgAlignLeft : "Izquierda",
DlgImgAlignAbsBottom: "Abs inferior",
DlgImgAlignAbsMiddle: "Abs centro",
DlgImgAlignBaseline : "Línea de base",
DlgImgAlignBottom : "Pie",
DlgImgAlignMiddle : "Centro",
DlgImgAlignRight : "Derecha",
DlgImgAlignTextTop : "Tope del texto",
DlgImgAlignTop : "Tope",
DlgImgPreview : "Vista Previa",
DlgImgAlertUrl : "Por favor tipee el URL de la imagen",
DlgImgLinkTab : "Vínculo",
 
// Flash Dialog
DlgFlashTitle : "Propiedades de Flash",
DlgFlashChkPlay : "Autoejecución",
DlgFlashChkLoop : "Repetir",
DlgFlashChkMenu : "Activar Menú Flash",
DlgFlashScale : "Escala",
DlgFlashScaleAll : "Mostrar todo",
DlgFlashScaleNoBorder : "Sin Borde",
DlgFlashScaleFit : "Ajustado",
 
// Link Dialog
DlgLnkWindowTitle : "Vínculo",
DlgLnkInfoTab : "Información de Vínculo",
DlgLnkTargetTab : "Destino",
 
DlgLnkType : "Tipo de vínculo",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Referencia en esta página",
DlgLnkTypeEMail : "E-Mail",
DlgLnkProto : "Protocolo",
DlgLnkProtoOther : "<otro>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Seleccionar una referencia",
DlgLnkAnchorByName : "Por Nombre de Referencia",
DlgLnkAnchorById : "Por ID de elemento",
DlgLnkNoAnchors : "<No hay referencias disponibles en el documento>",
DlgLnkEMail : "Dirección de E-Mail",
DlgLnkEMailSubject : "Título del Mensaje",
DlgLnkEMailBody : "Cuerpo del Mensaje",
DlgLnkUpload : "Cargar",
DlgLnkBtnUpload : "Enviar al Servidor",
 
DlgLnkTarget : "Destino",
DlgLnkTargetFrame : "<marco>",
DlgLnkTargetPopup : "<ventana emergente>",
DlgLnkTargetBlank : "Nueva Ventana(_blank)",
DlgLnkTargetParent : "Ventana Padre (_parent)",
DlgLnkTargetSelf : "Misma Ventana (_self)",
DlgLnkTargetTop : "Ventana primaria (_top)",
DlgLnkTargetFrameName : "Nombre del Marco Destino",
DlgLnkPopWinName : "Nombre de Ventana Emergente",
DlgLnkPopWinFeat : "Características de Ventana Emergente",
DlgLnkPopResize : "Ajustable",
DlgLnkPopLocation : "Barra de ubicación",
DlgLnkPopMenu : "Barra de Menú",
DlgLnkPopScroll : "Barras de desplazamiento",
DlgLnkPopStatus : "Barra de Estado",
DlgLnkPopToolbar : "Barra de Herramientas",
DlgLnkPopFullScrn : "Pantalla Completa (IE)",
DlgLnkPopDependent : "Dependiente (Netscape)",
DlgLnkPopWidth : "Anchura",
DlgLnkPopHeight : "Altura",
DlgLnkPopLeft : "Posición Izquierda",
DlgLnkPopTop : "Posición Derecha",
 
DlnLnkMsgNoUrl : "Por favor tipee el vínculo URL",
DlnLnkMsgNoEMail : "Por favor tipee la dirección de e-mail",
DlnLnkMsgNoAnchor : "Por favor seleccione una referencia",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "Seleccionar Color",
DlgColorBtnClear : "Ninguno",
DlgColorHighlight : "Resaltado",
DlgColorSelected : "Seleccionado",
 
// Smiley Dialog
DlgSmileyTitle : "Insertar un Emoticon",
 
// Special Character Dialog
DlgSpecialCharTitle : "Seleccione un caracter especial",
 
// Table Dialog
DlgTableTitle : "Propiedades de Tabla",
DlgTableRows : "Filas",
DlgTableColumns : "Columnas",
DlgTableBorder : "Tamaño de Borde",
DlgTableAlign : "Alineación",
DlgTableAlignNotSet : "<No establecido>",
DlgTableAlignLeft : "Izquierda",
DlgTableAlignCenter : "Centrado",
DlgTableAlignRight : "Derecha",
DlgTableWidth : "Anchura",
DlgTableWidthPx : "pixeles",
DlgTableWidthPc : "porcentaje",
DlgTableHeight : "Altura",
DlgTableCellSpace : "Esp. e/celdas",
DlgTableCellPad : "Esp. interior",
DlgTableCaption : "Título",
DlgTableSummary : "Síntesis",
 
// Table Cell Dialog
DlgCellTitle : "Propiedades de Celda",
DlgCellWidth : "Anchura",
DlgCellWidthPx : "pixeles",
DlgCellWidthPc : "porcentaje",
DlgCellHeight : "Altura",
DlgCellWordWrap : "Cortar Línea",
DlgCellWordWrapNotSet : "<No establecido>",
DlgCellWordWrapYes : "Si",
DlgCellWordWrapNo : "No",
DlgCellHorAlign : "Alineación Horizontal",
DlgCellHorAlignNotSet : "<No establecido>",
DlgCellHorAlignLeft : "Izquierda",
DlgCellHorAlignCenter : "Centrado",
DlgCellHorAlignRight: "Derecha",
DlgCellVerAlign : "Alineación Vertical",
DlgCellVerAlignNotSet : "<Not establecido>",
DlgCellVerAlignTop : "Tope",
DlgCellVerAlignMiddle : "Medio",
DlgCellVerAlignBottom : "ie",
DlgCellVerAlignBaseline : "Línea de Base",
DlgCellRowSpan : "Abarcar Filas",
DlgCellCollSpan : "Abarcar Columnas",
DlgCellBackColor : "Color de Fondo",
DlgCellBorderColor : "Color de Borde",
DlgCellBtnSelect : "Seleccione...",
 
// Find Dialog
DlgFindTitle : "Buscar",
DlgFindFindBtn : "Buscar",
DlgFindNotFoundMsg : "El texto especificado no ha sido encontrado.",
 
// Replace Dialog
DlgReplaceTitle : "Reemplazar",
DlgReplaceFindLbl : "Texto a buscar:",
DlgReplaceReplaceLbl : "Reemplazar con:",
DlgReplaceCaseChk : "Coincidir may/min",
DlgReplaceReplaceBtn : "Reemplazar",
DlgReplaceReplAllBtn : "Reemplazar Todo",
DlgReplaceWordChk : "Coincidir toda la palabra",
 
// Paste Operations / Dialog
PasteErrorPaste : "La configuración de seguridad de este navegador no permite la ejecución automática de operaciones de pegado. Por favor use el teclado (Ctrl+V).",
PasteErrorCut : "La configuración de seguridad de este navegador no permite la ejecución automática de operaciones de cortado. Por favor use el teclado (Ctrl+X).",
PasteErrorCopy : "La configuración de seguridad de este navegador no permite la ejecución automática de operaciones de copiado. Por favor use el teclado (Ctrl+C).",
 
PasteAsText : "Pegar como Texto Plano",
PasteFromWord : "Pegar desde Word",
 
DlgPasteMsg2 : "Por favor pegue dentro del cuadro utilizando el teclado (<STRONG>Ctrl+V</STRONG>); luego presione <STRONG>OK</STRONG>.",
DlgPasteIgnoreFont : "Ignorar definiciones de fuentes",
DlgPasteRemoveStyles : "Remover definiciones de estilo",
DlgPasteCleanBox : "Borrar el contenido del cuadro",
 
// Color Picker
ColorAutomatic : "Automático",
ColorMoreColors : "Más Colores...",
 
// Document Properties
DocProps : "Propiedades del Documento",
 
// Anchor Dialog
DlgAnchorTitle : "Propiedades de la Referencia",
DlgAnchorName : "Nombre de la Referencia",
DlgAnchorErrorName : "Por favor, complete el nombre de la Referencia",
 
// Speller Pages Dialog
DlgSpellNotInDic : "No se encuentra en el Diccionario",
DlgSpellChangeTo : "Cambiar a",
DlgSpellBtnIgnore : "Ignorar",
DlgSpellBtnIgnoreAll : "Ignorar Todo",
DlgSpellBtnReplace : "Reemplazar",
DlgSpellBtnReplaceAll : "Reemplazar Todo",
DlgSpellBtnUndo : "Deshacer",
DlgSpellNoSuggestions : "- No hay sugerencias -",
DlgSpellProgress : "Control de Ortografía en progreso...",
DlgSpellNoMispell : "Control finalizado: no se encontraron errores",
DlgSpellNoChanges : "Control finalizado: no se ha cambiado ninguna palabra",
DlgSpellOneChange : "Control finalizado: se ha cambiado una palabra",
DlgSpellManyChanges : "Control finalizado: se ha cambiado %1 palabras",
 
IeSpellDownload : "Módulo de Control de Ortografía no instalado. ¿Desea descargarlo ahora?",
 
// Button Dialog
DlgButtonText : "Texto (Valor)",
DlgButtonType : "Tipo",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Nombre",
DlgCheckboxValue : "Valor",
DlgCheckboxSelected : "Seleccionado",
 
// Form Dialog
DlgFormName : "Nombre",
DlgFormAction : "Acción",
DlgFormMethod : "Método",
 
// Select Field Dialog
DlgSelectName : "Nombre",
DlgSelectValue : "Valor",
DlgSelectSize : "Tamaño",
DlgSelectLines : "Lineas",
DlgSelectChkMulti : "Permitir múltiple selección",
DlgSelectOpAvail : "Opciones disponibles",
DlgSelectOpText : "Texto",
DlgSelectOpValue : "Valor",
DlgSelectBtnAdd : "Agregar",
DlgSelectBtnModify : "Modificar",
DlgSelectBtnUp : "Subir",
DlgSelectBtnDown : "Bajar",
DlgSelectBtnSetValue : "Establecer como predeterminado",
DlgSelectBtnDelete : "Eliminar",
 
// Textarea Dialog
DlgTextareaName : "Nombre",
DlgTextareaCols : "Columnas",
DlgTextareaRows : "Filas",
 
// Text Field Dialog
DlgTextName : "Nombre",
DlgTextValue : "Valor",
DlgTextCharWidth : "Caracteres de ancho",
DlgTextMaxChars : "Máximo caracteres",
DlgTextType : "Tipo",
DlgTextTypeText : "Texto",
DlgTextTypePass : "Contraseña",
 
// Hidden Field Dialog
DlgHiddenName : "Nombre",
DlgHiddenValue : "Valor",
 
// Bulleted List Dialog
BulletedListProp : "Propiedades de Viñetas",
NumberedListProp : "Propiedades de Numeraciones",
DlgLstStart : "Start", //MISSING
DlgLstType : "Tipo",
DlgLstTypeCircle : "Círculo",
DlgLstTypeDisc : "Disco",
DlgLstTypeSquare : "Cuadrado",
DlgLstTypeNumbers : "Números (1, 2, 3)",
DlgLstTypeLCase : "letras en minúsculas (a, b, c)",
DlgLstTypeUCase : "letras en mayúsculas (A, B, C)",
DlgLstTypeSRoman : "Números Romanos (i, ii, iii)",
DlgLstTypeLRoman : "Números Romanos (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "General",
DlgDocBackTab : "Fondo",
DlgDocColorsTab : "Colores y Márgenes",
DlgDocMetaTab : "Meta Información",
 
DlgDocPageTitle : "Título de Página",
DlgDocLangDir : "Orientación de idioma",
DlgDocLangDirLTR : "Izq. a Derecha (LTR)",
DlgDocLangDirRTL : "Der. a Izquierda (RTL)",
DlgDocLangCode : "Código de Idioma",
DlgDocCharSet : "Codif. de Conjunto de Caracteres",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "Otra Codificación",
 
DlgDocDocType : "Encabezado de Tipo de Documento",
DlgDocDocTypeOther : "Otro Encabezado",
DlgDocIncXHTML : "Incluir Declaraciones XHTML",
DlgDocBgColor : "Color de Fondo",
DlgDocBgImage : "URL de Imagen de Fondo",
DlgDocBgNoScroll : "Fondo sin rolido",
DlgDocCText : "Texto",
DlgDocCLink : "Vínculo",
DlgDocCVisited : "Vínculo Visitado",
DlgDocCActive : "Vínculo Activo",
DlgDocMargins : "Márgenes de Página",
DlgDocMaTop : "Tope",
DlgDocMaLeft : "Izquierda",
DlgDocMaRight : "Derecha",
DlgDocMaBottom : "Pie",
DlgDocMeIndex : "Claves de indexación del Documento (separados por comas)",
DlgDocMeDescr : "Descripción del Documento",
DlgDocMeAuthor : "Autor",
DlgDocMeCopy : "Copyright",
DlgDocPreview : "Vista Previa",
 
// Templates Dialog
Templates : "Plantillas",
DlgTemplatesTitle : "Contenido de Plantillas",
DlgTemplatesSelMsg : "Por favor selecciona la plantilla a abrir en el editor<br>(el contenido actual se perderá):",
DlgTemplatesLoading : "Cargando lista de Plantillas. Por favor, aguarde...",
DlgTemplatesNoTpl : "(No hay plantillas definidas)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "Acerca de",
DlgAboutBrowserInfoTab : "Información de Navegador",
DlgAboutLicenseTab : "Licencia",
DlgAboutVersion : "versión",
DlgAboutLicense : "Licenciado bajo los términos de GNU Lesser General Public License",
DlgAboutInfo : "Para mayor información por favor dirigirse a"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/ko.js
New file
0,0 → 1,502
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: ko.js
* Korean language file.
*
* File Authors:
* Taehwan Kwag (thkwag@nate.com)
* Hyung-chae, Kim (chaeya@gmail.com)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "툴바 감추기",
ToolbarExpand : "툴바 보이기",
 
// Toolbar Items and Context Menu
Save : "저장하기",
NewPage : "새 문서",
Preview : "미리보기",
Cut : "잘라내기",
Copy : "복사하기",
Paste : "붙여넣기",
PasteText : "텍스트로 붙여넣기",
PasteWord : "MS Word 형식에서 붙여넣기",
Print : "인쇄하기",
SelectAll : "전체선택",
RemoveFormat : "포맷 지우기",
InsertLinkLbl : "링크",
InsertLink : "링크 삽입/변경",
RemoveLink : "링크 삭제",
Anchor : "책갈피 삽입/변경",
InsertImageLbl : "이미지",
InsertImage : "이미지 삽입/변경",
InsertFlashLbl : "플래쉬",
InsertFlash : "플래쉬 삽입/변경",
InsertTableLbl : "표",
InsertTable : "표 삽입/변경",
InsertLineLbl : "수평선",
InsertLine : "수평선 삽입",
InsertSpecialCharLbl: "특수문자 삽입",
InsertSpecialChar : "특수문자 삽입",
InsertSmileyLbl : "아이콘",
InsertSmiley : "아이콘 삽입",
About : "FCKeditor에 대하여",
Bold : "진하게",
Italic : "이텔릭",
Underline : "밑줄",
StrikeThrough : "취소선",
Subscript : "아래 첨자",
Superscript : "위 첨자",
LeftJustify : "왼쪽 정렬",
CenterJustify : "가운데 정렬",
RightJustify : "오른쪽 정렬",
BlockJustify : "양쪽 맞춤",
DecreaseIndent : "내어쓰기",
IncreaseIndent : "들여쓰기",
Undo : "취소",
Redo : "재실행",
NumberedListLbl : "순서있는 목록",
NumberedList : "순서있는 목록",
BulletedListLbl : "순서없는 목록",
BulletedList : "순서없는 목록",
ShowTableBorders : "표 테두리 보기",
ShowDetails : "문서기호 보기",
Style : "스타일",
FontFormat : "포맷",
Font : "폰트",
FontSize : "글자 크기",
TextColor : "글자 색상",
BGColor : "배경 색상",
Source : "소스",
Find : "찾기",
Replace : "바꾸기",
SpellCheck : "철자검사",
UniversalKeyboard : "다국어 입력기",
PageBreakLbl : "Page Break", //MISSING
PageBreak : "Insert Page Break", //MISSING
 
Form : "폼",
Checkbox : "체크박스",
RadioButton : "라디오버튼",
TextField : "입력필드",
Textarea : "입력영역",
HiddenField : "숨김필드",
Button : "버튼",
SelectionField : "펼침목록",
ImageButton : "이미지버튼",
 
FitWindow : "Maximize the editor size", //MISSING
 
// Context Menu
EditLink : "링크 수정",
CellCM : "Cell", //MISSING
RowCM : "Row", //MISSING
ColumnCM : "Column", //MISSING
InsertRow : "가로줄 삽입",
DeleteRows : "가로줄 삭제",
InsertColumn : "세로줄 삽입",
DeleteColumns : "세로줄 삭제",
InsertCell : "셀 삽입",
DeleteCells : "셀 삭제",
MergeCells : "셀 합치기",
SplitCell : "셀 나누기",
TableDelete : "Delete Table", //MISSING
CellProperties : "셀 속성",
TableProperties : "표 속성",
ImageProperties : "이미지 속성",
FlashProperties : "플래쉬 속성",
 
AnchorProp : "책갈피 속성",
ButtonProp : "버튼 속성",
CheckboxProp : "체크박스 속성",
HiddenFieldProp : "숨김필드 속성",
RadioButtonProp : "라디오버튼 속성",
ImageButtonProp : "이미지버튼 속성",
TextFieldProp : "입력필드 속성",
SelectionFieldProp : "펼침목록 속성",
TextareaProp : "입력영역 속성",
FormProp : "폼 속성",
 
FontFormats : "Normal;Formatted;Address;Heading 1;Heading 2;Heading 3;Heading 4;Heading 5;Heading 6",
 
// Alerts and Messages
ProcessingXHTML : "XHTML 처리중. 잠시만 기다려주십시요.",
Done : "완료",
PasteWordConfirm : "붙여넣기 할 텍스트는 MS Word에서 복사한 것입니다. 붙여넣기 전에 MS Word 포멧을 삭제하시겠습니까?",
NotCompatiblePaste : "이 명령은 인터넷익스플로러 5.5 버전 이상에서만 작동합니다. 포멧을 삭제하지 않고 붙여넣기 하시겠습니까?",
UnknownToolbarItem : "알수없는 툴바입니다. : \"%1\"",
UnknownCommand : "알수없는 기능입니다. : \"%1\"",
NotImplemented : "기능이 실행되지 않았습니다.",
UnknownToolbarSet : "툴바 설정이 없습니다. : \"%1\"",
NoActiveX : "Your browser's security settings could limit some features of the editor. You must enable the option \"Run ActiveX controls and plug-ins\". You may experience errors and notice missing features.", //MISSING
BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.", //MISSING
DialogBlocked : "It was not possible to open the dialog window. Make sure all popup blockers are disabled.", //MISSING
 
// Dialogs
DlgBtnOK : "예",
DlgBtnCancel : "아니오",
DlgBtnClose : "닫기",
DlgBtnBrowseServer : "서버 보기",
DlgAdvancedTag : "자세히",
DlgOpOther : "<기타>",
DlgInfoTab : "정보",
DlgAlertUrl : "URL을 입력하십시요",
 
// General Dialogs Labels
DlgGenNotSet : "<설정되지 않음>",
DlgGenId : "ID",
DlgGenLangDir : "쓰기 방향",
DlgGenLangDirLtr : "왼쪽에서 오른쪽 (LTR)",
DlgGenLangDirRtl : "오른쪽에서 왼쪽 (RTL)",
DlgGenLangCode : "언어 코드",
DlgGenAccessKey : "엑세스 키",
DlgGenName : "Name",
DlgGenTabIndex : "탭 순서",
DlgGenLongDescr : "URL 설명",
DlgGenClass : "Stylesheet Classes",
DlgGenTitle : "Advisory Title",
DlgGenContType : "Advisory Content Type",
DlgGenLinkCharset : "Linked Resource Charset",
DlgGenStyle : "Style",
 
// Image Dialog
DlgImgTitle : "이미지 설정",
DlgImgInfoTab : "이미지 정보",
DlgImgBtnUpload : "서버로 전송",
DlgImgURL : "URL",
DlgImgUpload : "업로드",
DlgImgAlt : "이미지 설명",
DlgImgWidth : "너비",
DlgImgHeight : "높이",
DlgImgLockRatio : "비율 유지",
DlgBtnResetSize : "원래 크기로",
DlgImgBorder : "테두리",
DlgImgHSpace : "수평여백",
DlgImgVSpace : "수직여백",
DlgImgAlign : "정렬",
DlgImgAlignLeft : "왼쪽",
DlgImgAlignAbsBottom: "줄아래(Abs Bottom)",
DlgImgAlignAbsMiddle: "줄중간(Abs Middle)",
DlgImgAlignBaseline : "기준선",
DlgImgAlignBottom : "아래",
DlgImgAlignMiddle : "중간",
DlgImgAlignRight : "오른쪽",
DlgImgAlignTextTop : "글자위(Text Top)",
DlgImgAlignTop : "위",
DlgImgPreview : "미리보기",
DlgImgAlertUrl : "이미지 URL을 입력하십시요",
DlgImgLinkTab : "링크",
 
// Flash Dialog
DlgFlashTitle : "플래쉬 등록정보",
DlgFlashChkPlay : "자동재생",
DlgFlashChkLoop : "반복",
DlgFlashChkMenu : "플래쉬메뉴 가능",
DlgFlashScale : "영역",
DlgFlashScaleAll : "모두보기",
DlgFlashScaleNoBorder : "경계선없음",
DlgFlashScaleFit : "영역자동조절",
 
// Link Dialog
DlgLnkWindowTitle : "링크",
DlgLnkInfoTab : "링크 정보",
DlgLnkTargetTab : "타겟",
 
DlgLnkType : "링크 종류",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "책갈피",
DlgLnkTypeEMail : "이메일",
DlgLnkProto : "프로토콜",
DlgLnkProtoOther : "<기타>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "책갈피 선택",
DlgLnkAnchorByName : "책갈피 이름",
DlgLnkAnchorById : "책갈피 ID",
DlgLnkNoAnchors : "<문서에 책갈피가 없습니다.>",
DlgLnkEMail : "이메일 주소",
DlgLnkEMailSubject : "제목",
DlgLnkEMailBody : "내용",
DlgLnkUpload : "업로드",
DlgLnkBtnUpload : "서버로 전송",
 
DlgLnkTarget : "타겟",
DlgLnkTargetFrame : "<프레임>",
DlgLnkTargetPopup : "<팝업창>",
DlgLnkTargetBlank : "새 창 (_blank)",
DlgLnkTargetParent : "부모 창 (_parent)",
DlgLnkTargetSelf : "현재 창 (_self)",
DlgLnkTargetTop : "최 상위 창 (_top)",
DlgLnkTargetFrameName : "타겟 프레임 이름",
DlgLnkPopWinName : "팝업창 이름",
DlgLnkPopWinFeat : "팝업창 설정",
DlgLnkPopResize : "크기조정",
DlgLnkPopLocation : "주소표시줄",
DlgLnkPopMenu : "메뉴바",
DlgLnkPopScroll : "스크롤바",
DlgLnkPopStatus : "상태바",
DlgLnkPopToolbar : "툴바",
DlgLnkPopFullScrn : "전체화면 (IE)",
DlgLnkPopDependent : "Dependent (Netscape)",
DlgLnkPopWidth : "너비",
DlgLnkPopHeight : "높이",
DlgLnkPopLeft : "왼쪽 위치",
DlgLnkPopTop : "윗쪽 위치",
 
DlnLnkMsgNoUrl : "링크 URL을 입력하십시요.",
DlnLnkMsgNoEMail : "이메일주소를 입력하십시요.",
DlnLnkMsgNoAnchor : "책갈피명을 입력하십시요.",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "색상 선택",
DlgColorBtnClear : "지우기",
DlgColorHighlight : "현재",
DlgColorSelected : "선택됨",
 
// Smiley Dialog
DlgSmileyTitle : "아이콘 삽입",
 
// Special Character Dialog
DlgSpecialCharTitle : "특수문자 선택",
 
// Table Dialog
DlgTableTitle : "표 설정",
DlgTableRows : "가로줄",
DlgTableColumns : "세로줄",
DlgTableBorder : "테두리 크기",
DlgTableAlign : "정렬",
DlgTableAlignNotSet : "<설정되지 않음>",
DlgTableAlignLeft : "왼쪽",
DlgTableAlignCenter : "가운데",
DlgTableAlignRight : "오른쪽",
DlgTableWidth : "너비",
DlgTableWidthPx : "픽셀",
DlgTableWidthPc : "퍼센트",
DlgTableHeight : "높이",
DlgTableCellSpace : "셀 간격",
DlgTableCellPad : "셀 여백",
DlgTableCaption : "캡션",
DlgTableSummary : "Summary", //MISSING
 
// Table Cell Dialog
DlgCellTitle : "셀 설정",
DlgCellWidth : "너비",
DlgCellWidthPx : "픽셀",
DlgCellWidthPc : "퍼센트",
DlgCellHeight : "높이",
DlgCellWordWrap : "워드랩",
DlgCellWordWrapNotSet : "<설정되지 않음>",
DlgCellWordWrapYes : "예",
DlgCellWordWrapNo : "아니오",
DlgCellHorAlign : "수평 정렬",
DlgCellHorAlignNotSet : "<설정되지 않음>",
DlgCellHorAlignLeft : "왼쪽",
DlgCellHorAlignCenter : "가운데",
DlgCellHorAlignRight: "오른쪽",
DlgCellVerAlign : "수직 정렬",
DlgCellVerAlignNotSet : "<설정되지 않음>",
DlgCellVerAlignTop : "위",
DlgCellVerAlignMiddle : "중간",
DlgCellVerAlignBottom : "아래",
DlgCellVerAlignBaseline : "기준선",
DlgCellRowSpan : "세로 합치기",
DlgCellCollSpan : "가로 합치기",
DlgCellBackColor : "배경 색상",
DlgCellBorderColor : "테두리 색상",
DlgCellBtnSelect : "선택",
 
// Find Dialog
DlgFindTitle : "찾기",
DlgFindFindBtn : "찾기",
DlgFindNotFoundMsg : "문자열을 찾을 수 없습니다.",
 
// Replace Dialog
DlgReplaceTitle : "바꾸기",
DlgReplaceFindLbl : "찾을 문자열:",
DlgReplaceReplaceLbl : "바꿀 문자열:",
DlgReplaceCaseChk : "대소문자 구분",
DlgReplaceReplaceBtn : "바꾸기",
DlgReplaceReplAllBtn : "모두 바꾸기",
DlgReplaceWordChk : "온전한 단어",
 
// Paste Operations / Dialog
PasteErrorPaste : "브라우저의 보안설정때문에 붙여넣기 기능을 실행할 수 없습니다. 키보드 명령을 사용하십시요. (Ctrl+V).",
PasteErrorCut : "브라우저의 보안설정때문에 잘라내기 기능을 실행할 수 없습니다. 키보드 명령을 사용하십시요. (Ctrl+X).",
PasteErrorCopy : "브라우저의 보안설정때문에 복사하기 기능을 실행할 수 없습니다. 키보드 명령을 사용하십시요. (Ctrl+C).",
 
PasteAsText : "텍스트로 붙여넣기",
PasteFromWord : "MS Word 형식에서 붙여넣기",
 
DlgPasteMsg2 : "키보드의 (<STRONG>Ctrl+V</STRONG>) 를 이용해서 상자안에 붙여넣고 <STRONG>OK</STRONG> 를 누르세요.",
DlgPasteIgnoreFont : "폰트 설정 무시",
DlgPasteRemoveStyles : "스타일 정의 제거",
DlgPasteCleanBox : "글상자 제거",
 
// Color Picker
ColorAutomatic : "기본색상",
ColorMoreColors : "색상선택...",
 
// Document Properties
DocProps : "문서 속성",
 
// Anchor Dialog
DlgAnchorTitle : "책갈피 속성",
DlgAnchorName : "책갈피 이름",
DlgAnchorErrorName : "책갈피 이름을 입력하십시요.",
 
// Speller Pages Dialog
DlgSpellNotInDic : "사전에 없는 단어",
DlgSpellChangeTo : "변경할 단어",
DlgSpellBtnIgnore : "건너뜀",
DlgSpellBtnIgnoreAll : "모두 건너뜀",
DlgSpellBtnReplace : "변경",
DlgSpellBtnReplaceAll : "모두 변경",
DlgSpellBtnUndo : "취소",
DlgSpellNoSuggestions : "- 추천단어 없음 -",
DlgSpellProgress : "철자검사를 진행중입니다...",
DlgSpellNoMispell : "철자검사 완료: 잘못된 철자가 없습니다.",
DlgSpellNoChanges : "철자검사 완료: 변경된 단어가 없습니다.",
DlgSpellOneChange : "철자검사 완료: 단어가 변경되었습니다.",
DlgSpellManyChanges : "철자검사 완료: %1 단어가 변경되었습니다.",
 
IeSpellDownload : "철자 검사기가 철치되지 않았습니다. 지금 다운로드하시겠습니까?",
 
// Button Dialog
DlgButtonText : "버튼글자(값)",
DlgButtonType : "버튼종류",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "이름",
DlgCheckboxValue : "값",
DlgCheckboxSelected : "선택됨",
 
// Form Dialog
DlgFormName : "폼이름",
DlgFormAction : "실행경로(Action)",
DlgFormMethod : "방법(Method)",
 
// Select Field Dialog
DlgSelectName : "이름",
DlgSelectValue : "값",
DlgSelectSize : "세로크기",
DlgSelectLines : "줄",
DlgSelectChkMulti : "여러항목 선택 허용",
DlgSelectOpAvail : "선택옵션",
DlgSelectOpText : "이름",
DlgSelectOpValue : "값",
DlgSelectBtnAdd : "추가",
DlgSelectBtnModify : "변경",
DlgSelectBtnUp : "위로",
DlgSelectBtnDown : "아래로",
DlgSelectBtnSetValue : "선택된것으로 설정",
DlgSelectBtnDelete : "삭제",
 
// Textarea Dialog
DlgTextareaName : "이름",
DlgTextareaCols : "칸수",
DlgTextareaRows : "줄수",
 
// Text Field Dialog
DlgTextName : "이름",
DlgTextValue : "값",
DlgTextCharWidth : "글자 너비",
DlgTextMaxChars : "최대 글자수",
DlgTextType : "종류",
DlgTextTypeText : "문자열",
DlgTextTypePass : "비밀번호",
 
// Hidden Field Dialog
DlgHiddenName : "이름",
DlgHiddenValue : "값",
 
// Bulleted List Dialog
BulletedListProp : "순서없는 목록 속성",
NumberedListProp : "순서있는 목록 속성",
DlgLstStart : "Start", //MISSING
DlgLstType : "종류",
DlgLstTypeCircle : "원(Circle)",
DlgLstTypeDisc : "Disc", //MISSING
DlgLstTypeSquare : "네모점(Square)",
DlgLstTypeNumbers : "번호 (1, 2, 3)",
DlgLstTypeLCase : "소문자 (a, b, c)",
DlgLstTypeUCase : "대문자 (A, B, C)",
DlgLstTypeSRoman : "로마자 수문자 (i, ii, iii)",
DlgLstTypeLRoman : "로마자 대문자 (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "일반",
DlgDocBackTab : "배경",
DlgDocColorsTab : "색상 및 여백",
DlgDocMetaTab : "메타데이터",
 
DlgDocPageTitle : "페이지명",
DlgDocLangDir : "문자 쓰기방향",
DlgDocLangDirLTR : "왼쪽에서 오른쪽 (LTR)",
DlgDocLangDirRTL : "오른쪽에서 왼쪽 (RTL)",
DlgDocLangCode : "언어코드",
DlgDocCharSet : "캐릭터셋 인코딩",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "다른 캐릭터셋 인코딩",
 
DlgDocDocType : "문서 헤드",
DlgDocDocTypeOther : "다른 문서헤드",
DlgDocIncXHTML : "XHTML 문서정의 포함",
DlgDocBgColor : "배경색상",
DlgDocBgImage : "배경이미지 URL",
DlgDocBgNoScroll : "스크롤되지않는 배경",
DlgDocCText : "텍스트",
DlgDocCLink : "링크",
DlgDocCVisited : "방문한 링크(Visited)",
DlgDocCActive : "활성화된 링크(Active)",
DlgDocMargins : "페이지 여백",
DlgDocMaTop : "위",
DlgDocMaLeft : "왼쪽",
DlgDocMaRight : "오른쪽",
DlgDocMaBottom : "아래",
DlgDocMeIndex : "문서 키워드 (콤마로 구분)",
DlgDocMeDescr : "문서 설명",
DlgDocMeAuthor : "작성자",
DlgDocMeCopy : "저작권",
DlgDocPreview : "미리보기",
 
// Templates Dialog
Templates : "템플릿",
DlgTemplatesTitle : "내용 템플릿",
DlgTemplatesSelMsg : "에디터에서 사용할 템플릿을 선택하십시요.<br>(지금까지 작성된 내용은 사라집니다.):",
DlgTemplatesLoading : "템플릿 목록을 불러오는중입니다. 잠시만 기다려주십시요.",
DlgTemplatesNoTpl : "(템플릿이 없습니다.)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "About",
DlgAboutBrowserInfoTab : "브라우저 정보",
DlgAboutLicenseTab : "License", //MISSING
DlgAboutVersion : "버전",
DlgAboutLicense : "Licensed under the terms of the GNU Lesser General Public License",
DlgAboutInfo : "For further information go to"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/eu.js
New file
0,0 → 1,502
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: eu.js
* Basque language file.
* Euskara hizkuntza fitxategia.
*
* File Authors:
* Ibon Igartua (Librezale.org)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Estutu Tresna Barra",
ToolbarExpand : "Hedatu Tresna Barra",
 
// Toolbar Items and Context Menu
Save : "Gorde",
NewPage : "Orrialde Berria",
Preview : "Aurrebista",
Cut : "Ebaki",
Copy : "Kopiatu",
Paste : "Itsatsi",
PasteText : "Itsatsi testu bezala",
PasteWord : "Itsatsi Word-etik",
Print : "Inprimatu",
SelectAll : "Hautatu dena",
RemoveFormat : "Kendu Formatoa",
InsertLinkLbl : "Esteka",
InsertLink : "Txertatu/Editatu Esteka",
RemoveLink : "Kendu Esteka",
Anchor : "Aingura",
InsertImageLbl : "Irudia",
InsertImage : "Txertatu/Editatu Irudia",
InsertFlashLbl : "Flasha",
InsertFlash : "Txertatu/Editatu Flasha",
InsertTableLbl : "Taula",
InsertTable : "Txertatu/Editatu Taula",
InsertLineLbl : "Lerroa",
InsertLine : "Txertatu Marra Horizontala",
InsertSpecialCharLbl: "Karaktere Berezia",
InsertSpecialChar : "Txertatu Karaktere Berezia",
InsertSmileyLbl : "Aurpegierak",
InsertSmiley : "Txertatu Aurpegierak",
About : "FCKeditor-ri buruz",
Bold : "Lodia",
Italic : "Etzana",
Underline : "Azpimarratu",
StrikeThrough : "Marratua",
Subscript : "Azpi-indize",
Superscript : "Goi-indize",
LeftJustify : "Lerrokatu Ezkerrean",
CenterJustify : "Lerrokatu Erdian",
RightJustify : "Lerrokatu Eskuman",
BlockJustify : "Justifikatu",
DecreaseIndent : "Txikitu Koska",
IncreaseIndent : "Handitu Koska",
Undo : "Desegin",
Redo : "Berregin",
NumberedListLbl : "Zenbakidun Zerrenda",
NumberedList : "Txertatu/Kendu Zenbakidun zerrenda",
BulletedListLbl : "Buletdun Zerrenda",
BulletedList : "Txertatu/Kendu Buletdun zerrenda",
ShowTableBorders : "Erakutsi Taularen Ertzak",
ShowDetails : "Erakutsi Xehetasunak",
Style : "Estiloa",
FontFormat : "Formatoa",
Font : "Letra-tipoa",
FontSize : "Tamaina",
TextColor : "Testu Kolorea",
BGColor : "Atzeko kolorea",
Source : "HTML Iturburua",
Find : "Bilatu",
Replace : "Ordezkatu",
SpellCheck : "Ortografia",
UniversalKeyboard : "Teklatu Unibertsala",
PageBreakLbl : "Orrialde-jauzia",
PageBreak : "Txertatu Orrialde-jauzia",
 
Form : "Formularioa",
Checkbox : "Kontrol-laukia",
RadioButton : "Aukera-botoia",
TextField : "Testu Eremua",
Textarea : "Testu-area",
HiddenField : "Ezkutuko Eremua",
Button : "Botoia",
SelectionField : "Hautespen Eremua",
ImageButton : "Irudi Botoia",
 
FitWindow : "Maximizatu editorearen tamaina",
 
// Context Menu
EditLink : "Aldatu Esteka",
CellCM : "Gelaxka",
RowCM : "Errenkada",
ColumnCM : "Zutabea",
InsertRow : "Txertatu Errenkada",
DeleteRows : "Ezabatu Errenkadak",
InsertColumn : "Txertatu Zutabea",
DeleteColumns : "Ezabatu Zutabeak",
InsertCell : "Txertatu Gelaxka",
DeleteCells : "Kendu Gelaxkak",
MergeCells : "Batu Gelaxkak",
SplitCell : "Zatitu Gelaxka",
TableDelete : "Ezabatu Taula",
CellProperties : "Gelaxkaren Ezaugarriak",
TableProperties : "Taularen Ezaugarriak",
ImageProperties : "Irudiaren Ezaugarriak",
FlashProperties : "Flasharen Ezaugarriak",
 
AnchorProp : "Ainguraren Ezaugarriak",
ButtonProp : "Botoiaren Ezaugarriak",
CheckboxProp : "Kontrol-laukiko Ezaugarriak",
HiddenFieldProp : "Ezkutuko Eremuaren Ezaugarriak",
RadioButtonProp : "Aukera-botoiaren Ezaugarriak",
ImageButtonProp : "Irudi Botoiaren Ezaugarriak",
TextFieldProp : "Testu Eremuaren Ezaugarriak",
SelectionFieldProp : "Hautespen Eremuaren Ezaugarriak",
TextareaProp : "Testu-arearen Ezaugarriak",
FormProp : "Formularioaren Ezaugarriak",
 
FontFormats : "Arrunta;Formateatua;Helbidea;Izenburua 1;Izenburua 2;Izenburua 3;Izenburua 4;Izenburua 5;Izenburua 6;Paragrafoa (DIV)",
 
// Alerts and Messages
ProcessingXHTML : "XHTML Prozesatzen. Itxaron mesedez...",
Done : "Eginda",
PasteWordConfirm : "Itsatsi nahi duzun textua Wordetik hartua dela dirudi. Itsatsi baino lehen garbitu nahi duzu?",
NotCompatiblePaste : "Komando hau Internet Explorer 5.5 bertsiorako edo ondorengoentzako erabilgarria dago. Garbitu gabe itsatsi nahi duzu?",
UnknownToolbarItem : "Ataza barrako elementu ezezaguna \"%1\"",
UnknownCommand : "Komando izen ezezaguna \"%1\"",
NotImplemented : "Komando ez inplementatua",
UnknownToolbarSet : "Ataza barra \"%1\" taldea ez da existitzen",
NoActiveX : "Zure nabigatzailearen segustasun hobespenak editore honen zenbait ezaugarri mugatu ditzake. \"ActiveX kontrolak eta plug-inak\" aktibatu beharko zenituzke, bestela erroreak eta ezaugarrietan mugak egon daitezke.",
BrowseServerBlocked : "Baliabideen arakatzailea ezin da ireki. Ziurtatu popup blokeatzaileak desgaituta dituzula.",
DialogBlocked : "Ezin da elkarrizketa-leihoa ireki. Ziurtatu popup blokeatzaileak desgaituta dituzula.",
 
// Dialogs
DlgBtnOK : "Ados",
DlgBtnCancel : "Utzi",
DlgBtnClose : "Itxi",
DlgBtnBrowseServer : "Zerbitzaria arakatu",
DlgAdvancedTag : "Aurreratua",
DlgOpOther : "<Bestelakoak>",
DlgInfoTab : "Informazioa",
DlgAlertUrl : "Mesedez URLa idatzi ezazu",
 
// General Dialogs Labels
DlgGenNotSet : "<Ezarri gabe>",
DlgGenId : "Id",
DlgGenLangDir : "Hizkuntzaren Norabidea",
DlgGenLangDirLtr : "Ezkerretik Eskumara(LTR)",
DlgGenLangDirRtl : "Eskumatik Ezkerrera (RTL)",
DlgGenLangCode : "Hizkuntza Kodea",
DlgGenAccessKey : "Sarbide-gakoa",
DlgGenName : "Izena",
DlgGenTabIndex : "Tabulazio Indizea",
DlgGenLongDescr : "URL Deskribapen Luzea",
DlgGenClass : "Estilo-orriko Klaseak",
DlgGenTitle : "Izenburua",
DlgGenContType : "Eduki Mota (Content Type)",
DlgGenLinkCharset : "Estekatutako Karaktere Multzoa",
DlgGenStyle : "Estiloa",
 
// Image Dialog
DlgImgTitle : "Irudi Ezaugarriak",
DlgImgInfoTab : "Irudi informazioa",
DlgImgBtnUpload : "Zerbitzarira bidalia",
DlgImgURL : "URL",
DlgImgUpload : "Gora Kargatu",
DlgImgAlt : "Textu Alternatiboa",
DlgImgWidth : "Zabalera",
DlgImgHeight : "Altuera",
DlgImgLockRatio : "Erlazioa Blokeatu",
DlgBtnResetSize : "Tamaina Berrezarri",
DlgImgBorder : "Ertza",
DlgImgHSpace : "HSpace",
DlgImgVSpace : "VSpace",
DlgImgAlign : "Lerrokatu",
DlgImgAlignLeft : "Ezkerrera",
DlgImgAlignAbsBottom: "Abs Behean",
DlgImgAlignAbsMiddle: "Abs Erdian",
DlgImgAlignBaseline : "Oinan",
DlgImgAlignBottom : "Behean",
DlgImgAlignMiddle : "Erdian",
DlgImgAlignRight : "Eskuman",
DlgImgAlignTextTop : "Testua Goian",
DlgImgAlignTop : "Goian",
DlgImgPreview : "Aurrebista",
DlgImgAlertUrl : "Mesedez Irudiaren URLa idatzi",
DlgImgLinkTab : "Esteka",
 
// Flash Dialog
DlgFlashTitle : "Flasharen Ezaugarriak",
DlgFlashChkPlay : "Automatikoki Erreproduzitu",
DlgFlashChkLoop : "Begizta",
DlgFlashChkMenu : "Flasharen Menua Gaitu",
DlgFlashScale : "Eskalatu",
DlgFlashScaleAll : "Dena erakutsi",
DlgFlashScaleNoBorder : "Ertzarik gabe",
DlgFlashScaleFit : "Doitu",
 
// Link Dialog
DlgLnkWindowTitle : "Esteka",
DlgLnkInfoTab : "Estekaren Informazioa",
DlgLnkTargetTab : "Helburua",
 
DlgLnkType : "Esteka Mota",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Aingura horrialde honentan",
DlgLnkTypeEMail : "ePosta",
DlgLnkProto : "Protokoloa",
DlgLnkProtoOther : "<Beste batzuk>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Aingura bat hautatu",
DlgLnkAnchorByName : "Aingura izenagatik",
DlgLnkAnchorById : "Elementuaren ID-gatik",
DlgLnkNoAnchors : "<Ez daude aingurak eskuragarri dokumentuan>",
DlgLnkEMail : "ePosta Helbidea",
DlgLnkEMailSubject : "Mezuaren Gaia",
DlgLnkEMailBody : "Mezuaren Gorputza",
DlgLnkUpload : "Gora kargatu",
DlgLnkBtnUpload : "Zerbitzarira bidali",
 
DlgLnkTarget : "Target (Helburua)",
DlgLnkTargetFrame : "<marko>",
DlgLnkTargetPopup : "<popup lehioa>",
DlgLnkTargetBlank : "Lehio Berria (_blank)",
DlgLnkTargetParent : "Lehio Gurasoa (_parent)",
DlgLnkTargetSelf : "Lehio Berdina (_self)",
DlgLnkTargetTop : "Goiko Lehioa (_top)",
DlgLnkTargetFrameName : "Marko Helburuaren Izena",
DlgLnkPopWinName : "Popup Lehioaren Izena",
DlgLnkPopWinFeat : "Popup Lehioaren Ezaugarriak",
DlgLnkPopResize : "Tamaina Aldakorra",
DlgLnkPopLocation : "Kokaleku Barra",
DlgLnkPopMenu : "Menu Barra",
DlgLnkPopScroll : "Korritze Barrak",
DlgLnkPopStatus : "Egoera Barra",
DlgLnkPopToolbar : "Tresna Barra",
DlgLnkPopFullScrn : "Pantaila Osoa (IE)",
DlgLnkPopDependent : "Menpekoa (Netscape)",
DlgLnkPopWidth : "Zabalera",
DlgLnkPopHeight : "Altuera",
DlgLnkPopLeft : "Ezkerreko Posizioa",
DlgLnkPopTop : "Goiko Posizioa",
 
DlnLnkMsgNoUrl : "Mesedez URL esteka idatzi",
DlnLnkMsgNoEMail : "Mesedez ePosta helbidea idatzi",
DlnLnkMsgNoAnchor : "Mesedez aingura bat aukeratu",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "Kolore Aukeraketa",
DlgColorBtnClear : "Garbitu",
DlgColorHighlight : "Nabarmendu",
DlgColorSelected : "Aukeratuta",
 
// Smiley Dialog
DlgSmileyTitle : "Aurpegiera Sartu",
 
// Special Character Dialog
DlgSpecialCharTitle : "Karaktere Berezia Aukeratu",
 
// Table Dialog
DlgTableTitle : "Taularen Ezaugarriak",
DlgTableRows : "Lerroak",
DlgTableColumns : "Zutabeak",
DlgTableBorder : "Ertzaren Zabalera",
DlgTableAlign : "Lerrokatu",
DlgTableAlignNotSet : "<Ezarri gabe>",
DlgTableAlignLeft : "Ezkerrean",
DlgTableAlignCenter : "Erdian",
DlgTableAlignRight : "Eskuman",
DlgTableWidth : "Zabalera",
DlgTableWidthPx : "pixel",
DlgTableWidthPc : "ehuneko",
DlgTableHeight : "Altuera",
DlgTableCellSpace : "Gelaxka arteko tartea",
DlgTableCellPad : "Gelaxken betegarria",
DlgTableCaption : "Epigrafea",
DlgTableSummary : "Laburpena",
 
// Table Cell Dialog
DlgCellTitle : "Gelaxken Ezaugarriak",
DlgCellWidth : "Zabalera",
DlgCellWidthPx : "pixel",
DlgCellWidthPc : "ehuneko",
DlgCellHeight : "Altuera",
DlgCellWordWrap : "Itzulbira",
DlgCellWordWrapNotSet : "<Ezarri gabe>",
DlgCellWordWrapYes : "Bai",
DlgCellWordWrapNo : "Ez",
DlgCellHorAlign : "Horizontal Alignment",
DlgCellHorAlignNotSet : "<Ezarri gabe>",
DlgCellHorAlignLeft : "Ezkerrean",
DlgCellHorAlignCenter : "Erdian",
DlgCellHorAlignRight: "Eskuman",
DlgCellVerAlign : "Lerrokatu Bertikalki",
DlgCellVerAlignNotSet : "<Ezarri gabe>",
DlgCellVerAlignTop : "Goian",
DlgCellVerAlignMiddle : "Erdian",
DlgCellVerAlignBottom : "Behean",
DlgCellVerAlignBaseline : "Oinan",
DlgCellRowSpan : "Lerroak Hedatu",
DlgCellCollSpan : "Zutabeak Hedatu",
DlgCellBackColor : "Atzeko Kolorea",
DlgCellBorderColor : "Ertzako Kolorea",
DlgCellBtnSelect : "Aukertau...",
 
// Find Dialog
DlgFindTitle : "Bilaketa",
DlgFindFindBtn : "Bilatu",
DlgFindNotFoundMsg : "Idatzitako testua ez da topatu.",
 
// Replace Dialog
DlgReplaceTitle : "Ordeztu",
DlgReplaceFindLbl : "Zer bilatu:",
DlgReplaceReplaceLbl : "Zerekin ordeztu:",
DlgReplaceCaseChk : "Maiuskula/minuskula",
DlgReplaceReplaceBtn : "Ordeztu",
DlgReplaceReplAllBtn : "Ordeztu Guztiak",
DlgReplaceWordChk : "Esaldi osoa bilatu",
 
// Paste Operations / Dialog
PasteErrorPaste : "Zure web nabigatzailearen segurtasun ezarpenak testuak automatikoki itsastea ez dute baimentzen. Mesedez teklatua erabili ezazu (Ctrl+V).",
PasteErrorCut : "Zure web nabigatzailearen segurtasun ezarpenak testuak automatikoki moztea ez dute baimentzen. Mesedez teklatua erabili ezazu (Ctrl+X).",
PasteErrorCopy : "Zure web nabigatzailearen segurtasun ezarpenak testuak automatikoki kopiatzea ez dute baimentzen. Mesedez teklatua erabili ezazu (Ctrl+C).",
 
PasteAsText : "Testu Arrunta bezala Itsatsi",
PasteFromWord : "Word-etik itsatsi",
 
DlgPasteMsg2 : "Mesedez teklatua erabilita (<STRONG>Ctrl+V</STRONG>) ondorego eremuan testua itsatsi eta <STRONG>OK</STRONG> sakatu.",
DlgPasteIgnoreFont : "Letra Motaren definizioa ezikusi",
DlgPasteRemoveStyles : "Estilo definizioak kendu",
DlgPasteCleanBox : "Testu-eremua Garbitu",
 
// Color Picker
ColorAutomatic : "Automatikoa",
ColorMoreColors : "Kolore gehiago...",
 
// Document Properties
DocProps : "Dokumentuaren Ezarpenak",
 
// Anchor Dialog
DlgAnchorTitle : "Ainguraren Ezaugarriak",
DlgAnchorName : "Ainguraren Izena",
DlgAnchorErrorName : "Idatzi ainguraren izena",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Ez dago hiztegian",
DlgSpellChangeTo : "Honekin ordezkatu",
DlgSpellBtnIgnore : "Ezikusi",
DlgSpellBtnIgnoreAll : "Denak Ezikusi",
DlgSpellBtnReplace : "Ordezkatu",
DlgSpellBtnReplaceAll : "Denak Ordezkatu",
DlgSpellBtnUndo : "Desegin",
DlgSpellNoSuggestions : "- Iradokizunik ez -",
DlgSpellProgress : "Zuzenketa ortografikoa martxan...",
DlgSpellNoMispell : "Zuzenketa ortografikoa bukatuta: Akatsik ez",
DlgSpellNoChanges : "Zuzenketa ortografikoa bukatuta: Ez da ezer aldatu",
DlgSpellOneChange : "Zuzenketa ortografikoa bukatuta: Hitz bat aldatu da",
DlgSpellManyChanges : "Zuzenketa ortografikoa bukatuta: %1 hitz aldatu dira",
 
IeSpellDownload : "Zuzentzaile ortografikoa ez dago instalatuta. Deskargatu nahi duzu?",
 
// Button Dialog
DlgButtonText : "Testua (Balorea)",
DlgButtonType : "Mota",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Izena",
DlgCheckboxValue : "Balorea",
DlgCheckboxSelected : "Hautatuta",
 
// Form Dialog
DlgFormName : "Izena",
DlgFormAction : "Ekintza",
DlgFormMethod : "Method",
 
// Select Field Dialog
DlgSelectName : "Izena",
DlgSelectValue : "Balorea",
DlgSelectSize : "Tamaina",
DlgSelectLines : "lerro kopurura",
DlgSelectChkMulti : "Hautaketa anitzak baimendu",
DlgSelectOpAvail : "Aukera Eskuragarriak",
DlgSelectOpText : "Testua",
DlgSelectOpValue : "Balorea",
DlgSelectBtnAdd : "Gehitu",
DlgSelectBtnModify : "Aldatu",
DlgSelectBtnUp : "Gora",
DlgSelectBtnDown : "Behera",
DlgSelectBtnSetValue : "Aukeratutako balorea ezarri",
DlgSelectBtnDelete : "Ezabatu",
 
// Textarea Dialog
DlgTextareaName : "Izena",
DlgTextareaCols : "Zutabeak",
DlgTextareaRows : "Lerroak",
 
// Text Field Dialog
DlgTextName : "Izena",
DlgTextValue : "Balorea",
DlgTextCharWidth : "Zabalera",
DlgTextMaxChars : "Zenbat karaktere gehienez",
DlgTextType : "Mota",
DlgTextTypeText : "Testua",
DlgTextTypePass : "Pasahitza",
 
// Hidden Field Dialog
DlgHiddenName : "Izena",
DlgHiddenValue : "Balorea",
 
// Bulleted List Dialog
BulletedListProp : "Buletdun Zerrendaren Ezarpenak",
NumberedListProp : "Zenbakidun Zerrendaren Ezarpenak",
DlgLstStart : "Start", //MISSING
DlgLstType : "Mota",
DlgLstTypeCircle : "Zirkulua",
DlgLstTypeDisc : "Diskoa",
DlgLstTypeSquare : "Karratua",
DlgLstTypeNumbers : "Zenbakiak (1, 2, 3)",
DlgLstTypeLCase : "Letra xeheak (a, b, c)",
DlgLstTypeUCase : "Letra larriak (A, B, C)",
DlgLstTypeSRoman : "Erromatar zenbaki zeheak (i, ii, iii)",
DlgLstTypeLRoman : "Erromatar zenbaki larriak (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "Orokorra",
DlgDocBackTab : "Atzekaldea",
DlgDocColorsTab : "Koloreak eta Marjinak",
DlgDocMetaTab : "Meta Informazioa",
 
DlgDocPageTitle : "Orriaren Izenburua",
DlgDocLangDir : "Hizkuntzaren Norabidea",
DlgDocLangDirLTR : "Ezkerretik eskumara (LTR)",
DlgDocLangDirRTL : "Eskumatik ezkerrera (RTL)",
DlgDocLangCode : "Hizkuntzaren Kodea",
DlgDocCharSet : "Karaktere Multzoaren Kodeketa",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "Beste Karaktere Multzoaren Kodeketa",
 
DlgDocDocType : "Document Type Goiburua",
DlgDocDocTypeOther : "Beste Document Type Goiburua",
DlgDocIncXHTML : "XHTML Ezarpenak",
DlgDocBgColor : "Atzeko Kolorea",
DlgDocBgImage : "Atzeko Irudiaren URL-a",
DlgDocBgNoScroll : "Korritze gabeko Atzekaldea",
DlgDocCText : "Testua",
DlgDocCLink : "Estekak",
DlgDocCVisited : "Bisitatutako Estekak",
DlgDocCActive : "Esteka Aktiboa",
DlgDocMargins : "Orrialdearen marjinak",
DlgDocMaTop : "Goian",
DlgDocMaLeft : "Ezkerrean",
DlgDocMaRight : "Eskuman",
DlgDocMaBottom : "Behean",
DlgDocMeIndex : "Dokumentuaren Gako-hitzak (komarekin bananduta)",
DlgDocMeDescr : "Dokumentuaren Deskribapena",
DlgDocMeAuthor : "Egilea",
DlgDocMeCopy : "Copyright",
DlgDocPreview : "Aurrebista",
 
// Templates Dialog
Templates : "Txantiloiak",
DlgTemplatesTitle : "Eduki Txantiloiak",
DlgTemplatesSelMsg : "Mesedez txantiloia aukeratu editorean kargatzeko<br>(orain dauden edukiak galduko dira):",
DlgTemplatesLoading : "Txantiloiak kargatzen. Itxaron mesedez...",
DlgTemplatesNoTpl : "(Ez dago definitutako txantiloirik)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "Honi buruz",
DlgAboutBrowserInfoTab : "Nabigatzailearen Informazioa",
DlgAboutLicenseTab : "Lizentzia",
DlgAboutVersion : "bertsioa",
DlgAboutLicense : "GNU Lesser General Public License Lizentziapean",
DlgAboutInfo : "Informazio gehiago eskuratzeko hona joan"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/hu.js
New file
0,0 → 1,502
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: hu.js
* Hungarian language file.
*
* File Authors:
* Varga Zsolt (meridian@netteszt.hu)
* Géza Szűcs (flextor@flextor.hu)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Eszköztár elrejtése",
ToolbarExpand : "Eszköztár megjelenítése",
 
// Toolbar Items and Context Menu
Save : "Mentés",
NewPage : "Új oldal",
Preview : "Előnézet",
Cut : "Kivágás",
Copy : "Másolás",
Paste : "Beillesztés",
PasteText : "Beillesztés formázás nélkül",
PasteWord : "Beillesztés Word-ből",
Print : "Nyomtatás",
SelectAll : "Mindent kijelöl",
RemoveFormat : "Formázás eltávolítása",
InsertLinkLbl : "Hivatkozás",
InsertLink : "Hivatkozás beillesztése/módosítása",
RemoveLink : "Hivatkozás törlése",
Anchor : "Horgony beillesztése/szerkesztése",
InsertImageLbl : "Kép",
InsertImage : "Kép beillesztése/módosítása",
InsertFlashLbl : "Flash",
InsertFlash : "Flash beillesztése, módosítása",
InsertTableLbl : "Táblázat",
InsertTable : "Táblázat beillesztése/módosítása",
InsertLineLbl : "Vonal",
InsertLine : "Elválasztóvonal beillesztése",
InsertSpecialCharLbl: "Speciális karakter",
InsertSpecialChar : "Speciális karakter beillesztése",
InsertSmileyLbl : "Hangulatjelek",
InsertSmiley : "Hangulatjelek beillesztése",
About : "FCKeditor névjegy",
Bold : "Félkövér",
Italic : "Dőlt",
Underline : "Aláhúzott",
StrikeThrough : "Áthúzott",
Subscript : "Alsó index",
Superscript : "Felső index",
LeftJustify : "Balra",
CenterJustify : "Középre",
RightJustify : "Jobbra",
BlockJustify : "Sorkizárt",
DecreaseIndent : "Behúzás csökkentése",
IncreaseIndent : "Behúzás növelése",
Undo : "Visszavonás",
Redo : "Ismétlés",
NumberedListLbl : "Számozás",
NumberedList : "Számozás beillesztése/törlése",
BulletedListLbl : "Felsorolás",
BulletedList : "Felsorolás beillesztése/törlése",
ShowTableBorders : "Táblázat szegély mutatása",
ShowDetails : "Részletek mutatása",
Style : "Stílus",
FontFormat : "Formátum",
Font : "Betűtípus",
FontSize : "Méret",
TextColor : "Betűszín",
BGColor : "Háttérszín",
Source : "Forráskód",
Find : "Keresés",
Replace : "Csere",
SpellCheck : "Helyesírás-ellenőrzés",
UniversalKeyboard : "Univerzális billentyűzet",
PageBreakLbl : "Oldaltörés",
PageBreak : "Oldaltörés beillesztése",
 
Form : "Űrlap",
Checkbox : "Jelölőnégyzet",
RadioButton : "Választógomb",
TextField : "Szövegmező",
Textarea : "Szövegterület",
HiddenField : "Rejtettmező",
Button : "Gomb",
SelectionField : "Legördülő lista",
ImageButton : "Képgomb",
 
FitWindow : "Maximalizálás",
 
// Context Menu
EditLink : "Hivatkozás módosítása",
CellCM : "Cella",
RowCM : "Sor",
ColumnCM : "Oszlop",
InsertRow : "Sor beszúrása",
DeleteRows : "Sorok törlése",
InsertColumn : "Oszlop beszúrása",
DeleteColumns : "Oszlopok törlése",
InsertCell : "Cella beszúrása",
DeleteCells : "Cellák törlése",
MergeCells : "Cellák egyesítése",
SplitCell : "Cella szétválasztása",
TableDelete : "Táblázat törlése",
CellProperties : "Cella tulajdonságai",
TableProperties : "Táblázat tulajdonságai",
ImageProperties : "Kép tulajdonságai",
FlashProperties : "Flash tulajdonságai",
 
AnchorProp : "Horgony tulajdonságai",
ButtonProp : "Gomb tulajdonságai",
CheckboxProp : "Jelölőnégyzet tulajdonságai",
HiddenFieldProp : "Rejtett mező tulajdonságai",
RadioButtonProp : "Választógomb tulajdonságai",
ImageButtonProp : "Képgomb tulajdonságai",
TextFieldProp : "Szövegmező tulajdonságai",
SelectionFieldProp : "Legördülő lista tulajdonságai",
TextareaProp : "Szövegterület tulajdonságai",
FormProp : "Å°rlap tulajdonságai",
 
FontFormats : "Normál;Formázott;Címsor;Fejléc 1;Fejléc 2;Fejléc 3;Fejléc 4;Fejléc 5;Fejléc 6;Bekezdés (DIV)",
 
// Alerts and Messages
ProcessingXHTML : "XHTML feldolgozása. Kérem várjon...",
Done : "Kész",
PasteWordConfirm : "A beilleszteni kívánt szöveg Word-ből van másolva. El kívánja távolítani a formázást a beillesztés előtt?",
NotCompatiblePaste : "Ez a parancs csak Internet Explorer 5.5 verziótól használható. Megpróbálja beilleszteni a szöveget az eredeti formázással?",
UnknownToolbarItem : "Ismeretlen eszköztár elem \"%1\"",
UnknownCommand : "Ismeretlen parancs \"%1\"",
NotImplemented : "A parancs nem hajtható végre",
UnknownToolbarSet : "Az eszközkészlet \"%1\" nem létezik",
NoActiveX : "A böngésző biztonsági beállításai korlátozzák a szerkesztő lehetőségeit. Engedélyezni kell ezt az opciót: \"Run ActiveX controls and plug-ins\". Ettől függetlenül előfordulhatnak hibaüzenetek ill. bizonyos funkciók hiányozhatnak.",
BrowseServerBlocked : "Nem lehet megnyitni a fájlböngészőt. Bizonyosodjon meg róla, hogy a felbukkanó ablakok engedélyezve vannak.",
DialogBlocked : "Nem lehet megnyitni a párbeszédablakot. Bizonyosodjon meg róla, hogy a felbukkanó ablakok engedélyezve vannak.",
 
// Dialogs
DlgBtnOK : "Rendben",
DlgBtnCancel : "Mégsem",
DlgBtnClose : "Bezárás",
DlgBtnBrowseServer : "Böngészés a szerveren",
DlgAdvancedTag : "További opciók",
DlgOpOther : "Egyéb",
DlgInfoTab : "Alaptulajdonságok",
DlgAlertUrl : "Illessze be a webcímet",
 
// General Dialogs Labels
DlgGenNotSet : "<nincs beállítva>",
DlgGenId : "Azonosító",
DlgGenLangDir : "Írás iránya",
DlgGenLangDirLtr : "Balról jobbra",
DlgGenLangDirRtl : "Jobbról balra",
DlgGenLangCode : "Nyelv kódja",
DlgGenAccessKey : "Billentyűkombináció",
DlgGenName : "Név",
DlgGenTabIndex : "Tabulátor index",
DlgGenLongDescr : "Részletes leírás webcíme",
DlgGenClass : "Stíluskészlet",
DlgGenTitle : "Súgócimke",
DlgGenContType : "Súgó tartalomtípusa",
DlgGenLinkCharset : "Hivatkozott tartalom kódlapja",
DlgGenStyle : "Stílus",
 
// Image Dialog
DlgImgTitle : "Kép tulajdonságai",
DlgImgInfoTab : "Alaptulajdonságok",
DlgImgBtnUpload : "Küldés a szerverre",
DlgImgURL : "Hivatkozás",
DlgImgUpload : "Feltöltés",
DlgImgAlt : "Buborék szöveg",
DlgImgWidth : "Szélesség",
DlgImgHeight : "Magasság",
DlgImgLockRatio : "Arány megtartása",
DlgBtnResetSize : "Eredeti méret",
DlgImgBorder : "Keret",
DlgImgHSpace : "Vízsz. táv",
DlgImgVSpace : "Függ. táv",
DlgImgAlign : "Igazítás",
DlgImgAlignLeft : "Bal",
DlgImgAlignAbsBottom: "Legaljára",
DlgImgAlignAbsMiddle: "Közepére",
DlgImgAlignBaseline : "Alapvonalhoz",
DlgImgAlignBottom : "Aljára",
DlgImgAlignMiddle : "Középre",
DlgImgAlignRight : "Jobbra",
DlgImgAlignTextTop : "Szöveg tetejére",
DlgImgAlignTop : "Tetejére",
DlgImgPreview : "Előnézet",
DlgImgAlertUrl : "Töltse ki a kép webcímét",
DlgImgLinkTab : "Hivatkozás",
 
// Flash Dialog
DlgFlashTitle : "Flash tulajdonságai",
DlgFlashChkPlay : "Automata lejátszás",
DlgFlashChkLoop : "Folyamatosan",
DlgFlashChkMenu : "Flash menü engedélyezése",
DlgFlashScale : "Méretezés",
DlgFlashScaleAll : "Mindent mutat",
DlgFlashScaleNoBorder : "Keret nélkül",
DlgFlashScaleFit : "Teljes kitöltés",
 
// Link Dialog
DlgLnkWindowTitle : "Hivatkozás tulajdonságai",
DlgLnkInfoTab : "Alaptulajdonságok",
DlgLnkTargetTab : "Megjelenítés",
 
DlgLnkType : "Hivatkozás típusa",
DlgLnkTypeURL : "Webcím",
DlgLnkTypeAnchor : "Horgony az oldalon",
DlgLnkTypeEMail : "E-Mail",
DlgLnkProto : "Protokoll",
DlgLnkProtoOther : "<más>",
DlgLnkURL : "Webcím",
DlgLnkAnchorSel : "Horgony választása",
DlgLnkAnchorByName : "Horgony név szerint",
DlgLnkAnchorById : "Azonosító szerint",
DlgLnkNoAnchors : "<Nincs horgony a dokumentumban>",
DlgLnkEMail : "E-Mail cím",
DlgLnkEMailSubject : "Üzenet tárgya",
DlgLnkEMailBody : "Üzenet",
DlgLnkUpload : "Feltöltés",
DlgLnkBtnUpload : "Küldés a szerverre",
 
DlgLnkTarget : "Tartalom megjelenítése",
DlgLnkTargetFrame : "<keretben>",
DlgLnkTargetPopup : "<felugró ablakban>",
DlgLnkTargetBlank : "Új ablakban (_blank)",
DlgLnkTargetParent : "Szülő ablakban (_parent)",
DlgLnkTargetSelf : "Azonos ablakban (_self)",
DlgLnkTargetTop : "Legfelső ablakban (_top)",
DlgLnkTargetFrameName : "Keret neve",
DlgLnkPopWinName : "Felugró ablak neve",
DlgLnkPopWinFeat : "Felugró ablak jellemzői",
DlgLnkPopResize : "Méretezhető",
DlgLnkPopLocation : "Címsor",
DlgLnkPopMenu : "Menü sor",
DlgLnkPopScroll : "Gördítősáv",
DlgLnkPopStatus : "Állapotsor",
DlgLnkPopToolbar : "Eszköztár",
DlgLnkPopFullScrn : "Teljes képernyő (csak IE)",
DlgLnkPopDependent : "Szülőhöz kapcsolt (csak Netscape)",
DlgLnkPopWidth : "Szélesség",
DlgLnkPopHeight : "Magasság",
DlgLnkPopLeft : "Bal pozíció",
DlgLnkPopTop : "Felső pozíció",
 
DlnLnkMsgNoUrl : "Adja meg a hivatkozás webcímét",
DlnLnkMsgNoEMail : "Adja meg az E-Mail címet",
DlnLnkMsgNoAnchor : "Válasszon egy horgonyt",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "Színválasztás",
DlgColorBtnClear : "Törlés",
DlgColorHighlight : "Előnézet",
DlgColorSelected : "Kiválasztott",
 
// Smiley Dialog
DlgSmileyTitle : "Hangulatjel beszúrása",
 
// Special Character Dialog
DlgSpecialCharTitle : "Speciális karakter választása",
 
// Table Dialog
DlgTableTitle : "Táblázat tulajdonságai",
DlgTableRows : "Sorok",
DlgTableColumns : "Oszlopok",
DlgTableBorder : "Szegélyméret",
DlgTableAlign : "Igazítás",
DlgTableAlignNotSet : "<Nincs beállítva>",
DlgTableAlignLeft : "Balra",
DlgTableAlignCenter : "Középre",
DlgTableAlignRight : "Jobbra",
DlgTableWidth : "Szélesség",
DlgTableWidthPx : "képpont",
DlgTableWidthPc : "százalék",
DlgTableHeight : "Magasság",
DlgTableCellSpace : "Cella térköz",
DlgTableCellPad : "Cella belső margó",
DlgTableCaption : "Felirat",
DlgTableSummary : "Leírás",
 
// Table Cell Dialog
DlgCellTitle : "Cella tulajdonságai",
DlgCellWidth : "Szélesség",
DlgCellWidthPx : "képpont",
DlgCellWidthPc : "százalék",
DlgCellHeight : "Magasság",
DlgCellWordWrap : "Sortörés",
DlgCellWordWrapNotSet : "<Nincs beállítva>",
DlgCellWordWrapYes : "Igen",
DlgCellWordWrapNo : "Nem",
DlgCellHorAlign : "Vízsz. igazítás",
DlgCellHorAlignNotSet : "<Nincs beállítva>",
DlgCellHorAlignLeft : "Balra",
DlgCellHorAlignCenter : "Középre",
DlgCellHorAlignRight: "Jobbra",
DlgCellVerAlign : "Függ. igazítás",
DlgCellVerAlignNotSet : "<Nincs beállítva>",
DlgCellVerAlignTop : "Tetejére",
DlgCellVerAlignMiddle : "Középre",
DlgCellVerAlignBottom : "Aljára",
DlgCellVerAlignBaseline : "Egyvonalba",
DlgCellRowSpan : "Sorok egyesítése",
DlgCellCollSpan : "Oszlopok egyesítése",
DlgCellBackColor : "Háttérszín",
DlgCellBorderColor : "Szegélyszín",
DlgCellBtnSelect : "Kiválasztás...",
 
// Find Dialog
DlgFindTitle : "Keresés",
DlgFindFindBtn : "Keresés",
DlgFindNotFoundMsg : "A keresett szöveg nem található.",
 
// Replace Dialog
DlgReplaceTitle : "Csere",
DlgReplaceFindLbl : "Keresett szöveg:",
DlgReplaceReplaceLbl : "Csere erre:",
DlgReplaceCaseChk : "kis- és nagybetű megkülönböztetése",
DlgReplaceReplaceBtn : "Csere",
DlgReplaceReplAllBtn : "Az összes cseréje",
DlgReplaceWordChk : "csak ha ez a teljes szó",
 
// Paste Operations / Dialog
PasteErrorPaste : "A böngésző biztonsági beállításai nem engedélyezik a szerkesztőnek, hogy végrehajtsa a beillesztés műveletet. Használja az alábbi billentyűkombinációt (Ctrl+V).",
PasteErrorCut : "A böngésző biztonsági beállításai nem engedélyezik a szerkesztőnek, hogy végrehajtsa a kivágás műveletet. Használja az alábbi billentyűkombinációt (Ctrl+X).",
PasteErrorCopy : "A böngésző biztonsági beállításai nem engedélyezik a szerkesztőnek, hogy végrehajtsa a másolás műveletet. Használja az alábbi billentyűkombinációt (Ctrl+X).",
 
PasteAsText : "Beillesztés formázatlan szövegként",
PasteFromWord : "Beillesztés Word-ből",
 
DlgPasteMsg2 : "Másolja be az alábbi mezőbe a <STRONG>Ctrl+V</STRONG> billentyűk lenyomásával, majd nyomjon <STRONG>Rendben</STRONG>-t.",
DlgPasteIgnoreFont : "Betű formázások megszüntetése",
DlgPasteRemoveStyles : "Stílusok eltávolítása",
DlgPasteCleanBox : "Törlés",
 
// Color Picker
ColorAutomatic : "Automatikus",
ColorMoreColors : "További színek...",
 
// Document Properties
DocProps : "Dokumentum tulajdonságai",
 
// Anchor Dialog
DlgAnchorTitle : "Horgony tulajdonságai",
DlgAnchorName : "Horgony neve",
DlgAnchorErrorName : "Kérem adja meg a horgony nevét",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Nincs a szótárban",
DlgSpellChangeTo : "Módosítás",
DlgSpellBtnIgnore : "Kihagyja",
DlgSpellBtnIgnoreAll : "Mindet kihagyja",
DlgSpellBtnReplace : "Csere",
DlgSpellBtnReplaceAll : "Összes cseréje",
DlgSpellBtnUndo : "Visszavonás",
DlgSpellNoSuggestions : "Nincs javaslat",
DlgSpellProgress : "Helyesírás-ellenőrzés folyamatban...",
DlgSpellNoMispell : "Helyesírás-ellenőrzés kész: Nem találtam hibát",
DlgSpellNoChanges : "Helyesírás-ellenőrzés kész: Nincs változtatott szó",
DlgSpellOneChange : "Helyesírás-ellenőrzés kész: Egy szó cserélve",
DlgSpellManyChanges : "Helyesírás-ellenőrzés kész: %1 szó cserélve",
 
IeSpellDownload : "A helyesírás-ellenőrző nincs telepítve. Szeretné letölteni most?",
 
// Button Dialog
DlgButtonText : "Szöveg (Érték)",
DlgButtonType : "Típus",
DlgButtonTypeBtn : "Gomb",
DlgButtonTypeSbm : "Küldés",
DlgButtonTypeRst : "Alaphelyzet",
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Név",
DlgCheckboxValue : "Érték",
DlgCheckboxSelected : "Kiválasztott",
 
// Form Dialog
DlgFormName : "Név",
DlgFormAction : "Adatfeldolgozást végző hivatkozás",
DlgFormMethod : "Adatküldés módja",
 
// Select Field Dialog
DlgSelectName : "Név",
DlgSelectValue : "Érték",
DlgSelectSize : "Méret",
DlgSelectLines : "sor",
DlgSelectChkMulti : "több sor is kiválasztható",
DlgSelectOpAvail : "Elérhető opciók",
DlgSelectOpText : "Szöveg",
DlgSelectOpValue : "Érték",
DlgSelectBtnAdd : "Hozzáad",
DlgSelectBtnModify : "Módosít",
DlgSelectBtnUp : "Fel",
DlgSelectBtnDown : "Le",
DlgSelectBtnSetValue : "Legyen az alapértelmezett érték",
DlgSelectBtnDelete : "Töröl",
 
// Textarea Dialog
DlgTextareaName : "Név",
DlgTextareaCols : "Karakterek száma egy sorban",
DlgTextareaRows : "Sorok száma",
 
// Text Field Dialog
DlgTextName : "Név",
DlgTextValue : "Érték",
DlgTextCharWidth : "Megjelenített karakterek száma",
DlgTextMaxChars : "Maximális karakterszám",
DlgTextType : "Típus",
DlgTextTypeText : "Szöveg",
DlgTextTypePass : "Jelszó",
 
// Hidden Field Dialog
DlgHiddenName : "Név",
DlgHiddenValue : "Érték",
 
// Bulleted List Dialog
BulletedListProp : "Felsorolás tulajdonságai",
NumberedListProp : "Számozás tulajdonságai",
DlgLstStart : "Start",
DlgLstType : "Formátum",
DlgLstTypeCircle : "Kör",
DlgLstTypeDisc : "Lemez",
DlgLstTypeSquare : "Négyzet",
DlgLstTypeNumbers : "Számok (1, 2, 3)",
DlgLstTypeLCase : "Kisbetűk (a, b, c)",
DlgLstTypeUCase : "Nagybetűk (A, B, C)",
DlgLstTypeSRoman : "Kis római számok (i, ii, iii)",
DlgLstTypeLRoman : "Nagy római számok (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "Általános",
DlgDocBackTab : "Háttér",
DlgDocColorsTab : "Színek és margók",
DlgDocMetaTab : "Meta adatok",
 
DlgDocPageTitle : "Oldalcím",
DlgDocLangDir : "Írás iránya",
DlgDocLangDirLTR : "Balról jobbra",
DlgDocLangDirRTL : "Jobbról balra",
DlgDocLangCode : "Nyelv kód",
DlgDocCharSet : "Karakterkódolás",
DlgDocCharSetCE : "Közép-Európai",
DlgDocCharSetCT : "Kínai Tradicionális (Big5)",
DlgDocCharSetCR : "Cyrill",
DlgDocCharSetGR : "Görög",
DlgDocCharSetJP : "Japán",
DlgDocCharSetKR : "Koreai",
DlgDocCharSetTR : "Török",
DlgDocCharSetUN : "Unicode (UTF-8)",
DlgDocCharSetWE : "Nyugat-Európai",
DlgDocCharSetOther : "Más karakterkódolás",
 
DlgDocDocType : "Dokumentum típus fejléc",
DlgDocDocTypeOther : "Más dokumentum típus fejléc",
DlgDocIncXHTML : "XHTML deklarációk beillesztése",
DlgDocBgColor : "Háttérszín",
DlgDocBgImage : "Háttérkép cím",
DlgDocBgNoScroll : "Nem gördíthető háttér",
DlgDocCText : "Szöveg",
DlgDocCLink : "Cím",
DlgDocCVisited : "Látogatott cím",
DlgDocCActive : "Aktív cím",
DlgDocMargins : "Oldal margók",
DlgDocMaTop : "Felső",
DlgDocMaLeft : "Bal",
DlgDocMaRight : "Jobb",
DlgDocMaBottom : "Alsó",
DlgDocMeIndex : "Dokumentum keresőszavak (vesszővel elválasztva)",
DlgDocMeDescr : "Dokumentum leírás",
DlgDocMeAuthor : "Szerző",
DlgDocMeCopy : "Szerzői jog",
DlgDocPreview : "Előnézet",
 
// Templates Dialog
Templates : "Sablonok",
DlgTemplatesTitle : "Elérhető sablonok",
DlgTemplatesSelMsg : "Válassza ki melyik sablon nyíljon meg a szerkesztőben<br>(a jelenlegi tartalom elveszik):",
DlgTemplatesLoading : "Sablon lista betöltése. Kis türelmet...",
DlgTemplatesNoTpl : "(Nincs sablon megadva)",
DlgTemplatesReplace : "Kicseréli a jelenlegi tartalmat",
 
// About Dialog
DlgAboutAboutTab : "Névjegy",
DlgAboutBrowserInfoTab : "Böngésző információ",
DlgAboutLicenseTab : "Licensz",
DlgAboutVersion : "verzió",
DlgAboutLicense : "GNU Lesser General Public License szabadalom alá tartozik",
DlgAboutInfo : "További információkért látogasson el ide:"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/no.js
New file
0,0 → 1,501
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: no.js
* Norwegian language file.
*
* File Authors:
* Martin Kronstad (www.siteman.no) (martin.kronstad@gmail.com)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Skjul verktøylinje",
ToolbarExpand : "Vis verktøylinje",
 
// Toolbar Items and Context Menu
Save : "Lagre",
NewPage : "Ny Side",
Preview : "Forhåndsvis",
Cut : "Klipp ut",
Copy : "Kopier",
Paste : "Lim inn",
PasteText : "Lim inn som ren tekst",
PasteWord : "Lim inn fra Word",
Print : "Skriv ut",
SelectAll : "Velg alle",
RemoveFormat : "Fjern format",
InsertLinkLbl : "Lenke",
InsertLink : "Sett inn/Rediger lenke",
RemoveLink : "Fjern lenke",
Anchor : "Sett inn/Rediger anker",
InsertImageLbl : "Bilde",
InsertImage : "Sett inn/Rediger bilde",
InsertFlashLbl : "Flash",
InsertFlash : "Sett inn/Rediger Flash",
InsertTableLbl : "Tabell",
InsertTable : "Sett inn/Rediger tabell",
InsertLineLbl : "Linje",
InsertLine : "Sett inn horisontal linje",
InsertSpecialCharLbl: "Spesielt tegn",
InsertSpecialChar : "Sett inn spesielt tegn",
InsertSmileyLbl : "Smil",
InsertSmiley : "Sett inn smil",
About : "Om FCKeditor",
Bold : "Fet",
Italic : "Kursiv",
Underline : "Understrek",
StrikeThrough : "Gjennomstrek",
Subscript : "Senket skrift",
Superscript : "Hevet skrift",
LeftJustify : "Venstrejuster",
CenterJustify : "Midtjuster",
RightJustify : "Høyrejuster",
BlockJustify : "Blokkjuster",
DecreaseIndent : "Senk nivå",
IncreaseIndent : "Øk nivå",
Undo : "Angre",
Redo : "Gjør om",
NumberedListLbl : "Numrert liste",
NumberedList : "Sett inn/Fjern numrert liste",
BulletedListLbl : "Uordnet liste",
BulletedList : "Sett inn/Fjern uordnet liste",
ShowTableBorders : "Vis tabellrammer",
ShowDetails : "Vis detaljer",
Style : "Stil",
FontFormat : "Format",
Font : "Skrift",
FontSize : "Størrelse",
TextColor : "Tekstfarge",
BGColor : "Bakgrunnsfarge",
Source : "Kilde",
Find : "Finn",
Replace : "Erstatt",
SpellCheck : "Stavekontroll",
UniversalKeyboard : "Universelt tastatur",
PageBreakLbl : "Sideskift",
PageBreak : "Sett inn sideskift",
 
Form : "Skjema",
Checkbox : "Sjekkboks",
RadioButton : "Radioknapp",
TextField : "Tekstfelt",
Textarea : "Tekstområde",
HiddenField : "Skjult felt",
Button : "Knapp",
SelectionField : "Dropdown meny",
ImageButton : "Bildeknapp",
 
FitWindow : "Maksimer størrelsen på redigeringsverktøyet",
 
// Context Menu
EditLink : "Rediger lenke",
CellCM : "Celle",
RowCM : "Rader",
ColumnCM : "Kolonne",
InsertRow : "Sett inn rad",
DeleteRows : "Slett rader",
InsertColumn : "Sett inn kolonne",
DeleteColumns : "Slett kolonner",
InsertCell : "Sett inn celle",
DeleteCells : "Slett celler",
MergeCells : "Slå sammen celler",
SplitCell : "Splitt celler",
TableDelete : "Slett tabell",
CellProperties : "Celleegenskaper",
TableProperties : "Tabellegenskaper",
ImageProperties : "Bildeegenskaper",
FlashProperties : "Flash Egenskaper",
 
AnchorProp : "Ankeregenskaper",
ButtonProp : "Knappegenskaper",
CheckboxProp : "Sjekkboksegenskaper",
HiddenFieldProp : "Skjult felt egenskaper",
RadioButtonProp : "Radioknappegenskaper",
ImageButtonProp : "Bildeknappegenskaper",
TextFieldProp : "Tekstfeltegenskaper",
SelectionFieldProp : "Dropdown menyegenskaper",
TextareaProp : "Tekstfeltegenskaper",
FormProp : "Skjemaegenskaper",
 
FontFormats : "Normal;Formatert;Adresse;Tittel 1;Tittel 2;Tittel 3;Tittel 4;Tittel 5;Tittel 6",
 
// Alerts and Messages
ProcessingXHTML : "Lager XHTML. Vennligst vent...",
Done : "Ferdig",
PasteWordConfirm : "Teksten du prøver å lime inn ser ut som om den kommer fra word , du bør rense den før du limer inn , vil du gjøre dette?",
NotCompatiblePaste : "Denne kommandoen er tilgjenglig kun for Internet Explorer version 5.5 eller bedre. Vil du fortsette uten å rense?(Du kan lime inn som ren tekst)",
UnknownToolbarItem : "Ukjent menyvalg \"%1\"",
UnknownCommand : "Ukjent kommando \"%1\"",
NotImplemented : "Kommando ikke ennå implimentert",
UnknownToolbarSet : "Verktøylinjesett \"%1\" finnes ikke",
NoActiveX : "Din nettleser's sikkerhetsinstillinger kan begrense noen av funksjonene i redigeringsverktøyet. Du må aktivere \"Kjør ActiveXkontroller og plugins\". Du kan oppleve feil og advarsler om manglende funksjoner",
BrowseServerBlocked : "Kunne ikke åpne dialogboksen for filarkiv. Pass på at du har slått av popupstoppere.",
DialogBlocked : "Kunne ikke åpne dialogboksen. Pass på at du har slått av popupstoppere.",
 
// Dialogs
DlgBtnOK : "OK",
DlgBtnCancel : "Avbryt",
DlgBtnClose : "Lukk",
DlgBtnBrowseServer : "Bla igjennom server",
DlgAdvancedTag : "Avansert",
DlgOpOther : "<Annet>",
DlgInfoTab : "Info",
DlgAlertUrl : "Vennligst skriv inn URL'en",
 
// General Dialogs Labels
DlgGenNotSet : "<ikke satt>",
DlgGenId : "Id",
DlgGenLangDir : "Språkretning",
DlgGenLangDirLtr : "Venstre til høyre (VTH)",
DlgGenLangDirRtl : "Høyre til venstre (HTV)",
DlgGenLangCode : "Språk kode",
DlgGenAccessKey : "Aksessknapp",
DlgGenName : "Navn",
DlgGenTabIndex : "Tab Indeks",
DlgGenLongDescr : "Utvidet beskrivelse",
DlgGenClass : "Stilarkklasser",
DlgGenTitle : "Tittel",
DlgGenContType : "Type",
DlgGenLinkCharset : "Lenket språkkart",
DlgGenStyle : "Stil",
 
// Image Dialog
DlgImgTitle : "Bildeegenskaper",
DlgImgInfoTab : "Bildeinformasjon",
DlgImgBtnUpload : "Send det til serveren",
DlgImgURL : "URL",
DlgImgUpload : "Last opp",
DlgImgAlt : "Alternativ tekst",
DlgImgWidth : "Bredde",
DlgImgHeight : "Høyde",
DlgImgLockRatio : "Lås forhold",
DlgBtnResetSize : "Tilbakestill størrelse",
DlgImgBorder : "Ramme",
DlgImgHSpace : "HMarg",
DlgImgVSpace : "VMarg",
DlgImgAlign : "Juster",
DlgImgAlignLeft : "Venstre",
DlgImgAlignAbsBottom: "Abs bunn",
DlgImgAlignAbsMiddle: "Abs midten",
DlgImgAlignBaseline : "Bunnlinje",
DlgImgAlignBottom : "Bunn",
DlgImgAlignMiddle : "Midten",
DlgImgAlignRight : "Høyre",
DlgImgAlignTextTop : "Tekst topp",
DlgImgAlignTop : "Topp",
DlgImgPreview : "Forhåndsvis",
DlgImgAlertUrl : "Vennligst skriv bildeurlen",
DlgImgLinkTab : "Lenke",
 
// Flash Dialog
DlgFlashTitle : "Flash Egenskaper",
DlgFlashChkPlay : "Auto Spill",
DlgFlashChkLoop : "Loop",
DlgFlashChkMenu : "Slå på Flash meny",
DlgFlashScale : "Skaler",
DlgFlashScaleAll : "Vis alt",
DlgFlashScaleNoBorder : "Ingen ramme",
DlgFlashScaleFit : "Skaler til å passeExact Fit",
 
// Link Dialog
DlgLnkWindowTitle : "Lenke",
DlgLnkInfoTab : "Lenkeinfo",
DlgLnkTargetTab : "Mål",
 
DlgLnkType : "Lenketype",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Lenke til bokmerke i teksten",
DlgLnkTypeEMail : "E-Post",
DlgLnkProto : "Protokoll",
DlgLnkProtoOther : "<annet>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Velg ett anker",
DlgLnkAnchorByName : "Anker etter navn",
DlgLnkAnchorById : "Element etter ID",
DlgLnkNoAnchors : "<Ingen anker i dokumentet>",
DlgLnkEMail : "E-Post Addresse",
DlgLnkEMailSubject : "Meldingsemne",
DlgLnkEMailBody : "Melding",
DlgLnkUpload : "Last opp",
DlgLnkBtnUpload : "Send til server",
 
DlgLnkTarget : "Mål",
DlgLnkTargetFrame : "<ramme>",
DlgLnkTargetPopup : "<popup vindu>",
DlgLnkTargetBlank : "Nytt vindu (_blank)",
DlgLnkTargetParent : "Foreldre vindu (_parent)",
DlgLnkTargetSelf : "Samme vindu (_self)",
DlgLnkTargetTop : "Hele vindu (_top)",
DlgLnkTargetFrameName : "Målramme",
DlgLnkPopWinName : "Popup vindus navn",
DlgLnkPopWinFeat : "Popup vindus egenskaper",
DlgLnkPopResize : "Endre størrelse",
DlgLnkPopLocation : "Adresselinje",
DlgLnkPopMenu : "Menylinje",
DlgLnkPopScroll : "Scrollbar",
DlgLnkPopStatus : "Statuslinje",
DlgLnkPopToolbar : "Verktøylinje",
DlgLnkPopFullScrn : "Full skjerm (IE)",
DlgLnkPopDependent : "Avhenging (Netscape)",
DlgLnkPopWidth : "Bredde",
DlgLnkPopHeight : "Høyde",
DlgLnkPopLeft : "Venstre posisjon",
DlgLnkPopTop : "Topp posisjon",
 
DlnLnkMsgNoUrl : "Vennligst skriv inn lenkens url",
DlnLnkMsgNoEMail : "Vennligst skriv inn e-postadressen",
DlnLnkMsgNoAnchor : "Vennligst velg ett anker",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "Velg farge",
DlgColorBtnClear : "Tøm",
DlgColorHighlight : "Marker",
DlgColorSelected : "Velg",
 
// Smiley Dialog
DlgSmileyTitle : "Sett inn smil",
 
// Special Character Dialog
DlgSpecialCharTitle : "Velg spesielt tegn",
 
// Table Dialog
DlgTableTitle : "Tabellegenskaper",
DlgTableRows : "Rader",
DlgTableColumns : "Kolonner",
DlgTableBorder : "Rammestørrelse",
DlgTableAlign : "Justering",
DlgTableAlignNotSet : "<Ikke satt>",
DlgTableAlignLeft : "Venstre",
DlgTableAlignCenter : "Midtjuster",
DlgTableAlignRight : "Høyre",
DlgTableWidth : "Bredde",
DlgTableWidthPx : "pixler",
DlgTableWidthPc : "prosent",
DlgTableHeight : "Høyde",
DlgTableCellSpace : "Celle marg",
DlgTableCellPad : "Celle polstring",
DlgTableCaption : "Tittel",
DlgTableSummary : "Sammendrag",
 
// Table Cell Dialog
DlgCellTitle : "Celle egenskaper",
DlgCellWidth : "Bredde",
DlgCellWidthPx : "pixeler",
DlgCellWidthPc : "prosent",
DlgCellHeight : "Høyde",
DlgCellWordWrap : "Tekstbrytning",
DlgCellWordWrapNotSet : "<Ikke satt>",
DlgCellWordWrapYes : "Ja",
DlgCellWordWrapNo : "Nei",
DlgCellHorAlign : "Horisontal justering",
DlgCellHorAlignNotSet : "<Ikke satt>",
DlgCellHorAlignLeft : "Venstre",
DlgCellHorAlignCenter : "Midtjuster",
DlgCellHorAlignRight: "Høyre",
DlgCellVerAlign : "Vertikal justering",
DlgCellVerAlignNotSet : "<Ikke satt>",
DlgCellVerAlignTop : "Topp",
DlgCellVerAlignMiddle : "Midten",
DlgCellVerAlignBottom : "Bunn",
DlgCellVerAlignBaseline : "Bunnlinje",
DlgCellRowSpan : "Radspenn",
DlgCellCollSpan : "Kolonnespenn",
DlgCellBackColor : "Bakgrunnsfarge",
DlgCellBorderColor : "Rammefarge",
DlgCellBtnSelect : "Velg...",
 
// Find Dialog
DlgFindTitle : "Finn",
DlgFindFindBtn : "Finn",
DlgFindNotFoundMsg : "Den spesifiserte teksten ble ikke funnet.",
 
// Replace Dialog
DlgReplaceTitle : "Erstatt",
DlgReplaceFindLbl : "Finn hva:",
DlgReplaceReplaceLbl : "Erstatt med:",
DlgReplaceCaseChk : "Riktig case",
DlgReplaceReplaceBtn : "Erstatt",
DlgReplaceReplAllBtn : "Erstatt alle",
DlgReplaceWordChk : "Finn hele ordet",
 
// Paste Operations / Dialog
PasteErrorPaste : "Din nettlesers sikkerhetsinstillinger tillater ikke automatisk innliming av tekst. Vennligst brukt snareveien (Ctrl+V).",
PasteErrorCut : "Din nettlesers sikkerhetsinstillinger tillater ikke automatisk klipping av tekst. Vennligst brukt snareveien (Ctrl+X).",
PasteErrorCopy : "Din nettlesers sikkerhetsinstillinger tillater ikke automatisk kopiering av tekst. Vennligst brukt snareveien (Ctrl+C).",
 
PasteAsText : "Lim inn som ren tekst",
PasteFromWord : "Lim inn fra word",
 
DlgPasteMsg2 : "Vennligst lim inn i den følgende boksen med tastaturet (<STRONG>Ctrl+V</STRONG>) og trykk <STRONG>OK</STRONG>.",
DlgPasteIgnoreFont : "Fjern skrifttyper",
DlgPasteRemoveStyles : "Fjern stildefinisjoner",
DlgPasteCleanBox : "Tøm boksen",
 
// Color Picker
ColorAutomatic : "Automatisk",
ColorMoreColors : "Flere farger...",
 
// Document Properties
DocProps : "Dokumentegenskaper",
 
// Anchor Dialog
DlgAnchorTitle : "Ankeregenskaper",
DlgAnchorName : "Ankernavn",
DlgAnchorErrorName : "Vennligst skriv inn ankernavnet",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Ikke i ordboken",
DlgSpellChangeTo : "Endre til",
DlgSpellBtnIgnore : "Ignorer",
DlgSpellBtnIgnoreAll : "Ignorer alle",
DlgSpellBtnReplace : "Erstatt",
DlgSpellBtnReplaceAll : "Erstatt alle",
DlgSpellBtnUndo : "Angre",
DlgSpellNoSuggestions : "- ingen forslag -",
DlgSpellProgress : "Stavekontroll pågår...",
DlgSpellNoMispell : "Stavekontroll fullført: ingen feilstavinger funnet",
DlgSpellNoChanges : "Stavekontroll fullført: ingen ord endret",
DlgSpellOneChange : "Stavekontroll fullført: Ett ord endret",
DlgSpellManyChanges : "Stavekontroll fullført: %1 ord endret",
 
IeSpellDownload : "Stavekontroll ikke installert, vil du laste den ned nå?",
 
// Button Dialog
DlgButtonText : "Tekst",
DlgButtonType : "Type",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Navn",
DlgCheckboxValue : "Verdi",
DlgCheckboxSelected : "Valgt",
 
// Form Dialog
DlgFormName : "Navn",
DlgFormAction : "Handling",
DlgFormMethod : "Metode",
 
// Select Field Dialog
DlgSelectName : "Navn",
DlgSelectValue : "Verdi",
DlgSelectSize : "Størrelse",
DlgSelectLines : "Linjer",
DlgSelectChkMulti : "Tillat flervalg",
DlgSelectOpAvail : "Tilgjenglige alternativer",
DlgSelectOpText : "Tekst",
DlgSelectOpValue : "Verdi",
DlgSelectBtnAdd : "Legg til",
DlgSelectBtnModify : "Endre",
DlgSelectBtnUp : "Opp",
DlgSelectBtnDown : "Ned",
DlgSelectBtnSetValue : "Sett som valgt",
DlgSelectBtnDelete : "Slett",
 
// Textarea Dialog
DlgTextareaName : "Navn",
DlgTextareaCols : "Kolonner",
DlgTextareaRows : "Rader",
 
// Text Field Dialog
DlgTextName : "Navn",
DlgTextValue : "verdi",
DlgTextCharWidth : "Tegnbredde",
DlgTextMaxChars : "Maks antall tegn",
DlgTextType : "Type",
DlgTextTypeText : "Tekst",
DlgTextTypePass : "Passord",
 
// Hidden Field Dialog
DlgHiddenName : "Navn",
DlgHiddenValue : "Verdi",
 
// Bulleted List Dialog
BulletedListProp : "Uordnet listeegenskaper",
NumberedListProp : "Ordnet listeegenskaper",
DlgLstStart : "Start", //MISSING
DlgLstType : "Type",
DlgLstTypeCircle : "Sirkel",
DlgLstTypeDisc : "Hel sirkel",
DlgLstTypeSquare : "Firkant",
DlgLstTypeNumbers : "Numre(1, 2, 3)",
DlgLstTypeLCase : "Små bokstaver (a, b, c)",
DlgLstTypeUCase : "Store bokstaver(A, B, C)",
DlgLstTypeSRoman : "Små romerske tall(i, ii, iii)",
DlgLstTypeLRoman : "Store romerske tall(I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "Generalt",
DlgDocBackTab : "Bakgrunn",
DlgDocColorsTab : "Farger og marginer",
DlgDocMetaTab : "Meta Data",
 
DlgDocPageTitle : "Sidetittel",
DlgDocLangDir : "Språkretning",
DlgDocLangDirLTR : "Venstre til høyre (LTR)",
DlgDocLangDirRTL : "Høyre til venstre (RTL)",
DlgDocLangCode : "Språkkode",
DlgDocCharSet : "Tegnsett",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "Annet tegnsett",
 
DlgDocDocType : "Dokumenttype header",
DlgDocDocTypeOther : "Annet dokumenttype header",
DlgDocIncXHTML : "Inkulder XHTML deklarasjon",
DlgDocBgColor : "Bakgrunnsfarge",
DlgDocBgImage : "Bakgrunnsbilde url",
DlgDocBgNoScroll : "Ikke scroll bakgrunnsbilde",
DlgDocCText : "Tekst",
DlgDocCLink : "Link",
DlgDocCVisited : "Besøkt lenke",
DlgDocCActive : "Aktiv lenke",
DlgDocMargins : "Sidemargin",
DlgDocMaTop : "Topp",
DlgDocMaLeft : "Venstre",
DlgDocMaRight : "Høyre",
DlgDocMaBottom : "Bunn",
DlgDocMeIndex : "Dokument nøkkelord (kommaseparert)",
DlgDocMeDescr : "Dokumentbeskrivelse",
DlgDocMeAuthor : "Forfatter",
DlgDocMeCopy : "Kopirett",
DlgDocPreview : "Forhåndsvising",
 
// Templates Dialog
Templates : "Maler",
DlgTemplatesTitle : "Innholdsmaler",
DlgTemplatesSelMsg : "Velg malen du vil åpne<br>(innholdet du har skrevet blir tapt!):",
DlgTemplatesLoading : "Laster malliste. Vennligst vent...",
DlgTemplatesNoTpl : "(Ingen maler definert)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "Om",
DlgAboutBrowserInfoTab : "Nettleserinfo",
DlgAboutLicenseTab : "Lisens",
DlgAboutVersion : "versjon",
DlgAboutLicense : "Lisensiert under GNU Lesser General Public License",
DlgAboutInfo : "Oversatt av Siteman AS<br /><a target=\"_blank\" href=\"http://www.siteman.no\">www.siteman.no</a><br /><br />For mer informasjon gå til"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/sk.js
New file
0,0 → 1,501
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: sk.js
* Slovak language file.
*
* File Authors:
* Samuel Szabo (samuel@nanete.sk)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "SkryÅ¥ panel nástrojov",
ToolbarExpand : "ZobraziÅ¥ panel nástrojov",
 
// Toolbar Items and Context Menu
Save : "Uložit",
NewPage : "Nová stránka",
Preview : "Náhľad",
Cut : "VystrihnúÅ¥",
Copy : "KopírovaÅ¥",
Paste : "Vložiť",
PasteText : "VložiÅ¥ ako čistý text",
PasteWord : "Vložiť z Wordu",
Print : "Tlač",
SelectAll : "Vybrať všetko",
RemoveFormat : "OdstrániÅ¥ formátovanie",
InsertLinkLbl : "Odkaz",
InsertLink : "Vložiť/zmeniť odkaz",
RemoveLink : "OdstrániÅ¥ odkaz",
Anchor : "Vložiť/zmeniť kotvu",
InsertImageLbl : "Obrázok",
InsertImage : "Vložiť/zmeniť obrazok",
InsertFlashLbl : "Flash",
InsertFlash : "Vložiť/zmeniť Flash",
InsertTableLbl : "Tabuľka",
InsertTable : "Vložiť/zmeniť tabuľku",
InsertLineLbl : "Čiara",
InsertLine : "VložiÅ¥ vodorovnú čiara",
InsertSpecialCharLbl: "Speciálne znaky",
InsertSpecialChar : "VložiÅ¥ Å¡peciálne znaky",
InsertSmileyLbl : "Smajlíky",
InsertSmiley : "VložiÅ¥ smajlíka",
About : "O aplikáci FCKeditor",
Bold : "Tučné",
Italic : "Kurzíva",
Underline : "Podčiarknuté",
StrikeThrough : "Prečiarknuté",
Subscript : "Dolný index",
Superscript : "Horný index",
LeftJustify : "Zarovnať vľavo",
CenterJustify : "Zarovnať na stred",
RightJustify : "Zarovnať vpravo",
BlockJustify : "Zarovnať do bloku",
DecreaseIndent : "Zmenšiť odsadenie",
IncreaseIndent : "ZväčšiÅ¥ odsadenie",
Undo : "SpäÅ¥",
Redo : "Znovu",
NumberedListLbl : "Číslovanie",
NumberedList : "VložiÅ¥/odstrániÅ¥ číslovaný zoznam",
BulletedListLbl : "Odrážky",
BulletedList : "VložiÅ¥/odstraniÅ¥ odrážky",
ShowTableBorders : "Zobraziť okraje tabuliek",
ShowDetails : "Zobraziť podrobnosti",
Style : "Å týl",
FontFormat : "Formát",
Font : "Písmo",
FontSize : "Veľkost",
TextColor : "Farba textu",
BGColor : "Farba pozadia",
Source : "Zdroj",
Find : "Hľadať",
Replace : "Nahradiť",
SpellCheck : "Kontrola pravopisu",
UniversalKeyboard : "Univerzálna klávesnica",
PageBreakLbl : "Oddeľovač stránky",
PageBreak : "VložiÅ¥ oddeľovač stránky",
 
Form : "Formulár",
Checkbox : "ZaÅ¡krtávacie políčko",
RadioButton : "Prepínač",
TextField : "Textové pole",
Textarea : "Textová oblasÅ¥",
HiddenField : "Skryté pole",
Button : "Tlačítko",
SelectionField : "Rozbaľovací zoznam",
ImageButton : "Obrázkové tlačítko",
 
FitWindow : "Maximize the editor size", //MISSING
 
// Context Menu
EditLink : "Zmeniť odkaz",
CellCM : "Cell", //MISSING
RowCM : "Row", //MISSING
ColumnCM : "Column", //MISSING
InsertRow : "Vložiť riadok",
DeleteRows : "Zmazať riadok",
InsertColumn : "Vložiť stĺpec",
DeleteColumns : "Zmazať stĺpec",
InsertCell : "Vložiť bunku",
DeleteCells : "Zmazať bunky",
MergeCells : "ZlúčiÅ¥ bunky",
SplitCell : "Rozdeliť bunku",
TableDelete : "Zmazať tabuľku",
CellProperties : "Vlastnosti bunky",
TableProperties : "Vlastnosti tabuľky",
ImageProperties : "Vlastnosti obrázku",
FlashProperties : "Vlastnosti Flashu",
 
AnchorProp : "Vlastnosti kotvy",
ButtonProp : "Vlastnosti tlačítka",
CheckboxProp : "Vlastnosti zaÅ¡krtávacieho políčka",
HiddenFieldProp : "Vlastnosti skrytého poľa",
RadioButtonProp : "Vlastnosti prepínača",
ImageButtonProp : "Vlastnosti obrázkového tlačítka",
TextFieldProp : "Vlastnosti textového pola",
SelectionFieldProp : "Vlastnosti rozbaľovacieho zoznamu",
TextareaProp : "Vlastnosti textové oblasti",
FormProp : "Vlastnosti formulára",
 
FontFormats : "Normálny;Formátovaný;Adresa;Nadpis 1;Nadpis 2;Nadpis 3;Nadpis 4;Nadpis 5;Nadpis 6;Odsek (DIV)",
 
// Alerts and Messages
ProcessingXHTML : "Prebieha spracovanie XHTML. Čakejte prosím...",
Done : "Dokončené.",
PasteWordConfirm : "Vyzerá to tak, že vkladaný text je kopírovaný z Wordu. Chcete ho pred vložením vyčistiÅ¥?",
NotCompatiblePaste : "Tento príkaz je dostupný len v prehliadači Internet Explorer verzie 5.5 alebo vyÅ¡Å¡ej. Chcete vložiÅ¥ text bez vyčistenia?",
UnknownToolbarItem : "Neznáma položka panela nástrojov \"%1\"",
UnknownCommand : "Neznámy príkaz \"%1\"",
NotImplemented : "Príkaz nie je implementovaný",
UnknownToolbarSet : "Panel nástrojov \"%1\" neexistuje",
NoActiveX : "Bezpečnostné nastavenia VaÅ¡eho prehliadača môžu obmedzovaÅ¥ niektoré funkcie editora. Pre ich plnú funkčnosÅ¥ musíte zapnúÅ¥ voľbu \"SpúÅ¡Å¥aÅ¥ ActiveX moduly a zásuvné moduly\", inak sa môžete stretnúÅ¥ s chybami a nefunkčnosÅ¥ou niektorých funkcií.",
BrowseServerBlocked : "Prehliadač zdrojových prvkov nebolo možné otvoriÅ¥. Uistite sa, že máte vypnuté vÅ¡etky blokovače vyskakujúcich okien.",
DialogBlocked : "Dialógové okno nebolo možné otvoriÅ¥. Uistite sa, že máte vypnuté vÅ¡etky blokovače vyskakujúcich okien.",
 
// Dialogs
DlgBtnOK : "OK",
DlgBtnCancel : "Zrušiť",
DlgBtnClose : "Zavrieť",
DlgBtnBrowseServer : "PrechádzaÅ¥ server",
DlgAdvancedTag : "RozÅ¡írené",
DlgOpOther : "<Ďalšie>",
DlgInfoTab : "Info",
DlgAlertUrl : "Prosím vložte URL",
 
// General Dialogs Labels
DlgGenNotSet : "<nenastavené>",
DlgGenId : "Id",
DlgGenLangDir : "Orientácia jazyka",
DlgGenLangDirLtr : "Zľava doprava (LTR)",
DlgGenLangDirRtl : "Zprava doľava (RTL)",
DlgGenLangCode : "Kód jazyka",
DlgGenAccessKey : "Prístupový kľúč",
DlgGenName : "Meno",
DlgGenTabIndex : "Poradie prvku",
DlgGenLongDescr : "Dlhý popis URL",
DlgGenClass : "Trieda Å¡týlu",
DlgGenTitle : "Pomocný titulok",
DlgGenContType : "Pomocný typ obsahu",
DlgGenLinkCharset : "Priradená znaková sada",
DlgGenStyle : "Å týl",
 
// Image Dialog
DlgImgTitle : "Vlastnosti obrázku",
DlgImgInfoTab : "Informácie o obrázku",
DlgImgBtnUpload : "Odoslať na server",
DlgImgURL : "URL",
DlgImgUpload : "Odoslať",
DlgImgAlt : "Alternatívny text",
DlgImgWidth : "Å írka",
DlgImgHeight : "VýÅ¡ka",
DlgImgLockRatio : "Zámok",
DlgBtnResetSize : "Pôvodná veľkosÅ¥",
DlgImgBorder : "Okraje",
DlgImgHSpace : "H-medzera",
DlgImgVSpace : "V-medzera",
DlgImgAlign : "Zarovnanie",
DlgImgAlignLeft : "Vľavo",
DlgImgAlignAbsBottom: "Úplne dole",
DlgImgAlignAbsMiddle: "Do stredu",
DlgImgAlignBaseline : "Na základňu",
DlgImgAlignBottom : "Dole",
DlgImgAlignMiddle : "Na stred",
DlgImgAlignRight : "Vpravo",
DlgImgAlignTextTop : "Na horný okraj textu",
DlgImgAlignTop : "Nahor",
DlgImgPreview : "Náhľad",
DlgImgAlertUrl : "Zadajte prosím URL obrázku",
DlgImgLinkTab : "Odkaz",
 
// Flash Dialog
DlgFlashTitle : "Vlastnosti Flashu",
DlgFlashChkPlay : "Automatické prehrávanie",
DlgFlashChkLoop : "Opakovanie",
DlgFlashChkMenu : "Povoliť Flash Menu",
DlgFlashScale : "Mierka",
DlgFlashScaleAll : "Zobraziť mierku",
DlgFlashScaleNoBorder : "Bez okrajov",
DlgFlashScaleFit : "RoztiahnuÅ¥ na celé",
 
// Link Dialog
DlgLnkWindowTitle : "Odkaz",
DlgLnkInfoTab : "Informácie o odkaze",
DlgLnkTargetTab : "Cieľ",
 
DlgLnkType : "Typ odkazu",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Kotva v tejto stránke",
DlgLnkTypeEMail : "E-Mail",
DlgLnkProto : "Protokol",
DlgLnkProtoOther : "<iný>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Vybrať kotvu",
DlgLnkAnchorByName : "Podľa mena kotvy",
DlgLnkAnchorById : "Podľa Id objektu",
DlgLnkNoAnchors : "<V stránke nie je definovaná žiadna kotva>",
DlgLnkEMail : "E-Mailová adresa",
DlgLnkEMailSubject : "Predmet správy",
DlgLnkEMailBody : "Telo správy",
DlgLnkUpload : "Odoslať",
DlgLnkBtnUpload : "Odoslať na server",
 
DlgLnkTarget : "Cieľ",
DlgLnkTargetFrame : "<rámec>",
DlgLnkTargetPopup : "<vyskakovacie okno>",
DlgLnkTargetBlank : "Nové okno (_blank)",
DlgLnkTargetParent : "Rodičovské okno (_parent)",
DlgLnkTargetSelf : "Rovnaké okno (_self)",
DlgLnkTargetTop : "Hlavné okno (_top)",
DlgLnkTargetFrameName : "Meno rámu cieľa",
DlgLnkPopWinName : "Názov vyskakovacieho okna",
DlgLnkPopWinFeat : "Vlastnosti vyskakovacieho okna",
DlgLnkPopResize : "Meniteľná veľkosÅ¥",
DlgLnkPopLocation : "Panel umiestnenia",
DlgLnkPopMenu : "Panel ponuky",
DlgLnkPopScroll : "Posuvníky",
DlgLnkPopStatus : "Stavový riadok",
DlgLnkPopToolbar : "Panel nástrojov",
DlgLnkPopFullScrn : "Celá obrazovka (IE)",
DlgLnkPopDependent : "ZávislosÅ¥ (Netscape)",
DlgLnkPopWidth : "Å írka",
DlgLnkPopHeight : "VýÅ¡ka",
DlgLnkPopLeft : "Ľavý okraj",
DlgLnkPopTop : "Horný okraj",
 
DlnLnkMsgNoUrl : "Zadajte prosím URL odkazu",
DlnLnkMsgNoEMail : "Zadajte prosím e-mailovú adresu",
DlnLnkMsgNoAnchor : "Vyberte prosím kotvu",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "Výber farby",
DlgColorBtnClear : "Vymazať",
DlgColorHighlight : "Zvýraznená",
DlgColorSelected : "Vybraná",
 
// Smiley Dialog
DlgSmileyTitle : "Vkladanie smajlíkov",
 
// Special Character Dialog
DlgSpecialCharTitle : "Výber speciálneho znaku",
 
// Table Dialog
DlgTableTitle : "Vlastnosti tabuľky",
DlgTableRows : "Riadky",
DlgTableColumns : "Stĺpce",
DlgTableBorder : "Ohraničenie",
DlgTableAlign : "Zarovnanie",
DlgTableAlignNotSet : "<nenastavené>",
DlgTableAlignLeft : "Vľavo",
DlgTableAlignCenter : "Na stred",
DlgTableAlignRight : "Vpravo",
DlgTableWidth : "Å írka",
DlgTableWidthPx : "pixelov",
DlgTableWidthPc : "percent",
DlgTableHeight : "VýÅ¡ka",
DlgTableCellSpace : "Vzdialenosť buniek",
DlgTableCellPad : "Odsadenie obsahu",
DlgTableCaption : "Popis",
DlgTableSummary : "Prehľad",
 
// Table Cell Dialog
DlgCellTitle : "Vlastnosti bunky",
DlgCellWidth : "Å írka",
DlgCellWidthPx : "bodov",
DlgCellWidthPc : "percent",
DlgCellHeight : "VýÅ¡ka",
DlgCellWordWrap : "Zalamovannie",
DlgCellWordWrapNotSet : "<nenastavené>",
DlgCellWordWrapYes : "Áno",
DlgCellWordWrapNo : "Nie",
DlgCellHorAlign : "Vodorovné zarovnanie",
DlgCellHorAlignNotSet : "<nenastavené>",
DlgCellHorAlignLeft : "Vľavo",
DlgCellHorAlignCenter : "Na stred",
DlgCellHorAlignRight: "Vpravo",
DlgCellVerAlign : "Zvyslé zarovnanie",
DlgCellVerAlignNotSet : "<nenastavené>",
DlgCellVerAlignTop : "Nahor",
DlgCellVerAlignMiddle : "Doprostred",
DlgCellVerAlignBottom : "Dole",
DlgCellVerAlignBaseline : "Na základňu",
DlgCellRowSpan : "Zlúčené riadky",
DlgCellCollSpan : "Zlúčené stĺpce",
DlgCellBackColor : "Farba pozadia",
DlgCellBorderColor : "Farba ohraničenia",
DlgCellBtnSelect : "Výber...",
 
// Find Dialog
DlgFindTitle : "Hľadať",
DlgFindFindBtn : "Hľadať",
DlgFindNotFoundMsg : "Hľadaný text nebol nájdený.",
 
// Replace Dialog
DlgReplaceTitle : "Nahradiť",
DlgReplaceFindLbl : "Čo hľadať:",
DlgReplaceReplaceLbl : "Čím nahradiÅ¥:",
DlgReplaceCaseChk : "RozliÅ¡ovaÅ¥ malé/veľké písmená",
DlgReplaceReplaceBtn : "Nahradiť",
DlgReplaceReplAllBtn : "Nahradiť všetko",
DlgReplaceWordChk : "Len celé slová",
 
// Paste Operations / Dialog
PasteErrorPaste : "Bezpečnostné nastavenie VáÅ¡ho prohehliadača nedovoľujú editoru spustiÅ¥ funkciu pre vloženie textu zo schránky. Prosím vložte text zo schránky pomocou klávesnice (Ctrl+V).",
PasteErrorCut : "Bezpečnostné nastavenie VáÅ¡ho prohehliadača nedovoľujú editoru spustiÅ¥ funkciu pre vystrihnutie zvoleného textu do schránky. Prosím vystrihnite zvolený text do schránky pomocou klávesnice (Ctrl+X).",
PasteErrorCopy : "Bezpečnostné nastavenie VáÅ¡ho prohehliadača nedovoľujú editoru spustiÅ¥ funkciu pre kopírovánie zvoleného textu do schránky. Prosím skopírujte zvolený text do schránky pomocou klávesnice (Ctrl+C).",
 
PasteAsText : "VložiÅ¥ ako čistý text",
PasteFromWord : "Vložiť text z Wordu",
 
DlgPasteMsg2 : "Do nasledujúceho boxu vložte obsah schránky použitím klávesnice (<STRONG>Ctrl+V</STRONG>) a stlačte <STRONG>OK</STRONG>.",
DlgPasteIgnoreFont : "IgnorovaÅ¥ nastavenia typu písma",
DlgPasteRemoveStyles : "OdstrániÅ¥ formátovanie",
DlgPasteCleanBox : "VyčistiÅ¥ schránku",
 
// Color Picker
ColorAutomatic : "Automaticky",
ColorMoreColors : "Viac farieb...",
 
// Document Properties
DocProps : "Vlastnosti dokumentu",
 
// Anchor Dialog
DlgAnchorTitle : "Vlastnosti kotvy",
DlgAnchorName : "Meno kotvy",
DlgAnchorErrorName : "Zadajte prosím meno kotvy",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Nie je v slovníku",
DlgSpellChangeTo : "Zmeniť na",
DlgSpellBtnIgnore : "Ignorovať",
DlgSpellBtnIgnoreAll : "Ignorovať všetko",
DlgSpellBtnReplace : "Prepísat",
DlgSpellBtnReplaceAll : "Prepísat vÅ¡etko",
DlgSpellBtnUndo : "SpäÅ¥",
DlgSpellNoSuggestions : "- Žiadny návrh -",
DlgSpellProgress : "Prebieha kontrola pravopisu...",
DlgSpellNoMispell : "Kontrola pravopisu dokončená: bez chyb",
DlgSpellNoChanges : "Kontrola pravopisu dokončená: žiadne slová nezmenené",
DlgSpellOneChange : "Kontrola pravopisu dokončená: zmenené jedno slovo",
DlgSpellManyChanges : "Kontrola pravopisu dokončená: zmenených %1 slov",
 
IeSpellDownload : "Kontrola pravopisu nie je naiÅ¡talovaná. Chcete ju hneď stiahnuÅ¥?",
 
// Button Dialog
DlgButtonText : "Text",
DlgButtonType : "Typ",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Názov",
DlgCheckboxValue : "Hodnota",
DlgCheckboxSelected : "Vybrané",
 
// Form Dialog
DlgFormName : "Názov",
DlgFormAction : "Akcie",
DlgFormMethod : "Metóda",
 
// Select Field Dialog
DlgSelectName : "Názov",
DlgSelectValue : "Hodnota",
DlgSelectSize : "Veľkosť",
DlgSelectLines : "riadkov",
DlgSelectChkMulti : "PovoliÅ¥ viacnásobný výber",
DlgSelectOpAvail : "Dostupné možnosti",
DlgSelectOpText : "Text",
DlgSelectOpValue : "Hodnota",
DlgSelectBtnAdd : "Pridať",
DlgSelectBtnModify : "Zmeniť",
DlgSelectBtnUp : "Nahor",
DlgSelectBtnDown : "Dolu",
DlgSelectBtnSetValue : "NastaviÅ¥ ako vybranú hodnotu",
DlgSelectBtnDelete : "Zmazať",
 
// Textarea Dialog
DlgTextareaName : "Názov",
DlgTextareaCols : "Stĺpce",
DlgTextareaRows : "Riadky",
 
// Text Field Dialog
DlgTextName : "Názov",
DlgTextValue : "Hodnota",
DlgTextCharWidth : "Å írka pola (znakov)",
DlgTextMaxChars : "Maximálny počet znakov",
DlgTextType : "Typ",
DlgTextTypeText : "Text",
DlgTextTypePass : "Heslo",
 
// Hidden Field Dialog
DlgHiddenName : "Názov",
DlgHiddenValue : "Hodnota",
 
// Bulleted List Dialog
BulletedListProp : "Vlastnosti odrážok",
NumberedListProp : "Vlastnosti číslovania",
DlgLstStart : "Start", //MISSING
DlgLstType : "Typ",
DlgLstTypeCircle : "Krúžok",
DlgLstTypeDisc : "Disk",
DlgLstTypeSquare : "Štvorec",
DlgLstTypeNumbers : "Číslovanie (1, 2, 3)",
DlgLstTypeLCase : "Malé písmená (a, b, c)",
DlgLstTypeUCase : "Veľké písmená (A, B, C)",
DlgLstTypeSRoman : "Malé rímske číslice (i, ii, iii)",
DlgLstTypeLRoman : "Veľké rímske číslice (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "VÅ¡eobecné",
DlgDocBackTab : "Pozadie",
DlgDocColorsTab : "Farby a okraje",
DlgDocMetaTab : "Meta Data",
 
DlgDocPageTitle : "Titulok",
DlgDocLangDir : "Orientácie jazyka",
DlgDocLangDirLTR : "Zľava doprava (LTR)",
DlgDocLangDirRTL : "Zprava doľava (RTL)",
DlgDocLangCode : "Kód jazyka",
DlgDocCharSet : "Kódová stránka",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "Iná kódová stránka",
 
DlgDocDocType : "Typ záhlavia dokumentu",
DlgDocDocTypeOther : "Iný typ záhlavia dokumentu",
DlgDocIncXHTML : "Obsahuje deklarácie XHTML",
DlgDocBgColor : "Farba pozadia",
DlgDocBgImage : "URL adresa obrázku na pozadí",
DlgDocBgNoScroll : "Fixné pozadie",
DlgDocCText : "Text",
DlgDocCLink : "Odkaz",
DlgDocCVisited : "NavÅ¡tívený odkaz",
DlgDocCActive : "Aktívny odkaz",
DlgDocMargins : "Okraje stránky",
DlgDocMaTop : "Horný",
DlgDocMaLeft : "Ľavý",
DlgDocMaRight : "Pravý",
DlgDocMaBottom : "Dolný",
DlgDocMeIndex : "Kľúčové slová pre indexovanie (oddelené čiarkou)",
DlgDocMeDescr : "Popis stránky",
DlgDocMeAuthor : "Autor",
DlgDocMeCopy : "Autorské práva",
DlgDocPreview : "Náhľad",
 
// Templates Dialog
Templates : "Å ablóny",
DlgTemplatesTitle : "Å ablóny obsahu",
DlgTemplatesSelMsg : "Prosím vyberte Å¡ablóny ma otvorenie v editore<br>(terajÅ¡í obsah bude stratený):",
DlgTemplatesLoading : "Nahrávam zoznam Å¡ablón. Čakajte prosím...",
DlgTemplatesNoTpl : "(žiadne Å¡ablóny nenájdené)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "O aplikáci",
DlgAboutBrowserInfoTab : "Informácie o prehliadači",
DlgAboutLicenseTab : "License", //MISSING
DlgAboutVersion : "verzie",
DlgAboutLicense : "Licencované pod pravidlami GNU Lesser General Public License",
DlgAboutInfo : "Viac informácií získate na"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/vi.js
New file
0,0 → 1,502
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: vi.js
* Vietnamese language file.
*
* File Authors:
* Phan Binh Giang (bbbgiang@yahoo.com)
* Hà Thanh Hải (thanhhai.ha@gmail.com)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Thu gọn Thanh công cụ",
ToolbarExpand : "Mở rộng Thanh công cụ",
 
// Toolbar Items and Context Menu
Save : "Lưu",
NewPage : "Trang mới",
Preview : "Xem trước",
Cut : "Cắt",
Copy : "Sao chép",
Paste : "Dán",
PasteText : "Dán theo dạng văn bản thuần",
PasteWord : "Dán với định dạng Word",
Print : "In",
SelectAll : "Chọn Tất cả",
RemoveFormat : "Xoá Định dạng",
InsertLinkLbl : "Liên kết",
InsertLink : "Chèn/Sá»­a Liên kết",
RemoveLink : "Xoá Liên kết",
Anchor : "Chèn/Sá»­a Neo",
InsertImageLbl : "Hình ảnh",
InsertImage : "Chèn/Sá»­a Hình ảnh",
InsertFlashLbl : "Flash",
InsertFlash : "Chèn/Sá»­a Flash",
InsertTableLbl : "Bảng",
InsertTable : "Chèn/Sá»­a Bảng",
InsertLineLbl : "Đường phân cách ngang",
InsertLine : "Chèn Đường phân cách ngang",
InsertSpecialCharLbl: "Ký tá»± đặc biệt",
InsertSpecialChar : "Chèn Ký tá»± đặc biệt",
InsertSmileyLbl : "Hình biểu lộ cảm xúc (mặt cười)",
InsertSmiley : "Chèn Hình biểu lộ cảm xúc (mặt cười)",
About : "Giới thiệu về FCKeditor",
Bold : "Đậm",
Italic : "Nghiêng",
Underline : "Gạch chân",
StrikeThrough : "Gạch xuyên ngang",
Subscript : "Chỉ số dưới",
Superscript : "Chỉ số trên",
LeftJustify : "Canh trái",
CenterJustify : "Canh giữa",
RightJustify : "Canh phải",
BlockJustify : "Canh đều",
DecreaseIndent : "Dịch ra ngoài",
IncreaseIndent : "Dịch vào trong",
Undo : "Khôi phục thao tác",
Redo : "Làm lại thao tác",
NumberedListLbl : "Danh sách có thứ tá»±",
NumberedList : "Chèn/Xoá Danh sách có thứ tá»±",
BulletedListLbl : "Danh sách không thứ tá»±",
BulletedList : "Chèn/Xoá Danh sách không thứ tá»±",
ShowTableBorders : "Hiển thị Đường viền bảng",
ShowDetails : "Hiển thị Chi tiết",
Style : "Mẫu",
FontFormat : "Định dạng",
Font : "Phông",
FontSize : "Cỡ chữ",
TextColor : "Màu chữ",
BGColor : "Màu nền",
Source : "Mã HTML",
Find : "Tìm kiếm",
Replace : "Thay thế",
SpellCheck : "Kiểm tra Chính tả",
UniversalKeyboard : "Bàn phím Quốc tế",
PageBreakLbl : "Ngắt trang",
PageBreak : "Chèn Ngắt trang",
 
Form : "Biểu mẫu",
Checkbox : "Nút kiểm",
RadioButton : "Nút chọn",
TextField : "Trường văn bản",
Textarea : "Vùng văn bản",
HiddenField : "Trường ẩn",
Button : "Nút",
SelectionField : "Ô chọn",
ImageButton : "Nút hình ảnh",
 
FitWindow : "Mở rộng tối đa kích thước trình biên tập",
 
// Context Menu
EditLink : "Sá»­a Liên kết",
CellCM : "Ô",
RowCM : "Hàng",
ColumnCM : "Cột",
InsertRow : "Chèn Hàng",
DeleteRows : "Xoá Hàng",
InsertColumn : "Chèn Cột",
DeleteColumns : "Xoá Cột",
InsertCell : "Chèn Ô",
DeleteCells : "Xoá Ô",
MergeCells : "Trộn Ô",
SplitCell : "Chia Ô",
TableDelete : "Xóa Bảng",
CellProperties : "Thuộc tính Ô",
TableProperties : "Thuộc tính Bảng",
ImageProperties : "Thuộc tính Hình ảnh",
FlashProperties : "Thuộc tính Flash",
 
AnchorProp : "Thuộc tính Neo",
ButtonProp : "Thuộc tính Nút",
CheckboxProp : "Thuộc tính Nút kiểm",
HiddenFieldProp : "Thuộc tính Trường ẩn",
RadioButtonProp : "Thuộc tính Nút chọn",
ImageButtonProp : "Thuộc tính Nút hình ảnh",
TextFieldProp : "Thuộc tính Trường văn bản",
SelectionFieldProp : "Thuộc tính Ô chọn",
TextareaProp : "Thuộc tính Vùng văn bản",
FormProp : "Thuộc tính Biểu mẫu",
 
FontFormats : "Normal;Formatted;Address;Heading 1;Heading 2;Heading 3;Heading 4;Heading 5;Heading 6;Normal (DIV)",
 
// Alerts and Messages
ProcessingXHTML : "Đang xá»­ lý XHTML. Vui lòng đợi trong giây lát...",
Done : "Đã hoàn thành",
PasteWordConfirm : "Văn bản bạn muốn dán có kèm định dạng của Word. Bạn có muốn loại bỏ định dạng Word trước khi dán?",
NotCompatiblePaste : "Lệnh này chỉ được hỗ trợ từ trình duyệt Internet Explorer phiên bản 5.5 hoặc mới hÆ¡n. Bạn có muốn dán nguyên mẫu?",
UnknownToolbarItem : "Không rõ mục trên thanh công cụ \"%1\"",
UnknownCommand : "Không rõ lệnh \"%1\"",
NotImplemented : "Lệnh không được thá»±c hiện",
UnknownToolbarSet : "Thanh công cụ \"%1\" không tồn tại",
NoActiveX : "Các thiết lập bảo mật của trình duyệt có thể giới hạn một số chức năng của trình biên tập. Bạn phải bật tùy chọn \"Run ActiveX controls and plug-ins\". Bạn có thể gặp một số lỗi và thấy thiếu đi một số chức năng.",
BrowseServerBlocked : "Không thể mở được bộ duyệt tài nguyên. Hãy đảm bảo chức năng chặn popup đã bị vô hiệu hóa.",
DialogBlocked : "Không thể mở được cá»­a sổ hộp thoại. Hãy đảm bảo chức năng chặn popup đã bị vô hiệu hóa.",
 
// Dialogs
DlgBtnOK : "Đồng ý",
DlgBtnCancel : "Bỏ qua",
DlgBtnClose : "Đóng",
DlgBtnBrowseServer : "Duyệt trên máy chủ",
DlgAdvancedTag : "Mở rộng",
DlgOpOther : "<Khác>",
DlgInfoTab : "Thông tin",
DlgAlertUrl : "Hãy nhập vào một URL",
 
// General Dialogs Labels
DlgGenNotSet : "<không thiết lập>",
DlgGenId : "Định danh",
DlgGenLangDir : "Đường dẫn Ngôn ngữ",
DlgGenLangDirLtr : "Trái sang Phải (LTR)",
DlgGenLangDirRtl : "Phải sang Trái (RTL)",
DlgGenLangCode : "Mã Ngôn ngữ",
DlgGenAccessKey : "Phím Hỗ trợ truy cập",
DlgGenName : "Tên",
DlgGenTabIndex : "Chỉ số của Tab",
DlgGenLongDescr : "Mô tả URL",
DlgGenClass : "Lớp Stylesheet",
DlgGenTitle : "Advisory Title",
DlgGenContType : "Advisory Content Type",
DlgGenLinkCharset : "Bảng mã của tài nguyên được liên kết đến",
DlgGenStyle : "Mẫu",
 
// Image Dialog
DlgImgTitle : "Thuộc tính Hình ảnh",
DlgImgInfoTab : "Thông tin Hình ảnh",
DlgImgBtnUpload : "Tải lên Máy chủ",
DlgImgURL : "URL",
DlgImgUpload : "Tải lên",
DlgImgAlt : "Chú thích Hình ảnh",
DlgImgWidth : "Rộng",
DlgImgHeight : "Cao",
DlgImgLockRatio : "Giữ tỷ lệ",
DlgBtnResetSize : "Kích thước gốc",
DlgImgBorder : "Đường viền",
DlgImgHSpace : "HSpace",
DlgImgVSpace : "VSpace",
DlgImgAlign : "Vị trí",
DlgImgAlignLeft : "Trái",
DlgImgAlignAbsBottom: "Dưới tuyệt đối",
DlgImgAlignAbsMiddle: "Giữa tuyệt đối",
DlgImgAlignBaseline : "Baseline",
DlgImgAlignBottom : "Dưới",
DlgImgAlignMiddle : "Giữa",
DlgImgAlignRight : "Phải",
DlgImgAlignTextTop : "Phía trên chữ",
DlgImgAlignTop : "Trên",
DlgImgPreview : "Xem trước",
DlgImgAlertUrl : "Hãy đưa vào URL của hình ảnh",
DlgImgLinkTab : "Liên kết",
 
// Flash Dialog
DlgFlashTitle : "Thuộc tính Flash",
DlgFlashChkPlay : "Tự động chạy",
DlgFlashChkLoop : "Lặp",
DlgFlashChkMenu : "Cho phép bật Menu của Flash",
DlgFlashScale : "Tỷ lệ",
DlgFlashScaleAll : "Hiển thị tất cả",
DlgFlashScaleNoBorder : "Không đường viền",
DlgFlashScaleFit : "Vừa vặn",
 
// Link Dialog
DlgLnkWindowTitle : "Liên kết",
DlgLnkInfoTab : "Thông tin Liên kết",
DlgLnkTargetTab : "Đích",
 
DlgLnkType : "Kiểu Liên kết",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Neo trong trang này",
DlgLnkTypeEMail : "Thư điện tử",
DlgLnkProto : "Giao thức",
DlgLnkProtoOther : "<khác>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Chọn một Neo",
DlgLnkAnchorByName : "Theo Tên Neo",
DlgLnkAnchorById : "Theo Định danh Element",
DlgLnkNoAnchors : "<Không có Neo nào trong tài liệu>",
DlgLnkEMail : "Thư điện tử",
DlgLnkEMailSubject : "Tiêu đề Thông điệp",
DlgLnkEMailBody : "Nội dung Thông điệp",
DlgLnkUpload : "Tải lên",
DlgLnkBtnUpload : "Tải lên Máy chủ",
 
DlgLnkTarget : "Đích",
DlgLnkTargetFrame : "<khung>",
DlgLnkTargetPopup : "<cửa sổ popup>",
DlgLnkTargetBlank : "Cửa sổ mới (_blank)",
DlgLnkTargetParent : "Cửa sổ cha (_parent)",
DlgLnkTargetSelf : "Cùng cá»­a sổ (_self)",
DlgLnkTargetTop : "Cá»­a sổ trên cùng(_top)",
DlgLnkTargetFrameName : "Tên Khung đích",
DlgLnkPopWinName : "Tên Cá»­a sổ Popup",
DlgLnkPopWinFeat : "Đặc điểm của Cửa sổ Popup",
DlgLnkPopResize : "Kích thước thay đổi",
DlgLnkPopLocation : "Thanh vị trí",
DlgLnkPopMenu : "Thanh Menu",
DlgLnkPopScroll : "Thanh cuộn",
DlgLnkPopStatus : "Thanh trạng thái",
DlgLnkPopToolbar : "Thanh công cụ",
DlgLnkPopFullScrn : "Toàn màn hình (IE)",
DlgLnkPopDependent : "Phụ thuộc (Netscape)",
DlgLnkPopWidth : "Rộng",
DlgLnkPopHeight : "Cao",
DlgLnkPopLeft : "Vị trí Trái",
DlgLnkPopTop : "Vị trí Trên",
 
DlnLnkMsgNoUrl : "Hãy đưa vào Liên kết URL",
DlnLnkMsgNoEMail : "Hãy đưa vào địa chỉ thÆ° điện tá»­",
DlnLnkMsgNoAnchor : "Hãy chọn một Neo",
DlnLnkMsgInvPopName : "Tên của cá»­a sổ Popup phải bắt đầu bằng một ký tá»± và không được chứa khoảng trắng",
 
// Color Dialog
DlgColorTitle : "Chọn màu",
DlgColorBtnClear : "Xoá",
DlgColorHighlight : "Tô sáng",
DlgColorSelected : "Đã chọn",
 
// Smiley Dialog
DlgSmileyTitle : "Chèn Hình biểu lộ cảm xúc (mặt cười)",
 
// Special Character Dialog
DlgSpecialCharTitle : "Hãy chọn Ký tá»± đặc biệt",
 
// Table Dialog
DlgTableTitle : "Thuộc tính bảng",
DlgTableRows : "Hàng",
DlgTableColumns : "Cột",
DlgTableBorder : "Cỡ Đường viền",
DlgTableAlign : "Canh lề",
DlgTableAlignNotSet : "<Chưa thiết lập>",
DlgTableAlignLeft : "Trái",
DlgTableAlignCenter : "Giữa",
DlgTableAlignRight : "Phải",
DlgTableWidth : "Rộng",
DlgTableWidthPx : "điểm (px)",
DlgTableWidthPc : "%",
DlgTableHeight : "Cao",
DlgTableCellSpace : "Khoảng cách Ô",
DlgTableCellPad : "Đệm Ô",
DlgTableCaption : "Đầu đề",
DlgTableSummary : "Tóm lược",
 
// Table Cell Dialog
DlgCellTitle : "Thuộc tính Ô",
DlgCellWidth : "Rộng",
DlgCellWidthPx : "điểm (px)",
DlgCellWidthPc : "%",
DlgCellHeight : "Cao",
DlgCellWordWrap : "Bọc từ",
DlgCellWordWrapNotSet : "<Chưa thiết lập>",
DlgCellWordWrapYes : "Đồng ý",
DlgCellWordWrapNo : "Không",
DlgCellHorAlign : "Canh theo Chiều ngang",
DlgCellHorAlignNotSet : "<Chưa thiết lập>",
DlgCellHorAlignLeft : "Trái",
DlgCellHorAlignCenter : "Giữa",
DlgCellHorAlignRight: "Phải",
DlgCellVerAlign : "Canh theo Chiều dọc",
DlgCellVerAlignNotSet : "<Chưa thiết lập>",
DlgCellVerAlignTop : "Trên",
DlgCellVerAlignMiddle : "Giữa",
DlgCellVerAlignBottom : "Dưới",
DlgCellVerAlignBaseline : "Baseline",
DlgCellRowSpan : "Nối Hàng",
DlgCellCollSpan : "Nối Cột",
DlgCellBackColor : "Màu nền",
DlgCellBorderColor : "Màu viền",
DlgCellBtnSelect : "Chọn...",
 
// Find Dialog
DlgFindTitle : "Tìm kiếm",
DlgFindFindBtn : "Tìm kiếm",
DlgFindNotFoundMsg : "Không tìm thấy chuỗi cần tìm.",
 
// Replace Dialog
DlgReplaceTitle : "Thay thế",
DlgReplaceFindLbl : "Tìm chuỗi:",
DlgReplaceReplaceLbl : "Thay bằng:",
DlgReplaceCaseChk : "Phân biệt chữ hoa/thường",
DlgReplaceReplaceBtn : "Thay thế",
DlgReplaceReplAllBtn : "Thay thế Tất cả",
DlgReplaceWordChk : "Đúng toàn bộ từ",
 
// Paste Operations / Dialog
PasteErrorPaste : "Các thiết lập bảo mật của trình duyệt không cho phép trình biên tập tá»± động thá»±c thi lệnh dán. Hãy sá»­ dụng bàn phím cho lệnh này (Ctrl+V).",
PasteErrorCut : "Các thiết lập bảo mật của trình duyệt không cho phép trình biên tập tá»± động thá»±c thi lệnh cắt. Hãy sá»­ dụng bàn phím cho lệnh này (Ctrl+X).",
PasteErrorCopy : "Các thiết lập bảo mật của trình duyệt không cho phép trình biên tập tá»± động thá»±c thi lệnh sao chép. Hãy sá»­ dụng bàn phím cho lệnh này (Ctrl+C).",
 
PasteAsText : "Dán theo định dạng văn bản thuần",
PasteFromWord : "Dán với định dạng Word",
 
DlgPasteMsg2 : "Hãy dán nội dung vào trong khung bên dưới, sá»­ dụng tổ hợp phím (<STRONG>Ctrl+V</STRONG>) và nhấn vào nút <STRONG>Đồng ý</STRONG>.",
DlgPasteIgnoreFont : "Chấp nhận các định dạng phông",
DlgPasteRemoveStyles : "Gỡ bỏ các định dạng Styles",
DlgPasteCleanBox : "Xóa nội dung",
 
// Color Picker
ColorAutomatic : "Tự động",
ColorMoreColors : "Màu khác...",
 
// Document Properties
DocProps : "Thuộc tính Tài liệu",
 
// Anchor Dialog
DlgAnchorTitle : "Thuộc tính Neo",
DlgAnchorName : "Tên của Neo",
DlgAnchorErrorName : "Hãy đưa vào tên của Neo",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Không có trong từ điển",
DlgSpellChangeTo : "Chuyển thành",
DlgSpellBtnIgnore : "Bỏ qua",
DlgSpellBtnIgnoreAll : "Bỏ qua Tất cả",
DlgSpellBtnReplace : "Thay thế",
DlgSpellBtnReplaceAll : "Thay thế Tất cả",
DlgSpellBtnUndo : "Phục hồi lại",
DlgSpellNoSuggestions : "- Không đưa ra gợi ý về từ -",
DlgSpellProgress : "Đang tiến hành kiểm tra chính tả...",
DlgSpellNoMispell : "Hoàn tất kiểm tra chính tả: Không có lỗi chính tả",
DlgSpellNoChanges : "Hoàn tất kiểm tra chính tả: Không có từ nào được thay đổi",
DlgSpellOneChange : "Hoàn tất kiểm tra chính tả: Một từ đã được thay đổi",
DlgSpellManyChanges : "Hoàn tất kiểm tra chính tả: %1 từ đã được thay đổi",
 
IeSpellDownload : "Chức năng kiểm tra chính tả chÆ°a được cài đặt. Bạn có muốn tải về ngay bây giờ?",
 
// Button Dialog
DlgButtonText : "Chuỗi hiển thị (Giá trị)",
DlgButtonType : "Kiểu",
DlgButtonTypeBtn : "Nút Bấm",
DlgButtonTypeSbm : "Nút Gá»­i",
DlgButtonTypeRst : "Nút Nhập lại",
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Tên",
DlgCheckboxValue : "Giá trị",
DlgCheckboxSelected : "Được chọn",
 
// Form Dialog
DlgFormName : "Tên",
DlgFormAction : "Hành động",
DlgFormMethod : "Phương thức",
 
// Select Field Dialog
DlgSelectName : "Tên",
DlgSelectValue : "Giá trị",
DlgSelectSize : "Kích cỡ",
DlgSelectLines : "dòng",
DlgSelectChkMulti : "Cho phép chọn nhiều",
DlgSelectOpAvail : "Các tùy chọn có thể sá»­ dụng",
DlgSelectOpText : "Văn bản",
DlgSelectOpValue : "Giá trị",
DlgSelectBtnAdd : "Thêm",
DlgSelectBtnModify : "Thay đổi",
DlgSelectBtnUp : "Lên",
DlgSelectBtnDown : "Xuống",
DlgSelectBtnSetValue : "Giá trị được chọn",
DlgSelectBtnDelete : "Xoá",
 
// Textarea Dialog
DlgTextareaName : "Tên",
DlgTextareaCols : "Cột",
DlgTextareaRows : "Hàng",
 
// Text Field Dialog
DlgTextName : "Tên",
DlgTextValue : "Giá trị",
DlgTextCharWidth : "Rộng",
DlgTextMaxChars : "Số Ký tá»± tối đa",
DlgTextType : "Kiểu",
DlgTextTypeText : "Ký tá»±",
DlgTextTypePass : "Mật khẩu",
 
// Hidden Field Dialog
DlgHiddenName : "Tên",
DlgHiddenValue : "Giá trị",
 
// Bulleted List Dialog
BulletedListProp : "Thuộc tính Danh sách không thứ tá»±",
NumberedListProp : "Thuộc tính Danh sách có thứ tá»±",
DlgLstStart : "Bắt đầu",
DlgLstType : "Kiểu",
DlgLstTypeCircle : "Hình tròn",
DlgLstTypeDisc : "Hình đĩa",
DlgLstTypeSquare : "Hình vuông",
DlgLstTypeNumbers : "Số thứ tự (1, 2, 3)",
DlgLstTypeLCase : "Chữ cái thường (a, b, c)",
DlgLstTypeUCase : "Chữ cái hoa (A, B, C)",
DlgLstTypeSRoman : "Số La Mã thường (i, ii, iii)",
DlgLstTypeLRoman : "Số La Mã hoa (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "Toàn thể",
DlgDocBackTab : "Nền",
DlgDocColorsTab : "Màu sắc và Đường biên",
DlgDocMetaTab : "Siêu dữ liệu",
 
DlgDocPageTitle : "Tiêu đề Trang",
DlgDocLangDir : "Đường dẫn Ngôn ngữ",
DlgDocLangDirLTR : "Trái sang Phải (LTR)",
DlgDocLangDirRTL : "Phải sang Trái (RTL)",
DlgDocLangCode : "Mã Ngôn ngữ",
DlgDocCharSet : "Bảng mã ký tá»±",
DlgDocCharSetCE : "Trung Âu",
DlgDocCharSetCT : "Tiếng Trung Quốc (Big5)",
DlgDocCharSetCR : "Tiếng Kirin",
DlgDocCharSetGR : "Tiếng Hy Lạp",
DlgDocCharSetJP : "Tiếng Nhật",
DlgDocCharSetKR : "Tiếng Hàn",
DlgDocCharSetTR : "Tiếng Thổ Nhĩ Kỳ",
DlgDocCharSetUN : "Unicode (UTF-8)",
DlgDocCharSetWE : "Tây Âu",
DlgDocCharSetOther : "Bảng mã ký tá»± khác",
 
DlgDocDocType : "Kiểu Đề mục Tài liệu",
DlgDocDocTypeOther : "Kiểu Đề mục Tài liệu khác",
DlgDocIncXHTML : "Bao gồm cả định nghĩa XHTML",
DlgDocBgColor : "Màu nền",
DlgDocBgImage : "URL của Hình ảnh nền",
DlgDocBgNoScroll : "Không cuộn nền",
DlgDocCText : "Văn bản",
DlgDocCLink : "Liên kết",
DlgDocCVisited : "Liên kết Đã ghé thăm",
DlgDocCActive : "Liên kết Hiện hành",
DlgDocMargins : "Đường biên của Trang",
DlgDocMaTop : "Trên",
DlgDocMaLeft : "Trái",
DlgDocMaRight : "Phải",
DlgDocMaBottom : "Dưới",
DlgDocMeIndex : "Các từ khóa chỉ mục tài liệu (phân cách bởi dấu phẩy)",
DlgDocMeDescr : "Mô tả tài liệu",
DlgDocMeAuthor : "Tác giả",
DlgDocMeCopy : "Bản quyền",
DlgDocPreview : "Xem trước",
 
// Templates Dialog
Templates : "Mẫu dựng sẵn",
DlgTemplatesTitle : "Nội dung Mẫu dựng sẵn",
DlgTemplatesSelMsg : "Hãy chọn Mẫu dá»±ng sẵn để mở trong trình biên tập<br>(nội dung hiện tại sẽ bị mất):",
DlgTemplatesLoading : "Đang nạp Danh sách Mẫu dá»±ng sẵn. Vui lòng đợi trong giây lát...",
DlgTemplatesNoTpl : "(Không có Mẫu dá»±ng sẵn nào được định nghÄ©a)",
DlgTemplatesReplace : "Thay thế nội dung hiện tại",
 
// About Dialog
DlgAboutAboutTab : "Giới thiệu",
DlgAboutBrowserInfoTab : "Thông tin trình duyệt",
DlgAboutLicenseTab : "Giấy phép",
DlgAboutVersion : "phiên bản",
DlgAboutLicense : "Được cấp phép theo các điều khoản của giấy phép GNU Lesser General Public License",
DlgAboutInfo : "Để biết thêm thông tin, hãy truy cập"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/en-uk.js
New file
0,0 → 1,502
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: en-uk.js
* English (United Kingdom) language file.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
* Christopher Dawes (fckeditor@dawes.id.au)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Collapse Toolbar",
ToolbarExpand : "Expand Toolbar",
 
// Toolbar Items and Context Menu
Save : "Save",
NewPage : "New Page",
Preview : "Preview",
Cut : "Cut",
Copy : "Copy",
Paste : "Paste",
PasteText : "Paste as plain text",
PasteWord : "Paste from Word",
Print : "Print",
SelectAll : "Select All",
RemoveFormat : "Remove Format",
InsertLinkLbl : "Link",
InsertLink : "Insert/Edit Link",
RemoveLink : "Remove Link",
Anchor : "Insert/Edit Anchor",
InsertImageLbl : "Image",
InsertImage : "Insert/Edit Image",
InsertFlashLbl : "Flash",
InsertFlash : "Insert/Edit Flash",
InsertTableLbl : "Table",
InsertTable : "Insert/Edit Table",
InsertLineLbl : "Line",
InsertLine : "Insert Horizontal Line",
InsertSpecialCharLbl: "Special Character",
InsertSpecialChar : "Insert Special Character",
InsertSmileyLbl : "Smiley",
InsertSmiley : "Insert Smiley",
About : "About FCKeditor",
Bold : "Bold",
Italic : "Italic",
Underline : "Underline",
StrikeThrough : "Strike Through",
Subscript : "Subscript",
Superscript : "Superscript",
LeftJustify : "Left Justify",
CenterJustify : "Centre Justify",
RightJustify : "Right Justify",
BlockJustify : "Block Justify",
DecreaseIndent : "Decrease Indent",
IncreaseIndent : "Increase Indent",
Undo : "Undo",
Redo : "Redo",
NumberedListLbl : "Numbered List",
NumberedList : "Insert/Remove Numbered List",
BulletedListLbl : "Bulleted List",
BulletedList : "Insert/Remove Bulleted List",
ShowTableBorders : "Show Table Borders",
ShowDetails : "Show Details",
Style : "Style",
FontFormat : "Format",
Font : "Font",
FontSize : "Size",
TextColor : "Text Colour",
BGColor : "Background Colour",
Source : "Source",
Find : "Find",
Replace : "Replace",
SpellCheck : "Check Spelling",
UniversalKeyboard : "Universal Keyboard",
PageBreakLbl : "Page Break",
PageBreak : "Insert Page Break",
 
Form : "Form",
Checkbox : "Checkbox",
RadioButton : "Radio Button",
TextField : "Text Field",
Textarea : "Textarea",
HiddenField : "Hidden Field",
Button : "Button",
SelectionField : "Selection Field",
ImageButton : "Image Button",
 
FitWindow : "Maximize the editor size",
 
// Context Menu
EditLink : "Edit Link",
CellCM : "Cell",
RowCM : "Row",
ColumnCM : "Column",
InsertRow : "Insert Row",
DeleteRows : "Delete Rows",
InsertColumn : "Insert Column",
DeleteColumns : "Delete Columns",
InsertCell : "Insert Cell",
DeleteCells : "Delete Cells",
MergeCells : "Merge Cells",
SplitCell : "Split Cell",
TableDelete : "Delete Table",
CellProperties : "Cell Properties",
TableProperties : "Table Properties",
ImageProperties : "Image Properties",
FlashProperties : "Flash Properties",
 
AnchorProp : "Anchor Properties",
ButtonProp : "Button Properties",
CheckboxProp : "Checkbox Properties",
HiddenFieldProp : "Hidden Field Properties",
RadioButtonProp : "Radio Button Properties",
ImageButtonProp : "Image Button Properties",
TextFieldProp : "Text Field Properties",
SelectionFieldProp : "Selection Field Properties",
TextareaProp : "Textarea Properties",
FormProp : "Form Properties",
 
FontFormats : "Normal;Formatted;Address;Heading 1;Heading 2;Heading 3;Heading 4;Heading 5;Heading 6;Normal (DIV)",
 
// Alerts and Messages
ProcessingXHTML : "Processing XHTML. Please wait...",
Done : "Done",
PasteWordConfirm : "The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?",
NotCompatiblePaste : "This command is available for Internet Explorer version 5.5 or more. Do you want to paste without cleaning?",
UnknownToolbarItem : "Unknown toolbar item \"%1\"",
UnknownCommand : "Unknown command name \"%1\"",
NotImplemented : "Command not implemented",
UnknownToolbarSet : "Toolbar set \"%1\" doesn't exist",
NoActiveX : "Your browser's security settings could limit some features of the editor. You must enable the option \"Run ActiveX controls and plug-ins\". You may experience errors and notice missing features.",
BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.",
DialogBlocked : "It was not possible to open the dialog window. Make sure all popup blockers are disabled.",
 
// Dialogs
DlgBtnOK : "OK",
DlgBtnCancel : "Cancel",
DlgBtnClose : "Close",
DlgBtnBrowseServer : "Browse Server",
DlgAdvancedTag : "Advanced",
DlgOpOther : "<Other>",
DlgInfoTab : "Info",
DlgAlertUrl : "Please insert the URL",
 
// General Dialogs Labels
DlgGenNotSet : "<not set>",
DlgGenId : "Id",
DlgGenLangDir : "Language Direction",
DlgGenLangDirLtr : "Left to Right (LTR)",
DlgGenLangDirRtl : "Right to Left (RTL)",
DlgGenLangCode : "Language Code",
DlgGenAccessKey : "Access Key",
DlgGenName : "Name",
DlgGenTabIndex : "Tab Index",
DlgGenLongDescr : "Long Description URL",
DlgGenClass : "Stylesheet Classes",
DlgGenTitle : "Advisory Title",
DlgGenContType : "Advisory Content Type",
DlgGenLinkCharset : "Linked Resource Charset",
DlgGenStyle : "Style",
 
// Image Dialog
DlgImgTitle : "Image Properties",
DlgImgInfoTab : "Image Info",
DlgImgBtnUpload : "Send it to the Server",
DlgImgURL : "URL",
DlgImgUpload : "Upload",
DlgImgAlt : "Alternative Text",
DlgImgWidth : "Width",
DlgImgHeight : "Height",
DlgImgLockRatio : "Lock Ratio",
DlgBtnResetSize : "Reset Size",
DlgImgBorder : "Border",
DlgImgHSpace : "HSpace",
DlgImgVSpace : "VSpace",
DlgImgAlign : "Align",
DlgImgAlignLeft : "Left",
DlgImgAlignAbsBottom: "Abs Bottom",
DlgImgAlignAbsMiddle: "Abs Middle",
DlgImgAlignBaseline : "Baseline",
DlgImgAlignBottom : "Bottom",
DlgImgAlignMiddle : "Middle",
DlgImgAlignRight : "Right",
DlgImgAlignTextTop : "Text Top",
DlgImgAlignTop : "Top",
DlgImgPreview : "Preview",
DlgImgAlertUrl : "Please type the image URL",
DlgImgLinkTab : "Link",
 
// Flash Dialog
DlgFlashTitle : "Flash Properties",
DlgFlashChkPlay : "Auto Play",
DlgFlashChkLoop : "Loop",
DlgFlashChkMenu : "Enable Flash Menu",
DlgFlashScale : "Scale",
DlgFlashScaleAll : "Show all",
DlgFlashScaleNoBorder : "No Border",
DlgFlashScaleFit : "Exact Fit",
 
// Link Dialog
DlgLnkWindowTitle : "Link",
DlgLnkInfoTab : "Link Info",
DlgLnkTargetTab : "Target",
 
DlgLnkType : "Link Type",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Link to anchor in the text",
DlgLnkTypeEMail : "E-Mail",
DlgLnkProto : "Protocol",
DlgLnkProtoOther : "<other>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Select an Anchor",
DlgLnkAnchorByName : "By Anchor Name",
DlgLnkAnchorById : "By Element Id",
DlgLnkNoAnchors : "<No anchors available in the document>",
DlgLnkEMail : "E-Mail Address",
DlgLnkEMailSubject : "Message Subject",
DlgLnkEMailBody : "Message Body",
DlgLnkUpload : "Upload",
DlgLnkBtnUpload : "Send it to the Server",
 
DlgLnkTarget : "Target",
DlgLnkTargetFrame : "<frame>",
DlgLnkTargetPopup : "<popup window>",
DlgLnkTargetBlank : "New Window (_blank)",
DlgLnkTargetParent : "Parent Window (_parent)",
DlgLnkTargetSelf : "Same Window (_self)",
DlgLnkTargetTop : "Topmost Window (_top)",
DlgLnkTargetFrameName : "Target Frame Name",
DlgLnkPopWinName : "Popup Window Name",
DlgLnkPopWinFeat : "Popup Window Features",
DlgLnkPopResize : "Resizable",
DlgLnkPopLocation : "Location Bar",
DlgLnkPopMenu : "Menu Bar",
DlgLnkPopScroll : "Scroll Bars",
DlgLnkPopStatus : "Status Bar",
DlgLnkPopToolbar : "Toolbar",
DlgLnkPopFullScrn : "Full Screen (IE)",
DlgLnkPopDependent : "Dependent (Netscape)",
DlgLnkPopWidth : "Width",
DlgLnkPopHeight : "Height",
DlgLnkPopLeft : "Left Position",
DlgLnkPopTop : "Top Position",
 
DlnLnkMsgNoUrl : "Please type the link URL",
DlnLnkMsgNoEMail : "Please type the e-mail address",
DlnLnkMsgNoAnchor : "Please select an anchor",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces",
 
// Color Dialog
DlgColorTitle : "Select Colour",
DlgColorBtnClear : "Clear",
DlgColorHighlight : "Highlight",
DlgColorSelected : "Selected",
 
// Smiley Dialog
DlgSmileyTitle : "Insert a Smiley",
 
// Special Character Dialog
DlgSpecialCharTitle : "Select Special Character",
 
// Table Dialog
DlgTableTitle : "Table Properties",
DlgTableRows : "Rows",
DlgTableColumns : "Columns",
DlgTableBorder : "Border size",
DlgTableAlign : "Alignment",
DlgTableAlignNotSet : "<Not set>",
DlgTableAlignLeft : "Left",
DlgTableAlignCenter : "Centre",
DlgTableAlignRight : "Right",
DlgTableWidth : "Width",
DlgTableWidthPx : "pixels",
DlgTableWidthPc : "percent",
DlgTableHeight : "Height",
DlgTableCellSpace : "Cell spacing",
DlgTableCellPad : "Cell padding",
DlgTableCaption : "Caption",
DlgTableSummary : "Summary",
 
// Table Cell Dialog
DlgCellTitle : "Cell Properties",
DlgCellWidth : "Width",
DlgCellWidthPx : "pixels",
DlgCellWidthPc : "percent",
DlgCellHeight : "Height",
DlgCellWordWrap : "Word Wrap",
DlgCellWordWrapNotSet : "<Not set>",
DlgCellWordWrapYes : "Yes",
DlgCellWordWrapNo : "No",
DlgCellHorAlign : "Horizontal Alignment",
DlgCellHorAlignNotSet : "<Not set>",
DlgCellHorAlignLeft : "Left",
DlgCellHorAlignCenter : "Centre",
DlgCellHorAlignRight: "Right",
DlgCellVerAlign : "Vertical Alignment",
DlgCellVerAlignNotSet : "<Not set>",
DlgCellVerAlignTop : "Top",
DlgCellVerAlignMiddle : "Middle",
DlgCellVerAlignBottom : "Bottom",
DlgCellVerAlignBaseline : "Baseline",
DlgCellRowSpan : "Rows Span",
DlgCellCollSpan : "Columns Span",
DlgCellBackColor : "Background Colour",
DlgCellBorderColor : "Border Colour",
DlgCellBtnSelect : "Select...",
 
// Find Dialog
DlgFindTitle : "Find",
DlgFindFindBtn : "Find",
DlgFindNotFoundMsg : "The specified text was not found.",
 
// Replace Dialog
DlgReplaceTitle : "Replace",
DlgReplaceFindLbl : "Find what:",
DlgReplaceReplaceLbl : "Replace with:",
DlgReplaceCaseChk : "Match case",
DlgReplaceReplaceBtn : "Replace",
DlgReplaceReplAllBtn : "Replace All",
DlgReplaceWordChk : "Match whole word",
 
// Paste Operations / Dialog
PasteErrorPaste : "Your browser security settings don't permit the editor to automatically execute pasting operations. Please use the keyboard for that (Ctrl+V).",
PasteErrorCut : "Your browser security settings don't permit the editor to automatically execute cutting operations. Please use the keyboard for that (Ctrl+X).",
PasteErrorCopy : "Your browser security settings don't permit the editor to automatically execute copying operations. Please use the keyboard for that (Ctrl+C).",
 
PasteAsText : "Paste as Plain Text",
PasteFromWord : "Paste from Word",
 
DlgPasteMsg2 : "Please paste inside the following box using the keyboard (<STRONG>Ctrl+V</STRONG>) and hit <STRONG>OK</STRONG>.",
DlgPasteIgnoreFont : "Ignore Font Face definitions",
DlgPasteRemoveStyles : "Remove Styles definitions",
DlgPasteCleanBox : "Clean Up Box",
 
// Color Picker
ColorAutomatic : "Automatic",
ColorMoreColors : "More Colours...",
 
// Document Properties
DocProps : "Document Properties",
 
// Anchor Dialog
DlgAnchorTitle : "Anchor Properties",
DlgAnchorName : "Anchor Name",
DlgAnchorErrorName : "Please type the anchor name",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Not in dictionary",
DlgSpellChangeTo : "Change to",
DlgSpellBtnIgnore : "Ignore",
DlgSpellBtnIgnoreAll : "Ignore All",
DlgSpellBtnReplace : "Replace",
DlgSpellBtnReplaceAll : "Replace All",
DlgSpellBtnUndo : "Undo",
DlgSpellNoSuggestions : "- No suggestions -",
DlgSpellProgress : "Spell check in progress...",
DlgSpellNoMispell : "Spell check complete: No misspellings found",
DlgSpellNoChanges : "Spell check complete: No words changed",
DlgSpellOneChange : "Spell check complete: One word changed",
DlgSpellManyChanges : "Spell check complete: %1 words changed",
 
IeSpellDownload : "Spell checker not installed. Do you want to download it now?",
 
// Button Dialog
DlgButtonText : "Text (Value)",
DlgButtonType : "Type",
DlgButtonTypeBtn : "Button",
DlgButtonTypeSbm : "Submit",
DlgButtonTypeRst : "Reset",
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Name",
DlgCheckboxValue : "Value",
DlgCheckboxSelected : "Selected",
 
// Form Dialog
DlgFormName : "Name",
DlgFormAction : "Action",
DlgFormMethod : "Method",
 
// Select Field Dialog
DlgSelectName : "Name",
DlgSelectValue : "Value",
DlgSelectSize : "Size",
DlgSelectLines : "lines",
DlgSelectChkMulti : "Allow multiple selections",
DlgSelectOpAvail : "Available Options",
DlgSelectOpText : "Text",
DlgSelectOpValue : "Value",
DlgSelectBtnAdd : "Add",
DlgSelectBtnModify : "Modify",
DlgSelectBtnUp : "Up",
DlgSelectBtnDown : "Down",
DlgSelectBtnSetValue : "Set as selected value",
DlgSelectBtnDelete : "Delete",
 
// Textarea Dialog
DlgTextareaName : "Name",
DlgTextareaCols : "Columns",
DlgTextareaRows : "Rows",
 
// Text Field Dialog
DlgTextName : "Name",
DlgTextValue : "Value",
DlgTextCharWidth : "Character Width",
DlgTextMaxChars : "Maximum Characters",
DlgTextType : "Type",
DlgTextTypeText : "Text",
DlgTextTypePass : "Password",
 
// Hidden Field Dialog
DlgHiddenName : "Name",
DlgHiddenValue : "Value",
 
// Bulleted List Dialog
BulletedListProp : "Bulleted List Properties",
NumberedListProp : "Numbered List Properties",
DlgLstStart : "Start",
DlgLstType : "Type",
DlgLstTypeCircle : "Circle",
DlgLstTypeDisc : "Disc",
DlgLstTypeSquare : "Square",
DlgLstTypeNumbers : "Numbers (1, 2, 3)",
DlgLstTypeLCase : "Lowercase Letters (a, b, c)",
DlgLstTypeUCase : "Uppercase Letters (A, B, C)",
DlgLstTypeSRoman : "Small Roman Numerals (i, ii, iii)",
DlgLstTypeLRoman : "Large Roman Numerals (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "General",
DlgDocBackTab : "Background",
DlgDocColorsTab : "Colours and Margins",
DlgDocMetaTab : "Meta Data",
 
DlgDocPageTitle : "Page Title",
DlgDocLangDir : "Language Direction",
DlgDocLangDirLTR : "Left to Right (LTR)",
DlgDocLangDirRTL : "Right to Left (RTL)",
DlgDocLangCode : "Language Code",
DlgDocCharSet : "Character Set Encoding",
DlgDocCharSetCE : "Central European",
DlgDocCharSetCT : "Chinese Traditional (Big5)",
DlgDocCharSetCR : "Cyrillic",
DlgDocCharSetGR : "Greek",
DlgDocCharSetJP : "Japanese",
DlgDocCharSetKR : "Korean",
DlgDocCharSetTR : "Turkish",
DlgDocCharSetUN : "Unicode (UTF-8)",
DlgDocCharSetWE : "Western European",
DlgDocCharSetOther : "Other Character Set Encoding",
 
DlgDocDocType : "Document Type Heading",
DlgDocDocTypeOther : "Other Document Type Heading",
DlgDocIncXHTML : "Include XHTML Declarations",
DlgDocBgColor : "Background Colour",
DlgDocBgImage : "Background Image URL",
DlgDocBgNoScroll : "Nonscrolling Background",
DlgDocCText : "Text",
DlgDocCLink : "Link",
DlgDocCVisited : "Visited Link",
DlgDocCActive : "Active Link",
DlgDocMargins : "Page Margins",
DlgDocMaTop : "Top",
DlgDocMaLeft : "Left",
DlgDocMaRight : "Right",
DlgDocMaBottom : "Bottom",
DlgDocMeIndex : "Document Indexing Keywords (comma separated)",
DlgDocMeDescr : "Document Description",
DlgDocMeAuthor : "Author",
DlgDocMeCopy : "Copyright",
DlgDocPreview : "Preview",
 
// Templates Dialog
Templates : "Templates",
DlgTemplatesTitle : "Content Templates",
DlgTemplatesSelMsg : "Please select the template to open in the editor<br>(the actual contents will be lost):",
DlgTemplatesLoading : "Loading templates list. Please wait...",
DlgTemplatesNoTpl : "(No templates defined)",
DlgTemplatesReplace : "Replace actual contents",
 
// About Dialog
DlgAboutAboutTab : "About",
DlgAboutBrowserInfoTab : "Browser Info",
DlgAboutLicenseTab : "License",
DlgAboutVersion : "version",
DlgAboutLicense : "Licensed under the terms of the GNU Lesser General Public License",
DlgAboutInfo : "For further information go to"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/ms.js
New file
0,0 → 1,501
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: ms.js
* Malay language file.
*
* File Authors:
* Fairul Izham Mohd Mokhlas (eg86@hotmail.com)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Collapse Toolbar",
ToolbarExpand : "Expand Toolbar",
 
// Toolbar Items and Context Menu
Save : "Simpan",
NewPage : "Helaian Baru",
Preview : "Prebiu",
Cut : "Potong",
Copy : "Salin",
Paste : "Tampal",
PasteText : "Tampal sebagai Text Biasa",
PasteWord : "Tampal dari Word",
Print : "Cetak",
SelectAll : "Pilih Semua",
RemoveFormat : "Buang Format",
InsertLinkLbl : "Sambungan",
InsertLink : "Masukkan/Sunting Sambungan",
RemoveLink : "Buang Sambungan",
Anchor : "Masukkan/Sunting Pautan",
InsertImageLbl : "Gambar",
InsertImage : "Masukkan/Sunting Gambar",
InsertFlashLbl : "Flash", //MISSING
InsertFlash : "Insert/Edit Flash", //MISSING
InsertTableLbl : "Jadual",
InsertTable : "Masukkan/Sunting Jadual",
InsertLineLbl : "Garisan",
InsertLine : "Masukkan Garisan Membujur",
InsertSpecialCharLbl: "Huruf Istimewa",
InsertSpecialChar : "Masukkan Huruf Istimewa",
InsertSmileyLbl : "Smiley",
InsertSmiley : "Masukkan Smiley",
About : "Tentang FCKeditor",
Bold : "Bold",
Italic : "Italic",
Underline : "Underline",
StrikeThrough : "Strike Through",
Subscript : "Subscript",
Superscript : "Superscript",
LeftJustify : "Jajaran Kiri",
CenterJustify : "Jajaran Tengah",
RightJustify : "Jajaran Kanan",
BlockJustify : "Jajaran Blok",
DecreaseIndent : "Kurangkan Inden",
IncreaseIndent : "Tambahkan Inden",
Undo : "Batalkan",
Redo : "Ulangkan",
NumberedListLbl : "Senarai bernombor",
NumberedList : "Masukkan/Sunting Senarai bernombor",
BulletedListLbl : "Senarai tidak bernombor",
BulletedList : "Masukkan/Sunting Senarai tidak bernombor",
ShowTableBorders : "Tunjukkan Border Jadual",
ShowDetails : "Tunjukkan Butiran",
Style : "Stail",
FontFormat : "Format",
Font : "Font",
FontSize : "Saiz",
TextColor : "Warna Text",
BGColor : "Warna Latarbelakang",
Source : "Sumber",
Find : "Cari",
Replace : "Ganti",
SpellCheck : "Semak Ejaan",
UniversalKeyboard : "Papan Kekunci Universal",
PageBreakLbl : "Page Break", //MISSING
PageBreak : "Insert Page Break", //MISSING
 
Form : "Borang",
Checkbox : "Checkbox",
RadioButton : "Butang Radio",
TextField : "Text Field",
Textarea : "Textarea",
HiddenField : "Field Tersembunyi",
Button : "Butang",
SelectionField : "Field Pilihan",
ImageButton : "Butang Bergambar",
 
FitWindow : "Maximize the editor size", //MISSING
 
// Context Menu
EditLink : "Sunting Sambungan",
CellCM : "Cell", //MISSING
RowCM : "Row", //MISSING
ColumnCM : "Column", //MISSING
InsertRow : "Masukkan Baris",
DeleteRows : "Buangkan Baris",
InsertColumn : "Masukkan Lajur",
DeleteColumns : "Buangkan Lajur",
InsertCell : "Masukkan Sel",
DeleteCells : "Buangkan Sel-sel",
MergeCells : "Cantumkan Sel-sel",
SplitCell : "Bahagikan Sel",
TableDelete : "Delete Table", //MISSING
CellProperties : "Ciri-ciri Sel",
TableProperties : "Ciri-ciri Jadual",
ImageProperties : "Ciri-ciri Gambar",
FlashProperties : "Flash Properties", //MISSING
 
AnchorProp : "Ciri-ciri Pautan",
ButtonProp : "Ciri-ciri Butang",
CheckboxProp : "Ciri-ciri Checkbox",
HiddenFieldProp : "Ciri-ciri Field Tersembunyi",
RadioButtonProp : "Ciri-ciri Butang Radio",
ImageButtonProp : "Ciri-ciri Butang Bergambar",
TextFieldProp : "Ciri-ciri Text Field",
SelectionFieldProp : "Ciri-ciri Selection Field",
TextareaProp : "Ciri-ciri Textarea",
FormProp : "Ciri-ciri Borang",
 
FontFormats : "Normal;Telah Diformat;Alamat;Heading 1;Heading 2;Heading 3;Heading 4;Heading 5;Heading 6;Perenggan (DIV)",
 
// Alerts and Messages
ProcessingXHTML : "Memproses XHTML. Sila tunggu...",
Done : "Siap",
PasteWordConfirm : "Text yang anda hendak tampal adalah berasal dari Word. Adakah anda mahu membuang semua format Word sebelum tampal ke dalam text?",
NotCompatiblePaste : "Arahan ini bole dilakukan jika anda mempuunyai Internet Explorer version 5.5 atau yang lebih tinggi. Adakah anda hendak tampal text tanpa membuang format Word?",
UnknownToolbarItem : "Toolbar item tidak diketahui\"%1\"",
UnknownCommand : "Arahan tidak diketahui \"%1\"",
NotImplemented : "Arahan tidak terdapat didalam sistem",
UnknownToolbarSet : "Set toolbar \"%1\" tidak wujud",
NoActiveX : "Your browser's security settings could limit some features of the editor. You must enable the option \"Run ActiveX controls and plug-ins\". You may experience errors and notice missing features.", //MISSING
BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.", //MISSING
DialogBlocked : "It was not possible to open the dialog window. Make sure all popup blockers are disabled.", //MISSING
 
// Dialogs
DlgBtnOK : "OK",
DlgBtnCancel : "Batal",
DlgBtnClose : "Tutup",
DlgBtnBrowseServer : "Browse Server",
DlgAdvancedTag : "Advanced",
DlgOpOther : "<Lain-lain>",
DlgInfoTab : "Info", //MISSING
DlgAlertUrl : "Please insert the URL", //MISSING
 
// General Dialogs Labels
DlgGenNotSet : "<tidak di set>",
DlgGenId : "Id",
DlgGenLangDir : "Arah Tulisan",
DlgGenLangDirLtr : "Kiri ke Kanan (LTR)",
DlgGenLangDirRtl : "Kanan ke Kiri (RTL)",
DlgGenLangCode : "Kod Bahasa",
DlgGenAccessKey : "Kunci Akses",
DlgGenName : "Nama",
DlgGenTabIndex : "Indeks Tab ",
DlgGenLongDescr : "Butiran Panjang URL",
DlgGenClass : "Kelas-kelas Stylesheet",
DlgGenTitle : "Tajuk Makluman",
DlgGenContType : "Jenis Kandungan Makluman",
DlgGenLinkCharset : "Linked Resource Charset",
DlgGenStyle : "Stail",
 
// Image Dialog
DlgImgTitle : "Ciri-ciri Imej",
DlgImgInfoTab : "Info Imej",
DlgImgBtnUpload : "Hantar ke Server",
DlgImgURL : "URL",
DlgImgUpload : "Muat Naik",
DlgImgAlt : "Text Alternatif",
DlgImgWidth : "Lebar",
DlgImgHeight : "Tinggi",
DlgImgLockRatio : "Tetapkan Nisbah",
DlgBtnResetSize : "Saiz Set Semula",
DlgImgBorder : "Border",
DlgImgHSpace : "Ruang Melintang",
DlgImgVSpace : "Ruang Menegak",
DlgImgAlign : "Jajaran",
DlgImgAlignLeft : "Kiri",
DlgImgAlignAbsBottom: "Bawah Mutlak",
DlgImgAlignAbsMiddle: "Pertengahan Mutlak",
DlgImgAlignBaseline : "Garis Dasar",
DlgImgAlignBottom : "Bawah",
DlgImgAlignMiddle : "Pertengahan",
DlgImgAlignRight : "Kanan",
DlgImgAlignTextTop : "Atas Text",
DlgImgAlignTop : "Atas",
DlgImgPreview : "Prebiu",
DlgImgAlertUrl : "Sila taip URL untuk fail gambar",
DlgImgLinkTab : "Sambungan",
 
// Flash Dialog
DlgFlashTitle : "Flash Properties", //MISSING
DlgFlashChkPlay : "Auto Play", //MISSING
DlgFlashChkLoop : "Loop", //MISSING
DlgFlashChkMenu : "Enable Flash Menu", //MISSING
DlgFlashScale : "Scale", //MISSING
DlgFlashScaleAll : "Show all", //MISSING
DlgFlashScaleNoBorder : "No Border", //MISSING
DlgFlashScaleFit : "Exact Fit", //MISSING
 
// Link Dialog
DlgLnkWindowTitle : "Sambungan",
DlgLnkInfoTab : "Butiran Sambungan",
DlgLnkTargetTab : "Sasaran",
 
DlgLnkType : "Jenis Sambungan",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Pautan dalam muka surat ini",
DlgLnkTypeEMail : "E-Mail",
DlgLnkProto : "Protokol",
DlgLnkProtoOther : "<lain-lain>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Sila pilih pautan",
DlgLnkAnchorByName : "dengan menggunakan nama pautan",
DlgLnkAnchorById : "dengan menggunakan ID elemen",
DlgLnkNoAnchors : "<Tiada pautan terdapat dalam dokumen ini>",
DlgLnkEMail : "Alamat E-Mail",
DlgLnkEMailSubject : "Subjek Mesej",
DlgLnkEMailBody : "Isi Kandungan Mesej",
DlgLnkUpload : "Muat Naik",
DlgLnkBtnUpload : "Hantar ke Server",
 
DlgLnkTarget : "Sasaran",
DlgLnkTargetFrame : "<bingkai>",
DlgLnkTargetPopup : "<tetingkap popup>",
DlgLnkTargetBlank : "Tetingkap Baru (_blank)",
DlgLnkTargetParent : "Tetingkap Parent (_parent)",
DlgLnkTargetSelf : "Tetingkap yang Sama (_self)",
DlgLnkTargetTop : "Tetingkap yang paling atas (_top)",
DlgLnkTargetFrameName : "Nama Bingkai Sasaran",
DlgLnkPopWinName : "Nama Tetingkap Popup",
DlgLnkPopWinFeat : "Ciri Tetingkap Popup",
DlgLnkPopResize : "Saiz bolehubah",
DlgLnkPopLocation : "Bar Lokasi",
DlgLnkPopMenu : "Bar Menu",
DlgLnkPopScroll : "Bar-bar skrol",
DlgLnkPopStatus : "Bar Status",
DlgLnkPopToolbar : "Toolbar",
DlgLnkPopFullScrn : "Skrin Penuh (IE)",
DlgLnkPopDependent : "Bergantungan (Netscape)",
DlgLnkPopWidth : "Lebar",
DlgLnkPopHeight : "Tinggi",
DlgLnkPopLeft : "Posisi Kiri",
DlgLnkPopTop : "Posisi Atas",
 
DlnLnkMsgNoUrl : "Sila taip sambungan URL",
DlnLnkMsgNoEMail : "Sila taip alamat e-mail",
DlnLnkMsgNoAnchor : "Sila pilih pautan berkenaaan",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "Pilihan Warna",
DlgColorBtnClear : "Nyahwarna",
DlgColorHighlight : "Terang",
DlgColorSelected : "Dipilih",
 
// Smiley Dialog
DlgSmileyTitle : "Masukkan Smiley",
 
// Special Character Dialog
DlgSpecialCharTitle : "Sila pilih huruf istimewa",
 
// Table Dialog
DlgTableTitle : "Ciri-ciri Jadual",
DlgTableRows : "Barisan",
DlgTableColumns : "Jaluran",
DlgTableBorder : "Saiz Border",
DlgTableAlign : "Penjajaran",
DlgTableAlignNotSet : "<Tidak diset>",
DlgTableAlignLeft : "Kiri",
DlgTableAlignCenter : "Tengah",
DlgTableAlignRight : "Kanan",
DlgTableWidth : "Lebar",
DlgTableWidthPx : "piksel-piksel",
DlgTableWidthPc : "peratus",
DlgTableHeight : "Tinggi",
DlgTableCellSpace : "Ruangan Antara Sel",
DlgTableCellPad : "Tambahan Ruang Sel",
DlgTableCaption : "Keterangan",
DlgTableSummary : "Summary", //MISSING
 
// Table Cell Dialog
DlgCellTitle : "Ciri-ciri Sel",
DlgCellWidth : "Lebar",
DlgCellWidthPx : "piksel-piksel",
DlgCellWidthPc : "peratus",
DlgCellHeight : "Tinggi",
DlgCellWordWrap : "Mengulung Perkataan",
DlgCellWordWrapNotSet : "<Tidak diset>",
DlgCellWordWrapYes : "Ya",
DlgCellWordWrapNo : "Tidak",
DlgCellHorAlign : "Jajaran Membujur",
DlgCellHorAlignNotSet : "<Tidak diset>",
DlgCellHorAlignLeft : "Kiri",
DlgCellHorAlignCenter : "Tengah",
DlgCellHorAlignRight: "Kanan",
DlgCellVerAlign : "Jajaran Menegak",
DlgCellVerAlignNotSet : "<Tidak diset>",
DlgCellVerAlignTop : "Atas",
DlgCellVerAlignMiddle : "Tengah",
DlgCellVerAlignBottom : "Bawah",
DlgCellVerAlignBaseline : "Garis Dasar",
DlgCellRowSpan : "Penggunaan Baris",
DlgCellCollSpan : "Penggunaan Lajur",
DlgCellBackColor : "Warna Latarbelakang",
DlgCellBorderColor : "Warna Border",
DlgCellBtnSelect : "Pilih...",
 
// Find Dialog
DlgFindTitle : "Carian",
DlgFindFindBtn : "Cari",
DlgFindNotFoundMsg : "Text yang dicari tidak dijumpai.",
 
// Replace Dialog
DlgReplaceTitle : "Gantian",
DlgReplaceFindLbl : "Perkataan yang dicari:",
DlgReplaceReplaceLbl : "Diganti dengan:",
DlgReplaceCaseChk : "Padanan case huruf",
DlgReplaceReplaceBtn : "Ganti",
DlgReplaceReplAllBtn : "Ganti semua",
DlgReplaceWordChk : "Padana Keseluruhan perkataan",
 
// Paste Operations / Dialog
PasteErrorPaste : "Keselamatan perisian browser anda tidak membenarkan operasi tampalan text/imej. Sila gunakan papan kekunci (Ctrl+V).",
PasteErrorCut : "Keselamatan perisian browser anda tidak membenarkan operasi suntingan text/imej. Sila gunakan papan kekunci (Ctrl+X).",
PasteErrorCopy : "Keselamatan perisian browser anda tidak membenarkan operasi salinan text/imej. Sila gunakan papan kekunci (Ctrl+C).",
 
PasteAsText : "Tampal sebagai text biasa",
PasteFromWord : "Tampal dari perisian \"Word\"",
 
DlgPasteMsg2 : "Please paste inside the following box using the keyboard (<STRONG>Ctrl+V</STRONG>) and hit <STRONG>OK</STRONG>.", //MISSING
DlgPasteIgnoreFont : "Ignore Font Face definitions", //MISSING
DlgPasteRemoveStyles : "Remove Styles definitions", //MISSING
DlgPasteCleanBox : "Clean Up Box", //MISSING
 
// Color Picker
ColorAutomatic : "Otomatik",
ColorMoreColors : "Warna lain-lain...",
 
// Document Properties
DocProps : "Ciri-ciri dokumen",
 
// Anchor Dialog
DlgAnchorTitle : "Ciri-ciri Pautan",
DlgAnchorName : "Nama Pautan",
DlgAnchorErrorName : "Sila taip nama pautan",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Tidak terdapat didalam kamus",
DlgSpellChangeTo : "Tukarkan kepada",
DlgSpellBtnIgnore : "Biar",
DlgSpellBtnIgnoreAll : "Biarkan semua",
DlgSpellBtnReplace : "Ganti",
DlgSpellBtnReplaceAll : "Gantikan Semua",
DlgSpellBtnUndo : "Batalkan",
DlgSpellNoSuggestions : "- Tiada cadangan -",
DlgSpellProgress : "Pemeriksaan ejaan sedang diproses...",
DlgSpellNoMispell : "Pemeriksaan ejaan siap: Tiada salah ejaan",
DlgSpellNoChanges : "Pemeriksaan ejaan siap: Tiada perkataan diubah",
DlgSpellOneChange : "Pemeriksaan ejaan siap: Satu perkataan telah diubah",
DlgSpellManyChanges : "Pemeriksaan ejaan siap: %1 perkataan diubah",
 
IeSpellDownload : "Pemeriksa ejaan tidak dipasang. Adakah anda mahu muat turun sekarang?",
 
// Button Dialog
DlgButtonText : "Teks (Nilai)",
DlgButtonType : "Jenis",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Nama",
DlgCheckboxValue : "Nilai",
DlgCheckboxSelected : "Dipilih",
 
// Form Dialog
DlgFormName : "Nama",
DlgFormAction : "Tindakan borang",
DlgFormMethod : "Cara borang dihantar",
 
// Select Field Dialog
DlgSelectName : "Nama",
DlgSelectValue : "Nilai",
DlgSelectSize : "Saiz",
DlgSelectLines : "garisan",
DlgSelectChkMulti : "Benarkan pilihan pelbagai",
DlgSelectOpAvail : "Pilihan sediada",
DlgSelectOpText : "Teks",
DlgSelectOpValue : "Nilai",
DlgSelectBtnAdd : "Tambah Pilihan",
DlgSelectBtnModify : "Ubah Pilihan",
DlgSelectBtnUp : "Naik ke atas",
DlgSelectBtnDown : "Turun ke bawah",
DlgSelectBtnSetValue : "Set sebagai nilai terpilih",
DlgSelectBtnDelete : "Padam",
 
// Textarea Dialog
DlgTextareaName : "Nama",
DlgTextareaCols : "Lajur",
DlgTextareaRows : "Baris",
 
// Text Field Dialog
DlgTextName : "Nama",
DlgTextValue : "Nilai",
DlgTextCharWidth : "Lebar isian",
DlgTextMaxChars : "Isian Maksimum",
DlgTextType : "Jenis",
DlgTextTypeText : "Teks",
DlgTextTypePass : "Kata Laluan",
 
// Hidden Field Dialog
DlgHiddenName : "Nama",
DlgHiddenValue : "Nilai",
 
// Bulleted List Dialog
BulletedListProp : "Ciri-ciri senarai berpeluru",
NumberedListProp : "Ciri-ciri senarai bernombor",
DlgLstStart : "Start", //MISSING
DlgLstType : "Jenis",
DlgLstTypeCircle : "Circle",
DlgLstTypeDisc : "Disc", //MISSING
DlgLstTypeSquare : "Square",
DlgLstTypeNumbers : "Nombor-nombor (1, 2, 3)",
DlgLstTypeLCase : "Huruf-huruf kecil (a, b, c)",
DlgLstTypeUCase : "Huruf-huruf besar (A, B, C)",
DlgLstTypeSRoman : "Nombor Roman Kecil (i, ii, iii)",
DlgLstTypeLRoman : "Nombor Roman Besar (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "Umum",
DlgDocBackTab : "Latarbelakang",
DlgDocColorsTab : "Warna dan margin",
DlgDocMetaTab : "Data Meta",
 
DlgDocPageTitle : "Tajuk Muka Surat",
DlgDocLangDir : "Arah Tulisan",
DlgDocLangDirLTR : "Kiri ke Kanan (LTR)",
DlgDocLangDirRTL : "Kanan ke Kiri (RTL)",
DlgDocLangCode : "Kod Bahasa",
DlgDocCharSet : "Enkod Set Huruf",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "Enkod Set Huruf yang Lain",
 
DlgDocDocType : "Jenis Kepala Dokumen",
DlgDocDocTypeOther : "Jenis Kepala Dokumen yang Lain",
DlgDocIncXHTML : "Masukkan pemula kod XHTML",
DlgDocBgColor : "Warna Latarbelakang",
DlgDocBgImage : "URL Gambar Latarbelakang",
DlgDocBgNoScroll : "Imej Latarbelakang tanpa Skrol",
DlgDocCText : "Teks",
DlgDocCLink : "Sambungan",
DlgDocCVisited : "Sambungan telah Dilawati",
DlgDocCActive : "Sambungan Aktif",
DlgDocMargins : "Margin Muka Surat",
DlgDocMaTop : "Atas",
DlgDocMaLeft : "Kiri",
DlgDocMaRight : "Kanan",
DlgDocMaBottom : "Bawah",
DlgDocMeIndex : "Kata Kunci Indeks Dokumen (dipisahkan oleh koma)",
DlgDocMeDescr : "Keterangan Dokumen",
DlgDocMeAuthor : "Penulis",
DlgDocMeCopy : "Hakcipta",
DlgDocPreview : "Prebiu",
 
// Templates Dialog
Templates : "Templat",
DlgTemplatesTitle : "Templat Kandungan",
DlgTemplatesSelMsg : "Sila pilih templat untuk dibuka oleh editor<br>(kandungan sebenar akan hilang):",
DlgTemplatesLoading : "Senarai Templat sedang diproses. Sila Tunggu...",
DlgTemplatesNoTpl : "(Tiada Templat Disimpan)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "Tentang",
DlgAboutBrowserInfoTab : "Maklumat Perisian Browser",
DlgAboutLicenseTab : "License", //MISSING
DlgAboutVersion : "versi",
DlgAboutLicense : "Perlesenan dibawah terma GNU Lesser General Public License",
DlgAboutInfo : "Untuk maklumat lanjut sila pergi ke"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/uk.js
New file
0,0 → 1,501
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: uk.js
* Ukrainian language file.
*
* File Authors:
* Alexander Pervak (pervak@gmail.com)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Згорнути панель інструментів",
ToolbarExpand : "Розгорнути панель інструментів",
 
// Toolbar Items and Context Menu
Save : "Зберегти",
NewPage : "Нова сторінка",
Preview : "Попередній перегляд",
Cut : "Вирізати",
Copy : "Копіювати",
Paste : "Вставити",
PasteText : "Вставити тільки текст",
PasteWord : "Вставити з Word",
Print : "Друк",
SelectAll : "Виділити все",
RemoveFormat : "Прибрати форматування",
InsertLinkLbl : "Посилання",
InsertLink : "Вставити/Редагувати посилання",
RemoveLink : "Знищити посилання",
Anchor : "Вставити/Редагувати якір",
InsertImageLbl : "Зображення",
InsertImage : "Вставити/Редагувати зображення",
InsertFlashLbl : "Flash",
InsertFlash : "Вставити/Редагувати Flash",
InsertTableLbl : "Таблиця",
InsertTable : "Вставити/Редагувати таблицю",
InsertLineLbl : "Лінія",
InsertLine : "Вставити горизонтальну лінію",
InsertSpecialCharLbl: "Спеціальний символ",
InsertSpecialChar : "Вставити спеціальний символ",
InsertSmileyLbl : "Смайлик",
InsertSmiley : "Вставити смайлик",
About : "Про FCKeditor",
Bold : "Жирний",
Italic : "Курсив",
Underline : "Підкреслений",
StrikeThrough : "Закреслений",
Subscript : "Підрядковий індекс",
Superscript : "Надрядковий индекс",
LeftJustify : "По лівому краю",
CenterJustify : "По центру",
RightJustify : "По правому краю",
BlockJustify : "По ширині",
DecreaseIndent : "Зменшити відступ",
IncreaseIndent : "Збільшити відступ",
Undo : "Повернути",
Redo : "Повторити",
NumberedListLbl : "Нумерований список",
NumberedList : "Вставити/Видалити нумерований список",
BulletedListLbl : "Маркований список",
BulletedList : "Вставити/Видалити маркований список",
ShowTableBorders : "Показати бордюри таблиці",
ShowDetails : "Показати деталі",
Style : "Стиль",
FontFormat : "Форматування",
Font : "Шрифт",
FontSize : "Розмір",
TextColor : "Колір тексту",
BGColor : "Колір фону",
Source : "Джерело",
Find : "Пошук",
Replace : "Заміна",
SpellCheck : "Перевірити орфографію",
UniversalKeyboard : "Універсальна клавіатура",
PageBreakLbl : "Page Break", //MISSING
PageBreak : "Insert Page Break", //MISSING
 
Form : "Форма",
Checkbox : "Флагова кнопка",
RadioButton : "Кнопка вибору",
TextField : "Текстове поле",
Textarea : "Текстова область",
HiddenField : "Приховане поле",
Button : "Кнопка",
SelectionField : "Список",
ImageButton : "Кнопка із зображенням",
 
FitWindow : "Maximize the editor size", //MISSING
 
// Context Menu
EditLink : "Вставити посилання",
CellCM : "Cell", //MISSING
RowCM : "Row", //MISSING
ColumnCM : "Column", //MISSING
InsertRow : "Вставити строку",
DeleteRows : "Видалити строки",
InsertColumn : "Вставити колонку",
DeleteColumns : "Видалити колонки",
InsertCell : "Вставити комірку",
DeleteCells : "Видалити комірки",
MergeCells : "Об'єднати комірки",
SplitCell : "Роз'єднати комірку",
TableDelete : "Delete Table", //MISSING
CellProperties : "Властивості комірки",
TableProperties : "Властивості таблиці",
ImageProperties : "Властивості зображення",
FlashProperties : "Властивості Flash",
 
AnchorProp : "Властивості якоря",
ButtonProp : "Властивості кнопки",
CheckboxProp : "Властивості флагової кнопки",
HiddenFieldProp : "Властивості прихованого поля",
RadioButtonProp : "Властивості кнопки вибору",
ImageButtonProp : "Властивості кнопки із зображенням",
TextFieldProp : "Властивості текстового поля",
SelectionFieldProp : "Властивості списку",
TextareaProp : "Властивості текстової області",
FormProp : "Властивості форми",
 
FontFormats : "Нормальний;Форматований;Адреса;Заголовок 1;Заголовок 2;Заголовок 3;Заголовок 4;Заголовок 5;Заголовок 6",
 
// Alerts and Messages
ProcessingXHTML : "Обробка XHTML. Зачекайте, будь ласка...",
Done : "Зроблено",
PasteWordConfirm : "Текст, що ви хочете вставити, схожий на копійований з Word. Ви хочете очистити його перед вставкою?",
NotCompatiblePaste : "Ця команда доступна для Internet Explorer версії 5.5 або вище. Ви хочете вставити без очищення?",
UnknownToolbarItem : "Невідомий елемент панелі інструментів \"%1\"",
UnknownCommand : "Невідоме ім'я команди \"%1\"",
NotImplemented : "Команда не реалізована",
UnknownToolbarSet : "Панель інструментів \"%1\" не існує",
NoActiveX : "Your browser's security settings could limit some features of the editor. You must enable the option \"Run ActiveX controls and plug-ins\". You may experience errors and notice missing features.", //MISSING
BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.", //MISSING
DialogBlocked : "It was not possible to open the dialog window. Make sure all popup blockers are disabled.", //MISSING
 
// Dialogs
DlgBtnOK : "ОК",
DlgBtnCancel : "Скасувати",
DlgBtnClose : "Зачинити",
DlgBtnBrowseServer : "Передивитися на сервері",
DlgAdvancedTag : "Розширений",
DlgOpOther : "<Інше>",
DlgInfoTab : "Інфо",
DlgAlertUrl : "Вставте, будь-ласка, URL",
 
// General Dialogs Labels
DlgGenNotSet : "<не визначено>",
DlgGenId : "Ідентифікатор",
DlgGenLangDir : "Напрямок мови",
DlgGenLangDirLtr : "Зліва на право (LTR)",
DlgGenLangDirRtl : "Зправа на ліво (RTL)",
DlgGenLangCode : "Мова",
DlgGenAccessKey : "Гаряча клавіша",
DlgGenName : "Им'я",
DlgGenTabIndex : "Послідовність переходу",
DlgGenLongDescr : "Довгий опис URL",
DlgGenClass : "Клас CSS",
DlgGenTitle : "Заголовок",
DlgGenContType : "Тип вмісту",
DlgGenLinkCharset : "Кодировка",
DlgGenStyle : "Стиль CSS",
 
// Image Dialog
DlgImgTitle : "Властивості зображення",
DlgImgInfoTab : "Інформація про изображении",
DlgImgBtnUpload : "Надіслати на сервер",
DlgImgURL : "URL",
DlgImgUpload : "Закачати",
DlgImgAlt : "Альтернативний текст",
DlgImgWidth : "Ширина",
DlgImgHeight : "Висота",
DlgImgLockRatio : "Зберегти пропорції",
DlgBtnResetSize : "Скинути розмір",
DlgImgBorder : "Бордюр",
DlgImgHSpace : "Горизонтальний відступ",
DlgImgVSpace : "Вертикальний відступ",
DlgImgAlign : "Вирівнювання",
DlgImgAlignLeft : "По лівому краю",
DlgImgAlignAbsBottom: "Абс по низу",
DlgImgAlignAbsMiddle: "Абс по середині",
DlgImgAlignBaseline : "По базовій лінії",
DlgImgAlignBottom : "По низу",
DlgImgAlignMiddle : "По середині",
DlgImgAlignRight : "По правому краю",
DlgImgAlignTextTop : "Текст на верху",
DlgImgAlignTop : "По верху",
DlgImgPreview : "Попередній перегляд",
DlgImgAlertUrl : "Будь ласка, введіть URL зображення",
DlgImgLinkTab : "Посилання",
 
// Flash Dialog
DlgFlashTitle : "Властивості Flash",
DlgFlashChkPlay : "Авто програвання",
DlgFlashChkLoop : "Зациклити",
DlgFlashChkMenu : "Дозволити меню Flash",
DlgFlashScale : "Масштаб",
DlgFlashScaleAll : "Показати всі",
DlgFlashScaleNoBorder : "Без рамки",
DlgFlashScaleFit : "Дійсний розмір",
 
// Link Dialog
DlgLnkWindowTitle : "Посилання",
DlgLnkInfoTab : "Інформація посилання",
DlgLnkTargetTab : "Ціль",
 
DlgLnkType : "Тип посилання",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Якір на цю сторінку",
DlgLnkTypeEMail : "Эл. пошта",
DlgLnkProto : "Протокол",
DlgLnkProtoOther : "<інше>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Оберіть якір",
DlgLnkAnchorByName : "За ім'ям якоря",
DlgLnkAnchorById : "За ідентифікатором елемента",
DlgLnkNoAnchors : "<Немає якорів доступних в цьому документі>",
DlgLnkEMail : "Адреса ел. пошти",
DlgLnkEMailSubject : "Тема листа",
DlgLnkEMailBody : "Тіло повідомлення",
DlgLnkUpload : "Закачати",
DlgLnkBtnUpload : "Переслати на сервер",
 
DlgLnkTarget : "Ціль",
DlgLnkTargetFrame : "<фрейм>",
DlgLnkTargetPopup : "<спливаюче вікно>",
DlgLnkTargetBlank : "Нове вікно (_blank)",
DlgLnkTargetParent : "Батьківське вікно (_parent)",
DlgLnkTargetSelf : "Теж вікно (_self)",
DlgLnkTargetTop : "Найвище вікно (_top)",
DlgLnkTargetFrameName : "Ім'я целевого фрейма",
DlgLnkPopWinName : "Ім'я спливаючого вікна",
DlgLnkPopWinFeat : "Властивості спливаючого вікна",
DlgLnkPopResize : "Змінюється в розмірах",
DlgLnkPopLocation : "Панель локації",
DlgLnkPopMenu : "Панель меню",
DlgLnkPopScroll : "Полоси прокрутки",
DlgLnkPopStatus : "Строка статусу",
DlgLnkPopToolbar : "Панель інструментів",
DlgLnkPopFullScrn : "Повний екран (IE)",
DlgLnkPopDependent : "Залежний (Netscape)",
DlgLnkPopWidth : "Ширина",
DlgLnkPopHeight : "Висота",
DlgLnkPopLeft : "Позиція зліва",
DlgLnkPopTop : "Позиція зверху",
 
DlnLnkMsgNoUrl : "Будь ласка, занесіть URL посилання",
DlnLnkMsgNoEMail : "Будь ласка, занесіть адрес эл. почты",
DlnLnkMsgNoAnchor : "Будь ласка, оберіть якір",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "Оберіть колір",
DlgColorBtnClear : "Очистити",
DlgColorHighlight : "Підсвічений",
DlgColorSelected : "Обраний",
 
// Smiley Dialog
DlgSmileyTitle : "Вставити смайлик",
 
// Special Character Dialog
DlgSpecialCharTitle : "Оберіть спеціальний символ",
 
// Table Dialog
DlgTableTitle : "Властивості таблиці",
DlgTableRows : "Строки",
DlgTableColumns : "Колонки",
DlgTableBorder : "Розмір бордюра",
DlgTableAlign : "Вирівнювання",
DlgTableAlignNotSet : "<Не вст.>",
DlgTableAlignLeft : "Зліва",
DlgTableAlignCenter : "По центру",
DlgTableAlignRight : "Зправа",
DlgTableWidth : "Ширина",
DlgTableWidthPx : "пікселів",
DlgTableWidthPc : "відсотків",
DlgTableHeight : "Висота",
DlgTableCellSpace : "Проміжок (spacing)",
DlgTableCellPad : "Відступ (padding)",
DlgTableCaption : "Заголовок (Caption)",
DlgTableSummary : "Summary", //MISSING
 
// Table Cell Dialog
DlgCellTitle : "Властивості комірки",
DlgCellWidth : "Ширина",
DlgCellWidthPx : "пікселів",
DlgCellWidthPc : "відсотків",
DlgCellHeight : "Висота",
DlgCellWordWrap : "Згортання текста",
DlgCellWordWrapNotSet : "<Не вст.>",
DlgCellWordWrapYes : "Так",
DlgCellWordWrapNo : "Ні",
DlgCellHorAlign : "Горизонтальне вирівнювання",
DlgCellHorAlignNotSet : "<Не вст.>",
DlgCellHorAlignLeft : "Зліва",
DlgCellHorAlignCenter : "По центру",
DlgCellHorAlignRight: "Зправа",
DlgCellVerAlign : "Вертикальное вирівнювання",
DlgCellVerAlignNotSet : "<Не вст.>",
DlgCellVerAlignTop : "Зверху",
DlgCellVerAlignMiddle : "Посередині",
DlgCellVerAlignBottom : "Знизу",
DlgCellVerAlignBaseline : "По базовій лінії",
DlgCellRowSpan : "Діапазон строк (span)",
DlgCellCollSpan : "Діапазон колонок (span)",
DlgCellBackColor : "Колір фона",
DlgCellBorderColor : "Колір бордюра",
DlgCellBtnSelect : "Оберіть...",
 
// Find Dialog
DlgFindTitle : "Пошук",
DlgFindFindBtn : "Пошук",
DlgFindNotFoundMsg : "Вказаний текст не знайдений.",
 
// Replace Dialog
DlgReplaceTitle : "Замінити",
DlgReplaceFindLbl : "Шукати:",
DlgReplaceReplaceLbl : "Замінити на:",
DlgReplaceCaseChk : "Учитывать регистр",
DlgReplaceReplaceBtn : "Замінити",
DlgReplaceReplAllBtn : "Замінити все",
DlgReplaceWordChk : "Збіг цілих слів",
 
// Paste Operations / Dialog
PasteErrorPaste : "Настройки безпеки вашого браузера не дозволяють редактору автоматично виконувати операції вставки. Будь ласка, використовуйте клавіатуру для цього (Ctrl+V).",
PasteErrorCut : "Настройки безпеки вашого браузера не дозволяють редактору автоматично виконувати операції вирізування. Будь ласка, використовуйте клавіатуру для цього (Ctrl+X).",
PasteErrorCopy : "Настройки безпеки вашого браузера не дозволяють редактору автоматично виконувати операції копіювання. Будь ласка, використовуйте клавіатуру для цього (Ctrl+C).",
 
PasteAsText : "Вставити тільки текст",
PasteFromWord : "Вставити з Word",
 
DlgPasteMsg2 : "Будь-ласка, вставте з буфера обміну в цю область, користуючись комбінацією клавіш (<STRONG>Ctrl+V</STRONG>) та натисніть <STRONG>OK</STRONG>.",
DlgPasteIgnoreFont : "Ігнорувати налаштування шрифтів",
DlgPasteRemoveStyles : "Видалити налаштування стилів",
DlgPasteCleanBox : "Очистити область",
 
// Color Picker
ColorAutomatic : "Автоматичний",
ColorMoreColors : "Кольори...",
 
// Document Properties
DocProps : "Властивості документа",
 
// Anchor Dialog
DlgAnchorTitle : "Властивості якоря",
DlgAnchorName : "Ім'я якоря",
DlgAnchorErrorName : "Будь ласка, занесіть ім'я якоря",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Не має в словнику",
DlgSpellChangeTo : "Замінити на",
DlgSpellBtnIgnore : "Ігнорувати",
DlgSpellBtnIgnoreAll : "Ігнорувати все",
DlgSpellBtnReplace : "Замінити",
DlgSpellBtnReplaceAll : "Замінити все",
DlgSpellBtnUndo : "Назад",
DlgSpellNoSuggestions : "- Немає припущень -",
DlgSpellProgress : "Виконується перевірка орфографії...",
DlgSpellNoMispell : "Перевірку орфографії завершено: помилок не знайдено",
DlgSpellNoChanges : "Перевірку орфографії завершено: жодне слово не змінено",
DlgSpellOneChange : "Перевірку орфографії завершено: змінено одно слово",
DlgSpellManyChanges : "Перевірку орфографії завершено: 1% слів змінено",
 
IeSpellDownload : "Модуль перевірки орфографії не встановлено. Бажаєтн завантажити його зараз?",
 
// Button Dialog
DlgButtonText : "Текст (Значення)",
DlgButtonType : "Тип",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Ім'я",
DlgCheckboxValue : "Значення",
DlgCheckboxSelected : "Обрана",
 
// Form Dialog
DlgFormName : "Ім'я",
DlgFormAction : "Дія",
DlgFormMethod : "Метод",
 
// Select Field Dialog
DlgSelectName : "Ім'я",
DlgSelectValue : "Значення",
DlgSelectSize : "Розмір",
DlgSelectLines : "лінії",
DlgSelectChkMulti : "Дозволити обрання декількох позицій",
DlgSelectOpAvail : "Доступні варіанти",
DlgSelectOpText : "Текст",
DlgSelectOpValue : "Значення",
DlgSelectBtnAdd : "Добавити",
DlgSelectBtnModify : "Змінити",
DlgSelectBtnUp : "Вгору",
DlgSelectBtnDown : "Вниз",
DlgSelectBtnSetValue : "Встановити як вибране значення",
DlgSelectBtnDelete : "Видалити",
 
// Textarea Dialog
DlgTextareaName : "Ім'я",
DlgTextareaCols : "Колонки",
DlgTextareaRows : "Строки",
 
// Text Field Dialog
DlgTextName : "Ім'я",
DlgTextValue : "Значення",
DlgTextCharWidth : "Ширина",
DlgTextMaxChars : "Макс. кіл-ть символів",
DlgTextType : "Тип",
DlgTextTypeText : "Текст",
DlgTextTypePass : "Пароль",
 
// Hidden Field Dialog
DlgHiddenName : "Ім'я",
DlgHiddenValue : "Значення",
 
// Bulleted List Dialog
BulletedListProp : "Властивості маркованого списка",
NumberedListProp : "Властивості нумерованного списка",
DlgLstStart : "Start", //MISSING
DlgLstType : "Тип",
DlgLstTypeCircle : "Коло",
DlgLstTypeDisc : "Disc", //MISSING
DlgLstTypeSquare : "Квадрат",
DlgLstTypeNumbers : "Номери (1, 2, 3)",
DlgLstTypeLCase : "Літери нижнього регістра(a, b, c)",
DlgLstTypeUCase : "Літери ВЕРХНЬОГО РЕГІСТРА (A, B, C)",
DlgLstTypeSRoman : "Малі римські літери (i, ii, iii)",
DlgLstTypeLRoman : "Великі римські літери (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "Загальні",
DlgDocBackTab : "Заднє тло",
DlgDocColorsTab : "Кольори та відступи",
DlgDocMetaTab : "Мета дані",
 
DlgDocPageTitle : "Заголовок сторінки",
DlgDocLangDir : "Напрямок тексту",
DlgDocLangDirLTR : "Зліва на право (LTR)",
DlgDocLangDirRTL : "Зправа на лево (RTL)",
DlgDocLangCode : "Код мови",
DlgDocCharSet : "Кодування набору символів",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "Інше кодування набору символів",
 
DlgDocDocType : "Заголовок типу документу",
DlgDocDocTypeOther : "Інший заголовок типу документу",
DlgDocIncXHTML : "Ввімкнути XHTML оголошення",
DlgDocBgColor : "Колір тла",
DlgDocBgImage : "URL зображення тла",
DlgDocBgNoScroll : "Тло без прокрутки",
DlgDocCText : "Текст",
DlgDocCLink : "Посилання",
DlgDocCVisited : "Відвідане посилання",
DlgDocCActive : "Активне посилання",
DlgDocMargins : "Відступи сторінки",
DlgDocMaTop : "Верхній",
DlgDocMaLeft : "Лівий",
DlgDocMaRight : "Правий",
DlgDocMaBottom : "Нижній",
DlgDocMeIndex : "Ключові слова документа (розділені комами)",
DlgDocMeDescr : "Опис документа",
DlgDocMeAuthor : "Автор",
DlgDocMeCopy : "Авторські права",
DlgDocPreview : "Попередній перегляд",
 
// Templates Dialog
Templates : "Шаблони",
DlgTemplatesTitle : "Шаблони змісту",
DlgTemplatesSelMsg : "Оберіть, будь ласка, шаблон для відкриття в редакторі<br>(поточний зміст буде втрачено):",
DlgTemplatesLoading : "Завантаження списку шаблонів. Зачекайте, будь ласка...",
DlgTemplatesNoTpl : "(Не визначено жодного шаблону)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "Про програму",
DlgAboutBrowserInfoTab : "Інформація браузера",
DlgAboutLicenseTab : "License", //MISSING
DlgAboutVersion : "Версія",
DlgAboutLicense : "Ліцензовано згідно умовам GNU Lesser General Public License",
DlgAboutInfo : "Додаткову інформацію дивіться на "
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/zh-cn.js
New file
0,0 → 1,501
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: zh-cn.js
* Chinese Simplified language file.
*
* File Authors:
* NetRube (NetRube@gmail.com)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "折叠工具栏",
ToolbarExpand : "展开工具栏",
 
// Toolbar Items and Context Menu
Save : "保存",
NewPage : "新建",
Preview : "预览",
Cut : "剪切",
Copy : "复制",
Paste : "粘贴",
PasteText : "粘贴为无格式文本",
PasteWord : "从 MS Word 粘贴",
Print : "打印",
SelectAll : "全选",
RemoveFormat : "清除格式",
InsertLinkLbl : "超链接",
InsertLink : "插入/编辑超链接",
RemoveLink : "取消超链接",
Anchor : "插入/编辑锚点链接",
InsertImageLbl : "图象",
InsertImage : "插入/编辑图象",
InsertFlashLbl : "Flash",
InsertFlash : "插入/编辑 Flash",
InsertTableLbl : "表格",
InsertTable : "插入/编辑表格",
InsertLineLbl : "水平线",
InsertLine : "插入水平线",
InsertSpecialCharLbl: "特殊符号",
InsertSpecialChar : "插入特殊符号",
InsertSmileyLbl : "表情符",
InsertSmiley : "插入表情图标",
About : "关于 FCKeditor",
Bold : "加粗",
Italic : "倾斜",
Underline : "下划线",
StrikeThrough : "删除线",
Subscript : "下标",
Superscript : "上标",
LeftJustify : "左对齐",
CenterJustify : "居中对齐",
RightJustify : "右对齐",
BlockJustify : "两端对齐",
DecreaseIndent : "减少缩进量",
IncreaseIndent : "增加缩进量",
Undo : "撤消",
Redo : "重做",
NumberedListLbl : "编号列表",
NumberedList : "插入/删除编号列表",
BulletedListLbl : "项目列表",
BulletedList : "插入/删除项目列表",
ShowTableBorders : "显示表格边框",
ShowDetails : "显示详细资料",
Style : "样式",
FontFormat : "格式",
Font : "字体",
FontSize : "大小",
TextColor : "文本颜色",
BGColor : "背景颜色",
Source : "源代码",
Find : "查找",
Replace : "替换",
SpellCheck : "拼写检查",
UniversalKeyboard : "软键盘",
PageBreakLbl : "分页符",
PageBreak : "插入分页符",
 
Form : "表单",
Checkbox : "复选框",
RadioButton : "单选按钮",
TextField : "单行文本",
Textarea : "多行文本",
HiddenField : "隐藏域",
Button : "按钮",
SelectionField : "列表/菜单",
ImageButton : "图像域",
 
FitWindow : "全屏编辑",
 
// Context Menu
EditLink : "编辑超链接",
CellCM : "单元格",
RowCM : "行",
ColumnCM : "列",
InsertRow : "插入行",
DeleteRows : "删除行",
InsertColumn : "插入列",
DeleteColumns : "删除列",
InsertCell : "插入单元格",
DeleteCells : "删除单元格",
MergeCells : "合并单元格",
SplitCell : "拆分单元格",
TableDelete : "删除表格",
CellProperties : "单元格属性",
TableProperties : "表格属性",
ImageProperties : "图象属性",
FlashProperties : "Flash 属性",
 
AnchorProp : "锚点链接属性",
ButtonProp : "按钮属性",
CheckboxProp : "复选框属性",
HiddenFieldProp : "隐藏域属性",
RadioButtonProp : "单选按钮属性",
ImageButtonProp : "图像域属性",
TextFieldProp : "单行文本属性",
SelectionFieldProp : "菜单/列表属性",
TextareaProp : "多行文本属性",
FormProp : "表单属性",
 
FontFormats : "普通;已编排格式;地址;标题 1;标题 2;标题 3;标题 4;标题 5;标题 6;段落(DIV)",
 
// Alerts and Messages
ProcessingXHTML : "正在处理 XHTML,请稍等...",
Done : "完成",
PasteWordConfirm : "您要粘贴的内容好像是来自 MS Word,是否要清除 MS Word 格式后再粘贴?",
NotCompatiblePaste : "该命令需要 Internet Explorer 5.5 或更高版本的支持,是否按常规粘贴进行?",
UnknownToolbarItem : "未知工具栏项目 \"%1\"",
UnknownCommand : "未知命令名称 \"%1\"",
NotImplemented : "命令无法执行",
UnknownToolbarSet : "工具栏设置 \"%1\" 不存在",
NoActiveX : "浏览器安全设置限制了本编辑器的某些功能。您必须启用安全设置中的“运行 ActiveX 控件和插件”,否则将出现某些错误并缺少功能。",
BrowseServerBlocked : "无法打开资源浏览器,请确认是否启用了禁止弹出窗口。",
DialogBlocked : "无法打开对话框窗口,请确认是否启用了禁止弹出窗口或网页对话框(IE)。",
 
// Dialogs
DlgBtnOK : "确定",
DlgBtnCancel : "取消",
DlgBtnClose : "关闭",
DlgBtnBrowseServer : "浏览服务器",
DlgAdvancedTag : "高级",
DlgOpOther : "<其它>",
DlgInfoTab : "信息",
DlgAlertUrl : "请插入 URL",
 
// General Dialogs Labels
DlgGenNotSet : "<没有设置>",
DlgGenId : "ID",
DlgGenLangDir : "语言方向",
DlgGenLangDirLtr : "从左到右 (LTR)",
DlgGenLangDirRtl : "从右到左 (RTL)",
DlgGenLangCode : "语言代码",
DlgGenAccessKey : "访问键",
DlgGenName : "名称",
DlgGenTabIndex : "Tab 键次序",
DlgGenLongDescr : "详细说明地址",
DlgGenClass : "样式类名称",
DlgGenTitle : "标题",
DlgGenContType : "内容类型",
DlgGenLinkCharset : "字符编码",
DlgGenStyle : "行内样式",
 
// Image Dialog
DlgImgTitle : "图象属性",
DlgImgInfoTab : "图象",
DlgImgBtnUpload : "发送到服务器上",
DlgImgURL : "源文件",
DlgImgUpload : "上传",
DlgImgAlt : "替换文本",
DlgImgWidth : "宽度",
DlgImgHeight : "高度",
DlgImgLockRatio : "锁定比例",
DlgBtnResetSize : "恢复尺寸",
DlgImgBorder : "边框大小",
DlgImgHSpace : "水平间距",
DlgImgVSpace : "垂直间距",
DlgImgAlign : "对齐方式",
DlgImgAlignLeft : "左对齐",
DlgImgAlignAbsBottom: "绝对底边",
DlgImgAlignAbsMiddle: "绝对居中",
DlgImgAlignBaseline : "基线",
DlgImgAlignBottom : "底边",
DlgImgAlignMiddle : "居中",
DlgImgAlignRight : "右对齐",
DlgImgAlignTextTop : "文本上方",
DlgImgAlignTop : "顶端",
DlgImgPreview : "预览",
DlgImgAlertUrl : "请输入图象地址",
DlgImgLinkTab : "链接",
 
// Flash Dialog
DlgFlashTitle : "Flash 属性",
DlgFlashChkPlay : "自动播放",
DlgFlashChkLoop : "循环",
DlgFlashChkMenu : "启用 Flash 菜单",
DlgFlashScale : "缩放",
DlgFlashScaleAll : "全部显示",
DlgFlashScaleNoBorder : "无边框",
DlgFlashScaleFit : "严格匹配",
 
// Link Dialog
DlgLnkWindowTitle : "超链接",
DlgLnkInfoTab : "超链接信息",
DlgLnkTargetTab : "目标",
 
DlgLnkType : "超链接类型",
DlgLnkTypeURL : "超链接",
DlgLnkTypeAnchor : "页内锚点链接",
DlgLnkTypeEMail : "电子邮件",
DlgLnkProto : "协议",
DlgLnkProtoOther : "<其它>",
DlgLnkURL : "地址",
DlgLnkAnchorSel : "选择一个锚点",
DlgLnkAnchorByName : "按锚点名称",
DlgLnkAnchorById : "按锚点 ID",
DlgLnkNoAnchors : "<此文档没有可用的锚点>",
DlgLnkEMail : "地址",
DlgLnkEMailSubject : "主题",
DlgLnkEMailBody : "内容",
DlgLnkUpload : "上传",
DlgLnkBtnUpload : "发送到服务器上",
 
DlgLnkTarget : "目标",
DlgLnkTargetFrame : "<框架>",
DlgLnkTargetPopup : "<弹出窗口>",
DlgLnkTargetBlank : "新窗口 (_blank)",
DlgLnkTargetParent : "父窗口 (_parent)",
DlgLnkTargetSelf : "本窗口 (_self)",
DlgLnkTargetTop : "整页 (_top)",
DlgLnkTargetFrameName : "目标框架名称",
DlgLnkPopWinName : "弹出窗口名称",
DlgLnkPopWinFeat : "弹出窗口属性",
DlgLnkPopResize : "调整大小",
DlgLnkPopLocation : "地址栏",
DlgLnkPopMenu : "菜单栏",
DlgLnkPopScroll : "滚动条",
DlgLnkPopStatus : "状态栏",
DlgLnkPopToolbar : "工具栏",
DlgLnkPopFullScrn : "全屏 (IE)",
DlgLnkPopDependent : "依附 (NS)",
DlgLnkPopWidth : "宽",
DlgLnkPopHeight : "高",
DlgLnkPopLeft : "左",
DlgLnkPopTop : "右",
 
DlnLnkMsgNoUrl : "请输入超链接地址",
DlnLnkMsgNoEMail : "请输入电子邮件地址",
DlnLnkMsgNoAnchor : "请选择一个锚点",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "选择颜色",
DlgColorBtnClear : "清除",
DlgColorHighlight : "预览",
DlgColorSelected : "选择",
 
// Smiley Dialog
DlgSmileyTitle : "插入表情图标",
 
// Special Character Dialog
DlgSpecialCharTitle : "选择特殊符号",
 
// Table Dialog
DlgTableTitle : "表格属性",
DlgTableRows : "行数",
DlgTableColumns : "列数",
DlgTableBorder : "边框",
DlgTableAlign : "对齐",
DlgTableAlignNotSet : "<没有设置>",
DlgTableAlignLeft : "左对齐",
DlgTableAlignCenter : "居中",
DlgTableAlignRight : "右对齐",
DlgTableWidth : "宽度",
DlgTableWidthPx : "像素",
DlgTableWidthPc : "百分比",
DlgTableHeight : "高度",
DlgTableCellSpace : "间距",
DlgTableCellPad : "边距",
DlgTableCaption : "标题",
DlgTableSummary : "摘要",
 
// Table Cell Dialog
DlgCellTitle : "单元格属性",
DlgCellWidth : "宽度",
DlgCellWidthPx : "像素",
DlgCellWidthPc : "百分比",
DlgCellHeight : "高度",
DlgCellWordWrap : "自动换行",
DlgCellWordWrapNotSet : "<没有设置>",
DlgCellWordWrapYes : "是",
DlgCellWordWrapNo : "否",
DlgCellHorAlign : "水平对齐",
DlgCellHorAlignNotSet : "<没有设置>",
DlgCellHorAlignLeft : "左对齐",
DlgCellHorAlignCenter : "居中",
DlgCellHorAlignRight: "右对齐",
DlgCellVerAlign : "垂直对齐",
DlgCellVerAlignNotSet : "<没有设置>",
DlgCellVerAlignTop : "顶端",
DlgCellVerAlignMiddle : "居中",
DlgCellVerAlignBottom : "底部",
DlgCellVerAlignBaseline : "基线",
DlgCellRowSpan : "纵跨行数",
DlgCellCollSpan : "横跨列数",
DlgCellBackColor : "背景颜色",
DlgCellBorderColor : "边框颜色",
DlgCellBtnSelect : "选择...",
 
// Find Dialog
DlgFindTitle : "查找",
DlgFindFindBtn : "查找",
DlgFindNotFoundMsg : "指定文本没有找到。",
 
// Replace Dialog
DlgReplaceTitle : "替换",
DlgReplaceFindLbl : "查找:",
DlgReplaceReplaceLbl : "替换:",
DlgReplaceCaseChk : "区分大小写",
DlgReplaceReplaceBtn : "替换",
DlgReplaceReplAllBtn : "全部替换",
DlgReplaceWordChk : "全字匹配",
 
// Paste Operations / Dialog
PasteErrorPaste : "您的浏览器安全设置不允许编辑器自动执行粘贴操作,请使用键盘快捷键(Ctrl+V)来完成。",
PasteErrorCut : "您的浏览器安全设置不允许编辑器自动执行剪切操作,请使用键盘快捷键(Ctrl+X)来完成。",
PasteErrorCopy : "您的浏览器安全设置不允许编辑器自动执行复制操作,请使用键盘快捷键(Ctrl+C)来完成。",
 
PasteAsText : "粘贴为无格式文本",
PasteFromWord : "从 MS Word 粘贴",
 
DlgPasteMsg2 : "请使用键盘快捷键(<STRONG>Ctrl+V</STRONG>)把内容粘贴到下面的方框里,再按 <STRONG>确定</STRONG>。",
DlgPasteIgnoreFont : "忽略 Font 标签",
DlgPasteRemoveStyles : "清理 CSS 样式",
DlgPasteCleanBox : "清空上面内容",
 
// Color Picker
ColorAutomatic : "自动",
ColorMoreColors : "其它颜色...",
 
// Document Properties
DocProps : "页面属性",
 
// Anchor Dialog
DlgAnchorTitle : "命名锚点",
DlgAnchorName : "锚点名称",
DlgAnchorErrorName : "请输入锚点名称",
 
// Speller Pages Dialog
DlgSpellNotInDic : "没有在字典里",
DlgSpellChangeTo : "更改为",
DlgSpellBtnIgnore : "忽略",
DlgSpellBtnIgnoreAll : "全部忽略",
DlgSpellBtnReplace : "替换",
DlgSpellBtnReplaceAll : "全部替换",
DlgSpellBtnUndo : "撤消",
DlgSpellNoSuggestions : "- 没有建议 -",
DlgSpellProgress : "正在进行拼写检查...",
DlgSpellNoMispell : "拼写检查完成:没有发现拼写错误",
DlgSpellNoChanges : "拼写检查完成:没有更改任何单词",
DlgSpellOneChange : "拼写检查完成:更改了一个单词",
DlgSpellManyChanges : "拼写检查完成:更改了 %1 个单词",
 
IeSpellDownload : "拼写检查插件还没安装,你是否想现在就下载?",
 
// Button Dialog
DlgButtonText : "标签(值)",
DlgButtonType : "类型",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "名称",
DlgCheckboxValue : "选定值",
DlgCheckboxSelected : "已勾选",
 
// Form Dialog
DlgFormName : "名称",
DlgFormAction : "动作",
DlgFormMethod : "方法",
 
// Select Field Dialog
DlgSelectName : "名称",
DlgSelectValue : "选定",
DlgSelectSize : "高度",
DlgSelectLines : "行",
DlgSelectChkMulti : "允许多选",
DlgSelectOpAvail : "列表值",
DlgSelectOpText : "标签",
DlgSelectOpValue : "值",
DlgSelectBtnAdd : "新增",
DlgSelectBtnModify : "修改",
DlgSelectBtnUp : "上移",
DlgSelectBtnDown : "下移",
DlgSelectBtnSetValue : "设为初始化时选定",
DlgSelectBtnDelete : "删除",
 
// Textarea Dialog
DlgTextareaName : "名称",
DlgTextareaCols : "字符宽度",
DlgTextareaRows : "行数",
 
// Text Field Dialog
DlgTextName : "名称",
DlgTextValue : "初始值",
DlgTextCharWidth : "字符宽度",
DlgTextMaxChars : "最多字符数",
DlgTextType : "类型",
DlgTextTypeText : "文本",
DlgTextTypePass : "密码",
 
// Hidden Field Dialog
DlgHiddenName : "名称",
DlgHiddenValue : "初始值",
 
// Bulleted List Dialog
BulletedListProp : "项目列表属性",
NumberedListProp : "编号列表属性",
DlgLstStart : "Start", //MISSING
DlgLstType : "列表类型",
DlgLstTypeCircle : "圆圈",
DlgLstTypeDisc : "圆点",
DlgLstTypeSquare : "方块",
DlgLstTypeNumbers : "数字 (1, 2, 3)",
DlgLstTypeLCase : "小写字母 (a, b, c)",
DlgLstTypeUCase : "大写字母 (A, B, C)",
DlgLstTypeSRoman : "小写罗马数字 (i, ii, iii)",
DlgLstTypeLRoman : "大写罗马数字 (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "常规",
DlgDocBackTab : "背景",
DlgDocColorsTab : "颜色和边距",
DlgDocMetaTab : "Meta 数据",
 
DlgDocPageTitle : "页面标题",
DlgDocLangDir : "语言方向",
DlgDocLangDirLTR : "从左到右 (LTR)",
DlgDocLangDirRTL : "从右到左 (RTL)",
DlgDocLangCode : "语言代码",
DlgDocCharSet : "字符编码",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "其它字符编码",
 
DlgDocDocType : "文档类型",
DlgDocDocTypeOther : "其它文档类型",
DlgDocIncXHTML : "包含 XHTML 声明",
DlgDocBgColor : "背景颜色",
DlgDocBgImage : "背景图像",
DlgDocBgNoScroll : "不滚动背景图像",
DlgDocCText : "文本",
DlgDocCLink : "超链接",
DlgDocCVisited : "已访问的超链接",
DlgDocCActive : "活动超链接",
DlgDocMargins : "页面边距",
DlgDocMaTop : "上",
DlgDocMaLeft : "左",
DlgDocMaRight : "右",
DlgDocMaBottom : "下",
DlgDocMeIndex : "页面索引关键字 (用半角逗号[,]分隔)",
DlgDocMeDescr : "页面说明",
DlgDocMeAuthor : "作者",
DlgDocMeCopy : "版权",
DlgDocPreview : "预览",
 
// Templates Dialog
Templates : "模板",
DlgTemplatesTitle : "内容模板",
DlgTemplatesSelMsg : "请选择编辑器内容模板<br>(当前内容将会被清除替换):",
DlgTemplatesLoading : "正在加载模板列表,请稍等...",
DlgTemplatesNoTpl : "(没有模板)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "关于",
DlgAboutBrowserInfoTab : "浏览器信息",
DlgAboutLicenseTab : "许可证",
DlgAboutVersion : "版本",
DlgAboutLicense : "基于 GNU 通用公共许可证授权发布 ",
DlgAboutInfo : "要获得更多信息请访问 "
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/ro.js
New file
0,0 → 1,502
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: ro.js
* Romanian language file.
*
* File Authors:
* Adrian Nicoara
* Ionut Traian Popa
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Ascunde bara cu opţiuni",
ToolbarExpand : "Expandează bara cu opţiuni",
 
// Toolbar Items and Context Menu
Save : "Salvează",
NewPage : "Pagină nouă",
Preview : "Previzualizare",
Cut : "Taie",
Copy : "Copiază",
Paste : "Adaugă",
PasteText : "Adaugă ca text simplu",
PasteWord : "Adaugă din Word",
Print : "Printează",
SelectAll : "Selectează tot",
RemoveFormat : "Înlătură formatarea",
InsertLinkLbl : "Link (Legătură web)",
InsertLink : "Inserează/Editează link (legătură web)",
RemoveLink : "Înlătură link (legătură web)",
Anchor : "Inserează/Editează ancoră",
InsertImageLbl : "Imagine",
InsertImage : "Inserează/Editează imagine",
InsertFlashLbl : "Flash",
InsertFlash : "Inserează/Editează flash",
InsertTableLbl : "Tabel",
InsertTable : "Inserează/Editează tabel",
InsertLineLbl : "Linie",
InsertLine : "Inserează linie orizontă",
InsertSpecialCharLbl: "Caracter special",
InsertSpecialChar : "Inserează caracter special",
InsertSmileyLbl : "Figură expresivă (Emoticon)",
InsertSmiley : "Inserează Figură expresivă (Emoticon)",
About : "Despre FCKeditor",
Bold : "Îngroşat (bold)",
Italic : "Înclinat (italic)",
Underline : "Subliniat (underline)",
StrikeThrough : "Tăiat (strike through)",
Subscript : "Indice (subscript)",
Superscript : "Putere (superscript)",
LeftJustify : "Aliniere la stânga",
CenterJustify : "Aliniere centrală",
RightJustify : "Aliniere la dreapta",
BlockJustify : "Aliniere în bloc (Block Justify)",
DecreaseIndent : "Scade indentarea",
IncreaseIndent : "Creşte indentarea",
Undo : "Starea anterioară (undo)",
Redo : "Starea ulterioară (redo)",
NumberedListLbl : "Listă numerotată",
NumberedList : "Inserează/Şterge listă numerotată",
BulletedListLbl : "Listă cu puncte",
BulletedList : "Inserează/Şterge listă cu puncte",
ShowTableBorders : "Arată marginile tabelului",
ShowDetails : "Arată detalii",
Style : "Stil",
FontFormat : "Formatare",
Font : "Font",
FontSize : "Mărime",
TextColor : "Culoarea textului",
BGColor : "Coloarea fundalului",
Source : "Sursa",
Find : "Găseşte",
Replace : "Înlocuieşte",
SpellCheck : "Verifică text",
UniversalKeyboard : "Tastatură universală",
PageBreakLbl : "Separator de pagină (Page Break)",
PageBreak : "Inserează separator de pagină (Page Break)",
 
Form : "Formular (Form)",
Checkbox : "Bifă (Checkbox)",
RadioButton : "Buton radio (RadioButton)",
TextField : "Câmp text (TextField)",
Textarea : "Suprafaţă text (Textarea)",
HiddenField : "Câmp ascuns (HiddenField)",
Button : "Buton",
SelectionField : "Câmp selecÅ£ie (SelectionField)",
ImageButton : "Buton imagine (ImageButton)",
 
FitWindow : "Maximizează mărimea editorului",
 
// Context Menu
EditLink : "Editează Link",
CellCM : "Celulă",
RowCM : "Linie",
ColumnCM : "Coloană",
InsertRow : "Inserează linie",
DeleteRows : "Şterge linii",
InsertColumn : "Inserează coloană",
DeleteColumns : "Şterge celule",
InsertCell : "Inserează celulă",
DeleteCells : "Şterge celule",
MergeCells : "Uneşte celule",
SplitCell : "Împarte celulă",
TableDelete : "Şterge tabel",
CellProperties : "Proprietăţile celulei",
TableProperties : "Proprietăţile tabelului",
ImageProperties : "Proprietăţile imaginii",
FlashProperties : "Proprietăţile flash-ului",
 
AnchorProp : "Proprietăţi ancoră",
ButtonProp : "Proprietăţi buton",
CheckboxProp : "Proprietăţi bifă (Checkbox)",
HiddenFieldProp : "Proprietăţi câmp ascuns (Hidden Field)",
RadioButtonProp : "Proprietăţi buton radio (Radio Button)",
ImageButtonProp : "Proprietăţi buton imagine (Image Button)",
TextFieldProp : "Proprietăţi câmp text (Text Field)",
SelectionFieldProp : "Proprietăţi câmp selecÅ£ie (Selection Field)",
TextareaProp : "Proprietăţi suprafaţă text (Textarea)",
FormProp : "Proprietăţi formular (Form)",
 
FontFormats : "Normal;Formatat;Adresa;Titlu 1;Titlu 2;Titlu 3;Titlu 4;Titlu 5;Titlu 6;Paragraf (DIV)",
 
// Alerts and Messages
ProcessingXHTML : "Procesăm XHTML. Vă rugăm aşteptaţi...",
Done : "Am terminat",
PasteWordConfirm : "Textul pe care doriÅ£i să-l adăugaÅ£i pare a fi formatat pentru Word. DoriÅ£i să-l curăţaÅ£i de această formatare înainte de a-l adăuga?",
NotCompatiblePaste : "Această facilitate e disponibilă doar pentru Microsoft Internet Explorer, versiunea 5.5 sau ulterioară. VreÅ£i să-l adăugaÅ£i fără a-i fi înlăturat formatarea?",
UnknownToolbarItem : "Obiectul \"%1\" din bara cu opţiuni necunoscut",
UnknownCommand : "Comanda \"%1\" necunoscută",
NotImplemented : "Comandă neimplementată",
UnknownToolbarSet : "Grupul din bara cu opţiuni \"%1\" nu există",
NoActiveX : "Setările de securitate ale programului dvs. cu care navigaÅ£i pe internet (browser) pot limita anumite funcÅ£ionalităţi ale editorului. Pentru a evita asta, trebuie să activaÅ£i opÅ£iunea \"Run ActiveX controls and plug-ins\". Poate veÅ£i întâlni erori sau veÅ£i observa funcÅ£ionalităţi lipsă.",
BrowseServerBlocked : "The resources browser could not be opened. Asiguraţi-vă că nu e activ niciun \"popup blocker\" (funcţionalitate a programului de navigat (browser) sau a unui plug-in al acestuia de a bloca deschiderea unui noi ferestre).",
DialogBlocked : "Nu a fost posibilă deschiderea unei ferestre de dialog. Asiguraţi-vă că nu e activ niciun \"popup blocker\" (funcţionalitate a programului de navigat (browser) sau a unui plug-in al acestuia de a bloca deschiderea unui noi ferestre).",
 
// Dialogs
DlgBtnOK : "Bine",
DlgBtnCancel : "Anulare",
DlgBtnClose : "Închidere",
DlgBtnBrowseServer : "Răsfoieşte server",
DlgAdvancedTag : "Avansat",
DlgOpOther : "<Altul>",
DlgInfoTab : "Informaţii",
DlgAlertUrl : "Vă rugăm să scrieţi URL-ul",
 
// General Dialogs Labels
DlgGenNotSet : "<nesetat>",
DlgGenId : "Id",
DlgGenLangDir : "Direcţia cuvintelor",
DlgGenLangDirLtr : "stânga-dreapta (LTR)",
DlgGenLangDirRtl : "dreapta-stânga (RTL)",
DlgGenLangCode : "Codul limbii",
DlgGenAccessKey : "Tasta de acces",
DlgGenName : "Nume",
DlgGenTabIndex : "Indexul tabului",
DlgGenLongDescr : "Descrierea lungă URL",
DlgGenClass : "Clasele cu stilul paginii (CSS)",
DlgGenTitle : "Titlul consultativ",
DlgGenContType : "Tipul consultativ al titlului",
DlgGenLinkCharset : "Setul de caractere al resursei legate",
DlgGenStyle : "Stil",
 
// Image Dialog
DlgImgTitle : "Proprietăţile imaginii",
DlgImgInfoTab : "Informaţii despre imagine",
DlgImgBtnUpload : "Trimite la server",
DlgImgURL : "URL",
DlgImgUpload : "Încarcă",
DlgImgAlt : "Text alternativ",
DlgImgWidth : "Lăţime",
DlgImgHeight : "ÎnălÅ£ime",
DlgImgLockRatio : "Păstrează proporţiile",
DlgBtnResetSize : "Resetează mărimea",
DlgImgBorder : "Margine",
DlgImgHSpace : "HSpace",
DlgImgVSpace : "VSpace",
DlgImgAlign : "Aliniere",
DlgImgAlignLeft : "Stânga",
DlgImgAlignAbsBottom: "Jos absolut (Abs Bottom)",
DlgImgAlignAbsMiddle: "Mijloc absolut (Abs Middle)",
DlgImgAlignBaseline : "Linia de jos (Baseline)",
DlgImgAlignBottom : "Jos",
DlgImgAlignMiddle : "Mijloc",
DlgImgAlignRight : "Dreapta",
DlgImgAlignTextTop : "Text sus",
DlgImgAlignTop : "Sus",
DlgImgPreview : "Previzualizare",
DlgImgAlertUrl : "Vă rugăm să scrieţi URL-ul imaginii",
DlgImgLinkTab : "Link (Legătură web)",
 
// Flash Dialog
DlgFlashTitle : "Proprietăţile flash-ului",
DlgFlashChkPlay : "Rulează automat",
DlgFlashChkLoop : "Repetă (Loop)",
DlgFlashChkMenu : "Activează meniul flash",
DlgFlashScale : "Scală",
DlgFlashScaleAll : "Arată tot",
DlgFlashScaleNoBorder : "Fără margini (No border)",
DlgFlashScaleFit : "Potriveşte",
 
// Link Dialog
DlgLnkWindowTitle : "Link (Legătură web)",
DlgLnkInfoTab : "Informaţii despre link (Legătură web)",
DlgLnkTargetTab : "Ţintă (Target)",
 
DlgLnkType : "Tipul link-ului (al legăturii web)",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Ancoră în această pagină",
DlgLnkTypeEMail : "E-Mail",
DlgLnkProto : "Protocol",
DlgLnkProtoOther : "<altul>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Selectaţi o ancoră",
DlgLnkAnchorByName : "după numele ancorei",
DlgLnkAnchorById : "după Id-ul elementului",
DlgLnkNoAnchors : "<Nicio ancoră disponibilă în document>",
DlgLnkEMail : "Adresă de e-mail",
DlgLnkEMailSubject : "Subiectul mesajului",
DlgLnkEMailBody : "Conţinutul mesajului",
DlgLnkUpload : "Încarcă",
DlgLnkBtnUpload : "Trimite la server",
 
DlgLnkTarget : "Ţintă (Target)",
DlgLnkTargetFrame : "<frame>",
DlgLnkTargetPopup : "<fereastra popup>",
DlgLnkTargetBlank : "Fereastră nouă (_blank)",
DlgLnkTargetParent : "Fereastra părinte (_parent)",
DlgLnkTargetSelf : "Aceeaşi fereastră (_self)",
DlgLnkTargetTop : "Fereastra din topul ierarhiei (_top)",
DlgLnkTargetFrameName : "Numele frame-ului ţintă",
DlgLnkPopWinName : "Numele ferestrei popup",
DlgLnkPopWinFeat : "Proprietăţile ferestrei popup",
DlgLnkPopResize : "Scalabilă",
DlgLnkPopLocation : "Bara de locaţie",
DlgLnkPopMenu : "Bara de meniu",
DlgLnkPopScroll : "Scroll Bars",
DlgLnkPopStatus : "Bara de status",
DlgLnkPopToolbar : "Bara de opţiuni",
DlgLnkPopFullScrn : "Tot ecranul (Full Screen)(IE)",
DlgLnkPopDependent : "Dependent (Netscape)",
DlgLnkPopWidth : "Lăţime",
DlgLnkPopHeight : "ÎnălÅ£ime",
DlgLnkPopLeft : "PoziÅ£ia la stânga",
DlgLnkPopTop : "Poziţia la dreapta",
 
DlnLnkMsgNoUrl : "Vă rugăm să scrieţi URL-ul",
DlnLnkMsgNoEMail : "Vă rugăm să scrieţi adresa de e-mail",
DlnLnkMsgNoAnchor : "Vă rugăm să selectaţi o ancoră",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "Selectează culoare",
DlgColorBtnClear : "Curăţă",
DlgColorHighlight : "Subliniază (Highlight)",
DlgColorSelected : "Selectat",
 
// Smiley Dialog
DlgSmileyTitle : "Inserează o figură expresivă (Emoticon)",
 
// Special Character Dialog
DlgSpecialCharTitle : "Selectează caracter special",
 
// Table Dialog
DlgTableTitle : "Proprietăţile tabelului",
DlgTableRows : "Linii",
DlgTableColumns : "Coloane",
DlgTableBorder : "Mărimea marginii",
DlgTableAlign : "Aliniament",
DlgTableAlignNotSet : "<Nesetat>",
DlgTableAlignLeft : "Stânga",
DlgTableAlignCenter : "Centru",
DlgTableAlignRight : "Dreapta",
DlgTableWidth : "Lăţime",
DlgTableWidthPx : "pixeli",
DlgTableWidthPc : "procente",
DlgTableHeight : "ÎnălÅ£ime",
DlgTableCellSpace : "SpaÅ£iu între celule",
DlgTableCellPad : "SpaÅ£iu în cadrul celulei",
DlgTableCaption : "Titlu (Caption)",
DlgTableSummary : "Rezumat",
 
// Table Cell Dialog
DlgCellTitle : "Proprietăţile celulei",
DlgCellWidth : "Lăţime",
DlgCellWidthPx : "pixeli",
DlgCellWidthPc : "procente",
DlgCellHeight : "ÎnălÅ£ime",
DlgCellWordWrap : "Desparte cuvintele (Wrap)",
DlgCellWordWrapNotSet : "<Nesetat>",
DlgCellWordWrapYes : "Da",
DlgCellWordWrapNo : "Nu",
DlgCellHorAlign : "Aliniament orizontal",
DlgCellHorAlignNotSet : "<Nesetat>",
DlgCellHorAlignLeft : "Stânga",
DlgCellHorAlignCenter : "Centru",
DlgCellHorAlignRight: "Dreapta",
DlgCellVerAlign : "Aliniament vertical",
DlgCellVerAlignNotSet : "<Nesetat>",
DlgCellVerAlignTop : "Sus",
DlgCellVerAlignMiddle : "Mijloc",
DlgCellVerAlignBottom : "Jos",
DlgCellVerAlignBaseline : "Linia de jos (Baseline)",
DlgCellRowSpan : "Lungimea în linii (Span)",
DlgCellCollSpan : "Lungimea în coloane (Span)",
DlgCellBackColor : "Culoarea fundalului",
DlgCellBorderColor : "Culoarea marginii",
DlgCellBtnSelect : "Selectaţi...",
 
// Find Dialog
DlgFindTitle : "Găseşte",
DlgFindFindBtn : "Găseşte",
DlgFindNotFoundMsg : "Textul specificat nu a fost găsit.",
 
// Replace Dialog
DlgReplaceTitle : "Replace",
DlgReplaceFindLbl : "Găseşte:",
DlgReplaceReplaceLbl : "Înlocuieşte cu:",
DlgReplaceCaseChk : "Deosebeşte majuscule de minuscule (Match case)",
DlgReplaceReplaceBtn : "Înlocuieşte",
DlgReplaceReplAllBtn : "Înlocuieşte tot",
DlgReplaceWordChk : "Doar cuvintele întregi",
 
// Paste Operations / Dialog
PasteErrorPaste : "Setările de securitate ale navigatorului (browser) pe care îl folosiÅ£i nu permit editorului să execute automat operaÅ£iunea de adăugare. Vă rugăm folosiÅ£i tastatura (Ctrl+V).",
PasteErrorCut : "Setările de securitate ale navigatorului (browser) pe care îl folosiÅ£i nu permit editorului să execute automat operaÅ£iunea de tăiere. Vă rugăm folosiÅ£i tastatura (Ctrl+X).",
PasteErrorCopy : "Setările de securitate ale navigatorului (browser) pe care îl folosiÅ£i nu permit editorului să execute automat operaÅ£iunea de copiere. Vă rugăm folosiÅ£i tastatura (Ctrl+C).",
 
PasteAsText : "Adaugă ca text simplu (Plain Text)",
PasteFromWord : "Adaugă din Word",
 
DlgPasteMsg2 : "Vă rugăm adăugaÅ£i în căsuÅ£a următoare folosind tastatura (<STRONG>Ctrl+V</STRONG>) şi apăsaÅ£i <STRONG>OK</STRONG>.",
DlgPasteIgnoreFont : "Ignoră definiţiile Font Face",
DlgPasteRemoveStyles : "Şterge definiţiile stilurilor",
DlgPasteCleanBox : "Şterge căsuţa",
 
// Color Picker
ColorAutomatic : "Automatic",
ColorMoreColors : "Mai multe culori...",
 
// Document Properties
DocProps : "Proprietăţile documentului",
 
// Anchor Dialog
DlgAnchorTitle : "Proprietăţile ancorei",
DlgAnchorName : "Numele ancorei",
DlgAnchorErrorName : "Vă rugăm scrieţi numele ancorei",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Nu e în dicÅ£ionar",
DlgSpellChangeTo : "Schimbă în",
DlgSpellBtnIgnore : "Ignoră",
DlgSpellBtnIgnoreAll : "Ignoră toate",
DlgSpellBtnReplace : "Înlocuieşte",
DlgSpellBtnReplaceAll : "Înlocuieşte tot",
DlgSpellBtnUndo : "Starea anterioară (undo)",
DlgSpellNoSuggestions : "- Fără sugestii -",
DlgSpellProgress : "Verificarea textului în desfăşurare...",
DlgSpellNoMispell : "Verificarea textului terminată: Nicio greşeală găsită",
DlgSpellNoChanges : "Verificarea textului terminată: Niciun cuvânt modificat",
DlgSpellOneChange : "Verificarea textului terminată: Un cuvânt modificat",
DlgSpellManyChanges : "Verificarea textului terminată: 1% cuvinte modificate",
 
IeSpellDownload : "Unealta pentru verificat textul (Spell checker) neinstalată. Doriţi să o descărcaţi acum?",
 
// Button Dialog
DlgButtonText : "Text (Valoare)",
DlgButtonType : "Tip",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Nume",
DlgCheckboxValue : "Valoare",
DlgCheckboxSelected : "Selectat",
 
// Form Dialog
DlgFormName : "Nume",
DlgFormAction : "Acţiune",
DlgFormMethod : "Metodă",
 
// Select Field Dialog
DlgSelectName : "Nume",
DlgSelectValue : "Valoare",
DlgSelectSize : "Mărime",
DlgSelectLines : "linii",
DlgSelectChkMulti : "Permite selecţii multiple",
DlgSelectOpAvail : "Opţiuni disponibile",
DlgSelectOpText : "Text",
DlgSelectOpValue : "Valoare",
DlgSelectBtnAdd : "Adaugă",
DlgSelectBtnModify : "Modifică",
DlgSelectBtnUp : "Sus",
DlgSelectBtnDown : "Jos",
DlgSelectBtnSetValue : "Setează ca valoare selectată",
DlgSelectBtnDelete : "Şterge",
 
// Textarea Dialog
DlgTextareaName : "Nume",
DlgTextareaCols : "Coloane",
DlgTextareaRows : "Linii",
 
// Text Field Dialog
DlgTextName : "Nume",
DlgTextValue : "Valoare",
DlgTextCharWidth : "Lărgimea caracterului",
DlgTextMaxChars : "Caractere maxime",
DlgTextType : "Tip",
DlgTextTypeText : "Text",
DlgTextTypePass : "Parolă",
 
// Hidden Field Dialog
DlgHiddenName : "Nume",
DlgHiddenValue : "Valoare",
 
// Bulleted List Dialog
BulletedListProp : "Proprietăţile listei punctate (Bulleted List)",
NumberedListProp : "Proprietăţile listei numerotate (Numbered List)",
DlgLstStart : "Start", //MISSING
DlgLstType : "Tip",
DlgLstTypeCircle : "Cerc",
DlgLstTypeDisc : "Disc",
DlgLstTypeSquare : "Pătrat",
DlgLstTypeNumbers : "Numere (1, 2, 3)",
DlgLstTypeLCase : "Minuscule-litere mici (a, b, c)",
DlgLstTypeUCase : "Majuscule (A, B, C)",
DlgLstTypeSRoman : "Cifre romane mici (i, ii, iii)",
DlgLstTypeLRoman : "Cifre romane mari (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "General",
DlgDocBackTab : "Fundal",
DlgDocColorsTab : "Culori si margini",
DlgDocMetaTab : "Meta Data",
 
DlgDocPageTitle : "Titlul paginii",
DlgDocLangDir : "Descrierea limbii",
DlgDocLangDirLTR : "stânga-dreapta (LTR)",
DlgDocLangDirRTL : "dreapta-stânga (RTL)",
DlgDocLangCode : "Codul limbii",
DlgDocCharSet : "Encoding setului de caractere",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "Alt encoding al setului de caractere",
 
DlgDocDocType : "Document Type Heading",
DlgDocDocTypeOther : "Alt Document Type Heading",
DlgDocIncXHTML : "Include declaraţii XHTML",
DlgDocBgColor : "Culoarea fundalului (Background Color)",
DlgDocBgImage : "URL-ul imaginii din fundal (Background Image URL)",
DlgDocBgNoScroll : "Fundal neflotant, fix (Nonscrolling Background)",
DlgDocCText : "Text",
DlgDocCLink : "Link (Legătură web)",
DlgDocCVisited : "Link (Legătură web) vizitat",
DlgDocCActive : "Link (Legătură web) activ",
DlgDocMargins : "Marginile paginii",
DlgDocMaTop : "Sus",
DlgDocMaLeft : "Stânga",
DlgDocMaRight : "Dreapta",
DlgDocMaBottom : "Jos",
DlgDocMeIndex : "Cuvinte cheie după care se va indexa documentul (separate prin virgulă)",
DlgDocMeDescr : "Descrierea documentului",
DlgDocMeAuthor : "Autor",
DlgDocMeCopy : "Drepturi de autor",
DlgDocPreview : "Previzualizare",
 
// Templates Dialog
Templates : "Template-uri (şabloane)",
DlgTemplatesTitle : "Template-uri (şabloane) de conţinut",
DlgTemplatesSelMsg : "Vă rugăm selectaÅ£i template-ul (şablonul) ce se va deschide în editor<br>(conÅ£inutul actual va fi pierdut):",
DlgTemplatesLoading : "Se încarcă lista cu template-uri (şabloane). Vă rugăm aşteptaÅ£i...",
DlgTemplatesNoTpl : "(Niciun template (şablon) definit)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "Despre",
DlgAboutBrowserInfoTab : "Informaţii browser",
DlgAboutLicenseTab : "Licenţă",
DlgAboutVersion : "versiune",
DlgAboutLicense : "Licenţiat sub termenii GNU Lesser General Public License",
DlgAboutInfo : "Pentru informaţii amănunţite, vizitaţi"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/pt-br.js
New file
0,0 → 1,502
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: pt-br.js
* Brazilian Portuguese language file.
*
* File Authors:
* Carlos Alberto Tomatis Loth (carlos.loth@conectait.com.br)
* GibaPhp (http://www.xoopstotal.com.br)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Ocultar Barra de Ferramentas",
ToolbarExpand : "Exibir Barra de Ferramentas",
 
// Toolbar Items and Context Menu
Save : "Salvar",
NewPage : "Novo",
Preview : "Visualizar",
Cut : "Recortar",
Copy : "Copiar",
Paste : "Colar",
PasteText : "Colar como Texto sem Formatação",
PasteWord : "Colar do Word",
Print : "Imprimir",
SelectAll : "Selecionar Tudo",
RemoveFormat : "Remover Formatação",
InsertLinkLbl : "Hiperlink",
InsertLink : "Inserir/Editar Hiperlink",
RemoveLink : "Remover Hiperlink",
Anchor : "Inserir/Editar Âncora",
InsertImageLbl : "Figura",
InsertImage : "Inserir/Editar Figura",
InsertFlashLbl : "Flash",
InsertFlash : "Insere/Edita Flash",
InsertTableLbl : "Tabela",
InsertTable : "Inserir/Editar Tabela",
InsertLineLbl : "Linha",
InsertLine : "Inserir Linha Horizontal",
InsertSpecialCharLbl: "Caracteres Especiais",
InsertSpecialChar : "Inserir Caractere Especial",
InsertSmileyLbl : "Emoticon",
InsertSmiley : "Inserir Emoticon",
About : "Sobre FCKeditor",
Bold : "Negrito",
Italic : "Itálico",
Underline : "Sublinhado",
StrikeThrough : "Tachado",
Subscript : "Subscrito",
Superscript : "Sobrescrito",
LeftJustify : "Alinhar Esquerda",
CenterJustify : "Centralizar",
RightJustify : "Alinhar Direita",
BlockJustify : "Justificado",
DecreaseIndent : "Diminuir Recuo",
IncreaseIndent : "Aumentar Recuo",
Undo : "Desfazer",
Redo : "Refazer",
NumberedListLbl : "Numeração",
NumberedList : "Inserir/Remover Numeração",
BulletedListLbl : "Marcadores",
BulletedList : "Inserir/Remover Marcadores",
ShowTableBorders : "Exibir Bordas da Tabela",
ShowDetails : "Exibir Detalhes",
Style : "Estilo",
FontFormat : "Formatação",
Font : "Fonte",
FontSize : "Tamanho",
TextColor : "Cor do Texto",
BGColor : "Cor do Plano de Fundo",
Source : "Código-Fonte",
Find : "Localizar",
Replace : "Substituir",
SpellCheck : "Verificar Ortografia",
UniversalKeyboard : "Teclado Universal",
PageBreakLbl : "Quebra de Página",
PageBreak : "Inserir Quebra de Página",
 
Form : "Formulário",
Checkbox : "Caixa de Seleção",
RadioButton : "Botão de Opção",
TextField : "Caixa de Texto",
Textarea : "Área de Texto",
HiddenField : "Campo Oculto",
Button : "Botão",
SelectionField : "Caixa de Listagem",
ImageButton : "Botão de Imagem",
 
FitWindow : "Maximize the editor size", //MISSING
 
// Context Menu
EditLink : "Editar Hiperlink",
CellCM : "Cell", //MISSING
RowCM : "Row", //MISSING
ColumnCM : "Column", //MISSING
InsertRow : "Inserir Linha",
DeleteRows : "Remover Linhas",
InsertColumn : "Inserir Coluna",
DeleteColumns : "Remover Colunas",
InsertCell : "Inserir Células",
DeleteCells : "Remover Células",
MergeCells : "Mesclar Células",
SplitCell : "Dividir Célular",
TableDelete : "Apagar Tabela",
CellProperties : "Formatar Célula",
TableProperties : "Formatar Tabela",
ImageProperties : "Formatar Figura",
FlashProperties : "Propriedades Flash",
 
AnchorProp : "Formatar Âncora",
ButtonProp : "Formatar Botão",
CheckboxProp : "Formatar Caixa de Seleção",
HiddenFieldProp : "Formatar Campo Oculto",
RadioButtonProp : "Formatar Botão de Opção",
ImageButtonProp : "Formatar Botão de Imagem",
TextFieldProp : "Formatar Caixa de Texto",
SelectionFieldProp : "Formatar Caixa de Listagem",
TextareaProp : "Formatar Área de Texto",
FormProp : "Formatar Formulário",
 
FontFormats : "Normal;Formatado;Endereço;Título 1;Título 2;Título 3;Título 4;Título 5;Título 6",
 
// Alerts and Messages
ProcessingXHTML : "Processando XHTML. Por favor, aguarde...",
Done : "Pronto",
PasteWordConfirm : "O texto que você deseja colar parece ter sido copiado do Word. Você gostaria de remover a formatação antes de colar?",
NotCompatiblePaste : "Este comando está disponível para o navegador Internet Explorer 5.5 ou superior. Você gostaria de colar sem remover a formatação?",
UnknownToolbarItem : "O item da barra de ferramentas \"%1\" não é reconhecido",
UnknownCommand : "O comando \"%1\" não é reconhecido",
NotImplemented : "O comando não foi implementado",
UnknownToolbarSet : "A barra de ferramentas \"%1\" não existe",
NoActiveX : "As configurações de segurança do seu browser podem limitar algumas características do editor. Você precisa habilitar a opção \"Executar controles e plug-ins ActiveX\". Você pode experimentar erros e alertas de características faltantes.",
BrowseServerBlocked : "Os recursos do browser não puderam ser abertos. Tenha certeza que todos os bloqueadores de popup estão desabilitados.",
DialogBlocked : "Não foi possível abrir a janela de diálogo. Tenha certeza que todos os bloqueadores de popup estão desabilitados.",
 
// Dialogs
DlgBtnOK : "OK",
DlgBtnCancel : "Cancelar",
DlgBtnClose : "Fechar",
DlgBtnBrowseServer : "Localizar no Servidor",
DlgAdvancedTag : "Avançado",
DlgOpOther : "<Outros>",
DlgInfoTab : "Info",
DlgAlertUrl : "Inserir a URL",
 
// General Dialogs Labels
DlgGenNotSet : "<não ajustado>",
DlgGenId : "Id",
DlgGenLangDir : "Direção do idioma",
DlgGenLangDirLtr : "Esquerda para Direita (LTR)",
DlgGenLangDirRtl : "Direita para Esquerda (RTL)",
DlgGenLangCode : "Idioma",
DlgGenAccessKey : "Chave de Acesso",
DlgGenName : "Nome",
DlgGenTabIndex : "Índice de Tabulação",
DlgGenLongDescr : "Descrição da URL",
DlgGenClass : "Classe de Folhas de Estilo",
DlgGenTitle : "Título",
DlgGenContType : "Tipo de Conteúdo",
DlgGenLinkCharset : "Conjunto de Caracteres do Hiperlink",
DlgGenStyle : "Estilos",
 
// Image Dialog
DlgImgTitle : "Formatar Figura",
DlgImgInfoTab : "Informações da Figura",
DlgImgBtnUpload : "Enviar para o Servidor",
DlgImgURL : "URL",
DlgImgUpload : "Submeter",
DlgImgAlt : "Texto Alternativo",
DlgImgWidth : "Largura",
DlgImgHeight : "Altura",
DlgImgLockRatio : "Manter proporções",
DlgBtnResetSize : "Redefinir para o Tamanho Original",
DlgImgBorder : "Borda",
DlgImgHSpace : "Horizontal",
DlgImgVSpace : "Vertical",
DlgImgAlign : "Alinhamento",
DlgImgAlignLeft : "Esquerda",
DlgImgAlignAbsBottom: "Inferior Absoluto",
DlgImgAlignAbsMiddle: "Centralizado Absoluto",
DlgImgAlignBaseline : "Baseline",
DlgImgAlignBottom : "Inferior",
DlgImgAlignMiddle : "Centralizado",
DlgImgAlignRight : "Direita",
DlgImgAlignTextTop : "Superior Absoluto",
DlgImgAlignTop : "Superior",
DlgImgPreview : "Visualização",
DlgImgAlertUrl : "Por favor, digite o URL da figura.",
DlgImgLinkTab : "Hiperlink",
 
// Flash Dialog
DlgFlashTitle : "Propriedades Flash",
DlgFlashChkPlay : "Tocar Automaticamente",
DlgFlashChkLoop : "Loop",
DlgFlashChkMenu : "Habilita Menu Flash",
DlgFlashScale : "Escala",
DlgFlashScaleAll : "Mostrar tudo",
DlgFlashScaleNoBorder : "Sem Borda",
DlgFlashScaleFit : "Escala Exata",
 
// Link Dialog
DlgLnkWindowTitle : "Hiperlink",
DlgLnkInfoTab : "Informações do hiperlink",
DlgLnkTargetTab : "Informações de destino",
 
DlgLnkType : "Tipo de hiperlink",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Âncora nesta página",
DlgLnkTypeEMail : "E-Mail",
DlgLnkProto : "Protocolo",
DlgLnkProtoOther : "<outro>",
DlgLnkURL : "URL do hiperlink",
DlgLnkAnchorSel : "Selecione uma âncora",
DlgLnkAnchorByName : "Pelo Nome da âncora",
DlgLnkAnchorById : "Pelo Id do Elemento",
DlgLnkNoAnchors : "<Não há âncoras disponíveis neste documento>",
DlgLnkEMail : "Endereço E-Mail",
DlgLnkEMailSubject : "Assunto da Mensagem",
DlgLnkEMailBody : "Corpo da Mensagem",
DlgLnkUpload : "Enviar ao Servidor",
DlgLnkBtnUpload : "Enviar ao Servidor",
 
DlgLnkTarget : "Destino",
DlgLnkTargetFrame : "<quadro>",
DlgLnkTargetPopup : "<janela popup>",
DlgLnkTargetBlank : "Nova Janela (_blank)",
DlgLnkTargetParent : "Janela Pai (_parent)",
DlgLnkTargetSelf : "Mesma Janela (_self)",
DlgLnkTargetTop : "Janela Superior (_top)",
DlgLnkTargetFrameName : "Nome do Frame de Destino",
DlgLnkPopWinName : "Nome da Janela Pop-up",
DlgLnkPopWinFeat : "Atributos da Janela Pop-up",
DlgLnkPopResize : "Redimensionável",
DlgLnkPopLocation : "Barra de Endereços",
DlgLnkPopMenu : "Barra de Menus",
DlgLnkPopScroll : "Barras de Rolagem",
DlgLnkPopStatus : "Barra de Status",
DlgLnkPopToolbar : "Barra de Ferramentas",
DlgLnkPopFullScrn : "Modo Tela Cheia (IE)",
DlgLnkPopDependent : "Dependente (Netscape)",
DlgLnkPopWidth : "Largura",
DlgLnkPopHeight : "Altura",
DlgLnkPopLeft : "Esquerda",
DlgLnkPopTop : "Superior",
 
DlnLnkMsgNoUrl : "Por favor, digite o endereço do Hiperlink",
DlnLnkMsgNoEMail : "Por favor, digite o endereço de e-mail",
DlnLnkMsgNoAnchor : "Por favor, selecione uma âncora",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "Selecione uma Cor",
DlgColorBtnClear : "Limpar",
DlgColorHighlight : "Visualização",
DlgColorSelected : "Selecionada",
 
// Smiley Dialog
DlgSmileyTitle : "Inserir Emoticon",
 
// Special Character Dialog
DlgSpecialCharTitle : "Selecione um Caractere Especial",
 
// Table Dialog
DlgTableTitle : "Formatar Tabela",
DlgTableRows : "Linhas",
DlgTableColumns : "Colunas",
DlgTableBorder : "Borda",
DlgTableAlign : "Alinhamento",
DlgTableAlignNotSet : "<Não ajustado>",
DlgTableAlignLeft : "Esquerda",
DlgTableAlignCenter : "Centralizado",
DlgTableAlignRight : "Direita",
DlgTableWidth : "Largura",
DlgTableWidthPx : "pixels",
DlgTableWidthPc : "%",
DlgTableHeight : "Altura",
DlgTableCellSpace : "Espaçamento",
DlgTableCellPad : "Enchimento",
DlgTableCaption : "Legenda",
DlgTableSummary : "Resumo",
 
// Table Cell Dialog
DlgCellTitle : "Formatar célula",
DlgCellWidth : "Largura",
DlgCellWidthPx : "pixels",
DlgCellWidthPc : "%",
DlgCellHeight : "Altura",
DlgCellWordWrap : "Quebra de Linha",
DlgCellWordWrapNotSet : "<Não ajustado>",
DlgCellWordWrapYes : "Sim",
DlgCellWordWrapNo : "Não",
DlgCellHorAlign : "Alinhamento Horizontal",
DlgCellHorAlignNotSet : "<Não ajustado>",
DlgCellHorAlignLeft : "Esquerda",
DlgCellHorAlignCenter : "Centralizado",
DlgCellHorAlignRight: "Direita",
DlgCellVerAlign : "Alinhamento Vertical",
DlgCellVerAlignNotSet : "<Não ajustado>",
DlgCellVerAlignTop : "Superior",
DlgCellVerAlignMiddle : "Centralizado",
DlgCellVerAlignBottom : "Inferior",
DlgCellVerAlignBaseline : "Baseline",
DlgCellRowSpan : "Transpor Linhas",
DlgCellCollSpan : "Transpor Colunas",
DlgCellBackColor : "Cor do Plano de Fundo",
DlgCellBorderColor : "Cor da Borda",
DlgCellBtnSelect : "Selecionar...",
 
// Find Dialog
DlgFindTitle : "Localizar...",
DlgFindFindBtn : "Localizar",
DlgFindNotFoundMsg : "O texto especificado não foi encontrado.",
 
// Replace Dialog
DlgReplaceTitle : "Substituir",
DlgReplaceFindLbl : "Procurar por:",
DlgReplaceReplaceLbl : "Substituir por:",
DlgReplaceCaseChk : "Coincidir Maiúsculas/Minúsculas",
DlgReplaceReplaceBtn : "Substituir",
DlgReplaceReplAllBtn : "Substituir Tudo",
DlgReplaceWordChk : "Coincidir a palavra inteira",
 
// Paste Operations / Dialog
PasteErrorPaste : "As configurações de segurança do seu navegador não permitem que o editor execute operações de colar automaticamente. Por favor, utilize o teclado para colar (Ctrl+V).",
PasteErrorCut : "As configurações de segurança do seu navegador não permitem que o editor execute operações de recortar automaticamente. Por favor, utilize o teclado para recortar (Ctrl+X).",
PasteErrorCopy : "As configurações de segurança do seu navegador não permitem que o editor execute operações de copiar automaticamente. Por favor, utilize o teclado para copiar (Ctrl+C).",
 
PasteAsText : "Colar como Texto sem Formatação",
PasteFromWord : "Colar do Word",
 
DlgPasteMsg2 : "Transfira o link usado no box usando o teclado com (<STRONG>Ctrl+V</STRONG>) e <STRONG>OK</STRONG>.",
DlgPasteIgnoreFont : "Ignorar definições de fonte",
DlgPasteRemoveStyles : "Remove definições de estilo",
DlgPasteCleanBox : "Limpar Box",
 
// Color Picker
ColorAutomatic : "Automático",
ColorMoreColors : "Mais Cores...",
 
// Document Properties
DocProps : "Propriedades Documento",
 
// Anchor Dialog
DlgAnchorTitle : "Formatar Âncora",
DlgAnchorName : "Nome da Âncora",
DlgAnchorErrorName : "Por favor, digite o nome da âncora",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Não encontrada",
DlgSpellChangeTo : "Alterar para",
DlgSpellBtnIgnore : "Ignorar uma vez",
DlgSpellBtnIgnoreAll : "Ignorar Todas",
DlgSpellBtnReplace : "Alterar",
DlgSpellBtnReplaceAll : "Alterar Todas",
DlgSpellBtnUndo : "Desfazer",
DlgSpellNoSuggestions : "-sem sugestões de ortografia-",
DlgSpellProgress : "Verificação ortográfica em andamento...",
DlgSpellNoMispell : "Verificação encerrada: Não foram encontrados erros de ortografia",
DlgSpellNoChanges : "Verificação ortográfica encerrada: Não houve alterações",
DlgSpellOneChange : "Verificação ortográfica encerrada: Uma palavra foi alterada",
DlgSpellManyChanges : "Verificação ortográfica encerrada: %1 foram alteradas",
 
IeSpellDownload : "A verificação ortográfica não foi instalada. Você gostaria de realizar o download agora?",
 
// Button Dialog
DlgButtonText : "Texto (Valor)",
DlgButtonType : "Tipo",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Nome",
DlgCheckboxValue : "Valor",
DlgCheckboxSelected : "Selecionado",
 
// Form Dialog
DlgFormName : "Nome",
DlgFormAction : "Action",
DlgFormMethod : "Método",
 
// Select Field Dialog
DlgSelectName : "Nome",
DlgSelectValue : "Valor",
DlgSelectSize : "Tamanho",
DlgSelectLines : "linhas",
DlgSelectChkMulti : "Permitir múltiplas seleções",
DlgSelectOpAvail : "Opções disponíveis",
DlgSelectOpText : "Texto",
DlgSelectOpValue : "Valor",
DlgSelectBtnAdd : "Adicionar",
DlgSelectBtnModify : "Modificar",
DlgSelectBtnUp : "Para cima",
DlgSelectBtnDown : "Para baixo",
DlgSelectBtnSetValue : "Definir como selecionado",
DlgSelectBtnDelete : "Remover",
 
// Textarea Dialog
DlgTextareaName : "Nome",
DlgTextareaCols : "Colunas",
DlgTextareaRows : "Linhas",
 
// Text Field Dialog
DlgTextName : "Nome",
DlgTextValue : "Valor",
DlgTextCharWidth : "Comprimento (em caracteres)",
DlgTextMaxChars : "Número Máximo de Caracteres",
DlgTextType : "Tipo",
DlgTextTypeText : "Texto",
DlgTextTypePass : "Senha",
 
// Hidden Field Dialog
DlgHiddenName : "Nome",
DlgHiddenValue : "Valor",
 
// Bulleted List Dialog
BulletedListProp : "Formatar Marcadores",
NumberedListProp : "Formatar Numeração",
DlgLstStart : "Start", //MISSING
DlgLstType : "Tipo",
DlgLstTypeCircle : "Círculo",
DlgLstTypeDisc : "Disco",
DlgLstTypeSquare : "Quadrado",
DlgLstTypeNumbers : "Números (1, 2, 3)",
DlgLstTypeLCase : "Letras Minúsculas (a, b, c)",
DlgLstTypeUCase : "Letras Maiúsculas (A, B, C)",
DlgLstTypeSRoman : "Números Romanos Minúsculos (i, ii, iii)",
DlgLstTypeLRoman : "Números Romanos Maiúsculos (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "Geral",
DlgDocBackTab : "Plano de Fundo",
DlgDocColorsTab : "Cores e Margens",
DlgDocMetaTab : "Meta Dados",
 
DlgDocPageTitle : "Título da Página",
DlgDocLangDir : "Direção do Idioma",
DlgDocLangDirLTR : "Esquerda para Direita (LTR)",
DlgDocLangDirRTL : "Direita para Esquerda (RTL)",
DlgDocLangCode : "Código do Idioma",
DlgDocCharSet : "Codificação de Caracteres",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "Outra Codificação de Caracteres",
 
DlgDocDocType : "Cabeçalho Tipo de Documento",
DlgDocDocTypeOther : "Other Document Type Heading",
DlgDocIncXHTML : "Incluir Declarações XHTML",
DlgDocBgColor : "Cor do Plano de Fundo",
DlgDocBgImage : "URL da Imagem de Plano de Fundo",
DlgDocBgNoScroll : "Plano de Fundo Fixo",
DlgDocCText : "Texto",
DlgDocCLink : "Hiperlink",
DlgDocCVisited : "Hiperlink Visitado",
DlgDocCActive : "Hiperlink Ativo",
DlgDocMargins : "Margens da Página",
DlgDocMaTop : "Superior",
DlgDocMaLeft : "Inferior",
DlgDocMaRight : "Direita",
DlgDocMaBottom : "Inferior",
DlgDocMeIndex : "Palavras-chave de Indexação do Documento (separadas por vírgula)",
DlgDocMeDescr : "Descrição do Documento",
DlgDocMeAuthor : "Autor",
DlgDocMeCopy : "Direitos Autorais",
DlgDocPreview : "Visualizar",
 
// Templates Dialog
Templates : "Modelos de layout",
DlgTemplatesTitle : "Modelo de layout do conteúdo",
DlgTemplatesSelMsg : "Selecione um modelo de layout para ser aberto no editor<br>(o conteúdo atual será perdido):",
DlgTemplatesLoading : "Carregando a lista de modelos de layout. Aguarde...",
DlgTemplatesNoTpl : "(Não foram definidos modelos de layout)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "Sobre",
DlgAboutBrowserInfoTab : "Informações do Navegador",
DlgAboutLicenseTab : "Licença",
DlgAboutVersion : "versão",
DlgAboutLicense : "Licenciado sob os termos da GNU Lesser General Public License",
DlgAboutInfo : "Para maiores informações visite"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/ru.js
New file
0,0 → 1,501
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: ru.js
* Russian language file.
*
* File Authors:
* Andrey Grebnev (andrey.grebnev@blandware.com)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Свернуть панель инструментов",
ToolbarExpand : "Развернуть панель инструментов",
 
// Toolbar Items and Context Menu
Save : "Сохранить",
NewPage : "Новая страница",
Preview : "Предварительный просмотр",
Cut : "Вырезать",
Copy : "Копировать",
Paste : "Вставить",
PasteText : "Вставить только текст",
PasteWord : "Вставить из Word",
Print : "Печать",
SelectAll : "Выделить все",
RemoveFormat : "Убрать форматирование",
InsertLinkLbl : "Ссылка",
InsertLink : "Вставить/Редактировать ссылку",
RemoveLink : "Убрать ссылку",
Anchor : "Вставить/Редактировать якорь",
InsertImageLbl : "Изображение",
InsertImage : "Вставить/Редактировать изображение",
InsertFlashLbl : "Flash",
InsertFlash : "Вставить/Редактировать Flash",
InsertTableLbl : "Таблица",
InsertTable : "Вставить/Редактировать таблицу",
InsertLineLbl : "Линия",
InsertLine : "Вставить горизонтальную линию",
InsertSpecialCharLbl: "Специальный символ",
InsertSpecialChar : "Вставить специальный символ",
InsertSmileyLbl : "Смайлик",
InsertSmiley : "Вставить смайлик",
About : "О FCKeditor",
Bold : "Жирный",
Italic : "Курсив",
Underline : "Подчеркнутый",
StrikeThrough : "Зачеркнутый",
Subscript : "Подстрочный индекс",
Superscript : "Надстрочный индекс",
LeftJustify : "По левому краю",
CenterJustify : "По центру",
RightJustify : "По правому краю",
BlockJustify : "По ширине",
DecreaseIndent : "Уменьшить отступ",
IncreaseIndent : "Увеличить отступ",
Undo : "Отменить",
Redo : "Повторить",
NumberedListLbl : "Нумерованный список",
NumberedList : "Вставить/Удалить нумерованный список",
BulletedListLbl : "Маркированный список",
BulletedList : "Вставить/Удалить маркированный список",
ShowTableBorders : "Показать бордюры таблицы",
ShowDetails : "Показать детали",
Style : "Стиль",
FontFormat : "Форматирование",
Font : "Шрифт",
FontSize : "Размер",
TextColor : "Цвет текста",
BGColor : "Цвет фона",
Source : "Источник",
Find : "Найти",
Replace : "Заменить",
SpellCheck : "Проверить орфографию",
UniversalKeyboard : "Универсальная клавиатура",
PageBreakLbl : "Разрыв страницы",
PageBreak : "Вставить разрыв страницы",
 
Form : "Форма",
Checkbox : "Флаговая кнопка",
RadioButton : "Кнопка выбора",
TextField : "Текстовое поле",
Textarea : "Текстовая область",
HiddenField : "Скрытое поле",
Button : "Кнопка",
SelectionField : "Список",
ImageButton : "Кнопка с изображением",
 
FitWindow : "Развернуть окно редактора",
 
// Context Menu
EditLink : "Вставить ссылку",
CellCM : "Ячейка",
RowCM : "Строка",
ColumnCM : "Колонка",
InsertRow : "Вставить строку",
DeleteRows : "Удалить строки",
InsertColumn : "Вставить колонку",
DeleteColumns : "Удалить колонки",
InsertCell : "Вставить ячейку",
DeleteCells : "Удалить ячейки",
MergeCells : "Соединить ячейки",
SplitCell : "Разбить ячейку",
TableDelete : "Удалить таблицу",
CellProperties : "Свойства ячейки",
TableProperties : "Свойства таблицы",
ImageProperties : "Свойства изображения",
FlashProperties : "Свойства Flash",
 
AnchorProp : "Свойства якоря",
ButtonProp : "Свойства кнопки",
CheckboxProp : "Свойства флаговой кнопки",
HiddenFieldProp : "Свойства скрытого поля",
RadioButtonProp : "Свойства кнопки выбора",
ImageButtonProp : "Свойства кнопки с изображением",
TextFieldProp : "Свойства текстового поля",
SelectionFieldProp : "Свойства списка",
TextareaProp : "Свойства текстовой области",
FormProp : "Свойства формы",
 
FontFormats : "Нормальный;Форматированный;Адрес;Заголовок 1;Заголовок 2;Заголовок 3;Заголовок 4;Заголовок 5;Заголовок 6;Нормальный (DIV)",
 
// Alerts and Messages
ProcessingXHTML : "Обработка XHTML. Пожалуйста подождите...",
Done : "Сделано",
PasteWordConfirm : "Текст, который вы хотите вставить, похож на копируемый из Word. Вы хотите очистить его перед вставкой?",
NotCompatiblePaste : "Эта команда доступна для Internet Explorer версии 5.5 или выше. Вы хотите вставить без очистки?",
UnknownToolbarItem : "Не известный элемент панели инструментов \"%1\"",
UnknownCommand : "Не известное имя команды \"%1\"",
NotImplemented : "Команда не реализована",
UnknownToolbarSet : "Панель инструментов \"%1\" не существует",
NoActiveX : "Настройки безопасности вашего браузера могут ограничивать некоторые свойства редактора. Вы должны включить опцию \"Запускать элементы управления ActiveX и плугины\". Вы можете видеть ошибки и замечать отсутствие возможностей.",
BrowseServerBlocked : "Ресурсы браузера не могут быть открыты. Проверьте что блокировки всплывающих окон выключены.",
DialogBlocked : "Не возможно открыть окно диалога. Проверьте что блокировки всплывающих окон выключены.",
 
// Dialogs
DlgBtnOK : "ОК",
DlgBtnCancel : "Отмена",
DlgBtnClose : "Закрыть",
DlgBtnBrowseServer : "Просмотреть на сервере",
DlgAdvancedTag : "Расширенный",
DlgOpOther : "<Другое>",
DlgInfoTab : "Информация",
DlgAlertUrl : "Пожалуйста вставьте URL",
 
// General Dialogs Labels
DlgGenNotSet : "<не определено>",
DlgGenId : "Идентификатор",
DlgGenLangDir : "Направление языка",
DlgGenLangDirLtr : "Слева на право (LTR)",
DlgGenLangDirRtl : "Справа на лево (RTL)",
DlgGenLangCode : "Язык",
DlgGenAccessKey : "Горячая клавиша",
DlgGenName : "Имя",
DlgGenTabIndex : "Последовательность перехода",
DlgGenLongDescr : "Длинное описание URL",
DlgGenClass : "Класс CSS",
DlgGenTitle : "Заголовок",
DlgGenContType : "Тип содержимого",
DlgGenLinkCharset : "Кодировка",
DlgGenStyle : "Стиль CSS",
 
// Image Dialog
DlgImgTitle : "Свойства изображения",
DlgImgInfoTab : "Информация о изображении",
DlgImgBtnUpload : "Послать на сервер",
DlgImgURL : "URL",
DlgImgUpload : "Закачать",
DlgImgAlt : "Альтернативный текст",
DlgImgWidth : "Ширина",
DlgImgHeight : "Высота",
DlgImgLockRatio : "Сохранять пропорции",
DlgBtnResetSize : "Сбросить размер",
DlgImgBorder : "Бордюр",
DlgImgHSpace : "Горизонтальный отступ",
DlgImgVSpace : "Вертикальный отступ",
DlgImgAlign : "Выравнивание",
DlgImgAlignLeft : "По левому краю",
DlgImgAlignAbsBottom: "Абс понизу",
DlgImgAlignAbsMiddle: "Абс посередине",
DlgImgAlignBaseline : "По базовой линии",
DlgImgAlignBottom : "Понизу",
DlgImgAlignMiddle : "Посередине",
DlgImgAlignRight : "По правому краю",
DlgImgAlignTextTop : "Текст наверху",
DlgImgAlignTop : "По верху",
DlgImgPreview : "Предварительный просмотр",
DlgImgAlertUrl : "Пожалуйста введите URL изображения",
DlgImgLinkTab : "Ссылка",
 
// Flash Dialog
DlgFlashTitle : "Свойства Flash",
DlgFlashChkPlay : "Авто проигрывание",
DlgFlashChkLoop : "Повтор",
DlgFlashChkMenu : "Включить меню Flash",
DlgFlashScale : "Масштабировать",
DlgFlashScaleAll : "Показывать все",
DlgFlashScaleNoBorder : "Без бордюра",
DlgFlashScaleFit : "Точное совпадение",
 
// Link Dialog
DlgLnkWindowTitle : "Ссылка",
DlgLnkInfoTab : "Информация ссылки",
DlgLnkTargetTab : "Цель",
 
DlgLnkType : "Тип ссылки",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Якорь на эту страницу",
DlgLnkTypeEMail : "Эл. почта",
DlgLnkProto : "Протокол",
DlgLnkProtoOther : "<другое>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Выберите якорь",
DlgLnkAnchorByName : "По имени якоря",
DlgLnkAnchorById : "По идентификатору элемента",
DlgLnkNoAnchors : "<Нет якорей доступных в этом документе>",
DlgLnkEMail : "Адрес эл. почты",
DlgLnkEMailSubject : "Заголовок сообщения",
DlgLnkEMailBody : "Тело сообщения",
DlgLnkUpload : "Закачать",
DlgLnkBtnUpload : "Послать на сервер",
 
DlgLnkTarget : "Цель",
DlgLnkTargetFrame : "<фрейм>",
DlgLnkTargetPopup : "<всплывающее окно>",
DlgLnkTargetBlank : "Новое окно (_blank)",
DlgLnkTargetParent : "Родительское окно (_parent)",
DlgLnkTargetSelf : "Тоже окно (_self)",
DlgLnkTargetTop : "Самое верхнее окно (_top)",
DlgLnkTargetFrameName : "Имя целевого фрейма",
DlgLnkPopWinName : "Имя всплывающего окна",
DlgLnkPopWinFeat : "Свойства всплывающего окна",
DlgLnkPopResize : "Изменяющееся в размерах",
DlgLnkPopLocation : "Панель локации",
DlgLnkPopMenu : "Панель меню",
DlgLnkPopScroll : "Полосы прокрутки",
DlgLnkPopStatus : "Строка состояния",
DlgLnkPopToolbar : "Панель инструментов",
DlgLnkPopFullScrn : "Полный экран (IE)",
DlgLnkPopDependent : "Зависимый (Netscape)",
DlgLnkPopWidth : "Ширина",
DlgLnkPopHeight : "Высота",
DlgLnkPopLeft : "Позиция слева",
DlgLnkPopTop : "Позиция сверху",
 
DlnLnkMsgNoUrl : "Пожалуйста введите URL ссылки",
DlnLnkMsgNoEMail : "Пожалуйста введите адрес эл. почты",
DlnLnkMsgNoAnchor : "Пожалуйста выберете якорь",
DlnLnkMsgInvPopName : "Название вспывающего окна должно начинаться буквы и не может содержать пробелов",
 
// Color Dialog
DlgColorTitle : "Выберите цвет",
DlgColorBtnClear : "Очистить",
DlgColorHighlight : "Подсвеченный",
DlgColorSelected : "Выбранный",
 
// Smiley Dialog
DlgSmileyTitle : "Вставить смайлик",
 
// Special Character Dialog
DlgSpecialCharTitle : "Выберите специальный символ",
 
// Table Dialog
DlgTableTitle : "Свойства таблицы",
DlgTableRows : "Строки",
DlgTableColumns : "Колонки",
DlgTableBorder : "Размер бордюра",
DlgTableAlign : "Выравнивание",
DlgTableAlignNotSet : "<Не уст.>",
DlgTableAlignLeft : "Слева",
DlgTableAlignCenter : "По центру",
DlgTableAlignRight : "Справа",
DlgTableWidth : "Ширина",
DlgTableWidthPx : "пикселей",
DlgTableWidthPc : "процентов",
DlgTableHeight : "Высота",
DlgTableCellSpace : "Промежуток (spacing)",
DlgTableCellPad : "Отступ (padding)",
DlgTableCaption : "Заголовок",
DlgTableSummary : "Резюме",
 
// Table Cell Dialog
DlgCellTitle : "Свойства ячейки",
DlgCellWidth : "Ширина",
DlgCellWidthPx : "пикселей",
DlgCellWidthPc : "процентов",
DlgCellHeight : "Высота",
DlgCellWordWrap : "Заворачивание текста",
DlgCellWordWrapNotSet : "<Не уст.>",
DlgCellWordWrapYes : "Да",
DlgCellWordWrapNo : "Нет",
DlgCellHorAlign : "Гор. выравнивание",
DlgCellHorAlignNotSet : "<Не уст.>",
DlgCellHorAlignLeft : "Слева",
DlgCellHorAlignCenter : "По центру",
DlgCellHorAlignRight: "Справа",
DlgCellVerAlign : "Верт. выравнивание",
DlgCellVerAlignNotSet : "<Не уст.>",
DlgCellVerAlignTop : "Сверху",
DlgCellVerAlignMiddle : "Посередине",
DlgCellVerAlignBottom : "Снизу",
DlgCellVerAlignBaseline : "По базовой линии",
DlgCellRowSpan : "Диапазон строк (span)",
DlgCellCollSpan : "Диапазон колонок (span)",
DlgCellBackColor : "Цвет фона",
DlgCellBorderColor : "Цвет бордюра",
DlgCellBtnSelect : "Выберите...",
 
// Find Dialog
DlgFindTitle : "Найти",
DlgFindFindBtn : "Найти",
DlgFindNotFoundMsg : "Указанный текст не найден.",
 
// Replace Dialog
DlgReplaceTitle : "Заменить",
DlgReplaceFindLbl : "Найти:",
DlgReplaceReplaceLbl : "Заменить на:",
DlgReplaceCaseChk : "Учитывать регистр",
DlgReplaceReplaceBtn : "Заменить",
DlgReplaceReplAllBtn : "Заменить все",
DlgReplaceWordChk : "Совпадение целых слов",
 
// Paste Operations / Dialog
PasteErrorPaste : "Настройки безопасности вашего браузера не позволяют редактору автоматически выполнять операции вставки. Пожалуйста используйте клавиатуру для этого (Ctrl+V).",
PasteErrorCut : "Настройки безопасности вашего браузера не позволяют редактору автоматически выполнять операции вырезания. Пожалуйста используйте клавиатуру для этого (Ctrl+X).",
PasteErrorCopy : "Настройки безопасности вашего браузера не позволяют редактору автоматически выполнять операции копирования. Пожалуйста используйте клавиатуру для этого (Ctrl+C).",
 
PasteAsText : "Вставить только текст",
PasteFromWord : "Вставить из Word",
 
DlgPasteMsg2 : "Пожалуйста вставьте текст в прямоугольник используя сочетание клавиш (<STRONG>Ctrl+V</STRONG>) и нажмите <STRONG>OK</STRONG>.",
DlgPasteIgnoreFont : "Игнорировать определения гарнитуры",
DlgPasteRemoveStyles : "Убрать определения стилей",
DlgPasteCleanBox : "Очистить",
 
// Color Picker
ColorAutomatic : "Автоматический",
ColorMoreColors : "Цвета...",
 
// Document Properties
DocProps : "Свойства документа",
 
// Anchor Dialog
DlgAnchorTitle : "Свойства якоря",
DlgAnchorName : "Имя якоря",
DlgAnchorErrorName : "Пожалуйста введите имя якоря",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Нет в словаре",
DlgSpellChangeTo : "Заменить на",
DlgSpellBtnIgnore : "Игнорировать",
DlgSpellBtnIgnoreAll : "Игнорировать все",
DlgSpellBtnReplace : "Заменить",
DlgSpellBtnReplaceAll : "Заменить все",
DlgSpellBtnUndo : "Отменить",
DlgSpellNoSuggestions : "- Нет предположений -",
DlgSpellProgress : "Идет проверка орфографии...",
DlgSpellNoMispell : "Проверка орфографии закончена: ошибок не найдено",
DlgSpellNoChanges : "Проверка орфографии закончена: ни одного слова не изменено",
DlgSpellOneChange : "Проверка орфографии закончена: одно слово изменено",
DlgSpellManyChanges : "Проверка орфографии закончена: 1% слов изменен",
 
IeSpellDownload : "Модуль проверки орфографии не установлен. Хотите скачать его сейчас?",
 
// Button Dialog
DlgButtonText : "Текст (Значение)",
DlgButtonType : "Тип",
DlgButtonTypeBtn : "Кнопка",
DlgButtonTypeSbm : "Отправить",
DlgButtonTypeRst : "Сбросить",
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Имя",
DlgCheckboxValue : "Значение",
DlgCheckboxSelected : "Выбранная",
 
// Form Dialog
DlgFormName : "Имя",
DlgFormAction : "Действие",
DlgFormMethod : "Метод",
 
// Select Field Dialog
DlgSelectName : "Имя",
DlgSelectValue : "Значение",
DlgSelectSize : "Размер",
DlgSelectLines : "линии",
DlgSelectChkMulti : "Разрешить множественный выбор",
DlgSelectOpAvail : "Доступные варианты",
DlgSelectOpText : "Текст",
DlgSelectOpValue : "Значение",
DlgSelectBtnAdd : "Добавить",
DlgSelectBtnModify : "Модифицировать",
DlgSelectBtnUp : "Вверх",
DlgSelectBtnDown : "Вниз",
DlgSelectBtnSetValue : "Установить как выбранное значение",
DlgSelectBtnDelete : "Удалить",
 
// Textarea Dialog
DlgTextareaName : "Имя",
DlgTextareaCols : "Колонки",
DlgTextareaRows : "Строки",
 
// Text Field Dialog
DlgTextName : "Имя",
DlgTextValue : "Значение",
DlgTextCharWidth : "Ширина",
DlgTextMaxChars : "Макс. кол-во символов",
DlgTextType : "Тип",
DlgTextTypeText : "Текст",
DlgTextTypePass : "Пароль",
 
// Hidden Field Dialog
DlgHiddenName : "Имя",
DlgHiddenValue : "Значение",
 
// Bulleted List Dialog
BulletedListProp : "Свойства маркированного списка",
NumberedListProp : "Свойства нумерованного списка",
DlgLstStart : "Начало",
DlgLstType : "Тип",
DlgLstTypeCircle : "Круг",
DlgLstTypeDisc : "Диск",
DlgLstTypeSquare : "Квадрат",
DlgLstTypeNumbers : "Номера (1, 2, 3)",
DlgLstTypeLCase : "Буквы нижнего регистра (a, b, c)",
DlgLstTypeUCase : "Буквы верхнего регистра (A, B, C)",
DlgLstTypeSRoman : "Малые римские буквы (i, ii, iii)",
DlgLstTypeLRoman : "Большие римские буквы (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "Общие",
DlgDocBackTab : "Задний фон",
DlgDocColorsTab : "Цвета и отступы",
DlgDocMetaTab : "Мета данные",
 
DlgDocPageTitle : "Заголовок страницы",
DlgDocLangDir : "Направление текста",
DlgDocLangDirLTR : "Слева на право (LTR)",
DlgDocLangDirRTL : "Справа на лево (RTL)",
DlgDocLangCode : "Код языка",
DlgDocCharSet : "Кодировка набора символов",
DlgDocCharSetCE : "Центрально-европейская",
DlgDocCharSetCT : "Китайская традиционная (Big5)",
DlgDocCharSetCR : "Кириллица",
DlgDocCharSetGR : "Греческая",
DlgDocCharSetJP : "Японская",
DlgDocCharSetKR : "Корейская",
DlgDocCharSetTR : "Турецкая",
DlgDocCharSetUN : "Юникод (UTF-8)",
DlgDocCharSetWE : "Западно-европейская",
DlgDocCharSetOther : "Другая кодировка набора символов",
 
DlgDocDocType : "Заголовок типа документа",
DlgDocDocTypeOther : "Другой заголовок типа документа",
DlgDocIncXHTML : "Включить XHTML объявления",
DlgDocBgColor : "Цвет фона",
DlgDocBgImage : "URL изображения фона",
DlgDocBgNoScroll : "Нескроллируемый фон",
DlgDocCText : "Текст",
DlgDocCLink : "Ссылка",
DlgDocCVisited : "Посещенная ссылка",
DlgDocCActive : "Активная ссылка",
DlgDocMargins : "Отступы страницы",
DlgDocMaTop : "Верхний",
DlgDocMaLeft : "Левый",
DlgDocMaRight : "Правый",
DlgDocMaBottom : "Нижний",
DlgDocMeIndex : "Ключевые слова документа (разделенные запятой)",
DlgDocMeDescr : "Описание документа",
DlgDocMeAuthor : "Автор",
DlgDocMeCopy : "Авторские права",
DlgDocPreview : "Предварительный просмотр",
 
// Templates Dialog
Templates : "Шаблоны",
DlgTemplatesTitle : "Шаблоны содержимого",
DlgTemplatesSelMsg : "Пожалуйста выберете шаблон для открытия в редакторе<br>(текущее содержимое будет потеряно):",
DlgTemplatesLoading : "Загрузка списка шаблонов. Пожалуйста подождите...",
DlgTemplatesNoTpl : "(Ни одного шаблона не определено)",
DlgTemplatesReplace : "Заменить текущее содержание",
 
// About Dialog
DlgAboutAboutTab : "О программе",
DlgAboutBrowserInfoTab : "Информация браузера",
DlgAboutLicenseTab : "Лицензия",
DlgAboutVersion : "Версия",
DlgAboutLicense : "Лицензировано в соответствии с условиями GNU Lesser General Public License",
DlgAboutInfo : "Для большей информации, посетите"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/bn.js
New file
0,0 → 1,502
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: bn.js
* Bengali/Bangla language file.
*
* File Authors:
* Richard Walledge (darkdoctrine@hotmail.com)
* S M Mahbub Murshed (udvranto@yahoo.com)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "টূলবার গুটিয়ে দাও",
ToolbarExpand : "টূলবার ছড়িয়ে দাও",
 
// Toolbar Items and Context Menu
Save : "সংরক্ষন কর",
NewPage : "নতুন পেজ",
Preview : "প্রিভিউ",
Cut : "কাট",
Copy : "কপি",
Paste : "পেস্ট",
PasteText : "পেস্ট (সাদা টেক্সট)",
PasteWord : "পেস্ট (শব্দ)",
Print : "প্রিন্ট",
SelectAll : "সব সিলেক্ট কর",
RemoveFormat : "ফরমেট সরাও",
InsertLinkLbl : "লিংকের যুক্ত করার লেবেল",
InsertLink : "লিংক যুক্ত কর",
RemoveLink : "লিংক সরাও",
Anchor : "নোঙ্গর",
InsertImageLbl : "ছবির লেবেল যুক্ত কর",
InsertImage : "ছবি যুক্ত কর",
InsertFlashLbl : "ফ্লাশ লেবেল যুক্ত কর",
InsertFlash : "ফ্লাশ যুক্ত কর",
InsertTableLbl : "টেবিলের লেবেল যুক্ত কর",
InsertTable : "টেবিল যুক্ত কর",
InsertLineLbl : "রেখা যুক্ত কর",
InsertLine : "রেখা যুক্ত কর",
InsertSpecialCharLbl: "বিশেষ অক্ষরের লেবেল যুক্ত কর",
InsertSpecialChar : "বিশেষ অক্ষর যুক্ত কর",
InsertSmileyLbl : "স্মাইলী",
InsertSmiley : "স্মাইলী যুক্ত কর",
About : "FCKeditor কে বানিয়েছে",
Bold : "বোল্ড",
Italic : "ইটালিক",
Underline : "আন্ডারলাইন",
StrikeThrough : "স্ট্রাইক থ্রু",
Subscript : "অধোলেখ",
Superscript : "অভিলেখ",
LeftJustify : "বা দিকে ঘেঁষা",
CenterJustify : "মাঝ বরাবর ঘেষা",
RightJustify : "ডান দিকে ঘেঁষা",
BlockJustify : "ব্লক জাস্টিফাই",
DecreaseIndent : "ইনডেন্ট কমাও",
IncreaseIndent : "ইনডেন্ট বাড়াও",
Undo : "আনডু",
Redo : "রি-ডু",
NumberedListLbl : "সাংখ্যিক লিস্টের লেবেল",
NumberedList : "সাংখ্যিক লিস্ট",
BulletedListLbl : "বুলেট লিস্ট লেবেল",
BulletedList : "বুলেটেড লিস্ট",
ShowTableBorders : "টেবিল বর্ডার",
ShowDetails : "সবটুকু দেখাও",
Style : "স্টাইল",
FontFormat : "ফন্ট ফরমেট",
Font : "ফন্ট",
FontSize : "সাইজ",
TextColor : "টেক্স্ট রং",
BGColor : "বেকগ্রাউন্ড রং",
Source : "সোর্স",
Find : "খোজো",
Replace : "রিপ্লেস",
SpellCheck : "বানান চেক",
UniversalKeyboard : "সার্বজনীন কিবোর্ড",
PageBreakLbl : "পেজ ব্রেক লেবেল",
PageBreak : "পেজ ব্রেক",
 
Form : "ফর্ম",
Checkbox : "চেক বাক্স",
RadioButton : "রেডিও বাটন",
TextField : "টেক্সট ফীল্ড",
Textarea : "টেক্সট এরিয়া",
HiddenField : "গুপ্ত ফীল্ড",
Button : "বাটন",
SelectionField : "বাছাই ফীল্ড",
ImageButton : "ছবির বাটন",
 
FitWindow : "উইন্ডো ফিট কর",
 
// Context Menu
EditLink : "লিংক সম্পাদন",
CellCM : "সেল",
RowCM : "রো",
ColumnCM : "কলাম",
InsertRow : "রো যুক্ত কর",
DeleteRows : "রো মুছে দাও",
InsertColumn : "কলাম যুক্ত কর",
DeleteColumns : "কলাম মুছে দাও",
InsertCell : "সেল যুক্ত কর",
DeleteCells : "সেল মুছে দাও",
MergeCells : "সেল জোড়া দাও",
SplitCell : "সেল আলাদা কর",
TableDelete : "টেবিল ডিলীট কর",
CellProperties : "সেলের প্রোপার্টিজ",
TableProperties : "টেবিল প্রোপার্টি",
ImageProperties : "ছবি প্রোপার্টি",
FlashProperties : "ফ্লাশ প্রোপার্টি",
 
AnchorProp : "নোঙর প্রোপার্টি",
ButtonProp : "বাটন প্রোপার্টি",
CheckboxProp : "চেক বক্স প্রোপার্টি",
HiddenFieldProp : "গুপ্ত ফীল্ড প্রোপার্টি",
RadioButtonProp : "রেডিও বাটন প্রোপার্টি",
ImageButtonProp : "ছবি বাটন প্রোপার্টি",
TextFieldProp : "টেক্সট ফীল্ড প্রোপার্টি",
SelectionFieldProp : "বাছাই ফীল্ড প্রোপার্টি",
TextareaProp : "টেক্সট এরিয়া প্রোপার্টি",
FormProp : "ফর্ম প্রোপার্টি",
 
FontFormats : "সাধারণ;ফর্মেটেড;ঠিকানা;শীর্ষক ১;শীর্ষক ২;শীর্ষক ৩;শীর্ষক ৪;শীর্ষক ৫;শীর্ষক ৬;শীর্ষক (DIV)",
 
// Alerts and Messages
ProcessingXHTML : "XHTML প্রসেস করা হচ্ছে",
Done : "শেষ হয়েছে",
PasteWordConfirm : "যে টেকস্টটি আপনি পেস্ট করতে চাচ্ছেন মনে হচ্ছে সেটি ওয়ার্ড থেকে কপি করা। আপনি কি পেস্ট করার আগে একে পরিষ্কার করতে চান?",
NotCompatiblePaste : "এই কমান্ডটি শুধুমাত্র ইন্টারনেট এক্সপ্লোরার ৫.০ বা তার পরের ভার্সনে পাওয়া সম্ভব। আপনি কি পরিষ্কার না করেই পেস্ট করতে চান?",
UnknownToolbarItem : "অজানা টুলবার আইটেম \"%1\"",
UnknownCommand : "অজানা কমান্ড \"%1\"",
NotImplemented : "কমান্ড ইমপ্লিমেন্ট করা হয়নি",
UnknownToolbarSet : "টুলবার সেট \"%1\" এর অস্তিত্ব নেই",
NoActiveX : "আপনার ব্রাউজারের সুরক্ষা সেটিংস কারনে এডিটরের কিছু ফিচার পাওয়া নাও যেতে পারে। আপনাকে অবশ্যই \"Run ActiveX controls and plug-ins\" এনাবেল করে নিতে হবে। আপনি ভুলভ্রান্তি কিছু কিছু ফিচারের অনুপস্থিতি উপলব্ধি করতে পারেন।",
BrowseServerBlocked : "রিসোর্স ব্রাউজার খোলা গেল না। নিশ্চিত করুন যে সব পপআপ ব্লকার বন্ধ করা আছে।",
DialogBlocked : "ডায়ালগ ইউন্ডো খোলা গেল না। নিশ্চিত করুন যে সব পপআপ ব্লকার বন্ধ করা আছে।",
 
// Dialogs
DlgBtnOK : "ওকে",
DlgBtnCancel : "বাতিল",
DlgBtnClose : "বন্ধ কর",
DlgBtnBrowseServer : "ব্রাউজ সার্ভার",
DlgAdvancedTag : "এডভান্সড",
DlgOpOther : "<অন্য>",
DlgInfoTab : "তথ্য",
DlgAlertUrl : "দয়া করে URL যুক্ত করুন",
 
// General Dialogs Labels
DlgGenNotSet : "<সেট নেই>",
DlgGenId : "আইডি",
DlgGenLangDir : "ভাষা লেখার দিক",
DlgGenLangDirLtr : "বাম থেকে ডান (LTR)",
DlgGenLangDirRtl : "ডান থেকে বাম (RTL)",
DlgGenLangCode : "ভাষা কোড",
DlgGenAccessKey : "এক্সেস কী",
DlgGenName : "নাম",
DlgGenTabIndex : "ট্যাব ইন্ডেক্স",
DlgGenLongDescr : "URL এর লম্বা বর্ণনা",
DlgGenClass : "স্টাইল-শীট ক্লাস",
DlgGenTitle : "পরামর্শ শীর্ষক",
DlgGenContType : "পরামর্শ কন্টেন্টের প্রকার",
DlgGenLinkCharset : "লিংক রিসোর্স ক্যারেক্টর সেট",
DlgGenStyle : "স্টাইল",
 
// Image Dialog
DlgImgTitle : "ছবির প্রোপার্টি",
DlgImgInfoTab : "ছবির তথ্য",
DlgImgBtnUpload : "ইহাকে সার্ভারে প্রেরন কর",
DlgImgURL : "URL",
DlgImgUpload : "আপলোড",
DlgImgAlt : "বিকল্প টেক্সট",
DlgImgWidth : "প্রস্থ",
DlgImgHeight : "দৈর্ঘ্য",
DlgImgLockRatio : "অনুপাত লক কর",
DlgBtnResetSize : "সাইজ পূর্বাবস্থায় ফিরিয়ে দাও",
DlgImgBorder : "বর্ডার",
DlgImgHSpace : "হরাইজন্টাল স্পেস",
DlgImgVSpace : "ভার্টিকেল স্পেস",
DlgImgAlign : "এলাইন",
DlgImgAlignLeft : "বামে",
DlgImgAlignAbsBottom: "Abs নীচে",
DlgImgAlignAbsMiddle: "Abs উপর",
DlgImgAlignBaseline : "মূল রেখা",
DlgImgAlignBottom : "নীচে",
DlgImgAlignMiddle : "মধ্য",
DlgImgAlignRight : "ডানে",
DlgImgAlignTextTop : "টেক্সট উপর",
DlgImgAlignTop : "উপর",
DlgImgPreview : "প্রীভিউ",
DlgImgAlertUrl : "অনুগ্রহক করে ছবির URL টাইপ করুন",
DlgImgLinkTab : "লিংক",
 
// Flash Dialog
DlgFlashTitle : "ফ্ল্যাশ প্রোপার্টি",
DlgFlashChkPlay : "অটো প্লে",
DlgFlashChkLoop : "লূপ",
DlgFlashChkMenu : "ফ্ল্যাশ মেনু এনাবল কর",
DlgFlashScale : "স্কেল",
DlgFlashScaleAll : "সব দেখাও",
DlgFlashScaleNoBorder : "কোনো বর্ডার নেই",
DlgFlashScaleFit : "নিখুঁত ফিট",
 
// Link Dialog
DlgLnkWindowTitle : "লিংক",
DlgLnkInfoTab : "লিংক তথ্য",
DlgLnkTargetTab : "টার্গেট",
 
DlgLnkType : "লিংক প্রকার",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "এই পেজে নোঙর কর",
DlgLnkTypeEMail : "ইমেইল",
DlgLnkProto : "প্রোটোকল",
DlgLnkProtoOther : "<অন্য>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "নোঙর বাছাই",
DlgLnkAnchorByName : "নোঙরের নাম দিয়ে",
DlgLnkAnchorById : "নোঙরের আইডি দিয়ে",
DlgLnkNoAnchors : "<ডকুমেন্টে আর কোন নোঙর নেই>",
DlgLnkEMail : "ইমেইল ঠিকানা",
DlgLnkEMailSubject : "মেসেজের বিষয়",
DlgLnkEMailBody : "মেসেজের দেহ",
DlgLnkUpload : "আপলোড",
DlgLnkBtnUpload : "একে সার্ভারে পাঠাও",
 
DlgLnkTarget : "টার্গেট",
DlgLnkTargetFrame : "<ফ্রেম>",
DlgLnkTargetPopup : "<পপআপ উইন্ডো>",
DlgLnkTargetBlank : "নতুন উইন্ডো (_blank)",
DlgLnkTargetParent : "মূল উইন্ডো (_parent)",
DlgLnkTargetSelf : "এই উইন্ডো (_self)",
DlgLnkTargetTop : "শীর্ষ উইন্ডো (_top)",
DlgLnkTargetFrameName : "টার্গেট ফ্রেমের নাম",
DlgLnkPopWinName : "পপআপ উইন্ডোর নাম",
DlgLnkPopWinFeat : "পপআপ উইন্ডো ফীচার সমূহ",
DlgLnkPopResize : "রিসাইজ করা সম্ভব",
DlgLnkPopLocation : "লোকেশন বার",
DlgLnkPopMenu : "মেন্যু বার",
DlgLnkPopScroll : "স্ক্রল বার",
DlgLnkPopStatus : "স্ট্যাটাস বার",
DlgLnkPopToolbar : "টুল বার",
DlgLnkPopFullScrn : "পূর্ণ পর্দা জুড়ে (IE)",
DlgLnkPopDependent : "ডিপেন্ডেন্ট (Netscape)",
DlgLnkPopWidth : "প্রস্থ",
DlgLnkPopHeight : "দৈর্ঘ্য",
DlgLnkPopLeft : "বামের পজিশন",
DlgLnkPopTop : "ডানের পজিশন",
 
DlnLnkMsgNoUrl : "অনুগ্রহ করে URL লিংক টাইপ করুন",
DlnLnkMsgNoEMail : "অনুগ্রহ করে ইমেইল এড্রেস টাইপ করুন",
DlnLnkMsgNoAnchor : "অনুগ্রহ করে নোঙর বাছাই করুন",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "রং বাছাই কর",
DlgColorBtnClear : "পরিষ্কার কর",
DlgColorHighlight : "হাইলাইট",
DlgColorSelected : "সিলেক্টেড",
 
// Smiley Dialog
DlgSmileyTitle : "স্মাইলী যুক্ত কর",
 
// Special Character Dialog
DlgSpecialCharTitle : "বিশেষ ক্যারেক্টার বাছাই কর",
 
// Table Dialog
DlgTableTitle : "টেবিল প্রোপার্টি",
DlgTableRows : "রো",
DlgTableColumns : "কলাম",
DlgTableBorder : "বর্ডার সাইজ",
DlgTableAlign : "এলাইনমেন্ট",
DlgTableAlignNotSet : "<সেট নেই>",
DlgTableAlignLeft : "বামে",
DlgTableAlignCenter : "মাঝখানে",
DlgTableAlignRight : "ডানে",
DlgTableWidth : "প্রস্থ",
DlgTableWidthPx : "পিক্সেল",
DlgTableWidthPc : "শতকরা",
DlgTableHeight : "দৈর্ঘ্য",
DlgTableCellSpace : "সেল স্পেস",
DlgTableCellPad : "সেল প্যাডিং",
DlgTableCaption : "শীর্ষক",
DlgTableSummary : "সারাংশ",
 
// Table Cell Dialog
DlgCellTitle : "সেল প্রোপার্টি",
DlgCellWidth : "প্রস্থ",
DlgCellWidthPx : "পিক্সেল",
DlgCellWidthPc : "শতকরা",
DlgCellHeight : "দৈর্ঘ্য",
DlgCellWordWrap : "ওয়ার্ড রেপ",
DlgCellWordWrapNotSet : "<সেট নেই>",
DlgCellWordWrapYes : "হাঁ",
DlgCellWordWrapNo : "না",
DlgCellHorAlign : "হরাইজন্টাল এলাইনমেন্ট",
DlgCellHorAlignNotSet : "<সেট নেই>",
DlgCellHorAlignLeft : "বামে",
DlgCellHorAlignCenter : "মাঝখানে",
DlgCellHorAlignRight: "ডানে",
DlgCellVerAlign : "ভার্টিক্যাল এলাইনমেন্ট",
DlgCellVerAlignNotSet : "<সেট নেই>",
DlgCellVerAlignTop : "উপর",
DlgCellVerAlignMiddle : "মধ্য",
DlgCellVerAlignBottom : "নীচে",
DlgCellVerAlignBaseline : "মূলরেখা",
DlgCellRowSpan : "রো স্প্যান",
DlgCellCollSpan : "কলাম স্প্যান",
DlgCellBackColor : "ব্যাকগ্রাউন্ড রং",
DlgCellBorderColor : "বর্ডারের রং",
DlgCellBtnSelect : "বাছাই কর",
 
// Find Dialog
DlgFindTitle : "খোঁজো",
DlgFindFindBtn : "খোঁজো",
DlgFindNotFoundMsg : "আপনার উল্লেখিত টেকস্ট পাওয়া যায়নি",
 
// Replace Dialog
DlgReplaceTitle : "বদলে দাও",
DlgReplaceFindLbl : "যা খুঁজতে হবে:",
DlgReplaceReplaceLbl : "যার সাথে বদলাতে হবে:",
DlgReplaceCaseChk : "কেস মিলাও",
DlgReplaceReplaceBtn : "বদলে দাও",
DlgReplaceReplAllBtn : "সব বদলে দাও",
DlgReplaceWordChk : "পুরা শব্দ মেলাও",
 
// Paste Operations / Dialog
PasteErrorPaste : "আপনার ব্রাউজারের সুরক্ষা সেটিংস এডিটরকে অটোমেটিক পেস্ট করার অনুমতি দেয়নি। দয়া করে এই কাজের জন্য কিবোর্ড ব্যবহার করুন (Ctrl+V)।",
PasteErrorCut : "আপনার ব্রাউজারের সুরক্ষা সেটিংস এডিটরকে অটোমেটিক কাট করার অনুমতি দেয়নি। দয়া করে এই কাজের জন্য কিবোর্ড ব্যবহার করুন (Ctrl+X)।",
PasteErrorCopy : "আপনার ব্রাউজারের সুরক্ষা সেটিংস এডিটরকে অটোমেটিক কপি করার অনুমতি দেয়নি। দয়া করে এই কাজের জন্য কিবোর্ড ব্যবহার করুন (Ctrl+C)।",
 
PasteAsText : "সাদা টেক্সট হিসেবে পেস্ট কর",
PasteFromWord : "ওয়ার্ড থেকে পেস্ট কর",
 
DlgPasteMsg2 : "অনুগ্রহ করে নীচের বাক্সে কিবোর্ড ব্যবহার করে (<STRONG>Ctrl+V</STRONG>) পেস্ট করুন এবং <STRONG>OK</STRONG> চাপ দিন",
DlgPasteIgnoreFont : "ফন্ট ফেস ডেফিনেশন ইগনোর করুন",
DlgPasteRemoveStyles : "স্টাইল ডেফিনেশন সরিয়ে দিন",
DlgPasteCleanBox : "বাক্স পরিষ্কার করুন",
 
// Color Picker
ColorAutomatic : "অটোমেটিক",
ColorMoreColors : "আরও রং...",
 
// Document Properties
DocProps : "ডক্যুমেন্ট প্রোপার্টি",
 
// Anchor Dialog
DlgAnchorTitle : "নোঙরের প্রোপার্টি",
DlgAnchorName : "নোঙরের নাম",
DlgAnchorErrorName : "নোঙরের নাম টাইপ করুন",
 
// Speller Pages Dialog
DlgSpellNotInDic : "শব্দকোষে নেই",
DlgSpellChangeTo : "এতে বদলাও",
DlgSpellBtnIgnore : "ইগনোর কর",
DlgSpellBtnIgnoreAll : "সব ইগনোর কর",
DlgSpellBtnReplace : "বদলে দাও",
DlgSpellBtnReplaceAll : "সব বদলে দাও",
DlgSpellBtnUndo : "আন্ডু",
DlgSpellNoSuggestions : "- কোন সাজেশন নেই -",
DlgSpellProgress : "বানান পরীক্ষা চলছে...",
DlgSpellNoMispell : "বানান পরীক্ষা শেষ: কোন ভুল বানান পাওয়া যায়নি",
DlgSpellNoChanges : "বানান পরীক্ষা শেষ: কোন শব্দ পরিবর্তন করা হয়নি",
DlgSpellOneChange : "বানান পরীক্ষা শেষ: একটি মাত্র শব্দ পরিবর্তন করা হয়েছে",
DlgSpellManyChanges : "বানান পরীক্ষা শেষ: %1 গুলো শব্দ বদলে গ্যাছে",
 
IeSpellDownload : "বানান পরীক্ষক ইনস্টল করা নেই। আপনি কি এখনই এটা ডাউনলোড করতে চান?",
 
// Button Dialog
DlgButtonText : "টেক্সট (ভ্যালু)",
DlgButtonType : "প্রকার",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "নাম",
DlgCheckboxValue : "ভ্যালু",
DlgCheckboxSelected : "সিলেক্টেড",
 
// Form Dialog
DlgFormName : "নাম",
DlgFormAction : "একশ্যন",
DlgFormMethod : "পদ্ধতি",
 
// Select Field Dialog
DlgSelectName : "নাম",
DlgSelectValue : "ভ্যালু",
DlgSelectSize : "সাইজ",
DlgSelectLines : "লাইন সমূহ",
DlgSelectChkMulti : "একাধিক সিলেকশন এলাউ কর",
DlgSelectOpAvail : "অন্যান্য বিকল্প",
DlgSelectOpText : "টেক্সট",
DlgSelectOpValue : "ভ্যালু",
DlgSelectBtnAdd : "যুক্ত",
DlgSelectBtnModify : "বদলে দাও",
DlgSelectBtnUp : "উপর",
DlgSelectBtnDown : "নীচে",
DlgSelectBtnSetValue : "বাছাই করা ভ্যালু হিসেবে সেট কর",
DlgSelectBtnDelete : "ডিলীট",
 
// Textarea Dialog
DlgTextareaName : "নাম",
DlgTextareaCols : "কলাম",
DlgTextareaRows : "রো",
 
// Text Field Dialog
DlgTextName : "নাম",
DlgTextValue : "ভ্যালু",
DlgTextCharWidth : "ক্যারেক্টার প্রশস্ততা",
DlgTextMaxChars : "সর্বাধিক ক্যারেক্টার",
DlgTextType : "টাইপ",
DlgTextTypeText : "টেক্সট",
DlgTextTypePass : "পাসওয়ার্ড",
 
// Hidden Field Dialog
DlgHiddenName : "নাম",
DlgHiddenValue : "ভ্যালু",
 
// Bulleted List Dialog
BulletedListProp : "বুলেটেড সূচী প্রোপার্টি",
NumberedListProp : "সাংখ্যিক সূচী প্রোপার্টি",
DlgLstStart : "Start", //MISSING
DlgLstType : "প্রকার",
DlgLstTypeCircle : "গোল",
DlgLstTypeDisc : "ডিস্ক",
DlgLstTypeSquare : "চৌকোণা",
DlgLstTypeNumbers : "সংখ্যা (1, 2, 3)",
DlgLstTypeLCase : "ছোট অক্ষর (a, b, c)",
DlgLstTypeUCase : "বড় অক্ষর (A, B, C)",
DlgLstTypeSRoman : "ছোট রোমান সংখ্যা (i, ii, iii)",
DlgLstTypeLRoman : "বড় রোমান সংখ্যা (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "সাধারন",
DlgDocBackTab : "ব্যাকগ্রাউন্ড",
DlgDocColorsTab : "রং এবং মার্জিন",
DlgDocMetaTab : "মেটাডেটা",
 
DlgDocPageTitle : "পেজ শীর্ষক",
DlgDocLangDir : "ভাষা লিখার দিক",
DlgDocLangDirLTR : "বাম থেকে ডানে (LTR)",
DlgDocLangDirRTL : "ডান থেকে বামে (RTL)",
DlgDocLangCode : "ভাষা কোড",
DlgDocCharSet : "ক্যারেক্টার সেট এনকোডিং",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "অন্য ক্যারেক্টার সেট এনকোডিং",
 
DlgDocDocType : "ডক্যুমেন্ট টাইপ হেডিং",
DlgDocDocTypeOther : "অন্য ডক্যুমেন্ট টাইপ হেডিং",
DlgDocIncXHTML : "XHTML ডেক্লারেশন যুক্ত কর",
DlgDocBgColor : "ব্যাকগ্রাউন্ড রং",
DlgDocBgImage : "ব্যাকগ্রাউন্ড ছবির URL",
DlgDocBgNoScroll : "স্ক্রলহীন ব্যাকগ্রাউন্ড",
DlgDocCText : "টেক্সট",
DlgDocCLink : "লিংক",
DlgDocCVisited : "ভিজিট করা লিংক",
DlgDocCActive : "সক্রিয় লিংক",
DlgDocMargins : "পেজ মার্জিন",
DlgDocMaTop : "উপর",
DlgDocMaLeft : "বামে",
DlgDocMaRight : "ডানে",
DlgDocMaBottom : "নীচে",
DlgDocMeIndex : "ডক্যুমেন্ট ইন্ডেক্স কিওয়ার্ড (কমা দ্বারা বিচ্ছিন্ন)",
DlgDocMeDescr : "ডক্যূমেন্ট বর্ণনা",
DlgDocMeAuthor : "লেখক",
DlgDocMeCopy : "কপীরাইট",
DlgDocPreview : "প্রীভিউ",
 
// Templates Dialog
Templates : "টেমপ্লেট",
DlgTemplatesTitle : "কনটেন্ট টেমপ্লেট",
DlgTemplatesSelMsg : "অনুগ্রহ করে এডিটরে ওপেন করার জন্য টেমপ্লেট বাছাই করুন<br>(আসল কনটেন্ট হারিয়ে যাবে):",
DlgTemplatesLoading : "টেমপ্লেট লিস্ট হারিয়ে যাবে। অনুগ্রহ করে অপেক্ষা করুন...",
DlgTemplatesNoTpl : "(কোন টেমপ্লেট ডিফাইন করা নেই)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "কে বানিয়েছে",
DlgAboutBrowserInfoTab : "ব্রাউজারের ব্যাপারে তথ্য",
DlgAboutLicenseTab : "লাইসেন্স",
DlgAboutVersion : "ভার্সন",
DlgAboutLicense : "লাইসেন্স GNU LGPL এর নীতিমালার অধীনে ",
DlgAboutInfo : "আরও তথ্যের জন্য যান"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/nb.js
New file
0,0 → 1,501
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: nb.js
* Norwegian Bokmål language file.
*
* File Authors:
* Martin Kronstad (www.siteman.no) (martin.kronstad@gmail.com)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Skjul verktøylinje",
ToolbarExpand : "Vis verktøylinje",
 
// Toolbar Items and Context Menu
Save : "Lagre",
NewPage : "Ny Side",
Preview : "Forhåndsvis",
Cut : "Klipp ut",
Copy : "Kopier",
Paste : "Lim inn",
PasteText : "Lim inn som ren tekst",
PasteWord : "Lim inn fra Word",
Print : "Skriv ut",
SelectAll : "Velg alle",
RemoveFormat : "Fjern format",
InsertLinkLbl : "Lenke",
InsertLink : "Sett inn/Rediger lenke",
RemoveLink : "Fjern lenke",
Anchor : "Sett inn/Rediger anker",
InsertImageLbl : "Bilde",
InsertImage : "Sett inn/Rediger bilde",
InsertFlashLbl : "Flash",
InsertFlash : "Sett inn/Rediger Flash",
InsertTableLbl : "Tabell",
InsertTable : "Sett inn/Rediger tabell",
InsertLineLbl : "Linje",
InsertLine : "Sett inn horisontal linje",
InsertSpecialCharLbl: "Spesielt tegn",
InsertSpecialChar : "Sett inn spesielt tegn",
InsertSmileyLbl : "Smil",
InsertSmiley : "Sett inn smil",
About : "Om FCKeditor",
Bold : "Fet",
Italic : "Kursiv",
Underline : "Understrek",
StrikeThrough : "Gjennomstrek",
Subscript : "Senket skrift",
Superscript : "Hevet skrift",
LeftJustify : "Venstrejuster",
CenterJustify : "Midtjuster",
RightJustify : "Høyrejuster",
BlockJustify : "Blokkjuster",
DecreaseIndent : "Senk nivå",
IncreaseIndent : "Øk nivå",
Undo : "Angre",
Redo : "Gjør om",
NumberedListLbl : "Numrert liste",
NumberedList : "Sett inn/Fjern numrert liste",
BulletedListLbl : "Uordnet liste",
BulletedList : "Sett inn/Fjern uordnet liste",
ShowTableBorders : "Vis tabellrammer",
ShowDetails : "Vis detaljer",
Style : "Stil",
FontFormat : "Format",
Font : "Skrift",
FontSize : "Størrelse",
TextColor : "Tekstfarge",
BGColor : "Bakgrunnsfarge",
Source : "Kilde",
Find : "Finn",
Replace : "Erstatt",
SpellCheck : "Stavekontroll",
UniversalKeyboard : "Universelt tastatur",
PageBreakLbl : "Sideskift",
PageBreak : "Sett inn sideskift",
 
Form : "Skjema",
Checkbox : "Sjekkboks",
RadioButton : "Radioknapp",
TextField : "Tekstfelt",
Textarea : "Tekstområde",
HiddenField : "Skjult felt",
Button : "Knapp",
SelectionField : "Dropdown meny",
ImageButton : "Bildeknapp",
 
FitWindow : "Maksimer størrelsen på redigeringsverktøyet",
 
// Context Menu
EditLink : "Rediger lenke",
CellCM : "Celle",
RowCM : "Rader",
ColumnCM : "Kolonne",
InsertRow : "Sett inn rad",
DeleteRows : "Slett rader",
InsertColumn : "Sett inn kolonne",
DeleteColumns : "Slett kolonner",
InsertCell : "Sett inn celle",
DeleteCells : "Slett celler",
MergeCells : "Slå sammen celler",
SplitCell : "Splitt celler",
TableDelete : "Slett tabell",
CellProperties : "Celleegenskaper",
TableProperties : "Tabellegenskaper",
ImageProperties : "Bildeegenskaper",
FlashProperties : "Flash Egenskaper",
 
AnchorProp : "Ankeregenskaper",
ButtonProp : "Knappegenskaper",
CheckboxProp : "Sjekkboksegenskaper",
HiddenFieldProp : "Skjult felt egenskaper",
RadioButtonProp : "Radioknappegenskaper",
ImageButtonProp : "Bildeknappegenskaper",
TextFieldProp : "Tekstfeltegenskaper",
SelectionFieldProp : "Dropdown menyegenskaper",
TextareaProp : "Tekstfeltegenskaper",
FormProp : "Skjemaegenskaper",
 
FontFormats : "Normal;Formatert;Adresse;Tittel 1;Tittel 2;Tittel 3;Tittel 4;Tittel 5;Tittel 6",
 
// Alerts and Messages
ProcessingXHTML : "Lager XHTML. Vennligst vent...",
Done : "Ferdig",
PasteWordConfirm : "Teksten du prøver å lime inn ser ut som om den kommer fra word , du bør rense den før du limer inn , vil du gjøre dette?",
NotCompatiblePaste : "Denne kommandoen er tilgjenglig kun for Internet Explorer version 5.5 eller bedre. Vil du fortsette uten å rense?(Du kan lime inn som ren tekst)",
UnknownToolbarItem : "Ukjent menyvalg \"%1\"",
UnknownCommand : "Ukjent kommando \"%1\"",
NotImplemented : "Kommando ikke ennå implimentert",
UnknownToolbarSet : "Verktøylinjesett \"%1\" finnes ikke",
NoActiveX : "Din nettleser's sikkerhetsinstillinger kan begrense noen av funksjonene i redigeringsverktøyet. Du må aktivere \"Kjør ActiveXkontroller og plugins\". Du kan oppleve feil og advarsler om manglende funksjoner",
BrowseServerBlocked : "Kunne ikke åpne dialogboksen for filarkiv. Pass på at du har slått av popupstoppere.",
DialogBlocked : "Kunne ikke åpne dialogboksen. Pass på at du har slått av popupstoppere.",
 
// Dialogs
DlgBtnOK : "OK",
DlgBtnCancel : "Avbryt",
DlgBtnClose : "Lukk",
DlgBtnBrowseServer : "Bla igjennom server",
DlgAdvancedTag : "Avansert",
DlgOpOther : "<Annet>",
DlgInfoTab : "Info",
DlgAlertUrl : "Vennligst skriv inn URL'en",
 
// General Dialogs Labels
DlgGenNotSet : "<ikke satt>",
DlgGenId : "Id",
DlgGenLangDir : "Språkretning",
DlgGenLangDirLtr : "Venstre til høyre (VTH)",
DlgGenLangDirRtl : "Høyre til venstre (HTV)",
DlgGenLangCode : "Språk kode",
DlgGenAccessKey : "Aksessknapp",
DlgGenName : "Navn",
DlgGenTabIndex : "Tab Indeks",
DlgGenLongDescr : "Utvidet beskrivelse",
DlgGenClass : "Stilarkklasser",
DlgGenTitle : "Tittel",
DlgGenContType : "Type",
DlgGenLinkCharset : "Lenket språkkart",
DlgGenStyle : "Stil",
 
// Image Dialog
DlgImgTitle : "Bildeegenskaper",
DlgImgInfoTab : "Bildeinformasjon",
DlgImgBtnUpload : "Send det til serveren",
DlgImgURL : "URL",
DlgImgUpload : "Last opp",
DlgImgAlt : "Alternativ tekst",
DlgImgWidth : "Bredde",
DlgImgHeight : "Høyde",
DlgImgLockRatio : "Lås forhold",
DlgBtnResetSize : "Tilbakestill størrelse",
DlgImgBorder : "Ramme",
DlgImgHSpace : "HMarg",
DlgImgVSpace : "VMarg",
DlgImgAlign : "Juster",
DlgImgAlignLeft : "Venstre",
DlgImgAlignAbsBottom: "Abs bunn",
DlgImgAlignAbsMiddle: "Abs midten",
DlgImgAlignBaseline : "Bunnlinje",
DlgImgAlignBottom : "Bunn",
DlgImgAlignMiddle : "Midten",
DlgImgAlignRight : "Høyre",
DlgImgAlignTextTop : "Tekst topp",
DlgImgAlignTop : "Topp",
DlgImgPreview : "Forhåndsvis",
DlgImgAlertUrl : "Vennligst skriv bildeurlen",
DlgImgLinkTab : "Lenke",
 
// Flash Dialog
DlgFlashTitle : "Flash Egenskaper",
DlgFlashChkPlay : "Auto Spill",
DlgFlashChkLoop : "Loop",
DlgFlashChkMenu : "Slå på Flash meny",
DlgFlashScale : "Skaler",
DlgFlashScaleAll : "Vis alt",
DlgFlashScaleNoBorder : "Ingen ramme",
DlgFlashScaleFit : "Skaler til å passeExact Fit",
 
// Link Dialog
DlgLnkWindowTitle : "Lenke",
DlgLnkInfoTab : "Lenkeinfo",
DlgLnkTargetTab : "Mål",
 
DlgLnkType : "Lenketype",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Bokmerk denne siden",
DlgLnkTypeEMail : "E-Post",
DlgLnkProto : "Protokoll",
DlgLnkProtoOther : "<annet>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Velg ett anker",
DlgLnkAnchorByName : "Anker etter navn",
DlgLnkAnchorById : "Element etter ID",
DlgLnkNoAnchors : "<Ingen anker i dokumentet>",
DlgLnkEMail : "E-Post Addresse",
DlgLnkEMailSubject : "Meldingsemne",
DlgLnkEMailBody : "Melding",
DlgLnkUpload : "Last opp",
DlgLnkBtnUpload : "Send til server",
 
DlgLnkTarget : "Mål",
DlgLnkTargetFrame : "<ramme>",
DlgLnkTargetPopup : "<popup vindu>",
DlgLnkTargetBlank : "Nytt vindu (_blank)",
DlgLnkTargetParent : "Foreldre vindu (_parent)",
DlgLnkTargetSelf : "Samme vindu (_self)",
DlgLnkTargetTop : "Hele vindu (_top)",
DlgLnkTargetFrameName : "Målramme",
DlgLnkPopWinName : "Popup vindus navn",
DlgLnkPopWinFeat : "Popup vindus egenskaper",
DlgLnkPopResize : "Endre størrelse",
DlgLnkPopLocation : "Adresselinje",
DlgLnkPopMenu : "Menylinje",
DlgLnkPopScroll : "Scrollbar",
DlgLnkPopStatus : "Statuslinje",
DlgLnkPopToolbar : "Verktøylinje",
DlgLnkPopFullScrn : "Full skjerm (IE)",
DlgLnkPopDependent : "Avhenging (Netscape)",
DlgLnkPopWidth : "Bredde",
DlgLnkPopHeight : "Høyde",
DlgLnkPopLeft : "Venstre posisjon",
DlgLnkPopTop : "Topp posisjon",
 
DlnLnkMsgNoUrl : "Vennligst skriv inn lenkens url",
DlnLnkMsgNoEMail : "Vennligst skriv inn e-postadressen",
DlnLnkMsgNoAnchor : "Vennligst velg ett anker",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "Velg farge",
DlgColorBtnClear : "Tøm",
DlgColorHighlight : "Marker",
DlgColorSelected : "Velg",
 
// Smiley Dialog
DlgSmileyTitle : "Sett inn smil",
 
// Special Character Dialog
DlgSpecialCharTitle : "Velg spesielt tegn",
 
// Table Dialog
DlgTableTitle : "Tabellegenskaper",
DlgTableRows : "Rader",
DlgTableColumns : "Kolonner",
DlgTableBorder : "Rammestørrelse",
DlgTableAlign : "Justering",
DlgTableAlignNotSet : "<Ikke satt>",
DlgTableAlignLeft : "Venstre",
DlgTableAlignCenter : "Midtjuster",
DlgTableAlignRight : "Høyre",
DlgTableWidth : "Bredde",
DlgTableWidthPx : "pixler",
DlgTableWidthPc : "prosent",
DlgTableHeight : "Høyde",
DlgTableCellSpace : "Celle marg",
DlgTableCellPad : "Celle polstring",
DlgTableCaption : "Tittel",
DlgTableSummary : "Sammendrag",
 
// Table Cell Dialog
DlgCellTitle : "Celle egenskaper",
DlgCellWidth : "Bredde",
DlgCellWidthPx : "pixeler",
DlgCellWidthPc : "prosent",
DlgCellHeight : "Høyde",
DlgCellWordWrap : "Tekstbrytning",
DlgCellWordWrapNotSet : "<Ikke satt>",
DlgCellWordWrapYes : "Ja",
DlgCellWordWrapNo : "Nei",
DlgCellHorAlign : "Horisontal justering",
DlgCellHorAlignNotSet : "<Ikke satt>",
DlgCellHorAlignLeft : "Venstre",
DlgCellHorAlignCenter : "Midtjuster",
DlgCellHorAlignRight: "Høyre",
DlgCellVerAlign : "Vertikal justering",
DlgCellVerAlignNotSet : "<Ikke satt>",
DlgCellVerAlignTop : "Topp",
DlgCellVerAlignMiddle : "Midten",
DlgCellVerAlignBottom : "Bunn",
DlgCellVerAlignBaseline : "Bunnlinje",
DlgCellRowSpan : "Radspenn",
DlgCellCollSpan : "Kolonnespenn",
DlgCellBackColor : "Bakgrunnsfarge",
DlgCellBorderColor : "Rammefarge",
DlgCellBtnSelect : "Velg...",
 
// Find Dialog
DlgFindTitle : "Finn",
DlgFindFindBtn : "Finn",
DlgFindNotFoundMsg : "Den spesifiserte teksten ble ikke funnet.",
 
// Replace Dialog
DlgReplaceTitle : "Erstatt",
DlgReplaceFindLbl : "Finn hva:",
DlgReplaceReplaceLbl : "Erstatt med:",
DlgReplaceCaseChk : "Riktig case",
DlgReplaceReplaceBtn : "Erstatt",
DlgReplaceReplAllBtn : "Erstatt alle",
DlgReplaceWordChk : "Finn hele ordet",
 
// Paste Operations / Dialog
PasteErrorPaste : "Din nettlesers sikkerhetsinstillinger tillater ikke automatisk innliming av tekst. Vennligst brukt snareveien (Ctrl+V).",
PasteErrorCut : "Din nettlesers sikkerhetsinstillinger tillater ikke automatisk klipping av tekst. Vennligst brukt snareveien (Ctrl+X).",
PasteErrorCopy : "Din nettlesers sikkerhetsinstillinger tillater ikke automatisk kopiering av tekst. Vennligst brukt snareveien (Ctrl+C).",
 
PasteAsText : "Lim inn som ren tekst",
PasteFromWord : "Lim inn fra word",
 
DlgPasteMsg2 : "Vennligst lim inn i den følgende boksen med tastaturet (<STRONG>Ctrl+V</STRONG>) og trykk <STRONG>OK</STRONG>.",
DlgPasteIgnoreFont : "Ignorer fonter",
DlgPasteRemoveStyles : "Fjern stildefinisjoner",
DlgPasteCleanBox : "Tøm boksen",
 
// Color Picker
ColorAutomatic : "Automatisk",
ColorMoreColors : "Flere farger...",
 
// Document Properties
DocProps : "Dokumentegenskaper",
 
// Anchor Dialog
DlgAnchorTitle : "Ankeregenskaper",
DlgAnchorName : "Ankernavn",
DlgAnchorErrorName : "Vennligst skriv inn ankernavnet",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Ikke i ordboken",
DlgSpellChangeTo : "Endre til",
DlgSpellBtnIgnore : "Ignorer",
DlgSpellBtnIgnoreAll : "Ignorer alle",
DlgSpellBtnReplace : "Erstatt",
DlgSpellBtnReplaceAll : "Erstatt alle",
DlgSpellBtnUndo : "Angre",
DlgSpellNoSuggestions : "- ingen forslag -",
DlgSpellProgress : "Stavekontroll pågår...",
DlgSpellNoMispell : "Stavekontroll fullført: ingen feilstavinger funnet",
DlgSpellNoChanges : "Stavekontroll fullført: ingen ord endret",
DlgSpellOneChange : "Stavekontroll fullført: Ett ord endret",
DlgSpellManyChanges : "Stavekontroll fullført: %1 ord endret",
 
IeSpellDownload : "Stavekontroll ikke installert, vil du laste den ned nå?",
 
// Button Dialog
DlgButtonText : "Tekst",
DlgButtonType : "Type",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Navn",
DlgCheckboxValue : "Verdi",
DlgCheckboxSelected : "Valgt",
 
// Form Dialog
DlgFormName : "Navn",
DlgFormAction : "Handling",
DlgFormMethod : "Metode",
 
// Select Field Dialog
DlgSelectName : "Navn",
DlgSelectValue : "Verdi",
DlgSelectSize : "Størrelse",
DlgSelectLines : "Linjer",
DlgSelectChkMulti : "Tillat flervalg",
DlgSelectOpAvail : "Tilgjenglige alternativer",
DlgSelectOpText : "Tekst",
DlgSelectOpValue : "Verdi",
DlgSelectBtnAdd : "Legg til",
DlgSelectBtnModify : "Endre",
DlgSelectBtnUp : "Opp",
DlgSelectBtnDown : "Ned",
DlgSelectBtnSetValue : "Sett som valgt",
DlgSelectBtnDelete : "Slett",
 
// Textarea Dialog
DlgTextareaName : "Navn",
DlgTextareaCols : "Kolonner",
DlgTextareaRows : "Rader",
 
// Text Field Dialog
DlgTextName : "Navn",
DlgTextValue : "verdi",
DlgTextCharWidth : "Tegnbredde",
DlgTextMaxChars : "Maks antall tegn",
DlgTextType : "Type",
DlgTextTypeText : "Tekst",
DlgTextTypePass : "Passord",
 
// Hidden Field Dialog
DlgHiddenName : "Navn",
DlgHiddenValue : "Verdi",
 
// Bulleted List Dialog
BulletedListProp : "Uordnet listeegenskaper",
NumberedListProp : "Ordnet listeegenskaper",
DlgLstStart : "Start", //MISSING
DlgLstType : "Type",
DlgLstTypeCircle : "Sirkel",
DlgLstTypeDisc : "Hel sirkel",
DlgLstTypeSquare : "Firkant",
DlgLstTypeNumbers : "Numre(1, 2, 3)",
DlgLstTypeLCase : "Små bokstaver (a, b, c)",
DlgLstTypeUCase : "Store bokstaver(A, B, C)",
DlgLstTypeSRoman : "Små romerske tall(i, ii, iii)",
DlgLstTypeLRoman : "Store romerske tall(I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "Generalt",
DlgDocBackTab : "Bakgrunn",
DlgDocColorsTab : "Farger og marginer",
DlgDocMetaTab : "Meta Data",
 
DlgDocPageTitle : "Sidetittel",
DlgDocLangDir : "Språkretning",
DlgDocLangDirLTR : "Venstre til høyre (LTR)",
DlgDocLangDirRTL : "Høyre til venstre (RTL)",
DlgDocLangCode : "Språkkode",
DlgDocCharSet : "Tegnsett",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "Annet tegnsett",
 
DlgDocDocType : "Dokumenttype header",
DlgDocDocTypeOther : "Annet dokumenttype header",
DlgDocIncXHTML : "Inkulder XHTML deklarasjon",
DlgDocBgColor : "Bakgrunnsfarge",
DlgDocBgImage : "Bakgrunnsbilde url",
DlgDocBgNoScroll : "Ikke scroll bakgrunnsbilde",
DlgDocCText : "Tekst",
DlgDocCLink : "Link",
DlgDocCVisited : "Besøkt lenke",
DlgDocCActive : "Aktiv lenke",
DlgDocMargins : "Sidemargin",
DlgDocMaTop : "Topp",
DlgDocMaLeft : "Venstre",
DlgDocMaRight : "Høyre",
DlgDocMaBottom : "Bunn",
DlgDocMeIndex : "Dokument nøkkelord (kommaseparert)",
DlgDocMeDescr : "Dokumentbeskrivelse",
DlgDocMeAuthor : "Forfatter",
DlgDocMeCopy : "Kopirett",
DlgDocPreview : "Forhåndsvising",
 
// Templates Dialog
Templates : "Maler",
DlgTemplatesTitle : "Innholdsmaler",
DlgTemplatesSelMsg : "Velg malen du vil åpne<br>(innholdet du har skrevet blir tapt!):",
DlgTemplatesLoading : "Laster malliste. Vennligst vent...",
DlgTemplatesNoTpl : "(Ingen maler definert)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "Om",
DlgAboutBrowserInfoTab : "Nettleserinfo",
DlgAboutLicenseTab : "Lisens",
DlgAboutVersion : "versjon",
DlgAboutLicense : "Lisensiert under GNU Lesser General Public License",
DlgAboutInfo : "Oversatt av Siteman AS<br /><a target=\"_blank\" href=\"http://www.siteman.no\">www.siteman.no</a><br /><br />For mer informasjon gå til"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/el.js
New file
0,0 → 1,502
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: el.js
* Greek language file.
*
* File Authors:
* Vangelis Bibakis (bibakisv[-a-t-]yahoo.com)
* Spyros Barbatos (sbarbatos{at}users.sourceforge.net)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Απόκρυψη Μπάρας Εργαλείων",
ToolbarExpand : "Εμφάνιση Μπάρας Εργαλείων",
 
// Toolbar Items and Context Menu
Save : "Αποθήκευση",
NewPage : "Νέα Σελίδα",
Preview : "Προεπισκόπιση",
Cut : "Αποκοπή",
Copy : "Αντιγραφή",
Paste : "Επικόλληση",
PasteText : "Επικόλληση (απλό κείμενο)",
PasteWord : "Επικόλληση από το Word",
Print : "Εκτύπωση",
SelectAll : "Επιλογή όλων",
RemoveFormat : "Αφαίρεση Μορφοποίησης",
InsertLinkLbl : "Σύνδεσμος (Link)",
InsertLink : "Εισαγωγή/Μεταβολή Συνδέσμου (Link)",
RemoveLink : "Αφαίρεση Συνδέσμου (Link)",
Anchor : "Εισαγωγή/επεξεργασία Anchor",
InsertImageLbl : "Εικόνα",
InsertImage : "Εισαγωγή/Μεταβολή Εικόνας",
InsertFlashLbl : "Εισαγωγή Flash",
InsertFlash : "Εισαγωγή/επεξεργασία Flash",
InsertTableLbl : "Πίνακας",
InsertTable : "Εισαγωγή/Μεταβολή Πίνακα",
InsertLineLbl : "Γραμμή",
InsertLine : "Εισαγωγή Οριζόντιας Γραμμής",
InsertSpecialCharLbl: "Ειδικό Σύμβολο",
InsertSpecialChar : "Εισαγωγή Ειδικού Συμβόλου",
InsertSmileyLbl : "Smiley",
InsertSmiley : "Εισαγωγή Smiley",
About : "Περί του FCKeditor",
Bold : "Έντονα",
Italic : "Πλάγια",
Underline : "Υπογράμμιση",
StrikeThrough : "Διαγράμμιση",
Subscript : "Δείκτης",
Superscript : "Εκθέτης",
LeftJustify : "Στοίχιση Αριστερά",
CenterJustify : "Στοίχιση στο Κέντρο",
RightJustify : "Στοίχιση Δεξιά",
BlockJustify : "Πλήρης Στοίχιση (Block)",
DecreaseIndent : "Μείωση Εσοχής",
IncreaseIndent : "Αύξηση Εσοχής",
Undo : "Αναίρεση",
Redo : "Επαναφορά",
NumberedListLbl : "Λίστα με Αριθμούς",
NumberedList : "Εισαγωγή/Διαγραφή Λίστας με Αριθμούς",
BulletedListLbl : "Λίστα με Bullets",
BulletedList : "Εισαγωγή/Διαγραφή Λίστας με Bullets",
ShowTableBorders : "Προβολή Ορίων Πίνακα",
ShowDetails : "Προβολή Λεπτομερειών",
Style : "Στυλ",
FontFormat : "Μορφή Γραμματοσειράς",
Font : "Γραμματοσειρά",
FontSize : "Μέγεθος",
TextColor : "Χρώμα Γραμμάτων",
BGColor : "Χρώμα Υποβάθρου",
Source : "HTML κώδικας",
Find : "Αναζήτηση",
Replace : "Αντικατάσταση",
SpellCheck : "Ορθογραφικός έλεγχος",
UniversalKeyboard : "Διεθνής πληκτρολόγιο",
PageBreakLbl : "Τέλος σελίδας",
PageBreak : "Εισαγωγή τέλους σελίδας",
 
Form : "Φόρμα",
Checkbox : "Κουτί επιλογής",
RadioButton : "Κουμπί Radio",
TextField : "Πεδίο κειμένου",
Textarea : "Περιοχή κειμένου",
HiddenField : "Κρυφό πεδίο",
Button : "Κουμπί",
SelectionField : "Πεδίο επιλογής",
ImageButton : "Κουμπί εικόνας",
 
FitWindow : "Μεγιστοποίηση προγράμματος",
 
// Context Menu
EditLink : "Μεταβολή Συνδέσμου (Link)",
CellCM : "Κελί",
RowCM : "Σειρά",
ColumnCM : "Στήλη",
InsertRow : "Εισαγωγή Γραμμής",
DeleteRows : "Διαγραφή Γραμμών",
InsertColumn : "Εισαγωγή Κολώνας",
DeleteColumns : "Διαγραφή Κολωνών",
InsertCell : "Εισαγωγή Κελιού",
DeleteCells : "Διαγραφή Κελιών",
MergeCells : "Ενοποίηση Κελιών",
SplitCell : "Διαχωρισμός Κελιού",
TableDelete : "Διαγραφή πίνακα",
CellProperties : "Ιδιότητες Κελιού",
TableProperties : "Ιδιότητες Πίνακα",
ImageProperties : "Ιδιότητες Εικόνας",
FlashProperties : "Ιδιότητες Flash",
 
AnchorProp : "Ιδιότητες άγκυρας",
ButtonProp : "Ιδιότητες κουμπιού",
CheckboxProp : "Ιδιότητες κουμπιού επιλογής",
HiddenFieldProp : "Ιδιότητες κρυφού πεδίου",
RadioButtonProp : "Ιδιότητες κουμπιού radio",
ImageButtonProp : "Ιδιότητες κουμπιού εικόνας",
TextFieldProp : "Ιδιότητες πεδίου κειμένου",
SelectionFieldProp : "Ιδιότητες πεδίου επιλογής",
TextareaProp : "Ιδιότητες περιοχής κειμένου",
FormProp : "Ιδιότητες φόρμας",
 
FontFormats : "Κανονικό;Μορφοποιημένο;Διεύθυνση;Επικεφαλίδα 1;Επικεφαλίδα 2;Επικεφαλίδα 3;Επικεφαλίδα 4;Επικεφαλίδα 5;Επικεφαλίδα 6",
 
// Alerts and Messages
ProcessingXHTML : "Επεξεργασία XHTML. Παρακαλώ περιμένετε...",
Done : "Έτοιμο",
PasteWordConfirm : "Το κείμενο που θέλετε να επικολήσετε, φαίνεται πως προέρχεται από το Word. Θέλετε να καθαριστεί πριν επικοληθεί;",
NotCompatiblePaste : "Αυτή η επιλογή είναι διαθέσιμη στον Internet Explorer έκδοση 5.5+. Θέλετε να γίνει η επικόλληση χωρίς καθαρισμό;",
UnknownToolbarItem : "Άγνωστο αντικείμενο της μπάρας εργαλείων \"%1\"",
UnknownCommand : "Άγνωστή εντολή \"%1\"",
NotImplemented : "Η εντολή δεν έχει ενεργοποιηθεί",
UnknownToolbarSet : "Η μπάρα εργαλείων \"%1\" δεν υπάρχει",
NoActiveX : "Οι ρυθμίσεις ασφαλείας του browser σας μπορεί να περιορίσουν κάποιες ρυθμίσεις του προγράμματος. Χρειάζεται να ενεργοποιήσετε την επιλογή \"Run ActiveX controls and plug-ins\". Ίσως παρουσιαστούν λάθη και παρατηρήσετε ελειπείς λειτουργίες.",
BrowseServerBlocked : "Οι πόροι του browser σας δεν είναι προσπελάσιμοι. Σιγουρευτείτε ότι δεν υπάρχουν ενεργοί popup blockers.",
DialogBlocked : "Δεν ήταν δυνατό να ανοίξει το παράθυρο διαλόγου. Σιγουρευτείτε ότι δεν υπάρχουν ενεργοί popup blockers.",
 
// Dialogs
DlgBtnOK : "OK",
DlgBtnCancel : "Ακύρωση",
DlgBtnClose : "Κλείσιμο",
DlgBtnBrowseServer : "Εξερεύνηση διακομιστή",
DlgAdvancedTag : "Για προχωρημένους",
DlgOpOther : "<Άλλα>",
DlgInfoTab : "Πληροφορίες",
DlgAlertUrl : "Παρακαλώ εισάγετε URL",
 
// General Dialogs Labels
DlgGenNotSet : "<χωρίς>",
DlgGenId : "Id",
DlgGenLangDir : "Κατεύθυνση κειμένου",
DlgGenLangDirLtr : "Αριστερά προς Δεξιά (LTR)",
DlgGenLangDirRtl : "Δεξιά προς Αριστερά (RTL)",
DlgGenLangCode : "Κωδικός Γλώσσας",
DlgGenAccessKey : "Συντόμευση (Access Key)",
DlgGenName : "Όνομα",
DlgGenTabIndex : "Tab Index",
DlgGenLongDescr : "Αναλυτική περιγραφή URL",
DlgGenClass : "Stylesheet Classes",
DlgGenTitle : "Συμβουλευτικός τίτλος",
DlgGenContType : "Συμβουλευτικός τίτλος περιεχομένου",
DlgGenLinkCharset : "Linked Resource Charset",
DlgGenStyle : "Στύλ",
 
// Image Dialog
DlgImgTitle : "Ιδιότητες Εικόνας",
DlgImgInfoTab : "Πληροφορίες Εικόνας",
DlgImgBtnUpload : "Αποστολή στον Διακομιστή",
DlgImgURL : "URL",
DlgImgUpload : "Αποστολή",
DlgImgAlt : "Εναλλακτικό Κείμενο (ALT)",
DlgImgWidth : "Πλάτος",
DlgImgHeight : "Ύψος",
DlgImgLockRatio : "Κλείδωμα Αναλογίας",
DlgBtnResetSize : "Επαναφορά Αρχικού Μεγέθους",
DlgImgBorder : "Περιθώριο",
DlgImgHSpace : "Οριζόντιος Χώρος (HSpace)",
DlgImgVSpace : "Κάθετος Χώρος (VSpace)",
DlgImgAlign : "Ευθυγράμμιση (Align)",
DlgImgAlignLeft : "Αριστερά",
DlgImgAlignAbsBottom: "Απόλυτα Κάτω (Abs Bottom)",
DlgImgAlignAbsMiddle: "Απόλυτα στη Μέση (Abs Middle)",
DlgImgAlignBaseline : "Γραμμή Βάσης (Baseline)",
DlgImgAlignBottom : "Κάτω (Bottom)",
DlgImgAlignMiddle : "Μέση (Middle)",
DlgImgAlignRight : "Δεξιά (Right)",
DlgImgAlignTextTop : "Κορυφή Κειμένου (Text Top)",
DlgImgAlignTop : "Πάνω (Top)",
DlgImgPreview : "Προεπισκόπιση",
DlgImgAlertUrl : "Εισάγετε την τοποθεσία (URL) της εικόνας",
DlgImgLinkTab : "Σύνδεσμος",
 
// Flash Dialog
DlgFlashTitle : "Ιδιότητες flash",
DlgFlashChkPlay : "Αυτόματη έναρξη",
DlgFlashChkLoop : "Επανάληψη",
DlgFlashChkMenu : "Ενεργοποίηση Flash Menu",
DlgFlashScale : "Κλίμακα",
DlgFlashScaleAll : "Εμφάνιση όλων",
DlgFlashScaleNoBorder : "Χωρίς όρια",
DlgFlashScaleFit : "Ακριβής εφαρμογή",
 
// Link Dialog
DlgLnkWindowTitle : "Σύνδεσμος (Link)",
DlgLnkInfoTab : "Link",
DlgLnkTargetTab : "Παράθυρο Στόχος (Target)",
 
DlgLnkType : "Τύπος συνδέσμου (Link)",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Άγκυρα σε αυτή τη σελίδα",
DlgLnkTypeEMail : "E-Mail",
DlgLnkProto : "Προτόκολο",
DlgLnkProtoOther : "<άλλο>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Επιλέξτε μια άγκυρα",
DlgLnkAnchorByName : "Βάσει του Ονόματος (Name) της άγκυρας",
DlgLnkAnchorById : "Βάσει του Element Id",
DlgLnkNoAnchors : "<Δεν υπάρχουν άγκυρες στο κείμενο>",
DlgLnkEMail : "Διεύθυνση Ηλεκτρονικού Ταχυδρομείου",
DlgLnkEMailSubject : "Θέμα Μηνύματος",
DlgLnkEMailBody : "Κείμενο Μηνύματος",
DlgLnkUpload : "Αποστολή",
DlgLnkBtnUpload : "Αποστολή στον Διακομιστή",
 
DlgLnkTarget : "Παράθυρο Στόχος (Target)",
DlgLnkTargetFrame : "<πλαίσιο>",
DlgLnkTargetPopup : "<παράθυρο popup>",
DlgLnkTargetBlank : "Νέο Παράθυρο (_blank)",
DlgLnkTargetParent : "Γονικό Παράθυρο (_parent)",
DlgLnkTargetSelf : "Ίδιο Παράθυρο (_self)",
DlgLnkTargetTop : "Ανώτατο Παράθυρο (_top)",
DlgLnkTargetFrameName : "Όνομα πλαισίου στόχου",
DlgLnkPopWinName : "Όνομα Popup Window",
DlgLnkPopWinFeat : "Επιλογές Popup Window",
DlgLnkPopResize : "Με αλλαγή Μεγέθους",
DlgLnkPopLocation : "Μπάρα Τοποθεσίας",
DlgLnkPopMenu : "Μπάρα Menu",
DlgLnkPopScroll : "Μπάρες Κύλισης",
DlgLnkPopStatus : "Μπάρα Status",
DlgLnkPopToolbar : "Μπάρα Εργαλείων",
DlgLnkPopFullScrn : "Ολόκληρη η Οθόνη (IE)",
DlgLnkPopDependent : "Dependent (Netscape)",
DlgLnkPopWidth : "Πλάτος",
DlgLnkPopHeight : "Ύψος",
DlgLnkPopLeft : "Τοποθεσία Αριστερής Άκρης",
DlgLnkPopTop : "Τοποθεσία Πάνω Άκρης",
 
DlnLnkMsgNoUrl : "Εισάγετε την τοποθεσία (URL) του υπερσυνδέσμου (Link)",
DlnLnkMsgNoEMail : "Εισάγετε την διεύθυνση ηλεκτρονικού ταχυδρομείου",
DlnLnkMsgNoAnchor : "Επιλέξτε ένα Anchor",
DlnLnkMsgInvPopName : "Το όνομα του popup πρέπει να αρχίζει με χαρακτήρα της αλφαβήτου και να μην περιέχει κενά",
 
// Color Dialog
DlgColorTitle : "Επιλογή χρώματος",
DlgColorBtnClear : "Καθαρισμός",
DlgColorHighlight : "Προεπισκόπιση",
DlgColorSelected : "Επιλεγμένο",
 
// Smiley Dialog
DlgSmileyTitle : "Επιλέξτε ένα Smiley",
 
// Special Character Dialog
DlgSpecialCharTitle : "Επιλέξτε ένα Ειδικό Σύμβολο",
 
// Table Dialog
DlgTableTitle : "Ιδιότητες Πίνακα",
DlgTableRows : "Γραμμές",
DlgTableColumns : "Κολώνες",
DlgTableBorder : "Μέγεθος Περιθωρίου",
DlgTableAlign : "Στοίχιση",
DlgTableAlignNotSet : "<χωρίς>",
DlgTableAlignLeft : "Αριστερά",
DlgTableAlignCenter : "Κέντρο",
DlgTableAlignRight : "Δεξιά",
DlgTableWidth : "Πλάτος",
DlgTableWidthPx : "pixels",
DlgTableWidthPc : "\%",
DlgTableHeight : "Ύψος",
DlgTableCellSpace : "Απόσταση κελιών",
DlgTableCellPad : "Γέμισμα κελιών",
DlgTableCaption : "Υπέρτιτλος",
DlgTableSummary : "Περίληψη",
 
// Table Cell Dialog
DlgCellTitle : "Ιδιότητες Κελιού",
DlgCellWidth : "Πλάτος",
DlgCellWidthPx : "pixels",
DlgCellWidthPc : "\%",
DlgCellHeight : "Ύψος",
DlgCellWordWrap : "Με αλλαγή γραμμής",
DlgCellWordWrapNotSet : "<χωρίς>",
DlgCellWordWrapYes : "Ναι",
DlgCellWordWrapNo : "Όχι",
DlgCellHorAlign : "Οριζόντια Στοίχιση",
DlgCellHorAlignNotSet : "<χωρίς>",
DlgCellHorAlignLeft : "Αριστερά",
DlgCellHorAlignCenter : "Κέντρο",
DlgCellHorAlignRight: "Δεξιά",
DlgCellVerAlign : "Κάθετη Στοίχιση",
DlgCellVerAlignNotSet : "<χωρίς>",
DlgCellVerAlignTop : "Πάνω (Top)",
DlgCellVerAlignMiddle : "Μέση (Middle)",
DlgCellVerAlignBottom : "Κάτω (Bottom)",
DlgCellVerAlignBaseline : "Γραμμή Βάσης (Baseline)",
DlgCellRowSpan : "Αριθμός Γραμμών (Rows Span)",
DlgCellCollSpan : "Αριθμός Κολωνών (Columns Span)",
DlgCellBackColor : "Χρώμα Υποβάθρου",
DlgCellBorderColor : "Χρώμα Περιθωρίου",
DlgCellBtnSelect : "Επιλογή...",
 
// Find Dialog
DlgFindTitle : "Αναζήτηση",
DlgFindFindBtn : "Αναζήτηση",
DlgFindNotFoundMsg : "Το κείμενο δεν βρέθηκε.",
 
// Replace Dialog
DlgReplaceTitle : "Αντικατάσταση",
DlgReplaceFindLbl : "Αναζήτηση:",
DlgReplaceReplaceLbl : "Αντικατάσταση με:",
DlgReplaceCaseChk : "Έλεγχος πεζών/κεφαλαίων",
DlgReplaceReplaceBtn : "Αντικατάσταση",
DlgReplaceReplAllBtn : "Αντικατάσταση Όλων",
DlgReplaceWordChk : "Εύρεση πλήρους λέξης",
 
// Paste Operations / Dialog
PasteErrorPaste : "Οι ρυθμίσεις ασφαλείας του φυλλομετρητή σας δεν επιτρέπουν την επιλεγμένη εργασία επικόλλησης. Χρησιμοποιείστε το πληκτρολόγιο (Ctrl+V).",
PasteErrorCut : "Οι ρυθμίσεις ασφαλείας του φυλλομετρητή σας δεν επιτρέπουν την επιλεγμένη εργασία αποκοπής. Χρησιμοποιείστε το πληκτρολόγιο (Ctrl+X).",
PasteErrorCopy : "Οι ρυθμίσεις ασφαλείας του φυλλομετρητή σας δεν επιτρέπουν την επιλεγμένη εργασία αντιγραφής. Χρησιμοποιείστε το πληκτρολόγιο (Ctrl+C).",
 
PasteAsText : "Επικόλληση ως Απλό Κείμενο",
PasteFromWord : "Επικόλληση από το Word",
 
DlgPasteMsg2 : "Παρακαλώ επικολήστε στο ακόλουθο κουτί χρησιμοποιόντας το πληκτρολόγιο (<STRONG>Ctrl+V</STRONG>) και πατήστε <STRONG>OK</STRONG>.",
DlgPasteIgnoreFont : "Αγνόηση προδιαγραφών γραμματοσειράς",
DlgPasteRemoveStyles : "Αφαίρεση προδιαγραφών στύλ",
DlgPasteCleanBox : "Κουτί εκαθάρισης",
 
// Color Picker
ColorAutomatic : "Αυτόματο",
ColorMoreColors : "Περισσότερα χρώματα...",
 
// Document Properties
DocProps : "Ιδιότητες εγγράφου",
 
// Anchor Dialog
DlgAnchorTitle : "Ιδιότητες άγκυρας",
DlgAnchorName : "Όνομα άγκυρας",
DlgAnchorErrorName : "Παρακαλούμε εισάγετε όνομα άγκυρας",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Δεν υπάρχει στο λεξικό",
DlgSpellChangeTo : "Αλλαγή σε",
DlgSpellBtnIgnore : "Αγνόηση",
DlgSpellBtnIgnoreAll : "Αγνόηση όλων",
DlgSpellBtnReplace : "Αντικατάσταση",
DlgSpellBtnReplaceAll : "Αντικατάσταση όλων",
DlgSpellBtnUndo : "Αναίρεση",
DlgSpellNoSuggestions : "- Δεν υπάρχουν προτάσεις -",
DlgSpellProgress : "Ορθογραφικός έλεγχος σε εξέλιξη...",
DlgSpellNoMispell : "Ο ορθογραφικός έλεγχος ολοκληρώθηκε: Δεν βρέθηκαν λάθη",
DlgSpellNoChanges : "Ο ορθογραφικός έλεγχος ολοκληρώθηκε: Δεν άλλαξαν λέξεις",
DlgSpellOneChange : "Ο ορθογραφικός έλεγχος ολοκληρώθηκε: Μια λέξη άλλαξε",
DlgSpellManyChanges : "Ο ορθογραφικός έλεγχος ολοκληρώθηκε: %1 λέξεις άλλαξαν",
 
IeSpellDownload : "Δεν υπάρχει εγκατεστημένος ορθογράφος. Θέλετε να τον κατεβάσετε τώρα;",
 
// Button Dialog
DlgButtonText : "Κείμενο (Τιμή)",
DlgButtonType : "Τύπος",
DlgButtonTypeBtn : "Κουμπί",
DlgButtonTypeSbm : "Καταχώρηση",
DlgButtonTypeRst : "Επαναφορά",
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Όνομα",
DlgCheckboxValue : "Τιμή",
DlgCheckboxSelected : "Επιλεγμένο",
 
// Form Dialog
DlgFormName : "Όνομα",
DlgFormAction : "Δράση",
DlgFormMethod : "Μάθοδος",
 
// Select Field Dialog
DlgSelectName : "Όνομα",
DlgSelectValue : "Τιμή",
DlgSelectSize : "Μέγεθος",
DlgSelectLines : "γραμμές",
DlgSelectChkMulti : "Πολλαπλές επιλογές",
DlgSelectOpAvail : "Διαθέσιμες επιλογές",
DlgSelectOpText : "Κείμενο",
DlgSelectOpValue : "Τιμή",
DlgSelectBtnAdd : "Προσθήκη",
DlgSelectBtnModify : "Αλλαγή",
DlgSelectBtnUp : "Πάνω",
DlgSelectBtnDown : "Κάτω",
DlgSelectBtnSetValue : "Προεπιλεγμένη επιλογή",
DlgSelectBtnDelete : "Διαγραφή",
 
// Textarea Dialog
DlgTextareaName : "Όνομα",
DlgTextareaCols : "Στήλες",
DlgTextareaRows : "Σειρές",
 
// Text Field Dialog
DlgTextName : "Όνομα",
DlgTextValue : "Τιμή",
DlgTextCharWidth : "Μήκος χαρακτήρων",
DlgTextMaxChars : "Μέγιστοι χαρακτήρες",
DlgTextType : "Τύπος",
DlgTextTypeText : "Κείμενο",
DlgTextTypePass : "Κωδικός",
 
// Hidden Field Dialog
DlgHiddenName : "Όνομα",
DlgHiddenValue : "Τιμή",
 
// Bulleted List Dialog
BulletedListProp : "Ιδιότητες λίστας Bulleted",
NumberedListProp : "Ιδιότητες αριθμημένης λίστας ",
DlgLstStart : "Αρχή",
DlgLstType : "Τύπος",
DlgLstTypeCircle : "Κύκλος",
DlgLstTypeDisc : "Δίσκος",
DlgLstTypeSquare : "Τετράγωνο",
DlgLstTypeNumbers : "Αριθμοί (1, 2, 3)",
DlgLstTypeLCase : "Πεζά γράμματα (a, b, c)",
DlgLstTypeUCase : "Κεφαλαία γράμματα (A, B, C)",
DlgLstTypeSRoman : "Μικρά λατινικά αριθμητικά (i, ii, iii)",
DlgLstTypeLRoman : "Μεγάλα λατινικά αριθμητικά (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "Γενικά",
DlgDocBackTab : "Φόντο",
DlgDocColorsTab : "Χρώματα και περιθώρια",
DlgDocMetaTab : "Δεδομένα Meta",
 
DlgDocPageTitle : "Τίτλος σελίδας",
DlgDocLangDir : "Κατεύθυνση γραφής",
DlgDocLangDirLTR : "αριστερά προς δεξιά (LTR)",
DlgDocLangDirRTL : "δεξιά προς αριστερά (RTL)",
DlgDocLangCode : "Κωδικός γλώσσας",
DlgDocCharSet : "Κωδικοποίηση χαρακτήρων",
DlgDocCharSetCE : "Κεντρικής Ευρώπης",
DlgDocCharSetCT : "Παραδοσιακά κινέζικα (Big5)",
DlgDocCharSetCR : "Κυριλλική",
DlgDocCharSetGR : "Ελληνική",
DlgDocCharSetJP : "Ιαπωνική",
DlgDocCharSetKR : "Κορεάτικη",
DlgDocCharSetTR : "Τουρκική",
DlgDocCharSetUN : "Διεθνής (UTF-8)",
DlgDocCharSetWE : "Δυτικής Ευρώπης",
DlgDocCharSetOther : "Άλλη κωδικοποίηση χαρακτήρων",
 
DlgDocDocType : "Επικεφαλίδα τύπου εγγράφου",
DlgDocDocTypeOther : "Άλλη επικεφαλίδα τύπου εγγράφου",
DlgDocIncXHTML : "Να συμπεριληφθούν οι δηλώσεις XHTML",
DlgDocBgColor : "Χρώμα φόντου",
DlgDocBgImage : "Διεύθυνση εικόνας φόντου",
DlgDocBgNoScroll : "Φόντο χωρίς κύλιση",
DlgDocCText : "Κείμενο",
DlgDocCLink : "Σύνδεσμος",
DlgDocCVisited : "Σύνδεσμος που έχει επισκευθεί",
DlgDocCActive : "Ενεργός σύνδεσμος",
DlgDocMargins : "Περιθώρια σελίδας",
DlgDocMaTop : "Κορυφή",
DlgDocMaLeft : "Αριστερά",
DlgDocMaRight : "Δεξιά",
DlgDocMaBottom : "Κάτω",
DlgDocMeIndex : "Λέξεις κλειδιά δείκτες εγγράφου (διαχωρισμός με κόμμα)",
DlgDocMeDescr : "Περιγραφή εγγράφου",
DlgDocMeAuthor : "Συγγραφέας",
DlgDocMeCopy : "Πνευματικά δικαιώματα",
DlgDocPreview : "Προεπισκόπηση",
 
// Templates Dialog
Templates : "Πρότυπα",
DlgTemplatesTitle : "Πρότυπα περιεχομένου",
DlgTemplatesSelMsg : "Παρακαλώ επιλέξτε πρότυπο για εισαγωγή στο πρόγραμμα<br>(τα υπάρχοντα περιεχόμενα θα χαθούν):",
DlgTemplatesLoading : "Φόρτωση καταλόγου προτύπων. Παρακαλώ περιμένετε...",
DlgTemplatesNoTpl : "(Δεν έχουν καθοριστεί πρότυπα)",
DlgTemplatesReplace : "Αντικατάσταση υπάρχοντων περιεχομένων",
 
// About Dialog
DlgAboutAboutTab : "Σχετικά",
DlgAboutBrowserInfoTab : "Πληροφορίες Browser",
DlgAboutLicenseTab : "Άδεια",
DlgAboutVersion : "έκδοση",
DlgAboutLicense : "Άδεια χρήσης υπό τους όρους της GNU Lesser General Public License",
DlgAboutInfo : "Για περισσότερες πληροφορίες"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/en.js
New file
0,0 → 1,501
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: en.js
* English language file.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Collapse Toolbar",
ToolbarExpand : "Expand Toolbar",
 
// Toolbar Items and Context Menu
Save : "Save",
NewPage : "New Page",
Preview : "Preview",
Cut : "Cut",
Copy : "Copy",
Paste : "Paste",
PasteText : "Paste as plain text",
PasteWord : "Paste from Word",
Print : "Print",
SelectAll : "Select All",
RemoveFormat : "Remove Format",
InsertLinkLbl : "Link",
InsertLink : "Insert/Edit Link",
RemoveLink : "Remove Link",
Anchor : "Insert/Edit Anchor",
InsertImageLbl : "Image",
InsertImage : "Insert/Edit Image",
InsertFlashLbl : "Flash",
InsertFlash : "Insert/Edit Flash",
InsertTableLbl : "Table",
InsertTable : "Insert/Edit Table",
InsertLineLbl : "Line",
InsertLine : "Insert Horizontal Line",
InsertSpecialCharLbl: "Special Character",
InsertSpecialChar : "Insert Special Character",
InsertSmileyLbl : "Smiley",
InsertSmiley : "Insert Smiley",
About : "About FCKeditor",
Bold : "Bold",
Italic : "Italic",
Underline : "Underline",
StrikeThrough : "Strike Through",
Subscript : "Subscript",
Superscript : "Superscript",
LeftJustify : "Left Justify",
CenterJustify : "Center Justify",
RightJustify : "Right Justify",
BlockJustify : "Block Justify",
DecreaseIndent : "Decrease Indent",
IncreaseIndent : "Increase Indent",
Undo : "Undo",
Redo : "Redo",
NumberedListLbl : "Numbered List",
NumberedList : "Insert/Remove Numbered List",
BulletedListLbl : "Bulleted List",
BulletedList : "Insert/Remove Bulleted List",
ShowTableBorders : "Show Table Borders",
ShowDetails : "Show Details",
Style : "Style",
FontFormat : "Format",
Font : "Font",
FontSize : "Size",
TextColor : "Text Color",
BGColor : "Background Color",
Source : "Source",
Find : "Find",
Replace : "Replace",
SpellCheck : "Check Spelling",
UniversalKeyboard : "Universal Keyboard",
PageBreakLbl : "Page Break",
PageBreak : "Insert Page Break",
 
Form : "Form",
Checkbox : "Checkbox",
RadioButton : "Radio Button",
TextField : "Text Field",
Textarea : "Textarea",
HiddenField : "Hidden Field",
Button : "Button",
SelectionField : "Selection Field",
ImageButton : "Image Button",
 
FitWindow : "Maximize the editor size",
 
// Context Menu
EditLink : "Edit Link",
CellCM : "Cell",
RowCM : "Row",
ColumnCM : "Column",
InsertRow : "Insert Row",
DeleteRows : "Delete Rows",
InsertColumn : "Insert Column",
DeleteColumns : "Delete Columns",
InsertCell : "Insert Cell",
DeleteCells : "Delete Cells",
MergeCells : "Merge Cells",
SplitCell : "Split Cell",
TableDelete : "Delete Table",
CellProperties : "Cell Properties",
TableProperties : "Table Properties",
ImageProperties : "Image Properties",
FlashProperties : "Flash Properties",
 
AnchorProp : "Anchor Properties",
ButtonProp : "Button Properties",
CheckboxProp : "Checkbox Properties",
HiddenFieldProp : "Hidden Field Properties",
RadioButtonProp : "Radio Button Properties",
ImageButtonProp : "Image Button Properties",
TextFieldProp : "Text Field Properties",
SelectionFieldProp : "Selection Field Properties",
TextareaProp : "Textarea Properties",
FormProp : "Form Properties",
 
FontFormats : "Normal;Formatted;Address;Heading 1;Heading 2;Heading 3;Heading 4;Heading 5;Heading 6;Normal (DIV)",
 
// Alerts and Messages
ProcessingXHTML : "Processing XHTML. Please wait...",
Done : "Done",
PasteWordConfirm : "The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?",
NotCompatiblePaste : "This command is available for Internet Explorer version 5.5 or more. Do you want to paste without cleaning?",
UnknownToolbarItem : "Unknown toolbar item \"%1\"",
UnknownCommand : "Unknown command name \"%1\"",
NotImplemented : "Command not implemented",
UnknownToolbarSet : "Toolbar set \"%1\" doesn't exist",
NoActiveX : "Your browser's security settings could limit some features of the editor. You must enable the option \"Run ActiveX controls and plug-ins\". You may experience errors and notice missing features.",
BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.",
DialogBlocked : "It was not possible to open the dialog window. Make sure all popup blockers are disabled.",
 
// Dialogs
DlgBtnOK : "OK",
DlgBtnCancel : "Cancel",
DlgBtnClose : "Close",
DlgBtnBrowseServer : "Browse Server",
DlgAdvancedTag : "Advanced",
DlgOpOther : "<Other>",
DlgInfoTab : "Info",
DlgAlertUrl : "Please insert the URL",
 
// General Dialogs Labels
DlgGenNotSet : "<not set>",
DlgGenId : "Id",
DlgGenLangDir : "Language Direction",
DlgGenLangDirLtr : "Left to Right (LTR)",
DlgGenLangDirRtl : "Right to Left (RTL)",
DlgGenLangCode : "Language Code",
DlgGenAccessKey : "Access Key",
DlgGenName : "Name",
DlgGenTabIndex : "Tab Index",
DlgGenLongDescr : "Long Description URL",
DlgGenClass : "Stylesheet Classes",
DlgGenTitle : "Advisory Title",
DlgGenContType : "Advisory Content Type",
DlgGenLinkCharset : "Linked Resource Charset",
DlgGenStyle : "Style",
 
// Image Dialog
DlgImgTitle : "Image Properties",
DlgImgInfoTab : "Image Info",
DlgImgBtnUpload : "Send it to the Server",
DlgImgURL : "URL",
DlgImgUpload : "Upload",
DlgImgAlt : "Alternative Text",
DlgImgWidth : "Width",
DlgImgHeight : "Height",
DlgImgLockRatio : "Lock Ratio",
DlgBtnResetSize : "Reset Size",
DlgImgBorder : "Border",
DlgImgHSpace : "HSpace",
DlgImgVSpace : "VSpace",
DlgImgAlign : "Align",
DlgImgAlignLeft : "Left",
DlgImgAlignAbsBottom: "Abs Bottom",
DlgImgAlignAbsMiddle: "Abs Middle",
DlgImgAlignBaseline : "Baseline",
DlgImgAlignBottom : "Bottom",
DlgImgAlignMiddle : "Middle",
DlgImgAlignRight : "Right",
DlgImgAlignTextTop : "Text Top",
DlgImgAlignTop : "Top",
DlgImgPreview : "Preview",
DlgImgAlertUrl : "Please type the image URL",
DlgImgLinkTab : "Link",
 
// Flash Dialog
DlgFlashTitle : "Flash Properties",
DlgFlashChkPlay : "Auto Play",
DlgFlashChkLoop : "Loop",
DlgFlashChkMenu : "Enable Flash Menu",
DlgFlashScale : "Scale",
DlgFlashScaleAll : "Show all",
DlgFlashScaleNoBorder : "No Border",
DlgFlashScaleFit : "Exact Fit",
 
// Link Dialog
DlgLnkWindowTitle : "Link",
DlgLnkInfoTab : "Link Info",
DlgLnkTargetTab : "Target",
 
DlgLnkType : "Link Type",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Link to anchor in the text",
DlgLnkTypeEMail : "E-Mail",
DlgLnkProto : "Protocol",
DlgLnkProtoOther : "<other>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Select an Anchor",
DlgLnkAnchorByName : "By Anchor Name",
DlgLnkAnchorById : "By Element Id",
DlgLnkNoAnchors : "<No anchors available in the document>",
DlgLnkEMail : "E-Mail Address",
DlgLnkEMailSubject : "Message Subject",
DlgLnkEMailBody : "Message Body",
DlgLnkUpload : "Upload",
DlgLnkBtnUpload : "Send it to the Server",
 
DlgLnkTarget : "Target",
DlgLnkTargetFrame : "<frame>",
DlgLnkTargetPopup : "<popup window>",
DlgLnkTargetBlank : "New Window (_blank)",
DlgLnkTargetParent : "Parent Window (_parent)",
DlgLnkTargetSelf : "Same Window (_self)",
DlgLnkTargetTop : "Topmost Window (_top)",
DlgLnkTargetFrameName : "Target Frame Name",
DlgLnkPopWinName : "Popup Window Name",
DlgLnkPopWinFeat : "Popup Window Features",
DlgLnkPopResize : "Resizable",
DlgLnkPopLocation : "Location Bar",
DlgLnkPopMenu : "Menu Bar",
DlgLnkPopScroll : "Scroll Bars",
DlgLnkPopStatus : "Status Bar",
DlgLnkPopToolbar : "Toolbar",
DlgLnkPopFullScrn : "Full Screen (IE)",
DlgLnkPopDependent : "Dependent (Netscape)",
DlgLnkPopWidth : "Width",
DlgLnkPopHeight : "Height",
DlgLnkPopLeft : "Left Position",
DlgLnkPopTop : "Top Position",
 
DlnLnkMsgNoUrl : "Please type the link URL",
DlnLnkMsgNoEMail : "Please type the e-mail address",
DlnLnkMsgNoAnchor : "Please select an anchor",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces",
 
// Color Dialog
DlgColorTitle : "Select Color",
DlgColorBtnClear : "Clear",
DlgColorHighlight : "Highlight",
DlgColorSelected : "Selected",
 
// Smiley Dialog
DlgSmileyTitle : "Insert a Smiley",
 
// Special Character Dialog
DlgSpecialCharTitle : "Select Special Character",
 
// Table Dialog
DlgTableTitle : "Table Properties",
DlgTableRows : "Rows",
DlgTableColumns : "Columns",
DlgTableBorder : "Border size",
DlgTableAlign : "Alignment",
DlgTableAlignNotSet : "<Not set>",
DlgTableAlignLeft : "Left",
DlgTableAlignCenter : "Center",
DlgTableAlignRight : "Right",
DlgTableWidth : "Width",
DlgTableWidthPx : "pixels",
DlgTableWidthPc : "percent",
DlgTableHeight : "Height",
DlgTableCellSpace : "Cell spacing",
DlgTableCellPad : "Cell padding",
DlgTableCaption : "Caption",
DlgTableSummary : "Summary",
 
// Table Cell Dialog
DlgCellTitle : "Cell Properties",
DlgCellWidth : "Width",
DlgCellWidthPx : "pixels",
DlgCellWidthPc : "percent",
DlgCellHeight : "Height",
DlgCellWordWrap : "Word Wrap",
DlgCellWordWrapNotSet : "<Not set>",
DlgCellWordWrapYes : "Yes",
DlgCellWordWrapNo : "No",
DlgCellHorAlign : "Horizontal Alignment",
DlgCellHorAlignNotSet : "<Not set>",
DlgCellHorAlignLeft : "Left",
DlgCellHorAlignCenter : "Center",
DlgCellHorAlignRight: "Right",
DlgCellVerAlign : "Vertical Alignment",
DlgCellVerAlignNotSet : "<Not set>",
DlgCellVerAlignTop : "Top",
DlgCellVerAlignMiddle : "Middle",
DlgCellVerAlignBottom : "Bottom",
DlgCellVerAlignBaseline : "Baseline",
DlgCellRowSpan : "Rows Span",
DlgCellCollSpan : "Columns Span",
DlgCellBackColor : "Background Color",
DlgCellBorderColor : "Border Color",
DlgCellBtnSelect : "Select...",
 
// Find Dialog
DlgFindTitle : "Find",
DlgFindFindBtn : "Find",
DlgFindNotFoundMsg : "The specified text was not found.",
 
// Replace Dialog
DlgReplaceTitle : "Replace",
DlgReplaceFindLbl : "Find what:",
DlgReplaceReplaceLbl : "Replace with:",
DlgReplaceCaseChk : "Match case",
DlgReplaceReplaceBtn : "Replace",
DlgReplaceReplAllBtn : "Replace All",
DlgReplaceWordChk : "Match whole word",
 
// Paste Operations / Dialog
PasteErrorPaste : "Your browser security settings don't permit the editor to automatically execute pasting operations. Please use the keyboard for that (Ctrl+V).",
PasteErrorCut : "Your browser security settings don't permit the editor to automatically execute cutting operations. Please use the keyboard for that (Ctrl+X).",
PasteErrorCopy : "Your browser security settings don't permit the editor to automatically execute copying operations. Please use the keyboard for that (Ctrl+C).",
 
PasteAsText : "Paste as Plain Text",
PasteFromWord : "Paste from Word",
 
DlgPasteMsg2 : "Please paste inside the following box using the keyboard (<STRONG>Ctrl+V</STRONG>) and hit <STRONG>OK</STRONG>.",
DlgPasteIgnoreFont : "Ignore Font Face definitions",
DlgPasteRemoveStyles : "Remove Styles definitions",
DlgPasteCleanBox : "Clean Up Box",
 
// Color Picker
ColorAutomatic : "Automatic",
ColorMoreColors : "More Colors...",
 
// Document Properties
DocProps : "Document Properties",
 
// Anchor Dialog
DlgAnchorTitle : "Anchor Properties",
DlgAnchorName : "Anchor Name",
DlgAnchorErrorName : "Please type the anchor name",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Not in dictionary",
DlgSpellChangeTo : "Change to",
DlgSpellBtnIgnore : "Ignore",
DlgSpellBtnIgnoreAll : "Ignore All",
DlgSpellBtnReplace : "Replace",
DlgSpellBtnReplaceAll : "Replace All",
DlgSpellBtnUndo : "Undo",
DlgSpellNoSuggestions : "- No suggestions -",
DlgSpellProgress : "Spell check in progress...",
DlgSpellNoMispell : "Spell check complete: No misspellings found",
DlgSpellNoChanges : "Spell check complete: No words changed",
DlgSpellOneChange : "Spell check complete: One word changed",
DlgSpellManyChanges : "Spell check complete: %1 words changed",
 
IeSpellDownload : "Spell checker not installed. Do you want to download it now?",
 
// Button Dialog
DlgButtonText : "Text (Value)",
DlgButtonType : "Type",
DlgButtonTypeBtn : "Button",
DlgButtonTypeSbm : "Submit",
DlgButtonTypeRst : "Reset",
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Name",
DlgCheckboxValue : "Value",
DlgCheckboxSelected : "Selected",
 
// Form Dialog
DlgFormName : "Name",
DlgFormAction : "Action",
DlgFormMethod : "Method",
 
// Select Field Dialog
DlgSelectName : "Name",
DlgSelectValue : "Value",
DlgSelectSize : "Size",
DlgSelectLines : "lines",
DlgSelectChkMulti : "Allow multiple selections",
DlgSelectOpAvail : "Available Options",
DlgSelectOpText : "Text",
DlgSelectOpValue : "Value",
DlgSelectBtnAdd : "Add",
DlgSelectBtnModify : "Modify",
DlgSelectBtnUp : "Up",
DlgSelectBtnDown : "Down",
DlgSelectBtnSetValue : "Set as selected value",
DlgSelectBtnDelete : "Delete",
 
// Textarea Dialog
DlgTextareaName : "Name",
DlgTextareaCols : "Columns",
DlgTextareaRows : "Rows",
 
// Text Field Dialog
DlgTextName : "Name",
DlgTextValue : "Value",
DlgTextCharWidth : "Character Width",
DlgTextMaxChars : "Maximum Characters",
DlgTextType : "Type",
DlgTextTypeText : "Text",
DlgTextTypePass : "Password",
 
// Hidden Field Dialog
DlgHiddenName : "Name",
DlgHiddenValue : "Value",
 
// Bulleted List Dialog
BulletedListProp : "Bulleted List Properties",
NumberedListProp : "Numbered List Properties",
DlgLstStart : "Start",
DlgLstType : "Type",
DlgLstTypeCircle : "Circle",
DlgLstTypeDisc : "Disc",
DlgLstTypeSquare : "Square",
DlgLstTypeNumbers : "Numbers (1, 2, 3)",
DlgLstTypeLCase : "Lowercase Letters (a, b, c)",
DlgLstTypeUCase : "Uppercase Letters (A, B, C)",
DlgLstTypeSRoman : "Small Roman Numerals (i, ii, iii)",
DlgLstTypeLRoman : "Large Roman Numerals (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "General",
DlgDocBackTab : "Background",
DlgDocColorsTab : "Colors and Margins",
DlgDocMetaTab : "Meta Data",
 
DlgDocPageTitle : "Page Title",
DlgDocLangDir : "Language Direction",
DlgDocLangDirLTR : "Left to Right (LTR)",
DlgDocLangDirRTL : "Right to Left (RTL)",
DlgDocLangCode : "Language Code",
DlgDocCharSet : "Character Set Encoding",
DlgDocCharSetCE : "Central European",
DlgDocCharSetCT : "Chinese Traditional (Big5)",
DlgDocCharSetCR : "Cyrillic",
DlgDocCharSetGR : "Greek",
DlgDocCharSetJP : "Japanese",
DlgDocCharSetKR : "Korean",
DlgDocCharSetTR : "Turkish",
DlgDocCharSetUN : "Unicode (UTF-8)",
DlgDocCharSetWE : "Western European",
DlgDocCharSetOther : "Other Character Set Encoding",
 
DlgDocDocType : "Document Type Heading",
DlgDocDocTypeOther : "Other Document Type Heading",
DlgDocIncXHTML : "Include XHTML Declarations",
DlgDocBgColor : "Background Color",
DlgDocBgImage : "Background Image URL",
DlgDocBgNoScroll : "Nonscrolling Background",
DlgDocCText : "Text",
DlgDocCLink : "Link",
DlgDocCVisited : "Visited Link",
DlgDocCActive : "Active Link",
DlgDocMargins : "Page Margins",
DlgDocMaTop : "Top",
DlgDocMaLeft : "Left",
DlgDocMaRight : "Right",
DlgDocMaBottom : "Bottom",
DlgDocMeIndex : "Document Indexing Keywords (comma separated)",
DlgDocMeDescr : "Document Description",
DlgDocMeAuthor : "Author",
DlgDocMeCopy : "Copyright",
DlgDocPreview : "Preview",
 
// Templates Dialog
Templates : "Templates",
DlgTemplatesTitle : "Content Templates",
DlgTemplatesSelMsg : "Please select the template to open in the editor<br>(the actual contents will be lost):",
DlgTemplatesLoading : "Loading templates list. Please wait...",
DlgTemplatesNoTpl : "(No templates defined)",
DlgTemplatesReplace : "Replace actual contents",
 
// About Dialog
DlgAboutAboutTab : "About",
DlgAboutBrowserInfoTab : "Browser Info",
DlgAboutLicenseTab : "License",
DlgAboutVersion : "version",
DlgAboutLicense : "Licensed under the terms of the GNU Lesser General Public License",
DlgAboutInfo : "For further information go to"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/gl.js
New file
0,0 → 1,501
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: gl.js
* Galician language file.
*
* File Authors:
* Fernando Riveiro Lopez
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Ocultar Ferramentas",
ToolbarExpand : "Mostrar Ferramentas",
 
// Toolbar Items and Context Menu
Save : "Gardar",
NewPage : "Nova Páxina",
Preview : "Vista Previa",
Cut : "Cortar",
Copy : "Copiar",
Paste : "Pegar",
PasteText : "Pegar como texto plano",
PasteWord : "Pegar dende Word",
Print : "Imprimir",
SelectAll : "Seleccionar todo",
RemoveFormat : "Eliminar Formato",
InsertLinkLbl : "Ligazón",
InsertLink : "Inserir/Editar Ligazón",
RemoveLink : "Eliminar Ligazón",
Anchor : "Inserir/Editar Referencia",
InsertImageLbl : "Imaxe",
InsertImage : "Inserir/Editar Imaxe",
InsertFlashLbl : "Flash",
InsertFlash : "Inserir/Editar Flash",
InsertTableLbl : "Tabla",
InsertTable : "Inserir/Editar Tabla",
InsertLineLbl : "Liña",
InsertLine : "Inserir Liña Horizontal",
InsertSpecialCharLbl: "Carácter Special",
InsertSpecialChar : "Inserir Carácter Especial",
InsertSmileyLbl : "Smiley",
InsertSmiley : "Inserir Smiley",
About : "Acerca de FCKeditor",
Bold : "Negrita",
Italic : "Cursiva",
Underline : "Sub-raiado",
StrikeThrough : "Tachado",
Subscript : "Subíndice",
Superscript : "Superíndice",
LeftJustify : "Aliñar á Esquerda",
CenterJustify : "Centrado",
RightJustify : "Aliñar á Dereita",
BlockJustify : "Xustificado",
DecreaseIndent : "Disminuir Sangría",
IncreaseIndent : "Aumentar Sangría",
Undo : "Desfacer",
Redo : "Refacer",
NumberedListLbl : "Lista Numerada",
NumberedList : "Inserir/Eliminar Lista Numerada",
BulletedListLbl : "Marcas",
BulletedList : "Inserir/Eliminar Marcas",
ShowTableBorders : "Mostrar Bordes das Táboas",
ShowDetails : "Mostrar Marcas Parágrafo",
Style : "Estilo",
FontFormat : "Formato",
Font : "Tipo",
FontSize : "Tamaño",
TextColor : "Cor do Texto",
BGColor : "Cor do Fondo",
Source : "Código Fonte",
Find : "Procurar",
Replace : "Substituir",
SpellCheck : "Corrección Ortográfica",
UniversalKeyboard : "Teclado Universal",
PageBreakLbl : "Salto de Páxina",
PageBreak : "Inserir Salto de Páxina",
 
Form : "Formulario",
Checkbox : "Cadro de Verificación",
RadioButton : "Botón de Radio",
TextField : "Campo de Texto",
Textarea : "Área de Texto",
HiddenField : "Campo Oculto",
Button : "Botón",
SelectionField : "Campo de Selección",
ImageButton : "Botón de Imaxe",
 
FitWindow : "Maximizar o tamaño do editor",
 
// Context Menu
EditLink : "Editar Ligazón",
CellCM : "Cela",
RowCM : "Fila",
ColumnCM : "Columna",
InsertRow : "Inserir Fila",
DeleteRows : "Borrar Filas",
InsertColumn : "Inserir Columna",
DeleteColumns : "Borrar Columnas",
InsertCell : "Inserir Cela",
DeleteCells : "Borrar Cela",
MergeCells : "Unir Celas",
SplitCell : "Partir Celas",
TableDelete : "Borrar Táboa",
CellProperties : "Propriedades da Cela",
TableProperties : "Propriedades da Táboa",
ImageProperties : "Propriedades Imaxe",
FlashProperties : "Propriedades Flash",
 
AnchorProp : "Propriedades da Referencia",
ButtonProp : "Propriedades do Botón",
CheckboxProp : "Propriedades do Cadro de Verificación",
HiddenFieldProp : "Propriedades do Campo Oculto",
RadioButtonProp : "Propriedades do Botón de Radio",
ImageButtonProp : "Propriedades do Botón de Imaxe",
TextFieldProp : "Propriedades do Campo de Texto",
SelectionFieldProp : "Propriedades do Campo de Selección",
TextareaProp : "Propriedades da Área de Texto",
FormProp : "Propriedades do Formulario",
 
FontFormats : "Normal;Formateado;Enderezo;Enacabezado 1;Encabezado 2;Encabezado 3;Encabezado 4;Encabezado 5;Encabezado 6;Paragraph (DIV)",
 
// Alerts and Messages
ProcessingXHTML : "Procesando XHTML. Por facor, agarde...",
Done : "Feiro",
PasteWordConfirm : "Parece que o texto que quere pegar está copiado do Word.¿Quere limpar o formato antes de pegalo?",
NotCompatiblePaste : "Este comando está disponible para Internet Explorer versión 5.5 ou superior. ¿Quere pegalo sen limpar o formato?",
UnknownToolbarItem : "Ítem de ferramentas descoñecido \"%1\"",
UnknownCommand : "Nome de comando descoñecido \"%1\"",
NotImplemented : "Comando non implementado",
UnknownToolbarSet : "O conxunto de ferramentas \"%1\" non existe",
NoActiveX : "As opcións de seguridade do seu navegador poderían limitar algunha das características de editor. Debe activar a opción \"Executar controis ActiveX e plug-ins\". Pode notar que faltan características e experimentar erros",
BrowseServerBlocked : "Non se poido abrir o navegador de recursos. Asegúrese de que están desactivados os bloqueadores de xanelas emerxentes",
DialogBlocked : "Non foi posible abrir a xanela de diálogo. Asegúrese de que están desactivados os bloqueadores de xanelas emerxentes",
 
// Dialogs
DlgBtnOK : "OK",
DlgBtnCancel : "Cancelar",
DlgBtnClose : "Pechar",
DlgBtnBrowseServer : "Navegar no Servidor",
DlgAdvancedTag : "Advanzado",
DlgOpOther : "<Outro>",
DlgInfoTab : "Info",
DlgAlertUrl : "Por favor, insira a URL",
 
// General Dialogs Labels
DlgGenNotSet : "<non definido>",
DlgGenId : "Id",
DlgGenLangDir : "Orientación do Idioma",
DlgGenLangDirLtr : "Esquerda a Dereita (LTR)",
DlgGenLangDirRtl : "Dereita a Esquerda (RTL)",
DlgGenLangCode : "Código do Idioma",
DlgGenAccessKey : "Chave de Acceso",
DlgGenName : "Nome",
DlgGenTabIndex : "Índice de Tabulación",
DlgGenLongDescr : "Descrición Completa da URL",
DlgGenClass : "Clases da Folla de Estilos",
DlgGenTitle : "Título",
DlgGenContType : "Tipo de Contido",
DlgGenLinkCharset : "Fonte de Caracteres Vinculado",
DlgGenStyle : "Estilo",
 
// Image Dialog
DlgImgTitle : "Propriedades da Imaxe",
DlgImgInfoTab : "Información da Imaxe",
DlgImgBtnUpload : "Enviar ó Servidor",
DlgImgURL : "URL",
DlgImgUpload : "Carregar",
DlgImgAlt : "Texto Alternativo",
DlgImgWidth : "Largura",
DlgImgHeight : "Altura",
DlgImgLockRatio : "Proporcional",
DlgBtnResetSize : "Tamaño Orixinal",
DlgImgBorder : "Límite",
DlgImgHSpace : "Esp. Horiz.",
DlgImgVSpace : "Esp. Vert.",
DlgImgAlign : "Aliñamento",
DlgImgAlignLeft : "Esquerda",
DlgImgAlignAbsBottom: "Abs Inferior",
DlgImgAlignAbsMiddle: "Abs Centro",
DlgImgAlignBaseline : "Liña Base",
DlgImgAlignBottom : "Pé",
DlgImgAlignMiddle : "Centro",
DlgImgAlignRight : "Dereita",
DlgImgAlignTextTop : "Tope do Texto",
DlgImgAlignTop : "Tope",
DlgImgPreview : "Vista Previa",
DlgImgAlertUrl : "Por favor, escriba a URL da imaxe",
DlgImgLinkTab : "Ligazón",
 
// Flash Dialog
DlgFlashTitle : "Propriedades Flash",
DlgFlashChkPlay : "Auto Execución",
DlgFlashChkLoop : "Bucle",
DlgFlashChkMenu : "Activar Menú Flash",
DlgFlashScale : "Escalar",
DlgFlashScaleAll : "Amosar Todo",
DlgFlashScaleNoBorder : "Sen Borde",
DlgFlashScaleFit : "Encaixar axustando",
 
// Link Dialog
DlgLnkWindowTitle : "Ligazón",
DlgLnkInfoTab : "Información da Ligazón",
DlgLnkTargetTab : "Referencia a esta páxina",
 
DlgLnkType : "Tipo de Ligazón",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Referencia nesta páxina",
DlgLnkTypeEMail : "E-Mail",
DlgLnkProto : "Protocolo",
DlgLnkProtoOther : "<outro>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Seleccionar unha Referencia",
DlgLnkAnchorByName : "Por Nome de Referencia",
DlgLnkAnchorById : "Por Element Id",
DlgLnkNoAnchors : "<Non hai referencias disponibles no documento>",
DlgLnkEMail : "Enderezo de E-Mail",
DlgLnkEMailSubject : "Asunto do Mensaxe",
DlgLnkEMailBody : "Corpo do Mensaxe",
DlgLnkUpload : "Carregar",
DlgLnkBtnUpload : "Enviar ó servidor",
 
DlgLnkTarget : "Destino",
DlgLnkTargetFrame : "<frame>",
DlgLnkTargetPopup : "<Xanela Emerxente>",
DlgLnkTargetBlank : "Nova Xanela (_blank)",
DlgLnkTargetParent : "Xanela Pai (_parent)",
DlgLnkTargetSelf : "Mesma Xanela (_self)",
DlgLnkTargetTop : "Xanela Primaria (_top)",
DlgLnkTargetFrameName : "Nome do Marco Destino",
DlgLnkPopWinName : "Nome da Xanela Emerxente",
DlgLnkPopWinFeat : "Características da Xanela Emerxente",
DlgLnkPopResize : "Axustable",
DlgLnkPopLocation : "Barra de Localización",
DlgLnkPopMenu : "Barra de Menú",
DlgLnkPopScroll : "Barras de Desplazamento",
DlgLnkPopStatus : "Barra de Estado",
DlgLnkPopToolbar : "Barra de Ferramentas",
DlgLnkPopFullScrn : "A Toda Pantalla (IE)",
DlgLnkPopDependent : "Dependente (Netscape)",
DlgLnkPopWidth : "Largura",
DlgLnkPopHeight : "Altura",
DlgLnkPopLeft : "Posición Esquerda",
DlgLnkPopTop : "Posición dende Arriba",
 
DlnLnkMsgNoUrl : "Por favor, escriba a ligazón URL",
DlnLnkMsgNoEMail : "Por favor, escriba o enderezo de e-mail",
DlnLnkMsgNoAnchor : "Por favor, seleccione un destino",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "Seleccionar Color",
DlgColorBtnClear : "Nengunha",
DlgColorHighlight : "Destacado",
DlgColorSelected : "Seleccionado",
 
// Smiley Dialog
DlgSmileyTitle : "Inserte un Smiley",
 
// Special Character Dialog
DlgSpecialCharTitle : "Seleccione Caracter Especial",
 
// Table Dialog
DlgTableTitle : "Propiedades da Táboa",
DlgTableRows : "Filas",
DlgTableColumns : "Columnas",
DlgTableBorder : "Tamaño do Borde",
DlgTableAlign : "Aliñamento",
DlgTableAlignNotSet : "<Non Definido>",
DlgTableAlignLeft : "Esquerda",
DlgTableAlignCenter : "Centro",
DlgTableAlignRight : "Ereita",
DlgTableWidth : "Largura",
DlgTableWidthPx : "pixels",
DlgTableWidthPc : "percent",
DlgTableHeight : "Altura",
DlgTableCellSpace : "Marxe entre Celas",
DlgTableCellPad : "Marxe interior",
DlgTableCaption : "Título",
DlgTableSummary : "Sumario",
 
// Table Cell Dialog
DlgCellTitle : "Propriedades da Cela",
DlgCellWidth : "Largura",
DlgCellWidthPx : "pixels",
DlgCellWidthPc : "percent",
DlgCellHeight : "Altura",
DlgCellWordWrap : "Axustar Liñas",
DlgCellWordWrapNotSet : "<Non Definido>",
DlgCellWordWrapYes : "Si",
DlgCellWordWrapNo : "Non",
DlgCellHorAlign : "Aliñamento Horizontal",
DlgCellHorAlignNotSet : "<Non definido>",
DlgCellHorAlignLeft : "Esquerda",
DlgCellHorAlignCenter : "Centro",
DlgCellHorAlignRight: "Dereita",
DlgCellVerAlign : "Aliñamento Vertical",
DlgCellVerAlignNotSet : "<Non definido>",
DlgCellVerAlignTop : "Arriba",
DlgCellVerAlignMiddle : "Medio",
DlgCellVerAlignBottom : "Abaixo",
DlgCellVerAlignBaseline : "Liña de Base",
DlgCellRowSpan : "Ocupar Filas",
DlgCellCollSpan : "Ocupar Columnas",
DlgCellBackColor : "Color de Fondo",
DlgCellBorderColor : "Color de Borde",
DlgCellBtnSelect : "Seleccionar...",
 
// Find Dialog
DlgFindTitle : "Procurar",
DlgFindFindBtn : "Procurar",
DlgFindNotFoundMsg : "Non te atopou o texto indicado.",
 
// Replace Dialog
DlgReplaceTitle : "Substituir",
DlgReplaceFindLbl : "Texto a procurar:",
DlgReplaceReplaceLbl : "Substituir con:",
DlgReplaceCaseChk : "Coincidir Mai./min.",
DlgReplaceReplaceBtn : "Substituir",
DlgReplaceReplAllBtn : "Substitiur Todo",
DlgReplaceWordChk : "Coincidir con toda a palabra",
 
// Paste Operations / Dialog
PasteErrorPaste : "Os axustes de seguridade do seu navegador non permiten que o editor realice automáticamente as tarefas de pegado. Por favor, use o teclado para iso (Ctrl+V).",
PasteErrorCut : "Os axustes de seguridade do seu navegador non permiten que o editor realice automáticamente as tarefas de corte. Por favor, use o teclado para iso (Ctrl+X).",
PasteErrorCopy : "Os axustes de seguridade do seu navegador non permiten que o editor realice automáticamente as tarefas de copia. Por favor, use o teclado para iso (Ctrl+C).",
 
PasteAsText : "Pegar como texto plano",
PasteFromWord : "Pegar dende Word",
 
DlgPasteMsg2 : "Por favor, pegue dentro do seguinte cadro usando o teclado (<STRONG>Ctrl+V</STRONG>) e pulse <STRONG>OK</STRONG>.",
DlgPasteIgnoreFont : "Ignorar as definicións de Tipografía",
DlgPasteRemoveStyles : "Eliminar as definicións de Estilos",
DlgPasteCleanBox : "Limpar o Cadro",
 
// Color Picker
ColorAutomatic : "Automático",
ColorMoreColors : "Máis Cores...",
 
// Document Properties
DocProps : "Propriedades do Documento",
 
// Anchor Dialog
DlgAnchorTitle : "Propriedades da Referencia",
DlgAnchorName : "Nome da Referencia",
DlgAnchorErrorName : "Por favor, escriba o nome da referencia",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Non está no diccionario",
DlgSpellChangeTo : "Cambiar a",
DlgSpellBtnIgnore : "Ignorar",
DlgSpellBtnIgnoreAll : "Ignorar Todas",
DlgSpellBtnReplace : "Substituir",
DlgSpellBtnReplaceAll : "Substituir Todas",
DlgSpellBtnUndo : "Desfacer",
DlgSpellNoSuggestions : "- Sen candidatos -",
DlgSpellProgress : "Corrección ortográfica en progreso...",
DlgSpellNoMispell : "Corrección ortográfica rematada: Non se atoparon erros",
DlgSpellNoChanges : "Corrección ortográfica rematada: Non se substituiu nengunha verba",
DlgSpellOneChange : "Corrección ortográfica rematada: Unha verba substituida",
DlgSpellManyChanges : "Corrección ortográfica rematada: %1 verbas substituidas",
 
IeSpellDownload : "O corrector ortográfico non está instalado. ¿Quere descargalo agora?",
 
// Button Dialog
DlgButtonText : "Texto (Valor)",
DlgButtonType : "Tipo",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Nome",
DlgCheckboxValue : "Valor",
DlgCheckboxSelected : "Seleccionado",
 
// Form Dialog
DlgFormName : "Nome",
DlgFormAction : "Acción",
DlgFormMethod : "Método",
 
// Select Field Dialog
DlgSelectName : "Nome",
DlgSelectValue : "Valor",
DlgSelectSize : "Tamaño",
DlgSelectLines : "liñas",
DlgSelectChkMulti : "Permitir múltiples seleccións",
DlgSelectOpAvail : "Opcións Disponibles",
DlgSelectOpText : "Texto",
DlgSelectOpValue : "Valor",
DlgSelectBtnAdd : "Engadir",
DlgSelectBtnModify : "Modificar",
DlgSelectBtnUp : "Subir",
DlgSelectBtnDown : "Baixar",
DlgSelectBtnSetValue : "Definir como valor por defecto",
DlgSelectBtnDelete : "Borrar",
 
// Textarea Dialog
DlgTextareaName : "Nome",
DlgTextareaCols : "Columnas",
DlgTextareaRows : "Filas",
 
// Text Field Dialog
DlgTextName : "Nome",
DlgTextValue : "Valor",
DlgTextCharWidth : "Tamaño do Caracter",
DlgTextMaxChars : "Máximo de Caracteres",
DlgTextType : "Tipo",
DlgTextTypeText : "Texto",
DlgTextTypePass : "Chave",
 
// Hidden Field Dialog
DlgHiddenName : "Nome",
DlgHiddenValue : "Valor",
 
// Bulleted List Dialog
BulletedListProp : "Propriedades das Marcas",
NumberedListProp : "Propriedades da Lista de Numeración",
DlgLstStart : "Start", //MISSING
DlgLstType : "Tipo",
DlgLstTypeCircle : "Círculo",
DlgLstTypeDisc : "Disco",
DlgLstTypeSquare : "Cuadrado",
DlgLstTypeNumbers : "Números (1, 2, 3)",
DlgLstTypeLCase : "Letras Minúsculas (a, b, c)",
DlgLstTypeUCase : "Letras Maiúsculas (A, B, C)",
DlgLstTypeSRoman : "Números Romanos en minúscula (i, ii, iii)",
DlgLstTypeLRoman : "Números Romanos en Maiúscula (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "Xeral",
DlgDocBackTab : "Fondo",
DlgDocColorsTab : "Cores e Marxes",
DlgDocMetaTab : "Meta Data",
 
DlgDocPageTitle : "Título da Páxina",
DlgDocLangDir : "Orientación do Idioma",
DlgDocLangDirLTR : "Esquerda a Dereita (LTR)",
DlgDocLangDirRTL : "Dereita a Esquerda (RTL)",
DlgDocLangCode : "Código de Idioma",
DlgDocCharSet : "Codificación do Xogo de Caracteres",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "Outra Codificación do Xogo de Caracteres",
 
DlgDocDocType : "Encabezado do Tipo de Documento",
DlgDocDocTypeOther : "Outro Encabezado do Tipo de Documento",
DlgDocIncXHTML : "Incluir Declaracións XHTML",
DlgDocBgColor : "Cor de Fondo",
DlgDocBgImage : "URL da Imaxe de Fondo",
DlgDocBgNoScroll : "Fondo Fixo",
DlgDocCText : "Texto",
DlgDocCLink : "Ligazóns",
DlgDocCVisited : "Ligazón Visitada",
DlgDocCActive : "Ligazón Activa",
DlgDocMargins : "Marxes da Páxina",
DlgDocMaTop : "Arriba",
DlgDocMaLeft : "Esquerda",
DlgDocMaRight : "Dereita",
DlgDocMaBottom : "Abaixo",
DlgDocMeIndex : "Palabras Chave de Indexación do Documento (separadas por comas)",
DlgDocMeDescr : "Descripción do Documento",
DlgDocMeAuthor : "Autor",
DlgDocMeCopy : "Copyright",
DlgDocPreview : "Vista Previa",
 
// Templates Dialog
Templates : "Plantillas",
DlgTemplatesTitle : "Plantillas de Contido",
DlgTemplatesSelMsg : "Por favor, seleccione a plantilla a abrir no editor<br>(o contido actual perderase):",
DlgTemplatesLoading : "Cargando listado de plantillas. Por favor, espere...",
DlgTemplatesNoTpl : "(Non hai plantillas definidas)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "Acerca de",
DlgAboutBrowserInfoTab : "Información do Navegador",
DlgAboutLicenseTab : "Licencia",
DlgAboutVersion : "versión",
DlgAboutLicense : "Licencia concedida baixo os termos da GNU Lesser General Public License",
DlgAboutInfo : "Para máis información visitar:"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/ar.js
New file
0,0 → 1,502
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: ar.js
* Arabic language file.
*
* File Authors:
* Abdul-Aziz Abdul-Kareem Al-Oraij (http://aziz.oraij.com)
* Abu Faisal (http://www.24at24.com)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "rtl",
 
ToolbarCollapse : "ضم شريط الأدوات",
ToolbarExpand : "تمدد شريط الأدوات",
 
// Toolbar Items and Context Menu
Save : "حفظ",
NewPage : "صفحة جديدة",
Preview : "معاينة الصفحة",
Cut : "قص",
Copy : "نسخ",
Paste : "لصق",
PasteText : "لصق كنص بسيط",
PasteWord : "لصق من وورد",
Print : "طباعة",
SelectAll : "تحديد الكل",
RemoveFormat : "إزالة التنسيقات",
InsertLinkLbl : "رابط",
InsertLink : "إدراج/تحرير رابط",
RemoveLink : "إزالة رابط",
Anchor : "إدراج/تحرير إشارة مرجعية",
InsertImageLbl : "صورة",
InsertImage : "إدراج/تحرير صورة",
InsertFlashLbl : "فلاش",
InsertFlash : "إدراج/تحرير فيلم فلاش",
InsertTableLbl : "جدول",
InsertTable : "إدراج/تحرير جدول",
InsertLineLbl : "خط فاصل",
InsertLine : "إدراج خط فاصل",
InsertSpecialCharLbl: "رموز",
InsertSpecialChar : "إدراج رموز..ِ",
InsertSmileyLbl : "ابتسامات",
InsertSmiley : "إدراج ابتسامات",
About : "حول FCKeditor",
Bold : "غامق",
Italic : "مائل",
Underline : "تسطير",
StrikeThrough : "يتوسطه خط",
Subscript : "منخفض",
Superscript : "مرتفع",
LeftJustify : "محاذاة إلى اليسار",
CenterJustify : "توسيط",
RightJustify : "محاذاة إلى اليمين",
BlockJustify : "ضبط",
DecreaseIndent : "إنقاص المسافة البادئة",
IncreaseIndent : "زيادة المسافة البادئة",
Undo : "تراجع",
Redo : "إعادة",
NumberedListLbl : "تعداد رقمي",
NumberedList : "إدراج/إلغاء تعداد رقمي",
BulletedListLbl : "تعداد نقطي",
BulletedList : "إدراج/إلغاء تعداد نقطي",
ShowTableBorders : "معاينة حدود الجداول",
ShowDetails : "معاينة التفاصيل",
Style : "نمط",
FontFormat : "تنسيق",
Font : "خط",
FontSize : "حجم الخط",
TextColor : "لون النص",
BGColor : "لون الخلفية",
Source : "شفرة المصدر",
Find : "بحث",
Replace : "إستبدال",
SpellCheck : "تدقيق إملائي",
UniversalKeyboard : "لوحة المفاتيح العالمية",
PageBreakLbl : "فصل الصفحة",
PageBreak : "إدخال صفحة جديدة",
 
Form : "نموذج",
Checkbox : "خانة إختيار",
RadioButton : "زر خيار",
TextField : "مربع نص",
Textarea : "ناحية نص",
HiddenField : "إدراج حقل خفي",
Button : "زر ضغط",
SelectionField : "قائمة منسدلة",
ImageButton : "زر صورة",
 
FitWindow : "تكبير حجم المحرر",
 
// Context Menu
EditLink : "تحرير رابط",
CellCM : "خلية",
RowCM : "صف",
ColumnCM : "عمود",
InsertRow : "إدراج صف",
DeleteRows : "حذف صفوف",
InsertColumn : "إدراج عمود",
DeleteColumns : "حذف أعمدة",
InsertCell : "إدراج خلية",
DeleteCells : "حذف خلايا",
MergeCells : "دمج خلايا",
SplitCell : "تقسيم خلية",
TableDelete : "حذف الجدول",
CellProperties : "خصائص الخلية",
TableProperties : "خصائص الجدول",
ImageProperties : "خصائص الصورة",
FlashProperties : "خصائص فيلم الفلاش",
 
AnchorProp : "خصائص الإشارة المرجعية",
ButtonProp : "خصائص زر الضغط",
CheckboxProp : "خصائص خانة الإختيار",
HiddenFieldProp : "خصائص الحقل الخفي",
RadioButtonProp : "خصائص زر الخيار",
ImageButtonProp : "خصائص زر الصورة",
TextFieldProp : "خصائص مربع النص",
SelectionFieldProp : "خصائص القائمة المنسدلة",
TextareaProp : "خصائص ناحية النص",
FormProp : "خصائص النموذج",
 
FontFormats : "عادي;منسّق;دوس;العنوان 1;العنوان 2;العنوان 3;العنوان 4;العنوان 5;العنوان 6",
 
// Alerts and Messages
ProcessingXHTML : "إنتظر قليلاً ريثما تتم معالَجة‏ XHTML. لن يستغرق طويلاً...",
Done : "تم",
PasteWordConfirm : "يبدو أن النص المراد لصقه منسوخ من برنامج وورد. هل تود تنظيفه قبل الشروع في عملية اللصق؟",
NotCompatiblePaste : "هذه الميزة تحتاج لمتصفح من النوعInternet Explorer إصدار 5.5 فما فوق. هل تود اللصق دون تنظيف الكود؟",
UnknownToolbarItem : "عنصر شريط أدوات غير معروف \"%1\"",
UnknownCommand : "أمر غير معروف \"%1\"",
NotImplemented : "لم يتم دعم هذا الأمر",
UnknownToolbarSet : "لم أتمكن من العثور على طقم الأدوات \"%1\" ",
NoActiveX : "لتأمين متصفحك يجب أن تحدد بعض مميزات المحرر. يتوجب عليك تمكين الخيار \"Run ActiveX controls and plug-ins\". قد تواجة أخطاء وتلاحظ مميزات مفقودة",
BrowseServerBlocked : "لايمكن فتح مصدر المتصفح. فضلا يجب التأكد بأن جميع موانع النوافذ المنبثقة معطلة",
DialogBlocked : "لايمكن فتح نافذة الحوار . فضلا تأكد من أن مانع النوافذ المنبثة معطل .",
 
// Dialogs
DlgBtnOK : "موافق",
DlgBtnCancel : "إلغاء الأمر",
DlgBtnClose : "إغلاق",
DlgBtnBrowseServer : "تصفح الخادم",
DlgAdvancedTag : "متقدم",
DlgOpOther : "<أخرى>",
DlgInfoTab : "معلومات",
DlgAlertUrl : "الرجاء كتابة عنوان الإنترنت",
 
// General Dialogs Labels
DlgGenNotSet : "<بدون تحديد>",
DlgGenId : "الرقم",
DlgGenLangDir : "إتجاه النص",
DlgGenLangDirLtr : "اليسار لليمين (LTR)",
DlgGenLangDirRtl : "اليمين لليسار (RTL)",
DlgGenLangCode : "رمز اللغة",
DlgGenAccessKey : "مفاتيح الإختصار",
DlgGenName : "الاسم",
DlgGenTabIndex : "الترتيب",
DlgGenLongDescr : "عنوان الوصف المفصّل",
DlgGenClass : "فئات التنسيق",
DlgGenTitle : "تلميح الشاشة",
DlgGenContType : "نوع التلميح",
DlgGenLinkCharset : "ترميز المادة المطلوبة",
DlgGenStyle : "نمط",
 
// Image Dialog
DlgImgTitle : "خصائص الصورة",
DlgImgInfoTab : "معلومات الصورة",
DlgImgBtnUpload : "أرسلها للخادم",
DlgImgURL : "موقع الصورة",
DlgImgUpload : "رفع",
DlgImgAlt : "الوصف",
DlgImgWidth : "العرض",
DlgImgHeight : "الإرتفاع",
DlgImgLockRatio : "تناسق الحجم",
DlgBtnResetSize : "إستعادة الحجم الأصلي",
DlgImgBorder : "سمك الحدود",
DlgImgHSpace : "تباعد أفقي",
DlgImgVSpace : "تباعد عمودي",
DlgImgAlign : "محاذاة",
DlgImgAlignLeft : "يسار",
DlgImgAlignAbsBottom: "أسفل النص",
DlgImgAlignAbsMiddle: "وسط السطر",
DlgImgAlignBaseline : "على السطر",
DlgImgAlignBottom : "أسفل",
DlgImgAlignMiddle : "وسط",
DlgImgAlignRight : "يمين",
DlgImgAlignTextTop : "أعلى النص",
DlgImgAlignTop : "أعلى",
DlgImgPreview : "معاينة",
DlgImgAlertUrl : "فضلاً أكتب الموقع الذي توجد عليه هذه الصورة.",
DlgImgLinkTab : "الرابط",
 
// Flash Dialog
DlgFlashTitle : "خصائص فيلم الفلاش",
DlgFlashChkPlay : "تشغيل تلقائي",
DlgFlashChkLoop : "تكرار",
DlgFlashChkMenu : "تمكين قائمة فيلم الفلاش",
DlgFlashScale : "الحجم",
DlgFlashScaleAll : "إظهار الكل",
DlgFlashScaleNoBorder : "بلا حدود",
DlgFlashScaleFit : "ضبط تام",
 
// Link Dialog
DlgLnkWindowTitle : "إرتباط تشعبي",
DlgLnkInfoTab : "معلومات الرابط",
DlgLnkTargetTab : "الهدف",
 
DlgLnkType : "نوع الربط",
DlgLnkTypeURL : "العنوان",
DlgLnkTypeAnchor : "مكان في هذا المستند",
DlgLnkTypeEMail : "بريد إلكتروني",
DlgLnkProto : "البروتوكول",
DlgLnkProtoOther : "<أخرى>",
DlgLnkURL : "الموقع",
DlgLnkAnchorSel : "اختر علامة مرجعية",
DlgLnkAnchorByName : "حسب اسم العلامة",
DlgLnkAnchorById : "حسب تعريف العنصر",
DlgLnkNoAnchors : "<لا يوجد علامات مرجعية في هذا المستند>",
DlgLnkEMail : "عنوان بريد إلكتروني",
DlgLnkEMailSubject : "موضوع الرسالة",
DlgLnkEMailBody : "محتوى الرسالة",
DlgLnkUpload : "رفع",
DlgLnkBtnUpload : "أرسلها للخادم",
 
DlgLnkTarget : "الهدف",
DlgLnkTargetFrame : "<إطار>",
DlgLnkTargetPopup : "<نافذة منبثقة>",
DlgLnkTargetBlank : "إطار جديد (_blank)",
DlgLnkTargetParent : "الإطار الأصل (_parent)",
DlgLnkTargetSelf : "نفس الإطار (_self)",
DlgLnkTargetTop : "صفحة كاملة (_top)",
DlgLnkTargetFrameName : "اسم الإطار الهدف",
DlgLnkPopWinName : "تسمية النافذة المنبثقة",
DlgLnkPopWinFeat : "خصائص النافذة المنبثقة",
DlgLnkPopResize : "قابلة للتحجيم",
DlgLnkPopLocation : "شريط العنوان",
DlgLnkPopMenu : "القوائم الرئيسية",
DlgLnkPopScroll : "أشرطة التمرير",
DlgLnkPopStatus : "شريط الحالة السفلي",
DlgLnkPopToolbar : "شريط الأدوات",
DlgLnkPopFullScrn : "ملئ الشاشة (IE)",
DlgLnkPopDependent : "تابع (Netscape)",
DlgLnkPopWidth : "العرض",
DlgLnkPopHeight : "الإرتفاع",
DlgLnkPopLeft : "التمركز لليسار",
DlgLnkPopTop : "التمركز للأعلى",
 
DlnLnkMsgNoUrl : "فضلاً أدخل عنوان الموقع الذي يشير إليه الرابط",
DlnLnkMsgNoEMail : "فضلاً أدخل عنوان البريد الإلكتروني",
DlnLnkMsgNoAnchor : "فضلاً حدد العلامة المرجعية المرغوبة",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "اختر لوناً",
DlgColorBtnClear : "مسح",
DlgColorHighlight : "تحديد",
DlgColorSelected : "إختيار",
 
// Smiley Dialog
DlgSmileyTitle : "إدراج إبتسامات ",
 
// Special Character Dialog
DlgSpecialCharTitle : "إدراج رمز",
 
// Table Dialog
DlgTableTitle : "إدراج جدول",
DlgTableRows : "صفوف",
DlgTableColumns : "أعمدة",
DlgTableBorder : "سمك الحدود",
DlgTableAlign : "المحاذاة",
DlgTableAlignNotSet : "<بدون تحديد>",
DlgTableAlignLeft : "يسار",
DlgTableAlignCenter : "وسط",
DlgTableAlignRight : "يمين",
DlgTableWidth : "العرض",
DlgTableWidthPx : "بكسل",
DlgTableWidthPc : "بالمئة",
DlgTableHeight : "الإرتفاع",
DlgTableCellSpace : "تباعد الخلايا",
DlgTableCellPad : "المسافة البادئة",
DlgTableCaption : "الوصف",
DlgTableSummary : "الخلاصة",
 
// Table Cell Dialog
DlgCellTitle : "خصائص الخلية",
DlgCellWidth : "العرض",
DlgCellWidthPx : "بكسل",
DlgCellWidthPc : "بالمئة",
DlgCellHeight : "الإرتفاع",
DlgCellWordWrap : "التفاف النص",
DlgCellWordWrapNotSet : "<بدون تحديد>",
DlgCellWordWrapYes : "نعم",
DlgCellWordWrapNo : "لا",
DlgCellHorAlign : "المحاذاة الأفقية",
DlgCellHorAlignNotSet : "<بدون تحديد>",
DlgCellHorAlignLeft : "يسار",
DlgCellHorAlignCenter : "وسط",
DlgCellHorAlignRight: "يمين",
DlgCellVerAlign : "المحاذاة العمودية",
DlgCellVerAlignNotSet : "<بدون تحديد>",
DlgCellVerAlignTop : "أعلى",
DlgCellVerAlignMiddle : "وسط",
DlgCellVerAlignBottom : "أسفل",
DlgCellVerAlignBaseline : "على السطر",
DlgCellRowSpan : "إمتداد الصفوف",
DlgCellCollSpan : "إمتداد الأعمدة",
DlgCellBackColor : "لون الخلفية",
DlgCellBorderColor : "لون الحدود",
DlgCellBtnSelect : "حدّد...",
 
// Find Dialog
DlgFindTitle : "بحث",
DlgFindFindBtn : "ابحث",
DlgFindNotFoundMsg : "لم يتم العثور على النص المحدد.",
 
// Replace Dialog
DlgReplaceTitle : "إستبدال",
DlgReplaceFindLbl : "البحث عن:",
DlgReplaceReplaceLbl : "إستبدال بـ:",
DlgReplaceCaseChk : "مطابقة حالة الأحرف",
DlgReplaceReplaceBtn : "إستبدال",
DlgReplaceReplAllBtn : "إستبدال الكل",
DlgReplaceWordChk : "الكلمة بالكامل فقط",
 
// Paste Operations / Dialog
PasteErrorPaste : "الإعدادات الأمنية للمتصفح الذي تستخدمه تمنع اللصق التلقائي. فضلاً إستخدم لوحة المفاتيح لفعل ذلك (Ctrl+V).",
PasteErrorCut : "الإعدادات الأمنية للمتصفح الذي تستخدمه تمنع القص التلقائي. فضلاً إستخدم لوحة المفاتيح لفعل ذلك (Ctrl+X).",
PasteErrorCopy : "الإعدادات الأمنية للمتصفح الذي تستخدمه تمنع النسخ التلقائي. فضلاً إستخدم لوحة المفاتيح لفعل ذلك (Ctrl+C).",
 
PasteAsText : "لصق كنص بسيط",
PasteFromWord : "لصق من وورد",
 
DlgPasteMsg2 : "الصق داخل الصندوق بإستخدام زرّي (<STRONG>Ctrl+V</STRONG>) في لوحة المفاتيح، ثم اضغط زر <STRONG>موافق</STRONG>.",
DlgPasteIgnoreFont : "تجاهل تعريفات أسماء الخطوط",
DlgPasteRemoveStyles : "إزالة تعريفات الأنماط",
DlgPasteCleanBox : "نظّف محتوى الصندوق",
 
// Color Picker
ColorAutomatic : "تلقائي",
ColorMoreColors : "ألوان إضافية...",
 
// Document Properties
DocProps : "خصائص الصفحة",
 
// Anchor Dialog
DlgAnchorTitle : "خصائص إشارة مرجعية",
DlgAnchorName : "اسم الإشارة المرجعية",
DlgAnchorErrorName : "الرجاء كتابة اسم الإشارة المرجعية",
 
// Speller Pages Dialog
DlgSpellNotInDic : "ليست في القاموس",
DlgSpellChangeTo : "التغيير إلى",
DlgSpellBtnIgnore : "تجاهل",
DlgSpellBtnIgnoreAll : "تجاهل الكل",
DlgSpellBtnReplace : "تغيير",
DlgSpellBtnReplaceAll : "تغيير الكل",
DlgSpellBtnUndo : "تراجع",
DlgSpellNoSuggestions : "- لا توجد إقتراحات -",
DlgSpellProgress : "جاري التدقيق إملائياً",
DlgSpellNoMispell : "تم إكمال التدقيق الإملائي: لم يتم العثور على أي أخطاء إملائية",
DlgSpellNoChanges : "تم إكمال التدقيق الإملائي: لم يتم تغيير أي كلمة",
DlgSpellOneChange : "تم إكمال التدقيق الإملائي: تم تغيير كلمة واحدة فقط",
DlgSpellManyChanges : "تم إكمال التدقيق الإملائي: تم تغيير %1 كلمات\كلمة",
 
IeSpellDownload : "المدقق الإملائي (الإنجليزي) غير مثبّت. هل تود تحميله الآن؟",
 
// Button Dialog
DlgButtonText : "القيمة/التسمية",
DlgButtonType : "نوع الزر",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "الاسم",
DlgCheckboxValue : "القيمة",
DlgCheckboxSelected : "محدد",
 
// Form Dialog
DlgFormName : "الاسم",
DlgFormAction : "اسم الملف",
DlgFormMethod : "الأسلوب",
 
// Select Field Dialog
DlgSelectName : "الاسم",
DlgSelectValue : "القيمة",
DlgSelectSize : "الحجم",
DlgSelectLines : "الأسطر",
DlgSelectChkMulti : "السماح بتحديدات متعددة",
DlgSelectOpAvail : "الخيارات المتاحة",
DlgSelectOpText : "النص",
DlgSelectOpValue : "القيمة",
DlgSelectBtnAdd : "إضافة",
DlgSelectBtnModify : "تعديل",
DlgSelectBtnUp : "تحريك لأعلى",
DlgSelectBtnDown : "تحريك لأسفل",
DlgSelectBtnSetValue : "إجعلها محددة",
DlgSelectBtnDelete : "إزالة",
 
// Textarea Dialog
DlgTextareaName : "الاسم",
DlgTextareaCols : "الأعمدة",
DlgTextareaRows : "الصفوف",
 
// Text Field Dialog
DlgTextName : "الاسم",
DlgTextValue : "القيمة",
DlgTextCharWidth : "العرض بالأحرف",
DlgTextMaxChars : "عدد الحروف الأقصى",
DlgTextType : "نوع المحتوى",
DlgTextTypeText : "نص",
DlgTextTypePass : "كلمة مرور",
 
// Hidden Field Dialog
DlgHiddenName : "الاسم",
DlgHiddenValue : "القيمة",
 
// Bulleted List Dialog
BulletedListProp : "خصائص التعداد النقطي",
NumberedListProp : "خصائص التعداد الرقمي",
DlgLstStart : "Start", //MISSING
DlgLstType : "النوع",
DlgLstTypeCircle : "دائرة",
DlgLstTypeDisc : "قرص",
DlgLstTypeSquare : "مربع",
DlgLstTypeNumbers : "أرقام (1، 2، 3)َ",
DlgLstTypeLCase : "حروف صغيرة (a, b, c)َ",
DlgLstTypeUCase : "حروف كبيرة (A, B, C)َ",
DlgLstTypeSRoman : "ترقيم روماني صغير (i, ii, iii)َ",
DlgLstTypeLRoman : "ترقيم روماني كبير (I, II, III)َ",
 
// Document Properties Dialog
DlgDocGeneralTab : "عام",
DlgDocBackTab : "الخلفية",
DlgDocColorsTab : "الألوان والهوامش",
DlgDocMetaTab : "المعرّفات الرأسية",
 
DlgDocPageTitle : "عنوان الصفحة",
DlgDocLangDir : "إتجاه اللغة",
DlgDocLangDirLTR : "اليسار لليمين (LTR)",
DlgDocLangDirRTL : "اليمين لليسار (RTL)",
DlgDocLangCode : "رمز اللغة",
DlgDocCharSet : "ترميز الحروف",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "ترميز حروف آخر",
 
DlgDocDocType : "ترويسة نوع الصفحة",
DlgDocDocTypeOther : "ترويسة نوع صفحة أخرى",
DlgDocIncXHTML : "تضمين إعلانات‏ لغة XHTMLَ",
DlgDocBgColor : "لون الخلفية",
DlgDocBgImage : "رابط الصورة الخلفية",
DlgDocBgNoScroll : "جعلها علامة مائية",
DlgDocCText : "النص",
DlgDocCLink : "الروابط",
DlgDocCVisited : "المزارة",
DlgDocCActive : "النشطة",
DlgDocMargins : "هوامش الصفحة",
DlgDocMaTop : "علوي",
DlgDocMaLeft : "أيسر",
DlgDocMaRight : "أيمن",
DlgDocMaBottom : "سفلي",
DlgDocMeIndex : "الكلمات الأساسية (مفصولة بفواصل)َ",
DlgDocMeDescr : "وصف الصفحة",
DlgDocMeAuthor : "الكاتب",
DlgDocMeCopy : "المالك",
DlgDocPreview : "معاينة",
 
// Templates Dialog
Templates : "القوالب",
DlgTemplatesTitle : "قوالب المحتوى",
DlgTemplatesSelMsg : "اختر القالب الذي تود وضعه في المحرر <br>(سيتم فقدان المحتوى الحالي):",
DlgTemplatesLoading : "جاري تحميل قائمة القوالب، الرجاء الإنتظار...",
DlgTemplatesNoTpl : "(لم يتم تعريف أي قالب)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "نبذة",
DlgAboutBrowserInfoTab : "معلومات متصفحك",
DlgAboutLicenseTab : "الترخيص",
DlgAboutVersion : "الإصدار",
DlgAboutLicense : "مرخّص بحسب قانون GNU LGPL",
DlgAboutInfo : "لمزيد من المعلومات تفضل بزيارة"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/_translationstatus.txt
New file
0,0 → 1,71
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: _translationstatus.txt
* Translations Status.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
ar.js Found: 388 Missing: 15
bg.js Found: 380 Missing: 23
bn.js Found: 388 Missing: 15
bs.js Found: 232 Missing: 171
ca.js Found: 403 Missing: 0
cs.js Found: 388 Missing: 15
da.js Found: 388 Missing: 15
de.js Found: 403 Missing: 0
el.js Found: 403 Missing: 0
en-au.js Found: 403 Missing: 0
en-ca.js Found: 403 Missing: 0
en-uk.js Found: 403 Missing: 0
eo.js Found: 352 Missing: 51
es.js Found: 388 Missing: 15
et.js Found: 388 Missing: 15
eu.js Found: 388 Missing: 15
fa.js Found: 388 Missing: 15
fi.js Found: 388 Missing: 15
fo.js Found: 358 Missing: 45
fr.js Found: 403 Missing: 0
gl.js Found: 388 Missing: 15
he.js Found: 388 Missing: 15
hi.js Found: 403 Missing: 0
hr.js Found: 403 Missing: 0
hu.js Found: 402 Missing: 1
it.js Found: 388 Missing: 15
ja.js Found: 403 Missing: 0
km.js Found: 377 Missing: 26
ko.js Found: 375 Missing: 28
lt.js Found: 383 Missing: 20
lv.js Found: 388 Missing: 15
mn.js Found: 232 Missing: 171
ms.js Found: 358 Missing: 45
nb.js Found: 388 Missing: 15
nl.js Found: 403 Missing: 0
no.js Found: 388 Missing: 15
pl.js Found: 388 Missing: 15
pt-br.js Found: 384 Missing: 19
pt.js Found: 388 Missing: 15
ro.js Found: 388 Missing: 15
ru.js Found: 403 Missing: 0
sk.js Found: 383 Missing: 20
sl.js Found: 380 Missing: 23
sr-latn.js Found: 375 Missing: 28
sr.js Found: 375 Missing: 28
sv.js Found: 383 Missing: 20
th.js Found: 352 Missing: 51
tr.js Found: 388 Missing: 15
uk.js Found: 375 Missing: 28
vi.js Found: 403 Missing: 0
zh-cn.js Found: 388 Missing: 15
zh.js Found: 403 Missing: 0
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/_getfontformat.html
New file
0,0 → 1,66
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</head>
<script language="javascript">
 
window.onload = function()
{
var oRange = document.selection.createRange() ;
var sNormal ;
var sFormats = '' ;
for ( var i = 1 ; i <= 9 ; i++ )
{
oRange.moveToElementText( document.getElementById( 'x' + i ) ) ;
sFormats += oRange.queryCommandValue( 'FormatBlock' ) ;
if ( i == 1 )
sNormal = sFormats ;
sFormats += ';' ;
}
document.getElementById('xFontFormats').innerHTML = sFormats + sNormal + ' (DIV)' ;
}
</script>
<body>
<table width="70%" align="center">
<tr>
<td>
<h3>FontFormats Localization</h3>
<p>
IE has some limits when handling the "Font Format". It actually uses localized
strings to retrieve the current format value. This makes it very difficult to
make a system that works on every single computer in the world.
</p>
<p>
With FCKeditor, this problem impacts in the "Format" toolbar command that
doesn't reflects the format of the current cursor position.
</p>
<p>
There is only one way to make it work. We must localize FCKeditor using the
strings used by IE. In this way, we will have the expected behavior at least
when using FCKeditor in the same language as the browser. So, when localizing
FCKeditor, go to a computer with IE in the target language, open this page and
use the following string to the "FontFormats" value:
</p>
<div style="white-space: nowrap">
FontFormats : "<span id="xFontFormats" style="COLOR: #000099"></span>",
</div>
</td>
</tr>
</table>
<div style="DISPLAY: none">
<p id="x1">&nbsp;</p>
<pre id="x2">&nbsp;</pre>
<address id="x3">&nbsp;</address>
<h1 id="x4">&nbsp;</h1>
<h2 id="x5">&nbsp;</h2>
<h3 id="x6">&nbsp;</h3>
<h4 id="x7">&nbsp;</h4>
<h5 id="x8">&nbsp;</h5>
<h6 id="x9">&nbsp;</h6>
</div>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/fr.js
New file
0,0 → 1,501
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fr.js
* French language file.
*
* File Authors:
* Hubert Garrido (liane@users.sourceforge.net)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Masquer Outils",
ToolbarExpand : "Afficher Outils",
 
// Toolbar Items and Context Menu
Save : "Enregistrer",
NewPage : "Nouvelle page",
Preview : "Prévisualisation",
Cut : "Couper",
Copy : "Copier",
Paste : "Coller",
PasteText : "Coller comme texte",
PasteWord : "Coller de Word",
Print : "Imprimer",
SelectAll : "Tout sélectionner",
RemoveFormat : "Supprimer le format",
InsertLinkLbl : "Lien",
InsertLink : "Insérer/modifier le lien",
RemoveLink : "Supprimer le lien",
Anchor : "Insérer/modifier l'ancre",
InsertImageLbl : "Image",
InsertImage : "Insérer/modifier l'image",
InsertFlashLbl : "Animation Flash",
InsertFlash : "Insérer/modifier l'animation Flash",
InsertTableLbl : "Tableau",
InsertTable : "Insérer/modifier le tableau",
InsertLineLbl : "Séparateur",
InsertLine : "Insérer un séparateur",
InsertSpecialCharLbl: "Caractères spéciaux",
InsertSpecialChar : "Insérer un caractère spécial",
InsertSmileyLbl : "Smiley",
InsertSmiley : "Insérer un Smiley",
About : "A propos de FCKeditor",
Bold : "Gras",
Italic : "Italique",
Underline : "Souligné",
StrikeThrough : "Barré",
Subscript : "Indice",
Superscript : "Exposant",
LeftJustify : "Aligné à gauche",
CenterJustify : "Centré",
RightJustify : "Aligné à Droite",
BlockJustify : "Texte justifié",
DecreaseIndent : "Diminuer le retrait",
IncreaseIndent : "Augmenter le retrait",
Undo : "Annuler",
Redo : "Refaire",
NumberedListLbl : "Liste numérotée",
NumberedList : "Insérer/supprimer la liste numérotée",
BulletedListLbl : "Liste à puces",
BulletedList : "Insérer/supprimer la liste à puces",
ShowTableBorders : "Afficher les bordures du tableau",
ShowDetails : "Afficher les caractères invisibles",
Style : "Style",
FontFormat : "Format",
Font : "Police",
FontSize : "Taille",
TextColor : "Couleur de caractère",
BGColor : "Couleur de fond",
Source : "Source",
Find : "Chercher",
Replace : "Remplacer",
SpellCheck : "Orthographe",
UniversalKeyboard : "Clavier universel",
PageBreakLbl : "Saut de page",
PageBreak : "Insérer un saut de page",
 
Form : "Formulaire",
Checkbox : "Case à cocher",
RadioButton : "Bouton radio",
TextField : "Champ texte",
Textarea : "Zone de texte",
HiddenField : "Champ caché",
Button : "Bouton",
SelectionField : "Liste/menu",
ImageButton : "Bouton image",
 
FitWindow : "Edition pleine page",
 
// Context Menu
EditLink : "Modifier le lien",
CellCM : "Cellule",
RowCM : "Ligne",
ColumnCM : "Colonne",
InsertRow : "Insérer une ligne",
DeleteRows : "Supprimer des lignes",
InsertColumn : "Insérer une colonne",
DeleteColumns : "Supprimer des colonnes",
InsertCell : "Insérer une cellule",
DeleteCells : "Supprimer des cellules",
MergeCells : "Fusionner les cellules",
SplitCell : "Scinder les cellules",
TableDelete : "Supprimer le tableau",
CellProperties : "Propriétés de cellule",
TableProperties : "Propriétés du tableau",
ImageProperties : "Propriétés de l'image",
FlashProperties : "Propriétés de l'animation Flash",
 
AnchorProp : "Propriétés de l'ancre",
ButtonProp : "Propriétés du bouton",
CheckboxProp : "Propriétés de la case à cocher",
HiddenFieldProp : "Propriétés du champ caché",
RadioButtonProp : "Propriétés du bouton radio",
ImageButtonProp : "Propriétés du bouton image",
TextFieldProp : "Propriétés du champ texte",
SelectionFieldProp : "Propriétés de la liste/du menu",
TextareaProp : "Propriétés de la zone de texte",
FormProp : "Propriétés du formulaire",
 
FontFormats : "Normal;Formaté;Adresse;En-tête 1;En-tête 2;En-tête 3;En-tête 4;En-tête 5;En-tête 6;Normal (DIV)",
 
// Alerts and Messages
ProcessingXHTML : "Calcul XHTML. Veuillez patienter...",
Done : "Terminé",
PasteWordConfirm : "Le texte à coller semble provenir de Word. Désirez-vous le nettoyer avant de coller?",
NotCompatiblePaste : "Cette commande nécessite Internet Explorer version 5.5 minimum. Souhaitez-vous coller sans nettoyage?",
UnknownToolbarItem : "Elément de barre d'outil inconnu \"%1\"",
UnknownCommand : "Nom de commande inconnu \"%1\"",
NotImplemented : "Commande non encore écrite",
UnknownToolbarSet : "La barre d'outils \"%1\" n'existe pas",
NoActiveX : "Les paramètres de sécurité de votre navigateur peuvent limiter quelques fonctionnalités de l'éditeur. Veuillez activer l'option \"Exécuter les contrôles ActiveX et les plug-ins\". Il se peut que vous rencontriez des erreurs et remarquiez quelques limitations.",
BrowseServerBlocked : "Le navigateur n'a pas pu être ouvert. Assurez-vous que les bloqueurs de popups soient désactivés.",
DialogBlocked : "La fenêtre de dialogue n'a pas pu s'ouvrir. Assurez-vous que les bloqueurs de popups soient désactivés.",
 
// Dialogs
DlgBtnOK : "OK",
DlgBtnCancel : "Annuler",
DlgBtnClose : "Fermer",
DlgBtnBrowseServer : "Parcourir le serveur",
DlgAdvancedTag : "Avancé",
DlgOpOther : "<Autre>",
DlgInfoTab : "Info",
DlgAlertUrl : "Veuillez saisir l'URL",
 
// General Dialogs Labels
DlgGenNotSet : "<Par défaut>",
DlgGenId : "Id",
DlgGenLangDir : "Sens d'écriture",
DlgGenLangDirLtr : "De gauche à droite (LTR)",
DlgGenLangDirRtl : "De droite à gauche (RTL)",
DlgGenLangCode : "Code langue",
DlgGenAccessKey : "Equivalent clavier",
DlgGenName : "Nom",
DlgGenTabIndex : "Ordre de tabulation",
DlgGenLongDescr : "URL de description longue",
DlgGenClass : "Classes de feuilles de style",
DlgGenTitle : "Titre",
DlgGenContType : "Type de contenu",
DlgGenLinkCharset : "Encodage de caractère",
DlgGenStyle : "Style",
 
// Image Dialog
DlgImgTitle : "Propriétés de l'image",
DlgImgInfoTab : "Informations sur l'image",
DlgImgBtnUpload : "Envoyer sur le serveur",
DlgImgURL : "URL",
DlgImgUpload : "Télécharger",
DlgImgAlt : "Texte de remplacement",
DlgImgWidth : "Largeur",
DlgImgHeight : "Hauteur",
DlgImgLockRatio : "Garder les proportions",
DlgBtnResetSize : "Taille originale",
DlgImgBorder : "Bordure",
DlgImgHSpace : "Espacement horizontal",
DlgImgVSpace : "Espacement vertical",
DlgImgAlign : "Alignement",
DlgImgAlignLeft : "Gauche",
DlgImgAlignAbsBottom: "Abs Bas",
DlgImgAlignAbsMiddle: "Abs Milieu",
DlgImgAlignBaseline : "Bas du texte",
DlgImgAlignBottom : "Bas",
DlgImgAlignMiddle : "Milieu",
DlgImgAlignRight : "Droite",
DlgImgAlignTextTop : "Haut du texte",
DlgImgAlignTop : "Haut",
DlgImgPreview : "Prévisualisation",
DlgImgAlertUrl : "Veuillez saisir l'URL de l'image",
DlgImgLinkTab : "Lien",
 
// Flash Dialog
DlgFlashTitle : "Propriétés de l'animation Flash",
DlgFlashChkPlay : "Lecture automatique",
DlgFlashChkLoop : "Boucle",
DlgFlashChkMenu : "Activer le menu Flash",
DlgFlashScale : "Affichage",
DlgFlashScaleAll : "Par défaut (tout montrer)",
DlgFlashScaleNoBorder : "Sans bordure",
DlgFlashScaleFit : "Ajuster aux dimensions",
 
// Link Dialog
DlgLnkWindowTitle : "Propriétés du lien",
DlgLnkInfoTab : "Informations sur le lien",
DlgLnkTargetTab : "Destination",
 
DlgLnkType : "Type de lien",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Ancre dans cette page",
DlgLnkTypeEMail : "E-Mail",
DlgLnkProto : "Protocole",
DlgLnkProtoOther : "<autre>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Sélectionner une ancre",
DlgLnkAnchorByName : "Par nom",
DlgLnkAnchorById : "Par id",
DlgLnkNoAnchors : "<Pas d'ancre disponible dans le document>",
DlgLnkEMail : "Adresse E-Mail",
DlgLnkEMailSubject : "Sujet du message",
DlgLnkEMailBody : "Corps du message",
DlgLnkUpload : "Télécharger",
DlgLnkBtnUpload : "Envoyer sur le serveur",
 
DlgLnkTarget : "Destination",
DlgLnkTargetFrame : "<cadre>",
DlgLnkTargetPopup : "<fenêtre popup>",
DlgLnkTargetBlank : "Nouvelle fenêtre (_blank)",
DlgLnkTargetParent : "Fenêtre mère (_parent)",
DlgLnkTargetSelf : "Même fenêtre (_self)",
DlgLnkTargetTop : "Fenêtre supérieure (_top)",
DlgLnkTargetFrameName : "Nom du cadre de destination",
DlgLnkPopWinName : "Nom de la fenêtre popup",
DlgLnkPopWinFeat : "Caractéristiques de la fenêtre popup",
DlgLnkPopResize : "Taille modifiable",
DlgLnkPopLocation : "Barre d'adresses",
DlgLnkPopMenu : "Barre de menu",
DlgLnkPopScroll : "Barres de défilement",
DlgLnkPopStatus : "Barre d'état",
DlgLnkPopToolbar : "Barre d'outils",
DlgLnkPopFullScrn : "Plein écran (IE)",
DlgLnkPopDependent : "Dépendante (Netscape)",
DlgLnkPopWidth : "Largeur",
DlgLnkPopHeight : "Hauteur",
DlgLnkPopLeft : "Position à partir de la gauche",
DlgLnkPopTop : "Position à partir du haut",
 
DlnLnkMsgNoUrl : "Veuillez saisir l'URL",
DlnLnkMsgNoEMail : "Veuillez saisir l'adresse e-mail",
DlnLnkMsgNoAnchor : "Veuillez sélectionner une ancre",
DlnLnkMsgInvPopName : "Le nom de la fenêtre popup doit commencer par une lettre et ne doit pas contenir d'espace",
 
// Color Dialog
DlgColorTitle : "Sélectionner",
DlgColorBtnClear : "Effacer",
DlgColorHighlight : "Prévisualisation",
DlgColorSelected : "Sélectionné",
 
// Smiley Dialog
DlgSmileyTitle : "Insérer un Smiley",
 
// Special Character Dialog
DlgSpecialCharTitle : "Insérer un caractère spécial",
 
// Table Dialog
DlgTableTitle : "Propriétés du tableau",
DlgTableRows : "Lignes",
DlgTableColumns : "Colonnes",
DlgTableBorder : "Bordure",
DlgTableAlign : "Alignement",
DlgTableAlignNotSet : "<Par défaut>",
DlgTableAlignLeft : "Gauche",
DlgTableAlignCenter : "Centré",
DlgTableAlignRight : "Droite",
DlgTableWidth : "Largeur",
DlgTableWidthPx : "pixels",
DlgTableWidthPc : "pourcentage",
DlgTableHeight : "Hauteur",
DlgTableCellSpace : "Espacement",
DlgTableCellPad : "Contour",
DlgTableCaption : "Titre",
DlgTableSummary : "Résumé",
 
// Table Cell Dialog
DlgCellTitle : "Propriétés de la cellule",
DlgCellWidth : "Largeur",
DlgCellWidthPx : "pixels",
DlgCellWidthPc : "pourcentage",
DlgCellHeight : "Hauteur",
DlgCellWordWrap : "Retour à la ligne",
DlgCellWordWrapNotSet : "<Par défaut>",
DlgCellWordWrapYes : "Oui",
DlgCellWordWrapNo : "Non",
DlgCellHorAlign : "Alignement horizontal",
DlgCellHorAlignNotSet : "<Par défaut>",
DlgCellHorAlignLeft : "Gauche",
DlgCellHorAlignCenter : "Centré",
DlgCellHorAlignRight: "Droite",
DlgCellVerAlign : "Alignement vertical",
DlgCellVerAlignNotSet : "<Par défaut>",
DlgCellVerAlignTop : "Haut",
DlgCellVerAlignMiddle : "Milieu",
DlgCellVerAlignBottom : "Bas",
DlgCellVerAlignBaseline : "Bas du texte",
DlgCellRowSpan : "Lignes fusionnées",
DlgCellCollSpan : "Colonnes fusionnées",
DlgCellBackColor : "Fond",
DlgCellBorderColor : "Bordure",
DlgCellBtnSelect : "Choisir...",
 
// Find Dialog
DlgFindTitle : "Chercher",
DlgFindFindBtn : "Chercher",
DlgFindNotFoundMsg : "Le texte indiqué est introuvable.",
 
// Replace Dialog
DlgReplaceTitle : "Remplacer",
DlgReplaceFindLbl : "Rechercher:",
DlgReplaceReplaceLbl : "Remplacer par:",
DlgReplaceCaseChk : "Respecter la casse",
DlgReplaceReplaceBtn : "Remplacer",
DlgReplaceReplAllBtn : "Tout remplacer",
DlgReplaceWordChk : "Mot entier",
 
// Paste Operations / Dialog
PasteErrorPaste : "Les paramètres de sécurité de votre navigateur empêchent l'éditeur de coller automatiquement vos données. Veuillez utiliser les équivalents claviers (Ctrl+V).",
PasteErrorCut : "Les paramètres de sécurité de votre navigateur empêchent l'éditeur de couper automatiquement vos données. Veuillez utiliser les équivalents claviers (Ctrl+X).",
PasteErrorCopy : "Les paramètres de sécurité de votre navigateur empêchent l'éditeur de copier automatiquement vos données. Veuillez utiliser les équivalents claviers (Ctrl+C).",
 
PasteAsText : "Coller comme texte",
PasteFromWord : "Coller à partir de Word",
 
DlgPasteMsg2 : "Veuillez coller dans la zone ci-dessous en utilisant le clavier (<STRONG>Ctrl+V</STRONG>) et cliquez sur <STRONG>OK</STRONG>.",
DlgPasteIgnoreFont : "Ignorer les polices de caractères",
DlgPasteRemoveStyles : "Supprimer les styles",
DlgPasteCleanBox : "Effacer le contenu",
 
// Color Picker
ColorAutomatic : "Automatique",
ColorMoreColors : "Plus de couleurs...",
 
// Document Properties
DocProps : "Propriétés du document",
 
// Anchor Dialog
DlgAnchorTitle : "Propriétés de l'ancre",
DlgAnchorName : "Nom de l'ancre",
DlgAnchorErrorName : "Veuillez saisir le nom de l'ancre",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Pas dans le dictionnaire",
DlgSpellChangeTo : "Changer en",
DlgSpellBtnIgnore : "Ignorer",
DlgSpellBtnIgnoreAll : "Ignorer tout",
DlgSpellBtnReplace : "Remplacer",
DlgSpellBtnReplaceAll : "Remplacer tout",
DlgSpellBtnUndo : "Annuler",
DlgSpellNoSuggestions : "- Aucune suggestion -",
DlgSpellProgress : "Vérification d'orthographe en cours...",
DlgSpellNoMispell : "Vérification d'orthographe terminée: Aucune erreur trouvée",
DlgSpellNoChanges : "Vérification d'orthographe terminée: Pas de modifications",
DlgSpellOneChange : "Vérification d'orthographe terminée: Un mot modifié",
DlgSpellManyChanges : "Vérification d'orthographe terminée: %1 mots modifiés",
 
IeSpellDownload : "Le Correcteur n'est pas installé. Souhaitez-vous le télécharger maintenant?",
 
// Button Dialog
DlgButtonText : "Texte (valeur)",
DlgButtonType : "Type",
DlgButtonTypeBtn : "Bouton",
DlgButtonTypeSbm : "Envoyer",
DlgButtonTypeRst : "Réinitialiser",
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Nom",
DlgCheckboxValue : "Valeur",
DlgCheckboxSelected : "Sélectionné",
 
// Form Dialog
DlgFormName : "Nom",
DlgFormAction : "Action",
DlgFormMethod : "Méthode",
 
// Select Field Dialog
DlgSelectName : "Nom",
DlgSelectValue : "Valeur",
DlgSelectSize : "Taille",
DlgSelectLines : "lignes",
DlgSelectChkMulti : "Sélection multiple",
DlgSelectOpAvail : "Options disponibles",
DlgSelectOpText : "Texte",
DlgSelectOpValue : "Valeur",
DlgSelectBtnAdd : "Ajouter",
DlgSelectBtnModify : "Modifier",
DlgSelectBtnUp : "Monter",
DlgSelectBtnDown : "Descendre",
DlgSelectBtnSetValue : "Valeur sélectionnée",
DlgSelectBtnDelete : "Supprimer",
 
// Textarea Dialog
DlgTextareaName : "Nom",
DlgTextareaCols : "Colonnes",
DlgTextareaRows : "Lignes",
 
// Text Field Dialog
DlgTextName : "Nom",
DlgTextValue : "Valeur",
DlgTextCharWidth : "Largeur en caractères",
DlgTextMaxChars : "Nombre maximum de caractères",
DlgTextType : "Type",
DlgTextTypeText : "Texte",
DlgTextTypePass : "Mot de passe",
 
// Hidden Field Dialog
DlgHiddenName : "Nom",
DlgHiddenValue : "Valeur",
 
// Bulleted List Dialog
BulletedListProp : "Propriétés de liste à puces",
NumberedListProp : "Propriétés de liste numérotée",
DlgLstStart : "Début",
DlgLstType : "Type",
DlgLstTypeCircle : "Cercle",
DlgLstTypeDisc : "Disque",
DlgLstTypeSquare : "Carré",
DlgLstTypeNumbers : "Nombres (1, 2, 3)",
DlgLstTypeLCase : "Lettres minuscules (a, b, c)",
DlgLstTypeUCase : "Lettres majuscules (A, B, C)",
DlgLstTypeSRoman : "Chiffres romains minuscules (i, ii, iii)",
DlgLstTypeLRoman : "Chiffres romains majuscules (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "Général",
DlgDocBackTab : "Fond",
DlgDocColorsTab : "Couleurs et marges",
DlgDocMetaTab : "Métadonnées",
 
DlgDocPageTitle : "Titre de la page",
DlgDocLangDir : "Sens d'écriture",
DlgDocLangDirLTR : "De la gauche vers la droite (LTR)",
DlgDocLangDirRTL : "De la droite vers la gauche (RTL)",
DlgDocLangCode : "Code langue",
DlgDocCharSet : "Encodage de caractère",
DlgDocCharSetCE : "Europe Centrale",
DlgDocCharSetCT : "Chinois Traditionnel (Big5)",
DlgDocCharSetCR : "Cyrillique",
DlgDocCharSetGR : "Grec",
DlgDocCharSetJP : "Japanais",
DlgDocCharSetKR : "Coréen",
DlgDocCharSetTR : "Turc",
DlgDocCharSetUN : "Unicode (UTF-8)",
DlgDocCharSetWE : "Occidental",
DlgDocCharSetOther : "Autre encodage de caractère",
 
DlgDocDocType : "Type de document",
DlgDocDocTypeOther : "Autre type de document",
DlgDocIncXHTML : "Inclure les déclarations XHTML",
DlgDocBgColor : "Couleur de fond",
DlgDocBgImage : "Image de fond",
DlgDocBgNoScroll : "Image fixe sans défilement",
DlgDocCText : "Texte",
DlgDocCLink : "Lien",
DlgDocCVisited : "Lien visité",
DlgDocCActive : "Lien activé",
DlgDocMargins : "Marges",
DlgDocMaTop : "Haut",
DlgDocMaLeft : "Gauche",
DlgDocMaRight : "Droite",
DlgDocMaBottom : "Bas",
DlgDocMeIndex : "Mots-clés (séparés par des virgules)",
DlgDocMeDescr : "Description",
DlgDocMeAuthor : "Auteur",
DlgDocMeCopy : "Copyright",
DlgDocPreview : "Prévisualisation",
 
// Templates Dialog
Templates : "Modèles",
DlgTemplatesTitle : "Modèles de contenu",
DlgTemplatesSelMsg : "Veuillez sélectionner le modèle à ouvrir dans l'éditeur<br>(le contenu actuel sera remplacé):",
DlgTemplatesLoading : "Chargement de la liste des modèles. Veuillez patienter...",
DlgTemplatesNoTpl : "(Aucun modèle disponible)",
DlgTemplatesReplace : "Remplacer tout le contenu",
 
// About Dialog
DlgAboutAboutTab : "A propos de",
DlgAboutBrowserInfoTab : "Navigateur",
DlgAboutLicenseTab : "License",
DlgAboutVersion : "version",
DlgAboutLicense : "License selon les termes de GNU Lesser General Public License",
DlgAboutInfo : "Pour plus d'informations, aller à"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/et.js
New file
0,0 → 1,502
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: et.js
* Estonian language file.
*
* File Authors:
* Kristjan Kivikangur (kristjan@ttrk.ee)
* Gustav Kaskema
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Voldi tööriistariba",
ToolbarExpand : "Laienda tööriistariba",
 
// Toolbar Items and Context Menu
Save : "Salvesta",
NewPage : "Uus leht",
Preview : "Eelvaade",
Cut : "Lõika",
Copy : "Kopeeri",
Paste : "Kleebi",
PasteText : "Kleebi tavalise tekstina",
PasteWord : "Kleebi Wordist",
Print : "Prindi",
SelectAll : "Vali kõik",
RemoveFormat : "Eemalda vorming",
InsertLinkLbl : "Link",
InsertLink : "Sisesta/Muuda link",
RemoveLink : "Eemalda link",
Anchor : "Sisesta/Muuda ankur",
InsertImageLbl : "Pilt",
InsertImage : "Sisesta/Muuda pilt",
InsertFlashLbl : "Flash",
InsertFlash : "Sisesta/Muuda flash",
InsertTableLbl : "Tabel",
InsertTable : "Sisesta/Muuda tabel",
InsertLineLbl : "Joon",
InsertLine : "Sisesta horisontaaljoon",
InsertSpecialCharLbl: "Erimärgid",
InsertSpecialChar : "Sisesta erimärk",
InsertSmileyLbl : "Emotikon",
InsertSmiley : "Sisesta emotikon",
About : "FCKeditor teave",
Bold : "Rasvane kiri",
Italic : "Kursiiv kiri",
Underline : "Allajoonitud kiri",
StrikeThrough : "Läbijoonitud kiri",
Subscript : "Allindeks",
Superscript : "Ülaindeks",
LeftJustify : "Vasakjoondus",
CenterJustify : "Keskjoondus",
RightJustify : "Paremjoondus",
BlockJustify : "Rööpjoondus",
DecreaseIndent : "Vähenda taanet",
IncreaseIndent : "Suurenda taanet",
Undo : "Võta tagasi",
Redo : "Korda toimingut",
NumberedListLbl : "Nummerdatud loetelu",
NumberedList : "Sisesta/Eemalda nummerdatud loetelu",
BulletedListLbl : "Punktiseeritud loetelu",
BulletedList : "Sisesta/Eemalda punktiseeritud loetelu",
ShowTableBorders : "Näita tabeli jooni",
ShowDetails : "Näita üksikasju",
Style : "Laad",
FontFormat : "Vorming",
Font : "Kiri",
FontSize : "Suurus",
TextColor : "Teksti värv",
BGColor : "Tausta värv",
Source : "Lähtekood",
Find : "Otsi",
Replace : "Asenda",
SpellCheck : "Kontrolli õigekirja",
UniversalKeyboard : "Universaalne klaviatuur",
PageBreakLbl : "Lehepiir",
PageBreak : "Sisesta lehevahetus koht",
 
Form : "Vorm",
Checkbox : "Märkeruut",
RadioButton : "Raadionupp",
TextField : "Tekstilahter",
Textarea : "Tekstiala",
HiddenField : "Varjatud lahter",
Button : "Nupp",
SelectionField : "Valiklahter",
ImageButton : "Piltnupp",
 
FitWindow : "Maksimeeri redaktori mõõtmed",
 
// Context Menu
EditLink : "Muuda linki",
CellCM : "Lahter",
RowCM : "Rida",
ColumnCM : "Veerg",
InsertRow : "Lisa rida",
DeleteRows : "Eemalda ridu",
InsertColumn : "Lisa veerg",
DeleteColumns : "Eemalda veerud",
InsertCell : "Lisa lahter",
DeleteCells : "Eemalda lahtrid",
MergeCells : "Ühenda lahtrid",
SplitCell : "Lahuta lahtrid",
TableDelete : "Kustuta tabel",
CellProperties : "Lahtri atribuudid",
TableProperties : "Tabeli atribuudid",
ImageProperties : "Pildi atribuudid",
FlashProperties : "Flash omadused",
 
AnchorProp : "Ankru omadused",
ButtonProp : "Nupu omadused",
CheckboxProp : "Märkeruudu omadused",
HiddenFieldProp : "Varjatud lahtri omadused",
RadioButtonProp : "Raadionupu omadused",
ImageButtonProp : "Piltnupu omadused",
TextFieldProp : "Tekstilahtri omadused",
SelectionFieldProp : "Valiklahtri omadused",
TextareaProp : "Tekstiala omadused",
FormProp : "Vormi omadused",
 
FontFormats : "Tavaline;Vormindatud;Aadress;Pealkiri 1;Pealkiri 2;Pealkiri 3;Pealkiri 4;Pealkiri 5;Pealkiri 6",
 
// Alerts and Messages
ProcessingXHTML : "Töötlen XHTML. Palun oota...",
Done : "Tehtud",
PasteWordConfirm : "Tekst, mida soovid lisada paistab pärinevat Wordist. Kas soovid seda enne kleepimist puhastada?",
NotCompatiblePaste : "See käsk on saadaval ainult Internet Explorer versioon 5.5 või uuema puhul. Kas soovid kleepida ilma puhastamata?",
UnknownToolbarItem : "Tundmatu tööriistariba üksus \"%1\"",
UnknownCommand : "Tundmatu käsunimi \"%1\"",
NotImplemented : "Käsku ei täidetud",
UnknownToolbarSet : "Tööriistariba \"%1\" ei eksisteeri",
NoActiveX : "Sinu interneti sirvija turvalisuse seaded võivad limiteerida mõningaid tekstirdaktori kasutus võimalusi. Sa peaksid võimaldama valiku \"Run ActiveX controls and plug-ins\" oma sirvija seadetes. Muidu võid sa täheldada vigu tekstiredaktori töös ja märgata puuduvaid funktsioone.",
BrowseServerBlocked : "Ressursside sirvija avamine ebaõnnestus. Võimalda pop-up akende avanemine.",
DialogBlocked : "Ei olenud võimalik avada dialoogi akent. Võimalda pop-up akende avanemine.",
 
// Dialogs
DlgBtnOK : "OK",
DlgBtnCancel : "Loobu",
DlgBtnClose : "Sulge",
DlgBtnBrowseServer : "Sirvi serverit",
DlgAdvancedTag : "Täpsemalt",
DlgOpOther : "<Teine>",
DlgInfoTab : "Info",
DlgAlertUrl : "Palun sisesta URL",
 
// General Dialogs Labels
DlgGenNotSet : "<määramata>",
DlgGenId : "Id",
DlgGenLangDir : "Keele suund",
DlgGenLangDirLtr : "Vasakult paremale (LTR)",
DlgGenLangDirRtl : "Paremalt vasakule (RTL)",
DlgGenLangCode : "Keele kood",
DlgGenAccessKey : "Juurdepääsu võti",
DlgGenName : "Nimi",
DlgGenTabIndex : "Tab indeks",
DlgGenLongDescr : "Pikk kirjeldus URL",
DlgGenClass : "Stiilistiku klassid",
DlgGenTitle : "Juhendav tiitel",
DlgGenContType : "Juhendava sisu tüüp",
DlgGenLinkCharset : "Lingitud ressurssi märgistik",
DlgGenStyle : "Laad",
 
// Image Dialog
DlgImgTitle : "Pildi atribuudid",
DlgImgInfoTab : "Pildi info",
DlgImgBtnUpload : "Saada serverissee",
DlgImgURL : "URL",
DlgImgUpload : "Lae üles",
DlgImgAlt : "Alternatiivne tekst",
DlgImgWidth : "Laius",
DlgImgHeight : "Kõrgus",
DlgImgLockRatio : "Lukusta kuvasuhe",
DlgBtnResetSize : "Lähtesta suurus",
DlgImgBorder : "Joon",
DlgImgHSpace : "H. vaheruum",
DlgImgVSpace : "V. vaheruum",
DlgImgAlign : "Joondus",
DlgImgAlignLeft : "Vasak",
DlgImgAlignAbsBottom: "Abs alla",
DlgImgAlignAbsMiddle: "Abs keskele",
DlgImgAlignBaseline : "Baasjoonele",
DlgImgAlignBottom : "Alla",
DlgImgAlignMiddle : "Keskele",
DlgImgAlignRight : "Paremale",
DlgImgAlignTextTop : "Tekstit üles",
DlgImgAlignTop : "Üles",
DlgImgPreview : "Eelvaade",
DlgImgAlertUrl : "Palun kirjuta pildi URL",
DlgImgLinkTab : "Link",
 
// Flash Dialog
DlgFlashTitle : "Flash omadused",
DlgFlashChkPlay : "Automaatne start ",
DlgFlashChkLoop : "Korduv",
DlgFlashChkMenu : "Võimalda flash menüü",
DlgFlashScale : "Mastaap",
DlgFlashScaleAll : "Näita kõike",
DlgFlashScaleNoBorder : "Äärist ei ole",
DlgFlashScaleFit : "Täpne sobivus",
 
// Link Dialog
DlgLnkWindowTitle : "Link",
DlgLnkInfoTab : "Lingi info",
DlgLnkTargetTab : "Sihtkoht",
 
DlgLnkType : "Lingi tüüp",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Ankur sellel lehel",
DlgLnkTypeEMail : "E-post",
DlgLnkProto : "Protokoll",
DlgLnkProtoOther : "<muu>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Vali ankur",
DlgLnkAnchorByName : "Ankru nime järgi",
DlgLnkAnchorById : "Elemendi id järgi",
DlgLnkNoAnchors : "<Selles dokumendis ei ole ankruid>",
DlgLnkEMail : "E-posti aadress",
DlgLnkEMailSubject : "Sõnumi teema",
DlgLnkEMailBody : "Sõnumi tekst",
DlgLnkUpload : "Lae üles",
DlgLnkBtnUpload : "Saada serverisse",
 
DlgLnkTarget : "Sihtkoht",
DlgLnkTargetFrame : "<raam>",
DlgLnkTargetPopup : "<hüpikaken>",
DlgLnkTargetBlank : "Uus aken (_blank)",
DlgLnkTargetParent : "Vanem aken (_parent)",
DlgLnkTargetSelf : "Sama aken (_self)",
DlgLnkTargetTop : "Pealmine aken (_top)",
DlgLnkTargetFrameName : "Sihtmärk raami nimi",
DlgLnkPopWinName : "Hüpikakna nimi",
DlgLnkPopWinFeat : "Hüpikakna omadused",
DlgLnkPopResize : "Suurendatav",
DlgLnkPopLocation : "Aadressiriba",
DlgLnkPopMenu : "Menüüriba",
DlgLnkPopScroll : "Kerimisribad",
DlgLnkPopStatus : "Olekuriba",
DlgLnkPopToolbar : "Tööriistariba",
DlgLnkPopFullScrn : "Täisekraan (IE)",
DlgLnkPopDependent : "Sõltuv (Netscape)",
DlgLnkPopWidth : "Laius",
DlgLnkPopHeight : "Kõrgus",
DlgLnkPopLeft : "Vasak asukoht",
DlgLnkPopTop : "Ülemine asukoht",
 
DlnLnkMsgNoUrl : "Palun kirjuta lingi URL",
DlnLnkMsgNoEMail : "Palun kirjuta E-Posti aadress",
DlnLnkMsgNoAnchor : "Palun vali ankur",
DlnLnkMsgInvPopName : "The popup name must begin with an alphabetic character and must not contain spaces", //MISSING
 
// Color Dialog
DlgColorTitle : "Vali värv",
DlgColorBtnClear : "Tühjenda",
DlgColorHighlight : "Märgi",
DlgColorSelected : "Valitud",
 
// Smiley Dialog
DlgSmileyTitle : "Sisesta emotikon",
 
// Special Character Dialog
DlgSpecialCharTitle : "Vali erimärk",
 
// Table Dialog
DlgTableTitle : "Tabeli atribuudid",
DlgTableRows : "Read",
DlgTableColumns : "Veerud",
DlgTableBorder : "Joone suurus",
DlgTableAlign : "Joondus",
DlgTableAlignNotSet : "<Määramata>",
DlgTableAlignLeft : "Vasak",
DlgTableAlignCenter : "Kesk",
DlgTableAlignRight : "Parem",
DlgTableWidth : "Laius",
DlgTableWidthPx : "pikslit",
DlgTableWidthPc : "protsenti",
DlgTableHeight : "Kõrgus",
DlgTableCellSpace : "Lahtri vahe",
DlgTableCellPad : "Lahtri täidis",
DlgTableCaption : "Tabeli tiitel",
DlgTableSummary : "Kokkuvõte",
 
// Table Cell Dialog
DlgCellTitle : "Lahtri atribuudid",
DlgCellWidth : "Laius",
DlgCellWidthPx : "pikslit",
DlgCellWidthPc : "protsenti",
DlgCellHeight : "Kõrgus",
DlgCellWordWrap : "Sõna ülekanne",
DlgCellWordWrapNotSet : "<Määramata>",
DlgCellWordWrapYes : "Jah",
DlgCellWordWrapNo : "Ei",
DlgCellHorAlign : "Horisontaaljoondus",
DlgCellHorAlignNotSet : "<Määramata>",
DlgCellHorAlignLeft : "Vasak",
DlgCellHorAlignCenter : "Kesk",
DlgCellHorAlignRight: "Parem",
DlgCellVerAlign : "Vertikaaljoondus",
DlgCellVerAlignNotSet : "<Määramata>",
DlgCellVerAlignTop : "Üles",
DlgCellVerAlignMiddle : "Keskele",
DlgCellVerAlignBottom : "Alla",
DlgCellVerAlignBaseline : "Baasjoonele",
DlgCellRowSpan : "Reaulatus",
DlgCellCollSpan : "Veeruulatus",
DlgCellBackColor : "Tausta värv",
DlgCellBorderColor : "Joone värv",
DlgCellBtnSelect : "Vali...",
 
// Find Dialog
DlgFindTitle : "Otsi",
DlgFindFindBtn : "Otsi",
DlgFindNotFoundMsg : "Valitud teksti ei leitud.",
 
// Replace Dialog
DlgReplaceTitle : "Asenda",
DlgReplaceFindLbl : "Leia mida:",
DlgReplaceReplaceLbl : "Asenda millega:",
DlgReplaceCaseChk : "Erista suur- ja väiketähti",
DlgReplaceReplaceBtn : "Asenda",
DlgReplaceReplAllBtn : "Asenda kõik",
DlgReplaceWordChk : "Otsi terviklike sõnu",
 
// Paste Operations / Dialog
PasteErrorPaste : "Sinu interneti sirvija turvaseaded ei luba redaktoril automaatselt kleepida. Palun kasutage selleks klaviatuuri klahvikombinatsiooni (Ctrl+V).",
PasteErrorCut : "Sinu interneti sirvija turvaseaded ei luba redaktoril automaatselt lõigata. Palun kasutage selleks klaviatuuri klahvikombinatsiooni (Ctrl+X).",
PasteErrorCopy : "Sinu interneti sirvija turvaseaded ei luba redaktoril automaatselt kopeerida. Palun kasutage selleks klaviatuuri klahvikombinatsiooni (Ctrl+C).",
 
PasteAsText : "Kleebi tavalise tekstina",
PasteFromWord : "Kleebi Wordist",
 
DlgPasteMsg2 : "Palun kleebi järgnevasse kasti kasutades klaviatuuri klahvikombinatsiooni (<STRONG>Ctrl+V</STRONG>) ja vajuta seejärel <STRONG>OK</STRONG>.",
DlgPasteIgnoreFont : "Ignoreeri kirja definitsioone",
DlgPasteRemoveStyles : "Eemalda stiilide definitsioonid",
DlgPasteCleanBox : "Puhasta ära kast",
 
// Color Picker
ColorAutomatic : "Automaatne",
ColorMoreColors : "Rohkem värve...",
 
// Document Properties
DocProps : "Dokumendi omadused",
 
// Anchor Dialog
DlgAnchorTitle : "Ankru omadused",
DlgAnchorName : "Ankru nimi",
DlgAnchorErrorName : "Palun sisest ankru nimi",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Puudub sõnastikust",
DlgSpellChangeTo : "Muuda",
DlgSpellBtnIgnore : "Ignoreeri",
DlgSpellBtnIgnoreAll : "Ignoreeri kõiki",
DlgSpellBtnReplace : "Asenda",
DlgSpellBtnReplaceAll : "Asenda kõik",
DlgSpellBtnUndo : "Võta tagasi",
DlgSpellNoSuggestions : "- Soovitused puuduvad -",
DlgSpellProgress : "Toimub õigekirja kontroll...",
DlgSpellNoMispell : "Õigekirja kontroll sooritatud: õigekirjuvigu ei leitud",
DlgSpellNoChanges : "Õigekirja kontroll sooritatud: ühtegi sõna ei muudetud",
DlgSpellOneChange : "Õigekirja kontroll sooritatud: üks sõna muudeti",
DlgSpellManyChanges : "Õigekirja kontroll sooritatud: %1 sõna muudetud",
 
IeSpellDownload : "Õigekirja kontrollija ei ole installeeritud. Soovid sa selle alla laadida?",
 
// Button Dialog
DlgButtonText : "Tekst (väärtus)",
DlgButtonType : "Tüüp",
DlgButtonTypeBtn : "Button", //MISSING
DlgButtonTypeSbm : "Submit", //MISSING
DlgButtonTypeRst : "Reset", //MISSING
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Nimi",
DlgCheckboxValue : "Väärtus",
DlgCheckboxSelected : "Valitud",
 
// Form Dialog
DlgFormName : "Nimi",
DlgFormAction : "Toiming",
DlgFormMethod : "Meetod",
 
// Select Field Dialog
DlgSelectName : "Nimi",
DlgSelectValue : "Väärtus",
DlgSelectSize : "Suurus",
DlgSelectLines : "ridu",
DlgSelectChkMulti : "Võimalda mitu valikut",
DlgSelectOpAvail : "Võimalikud valikud",
DlgSelectOpText : "Tekst",
DlgSelectOpValue : "Väärtus",
DlgSelectBtnAdd : "Lisa",
DlgSelectBtnModify : "Muuda",
DlgSelectBtnUp : "Üles",
DlgSelectBtnDown : "Alla",
DlgSelectBtnSetValue : "Sea valitud olekuna",
DlgSelectBtnDelete : "Kustuta",
 
// Textarea Dialog
DlgTextareaName : "Nimi",
DlgTextareaCols : "Veerge",
DlgTextareaRows : "Ridu",
 
// Text Field Dialog
DlgTextName : "Nimi",
DlgTextValue : "Väärtus",
DlgTextCharWidth : "Laius (tähemärkides)",
DlgTextMaxChars : "Maksimaalselt tähemärke",
DlgTextType : "Tüüp",
DlgTextTypeText : "Tekst",
DlgTextTypePass : "Parool",
 
// Hidden Field Dialog
DlgHiddenName : "Nimi",
DlgHiddenValue : "Väärtus",
 
// Bulleted List Dialog
BulletedListProp : "Täpitud loetelu omadused",
NumberedListProp : "Nummerdatud loetelu omadused",
DlgLstStart : "Start", //MISSING
DlgLstType : "Tüüp",
DlgLstTypeCircle : "Ring",
DlgLstTypeDisc : "Ketas",
DlgLstTypeSquare : "Ruut",
DlgLstTypeNumbers : "Numbrid (1, 2, 3)",
DlgLstTypeLCase : "Väiketähed (a, b, c)",
DlgLstTypeUCase : "Suurtähed (A, B, C)",
DlgLstTypeSRoman : "Väiksed Rooma numbrid (i, ii, iii)",
DlgLstTypeLRoman : "Suured Rooma numbrid (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "Üldine",
DlgDocBackTab : "Taust",
DlgDocColorsTab : "Värvid ja veerised",
DlgDocMetaTab : "Meta andmed",
 
DlgDocPageTitle : "Lehekülje tiitel",
DlgDocLangDir : "Kirja suund",
DlgDocLangDirLTR : "Vasakult paremale (LTR)",
DlgDocLangDirRTL : "Paremalt vasakule (RTL)",
DlgDocLangCode : "Keele kood",
DlgDocCharSet : "Märgistiku kodeering",
DlgDocCharSetCE : "Central European", //MISSING
DlgDocCharSetCT : "Chinese Traditional (Big5)", //MISSING
DlgDocCharSetCR : "Cyrillic", //MISSING
DlgDocCharSetGR : "Greek", //MISSING
DlgDocCharSetJP : "Japanese", //MISSING
DlgDocCharSetKR : "Korean", //MISSING
DlgDocCharSetTR : "Turkish", //MISSING
DlgDocCharSetUN : "Unicode (UTF-8)", //MISSING
DlgDocCharSetWE : "Western European", //MISSING
DlgDocCharSetOther : "Ülejäänud märgistike kodeeringud",
 
DlgDocDocType : "Dokumendi tüüppäis",
DlgDocDocTypeOther : "Teised dokumendi tüüppäised",
DlgDocIncXHTML : "Arva kaasa XHTML deklaratsioonid",
DlgDocBgColor : "Taustavärv",
DlgDocBgImage : "Taustapildi URL",
DlgDocBgNoScroll : "Mittekeritav tagataust",
DlgDocCText : "Tekst",
DlgDocCLink : "Link",
DlgDocCVisited : "Külastatud link",
DlgDocCActive : "Aktiivne link",
DlgDocMargins : "Lehekülje äärised",
DlgDocMaTop : "Ülaserv",
DlgDocMaLeft : "Vasakserv",
DlgDocMaRight : "Paremserv",
DlgDocMaBottom : "Alaserv",
DlgDocMeIndex : "Dokumendi võtmesõnad (eraldatud komadega)",
DlgDocMeDescr : "Dokumendi kirjeldus",
DlgDocMeAuthor : "Autor",
DlgDocMeCopy : "Autoriõigus",
DlgDocPreview : "Eelvaade",
 
// Templates Dialog
Templates : "Šabloon",
DlgTemplatesTitle : "Sisu šabloonid",
DlgTemplatesSelMsg : "Palun vali Å¡abloon, et avada see redaktoris<br />(praegune sisu läheb kaotsi):",
DlgTemplatesLoading : "Laen šabloonide nimekirja. Palun oota...",
DlgTemplatesNoTpl : "(Ühtegi Å¡ablooni ei ole defineeritud)",
DlgTemplatesReplace : "Replace actual contents", //MISSING
 
// About Dialog
DlgAboutAboutTab : "Teave",
DlgAboutBrowserInfoTab : "Interneti sirvija info",
DlgAboutLicenseTab : "Litsents",
DlgAboutVersion : "versioon",
DlgAboutLicense : "Litsenseeritud GNU Lesser General Public License litsentsiga",
DlgAboutInfo : "Täpsema info saamiseks mine"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/nl.js
New file
0,0 → 1,502
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: nl.js
* Dutch language file.
*
* File Authors:
* Bram Crins (bcrins@realdesign.nl)
* Aaron van Geffen (aaron@aaronweb.net)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Menubalk inklappen",
ToolbarExpand : "Menubalk uitklappen",
 
// Toolbar Items and Context Menu
Save : "Opslaan",
NewPage : "Nieuwe pagina",
Preview : "Voorbeeld",
Cut : "Knippen",
Copy : "Kopiëren",
Paste : "Plakken",
PasteText : "Plakken als platte tekst",
PasteWord : "Plakken als Word-gegevens",
Print : "Printen",
SelectAll : "Alles selecteren",
RemoveFormat : "Opmaak verwijderen",
InsertLinkLbl : "Link",
InsertLink : "Invoegen/Wijzigen link",
RemoveLink : "Verwijderen link",
Anchor : "Interne link",
InsertImageLbl : "Afbeelding",
InsertImage : "Invoegen/Wijzigen afbeelding",
InsertFlashLbl : "Flash",
InsertFlash : "Invoegen/Wijzigen Flash",
InsertTableLbl : "Tabel",
InsertTable : "Invoegen/Wijzigen tabel",
InsertLineLbl : "Lijn",
InsertLine : "Invoegen horizontale lijn",
InsertSpecialCharLbl: "Speciale tekens",
InsertSpecialChar : "Speciaal teken invoegen",
InsertSmileyLbl : "Smiley",
InsertSmiley : "Smiley invoegen",
About : "Over FCKeditor",
Bold : "Vet",
Italic : "Schuingedrukt",
Underline : "Onderstreept",
StrikeThrough : "Doorhalen",
Subscript : "Subscript",
Superscript : "Superscript",
LeftJustify : "Links uitlijnen",
CenterJustify : "Centreren",
RightJustify : "Rechts uitlijnen",
BlockJustify : "Uitvullen",
DecreaseIndent : "Oplopenend",
IncreaseIndent : "Aflopend",
Undo : "Ongedaan maken",
Redo : "Opnieuw",
NumberedListLbl : "Genummerde lijst",
NumberedList : "Invoegen/Verwijderen genummerde lijst",
BulletedListLbl : "Opsomming",
BulletedList : "Invoegen/Verwijderen opsomming",
ShowTableBorders : "Randen tabel weergeven",
ShowDetails : "Details weergeven",
Style : "Stijl",
FontFormat : "Opmaak",
Font : "Lettertype",
FontSize : "Grootte",
TextColor : "Tekstkleur",
BGColor : "Achtergrondkleur",
Source : "Code",
Find : "Zoeken",
Replace : "Vervangen",
SpellCheck : "Spellingscontrole",
UniversalKeyboard : "Universeel toetsenbord",
PageBreakLbl : "Pagina-einde",
PageBreak : "Pagina-einde invoegen",
 
Form : "Formulier",
Checkbox : "Aanvinkvakje",
RadioButton : "Selectievakje",
TextField : "Tekstveld",
Textarea : "Tekstvak",
HiddenField : "Verborgen veld",
Button : "Knop",
SelectionField : "Selectieveld",
ImageButton : "Afbeeldingsknop",
 
FitWindow : "De editor maximaliseren",
 
// Context Menu
EditLink : "Link wijzigen",
CellCM : "Cel",
RowCM : "Rij",
ColumnCM : "Kolom",
InsertRow : "Rij invoegen",
DeleteRows : "Rijen verwijderen",
InsertColumn : "Kolom invoegen",
DeleteColumns : "Kolommen verwijderen",
InsertCell : "Cel",
DeleteCells : "Cellen verwijderen",
MergeCells : "Cellen samenvoegen",
SplitCell : "Cellen splitsen",
TableDelete : "Tabel verwijderen",
CellProperties : "Eigenschappen cel",
TableProperties : "Eigenschappen tabel",
ImageProperties : "Eigenschappen afbeelding",
FlashProperties : "Eigenschappen Flash",
 
AnchorProp : "Eigenschappen interne link",
ButtonProp : "Eigenschappen knop",
CheckboxProp : "Eigenschappen aanvinkvakje",
HiddenFieldProp : "Eigenschappen verborgen veld",
RadioButtonProp : "Eigenschappen selectievakje",
ImageButtonProp : "Eigenschappen afbeeldingsknop",
TextFieldProp : "Eigenschappen tekstveld",
SelectionFieldProp : "Eigenschappen selectieveld",
TextareaProp : "Eigenschappen tekstvak",
FormProp : "Eigenschappen formulier",
 
FontFormats : "Normaal;Met opmaak;Adres;Kop 1;Kop 2;Kop 3;Kop 4;Kop 5;Kop 6;Normaal (DIV)",
 
// Alerts and Messages
ProcessingXHTML : "Verwerken XHTML. Even geduld aub...",
Done : "Klaar",
PasteWordConfirm : "De tekst die je plakte lijkt gekopieerd uit te zijn Word. Wil je de tekst opschonen voordat deze geplakt wordt?",
NotCompatiblePaste : "Deze opdracht is beschikbaar voor Internet Explorer versie 5.5 of hoger. Wil je plakken zonder op te schonen?",
UnknownToolbarItem : "Onbekend item op menubalk \"%1\"",
UnknownCommand : "Onbekende opdrachtnaam: \"%1\"",
NotImplemented : "Opdracht niet geïmplementeerd.",
UnknownToolbarSet : "Menubalk \"%1\" bestaat niet.",
NoActiveX : "De beveilingsinstellingen van je browser zouden sommige functies van de editor kunnen beperken. De optie \"Activeer ActiveX-elementen en plug-ins\" dient ingeschakeld te worden. Het kan zijn dat er nu functies ontbreken of niet werken.",
BrowseServerBlocked : "De bestandsbrowser kon niet geopend worden. Zorg ervoor dat pop-up-blokkeerders uit staan.",
DialogBlocked : "Kan het dialoogvenster niet weergeven. Zorg ervoor dat pop-up-blokkeerders uit staan.",
 
// Dialogs
DlgBtnOK : "OK",
DlgBtnCancel : "Annuleren",
DlgBtnClose : "Afsluiten",
DlgBtnBrowseServer : "Bladeren op server",
DlgAdvancedTag : "Geavanceerd",
DlgOpOther : "<Anders>",
DlgInfoTab : "Informatie",
DlgAlertUrl : "Geef URL op",
 
// General Dialogs Labels
DlgGenNotSet : "<niet ingevuld>",
DlgGenId : "Kenmerk",
DlgGenLangDir : "Schrijfrichting",
DlgGenLangDirLtr : "Links naar rechts (LTR)",
DlgGenLangDirRtl : "Rechts naar links (RTL)",
DlgGenLangCode : "Codetaal",
DlgGenAccessKey : "Toegangstoets",
DlgGenName : "Naam",
DlgGenTabIndex : "Tabvolgorde",
DlgGenLongDescr : "Lange URL-omschrijving",
DlgGenClass : "Stylesheet-klassen",
DlgGenTitle : "Aanbevolen titel",
DlgGenContType : "Aanbevolen content-type",
DlgGenLinkCharset : "Karakterset van gelinkte bron",
DlgGenStyle : "Stijl",
 
// Image Dialog
DlgImgTitle : "Eigenschappen afbeelding",
DlgImgInfoTab : "Informatie afbeelding",
DlgImgBtnUpload : "Naar server verzenden",
DlgImgURL : "URL",
DlgImgUpload : "Upload",
DlgImgAlt : "Alternatieve tekst",
DlgImgWidth : "Breedte",
DlgImgHeight : "Hoogte",
DlgImgLockRatio : "Afmetingen vergrendelen",
DlgBtnResetSize : "Afmetingen resetten",
DlgImgBorder : "Rand",
DlgImgHSpace : "HSpace",
DlgImgVSpace : "VSpace",
DlgImgAlign : "Uitlijning",
DlgImgAlignLeft : "Links",
DlgImgAlignAbsBottom: "Absoluut-onder",
DlgImgAlignAbsMiddle: "Absoluut-midden",
DlgImgAlignBaseline : "Basislijn",
DlgImgAlignBottom : "Beneden",
DlgImgAlignMiddle : "Midden",
DlgImgAlignRight : "Rechts",
DlgImgAlignTextTop : "Boven tekst",
DlgImgAlignTop : "Boven",
DlgImgPreview : "Voorbeeld",
DlgImgAlertUrl : "Geef de URL van de afbeelding",
DlgImgLinkTab : "Link",
 
// Flash Dialog
DlgFlashTitle : "Eigenschappen Flash",
DlgFlashChkPlay : "Automatisch afspelen",
DlgFlashChkLoop : "Herhalen",
DlgFlashChkMenu : "Flashmenu\'s inschakelen",
DlgFlashScale : "Schaal",
DlgFlashScaleAll : "Alles tonen",
DlgFlashScaleNoBorder : "Geen rand",
DlgFlashScaleFit : "Precies passend",
 
// Link Dialog
DlgLnkWindowTitle : "Link",
DlgLnkInfoTab : "Linkomschrijving",
DlgLnkTargetTab : "Doel",
 
DlgLnkType : "Linktype",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Interne link in pagina",
DlgLnkTypeEMail : "E-mail",
DlgLnkProto : "Protocol",
DlgLnkProtoOther : "<anders>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Kies een interne link",
DlgLnkAnchorByName : "Op naam interne link",
DlgLnkAnchorById : "Op kenmerk interne link",
DlgLnkNoAnchors : "<Geen interne links in document gevonden.>",
DlgLnkEMail : "E-mailadres",
DlgLnkEMailSubject : "Onderwerp bericht",
DlgLnkEMailBody : "Inhoud bericht",
DlgLnkUpload : "Upload",
DlgLnkBtnUpload : "Naar de server versturen",
 
DlgLnkTarget : "Doel",
DlgLnkTargetFrame : "<frame>",
DlgLnkTargetPopup : "<popup window>",
DlgLnkTargetBlank : "Nieuw venster (_blank)",
DlgLnkTargetParent : "Origineel venster (_parent)",
DlgLnkTargetSelf : "Zelfde venster (_self)",
DlgLnkTargetTop : "Hele venster (_top)",
DlgLnkTargetFrameName : "Naam doelframe",
DlgLnkPopWinName : "Naam popupvenster",
DlgLnkPopWinFeat : "Instellingen popupvenster",
DlgLnkPopResize : "Grootte wijzigen",
DlgLnkPopLocation : "Locatiemenu",
DlgLnkPopMenu : "Menubalk",
DlgLnkPopScroll : "Schuifbalken",
DlgLnkPopStatus : "Statusbalk",
DlgLnkPopToolbar : "Menubalk",
DlgLnkPopFullScrn : "Volledig scherm (IE)",
DlgLnkPopDependent : "Afhankelijk (Netscape)",
DlgLnkPopWidth : "Breedte",
DlgLnkPopHeight : "Hoogte",
DlgLnkPopLeft : "Positie links",
DlgLnkPopTop : "Positie boven",
 
DlnLnkMsgNoUrl : "Geef de link van de URL",
DlnLnkMsgNoEMail : "Geef een e-mailadres",
DlnLnkMsgNoAnchor : "Selecteer een interne link",
DlnLnkMsgInvPopName : "De naam van de popup moet met een alfa-numerieke waarde beginnen, en mag geen spaties bevatten.",
 
// Color Dialog
DlgColorTitle : "Selecteer kleur",
DlgColorBtnClear : "Opschonen",
DlgColorHighlight : "Accentueren",
DlgColorSelected : "Geselecteerd",
 
// Smiley Dialog
DlgSmileyTitle : "Smiley invoegen",
 
// Special Character Dialog
DlgSpecialCharTitle : "Selecteer speciaal teken",
 
// Table Dialog
DlgTableTitle : "Eigenschappen tabel",
DlgTableRows : "Rijen",
DlgTableColumns : "Kolommen",
DlgTableBorder : "Breedte rand",
DlgTableAlign : "Uitlijning",
DlgTableAlignNotSet : "<Niet ingevoerd>",
DlgTableAlignLeft : "Links",
DlgTableAlignCenter : "Centreren",
DlgTableAlignRight : "Rechts",
DlgTableWidth : "Breedte",
DlgTableWidthPx : "pixels",
DlgTableWidthPc : "procent",
DlgTableHeight : "Hoogte",
DlgTableCellSpace : "Afstand tussen cellen",
DlgTableCellPad : "Afstand vanaf rand cel",
DlgTableCaption : "Naam",
DlgTableSummary : "Samenvatting",
 
// Table Cell Dialog
DlgCellTitle : "Eigenschappen cel",
DlgCellWidth : "Breedte",
DlgCellWidthPx : "pixels",
DlgCellWidthPc : "procent",
DlgCellHeight : "Hoogte",
DlgCellWordWrap : "Afbreken woorden",
DlgCellWordWrapNotSet : "<Niet ingevoerd>",
DlgCellWordWrapYes : "Ja",
DlgCellWordWrapNo : "Nee",
DlgCellHorAlign : "Horizontale uitlijning",
DlgCellHorAlignNotSet : "<Niet ingevoerd>",
DlgCellHorAlignLeft : "Links",
DlgCellHorAlignCenter : "Centreren",
DlgCellHorAlignRight: "Rechts",
DlgCellVerAlign : "Verticale uitlijning",
DlgCellVerAlignNotSet : "<Niet ingevoerd>",
DlgCellVerAlignTop : "Boven",
DlgCellVerAlignMiddle : "Midden",
DlgCellVerAlignBottom : "Beneden",
DlgCellVerAlignBaseline : "Basislijn",
DlgCellRowSpan : "Overkoepeling rijen",
DlgCellCollSpan : "Overkoepeling kolommen",
DlgCellBackColor : "Achtergrondkleur",
DlgCellBorderColor : "Randkleur",
DlgCellBtnSelect : "Selecteren...",
 
// Find Dialog
DlgFindTitle : "Zoeken",
DlgFindFindBtn : "Zoeken",
DlgFindNotFoundMsg : "De opgegeven tekst is niet gevonden.",
 
// Replace Dialog
DlgReplaceTitle : "Vervangen",
DlgReplaceFindLbl : "Zoeken naar:",
DlgReplaceReplaceLbl : "Vervangen met:",
DlgReplaceCaseChk : "Hoofdlettergevoelig",
DlgReplaceReplaceBtn : "Vervangen",
DlgReplaceReplAllBtn : "Alles vervangen",
DlgReplaceWordChk : "Hele woord moet voorkomen",
 
// Paste Operations / Dialog
PasteErrorPaste : "De beveiligingsinstelling van de browser verhinderen het automatisch plakken. Gebruik de sneltoets Ctrl+V van het toetsenbord.",
PasteErrorCut : "De beveiligingsinstelling van de browser verhinderen het automatisch knippen. Gebruik de sneltoets Ctrl+X van het toetsenbord.",
PasteErrorCopy : "De beveiligingsinstelling van de browser verhinderen het automatisch kopiëren. Gebruik de sneltoets Ctrl+C van het toetsenbord.",
 
PasteAsText : "Plakken als platte tekst",
PasteFromWord : "Plakken als Word-gegevens",
 
DlgPasteMsg2 : "Plak de tekst in het volgende vak gebruik makend van je toetstenbord (<STRONG>Ctrl+V</STRONG>) en klik op <STRONG>OK</STRONG>.",
DlgPasteIgnoreFont : "Negeer \"Font Face\"-definities",
DlgPasteRemoveStyles : "Verwijder \"Style\"-definities",
DlgPasteCleanBox : "Vak opschonen",
 
// Color Picker
ColorAutomatic : "Automatisch",
ColorMoreColors : "Meer kleuren...",
 
// Document Properties
DocProps : "Eigenschappen document",
 
// Anchor Dialog
DlgAnchorTitle : "Eigenschappen interne link",
DlgAnchorName : "Naam interne link",
DlgAnchorErrorName : "Geef de naam van de interne link op",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Niet in het woordenboek",
DlgSpellChangeTo : "Wijzig in",
DlgSpellBtnIgnore : "Negeren",
DlgSpellBtnIgnoreAll : "Alles negeren",
DlgSpellBtnReplace : "Vervangen",
DlgSpellBtnReplaceAll : "Alles vervangen",
DlgSpellBtnUndo : "Ongedaan maken",
DlgSpellNoSuggestions : "-Geen suggesties-",
DlgSpellProgress : "Bezig met spellingscontrole...",
DlgSpellNoMispell : "Klaar met spellingscontrole: geen fouten gevonden",
DlgSpellNoChanges : "Klaar met spellingscontrole: geen woorden aangepast",
DlgSpellOneChange : "Klaar met spellingscontrole: één woord aangepast",
DlgSpellManyChanges : "Klaar met spellingscontrole: %1 woorden aangepast",
 
IeSpellDownload : "De spellingscontrole niet geïnstalleerd. Wil je deze nu downloaden?",
 
// Button Dialog
DlgButtonText : "Tekst (waarde)",
DlgButtonType : "Soort",
DlgButtonTypeBtn : "Knop",
DlgButtonTypeSbm : "Versturen",
DlgButtonTypeRst : "Leegmaken",
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Naam",
DlgCheckboxValue : "Waarde",
DlgCheckboxSelected : "Geselecteerd",
 
// Form Dialog
DlgFormName : "Naam",
DlgFormAction : "Actie",
DlgFormMethod : "Methode",
 
// Select Field Dialog
DlgSelectName : "Naam",
DlgSelectValue : "Waarde",
DlgSelectSize : "Grootte",
DlgSelectLines : "Regels",
DlgSelectChkMulti : "Gecombineerde selecties toestaan",
DlgSelectOpAvail : "Beschikbare opties",
DlgSelectOpText : "Tekst",
DlgSelectOpValue : "Waarde",
DlgSelectBtnAdd : "Toevoegen",
DlgSelectBtnModify : "Wijzigen",
DlgSelectBtnUp : "Omhoog",
DlgSelectBtnDown : "Omlaag",
DlgSelectBtnSetValue : "Als geselecteerde waarde instellen",
DlgSelectBtnDelete : "Verwijderen",
 
// Textarea Dialog
DlgTextareaName : "Naam",
DlgTextareaCols : "Kolommen",
DlgTextareaRows : "Rijen",
 
// Text Field Dialog
DlgTextName : "Naam",
DlgTextValue : "Waarde",
DlgTextCharWidth : "Breedte (tekens)",
DlgTextMaxChars : "Maximum aantal tekens",
DlgTextType : "Soort",
DlgTextTypeText : "Tekst",
DlgTextTypePass : "Wachtwoord",
 
// Hidden Field Dialog
DlgHiddenName : "Naam",
DlgHiddenValue : "Waarde",
 
// Bulleted List Dialog
BulletedListProp : "Eigenschappen opsommingslijst",
NumberedListProp : "Eigenschappen genummerde opsommingslijst",
DlgLstStart : "Start",
DlgLstType : "Soort",
DlgLstTypeCircle : "Cirkel",
DlgLstTypeDisc : "Schijf",
DlgLstTypeSquare : "Vierkant",
DlgLstTypeNumbers : "Nummers (1, 2, 3)",
DlgLstTypeLCase : "Kleine letters (a, b, c)",
DlgLstTypeUCase : "Hoofdletters (A, B, C)",
DlgLstTypeSRoman : "Klein Romeins (i, ii, iii)",
DlgLstTypeLRoman : "Groot Romeins (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "Algemeen",
DlgDocBackTab : "Achtergrond",
DlgDocColorsTab : "Kleuring en marges",
DlgDocMetaTab : "META-data",
 
DlgDocPageTitle : "Paginatitel",
DlgDocLangDir : "Schrijfrichting",
DlgDocLangDirLTR : "Links naar rechts",
DlgDocLangDirRTL : "Rechts naar links",
DlgDocLangCode : "Taalcode",
DlgDocCharSet : "Karakterset-encoding",
DlgDocCharSetCE : "Centraal Europees",
DlgDocCharSetCT : "Traditioneel Chinees (Big5)",
DlgDocCharSetCR : "Cyriliaans",
DlgDocCharSetGR : "Grieks",
DlgDocCharSetJP : "Japans",
DlgDocCharSetKR : "Koreaans",
DlgDocCharSetTR : "Turks",
DlgDocCharSetUN : "Unicode (UTF-8)",
DlgDocCharSetWE : "West europees",
DlgDocCharSetOther : "Andere karakterset-encoding",
 
DlgDocDocType : "Opschrift documentsoort",
DlgDocDocTypeOther : "Ander opschrift documentsoort",
DlgDocIncXHTML : "XHTML-declaraties meenemen",
DlgDocBgColor : "Achtergrondkleur",
DlgDocBgImage : "URL achtergrondplaatje",
DlgDocBgNoScroll : "Vaste achtergrond",
DlgDocCText : "Tekst",
DlgDocCLink : "Link",
DlgDocCVisited : "Bezochte link",
DlgDocCActive : "Active link",
DlgDocMargins : "Afstandsinstellingen document",
DlgDocMaTop : "Boven",
DlgDocMaLeft : "Links",
DlgDocMaRight : "Rechts",
DlgDocMaBottom : "Onder",
DlgDocMeIndex : "Trefwoorden betreffende document (kommagescheiden)",
DlgDocMeDescr : "Beschrijving document",
DlgDocMeAuthor : "Auteur",
DlgDocMeCopy : "Copyright",
DlgDocPreview : "Voorbeeld",
 
// Templates Dialog
Templates : "Sjablonen",
DlgTemplatesTitle : "Inhoud sjabonen",
DlgTemplatesSelMsg : "Selecteer het sjabloon dat in de editor geopend moet worden (de actuele inhoud gaat verloren):",
DlgTemplatesLoading : "Bezig met laden sjabonen. Even geduld alstublieft...",
DlgTemplatesNoTpl : "(Geen sjablonen gedefinieerd)",
DlgTemplatesReplace : "Vervang de huidige inhoud",
 
// About Dialog
DlgAboutAboutTab : "Over",
DlgAboutBrowserInfoTab : "Browserinformatie",
DlgAboutLicenseTab : "Licentie",
DlgAboutVersion : "Versie",
DlgAboutLicense : "Gelicenceerd onder de condities van het GNU Lesser General Public License",
DlgAboutInfo : "Voor meer informatie ga naar "
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/lang/hr.js
New file
0,0 → 1,501
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: hr.js
* Croatian language file.
*
* File Authors:
* Alex Varga (avarga@globaldizajn.hr)
*/
 
var FCKLang =
{
// Language direction : "ltr" (left to right) or "rtl" (right to left).
Dir : "ltr",
 
ToolbarCollapse : "Smanji trake s alatima",
ToolbarExpand : "Proširi trake s alatima",
 
// Toolbar Items and Context Menu
Save : "Snimi",
NewPage : "Nova stranica",
Preview : "Pregledaj",
Cut : "Izreži",
Copy : "Kopiraj",
Paste : "Zalijepi",
PasteText : "Zalijepi kao čisti tekst",
PasteWord : "Zalijepi iz Worda",
Print : "Ispiši",
SelectAll : "Odaberi sve",
RemoveFormat : "Ukloni formatiranje",
InsertLinkLbl : "Link",
InsertLink : "Ubaci/promijeni link",
RemoveLink : "Ukloni link",
Anchor : "Ubaci/promijeni sidro",
InsertImageLbl : "Slika",
InsertImage : "Ubaci/promijeni sliku",
InsertFlashLbl : "Flash",
InsertFlash : "Ubaci/promijeni Flash",
InsertTableLbl : "Tablica",
InsertTable : "Ubaci/promijeni tablicu",
InsertLineLbl : "Linija",
InsertLine : "Ubaci vodoravnu liniju",
InsertSpecialCharLbl: "Posebni karakteri",
InsertSpecialChar : "Ubaci posebne znakove",
InsertSmileyLbl : "Smješko",
InsertSmiley : "Ubaci smješka",
About : "O FCKeditoru",
Bold : "Podebljaj",
Italic : "Ukosi",
Underline : "Potcrtano",
StrikeThrough : "Precrtano",
Subscript : "Subscript",
Superscript : "Superscript",
LeftJustify : "Lijevo poravnanje",
CenterJustify : "Središnje poravnanje",
RightJustify : "Desno poravnanje",
BlockJustify : "Blok poravnanje",
DecreaseIndent : "Pomakni ulijevo",
IncreaseIndent : "Pomakni udesno",
Undo : "Poništi",
Redo : "Ponovi",
NumberedListLbl : "Brojčana lista",
NumberedList : "Ubaci/ukloni brojčanu listu",
BulletedListLbl : "Obična lista",
BulletedList : "Ubaci/ukloni običnu listu",
ShowTableBorders : "Prikaži okvir tablice",
ShowDetails : "Prikaži detalje",
Style : "Stil",
FontFormat : "Format",
Font : "Font",
FontSize : "Veličina",
TextColor : "Boja teksta",
BGColor : "Boja pozadine",
Source : "Kôd",
Find : "Pronađi",
Replace : "Zamijeni",
SpellCheck : "Provjeri pravopis",
UniversalKeyboard : "Univerzalna tipkovnica",
PageBreakLbl : "Prijelom stranice",
PageBreak : "Ubaci prijelom stranice",
 
Form : "Form",
Checkbox : "Checkbox",
RadioButton : "Radio Button",
TextField : "Text Field",
Textarea : "Textarea",
HiddenField : "Hidden Field",
Button : "Button",
SelectionField : "Selection Field",
ImageButton : "Image Button",
 
FitWindow : "Povećaj veličinu editora",
 
// Context Menu
EditLink : "Promijeni link",
CellCM : "Ćelija",
RowCM : "Red",
ColumnCM : "Kolona",
InsertRow : "Ubaci red",
DeleteRows : "Izbriši redove",
InsertColumn : "Ubaci kolonu",
DeleteColumns : "Izbriši kolone",
InsertCell : "Ubaci ćelije",
DeleteCells : "Izbriši ćelije",
MergeCells : "Spoji ćelije",
SplitCell : "Razdvoji ćelije",
TableDelete : "Izbriši tablicu",
CellProperties : "Svojstva ćelije",
TableProperties : "Svojstva tablice",
ImageProperties : "Svojstva slike",
FlashProperties : "Flash svojstva",
 
AnchorProp : "Svojstva sidra",
ButtonProp : "Image Button svojstva",
CheckboxProp : "Checkbox svojstva",
HiddenFieldProp : "Hidden Field svojstva",
RadioButtonProp : "Radio Button svojstva",
ImageButtonProp : "Image Button svojstva",
TextFieldProp : "Text Field svojstva",
SelectionFieldProp : "Selection svojstva",
TextareaProp : "Textarea svojstva",
FormProp : "Form svojstva",
 
FontFormats : "Normal;Formatted;Address;Heading 1;Heading 2;Heading 3;Heading 4;Heading 5;Heading 6;Normal (DIV)",
 
// Alerts and Messages
ProcessingXHTML : "Obrađujem XHTML. Molimo pričekajte...",
Done : "Završio",
PasteWordConfirm : "Tekst koji želite zalijepiti čini se da je kopiran iz Worda. Želite li prije očistiti tekst?",
NotCompatiblePaste : "Ova naredba je dostupna samo u Internet Exploreru 5.5 ili novijem. Želite li nastaviti bez čišćenja?",
UnknownToolbarItem : "Nepoznati član trake s alatima \"%1\"",
UnknownCommand : "Nepoznata naredba \"%1\"",
NotImplemented : "Naredba nije implementirana",
UnknownToolbarSet : "Traka s alatima \"%1\" ne postoji",
NoActiveX : "Vaše postavke pretraživača mogle bi ograničiti neke od mogućnosti editora. Morate uključiti opciju \"Run ActiveX controls and plug-ins\" u postavkama. Ukoliko to ne učinite, moguće su razliite greške tijekom rada.",
BrowseServerBlocked : "Pretraivač nije moguće otvoriti. Provjerite da li je uključeno blokiranje pop-up prozora.",
DialogBlocked : "Nije moguće otvoriti novi prozor. Provjerite da li je uključeno blokiranje pop-up prozora.",
 
// Dialogs
DlgBtnOK : "OK",
DlgBtnCancel : "Poništi",
DlgBtnClose : "Zatvori",
DlgBtnBrowseServer : "Pretraži server",
DlgAdvancedTag : "Napredno",
DlgOpOther : "<Drugo>",
DlgInfoTab : "Info",
DlgAlertUrl : "Molimo unesite URL",
 
// General Dialogs Labels
DlgGenNotSet : "<nije postavljeno>",
DlgGenId : "Id",
DlgGenLangDir : "Smjer jezika",
DlgGenLangDirLtr : "S lijeva na desno (LTR)",
DlgGenLangDirRtl : "S desna na lijevo (RTL)",
DlgGenLangCode : "Kôd jezika",
DlgGenAccessKey : "Pristupna tipka",
DlgGenName : "Naziv",
DlgGenTabIndex : "Tab Indeks",
DlgGenLongDescr : "Dugački opis URL",
DlgGenClass : "Stylesheet klase",
DlgGenTitle : "Advisory naslov",
DlgGenContType : "Advisory vrsta sadržaja",
DlgGenLinkCharset : "Kodna stranica povezanih resursa",
DlgGenStyle : "Stil",
 
// Image Dialog
DlgImgTitle : "Svojstva slika",
DlgImgInfoTab : "Info slike",
DlgImgBtnUpload : "Pošalji na server",
DlgImgURL : "URL",
DlgImgUpload : "Pošalji",
DlgImgAlt : "Alternativni tekst",
DlgImgWidth : "Širina",
DlgImgHeight : "Visina",
DlgImgLockRatio : "Zaključaj odnos",
DlgBtnResetSize : "Obriši veličinu",
DlgImgBorder : "Okvir",
DlgImgHSpace : "HSpace",
DlgImgVSpace : "VSpace",
DlgImgAlign : "Poravnaj",
DlgImgAlignLeft : "Lijevo",
DlgImgAlignAbsBottom: "Abs dolje",
DlgImgAlignAbsMiddle: "Abs sredina",
DlgImgAlignBaseline : "Bazno",
DlgImgAlignBottom : "Dolje",
DlgImgAlignMiddle : "Sredina",
DlgImgAlignRight : "Desno",
DlgImgAlignTextTop : "Vrh teksta",
DlgImgAlignTop : "Vrh",
DlgImgPreview : "Pregledaj",
DlgImgAlertUrl : "Unesite URL slike",
DlgImgLinkTab : "Link",
 
// Flash Dialog
DlgFlashTitle : "Flash svojstva",
DlgFlashChkPlay : "Auto Play",
DlgFlashChkLoop : "Ponavljaj",
DlgFlashChkMenu : "Omogući Flash izbornik",
DlgFlashScale : "Omjer",
DlgFlashScaleAll : "Prikaži sve",
DlgFlashScaleNoBorder : "Bez okvira",
DlgFlashScaleFit : "Točna veličina",
 
// Link Dialog
DlgLnkWindowTitle : "Link",
DlgLnkInfoTab : "Link Info",
DlgLnkTargetTab : "Meta",
 
DlgLnkType : "Link vrsta",
DlgLnkTypeURL : "URL",
DlgLnkTypeAnchor : "Sidro na ovoj stranici",
DlgLnkTypeEMail : "E-Mail",
DlgLnkProto : "Protokol",
DlgLnkProtoOther : "<drugo>",
DlgLnkURL : "URL",
DlgLnkAnchorSel : "Odaberi sidro",
DlgLnkAnchorByName : "Po nazivu sidra",
DlgLnkAnchorById : "Po Id elementa",
DlgLnkNoAnchors : "<Nema dostupnih sidra>",
DlgLnkEMail : "E-Mail adresa",
DlgLnkEMailSubject : "Naslov",
DlgLnkEMailBody : "Sadržaj poruke",
DlgLnkUpload : "Pošalji",
DlgLnkBtnUpload : "Pošalji na server",
 
DlgLnkTarget : "Meta",
DlgLnkTargetFrame : "<okvir>",
DlgLnkTargetPopup : "<popup prozor>",
DlgLnkTargetBlank : "Novi prozor (_blank)",
DlgLnkTargetParent : "Roditeljski prozor (_parent)",
DlgLnkTargetSelf : "Isti prozor (_self)",
DlgLnkTargetTop : "Vršni prozor (_top)",
DlgLnkTargetFrameName : "Ime ciljnog okvira",
DlgLnkPopWinName : "Naziv popup prozora",
DlgLnkPopWinFeat : "Mogućnosti popup prozora",
DlgLnkPopResize : "Promjenljive veličine",
DlgLnkPopLocation : "Traka za lokaciju",
DlgLnkPopMenu : "Izborna traka",
DlgLnkPopScroll : "Scroll traka",
DlgLnkPopStatus : "Statusna traka",
DlgLnkPopToolbar : "Traka s alatima",
DlgLnkPopFullScrn : "Cijeli ekran (IE)",
DlgLnkPopDependent : "Ovisno (Netscape)",
DlgLnkPopWidth : "Širina",
DlgLnkPopHeight : "Visina",
DlgLnkPopLeft : "Lijeva pozicija",
DlgLnkPopTop : "Gornja pozicija",
 
DlnLnkMsgNoUrl : "Molimo upišite URL link",
DlnLnkMsgNoEMail : "Molimo upišite e-mail adresu",
DlnLnkMsgNoAnchor : "Molimo odaberite sidro",
DlnLnkMsgInvPopName : "Ime popup prozora mora početi sa slovom i ne smije sadržavati razmake",
 
// Color Dialog
DlgColorTitle : "Odaberite boju",
DlgColorBtnClear : "Obriši",
DlgColorHighlight : "Osvijetli",
DlgColorSelected : "Odaberi",
 
// Smiley Dialog
DlgSmileyTitle : "Ubaci smješka",
 
// Special Character Dialog
DlgSpecialCharTitle : "Odaberite posebni karakter",
 
// Table Dialog
DlgTableTitle : "Svojstva tablice",
DlgTableRows : "Redova",
DlgTableColumns : "Kolona",
DlgTableBorder : "Veličina okvira",
DlgTableAlign : "Poravnanje",
DlgTableAlignNotSet : "<nije postavljeno>",
DlgTableAlignLeft : "Lijevo",
DlgTableAlignCenter : "Središnje",
DlgTableAlignRight : "Desno",
DlgTableWidth : "Širina",
DlgTableWidthPx : "piksela",
DlgTableWidthPc : "postotaka",
DlgTableHeight : "Visina",
DlgTableCellSpace : "Prostornost ćelija",
DlgTableCellPad : "Razmak ćelija",
DlgTableCaption : "Naslov",
DlgTableSummary : "Sažetak",
 
// Table Cell Dialog
DlgCellTitle : "Svojstva ćelije",
DlgCellWidth : "Širina",
DlgCellWidthPx : "piksela",
DlgCellWidthPc : "postotaka",
DlgCellHeight : "Visina",
DlgCellWordWrap : "Word Wrap",
DlgCellWordWrapNotSet : "<nije postavljeno>",
DlgCellWordWrapYes : "Da",
DlgCellWordWrapNo : "Ne",
DlgCellHorAlign : "Vodoravno poravnanje",
DlgCellHorAlignNotSet : "<nije postavljeno>",
DlgCellHorAlignLeft : "Lijevo",
DlgCellHorAlignCenter : "Središnje",
DlgCellHorAlignRight: "Desno",
DlgCellVerAlign : "Okomito poravnanje",
DlgCellVerAlignNotSet : "<nije postavljeno>",
DlgCellVerAlignTop : "Gornje",
DlgCellVerAlignMiddle : "Srednišnje",
DlgCellVerAlignBottom : "Donje",
DlgCellVerAlignBaseline : "Bazno",
DlgCellRowSpan : "Spajanje redova",
DlgCellCollSpan : "Spajanje kolona",
DlgCellBackColor : "Boja pozadine",
DlgCellBorderColor : "Boja okvira",
DlgCellBtnSelect : "Odaberi...",
 
// Find Dialog
DlgFindTitle : "Pronađi",
DlgFindFindBtn : "Pronađi",
DlgFindNotFoundMsg : "Traženi tekst nije pronađen.",
 
// Replace Dialog
DlgReplaceTitle : "Zamijeni",
DlgReplaceFindLbl : "Pronađi:",
DlgReplaceReplaceLbl : "Zamijeni s:",
DlgReplaceCaseChk : "Usporedi mala/velika slova",
DlgReplaceReplaceBtn : "Zamijeni",
DlgReplaceReplAllBtn : "Zamijeni sve",
DlgReplaceWordChk : "Usporedi cijele riječi",
 
// Paste Operations / Dialog
PasteErrorPaste : "Sigurnosne postavke Vašeg pretraživača ne dozvoljavaju operacije automatskog ljepljenja. Molimo koristite kraticu na tipkovnici (Ctrl+V).",
PasteErrorCut : "Sigurnosne postavke Vašeg pretraživača ne dozvoljavaju operacije automatskog izrezivanja. Molimo koristite kraticu na tipkovnici (Ctrl+X).",
PasteErrorCopy : "Sigurnosne postavke Vašeg pretraživača ne dozvoljavaju operacije automatskog kopiranja. Molimo koristite kraticu na tipkovnici (Ctrl+C).",
 
PasteAsText : "Zalijepi kao čisti tekst",
PasteFromWord : "Zalijepi iz Worda",
 
DlgPasteMsg2 : "Molimo zaljepite unutar doljnjeg okvira koristeći tipkovnicu (<STRONG>Ctrl+V</STRONG>) i kliknite <STRONG>OK</STRONG>.",
DlgPasteIgnoreFont : "Zanemari definiciju vrste fonta",
DlgPasteRemoveStyles : "Ukloni definicije stilova",
DlgPasteCleanBox : "Očisti okvir",
 
// Color Picker
ColorAutomatic : "Automatski",
ColorMoreColors : "Više boja...",
 
// Document Properties
DocProps : "Svojstva dokumenta",
 
// Anchor Dialog
DlgAnchorTitle : "Svojstva sidra",
DlgAnchorName : "Ime sidra",
DlgAnchorErrorName : "Molimo unesite ime sidra",
 
// Speller Pages Dialog
DlgSpellNotInDic : "Nije u rječniku",
DlgSpellChangeTo : "Promijeni u",
DlgSpellBtnIgnore : "Zanemari",
DlgSpellBtnIgnoreAll : "Zanemari sve",
DlgSpellBtnReplace : "Zamijeni",
DlgSpellBtnReplaceAll : "Zamijeni sve",
DlgSpellBtnUndo : "Vrati",
DlgSpellNoSuggestions : "-Nema preporuke-",
DlgSpellProgress : "Provjera u tijeku...",
DlgSpellNoMispell : "Provjera završena: Nema grešaka",
DlgSpellNoChanges : "Provjera završena: Nije napravljena promjena",
DlgSpellOneChange : "Provjera završena: Jedna riječ promjenjena",
DlgSpellManyChanges : "Provjera završena: Promijenjeno %1 riječi",
 
IeSpellDownload : "Provjera pravopisa nije instalirana. Želite li skinuti provjeru pravopisa?",
 
// Button Dialog
DlgButtonText : "Tekst (vrijednost)",
DlgButtonType : "Vrsta",
DlgButtonTypeBtn : "Gumb",
DlgButtonTypeSbm : "Pošalji",
DlgButtonTypeRst : "Poništi",
 
// Checkbox and Radio Button Dialogs
DlgCheckboxName : "Ime",
DlgCheckboxValue : "Vrijednost",
DlgCheckboxSelected : "Odabrano",
 
// Form Dialog
DlgFormName : "Ime",
DlgFormAction : "Akcija",
DlgFormMethod : "Metoda",
 
// Select Field Dialog
DlgSelectName : "Ime",
DlgSelectValue : "Vrijednost",
DlgSelectSize : "Veličina",
DlgSelectLines : "linija",
DlgSelectChkMulti : "Dozvoli višestruki odabir",
DlgSelectOpAvail : "Dostupne opcije",
DlgSelectOpText : "Tekst",
DlgSelectOpValue : "Vrijednost",
DlgSelectBtnAdd : "Dodaj",
DlgSelectBtnModify : "Promijeni",
DlgSelectBtnUp : "Gore",
DlgSelectBtnDown : "Dolje",
DlgSelectBtnSetValue : "Postavi kao odabranu vrijednost",
DlgSelectBtnDelete : "Obriši",
 
// Textarea Dialog
DlgTextareaName : "Ime",
DlgTextareaCols : "Kolona",
DlgTextareaRows : "Redova",
 
// Text Field Dialog
DlgTextName : "Ime",
DlgTextValue : "Vrijednost",
DlgTextCharWidth : "Širina",
DlgTextMaxChars : "Najviše karaktera",
DlgTextType : "Vrsta",
DlgTextTypeText : "Tekst",
DlgTextTypePass : "Šifra",
 
// Hidden Field Dialog
DlgHiddenName : "Ime",
DlgHiddenValue : "Vrijednost",
 
// Bulleted List Dialog
BulletedListProp : "Svojstva liste",
NumberedListProp : "Svojstva brojčane liste",
DlgLstStart : "Početak",
DlgLstType : "Vrsta",
DlgLstTypeCircle : "Krug",
DlgLstTypeDisc : "Disk",
DlgLstTypeSquare : "Kvadrat",
DlgLstTypeNumbers : "Brojevi (1, 2, 3)",
DlgLstTypeLCase : "Mala slova (a, b, c)",
DlgLstTypeUCase : "Velika slova (A, B, C)",
DlgLstTypeSRoman : "Male rimske brojke (i, ii, iii)",
DlgLstTypeLRoman : "Velike rimske brojke (I, II, III)",
 
// Document Properties Dialog
DlgDocGeneralTab : "Općenito",
DlgDocBackTab : "Pozadina",
DlgDocColorsTab : "Boje i margine",
DlgDocMetaTab : "Meta Data",
 
DlgDocPageTitle : "Naslov stranice",
DlgDocLangDir : "Smjer jezika",
DlgDocLangDirLTR : "S lijeva na desno",
DlgDocLangDirRTL : "S desna na lijevo",
DlgDocLangCode : "Kôd jezika",
DlgDocCharSet : "Enkodiranje znakova",
DlgDocCharSetCE : "Središnja Europa",
DlgDocCharSetCT : "Tradicionalna kineska (Big5)",
DlgDocCharSetCR : "Ćirilica",
DlgDocCharSetGR : "Grčka",
DlgDocCharSetJP : "Japanska",
DlgDocCharSetKR : "Koreanska",
DlgDocCharSetTR : "Turska",
DlgDocCharSetUN : "Unicode (UTF-8)",
DlgDocCharSetWE : "Zapadna Europa",
DlgDocCharSetOther : "Ostalo enkodiranje znakova",
 
DlgDocDocType : "Zaglavlje vrste dokumenta",
DlgDocDocTypeOther : "Ostalo zaglavlje vrste dokumenta",
DlgDocIncXHTML : "Ubaci XHTML deklaracije",
DlgDocBgColor : "Boja pozadine",
DlgDocBgImage : "URL slike pozadine",
DlgDocBgNoScroll : "Pozadine se ne pomiče",
DlgDocCText : "Tekst",
DlgDocCLink : "Link",
DlgDocCVisited : "Posjećeni link",
DlgDocCActive : "Aktivni link",
DlgDocMargins : "Margine stranice",
DlgDocMaTop : "Vrh",
DlgDocMaLeft : "Lijevo",
DlgDocMaRight : "Desno",
DlgDocMaBottom : "Dolje",
DlgDocMeIndex : "Ključne riječi dokumenta (odvojene zarezom)",
DlgDocMeDescr : "Opis dokumenta",
DlgDocMeAuthor : "Autor",
DlgDocMeCopy : "Autorska prava",
DlgDocPreview : "Pregledaj",
 
// Templates Dialog
Templates : "Predlošci",
DlgTemplatesTitle : "Predlošci sadržaja",
DlgTemplatesSelMsg : "Molimo odaberite predložak koji želite otvoriti<br>(stvarni sadržaj će biti izgubljen):",
DlgTemplatesLoading : "Učitavam listu predložaka. Molimo pričekajte...",
DlgTemplatesNoTpl : "(Nema definiranih predložaka)",
DlgTemplatesReplace : "Zamijeni trenutne sadržaje",
 
// About Dialog
DlgAboutAboutTab : "O FCKEditoru",
DlgAboutBrowserInfoTab : "Podaci o pretraživaču",
DlgAboutLicenseTab : "Licenca",
DlgAboutVersion : "inačica",
DlgAboutLicense : "Licencirano pod uvjetima GNU Lesser General Public License",
DlgAboutInfo : "Za više informacija posjetite"
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/plugins/tablecommands/fckplugin.js
New file
0,0 → 1,28
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckplugin.js
* This plugin register the required Toolbar items to be able to insert the
* toolbar commands in the toolbar.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
FCKToolbarItems.RegisterItem( 'TableInsertRow' , new FCKToolbarButton( 'TableInsertRow' , FCKLang.InsertRow, null, null, null, null, 62 ) ) ;
FCKToolbarItems.RegisterItem( 'TableDeleteRows' , new FCKToolbarButton( 'TableDeleteRows' , FCKLang.DeleteRows, null, null, null, null, 63 ) ) ;
FCKToolbarItems.RegisterItem( 'TableInsertColumn' , new FCKToolbarButton( 'TableInsertColumn' , FCKLang.InsertColumn, null, null, null, null, 64 ) ) ;
FCKToolbarItems.RegisterItem( 'TableDeleteColumns' , new FCKToolbarButton( 'TableDeleteColumns', FCKLang.DeleteColumns, null, null, null, null, 65 ) ) ;
FCKToolbarItems.RegisterItem( 'TableInsertCell' , new FCKToolbarButton( 'TableInsertCell' , FCKLang.InsertCell, null, null, null, null, 58 ) ) ;
FCKToolbarItems.RegisterItem( 'TableDeleteCells' , new FCKToolbarButton( 'TableDeleteCells' , FCKLang.DeleteCells, null, null, null, null, 59 ) ) ;
FCKToolbarItems.RegisterItem( 'TableMergeCells' , new FCKToolbarButton( 'TableMergeCells' , FCKLang.MergeCells, null, null, null, null, 60 ) ) ;
FCKToolbarItems.RegisterItem( 'TableSplitCell' , new FCKToolbarButton( 'TableSplitCell' , FCKLang.SplitCell, null, null, null, null, 61 ) ) ;
/tags/Racine_livraison_narmer/api/fckeditor/editor/plugins/simplecommands/fckplugin.js
New file
0,0 → 1,25
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckplugin.js
* This plugin register Toolbar items for the combos modifying the style to
* not show the box.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
FCKToolbarItems.RegisterItem( 'SourceSimple' , new FCKToolbarButton( 'Source', FCKLang.Source, null, FCK_TOOLBARITEM_ONLYICON, true, true, 1 ) ) ;
FCKToolbarItems.RegisterItem( 'StyleSimple' , new FCKToolbarStyleCombo( null, FCK_TOOLBARITEM_ONLYTEXT ) ) ;
FCKToolbarItems.RegisterItem( 'FontNameSimple' , new FCKToolbarFontsCombo( null, FCK_TOOLBARITEM_ONLYTEXT ) ) ;
FCKToolbarItems.RegisterItem( 'FontSizeSimple' , new FCKToolbarFontSizeCombo( null, FCK_TOOLBARITEM_ONLYTEXT ) ) ;
FCKToolbarItems.RegisterItem( 'FontFormatSimple', new FCKToolbarFontFormatCombo( null, FCK_TOOLBARITEM_ONLYTEXT ) ) ;
/tags/Racine_livraison_narmer/api/fckeditor/editor/plugins/placeholder/fck_placeholder.html
New file
0,0 → 1,96
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_placeholder.html
* Placeholder Plugin.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<html>
<head>
<title>Placeholder Properties</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta content="noindex, nofollow" name="robots">
<script language="javascript">
 
var oEditor = window.parent.InnerDialogLoaded() ;
var FCKLang = oEditor.FCKLang ;
var FCKPlaceholders = oEditor.FCKPlaceholders ;
 
window.onload = function ()
{
// First of all, translate the dialog box texts
oEditor.FCKLanguageManager.TranslatePage( document ) ;
LoadSelected() ;
// Show the "Ok" button.
window.parent.SetOkButton( true ) ;
}
 
var eSelected = oEditor.FCKSelection.GetSelectedElement() ;
 
function LoadSelected()
{
if ( !eSelected )
return ;
 
if ( eSelected.tagName == 'SPAN' && eSelected._fckplaceholder )
document.getElementById('txtName').value = eSelected._fckplaceholder ;
else
eSelected == null ;
}
 
function Ok()
{
var sValue = document.getElementById('txtName').value ;
if ( eSelected && eSelected._fckplaceholder == sValue )
return true ;
 
if ( sValue.length == 0 )
{
alert( FCKLang.PlaceholderErrNoName ) ;
return false ;
}
if ( FCKPlaceholders.Exist( sValue ) )
{
alert( FCKLang.PlaceholderErrNameInUse ) ;
return false ;
}
 
FCKPlaceholders.Add( sValue ) ;
return true ;
}
 
</script>
</head>
<body scroll="no" style="OVERFLOW: hidden">
<table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr>
<td>
<table cellSpacing="0" cellPadding="0" align="center" border="0">
<tr>
<td>
<span fckLang="PlaceholderDlgName">Placeholder Name</span><br>
<input id="txtName" type="text">
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
/tags/Racine_livraison_narmer/api/fckeditor/editor/plugins/placeholder/fckplugin.js
New file
0,0 → 1,175
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckplugin.js
* Plugin to insert "Placeholders" in the editor.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
// Register the related command.
FCKCommands.RegisterCommand( 'Placeholder', new FCKDialogCommand( 'Placeholder', FCKLang.PlaceholderDlgTitle, FCKPlugins.Items['placeholder'].Path + 'fck_placeholder.html', 340, 170 ) ) ;
 
// Create the "Plaholder" toolbar button.
var oPlaceholderItem = new FCKToolbarButton( 'Placeholder', FCKLang.PlaceholderBtn ) ;
oPlaceholderItem.IconPath = FCKPlugins.Items['placeholder'].Path + 'placeholder.gif' ;
 
FCKToolbarItems.RegisterItem( 'Placeholder', oPlaceholderItem ) ;
 
 
// The object used for all Placeholder operations.
var FCKPlaceholders = new Object() ;
 
// Add a new placeholder at the actual selection.
FCKPlaceholders.Add = function( name )
{
var oSpan = FCK.CreateElement( 'SPAN' ) ;
this.SetupSpan( oSpan, name ) ;
}
 
FCKPlaceholders.SetupSpan = function( span, name )
{
span.innerHTML = '[[ ' + name + ' ]]' ;
 
span.style.backgroundColor = '#ffff00' ;
span.style.color = '#000000' ;
 
if ( FCKBrowserInfo.IsGecko )
span.style.cursor = 'default' ;
 
span._fckplaceholder = name ;
span.contentEditable = false ;
 
// To avoid it to be resized.
span.onresizestart = function()
{
FCK.EditorWindow.event.returnValue = false ;
return false ;
}
}
 
// On Gecko we must do this trick so the user select all the SPAN when clicking on it.
FCKPlaceholders._SetupClickListener = function()
{
FCKPlaceholders._ClickListener = function( e )
{
if ( e.target.tagName == 'SPAN' && e.target._fckplaceholder )
FCKSelection.SelectNode( e.target ) ;
}
 
FCK.EditorDocument.addEventListener( 'click', FCKPlaceholders._ClickListener, true ) ;
}
 
// Open the Placeholder dialog on double click.
FCKPlaceholders.OnDoubleClick = function( span )
{
if ( span.tagName == 'SPAN' && span._fckplaceholder )
FCKCommands.GetCommand( 'Placeholder' ).Execute() ;
}
 
FCK.RegisterDoubleClickHandler( FCKPlaceholders.OnDoubleClick, 'SPAN' ) ;
 
// Check if a Placholder name is already in use.
FCKPlaceholders.Exist = function( name )
{
var aSpans = FCK.EditorDocument.getElementsByTagName( 'SPAN' )
 
for ( var i = 0 ; i < aSpans.length ; i++ )
{
if ( aSpans[i]._fckplaceholder == name )
return true ;
}
}
 
if ( FCKBrowserInfo.IsIE )
{
FCKPlaceholders.Redraw = function()
{
var aPlaholders = FCK.EditorDocument.body.innerText.match( /\[\[[^\[\]]+\]\]/g ) ;
if ( !aPlaholders )
return ;
 
var oRange = FCK.EditorDocument.body.createTextRange() ;
 
for ( var i = 0 ; i < aPlaholders.length ; i++ )
{
if ( oRange.findText( aPlaholders[i] ) )
{
var sName = aPlaholders[i].match( /\[\[\s*([^\]]*?)\s*\]\]/ )[1] ;
oRange.pasteHTML( '<span style="color: #000000; background-color: #ffff00" contenteditable="false" _fckplaceholder="' + sName + '">' + aPlaholders[i] + '</span>' ) ;
}
}
}
}
else
{
FCKPlaceholders.Redraw = function()
{
var oInteractor = FCK.EditorDocument.createTreeWalker( FCK.EditorDocument.body, NodeFilter.SHOW_TEXT, FCKPlaceholders._AcceptNode, true ) ;
 
var aNodes = new Array() ;
 
while ( oNode = oInteractor.nextNode() )
{
aNodes[ aNodes.length ] = oNode ;
}
 
for ( var n = 0 ; n < aNodes.length ; n++ )
{
var aPieces = aNodes[n].nodeValue.split( /(\[\[[^\[\]]+\]\])/g ) ;
 
for ( var i = 0 ; i < aPieces.length ; i++ )
{
if ( aPieces[i].length > 0 )
{
if ( aPieces[i].indexOf( '[[' ) == 0 )
{
var sName = aPieces[i].match( /\[\[\s*([^\]]*?)\s*\]\]/ )[1] ;
 
var oSpan = FCK.EditorDocument.createElement( 'span' ) ;
FCKPlaceholders.SetupSpan( oSpan, sName ) ;
 
aNodes[n].parentNode.insertBefore( oSpan, aNodes[n] ) ;
}
else
aNodes[n].parentNode.insertBefore( FCK.EditorDocument.createTextNode( aPieces[i] ) , aNodes[n] ) ;
}
}
 
aNodes[n].parentNode.removeChild( aNodes[n] ) ;
}
FCKPlaceholders._SetupClickListener() ;
}
 
FCKPlaceholders._AcceptNode = function( node )
{
if ( /\[\[[^\[\]]+\]\]/.test( node.nodeValue ) )
return NodeFilter.FILTER_ACCEPT ;
else
return NodeFilter.FILTER_SKIP ;
}
}
 
FCK.Events.AttachEvent( 'OnAfterSetHTML', FCKPlaceholders.Redraw ) ;
 
// We must process the SPAN tags to replace then with the real resulting value of the placeholder.
FCKXHtml.TagProcessors['span'] = function( node, htmlNode )
{
if ( htmlNode._fckplaceholder )
node = FCKXHtml.XML.createTextNode( '[[' + htmlNode._fckplaceholder + ']]' ) ;
else
FCKXHtml._AppendChildNodes( node, htmlNode, false ) ;
 
return node ;
}
/tags/Racine_livraison_narmer/api/fckeditor/editor/plugins/placeholder/lang/pl.js
New file
0,0 → 1,23
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: pl.js
* Placholder Polish language file.
*
* File Authors:
* Marcin Pietrzak (fck@iworks.pl)
*/
FCKLang.PlaceholderBtn = 'Wstaw/Edytuj nagłówek' ;
FCKLang.PlaceholderDlgTitle = 'Właśności nagłówka' ;
FCKLang.PlaceholderDlgName = 'Nazwa nagłówka' ;
FCKLang.PlaceholderErrNoName = 'Proszę wprowadzić nazwę nagłówka' ;
FCKLang.PlaceholderErrNameInUse = 'Podana nazwa jest już w użyciu' ;
/tags/Racine_livraison_narmer/api/fckeditor/editor/plugins/placeholder/lang/it.js
New file
0,0 → 1,23
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: it.js
* Placholder Italian language file.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
FCKLang.PlaceholderBtn = 'Aggiungi/Modifica Placeholder' ;
FCKLang.PlaceholderDlgTitle = 'Proprietà del Placeholder' ;
FCKLang.PlaceholderDlgName = 'Nome del Placeholder' ;
FCKLang.PlaceholderErrNoName = 'Digitare il nome del placeholder' ;
FCKLang.PlaceholderErrNameInUse = 'Il nome inserito è già in uso' ;
/tags/Racine_livraison_narmer/api/fckeditor/editor/plugins/placeholder/lang/en.js
New file
0,0 → 1,23
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: en.js
* Placholder English language file.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
FCKLang.PlaceholderBtn = 'Insert/Edit Placeholder' ;
FCKLang.PlaceholderDlgTitle = 'Placeholder Properties' ;
FCKLang.PlaceholderDlgName = 'Placeholder Name' ;
FCKLang.PlaceholderErrNoName = 'Please type the placeholder name' ;
FCKLang.PlaceholderErrNameInUse = 'The specified name is already in use' ;
/tags/Racine_livraison_narmer/api/fckeditor/editor/plugins/placeholder/lang/fr.js
New file
0,0 → 1,23
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fr.js
* Placholder Italian language file.
*
* File Authors:
* Hubert Garrido (liane@users.sourceforge.net)
*/
FCKLang.PlaceholderBtn = 'Insérer/Modifier Substitut' ;
FCKLang.PlaceholderDlgTitle = 'Propriétés de Substitut' ;
FCKLang.PlaceholderDlgName = 'Nom de Substitut' ;
FCKLang.PlaceholderErrNoName = 'Veuillez saisir le nom de Substitut' ;
FCKLang.PlaceholderErrNameInUse = 'Ce nom est déjà utilisé' ;
/tags/Racine_livraison_narmer/api/fckeditor/editor/plugins/placeholder/lang/de.js
New file
0,0 → 1,23
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: de.js
* Placholder German language file.
*
* File Authors:
* José Fontanil
*/
FCKLang.PlaceholderBtn = 'Einfügen/editieren Platzhalter' ;
FCKLang.PlaceholderDlgTitle = 'Platzhalter Eigenschaften' ;
FCKLang.PlaceholderDlgName = 'Platzhalter Name' ;
FCKLang.PlaceholderErrNoName = 'Bitte den Namen des Platzhalters schreiben' ;
FCKLang.PlaceholderErrNameInUse = 'Der angegebene Namen ist schon in Gebrauch' ;
/tags/Racine_livraison_narmer/api/fckeditor/editor/plugins/placeholder/placeholder.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/editor/plugins/placeholder/placeholder.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/editor/plugins/autogrow/fckplugin.js
New file
0,0 → 1,85
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckplugin.js
* Plugin: automatically resizes the editor until a configurable maximun
* height (FCKConfig.AutoGrowMax), based on its contents.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
var FCKAutoGrow_Min = window.frameElement.offsetHeight ;
 
function FCKAutoGrow_Check()
{
var oInnerDoc = FCK.EditorDocument ;
 
var iFrameHeight, iInnerHeight ;
if ( FCKBrowserInfo.IsIE )
{
iFrameHeight = FCK.EditorWindow.frameElement.offsetHeight ;
iInnerHeight = oInnerDoc.body.scrollHeight ;
}
else
{
iFrameHeight = FCK.EditorWindow.innerHeight ;
iInnerHeight = oInnerDoc.body.offsetHeight ;
}
 
var iDiff = iInnerHeight - iFrameHeight ;
 
if ( iDiff != 0 )
{
var iMainFrameSize = window.frameElement.offsetHeight ;
if ( iDiff > 0 && iMainFrameSize < FCKConfig.AutoGrowMax )
{
iMainFrameSize += iDiff ;
if ( iMainFrameSize > FCKConfig.AutoGrowMax )
iMainFrameSize = FCKConfig.AutoGrowMax ;
}
else if ( iDiff < 0 && iMainFrameSize > FCKAutoGrow_Min )
{
iMainFrameSize += iDiff ;
if ( iMainFrameSize < FCKAutoGrow_Min )
iMainFrameSize = FCKAutoGrow_Min ;
}
else
return ;
window.frameElement.height = iMainFrameSize ;
}
}
 
FCK.AttachToOnSelectionChange( FCKAutoGrow_Check ) ;
 
function FCKAutoGrow_SetListeners()
{
FCK.EditorWindow.attachEvent( 'onscroll', FCKAutoGrow_Check ) ;
FCK.EditorDocument.attachEvent( 'onkeyup', FCKAutoGrow_Check ) ;
}
 
if ( FCKBrowserInfo.IsIE )
{
// FCKAutoGrow_SetListeners() ;
FCK.Events.AttachEvent( 'OnAfterSetHTML', FCKAutoGrow_SetListeners ) ;
}
 
function FCKAutoGrow_CheckEditorStatus( sender, status )
{
if ( status == FCK_STATUS_COMPLETE )
FCKAutoGrow_Check() ;
}
 
FCK.Events.AttachEvent( 'OnStatusChange', FCKAutoGrow_CheckEditorStatus ) ;
/tags/Racine_livraison_narmer/api/fckeditor/fckstyles.xml
New file
0,0 → 1,48
<?xml version="1.0" encoding="utf-8" ?>
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckstyles.xml
* This is the sample style definitions file. It makes the styles combo
* completely customizable.
* See FCKConfig.StylesXmlPath in the configuration file.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<Styles>
<Style name="Image on Left" element="img">
<Attribute name="style" value="padding: 5px; margin-right: 5px" />
<Attribute name="border" value="2" />
<Attribute name="align" value="left" />
</Style>
<Style name="Image on Right" element="img">
<Attribute name="style" value="padding: 5px; margin-left: 5px" />
<Attribute name="border" value="2" />
<Attribute name="align" value="right" />
</Style>
<Style name="Custom Bold" element="span">
<Attribute name="style" value="font-weight: bold;" />
</Style>
<Style name="Custom Italic" element="em" />
<Style name="Title" element="span">
<Attribute name="class" value="Title" />
</Style>
<Style name="Code" element="span">
<Attribute name="class" value="Code" />
</Style>
<Style name="Title H3" element="h3" />
<Style name="Custom Ruler" element="hr">
<Attribute name="size" value="1" />
<Attribute name="color" value="#ff0000" />
</Style>
</Styles>
/tags/Racine_livraison_narmer/api/fckeditor/fckeditor.lasso
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/fckeditor.lasso
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/fckeditor.asp
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/fckeditor.asp
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/fckeditor.cfm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/fckeditor.cfm
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/fckeditor.afp
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/fckeditor.afp
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/fckeditor.php
New file
0,0 → 1,162
<?php
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckeditor.php
* This is the integration file for PHP.
*
* It defines the FCKeditor class that can be used to create editor
* instances in PHP pages on server side.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
class FCKeditor
{
var $InstanceName ;
var $BasePath ;
var $Width ;
var $Height ;
var $ToolbarSet ;
var $Value ;
var $Config ;
 
// PHP 5 Constructor (by Marcus Bointon <coolbru@users.sourceforge.net>)
function __construct( $instanceName )
{
$this->InstanceName = $instanceName ;
$this->BasePath = '/fckeditor/' ;
$this->Width = '100%' ;
$this->Height = '200' ;
$this->ToolbarSet = 'Default' ;
$this->Value = '' ;
 
$this->Config = array() ;
}
// PHP 4 Contructor
function FCKeditor( $instanceName )
{
$this->__construct( $instanceName ) ;
}
 
function Create()
{
echo $this->CreateHtml() ;
}
function CreateHtml()
{
$HtmlValue = htmlspecialchars( $this->Value ) ;
 
$Html = '<div>' ;
if ( $this->IsCompatible() )
{
if ( isset( $_GET['fcksource'] ) && $_GET['fcksource'] == "true" )
$File = 'fckeditor.original.html' ;
else
$File = 'fckeditor.html' ;
 
$Link = "{$this->BasePath}editor/{$File}?InstanceName={$this->InstanceName}" ;
if ( $this->ToolbarSet != '' )
$Link .= "&amp;Toolbar={$this->ToolbarSet}" ;
 
// Render the linked hidden field.
$Html .= "<input type=\"hidden\" id=\"{$this->InstanceName}\" name=\"{$this->InstanceName}\" value=\"{$HtmlValue}\" style=\"display:none\" />" ;
 
// Render the configurations hidden field.
$Html .= "<input type=\"hidden\" id=\"{$this->InstanceName}___Config\" value=\"" . $this->GetConfigFieldString() . "\" style=\"display:none\" />" ;
 
// Render the editor IFRAME.
$Html .= "<iframe id=\"{$this->InstanceName}___Frame\" src=\"{$Link}\" width=\"{$this->Width}\" height=\"{$this->Height}\" frameborder=\"0\" scrolling=\"no\"></iframe>" ;
}
else
{
if ( strpos( $this->Width, '%' ) === false )
$WidthCSS = $this->Width . 'px' ;
else
$WidthCSS = $this->Width ;
 
if ( strpos( $this->Height, '%' ) === false )
$HeightCSS = $this->Height . 'px' ;
else
$HeightCSS = $this->Height ;
 
$Html .= "<textarea name=\"{$this->InstanceName}\" rows=\"4\" cols=\"40\" style=\"width: {$WidthCSS}; height: {$HeightCSS}\">{$HtmlValue}</textarea>" ;
}
 
$Html .= '</div>' ;
return $Html ;
}
 
function IsCompatible()
{
global $HTTP_USER_AGENT ;
 
if ( isset( $HTTP_USER_AGENT ) )
$sAgent = $HTTP_USER_AGENT ;
else
$sAgent = $_SERVER['HTTP_USER_AGENT'] ;
 
if ( strpos($sAgent, 'MSIE') !== false && strpos($sAgent, 'mac') === false && strpos($sAgent, 'Opera') === false )
{
$iVersion = (float)substr($sAgent, strpos($sAgent, 'MSIE') + 5, 3) ;
return ($iVersion >= 5.5) ;
}
else if ( strpos($sAgent, 'Gecko/') !== false )
{
$iVersion = (int)substr($sAgent, strpos($sAgent, 'Gecko/') + 6, 8) ;
return ($iVersion >= 20030210) ;
}
else
return false ;
}
 
function GetConfigFieldString()
{
$sParams = '' ;
$bFirst = true ;
 
foreach ( $this->Config as $sKey => $sValue )
{
if ( $bFirst == false )
$sParams .= '&amp;' ;
else
$bFirst = false ;
if ( $sValue === true )
$sParams .= $this->EncodeConfig( $sKey ) . '=true' ;
else if ( $sValue === false )
$sParams .= $this->EncodeConfig( $sKey ) . '=false' ;
else
$sParams .= $this->EncodeConfig( $sKey ) . '=' . $this->EncodeConfig( $sValue ) ;
}
return $sParams ;
}
 
function EncodeConfig( $valueToEncode )
{
$chars = array(
'&' => '%26',
'=' => '%3D',
'"' => '%22' ) ;
 
return strtr( $valueToEncode, $chars ) ;
}
}
 
?>
/tags/Racine_livraison_narmer/api/fckeditor/fckeditor.py
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/fckeditor/fckeditor.py
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/fckeditor/fcktemplates.xml
New file
0,0 → 1,98
<?xml version="1.0" encoding="utf-8" ?>
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktemplates.xml
* This is the sample templates definitions file. It makes the "templates"
* command completely customizable.
* See FCKConfig.TemplatesXmlPath in the configuration file.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<Templates imagesBasePath="fck_template/images/">
<Template title="Image and Title" image="template1.gif">
<Description>One main image with a title and text that surround the image.</Description>
<Html>
<![CDATA[
<img style="MARGIN-RIGHT: 10px" height="100" alt="" width="100" align="left"/>
<h3>Type the title here</h3>
Type the text here
]]>
</Html>
</Template>
<Template title="Strange Template" image="template2.gif">
<Description>A template that defines two colums, each one with a title, and some text.</Description>
<Html>
<![CDATA[
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td width="50%">
<h3>Title 1</h3>
</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td>
<td width="50%">
<h3>Title 2</h3>
</td>
</tr>
<tr>
<td>Text 1</td>
<td>&nbsp;</td>
<td>Text 2</td>
</tr>
</tbody>
</table>
More text goes here.
]]>
</Html>
</Template>
<Template title="Text and Table" image="template3.gif">
<Description>A title with some text and a table.</Description>
<Html>
<![CDATA[
<table align="left" width="80%" border="0" cellspacing="0" cellpadding="0"><tr><td>
<h3>Title goes here</h3>
<p>
<table style="FLOAT: right" cellspacing="0" cellpadding="0" width="150" border="1">
<tbody>
<tr>
<td align="center" colspan="3"><strong>Table title</strong></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
Type the text here</p>
</td></tr></table>
]]>
</Html>
</Template>
</Templates>
/tags/Racine_livraison_narmer/api/arbre/arbre.class.php
New file
0,0 → 1,569
<?php
 
/* ***************************** classe arbre ***********************************
* classe permettant la creation d'un arbre, elle est fonctionnelle en tant que module
* de gsite (www.gsite.org).
* L'arbre peut servir de representation graphique de donnees statistiques.
* Copyright 2001 Tela Botanica
* Auteurs : Daniel Mathieu, Nicolas Touillaud, Alexandre Granier
* Cette bibliothèque est libre, vous pouvez la redistribuer et/ou la modifier
* selon les termes de la Licence Publique Générale GNU publiée par la
* Free Software Foundation.
* Cette bibliothèque est distribuée car potentiellement utile, mais SANS
* AUCUNE GARANTIE, ni explicite ni implicite, y compris les garanties de
* commercialisation ou d'adaptation dans un but spécifique.
*
* Derniere mise a jour : 10 decembre 2001
************************************************************************************/
error_reporting (E_ALL) ;
//l'ecran
//$xres=698; //doit etre divisible par 2 sinon bug d'alignement
$innerTableWidth = 600;
$xres=$innerTableWidth-10;
$yres=600;
 
//les images
$yfait= 50; //la hauteur du "sommet"
$xfait= 1;
$xtronc= 36; //doit etre divisible par 2 sinon bug d'alignement
$ytronc= 559;
$xbranche= 200;
$ybranche= 64;
$xracine= 191;
$yracine= 61;
$xfeuille= 50;
$yfeuille= 45;
$xtextedroite=10;
$ytextedroite=15;
$xtextegauche=10;
$ytextegauche=10;
$yposnom=12;
$xpuce=10;
$ypuce=10;
$taille_mini=60;
$nhi_xsommet=191;
$nhi_ysommet=61;
include 'tailles.php3' ;
 
define ("ARBRE_CHEMIN_IMAGES", 'api/arbre/images/') ;
 
 
function calc_xref_branche($xres_,$xfeuille_, $xtronc_)
//calcule la taille de reference des branches
{
//global $xres, $xfeuille, $xtronc;
$toto=round(($xres_-$xtronc_-(2*$xfeuille_))/2);
return $toto;
}
 
 
 
//******************************************************
// calcule l'espace vertical entre 2 branche d'un meme coté: si il n'y a pas la place -> 12 pixels
function calc_esver()
{
global $nbdroite ;
if ($nbdroite != 1):
{
global $yres, $yfait, $yracine, $ybranche, $nbdroite;
$toto=($yres-$yfait-$yracine-($nbdroite*$ybranche))/($nbdroite-1);
if($toto<0):{$toto=12;} //on ne se place plus sur 1 ecran mais sur plus
endif;
return $toto;
}
else:{return 0;}
endif;
}
//******************************************************
 
$esver=calc_esver();
 
//******************************************************
//calcul la position en x de la branche
function calcul_x_branche($adroite,$xreel)
{
global $xres, $xtronc, $xref_branche;
$tempx=($xres+$xtronc)/2-2; //pour un bug
if($adroite != 1):
{
$tempx=$tempx+2-$xtronc-($xreel);
}
endif;
return round($tempx);
}
//******************************************************
 
//Il est impératif d'afficher 1 branche d'un coté, puis de l'autre etc..
 
//******************************************************
//retourne la position y de la branche (et de la feuille) et met à jour la hauteur de la prochaine branche
function calcul_y_branche()
{
global $esver, $hauteur, $ybranche;
$toto=$hauteur;
$hauteur=$hauteur+(($ybranche+$esver)/2);
return $toto;
}
//******************************************************
 
//******************************************************
//retourne la position x du tronc
function x_tronc()
{
global $xtronc, $xres;
return ($xres-$xtronc)/2;
}
//******************************************************
 
//******************************************************
//retourne la position y du tronc
function y_tronc()
{
global $yfait;
return ($yfait);
}
//******************************************************
 
//******************************************************
// retourne la position x de la racine
function x_racine()
{
global $xracine, $xres;
return ($xres-$xracine)/2;
}
//******************************************************
 
//******************************************************
//retourne la taille du tronc en pixels
function taille_tronc()
{
global $nbdroite, $esver, $ybranche;
$toto=($nbdroite-1)*$esver+($nbdroite*$ybranche);
return $toto;
}
//******************************************************
 
//******************************************************
//retourne la position x de la feuille en fonction des param de la branche
function calcul_x_feuille($adroite, $pos_branche, $xreel_brch) //xreel en %
{
global $xref_branche, $xfeuille;
if($adroite !=1):
{
$toto=$pos_branche-$xfeuille;
}
else:
{
$toto=$pos_branche+($xreel_brch);
}
endif;
return $toto;
}
//******************************************************
 
//******************************************************
// retourne la position y de la racine
function y_racine()
{
global $yfait;
$toto=$yfait+taille_tronc();
return $toto;
}
//******************************************************
 
 
//******************************************************
//met 1 à 0 et inversement
function dg($dte)
{
if($dte==1):{return 0;}
else:{return 1;}
endif;
}
//******************************************************
 
//******************************************************
//une fonction qui prend le % de vert *100 et qui sort la chaine html du vert correspondant
function couleur_f($prc)
{
if ($prc==0) return ("#279C27");
if (($prc>0) && ($prc<=16)) return ("#279C27");
if (($prc>16) && ($prc<=32)) return ("#CCCC00");
if (($prc>32) && ($prc<=48)) return ("#FFCC00");
if (($prc>48) && ($prc<=64)) return ("#DD8D22");
if (($prc>64) && ($prc<=80)) {
return "#FF6600" ;
} else {
return "#CC3300" ;
}
}
//*****************************************************
 
//une fonction qui détermine si un entier est pair ou non
function est_pair($un_entier)
{
return(($un_entier %2)==0);
}
 
 
class arbre {
 
var $nbre_branche ;
var $branche ;
var $blanc_cime ;
/********************************************************************************
* constructeur arbre(chaine $nom, chaine $lien_nom, entier $intensite, chaine $lien_intensite,
* chaine $lien_feuille)
* crees une instance d'arbre, les parametres sont les informations du sommet de l'arbre
* $nom : le texte du haut de l'arbre
* $lien_nom : le lein associe
* $intensite : le nombre a cote du nom
* $lien_intensite : le lien sur l'intensite
* $lien_feuille : le lien, lorsqu'on clique sur la feuille du haut de l'arbre
*********************************************************************************/
 
function arbre() {}
 
function cime($nom, $lien_nom, $intensite, $lien_intensite, $lien_feuille) {
//global $nhi_xsommet, $nhi_ysommet,$ybranche,$yfeuille, $yres, $innerTableWidth ;
//l'ecran
//$xres=698; //doit etre divisible par 2 sinon bug d'alignement
$innerTableWidth = 600;
$xres=$innerTableWidth-10;
$yres=600;
 
//les images
$yfait= 50; //la hauteur du "sommet"
$xfait= 1;
$xtronc= 36; //doit etre divisible par 2 sinon bug d'alignement
$ytronc= 559;
$xbranche= 200;
$ybranche= 64;
$xracine= 191;
$yracine= 61;
$xfeuille= 50;
$yfeuille= 45;
$xtextedroite=10;
$ytextedroite=15;
$xtextegauche=10;
$ytextegauche=10;
$yposnom=12;
$xpuce=10;
$ypuce=10;
$taille_mini=60;
$nhi_xsommet=191;
$nhi_ysommet=61;
// tailles.php3 contient les variables de tailles des fichiers graphiques associes
// a l'arbre
include 'tailles.php3' ;
// Le blanc devant la cime de l'arbre
$this->blanc_cime = round(($xres-$nhi_xsommet)/2);
$res = '<tr>
<td align="center"><a href="'.$lien_nom.'"><b><i>'.$nom.'</i></b></a> <a href="'.$lien_intensite.'"><b><i>('.$intensite.')</i></b></a></td>
</tr>
<tr>
<td align="center"><table width="'.$xres.'" border="0" cellspacing="0" cellpadding="0" summary="">';
// haut de l'arbre
$res .= '<tr>
<td align="center"><table border="0" cellspacing="0" cellpadding="0" summary="">
<tr>
<td><img alt="" width="'.$this->blanc_cime.'" height="1" src="'.ARBRE_CHEMIN_IMAGES.'vide.gif" /></td>
<td width="'.$nhi_xsommet.'" height="'.$nhi_ysommet.'" align="center"><a href="'.$lien_feuille.'" target="_blank" class="image_lien">
<img alt="" width="'.$nhi_xsommet.'" height="'.$nhi_ysommet.'" border="0" src="'.ARBRE_CHEMIN_IMAGES.'haut.gif" /></a></td>
<td><img alt="" width="'.$this->blanc_cime.'" height="1" src="'.ARBRE_CHEMIN_IMAGES.'vide.gif" /></td>
</tr>
</table>
</td>
</tr>';
return $res ;
}
 
 
/************************** fonction addBranche ******************************************
* ajoute une branche a l'arbre
*
* $nom : le label d'une branche
* $lien_nom : le lien associe au label
* $intensite : le nombre a droite du label
* $lien_intensite : le lien sur le nombre
* $lien feuille : le lien quand on clique sur la feuille
* $intensite_feuille : un nombre compris entre 1 et 100, qui sera transforme en couleur
* $longueur_branche : un nombre entre 1 et 100, pour la longueur de la branche*
********************************************************************************************/
function addBranche($nom, $lien_nom, $intensite, $lien_intensite, $lien_feuille, $intensite_feuille, $longueur_branche) {
$this->nbre_branche++ ;
$this->branche["nom"][$this->nbre_branche] = $nom ;
$this->branche["lien_nom"][$this->nbre_branche] = $lien_nom ;
$this->branche["intensite"][$this->nbre_branche] = $intensite ;
$this->branche["lien_intensite"][$this->nbre_branche] = $lien_intensite ;
$this->branche["lien_feuille"][$this->nbre_branche] = $lien_feuille ;
$this->branche["intensite_feuille"][$this->nbre_branche] = $intensite_feuille ;
$this->branche["longueur_branche"][$this->nbre_branche] = $longueur_branche ;
}
/************ fonction affBranche() ajoute le code HTML des branches ********************
* ne renvoie rien
*********************************************************************************************/
function affBranche() {
//l'ecran
//$xres=698; //doit etre divisible par 2 sinon bug d'alignement
$innerTableWidth = 600;
$xres=$innerTableWidth-10;
$yres=600;
 
//les images
$yfait= 50; //la hauteur du "sommet"
$xfait= 1;
$xtronc= 36; //doit etre divisible par 2 sinon bug d'alignement
$ytronc= 559;
$xbranche= 200;
$ybranche= 64;
$xracine= 191;
$yracine= 61;
$xfeuille= 50;
$yfeuille= 45;
$xtextedroite=10;
$ytextedroite=15;
$xtextegauche=10;
$ytextegauche=10;
$yposnom=12;
$xpuce=10;
$ypuce=10;
$taille_mini=60;
$nhi_xsommet=191;
$nhi_ysommet=61;
$tb = "" ; $tb2 = "" ;
//global $nhi_xsommet, $nhi_ysommet,$ybranche,$yfeuille, $xref_branche, $taille_mini;
//global $xtronc, $espace_a_gauche, $xfeuille , $les_slashes, $xres, $innerTableWidth;
include 'tailles.php3' ;
$xref_branche = calc_xref_branche($xres,$xfeuille,$xtronc);
 
$res = "<!-- xref_branche=$xref_branche -->";
 
$yinv=$ybranche-$yfeuille; //Hauteur de la case vide sous la feuille
 
//le tableau des branches
 
//ici, la boucle
//ajustement de la boucle: le nombre de tables doit être pair dans la boucle
$la_limite_de_la_boucle = $this->nbre_branche;
 
if(true != est_pair($la_limite_de_la_boucle)): //ajustement de la boucle
{
$la_limite_de_la_boucle-=1;
}endif;
 
$coul_ = '' ;
for($i=0; $i < $la_limite_de_la_boucle ; $i += 2) {
// informations concernant la branche gauche
$coul_=couleur_f($this->branche["intensite_feuille"][$i+1]);
$xrel=$this->branche["longueur_branche"][$i+2]/100;
$tbr = round($xrel * $xref_branche);
if($tbr < $taille_mini) $tbr = $taille_mini + $tbr ; //taille mini de la branche
 
if(isset ($les_slashes) && $les_slashes == 1) {
$this->branche["lien_nom"][$i+1] = stripslashes($this->branche["nom_lien"][$i+1]);
$this->branche["lien_feuille"][$i+1] = stripslashes($this->branche["lien_feuille"][$i+1]);
//$lien_puce2=stripslashes($lien_puce2);
}
 
// informations concernant la branche droite
$coul_2=couleur_f($this->branche["intensite_feuille"][$i+2]);
$xrel2 = $this->branche["longueur_branche"][$i+1]/100.0;
$tbr2 = round($xrel2*$xref_branche);
if($tbr2 < $taille_mini) $tbr2 = $taille_mini+$tbr2 ; //taille mini de la branche
 
//pour des parametress de javascript, le addslash provient de appli_dessin_date
if(isset ($les_slashes) && $les_slashes == 1) {
$this->branche["lien_nom"][$i+2] = stripslashes($this->branche["lien_nom"][$i+2]);
$this->branche["lien_feuille"][$i+2] = stripslashes($this->branche["lien_feuille"][$i+2]);
//$lien_puce2=stripslashes($lien_puce2);
}
 
//espace à gauche
$espace_a_gauche=round((($xres-$xtronc)/2)-$tbr2-$xfeuille);
 
//espace à droite
$espace_a_droite=round($xres-$xtronc-$tbr-$tbr2-2*$xfeuille-$espace_a_gauche);
 
$res .= "<!-- Les noms des listes -->
<tr>
<td>
<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" summary=\"\">
<tr>
<td colspan=\"3\" align=\"right\"><a href=\"";
$res .= $this->branche["lien_nom"][$i+1];
$res .= '" class="lien_nom">';
$res .= $this->branche["nom"][$i+1];
$res .= "</a>";
if($this->branche["intensite"][$i+1] != 0) {
$res .= " <a href=\"" ;
$res .= $this->branche["lien_intensite"][$i+1];
$res .= '" class="lien_nom">(';
$res .= $this->branche["intensite"][$i+1];
$res .= ")</a>";
}
$res .= "&nbsp;&nbsp;&nbsp;&nbsp;</td>
<!-- Le tronc -->
<td bgcolor=\"#663333\"><img alt=\"\" width=\"$xtronc\" height=\"20\" src=\"".ARBRE_CHEMIN_IMAGES."vide.gif\" /></td>
<td colspan=\"3\" align=\"left\">&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"";
$res .= $this->branche["lien_nom"][$i+2];
$res .= '" class="lien_nom">';
$res .= $this->branche["nom"][$i+2];
$res .= "</a>";
if($this->branche["intensite"][$i+2] != 0) {
$res .= " <a href=\"";
$res .= $this->branche["lien_intensite"][$i+2];
$res .= '" class="lien_nom">(';
$res .= $this->branche["intensite"][$i+2];
$res .= ")</a>";
}
$res .= "</td>
</tr>
<!-- Bloc de 2 branches -->
<tr>
<!-- Espace gauche -->
<td rowspan=\"2\"><img alt=\"\" width=\"$espace_a_gauche\" height=\"1\" src=\"".ARBRE_CHEMIN_IMAGES."vide.gif\" /></td>
<!-- Feuille gauche -->
<td class=\"chiffre\" align=\"center\" bgcolor=\"$coul_2\" width=\"$xfeuille\" height=\"$yfeuille\">";
if($this->branche["lien_feuille"][$i+1]!="") {
$res .= '<a target="_blank" href="';
$res .= $this->branche["lien_feuille"][$i+1] ;
$res .= '" class="image_lien">';
}
$res .= "<img alt=\"\" width=\"$xfeuille\" height=\"$yfeuille\" border=\"0\" src=\"".ARBRE_CHEMIN_IMAGES."feuille_gauche.gif\" />";
if($this->branche["lien_feuille"][$i+1]!=""):{$res .= "</a>";}endif;$res .= "</td>
<!-- Branche gauche: taille $tb2 % = $tbr2 pixels -->
<td rowspan=\"2\"><img alt=\"\" width=\"$tbr2\" height=\"$ybranche\" src=\"".ARBRE_CHEMIN_IMAGES."branche_gauche.gif\" /></td>
<!-- Le tronc -->
<td rowspan=\"2\" bgcolor=\"#663333\"><img alt=\"\" width=\"$xtronc\" src=\"".ARBRE_CHEMIN_IMAGES."vide.gif\" /></td>
<!-- Branche droite: taille $tb % = $tbr pixels -->
<td rowspan=\"2\"><img alt=\"\" width=\"$tbr\" height=\"$ybranche\" src=\"".ARBRE_CHEMIN_IMAGES."branche_droite.gif\" /></td>
<!-- Feuille droite -->
<td class=\"chiffre\" align=\"center\" bgcolor=\"$coul_\" width=\"$xfeuille\" height=\"$yfeuille\">";
if($this->branche["lien_feuille"][$i+2] != "") {
$res .= '<a target="_blank" href="';
$res .= $this->branche["lien_feuille"][$i+2];
$res .= '" class="image_lien">';
}
$res .= "<img alt=\"\" width=\"$xfeuille\" height=\"$yfeuille\" border=\"0\" src=\"".ARBRE_CHEMIN_IMAGES."feuille_droite.gif\" />";
if($this->branche["lien_feuille"][$i+2] !="") {
$res .= "</a>";
}
$res .= '</td>
<!-- Espace droit -->
<td rowspan="2"><img alt="" width="'.$espace_a_droite.'" height="1" src="'.ARBRE_CHEMIN_IMAGES.'vide.gif" /></td>
</tr>
<!-- Les cases vides sous les feuilles -->
<tr>
<td height="'.$yinv.'"><img alt="" width="1" height="'.$yinv.'" src="'.ARBRE_CHEMIN_IMAGES.'vide.gif" /></td>
<td height="'.$yinv.'"><img alt="" width="1" height="'.$yinv.'" src="'.ARBRE_CHEMIN_IMAGES.'vide.gif" /></td>
</tr>
</table>
</td>
</tr>
<!-- Fin du bloc de 2 branches -->';
 
}
if(!est_pair($this->nbre_branche)) {
$coul_2=couleur_f($this->branche["intensite_feuille"][$this->nbre_branche]);
$xrel2 = $this->branche["longueur_branche"][$this->nbre_branche]/100.0;
$tbr2 = round($xrel2*$xref_branche);
if($tbr2 < $taille_mini) $tbr2 = $taille_mini+$tbr2 ; //taille mini de la branche
 
//pour des parametress de javascript, le addslash provient de appli_dessin_date
if(isset ($les_slashes) && $les_slashes==1) {
$this->branche["lien_nom"][$this->nbre_branche] = stripslashes($this->branche["lien_nom"][$this->nbre_branche]);
$this->branche["lien_feuille"][$this->nbre_branche] = stripslashes($this->branche["lien_feuille"][$this->nbre_branche]);
//$lien_puce2=stripslashes($lien_puce2);
}
//espace à gauche
$espace_a_gauche=round((($xres-$xtronc)/2)-$tbr2-$xfeuille);
 
$res .= '<!-- Le nom de la liste -->
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td colspan="3" align="right"><a href="';
$res .= $this->branche["lien_nom"][$this->nbre_branche] ;
$res .= '" class="lien_nom">';
$res .= $this->branche["nom"][$this->nbre_branche];
$res .= "</a>";
if($this->branche["intensite"][$this->nbre_branche] != 0 ) {
$res .= ' <a href="';
$res .= $this->branche["lien_intensite"][$this->nbre_branche] ;
$res .= '" class="lien_nom">(';
$res .= $this->branche["intensite"][$this->nbre_branche];
$res .= ')</a>';
}
$res .= '&nbsp;&nbsp;&nbsp;&nbsp;</td>
<!-- Le tronc -->
<td bgcolor="#663333"><img alt="" width="'.$xtronc.'" height="20" src="'.ARBRE_CHEMIN_IMAGES.'vide.gif" /></td>
<td colspan="3" rowspan="3" align="left">&nbsp;</td>
</tr>
<!-- Bloc de 1 branche -->
<tr>
<!-- Espace gauche -->
<td rowspan="2"><img alt="" width="'.$espace_a_gauche.'" height="1" src="'.ARBRE_CHEMIN_IMAGES.'vide.gif" /></td>
<!-- Feuille gauche -->
<td class="chiffre" align="center" bgcolor="'.$coul_.'" width="'.$xfeuille.'" height="'.$yfeuille.'" >';
if($this->branche["lien_feuille"][$this->nbre_branche] != "") {
$res .= "<a target=\"_blank\" href=\"";
$res .= $this->branche["lien_feuille"][$this->nbre_branche];
$res .= '">';
}
$res .= "<img alt=\"\" width=\"$xfeuille\" height=\"$yfeuille\" border=\"0\" src=\"".ARBRE_CHEMIN_IMAGES."feuille_gauche.gif\" />";
if($this->branche["lien_feuille"][$this->nbre_branche]!=""):{$res .= "</a>";}endif;$res .= "</td>
<!-- Branche gauche: taille $tb2 % = $tbr2 pixels -->
<td rowspan=\"2\"><img alt=\"\" width=\"$tbr2\" height=\"$ybranche\" src=\"".ARBRE_CHEMIN_IMAGES."branche_gauche.gif\" /></td>
 
<!-- Le tronc -->
<td rowspan=\"2\" bgcolor=\"#663333\"><img alt=\"\" width=\"$xtronc\" src=\"".ARBRE_CHEMIN_IMAGES."vide.gif\" /></td>
</tr>
<!-- La case vide sous la feuille -->
<tr>
<td height=\"$yinv\"><img alt=\"\" width=\"1\" height=\"$yinv\" src=\"".ARBRE_CHEMIN_IMAGES."vide.gif\" /></td>
</tr>
</table>
</td>
</tr>
";
 
}
return $res ;
}
/******************** fonction affRacine() ****************************************
* affiche la racine, ne renvoie rien
*************************************************************************************/
function affRacine() {
$xracine = 191 ; $yracine = 61;
$this->blanc_cime -= 4 ;
 
$res = '<!-- la racine -->
<tr>
<td align="left"><img width="'.$this->blanc_cime.'" height="1" border="0" src="'.ARBRE_CHEMIN_IMAGES.'vide.gif" alt="vide" />
<img src="'.ARBRE_CHEMIN_IMAGES.'racine.gif" width="'.$xracine.'" height="'.$yracine.'" border="0" alt="racine" />
</td>
</tr>
</table>
</td>
</tr>';
return $res ;
}
}
 
?>
/tags/Racine_livraison_narmer/api/arbre/images/fleche_droite.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/arbre/images/fleche_droite.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/arbre/images/puce.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/arbre/images/puce.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/arbre/images/feuille_gauche.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/arbre/images/feuille_gauche.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/arbre/images/haut.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/arbre/images/haut.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/arbre/images/racine.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/arbre/images/racine.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/arbre/images/fleche_gauche.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/arbre/images/fleche_gauche.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/arbre/images/barre_blanche.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/arbre/images/barre_blanche.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/arbre/images/feuille2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/arbre/images/feuille2.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/arbre/images/branche_droite.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/arbre/images/branche_droite.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/arbre/images/branche_gauche.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/arbre/images/branche_gauche.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/arbre/images/feuille.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/arbre/images/feuille.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/arbre/images/tronc.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/arbre/images/tronc.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/arbre/images/valider.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/arbre/images/valider.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/arbre/images/vide.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/arbre/images/vide.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/arbre/images/arbre.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/arbre/images/arbre.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/arbre/images/feuille_droite.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/arbre/images/feuille_droite.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/arbre/tailles.php3
New file
0,0 → 1,45
<?
/* ***************************** classe arbre ***********************************
* class permettant la creation d'un arbre, elle est fonctionnelle en tant que module
* de gsite (www.gsite.org).
* L'arbre peut servir de representation graphique de donnees statistiques.
* Copyright 2001 Tela Botanica
* Auteurs : Daniel Mathieu, Nicolas Touillaud, Alexandre Granier
* Cette bibliothèque est libre, vous pouvez la redistribuer et/ou la modifier
* selon les termes de la Licence Publique Générale GNU publiée par la
* Free Software Foundation.
* Cette bibliothèque est distribuée car potentiellement utile, mais SANS
* AUCUNE GARANTIE, ni explicite ni implicite, y compris les garanties de
* commercialisation ou d'adaptation dans un but spécifique.
*
************************************************************************************/
 
//l'ecran
//$xres=698; //doit etre divisible par 2 sinon bug d'alignement
$innerTableWidth = 600;
$xres=$innerTableWidth-10;
$yres=600;
 
//les images
$yfait= 50; //la hauteur du "sommet"
$xfait= 1;
$xtronc= 36; //doit etre divisible par 2 sinon bug d'alignement
$ytronc= 559;
$xbranche= 200;
$ybranche= 64;
$xracine= 191;
$yracine= 61;
$xfeuille= 50;
$yfeuille= 45;
$xtextedroite=10;
$ytextedroite=15;
$xtextegauche=10;
$ytextegauche=10;
$yposnom=12;
$xpuce=10;
$ypuce=10;
$taille_mini=60;
$nhi_xsommet=191;
$nhi_ysommet=61;
 
?>
/tags/Racine_livraison_narmer/api/syndication_rss/syndication_rss.php
New file
0,0 → 1,128
<?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$
/**
*
* Fonctions du module rss de papyrus
*
*
*@package syndication_rss
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
*@author Florian Schmitt <florian@ecole-et-nature.org>
//Autres auteurs :
*@copyright Tela-Botanica 2000-2007
*@version $Revision$
// +------------------------------------------------------------------------------------------------------+
*/
 
define('MAGPIE_DIR', GEN_CHEMIN_API.'syndication_rss/magpierss/');
define('MAGPIE_CACHE_DIR', MAGPIE_DIR.'tmp/magpie_cache');
define('OUVRIR_LIEN_RSS_NOUVELLE_FENETRE', 1);
define('FORMAT_DATE', 'jma');
require_once(MAGPIE_DIR.'rss_fetch.inc');
 
function voir_rss($titre='', $url='', $nb=0, $nouvelle_fenetre=OUVRIR_LIEN_RSS_NOUVELLE_FENETRE, $formatdate=FORMAT_DATE, $template = "") {
$res= '';
if ( $url!='' ) {
$rss = fetch_rss( $url );
if ($template != "") {
$i = 0 ;
foreach ($rss->items as $item) {
// Le test suivant pour savoir s il faut reduire l excendent de description
// Si {all} est present dans le template on ne reduit pas
if (preg_match ('/{all}/', $template)) {
$template = str_replace('{all}', '', $template);
$all = true ;
} else {
$all = false;
}
if (strlen($item['description']) > 200 && !$all) {
$item['description'] = substr ($item['description'] , 0, 300).'... <a href="'.$item['link'].'">Lire la suite</a>';
}
if (!isset($item['pubdate'])) $item['pubdate'] = date('dmY');
// Le code ci-apres est pour rattraper les dates du type 01012005 parsees par magpie
// lorsque les flux donne des dates au format iso
if (preg_match('/^([0-3][0-9])([0-1][0-9])([0-9][0-9][0-9][0-9])$/', $item['pubdate'], $match)) {
$item['pubdate'] = $match[3].'-'.$match[2].'-'.$match[1];
//echo $item['pubdate'];
}
$res .= str_replace ('{num}', ++$i,
str_replace ('{item}', '<a href="'.$item['link'].'" target="_top">'.$item['title'].'</a>',
str_replace ('{date}', strftime('%d.%m.%Y',strtotime($item['pubdate'])),
str_replace ('{description}', $item['description'], $template)))) ;
$res .= "\n";
if ($i > $nb) break;
}
return $res ;
}
if ( $titre=='' ) {$res .= '<h2>'.$rss->channel['title'].'</h2>'."\n";}
elseif ( $titre!='0' ) {$res .= '<h2>'.$titre.'</h2>'."\n";}
$res .= '<ul class="liste_rss">'."\n";
$i=0;
$nb_item=count($rss->items);
if (($nb==0)or($nb_item<=$nb)) {
foreach ($rss->items as $item) {
$href = $item['link'];
$title = $item['title'];
$res .= '<li class="titre_rss">'."\n";
if (isset($item['pubdate'])) $date=$item['pubdate'];
elseif ((!isset($item['pubdate']))and(isset($item['date_timestamp']))) $date=$item['date_timestamp'];
else $formatdate='';
if ($formatdate=='jm') {$res .= strftime('%d.%m',strtotime($date)).': ';}
if ($formatdate=='jma') {$res .= strftime('%d.%m.%Y',strtotime($date)).': ';}
if ($formatdate=='jmh') {$res .= strftime('%d.%m %H:%M',strtotime($date)).': ';}
if ($formatdate=='jmah') {$res .= strftime('%d.%m.%Y %H:%M',strtotime($date)).': ';}
$res .= '<a class="lien_rss" href="'.$href;
if ($nouvelle_fenetre==1) $res .= '" onclick="window.open(this.href); return false;';
$res .= '">'.$title.'</a></li>'."\n";
}
}
else {
$i=0;
foreach ($rss->items as $item) {
$href = $item['link'];
$title = $item['title'];
$res .= '<li class="titre_rss">'."\n";
if (isset($item['pubdate'])) $date=$item['pubdate'];
elseif ((!isset($item['pubdate']))and(isset($item['date_timestamp']))) $date=$item['date_timestamp'];
else $formatdate='';
if ($formatdate=='jm') {$res .= strftime('%d.%m',strtotime($date)).': ';}
if ($formatdate=='jma') {$res .= strftime('%d.%m.%Y',strtotime($date)).': ';}
if ($formatdate=='jmh') {$res .= strftime('%d.%m %H:%M',strtotime($date)).': ';}
if ($formatdate=='jmah') {$res .= strftime('%d.%m.%Y %H:%M',strtotime($date)).': ';}
$res .= '<a class="lien_rss" href="'.$href;
if ($nouvelle_fenetre==1) $res .= '" onclick="window.open(this.href); return false;';
$res .= '">'.$title.'</a></li>'."\n";
$i++;
if ($i>=$nb) break;
}
}
$res .= '</ul>'."\n";
}
//echo '<pre>'.var_dump($rss->items).'</pre><br /><br />';
return $res;
}
?>
/tags/Racine_livraison_narmer/api/syndication_rss/magpierss/rss_utils.inc
New file
0,0 → 1,67
<?php
/*
* Project: MagpieRSS: a simple RSS integration tool
* File: rss_utils.inc, utility methods for working with RSS
* Author: Kellan Elliott-McCrea <kellan@protest.net>
* Version: 0.51
* License: GPL
*
* The lastest version of MagpieRSS can be obtained from:
* http://magpierss.sourceforge.net
*
* For questions, help, comments, discussion, etc., please join the
* Magpie mailing list:
* magpierss-general@lists.sourceforge.net
*/
 
 
/*======================================================================*\
Function: parse_w3cdtf
Purpose: parse a W3CDTF date into unix epoch
 
NOTE: http://www.w3.org/TR/NOTE-datetime
\*======================================================================*/
 
function parse_w3cdtf ( $date_str ) {
# regex to match wc3dtf
$pat = "/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(:(\d{2}))?(?:([-+])(\d{2}):?(\d{2})|(Z))?/";
if ( preg_match( $pat, $date_str, $match ) ) {
list( $year, $month, $day, $hours, $minutes, $seconds) =
array( $match[1], $match[2], $match[3], $match[4], $match[5], $match[6]);
# calc epoch for current date assuming GMT
$epoch = gmmktime( $hours, $minutes, $seconds, $month, $day, $year);
$offset = 0;
if ( $match[10] == 'Z' ) {
# zulu time, aka GMT
}
else {
list( $tz_mod, $tz_hour, $tz_min ) =
array( $match[8], $match[9], $match[10]);
# zero out the variables
if ( ! $tz_hour ) { $tz_hour = 0; }
if ( ! $tz_min ) { $tz_min = 0; }
$offset_secs = (($tz_hour*60)+$tz_min)*60;
# is timezone ahead of GMT? then subtract offset
#
if ( $tz_mod == '+' ) {
$offset_secs = $offset_secs * -1;
}
$offset = $offset_secs;
}
$epoch = $epoch + $offset;
return $epoch;
}
else {
return -1;
}
}
 
?>
/tags/Racine_livraison_narmer/api/syndication_rss/magpierss/rss_cache.inc
New file
0,0 → 1,200
<?php
/*
* Project: MagpieRSS: a simple RSS integration tool
* File: rss_cache.inc, a simple, rolling(no GC), cache
* for RSS objects, keyed on URL.
* Author: Kellan Elliott-McCrea <kellan@protest.net>
* Version: 0.51
* License: GPL
*
* The lastest version of MagpieRSS can be obtained from:
* http://magpierss.sourceforge.net
*
* For questions, help, comments, discussion, etc., please join the
* Magpie mailing list:
* http://lists.sourceforge.net/lists/listinfo/magpierss-general
*
*/
 
class RSSCache {
var $BASE_CACHE = './cache'; // where the cache files are stored
var $MAX_AGE = 3600; // when are files stale, default one hour
var $ERROR = ""; // accumulate error messages
function RSSCache ($base='', $age='') {
if ( $base ) {
$this->BASE_CACHE = $base;
}
if ( $age ) {
$this->MAX_AGE = $age;
}
// attempt to make the cache directory
if ( ! file_exists( $this->BASE_CACHE ) ) {
$status = @mkdir( $this->BASE_CACHE, 0755 );
// if make failed
if ( ! $status ) {
$this->error(
"Cache couldn't make dir '" . $this->BASE_CACHE . "'."
);
}
}
}
/*=======================================================================*\
Function: set
Purpose: add an item to the cache, keyed on url
Input: url from wich the rss file was fetched
Output: true on sucess
\*=======================================================================*/
function set ($url, $rss) {
$this->ERROR = "";
$cache_file = $this->file_name( $url );
$fp = @fopen( $cache_file, 'w' );
if ( ! $fp ) {
$this->error(
"Cache unable to open file for writing: $cache_file"
);
return 0;
}
$data = $this->serialize( $rss );
fwrite( $fp, $data );
fclose( $fp );
return $cache_file;
}
/*=======================================================================*\
Function: get
Purpose: fetch an item from the cache
Input: url from wich the rss file was fetched
Output: cached object on HIT, false on MISS
\*=======================================================================*/
function get ($url) {
$this->ERROR = "";
$cache_file = $this->file_name( $url );
if ( ! file_exists( $cache_file ) ) {
$this->debug(
"Cache doesn't contain: $url (cache file: $cache_file)"
);
return 0;
}
$fp = @fopen($cache_file, 'r');
if ( ! $fp ) {
$this->error(
"Failed to open cache file for reading: $cache_file"
);
return 0;
}
if ($filesize = filesize($cache_file) ) {
$data = fread( $fp, filesize($cache_file) );
$rss = $this->unserialize( $data );
return $rss;
}
return 0;
}
 
/*=======================================================================*\
Function: check_cache
Purpose: check a url for membership in the cache
and whether the object is older then MAX_AGE (ie. STALE)
Input: url from wich the rss file was fetched
Output: cached object on HIT, false on MISS
\*=======================================================================*/
function check_cache ( $url ) {
$this->ERROR = "";
$filename = $this->file_name( $url );
if ( file_exists( $filename ) ) {
// find how long ago the file was added to the cache
// and whether that is longer then MAX_AGE
$mtime = filemtime( $filename );
$age = time() - $mtime;
if ( $this->MAX_AGE > $age ) {
// object exists and is current
return 'HIT';
}
else {
// object exists but is old
return 'STALE';
}
}
else {
// object does not exist
return 'MISS';
}
}
 
function cache_age( $cache_key ) {
$filename = $this->file_name( $url );
if ( file_exists( $filename ) ) {
$mtime = filemtime( $filename );
$age = time() - $mtime;
return $age;
}
else {
return -1;
}
}
/*=======================================================================*\
Function: serialize
\*=======================================================================*/
function serialize ( $rss ) {
return serialize( $rss );
}
 
/*=======================================================================*\
Function: unserialize
\*=======================================================================*/
function unserialize ( $data ) {
return unserialize( $data );
}
/*=======================================================================*\
Function: file_name
Purpose: map url to location in cache
Input: url from wich the rss file was fetched
Output: a file name
\*=======================================================================*/
function file_name ($url) {
$filename = md5( $url );
return join( DIRECTORY_SEPARATOR, array( $this->BASE_CACHE, $filename ) );
}
 
/*=======================================================================*\
Function: error
Purpose: register error
\*=======================================================================*/
function error ($errormsg, $lvl=E_USER_WARNING) {
// append PHP's error message if track_errors enabled
if ( isset($php_errormsg) ) {
$errormsg .= " ($php_errormsg)";
}
$this->ERROR = $errormsg;
if ( MAGPIE_DEBUG ) {
trigger_error( $errormsg, $lvl);
}
else {
error_log( $errormsg, 0);
}
}
function debug ($debugmsg, $lvl=E_USER_NOTICE) {
if ( MAGPIE_DEBUG ) {
$this->error("MagpieRSS [debug] $debugmsg", $lvl);
}
}
 
}
 
?>
/tags/Racine_livraison_narmer/api/syndication_rss/magpierss/extlib/Snoopy.class.inc
New file
0,0 → 1,900
<?php
 
/*************************************************
 
Snoopy - the PHP net client
Author: Monte Ohrt <monte@ispi.net>
Copyright (c): 1999-2000 ispi, all rights reserved
Version: 1.0
 
* 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
 
You may contact the author of Snoopy by e-mail at:
monte@ispi.net
 
Or, write to:
Monte Ohrt
CTO, ispi
237 S. 70th suite 220
Lincoln, NE 68510
 
The latest version of Snoopy can be obtained from:
http://snoopy.sourceforge.com
 
*************************************************/
 
class Snoopy
{
/**** Public variables ****/
/* user definable vars */
 
var $host = "www.php.net"; // host name we are connecting to
var $port = 80; // port we are connecting to
var $proxy_host = ""; // proxy host to use
var $proxy_port = ""; // proxy port to use
var $agent = "Snoopy v1.0"; // agent we masquerade as
var $referer = ""; // referer info to pass
var $cookies = array(); // array of cookies to pass
// $cookies["username"]="joe";
var $rawheaders = array(); // array of raw headers to send
// $rawheaders["Content-type"]="text/html";
 
var $maxredirs = 5; // http redirection depth maximum. 0 = disallow
var $lastredirectaddr = ""; // contains address of last redirected address
var $offsiteok = true; // allows redirection off-site
var $maxframes = 0; // frame content depth maximum. 0 = disallow
var $expandlinks = true; // expand links to fully qualified URLs.
// this only applies to fetchlinks()
// or submitlinks()
var $passcookies = true; // pass set cookies back through redirects
// NOTE: this currently does not respect
// dates, domains or paths.
var $user = ""; // user for http authentication
var $pass = ""; // password for http authentication
// http accept types
var $accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*";
var $results = ""; // where the content is put
var $error = ""; // error messages sent here
var $response_code = ""; // response code returned from server
var $headers = array(); // headers returned from server sent here
var $maxlength = 500000; // max return data length (body)
var $read_timeout = 0; // timeout on read operations, in seconds
// supported only since PHP 4 Beta 4
// set to 0 to disallow timeouts
var $timed_out = false; // if a read operation timed out
var $status = 0; // http request status
var $curl_path = "/usr/bin/curl";
// Snoopy will use cURL for fetching
// SSL content if a full system path to
// the cURL binary is supplied here.
// set to false if you do not have
// cURL installed. See http://curl.haxx.se
// for details on installing cURL.
// Snoopy does *not* use the cURL
// library functions built into php,
// as these functions are not stable
// as of this Snoopy release.
// send Accept-encoding: gzip?
var $use_gzip = true;
/**** Private variables ****/
var $_maxlinelen = 4096; // max line length (headers)
var $_httpmethod = "GET"; // default http request method
var $_httpversion = "HTTP/1.0"; // default http request version
var $_submit_method = "POST"; // default submit method
var $_submit_type = "application/x-www-form-urlencoded"; // default submit type
var $_mime_boundary = ""; // MIME boundary for multipart/form-data submit type
var $_redirectaddr = false; // will be set if page fetched is a redirect
var $_redirectdepth = 0; // increments on an http redirect
var $_frameurls = array(); // frame src urls
var $_framedepth = 0; // increments on frame depth
var $_isproxy = false; // set if using a proxy server
var $_fp_timeout = 30; // timeout for socket connection
 
/*======================================================================*\
Function: fetch
Purpose: fetch the contents of a web page
(and possibly other protocols in the
future like ftp, nntp, gopher, etc.)
Input: $URI the location of the page to fetch
Output: $this->results the output text from the fetch
\*======================================================================*/
 
function fetch($URI)
{
//preg_match("|^([^:]+)://([^:/]+)(:[\d]+)*(.*)|",$URI,$URI_PARTS);
$URI_PARTS = parse_url($URI);
if (!empty($URI_PARTS["user"]))
$this->user = $URI_PARTS["user"];
if (!empty($URI_PARTS["pass"]))
$this->pass = $URI_PARTS["pass"];
switch($URI_PARTS["scheme"])
{
case "http":
$this->host = $URI_PARTS["host"];
if(!empty($URI_PARTS["port"]))
$this->port = $URI_PARTS["port"];
if($this->_connect($fp))
{
if($this->_isproxy)
{
// using proxy, send entire URI
$this->_httprequest($URI,$fp,$URI,$this->_httpmethod);
}
else
{
$path = $URI_PARTS["path"].(isset($URI_PARTS["query"]) ? "?".$URI_PARTS["query"] : "");
// no proxy, send only the path
$this->_httprequest($path, $fp, $URI, $this->_httpmethod);
}
$this->_disconnect($fp);
 
if($this->_redirectaddr)
{
/* url was redirected, check if we've hit the max depth */
if($this->maxredirs > $this->_redirectdepth)
{
// only follow redirect if it's on this site, or offsiteok is true
if(preg_match("|^http://".preg_quote($this->host)."|i",$this->_redirectaddr) || $this->offsiteok)
{
/* follow the redirect */
$this->_redirectdepth++;
$this->lastredirectaddr=$this->_redirectaddr;
$this->fetch($this->_redirectaddr);
}
}
}
 
if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0)
{
$frameurls = $this->_frameurls;
$this->_frameurls = array();
while(list(,$frameurl) = each($frameurls))
{
if($this->_framedepth < $this->maxframes)
{
$this->fetch($frameurl);
$this->_framedepth++;
}
else
break;
}
}
}
else
{
return false;
}
return true;
break;
case "https":
if(!$this->curl_path || (!is_executable($this->curl_path))) {
$this->error = "Bad curl ($this->curl_path), can't fetch HTTPS \n";
return false;
}
$this->host = $URI_PARTS["host"];
if(!empty($URI_PARTS["port"]))
$this->port = $URI_PARTS["port"];
if($this->_isproxy)
{
// using proxy, send entire URI
$this->_httpsrequest($URI,$URI,$this->_httpmethod);
}
else
{
$path = $URI_PARTS["path"].($URI_PARTS["query"] ? "?".$URI_PARTS["query"] : "");
// no proxy, send only the path
$this->_httpsrequest($path, $URI, $this->_httpmethod);
}
 
if($this->_redirectaddr)
{
/* url was redirected, check if we've hit the max depth */
if($this->maxredirs > $this->_redirectdepth)
{
// only follow redirect if it's on this site, or offsiteok is true
if(preg_match("|^http://".preg_quote($this->host)."|i",$this->_redirectaddr) || $this->offsiteok)
{
/* follow the redirect */
$this->_redirectdepth++;
$this->lastredirectaddr=$this->_redirectaddr;
$this->fetch($this->_redirectaddr);
}
}
}
 
if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0)
{
$frameurls = $this->_frameurls;
$this->_frameurls = array();
 
while(list(,$frameurl) = each($frameurls))
{
if($this->_framedepth < $this->maxframes)
{
$this->fetch($frameurl);
$this->_framedepth++;
}
else
break;
}
}
return true;
break;
default:
// not a valid protocol
$this->error = 'Invalid protocol "'.$URI_PARTS["scheme"].'"\n';
return false;
break;
}
return true;
}
 
 
 
/*======================================================================*\
Private functions
\*======================================================================*/
/*======================================================================*\
Function: _striplinks
Purpose: strip the hyperlinks from an html document
Input: $document document to strip.
Output: $match an array of the links
\*======================================================================*/
 
function _striplinks($document)
{
preg_match_all("'<\s*a\s+.*href\s*=\s* # find <a href=
([\"\'])? # find single or double quote
(?(1) (.*?)\\1 | ([^\s\>]+)) # if quote found, match up to next matching
# quote, otherwise match up to next space
'isx",$document,$links);
 
// catenate the non-empty matches from the conditional subpattern
 
while(list($key,$val) = each($links[2]))
{
if(!empty($val))
$match[] = $val;
}
while(list($key,$val) = each($links[3]))
{
if(!empty($val))
$match[] = $val;
}
// return the links
return $match;
}
 
/*======================================================================*\
Function: _stripform
Purpose: strip the form elements from an html document
Input: $document document to strip.
Output: $match an array of the links
\*======================================================================*/
 
function _stripform($document)
{
preg_match_all("'<\/?(FORM|INPUT|SELECT|TEXTAREA|(OPTION))[^<>]*>(?(2)(.*(?=<\/?(option|select)[^<>]*>[\r\n]*)|(?=[\r\n]*))|(?=[\r\n]*))'Usi",$document,$elements);
// catenate the matches
$match = implode("\r\n",$elements[0]);
// return the links
return $match;
}
 
/*======================================================================*\
Function: _striptext
Purpose: strip the text from an html document
Input: $document document to strip.
Output: $text the resulting text
\*======================================================================*/
 
function _striptext($document)
{
// I didn't use preg eval (//e) since that is only available in PHP 4.0.
// so, list your entities one by one here. I included some of the
// more common ones.
$search = array("'<script[^>]*?>.*?</script>'si", // strip out javascript
"'<[\/\!]*?[^<>]*?>'si", // strip out html tags
"'([\r\n])[\s]+'", // strip out white space
"'&(quote|#34);'i", // replace html entities
"'&(amp|#38);'i",
"'&(lt|#60);'i",
"'&(gt|#62);'i",
"'&(nbsp|#160);'i",
"'&(iexcl|#161);'i",
"'&(cent|#162);'i",
"'&(pound|#163);'i",
"'&(copy|#169);'i"
);
$replace = array( "",
"",
"\\1",
"\"",
"&",
"<",
">",
" ",
chr(161),
chr(162),
chr(163),
chr(169));
$text = preg_replace($search,$replace,$document);
return $text;
}
 
/*======================================================================*\
Function: _expandlinks
Purpose: expand each link into a fully qualified URL
Input: $links the links to qualify
$URI the full URI to get the base from
Output: $expandedLinks the expanded links
\*======================================================================*/
 
function _expandlinks($links,$URI)
{
preg_match("/^[^\?]+/",$URI,$match);
 
$match = preg_replace("|/[^\/\.]+\.[^\/\.]+$|","",$match[0]);
$search = array( "|^http://".preg_quote($this->host)."|i",
"|^(?!http://)(\/)?(?!mailto:)|i",
"|/\./|",
"|/[^\/]+/\.\./|"
);
$replace = array( "",
$match."/",
"/",
"/"
);
$expandedLinks = preg_replace($search,$replace,$links);
 
return $expandedLinks;
}
 
/*======================================================================*\
Function: _httprequest
Purpose: go get the http data from the server
Input: $url the url to fetch
$fp the current open file pointer
$URI the full URI
$body body contents to send if any (POST)
Output:
\*======================================================================*/
function _httprequest($url,$fp,$URI,$http_method,$content_type="",$body="")
{
if($this->passcookies && $this->_redirectaddr)
$this->setcookies();
$URI_PARTS = parse_url($URI);
if(empty($url))
$url = "/";
$headers = $http_method." ".$url." ".$this->_httpversion."\r\n";
if(!empty($this->agent))
$headers .= "User-Agent: ".$this->agent."\r\n";
if(!empty($this->host) && !isset($this->rawheaders['Host']))
$headers .= "Host: ".$this->host."\r\n";
if(!empty($this->accept))
$headers .= "Accept: ".$this->accept."\r\n";
if($this->use_gzip) {
// make sure PHP was built with --with-zlib
// and we can handle gzipp'ed data
if ( function_exists('gzinflate') ) {
$headers .= "Accept-encoding: gzip\r\n";
}
else {
trigger_error(
"use_gzip is on, but PHP was built without zlib support.".
" Requesting file(s) without gzip encoding.",
E_USER_NOTICE);
}
}
if(!empty($this->referer))
$headers .= "Referer: ".$this->referer."\r\n";
if(!empty($this->cookies))
{
if(!is_array($this->cookies))
$this->cookies = (array)$this->cookies;
reset($this->cookies);
if ( count($this->cookies) > 0 ) {
$cookie_headers .= 'Cookie: ';
foreach ( $this->cookies as $cookieKey => $cookieVal ) {
$cookie_headers .= $cookieKey."=".urlencode($cookieVal)."; ";
}
$headers .= substr($cookie_headers,0,-2) . "\r\n";
}
}
if(!empty($this->rawheaders))
{
if(!is_array($this->rawheaders))
$this->rawheaders = (array)$this->rawheaders;
while(list($headerKey,$headerVal) = each($this->rawheaders))
$headers .= $headerKey.": ".$headerVal."\r\n";
}
if(!empty($content_type)) {
$headers .= "Content-type: $content_type";
if ($content_type == "multipart/form-data")
$headers .= "; boundary=".$this->_mime_boundary;
$headers .= "\r\n";
}
if(!empty($body))
$headers .= "Content-length: ".strlen($body)."\r\n";
if(!empty($this->user) || !empty($this->pass))
$headers .= "Authorization: BASIC ".base64_encode($this->user.":".$this->pass)."\r\n";
 
$headers .= "\r\n";
// set the read timeout if needed
if ($this->read_timeout > 0)
socket_set_timeout($fp, $this->read_timeout);
$this->timed_out = false;
fwrite($fp,$headers.$body,strlen($headers.$body));
$this->_redirectaddr = false;
unset($this->headers);
// content was returned gzip encoded?
$is_gzipped = false;
while($currentHeader = fgets($fp,$this->_maxlinelen))
{
if ($this->read_timeout > 0 && $this->_check_timeout($fp))
{
$this->status=-100;
return false;
}
// if($currentHeader == "\r\n")
if(preg_match("/^\r?\n$/", $currentHeader) )
break;
// if a header begins with Location: or URI:, set the redirect
if(preg_match("/^(Location:|URI:)/i",$currentHeader))
{
// get URL portion of the redirect
preg_match("/^(Location:|URI:)\s+(.*)/",chop($currentHeader),$matches);
// look for :// in the Location header to see if hostname is included
if(!preg_match("|\:\/\/|",$matches[2]))
{
// no host in the path, so prepend
$this->_redirectaddr = $URI_PARTS["scheme"]."://".$this->host.":".$this->port;
// eliminate double slash
if(!preg_match("|^/|",$matches[2]))
$this->_redirectaddr .= "/".$matches[2];
else
$this->_redirectaddr .= $matches[2];
}
else
$this->_redirectaddr = $matches[2];
}
if(preg_match("|^HTTP/|",$currentHeader))
{
if(preg_match("|^HTTP/[^\s]*\s(.*?)\s|",$currentHeader, $status))
{
$this->status= $status[1];
}
$this->response_code = $currentHeader;
}
if (preg_match("/Content-Encoding: gzip/", $currentHeader) ) {
$is_gzipped = true;
}
$this->headers[] = $currentHeader;
}
 
# $results = fread($fp, $this->maxlength);
$results = "";
while ( $data = fread($fp, $this->maxlength) ) {
$results .= $data;
if (
strlen($results) > $this->maxlength ) {
break;
}
}
// gunzip
if ( $is_gzipped ) {
// per http://www.php.net/manual/en/function.gzencode.php
$results = substr($results, 10);
$results = gzinflate($results);
}
if ($this->read_timeout > 0 && $this->_check_timeout($fp))
{
$this->status=-100;
return false;
}
// check if there is a a redirect meta tag
if(preg_match("'<meta[\s]*http-equiv[^>]*?content[\s]*=[\s]*[\"\']?\d+;[\s]+URL[\s]*=[\s]*([^\"\']*?)[\"\']?>'i",$results,$match))
{
$this->_redirectaddr = $this->_expandlinks($match[1],$URI);
}
 
// have we hit our frame depth and is there frame src to fetch?
if(($this->_framedepth < $this->maxframes) && preg_match_all("'<frame\s+.*src[\s]*=[\'\"]?([^\'\"\>]+)'i",$results,$match))
{
$this->results[] = $results;
for($x=0; $x<count($match[1]); $x++)
$this->_frameurls[] = $this->_expandlinks($match[1][$x],$URI_PARTS["scheme"]."://".$this->host);
}
// have we already fetched framed content?
elseif(is_array($this->results))
$this->results[] = $results;
// no framed content
else
$this->results = $results;
return true;
}
 
/*======================================================================*\
Function: _httpsrequest
Purpose: go get the https data from the server using curl
Input: $url the url to fetch
$URI the full URI
$body body contents to send if any (POST)
Output:
\*======================================================================*/
function _httpsrequest($url,$URI,$http_method,$content_type="",$body="")
{
if($this->passcookies && $this->_redirectaddr)
$this->setcookies();
 
$headers = array();
$URI_PARTS = parse_url($URI);
if(empty($url))
$url = "/";
// GET ... header not needed for curl
//$headers[] = $http_method." ".$url." ".$this->_httpversion;
if(!empty($this->agent))
$headers[] = "User-Agent: ".$this->agent;
if(!empty($this->host))
$headers[] = "Host: ".$this->host;
if(!empty($this->accept))
$headers[] = "Accept: ".$this->accept;
if(!empty($this->referer))
$headers[] = "Referer: ".$this->referer;
if(!empty($this->cookies))
{
if(!is_array($this->cookies))
$this->cookies = (array)$this->cookies;
reset($this->cookies);
if ( count($this->cookies) > 0 ) {
$cookie_str = 'Cookie: ';
foreach ( $this->cookies as $cookieKey => $cookieVal ) {
$cookie_str .= $cookieKey."=".urlencode($cookieVal)."; ";
}
$headers[] = substr($cookie_str,0,-2);
}
}
if(!empty($this->rawheaders))
{
if(!is_array($this->rawheaders))
$this->rawheaders = (array)$this->rawheaders;
while(list($headerKey,$headerVal) = each($this->rawheaders))
$headers[] = $headerKey.": ".$headerVal;
}
if(!empty($content_type)) {
if ($content_type == "multipart/form-data")
$headers[] = "Content-type: $content_type; boundary=".$this->_mime_boundary;
else
$headers[] = "Content-type: $content_type";
}
if(!empty($body))
$headers[] = "Content-length: ".strlen($body);
if(!empty($this->user) || !empty($this->pass))
$headers[] = "Authorization: BASIC ".base64_encode($this->user.":".$this->pass);
for($curr_header = 0; $curr_header < count($headers); $curr_header++) {
$cmdline_params .= " -H \"".$headers[$curr_header]."\"";
}
if(!empty($body))
$cmdline_params .= " -d \"$body\"";
if($this->read_timeout > 0)
$cmdline_params .= " -m ".$this->read_timeout;
$headerfile = uniqid(time());
# accept self-signed certs
$cmdline_params .= " -k";
exec($this->curl_path." -D \"/tmp/$headerfile\"".escapeshellcmd($cmdline_params)." ".escapeshellcmd($URI),$results,$return);
if($return)
{
$this->error = "Error: cURL could not retrieve the document, error $return.";
return false;
}
$results = implode("\r\n",$results);
$result_headers = file("/tmp/$headerfile");
$this->_redirectaddr = false;
unset($this->headers);
for($currentHeader = 0; $currentHeader < count($result_headers); $currentHeader++)
{
// if a header begins with Location: or URI:, set the redirect
if(preg_match("/^(Location: |URI: )/i",$result_headers[$currentHeader]))
{
// get URL portion of the redirect
preg_match("/^(Location: |URI:)(.*)/",chop($result_headers[$currentHeader]),$matches);
// look for :// in the Location header to see if hostname is included
if(!preg_match("|\:\/\/|",$matches[2]))
{
// no host in the path, so prepend
$this->_redirectaddr = $URI_PARTS["scheme"]."://".$this->host.":".$this->port;
// eliminate double slash
if(!preg_match("|^/|",$matches[2]))
$this->_redirectaddr .= "/".$matches[2];
else
$this->_redirectaddr .= $matches[2];
}
else
$this->_redirectaddr = $matches[2];
}
if(preg_match("|^HTTP/|",$result_headers[$currentHeader]))
{
$this->response_code = $result_headers[$currentHeader];
if(preg_match("|^HTTP/[^\s]*\s(.*?)\s|",$this->response_code, $match))
{
$this->status= $match[1];
}
}
$this->headers[] = $result_headers[$currentHeader];
}
 
// check if there is a a redirect meta tag
if(preg_match("'<meta[\s]*http-equiv[^>]*?content[\s]*=[\s]*[\"\']?\d+;[\s]+URL[\s]*=[\s]*([^\"\']*?)[\"\']?>'i",$results,$match))
{
$this->_redirectaddr = $this->_expandlinks($match[1],$URI);
}
 
// have we hit our frame depth and is there frame src to fetch?
if(($this->_framedepth < $this->maxframes) && preg_match_all("'<frame\s+.*src[\s]*=[\'\"]?([^\'\"\>]+)'i",$results,$match))
{
$this->results[] = $results;
for($x=0; $x<count($match[1]); $x++)
$this->_frameurls[] = $this->_expandlinks($match[1][$x],$URI_PARTS["scheme"]."://".$this->host);
}
// have we already fetched framed content?
elseif(is_array($this->results))
$this->results[] = $results;
// no framed content
else
$this->results = $results;
 
unlink("/tmp/$headerfile");
return true;
}
 
/*======================================================================*\
Function: setcookies()
Purpose: set cookies for a redirection
\*======================================================================*/
function setcookies()
{
for($x=0; $x<count($this->headers); $x++)
{
if(preg_match("/^set-cookie:[\s]+([^=]+)=([^;]+)/i", $this->headers[$x],$match))
$this->cookies[$match[1]] = $match[2];
}
}
 
/*======================================================================*\
Function: _check_timeout
Purpose: checks whether timeout has occurred
Input: $fp file pointer
\*======================================================================*/
 
function _check_timeout($fp)
{
if ($this->read_timeout > 0) {
$fp_status = socket_get_status($fp);
if ($fp_status["timed_out"]) {
$this->timed_out = true;
return true;
}
}
return false;
}
 
/*======================================================================*\
Function: _connect
Purpose: make a socket connection
Input: $fp file pointer
\*======================================================================*/
function _connect(&$fp)
{
if(!empty($this->proxy_host) && !empty($this->proxy_port))
{
$this->_isproxy = true;
$host = $this->proxy_host;
$port = $this->proxy_port;
}
else
{
$host = $this->host;
$port = $this->port;
}
$this->status = 0;
if($fp = fsockopen(
$host,
$port,
$errno,
$errstr,
$this->_fp_timeout
))
{
// socket connection succeeded
 
return true;
}
else
{
// socket connection failed
$this->status = $errno;
switch($errno)
{
case -3:
$this->error="socket creation failed (-3)";
case -4:
$this->error="dns lookup failure (-4)";
case -5:
$this->error="connection refused or timed out (-5)";
default:
$this->error="connection failed (".$errno.")";
}
return false;
}
}
/*======================================================================*\
Function: _disconnect
Purpose: disconnect a socket connection
Input: $fp file pointer
\*======================================================================*/
function _disconnect($fp)
{
return(fclose($fp));
}
 
/*======================================================================*\
Function: _prepare_post_body
Purpose: Prepare post body according to encoding type
Input: $formvars - form variables
$formfiles - form upload files
Output: post body
\*======================================================================*/
function _prepare_post_body($formvars, $formfiles)
{
settype($formvars, "array");
settype($formfiles, "array");
 
if (count($formvars) == 0 && count($formfiles) == 0)
return;
switch ($this->_submit_type) {
case "application/x-www-form-urlencoded":
reset($formvars);
while(list($key,$val) = each($formvars)) {
if (is_array($val) || is_object($val)) {
while (list($cur_key, $cur_val) = each($val)) {
$postdata .= urlencode($key)."[]=".urlencode($cur_val)."&";
}
} else
$postdata .= urlencode($key)."=".urlencode($val)."&";
}
break;
 
case "multipart/form-data":
$this->_mime_boundary = "Snoopy".md5(uniqid(microtime()));
reset($formvars);
while(list($key,$val) = each($formvars)) {
if (is_array($val) || is_object($val)) {
while (list($cur_key, $cur_val) = each($val)) {
$postdata .= "--".$this->_mime_boundary."\r\n";
$postdata .= "Content-Disposition: form-data; name=\"$key\[\]\"\r\n\r\n";
$postdata .= "$cur_val\r\n";
}
} else {
$postdata .= "--".$this->_mime_boundary."\r\n";
$postdata .= "Content-Disposition: form-data; name=\"$key\"\r\n\r\n";
$postdata .= "$val\r\n";
}
}
reset($formfiles);
while (list($field_name, $file_names) = each($formfiles)) {
settype($file_names, "array");
while (list(, $file_name) = each($file_names)) {
if (!is_readable($file_name)) continue;
 
$fp = fopen($file_name, "r");
$file_content = fread($fp, filesize($file_name));
fclose($fp);
$base_name = basename($file_name);
 
$postdata .= "--".$this->_mime_boundary."\r\n";
$postdata .= "Content-Disposition: form-data; name=\"$field_name\"; filename=\"$base_name\"\r\n\r\n";
$postdata .= "$file_content\r\n";
}
}
$postdata .= "--".$this->_mime_boundary."--\r\n";
break;
}
 
return $postdata;
}
}
 
?>
/tags/Racine_livraison_narmer/api/syndication_rss/magpierss/rss_fetch.inc
New file
0,0 → 1,460
<?php
/*
* Project: MagpieRSS: a simple RSS integration tool
* File: rss_fetch.inc, a simple functional interface
to fetching and parsing RSS files, via the
function fetch_rss()
* Author: Kellan Elliott-McCrea <kellan@protest.net>
* License: GPL
*
* The lastest version of MagpieRSS can be obtained from:
* http://magpierss.sourceforge.net
*
* For questions, help, comments, discussion, etc., please join the
* Magpie mailing list:
* magpierss-general@lists.sourceforge.net
*
*/
// Setup MAGPIE_DIR for use on hosts that don't include
// the current path in include_path.
// with thanks to rajiv and smarty
if (!defined('DIR_SEP')) {
define('DIR_SEP', DIRECTORY_SEPARATOR);
}
 
if (!defined('MAGPIE_DIR')) {
define('MAGPIE_DIR', dirname(__FILE__) . DIR_SEP);
}
 
define('MAGPIE_CACHE_ON', 0);
 
require_once( MAGPIE_DIR . 'rss_parse.inc' );
require_once( MAGPIE_DIR . 'rss_cache.inc' );
 
// for including 3rd party libraries
define('MAGPIE_EXTLIB', MAGPIE_DIR . 'extlib' . DIR_SEP);
require_once( MAGPIE_EXTLIB . 'Snoopy.class.inc');
 
 
/*
* CONSTANTS - redefine these in your script to change the
* behaviour of fetch_rss() currently, most options effect the cache
*
* MAGPIE_CACHE_ON - Should Magpie cache parsed RSS objects?
* For me a built in cache was essential to creating a "PHP-like"
* feel to Magpie, see rss_cache.inc for rationale
*
*
* MAGPIE_CACHE_DIR - Where should Magpie cache parsed RSS objects?
* This should be a location that the webserver can write to. If this
* directory does not already exist Mapie will try to be smart and create
* it. This will often fail for permissions reasons.
*
*
* MAGPIE_CACHE_AGE - How long to store cached RSS objects? In seconds.
*
*
* MAGPIE_CACHE_FRESH_ONLY - If remote fetch fails, throw error
* instead of returning stale object?
*
* MAGPIE_DEBUG - Display debugging notices?
*
*/
 
 
/*=======================================================================*\
Function: fetch_rss:
Purpose: return RSS object for the give url
maintain the cache
Input: url of RSS file
Output: parsed RSS object (see rss_parse.inc)
 
NOTES ON CACHEING:
If caching is on (MAGPIE_CACHE_ON) fetch_rss will first check the cache.
NOTES ON RETRIEVING REMOTE FILES:
If conditional gets are on (MAGPIE_CONDITIONAL_GET_ON) fetch_rss will
return a cached object, and touch the cache object upon recieving a
304.
NOTES ON FAILED REQUESTS:
If there is an HTTP error while fetching an RSS object, the cached
version will be return, if it exists (and if MAGPIE_CACHE_FRESH_ONLY is off)
\*=======================================================================*/
 
define('MAGPIE_VERSION', '0.72');
 
$MAGPIE_ERROR = "";
 
function fetch_rss ($url) {
// initialize constants
init();
if ( !isset($url) ) {
error("fetch_rss called without a url");
return false;
}
// if cache is disabled
if ( !MAGPIE_CACHE_ON ) {
// fetch file, and parse it
$resp = _fetch_remote_file( $url );
if ( is_success( $resp->status ) ) {
return _response_to_rss( $resp );
}
else {
error("Failed to fetch $url and cache is off");
return false;
}
}
// else cache is ON
else {
// Flow
// 1. check cache
// 2. if there is a hit, make sure its fresh
// 3. if cached obj fails freshness check, fetch remote
// 4. if remote fails, return stale object, or error
$cache = new RSSCache( MAGPIE_CACHE_DIR, MAGPIE_CACHE_AGE );
if (MAGPIE_DEBUG and $cache->ERROR) {
debug($cache->ERROR, E_USER_WARNING);
}
$cache_status = 0; // response of check_cache
$request_headers = array(); // HTTP headers to send with fetch
$rss = 0; // parsed RSS object
$errormsg = 0; // errors, if any
// store parsed XML by desired output encoding
// as character munging happens at parse time
$cache_key = $url . MAGPIE_OUTPUT_ENCODING;
if (!$cache->ERROR) {
// return cache HIT, MISS, or STALE
$cache_status = $cache->check_cache( $cache_key);
}
// if object cached, and cache is fresh, return cached obj
if ( $cache_status == 'HIT' ) {
$rss = $cache->get( $cache_key );
if ( isset($rss) and $rss ) {
// should be cache age
$rss->from_cache = 1;
if ( MAGPIE_DEBUG > 1) {
debug("MagpieRSS: Cache HIT", E_USER_NOTICE);
}
return $rss;
}
}
// else attempt a conditional get
// setup headers
if ( $cache_status == 'STALE' ) {
$rss = $cache->get( $cache_key );
if ( $rss and $rss->etag and $rss->last_modified ) {
$request_headers['If-None-Match'] = $rss->etag;
$request_headers['If-Last-Modified'] = $rss->last_modified;
}
}
$resp = _fetch_remote_file( $url, $request_headers );
if (isset($resp) and $resp) {
if ($resp->status == '304' ) {
// we have the most current copy
if ( MAGPIE_DEBUG > 1) {
debug("Got 304 for $url");
}
// reset cache on 304 (at minutillo insistent prodding)
$cache->set($cache_key, $rss);
return $rss;
}
elseif ( is_success( $resp->status ) ) {
$rss = _response_to_rss( $resp );
if ( $rss ) {
if (MAGPIE_DEBUG > 1) {
debug("Fetch successful");
}
// add object to cache
$cache->set( $cache_key, $rss );
return $rss;
}
}
else {
$errormsg = "Failed to fetch $url ";
if ( $resp->status == '-100' ) {
$errormsg .= "(Request timed out after " . MAGPIE_FETCH_TIME_OUT . " seconds)";
}
elseif ( $resp->error ) {
# compensate for Snoopy's annoying habbit to tacking
# on '\n'
$http_error = substr($resp->error, 0, -2);
$errormsg .= "(HTTP Error: $http_error)";
}
else {
$errormsg .= "(HTTP Response: " . $resp->response_code .')';
}
}
}
else {
$errormsg = "Unable to retrieve RSS file for unknown reasons.";
}
// else fetch failed
// attempt to return cached object
if ($rss) {
if ( MAGPIE_DEBUG ) {
debug("Returning STALE object for $url");
}
return $rss;
}
// else we totally failed
error( $errormsg );
return false;
} // end if ( !MAGPIE_CACHE_ON ) {
} // end fetch_rss()
 
/*=======================================================================*\
Function: error
Purpose: set MAGPIE_ERROR, and trigger error
\*=======================================================================*/
 
function error ($errormsg, $lvl=E_USER_WARNING) {
global $MAGPIE_ERROR;
// append PHP's error message if track_errors enabled
if ( isset($php_errormsg) ) {
$errormsg .= " ($php_errormsg)";
}
if ( $errormsg ) {
$errormsg = "MagpieRSS: $errormsg";
$MAGPIE_ERROR = $errormsg;
trigger_error( $errormsg, $lvl);
}
}
 
function debug ($debugmsg, $lvl=E_USER_NOTICE) {
trigger_error("MagpieRSS [debug] $debugmsg", $lvl);
}
/*=======================================================================*\
Function: magpie_error
Purpose: accessor for the magpie error variable
\*=======================================================================*/
function magpie_error ($errormsg="") {
global $MAGPIE_ERROR;
if ( isset($errormsg) and $errormsg ) {
$MAGPIE_ERROR = $errormsg;
}
return $MAGPIE_ERROR;
}
 
/*=======================================================================*\
Function: _fetch_remote_file
Purpose: retrieve an arbitrary remote file
Input: url of the remote file
headers to send along with the request (optional)
Output: an HTTP response object (see Snoopy.class.inc)
\*=======================================================================*/
function _fetch_remote_file ($url, $headers = "" ) {
// Snoopy is an HTTP client in PHP
$client = new Snoopy();
$client->agent = MAGPIE_USER_AGENT;
$client->read_timeout = MAGPIE_FETCH_TIME_OUT;
$client->use_gzip = MAGPIE_USE_GZIP;
if (is_array($headers) ) {
$client->rawheaders = $headers;
}
@$client->fetch($url);
return $client;
 
}
 
/*=======================================================================*\
Function: _response_to_rss
Purpose: parse an HTTP response object into an RSS object
Input: an HTTP response object (see Snoopy)
Output: parsed RSS object (see rss_parse)
\*=======================================================================*/
function _response_to_rss ($resp) {
$rss = new MagpieRSS( $resp->results, MAGPIE_OUTPUT_ENCODING, MAGPIE_INPUT_ENCODING, MAGPIE_DETECT_ENCODING );
// if RSS parsed successfully
if ( $rss and !$rss->ERROR) {
// find Etag, and Last-Modified
foreach($resp->headers as $h) {
// 2003-03-02 - Nicola Asuni (www.tecnick.com) - fixed bug "Undefined offset: 1"
if (strpos($h, ": ")) {
list($field, $val) = explode(": ", $h, 2);
}
else {
$field = $h;
$val = "";
}
if ( $field == 'ETag' ) {
$rss->etag = $val;
}
if ( $field == 'Last-Modified' ) {
$rss->last_modified = $val;
}
}
return $rss;
} // else construct error message
else {
$errormsg = "Failed to parse RSS file.";
if ($rss) {
$errormsg .= " (" . $rss->ERROR . ")";
}
error($errormsg);
return false;
} // end if ($rss and !$rss->error)
}
 
/*=======================================================================*\
Function: init
Purpose: setup constants with default values
check for user overrides
\*=======================================================================*/
function init () {
if ( defined('MAGPIE_INITALIZED') ) {
return;
}
else {
define('MAGPIE_INITALIZED', true);
}
if ( !defined('MAGPIE_CACHE_ON') ) {
define('MAGPIE_CACHE_ON', true);
}
 
if ( !defined('MAGPIE_CACHE_DIR') ) {
define('MAGPIE_CACHE_DIR', './cache');
}
 
if ( !defined('MAGPIE_CACHE_AGE') ) {
define('MAGPIE_CACHE_AGE', 60*60); // one hour
}
 
if ( !defined('MAGPIE_CACHE_FRESH_ONLY') ) {
define('MAGPIE_CACHE_FRESH_ONLY', false);
}
 
if ( !defined('MAGPIE_OUTPUT_ENCODING') ) {
define('MAGPIE_OUTPUT_ENCODING', 'ISO-8859-1');
}
if ( !defined('MAGPIE_INPUT_ENCODING') ) {
define('MAGPIE_INPUT_ENCODING', null);
}
if ( !defined('MAGPIE_DETECT_ENCODING') ) {
define('MAGPIE_DETECT_ENCODING', true);
}
if ( !defined('MAGPIE_DEBUG') ) {
define('MAGPIE_DEBUG', 0);
}
if ( !defined('MAGPIE_USER_AGENT') ) {
$ua = 'MagpieRSS/'. MAGPIE_VERSION . ' (+http://magpierss.sf.net';
if ( MAGPIE_CACHE_ON ) {
$ua = $ua . ')';
}
else {
$ua = $ua . '; No cache)';
}
define('MAGPIE_USER_AGENT', $ua);
}
if ( !defined('MAGPIE_FETCH_TIME_OUT') ) {
define('MAGPIE_FETCH_TIME_OUT', 5); // 5 second timeout
}
// use gzip encoding to fetch rss files if supported?
if ( !defined('MAGPIE_USE_GZIP') ) {
define('MAGPIE_USE_GZIP', true);
}
}
 
// NOTE: the following code should really be in Snoopy, or at least
// somewhere other then rss_fetch!
 
/*=======================================================================*\
HTTP STATUS CODE PREDICATES
These functions attempt to classify an HTTP status code
based on RFC 2616 and RFC 2518.
All of them take an HTTP status code as input, and return true or false
 
All this code is adapted from LWP's HTTP::Status.
\*=======================================================================*/
 
 
/*=======================================================================*\
Function: is_info
Purpose: return true if Informational status code
\*=======================================================================*/
function is_info ($sc) {
return $sc >= 100 && $sc < 200;
}
 
/*=======================================================================*\
Function: is_success
Purpose: return true if Successful status code
\*=======================================================================*/
function is_success ($sc) {
return $sc >= 200 && $sc < 300;
}
 
/*=======================================================================*\
Function: is_redirect
Purpose: return true if Redirection status code
\*=======================================================================*/
function is_redirect ($sc) {
return $sc >= 300 && $sc < 400;
}
 
/*=======================================================================*\
Function: is_error
Purpose: return true if Error status code
\*=======================================================================*/
function is_error ($sc) {
return $sc >= 400 && $sc < 600;
}
 
/*=======================================================================*\
Function: is_client_error
Purpose: return true if Error status code, and its a client error
\*=======================================================================*/
function is_client_error ($sc) {
return $sc >= 400 && $sc < 500;
}
 
/*=======================================================================*\
Function: is_client_error
Purpose: return true if Error status code, and its a server error
\*=======================================================================*/
function is_server_error ($sc) {
return $sc >= 500 && $sc < 600;
}
 
?>
/tags/Racine_livraison_narmer/api/syndication_rss/magpierss/rss_parse.inc
New file
0,0 → 1,605
<?php
 
/**
* Project: MagpieRSS: a simple RSS integration tool
* File: rss_parse.inc - parse an RSS or Atom feed
* return as a simple object.
*
* Handles RSS 0.9x, RSS 2.0, RSS 1.0, and Atom 0.3
*
* The lastest version of MagpieRSS can be obtained from:
* http://magpierss.sourceforge.net
*
* For questions, help, comments, discussion, etc., please join the
* Magpie mailing list:
* magpierss-general@lists.sourceforge.net
*
* @author Kellan Elliott-McCrea <kellan@protest.net>
* @version 0.7a
* @license GPL
*
*/
 
define('RSS', 'RSS');
define('ATOM', 'Atom');
 
require_once (MAGPIE_DIR . 'rss_utils.inc');
 
/**
* Hybrid parser, and object, takes RSS as a string and returns a simple object.
*
* see: rss_fetch.inc for a simpler interface with integrated caching support
*
*/
class MagpieRSS {
var $parser;
var $current_item = array(); // item currently being parsed
var $items = array(); // collection of parsed items
var $channel = array(); // hash of channel fields
var $textinput = array();
var $image = array();
var $feed_type;
var $feed_version;
var $encoding = ''; // output encoding of parsed rss
var $_source_encoding = ''; // only set if we have to parse xml prolog
var $ERROR = "";
var $WARNING = "";
// define some constants
var $_CONTENT_CONSTRUCTS = array('content', 'summary', 'info', 'title', 'tagline', 'copyright');
var $_KNOWN_ENCODINGS = array('UTF-8', 'US-ASCII', 'ISO-8859-1');
 
// parser variables, useless if you're not a parser, treat as private
var $stack = array(); // parser stack
var $inchannel = false;
var $initem = false;
var $incontent = false; // if in Atom <content mode="xml"> field
var $intextinput = false;
var $inimage = false;
var $current_namespace = false;
 
/**
* Set up XML parser, parse source, and return populated RSS object..
*
* @param string $source string containing the RSS to be parsed
*
* NOTE: Probably a good idea to leave the encoding options alone unless
* you know what you're doing as PHP's character set support is
* a little weird.
*
* NOTE: A lot of this is unnecessary but harmless with PHP5
*
*
* @param string $output_encoding output the parsed RSS in this character
* set defaults to ISO-8859-1 as this is PHP's
* default.
*
* NOTE: might be changed to UTF-8 in future
* versions.
*
* @param string $input_encoding the character set of the incoming RSS source.
* Leave blank and Magpie will try to figure it
* out.
*
*
* @param bool $detect_encoding if false Magpie won't attempt to detect
* source encoding. (caveat emptor)
*
*/
function MagpieRSS ($source, $output_encoding='ISO-8859-1',
$input_encoding=null, $detect_encoding=true)
{
# if PHP xml isn't compiled in, die
#
if (!function_exists('xml_parser_create')) {
$this->error( "Failed to load PHP's XML Extension. " .
"http://www.php.net/manual/en/ref.xml.php",
E_USER_ERROR );
}
list($parser, $source) = $this->create_parser($source,
$output_encoding, $input_encoding, $detect_encoding);
if (!is_resource($parser)) {
$this->error( "Failed to create an instance of PHP's XML parser. " .
"http://www.php.net/manual/en/ref.xml.php",
E_USER_ERROR );
}
 
$this->parser = $parser;
# pass in parser, and a reference to this object
# setup handlers
#
xml_set_object( $this->parser, $this );
xml_set_element_handler($this->parser,
'feed_start_element', 'feed_end_element' );
xml_set_character_data_handler( $this->parser, 'feed_cdata' );
$status = xml_parse( $this->parser, $source );
if (! $status ) {
$errorcode = xml_get_error_code( $this->parser );
if ( $errorcode != XML_ERROR_NONE ) {
$xml_error = xml_error_string( $errorcode );
$error_line = xml_get_current_line_number($this->parser);
$error_col = xml_get_current_column_number($this->parser);
$errormsg = "$xml_error at line $error_line, column $error_col";
 
$this->error( $errormsg );
}
}
xml_parser_free( $this->parser );
 
$this->normalize();
}
function feed_start_element($p, $element, &$attrs) {
$el = $element = strtolower($element);
$attrs = array_change_key_case($attrs, CASE_LOWER);
// check for a namespace, and split if found
$ns = false;
if ( strpos( $element, ':' ) ) {
list($ns, $el) = split( ':', $element, 2);
}
if ( $ns and $ns != 'rdf' ) {
$this->current_namespace = $ns;
}
# if feed type isn't set, then this is first element of feed
# identify feed from root element
#
if (!isset($this->feed_type) ) {
if ( $el == 'rdf' ) {
$this->feed_type = RSS;
$this->feed_version = '1.0';
}
elseif ( $el == 'rss' ) {
$this->feed_type = RSS;
$this->feed_version = $attrs['version'];
}
elseif ( $el == 'feed' ) {
$this->feed_type = ATOM;
$this->feed_version = $attrs['version'];
$this->inchannel = true;
}
return;
}
if ( $el == 'channel' )
{
$this->inchannel = true;
}
elseif ($el == 'item' or $el == 'entry' )
{
$this->initem = true;
if ( isset($attrs['rdf:about']) ) {
$this->current_item['about'] = $attrs['rdf:about'];
}
}
// if we're in the default namespace of an RSS feed,
// record textinput or image fields
elseif (
$this->feed_type == RSS and
$this->current_namespace == '' and
$el == 'textinput' )
{
$this->intextinput = true;
}
elseif (
$this->feed_type == RSS and
$this->current_namespace == '' and
$el == 'image' )
{
$this->inimage = true;
}
# handle atom content constructs
elseif ( $this->feed_type == ATOM and in_array($el, $this->_CONTENT_CONSTRUCTS) )
{
// avoid clashing w/ RSS mod_content
if ($el == 'content' ) {
$el = 'atom_content';
}
$this->incontent = $el;
}
// if inside an Atom content construct (e.g. content or summary) field treat tags as text
elseif ($this->feed_type == ATOM and $this->incontent )
{
// if tags are inlined, then flatten
$attrs_str = join(' ',
array_map('map_attrs',
array_keys($attrs),
array_values($attrs) ) );
$this->append_content( "<$element $attrs_str>" );
array_unshift( $this->stack, $el );
}
// Atom support many links per containging element.
// Magpie treats link elements of type rel='alternate'
// as being equivalent to RSS's simple link element.
//
elseif ($this->feed_type == ATOM and $el == 'link' )
{
if ( isset($attrs['rel']) and $attrs['rel'] == 'alternate' )
{
$link_el = 'link';
}
else {
$link_el = 'link_' . $attrs['rel'];
}
$this->append($link_el, $attrs['href']);
}
// set stack[0] to current element
else {
array_unshift($this->stack, $el);
}
}
 
function feed_cdata ($p, $text) {
if ($this->feed_type == ATOM and $this->incontent)
{
$this->append_content( $text );
}
else {
$current_el = join('_', array_reverse($this->stack));
$this->append($current_el, $text);
}
}
function feed_end_element ($p, $el) {
$el = strtolower($el);
if ( $el == 'item' or $el == 'entry' )
{
$this->items[] = $this->current_item;
$this->current_item = array();
$this->initem = false;
}
elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'textinput' )
{
$this->intextinput = false;
}
elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'image' )
{
$this->inimage = false;
}
elseif ($this->feed_type == ATOM and in_array($el, $this->_CONTENT_CONSTRUCTS) )
{
$this->incontent = false;
}
elseif ($el == 'channel' or $el == 'feed' )
{
$this->inchannel = false;
}
elseif ($this->feed_type == ATOM and $this->incontent ) {
// balance tags properly
// note: i don't think this is actually neccessary
if ( $this->stack[0] == $el )
{
$this->append_content("</$el>");
}
else {
$this->append_content("<$el />");
}
 
array_shift( $this->stack );
}
else {
array_shift( $this->stack );
}
$this->current_namespace = false;
}
function concat (&$str1, $str2="") {
if (!isset($str1) ) {
$str1="";
}
$str1 .= $str2;
}
function append_content($text) {
if ( $this->initem ) {
$this->concat( $this->current_item[ $this->incontent ], $text );
}
elseif ( $this->inchannel ) {
$this->concat( $this->channel[ $this->incontent ], $text );
}
}
// smart append - field and namespace aware
function append($el, $text) {
if (!$el) {
return;
}
if ( $this->current_namespace )
{
if ( $this->initem ) {
$this->concat(
$this->current_item[ $this->current_namespace ][ $el ], $text);
}
elseif ($this->inchannel) {
$this->concat(
$this->channel[ $this->current_namespace][ $el ], $text );
}
elseif ($this->intextinput) {
$this->concat(
$this->textinput[ $this->current_namespace][ $el ], $text );
}
elseif ($this->inimage) {
$this->concat(
$this->image[ $this->current_namespace ][ $el ], $text );
}
}
else {
if ( $this->initem ) {
$this->concat(
$this->current_item[ $el ], $text);
}
elseif ($this->intextinput) {
$this->concat(
$this->textinput[ $el ], $text );
}
elseif ($this->inimage) {
$this->concat(
$this->image[ $el ], $text );
}
elseif ($this->inchannel) {
$this->concat(
$this->channel[ $el ], $text );
}
}
}
function normalize () {
// if atom populate rss fields
if ( $this->is_atom() ) {
$this->channel['description'] = $this->channel['tagline'];
for ( $i = 0; $i < count($this->items); $i++) {
$item = $this->items[$i];
if ( isset($item['summary']) )
$item['description'] = $item['summary'];
if ( isset($item['atom_content']))
$item['content']['encoded'] = $item['atom_content'];
$atom_date = (isset($item['issued']) ) ? $item['issued'] : $item['modified'];
if ( $atom_date ) {
$epoch = @parse_w3cdtf($atom_date);
if ($epoch and $epoch > 0) {
$item['date_timestamp'] = $epoch;
}
}
$this->items[$i] = $item;
}
}
elseif ( $this->is_rss() ) {
$this->channel['tagline'] = $this->channel['description'];
for ( $i = 0; $i < count($this->items); $i++) {
$item = $this->items[$i];
if ( isset($item['description']))
$item['summary'] = $item['description'];
if ( isset($item['content']['encoded'] ) )
$item['atom_content'] = $item['content']['encoded'];
if ( $this->is_rss() == '1.0' and isset($item['dc']['date']) ) {
$epoch = @parse_w3cdtf($item['dc']['date']);
if ($epoch and $epoch > 0) {
$item['date_timestamp'] = $epoch;
}
}
elseif ( isset($item['pubdate']) ) {
$epoch = @strtotime($item['pubdate']);
if ($epoch > 0) {
$item['date_timestamp'] = $epoch;
}
}
$this->items[$i] = $item;
}
}
}
function is_rss () {
if ( $this->feed_type == RSS ) {
return $this->feed_version;
}
else {
return false;
}
}
function is_atom() {
if ( $this->feed_type == ATOM ) {
return $this->feed_version;
}
else {
return false;
}
}
 
/**
* return XML parser, and possibly re-encoded source
*
*/
function create_parser($source, $out_enc, $in_enc, $detect) {
if ( substr(phpversion(),0,1) == 5) {
$parser = $this->php5_create_parser($in_enc, $detect);
}
else {
list($parser, $source) = $this->php4_create_parser($source, $in_enc, $detect);
}
if ($out_enc) {
$this->encoding = $out_enc;
xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, $out_enc);
}
return array($parser, $source);
}
/**
* Instantiate an XML parser under PHP5
*
* PHP5 will do a fine job of detecting input encoding
* if passed an empty string as the encoding.
*
* All hail libxml2!
*
*/
function php5_create_parser($in_enc, $detect) {
// by default php5 does a fine job of detecting input encodings
if(!$detect && $in_enc) {
return xml_parser_create($in_enc);
}
else {
return xml_parser_create('');
}
}
/**
* Instaniate an XML parser under PHP4
*
* Unfortunately PHP4's support for character encodings
* and especially XML and character encodings sucks. As
* long as the documents you parse only contain characters
* from the ISO-8859-1 character set (a superset of ASCII,
* and a subset of UTF-8) you're fine. However once you
* step out of that comfy little world things get mad, bad,
* and dangerous to know.
*
* The following code is based on SJM's work with FoF
* @see http://minutillo.com/steve/weblog/2004/6/17/php-xml-and-character-encodings-a-tale-of-sadness-rage-and-data-loss
*
*/
function php4_create_parser($source, $in_enc, $detect) {
if ( !$detect ) {
return array(xml_parser_create($in_enc), $source);
}
if (!$in_enc) {
if (preg_match('/<?xml.*encoding=[\'"](.*?)[\'"].*?>/m', $source, $m)) {
$in_enc = strtoupper($m[1]);
$this->source_encoding = $in_enc;
}
else {
$in_enc = 'UTF-8';
}
}
if ($this->known_encoding($in_enc)) {
return array(xml_parser_create($in_enc), $source);
}
// the dectected encoding is not one of the simple encodings PHP knows
// attempt to use the iconv extension to
// cast the XML to a known encoding
// @see http://php.net/iconv
if (function_exists('iconv')) {
$encoded_source = iconv($in_enc,'UTF-8', $source);
if ($encoded_source) {
return array(xml_parser_create('UTF-8'), $encoded_source);
}
}
// iconv didn't work, try mb_convert_encoding
// @see http://php.net/mbstring
if(function_exists('mb_convert_encoding')) {
$encoded_source = mb_convert_encoding($source, 'UTF-8', $in_enc );
if ($encoded_source) {
return array(xml_parser_create('UTF-8'), $encoded_source);
}
}
// else
$this->error("Feed is in an unsupported character encoding. ($in_enc) " .
"You may see strange artifacts, and mangled characters.",
E_USER_NOTICE);
return array(xml_parser_create(), $source);
}
function known_encoding($enc) {
$enc = strtoupper($enc);
if ( in_array($enc, $this->_KNOWN_ENCODINGS) ) {
return $enc;
}
else {
return false;
}
}
 
function error ($errormsg, $lvl=E_USER_WARNING) {
// append PHP's error message if track_errors enabled
if ( isset($php_errormsg) ) {
$errormsg .= " ($php_errormsg)";
}
if ( MAGPIE_DEBUG ) {
trigger_error( $errormsg, $lvl);
}
else {
error_log( $errormsg, 0);
}
$notices = E_USER_NOTICE|E_NOTICE;
if ( $lvl&$notices ) {
$this->WARNING = $errormsg;
} else {
$this->ERROR = $errormsg;
}
}
} // end class RSS
 
function map_attrs($k, $v) {
return "$k=\"$v\"";
}
 
// patch to support medieval versions of PHP4.1.x,
// courtesy, Ryan Currie, ryan@digibliss.com
 
if (!function_exists('array_change_key_case')) {
define("CASE_UPPER",1);
define("CASE_LOWER",0);
 
 
function array_change_key_case($array,$case=CASE_LOWER) {
if ($case=CASE_LOWER) $cmd=strtolower;
elseif ($case=CASE_UPPER) $cmd=strtoupper;
foreach($array as $key=>$value) {
$output[$cmd($key)]=$value;
}
return $output;
}
 
}
 
?>
/tags/Racine_livraison_narmer/api/js/domtooltip/HOWTO.html
New file
0,0 → 1,160
<html>
<head>
<title>DOM Tooltip Library :: HOWTO</title>
<style type="text/css">
body
{
margin: 0;
padding: 10px;
font-size: .85em;
line-height: 1.3em;
}
dl
{
margin-left: 10px;
}
dt
{
font-weight: bold;
}
</style>
</head>
<body>
<h1>DOM Tooltip Library HOWTO</h1>
<h3>Usage</h3>
<p>This library offers a variety of ways to enable custom tooltips. The standard way of creating a tooltip is to add the domTT_activate() call to one of the event handlers of the target element. Tips can also be created programatically, which can be used for popping up inline windows. Another option is to call the method domTT_replaceTitles(), which replaces all elements containing the class 'tooltip' and the title attribute with a custom tooltip on mouseover.</p>
<h3>Examples</h3>
<pre>&lt;a href="index.html" onmouseover="domTT_activate(this, event, 'content', 'My first tooltip', 'trail', true);"&gt;sample link&lt;/a&gt;</pre>
<h3>Options</h3>
<p>The only required option to create a tooltip is the 'content' option. Most of the options below have a default value which is held in a global variable. If the option is specified, it overrides the default. The options are summarized below.</p>
<dl>
<dt>caption [text|xhtml|DOM Node]</dt>
<dd>An auto-generated caption will be created if this text is present. <strong>Set this to <code>false</code> when creating a sticky tip to prevent the automatic caption with close link.</strong></dd>
 
<dt>content [text|xhtml|DOM Node|function] (required)</dt>
<dd>The main content of the tip, which may be XHTML text. Note that when using a function, it is only called when the tip is activated, so it is necessary to use 'closeMethod' of 'destroy' to redraw each time.</dd>
 
<dt>clearMouse [boolean]</dt>
<dd>This option flags whether the tip should attempt to avoid the mouse when the direction is south.</dd>
 
<dt>closeAction ['hide'|'destroy']</dt>
<dd>Determines if the tip should be destroyed (removed from DOM) or just hidden when deactivated. (If fading is used, hiding is forced)</dd>
 
<dt>closeLink [text|xhtml|DOM Node]</dt>
<dd>The text that should be used for the auto-generated close link used for sticky tips.</dd>
 
<dt>delay [ms]</dt>
<dd>Time in milliseconds before the tip appears.</dd>
 
<dt>direction ['southeast'|'southwest'|'northeast'|'northwest'|'north'|'south']</dt>
<dd>The position of the tip relative to the mouse.</dd>
 
<dt>draggable [boolean]</dt>
<dd>Determines of the sticky tooltip can be dragged.</dd>
 
<dt>fade ['in'|'out'|'neither'|'both']</dt>
<dd>Sets the alpha effect when the tip is created or destroyed.</dd>
 
<dt>fadeMax [0-100]</dt>
<dd>Sets the maximum alpha that should be used for the alpha effect. (Minimum is always 0, or invisible)</dd>
 
<dt>grid [px]</dt>
<dd>Snaps the trailing to a grid, so that the tip only moves after a set number of pixels.</dd>
 
<dt>id [string]</dt>
<dd>The XML id that should be assigned to the tip. Using this setting allows for external manipulation of the tip.</dd>
 
<dt>inframe [boolean]</dt>
<dd>Hints that the tooltip is inside an iframe, so that the tip can be manipulated from the parent frame.</dd>
 
<dt>lifetime [ms]</dt>
<dd>The duration of time before the tooltip is automatically terminated, as long as it is still activated.</dd>
 
<dt>offsetX [px]</dt>
<dd>The left-to-right offset from the event where the tip should be placed.</dd>
 
<dt>offsetY [px]</dt>
<dd>The top-to-bottom offset from the event where the tip should be placed.</dd>
 
<dt>parent [DOM Node]</dt>
<dd>The parent node on which the tip should be appended. Usually used for tips with a relative position.</dd>
 
<dt>position ['absolute'|'relative'|'fixed']</dt>
<dd>The style position of the tip. (In most cases, the position is 'absolute')</dd>
 
<dt>predefined [string]</dt>
<dd>A reference to a previously defined tooltip using domTT_addPredefined()</dd>
 
<dt>statusText [string]</dt>
<dd>Sets the text to be used in the statusbar when the tip is activated. <strong>If used with mouseover, it is necessary to wrap the domTT_activate() call in 'return domTT_true()'.</strong></dd>
 
<dt>styleClass [string]</dt>
<dd>The class that will be assigned to the tip. The contents of the tip is assigned the class 'content' and the caption of the tip is assigned the class 'caption'.</dd>
 
<dt>type ['greasy'|'sticky'|'velcro']</dt>
<dd>Sets the fate of the tip. A greasy tip disappears when a mouse out occurs on owner. A sticky tip stays active until explicitly destroyed (a caption is also forced). A velcro tip disappears when a mouse out occurs on the tip itself.</dd>
 
<dt>trail [true|false|'x'|'y']</dt>
<dd>On which axis the tip should be updated when the mouse moves. A value of true updates on both axes.</dd>
 
<dt>lazy [boolean]</dt>
<dd>Whether or not to enable a delay when updating the mouse position of a trailing tip (drunk tooltip).</dd>
 
<dt>width [px]</dt>
<dd>A manual width for the tip.</dd>
 
<dt>maxWidth [px]</dt>
<dd>A manual maximum width for the tip. (In Firefox, this is controlled by the max-width style of the element)</dd>
 
<dt>x [px]</dt>
<dd>The absolute x position to be used for the tip location. This can be a calculated value, such as 'this.offsetLeft + 5'.</dd>
 
<dt>y [px]</dt>
<dd>The absolute y position to be used for the tip location. This can be a calculated value, such as 'this.offsetTop + 5'.</dd>
 
</dl>
<h3>Function Reference</h3>
<p>The DOM tooltip library offers a handful of functions, prefixed with 'domTT_', to aid in manipulating the tooltips. The following is a reference of these function calls.</p>
<dl>
<dt>domTT_activate()</dt>
<dd>The primary method for activating a tooltip, typically placed in an event handler such as <code>onmouseover</code>. The first two arguments must always be <code>this</code> and <code>event</code>, respectively. These two variable capture the environment on which to act. The rest of the arguments alternate between option name and option value from the list above.</dd>
<dt>domTT_addPredefined()</dt>
<dd>For times when tooltip creation should be seperated from activation, this method can be used to prepare the tooltips. The first argument is a unique name for the configuration, and the rest of the arguments alternate between option name and option value from the list of options above. A preconfigured tip can be reused any number of times, and the activate call can override options in the predefined configuration. A typical activate call for a predefined tooltip looks like: <code>domTT_activate(this, event, 'predefined', 'mytip')</code></dd>
<dt>domTT_close()</dt>
<dd>A more flexible alternative to <code>domTT_deactivate()</code>, this function assists in immediately closing the tooltip. The argument can either be a child object of the tip, the tip id or the owner id. From within a tooltip, the call is typically: <code>domTT_close(this)</code></dd>
<dt>domTT_deactivate()</dt>
<dd>In most cases, this method is automatically registered on the target element when <code>domTT_activate()</code> is first called. However, it may be necessary to programmatically close a tooltip. In this case, this method can be used. It requires one parameter, which can be the ID of the tooltip, the ID of the target or the target object itself.</dd>
<dt>domTT_mouseout()</dt>
<dd>When a tooltip is activate, it automatically registers a mouseout handler to close to tooltip unless one already exists. If you intend to have a custom mouseout handler on the target that activates the tip, you <strong><u>must</u></strong> make a <strong><u>call</u></strong> to <strong><code>domTT_mouseout(this, event)</code></strong> from within your mouseout handler. Otherwise, the tooltip will never be deactivated!</dd>
<dt>domTT_update()</dt>
<dd>If you find that you need to update the contents or caption of a tooltip after it has been created, you will find this function convenient. You must specify a tooltip id, target id or target node and new text or XHTML content and it will be used to replace the content of the existing tooltip. The third parameter allows you to specify either 'content' or 'caption', though it is optional and 'content' is the default.</dd>
<dt>makeTrue()/makeFalse()</dt>
<dd>These methods are indended soley for coaxing the return value of an event handler. Of times, it is necessary to return either true or false to the event handler, regardless of what the function in the handler might return. These methods will guarantee that result. For instance, the <code>onclick</code> handler must return false for a link or else the browser will follow the target href. Conversely, the handler must return true or else the browser will stall. These methods just help to achieve the desired behavior.</dd>
</dl>
<h3>Global Settings</h3>
<p>All of the options above can be used a global settings by prepending the 'domTT_' prefix. These assignments are a good way to establish common behaviors for your tooltips on the webpage. A couple of additional settings are documented here. <em>Be sure to include your custom values below the point when the domTT library is included so that they override the default values.</em></p>
<dl>
<dt>domTT_oneOnly</dt>
<dd>Set to this <code>true</code> to allow only one active tip at a time. When a tooltip is created, it will deactivate the last opened tooltip. You can access the last opened tooltip using the global variable domTT_lastOpened</dd>
<dt>fading</dt>
<dd>In order to use the fading feature, you must include the library fadomatic.js in your web page. See examples #5.</dd>
<dt>dragging</dt>
<dd>In order to drag tooltips, you must include the library domTT_drag.js in your web page. See example #4.</dd>
<dt>domTT_useGlobalMousePosition</dt>
<dd>This setting will allow domTT to register an event handler on the document to track the position of the mouse. Registering this event allows the trailing feature to behave more smoothly.</dd>
<dt>domTT_screenEdgeDetection</dt>
<dd>Enable the screen edge detection feature, which will prevent the tip from leaving the page. Setting this to <code>false</code> disables this feature.</dd>
<dt>domTT_screenEdgePadding</dt>
<dd>When using screen edge detection, this setting specifies how close to the edge the tip should be allowed to travel.</dd>
<dt>domTT_detectCollisions</dt>
<dd>If you would rather not having the select boxes and other interfering elements hidden when a visual collision is detected, you may turn off the functionality globally using this flag.</dd>
</dl>
<h3>Common Problems</h3>
<ul>
<li>If tips are not disappearing in low latency situations, use <code>onmouseover = domTT_deactivate(this.id);</code> to be sure it is discarded. (It seems, though, that a bug fix in 0.7.3 solved this problem.)</li>
<li>If the error 'operation aborted' is being thrown in IE, use the domTT_postponeActivation along with domTT_documentLoaded to prevent these types of page load problems.</li>
<li>To get dynamic updates on your tips using AJAX, you can either address the tip by its id, manipulate the node linked to the content, or use this domTT_update method. This point to remember is that the content is only processed when the tip is activated.</li>
<li>Disabled form fields do not have positions in the page. This prevents tooltips from being placed next to them. In order to use tooltips with form fields that are inactive, please use the onfocus="this.blur()" trick along with appropriate visual styling. In general, the disabled attribute causes other side-effects anyway.</li>
</ul>
</body>
</html>
/tags/Racine_livraison_narmer/api/js/domtooltip/AUTHORS
New file
0,0 → 1,7
DOM Tooltip Library 0.70
 
Maintainer: Dan Allen <dan.allen@mojavelinux.com>
Contributors:
Josh Gross <josh@jportalhome.com>
Jason Rust <jason@rustyparts.com>
Vic Mackey <shield24@gmail.com>
/tags/Racine_livraison_narmer/api/js/domtooltip/TODO
New file
0,0 → 1,205
$Id: TODO,v 1.1 2007-03-16 12:39:35 jp_milcent Exp $
 
TODO
----
[+] deactivate delay with appropriate timeout cancel handles (can then do the fancy work with velcro tip)
[+] use json for options to tip
[+] content can be a function, but until tip is destroyed, it isn't called again (call in domTT_show)
[+] option to use the DOM node rather than cloning for caption/content
[+] possible edge detection problem in Opera
 
[+] build a namespace for dom.lib dom.tt dom.menu or something
[+] doInDomTT() which would allow a function to be run when the tip is to be positioned
[+] issue a callback to fadomatic to destroy tip on fadeOut completion (allow the destory action for fading tips)
[+] make this domTT_runShow more clear as to what it is doing...maybe even
rework the timeout process we cannot allow for the timeout to hold onto any
object that might reference the DOM, else it won't get garbage collected
[+] think about creating a lightweight version that uses replaceTitles
 
[+] create addEvent() function for posting global events
 
[+] lazy trailing broken in Opera
 
[+] maxWidth handling is a bit ugly
[+] maybe not show contents when dragging? (also resize of sticky tooltips)
[+] drag API / add snap to grid when dragging
 
THOUGHTS
--------
[+] make alpha settings a sub-object or array...so we can set: max, step, etc...
[+] a more smooth lazy trail should be implemented by not moving the full amount each time
[+] make cursor "move" if caption is draggable
[+] Konq and Opera don't allow tip to flow over IFRAME in example11...but the code is working
 
NOTES
-----
never use:
onmouseover = function(e) { ... } as it will create a circular reference because of the function definition
 
 
[1,2,3] array object
{'one' : 1, 'two' : 2} object
cannot use setTimeout() with anonymous function in IE 5.0 since it crashes the browser when you execute clearTimeout() following this call
in compliance mode, IE measures use document.documentElement for many of the document.body functions
Text node cannot have an event in IE, but it can in mozilla
IE bubbles by default, which means that the child nodes get the event before the offsetParent nodes
setting an event to null in mozilla does not remove events registered using addEventListener...but it does in IE.
IE 5.0* does not have the .*? functionality in regexp
bug in linux onmousedown causes onmouseout beforehand
on IE, if there is an onmousemove and onmouseover, both will fire onmouseover
 
// innerHTML the DOM way
var range = document.createRange();
range.selectNodeContents(document.body);
var fragment = range.createContextualFragment('<b>test</b>');
var tooltip = document.createElement('div');
tooltip.appendChild(fragment);
 
WHAT I AM NOT THRILLED ABOUT
----------------------------
- (mozilla keeps firing events after javascript functions have been unloaded
- when appending a tooltip to a table cell, the table seems to get stretched out
 
DONE
----
[@] delay firing tooltip events until page has loaded (fix IE bug)
[@] missing fade should still allow tip to close
[@] one tooltip at a time
[@] mousemove makes konqueror flip the tip up (was a konqueror bug, fixed in 3.2)
[@] IE not detecting bottom edge of browser
[@] created global constant for standards mode detection
[@] if position relative, don't append to parent until tip is done creating or else parent get's all screwed up
[@] show should not set left and top style if position relative
[@] incorrect use of pending...pending should be between inactive and active
[@] fade fails when mouseout while fading when fading in 'in' only
[@] fade in is VERY slow
[@] domTT_isActive awkward
[@] velcro not working right
[@] strange stuff going on when doing click to stick
[@] mouseover then mouseout still has issues (sticky tips)
[@] what if tooltip is inactive and domTT_activate() fires again
[@] fix the FIXME's
[@] change domTT_true and domTT_false to makeTrue() and makeFalse()
[@] fix fades
[@] drag not working
[@] put delay back in for IE 5.0/Konq
[@] mousemove update is overridden by the mouseover placement, firing at wrong time
[@] cut the use of writing onmouseout() if is specified, same with onmousemove (make automatic)
[@] get rid of the float and go with tables instead so we can cut code
[@] try to speed it up a bit
[@] create lite version for simpler cases
[@] make a domTT_deactivate() that the user can use to make his/her own onmouseout()
[@] check for standards compliance mode, make it work either way
[@] problem if select box is inside tooltip
[@] infinite recursion bug in konqueror when using onmouseover
[@] be able to specify unique id as option
[@] use callTimeout
[@] problem with the setTimeout calls when using mousemove...before the tooltip activates, many setTimeouts can be registered, but only one can be cancelled
[@] have domTT_deactivate take a tip id or a tip object
[@] possibly make use of 'this' in the drag functions
[@] fix onmouseout to work as expected
[@] show off the preserving of the onmouseout
[@] talk about the auto width in the demo (which overlib does not have)
[@] select detection does not account for visible sticky tooltips...for this we have to have a global hash of the open tips...then, when we are going to change the style of a select element to visible, we check the open tips and make sure it is not conflicting with any of them
[@] some demos not working in Konqueror
[@] maxWidth handling is a bit awkward
[@] velcro having a rough time in IE, and in mozilla linux, cannot mousedown before it closes
[@] use typeof() instead of this.undefined
[@] strip out the javascript code for reporting errors in the packaged file
[@] store onmouseout function in the eventTarget attribute?
[@] common function for placing the tip (show and create do this stuff)
[@] be able to specify the width
[@] make function for domTT_mouseout()
[@] think about window.status on Example 4, right link
[@] few places where I get the mouse_x/mouse_y when I don't need it (relative position)
[@] when doing onmouseout for a greasy, make sure we are not entering a child...hmmm
[@] make example for relative position
[@] make maxWidth of 0 ignored
[@] since we can specify parent, be able to specify relative position or something so that we can just have the tooltip expand into the container
[@] have makefile fill in the version
[@] if event target is documentElement, coax it to document.body
[@] cursor errors in IE 5.5
[@] we don't need domTT_defaultStatus, just use window.defaultStatus
[@] add option for lifetime to tip
[@] create demo for velcro
[@] snap to grid tooltip (problem is we need to determine the difference from where the tip is located now, and where we would put it next, not just the mouse position)
[@] be able to fade out on close
[@] mouseover tip functionality...be able to keep it open when you mouseover, maybe another type...velcro
[@] don't kill the onmouseout the existed on tip...try to just add the close (see foo.html)
[@] fixed position tooltip (maybe pass in coordinates)
[@] change domTT_deactivate attribute to domTT_destroy
[@] tip lifetime for onmouseover
[@] set prefix for each tooltip in example pages
[@] maybe creat a domTT_writeStatus() function to be used for onmouseover
[@] added domTT_false() for onclick events on links that open IFRAMES
[@] remove hardcoded -1000px for a setting
[@] make fade a passed in option
[@] fading tooltip
[@] check for valid browser and don't execute if not meet requirements
[@] opera7 does not hide contents of IFRAME when tooltip is hidden
[@] make domTT_defaultStatus option
[@] prevent dragging close element
[@] drag bug in Opera 7
[@] full Opera 7 support!
[@] try Opera 7
[@] function for detect screen edge?
[@] edge detection not account for scroll (messes up placement bigtime when scroll is in effect)
[@] if content is empty, need to bail on creating tip
[@] why oncontextmenu no deliver onclick
[@] add domTT_isActive()
[@] add option 'deactivate' to be 'hide' or 'destroy', important for embedded IFRAMES
[@] option not to have X for sticky, but put onclick on document
[@] maybe remove the restriction for onmouseover and let it happen as it will
[@] more options for predefined can come over to tip definition, overridden by those passed in
[@] release to dynamic drive ddsubmit@yahoo.com
[@] if you have onmouseover sticky, and you mouseover then leave, it doesn't kill tip
[@] variable for tipObj visibility state to prevent all the lookups
[@] be able to specify style prefix for different styles on different tips
[@] add addPredefined() function
[@] make only draggable from caption
[@] be able to turn off dragging of sticky tips
[@] cleaner call to domTT_show()
[@] screenshot for freshmeat
[@] custom close text
[@] full screen edge detection
[@] handle the mouse cursor height automatically
[@] prettier way to handle default options
[@] support for directional tips (extending west from mouse action instead of east)
[@] eventDelay should be set to 0 if onmousemove and visible so it updates right away
[@] make function for reappear, domTT_show()
[@] when mouseover, use most recent location of mouse position
[@] perhaps do type instead of 'sticky' true or false?
[@] collision detection shouldn't delay when doing mousemove/click and tip is visible
[@] adjustable delay for tip in options
[@] change in_options to options in domTT_activate
[@] drag in IE jumps when select domTTContent area
[@] mouseout in IE when sticky active makes select boxes come back, event when tooptip is over it
[@] X should not be a dragable part of tooltip
[@] function for get mouse event position
[@] domTT_detectCollisions should do the lines just above it
[@] be able to drag sticky
[@] have getPosition return all 4 coordinates
[@] konqueror support
[@] browser variables
[@] code for x and y is twice in the activate function
[@] when you fly in and then click on the object while the tip is being created, it bugs out
[@] another paramater to domTT_activate() whether to unhide selects
[@] domTT_deactivate to take object instead of id
[@] fix problem with onmousemove after onclick beating setTimeout(...,0) on windows
[@] after we use a sticky, and it is closed, mousemove no longer works
[@] if we are sticky, all events on the same object should be cancelled
[@] be able to do sticky on click when onmousemove is used for non-sticky
[@] hiding of select boxes is not subject to the delay that the tooltip is subject to
[@] do internal hash, from the arguments after event
[@] itemExists to hash
[@] account for scroll offset of page
[@] fix max-width for IE
[@] fix broken float right for IE
[@] fix e.target to event.srcElement for IE
[@] need delay on reappear from cache
[@] no delay for onclick
[@] implement zIndex so new tips can go over old tips
[@] cache tooltips created by using visibility style
[@] pass in options as Hash
[@] auto-assign onmouseout
[@] add ability to have sticky (x in caption...what if we don't have caption?)
/tags/Racine_livraison_narmer/api/js/domtooltip/Changelog
New file
0,0 → 1,342
$Id: Changelog,v 1.1 2007-03-16 12:39:35 jp_milcent Exp $
DOM Tootip: Javascript tooltip generator
 
version 0.7.3 (SVN HEAD):
* added example integration with behaviour.js
* added domTT_postponeActivation option to workaround 'operation aborted' error
* added domTT_closeAll function to remove all tooltips on page
* 'content' option can now be a function to return the content
* make id prefix configurable
* close velcro tip by clicking on it
* allow tips to be created with no event (null value)
* allow disabling of collision detection
* fixed problem of tip not disappearing on rapid mouse movement
* fixed problem of using global mouse position before first mouse movement
* prevent tooltip events on banned tags, such as OPTION (for consistency)
* improvements to example14 to allow caption to render properly
 
version 0.7.2 (2006/04/12):
* added example to demonstrate custom positioning with a parent
* fixes in clear timeout made in domLib.js
* fixed a regression in the collision detection that left elements hidden
* content and caption are only cloned if domTT_cloneNodes is set to true, otherwise the reference is used
 
version 0.7.1 (2005/07/16):
 
* changed fading library from alphaAPI to fadomatic
* fixed problem with fade where links and buttons would become inactive
* fixed problem where tooltips would hang around if browser doesn't support fading
* released under Apache 2.0 license
* added example for dynamically updating tooltip content
* added method for updating tooltip content, domTT_update()
* enabled caption to be html or a DOM node
* removed the clone() prototype method in domLib to prevent conflicts with other libraries
* option to have only one tip show at a time
* fixed edge detection to be more precise
* added fadeMax as upper limit for an alpha fade-in
* fixed wrapping problem when tip nears edge in opera and IE
* replace domLib_isKonq with domLib_isKHTML
* added auto-generated tooltips from the title attribute for elements with class "tooltip"
* custom offsets can be set on a per-tip basis
* tips are now indexed on both tip id and owner id, for greater flexibility
* added a convenient method for use in custom close events, domTT_close()
* custom id can now be used for the tip for easy reference
* domTT_classPrefix is now domTT_styleClass, option classPrefix is now styleClass
* wrapper div for contents styled with generic class 'contents'
* wrapper for caption is now styled with generic class 'caption'
* make drag an optional parameter for tip to turn on/off dragging of sticky tips
* trail can now be either 'x' or 'y' which will lock trailing to a single axis
* added HOWTO
* updated all examples
 
version 0.7.0 (2004/11/10):
 
* Create tip on parent specified instead on document.body and then moving the tip in the DOM
* Added a standards mode detection, which was the root of edge bleed issues
* Added info in README about how to make the program smaller using jsmin
* Fixed memory leaks in IE caused by using inner functions
* Now works in Mac IE
* Tooltips can be created from a child iframe element
* IE 5.0 (Windows) removed from supported list of browsers
 
version 0.6.0 (2003/02/13):
 
* major rewrite (please consult this changelog and example for new requirements)
* made fading modular using alphaAPI (seperate file, alphaAPI.js)
* large gains in speed and compliance (fix Konq and IE 5 bugs)
* eliminate need for domTT_activate() in the mousemove event handler!!!
* new option 'trail' to specify tip to follow mouse movement (only for absolute)
* changed domTT_true/false() functions to makeTrue/false()!!!
* changed option 'status' option to 'statusText'!!!
* changed 'prefix' option to 'classPrefix'!!!
* changed 'close' option to 'closeAction'!!!
* made dragging of tips loadable (seperate file, domTT_drag.js)
* divided out common functions from domTT functions (seperate file, domLib.js)
* browser detection variables now prefixed with domLib_is*!!!
* to create an onload window, first option is unique id (no longer have 'id' option)
 
version 0.5.5 (2003/02/09):
 
* fixed major crashes in IE 5.0 (cannot use delays since setTimeout is buggy)
* fixed hideList error in all browsers
* fixed a bug on example10.html when using a popup
 
version 0.5.4 (2003/02/05):
 
* fixed a scroll offset problem when IE is in compatibility mode
* fixed problem where select box detection nixed element inside tooltip
 
version 0.5.3 (2003/01/29):
 
* fix misspelled document on like 971 in domTT.js
 
version 0.5.2 (2003/01/17):
 
* fix for document.documentElement.scrollTop for IE in standards compliance mode
 
version 0.5.1 (2002/12/19):
 
* implemented callTimeout() as an wrapper for setTimeout() for variable persistence
* konqueror can now implement delays for tips!!!
* konqueror can now handle tip lifetime!!!
* added workaround for some konqueror quirks
 
version 0.5.0 (2002/12/19):
 
* fixed invalid variable name tmp_offsetX...regression from fixes in 0.4.9
 
version 0.4.9 (2002/12/18):
 
* reworked domTT_deactivate() a bit
* can now specify an 'id' option on each tip to have multiple tips on one trigger
* fixed the activateTimeout process to rid of lingering bugs
* updated demos
 
version 0.4.8 (2002/12/11):
 
* fixed recursion bug
 
version 0.4.7 (2002/12/08):
 
* dragging of sticky tips in konqueror!!
* cleaned up the mouseout code a great deal and now it actually works as expected
* selects only appear again when all tooltips which hid them are cleared away!!!
* fixed IE javascript error caused by global onmousemove operating before page load
* simplified deactivate by putting code for unhide selects in detectCollisions()
* updated demos
 
version 0.4.6 (2002/12/07):
 
* eliminated unnecessary code in domTT_show()
* konqueror fixes (checks in wrong place, clientHeight problem)
* fixed onclick x, y measurement in konqueror
 
version 0.4.5 (2002/12/06):
 
* added maxWidth option (false to disable) and width option now independent
* added workaround for maxWidth bug in Opera
* switch to toggling display property to hide rather than using visibility hidden
* fixed error in IE 5.5 bypassing a safeguard and causing a javascript error
* fixed compliance error with IE 5.5 when executing IE hack for float
* fixed height calculation with IE 5.5 vs IE 6 (compliance difference)
* fixed case when hack IE code was executing under the wrong circumstances
* fixing small javascript errors
* totally block IE 5.0 until I can get to testing it
* demo fixes and cleanups
* fixed missing check for tip object existance in mouseout function
 
version 0.4.4 (2002/12/06):
 
* fixed onload problem in IE
 
version 0.4.3 (2002/12/05):
 
* code cleanups with strict compliance mozilla
* fixed so that using domTT_activate() can be used as an onload event
* closeLink will be interpreted as html (but note the link is automatically created)
 
version 0.4.2 (2002/12/05):
 
* fixed missing units in drag update
* fixed width calculation in IE in strict mode
* fix document.body.clientHeight -> document.documentElement.clientHeight (IE strict.dtd)
* catch permission errors in mozilla to write status text
 
version 0.4.1 (2002/12/05):
 
* forget to add contentEditable when made changed to domTT_create() in 0.4.0
* fixes to the domTT_isDescendantOf to exclude absolute elements
* fixed error in mozilla (tip was trying to be destroyed twice)
* fixed regexp bug in IE 5.01
* fixed link in demo for opera (example8.html)
* fixed javascript error in IE when triggerObj was #document
* fixed IE bug when contentEditable property was screwing up the height
* demo fixes
 
version 0.4.0 (2002/12/02):
 
* add required 'this' add the beginning of every domTT_activate() call
* prevent tip from disappearing when mouseout goes to child of target element
* tons of code cleanup dealing with onmouseout
* 'status' now clears after each mouseout, even if tip is sticky or velcro
* added 'width' option, which overides the global domTT_maxWidth (and the style)
* merged logic in create() and show() so that create() can use show() (normalize)
 
version 0.3.2 (2002/12/01):
 
* changed 'close' to 'closeLink' since it was confusing what it was
* added relative positioned tips (inline), added option 'position'
* maxWidth of 0 will be ignored
* fixed a fade bug when tooltip object exists (domTT_show())
* several other fade bugs fixed
 
version 0.3.1 (2002/12/01):
 
* 'caption' can be set to false to force it not to show, even when using 'type' sticky
* fixed error "Could not get cursor property" in IE5 because must use 'hand' not 'pointer'
* misspelled descendant
* cleaned up the preserving of onmouseout a ton
* 'caption' only has to be set to false if type is 'sticky', otherwise it can be left off
* updated demos
 
version 0.3.0 (2002/11/30):
 
* added global domTT_lifetime to set how long the tip stays alive when mouse is stationary
* added option 'lifetime' for each individual tip (0 for infinite)
* added fixed position tooltip option by passing in 'x' and 'y' as options
* changed hash method itemExists to hasItem to be DOM compliant
* perserve the onmouseout that existed on the target rather than just overwriting
* new type 'velcro', which disappears when you mouseout of the tooltip instead of target
* added ability to fade out and changed 'fade' option from boolean to in/out/both/neither
* added fade direction to the domTT_doFade() function to hande fade in both directions
* made a global variable for domTT_onClose, either 'hide' or 'remove'
* changed 'deactivate' option to 'onClose' which can be 'hide' or 'remove'
* added 'grid' option and domTT_grid global to snap to a grid on updates (0 for no grid)
* got rid of domTT_defaultStatus, just use window.defaultStatus for this value
* code cleanups
* demo addition and cleanups
 
version 0.2.3 (2002/11/27):
 
* added domTT_false() as a wrapper for links that make IFRAME tooltips to cancel click
* fixed case when domTT_isGecko was not deteting select-multiple with size=1
* can specify only 'status' to domTT_activate, and will change status and register clear
* made demo pages for library
* removed a hack width setting width because I was confused before...and didn't need it
* made global setting variable for domTT_prefix
 
version 0.2.2 (2002/11/21):
 
* fade-in on tips!!! (mozilla and IE only)
* global option for fade on or off (click events don't use fade ever)
* added option to domTT_activate for fade
 
version 0.2.1 (2002/11/21):
 
* perfect support for Opera7 !!! (what a great browser as far as standards go!)
* no need for select collision detection in opera (again, tremendous)
* prevented the close element from being draggable in all browsers (works this time)
* fixed bug that opera does not hide IFRAME children when tip is hidden or destroyed
* added domTT_defaultStatus to be used when clearing status bar
* for opera, you will want to disable all opera tooltips except 'element titles'
* added 'mousedown' as a trigger to set delay to 0 (3 types of mouse depress possible)
 
version 0.2.0 (2002/11/20):
 
* domTT_activate returns the id of the tip if it needs to be referenced externally
* added domTT_isActive() to check for an activated tip, returns tip object if active
* create domTT_true() function, which should be used to wrap domTT_activate for onmouseover
* second option to domTT_deactivate is optional (default to true)
* domTT_predefined now takes all the options domTT_activate takes
* domTT_activate loads in predefined options if predefined is the first option
* domTT_activate uses options from domTT_activate call to override predefined options
* take off restriction for status of onmouseover and just let it happen as it will
* caption now not used if empty, even if it is sticky (can externally close tip)
* added 'contextmenu' event type alongside 'click' for auto changing delay to 0
* if content is empty, bail on creating the tip (hmmm...still thinking on this)
* Gecko always makes the tip 4px too wide, for some unknown reason (maybe gecko bug?)
* bug in right edge detection (was giving the width the padding instead of taking away)
* fixed bug in global onmousemove (wasn't passing event to function for mozilla)
* fixed edge detection, which was not accounting for scroll offset
* made function domTT_correctEdgeBleed() for edge bleeding (since I used it twice)
* code cleanups, added docs and another example page
 
version 0.1.7 (2002/11/18):
 
* domTT_close can be an object, hence an image for an 'X' for close
* drag limited to the caption bar for sticky tips
* added domTT_addPredefined function for caching tip definitions
* added ability to pass in custom prefix for class styles, other than domTT
* can pass in 'close' option for text/image to be used as close markup
* fixed bug for onmouseover sticky tip which prevented cancel of tip creation onmouseout
* added a new example.html file
 
version 0.1.6 (2002/11/17):
 
* added option for directionality in tips (southeast, southwest, northeast, northwest)
* set default options at beginning of domTT_activate() instead of checking for each
* global setting for mouse height so that offset is from edge of mouse cursor
* added LICENSE, README to package
* finished screen edge detection and correction
* custom close text for sticky
* can globally turn off dragging of sticky tips
 
version 0.1.5 (2002/11/16):
* ability to grab current mouse position when tip is created on delay
* option for not using current mouse position when tip is created on delay (use passed in)
* changed mouseover to mousemove for event on the tooltip (prevent artifact tooltips)
* added delay as option (will use global if not passed in)
* added status as an option, which will change the status bar text
* eliminated collision detection delay when tip is already visible
* 'sticky' option changed to 'type' and can be 'greasy' or 'sticky'
* fixed some serious bugs in setTimout logic when destroying tips
* created function domTT_show() for showing hidden tip (previously created)
 
version 0.1.4 (2002/11/15):
 
* ability to drag sticky tooltips (lots of work here)
* change domTT_getPosition to domTT_getOffsets
* return more information from domTT_getOffsets
* simplify domTT_detectCollisions (now requires only one argument)
* made function for getting mouse position (since browsers do crazy things)
* the 'X' part of the tip is not draggable
 
version 0.1.3 (2002/11/14):
 
* konqueror support (lots of fixes for this) (onclick is somewhate hacked)
* browser variables instead of using javascript objects to differentiate
* eliminated duplicate mouse_x and mouse_y code
* changed lamda function calls in setTimeout to support konqueror
* getPosition returns right and bottom as well
 
version 0.1.2 (2002/11/13):
 
* fixed case when you flew over object and then clicked fast to create sticky and it failed
* domTT_deactivate now takes an object instead of id (avoids lookup)
* fixed problem with onmousemove after onclick beating setTimeout(...,0) on windows
* fixed the e.target to e.currentTarget for mozilla (which is the registered target)
* sticky tips now work correctly
* fixed domTT_detectCollisions to be subject to the activate delay on tip unhide
* no longer dependent on global Hash() function...arguments become hash internally
* account for the scroll offset when working with event coordinates
* compensated for lack of max-width for IE
* fixed broken float right for IE (cannot assign through DOM)
* float right causes tooltip to stretch to widht of page, fixed that
* fixed javascript error because IE doesn't have e.target (event.srcElement instead)
 
version 0.1.1 (2002/11/10):
 
* pass in options as Hash
* cache created tips to reuse via visibility style
* auto-assign onmouseout to deactivate
* add ability to have sticky
* implemented zIndex so new tips can go over old tips
* no delay for onclick tips
* implemented delay when toggling visibility of cached tips
* ability to pass in html content
 
version 0.1.0 (2002/10/30):
 
* Initial release
 
/tags/Racine_livraison_narmer/api/js/domtooltip/alphaAPI.js
New file
0,0 → 1,294
/** $Id: alphaAPI.js,v 1.1 2007-03-16 12:39:35 jp_milcent Exp $ */
// {{{ license
 
/*
* Copyright 2002-2005 Dan Allen, Mojavelinux.com (dan.allen@mojavelinux.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
 
// }}}
// {{{ intro
 
/**
* Title: alphaAPI
* Original Author: chrisken
* Original Url: http://www.cs.utexas.edu/users/chrisken/alphaapi.html
*
* Modified by Dan Allen <dan.allen@mojavelinux.com>
* Note: When the stopAlpha is reached and it is equal to 0, the element's
* style is set to display: none to fix a bug in domTT
*/
 
// }}}
function alphaAPI(element, fadeInDelay, fadeOutDelay, startAlpha, stopAlpha, offsetTime, deltaAlpha)
{
// {{{ properties
 
this.element = typeof(element) == 'object' ? element : document.getElementById(element);
this.fadeInDelay = fadeInDelay || 40;
this.fadeOutDelay = fadeOutDelay || this.fadeInDelay;
this.startAlpha = startAlpha;
this.stopAlpha = stopAlpha;
// make sure a filter exists so an error is not thrown
if (typeof(this.element.filters) == 'object')
{
if (typeof(this.element.filters.alpha) == 'undefined')
{
this.element.style.filter += 'alpha(opacity=100)';
}
}
 
this.offsetTime = (offsetTime || 0) * 1000;
this.deltaAlpha = deltaAlpha || 10;
this.timer = null;
this.paused = false;
this.started = false;
this.cycle = false;
this.command = function() {};
return this;
 
// }}}
}
 
// use prototype methods to save memory
// {{{ repeat()
 
alphaAPI.prototype.repeat = function(repeat)
{
this.cycle = repeat ? true : false;
}
 
// }}}
// {{{ setAlphaBy()
 
alphaAPI.prototype.setAlphaBy = function(deltaAlpha)
{
this.setAlpha(this.getAlpha() + deltaAlpha);
}
 
// }}}
// {{{ toggle()
 
alphaAPI.prototype.toggle = function()
{
if (!this.started)
{
this.start();
}
else if (this.paused)
{
this.unpause();
}
else
{
this.pause();
}
}
 
// }}}
// {{{ timeout()
 
alphaAPI.prototype.timeout = function(command, delay)
{
this.command = command;
this.timer = setTimeout(command, delay);
}
 
// }}}
// {{{ setAlpha()
 
alphaAPI.prototype.setAlpha = function(opacity)
{
if (typeof(this.element.filters) == 'object')
{
this.element.filters.alpha.opacity = opacity;
}
else if (this.element.style.setProperty)
{
this.element.style.setProperty('opacity', opacity / 100, '');
// handle the case of mozilla < 1.7
this.element.style.setProperty('-moz-opacity', opacity / 100, '');
// handle the case of old kthml
this.element.style.setProperty('-khtml-opacity', opacity / 100, '');
}
}
 
// }}}
// {{{ getAlpha()
 
alphaAPI.prototype.getAlpha = function()
{
if (typeof(this.element.filters) == 'object')
{
return this.element.filters.alpha.opacity;
}
else if (this.element.style.getPropertyValue)
{
var opacityValue = this.element.style.getPropertyValue('opacity');
// handle the case of mozilla < 1.7
if (opacityValue == '')
{
opacityValue = this.element.style.getPropertyValue('-moz-opacity');
}
 
// handle the case of old khtml
if (opacityValue == '')
{
opacityValue = this.element.style.getPropertyValue('-khtml-opacity');
}
 
return opacityValue * 100;
}
 
return 100;
}
 
// }}}
// {{{ start()
 
alphaAPI.prototype.start = function()
{
this.started = true;
this.setAlpha(this.startAlpha);
// determine direction
if (this.startAlpha > this.stopAlpha)
{
var instance = this;
this.timeout(function() { instance.fadeOut(); }, this.offsetTime);
}
else
{
var instance = this;
this.timeout(function() { instance.fadeIn(); }, this.offsetTime);
}
}
 
// }}}
// {{{ stop()
 
alphaAPI.prototype.stop = function()
{
this.started = false;
this.setAlpha(this.stopAlpha);
if (this.stopAlpha == 0)
{
this.element.style.display = 'none';
}
 
this.stopTimer();
this.command = function() {};
}
 
// }}}
// {{{ reset()
 
alphaAPI.prototype.reset = function()
{
this.started = false;
this.setAlpha(this.startAlpha);
this.stopTimer();
this.command = function() {};
}
 
// }}}
// {{{ pause()
 
alphaAPI.prototype.pause = function()
{
this.paused = true;
this.stopTimer();
}
 
// }}}
// {{{ unpause()
 
alphaAPI.prototype.unpause = function()
{
this.paused = false;
if (!this.started)
{
this.start();
}
else
{
this.command();
}
}
 
// }}}
// {{{ stopTimer()
 
alphaAPI.prototype.stopTimer = function()
{
clearTimeout(this.timer);
this.timer = null;
}
 
// }}}
// {{{ fadeOut()
 
alphaAPI.prototype.fadeOut = function()
{
this.stopTimer();
if (this.getAlpha() > this.stopAlpha)
{
this.setAlphaBy(-1 * this.deltaAlpha);
var instance = this;
this.timeout(function() { instance.fadeOut(); }, this.fadeOutDelay);
}
else
{
if (this.cycle)
{
var instance = this;
this.timeout(function() { instance.fadeIn(); }, this.fadeInDelay);
}
else
{
if (this.stopAlpha == 0)
{
this.element.style.display = 'none';
}
this.started = false;
}
}
}
 
// }}}
// {{{ fadeIn()
 
alphaAPI.prototype.fadeIn = function()
{
this.stopTimer();
if (this.getAlpha() < this.startAlpha)
{
this.setAlphaBy(this.deltaAlpha);
var instance = this;
this.timeout(function() { instance.fadeIn(); }, this.fadeInDelay);
}
else
{
if (this.cycle)
{
var instance = this;
this.timeout(function() { instance.fadeOut(); }, this.fadeOutDelay);
}
else
{
this.started = false;
}
}
}
 
// }}}
/tags/Racine_livraison_narmer/api/js/domtooltip/README
New file
0,0 → 1,142
$Id: README,v 1.1 2007-03-16 12:39:35 jp_milcent Exp $
 
Project: DOM Tooltip
Maintainer: Dan Allen (Mojavelinux) <dan.allen@mojavelinux.com>
Contributors:
Josh Gross (JPortalHome) <josh@jportalhome.com>
Jason Rust (CodeJanitor) <jason@rustyparts.com>
License: Apache 2.0
 
What is it?
-----------
This javascript library will allow you to have dynamic and configurable
tooltips on your html pages. There are several other tooltip libraries on the
web, but you will find that this library is very complete and stable. It
includes support for all the modern browsers and behaves in a consistent way
across these platforms. This library does not support Netscape 4. Netscape 4
is no longer an acceptable browser and it is time to move forward. That is why
I prefixed the project title with DOM. If your browser doesn't support the DOM
standard, then this library won't work.
 
How does it work?
-----------------
This library supports Gecko (Mozilla/Netscape6+,Firefox, etc), IE 5.5+, IE on
Mac, Safari, Konqueror and Opera 7 (which includes full DOM and CSS2 support).
The tooltips are configured through class definitions in your stylesheet and
the rest is up to javascript. The tooltips may consist of two parts, the
caption and the content. The caption is optional. The tips can either be
greasy, sticky, or velcro. Greasy means that they move around when you move
the mouse around and go away when you leave the element. Sticky means that they
stick around after you leave the element and are otherwise stationary. Velcro
tips disappear after a mouseout occurs on the tip itself. The tooltips also
have directionality, so you can have tips that are 'northeast', 'northwest',
'southeast' or 'southwest' of the mouse.
 
Be sure to include the file 'domLib.js' whereever you use 'domTT.js' and if you
want to have draggable tips or opacity fading, include the 'domTT_drag.js' and
'fadomatic.js' files as well. **Some of these libraries are available under the
domLib project.** Please see the HOWTO.html for details on how to use the
library and the options that are available.
 
Why is this program so big?
---------------------------
Partly because it is feature rich and thus there is lots of code, partly
because we try to use comments where ever necessary to clarify issues, and
partly because our coding style is one which makes liberal use of whitespace.
However, to save your users the trouble of downloading 50k of JavaScript every
time they come to your page you can use Douglas Crockford's excellent jsmin
program to strip all non-essentials from the code, reducing it's size by as
much as 50%. This program has been verified to work with his program, located at:
http://www.crockford.com/javascript/jsmin.html
An example usage would be:
bash# ./jsmin domTT.js domTT_min.js \
"domTT is Copyright Dan Allen (dan.allen@mojavelinux.com) (2002 - 2005). Licensed under the Apache 2.0 license"
 
Anything I should know?
-----------------------
Additionally, this tooltip library autodetects select boxes in IE and the
scrollbar on multiple selects in mozilla (the only issue mozilla has) and
HIDES them whenever the tooltip collides with them. Hence, it has full
collision detection with components which cannot use the zIndex propery!!
 
In order for it to work correctly you'll want to follow the example stylesheet
pretty closely. It has been crafted to work well on all the supported
browsers. Note the body { margin: 0; } style which is needed if you want it to
work decently on Mac IE and Opera. (According the W3C standard, a body cannot
have a margin anyway).
 
By default, the library accounts for the size of the mouse when the tip is
in one of the two southern positions. If you need to turn off this correction
on a given tip, set the option 'clearMouse' to false. If the size of the mouse
needs to be adjusted, overwrite the global variable domTT_mouseHeight.
 
In 0.7.1, the hiding of flash animations was added for those browsers that
cannot put html over top of flash. However, there are a couple of
requirements. First, the syntax that must be used is:
 
<object
type="application/x-shockwave-flash"
data="animation.swf"
width="450px"
height="250px"
pluginspage="http://www.macromedia.com/go/getflashplayer">
<param name="movie" value="animation.swf" />
<param name="wmode" value="opaque" />
...alternate (non-flash) html here!...
</object>
 
If you use the object+embed syntax, the flash will not be properly detected.
The second requirement is that the flash must be included in an element with a
position of either absolute or relative. If it is not, the flash animation
will be relocated in the DOM and therefore will not be aware of its location on
the page, making collision detection worthless.
 
Why did you write it?
---------------------
The reason I wrote this library is because I wanted a library which used 100%
DOM to do the tooltips, was easy to configure, was fast, and which was freely
distributable. You may use this library in personal or company, open source or
proprietry projects. I wrote it for you, so enjoy it. All I ask is that you
spread the word and please give me credit by leaving in my comments. If you
do make patches, please let me know about them on my forums. Viva Open Source!!
 
Important Changes in 0.7.1
--------------------------
Fading library is now fadomatic.js, so be sure to change your include
when using the fade feature. This is a third party library developed
by fadomatic@chimpen.com. You can find this library at the following URL:
 
http://chimpen.com/fadomatic
 
The global setting domTT_classPrefix was changed to domTT_styleClass and the
equivalent options without the domTT_ prefix in the domTT_activate() function
call have been changed.
 
Important Changes in 0.70
-----------------------------
IE 5.0 is no longer supported because its DOM implementation is just too
crippled. Many of the complaints about the positioning of the tips and
the screen edge detecting are now fixed.
 
Important API Changes in 0.60
------------------------------
The release is 0.60 and it introduced several significant changes over the
0.55 release. Several of the options have changed names. The following is a
list:
 
'status' -> 'statusText'
'close' -> 'closeAction'
'prefix' -> 'classPrefix'
'id' -> *no longer an option*
 
There is also a new option 'trail' which is used in place of mousemove. Do not
use domTT_activate() in the onmousemove event handler any longer!!! It was far
too slow to parse the same options all over again from onmouseover, so now just
specify the domTT_activate() in onmouseover with the option trail.
 
Also to note, the functions domTT_true() and domTT_false() have been changed to
makeTrue() and makeFalse() respectively to make them more understandable.
 
Be sure to include the file 'domLib.js' whereever you use 'domTT.js'
and if you want to have draggable tips or opacity fading, include the
'domTT_drag.js' and 'fadomatic.js' files as well.
/tags/Racine_livraison_narmer/api/js/domtooltip/domTT_drag.js
New file
0,0 → 1,102
/** $Id: domTT_drag.js,v 1.1 2007-03-16 12:39:35 jp_milcent Exp $ */
// {{{ license
 
/*
* Copyright 2002-2005 Dan Allen, Mojavelinux.com (dan.allen@mojavelinux.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
 
// }}}
// {{{ globals (DO NOT EDIT)
 
var domTT_dragEnabled = true;
var domTT_currentDragTarget;
var domTT_dragMouseDown;
var domTT_dragOffsetLeft;
var domTT_dragOffsetTop;
 
// }}}
// {{{ domTT_dragStart()
 
function domTT_dragStart(in_this, in_event)
{
if (typeof(in_event) == 'undefined') { in_event = window.event; }
 
var eventButton = in_event[domLib_eventButton];
if (eventButton != 1 && !domLib_isKHTML)
{
return;
}
 
domTT_currentDragTarget = in_this;
in_this.style.cursor = 'move';
 
// upgrade our z-index
in_this.style.zIndex = ++domLib_zIndex;
 
var eventPosition = domLib_getEventPosition(in_event);
 
var targetPosition = domLib_getOffsets(in_this);
domTT_dragOffsetLeft = eventPosition.get('x') - targetPosition.get('left');
domTT_dragOffsetTop = eventPosition.get('y') - targetPosition.get('top');
domTT_dragMouseDown = true;
}
 
// }}}
// {{{ domTT_dragUpdate()
 
function domTT_dragUpdate(in_event)
{
if (domTT_dragMouseDown)
{
if (domLib_isGecko)
{
window.getSelection().removeAllRanges()
}
 
if (domTT_useGlobalMousePosition && domTT_mousePosition != null)
{
var eventPosition = domTT_mousePosition;
}
else
{
if (typeof(in_event) == 'undefined') { in_event = window.event; }
var eventPosition = domLib_getEventPosition(in_event);
}
 
domTT_currentDragTarget.style.left = (eventPosition.get('x') - domTT_dragOffsetLeft) + 'px';
domTT_currentDragTarget.style.top = (eventPosition.get('y') - domTT_dragOffsetTop) + 'px';
 
// update the collision detection
domLib_detectCollisions(domTT_currentDragTarget);
}
}
 
// }}}
// {{{ domTT_dragStop()
 
function domTT_dragStop()
{
if (domTT_dragMouseDown) {
domTT_dragMouseDown = false;
domTT_currentDragTarget.style.cursor = 'default';
domTT_currentDragTarget = null;
if (domLib_isGecko)
{
window.getSelection().removeAllRanges()
}
}
}
 
// }}}
/tags/Racine_livraison_narmer/api/js/domtooltip/BUGS
New file
0,0 → 1,16
$Id: BUGS,v 1.1 2007-03-16 12:39:35 jp_milcent Exp $
These are the known bugs/issues in the DOM Tooltip library:
 
- Opera7 popups up a native tooltip title for the link, which goes over the custom tooltip
(all you need to do is disable tooltips in the opera preferences)
 
- you cannot use the margin style on the body in Opera7, you have to use padding instead
you can read over at opera.com why they don't support this...apparently not a legit style
 
- offset* properties do not account for margins, so styles with margins could lead to issues
 
- fading in and fading out in mozilla is somewhat flaky...it works but has flickering...this
flickering is NOT the tooltip code, it is the rendering of the styles in mozilla...only time
will help us here (this seems to be resolved in Firefox 1.0)
 
- inframe tips do not appear over top of the iframe in Opera and Konqueror
/tags/Racine_livraison_narmer/api/js/domtooltip/domLib.js
New file
0,0 → 1,706
/** $Id: domLib.js,v 1.1 2007-03-16 12:39:35 jp_milcent Exp $ */
// {{{ license
 
/*
* Copyright 2002-2005 Dan Allen, Mojavelinux.com (dan.allen@mojavelinux.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
 
// }}}
// {{{ intro
 
/**
* Title: DOM Library Core
* Version: 0.70
*
* Summary:
* A set of commonly used functions that make it easier to create javascript
* applications that rely on the DOM.
*
* Updated: 2005/05/17
*
* Maintainer: Dan Allen <dan.allen@mojavelinux.com>
* Maintainer: Jason Rust <jrust@rustyparts.com>
*
* License: Apache 2.0
*/
 
// }}}
// {{{ global constants (DO NOT EDIT)
 
// -- Browser Detection --
var domLib_userAgent = navigator.userAgent.toLowerCase();
var domLib_isMac = navigator.appVersion.indexOf('Mac') != -1;
var domLib_isWin = domLib_userAgent.indexOf('windows') != -1;
// NOTE: could use window.opera for detecting Opera
var domLib_isOpera = domLib_userAgent.indexOf('opera') != -1;
var domLib_isOpera7up = domLib_userAgent.match(/opera.(7|8)/i);
var domLib_isSafari = domLib_userAgent.indexOf('safari') != -1;
var domLib_isKonq = domLib_userAgent.indexOf('konqueror') != -1;
// Both konqueror and safari use the khtml rendering engine
var domLib_isKHTML = (domLib_isKonq || domLib_isSafari || domLib_userAgent.indexOf('khtml') != -1);
var domLib_isIE = (!domLib_isKHTML && !domLib_isOpera && (domLib_userAgent.indexOf('msie 5') != -1 || domLib_userAgent.indexOf('msie 6') != -1 || domLib_userAgent.indexOf('msie 7') != -1));
var domLib_isIE5up = domLib_isIE;
var domLib_isIE50 = (domLib_isIE && domLib_userAgent.indexOf('msie 5.0') != -1);
var domLib_isIE55 = (domLib_isIE && domLib_userAgent.indexOf('msie 5.5') != -1);
var domLib_isIE5 = (domLib_isIE50 || domLib_isIE55);
// safari and konq may use string "khtml, like gecko", so check for destinctive /
var domLib_isGecko = domLib_userAgent.indexOf('gecko/') != -1;
var domLib_isMacIE = (domLib_isIE && domLib_isMac);
var domLib_isIE55up = domLib_isIE5up && !domLib_isIE50 && !domLib_isMacIE;
var domLib_isIE6up = domLib_isIE55up && !domLib_isIE55;
 
// -- Browser Abilities --
var domLib_standardsMode = (document.compatMode && document.compatMode == 'CSS1Compat');
var domLib_useLibrary = (domLib_isOpera7up || domLib_isKHTML || domLib_isIE5up || domLib_isGecko || domLib_isMacIE || document.defaultView);
// fixed in Konq3.2
var domLib_hasBrokenTimeout = (domLib_isMacIE || (domLib_isKonq && domLib_userAgent.match(/konqueror\/3.([2-9])/) == null));
var domLib_canFade = (domLib_isGecko || domLib_isIE || domLib_isSafari || domLib_isOpera);
var domLib_canDrawOverSelect = (domLib_isMac || domLib_isOpera || domLib_isGecko);
var domLib_canDrawOverFlash = (domLib_isMac || domLib_isWin);
 
// -- Event Variables --
var domLib_eventTarget = domLib_isIE ? 'srcElement' : 'currentTarget';
var domLib_eventButton = domLib_isIE ? 'button' : 'which';
var domLib_eventTo = domLib_isIE ? 'toElement' : 'relatedTarget';
var domLib_stylePointer = domLib_isIE ? 'hand' : 'pointer';
// NOTE: a bug exists in Opera that prevents maxWidth from being set to 'none', so we make it huge
var domLib_styleNoMaxWidth = domLib_isOpera ? '10000px' : 'none';
var domLib_hidePosition = '-1000px';
var domLib_scrollbarWidth = 14;
var domLib_autoId = 1;
var domLib_zIndex = 100;
 
// -- Detection --
var domLib_collisionElements;
var domLib_collisionsCached = false;
 
var domLib_timeoutStateId = 0;
var domLib_timeoutStates = new Hash();
 
// }}}
// {{{ DOM enhancements
 
if (!document.ELEMENT_NODE)
{
document.ELEMENT_NODE = 1;
document.ATTRIBUTE_NODE = 2;
document.TEXT_NODE = 3;
document.DOCUMENT_NODE = 9;
document.DOCUMENT_FRAGMENT_NODE = 11;
}
 
function domLib_clone(obj)
{
var copy = {};
for (var i in obj)
{
var value = obj[i];
try
{
if (value != null && typeof(value) == 'object' && value != window && !value.nodeType)
{
copy[i] = domLib_clone(value);
}
else
{
copy[i] = value;
}
}
catch(e)
{
copy[i] = value;
}
}
 
return copy;
}
 
// }}}
// {{{ class Hash()
 
function Hash()
{
this.length = 0;
this.numericLength = 0;
this.elementData = [];
for (var i = 0; i < arguments.length; i += 2)
{
if (typeof(arguments[i + 1]) != 'undefined')
{
this.elementData[arguments[i]] = arguments[i + 1];
this.length++;
if (arguments[i] == parseInt(arguments[i]))
{
this.numericLength++;
}
}
}
}
 
// using prototype as opposed to inner functions saves on memory
Hash.prototype.get = function(in_key)
{
if (typeof(this.elementData[in_key]) != 'undefined') {
return this.elementData[in_key];
}
 
return null;
}
 
Hash.prototype.set = function(in_key, in_value)
{
if (typeof(in_value) != 'undefined')
{
if (typeof(this.elementData[in_key]) == 'undefined')
{
this.length++;
if (in_key == parseInt(in_key))
{
this.numericLength++;
}
}
 
return this.elementData[in_key] = in_value;
}
 
return false;
}
 
Hash.prototype.remove = function(in_key)
{
var tmp_value;
if (typeof(this.elementData[in_key]) != 'undefined')
{
this.length--;
if (in_key == parseInt(in_key))
{
this.numericLength--;
}
 
tmp_value = this.elementData[in_key];
delete this.elementData[in_key];
}
 
return tmp_value;
}
 
Hash.prototype.size = function()
{
return this.length;
}
 
Hash.prototype.has = function(in_key)
{
return typeof(this.elementData[in_key]) != 'undefined';
}
 
Hash.prototype.find = function(in_obj)
{
for (var tmp_key in this.elementData)
{
if (this.elementData[tmp_key] == in_obj)
{
return tmp_key;
}
}
 
return null;
}
 
Hash.prototype.merge = function(in_hash)
{
for (var tmp_key in in_hash.elementData)
{
if (typeof(this.elementData[tmp_key]) == 'undefined')
{
this.length++;
if (tmp_key == parseInt(tmp_key))
{
this.numericLength++;
}
}
 
this.elementData[tmp_key] = in_hash.elementData[tmp_key];
}
}
 
Hash.prototype.compare = function(in_hash)
{
if (this.length != in_hash.length)
{
return false;
}
 
for (var tmp_key in this.elementData)
{
if (this.elementData[tmp_key] != in_hash.elementData[tmp_key])
{
return false;
}
}
return true;
}
 
// }}}
// {{{ domLib_isDescendantOf()
 
function domLib_isDescendantOf(in_object, in_ancestor, in_bannedTags)
{
if (in_object == null)
{
return false;
}
 
if (in_object == in_ancestor)
{
return true;
}
 
if (typeof(in_bannedTags) != 'undefined' &&
(',' + in_bannedTags.join(',') + ',').indexOf(',' + in_object.tagName + ',') != -1)
{
return false;
}
 
while (in_object != document.documentElement)
{
try
{
if ((tmp_object = in_object.offsetParent) && tmp_object == in_ancestor)
{
return true;
}
else if ((tmp_object = in_object.parentNode) == in_ancestor)
{
return true;
}
else
{
in_object = tmp_object;
}
}
// in case we get some wierd error, assume we left the building
catch(e)
{
return false;
}
}
 
return false;
}
 
// }}}
// {{{ domLib_detectCollisions()
 
/**
* For any given target element, determine if elements on the page
* are colliding with it that do not obey the rules of z-index.
*/
function domLib_detectCollisions(in_object, in_recover, in_useCache)
{
// the reason for the cache is that if the root menu is built before
// the page is done loading, then it might not find all the elements.
// so really the only time you don't use cache is when building the
// menu as part of the page load
if (!domLib_collisionsCached)
{
var tags = [];
 
if (!domLib_canDrawOverFlash)
{
tags[tags.length] = 'object';
}
 
if (!domLib_canDrawOverSelect)
{
tags[tags.length] = 'select';
}
 
domLib_collisionElements = domLib_getElementsByTagNames(tags, true);
domLib_collisionsCached = in_useCache;
}
 
// if we don't have a tip, then unhide selects
if (in_recover)
{
for (var cnt = 0; cnt < domLib_collisionElements.length; cnt++)
{
var thisElement = domLib_collisionElements[cnt];
 
if (!thisElement.hideList)
{
thisElement.hideList = new Hash();
}
 
thisElement.hideList.remove(in_object.id);
if (!thisElement.hideList.length)
{
domLib_collisionElements[cnt].style.visibility = 'visible';
if (domLib_isKonq)
{
domLib_collisionElements[cnt].style.display = '';
}
}
}
 
return;
}
else if (domLib_collisionElements.length == 0)
{
return;
}
 
// okay, we have a tip, so hunt and destroy
var objectOffsets = domLib_getOffsets(in_object);
 
for (var cnt = 0; cnt < domLib_collisionElements.length; cnt++)
{
var thisElement = domLib_collisionElements[cnt];
 
// if collision element is in active element, move on
// WARNING: is this too costly?
if (domLib_isDescendantOf(thisElement, in_object))
{
continue;
}
 
// konqueror only has trouble with multirow selects
if (domLib_isKonq &&
thisElement.tagName == 'SELECT' &&
(thisElement.size <= 1 && !thisElement.multiple))
{
continue;
}
 
if (!thisElement.hideList)
{
thisElement.hideList = new Hash();
}
 
var selectOffsets = domLib_getOffsets(thisElement);
var center2centerDistance = Math.sqrt(Math.pow(selectOffsets.get('leftCenter') - objectOffsets.get('leftCenter'), 2) + Math.pow(selectOffsets.get('topCenter') - objectOffsets.get('topCenter'), 2));
var radiusSum = selectOffsets.get('radius') + objectOffsets.get('radius');
// the encompassing circles are overlapping, get in for a closer look
if (center2centerDistance < radiusSum)
{
// tip is left of select
if ((objectOffsets.get('leftCenter') <= selectOffsets.get('leftCenter') && objectOffsets.get('right') < selectOffsets.get('left')) ||
// tip is right of select
(objectOffsets.get('leftCenter') > selectOffsets.get('leftCenter') && objectOffsets.get('left') > selectOffsets.get('right')) ||
// tip is above select
(objectOffsets.get('topCenter') <= selectOffsets.get('topCenter') && objectOffsets.get('bottom') < selectOffsets.get('top')) ||
// tip is below select
(objectOffsets.get('topCenter') > selectOffsets.get('topCenter') && objectOffsets.get('top') > selectOffsets.get('bottom')))
{
thisElement.hideList.remove(in_object.id);
if (!thisElement.hideList.length)
{
thisElement.style.visibility = 'visible';
if (domLib_isKonq)
{
thisElement.style.display = '';
}
}
}
else
{
thisElement.hideList.set(in_object.id, true);
thisElement.style.visibility = 'hidden';
if (domLib_isKonq)
{
thisElement.style.display = 'none';
}
}
}
}
}
 
// }}}
// {{{ domLib_getOffsets()
 
function domLib_getOffsets(in_object, in_preserveScroll)
{
if (typeof(in_preserveScroll) == 'undefined') {
in_preserveScroll = false;
}
 
var originalObject = in_object;
var originalWidth = in_object.offsetWidth;
var originalHeight = in_object.offsetHeight;
var offsetLeft = 0;
var offsetTop = 0;
 
while (in_object)
{
offsetLeft += in_object.offsetLeft;
offsetTop += in_object.offsetTop;
in_object = in_object.offsetParent;
// consider scroll offset of parent elements
if (in_object && !in_preserveScroll)
{
offsetLeft -= in_object.scrollLeft;
offsetTop -= in_object.scrollTop;
}
}
 
// MacIE misreports the offsets (even with margin: 0 in body{}), still not perfect
if (domLib_isMacIE) {
offsetLeft += 10;
offsetTop += 10;
}
 
return new Hash(
'left', offsetLeft,
'top', offsetTop,
'right', offsetLeft + originalWidth,
'bottom', offsetTop + originalHeight,
'leftCenter', offsetLeft + originalWidth/2,
'topCenter', offsetTop + originalHeight/2,
'radius', Math.max(originalWidth, originalHeight)
);
}
 
// }}}
// {{{ domLib_setTimeout()
 
function domLib_setTimeout(in_function, in_timeout, in_args)
{
if (typeof(in_args) == 'undefined')
{
in_args = [];
}
 
if (in_timeout == -1)
{
// timeout event is disabled
return 0;
}
else if (in_timeout == 0)
{
in_function(in_args);
return 0;
}
 
// must make a copy of the arguments so that we release the reference
var args = domLib_clone(in_args);
 
if (!domLib_hasBrokenTimeout)
{
return setTimeout(function() { in_function(args); }, in_timeout);
}
else
{
var id = domLib_timeoutStateId++;
var data = new Hash();
data.set('function', in_function);
data.set('args', args);
domLib_timeoutStates.set(id, data);
 
data.set('timeoutId', setTimeout('domLib_timeoutStates.get(' + id + ').get(\'function\')(domLib_timeoutStates.get(' + id + ').get(\'args\')); domLib_timeoutStates.remove(' + id + ');', in_timeout));
return id;
}
}
 
// }}}
// {{{ domLib_clearTimeout()
 
function domLib_clearTimeout(in_id)
{
if (!domLib_hasBrokenTimeout)
{
if (in_id > 0) {
clearTimeout(in_id);
}
}
else
{
if (domLib_timeoutStates.has(in_id))
{
clearTimeout(domLib_timeoutStates.get(in_id).get('timeoutId'))
domLib_timeoutStates.remove(in_id);
}
}
}
 
// }}}
// {{{ domLib_getEventPosition()
 
function domLib_getEventPosition(in_eventObj)
{
var eventPosition = new Hash('x', 0, 'y', 0, 'scrollX', 0, 'scrollY', 0);
 
// IE varies depending on standard compliance mode
if (domLib_isIE)
{
var doc = (domLib_standardsMode ? document.documentElement : document.body);
// NOTE: events may fire before the body has been loaded
if (doc)
{
eventPosition.set('x', in_eventObj.clientX + doc.scrollLeft);
eventPosition.set('y', in_eventObj.clientY + doc.scrollTop);
eventPosition.set('scrollX', doc.scrollLeft);
eventPosition.set('scrollY', doc.scrollTop);
}
}
else
{
eventPosition.set('x', in_eventObj.pageX);
eventPosition.set('y', in_eventObj.pageY);
eventPosition.set('scrollX', in_eventObj.pageX - in_eventObj.clientX);
eventPosition.set('scrollY', in_eventObj.pageY - in_eventObj.clientY);
}
 
return eventPosition;
}
 
// }}}
// {{{ domLib_cancelBubble()
 
function domLib_cancelBubble(in_event)
{
var eventObj = in_event ? in_event : window.event;
eventObj.cancelBubble = true;
}
 
// }}}
// {{{ domLib_getIFrameReference()
 
function domLib_getIFrameReference(in_frame)
{
if (domLib_isGecko || domLib_isIE)
{
return in_frame.frameElement;
}
else
{
// we could either do it this way or require an id on the frame
// equivalent to the name
var name = in_frame.name;
if (!name || !in_frame.parent)
{
return null;
}
 
var candidates = in_frame.parent.document.getElementsByTagName('iframe');
for (var i = 0; i < candidates.length; i++)
{
if (candidates[i].name == name)
{
return candidates[i];
}
}
 
return null;
}
}
 
// }}}
// {{{ domLib_getElementsByClass()
 
function domLib_getElementsByClass(in_class)
{
var elements = domLib_isIE5 ? document.all : document.getElementsByTagName('*');
var matches = [];
var cnt = 0;
for (var i = 0; i < elements.length; i++)
{
if ((" " + elements[i].className + " ").indexOf(" " + in_class + " ") != -1)
{
matches[cnt++] = elements[i];
}
}
 
return matches;
}
 
// }}}
// {{{ domLib_getElementsByTagNames()
 
function domLib_getElementsByTagNames(in_list, in_excludeHidden)
{
var elements = [];
for (var i = 0; i < in_list.length; i++)
{
var matches = document.getElementsByTagName(in_list[i]);
for (var j = 0; j < matches.length; j++)
{
// skip objects that have nested embeds, or else we get "flashing"
if (matches[j].tagName == 'OBJECT' && domLib_isGecko)
{
var kids = matches[j].childNodes;
var skip = false;
for (var k = 0; k < kids.length; k++)
{
if (kids[k].tagName == 'EMBED')
{
skip = true;
break;
}
}
if (skip) continue;
}
 
if (in_excludeHidden && domLib_getComputedStyle(matches[j], 'visibility') == 'hidden')
{
continue;
}
 
elements[elements.length] = matches[j];
}
}
 
return elements;
}
 
// }}}
// {{{ domLib_getComputedStyle()
 
function domLib_getComputedStyle(in_obj, in_property)
{
if (domLib_isIE)
{
var humpBackProp = in_property.replace(/-(.)/, function (a, b) { return b.toUpperCase(); });
return eval('in_obj.currentStyle.' + humpBackProp);
}
// getComputedStyle() is broken in konqueror, so let's go for the style object
else if (domLib_isKonq)
{
//var humpBackProp = in_property.replace(/-(.)/, function (a, b) { return b.toUpperCase(); });
return eval('in_obj.style.' + in_property);
}
else
{
return document.defaultView.getComputedStyle(in_obj, null).getPropertyValue(in_property);
}
}
 
// }}}
// {{{ makeTrue()
 
function makeTrue()
{
return true;
}
 
// }}}
// {{{ makeFalse()
 
function makeFalse()
{
return false;
}
 
// }}}
/tags/Racine_livraison_narmer/api/js/domtooltip/LICENSE
New file
0,0 → 1,202
 
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
 
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
 
1. Definitions.
 
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
 
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
 
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
 
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
 
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
 
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
 
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
 
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
 
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
 
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
 
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
 
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
 
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
 
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
 
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
 
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
 
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
 
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
 
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
 
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
 
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
 
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
 
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
 
END OF TERMS AND CONDITIONS
 
APPENDIX: How to apply the Apache License to your work.
 
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
 
Copyright [yyyy] [name of copyright owner]
 
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
 
http://www.apache.org/licenses/LICENSE-2.0
 
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
/tags/Racine_livraison_narmer/api/js/domtooltip/domTT.js
New file
0,0 → 1,1132
/** $Id: domTT.js,v 1.1 2007-03-16 12:39:35 jp_milcent Exp $ */
// {{{ license
 
/*
* Copyright 2002-2005 Dan Allen, Mojavelinux.com (dan.allen@mojavelinux.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
 
// }}}
// {{{ intro
 
/**
* Title: DOM Tooltip Library
* Version: 0.7.3
*
* Summary:
* Allows developers to add custom tooltips to the webpages. Tooltips are
* generated using the domTT_activate() function and customized by setting
* a handful of options.
*
* Maintainer: Dan Allen <dan.allen@mojavelinux.com>
* Contributors:
* Josh Gross <josh@jportalhome.com>
* Jason Rust <jason@rustyparts.com>
*
* License: Apache 2.0
* However, if you use this library, you earn the position of official bug
* reporter :) Please post questions or problem reports to the newsgroup:
*
* http://groups-beta.google.com/group/dom-tooltip
*
* If you are doing this for commercial work, perhaps you could send me a few
* Starbucks Coffee gift dollars or PayPal bucks to encourage future
* developement (NOT REQUIRED). E-mail me for my snail mail address.
 
*
* Homepage: http://www.mojavelinux.com/projects/domtooltip/
*
* Newsgroup: http://groups-beta.google.com/group/dom-tooltip
*
* Freshmeat Project: http://freshmeat.net/projects/domtt/?topic_id=92
*
* Updated: 2005/07/16
*
* Supported Browsers:
* Mozilla (Gecko), IE 5.5+, IE on Mac, Safari, Konqueror, Opera 7
*
* Usage:
* Please see the HOWTO documentation.
**/
 
// }}}
// {{{ settings (editable)
 
// IE mouse events seem to be off by 2 pixels
var domTT_offsetX = (domLib_isIE ? -2 : 0);
var domTT_offsetY = (domLib_isIE ? 4 : 2);
var domTT_direction = 'southeast';
var domTT_mouseHeight = domLib_isIE ? 13 : 19;
var domTT_closeLink = 'X';
var domTT_closeAction = 'hide';
var domTT_activateDelay = 500;
var domTT_maxWidth = false;
var domTT_styleClass = 'domTT';
var domTT_fade = 'neither';
var domTT_lifetime = 0;
var domTT_grid = 0;
var domTT_trailDelay = 200;
var domTT_useGlobalMousePosition = true;
var domTT_postponeActivation = false;
var domTT_tooltipIdPrefix = '[domTT]';
var domTT_screenEdgeDetection = true;
var domTT_screenEdgePadding = 4;
var domTT_oneOnly = false;
var domTT_cloneNodes = false;
var domTT_detectCollisions = true;
var domTT_bannedTags = ['OPTION'];
var domTT_draggable = false;
if (typeof(domTT_dragEnabled) == 'undefined')
{
domTT_dragEnabled = false;
}
 
// }}}
// {{{ globals (DO NOT EDIT)
 
var domTT_predefined = new Hash();
// tooltips are keyed on both the tip id and the owner id,
// since events can originate on either object
var domTT_tooltips = new Hash();
var domTT_lastOpened = 0;
var domTT_documentLoaded = false;
var domTT_mousePosition = null;
 
// }}}
// {{{ document.onmousemove
 
if (domLib_useLibrary && domTT_useGlobalMousePosition)
{
document.onmousemove = function(in_event)
{
if (typeof(in_event) == 'undefined') { in_event = window.event; }
 
domTT_mousePosition = domLib_getEventPosition(in_event);
if (domTT_dragEnabled && domTT_dragMouseDown)
{
domTT_dragUpdate(in_event);
}
}
}
 
// }}}
// {{{ domTT_activate()
 
function domTT_activate(in_this, in_event)
{
if (!domLib_useLibrary || (domTT_postponeActivation && !domTT_documentLoaded)) { return false; }
 
// make sure in_event is set (for IE, some cases we have to use window.event)
if (typeof(in_event) == 'undefined') { in_event = window.event; }
 
// don't allow tooltips on banned tags (such as OPTION)
if (in_event != null) {
var target = in_event.srcElement ? in_event.srcElement : in_event.target;
if (target != null && (',' + domTT_bannedTags.join(',') + ',').indexOf(',' + target.tagName + ',') != -1)
{
return false;
}
}
 
var owner = document.body;
// we have an active event so get the owner
if (in_event != null && in_event.type.match(/key|mouse|click|contextmenu/i))
{
// make sure we have nothing higher than the body element
if (in_this.nodeType && in_this.nodeType != document.DOCUMENT_NODE)
{
owner = in_this;
}
}
// non active event (make sure we were passed a string id)
else
{
if (typeof(in_this) != 'object' && !(owner = domTT_tooltips.get(in_this)))
{
// NOTE: two steps to avoid "flashing" in gecko
var embryo = document.createElement('div');
owner = document.body.appendChild(embryo);
owner.style.display = 'none';
owner.id = in_this;
}
}
 
// make sure the owner has a unique id
if (!owner.id)
{
owner.id = '__autoId' + domLib_autoId++;
}
 
// see if we should only be opening one tip at a time
// NOTE: this is not "perfect" yet since it really steps on any other
// tip working on fade out or delayed close, but it get's the job done
if (domTT_oneOnly && domTT_lastOpened)
{
domTT_deactivate(domTT_lastOpened);
}
 
domTT_lastOpened = owner.id;
 
var tooltip = domTT_tooltips.get(owner.id);
if (tooltip)
{
if (tooltip.get('eventType') != in_event.type)
{
if (tooltip.get('type') == 'greasy')
{
tooltip.set('closeAction', 'destroy');
domTT_deactivate(owner.id);
}
else if (tooltip.get('status') != 'inactive')
{
return owner.id;
}
}
else
{
if (tooltip.get('status') == 'inactive')
{
tooltip.set('status', 'pending');
tooltip.set('activateTimeout', domLib_setTimeout(domTT_runShow, tooltip.get('delay'), [owner.id, in_event]));
 
return owner.id;
}
// either pending or active, let it be
else
{
return owner.id;
}
}
}
 
// setup the default options hash
var options = new Hash(
'caption', '',
'content', '',
'clearMouse', true,
'closeAction', domTT_closeAction,
'closeLink', domTT_closeLink,
'delay', domTT_activateDelay,
'direction', domTT_direction,
'draggable', domTT_draggable,
'fade', domTT_fade,
'fadeMax', 100,
'grid', domTT_grid,
'id', domTT_tooltipIdPrefix + owner.id,
'inframe', false,
'lifetime', domTT_lifetime,
'offsetX', domTT_offsetX,
'offsetY', domTT_offsetY,
'parent', document.body,
'position', 'absolute',
'styleClass', domTT_styleClass,
'type', 'greasy',
'trail', false,
'lazy', false
);
 
// load in the options from the function call
for (var i = 2; i < arguments.length; i += 2)
{
// load in predefined
if (arguments[i] == 'predefined')
{
var predefinedOptions = domTT_predefined.get(arguments[i + 1]);
for (var j in predefinedOptions.elementData)
{
options.set(j, predefinedOptions.get(j));
}
}
// set option
else
{
options.set(arguments[i], arguments[i + 1]);
}
}
 
options.set('eventType', in_event != null ? in_event.type : null);
 
// immediately set the status text if provided
if (options.has('statusText'))
{
try { window.status = options.get('statusText'); } catch(e) {}
}
 
// if we didn't give content...assume we just wanted to change the status and return
if (!options.has('content') || options.get('content') == '' || options.get('content') == null)
{
if (typeof(owner.onmouseout) != 'function')
{
owner.onmouseout = function(in_event) { domTT_mouseout(this, in_event); };
}
 
return owner.id;
}
 
options.set('owner', owner);
 
domTT_create(options);
 
// determine the show delay
options.set('delay', (in_event != null && in_event.type.match(/click|mousedown|contextmenu/i)) ? 0 : parseInt(options.get('delay')));
domTT_tooltips.set(owner.id, options);
domTT_tooltips.set(options.get('id'), options);
options.set('status', 'pending');
options.set('activateTimeout', domLib_setTimeout(domTT_runShow, options.get('delay'), [owner.id, in_event]));
 
return owner.id;
}
 
// }}}
// {{{ domTT_create()
 
function domTT_create(in_options)
{
var tipOwner = in_options.get('owner');
var parentObj = in_options.get('parent');
var parentDoc = parentObj.ownerDocument || parentObj.document;
 
// create the tooltip and hide it
// NOTE: two steps to avoid "flashing" in gecko
var embryo = parentDoc.createElement('div');
var tipObj = parentObj.appendChild(embryo);
tipObj.style.position = 'absolute';
tipObj.style.left = '0px';
tipObj.style.top = '0px';
tipObj.style.visibility = 'hidden';
tipObj.id = in_options.get('id');
tipObj.className = in_options.get('styleClass');
 
var contentBlock;
var tableLayout = false;
 
if (in_options.get('caption') || (in_options.get('type') == 'sticky' && in_options.get('caption') !== false))
{
tableLayout = true;
// layout the tip with a hidden formatting table
var tipLayoutTable = tipObj.appendChild(parentDoc.createElement('table'));
tipLayoutTable.style.borderCollapse = 'collapse';
if (domLib_isKHTML)
{
tipLayoutTable.cellSpacing = 0;
}
 
var tipLayoutTbody = tipLayoutTable.appendChild(parentDoc.createElement('tbody'));
 
var numCaptionCells = 0;
var captionRow = tipLayoutTbody.appendChild(parentDoc.createElement('tr'));
var captionCell = captionRow.appendChild(parentDoc.createElement('td'));
captionCell.style.padding = '0px';
var caption = captionCell.appendChild(parentDoc.createElement('div'));
caption.className = 'caption';
if (domLib_isIE50)
{
caption.style.height = '100%';
}
 
if (in_options.get('caption').nodeType)
{
caption.appendChild(domTT_cloneNodes ? in_options.get('caption').cloneNode(1) : in_options.get('caption'));
}
else
{
caption.innerHTML = in_options.get('caption');
}
 
if (in_options.get('type') == 'sticky')
{
var numCaptionCells = 2;
var closeLinkCell = captionRow.appendChild(parentDoc.createElement('td'));
closeLinkCell.style.padding = '0px';
var closeLink = closeLinkCell.appendChild(parentDoc.createElement('div'));
closeLink.className = 'caption';
if (domLib_isIE50)
{
closeLink.style.height = '100%';
}
 
closeLink.style.textAlign = 'right';
closeLink.style.cursor = domLib_stylePointer;
// merge the styles of the two cells
closeLink.style.borderLeftWidth = caption.style.borderRightWidth = '0px';
closeLink.style.paddingLeft = caption.style.paddingRight = '0px';
closeLink.style.marginLeft = caption.style.marginRight = '0px';
if (in_options.get('closeLink').nodeType)
{
closeLink.appendChild(in_options.get('closeLink').cloneNode(1));
}
else
{
closeLink.innerHTML = in_options.get('closeLink');
}
 
closeLink.onclick = function()
{
domTT_deactivate(tipOwner.id);
};
closeLink.onmousedown = function(in_event)
{
if (typeof(in_event) == 'undefined') { in_event = window.event; }
in_event.cancelBubble = true;
};
// MacIE has to have a newline at the end and must be made with createTextNode()
if (domLib_isMacIE)
{
closeLinkCell.appendChild(parentDoc.createTextNode("\n"));
}
}
 
// MacIE has to have a newline at the end and must be made with createTextNode()
if (domLib_isMacIE)
{
captionCell.appendChild(parentDoc.createTextNode("\n"));
}
 
var contentRow = tipLayoutTbody.appendChild(parentDoc.createElement('tr'));
var contentCell = contentRow.appendChild(parentDoc.createElement('td'));
contentCell.style.padding = '0px';
if (numCaptionCells)
{
if (domLib_isIE || domLib_isOpera)
{
contentCell.colSpan = numCaptionCells;
}
else
{
contentCell.setAttribute('colspan', numCaptionCells);
}
}
 
contentBlock = contentCell.appendChild(parentDoc.createElement('div'));
if (domLib_isIE50)
{
contentBlock.style.height = '100%';
}
}
else
{
contentBlock = tipObj.appendChild(parentDoc.createElement('div'));
}
 
contentBlock.className = 'contents';
 
var content = in_options.get('content');
// allow content has a function to return the actual content
if (typeof(content) == 'function') {
content = content(in_options.get('id'));
}
 
if (content != null && content.nodeType)
{
contentBlock.appendChild(domTT_cloneNodes ? content.cloneNode(1) : content);
}
else
{
contentBlock.innerHTML = content;
}
 
// adjust the width if specified
if (in_options.has('width'))
{
tipObj.style.width = parseInt(in_options.get('width')) + 'px';
}
 
// check if we are overridding the maxWidth
// if the browser supports maxWidth, the global setting will be ignored (assume stylesheet)
var maxWidth = domTT_maxWidth;
if (in_options.has('maxWidth'))
{
if ((maxWidth = in_options.get('maxWidth')) === false)
{
tipObj.style.maxWidth = domLib_styleNoMaxWidth;
}
else
{
maxWidth = parseInt(in_options.get('maxWidth'));
tipObj.style.maxWidth = maxWidth + 'px';
}
}
 
// HACK: fix lack of maxWidth in CSS for KHTML and IE
if (maxWidth !== false && (domLib_isIE || domLib_isKHTML) && tipObj.offsetWidth > maxWidth)
{
tipObj.style.width = maxWidth + 'px';
}
 
in_options.set('offsetWidth', tipObj.offsetWidth);
in_options.set('offsetHeight', tipObj.offsetHeight);
 
// konqueror miscalcuates the width of the containing div when using the layout table based on the
// border size of the containing div
if (domLib_isKonq && tableLayout && !tipObj.style.width)
{
var left = document.defaultView.getComputedStyle(tipObj, '').getPropertyValue('border-left-width');
var right = document.defaultView.getComputedStyle(tipObj, '').getPropertyValue('border-right-width');
left = left.substring(left.indexOf(':') + 2, left.indexOf(';'));
right = right.substring(right.indexOf(':') + 2, right.indexOf(';'));
var correction = 2 * ((left ? parseInt(left) : 0) + (right ? parseInt(right) : 0));
tipObj.style.width = (tipObj.offsetWidth - correction) + 'px';
}
 
// if a width is not set on an absolutely positioned object, both IE and Opera
// will attempt to wrap when it spills outside of body...we cannot have that
if (domLib_isIE || domLib_isOpera)
{
if (!tipObj.style.width)
{
// HACK: the correction here is for a border
tipObj.style.width = (tipObj.offsetWidth - 2) + 'px';
}
 
// HACK: the correction here is for a border
tipObj.style.height = (tipObj.offsetHeight - 2) + 'px';
}
 
// store placement offsets from event position
var offsetX, offsetY;
 
// tooltip floats
if (in_options.get('position') == 'absolute' && !(in_options.has('x') && in_options.has('y')))
{
// determine the offset relative to the pointer
switch (in_options.get('direction'))
{
case 'northeast':
offsetX = in_options.get('offsetX');
offsetY = 0 - tipObj.offsetHeight - in_options.get('offsetY');
break;
case 'northwest':
offsetX = 0 - tipObj.offsetWidth - in_options.get('offsetX');
offsetY = 0 - tipObj.offsetHeight - in_options.get('offsetY');
break;
case 'north':
offsetX = 0 - parseInt(tipObj.offsetWidth/2);
offsetY = 0 - tipObj.offsetHeight - in_options.get('offsetY');
break;
case 'southwest':
offsetX = 0 - tipObj.offsetWidth - in_options.get('offsetX');
offsetY = in_options.get('offsetY');
break;
case 'southeast':
offsetX = in_options.get('offsetX');
offsetY = in_options.get('offsetY');
break;
case 'south':
offsetX = 0 - parseInt(tipObj.offsetWidth/2);
offsetY = in_options.get('offsetY');
break;
}
 
// if we are in an iframe, get the offsets of the iframe in the parent document
if (in_options.get('inframe'))
{
var iframeObj = domLib_getIFrameReference(window);
if (iframeObj)
{
var frameOffsets = domLib_getOffsets(iframeObj);
offsetX += frameOffsets.get('left');
offsetY += frameOffsets.get('top');
}
}
}
// tooltip is fixed
else
{
offsetX = 0;
offsetY = 0;
in_options.set('trail', false);
}
 
// set the direction-specific offsetX/Y
in_options.set('offsetX', offsetX);
in_options.set('offsetY', offsetY);
if (in_options.get('clearMouse') && in_options.get('direction').indexOf('south') != -1)
{
in_options.set('mouseOffset', domTT_mouseHeight);
}
else
{
in_options.set('mouseOffset', 0);
}
 
if (domLib_canFade && typeof(Fadomatic) == 'function')
{
if (in_options.get('fade') != 'neither')
{
var fadeHandler = new Fadomatic(tipObj, 10, 0, 0, in_options.get('fadeMax'));
in_options.set('fadeHandler', fadeHandler);
}
}
else
{
in_options.set('fade', 'neither');
}
 
// setup mouse events
if (in_options.get('trail') && typeof(tipOwner.onmousemove) != 'function')
{
tipOwner.onmousemove = function(in_event) { domTT_mousemove(this, in_event); };
}
 
if (typeof(tipOwner.onmouseout) != 'function')
{
tipOwner.onmouseout = function(in_event) { domTT_mouseout(this, in_event); };
}
 
if (in_options.get('type') == 'sticky')
{
if (in_options.get('position') == 'absolute' && domTT_dragEnabled && in_options.get('draggable'))
{
if (domLib_isIE)
{
captionRow.onselectstart = function() { return false; };
}
 
// setup drag
captionRow.onmousedown = function(in_event) { domTT_dragStart(tipObj, in_event); };
captionRow.onmousemove = function(in_event) { domTT_dragUpdate(in_event); };
captionRow.onmouseup = function() { domTT_dragStop(); };
}
}
else if (in_options.get('type') == 'velcro')
{
/* can use once we have deactivateDelay
tipObj.onmouseover = function(in_event)
{
if (typeof(in_event) == 'undefined') { in_event = window.event; }
var tooltip = domTT_tooltips.get(tipObj.id);
if (in_options.get('lifetime')) {
domLib_clearTimeout(in_options.get('lifetimeTimeout');
}
};
*/
tipObj.onmouseout = function(in_event)
{
if (typeof(in_event) == 'undefined') { in_event = window.event; }
if (!domLib_isDescendantOf(in_event[domLib_eventTo], tipObj, domTT_bannedTags)) {
domTT_deactivate(tipOwner.id);
}
};
// NOTE: this might interfere with links in the tip
tipObj.onclick = function(in_event)
{
domTT_deactivate(tipOwner.id);
};
}
 
if (in_options.get('position') == 'relative')
{
tipObj.style.position = 'relative';
}
 
in_options.set('node', tipObj);
in_options.set('status', 'inactive');
}
 
// }}}
// {{{ domTT_show()
 
// in_id is either tip id or the owner id
function domTT_show(in_id, in_event)
{
 
// should always find one since this call would be cancelled if tip was killed
var tooltip = domTT_tooltips.get(in_id);
var status = tooltip.get('status');
var tipObj = tooltip.get('node');
 
if (tooltip.get('position') == 'absolute')
{
var mouseX, mouseY;
 
if (tooltip.has('x') && tooltip.has('y'))
{
mouseX = tooltip.get('x');
mouseY = tooltip.get('y');
}
else if (!domTT_useGlobalMousePosition || domTT_mousePosition == null || status == 'active' || tooltip.get('delay') == 0)
{
var eventPosition = domLib_getEventPosition(in_event);
var eventX = eventPosition.get('x');
var eventY = eventPosition.get('y');
if (tooltip.get('inframe'))
{
eventX -= eventPosition.get('scrollX');
eventY -= eventPosition.get('scrollY');
}
 
// only move tip along requested trail axis when updating position
if (status == 'active' && tooltip.get('trail') !== true)
{
var trail = tooltip.get('trail');
if (trail == 'x')
{
mouseX = eventX;
mouseY = tooltip.get('mouseY');
}
else if (trail == 'y')
{
mouseX = tooltip.get('mouseX');
mouseY = eventY;
}
}
else
{
mouseX = eventX;
mouseY = eventY;
}
}
else
{
mouseX = domTT_mousePosition.get('x');
mouseY = domTT_mousePosition.get('y');
if (tooltip.get('inframe'))
{
mouseX -= domTT_mousePosition.get('scrollX');
mouseY -= domTT_mousePosition.get('scrollY');
}
}
 
// we are using a grid for updates
if (tooltip.get('grid'))
{
// if this is not a mousemove event or it is a mousemove event on an active tip and
// the movement is bigger than the grid
if (in_event.type != 'mousemove' || (status == 'active' && (Math.abs(tooltip.get('lastX') - mouseX) > tooltip.get('grid') || Math.abs(tooltip.get('lastY') - mouseY) > tooltip.get('grid'))))
{
tooltip.set('lastX', mouseX);
tooltip.set('lastY', mouseY);
}
// did not satisfy the grid movement requirement
else
{
return false;
}
}
 
// mouseX and mouseY store the last acknowleged mouse position,
// good for trailing on one axis
tooltip.set('mouseX', mouseX);
tooltip.set('mouseY', mouseY);
 
var coordinates;
if (domTT_screenEdgeDetection)
{
coordinates = domTT_correctEdgeBleed(
tooltip.get('offsetWidth'),
tooltip.get('offsetHeight'),
mouseX,
mouseY,
tooltip.get('offsetX'),
tooltip.get('offsetY'),
tooltip.get('mouseOffset'),
tooltip.get('inframe') ? window.parent : window
);
}
else
{
coordinates = {
'x' : mouseX + tooltip.get('offsetX'),
'y' : mouseY + tooltip.get('offsetY') + tooltip.get('mouseOffset')
};
}
 
// update the position
tipObj.style.left = coordinates.x + 'px';
tipObj.style.top = coordinates.y + 'px';
 
// increase the tip zIndex so it goes over previously shown tips
tipObj.style.zIndex = domLib_zIndex++;
}
 
// if tip is not active, active it now and check for a fade in
if (status == 'pending')
{
// unhide the tooltip
tooltip.set('status', 'active');
tipObj.style.display = '';
tipObj.style.visibility = 'visible';
 
var fade = tooltip.get('fade');
if (fade != 'neither')
{
var fadeHandler = tooltip.get('fadeHandler');
if (fade == 'out' || fade == 'both')
{
fadeHandler.haltFade();
if (fade == 'out')
{
fadeHandler.halt();
}
}
 
if (fade == 'in' || fade == 'both')
{
fadeHandler.fadeIn();
}
}
 
if (tooltip.get('type') == 'greasy' && tooltip.get('lifetime') != 0)
{
tooltip.set('lifetimeTimeout', domLib_setTimeout(domTT_runDeactivate, tooltip.get('lifetime'), [tipObj.id]));
}
}
 
if (tooltip.get('position') == 'absolute' && domTT_detectCollisions)
{
// utilize original collision element cache
domLib_detectCollisions(tipObj, false, true);
}
}
 
// }}}
// {{{ domTT_close()
 
// in_handle can either be an child object of the tip, the tip id or the owner id
function domTT_close(in_handle)
{
var id;
if (typeof(in_handle) == 'object' && in_handle.nodeType)
{
var obj = in_handle;
while (!obj.id || !domTT_tooltips.get(obj.id))
{
obj = obj.parentNode;
if (obj.nodeType != document.ELEMENT_NODE) { return; }
}
 
id = obj.id;
}
else
{
id = in_handle;
}
 
domTT_deactivate(id);
}
 
// }}}
// {{{ domTT_closeAll()
 
// run through the tooltips and close them all
function domTT_closeAll()
{
// NOTE: this will iterate 2x # of tooltips
for (var id in domTT_tooltips.elementData) {
domTT_close(id);
}
}
 
// }}}
// {{{ domTT_deactivate()
 
// in_id is either the tip id or the owner id
function domTT_deactivate(in_id)
{
var tooltip = domTT_tooltips.get(in_id);
if (tooltip)
{
var status = tooltip.get('status');
if (status == 'pending')
{
// cancel the creation of this tip if it is still pending
domLib_clearTimeout(tooltip.get('activateTimeout'));
tooltip.set('status', 'inactive');
}
else if (status == 'active')
{
if (tooltip.get('lifetime'))
{
domLib_clearTimeout(tooltip.get('lifetimeTimeout'));
}
 
var tipObj = tooltip.get('node');
if (tooltip.get('closeAction') == 'hide')
{
var fade = tooltip.get('fade');
if (fade != 'neither')
{
var fadeHandler = tooltip.get('fadeHandler');
if (fade == 'out' || fade == 'both')
{
fadeHandler.fadeOut();
}
else
{
fadeHandler.hide();
}
}
else
{
tipObj.style.display = 'none';
}
}
else
{
tooltip.get('parent').removeChild(tipObj);
domTT_tooltips.remove(tooltip.get('owner').id);
domTT_tooltips.remove(tooltip.get('id'));
}
 
tooltip.set('status', 'inactive');
if (domTT_detectCollisions) {
// unhide all of the selects that are owned by this object
// utilize original collision element cache
domLib_detectCollisions(tipObj, true, true);
}
}
}
}
 
// }}}
// {{{ domTT_mouseout()
 
function domTT_mouseout(in_owner, in_event)
{
if (!domLib_useLibrary) { return false; }
 
if (typeof(in_event) == 'undefined') { in_event = window.event; }
 
var toChild = domLib_isDescendantOf(in_event[domLib_eventTo], in_owner, domTT_bannedTags);
var tooltip = domTT_tooltips.get(in_owner.id);
if (tooltip && (tooltip.get('type') == 'greasy' || tooltip.get('status') != 'active'))
{
// deactivate tip if exists and we moved away from the owner
if (!toChild)
{
domTT_deactivate(in_owner.id);
try { window.status = window.defaultStatus; } catch(e) {}
}
}
else if (!toChild)
{
try { window.status = window.defaultStatus; } catch(e) {}
}
}
 
// }}}
// {{{ domTT_mousemove()
 
function domTT_mousemove(in_owner, in_event)
{
if (!domLib_useLibrary) { return false; }
 
if (typeof(in_event) == 'undefined') { in_event = window.event; }
 
var tooltip = domTT_tooltips.get(in_owner.id);
if (tooltip && tooltip.get('trail') && tooltip.get('status') == 'active')
{
// see if we are trailing lazy
if (tooltip.get('lazy'))
{
domLib_setTimeout(domTT_runShow, domTT_trailDelay, [in_owner.id, in_event]);
}
else
{
domTT_show(in_owner.id, in_event);
}
}
}
 
// }}}
// {{{ domTT_addPredefined()
 
function domTT_addPredefined(in_id)
{
var options = new Hash();
for (var i = 1; i < arguments.length; i += 2)
{
options.set(arguments[i], arguments[i + 1]);
}
 
domTT_predefined.set(in_id, options);
}
 
// }}}
// {{{ domTT_correctEdgeBleed()
 
function domTT_correctEdgeBleed(in_width, in_height, in_x, in_y, in_offsetX, in_offsetY, in_mouseOffset, in_window)
{
var win, doc;
var bleedRight, bleedBottom;
var pageHeight, pageWidth, pageYOffset, pageXOffset;
 
var x = in_x + in_offsetX;
var y = in_y + in_offsetY + in_mouseOffset;
 
win = (typeof(in_window) == 'undefined' ? window : in_window);
 
// Gecko and IE swaps values of clientHeight, clientWidth properties when
// in standards compliance mode from documentElement to document.body
doc = ((domLib_standardsMode && (domLib_isIE || domLib_isGecko)) ? win.document.documentElement : win.document.body);
 
// for IE in compliance mode
if (domLib_isIE)
{
pageHeight = doc.clientHeight;
pageWidth = doc.clientWidth;
pageYOffset = doc.scrollTop;
pageXOffset = doc.scrollLeft;
}
else
{
pageHeight = doc.clientHeight;
pageWidth = doc.clientWidth;
 
if (domLib_isKHTML)
{
pageHeight = win.innerHeight;
}
 
pageYOffset = win.pageYOffset;
pageXOffset = win.pageXOffset;
}
 
// we are bleeding off the right, move tip over to stay on page
// logic: take x position, add width and subtract from effective page width
if ((bleedRight = (x - pageXOffset) + in_width - (pageWidth - domTT_screenEdgePadding)) > 0)
{
x -= bleedRight;
}
 
// we are bleeding to the left, move tip over to stay on page
// if tip doesn't fit, we will go back to bleeding off the right
// logic: take x position and check if less than edge padding
if ((x - pageXOffset) < domTT_screenEdgePadding)
{
x = domTT_screenEdgePadding + pageXOffset;
}
 
// if we are bleeding off the bottom, flip to north
// logic: take y position, add height and subtract from effective page height
if ((bleedBottom = (y - pageYOffset) + in_height - (pageHeight - domTT_screenEdgePadding)) > 0)
{
y = in_y - in_height - in_offsetY;
}
 
// if we are bleeding off the top, flip to south
// if tip doesn't fit, we will go back to bleeding off the bottom
// logic: take y position and check if less than edge padding
if ((y - pageYOffset) < domTT_screenEdgePadding)
{
y = in_y + domTT_mouseHeight + in_offsetY;
}
 
return {'x' : x, 'y' : y};
}
 
// }}}
// {{{ domTT_isActive()
 
// in_id is either the tip id or the owner id
function domTT_isActive(in_id)
{
var tooltip = domTT_tooltips.get(in_id);
if (!tooltip || tooltip.get('status') != 'active')
{
return false;
}
else
{
return true;
}
}
 
// }}}
// {{{ domTT_runXXX()
 
// All of these domMenu_runXXX() methods are used by the event handling sections to
// avoid the circular memory leaks caused by inner functions
function domTT_runDeactivate(args) { domTT_deactivate(args[0]); }
function domTT_runShow(args) { domTT_show(args[0], args[1]); }
 
// }}}
// {{{ domTT_replaceTitles()
 
function domTT_replaceTitles(in_decorator)
{
var elements = domLib_getElementsByClass('tooltip');
for (var i = 0; i < elements.length; i++)
{
if (elements[i].title)
{
var content;
if (typeof(in_decorator) == 'function')
{
content = in_decorator(elements[i]);
}
else
{
content = elements[i].title;
}
 
content = content.replace(new RegExp('\'', 'g'), '\\\'');
elements[i].onmouseover = new Function('in_event', "domTT_activate(this, in_event, 'content', '" + content + "')");
elements[i].title = '';
}
}
}
 
// }}}
// {{{ domTT_update()
 
// Allow authors to update the contents of existing tips using the DOM
// Unfortunately, the tip must already exist, or else no work is done.
// TODO: make getting at content or caption cleaner
function domTT_update(handle, content, type)
{
// type defaults to 'content', can also be 'caption'
if (typeof(type) == 'undefined')
{
type = 'content';
}
 
var tip = domTT_tooltips.get(handle);
if (!tip)
{
return;
}
 
var tipObj = tip.get('node');
var updateNode;
if (type == 'content')
{
// <div class="contents">...
updateNode = tipObj.firstChild;
if (updateNode.className != 'contents')
{
// <table><tbody><tr>...</tr><tr><td><div class="contents">...
updateNode = updateNode.firstChild.firstChild.nextSibling.firstChild.firstChild;
}
}
else
{
updateNode = tipObj.firstChild;
if (updateNode.className == 'contents')
{
// missing caption
return;
}
 
// <table><tbody><tr><td><div class="caption">...
updateNode = updateNode.firstChild.firstChild.firstChild.firstChild;
}
 
// TODO: allow for a DOM node as content
updateNode.innerHTML = content;
}
 
// }}}
/tags/Racine_livraison_narmer/api/js/domtooltip/fadomatic.js
New file
0,0 → 1,180
/** $Id: fadomatic.js,v 1.1 2007-03-16 12:39:35 jp_milcent Exp $ */
// Title: Fadomatic
// Version: 1.2
// Homepage: http://chimpen.com/fadomatic
// Author: Philip McCarthy <fadomatic@chimpen.com>
 
// Fade interval in milliseconds
// Make this larger if you experience performance issues
Fadomatic.INTERVAL_MILLIS = 50;
 
// Creates a fader
// element - The element to fade
// speed - The speed to fade at, from 0.0 to 100.0
// initialOpacity (optional, default 100) - element's starting opacity, 0 to 100
// minOpacity (optional, default 0) - element's minimum opacity, 0 to 100
// maxOpacity (optional, default 0) - element's minimum opacity, 0 to 100
function Fadomatic (element, rate, initialOpacity, minOpacity, maxOpacity) {
this._element = element;
this._intervalId = null;
this._rate = rate;
this._isFadeOut = true;
 
// Set initial opacity and bounds
// NB use 99 instead of 100 to avoid flicker at start of fade
this._minOpacity = 0;
this._maxOpacity = 99;
this._opacity = 99;
 
if (typeof minOpacity != 'undefined') {
if (minOpacity < 0) {
this._minOpacity = 0;
} else if (minOpacity > 99) {
this._minOpacity = 99;
} else {
this._minOpacity = minOpacity;
}
}
 
if (typeof maxOpacity != 'undefined') {
if (maxOpacity < 0) {
this._maxOpacity = 0;
} else if (maxOpacity > 99) {
this._maxOpacity = 99;
} else {
this._maxOpacity = maxOpacity;
}
 
if (this._maxOpacity < this._minOpacity) {
this._maxOpacity = this._minOpacity;
}
}
if (typeof initialOpacity != 'undefined') {
if (initialOpacity > this._maxOpacity) {
this._opacity = this._maxOpacity;
} else if (initialOpacity < this._minOpacity) {
this._opacity = this._minOpacity;
} else {
this._opacity = initialOpacity;
}
}
 
// See if we're using W3C opacity, MSIE filter, or just
// toggling visiblity
if(typeof element.style.opacity != 'undefined') {
 
this._updateOpacity = this._updateOpacityW3c;
 
} else if(typeof element.style.filter != 'undefined') {
 
// If there's not an alpha filter on the element already,
// add one
if (element.style.filter.indexOf("alpha") == -1) {
 
// Attempt to preserve existing filters
var existingFilters="";
if (element.style.filter) {
existingFilters = element.style.filter+" ";
}
element.style.filter = existingFilters+"alpha(opacity="+this._opacity+")";
}
 
this._updateOpacity = this._updateOpacityMSIE;
} else {
 
this._updateOpacity = this._updateVisibility;
}
 
this._updateOpacity();
}
 
// Initiates a fade out
Fadomatic.prototype.fadeOut = function () {
this._isFadeOut = true;
this._beginFade();
}
 
// Initiates a fade in
Fadomatic.prototype.fadeIn = function () {
this._isFadeOut = false;
this._beginFade();
}
 
// Makes the element completely opaque, stops any fade in progress
Fadomatic.prototype.show = function () {
this.haltFade();
this._opacity = this._maxOpacity;
this._updateOpacity();
}
 
// Makes the element completely transparent, stops any fade in progress
Fadomatic.prototype.hide = function () {
this.haltFade();
this._opacity = 0;
this._updateOpacity();
}
 
// Halts any fade in progress
Fadomatic.prototype.haltFade = function () {
 
clearInterval(this._intervalId);
}
 
// Resumes a fade where it was halted
Fadomatic.prototype.resumeFade = function () {
 
this._beginFade();
}
 
// Pseudo-private members
 
Fadomatic.prototype._beginFade = function () {
 
this.haltFade();
var objref = this;
this._intervalId = setInterval(function() { objref._tickFade(); },Fadomatic.INTERVAL_MILLIS);
}
 
Fadomatic.prototype._tickFade = function () {
 
if (this._isFadeOut) {
this._opacity -= this._rate;
if (this._opacity < this._minOpacity) {
this._opacity = this._minOpacity;
this.haltFade();
}
} else {
this._opacity += this._rate;
if (this._opacity > this._maxOpacity ) {
this._opacity = this._maxOpacity;
this.haltFade();
}
}
 
this._updateOpacity();
}
 
Fadomatic.prototype._updateVisibility = function () {
if (this._opacity > 0) {
this._element.style.visibility = 'visible';
} else {
this._element.style.visibility = 'hidden';
}
}
 
Fadomatic.prototype._updateOpacityW3c = function () {
this._element.style.opacity = this._opacity/100;
this._updateVisibility();
}
 
Fadomatic.prototype._updateOpacityMSIE = function () {
this._element.filters.alpha.opacity = this._opacity;
this._updateVisibility();
}
 
Fadomatic.prototype._updateOpacity = null;
/tags/Racine_livraison_narmer/api/js/dojo/Storage_version8.swf
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/Storage_version8.swf
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/storage_dialog.swf
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/storage_dialog.swf
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/LICENSE
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/LICENSE
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/flash6_gateway.swf
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/flash6_gateway.swf
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/DojoFileStorageProvider.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/DojoFileStorageProvider.jar
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/dojo.js
New file
0,0 → 1,6411
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
/*
This is a compiled version of Dojo, built for deployment and not for
development. To get an editable version, please visit:
 
http://dojotoolkit.org
 
for documentation and information on getting the source.
*/
 
if(typeof dojo=="undefined"){
var dj_global=this;
var dj_currentContext=this;
function dj_undef(_1,_2){
return (typeof (_2||dj_currentContext)[_1]=="undefined");
}
if(dj_undef("djConfig",this)){
var djConfig={};
}
if(dj_undef("dojo",this)){
var dojo={};
}
dojo.global=function(){
return dj_currentContext;
};
dojo.locale=djConfig.locale;
dojo.version={major:0,minor:4,patch:2,flag:"",revision:Number("$Rev: 7616 $".match(/[0-9]+/)[0]),toString:function(){
with(dojo.version){
return major+"."+minor+"."+patch+flag+" ("+revision+")";
}
}};
dojo.evalProp=function(_3,_4,_5){
if((!_4)||(!_3)){
return undefined;
}
if(!dj_undef(_3,_4)){
return _4[_3];
}
return (_5?(_4[_3]={}):undefined);
};
dojo.parseObjPath=function(_6,_7,_8){
var _9=(_7||dojo.global());
var _a=_6.split(".");
var _b=_a.pop();
for(var i=0,l=_a.length;i<l&&_9;i++){
_9=dojo.evalProp(_a[i],_9,_8);
}
return {obj:_9,prop:_b};
};
dojo.evalObjPath=function(_e,_f){
if(typeof _e!="string"){
return dojo.global();
}
if(_e.indexOf(".")==-1){
return dojo.evalProp(_e,dojo.global(),_f);
}
var ref=dojo.parseObjPath(_e,dojo.global(),_f);
if(ref){
return dojo.evalProp(ref.prop,ref.obj,_f);
}
return null;
};
dojo.errorToString=function(_11){
if(!dj_undef("message",_11)){
return _11.message;
}else{
if(!dj_undef("description",_11)){
return _11.description;
}else{
return _11;
}
}
};
dojo.raise=function(_12,_13){
if(_13){
_12=_12+": "+dojo.errorToString(_13);
}else{
_12=dojo.errorToString(_12);
}
try{
if(djConfig.isDebug){
dojo.hostenv.println("FATAL exception raised: "+_12);
}
}
catch(e){
}
throw _13||Error(_12);
};
dojo.debug=function(){
};
dojo.debugShallow=function(obj){
};
dojo.profile={start:function(){
},end:function(){
},stop:function(){
},dump:function(){
}};
function dj_eval(_15){
return dj_global.eval?dj_global.eval(_15):eval(_15);
}
dojo.unimplemented=function(_16,_17){
var _18="'"+_16+"' not implemented";
if(_17!=null){
_18+=" "+_17;
}
dojo.raise(_18);
};
dojo.deprecated=function(_19,_1a,_1b){
var _1c="DEPRECATED: "+_19;
if(_1a){
_1c+=" "+_1a;
}
if(_1b){
_1c+=" -- will be removed in version: "+_1b;
}
dojo.debug(_1c);
};
dojo.render=(function(){
function vscaffold(_1d,_1e){
var tmp={capable:false,support:{builtin:false,plugin:false},prefixes:_1d};
for(var i=0;i<_1e.length;i++){
tmp[_1e[i]]=false;
}
return tmp;
}
return {name:"",ver:dojo.version,os:{win:false,linux:false,osx:false},html:vscaffold(["html"],["ie","opera","khtml","safari","moz"]),svg:vscaffold(["svg"],["corel","adobe","batik"]),vml:vscaffold(["vml"],["ie"]),swf:vscaffold(["Swf","Flash","Mm"],["mm"]),swt:vscaffold(["Swt"],["ibm"])};
})();
dojo.hostenv=(function(){
var _21={isDebug:false,allowQueryConfig:false,baseScriptUri:"",baseRelativePath:"",libraryScriptUri:"",iePreventClobber:false,ieClobberMinimal:true,preventBackButtonFix:true,delayMozLoadingFix:false,searchIds:[],parseWidgets:true};
if(typeof djConfig=="undefined"){
djConfig=_21;
}else{
for(var _22 in _21){
if(typeof djConfig[_22]=="undefined"){
djConfig[_22]=_21[_22];
}
}
}
return {name_:"(unset)",version_:"(unset)",getName:function(){
return this.name_;
},getVersion:function(){
return this.version_;
},getText:function(uri){
dojo.unimplemented("getText","uri="+uri);
}};
})();
dojo.hostenv.getBaseScriptUri=function(){
if(djConfig.baseScriptUri.length){
return djConfig.baseScriptUri;
}
var uri=new String(djConfig.libraryScriptUri||djConfig.baseRelativePath);
if(!uri){
dojo.raise("Nothing returned by getLibraryScriptUri(): "+uri);
}
var _25=uri.lastIndexOf("/");
djConfig.baseScriptUri=djConfig.baseRelativePath;
return djConfig.baseScriptUri;
};
(function(){
var _26={pkgFileName:"__package__",loading_modules_:{},loaded_modules_:{},addedToLoadingCount:[],removedFromLoadingCount:[],inFlightCount:0,modulePrefixes_:{dojo:{name:"dojo",value:"src"}},setModulePrefix:function(_27,_28){
this.modulePrefixes_[_27]={name:_27,value:_28};
},moduleHasPrefix:function(_29){
var mp=this.modulePrefixes_;
return Boolean(mp[_29]&&mp[_29].value);
},getModulePrefix:function(_2b){
if(this.moduleHasPrefix(_2b)){
return this.modulePrefixes_[_2b].value;
}
return _2b;
},getTextStack:[],loadUriStack:[],loadedUris:[],post_load_:false,modulesLoadedListeners:[],unloadListeners:[],loadNotifying:false};
for(var _2c in _26){
dojo.hostenv[_2c]=_26[_2c];
}
})();
dojo.hostenv.loadPath=function(_2d,_2e,cb){
var uri;
if(_2d.charAt(0)=="/"||_2d.match(/^\w+:/)){
uri=_2d;
}else{
uri=this.getBaseScriptUri()+_2d;
}
if(djConfig.cacheBust&&dojo.render.html.capable){
uri+="?"+String(djConfig.cacheBust).replace(/\W+/g,"");
}
try{
return !_2e?this.loadUri(uri,cb):this.loadUriAndCheck(uri,_2e,cb);
}
catch(e){
dojo.debug(e);
return false;
}
};
dojo.hostenv.loadUri=function(uri,cb){
if(this.loadedUris[uri]){
return true;
}
var _33=this.getText(uri,null,true);
if(!_33){
return false;
}
this.loadedUris[uri]=true;
if(cb){
_33="("+_33+")";
}
var _34=dj_eval(_33);
if(cb){
cb(_34);
}
return true;
};
dojo.hostenv.loadUriAndCheck=function(uri,_36,cb){
var ok=true;
try{
ok=this.loadUri(uri,cb);
}
catch(e){
dojo.debug("failed loading ",uri," with error: ",e);
}
return Boolean(ok&&this.findModule(_36,false));
};
dojo.loaded=function(){
};
dojo.unloaded=function(){
};
dojo.hostenv.loaded=function(){
this.loadNotifying=true;
this.post_load_=true;
var mll=this.modulesLoadedListeners;
for(var x=0;x<mll.length;x++){
mll[x]();
}
this.modulesLoadedListeners=[];
this.loadNotifying=false;
dojo.loaded();
};
dojo.hostenv.unloaded=function(){
var mll=this.unloadListeners;
while(mll.length){
(mll.pop())();
}
dojo.unloaded();
};
dojo.addOnLoad=function(obj,_3d){
var dh=dojo.hostenv;
if(arguments.length==1){
dh.modulesLoadedListeners.push(obj);
}else{
if(arguments.length>1){
dh.modulesLoadedListeners.push(function(){
obj[_3d]();
});
}
}
if(dh.post_load_&&dh.inFlightCount==0&&!dh.loadNotifying){
dh.callLoaded();
}
};
dojo.addOnUnload=function(obj,_40){
var dh=dojo.hostenv;
if(arguments.length==1){
dh.unloadListeners.push(obj);
}else{
if(arguments.length>1){
dh.unloadListeners.push(function(){
obj[_40]();
});
}
}
};
dojo.hostenv.modulesLoaded=function(){
if(this.post_load_){
return;
}
if(this.loadUriStack.length==0&&this.getTextStack.length==0){
if(this.inFlightCount>0){
dojo.debug("files still in flight!");
return;
}
dojo.hostenv.callLoaded();
}
};
dojo.hostenv.callLoaded=function(){
if(typeof setTimeout=="object"||(djConfig["useXDomain"]&&dojo.render.html.opera)){
setTimeout("dojo.hostenv.loaded();",0);
}else{
dojo.hostenv.loaded();
}
};
dojo.hostenv.getModuleSymbols=function(_42){
var _43=_42.split(".");
for(var i=_43.length;i>0;i--){
var _45=_43.slice(0,i).join(".");
if((i==1)&&!this.moduleHasPrefix(_45)){
_43[0]="../"+_43[0];
}else{
var _46=this.getModulePrefix(_45);
if(_46!=_45){
_43.splice(0,i,_46);
break;
}
}
}
return _43;
};
dojo.hostenv._global_omit_module_check=false;
dojo.hostenv.loadModule=function(_47,_48,_49){
if(!_47){
return;
}
_49=this._global_omit_module_check||_49;
var _4a=this.findModule(_47,false);
if(_4a){
return _4a;
}
if(dj_undef(_47,this.loading_modules_)){
this.addedToLoadingCount.push(_47);
}
this.loading_modules_[_47]=1;
var _4b=_47.replace(/\./g,"/")+".js";
var _4c=_47.split(".");
var _4d=this.getModuleSymbols(_47);
var _4e=((_4d[0].charAt(0)!="/")&&!_4d[0].match(/^\w+:/));
var _4f=_4d[_4d.length-1];
var ok;
if(_4f=="*"){
_47=_4c.slice(0,-1).join(".");
while(_4d.length){
_4d.pop();
_4d.push(this.pkgFileName);
_4b=_4d.join("/")+".js";
if(_4e&&_4b.charAt(0)=="/"){
_4b=_4b.slice(1);
}
ok=this.loadPath(_4b,!_49?_47:null);
if(ok){
break;
}
_4d.pop();
}
}else{
_4b=_4d.join("/")+".js";
_47=_4c.join(".");
var _51=!_49?_47:null;
ok=this.loadPath(_4b,_51);
if(!ok&&!_48){
_4d.pop();
while(_4d.length){
_4b=_4d.join("/")+".js";
ok=this.loadPath(_4b,_51);
if(ok){
break;
}
_4d.pop();
_4b=_4d.join("/")+"/"+this.pkgFileName+".js";
if(_4e&&_4b.charAt(0)=="/"){
_4b=_4b.slice(1);
}
ok=this.loadPath(_4b,_51);
if(ok){
break;
}
}
}
if(!ok&&!_49){
dojo.raise("Could not load '"+_47+"'; last tried '"+_4b+"'");
}
}
if(!_49&&!this["isXDomain"]){
_4a=this.findModule(_47,false);
if(!_4a){
dojo.raise("symbol '"+_47+"' is not defined after loading '"+_4b+"'");
}
}
return _4a;
};
dojo.hostenv.startPackage=function(_52){
var _53=String(_52);
var _54=_53;
var _55=_52.split(/\./);
if(_55[_55.length-1]=="*"){
_55.pop();
_54=_55.join(".");
}
var _56=dojo.evalObjPath(_54,true);
this.loaded_modules_[_53]=_56;
this.loaded_modules_[_54]=_56;
return _56;
};
dojo.hostenv.findModule=function(_57,_58){
var lmn=String(_57);
if(this.loaded_modules_[lmn]){
return this.loaded_modules_[lmn];
}
if(_58){
dojo.raise("no loaded module named '"+_57+"'");
}
return null;
};
dojo.kwCompoundRequire=function(_5a){
var _5b=_5a["common"]||[];
var _5c=_5a[dojo.hostenv.name_]?_5b.concat(_5a[dojo.hostenv.name_]||[]):_5b.concat(_5a["default"]||[]);
for(var x=0;x<_5c.length;x++){
var _5e=_5c[x];
if(_5e.constructor==Array){
dojo.hostenv.loadModule.apply(dojo.hostenv,_5e);
}else{
dojo.hostenv.loadModule(_5e);
}
}
};
dojo.require=function(_5f){
dojo.hostenv.loadModule.apply(dojo.hostenv,arguments);
};
dojo.requireIf=function(_60,_61){
var _62=arguments[0];
if((_62===true)||(_62=="common")||(_62&&dojo.render[_62].capable)){
var _63=[];
for(var i=1;i<arguments.length;i++){
_63.push(arguments[i]);
}
dojo.require.apply(dojo,_63);
}
};
dojo.requireAfterIf=dojo.requireIf;
dojo.provide=function(_65){
return dojo.hostenv.startPackage.apply(dojo.hostenv,arguments);
};
dojo.registerModulePath=function(_66,_67){
return dojo.hostenv.setModulePrefix(_66,_67);
};
if(djConfig["modulePaths"]){
for(var param in djConfig["modulePaths"]){
dojo.registerModulePath(param,djConfig["modulePaths"][param]);
}
}
dojo.setModulePrefix=function(_68,_69){
dojo.deprecated("dojo.setModulePrefix(\""+_68+"\", \""+_69+"\")","replaced by dojo.registerModulePath","0.5");
return dojo.registerModulePath(_68,_69);
};
dojo.exists=function(obj,_6b){
var p=_6b.split(".");
for(var i=0;i<p.length;i++){
if(!obj[p[i]]){
return false;
}
obj=obj[p[i]];
}
return true;
};
dojo.hostenv.normalizeLocale=function(_6e){
var _6f=_6e?_6e.toLowerCase():dojo.locale;
if(_6f=="root"){
_6f="ROOT";
}
return _6f;
};
dojo.hostenv.searchLocalePath=function(_70,_71,_72){
_70=dojo.hostenv.normalizeLocale(_70);
var _73=_70.split("-");
var _74=[];
for(var i=_73.length;i>0;i--){
_74.push(_73.slice(0,i).join("-"));
}
_74.push(false);
if(_71){
_74.reverse();
}
for(var j=_74.length-1;j>=0;j--){
var loc=_74[j]||"ROOT";
var _78=_72(loc);
if(_78){
break;
}
}
};
dojo.hostenv.localesGenerated;
dojo.hostenv.registerNlsPrefix=function(){
dojo.registerModulePath("nls","nls");
};
dojo.hostenv.preloadLocalizations=function(){
if(dojo.hostenv.localesGenerated){
dojo.hostenv.registerNlsPrefix();
function preload(_79){
_79=dojo.hostenv.normalizeLocale(_79);
dojo.hostenv.searchLocalePath(_79,true,function(loc){
for(var i=0;i<dojo.hostenv.localesGenerated.length;i++){
if(dojo.hostenv.localesGenerated[i]==loc){
dojo["require"]("nls.dojo_"+loc);
return true;
}
}
return false;
});
}
preload();
var _7c=djConfig.extraLocale||[];
for(var i=0;i<_7c.length;i++){
preload(_7c[i]);
}
}
dojo.hostenv.preloadLocalizations=function(){
};
};
dojo.requireLocalization=function(_7e,_7f,_80,_81){
dojo.hostenv.preloadLocalizations();
var _82=dojo.hostenv.normalizeLocale(_80);
var _83=[_7e,"nls",_7f].join(".");
var _84="";
if(_81){
var _85=_81.split(",");
for(var i=0;i<_85.length;i++){
if(_82.indexOf(_85[i])==0){
if(_85[i].length>_84.length){
_84=_85[i];
}
}
}
if(!_84){
_84="ROOT";
}
}
var _87=_81?_84:_82;
var _88=dojo.hostenv.findModule(_83);
var _89=null;
if(_88){
if(djConfig.localizationComplete&&_88._built){
return;
}
var _8a=_87.replace("-","_");
var _8b=_83+"."+_8a;
_89=dojo.hostenv.findModule(_8b);
}
if(!_89){
_88=dojo.hostenv.startPackage(_83);
var _8c=dojo.hostenv.getModuleSymbols(_7e);
var _8d=_8c.concat("nls").join("/");
var _8e;
dojo.hostenv.searchLocalePath(_87,_81,function(loc){
var _90=loc.replace("-","_");
var _91=_83+"."+_90;
var _92=false;
if(!dojo.hostenv.findModule(_91)){
dojo.hostenv.startPackage(_91);
var _93=[_8d];
if(loc!="ROOT"){
_93.push(loc);
}
_93.push(_7f);
var _94=_93.join("/")+".js";
_92=dojo.hostenv.loadPath(_94,null,function(_95){
var _96=function(){
};
_96.prototype=_8e;
_88[_90]=new _96();
for(var j in _95){
_88[_90][j]=_95[j];
}
});
}else{
_92=true;
}
if(_92&&_88[_90]){
_8e=_88[_90];
}else{
_88[_90]=_8e;
}
if(_81){
return true;
}
});
}
if(_81&&_82!=_84){
_88[_82.replace("-","_")]=_88[_84.replace("-","_")];
}
};
(function(){
var _98=djConfig.extraLocale;
if(_98){
if(!_98 instanceof Array){
_98=[_98];
}
var req=dojo.requireLocalization;
dojo.requireLocalization=function(m,b,_9c,_9d){
req(m,b,_9c,_9d);
if(_9c){
return;
}
for(var i=0;i<_98.length;i++){
req(m,b,_98[i],_9d);
}
};
}
})();
}
if(typeof window!="undefined"){
(function(){
if(djConfig.allowQueryConfig){
var _9f=document.location.toString();
var _a0=_9f.split("?",2);
if(_a0.length>1){
var _a1=_a0[1];
var _a2=_a1.split("&");
for(var x in _a2){
var sp=_a2[x].split("=");
if((sp[0].length>9)&&(sp[0].substr(0,9)=="djConfig.")){
var opt=sp[0].substr(9);
try{
djConfig[opt]=eval(sp[1]);
}
catch(e){
djConfig[opt]=sp[1];
}
}
}
}
}
if(((djConfig["baseScriptUri"]=="")||(djConfig["baseRelativePath"]==""))&&(document&&document.getElementsByTagName)){
var _a6=document.getElementsByTagName("script");
var _a7=/(__package__|dojo|bootstrap1)\.js([\?\.]|$)/i;
for(var i=0;i<_a6.length;i++){
var src=_a6[i].getAttribute("src");
if(!src){
continue;
}
var m=src.match(_a7);
if(m){
var _ab=src.substring(0,m.index);
if(src.indexOf("bootstrap1")>-1){
_ab+="../";
}
if(!this["djConfig"]){
djConfig={};
}
if(djConfig["baseScriptUri"]==""){
djConfig["baseScriptUri"]=_ab;
}
if(djConfig["baseRelativePath"]==""){
djConfig["baseRelativePath"]=_ab;
}
break;
}
}
}
var dr=dojo.render;
var drh=dojo.render.html;
var drs=dojo.render.svg;
var dua=(drh.UA=navigator.userAgent);
var dav=(drh.AV=navigator.appVersion);
var t=true;
var f=false;
drh.capable=t;
drh.support.builtin=t;
dr.ver=parseFloat(drh.AV);
dr.os.mac=dav.indexOf("Macintosh")>=0;
dr.os.win=dav.indexOf("Windows")>=0;
dr.os.linux=dav.indexOf("X11")>=0;
drh.opera=dua.indexOf("Opera")>=0;
drh.khtml=(dav.indexOf("Konqueror")>=0)||(dav.indexOf("Safari")>=0);
drh.safari=dav.indexOf("Safari")>=0;
var _b3=dua.indexOf("Gecko");
drh.mozilla=drh.moz=(_b3>=0)&&(!drh.khtml);
if(drh.mozilla){
drh.geckoVersion=dua.substring(_b3+6,_b3+14);
}
drh.ie=(document.all)&&(!drh.opera);
drh.ie50=drh.ie&&dav.indexOf("MSIE 5.0")>=0;
drh.ie55=drh.ie&&dav.indexOf("MSIE 5.5")>=0;
drh.ie60=drh.ie&&dav.indexOf("MSIE 6.0")>=0;
drh.ie70=drh.ie&&dav.indexOf("MSIE 7.0")>=0;
var cm=document["compatMode"];
drh.quirks=(cm=="BackCompat")||(cm=="QuirksMode")||drh.ie55||drh.ie50;
dojo.locale=dojo.locale||(drh.ie?navigator.userLanguage:navigator.language).toLowerCase();
dr.vml.capable=drh.ie;
drs.capable=f;
drs.support.plugin=f;
drs.support.builtin=f;
var _b5=window["document"];
var tdi=_b5["implementation"];
if((tdi)&&(tdi["hasFeature"])&&(tdi.hasFeature("org.w3c.dom.svg","1.0"))){
drs.capable=t;
drs.support.builtin=t;
drs.support.plugin=f;
}
if(drh.safari){
var tmp=dua.split("AppleWebKit/")[1];
var ver=parseFloat(tmp.split(" ")[0]);
if(ver>=420){
drs.capable=t;
drs.support.builtin=t;
drs.support.plugin=f;
}
}else{
}
})();
dojo.hostenv.startPackage("dojo.hostenv");
dojo.render.name=dojo.hostenv.name_="browser";
dojo.hostenv.searchIds=[];
dojo.hostenv._XMLHTTP_PROGIDS=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];
dojo.hostenv.getXmlhttpObject=function(){
var _b9=null;
var _ba=null;
try{
_b9=new XMLHttpRequest();
}
catch(e){
}
if(!_b9){
for(var i=0;i<3;++i){
var _bc=dojo.hostenv._XMLHTTP_PROGIDS[i];
try{
_b9=new ActiveXObject(_bc);
}
catch(e){
_ba=e;
}
if(_b9){
dojo.hostenv._XMLHTTP_PROGIDS=[_bc];
break;
}
}
}
if(!_b9){
return dojo.raise("XMLHTTP not available",_ba);
}
return _b9;
};
dojo.hostenv._blockAsync=false;
dojo.hostenv.getText=function(uri,_be,_bf){
if(!_be){
this._blockAsync=true;
}
var _c0=this.getXmlhttpObject();
function isDocumentOk(_c1){
var _c2=_c1["status"];
return Boolean((!_c2)||((200<=_c2)&&(300>_c2))||(_c2==304));
}
if(_be){
var _c3=this,_c4=null,gbl=dojo.global();
var xhr=dojo.evalObjPath("dojo.io.XMLHTTPTransport");
_c0.onreadystatechange=function(){
if(_c4){
gbl.clearTimeout(_c4);
_c4=null;
}
if(_c3._blockAsync||(xhr&&xhr._blockAsync)){
_c4=gbl.setTimeout(function(){
_c0.onreadystatechange.apply(this);
},10);
}else{
if(4==_c0.readyState){
if(isDocumentOk(_c0)){
_be(_c0.responseText);
}
}
}
};
}
_c0.open("GET",uri,_be?true:false);
try{
_c0.send(null);
if(_be){
return null;
}
if(!isDocumentOk(_c0)){
var err=Error("Unable to load "+uri+" status:"+_c0.status);
err.status=_c0.status;
err.responseText=_c0.responseText;
throw err;
}
}
catch(e){
this._blockAsync=false;
if((_bf)&&(!_be)){
return null;
}else{
throw e;
}
}
this._blockAsync=false;
return _c0.responseText;
};
dojo.hostenv.defaultDebugContainerId="dojoDebug";
dojo.hostenv._println_buffer=[];
dojo.hostenv._println_safe=false;
dojo.hostenv.println=function(_c8){
if(!dojo.hostenv._println_safe){
dojo.hostenv._println_buffer.push(_c8);
}else{
try{
var _c9=document.getElementById(djConfig.debugContainerId?djConfig.debugContainerId:dojo.hostenv.defaultDebugContainerId);
if(!_c9){
_c9=dojo.body();
}
var div=document.createElement("div");
div.appendChild(document.createTextNode(_c8));
_c9.appendChild(div);
}
catch(e){
try{
document.write("<div>"+_c8+"</div>");
}
catch(e2){
window.status=_c8;
}
}
}
};
dojo.addOnLoad(function(){
dojo.hostenv._println_safe=true;
while(dojo.hostenv._println_buffer.length>0){
dojo.hostenv.println(dojo.hostenv._println_buffer.shift());
}
});
function dj_addNodeEvtHdlr(_cb,_cc,fp){
var _ce=_cb["on"+_cc]||function(){
};
_cb["on"+_cc]=function(){
fp.apply(_cb,arguments);
_ce.apply(_cb,arguments);
};
return true;
}
function dj_load_init(e){
var _d0=(e&&e.type)?e.type.toLowerCase():"load";
if(arguments.callee.initialized||(_d0!="domcontentloaded"&&_d0!="load")){
return;
}
arguments.callee.initialized=true;
if(typeof (_timer)!="undefined"){
clearInterval(_timer);
delete _timer;
}
var _d1=function(){
if(dojo.render.html.ie){
dojo.hostenv.makeWidgets();
}
};
if(dojo.hostenv.inFlightCount==0){
_d1();
dojo.hostenv.modulesLoaded();
}else{
dojo.hostenv.modulesLoadedListeners.unshift(_d1);
}
}
if(document.addEventListener){
if(dojo.render.html.opera||(dojo.render.html.moz&&(djConfig["enableMozDomContentLoaded"]===true))){
document.addEventListener("DOMContentLoaded",dj_load_init,null);
}
window.addEventListener("load",dj_load_init,null);
}
if(dojo.render.html.ie&&dojo.render.os.win){
document.attachEvent("onreadystatechange",function(e){
if(document.readyState=="complete"){
dj_load_init();
}
});
}
if(/(WebKit|khtml)/i.test(navigator.userAgent)){
var _timer=setInterval(function(){
if(/loaded|complete/.test(document.readyState)){
dj_load_init();
}
},10);
}
if(dojo.render.html.ie){
dj_addNodeEvtHdlr(window,"beforeunload",function(){
dojo.hostenv._unloading=true;
window.setTimeout(function(){
dojo.hostenv._unloading=false;
},0);
});
}
dj_addNodeEvtHdlr(window,"unload",function(){
dojo.hostenv.unloaded();
if((!dojo.render.html.ie)||(dojo.render.html.ie&&dojo.hostenv._unloading)){
dojo.hostenv.unloaded();
}
});
dojo.hostenv.makeWidgets=function(){
var _d3=[];
if(djConfig.searchIds&&djConfig.searchIds.length>0){
_d3=_d3.concat(djConfig.searchIds);
}
if(dojo.hostenv.searchIds&&dojo.hostenv.searchIds.length>0){
_d3=_d3.concat(dojo.hostenv.searchIds);
}
if((djConfig.parseWidgets)||(_d3.length>0)){
if(dojo.evalObjPath("dojo.widget.Parse")){
var _d4=new dojo.xml.Parse();
if(_d3.length>0){
for(var x=0;x<_d3.length;x++){
var _d6=document.getElementById(_d3[x]);
if(!_d6){
continue;
}
var _d7=_d4.parseElement(_d6,null,true);
dojo.widget.getParser().createComponents(_d7);
}
}else{
if(djConfig.parseWidgets){
var _d7=_d4.parseElement(dojo.body(),null,true);
dojo.widget.getParser().createComponents(_d7);
}
}
}
}
};
dojo.addOnLoad(function(){
if(!dojo.render.html.ie){
dojo.hostenv.makeWidgets();
}
});
try{
if(dojo.render.html.ie){
document.namespaces.add("v","urn:schemas-microsoft-com:vml");
document.createStyleSheet().addRule("v\\:*","behavior:url(#default#VML)");
}
}
catch(e){
}
dojo.hostenv.writeIncludes=function(){
};
if(!dj_undef("document",this)){
dj_currentDocument=this.document;
}
dojo.doc=function(){
return dj_currentDocument;
};
dojo.body=function(){
return dojo.doc().body||dojo.doc().getElementsByTagName("body")[0];
};
dojo.byId=function(id,doc){
if((id)&&((typeof id=="string")||(id instanceof String))){
if(!doc){
doc=dj_currentDocument;
}
var ele=doc.getElementById(id);
if(ele&&(ele.id!=id)&&doc.all){
ele=null;
eles=doc.all[id];
if(eles){
if(eles.length){
for(var i=0;i<eles.length;i++){
if(eles[i].id==id){
ele=eles[i];
break;
}
}
}else{
ele=eles;
}
}
}
return ele;
}
return id;
};
dojo.setContext=function(_dc,_dd){
dj_currentContext=_dc;
dj_currentDocument=_dd;
};
dojo._fireCallback=function(_de,_df,_e0){
if((_df)&&((typeof _de=="string")||(_de instanceof String))){
_de=_df[_de];
}
return (_df?_de.apply(_df,_e0||[]):_de());
};
dojo.withGlobal=function(_e1,_e2,_e3,_e4){
var _e5;
var _e6=dj_currentContext;
var _e7=dj_currentDocument;
try{
dojo.setContext(_e1,_e1.document);
_e5=dojo._fireCallback(_e2,_e3,_e4);
}
finally{
dojo.setContext(_e6,_e7);
}
return _e5;
};
dojo.withDoc=function(_e8,_e9,_ea,_eb){
var _ec;
var _ed=dj_currentDocument;
try{
dj_currentDocument=_e8;
_ec=dojo._fireCallback(_e9,_ea,_eb);
}
finally{
dj_currentDocument=_ed;
}
return _ec;
};
}
dojo.requireIf((djConfig["isDebug"]||djConfig["debugAtAllCosts"]),"dojo.debug");
dojo.requireIf(djConfig["debugAtAllCosts"]&&!window.widget&&!djConfig["useXDomain"],"dojo.browser_debug");
dojo.requireIf(djConfig["debugAtAllCosts"]&&!window.widget&&djConfig["useXDomain"],"dojo.browser_debug_xd");
dojo.provide("dojo.string.common");
dojo.string.trim=function(str,wh){
if(!str.replace){
return str;
}
if(!str.length){
return str;
}
var re=(wh>0)?(/^\s+/):(wh<0)?(/\s+$/):(/^\s+|\s+$/g);
return str.replace(re,"");
};
dojo.string.trimStart=function(str){
return dojo.string.trim(str,1);
};
dojo.string.trimEnd=function(str){
return dojo.string.trim(str,-1);
};
dojo.string.repeat=function(str,_f4,_f5){
var out="";
for(var i=0;i<_f4;i++){
out+=str;
if(_f5&&i<_f4-1){
out+=_f5;
}
}
return out;
};
dojo.string.pad=function(str,len,c,dir){
var out=String(str);
if(!c){
c="0";
}
if(!dir){
dir=1;
}
while(out.length<len){
if(dir>0){
out=c+out;
}else{
out+=c;
}
}
return out;
};
dojo.string.padLeft=function(str,len,c){
return dojo.string.pad(str,len,c,1);
};
dojo.string.padRight=function(str,len,c){
return dojo.string.pad(str,len,c,-1);
};
dojo.provide("dojo.string");
dojo.provide("dojo.lang.common");
dojo.lang.inherits=function(_103,_104){
if(!dojo.lang.isFunction(_104)){
dojo.raise("dojo.inherits: superclass argument ["+_104+"] must be a function (subclass: ["+_103+"']");
}
_103.prototype=new _104();
_103.prototype.constructor=_103;
_103.superclass=_104.prototype;
_103["super"]=_104.prototype;
};
dojo.lang._mixin=function(obj,_106){
var tobj={};
for(var x in _106){
if((typeof tobj[x]=="undefined")||(tobj[x]!=_106[x])){
obj[x]=_106[x];
}
}
if(dojo.render.html.ie&&(typeof (_106["toString"])=="function")&&(_106["toString"]!=obj["toString"])&&(_106["toString"]!=tobj["toString"])){
obj.toString=_106.toString;
}
return obj;
};
dojo.lang.mixin=function(obj,_10a){
for(var i=1,l=arguments.length;i<l;i++){
dojo.lang._mixin(obj,arguments[i]);
}
return obj;
};
dojo.lang.extend=function(_10d,_10e){
for(var i=1,l=arguments.length;i<l;i++){
dojo.lang._mixin(_10d.prototype,arguments[i]);
}
return _10d;
};
dojo.inherits=dojo.lang.inherits;
dojo.mixin=dojo.lang.mixin;
dojo.extend=dojo.lang.extend;
dojo.lang.find=function(_111,_112,_113,_114){
if(!dojo.lang.isArrayLike(_111)&&dojo.lang.isArrayLike(_112)){
dojo.deprecated("dojo.lang.find(value, array)","use dojo.lang.find(array, value) instead","0.5");
var temp=_111;
_111=_112;
_112=temp;
}
var _116=dojo.lang.isString(_111);
if(_116){
_111=_111.split("");
}
if(_114){
var step=-1;
var i=_111.length-1;
var end=-1;
}else{
var step=1;
var i=0;
var end=_111.length;
}
if(_113){
while(i!=end){
if(_111[i]===_112){
return i;
}
i+=step;
}
}else{
while(i!=end){
if(_111[i]==_112){
return i;
}
i+=step;
}
}
return -1;
};
dojo.lang.indexOf=dojo.lang.find;
dojo.lang.findLast=function(_11a,_11b,_11c){
return dojo.lang.find(_11a,_11b,_11c,true);
};
dojo.lang.lastIndexOf=dojo.lang.findLast;
dojo.lang.inArray=function(_11d,_11e){
return dojo.lang.find(_11d,_11e)>-1;
};
dojo.lang.isObject=function(it){
if(typeof it=="undefined"){
return false;
}
return (typeof it=="object"||it===null||dojo.lang.isArray(it)||dojo.lang.isFunction(it));
};
dojo.lang.isArray=function(it){
return (it&&it instanceof Array||typeof it=="array");
};
dojo.lang.isArrayLike=function(it){
if((!it)||(dojo.lang.isUndefined(it))){
return false;
}
if(dojo.lang.isString(it)){
return false;
}
if(dojo.lang.isFunction(it)){
return false;
}
if(dojo.lang.isArray(it)){
return true;
}
if((it.tagName)&&(it.tagName.toLowerCase()=="form")){
return false;
}
if(dojo.lang.isNumber(it.length)&&isFinite(it.length)){
return true;
}
return false;
};
dojo.lang.isFunction=function(it){
return (it instanceof Function||typeof it=="function");
};
(function(){
if((dojo.render.html.capable)&&(dojo.render.html["safari"])){
dojo.lang.isFunction=function(it){
if((typeof (it)=="function")&&(it=="[object NodeList]")){
return false;
}
return (it instanceof Function||typeof it=="function");
};
}
})();
dojo.lang.isString=function(it){
return (typeof it=="string"||it instanceof String);
};
dojo.lang.isAlien=function(it){
if(!it){
return false;
}
return !dojo.lang.isFunction(it)&&/\{\s*\[native code\]\s*\}/.test(String(it));
};
dojo.lang.isBoolean=function(it){
return (it instanceof Boolean||typeof it=="boolean");
};
dojo.lang.isNumber=function(it){
return (it instanceof Number||typeof it=="number");
};
dojo.lang.isUndefined=function(it){
return ((typeof (it)=="undefined")&&(it==undefined));
};
dojo.provide("dojo.lang.extras");
dojo.lang.setTimeout=function(func,_12a){
var _12b=window,_12c=2;
if(!dojo.lang.isFunction(func)){
_12b=func;
func=_12a;
_12a=arguments[2];
_12c++;
}
if(dojo.lang.isString(func)){
func=_12b[func];
}
var args=[];
for(var i=_12c;i<arguments.length;i++){
args.push(arguments[i]);
}
return dojo.global().setTimeout(function(){
func.apply(_12b,args);
},_12a);
};
dojo.lang.clearTimeout=function(_12f){
dojo.global().clearTimeout(_12f);
};
dojo.lang.getNameInObj=function(ns,item){
if(!ns){
ns=dj_global;
}
for(var x in ns){
if(ns[x]===item){
return new String(x);
}
}
return null;
};
dojo.lang.shallowCopy=function(obj,deep){
var i,ret;
if(obj===null){
return null;
}
if(dojo.lang.isObject(obj)){
ret=new obj.constructor();
for(i in obj){
if(dojo.lang.isUndefined(ret[i])){
ret[i]=deep?dojo.lang.shallowCopy(obj[i],deep):obj[i];
}
}
}else{
if(dojo.lang.isArray(obj)){
ret=[];
for(i=0;i<obj.length;i++){
ret[i]=deep?dojo.lang.shallowCopy(obj[i],deep):obj[i];
}
}else{
ret=obj;
}
}
return ret;
};
dojo.lang.firstValued=function(){
for(var i=0;i<arguments.length;i++){
if(typeof arguments[i]!="undefined"){
return arguments[i];
}
}
return undefined;
};
dojo.lang.getObjPathValue=function(_138,_139,_13a){
with(dojo.parseObjPath(_138,_139,_13a)){
return dojo.evalProp(prop,obj,_13a);
}
};
dojo.lang.setObjPathValue=function(_13b,_13c,_13d,_13e){
dojo.deprecated("dojo.lang.setObjPathValue","use dojo.parseObjPath and the '=' operator","0.6");
if(arguments.length<4){
_13e=true;
}
with(dojo.parseObjPath(_13b,_13d,_13e)){
if(obj&&(_13e||(prop in obj))){
obj[prop]=_13c;
}
}
};
dojo.provide("dojo.io.common");
dojo.io.transports=[];
dojo.io.hdlrFuncNames=["load","error","timeout"];
dojo.io.Request=function(url,_140,_141,_142){
if((arguments.length==1)&&(arguments[0].constructor==Object)){
this.fromKwArgs(arguments[0]);
}else{
this.url=url;
if(_140){
this.mimetype=_140;
}
if(_141){
this.transport=_141;
}
if(arguments.length>=4){
this.changeUrl=_142;
}
}
};
dojo.lang.extend(dojo.io.Request,{url:"",mimetype:"text/plain",method:"GET",content:undefined,transport:undefined,changeUrl:undefined,formNode:undefined,sync:false,bindSuccess:false,useCache:false,preventCache:false,load:function(type,data,_145,_146){
},error:function(type,_148,_149,_14a){
},timeout:function(type,_14c,_14d,_14e){
},handle:function(type,data,_151,_152){
},timeoutSeconds:0,abort:function(){
},fromKwArgs:function(_153){
if(_153["url"]){
_153.url=_153.url.toString();
}
if(_153["formNode"]){
_153.formNode=dojo.byId(_153.formNode);
}
if(!_153["method"]&&_153["formNode"]&&_153["formNode"].method){
_153.method=_153["formNode"].method;
}
if(!_153["handle"]&&_153["handler"]){
_153.handle=_153.handler;
}
if(!_153["load"]&&_153["loaded"]){
_153.load=_153.loaded;
}
if(!_153["changeUrl"]&&_153["changeURL"]){
_153.changeUrl=_153.changeURL;
}
_153.encoding=dojo.lang.firstValued(_153["encoding"],djConfig["bindEncoding"],"");
_153.sendTransport=dojo.lang.firstValued(_153["sendTransport"],djConfig["ioSendTransport"],false);
var _154=dojo.lang.isFunction;
for(var x=0;x<dojo.io.hdlrFuncNames.length;x++){
var fn=dojo.io.hdlrFuncNames[x];
if(_153[fn]&&_154(_153[fn])){
continue;
}
if(_153["handle"]&&_154(_153["handle"])){
_153[fn]=_153.handle;
}
}
dojo.lang.mixin(this,_153);
}});
dojo.io.Error=function(msg,type,num){
this.message=msg;
this.type=type||"unknown";
this.number=num||0;
};
dojo.io.transports.addTransport=function(name){
this.push(name);
this[name]=dojo.io[name];
};
dojo.io.bind=function(_15b){
if(!(_15b instanceof dojo.io.Request)){
try{
_15b=new dojo.io.Request(_15b);
}
catch(e){
dojo.debug(e);
}
}
var _15c="";
if(_15b["transport"]){
_15c=_15b["transport"];
if(!this[_15c]){
dojo.io.sendBindError(_15b,"No dojo.io.bind() transport with name '"+_15b["transport"]+"'.");
return _15b;
}
if(!this[_15c].canHandle(_15b)){
dojo.io.sendBindError(_15b,"dojo.io.bind() transport with name '"+_15b["transport"]+"' cannot handle this type of request.");
return _15b;
}
}else{
for(var x=0;x<dojo.io.transports.length;x++){
var tmp=dojo.io.transports[x];
if((this[tmp])&&(this[tmp].canHandle(_15b))){
_15c=tmp;
break;
}
}
if(_15c==""){
dojo.io.sendBindError(_15b,"None of the loaded transports for dojo.io.bind()"+" can handle the request.");
return _15b;
}
}
this[_15c].bind(_15b);
_15b.bindSuccess=true;
return _15b;
};
dojo.io.sendBindError=function(_15f,_160){
if((typeof _15f.error=="function"||typeof _15f.handle=="function")&&(typeof setTimeout=="function"||typeof setTimeout=="object")){
var _161=new dojo.io.Error(_160);
setTimeout(function(){
_15f[(typeof _15f.error=="function")?"error":"handle"]("error",_161,null,_15f);
},50);
}else{
dojo.raise(_160);
}
};
dojo.io.queueBind=function(_162){
if(!(_162 instanceof dojo.io.Request)){
try{
_162=new dojo.io.Request(_162);
}
catch(e){
dojo.debug(e);
}
}
var _163=_162.load;
_162.load=function(){
dojo.io._queueBindInFlight=false;
var ret=_163.apply(this,arguments);
dojo.io._dispatchNextQueueBind();
return ret;
};
var _165=_162.error;
_162.error=function(){
dojo.io._queueBindInFlight=false;
var ret=_165.apply(this,arguments);
dojo.io._dispatchNextQueueBind();
return ret;
};
dojo.io._bindQueue.push(_162);
dojo.io._dispatchNextQueueBind();
return _162;
};
dojo.io._dispatchNextQueueBind=function(){
if(!dojo.io._queueBindInFlight){
dojo.io._queueBindInFlight=true;
if(dojo.io._bindQueue.length>0){
dojo.io.bind(dojo.io._bindQueue.shift());
}else{
dojo.io._queueBindInFlight=false;
}
}
};
dojo.io._bindQueue=[];
dojo.io._queueBindInFlight=false;
dojo.io.argsFromMap=function(map,_168,last){
var enc=/utf/i.test(_168||"")?encodeURIComponent:dojo.string.encodeAscii;
var _16b=[];
var _16c=new Object();
for(var name in map){
var _16e=function(elt){
var val=enc(name)+"="+enc(elt);
_16b[(last==name)?"push":"unshift"](val);
};
if(!_16c[name]){
var _171=map[name];
if(dojo.lang.isArray(_171)){
dojo.lang.forEach(_171,_16e);
}else{
_16e(_171);
}
}
}
return _16b.join("&");
};
dojo.io.setIFrameSrc=function(_172,src,_174){
try{
var r=dojo.render.html;
if(!_174){
if(r.safari){
_172.location=src;
}else{
frames[_172.name].location=src;
}
}else{
var idoc;
if(r.ie){
idoc=_172.contentWindow.document;
}else{
if(r.safari){
idoc=_172.document;
}else{
idoc=_172.contentWindow;
}
}
if(!idoc){
_172.location=src;
return;
}else{
idoc.location.replace(src);
}
}
}
catch(e){
dojo.debug(e);
dojo.debug("setIFrameSrc: "+e);
}
};
dojo.provide("dojo.lang.array");
dojo.lang.mixin(dojo.lang,{has:function(obj,name){
try{
return typeof obj[name]!="undefined";
}
catch(e){
return false;
}
},isEmpty:function(obj){
if(dojo.lang.isObject(obj)){
var tmp={};
var _17b=0;
for(var x in obj){
if(obj[x]&&(!tmp[x])){
_17b++;
break;
}
}
return _17b==0;
}else{
if(dojo.lang.isArrayLike(obj)||dojo.lang.isString(obj)){
return obj.length==0;
}
}
},map:function(arr,obj,_17f){
var _180=dojo.lang.isString(arr);
if(_180){
arr=arr.split("");
}
if(dojo.lang.isFunction(obj)&&(!_17f)){
_17f=obj;
obj=dj_global;
}else{
if(dojo.lang.isFunction(obj)&&_17f){
var _181=obj;
obj=_17f;
_17f=_181;
}
}
if(Array.map){
var _182=Array.map(arr,_17f,obj);
}else{
var _182=[];
for(var i=0;i<arr.length;++i){
_182.push(_17f.call(obj,arr[i]));
}
}
if(_180){
return _182.join("");
}else{
return _182;
}
},reduce:function(arr,_185,obj,_187){
var _188=_185;
if(arguments.length==2){
_187=_185;
_188=arr[0];
arr=arr.slice(1);
}else{
if(arguments.length==3){
if(dojo.lang.isFunction(obj)){
_187=obj;
obj=null;
}
}else{
if(dojo.lang.isFunction(obj)){
var tmp=_187;
_187=obj;
obj=tmp;
}
}
}
var ob=obj||dj_global;
dojo.lang.map(arr,function(val){
_188=_187.call(ob,_188,val);
});
return _188;
},forEach:function(_18c,_18d,_18e){
if(dojo.lang.isString(_18c)){
_18c=_18c.split("");
}
if(Array.forEach){
Array.forEach(_18c,_18d,_18e);
}else{
if(!_18e){
_18e=dj_global;
}
for(var i=0,l=_18c.length;i<l;i++){
_18d.call(_18e,_18c[i],i,_18c);
}
}
},_everyOrSome:function(_191,arr,_193,_194){
if(dojo.lang.isString(arr)){
arr=arr.split("");
}
if(Array.every){
return Array[_191?"every":"some"](arr,_193,_194);
}else{
if(!_194){
_194=dj_global;
}
for(var i=0,l=arr.length;i<l;i++){
var _197=_193.call(_194,arr[i],i,arr);
if(_191&&!_197){
return false;
}else{
if((!_191)&&(_197)){
return true;
}
}
}
return Boolean(_191);
}
},every:function(arr,_199,_19a){
return this._everyOrSome(true,arr,_199,_19a);
},some:function(arr,_19c,_19d){
return this._everyOrSome(false,arr,_19c,_19d);
},filter:function(arr,_19f,_1a0){
var _1a1=dojo.lang.isString(arr);
if(_1a1){
arr=arr.split("");
}
var _1a2;
if(Array.filter){
_1a2=Array.filter(arr,_19f,_1a0);
}else{
if(!_1a0){
if(arguments.length>=3){
dojo.raise("thisObject doesn't exist!");
}
_1a0=dj_global;
}
_1a2=[];
for(var i=0;i<arr.length;i++){
if(_19f.call(_1a0,arr[i],i,arr)){
_1a2.push(arr[i]);
}
}
}
if(_1a1){
return _1a2.join("");
}else{
return _1a2;
}
},unnest:function(){
var out=[];
for(var i=0;i<arguments.length;i++){
if(dojo.lang.isArrayLike(arguments[i])){
var add=dojo.lang.unnest.apply(this,arguments[i]);
out=out.concat(add);
}else{
out.push(arguments[i]);
}
}
return out;
},toArray:function(_1a7,_1a8){
var _1a9=[];
for(var i=_1a8||0;i<_1a7.length;i++){
_1a9.push(_1a7[i]);
}
return _1a9;
}});
dojo.provide("dojo.lang.func");
dojo.lang.hitch=function(_1ab,_1ac){
var fcn=(dojo.lang.isString(_1ac)?_1ab[_1ac]:_1ac)||function(){
};
return function(){
return fcn.apply(_1ab,arguments);
};
};
dojo.lang.anonCtr=0;
dojo.lang.anon={};
dojo.lang.nameAnonFunc=function(_1ae,_1af,_1b0){
var nso=(_1af||dojo.lang.anon);
if((_1b0)||((dj_global["djConfig"])&&(djConfig["slowAnonFuncLookups"]==true))){
for(var x in nso){
try{
if(nso[x]===_1ae){
return x;
}
}
catch(e){
}
}
}
var ret="__"+dojo.lang.anonCtr++;
while(typeof nso[ret]!="undefined"){
ret="__"+dojo.lang.anonCtr++;
}
nso[ret]=_1ae;
return ret;
};
dojo.lang.forward=function(_1b4){
return function(){
return this[_1b4].apply(this,arguments);
};
};
dojo.lang.curry=function(_1b5,func){
var _1b7=[];
_1b5=_1b5||dj_global;
if(dojo.lang.isString(func)){
func=_1b5[func];
}
for(var x=2;x<arguments.length;x++){
_1b7.push(arguments[x]);
}
var _1b9=(func["__preJoinArity"]||func.length)-_1b7.length;
function gather(_1ba,_1bb,_1bc){
var _1bd=_1bc;
var _1be=_1bb.slice(0);
for(var x=0;x<_1ba.length;x++){
_1be.push(_1ba[x]);
}
_1bc=_1bc-_1ba.length;
if(_1bc<=0){
var res=func.apply(_1b5,_1be);
_1bc=_1bd;
return res;
}else{
return function(){
return gather(arguments,_1be,_1bc);
};
}
}
return gather([],_1b7,_1b9);
};
dojo.lang.curryArguments=function(_1c1,func,args,_1c4){
var _1c5=[];
var x=_1c4||0;
for(x=_1c4;x<args.length;x++){
_1c5.push(args[x]);
}
return dojo.lang.curry.apply(dojo.lang,[_1c1,func].concat(_1c5));
};
dojo.lang.tryThese=function(){
for(var x=0;x<arguments.length;x++){
try{
if(typeof arguments[x]=="function"){
var ret=(arguments[x]());
if(ret){
return ret;
}
}
}
catch(e){
dojo.debug(e);
}
}
};
dojo.lang.delayThese=function(farr,cb,_1cb,_1cc){
if(!farr.length){
if(typeof _1cc=="function"){
_1cc();
}
return;
}
if((typeof _1cb=="undefined")&&(typeof cb=="number")){
_1cb=cb;
cb=function(){
};
}else{
if(!cb){
cb=function(){
};
if(!_1cb){
_1cb=0;
}
}
}
setTimeout(function(){
(farr.shift())();
cb();
dojo.lang.delayThese(farr,cb,_1cb,_1cc);
},_1cb);
};
dojo.provide("dojo.string.extras");
dojo.string.substituteParams=function(_1cd,hash){
var map=(typeof hash=="object")?hash:dojo.lang.toArray(arguments,1);
return _1cd.replace(/\%\{(\w+)\}/g,function(_1d0,key){
if(typeof (map[key])!="undefined"&&map[key]!=null){
return map[key];
}
dojo.raise("Substitution not found: "+key);
});
};
dojo.string.capitalize=function(str){
if(!dojo.lang.isString(str)){
return "";
}
if(arguments.length==0){
str=this;
}
var _1d3=str.split(" ");
for(var i=0;i<_1d3.length;i++){
_1d3[i]=_1d3[i].charAt(0).toUpperCase()+_1d3[i].substring(1);
}
return _1d3.join(" ");
};
dojo.string.isBlank=function(str){
if(!dojo.lang.isString(str)){
return true;
}
return (dojo.string.trim(str).length==0);
};
dojo.string.encodeAscii=function(str){
if(!dojo.lang.isString(str)){
return str;
}
var ret="";
var _1d8=escape(str);
var _1d9,re=/%u([0-9A-F]{4})/i;
while((_1d9=_1d8.match(re))){
var num=Number("0x"+_1d9[1]);
var _1dc=escape("&#"+num+";");
ret+=_1d8.substring(0,_1d9.index)+_1dc;
_1d8=_1d8.substring(_1d9.index+_1d9[0].length);
}
ret+=_1d8.replace(/\+/g,"%2B");
return ret;
};
dojo.string.escape=function(type,str){
var args=dojo.lang.toArray(arguments,1);
switch(type.toLowerCase()){
case "xml":
case "html":
case "xhtml":
return dojo.string.escapeXml.apply(this,args);
case "sql":
return dojo.string.escapeSql.apply(this,args);
case "regexp":
case "regex":
return dojo.string.escapeRegExp.apply(this,args);
case "javascript":
case "jscript":
case "js":
return dojo.string.escapeJavaScript.apply(this,args);
case "ascii":
return dojo.string.encodeAscii.apply(this,args);
default:
return str;
}
};
dojo.string.escapeXml=function(str,_1e1){
str=str.replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;").replace(/"/gm,"&quot;");
if(!_1e1){
str=str.replace(/'/gm,"&#39;");
}
return str;
};
dojo.string.escapeSql=function(str){
return str.replace(/'/gm,"''");
};
dojo.string.escapeRegExp=function(str){
return str.replace(/\\/gm,"\\\\").replace(/([\f\b\n\t\r[\^$|?*+(){}])/gm,"\\$1");
};
dojo.string.escapeJavaScript=function(str){
return str.replace(/(["'\f\b\n\t\r])/gm,"\\$1");
};
dojo.string.escapeString=function(str){
return ("\""+str.replace(/(["\\])/g,"\\$1")+"\"").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r");
};
dojo.string.summary=function(str,len){
if(!len||str.length<=len){
return str;
}
return str.substring(0,len).replace(/\.+$/,"")+"...";
};
dojo.string.endsWith=function(str,end,_1ea){
if(_1ea){
str=str.toLowerCase();
end=end.toLowerCase();
}
if((str.length-end.length)<0){
return false;
}
return str.lastIndexOf(end)==str.length-end.length;
};
dojo.string.endsWithAny=function(str){
for(var i=1;i<arguments.length;i++){
if(dojo.string.endsWith(str,arguments[i])){
return true;
}
}
return false;
};
dojo.string.startsWith=function(str,_1ee,_1ef){
if(_1ef){
str=str.toLowerCase();
_1ee=_1ee.toLowerCase();
}
return str.indexOf(_1ee)==0;
};
dojo.string.startsWithAny=function(str){
for(var i=1;i<arguments.length;i++){
if(dojo.string.startsWith(str,arguments[i])){
return true;
}
}
return false;
};
dojo.string.has=function(str){
for(var i=1;i<arguments.length;i++){
if(str.indexOf(arguments[i])>-1){
return true;
}
}
return false;
};
dojo.string.normalizeNewlines=function(text,_1f5){
if(_1f5=="\n"){
text=text.replace(/\r\n/g,"\n");
text=text.replace(/\r/g,"\n");
}else{
if(_1f5=="\r"){
text=text.replace(/\r\n/g,"\r");
text=text.replace(/\n/g,"\r");
}else{
text=text.replace(/([^\r])\n/g,"$1\r\n").replace(/\r([^\n])/g,"\r\n$1");
}
}
return text;
};
dojo.string.splitEscaped=function(str,_1f7){
var _1f8=[];
for(var i=0,_1fa=0;i<str.length;i++){
if(str.charAt(i)=="\\"){
i++;
continue;
}
if(str.charAt(i)==_1f7){
_1f8.push(str.substring(_1fa,i));
_1fa=i+1;
}
}
_1f8.push(str.substr(_1fa));
return _1f8;
};
dojo.provide("dojo.dom");
dojo.dom.ELEMENT_NODE=1;
dojo.dom.ATTRIBUTE_NODE=2;
dojo.dom.TEXT_NODE=3;
dojo.dom.CDATA_SECTION_NODE=4;
dojo.dom.ENTITY_REFERENCE_NODE=5;
dojo.dom.ENTITY_NODE=6;
dojo.dom.PROCESSING_INSTRUCTION_NODE=7;
dojo.dom.COMMENT_NODE=8;
dojo.dom.DOCUMENT_NODE=9;
dojo.dom.DOCUMENT_TYPE_NODE=10;
dojo.dom.DOCUMENT_FRAGMENT_NODE=11;
dojo.dom.NOTATION_NODE=12;
dojo.dom.dojoml="http://www.dojotoolkit.org/2004/dojoml";
dojo.dom.xmlns={svg:"http://www.w3.org/2000/svg",smil:"http://www.w3.org/2001/SMIL20/",mml:"http://www.w3.org/1998/Math/MathML",cml:"http://www.xml-cml.org",xlink:"http://www.w3.org/1999/xlink",xhtml:"http://www.w3.org/1999/xhtml",xul:"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",xbl:"http://www.mozilla.org/xbl",fo:"http://www.w3.org/1999/XSL/Format",xsl:"http://www.w3.org/1999/XSL/Transform",xslt:"http://www.w3.org/1999/XSL/Transform",xi:"http://www.w3.org/2001/XInclude",xforms:"http://www.w3.org/2002/01/xforms",saxon:"http://icl.com/saxon",xalan:"http://xml.apache.org/xslt",xsd:"http://www.w3.org/2001/XMLSchema",dt:"http://www.w3.org/2001/XMLSchema-datatypes",xsi:"http://www.w3.org/2001/XMLSchema-instance",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",dc:"http://purl.org/dc/elements/1.1/",dcq:"http://purl.org/dc/qualifiers/1.0","soap-env":"http://schemas.xmlsoap.org/soap/envelope/",wsdl:"http://schemas.xmlsoap.org/wsdl/",AdobeExtensions:"http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"};
dojo.dom.isNode=function(wh){
if(typeof Element=="function"){
try{
return wh instanceof Element;
}
catch(e){
}
}else{
return wh&&!isNaN(wh.nodeType);
}
};
dojo.dom.getUniqueId=function(){
var _1fc=dojo.doc();
do{
var id="dj_unique_"+(++arguments.callee._idIncrement);
}while(_1fc.getElementById(id));
return id;
};
dojo.dom.getUniqueId._idIncrement=0;
dojo.dom.firstElement=dojo.dom.getFirstChildElement=function(_1fe,_1ff){
var node=_1fe.firstChild;
while(node&&node.nodeType!=dojo.dom.ELEMENT_NODE){
node=node.nextSibling;
}
if(_1ff&&node&&node.tagName&&node.tagName.toLowerCase()!=_1ff.toLowerCase()){
node=dojo.dom.nextElement(node,_1ff);
}
return node;
};
dojo.dom.lastElement=dojo.dom.getLastChildElement=function(_201,_202){
var node=_201.lastChild;
while(node&&node.nodeType!=dojo.dom.ELEMENT_NODE){
node=node.previousSibling;
}
if(_202&&node&&node.tagName&&node.tagName.toLowerCase()!=_202.toLowerCase()){
node=dojo.dom.prevElement(node,_202);
}
return node;
};
dojo.dom.nextElement=dojo.dom.getNextSiblingElement=function(node,_205){
if(!node){
return null;
}
do{
node=node.nextSibling;
}while(node&&node.nodeType!=dojo.dom.ELEMENT_NODE);
if(node&&_205&&_205.toLowerCase()!=node.tagName.toLowerCase()){
return dojo.dom.nextElement(node,_205);
}
return node;
};
dojo.dom.prevElement=dojo.dom.getPreviousSiblingElement=function(node,_207){
if(!node){
return null;
}
if(_207){
_207=_207.toLowerCase();
}
do{
node=node.previousSibling;
}while(node&&node.nodeType!=dojo.dom.ELEMENT_NODE);
if(node&&_207&&_207.toLowerCase()!=node.tagName.toLowerCase()){
return dojo.dom.prevElement(node,_207);
}
return node;
};
dojo.dom.moveChildren=function(_208,_209,trim){
var _20b=0;
if(trim){
while(_208.hasChildNodes()&&_208.firstChild.nodeType==dojo.dom.TEXT_NODE){
_208.removeChild(_208.firstChild);
}
while(_208.hasChildNodes()&&_208.lastChild.nodeType==dojo.dom.TEXT_NODE){
_208.removeChild(_208.lastChild);
}
}
while(_208.hasChildNodes()){
_209.appendChild(_208.firstChild);
_20b++;
}
return _20b;
};
dojo.dom.copyChildren=function(_20c,_20d,trim){
var _20f=_20c.cloneNode(true);
return this.moveChildren(_20f,_20d,trim);
};
dojo.dom.replaceChildren=function(node,_211){
var _212=[];
if(dojo.render.html.ie){
for(var i=0;i<node.childNodes.length;i++){
_212.push(node.childNodes[i]);
}
}
dojo.dom.removeChildren(node);
node.appendChild(_211);
for(var i=0;i<_212.length;i++){
dojo.dom.destroyNode(_212[i]);
}
};
dojo.dom.removeChildren=function(node){
var _215=node.childNodes.length;
while(node.hasChildNodes()){
dojo.dom.removeNode(node.firstChild);
}
return _215;
};
dojo.dom.replaceNode=function(node,_217){
return node.parentNode.replaceChild(_217,node);
};
dojo.dom.destroyNode=function(node){
if(node.parentNode){
node=dojo.dom.removeNode(node);
}
if(node.nodeType!=3){
if(dojo.evalObjPath("dojo.event.browser.clean",false)){
dojo.event.browser.clean(node);
}
if(dojo.render.html.ie){
node.outerHTML="";
}
}
};
dojo.dom.removeNode=function(node){
if(node&&node.parentNode){
return node.parentNode.removeChild(node);
}
};
dojo.dom.getAncestors=function(node,_21b,_21c){
var _21d=[];
var _21e=(_21b&&(_21b instanceof Function||typeof _21b=="function"));
while(node){
if(!_21e||_21b(node)){
_21d.push(node);
}
if(_21c&&_21d.length>0){
return _21d[0];
}
node=node.parentNode;
}
if(_21c){
return null;
}
return _21d;
};
dojo.dom.getAncestorsByTag=function(node,tag,_221){
tag=tag.toLowerCase();
return dojo.dom.getAncestors(node,function(el){
return ((el.tagName)&&(el.tagName.toLowerCase()==tag));
},_221);
};
dojo.dom.getFirstAncestorByTag=function(node,tag){
return dojo.dom.getAncestorsByTag(node,tag,true);
};
dojo.dom.isDescendantOf=function(node,_226,_227){
if(_227&&node){
node=node.parentNode;
}
while(node){
if(node==_226){
return true;
}
node=node.parentNode;
}
return false;
};
dojo.dom.innerXML=function(node){
if(node.innerXML){
return node.innerXML;
}else{
if(node.xml){
return node.xml;
}else{
if(typeof XMLSerializer!="undefined"){
return (new XMLSerializer()).serializeToString(node);
}
}
}
};
dojo.dom.createDocument=function(){
var doc=null;
var _22a=dojo.doc();
if(!dj_undef("ActiveXObject")){
var _22b=["MSXML2","Microsoft","MSXML","MSXML3"];
for(var i=0;i<_22b.length;i++){
try{
doc=new ActiveXObject(_22b[i]+".XMLDOM");
}
catch(e){
}
if(doc){
break;
}
}
}else{
if((_22a.implementation)&&(_22a.implementation.createDocument)){
doc=_22a.implementation.createDocument("","",null);
}
}
return doc;
};
dojo.dom.createDocumentFromText=function(str,_22e){
if(!_22e){
_22e="text/xml";
}
if(!dj_undef("DOMParser")){
var _22f=new DOMParser();
return _22f.parseFromString(str,_22e);
}else{
if(!dj_undef("ActiveXObject")){
var _230=dojo.dom.createDocument();
if(_230){
_230.async=false;
_230.loadXML(str);
return _230;
}else{
dojo.debug("toXml didn't work?");
}
}else{
var _231=dojo.doc();
if(_231.createElement){
var tmp=_231.createElement("xml");
tmp.innerHTML=str;
if(_231.implementation&&_231.implementation.createDocument){
var _233=_231.implementation.createDocument("foo","",null);
for(var i=0;i<tmp.childNodes.length;i++){
_233.importNode(tmp.childNodes.item(i),true);
}
return _233;
}
return ((tmp.document)&&(tmp.document.firstChild?tmp.document.firstChild:tmp));
}
}
}
return null;
};
dojo.dom.prependChild=function(node,_236){
if(_236.firstChild){
_236.insertBefore(node,_236.firstChild);
}else{
_236.appendChild(node);
}
return true;
};
dojo.dom.insertBefore=function(node,ref,_239){
if((_239!=true)&&(node===ref||node.nextSibling===ref)){
return false;
}
var _23a=ref.parentNode;
_23a.insertBefore(node,ref);
return true;
};
dojo.dom.insertAfter=function(node,ref,_23d){
var pn=ref.parentNode;
if(ref==pn.lastChild){
if((_23d!=true)&&(node===ref)){
return false;
}
pn.appendChild(node);
}else{
return this.insertBefore(node,ref.nextSibling,_23d);
}
return true;
};
dojo.dom.insertAtPosition=function(node,ref,_241){
if((!node)||(!ref)||(!_241)){
return false;
}
switch(_241.toLowerCase()){
case "before":
return dojo.dom.insertBefore(node,ref);
case "after":
return dojo.dom.insertAfter(node,ref);
case "first":
if(ref.firstChild){
return dojo.dom.insertBefore(node,ref.firstChild);
}else{
ref.appendChild(node);
return true;
}
break;
default:
ref.appendChild(node);
return true;
}
};
dojo.dom.insertAtIndex=function(node,_243,_244){
var _245=_243.childNodes;
if(!_245.length||_245.length==_244){
_243.appendChild(node);
return true;
}
if(_244==0){
return dojo.dom.prependChild(node,_243);
}
return dojo.dom.insertAfter(node,_245[_244-1]);
};
dojo.dom.textContent=function(node,text){
if(arguments.length>1){
var _248=dojo.doc();
dojo.dom.replaceChildren(node,_248.createTextNode(text));
return text;
}else{
if(node.textContent!=undefined){
return node.textContent;
}
var _249="";
if(node==null){
return _249;
}
for(var i=0;i<node.childNodes.length;i++){
switch(node.childNodes[i].nodeType){
case 1:
case 5:
_249+=dojo.dom.textContent(node.childNodes[i]);
break;
case 3:
case 2:
case 4:
_249+=node.childNodes[i].nodeValue;
break;
default:
break;
}
}
return _249;
}
};
dojo.dom.hasParent=function(node){
return Boolean(node&&node.parentNode&&dojo.dom.isNode(node.parentNode));
};
dojo.dom.isTag=function(node){
if(node&&node.tagName){
for(var i=1;i<arguments.length;i++){
if(node.tagName==String(arguments[i])){
return String(arguments[i]);
}
}
}
return "";
};
dojo.dom.setAttributeNS=function(elem,_24f,_250,_251){
if(elem==null||((elem==undefined)&&(typeof elem=="undefined"))){
dojo.raise("No element given to dojo.dom.setAttributeNS");
}
if(!((elem.setAttributeNS==undefined)&&(typeof elem.setAttributeNS=="undefined"))){
elem.setAttributeNS(_24f,_250,_251);
}else{
var _252=elem.ownerDocument;
var _253=_252.createNode(2,_250,_24f);
_253.nodeValue=_251;
elem.setAttributeNode(_253);
}
};
dojo.provide("dojo.undo.browser");
try{
if((!djConfig["preventBackButtonFix"])&&(!dojo.hostenv.post_load_)){
document.write("<iframe style='border: 0px; width: 1px; height: 1px; position: absolute; bottom: 0px; right: 0px; visibility: visible;' name='djhistory' id='djhistory' src='"+(djConfig["dojoIframeHistoryUrl"]||dojo.hostenv.getBaseScriptUri()+"iframe_history.html")+"'></iframe>");
}
}
catch(e){
}
if(dojo.render.html.opera){
dojo.debug("Opera is not supported with dojo.undo.browser, so back/forward detection will not work.");
}
dojo.undo.browser={initialHref:(!dj_undef("window"))?window.location.href:"",initialHash:(!dj_undef("window"))?window.location.hash:"",moveForward:false,historyStack:[],forwardStack:[],historyIframe:null,bookmarkAnchor:null,locationTimer:null,setInitialState:function(args){
this.initialState=this._createState(this.initialHref,args,this.initialHash);
},addToHistory:function(args){
this.forwardStack=[];
var hash=null;
var url=null;
if(!this.historyIframe){
if(djConfig["useXDomain"]&&!djConfig["dojoIframeHistoryUrl"]){
dojo.debug("dojo.undo.browser: When using cross-domain Dojo builds,"+" please save iframe_history.html to your domain and set djConfig.dojoIframeHistoryUrl"+" to the path on your domain to iframe_history.html");
}
this.historyIframe=window.frames["djhistory"];
}
if(!this.bookmarkAnchor){
this.bookmarkAnchor=document.createElement("a");
dojo.body().appendChild(this.bookmarkAnchor);
this.bookmarkAnchor.style.display="none";
}
if(args["changeUrl"]){
hash="#"+((args["changeUrl"]!==true)?args["changeUrl"]:(new Date()).getTime());
if(this.historyStack.length==0&&this.initialState.urlHash==hash){
this.initialState=this._createState(url,args,hash);
return;
}else{
if(this.historyStack.length>0&&this.historyStack[this.historyStack.length-1].urlHash==hash){
this.historyStack[this.historyStack.length-1]=this._createState(url,args,hash);
return;
}
}
this.changingUrl=true;
setTimeout("window.location.href = '"+hash+"'; dojo.undo.browser.changingUrl = false;",1);
this.bookmarkAnchor.href=hash;
if(dojo.render.html.ie){
url=this._loadIframeHistory();
var _258=args["back"]||args["backButton"]||args["handle"];
var tcb=function(_25a){
if(window.location.hash!=""){
setTimeout("window.location.href = '"+hash+"';",1);
}
_258.apply(this,[_25a]);
};
if(args["back"]){
args.back=tcb;
}else{
if(args["backButton"]){
args.backButton=tcb;
}else{
if(args["handle"]){
args.handle=tcb;
}
}
}
var _25b=args["forward"]||args["forwardButton"]||args["handle"];
var tfw=function(_25d){
if(window.location.hash!=""){
window.location.href=hash;
}
if(_25b){
_25b.apply(this,[_25d]);
}
};
if(args["forward"]){
args.forward=tfw;
}else{
if(args["forwardButton"]){
args.forwardButton=tfw;
}else{
if(args["handle"]){
args.handle=tfw;
}
}
}
}else{
if(dojo.render.html.moz){
if(!this.locationTimer){
this.locationTimer=setInterval("dojo.undo.browser.checkLocation();",200);
}
}
}
}else{
url=this._loadIframeHistory();
}
this.historyStack.push(this._createState(url,args,hash));
},checkLocation:function(){
if(!this.changingUrl){
var hsl=this.historyStack.length;
if((window.location.hash==this.initialHash||window.location.href==this.initialHref)&&(hsl==1)){
this.handleBackButton();
return;
}
if(this.forwardStack.length>0){
if(this.forwardStack[this.forwardStack.length-1].urlHash==window.location.hash){
this.handleForwardButton();
return;
}
}
if((hsl>=2)&&(this.historyStack[hsl-2])){
if(this.historyStack[hsl-2].urlHash==window.location.hash){
this.handleBackButton();
return;
}
}
}
},iframeLoaded:function(evt,_260){
if(!dojo.render.html.opera){
var _261=this._getUrlQuery(_260.href);
if(_261==null){
if(this.historyStack.length==1){
this.handleBackButton();
}
return;
}
if(this.moveForward){
this.moveForward=false;
return;
}
if(this.historyStack.length>=2&&_261==this._getUrlQuery(this.historyStack[this.historyStack.length-2].url)){
this.handleBackButton();
}else{
if(this.forwardStack.length>0&&_261==this._getUrlQuery(this.forwardStack[this.forwardStack.length-1].url)){
this.handleForwardButton();
}
}
}
},handleBackButton:function(){
var _262=this.historyStack.pop();
if(!_262){
return;
}
var last=this.historyStack[this.historyStack.length-1];
if(!last&&this.historyStack.length==0){
last=this.initialState;
}
if(last){
if(last.kwArgs["back"]){
last.kwArgs["back"]();
}else{
if(last.kwArgs["backButton"]){
last.kwArgs["backButton"]();
}else{
if(last.kwArgs["handle"]){
last.kwArgs.handle("back");
}
}
}
}
this.forwardStack.push(_262);
},handleForwardButton:function(){
var last=this.forwardStack.pop();
if(!last){
return;
}
if(last.kwArgs["forward"]){
last.kwArgs.forward();
}else{
if(last.kwArgs["forwardButton"]){
last.kwArgs.forwardButton();
}else{
if(last.kwArgs["handle"]){
last.kwArgs.handle("forward");
}
}
}
this.historyStack.push(last);
},_createState:function(url,args,hash){
return {"url":url,"kwArgs":args,"urlHash":hash};
},_getUrlQuery:function(url){
var _269=url.split("?");
if(_269.length<2){
return null;
}else{
return _269[1];
}
},_loadIframeHistory:function(){
var url=(djConfig["dojoIframeHistoryUrl"]||dojo.hostenv.getBaseScriptUri()+"iframe_history.html")+"?"+(new Date()).getTime();
this.moveForward=true;
dojo.io.setIFrameSrc(this.historyIframe,url,false);
return url;
}};
dojo.provide("dojo.io.BrowserIO");
if(!dj_undef("window")){
dojo.io.checkChildrenForFile=function(node){
var _26c=false;
var _26d=node.getElementsByTagName("input");
dojo.lang.forEach(_26d,function(_26e){
if(_26c){
return;
}
if(_26e.getAttribute("type")=="file"){
_26c=true;
}
});
return _26c;
};
dojo.io.formHasFile=function(_26f){
return dojo.io.checkChildrenForFile(_26f);
};
dojo.io.updateNode=function(node,_271){
node=dojo.byId(node);
var args=_271;
if(dojo.lang.isString(_271)){
args={url:_271};
}
args.mimetype="text/html";
args.load=function(t,d,e){
while(node.firstChild){
dojo.dom.destroyNode(node.firstChild);
}
node.innerHTML=d;
};
dojo.io.bind(args);
};
dojo.io.formFilter=function(node){
var type=(node.type||"").toLowerCase();
return !node.disabled&&node.name&&!dojo.lang.inArray(["file","submit","image","reset","button"],type);
};
dojo.io.encodeForm=function(_278,_279,_27a){
if((!_278)||(!_278.tagName)||(!_278.tagName.toLowerCase()=="form")){
dojo.raise("Attempted to encode a non-form element.");
}
if(!_27a){
_27a=dojo.io.formFilter;
}
var enc=/utf/i.test(_279||"")?encodeURIComponent:dojo.string.encodeAscii;
var _27c=[];
for(var i=0;i<_278.elements.length;i++){
var elm=_278.elements[i];
if(!elm||elm.tagName.toLowerCase()=="fieldset"||!_27a(elm)){
continue;
}
var name=enc(elm.name);
var type=elm.type.toLowerCase();
if(type=="select-multiple"){
for(var j=0;j<elm.options.length;j++){
if(elm.options[j].selected){
_27c.push(name+"="+enc(elm.options[j].value));
}
}
}else{
if(dojo.lang.inArray(["radio","checkbox"],type)){
if(elm.checked){
_27c.push(name+"="+enc(elm.value));
}
}else{
_27c.push(name+"="+enc(elm.value));
}
}
}
var _282=_278.getElementsByTagName("input");
for(var i=0;i<_282.length;i++){
var _283=_282[i];
if(_283.type.toLowerCase()=="image"&&_283.form==_278&&_27a(_283)){
var name=enc(_283.name);
_27c.push(name+"="+enc(_283.value));
_27c.push(name+".x=0");
_27c.push(name+".y=0");
}
}
return _27c.join("&")+"&";
};
dojo.io.FormBind=function(args){
this.bindArgs={};
if(args&&args.formNode){
this.init(args);
}else{
if(args){
this.init({formNode:args});
}
}
};
dojo.lang.extend(dojo.io.FormBind,{form:null,bindArgs:null,clickedButton:null,init:function(args){
var form=dojo.byId(args.formNode);
if(!form||!form.tagName||form.tagName.toLowerCase()!="form"){
throw new Error("FormBind: Couldn't apply, invalid form");
}else{
if(this.form==form){
return;
}else{
if(this.form){
throw new Error("FormBind: Already applied to a form");
}
}
}
dojo.lang.mixin(this.bindArgs,args);
this.form=form;
this.connect(form,"onsubmit","submit");
for(var i=0;i<form.elements.length;i++){
var node=form.elements[i];
if(node&&node.type&&dojo.lang.inArray(["submit","button"],node.type.toLowerCase())){
this.connect(node,"onclick","click");
}
}
var _289=form.getElementsByTagName("input");
for(var i=0;i<_289.length;i++){
var _28a=_289[i];
if(_28a.type.toLowerCase()=="image"&&_28a.form==form){
this.connect(_28a,"onclick","click");
}
}
},onSubmit:function(form){
return true;
},submit:function(e){
e.preventDefault();
if(this.onSubmit(this.form)){
dojo.io.bind(dojo.lang.mixin(this.bindArgs,{formFilter:dojo.lang.hitch(this,"formFilter")}));
}
},click:function(e){
var node=e.currentTarget;
if(node.disabled){
return;
}
this.clickedButton=node;
},formFilter:function(node){
var type=(node.type||"").toLowerCase();
var _291=false;
if(node.disabled||!node.name){
_291=false;
}else{
if(dojo.lang.inArray(["submit","button","image"],type)){
if(!this.clickedButton){
this.clickedButton=node;
}
_291=node==this.clickedButton;
}else{
_291=!dojo.lang.inArray(["file","submit","reset","button"],type);
}
}
return _291;
},connect:function(_292,_293,_294){
if(dojo.evalObjPath("dojo.event.connect")){
dojo.event.connect(_292,_293,this,_294);
}else{
var fcn=dojo.lang.hitch(this,_294);
_292[_293]=function(e){
if(!e){
e=window.event;
}
if(!e.currentTarget){
e.currentTarget=e.srcElement;
}
if(!e.preventDefault){
e.preventDefault=function(){
window.event.returnValue=false;
};
}
fcn(e);
};
}
}});
dojo.io.XMLHTTPTransport=new function(){
var _297=this;
var _298={};
this.useCache=false;
this.preventCache=false;
function getCacheKey(url,_29a,_29b){
return url+"|"+_29a+"|"+_29b.toLowerCase();
}
function addToCache(url,_29d,_29e,http){
_298[getCacheKey(url,_29d,_29e)]=http;
}
function getFromCache(url,_2a1,_2a2){
return _298[getCacheKey(url,_2a1,_2a2)];
}
this.clearCache=function(){
_298={};
};
function doLoad(_2a3,http,url,_2a6,_2a7){
if(((http.status>=200)&&(http.status<300))||(http.status==304)||(location.protocol=="file:"&&(http.status==0||http.status==undefined))||(location.protocol=="chrome:"&&(http.status==0||http.status==undefined))){
var ret;
if(_2a3.method.toLowerCase()=="head"){
var _2a9=http.getAllResponseHeaders();
ret={};
ret.toString=function(){
return _2a9;
};
var _2aa=_2a9.split(/[\r\n]+/g);
for(var i=0;i<_2aa.length;i++){
var pair=_2aa[i].match(/^([^:]+)\s*:\s*(.+)$/i);
if(pair){
ret[pair[1]]=pair[2];
}
}
}else{
if(_2a3.mimetype=="text/javascript"){
try{
ret=dj_eval(http.responseText);
}
catch(e){
dojo.debug(e);
dojo.debug(http.responseText);
ret=null;
}
}else{
if(_2a3.mimetype=="text/json"||_2a3.mimetype=="application/json"){
try{
ret=dj_eval("("+http.responseText+")");
}
catch(e){
dojo.debug(e);
dojo.debug(http.responseText);
ret=false;
}
}else{
if((_2a3.mimetype=="application/xml")||(_2a3.mimetype=="text/xml")){
ret=http.responseXML;
if(!ret||typeof ret=="string"||!http.getResponseHeader("Content-Type")){
ret=dojo.dom.createDocumentFromText(http.responseText);
}
}else{
ret=http.responseText;
}
}
}
}
if(_2a7){
addToCache(url,_2a6,_2a3.method,http);
}
_2a3[(typeof _2a3.load=="function")?"load":"handle"]("load",ret,http,_2a3);
}else{
var _2ad=new dojo.io.Error("XMLHttpTransport Error: "+http.status+" "+http.statusText);
_2a3[(typeof _2a3.error=="function")?"error":"handle"]("error",_2ad,http,_2a3);
}
}
function setHeaders(http,_2af){
if(_2af["headers"]){
for(var _2b0 in _2af["headers"]){
if(_2b0.toLowerCase()=="content-type"&&!_2af["contentType"]){
_2af["contentType"]=_2af["headers"][_2b0];
}else{
http.setRequestHeader(_2b0,_2af["headers"][_2b0]);
}
}
}
}
this.inFlight=[];
this.inFlightTimer=null;
this.startWatchingInFlight=function(){
if(!this.inFlightTimer){
this.inFlightTimer=setTimeout("dojo.io.XMLHTTPTransport.watchInFlight();",10);
}
};
this.watchInFlight=function(){
var now=null;
if(!dojo.hostenv._blockAsync&&!_297._blockAsync){
for(var x=this.inFlight.length-1;x>=0;x--){
try{
var tif=this.inFlight[x];
if(!tif||tif.http._aborted||!tif.http.readyState){
this.inFlight.splice(x,1);
continue;
}
if(4==tif.http.readyState){
this.inFlight.splice(x,1);
doLoad(tif.req,tif.http,tif.url,tif.query,tif.useCache);
}else{
if(tif.startTime){
if(!now){
now=(new Date()).getTime();
}
if(tif.startTime+(tif.req.timeoutSeconds*1000)<now){
if(typeof tif.http.abort=="function"){
tif.http.abort();
}
this.inFlight.splice(x,1);
tif.req[(typeof tif.req.timeout=="function")?"timeout":"handle"]("timeout",null,tif.http,tif.req);
}
}
}
}
catch(e){
try{
var _2b4=new dojo.io.Error("XMLHttpTransport.watchInFlight Error: "+e);
tif.req[(typeof tif.req.error=="function")?"error":"handle"]("error",_2b4,tif.http,tif.req);
}
catch(e2){
dojo.debug("XMLHttpTransport error callback failed: "+e2);
}
}
}
}
clearTimeout(this.inFlightTimer);
if(this.inFlight.length==0){
this.inFlightTimer=null;
return;
}
this.inFlightTimer=setTimeout("dojo.io.XMLHTTPTransport.watchInFlight();",10);
};
var _2b5=dojo.hostenv.getXmlhttpObject()?true:false;
this.canHandle=function(_2b6){
return _2b5&&dojo.lang.inArray(["text/plain","text/html","application/xml","text/xml","text/javascript","text/json","application/json"],(_2b6["mimetype"].toLowerCase()||""))&&!(_2b6["formNode"]&&dojo.io.formHasFile(_2b6["formNode"]));
};
this.multipartBoundary="45309FFF-BD65-4d50-99C9-36986896A96F";
this.bind=function(_2b7){
if(!_2b7["url"]){
if(!_2b7["formNode"]&&(_2b7["backButton"]||_2b7["back"]||_2b7["changeUrl"]||_2b7["watchForURL"])&&(!djConfig.preventBackButtonFix)){
dojo.deprecated("Using dojo.io.XMLHTTPTransport.bind() to add to browser history without doing an IO request","Use dojo.undo.browser.addToHistory() instead.","0.4");
dojo.undo.browser.addToHistory(_2b7);
return true;
}
}
var url=_2b7.url;
var _2b9="";
if(_2b7["formNode"]){
var ta=_2b7.formNode.getAttribute("action");
if((ta)&&(!_2b7["url"])){
url=ta;
}
var tp=_2b7.formNode.getAttribute("method");
if((tp)&&(!_2b7["method"])){
_2b7.method=tp;
}
_2b9+=dojo.io.encodeForm(_2b7.formNode,_2b7.encoding,_2b7["formFilter"]);
}
if(url.indexOf("#")>-1){
dojo.debug("Warning: dojo.io.bind: stripping hash values from url:",url);
url=url.split("#")[0];
}
if(_2b7["file"]){
_2b7.method="post";
}
if(!_2b7["method"]){
_2b7.method="get";
}
if(_2b7.method.toLowerCase()=="get"){
_2b7.multipart=false;
}else{
if(_2b7["file"]){
_2b7.multipart=true;
}else{
if(!_2b7["multipart"]){
_2b7.multipart=false;
}
}
}
if(_2b7["backButton"]||_2b7["back"]||_2b7["changeUrl"]){
dojo.undo.browser.addToHistory(_2b7);
}
var _2bc=_2b7["content"]||{};
if(_2b7.sendTransport){
_2bc["dojo.transport"]="xmlhttp";
}
do{
if(_2b7.postContent){
_2b9=_2b7.postContent;
break;
}
if(_2bc){
_2b9+=dojo.io.argsFromMap(_2bc,_2b7.encoding);
}
if(_2b7.method.toLowerCase()=="get"||!_2b7.multipart){
break;
}
var t=[];
if(_2b9.length){
var q=_2b9.split("&");
for(var i=0;i<q.length;++i){
if(q[i].length){
var p=q[i].split("=");
t.push("--"+this.multipartBoundary,"Content-Disposition: form-data; name=\""+p[0]+"\"","",p[1]);
}
}
}
if(_2b7.file){
if(dojo.lang.isArray(_2b7.file)){
for(var i=0;i<_2b7.file.length;++i){
var o=_2b7.file[i];
t.push("--"+this.multipartBoundary,"Content-Disposition: form-data; name=\""+o.name+"\"; filename=\""+("fileName" in o?o.fileName:o.name)+"\"","Content-Type: "+("contentType" in o?o.contentType:"application/octet-stream"),"",o.content);
}
}else{
var o=_2b7.file;
t.push("--"+this.multipartBoundary,"Content-Disposition: form-data; name=\""+o.name+"\"; filename=\""+("fileName" in o?o.fileName:o.name)+"\"","Content-Type: "+("contentType" in o?o.contentType:"application/octet-stream"),"",o.content);
}
}
if(t.length){
t.push("--"+this.multipartBoundary+"--","");
_2b9=t.join("\r\n");
}
}while(false);
var _2c2=_2b7["sync"]?false:true;
var _2c3=_2b7["preventCache"]||(this.preventCache==true&&_2b7["preventCache"]!=false);
var _2c4=_2b7["useCache"]==true||(this.useCache==true&&_2b7["useCache"]!=false);
if(!_2c3&&_2c4){
var _2c5=getFromCache(url,_2b9,_2b7.method);
if(_2c5){
doLoad(_2b7,_2c5,url,_2b9,false);
return;
}
}
var http=dojo.hostenv.getXmlhttpObject(_2b7);
var _2c7=false;
if(_2c2){
var _2c8=this.inFlight.push({"req":_2b7,"http":http,"url":url,"query":_2b9,"useCache":_2c4,"startTime":_2b7.timeoutSeconds?(new Date()).getTime():0});
this.startWatchingInFlight();
}else{
_297._blockAsync=true;
}
if(_2b7.method.toLowerCase()=="post"){
if(!_2b7.user){
http.open("POST",url,_2c2);
}else{
http.open("POST",url,_2c2,_2b7.user,_2b7.password);
}
setHeaders(http,_2b7);
http.setRequestHeader("Content-Type",_2b7.multipart?("multipart/form-data; boundary="+this.multipartBoundary):(_2b7.contentType||"application/x-www-form-urlencoded"));
try{
http.send(_2b9);
}
catch(e){
if(typeof http.abort=="function"){
http.abort();
}
doLoad(_2b7,{status:404},url,_2b9,_2c4);
}
}else{
var _2c9=url;
if(_2b9!=""){
_2c9+=(_2c9.indexOf("?")>-1?"&":"?")+_2b9;
}
if(_2c3){
_2c9+=(dojo.string.endsWithAny(_2c9,"?","&")?"":(_2c9.indexOf("?")>-1?"&":"?"))+"dojo.preventCache="+new Date().valueOf();
}
if(!_2b7.user){
http.open(_2b7.method.toUpperCase(),_2c9,_2c2);
}else{
http.open(_2b7.method.toUpperCase(),_2c9,_2c2,_2b7.user,_2b7.password);
}
setHeaders(http,_2b7);
try{
http.send(null);
}
catch(e){
if(typeof http.abort=="function"){
http.abort();
}
doLoad(_2b7,{status:404},url,_2b9,_2c4);
}
}
if(!_2c2){
doLoad(_2b7,http,url,_2b9,_2c4);
_297._blockAsync=false;
}
_2b7.abort=function(){
try{
http._aborted=true;
}
catch(e){
}
return http.abort();
};
return;
};
dojo.io.transports.addTransport("XMLHTTPTransport");
};
}
dojo.provide("dojo.io.cookie");
dojo.io.cookie.setCookie=function(name,_2cb,days,path,_2ce,_2cf){
var _2d0=-1;
if((typeof days=="number")&&(days>=0)){
var d=new Date();
d.setTime(d.getTime()+(days*24*60*60*1000));
_2d0=d.toGMTString();
}
_2cb=escape(_2cb);
document.cookie=name+"="+_2cb+";"+(_2d0!=-1?" expires="+_2d0+";":"")+(path?"path="+path:"")+(_2ce?"; domain="+_2ce:"")+(_2cf?"; secure":"");
};
dojo.io.cookie.set=dojo.io.cookie.setCookie;
dojo.io.cookie.getCookie=function(name){
var idx=document.cookie.lastIndexOf(name+"=");
if(idx==-1){
return null;
}
var _2d4=document.cookie.substring(idx+name.length+1);
var end=_2d4.indexOf(";");
if(end==-1){
end=_2d4.length;
}
_2d4=_2d4.substring(0,end);
_2d4=unescape(_2d4);
return _2d4;
};
dojo.io.cookie.get=dojo.io.cookie.getCookie;
dojo.io.cookie.deleteCookie=function(name){
dojo.io.cookie.setCookie(name,"-",0);
};
dojo.io.cookie.setObjectCookie=function(name,obj,days,path,_2db,_2dc,_2dd){
if(arguments.length==5){
_2dd=_2db;
_2db=null;
_2dc=null;
}
var _2de=[],_2df,_2e0="";
if(!_2dd){
_2df=dojo.io.cookie.getObjectCookie(name);
}
if(days>=0){
if(!_2df){
_2df={};
}
for(var prop in obj){
if(obj[prop]==null){
delete _2df[prop];
}else{
if((typeof obj[prop]=="string")||(typeof obj[prop]=="number")){
_2df[prop]=obj[prop];
}
}
}
prop=null;
for(var prop in _2df){
_2de.push(escape(prop)+"="+escape(_2df[prop]));
}
_2e0=_2de.join("&");
}
dojo.io.cookie.setCookie(name,_2e0,days,path,_2db,_2dc);
};
dojo.io.cookie.getObjectCookie=function(name){
var _2e3=null,_2e4=dojo.io.cookie.getCookie(name);
if(_2e4){
_2e3={};
var _2e5=_2e4.split("&");
for(var i=0;i<_2e5.length;i++){
var pair=_2e5[i].split("=");
var _2e8=pair[1];
if(isNaN(_2e8)){
_2e8=unescape(pair[1]);
}
_2e3[unescape(pair[0])]=_2e8;
}
}
return _2e3;
};
dojo.io.cookie.isSupported=function(){
if(typeof navigator.cookieEnabled!="boolean"){
dojo.io.cookie.setCookie("__TestingYourBrowserForCookieSupport__","CookiesAllowed",90,null);
var _2e9=dojo.io.cookie.getCookie("__TestingYourBrowserForCookieSupport__");
navigator.cookieEnabled=(_2e9=="CookiesAllowed");
if(navigator.cookieEnabled){
this.deleteCookie("__TestingYourBrowserForCookieSupport__");
}
}
return navigator.cookieEnabled;
};
if(!dojo.io.cookies){
dojo.io.cookies=dojo.io.cookie;
}
dojo.kwCompoundRequire({common:["dojo.io.common"],rhino:["dojo.io.RhinoIO"],browser:["dojo.io.BrowserIO","dojo.io.cookie"],dashboard:["dojo.io.BrowserIO","dojo.io.cookie"]});
dojo.provide("dojo.io.*");
dojo.provide("dojo.event.common");
dojo.event=new function(){
this._canTimeout=dojo.lang.isFunction(dj_global["setTimeout"])||dojo.lang.isAlien(dj_global["setTimeout"]);
function interpolateArgs(args,_2eb){
var dl=dojo.lang;
var ao={srcObj:dj_global,srcFunc:null,adviceObj:dj_global,adviceFunc:null,aroundObj:null,aroundFunc:null,adviceType:(args.length>2)?args[0]:"after",precedence:"last",once:false,delay:null,rate:0,adviceMsg:false,maxCalls:-1};
switch(args.length){
case 0:
return;
case 1:
return;
case 2:
ao.srcFunc=args[0];
ao.adviceFunc=args[1];
break;
case 3:
if((dl.isObject(args[0]))&&(dl.isString(args[1]))&&(dl.isString(args[2]))){
ao.adviceType="after";
ao.srcObj=args[0];
ao.srcFunc=args[1];
ao.adviceFunc=args[2];
}else{
if((dl.isString(args[1]))&&(dl.isString(args[2]))){
ao.srcFunc=args[1];
ao.adviceFunc=args[2];
}else{
if((dl.isObject(args[0]))&&(dl.isString(args[1]))&&(dl.isFunction(args[2]))){
ao.adviceType="after";
ao.srcObj=args[0];
ao.srcFunc=args[1];
var _2ee=dl.nameAnonFunc(args[2],ao.adviceObj,_2eb);
ao.adviceFunc=_2ee;
}else{
if((dl.isFunction(args[0]))&&(dl.isObject(args[1]))&&(dl.isString(args[2]))){
ao.adviceType="after";
ao.srcObj=dj_global;
var _2ee=dl.nameAnonFunc(args[0],ao.srcObj,_2eb);
ao.srcFunc=_2ee;
ao.adviceObj=args[1];
ao.adviceFunc=args[2];
}
}
}
}
break;
case 4:
if((dl.isObject(args[0]))&&(dl.isObject(args[2]))){
ao.adviceType="after";
ao.srcObj=args[0];
ao.srcFunc=args[1];
ao.adviceObj=args[2];
ao.adviceFunc=args[3];
}else{
if((dl.isString(args[0]))&&(dl.isString(args[1]))&&(dl.isObject(args[2]))){
ao.adviceType=args[0];
ao.srcObj=dj_global;
ao.srcFunc=args[1];
ao.adviceObj=args[2];
ao.adviceFunc=args[3];
}else{
if((dl.isString(args[0]))&&(dl.isFunction(args[1]))&&(dl.isObject(args[2]))){
ao.adviceType=args[0];
ao.srcObj=dj_global;
var _2ee=dl.nameAnonFunc(args[1],dj_global,_2eb);
ao.srcFunc=_2ee;
ao.adviceObj=args[2];
ao.adviceFunc=args[3];
}else{
if((dl.isString(args[0]))&&(dl.isObject(args[1]))&&(dl.isString(args[2]))&&(dl.isFunction(args[3]))){
ao.srcObj=args[1];
ao.srcFunc=args[2];
var _2ee=dl.nameAnonFunc(args[3],dj_global,_2eb);
ao.adviceObj=dj_global;
ao.adviceFunc=_2ee;
}else{
if(dl.isObject(args[1])){
ao.srcObj=args[1];
ao.srcFunc=args[2];
ao.adviceObj=dj_global;
ao.adviceFunc=args[3];
}else{
if(dl.isObject(args[2])){
ao.srcObj=dj_global;
ao.srcFunc=args[1];
ao.adviceObj=args[2];
ao.adviceFunc=args[3];
}else{
ao.srcObj=ao.adviceObj=ao.aroundObj=dj_global;
ao.srcFunc=args[1];
ao.adviceFunc=args[2];
ao.aroundFunc=args[3];
}
}
}
}
}
}
break;
case 6:
ao.srcObj=args[1];
ao.srcFunc=args[2];
ao.adviceObj=args[3];
ao.adviceFunc=args[4];
ao.aroundFunc=args[5];
ao.aroundObj=dj_global;
break;
default:
ao.srcObj=args[1];
ao.srcFunc=args[2];
ao.adviceObj=args[3];
ao.adviceFunc=args[4];
ao.aroundObj=args[5];
ao.aroundFunc=args[6];
ao.once=args[7];
ao.delay=args[8];
ao.rate=args[9];
ao.adviceMsg=args[10];
ao.maxCalls=(!isNaN(parseInt(args[11])))?args[11]:-1;
break;
}
if(dl.isFunction(ao.aroundFunc)){
var _2ee=dl.nameAnonFunc(ao.aroundFunc,ao.aroundObj,_2eb);
ao.aroundFunc=_2ee;
}
if(dl.isFunction(ao.srcFunc)){
ao.srcFunc=dl.getNameInObj(ao.srcObj,ao.srcFunc);
}
if(dl.isFunction(ao.adviceFunc)){
ao.adviceFunc=dl.getNameInObj(ao.adviceObj,ao.adviceFunc);
}
if((ao.aroundObj)&&(dl.isFunction(ao.aroundFunc))){
ao.aroundFunc=dl.getNameInObj(ao.aroundObj,ao.aroundFunc);
}
if(!ao.srcObj){
dojo.raise("bad srcObj for srcFunc: "+ao.srcFunc);
}
if(!ao.adviceObj){
dojo.raise("bad adviceObj for adviceFunc: "+ao.adviceFunc);
}
if(!ao.adviceFunc){
dojo.debug("bad adviceFunc for srcFunc: "+ao.srcFunc);
dojo.debugShallow(ao);
}
return ao;
}
this.connect=function(){
if(arguments.length==1){
var ao=arguments[0];
}else{
var ao=interpolateArgs(arguments,true);
}
if(dojo.lang.isArray(ao.srcObj)&&ao.srcObj!=""){
var _2f0={};
for(var x in ao){
_2f0[x]=ao[x];
}
var mjps=[];
dojo.lang.forEach(ao.srcObj,function(src){
if((dojo.render.html.capable)&&(dojo.lang.isString(src))){
src=dojo.byId(src);
}
_2f0.srcObj=src;
mjps.push(dojo.event.connect.call(dojo.event,_2f0));
});
return mjps;
}
var mjp=dojo.event.MethodJoinPoint.getForMethod(ao.srcObj,ao.srcFunc);
if(ao.adviceFunc){
var mjp2=dojo.event.MethodJoinPoint.getForMethod(ao.adviceObj,ao.adviceFunc);
}
mjp.kwAddAdvice(ao);
return mjp;
};
this.log=function(a1,a2){
var _2f8;
if((arguments.length==1)&&(typeof a1=="object")){
_2f8=a1;
}else{
_2f8={srcObj:a1,srcFunc:a2};
}
_2f8.adviceFunc=function(){
var _2f9=[];
for(var x=0;x<arguments.length;x++){
_2f9.push(arguments[x]);
}
dojo.debug("("+_2f8.srcObj+")."+_2f8.srcFunc,":",_2f9.join(", "));
};
this.kwConnect(_2f8);
};
this.connectBefore=function(){
var args=["before"];
for(var i=0;i<arguments.length;i++){
args.push(arguments[i]);
}
return this.connect.apply(this,args);
};
this.connectAround=function(){
var args=["around"];
for(var i=0;i<arguments.length;i++){
args.push(arguments[i]);
}
return this.connect.apply(this,args);
};
this.connectOnce=function(){
var ao=interpolateArgs(arguments,true);
ao.once=true;
return this.connect(ao);
};
this.connectRunOnce=function(){
var ao=interpolateArgs(arguments,true);
ao.maxCalls=1;
return this.connect(ao);
};
this._kwConnectImpl=function(_301,_302){
var fn=(_302)?"disconnect":"connect";
if(typeof _301["srcFunc"]=="function"){
_301.srcObj=_301["srcObj"]||dj_global;
var _304=dojo.lang.nameAnonFunc(_301.srcFunc,_301.srcObj,true);
_301.srcFunc=_304;
}
if(typeof _301["adviceFunc"]=="function"){
_301.adviceObj=_301["adviceObj"]||dj_global;
var _304=dojo.lang.nameAnonFunc(_301.adviceFunc,_301.adviceObj,true);
_301.adviceFunc=_304;
}
_301.srcObj=_301["srcObj"]||dj_global;
_301.adviceObj=_301["adviceObj"]||_301["targetObj"]||dj_global;
_301.adviceFunc=_301["adviceFunc"]||_301["targetFunc"];
return dojo.event[fn](_301);
};
this.kwConnect=function(_305){
return this._kwConnectImpl(_305,false);
};
this.disconnect=function(){
if(arguments.length==1){
var ao=arguments[0];
}else{
var ao=interpolateArgs(arguments,true);
}
if(!ao.adviceFunc){
return;
}
if(dojo.lang.isString(ao.srcFunc)&&(ao.srcFunc.toLowerCase()=="onkey")){
if(dojo.render.html.ie){
ao.srcFunc="onkeydown";
this.disconnect(ao);
}
ao.srcFunc="onkeypress";
}
if(!ao.srcObj[ao.srcFunc]){
return null;
}
var mjp=dojo.event.MethodJoinPoint.getForMethod(ao.srcObj,ao.srcFunc,true);
mjp.removeAdvice(ao.adviceObj,ao.adviceFunc,ao.adviceType,ao.once);
return mjp;
};
this.kwDisconnect=function(_308){
return this._kwConnectImpl(_308,true);
};
};
dojo.event.MethodInvocation=function(_309,obj,args){
this.jp_=_309;
this.object=obj;
this.args=[];
for(var x=0;x<args.length;x++){
this.args[x]=args[x];
}
this.around_index=-1;
};
dojo.event.MethodInvocation.prototype.proceed=function(){
this.around_index++;
if(this.around_index>=this.jp_.around.length){
return this.jp_.object[this.jp_.methodname].apply(this.jp_.object,this.args);
}else{
var ti=this.jp_.around[this.around_index];
var mobj=ti[0]||dj_global;
var meth=ti[1];
return mobj[meth].call(mobj,this);
}
};
dojo.event.MethodJoinPoint=function(obj,_311){
this.object=obj||dj_global;
this.methodname=_311;
this.methodfunc=this.object[_311];
this.squelch=false;
};
dojo.event.MethodJoinPoint.getForMethod=function(obj,_313){
if(!obj){
obj=dj_global;
}
var ofn=obj[_313];
if(!ofn){
ofn=obj[_313]=function(){
};
if(!obj[_313]){
dojo.raise("Cannot set do-nothing method on that object "+_313);
}
}else{
if((typeof ofn!="function")&&(!dojo.lang.isFunction(ofn))&&(!dojo.lang.isAlien(ofn))){
return null;
}
}
var _315=_313+"$joinpoint";
var _316=_313+"$joinpoint$method";
var _317=obj[_315];
if(!_317){
var _318=false;
if(dojo.event["browser"]){
if((obj["attachEvent"])||(obj["nodeType"])||(obj["addEventListener"])){
_318=true;
dojo.event.browser.addClobberNodeAttrs(obj,[_315,_316,_313]);
}
}
var _319=ofn.length;
obj[_316]=ofn;
_317=obj[_315]=new dojo.event.MethodJoinPoint(obj,_316);
if(!_318){
obj[_313]=function(){
return _317.run.apply(_317,arguments);
};
}else{
obj[_313]=function(){
var args=[];
if(!arguments.length){
var evt=null;
try{
if(obj.ownerDocument){
evt=obj.ownerDocument.parentWindow.event;
}else{
if(obj.documentElement){
evt=obj.documentElement.ownerDocument.parentWindow.event;
}else{
if(obj.event){
evt=obj.event;
}else{
evt=window.event;
}
}
}
}
catch(e){
evt=window.event;
}
if(evt){
args.push(dojo.event.browser.fixEvent(evt,this));
}
}else{
for(var x=0;x<arguments.length;x++){
if((x==0)&&(dojo.event.browser.isEvent(arguments[x]))){
args.push(dojo.event.browser.fixEvent(arguments[x],this));
}else{
args.push(arguments[x]);
}
}
}
return _317.run.apply(_317,args);
};
}
obj[_313].__preJoinArity=_319;
}
return _317;
};
dojo.lang.extend(dojo.event.MethodJoinPoint,{squelch:false,unintercept:function(){
this.object[this.methodname]=this.methodfunc;
this.before=[];
this.after=[];
this.around=[];
},disconnect:dojo.lang.forward("unintercept"),run:function(){
var obj=this.object||dj_global;
var args=arguments;
var _31f=[];
for(var x=0;x<args.length;x++){
_31f[x]=args[x];
}
var _321=function(marr){
if(!marr){
dojo.debug("Null argument to unrollAdvice()");
return;
}
var _323=marr[0]||dj_global;
var _324=marr[1];
if(!_323[_324]){
dojo.raise("function \""+_324+"\" does not exist on \""+_323+"\"");
}
var _325=marr[2]||dj_global;
var _326=marr[3];
var msg=marr[6];
var _328=marr[7];
if(_328>-1){
if(_328==0){
return;
}
marr[7]--;
}
var _329;
var to={args:[],jp_:this,object:obj,proceed:function(){
return _323[_324].apply(_323,to.args);
}};
to.args=_31f;
var _32b=parseInt(marr[4]);
var _32c=((!isNaN(_32b))&&(marr[4]!==null)&&(typeof marr[4]!="undefined"));
if(marr[5]){
var rate=parseInt(marr[5]);
var cur=new Date();
var _32f=false;
if((marr["last"])&&((cur-marr.last)<=rate)){
if(dojo.event._canTimeout){
if(marr["delayTimer"]){
clearTimeout(marr.delayTimer);
}
var tod=parseInt(rate*2);
var mcpy=dojo.lang.shallowCopy(marr);
marr.delayTimer=setTimeout(function(){
mcpy[5]=0;
_321(mcpy);
},tod);
}
return;
}else{
marr.last=cur;
}
}
if(_326){
_325[_326].call(_325,to);
}else{
if((_32c)&&((dojo.render.html)||(dojo.render.svg))){
dj_global["setTimeout"](function(){
if(msg){
_323[_324].call(_323,to);
}else{
_323[_324].apply(_323,args);
}
},_32b);
}else{
if(msg){
_323[_324].call(_323,to);
}else{
_323[_324].apply(_323,args);
}
}
}
};
var _332=function(){
if(this.squelch){
try{
return _321.apply(this,arguments);
}
catch(e){
dojo.debug(e);
}
}else{
return _321.apply(this,arguments);
}
};
if((this["before"])&&(this.before.length>0)){
dojo.lang.forEach(this.before.concat(new Array()),_332);
}
var _333;
try{
if((this["around"])&&(this.around.length>0)){
var mi=new dojo.event.MethodInvocation(this,obj,args);
_333=mi.proceed();
}else{
if(this.methodfunc){
_333=this.object[this.methodname].apply(this.object,args);
}
}
}
catch(e){
if(!this.squelch){
dojo.debug(e,"when calling",this.methodname,"on",this.object,"with arguments",args);
dojo.raise(e);
}
}
if((this["after"])&&(this.after.length>0)){
dojo.lang.forEach(this.after.concat(new Array()),_332);
}
return (this.methodfunc)?_333:null;
},getArr:function(kind){
var type="after";
if((typeof kind=="string")&&(kind.indexOf("before")!=-1)){
type="before";
}else{
if(kind=="around"){
type="around";
}
}
if(!this[type]){
this[type]=[];
}
return this[type];
},kwAddAdvice:function(args){
this.addAdvice(args["adviceObj"],args["adviceFunc"],args["aroundObj"],args["aroundFunc"],args["adviceType"],args["precedence"],args["once"],args["delay"],args["rate"],args["adviceMsg"],args["maxCalls"]);
},addAdvice:function(_338,_339,_33a,_33b,_33c,_33d,once,_33f,rate,_341,_342){
var arr=this.getArr(_33c);
if(!arr){
dojo.raise("bad this: "+this);
}
var ao=[_338,_339,_33a,_33b,_33f,rate,_341,_342];
if(once){
if(this.hasAdvice(_338,_339,_33c,arr)>=0){
return;
}
}
if(_33d=="first"){
arr.unshift(ao);
}else{
arr.push(ao);
}
},hasAdvice:function(_345,_346,_347,arr){
if(!arr){
arr=this.getArr(_347);
}
var ind=-1;
for(var x=0;x<arr.length;x++){
var aao=(typeof _346=="object")?(new String(_346)).toString():_346;
var a1o=(typeof arr[x][1]=="object")?(new String(arr[x][1])).toString():arr[x][1];
if((arr[x][0]==_345)&&(a1o==aao)){
ind=x;
}
}
return ind;
},removeAdvice:function(_34d,_34e,_34f,once){
var arr=this.getArr(_34f);
var ind=this.hasAdvice(_34d,_34e,_34f,arr);
if(ind==-1){
return false;
}
while(ind!=-1){
arr.splice(ind,1);
if(once){
break;
}
ind=this.hasAdvice(_34d,_34e,_34f,arr);
}
return true;
}});
dojo.provide("dojo.event.topic");
dojo.event.topic=new function(){
this.topics={};
this.getTopic=function(_353){
if(!this.topics[_353]){
this.topics[_353]=new this.TopicImpl(_353);
}
return this.topics[_353];
};
this.registerPublisher=function(_354,obj,_356){
var _354=this.getTopic(_354);
_354.registerPublisher(obj,_356);
};
this.subscribe=function(_357,obj,_359){
var _357=this.getTopic(_357);
_357.subscribe(obj,_359);
};
this.unsubscribe=function(_35a,obj,_35c){
var _35a=this.getTopic(_35a);
_35a.unsubscribe(obj,_35c);
};
this.destroy=function(_35d){
this.getTopic(_35d).destroy();
delete this.topics[_35d];
};
this.publishApply=function(_35e,args){
var _35e=this.getTopic(_35e);
_35e.sendMessage.apply(_35e,args);
};
this.publish=function(_360,_361){
var _360=this.getTopic(_360);
var args=[];
for(var x=1;x<arguments.length;x++){
args.push(arguments[x]);
}
_360.sendMessage.apply(_360,args);
};
};
dojo.event.topic.TopicImpl=function(_364){
this.topicName=_364;
this.subscribe=function(_365,_366){
var tf=_366||_365;
var to=(!_366)?dj_global:_365;
return dojo.event.kwConnect({srcObj:this,srcFunc:"sendMessage",adviceObj:to,adviceFunc:tf});
};
this.unsubscribe=function(_369,_36a){
var tf=(!_36a)?_369:_36a;
var to=(!_36a)?null:_369;
return dojo.event.kwDisconnect({srcObj:this,srcFunc:"sendMessage",adviceObj:to,adviceFunc:tf});
};
this._getJoinPoint=function(){
return dojo.event.MethodJoinPoint.getForMethod(this,"sendMessage");
};
this.setSquelch=function(_36d){
this._getJoinPoint().squelch=_36d;
};
this.destroy=function(){
this._getJoinPoint().disconnect();
};
this.registerPublisher=function(_36e,_36f){
dojo.event.connect(_36e,_36f,this,"sendMessage");
};
this.sendMessage=function(_370){
};
};
dojo.provide("dojo.event.browser");
dojo._ie_clobber=new function(){
this.clobberNodes=[];
function nukeProp(node,prop){
try{
node[prop]=null;
}
catch(e){
}
try{
delete node[prop];
}
catch(e){
}
try{
node.removeAttribute(prop);
}
catch(e){
}
}
this.clobber=function(_373){
var na;
var tna;
if(_373){
tna=_373.all||_373.getElementsByTagName("*");
na=[_373];
for(var x=0;x<tna.length;x++){
if(tna[x]["__doClobber__"]){
na.push(tna[x]);
}
}
}else{
try{
window.onload=null;
}
catch(e){
}
na=(this.clobberNodes.length)?this.clobberNodes:document.all;
}
tna=null;
var _377={};
for(var i=na.length-1;i>=0;i=i-1){
var el=na[i];
try{
if(el&&el["__clobberAttrs__"]){
for(var j=0;j<el.__clobberAttrs__.length;j++){
nukeProp(el,el.__clobberAttrs__[j]);
}
nukeProp(el,"__clobberAttrs__");
nukeProp(el,"__doClobber__");
}
}
catch(e){
}
}
na=null;
};
};
if(dojo.render.html.ie){
dojo.addOnUnload(function(){
dojo._ie_clobber.clobber();
try{
if((dojo["widget"])&&(dojo.widget["manager"])){
dojo.widget.manager.destroyAll();
}
}
catch(e){
}
if(dojo.widget){
for(var name in dojo.widget._templateCache){
if(dojo.widget._templateCache[name].node){
dojo.dom.destroyNode(dojo.widget._templateCache[name].node);
dojo.widget._templateCache[name].node=null;
delete dojo.widget._templateCache[name].node;
}
}
}
try{
window.onload=null;
}
catch(e){
}
try{
window.onunload=null;
}
catch(e){
}
dojo._ie_clobber.clobberNodes=[];
});
}
dojo.event.browser=new function(){
var _37c=0;
this.normalizedEventName=function(_37d){
switch(_37d){
case "CheckboxStateChange":
case "DOMAttrModified":
case "DOMMenuItemActive":
case "DOMMenuItemInactive":
case "DOMMouseScroll":
case "DOMNodeInserted":
case "DOMNodeRemoved":
case "RadioStateChange":
return _37d;
break;
default:
var lcn=_37d.toLowerCase();
return (lcn.indexOf("on")==0)?lcn.substr(2):lcn;
break;
}
};
this.clean=function(node){
if(dojo.render.html.ie){
dojo._ie_clobber.clobber(node);
}
};
this.addClobberNode=function(node){
if(!dojo.render.html.ie){
return;
}
if(!node["__doClobber__"]){
node.__doClobber__=true;
dojo._ie_clobber.clobberNodes.push(node);
node.__clobberAttrs__=[];
}
};
this.addClobberNodeAttrs=function(node,_382){
if(!dojo.render.html.ie){
return;
}
this.addClobberNode(node);
for(var x=0;x<_382.length;x++){
node.__clobberAttrs__.push(_382[x]);
}
};
this.removeListener=function(node,_385,fp,_387){
if(!_387){
var _387=false;
}
_385=dojo.event.browser.normalizedEventName(_385);
if(_385=="key"){
if(dojo.render.html.ie){
this.removeListener(node,"onkeydown",fp,_387);
}
_385="keypress";
}
if(node.removeEventListener){
node.removeEventListener(_385,fp,_387);
}
};
this.addListener=function(node,_389,fp,_38b,_38c){
if(!node){
return;
}
if(!_38b){
var _38b=false;
}
_389=dojo.event.browser.normalizedEventName(_389);
if(_389=="key"){
if(dojo.render.html.ie){
this.addListener(node,"onkeydown",fp,_38b,_38c);
}
_389="keypress";
}
if(!_38c){
var _38d=function(evt){
if(!evt){
evt=window.event;
}
var ret=fp(dojo.event.browser.fixEvent(evt,this));
if(_38b){
dojo.event.browser.stopEvent(evt);
}
return ret;
};
}else{
_38d=fp;
}
if(node.addEventListener){
node.addEventListener(_389,_38d,_38b);
return _38d;
}else{
_389="on"+_389;
if(typeof node[_389]=="function"){
var _390=node[_389];
node[_389]=function(e){
_390(e);
return _38d(e);
};
}else{
node[_389]=_38d;
}
if(dojo.render.html.ie){
this.addClobberNodeAttrs(node,[_389]);
}
return _38d;
}
};
this.isEvent=function(obj){
return (typeof obj!="undefined")&&(obj)&&(typeof Event!="undefined")&&(obj.eventPhase);
};
this.currentEvent=null;
this.callListener=function(_393,_394){
if(typeof _393!="function"){
dojo.raise("listener not a function: "+_393);
}
dojo.event.browser.currentEvent.currentTarget=_394;
return _393.call(_394,dojo.event.browser.currentEvent);
};
this._stopPropagation=function(){
dojo.event.browser.currentEvent.cancelBubble=true;
};
this._preventDefault=function(){
dojo.event.browser.currentEvent.returnValue=false;
};
this.keys={KEY_BACKSPACE:8,KEY_TAB:9,KEY_CLEAR:12,KEY_ENTER:13,KEY_SHIFT:16,KEY_CTRL:17,KEY_ALT:18,KEY_PAUSE:19,KEY_CAPS_LOCK:20,KEY_ESCAPE:27,KEY_SPACE:32,KEY_PAGE_UP:33,KEY_PAGE_DOWN:34,KEY_END:35,KEY_HOME:36,KEY_LEFT_ARROW:37,KEY_UP_ARROW:38,KEY_RIGHT_ARROW:39,KEY_DOWN_ARROW:40,KEY_INSERT:45,KEY_DELETE:46,KEY_HELP:47,KEY_LEFT_WINDOW:91,KEY_RIGHT_WINDOW:92,KEY_SELECT:93,KEY_NUMPAD_0:96,KEY_NUMPAD_1:97,KEY_NUMPAD_2:98,KEY_NUMPAD_3:99,KEY_NUMPAD_4:100,KEY_NUMPAD_5:101,KEY_NUMPAD_6:102,KEY_NUMPAD_7:103,KEY_NUMPAD_8:104,KEY_NUMPAD_9:105,KEY_NUMPAD_MULTIPLY:106,KEY_NUMPAD_PLUS:107,KEY_NUMPAD_ENTER:108,KEY_NUMPAD_MINUS:109,KEY_NUMPAD_PERIOD:110,KEY_NUMPAD_DIVIDE:111,KEY_F1:112,KEY_F2:113,KEY_F3:114,KEY_F4:115,KEY_F5:116,KEY_F6:117,KEY_F7:118,KEY_F8:119,KEY_F9:120,KEY_F10:121,KEY_F11:122,KEY_F12:123,KEY_F13:124,KEY_F14:125,KEY_F15:126,KEY_NUM_LOCK:144,KEY_SCROLL_LOCK:145};
this.revKeys=[];
for(var key in this.keys){
this.revKeys[this.keys[key]]=key;
}
this.fixEvent=function(evt,_397){
if(!evt){
if(window["event"]){
evt=window.event;
}
}
if((evt["type"])&&(evt["type"].indexOf("key")==0)){
evt.keys=this.revKeys;
for(var key in this.keys){
evt[key]=this.keys[key];
}
if(evt["type"]=="keydown"&&dojo.render.html.ie){
switch(evt.keyCode){
case evt.KEY_SHIFT:
case evt.KEY_CTRL:
case evt.KEY_ALT:
case evt.KEY_CAPS_LOCK:
case evt.KEY_LEFT_WINDOW:
case evt.KEY_RIGHT_WINDOW:
case evt.KEY_SELECT:
case evt.KEY_NUM_LOCK:
case evt.KEY_SCROLL_LOCK:
case evt.KEY_NUMPAD_0:
case evt.KEY_NUMPAD_1:
case evt.KEY_NUMPAD_2:
case evt.KEY_NUMPAD_3:
case evt.KEY_NUMPAD_4:
case evt.KEY_NUMPAD_5:
case evt.KEY_NUMPAD_6:
case evt.KEY_NUMPAD_7:
case evt.KEY_NUMPAD_8:
case evt.KEY_NUMPAD_9:
case evt.KEY_NUMPAD_PERIOD:
break;
case evt.KEY_NUMPAD_MULTIPLY:
case evt.KEY_NUMPAD_PLUS:
case evt.KEY_NUMPAD_ENTER:
case evt.KEY_NUMPAD_MINUS:
case evt.KEY_NUMPAD_DIVIDE:
break;
case evt.KEY_PAUSE:
case evt.KEY_TAB:
case evt.KEY_BACKSPACE:
case evt.KEY_ENTER:
case evt.KEY_ESCAPE:
case evt.KEY_PAGE_UP:
case evt.KEY_PAGE_DOWN:
case evt.KEY_END:
case evt.KEY_HOME:
case evt.KEY_LEFT_ARROW:
case evt.KEY_UP_ARROW:
case evt.KEY_RIGHT_ARROW:
case evt.KEY_DOWN_ARROW:
case evt.KEY_INSERT:
case evt.KEY_DELETE:
case evt.KEY_F1:
case evt.KEY_F2:
case evt.KEY_F3:
case evt.KEY_F4:
case evt.KEY_F5:
case evt.KEY_F6:
case evt.KEY_F7:
case evt.KEY_F8:
case evt.KEY_F9:
case evt.KEY_F10:
case evt.KEY_F11:
case evt.KEY_F12:
case evt.KEY_F12:
case evt.KEY_F13:
case evt.KEY_F14:
case evt.KEY_F15:
case evt.KEY_CLEAR:
case evt.KEY_HELP:
evt.key=evt.keyCode;
break;
default:
if(evt.ctrlKey||evt.altKey){
var _399=evt.keyCode;
if(_399>=65&&_399<=90&&evt.shiftKey==false){
_399+=32;
}
if(_399>=1&&_399<=26&&evt.ctrlKey){
_399+=96;
}
evt.key=String.fromCharCode(_399);
}
}
}else{
if(evt["type"]=="keypress"){
if(dojo.render.html.opera){
if(evt.which==0){
evt.key=evt.keyCode;
}else{
if(evt.which>0){
switch(evt.which){
case evt.KEY_SHIFT:
case evt.KEY_CTRL:
case evt.KEY_ALT:
case evt.KEY_CAPS_LOCK:
case evt.KEY_NUM_LOCK:
case evt.KEY_SCROLL_LOCK:
break;
case evt.KEY_PAUSE:
case evt.KEY_TAB:
case evt.KEY_BACKSPACE:
case evt.KEY_ENTER:
case evt.KEY_ESCAPE:
evt.key=evt.which;
break;
default:
var _399=evt.which;
if((evt.ctrlKey||evt.altKey||evt.metaKey)&&(evt.which>=65&&evt.which<=90&&evt.shiftKey==false)){
_399+=32;
}
evt.key=String.fromCharCode(_399);
}
}
}
}else{
if(dojo.render.html.ie){
if(!evt.ctrlKey&&!evt.altKey&&evt.keyCode>=evt.KEY_SPACE){
evt.key=String.fromCharCode(evt.keyCode);
}
}else{
if(dojo.render.html.safari){
switch(evt.keyCode){
case 25:
evt.key=evt.KEY_TAB;
evt.shift=true;
break;
case 63232:
evt.key=evt.KEY_UP_ARROW;
break;
case 63233:
evt.key=evt.KEY_DOWN_ARROW;
break;
case 63234:
evt.key=evt.KEY_LEFT_ARROW;
break;
case 63235:
evt.key=evt.KEY_RIGHT_ARROW;
break;
case 63236:
evt.key=evt.KEY_F1;
break;
case 63237:
evt.key=evt.KEY_F2;
break;
case 63238:
evt.key=evt.KEY_F3;
break;
case 63239:
evt.key=evt.KEY_F4;
break;
case 63240:
evt.key=evt.KEY_F5;
break;
case 63241:
evt.key=evt.KEY_F6;
break;
case 63242:
evt.key=evt.KEY_F7;
break;
case 63243:
evt.key=evt.KEY_F8;
break;
case 63244:
evt.key=evt.KEY_F9;
break;
case 63245:
evt.key=evt.KEY_F10;
break;
case 63246:
evt.key=evt.KEY_F11;
break;
case 63247:
evt.key=evt.KEY_F12;
break;
case 63250:
evt.key=evt.KEY_PAUSE;
break;
case 63272:
evt.key=evt.KEY_DELETE;
break;
case 63273:
evt.key=evt.KEY_HOME;
break;
case 63275:
evt.key=evt.KEY_END;
break;
case 63276:
evt.key=evt.KEY_PAGE_UP;
break;
case 63277:
evt.key=evt.KEY_PAGE_DOWN;
break;
case 63302:
evt.key=evt.KEY_INSERT;
break;
case 63248:
case 63249:
case 63289:
break;
default:
evt.key=evt.charCode>=evt.KEY_SPACE?String.fromCharCode(evt.charCode):evt.keyCode;
}
}else{
evt.key=evt.charCode>0?String.fromCharCode(evt.charCode):evt.keyCode;
}
}
}
}
}
}
if(dojo.render.html.ie){
if(!evt.target){
evt.target=evt.srcElement;
}
if(!evt.currentTarget){
evt.currentTarget=(_397?_397:evt.srcElement);
}
if(!evt.layerX){
evt.layerX=evt.offsetX;
}
if(!evt.layerY){
evt.layerY=evt.offsetY;
}
var doc=(evt.srcElement&&evt.srcElement.ownerDocument)?evt.srcElement.ownerDocument:document;
var _39b=((dojo.render.html.ie55)||(doc["compatMode"]=="BackCompat"))?doc.body:doc.documentElement;
if(!evt.pageX){
evt.pageX=evt.clientX+(_39b.scrollLeft||0);
}
if(!evt.pageY){
evt.pageY=evt.clientY+(_39b.scrollTop||0);
}
if(evt.type=="mouseover"){
evt.relatedTarget=evt.fromElement;
}
if(evt.type=="mouseout"){
evt.relatedTarget=evt.toElement;
}
this.currentEvent=evt;
evt.callListener=this.callListener;
evt.stopPropagation=this._stopPropagation;
evt.preventDefault=this._preventDefault;
}
return evt;
};
this.stopEvent=function(evt){
if(window.event){
evt.cancelBubble=true;
evt.returnValue=false;
}else{
evt.preventDefault();
evt.stopPropagation();
}
};
};
dojo.kwCompoundRequire({common:["dojo.event.common","dojo.event.topic"],browser:["dojo.event.browser"],dashboard:["dojo.event.browser"]});
dojo.provide("dojo.event.*");
dojo.provide("dojo.gfx.color");
dojo.gfx.color.Color=function(r,g,b,a){
if(dojo.lang.isArray(r)){
this.r=r[0];
this.g=r[1];
this.b=r[2];
this.a=r[3]||1;
}else{
if(dojo.lang.isString(r)){
var rgb=dojo.gfx.color.extractRGB(r);
this.r=rgb[0];
this.g=rgb[1];
this.b=rgb[2];
this.a=g||1;
}else{
if(r instanceof dojo.gfx.color.Color){
this.r=r.r;
this.b=r.b;
this.g=r.g;
this.a=r.a;
}else{
this.r=r;
this.g=g;
this.b=b;
this.a=a;
}
}
}
};
dojo.gfx.color.Color.fromArray=function(arr){
return new dojo.gfx.color.Color(arr[0],arr[1],arr[2],arr[3]);
};
dojo.extend(dojo.gfx.color.Color,{toRgb:function(_3a3){
if(_3a3){
return this.toRgba();
}else{
return [this.r,this.g,this.b];
}
},toRgba:function(){
return [this.r,this.g,this.b,this.a];
},toHex:function(){
return dojo.gfx.color.rgb2hex(this.toRgb());
},toCss:function(){
return "rgb("+this.toRgb().join()+")";
},toString:function(){
return this.toHex();
},blend:function(_3a4,_3a5){
var rgb=null;
if(dojo.lang.isArray(_3a4)){
rgb=_3a4;
}else{
if(_3a4 instanceof dojo.gfx.color.Color){
rgb=_3a4.toRgb();
}else{
rgb=new dojo.gfx.color.Color(_3a4).toRgb();
}
}
return dojo.gfx.color.blend(this.toRgb(),rgb,_3a5);
}});
dojo.gfx.color.named={white:[255,255,255],black:[0,0,0],red:[255,0,0],green:[0,255,0],lime:[0,255,0],blue:[0,0,255],navy:[0,0,128],gray:[128,128,128],silver:[192,192,192]};
dojo.gfx.color.blend=function(a,b,_3a9){
if(typeof a=="string"){
return dojo.gfx.color.blendHex(a,b,_3a9);
}
if(!_3a9){
_3a9=0;
}
_3a9=Math.min(Math.max(-1,_3a9),1);
_3a9=((_3a9+1)/2);
var c=[];
for(var x=0;x<3;x++){
c[x]=parseInt(b[x]+((a[x]-b[x])*_3a9));
}
return c;
};
dojo.gfx.color.blendHex=function(a,b,_3ae){
return dojo.gfx.color.rgb2hex(dojo.gfx.color.blend(dojo.gfx.color.hex2rgb(a),dojo.gfx.color.hex2rgb(b),_3ae));
};
dojo.gfx.color.extractRGB=function(_3af){
var hex="0123456789abcdef";
_3af=_3af.toLowerCase();
if(_3af.indexOf("rgb")==0){
var _3b1=_3af.match(/rgba*\((\d+), *(\d+), *(\d+)/i);
var ret=_3b1.splice(1,3);
return ret;
}else{
var _3b3=dojo.gfx.color.hex2rgb(_3af);
if(_3b3){
return _3b3;
}else{
return dojo.gfx.color.named[_3af]||[255,255,255];
}
}
};
dojo.gfx.color.hex2rgb=function(hex){
var _3b5="0123456789ABCDEF";
var rgb=new Array(3);
if(hex.indexOf("#")==0){
hex=hex.substring(1);
}
hex=hex.toUpperCase();
if(hex.replace(new RegExp("["+_3b5+"]","g"),"")!=""){
return null;
}
if(hex.length==3){
rgb[0]=hex.charAt(0)+hex.charAt(0);
rgb[1]=hex.charAt(1)+hex.charAt(1);
rgb[2]=hex.charAt(2)+hex.charAt(2);
}else{
rgb[0]=hex.substring(0,2);
rgb[1]=hex.substring(2,4);
rgb[2]=hex.substring(4);
}
for(var i=0;i<rgb.length;i++){
rgb[i]=_3b5.indexOf(rgb[i].charAt(0))*16+_3b5.indexOf(rgb[i].charAt(1));
}
return rgb;
};
dojo.gfx.color.rgb2hex=function(r,g,b){
if(dojo.lang.isArray(r)){
g=r[1]||0;
b=r[2]||0;
r=r[0]||0;
}
var ret=dojo.lang.map([r,g,b],function(x){
x=new Number(x);
var s=x.toString(16);
while(s.length<2){
s="0"+s;
}
return s;
});
ret.unshift("#");
return ret.join("");
};
dojo.provide("dojo.lfx.Animation");
dojo.lfx.Line=function(_3be,end){
this.start=_3be;
this.end=end;
if(dojo.lang.isArray(_3be)){
var diff=[];
dojo.lang.forEach(this.start,function(s,i){
diff[i]=this.end[i]-s;
},this);
this.getValue=function(n){
var res=[];
dojo.lang.forEach(this.start,function(s,i){
res[i]=(diff[i]*n)+s;
},this);
return res;
};
}else{
var diff=end-_3be;
this.getValue=function(n){
return (diff*n)+this.start;
};
}
};
if((dojo.render.html.khtml)&&(!dojo.render.html.safari)){
dojo.lfx.easeDefault=function(n){
return (parseFloat("0.5")+((Math.sin((n+parseFloat("1.5"))*Math.PI))/2));
};
}else{
dojo.lfx.easeDefault=function(n){
return (0.5+((Math.sin((n+1.5)*Math.PI))/2));
};
}
dojo.lfx.easeIn=function(n){
return Math.pow(n,3);
};
dojo.lfx.easeOut=function(n){
return (1-Math.pow(1-n,3));
};
dojo.lfx.easeInOut=function(n){
return ((3*Math.pow(n,2))-(2*Math.pow(n,3)));
};
dojo.lfx.IAnimation=function(){
};
dojo.lang.extend(dojo.lfx.IAnimation,{curve:null,duration:1000,easing:null,repeatCount:0,rate:10,handler:null,beforeBegin:null,onBegin:null,onAnimate:null,onEnd:null,onPlay:null,onPause:null,onStop:null,play:null,pause:null,stop:null,connect:function(evt,_3ce,_3cf){
if(!_3cf){
_3cf=_3ce;
_3ce=this;
}
_3cf=dojo.lang.hitch(_3ce,_3cf);
var _3d0=this[evt]||function(){
};
this[evt]=function(){
var ret=_3d0.apply(this,arguments);
_3cf.apply(this,arguments);
return ret;
};
return this;
},fire:function(evt,args){
if(this[evt]){
this[evt].apply(this,(args||[]));
}
return this;
},repeat:function(_3d4){
this.repeatCount=_3d4;
return this;
},_active:false,_paused:false});
dojo.lfx.Animation=function(_3d5,_3d6,_3d7,_3d8,_3d9,rate){
dojo.lfx.IAnimation.call(this);
if(dojo.lang.isNumber(_3d5)||(!_3d5&&_3d6.getValue)){
rate=_3d9;
_3d9=_3d8;
_3d8=_3d7;
_3d7=_3d6;
_3d6=_3d5;
_3d5=null;
}else{
if(_3d5.getValue||dojo.lang.isArray(_3d5)){
rate=_3d8;
_3d9=_3d7;
_3d8=_3d6;
_3d7=_3d5;
_3d6=null;
_3d5=null;
}
}
if(dojo.lang.isArray(_3d7)){
this.curve=new dojo.lfx.Line(_3d7[0],_3d7[1]);
}else{
this.curve=_3d7;
}
if(_3d6!=null&&_3d6>0){
this.duration=_3d6;
}
if(_3d9){
this.repeatCount=_3d9;
}
if(rate){
this.rate=rate;
}
if(_3d5){
dojo.lang.forEach(["handler","beforeBegin","onBegin","onEnd","onPlay","onStop","onAnimate"],function(item){
if(_3d5[item]){
this.connect(item,_3d5[item]);
}
},this);
}
if(_3d8&&dojo.lang.isFunction(_3d8)){
this.easing=_3d8;
}
};
dojo.inherits(dojo.lfx.Animation,dojo.lfx.IAnimation);
dojo.lang.extend(dojo.lfx.Animation,{_startTime:null,_endTime:null,_timer:null,_percent:0,_startRepeatCount:0,play:function(_3dc,_3dd){
if(_3dd){
clearTimeout(this._timer);
this._active=false;
this._paused=false;
this._percent=0;
}else{
if(this._active&&!this._paused){
return this;
}
}
this.fire("handler",["beforeBegin"]);
this.fire("beforeBegin");
if(_3dc>0){
setTimeout(dojo.lang.hitch(this,function(){
this.play(null,_3dd);
}),_3dc);
return this;
}
this._startTime=new Date().valueOf();
if(this._paused){
this._startTime-=(this.duration*this._percent/100);
}
this._endTime=this._startTime+this.duration;
this._active=true;
this._paused=false;
var step=this._percent/100;
var _3df=this.curve.getValue(step);
if(this._percent==0){
if(!this._startRepeatCount){
this._startRepeatCount=this.repeatCount;
}
this.fire("handler",["begin",_3df]);
this.fire("onBegin",[_3df]);
}
this.fire("handler",["play",_3df]);
this.fire("onPlay",[_3df]);
this._cycle();
return this;
},pause:function(){
clearTimeout(this._timer);
if(!this._active){
return this;
}
this._paused=true;
var _3e0=this.curve.getValue(this._percent/100);
this.fire("handler",["pause",_3e0]);
this.fire("onPause",[_3e0]);
return this;
},gotoPercent:function(pct,_3e2){
clearTimeout(this._timer);
this._active=true;
this._paused=true;
this._percent=pct;
if(_3e2){
this.play();
}
return this;
},stop:function(_3e3){
clearTimeout(this._timer);
var step=this._percent/100;
if(_3e3){
step=1;
}
var _3e5=this.curve.getValue(step);
this.fire("handler",["stop",_3e5]);
this.fire("onStop",[_3e5]);
this._active=false;
this._paused=false;
return this;
},status:function(){
if(this._active){
return this._paused?"paused":"playing";
}else{
return "stopped";
}
return this;
},_cycle:function(){
clearTimeout(this._timer);
if(this._active){
var curr=new Date().valueOf();
var step=(curr-this._startTime)/(this._endTime-this._startTime);
if(step>=1){
step=1;
this._percent=100;
}else{
this._percent=step*100;
}
if((this.easing)&&(dojo.lang.isFunction(this.easing))){
step=this.easing(step);
}
var _3e8=this.curve.getValue(step);
this.fire("handler",["animate",_3e8]);
this.fire("onAnimate",[_3e8]);
if(step<1){
this._timer=setTimeout(dojo.lang.hitch(this,"_cycle"),this.rate);
}else{
this._active=false;
this.fire("handler",["end"]);
this.fire("onEnd");
if(this.repeatCount>0){
this.repeatCount--;
this.play(null,true);
}else{
if(this.repeatCount==-1){
this.play(null,true);
}else{
if(this._startRepeatCount){
this.repeatCount=this._startRepeatCount;
this._startRepeatCount=0;
}
}
}
}
}
return this;
}});
dojo.lfx.Combine=function(_3e9){
dojo.lfx.IAnimation.call(this);
this._anims=[];
this._animsEnded=0;
var _3ea=arguments;
if(_3ea.length==1&&(dojo.lang.isArray(_3ea[0])||dojo.lang.isArrayLike(_3ea[0]))){
_3ea=_3ea[0];
}
dojo.lang.forEach(_3ea,function(anim){
this._anims.push(anim);
anim.connect("onEnd",dojo.lang.hitch(this,"_onAnimsEnded"));
},this);
};
dojo.inherits(dojo.lfx.Combine,dojo.lfx.IAnimation);
dojo.lang.extend(dojo.lfx.Combine,{_animsEnded:0,play:function(_3ec,_3ed){
if(!this._anims.length){
return this;
}
this.fire("beforeBegin");
if(_3ec>0){
setTimeout(dojo.lang.hitch(this,function(){
this.play(null,_3ed);
}),_3ec);
return this;
}
if(_3ed||this._anims[0].percent==0){
this.fire("onBegin");
}
this.fire("onPlay");
this._animsCall("play",null,_3ed);
return this;
},pause:function(){
this.fire("onPause");
this._animsCall("pause");
return this;
},stop:function(_3ee){
this.fire("onStop");
this._animsCall("stop",_3ee);
return this;
},_onAnimsEnded:function(){
this._animsEnded++;
if(this._animsEnded>=this._anims.length){
this.fire("onEnd");
}
return this;
},_animsCall:function(_3ef){
var args=[];
if(arguments.length>1){
for(var i=1;i<arguments.length;i++){
args.push(arguments[i]);
}
}
var _3f2=this;
dojo.lang.forEach(this._anims,function(anim){
anim[_3ef](args);
},_3f2);
return this;
}});
dojo.lfx.Chain=function(_3f4){
dojo.lfx.IAnimation.call(this);
this._anims=[];
this._currAnim=-1;
var _3f5=arguments;
if(_3f5.length==1&&(dojo.lang.isArray(_3f5[0])||dojo.lang.isArrayLike(_3f5[0]))){
_3f5=_3f5[0];
}
var _3f6=this;
dojo.lang.forEach(_3f5,function(anim,i,_3f9){
this._anims.push(anim);
if(i<_3f9.length-1){
anim.connect("onEnd",dojo.lang.hitch(this,"_playNext"));
}else{
anim.connect("onEnd",dojo.lang.hitch(this,function(){
this.fire("onEnd");
}));
}
},this);
};
dojo.inherits(dojo.lfx.Chain,dojo.lfx.IAnimation);
dojo.lang.extend(dojo.lfx.Chain,{_currAnim:-1,play:function(_3fa,_3fb){
if(!this._anims.length){
return this;
}
if(_3fb||!this._anims[this._currAnim]){
this._currAnim=0;
}
var _3fc=this._anims[this._currAnim];
this.fire("beforeBegin");
if(_3fa>0){
setTimeout(dojo.lang.hitch(this,function(){
this.play(null,_3fb);
}),_3fa);
return this;
}
if(_3fc){
if(this._currAnim==0){
this.fire("handler",["begin",this._currAnim]);
this.fire("onBegin",[this._currAnim]);
}
this.fire("onPlay",[this._currAnim]);
_3fc.play(null,_3fb);
}
return this;
},pause:function(){
if(this._anims[this._currAnim]){
this._anims[this._currAnim].pause();
this.fire("onPause",[this._currAnim]);
}
return this;
},playPause:function(){
if(this._anims.length==0){
return this;
}
if(this._currAnim==-1){
this._currAnim=0;
}
var _3fd=this._anims[this._currAnim];
if(_3fd){
if(!_3fd._active||_3fd._paused){
this.play();
}else{
this.pause();
}
}
return this;
},stop:function(){
var _3fe=this._anims[this._currAnim];
if(_3fe){
_3fe.stop();
this.fire("onStop",[this._currAnim]);
}
return _3fe;
},_playNext:function(){
if(this._currAnim==-1||this._anims.length==0){
return this;
}
this._currAnim++;
if(this._anims[this._currAnim]){
this._anims[this._currAnim].play(null,true);
}
return this;
}});
dojo.lfx.combine=function(_3ff){
var _400=arguments;
if(dojo.lang.isArray(arguments[0])){
_400=arguments[0];
}
if(_400.length==1){
return _400[0];
}
return new dojo.lfx.Combine(_400);
};
dojo.lfx.chain=function(_401){
var _402=arguments;
if(dojo.lang.isArray(arguments[0])){
_402=arguments[0];
}
if(_402.length==1){
return _402[0];
}
return new dojo.lfx.Chain(_402);
};
dojo.provide("dojo.html.common");
dojo.lang.mixin(dojo.html,dojo.dom);
dojo.html.body=function(){
dojo.deprecated("dojo.html.body() moved to dojo.body()","0.5");
return dojo.body();
};
dojo.html.getEventTarget=function(evt){
if(!evt){
evt=dojo.global().event||{};
}
var t=(evt.srcElement?evt.srcElement:(evt.target?evt.target:null));
while((t)&&(t.nodeType!=1)){
t=t.parentNode;
}
return t;
};
dojo.html.getViewport=function(){
var _405=dojo.global();
var _406=dojo.doc();
var w=0;
var h=0;
if(dojo.render.html.mozilla){
w=_406.documentElement.clientWidth;
h=_405.innerHeight;
}else{
if(!dojo.render.html.opera&&_405.innerWidth){
w=_405.innerWidth;
h=_405.innerHeight;
}else{
if(!dojo.render.html.opera&&dojo.exists(_406,"documentElement.clientWidth")){
var w2=_406.documentElement.clientWidth;
if(!w||w2&&w2<w){
w=w2;
}
h=_406.documentElement.clientHeight;
}else{
if(dojo.body().clientWidth){
w=dojo.body().clientWidth;
h=dojo.body().clientHeight;
}
}
}
}
return {width:w,height:h};
};
dojo.html.getScroll=function(){
var _40a=dojo.global();
var _40b=dojo.doc();
var top=_40a.pageYOffset||_40b.documentElement.scrollTop||dojo.body().scrollTop||0;
var left=_40a.pageXOffset||_40b.documentElement.scrollLeft||dojo.body().scrollLeft||0;
return {top:top,left:left,offset:{x:left,y:top}};
};
dojo.html.getParentByType=function(node,type){
var _410=dojo.doc();
var _411=dojo.byId(node);
type=type.toLowerCase();
while((_411)&&(_411.nodeName.toLowerCase()!=type)){
if(_411==(_410["body"]||_410["documentElement"])){
return null;
}
_411=_411.parentNode;
}
return _411;
};
dojo.html.getAttribute=function(node,attr){
node=dojo.byId(node);
if((!node)||(!node.getAttribute)){
return null;
}
var ta=typeof attr=="string"?attr:new String(attr);
var v=node.getAttribute(ta.toUpperCase());
if((v)&&(typeof v=="string")&&(v!="")){
return v;
}
if(v&&v.value){
return v.value;
}
if((node.getAttributeNode)&&(node.getAttributeNode(ta))){
return (node.getAttributeNode(ta)).value;
}else{
if(node.getAttribute(ta)){
return node.getAttribute(ta);
}else{
if(node.getAttribute(ta.toLowerCase())){
return node.getAttribute(ta.toLowerCase());
}
}
}
return null;
};
dojo.html.hasAttribute=function(node,attr){
return dojo.html.getAttribute(dojo.byId(node),attr)?true:false;
};
dojo.html.getCursorPosition=function(e){
e=e||dojo.global().event;
var _419={x:0,y:0};
if(e.pageX||e.pageY){
_419.x=e.pageX;
_419.y=e.pageY;
}else{
var de=dojo.doc().documentElement;
var db=dojo.body();
_419.x=e.clientX+((de||db)["scrollLeft"])-((de||db)["clientLeft"]);
_419.y=e.clientY+((de||db)["scrollTop"])-((de||db)["clientTop"]);
}
return _419;
};
dojo.html.isTag=function(node){
node=dojo.byId(node);
if(node&&node.tagName){
for(var i=1;i<arguments.length;i++){
if(node.tagName.toLowerCase()==String(arguments[i]).toLowerCase()){
return String(arguments[i]).toLowerCase();
}
}
}
return "";
};
if(dojo.render.html.ie&&!dojo.render.html.ie70){
if(window.location.href.substr(0,6).toLowerCase()!="https:"){
(function(){
var _41e=dojo.doc().createElement("script");
_41e.src="javascript:'dojo.html.createExternalElement=function(doc, tag){ return doc.createElement(tag); }'";
dojo.doc().getElementsByTagName("head")[0].appendChild(_41e);
})();
}
}else{
dojo.html.createExternalElement=function(doc,tag){
return doc.createElement(tag);
};
}
dojo.html._callDeprecated=function(_421,_422,args,_424,_425){
dojo.deprecated("dojo.html."+_421,"replaced by dojo.html."+_422+"("+(_424?"node, {"+_424+": "+_424+"}":"")+")"+(_425?"."+_425:""),"0.5");
var _426=[];
if(_424){
var _427={};
_427[_424]=args[1];
_426.push(args[0]);
_426.push(_427);
}else{
_426=args;
}
var ret=dojo.html[_422].apply(dojo.html,args);
if(_425){
return ret[_425];
}else{
return ret;
}
};
dojo.html.getViewportWidth=function(){
return dojo.html._callDeprecated("getViewportWidth","getViewport",arguments,null,"width");
};
dojo.html.getViewportHeight=function(){
return dojo.html._callDeprecated("getViewportHeight","getViewport",arguments,null,"height");
};
dojo.html.getViewportSize=function(){
return dojo.html._callDeprecated("getViewportSize","getViewport",arguments);
};
dojo.html.getScrollTop=function(){
return dojo.html._callDeprecated("getScrollTop","getScroll",arguments,null,"top");
};
dojo.html.getScrollLeft=function(){
return dojo.html._callDeprecated("getScrollLeft","getScroll",arguments,null,"left");
};
dojo.html.getScrollOffset=function(){
return dojo.html._callDeprecated("getScrollOffset","getScroll",arguments,null,"offset");
};
dojo.provide("dojo.uri.Uri");
dojo.uri=new function(){
this.dojoUri=function(uri){
return new dojo.uri.Uri(dojo.hostenv.getBaseScriptUri(),uri);
};
this.moduleUri=function(_42a,uri){
var loc=dojo.hostenv.getModuleSymbols(_42a).join("/");
if(!loc){
return null;
}
if(loc.lastIndexOf("/")!=loc.length-1){
loc+="/";
}
var _42d=loc.indexOf(":");
var _42e=loc.indexOf("/");
if(loc.charAt(0)!="/"&&(_42d==-1||_42d>_42e)){
loc=dojo.hostenv.getBaseScriptUri()+loc;
}
return new dojo.uri.Uri(loc,uri);
};
this.Uri=function(){
var uri=arguments[0];
for(var i=1;i<arguments.length;i++){
if(!arguments[i]){
continue;
}
var _431=new dojo.uri.Uri(arguments[i].toString());
var _432=new dojo.uri.Uri(uri.toString());
if((_431.path=="")&&(_431.scheme==null)&&(_431.authority==null)&&(_431.query==null)){
if(_431.fragment!=null){
_432.fragment=_431.fragment;
}
_431=_432;
}else{
if(_431.scheme==null){
_431.scheme=_432.scheme;
if(_431.authority==null){
_431.authority=_432.authority;
if(_431.path.charAt(0)!="/"){
var path=_432.path.substring(0,_432.path.lastIndexOf("/")+1)+_431.path;
var segs=path.split("/");
for(var j=0;j<segs.length;j++){
if(segs[j]=="."){
if(j==segs.length-1){
segs[j]="";
}else{
segs.splice(j,1);
j--;
}
}else{
if(j>0&&!(j==1&&segs[0]=="")&&segs[j]==".."&&segs[j-1]!=".."){
if(j==segs.length-1){
segs.splice(j,1);
segs[j-1]="";
}else{
segs.splice(j-1,2);
j-=2;
}
}
}
}
_431.path=segs.join("/");
}
}
}
}
uri="";
if(_431.scheme!=null){
uri+=_431.scheme+":";
}
if(_431.authority!=null){
uri+="//"+_431.authority;
}
uri+=_431.path;
if(_431.query!=null){
uri+="?"+_431.query;
}
if(_431.fragment!=null){
uri+="#"+_431.fragment;
}
}
this.uri=uri.toString();
var _436="^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$";
var r=this.uri.match(new RegExp(_436));
this.scheme=r[2]||(r[1]?"":null);
this.authority=r[4]||(r[3]?"":null);
this.path=r[5];
this.query=r[7]||(r[6]?"":null);
this.fragment=r[9]||(r[8]?"":null);
if(this.authority!=null){
_436="^((([^:]+:)?([^@]+))@)?([^:]*)(:([0-9]+))?$";
r=this.authority.match(new RegExp(_436));
this.user=r[3]||null;
this.password=r[4]||null;
this.host=r[5];
this.port=r[7]||null;
}
this.toString=function(){
return this.uri;
};
};
};
dojo.provide("dojo.html.style");
dojo.html.getClass=function(node){
node=dojo.byId(node);
if(!node){
return "";
}
var cs="";
if(node.className){
cs=node.className;
}else{
if(dojo.html.hasAttribute(node,"class")){
cs=dojo.html.getAttribute(node,"class");
}
}
return cs.replace(/^\s+|\s+$/g,"");
};
dojo.html.getClasses=function(node){
var c=dojo.html.getClass(node);
return (c=="")?[]:c.split(/\s+/g);
};
dojo.html.hasClass=function(node,_43d){
return (new RegExp("(^|\\s+)"+_43d+"(\\s+|$)")).test(dojo.html.getClass(node));
};
dojo.html.prependClass=function(node,_43f){
_43f+=" "+dojo.html.getClass(node);
return dojo.html.setClass(node,_43f);
};
dojo.html.addClass=function(node,_441){
if(dojo.html.hasClass(node,_441)){
return false;
}
_441=(dojo.html.getClass(node)+" "+_441).replace(/^\s+|\s+$/g,"");
return dojo.html.setClass(node,_441);
};
dojo.html.setClass=function(node,_443){
node=dojo.byId(node);
var cs=new String(_443);
try{
if(typeof node.className=="string"){
node.className=cs;
}else{
if(node.setAttribute){
node.setAttribute("class",_443);
node.className=cs;
}else{
return false;
}
}
}
catch(e){
dojo.debug("dojo.html.setClass() failed",e);
}
return true;
};
dojo.html.removeClass=function(node,_446,_447){
try{
if(!_447){
var _448=dojo.html.getClass(node).replace(new RegExp("(^|\\s+)"+_446+"(\\s+|$)"),"$1$2");
}else{
var _448=dojo.html.getClass(node).replace(_446,"");
}
dojo.html.setClass(node,_448);
}
catch(e){
dojo.debug("dojo.html.removeClass() failed",e);
}
return true;
};
dojo.html.replaceClass=function(node,_44a,_44b){
dojo.html.removeClass(node,_44b);
dojo.html.addClass(node,_44a);
};
dojo.html.classMatchType={ContainsAll:0,ContainsAny:1,IsOnly:2};
dojo.html.getElementsByClass=function(_44c,_44d,_44e,_44f,_450){
_450=false;
var _451=dojo.doc();
_44d=dojo.byId(_44d)||_451;
var _452=_44c.split(/\s+/g);
var _453=[];
if(_44f!=1&&_44f!=2){
_44f=0;
}
var _454=new RegExp("(\\s|^)(("+_452.join(")|(")+"))(\\s|$)");
var _455=_452.join(" ").length;
var _456=[];
if(!_450&&_451.evaluate){
var _457=".//"+(_44e||"*")+"[contains(";
if(_44f!=dojo.html.classMatchType.ContainsAny){
_457+="concat(' ',@class,' '), ' "+_452.join(" ') and contains(concat(' ',@class,' '), ' ")+" ')";
if(_44f==2){
_457+=" and string-length(@class)="+_455+"]";
}else{
_457+="]";
}
}else{
_457+="concat(' ',@class,' '), ' "+_452.join(" ') or contains(concat(' ',@class,' '), ' ")+" ')]";
}
var _458=_451.evaluate(_457,_44d,null,XPathResult.ANY_TYPE,null);
var _459=_458.iterateNext();
while(_459){
try{
_456.push(_459);
_459=_458.iterateNext();
}
catch(e){
break;
}
}
return _456;
}else{
if(!_44e){
_44e="*";
}
_456=_44d.getElementsByTagName(_44e);
var node,i=0;
outer:
while(node=_456[i++]){
var _45c=dojo.html.getClasses(node);
if(_45c.length==0){
continue outer;
}
var _45d=0;
for(var j=0;j<_45c.length;j++){
if(_454.test(_45c[j])){
if(_44f==dojo.html.classMatchType.ContainsAny){
_453.push(node);
continue outer;
}else{
_45d++;
}
}else{
if(_44f==dojo.html.classMatchType.IsOnly){
continue outer;
}
}
}
if(_45d==_452.length){
if((_44f==dojo.html.classMatchType.IsOnly)&&(_45d==_45c.length)){
_453.push(node);
}else{
if(_44f==dojo.html.classMatchType.ContainsAll){
_453.push(node);
}
}
}
}
return _453;
}
};
dojo.html.getElementsByClassName=dojo.html.getElementsByClass;
dojo.html.toCamelCase=function(_45f){
var arr=_45f.split("-"),cc=arr[0];
for(var i=1;i<arr.length;i++){
cc+=arr[i].charAt(0).toUpperCase()+arr[i].substring(1);
}
return cc;
};
dojo.html.toSelectorCase=function(_463){
return _463.replace(/([A-Z])/g,"-$1").toLowerCase();
};
if(dojo.render.html.ie){
dojo.html.getComputedStyle=function(node,_465,_466){
node=dojo.byId(node);
if(!node||!node.style){
return _466;
}
return node.currentStyle[dojo.html.toCamelCase(_465)];
};
dojo.html.getComputedStyles=function(node){
return node.currentStyle;
};
}else{
dojo.html.getComputedStyle=function(node,_469,_46a){
node=dojo.byId(node);
if(!node||!node.style){
return _46a;
}
var s=document.defaultView.getComputedStyle(node,null);
return (s&&s[dojo.html.toCamelCase(_469)])||"";
};
dojo.html.getComputedStyles=function(node){
return document.defaultView.getComputedStyle(node,null);
};
}
dojo.html.getStyleProperty=function(node,_46e){
node=dojo.byId(node);
return (node&&node.style?node.style[dojo.html.toCamelCase(_46e)]:undefined);
};
dojo.html.getStyle=function(node,_470){
var _471=dojo.html.getStyleProperty(node,_470);
return (_471?_471:dojo.html.getComputedStyle(node,_470));
};
dojo.html.setStyle=function(node,_473,_474){
node=dojo.byId(node);
if(node&&node.style){
var _475=dojo.html.toCamelCase(_473);
node.style[_475]=_474;
}
};
dojo.html.setStyleText=function(_476,text){
try{
_476.style.cssText=text;
}
catch(e){
_476.setAttribute("style",text);
}
};
dojo.html.copyStyle=function(_478,_479){
if(!_479.style.cssText){
_478.setAttribute("style",_479.getAttribute("style"));
}else{
_478.style.cssText=_479.style.cssText;
}
dojo.html.addClass(_478,dojo.html.getClass(_479));
};
dojo.html.getUnitValue=function(node,_47b,_47c){
var s=dojo.html.getComputedStyle(node,_47b);
if((!s)||((s=="auto")&&(_47c))){
return {value:0,units:"px"};
}
var _47e=s.match(/(\-?[\d.]+)([a-z%]*)/i);
if(!_47e){
return dojo.html.getUnitValue.bad;
}
return {value:Number(_47e[1]),units:_47e[2].toLowerCase()};
};
dojo.html.getUnitValue.bad={value:NaN,units:""};
if(dojo.render.html.ie){
dojo.html.toPixelValue=function(_47f,_480){
if(!_480){
return 0;
}
if(_480.slice(-2)=="px"){
return parseFloat(_480);
}
var _481=0;
with(_47f){
var _482=style.left;
var _483=runtimeStyle.left;
runtimeStyle.left=currentStyle.left;
try{
style.left=_480||0;
_481=style.pixelLeft;
style.left=_482;
runtimeStyle.left=_483;
}
catch(e){
}
}
return _481;
};
}else{
dojo.html.toPixelValue=function(_484,_485){
return (_485&&(_485.slice(-2)=="px")?parseFloat(_485):0);
};
}
dojo.html.getPixelValue=function(node,_487,_488){
return dojo.html.toPixelValue(node,dojo.html.getComputedStyle(node,_487));
};
dojo.html.setPositivePixelValue=function(node,_48a,_48b){
if(isNaN(_48b)){
return false;
}
node.style[_48a]=Math.max(0,_48b)+"px";
return true;
};
dojo.html.styleSheet=null;
dojo.html.insertCssRule=function(_48c,_48d,_48e){
if(!dojo.html.styleSheet){
if(document.createStyleSheet){
dojo.html.styleSheet=document.createStyleSheet();
}else{
if(document.styleSheets[0]){
dojo.html.styleSheet=document.styleSheets[0];
}else{
return null;
}
}
}
if(arguments.length<3){
if(dojo.html.styleSheet.cssRules){
_48e=dojo.html.styleSheet.cssRules.length;
}else{
if(dojo.html.styleSheet.rules){
_48e=dojo.html.styleSheet.rules.length;
}else{
return null;
}
}
}
if(dojo.html.styleSheet.insertRule){
var rule=_48c+" { "+_48d+" }";
return dojo.html.styleSheet.insertRule(rule,_48e);
}else{
if(dojo.html.styleSheet.addRule){
return dojo.html.styleSheet.addRule(_48c,_48d,_48e);
}else{
return null;
}
}
};
dojo.html.removeCssRule=function(_490){
if(!dojo.html.styleSheet){
dojo.debug("no stylesheet defined for removing rules");
return false;
}
if(dojo.render.html.ie){
if(!_490){
_490=dojo.html.styleSheet.rules.length;
dojo.html.styleSheet.removeRule(_490);
}
}else{
if(document.styleSheets[0]){
if(!_490){
_490=dojo.html.styleSheet.cssRules.length;
}
dojo.html.styleSheet.deleteRule(_490);
}
}
return true;
};
dojo.html._insertedCssFiles=[];
dojo.html.insertCssFile=function(URI,doc,_493,_494){
if(!URI){
return;
}
if(!doc){
doc=document;
}
var _495=dojo.hostenv.getText(URI,false,_494);
if(_495===null){
return;
}
_495=dojo.html.fixPathsInCssText(_495,URI);
if(_493){
var idx=-1,node,ent=dojo.html._insertedCssFiles;
for(var i=0;i<ent.length;i++){
if((ent[i].doc==doc)&&(ent[i].cssText==_495)){
idx=i;
node=ent[i].nodeRef;
break;
}
}
if(node){
var _49a=doc.getElementsByTagName("style");
for(var i=0;i<_49a.length;i++){
if(_49a[i]==node){
return;
}
}
dojo.html._insertedCssFiles.shift(idx,1);
}
}
var _49b=dojo.html.insertCssText(_495,doc);
dojo.html._insertedCssFiles.push({"doc":doc,"cssText":_495,"nodeRef":_49b});
if(_49b&&djConfig.isDebug){
_49b.setAttribute("dbgHref",URI);
}
return _49b;
};
dojo.html.insertCssText=function(_49c,doc,URI){
if(!_49c){
return;
}
if(!doc){
doc=document;
}
if(URI){
_49c=dojo.html.fixPathsInCssText(_49c,URI);
}
var _49f=doc.createElement("style");
_49f.setAttribute("type","text/css");
var head=doc.getElementsByTagName("head")[0];
if(!head){
dojo.debug("No head tag in document, aborting styles");
return;
}else{
head.appendChild(_49f);
}
if(_49f.styleSheet){
var _4a1=function(){
try{
_49f.styleSheet.cssText=_49c;
}
catch(e){
dojo.debug(e);
}
};
if(_49f.styleSheet.disabled){
setTimeout(_4a1,10);
}else{
_4a1();
}
}else{
var _4a2=doc.createTextNode(_49c);
_49f.appendChild(_4a2);
}
return _49f;
};
dojo.html.fixPathsInCssText=function(_4a3,URI){
if(!_4a3||!URI){
return;
}
var _4a5,str="",url="",_4a8="[\\t\\s\\w\\(\\)\\/\\.\\\\'\"-:#=&?~]+";
var _4a9=new RegExp("url\\(\\s*("+_4a8+")\\s*\\)");
var _4aa=/(file|https?|ftps?):\/\//;
regexTrim=new RegExp("^[\\s]*(['\"]?)("+_4a8+")\\1[\\s]*?$");
if(dojo.render.html.ie55||dojo.render.html.ie60){
var _4ab=new RegExp("AlphaImageLoader\\((.*)src=['\"]("+_4a8+")['\"]");
while(_4a5=_4ab.exec(_4a3)){
url=_4a5[2].replace(regexTrim,"$2");
if(!_4aa.exec(url)){
url=(new dojo.uri.Uri(URI,url).toString());
}
str+=_4a3.substring(0,_4a5.index)+"AlphaImageLoader("+_4a5[1]+"src='"+url+"'";
_4a3=_4a3.substr(_4a5.index+_4a5[0].length);
}
_4a3=str+_4a3;
str="";
}
while(_4a5=_4a9.exec(_4a3)){
url=_4a5[1].replace(regexTrim,"$2");
if(!_4aa.exec(url)){
url=(new dojo.uri.Uri(URI,url).toString());
}
str+=_4a3.substring(0,_4a5.index)+"url("+url+")";
_4a3=_4a3.substr(_4a5.index+_4a5[0].length);
}
return str+_4a3;
};
dojo.html.setActiveStyleSheet=function(_4ac){
var i=0,a,els=dojo.doc().getElementsByTagName("link");
while(a=els[i++]){
if(a.getAttribute("rel").indexOf("style")!=-1&&a.getAttribute("title")){
a.disabled=true;
if(a.getAttribute("title")==_4ac){
a.disabled=false;
}
}
}
};
dojo.html.getActiveStyleSheet=function(){
var i=0,a,els=dojo.doc().getElementsByTagName("link");
while(a=els[i++]){
if(a.getAttribute("rel").indexOf("style")!=-1&&a.getAttribute("title")&&!a.disabled){
return a.getAttribute("title");
}
}
return null;
};
dojo.html.getPreferredStyleSheet=function(){
var i=0,a,els=dojo.doc().getElementsByTagName("link");
while(a=els[i++]){
if(a.getAttribute("rel").indexOf("style")!=-1&&a.getAttribute("rel").indexOf("alt")==-1&&a.getAttribute("title")){
return a.getAttribute("title");
}
}
return null;
};
dojo.html.applyBrowserClass=function(node){
var drh=dojo.render.html;
var _4b8={dj_ie:drh.ie,dj_ie55:drh.ie55,dj_ie6:drh.ie60,dj_ie7:drh.ie70,dj_iequirks:drh.ie&&drh.quirks,dj_opera:drh.opera,dj_opera8:drh.opera&&(Math.floor(dojo.render.version)==8),dj_opera9:drh.opera&&(Math.floor(dojo.render.version)==9),dj_khtml:drh.khtml,dj_safari:drh.safari,dj_gecko:drh.mozilla};
for(var p in _4b8){
if(_4b8[p]){
dojo.html.addClass(node,p);
}
}
};
dojo.provide("dojo.html.display");
dojo.html._toggle=function(node,_4bb,_4bc){
node=dojo.byId(node);
_4bc(node,!_4bb(node));
return _4bb(node);
};
dojo.html.show=function(node){
node=dojo.byId(node);
if(dojo.html.getStyleProperty(node,"display")=="none"){
dojo.html.setStyle(node,"display",(node.dojoDisplayCache||""));
node.dojoDisplayCache=undefined;
}
};
dojo.html.hide=function(node){
node=dojo.byId(node);
if(typeof node["dojoDisplayCache"]=="undefined"){
var d=dojo.html.getStyleProperty(node,"display");
if(d!="none"){
node.dojoDisplayCache=d;
}
}
dojo.html.setStyle(node,"display","none");
};
dojo.html.setShowing=function(node,_4c1){
dojo.html[(_4c1?"show":"hide")](node);
};
dojo.html.isShowing=function(node){
return (dojo.html.getStyleProperty(node,"display")!="none");
};
dojo.html.toggleShowing=function(node){
return dojo.html._toggle(node,dojo.html.isShowing,dojo.html.setShowing);
};
dojo.html.displayMap={tr:"",td:"",th:"",img:"inline",span:"inline",input:"inline",button:"inline"};
dojo.html.suggestDisplayByTagName=function(node){
node=dojo.byId(node);
if(node&&node.tagName){
var tag=node.tagName.toLowerCase();
return (tag in dojo.html.displayMap?dojo.html.displayMap[tag]:"block");
}
};
dojo.html.setDisplay=function(node,_4c7){
dojo.html.setStyle(node,"display",((_4c7 instanceof String||typeof _4c7=="string")?_4c7:(_4c7?dojo.html.suggestDisplayByTagName(node):"none")));
};
dojo.html.isDisplayed=function(node){
return (dojo.html.getComputedStyle(node,"display")!="none");
};
dojo.html.toggleDisplay=function(node){
return dojo.html._toggle(node,dojo.html.isDisplayed,dojo.html.setDisplay);
};
dojo.html.setVisibility=function(node,_4cb){
dojo.html.setStyle(node,"visibility",((_4cb instanceof String||typeof _4cb=="string")?_4cb:(_4cb?"visible":"hidden")));
};
dojo.html.isVisible=function(node){
return (dojo.html.getComputedStyle(node,"visibility")!="hidden");
};
dojo.html.toggleVisibility=function(node){
return dojo.html._toggle(node,dojo.html.isVisible,dojo.html.setVisibility);
};
dojo.html.setOpacity=function(node,_4cf,_4d0){
node=dojo.byId(node);
var h=dojo.render.html;
if(!_4d0){
if(_4cf>=1){
if(h.ie){
dojo.html.clearOpacity(node);
return;
}else{
_4cf=0.999999;
}
}else{
if(_4cf<0){
_4cf=0;
}
}
}
if(h.ie){
if(node.nodeName.toLowerCase()=="tr"){
var tds=node.getElementsByTagName("td");
for(var x=0;x<tds.length;x++){
tds[x].style.filter="Alpha(Opacity="+_4cf*100+")";
}
}
node.style.filter="Alpha(Opacity="+_4cf*100+")";
}else{
if(h.moz){
node.style.opacity=_4cf;
node.style.MozOpacity=_4cf;
}else{
if(h.safari){
node.style.opacity=_4cf;
node.style.KhtmlOpacity=_4cf;
}else{
node.style.opacity=_4cf;
}
}
}
};
dojo.html.clearOpacity=function(node){
node=dojo.byId(node);
var ns=node.style;
var h=dojo.render.html;
if(h.ie){
try{
if(node.filters&&node.filters.alpha){
ns.filter="";
}
}
catch(e){
}
}else{
if(h.moz){
ns.opacity=1;
ns.MozOpacity=1;
}else{
if(h.safari){
ns.opacity=1;
ns.KhtmlOpacity=1;
}else{
ns.opacity=1;
}
}
}
};
dojo.html.getOpacity=function(node){
node=dojo.byId(node);
var h=dojo.render.html;
if(h.ie){
var opac=(node.filters&&node.filters.alpha&&typeof node.filters.alpha.opacity=="number"?node.filters.alpha.opacity:100)/100;
}else{
var opac=node.style.opacity||node.style.MozOpacity||node.style.KhtmlOpacity||1;
}
return opac>=0.999999?1:Number(opac);
};
dojo.provide("dojo.html.color");
dojo.html.getBackgroundColor=function(node){
node=dojo.byId(node);
var _4db;
do{
_4db=dojo.html.getStyle(node,"background-color");
if(_4db.toLowerCase()=="rgba(0, 0, 0, 0)"){
_4db="transparent";
}
if(node==document.getElementsByTagName("body")[0]){
node=null;
break;
}
node=node.parentNode;
}while(node&&dojo.lang.inArray(["transparent",""],_4db));
if(_4db=="transparent"){
_4db=[255,255,255,0];
}else{
_4db=dojo.gfx.color.extractRGB(_4db);
}
return _4db;
};
dojo.provide("dojo.html.layout");
dojo.html.sumAncestorProperties=function(node,prop){
node=dojo.byId(node);
if(!node){
return 0;
}
var _4de=0;
while(node){
if(dojo.html.getComputedStyle(node,"position")=="fixed"){
return 0;
}
var val=node[prop];
if(val){
_4de+=val-0;
if(node==dojo.body()){
break;
}
}
node=node.parentNode;
}
return _4de;
};
dojo.html.setStyleAttributes=function(node,_4e1){
node=dojo.byId(node);
var _4e2=_4e1.replace(/(;)?\s*$/,"").split(";");
for(var i=0;i<_4e2.length;i++){
var _4e4=_4e2[i].split(":");
var name=_4e4[0].replace(/\s*$/,"").replace(/^\s*/,"").toLowerCase();
var _4e6=_4e4[1].replace(/\s*$/,"").replace(/^\s*/,"");
switch(name){
case "opacity":
dojo.html.setOpacity(node,_4e6);
break;
case "content-height":
dojo.html.setContentBox(node,{height:_4e6});
break;
case "content-width":
dojo.html.setContentBox(node,{width:_4e6});
break;
case "outer-height":
dojo.html.setMarginBox(node,{height:_4e6});
break;
case "outer-width":
dojo.html.setMarginBox(node,{width:_4e6});
break;
default:
node.style[dojo.html.toCamelCase(name)]=_4e6;
}
}
};
dojo.html.boxSizing={MARGIN_BOX:"margin-box",BORDER_BOX:"border-box",PADDING_BOX:"padding-box",CONTENT_BOX:"content-box"};
dojo.html.getAbsolutePosition=dojo.html.abs=function(node,_4e8,_4e9){
node=dojo.byId(node,node.ownerDocument);
var ret={x:0,y:0};
var bs=dojo.html.boxSizing;
if(!_4e9){
_4e9=bs.CONTENT_BOX;
}
var _4ec=2;
var _4ed;
switch(_4e9){
case bs.MARGIN_BOX:
_4ed=3;
break;
case bs.BORDER_BOX:
_4ed=2;
break;
case bs.PADDING_BOX:
default:
_4ed=1;
break;
case bs.CONTENT_BOX:
_4ed=0;
break;
}
var h=dojo.render.html;
var db=document["body"]||document["documentElement"];
if(h.ie){
with(node.getBoundingClientRect()){
ret.x=left-2;
ret.y=top-2;
}
}else{
if(document.getBoxObjectFor){
_4ec=1;
try{
var bo=document.getBoxObjectFor(node);
ret.x=bo.x-dojo.html.sumAncestorProperties(node,"scrollLeft");
ret.y=bo.y-dojo.html.sumAncestorProperties(node,"scrollTop");
}
catch(e){
}
}else{
if(node["offsetParent"]){
var _4f1;
if((h.safari)&&(node.style.getPropertyValue("position")=="absolute")&&(node.parentNode==db)){
_4f1=db;
}else{
_4f1=db.parentNode;
}
if(node.parentNode!=db){
var nd=node;
if(dojo.render.html.opera){
nd=db;
}
ret.x-=dojo.html.sumAncestorProperties(nd,"scrollLeft");
ret.y-=dojo.html.sumAncestorProperties(nd,"scrollTop");
}
var _4f3=node;
do{
var n=_4f3["offsetLeft"];
if(!h.opera||n>0){
ret.x+=isNaN(n)?0:n;
}
var m=_4f3["offsetTop"];
ret.y+=isNaN(m)?0:m;
_4f3=_4f3.offsetParent;
}while((_4f3!=_4f1)&&(_4f3!=null));
}else{
if(node["x"]&&node["y"]){
ret.x+=isNaN(node.x)?0:node.x;
ret.y+=isNaN(node.y)?0:node.y;
}
}
}
}
if(_4e8){
var _4f6=dojo.html.getScroll();
ret.y+=_4f6.top;
ret.x+=_4f6.left;
}
var _4f7=[dojo.html.getPaddingExtent,dojo.html.getBorderExtent,dojo.html.getMarginExtent];
if(_4ec>_4ed){
for(var i=_4ed;i<_4ec;++i){
ret.y+=_4f7[i](node,"top");
ret.x+=_4f7[i](node,"left");
}
}else{
if(_4ec<_4ed){
for(var i=_4ed;i>_4ec;--i){
ret.y-=_4f7[i-1](node,"top");
ret.x-=_4f7[i-1](node,"left");
}
}
}
ret.top=ret.y;
ret.left=ret.x;
return ret;
};
dojo.html.isPositionAbsolute=function(node){
return (dojo.html.getComputedStyle(node,"position")=="absolute");
};
dojo.html._sumPixelValues=function(node,_4fb,_4fc){
var _4fd=0;
for(var x=0;x<_4fb.length;x++){
_4fd+=dojo.html.getPixelValue(node,_4fb[x],_4fc);
}
return _4fd;
};
dojo.html.getMargin=function(node){
return {width:dojo.html._sumPixelValues(node,["margin-left","margin-right"],(dojo.html.getComputedStyle(node,"position")=="absolute")),height:dojo.html._sumPixelValues(node,["margin-top","margin-bottom"],(dojo.html.getComputedStyle(node,"position")=="absolute"))};
};
dojo.html.getBorder=function(node){
return {width:dojo.html.getBorderExtent(node,"left")+dojo.html.getBorderExtent(node,"right"),height:dojo.html.getBorderExtent(node,"top")+dojo.html.getBorderExtent(node,"bottom")};
};
dojo.html.getBorderExtent=function(node,side){
return (dojo.html.getStyle(node,"border-"+side+"-style")=="none"?0:dojo.html.getPixelValue(node,"border-"+side+"-width"));
};
dojo.html.getMarginExtent=function(node,side){
return dojo.html._sumPixelValues(node,["margin-"+side],dojo.html.isPositionAbsolute(node));
};
dojo.html.getPaddingExtent=function(node,side){
return dojo.html._sumPixelValues(node,["padding-"+side],true);
};
dojo.html.getPadding=function(node){
return {width:dojo.html._sumPixelValues(node,["padding-left","padding-right"],true),height:dojo.html._sumPixelValues(node,["padding-top","padding-bottom"],true)};
};
dojo.html.getPadBorder=function(node){
var pad=dojo.html.getPadding(node);
var _50a=dojo.html.getBorder(node);
return {width:pad.width+_50a.width,height:pad.height+_50a.height};
};
dojo.html.getBoxSizing=function(node){
var h=dojo.render.html;
var bs=dojo.html.boxSizing;
if(((h.ie)||(h.opera))&&node.nodeName.toLowerCase()!="img"){
var cm=document["compatMode"];
if((cm=="BackCompat")||(cm=="QuirksMode")){
return bs.BORDER_BOX;
}else{
return bs.CONTENT_BOX;
}
}else{
if(arguments.length==0){
node=document.documentElement;
}
var _50f;
if(!h.ie){
_50f=dojo.html.getStyle(node,"-moz-box-sizing");
if(!_50f){
_50f=dojo.html.getStyle(node,"box-sizing");
}
}
return (_50f?_50f:bs.CONTENT_BOX);
}
};
dojo.html.isBorderBox=function(node){
return (dojo.html.getBoxSizing(node)==dojo.html.boxSizing.BORDER_BOX);
};
dojo.html.getBorderBox=function(node){
node=dojo.byId(node);
return {width:node.offsetWidth,height:node.offsetHeight};
};
dojo.html.getPaddingBox=function(node){
var box=dojo.html.getBorderBox(node);
var _514=dojo.html.getBorder(node);
return {width:box.width-_514.width,height:box.height-_514.height};
};
dojo.html.getContentBox=function(node){
node=dojo.byId(node);
var _516=dojo.html.getPadBorder(node);
return {width:node.offsetWidth-_516.width,height:node.offsetHeight-_516.height};
};
dojo.html.setContentBox=function(node,args){
node=dojo.byId(node);
var _519=0;
var _51a=0;
var isbb=dojo.html.isBorderBox(node);
var _51c=(isbb?dojo.html.getPadBorder(node):{width:0,height:0});
var ret={};
if(typeof args.width!="undefined"){
_519=args.width+_51c.width;
ret.width=dojo.html.setPositivePixelValue(node,"width",_519);
}
if(typeof args.height!="undefined"){
_51a=args.height+_51c.height;
ret.height=dojo.html.setPositivePixelValue(node,"height",_51a);
}
return ret;
};
dojo.html.getMarginBox=function(node){
var _51f=dojo.html.getBorderBox(node);
var _520=dojo.html.getMargin(node);
return {width:_51f.width+_520.width,height:_51f.height+_520.height};
};
dojo.html.setMarginBox=function(node,args){
node=dojo.byId(node);
var _523=0;
var _524=0;
var isbb=dojo.html.isBorderBox(node);
var _526=(!isbb?dojo.html.getPadBorder(node):{width:0,height:0});
var _527=dojo.html.getMargin(node);
var ret={};
if(typeof args.width!="undefined"){
_523=args.width-_526.width;
_523-=_527.width;
ret.width=dojo.html.setPositivePixelValue(node,"width",_523);
}
if(typeof args.height!="undefined"){
_524=args.height-_526.height;
_524-=_527.height;
ret.height=dojo.html.setPositivePixelValue(node,"height",_524);
}
return ret;
};
dojo.html.getElementBox=function(node,type){
var bs=dojo.html.boxSizing;
switch(type){
case bs.MARGIN_BOX:
return dojo.html.getMarginBox(node);
case bs.BORDER_BOX:
return dojo.html.getBorderBox(node);
case bs.PADDING_BOX:
return dojo.html.getPaddingBox(node);
case bs.CONTENT_BOX:
default:
return dojo.html.getContentBox(node);
}
};
dojo.html.toCoordinateObject=dojo.html.toCoordinateArray=function(_52c,_52d,_52e){
if(_52c instanceof Array||typeof _52c=="array"){
dojo.deprecated("dojo.html.toCoordinateArray","use dojo.html.toCoordinateObject({left: , top: , width: , height: }) instead","0.5");
while(_52c.length<4){
_52c.push(0);
}
while(_52c.length>4){
_52c.pop();
}
var ret={left:_52c[0],top:_52c[1],width:_52c[2],height:_52c[3]};
}else{
if(!_52c.nodeType&&!(_52c instanceof String||typeof _52c=="string")&&("width" in _52c||"height" in _52c||"left" in _52c||"x" in _52c||"top" in _52c||"y" in _52c)){
var ret={left:_52c.left||_52c.x||0,top:_52c.top||_52c.y||0,width:_52c.width||0,height:_52c.height||0};
}else{
var node=dojo.byId(_52c);
var pos=dojo.html.abs(node,_52d,_52e);
var _532=dojo.html.getMarginBox(node);
var ret={left:pos.left,top:pos.top,width:_532.width,height:_532.height};
}
}
ret.x=ret.left;
ret.y=ret.top;
return ret;
};
dojo.html.setMarginBoxWidth=dojo.html.setOuterWidth=function(node,_534){
return dojo.html._callDeprecated("setMarginBoxWidth","setMarginBox",arguments,"width");
};
dojo.html.setMarginBoxHeight=dojo.html.setOuterHeight=function(){
return dojo.html._callDeprecated("setMarginBoxHeight","setMarginBox",arguments,"height");
};
dojo.html.getMarginBoxWidth=dojo.html.getOuterWidth=function(){
return dojo.html._callDeprecated("getMarginBoxWidth","getMarginBox",arguments,null,"width");
};
dojo.html.getMarginBoxHeight=dojo.html.getOuterHeight=function(){
return dojo.html._callDeprecated("getMarginBoxHeight","getMarginBox",arguments,null,"height");
};
dojo.html.getTotalOffset=function(node,type,_537){
return dojo.html._callDeprecated("getTotalOffset","getAbsolutePosition",arguments,null,type);
};
dojo.html.getAbsoluteX=function(node,_539){
return dojo.html._callDeprecated("getAbsoluteX","getAbsolutePosition",arguments,null,"x");
};
dojo.html.getAbsoluteY=function(node,_53b){
return dojo.html._callDeprecated("getAbsoluteY","getAbsolutePosition",arguments,null,"y");
};
dojo.html.totalOffsetLeft=function(node,_53d){
return dojo.html._callDeprecated("totalOffsetLeft","getAbsolutePosition",arguments,null,"left");
};
dojo.html.totalOffsetTop=function(node,_53f){
return dojo.html._callDeprecated("totalOffsetTop","getAbsolutePosition",arguments,null,"top");
};
dojo.html.getMarginWidth=function(node){
return dojo.html._callDeprecated("getMarginWidth","getMargin",arguments,null,"width");
};
dojo.html.getMarginHeight=function(node){
return dojo.html._callDeprecated("getMarginHeight","getMargin",arguments,null,"height");
};
dojo.html.getBorderWidth=function(node){
return dojo.html._callDeprecated("getBorderWidth","getBorder",arguments,null,"width");
};
dojo.html.getBorderHeight=function(node){
return dojo.html._callDeprecated("getBorderHeight","getBorder",arguments,null,"height");
};
dojo.html.getPaddingWidth=function(node){
return dojo.html._callDeprecated("getPaddingWidth","getPadding",arguments,null,"width");
};
dojo.html.getPaddingHeight=function(node){
return dojo.html._callDeprecated("getPaddingHeight","getPadding",arguments,null,"height");
};
dojo.html.getPadBorderWidth=function(node){
return dojo.html._callDeprecated("getPadBorderWidth","getPadBorder",arguments,null,"width");
};
dojo.html.getPadBorderHeight=function(node){
return dojo.html._callDeprecated("getPadBorderHeight","getPadBorder",arguments,null,"height");
};
dojo.html.getBorderBoxWidth=dojo.html.getInnerWidth=function(){
return dojo.html._callDeprecated("getBorderBoxWidth","getBorderBox",arguments,null,"width");
};
dojo.html.getBorderBoxHeight=dojo.html.getInnerHeight=function(){
return dojo.html._callDeprecated("getBorderBoxHeight","getBorderBox",arguments,null,"height");
};
dojo.html.getContentBoxWidth=dojo.html.getContentWidth=function(){
return dojo.html._callDeprecated("getContentBoxWidth","getContentBox",arguments,null,"width");
};
dojo.html.getContentBoxHeight=dojo.html.getContentHeight=function(){
return dojo.html._callDeprecated("getContentBoxHeight","getContentBox",arguments,null,"height");
};
dojo.html.setContentBoxWidth=dojo.html.setContentWidth=function(node,_549){
return dojo.html._callDeprecated("setContentBoxWidth","setContentBox",arguments,"width");
};
dojo.html.setContentBoxHeight=dojo.html.setContentHeight=function(node,_54b){
return dojo.html._callDeprecated("setContentBoxHeight","setContentBox",arguments,"height");
};
dojo.provide("dojo.lfx.html");
dojo.lfx.html._byId=function(_54c){
if(!_54c){
return [];
}
if(dojo.lang.isArrayLike(_54c)){
if(!_54c.alreadyChecked){
var n=[];
dojo.lang.forEach(_54c,function(node){
n.push(dojo.byId(node));
});
n.alreadyChecked=true;
return n;
}else{
return _54c;
}
}else{
var n=[];
n.push(dojo.byId(_54c));
n.alreadyChecked=true;
return n;
}
};
dojo.lfx.html.propertyAnimation=function(_54f,_550,_551,_552,_553){
_54f=dojo.lfx.html._byId(_54f);
var _554={"propertyMap":_550,"nodes":_54f,"duration":_551,"easing":_552||dojo.lfx.easeDefault};
var _555=function(args){
if(args.nodes.length==1){
var pm=args.propertyMap;
if(!dojo.lang.isArray(args.propertyMap)){
var parr=[];
for(var _559 in pm){
pm[_559].property=_559;
parr.push(pm[_559]);
}
pm=args.propertyMap=parr;
}
dojo.lang.forEach(pm,function(prop){
if(dj_undef("start",prop)){
if(prop.property!="opacity"){
prop.start=parseInt(dojo.html.getComputedStyle(args.nodes[0],prop.property));
}else{
prop.start=dojo.html.getOpacity(args.nodes[0]);
}
}
});
}
};
var _55b=function(_55c){
var _55d=[];
dojo.lang.forEach(_55c,function(c){
_55d.push(Math.round(c));
});
return _55d;
};
var _55f=function(n,_561){
n=dojo.byId(n);
if(!n||!n.style){
return;
}
for(var s in _561){
try{
if(s=="opacity"){
dojo.html.setOpacity(n,_561[s]);
}else{
n.style[s]=_561[s];
}
}
catch(e){
dojo.debug(e);
}
}
};
var _563=function(_564){
this._properties=_564;
this.diffs=new Array(_564.length);
dojo.lang.forEach(_564,function(prop,i){
if(dojo.lang.isFunction(prop.start)){
prop.start=prop.start(prop,i);
}
if(dojo.lang.isFunction(prop.end)){
prop.end=prop.end(prop,i);
}
if(dojo.lang.isArray(prop.start)){
this.diffs[i]=null;
}else{
if(prop.start instanceof dojo.gfx.color.Color){
prop.startRgb=prop.start.toRgb();
prop.endRgb=prop.end.toRgb();
}else{
this.diffs[i]=prop.end-prop.start;
}
}
},this);
this.getValue=function(n){
var ret={};
dojo.lang.forEach(this._properties,function(prop,i){
var _56b=null;
if(dojo.lang.isArray(prop.start)){
}else{
if(prop.start instanceof dojo.gfx.color.Color){
_56b=(prop.units||"rgb")+"(";
for(var j=0;j<prop.startRgb.length;j++){
_56b+=Math.round(((prop.endRgb[j]-prop.startRgb[j])*n)+prop.startRgb[j])+(j<prop.startRgb.length-1?",":"");
}
_56b+=")";
}else{
_56b=((this.diffs[i])*n)+prop.start+(prop.property!="opacity"?prop.units||"px":"");
}
}
ret[dojo.html.toCamelCase(prop.property)]=_56b;
},this);
return ret;
};
};
var anim=new dojo.lfx.Animation({beforeBegin:function(){
_555(_554);
anim.curve=new _563(_554.propertyMap);
},onAnimate:function(_56e){
dojo.lang.forEach(_554.nodes,function(node){
_55f(node,_56e);
});
}},_554.duration,null,_554.easing);
if(_553){
for(var x in _553){
if(dojo.lang.isFunction(_553[x])){
anim.connect(x,anim,_553[x]);
}
}
}
return anim;
};
dojo.lfx.html._makeFadeable=function(_571){
var _572=function(node){
if(dojo.render.html.ie){
if((node.style.zoom.length==0)&&(dojo.html.getStyle(node,"zoom")=="normal")){
node.style.zoom="1";
}
if((node.style.width.length==0)&&(dojo.html.getStyle(node,"width")=="auto")){
node.style.width="auto";
}
}
};
if(dojo.lang.isArrayLike(_571)){
dojo.lang.forEach(_571,_572);
}else{
_572(_571);
}
};
dojo.lfx.html.fade=function(_574,_575,_576,_577,_578){
_574=dojo.lfx.html._byId(_574);
var _579={property:"opacity"};
if(!dj_undef("start",_575)){
_579.start=_575.start;
}else{
_579.start=function(){
return dojo.html.getOpacity(_574[0]);
};
}
if(!dj_undef("end",_575)){
_579.end=_575.end;
}else{
dojo.raise("dojo.lfx.html.fade needs an end value");
}
var anim=dojo.lfx.propertyAnimation(_574,[_579],_576,_577);
anim.connect("beforeBegin",function(){
dojo.lfx.html._makeFadeable(_574);
});
if(_578){
anim.connect("onEnd",function(){
_578(_574,anim);
});
}
return anim;
};
dojo.lfx.html.fadeIn=function(_57b,_57c,_57d,_57e){
return dojo.lfx.html.fade(_57b,{end:1},_57c,_57d,_57e);
};
dojo.lfx.html.fadeOut=function(_57f,_580,_581,_582){
return dojo.lfx.html.fade(_57f,{end:0},_580,_581,_582);
};
dojo.lfx.html.fadeShow=function(_583,_584,_585,_586){
_583=dojo.lfx.html._byId(_583);
dojo.lang.forEach(_583,function(node){
dojo.html.setOpacity(node,0);
});
var anim=dojo.lfx.html.fadeIn(_583,_584,_585,_586);
anim.connect("beforeBegin",function(){
if(dojo.lang.isArrayLike(_583)){
dojo.lang.forEach(_583,dojo.html.show);
}else{
dojo.html.show(_583);
}
});
return anim;
};
dojo.lfx.html.fadeHide=function(_589,_58a,_58b,_58c){
var anim=dojo.lfx.html.fadeOut(_589,_58a,_58b,function(){
if(dojo.lang.isArrayLike(_589)){
dojo.lang.forEach(_589,dojo.html.hide);
}else{
dojo.html.hide(_589);
}
if(_58c){
_58c(_589,anim);
}
});
return anim;
};
dojo.lfx.html.wipeIn=function(_58e,_58f,_590,_591){
_58e=dojo.lfx.html._byId(_58e);
var _592=[];
dojo.lang.forEach(_58e,function(node){
var _594={};
var _595,_596,_597;
with(node.style){
_595=top;
_596=left;
_597=position;
top="-9999px";
left="-9999px";
position="absolute";
display="";
}
var _598=dojo.html.getBorderBox(node).height;
with(node.style){
top=_595;
left=_596;
position=_597;
display="none";
}
var anim=dojo.lfx.propertyAnimation(node,{"height":{start:1,end:function(){
return _598;
}}},_58f,_590);
anim.connect("beforeBegin",function(){
_594.overflow=node.style.overflow;
_594.height=node.style.height;
with(node.style){
overflow="hidden";
height="1px";
}
dojo.html.show(node);
});
anim.connect("onEnd",function(){
with(node.style){
overflow=_594.overflow;
height=_594.height;
}
if(_591){
_591(node,anim);
}
});
_592.push(anim);
});
return dojo.lfx.combine(_592);
};
dojo.lfx.html.wipeOut=function(_59a,_59b,_59c,_59d){
_59a=dojo.lfx.html._byId(_59a);
var _59e=[];
dojo.lang.forEach(_59a,function(node){
var _5a0={};
var anim=dojo.lfx.propertyAnimation(node,{"height":{start:function(){
return dojo.html.getContentBox(node).height;
},end:1}},_59b,_59c,{"beforeBegin":function(){
_5a0.overflow=node.style.overflow;
_5a0.height=node.style.height;
with(node.style){
overflow="hidden";
}
dojo.html.show(node);
},"onEnd":function(){
dojo.html.hide(node);
with(node.style){
overflow=_5a0.overflow;
height=_5a0.height;
}
if(_59d){
_59d(node,anim);
}
}});
_59e.push(anim);
});
return dojo.lfx.combine(_59e);
};
dojo.lfx.html.slideTo=function(_5a2,_5a3,_5a4,_5a5,_5a6){
_5a2=dojo.lfx.html._byId(_5a2);
var _5a7=[];
var _5a8=dojo.html.getComputedStyle;
if(dojo.lang.isArray(_5a3)){
dojo.deprecated("dojo.lfx.html.slideTo(node, array)","use dojo.lfx.html.slideTo(node, {top: value, left: value});","0.5");
_5a3={top:_5a3[0],left:_5a3[1]};
}
dojo.lang.forEach(_5a2,function(node){
var top=null;
var left=null;
var init=(function(){
var _5ad=node;
return function(){
var pos=_5a8(_5ad,"position");
top=(pos=="absolute"?node.offsetTop:parseInt(_5a8(node,"top"))||0);
left=(pos=="absolute"?node.offsetLeft:parseInt(_5a8(node,"left"))||0);
if(!dojo.lang.inArray(["absolute","relative"],pos)){
var ret=dojo.html.abs(_5ad,true);
dojo.html.setStyleAttributes(_5ad,"position:absolute;top:"+ret.y+"px;left:"+ret.x+"px;");
top=ret.y;
left=ret.x;
}
};
})();
init();
var anim=dojo.lfx.propertyAnimation(node,{"top":{start:top,end:(_5a3.top||0)},"left":{start:left,end:(_5a3.left||0)}},_5a4,_5a5,{"beforeBegin":init});
if(_5a6){
anim.connect("onEnd",function(){
_5a6(_5a2,anim);
});
}
_5a7.push(anim);
});
return dojo.lfx.combine(_5a7);
};
dojo.lfx.html.slideBy=function(_5b1,_5b2,_5b3,_5b4,_5b5){
_5b1=dojo.lfx.html._byId(_5b1);
var _5b6=[];
var _5b7=dojo.html.getComputedStyle;
if(dojo.lang.isArray(_5b2)){
dojo.deprecated("dojo.lfx.html.slideBy(node, array)","use dojo.lfx.html.slideBy(node, {top: value, left: value});","0.5");
_5b2={top:_5b2[0],left:_5b2[1]};
}
dojo.lang.forEach(_5b1,function(node){
var top=null;
var left=null;
var init=(function(){
var _5bc=node;
return function(){
var pos=_5b7(_5bc,"position");
top=(pos=="absolute"?node.offsetTop:parseInt(_5b7(node,"top"))||0);
left=(pos=="absolute"?node.offsetLeft:parseInt(_5b7(node,"left"))||0);
if(!dojo.lang.inArray(["absolute","relative"],pos)){
var ret=dojo.html.abs(_5bc,true);
dojo.html.setStyleAttributes(_5bc,"position:absolute;top:"+ret.y+"px;left:"+ret.x+"px;");
top=ret.y;
left=ret.x;
}
};
})();
init();
var anim=dojo.lfx.propertyAnimation(node,{"top":{start:top,end:top+(_5b2.top||0)},"left":{start:left,end:left+(_5b2.left||0)}},_5b3,_5b4).connect("beforeBegin",init);
if(_5b5){
anim.connect("onEnd",function(){
_5b5(_5b1,anim);
});
}
_5b6.push(anim);
});
return dojo.lfx.combine(_5b6);
};
dojo.lfx.html.explode=function(_5c0,_5c1,_5c2,_5c3,_5c4){
var h=dojo.html;
_5c0=dojo.byId(_5c0);
_5c1=dojo.byId(_5c1);
var _5c6=h.toCoordinateObject(_5c0,true);
var _5c7=document.createElement("div");
h.copyStyle(_5c7,_5c1);
if(_5c1.explodeClassName){
_5c7.className=_5c1.explodeClassName;
}
with(_5c7.style){
position="absolute";
display="none";
var _5c8=h.getStyle(_5c0,"background-color");
backgroundColor=_5c8?_5c8.toLowerCase():"transparent";
backgroundColor=(backgroundColor=="transparent")?"rgb(221, 221, 221)":backgroundColor;
}
dojo.body().appendChild(_5c7);
with(_5c1.style){
visibility="hidden";
display="block";
}
var _5c9=h.toCoordinateObject(_5c1,true);
with(_5c1.style){
display="none";
visibility="visible";
}
var _5ca={opacity:{start:0.5,end:1}};
dojo.lang.forEach(["height","width","top","left"],function(type){
_5ca[type]={start:_5c6[type],end:_5c9[type]};
});
var anim=new dojo.lfx.propertyAnimation(_5c7,_5ca,_5c2,_5c3,{"beforeBegin":function(){
h.setDisplay(_5c7,"block");
},"onEnd":function(){
h.setDisplay(_5c1,"block");
_5c7.parentNode.removeChild(_5c7);
}});
if(_5c4){
anim.connect("onEnd",function(){
_5c4(_5c1,anim);
});
}
return anim;
};
dojo.lfx.html.implode=function(_5cd,end,_5cf,_5d0,_5d1){
var h=dojo.html;
_5cd=dojo.byId(_5cd);
end=dojo.byId(end);
var _5d3=dojo.html.toCoordinateObject(_5cd,true);
var _5d4=dojo.html.toCoordinateObject(end,true);
var _5d5=document.createElement("div");
dojo.html.copyStyle(_5d5,_5cd);
if(_5cd.explodeClassName){
_5d5.className=_5cd.explodeClassName;
}
dojo.html.setOpacity(_5d5,0.3);
with(_5d5.style){
position="absolute";
display="none";
backgroundColor=h.getStyle(_5cd,"background-color").toLowerCase();
}
dojo.body().appendChild(_5d5);
var _5d6={opacity:{start:1,end:0.5}};
dojo.lang.forEach(["height","width","top","left"],function(type){
_5d6[type]={start:_5d3[type],end:_5d4[type]};
});
var anim=new dojo.lfx.propertyAnimation(_5d5,_5d6,_5cf,_5d0,{"beforeBegin":function(){
dojo.html.hide(_5cd);
dojo.html.show(_5d5);
},"onEnd":function(){
_5d5.parentNode.removeChild(_5d5);
}});
if(_5d1){
anim.connect("onEnd",function(){
_5d1(_5cd,anim);
});
}
return anim;
};
dojo.lfx.html.highlight=function(_5d9,_5da,_5db,_5dc,_5dd){
_5d9=dojo.lfx.html._byId(_5d9);
var _5de=[];
dojo.lang.forEach(_5d9,function(node){
var _5e0=dojo.html.getBackgroundColor(node);
var bg=dojo.html.getStyle(node,"background-color").toLowerCase();
var _5e2=dojo.html.getStyle(node,"background-image");
var _5e3=(bg=="transparent"||bg=="rgba(0, 0, 0, 0)");
while(_5e0.length>3){
_5e0.pop();
}
var rgb=new dojo.gfx.color.Color(_5da);
var _5e5=new dojo.gfx.color.Color(_5e0);
var anim=dojo.lfx.propertyAnimation(node,{"background-color":{start:rgb,end:_5e5}},_5db,_5dc,{"beforeBegin":function(){
if(_5e2){
node.style.backgroundImage="none";
}
node.style.backgroundColor="rgb("+rgb.toRgb().join(",")+")";
},"onEnd":function(){
if(_5e2){
node.style.backgroundImage=_5e2;
}
if(_5e3){
node.style.backgroundColor="transparent";
}
if(_5dd){
_5dd(node,anim);
}
}});
_5de.push(anim);
});
return dojo.lfx.combine(_5de);
};
dojo.lfx.html.unhighlight=function(_5e7,_5e8,_5e9,_5ea,_5eb){
_5e7=dojo.lfx.html._byId(_5e7);
var _5ec=[];
dojo.lang.forEach(_5e7,function(node){
var _5ee=new dojo.gfx.color.Color(dojo.html.getBackgroundColor(node));
var rgb=new dojo.gfx.color.Color(_5e8);
var _5f0=dojo.html.getStyle(node,"background-image");
var anim=dojo.lfx.propertyAnimation(node,{"background-color":{start:_5ee,end:rgb}},_5e9,_5ea,{"beforeBegin":function(){
if(_5f0){
node.style.backgroundImage="none";
}
node.style.backgroundColor="rgb("+_5ee.toRgb().join(",")+")";
},"onEnd":function(){
if(_5eb){
_5eb(node,anim);
}
}});
_5ec.push(anim);
});
return dojo.lfx.combine(_5ec);
};
dojo.lang.mixin(dojo.lfx,dojo.lfx.html);
dojo.kwCompoundRequire({browser:["dojo.lfx.html"],dashboard:["dojo.lfx.html"]});
dojo.provide("dojo.lfx.*");
 
/tags/Racine_livraison_narmer/api/js/dojo/dojo.js.uncompressed.js
New file
0,0 → 1,9828
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
if(typeof dojo == "undefined"){
 
// TODOC: HOW TO DOC THE BELOW?
// @global: djConfig
// summary:
// Application code can set the global 'djConfig' prior to loading
// the library to override certain global settings for how dojo works.
// description: The variables that can be set are as follows:
// - isDebug: false
// - allowQueryConfig: false
// - baseScriptUri: ""
// - baseRelativePath: ""
// - libraryScriptUri: ""
// - iePreventClobber: false
// - ieClobberMinimal: true
// - locale: undefined
// - extraLocale: undefined
// - preventBackButtonFix: true
// - searchIds: []
// - parseWidgets: true
// TODOC: HOW TO DOC THESE VARIABLES?
// TODOC: IS THIS A COMPLETE LIST?
// note:
// 'djConfig' does not exist under 'dojo.*' so that it can be set before the
// 'dojo' variable exists.
// note:
// Setting any of these variables *after* the library has loaded does nothing at all.
// TODOC: is this still true? Release notes for 0.3 indicated they could be set after load.
//
 
 
//TODOC: HOW TO DOC THIS?
// @global: dj_global
// summary:
// an alias for the top-level global object in the host environment
// (e.g., the window object in a browser).
// description:
// Refer to 'dj_global' rather than referring to window to ensure your
// code runs correctly in contexts other than web browsers (eg: Rhino on a server).
var dj_global = this;
 
//TODOC: HOW TO DOC THIS?
// @global: dj_currentContext
// summary:
// Private global context object. Where 'dj_global' always refers to the boot-time
// global context, 'dj_currentContext' can be modified for temporary context shifting.
// dojo.global() returns dj_currentContext.
// description:
// Refer to dojo.global() rather than referring to dj_global to ensure your
// code runs correctly in managed contexts.
var dj_currentContext = this;
 
 
// ****************************************************************
// global public utils
// TODOC: DO WE WANT TO NOTE THAT THESE ARE GLOBAL PUBLIC UTILS?
// ****************************************************************
 
function dj_undef(/*String*/ name, /*Object?*/ object){
//summary: Returns true if 'name' is defined on 'object' (or globally if 'object' is null).
//description: Note that 'defined' and 'exists' are not the same concept.
return (typeof (object || dj_currentContext)[name] == "undefined"); // Boolean
}
 
// make sure djConfig is defined
if(dj_undef("djConfig", this)){
var djConfig = {};
}
 
//TODOC: HOW TO DOC THIS?
// dojo is the root variable of (almost all) our public symbols -- make sure it is defined.
if(dj_undef("dojo", this)){
var dojo = {};
}
 
dojo.global = function(){
// summary:
// return the current global context object
// (e.g., the window object in a browser).
// description:
// Refer to 'dojo.global()' rather than referring to window to ensure your
// code runs correctly in contexts other than web browsers (eg: Rhino on a server).
return dj_currentContext;
}
 
// Override locale setting, if specified
dojo.locale = djConfig.locale;
 
//TODOC: HOW TO DOC THIS?
dojo.version = {
// summary: version number of this instance of dojo.
major: 0, minor: 4, patch: 2, flag: "",
revision: Number("$Rev: 7616 $".match(/[0-9]+/)[0]),
toString: function(){
with(dojo.version){
return major + "." + minor + "." + patch + flag + " (" + revision + ")"; // String
}
}
}
 
dojo.evalProp = function(/*String*/ name, /*Object*/ object, /*Boolean?*/ create){
// summary: Returns 'object[name]'. If not defined and 'create' is true, will return a new Object.
// description:
// Returns null if 'object[name]' is not defined and 'create' is not true.
// Note: 'defined' and 'exists' are not the same concept.
if((!object)||(!name)) return undefined; // undefined
if(!dj_undef(name, object)) return object[name]; // mixed
return (create ? (object[name]={}) : undefined); // mixed
}
 
dojo.parseObjPath = function(/*String*/ path, /*Object?*/ context, /*Boolean?*/ create){
// summary: Parse string path to an object, and return corresponding object reference and property name.
// description:
// Returns an object with two properties, 'obj' and 'prop'.
// 'obj[prop]' is the reference indicated by 'path'.
// path: Path to an object, in the form "A.B.C".
// context: Object to use as root of path. Defaults to 'dojo.global()'.
// create: If true, Objects will be created at any point along the 'path' that is undefined.
var object = (context || dojo.global());
var names = path.split('.');
var prop = names.pop();
for (var i=0,l=names.length;i<l && object;i++){
object = dojo.evalProp(names[i], object, create);
}
return {obj: object, prop: prop}; // Object: {obj: Object, prop: String}
}
 
dojo.evalObjPath = function(/*String*/ path, /*Boolean?*/ create){
// summary: Return the value of object at 'path' in the global scope, without using 'eval()'.
// path: Path to an object, in the form "A.B.C".
// create: If true, Objects will be created at any point along the 'path' that is undefined.
if(typeof path != "string"){
return dojo.global();
}
// fast path for no periods
if(path.indexOf('.') == -1){
return dojo.evalProp(path, dojo.global(), create); // mixed
}
 
//MOW: old 'with' syntax was confusing and would throw an error if parseObjPath returned null.
var ref = dojo.parseObjPath(path, dojo.global(), create);
if(ref){
return dojo.evalProp(ref.prop, ref.obj, create); // mixed
}
return null;
}
 
dojo.errorToString = function(/*Error*/ exception){
// summary: Return an exception's 'message', 'description' or text.
 
// TODO: overriding Error.prototype.toString won't accomplish this?
// ... since natively generated Error objects do not always reflect such things?
if(!dj_undef("message", exception)){
return exception.message; // String
}else if(!dj_undef("description", exception)){
return exception.description; // String
}else{
return exception; // Error
}
}
 
dojo.raise = function(/*String*/ message, /*Error?*/ exception){
// summary: Common point for raising exceptions in Dojo to enable logging.
// Throws an error message with text of 'exception' if provided, or
// rethrows exception object.
 
if(exception){
message = message + ": "+dojo.errorToString(exception);
}else{
message = dojo.errorToString(message);
}
 
// print the message to the user if hostenv.println is defined
try { if(djConfig.isDebug){ dojo.hostenv.println("FATAL exception raised: "+message); } } catch (e) {}
 
throw exception || Error(message);
}
 
//Stub functions so things don't break.
//TODOC: HOW TO DOC THESE?
dojo.debug = function(){};
dojo.debugShallow = function(obj){};
dojo.profile = { start: function(){}, end: function(){}, stop: function(){}, dump: function(){} };
 
function dj_eval(/*String*/ scriptFragment){
// summary: Perform an evaluation in the global scope. Use this rather than calling 'eval()' directly.
// description: Placed in a separate function to minimize size of trapped evaluation context.
// note:
// - JSC eval() takes an optional second argument which can be 'unsafe'.
// - Mozilla/SpiderMonkey eval() takes an optional second argument which is the
// scope object for new symbols.
return dj_global.eval ? dj_global.eval(scriptFragment) : eval(scriptFragment); // mixed
}
 
dojo.unimplemented = function(/*String*/ funcname, /*String?*/ extra){
// summary: Throw an exception because some function is not implemented.
// extra: Text to append to the exception message.
var message = "'" + funcname + "' not implemented";
if (extra != null) { message += " " + extra; }
dojo.raise(message);
}
 
dojo.deprecated = function(/*String*/ behaviour, /*String?*/ extra, /*String?*/ removal){
// summary: Log a debug message to indicate that a behavior has been deprecated.
// extra: Text to append to the message.
// removal: Text to indicate when in the future the behavior will be removed.
var message = "DEPRECATED: " + behaviour;
if(extra){ message += " " + extra; }
if(removal){ message += " -- will be removed in version: " + removal; }
dojo.debug(message);
}
 
dojo.render = (function(){
//TODOC: HOW TO DOC THIS?
// summary: Details rendering support, OS and browser of the current environment.
// TODOC: is this something many folks will interact with? If so, we should doc the structure created...
function vscaffold(prefs, names){
var tmp = {
capable: false,
support: {
builtin: false,
plugin: false
},
prefixes: prefs
};
for(var i=0; i<names.length; i++){
tmp[names[i]] = false;
}
return tmp;
}
 
return {
name: "",
ver: dojo.version,
os: { win: false, linux: false, osx: false },
html: vscaffold(["html"], ["ie", "opera", "khtml", "safari", "moz"]),
svg: vscaffold(["svg"], ["corel", "adobe", "batik"]),
vml: vscaffold(["vml"], ["ie"]),
swf: vscaffold(["Swf", "Flash", "Mm"], ["mm"]),
swt: vscaffold(["Swt"], ["ibm"])
};
})();
 
// ****************************************************************
// dojo.hostenv methods that must be defined in hostenv_*.js
// ****************************************************************
 
/**
* The interface definining the interaction with the EcmaScript host environment.
*/
 
/*
* None of these methods should ever be called directly by library users.
* Instead public methods such as loadModule should be called instead.
*/
dojo.hostenv = (function(){
// TODOC: HOW TO DOC THIS?
// summary: Provides encapsulation of behavior that changes across different 'host environments'
// (different browsers, server via Rhino, etc).
// description: None of these methods should ever be called directly by library users.
// Use public methods such as 'loadModule' instead.
 
// default configuration options
var config = {
isDebug: false,
allowQueryConfig: false,
baseScriptUri: "",
baseRelativePath: "",
libraryScriptUri: "",
iePreventClobber: false,
ieClobberMinimal: true,
preventBackButtonFix: true,
delayMozLoadingFix: false,
searchIds: [],
parseWidgets: true
};
 
if (typeof djConfig == "undefined") { djConfig = config; }
else {
for (var option in config) {
if (typeof djConfig[option] == "undefined") {
djConfig[option] = config[option];
}
}
}
 
return {
name_: '(unset)',
version_: '(unset)',
 
 
getName: function(){
// sumary: Return the name of the host environment.
return this.name_; // String
},
 
 
getVersion: function(){
// summary: Return the version of the hostenv.
return this.version_; // String
},
 
getText: function(/*String*/ uri){
// summary: Read the plain/text contents at the specified 'uri'.
// description:
// If 'getText()' is not implemented, then it is necessary to override
// 'loadUri()' with an implementation that doesn't rely on it.
 
dojo.unimplemented('getText', "uri=" + uri);
}
};
})();
 
 
dojo.hostenv.getBaseScriptUri = function(){
// summary: Return the base script uri that other scripts are found relative to.
// TODOC: HUH? This comment means nothing to me. What other scripts? Is this the path to other dojo libraries?
// MAYBE: Return the base uri to scripts in the dojo library. ???
// return: Empty string or a path ending in '/'.
if(djConfig.baseScriptUri.length){
return djConfig.baseScriptUri;
}
 
// MOW: Why not:
// uri = djConfig.libraryScriptUri || djConfig.baseRelativePath
// ??? Why 'new String(...)'
var uri = new String(djConfig.libraryScriptUri||djConfig.baseRelativePath);
if (!uri) { dojo.raise("Nothing returned by getLibraryScriptUri(): " + uri); }
 
// MOW: uri seems to not be actually used. Seems to be hard-coding to djConfig.baseRelativePath... ???
var lastslash = uri.lastIndexOf('/'); // MOW ???
djConfig.baseScriptUri = djConfig.baseRelativePath;
return djConfig.baseScriptUri; // String
}
 
/*
* loader.js - A bootstrap module. Runs before the hostenv_*.js file. Contains all of the package loading methods.
*/
 
//A semi-colon is at the start of the line because after doing a build, this function definition
//get compressed onto the same line as the last line in bootstrap1.js. That list line is just a
//curly bracket, and the browser complains about that syntax. The semicolon fixes it. Putting it
//here instead of at the end of bootstrap1.js, since it is more of an issue for this file, (using
//the closure), and bootstrap1.js could change in the future.
;(function(){
//Additional properties for dojo.hostenv
var _addHostEnv = {
pkgFileName: "__package__",
// for recursion protection
loading_modules_: {},
loaded_modules_: {},
addedToLoadingCount: [],
removedFromLoadingCount: [],
inFlightCount: 0,
// FIXME: it should be possible to pull module prefixes in from djConfig
modulePrefixes_: {
dojo: {name: "dojo", value: "src"}
},
 
setModulePrefix: function(/*String*/module, /*String*/prefix){
// summary: establishes module/prefix pair
this.modulePrefixes_[module] = {name: module, value: prefix};
},
 
moduleHasPrefix: function(/*String*/module){
// summary: checks to see if module has been established
var mp = this.modulePrefixes_;
return Boolean(mp[module] && mp[module].value); // Boolean
},
 
getModulePrefix: function(/*String*/module){
// summary: gets the prefix associated with module
if(this.moduleHasPrefix(module)){
return this.modulePrefixes_[module].value; // String
}
return module; // String
},
 
getTextStack: [],
loadUriStack: [],
loadedUris: [],
//WARNING: This variable is referenced by packages outside of bootstrap: FloatingPane.js and undo/browser.js
post_load_: false,
//Egad! Lots of test files push on this directly instead of using dojo.addOnLoad.
modulesLoadedListeners: [],
unloadListeners: [],
loadNotifying: false
};
//Add all of these properties to dojo.hostenv
for(var param in _addHostEnv){
dojo.hostenv[param] = _addHostEnv[param];
}
})();
 
dojo.hostenv.loadPath = function(/*String*/relpath, /*String?*/module, /*Function?*/cb){
// summary:
// Load a Javascript module given a relative path
//
// description:
// Loads and interprets the script located at relpath, which is relative to the
// script root directory. If the script is found but its interpretation causes
// a runtime exception, that exception is not caught by us, so the caller will
// see it. We return a true value if and only if the script is found.
//
// For now, we do not have an implementation of a true search path. We
// consider only the single base script uri, as returned by getBaseScriptUri().
//
// relpath: A relative path to a script (no leading '/', and typically
// ending in '.js').
// module: A module whose existance to check for after loading a path.
// Can be used to determine success or failure of the load.
// cb: a callback function to pass the result of evaluating the script
 
var uri;
if(relpath.charAt(0) == '/' || relpath.match(/^\w+:/)){
// dojo.raise("relpath '" + relpath + "'; must be relative");
uri = relpath;
}else{
uri = this.getBaseScriptUri() + relpath;
}
if(djConfig.cacheBust && dojo.render.html.capable){
uri += "?" + String(djConfig.cacheBust).replace(/\W+/g,"");
}
try{
return !module ? this.loadUri(uri, cb) : this.loadUriAndCheck(uri, module, cb); // Boolean
}catch(e){
dojo.debug(e);
return false; // Boolean
}
}
 
dojo.hostenv.loadUri = function(/*String (URL)*/uri, /*Function?*/cb){
// summary:
// Loads JavaScript from a URI
//
// description:
// Reads the contents of the URI, and evaluates the contents. This is used to load modules as well
// as resource bundles. Returns true if it succeeded. Returns false if the URI reading failed.
// Throws if the evaluation throws.
//
// uri: a uri which points at the script to be loaded
// cb: a callback function to process the result of evaluating the script as an expression, typically
// used by the resource bundle loader to load JSON-style resources
 
if(this.loadedUris[uri]){
return true; // Boolean
}
var contents = this.getText(uri, null, true);
if(!contents){ return false; } // Boolean
this.loadedUris[uri] = true;
if(cb){ contents = '('+contents+')'; }
var value = dj_eval(contents);
if(cb){ cb(value); }
return true; // Boolean
}
 
// FIXME: probably need to add logging to this method
dojo.hostenv.loadUriAndCheck = function(/*String (URL)*/uri, /*String*/moduleName, /*Function?*/cb){
// summary: calls loadUri then findModule and returns true if both succeed
var ok = true;
try{
ok = this.loadUri(uri, cb);
}catch(e){
dojo.debug("failed loading ", uri, " with error: ", e);
}
return Boolean(ok && this.findModule(moduleName, false)); // Boolean
}
 
dojo.loaded = function(){ }
dojo.unloaded = function(){ }
 
dojo.hostenv.loaded = function(){
this.loadNotifying = true;
this.post_load_ = true;
var mll = this.modulesLoadedListeners;
for(var x=0; x<mll.length; x++){
mll[x]();
}
 
//Clear listeners so new ones can be added
//For other xdomain package loads after the initial load.
this.modulesLoadedListeners = [];
this.loadNotifying = false;
 
dojo.loaded();
}
 
dojo.hostenv.unloaded = function(){
var mll = this.unloadListeners;
while(mll.length){
(mll.pop())();
}
dojo.unloaded();
}
 
dojo.addOnLoad = function(/*Object?*/obj, /*String|Function*/functionName) {
// summary:
// Registers a function to be triggered after the DOM has finished loading
// and widgets declared in markup have been instantiated. Images and CSS files
// may or may not have finished downloading when the specified function is called.
// (Note that widgets' CSS and HTML code is guaranteed to be downloaded before said
// widgets are instantiated.)
//
// usage:
// dojo.addOnLoad(functionPointer)
// dojo.addOnLoad(object, "functionName")
 
var dh = dojo.hostenv;
if(arguments.length == 1) {
dh.modulesLoadedListeners.push(obj);
} else if(arguments.length > 1) {
dh.modulesLoadedListeners.push(function() {
obj[functionName]();
});
}
 
//Added for xdomain loading. dojo.addOnLoad is used to
//indicate callbacks after doing some dojo.require() statements.
//In the xdomain case, if all the requires are loaded (after initial
//page load), then immediately call any listeners.
if(dh.post_load_ && dh.inFlightCount == 0 && !dh.loadNotifying){
dh.callLoaded();
}
}
 
dojo.addOnUnload = function(/*Object?*/obj, /*String|Function?*/functionName){
// summary: registers a function to be triggered when the page unloads
//
// usage:
// dojo.addOnLoad(functionPointer)
// dojo.addOnLoad(object, "functionName")
var dh = dojo.hostenv;
if(arguments.length == 1){
dh.unloadListeners.push(obj);
} else if(arguments.length > 1) {
dh.unloadListeners.push(function() {
obj[functionName]();
});
}
}
 
dojo.hostenv.modulesLoaded = function(){
if(this.post_load_){ return; }
if(this.loadUriStack.length==0 && this.getTextStack.length==0){
if(this.inFlightCount > 0){
dojo.debug("files still in flight!");
return;
}
dojo.hostenv.callLoaded();
}
}
 
dojo.hostenv.callLoaded = function(){
//The "object" check is for IE, and the other opera check fixes an issue
//in Opera where it could not find the body element in some widget test cases.
//For 0.9, maybe route all browsers through the setTimeout (need protection
//still for non-browser environments though). This might also help the issue with
//FF 2.0 and freezing issues where we try to do sync xhr while background css images
//are being loaded (trac #2572)? Consider for 0.9.
if(typeof setTimeout == "object" || (djConfig["useXDomain"] && dojo.render.html.opera)){
setTimeout("dojo.hostenv.loaded();", 0);
}else{
dojo.hostenv.loaded();
}
}
 
dojo.hostenv.getModuleSymbols = function(/*String*/modulename){
// summary:
// Converts a module name in dotted JS notation to an array representing the path in the source tree
var syms = modulename.split(".");
for(var i = syms.length; i>0; i--){
var parentModule = syms.slice(0, i).join(".");
if((i==1) && !this.moduleHasPrefix(parentModule)){
// Support default module directory (sibling of dojo) for top-level modules
syms[0] = "../" + syms[0];
}else{
var parentModulePath = this.getModulePrefix(parentModule);
if(parentModulePath != parentModule){
syms.splice(0, i, parentModulePath);
break;
}
}
}
return syms; // Array
}
 
dojo.hostenv._global_omit_module_check = false;
dojo.hostenv.loadModule = function(/*String*/moduleName, /*Boolean?*/exactOnly, /*Boolean?*/omitModuleCheck){
// summary:
// loads a Javascript module from the appropriate URI
//
// description:
// loadModule("A.B") first checks to see if symbol A.B is defined.
// If it is, it is simply returned (nothing to do).
//
// If it is not defined, it will look for "A/B.js" in the script root directory,
// followed by "A.js".
//
// It throws if it cannot find a file to load, or if the symbol A.B is not
// defined after loading.
//
// It returns the object A.B.
//
// This does nothing about importing symbols into the current package.
// It is presumed that the caller will take care of that. For example, to import
// all symbols:
//
// with (dojo.hostenv.loadModule("A.B")) {
// ...
// }
//
// And to import just the leaf symbol:
//
// var B = dojo.hostenv.loadModule("A.B");
// ...
//
// dj_load is an alias for dojo.hostenv.loadModule
 
if(!moduleName){ return; }
omitModuleCheck = this._global_omit_module_check || omitModuleCheck;
var module = this.findModule(moduleName, false);
if(module){
return module;
}
 
// protect against infinite recursion from mutual dependencies
if(dj_undef(moduleName, this.loading_modules_)){
this.addedToLoadingCount.push(moduleName);
}
this.loading_modules_[moduleName] = 1;
 
// convert periods to slashes
var relpath = moduleName.replace(/\./g, '/') + '.js';
 
var nsyms = moduleName.split(".");
// this line allowed loading of a module manifest as if it were a namespace
// it's an interesting idea, but shouldn't be combined with 'namespaces' proper
// and leads to unwanted dependencies
// the effect can be achieved in other (albeit less-flexible) ways now, so I am
// removing this pending further design work
// perhaps we can explicitly define this idea of a 'module manifest', and subclass
// 'namespace manifest' from that
//dojo.getNamespace(nsyms[0]);
 
var syms = this.getModuleSymbols(moduleName);
var startedRelative = ((syms[0].charAt(0) != '/') && !syms[0].match(/^\w+:/));
var last = syms[syms.length - 1];
var ok;
// figure out if we're looking for a full package, if so, we want to do
// things slightly diffrently
if(last=="*"){
moduleName = nsyms.slice(0, -1).join('.');
while(syms.length){
syms.pop();
syms.push(this.pkgFileName);
relpath = syms.join("/") + '.js';
if(startedRelative && relpath.charAt(0)=="/"){
relpath = relpath.slice(1);
}
ok = this.loadPath(relpath, !omitModuleCheck ? moduleName : null);
if(ok){ break; }
syms.pop();
}
}else{
relpath = syms.join("/") + '.js';
moduleName = nsyms.join('.');
var modArg = !omitModuleCheck ? moduleName : null;
ok = this.loadPath(relpath, modArg);
if(!ok && !exactOnly){
syms.pop();
while(syms.length){
relpath = syms.join('/') + '.js';
ok = this.loadPath(relpath, modArg);
if(ok){ break; }
syms.pop();
relpath = syms.join('/') + '/'+this.pkgFileName+'.js';
if(startedRelative && relpath.charAt(0)=="/"){
relpath = relpath.slice(1);
}
ok = this.loadPath(relpath, modArg);
if(ok){ break; }
}
}
 
if(!ok && !omitModuleCheck){
dojo.raise("Could not load '" + moduleName + "'; last tried '" + relpath + "'");
}
}
 
// check that the symbol was defined
//Don't bother if we're doing xdomain (asynchronous) loading.
if(!omitModuleCheck && !this["isXDomain"]){
// pass in false so we can give better error
module = this.findModule(moduleName, false);
if(!module){
dojo.raise("symbol '" + moduleName + "' is not defined after loading '" + relpath + "'");
}
}
 
return module;
}
 
dojo.hostenv.startPackage = function(/*String*/packageName){
// summary:
// Creates a JavaScript package
//
// description:
// startPackage("A.B") follows the path, and at each level creates a new empty
// object or uses what already exists. It returns the result.
//
// packageName: the package to be created as a String in dot notation
 
//Make sure we have a string.
var fullPkgName = String(packageName);
var strippedPkgName = fullPkgName;
 
var syms = packageName.split(/\./);
if(syms[syms.length-1]=="*"){
syms.pop();
strippedPkgName = syms.join(".");
}
var evaledPkg = dojo.evalObjPath(strippedPkgName, true);
this.loaded_modules_[fullPkgName] = evaledPkg;
this.loaded_modules_[strippedPkgName] = evaledPkg;
return evaledPkg; // Object
}
 
dojo.hostenv.findModule = function(/*String*/moduleName, /*Boolean?*/mustExist){
// summary:
// Returns the Object representing the module, if it exists, otherwise null.
//
// moduleName A fully qualified module including package name, like 'A.B'.
// mustExist Optional, default false. throw instead of returning null
// if the module does not currently exist.
 
var lmn = String(moduleName);
 
if(this.loaded_modules_[lmn]){
return this.loaded_modules_[lmn]; // Object
}
 
if(mustExist){
dojo.raise("no loaded module named '" + moduleName + "'");
}
return null; // null
}
 
//Start of old bootstrap2:
 
dojo.kwCompoundRequire = function(/*Object containing Arrays*/modMap){
// description:
// This method taks a "map" of arrays which one can use to optionally load dojo
// modules. The map is indexed by the possible dojo.hostenv.name_ values, with
// two additional values: "default" and "common". The items in the "default"
// array will be loaded if none of the other items have been choosen based on
// the hostenv.name_ item. The items in the "common" array will _always_ be
// loaded, regardless of which list is chosen. Here's how it's normally
// called:
//
// dojo.kwCompoundRequire({
// browser: [
// ["foo.bar.baz", true, true], // an example that passes multiple args to loadModule()
// "foo.sample.*",
// "foo.test,
// ],
// default: [ "foo.sample.*" ],
// common: [ "really.important.module.*" ]
// });
 
var common = modMap["common"]||[];
var result = modMap[dojo.hostenv.name_] ? common.concat(modMap[dojo.hostenv.name_]||[]) : common.concat(modMap["default"]||[]);
 
for(var x=0; x<result.length; x++){
var curr = result[x];
if(curr.constructor == Array){
dojo.hostenv.loadModule.apply(dojo.hostenv, curr);
}else{
dojo.hostenv.loadModule(curr);
}
}
}
 
dojo.require = function(/*String*/ resourceName){
// summary
// Ensure that the given resource (ie, javascript
// source file) has been loaded.
// description
// dojo.require() is similar to C's #include command or java's "import" command.
// You call dojo.require() to pull in the resources (ie, javascript source files)
// that define the functions you are using.
//
// Note that in the case of a build, many resources have already been included
// into dojo.js (ie, many of the javascript source files have been compressed and
// concatened into dojo.js), so many dojo.require() calls will simply return
// without downloading anything.
dojo.hostenv.loadModule.apply(dojo.hostenv, arguments);
}
 
dojo.requireIf = function(/*Boolean*/ condition, /*String*/ resourceName){
// summary
// If the condition is true then call dojo.require() for the specified resource
var arg0 = arguments[0];
if((arg0 === true)||(arg0=="common")||(arg0 && dojo.render[arg0].capable)){
var args = [];
for (var i = 1; i < arguments.length; i++) { args.push(arguments[i]); }
dojo.require.apply(dojo, args);
}
}
 
dojo.requireAfterIf = dojo.requireIf;
 
dojo.provide = function(/*String*/ resourceName){
// summary
// Each javascript source file must have (exactly) one dojo.provide()
// call at the top of the file, corresponding to the file name.
// For example, dojo/src/foo.js must have dojo.provide("dojo.foo"); at the top of the file.
//
// description
// Each javascript source file is called a resource. When a resource
// is loaded by the browser, dojo.provide() registers that it has
// been loaded.
//
// For backwards compatibility reasons, in addition to registering the resource,
// dojo.provide() also ensures that the javascript object for the module exists. For
// example, dojo.provide("dojo.html.common"), in addition to registering that common.js
// is a resource for the dojo.html module, will ensure that the dojo.html javascript object
// exists, so that calls like dojo.html.foo = function(){ ... } don't fail.
//
// In the case of a build (or in the future, a rollup), where multiple javascript source
// files are combined into one bigger file (similar to a .lib or .jar file), that file
// will contain multiple dojo.provide() calls, to note that it includes
// multiple resources.
return dojo.hostenv.startPackage.apply(dojo.hostenv, arguments);
}
 
dojo.registerModulePath = function(/*String*/module, /*String*/prefix){
// summary: maps a module name to a path
// description: An unregistered module is given the default path of ../<module>,
// relative to Dojo root. For example, module acme is mapped to ../acme.
// If you want to use a different module name, use dojo.registerModulePath.
return dojo.hostenv.setModulePrefix(module, prefix);
}
 
if(djConfig["modulePaths"]){
for(var param in djConfig["modulePaths"]){
dojo.registerModulePath(param, djConfig["modulePaths"][param]);
}
}
 
dojo.setModulePrefix = function(/*String*/module, /*String*/prefix){
// summary: maps a module name to a path
dojo.deprecated('dojo.setModulePrefix("' + module + '", "' + prefix + '")', "replaced by dojo.registerModulePath", "0.5");
return dojo.registerModulePath(module, prefix);
}
 
dojo.exists = function(/*Object*/obj, /*String*/name){
// summary: determine if an object supports a given method
// description: useful for longer api chains where you have to test each object in the chain
var p = name.split(".");
for(var i = 0; i < p.length; i++){
if(!obj[p[i]]){ return false; } // Boolean
obj = obj[p[i]];
}
return true; // Boolean
}
 
// Localization routines
 
dojo.hostenv.normalizeLocale = function(/*String?*/locale){
// summary:
// Returns canonical form of locale, as used by Dojo. All variants are case-insensitive and are separated by '-'
// as specified in RFC 3066. If no locale is specified, the user agent's default is returned.
 
var result = locale ? locale.toLowerCase() : dojo.locale;
if(result == "root"){
result = "ROOT";
}
return result;// String
};
 
dojo.hostenv.searchLocalePath = function(/*String*/locale, /*Boolean*/down, /*Function*/searchFunc){
// summary:
// A helper method to assist in searching for locale-based resources. Will iterate through
// the variants of a particular locale, either up or down, executing a callback function.
// For example, "en-us" and true will try "en-us" followed by "en" and finally "ROOT".
 
locale = dojo.hostenv.normalizeLocale(locale);
 
var elements = locale.split('-');
var searchlist = [];
for(var i = elements.length; i > 0; i--){
searchlist.push(elements.slice(0, i).join('-'));
}
searchlist.push(false);
if(down){searchlist.reverse();}
 
for(var j = searchlist.length - 1; j >= 0; j--){
var loc = searchlist[j] || "ROOT";
var stop = searchFunc(loc);
if(stop){ break; }
}
}
 
//These two functions are placed outside of preloadLocalizations
//So that the xd loading can use/override them.
dojo.hostenv.localesGenerated /***BUILD:localesGenerated***/; // value will be inserted here at build time, if necessary
 
dojo.hostenv.registerNlsPrefix = function(){
// summary:
// Register module "nls" to point where Dojo can find pre-built localization files
dojo.registerModulePath("nls","nls");
}
 
dojo.hostenv.preloadLocalizations = function(){
// summary:
// Load built, flattened resource bundles, if available for all locales used in the page.
// Execute only once. Note that this is a no-op unless there is a build.
 
if(dojo.hostenv.localesGenerated){
dojo.hostenv.registerNlsPrefix();
 
function preload(locale){
locale = dojo.hostenv.normalizeLocale(locale);
dojo.hostenv.searchLocalePath(locale, true, function(loc){
for(var i=0; i<dojo.hostenv.localesGenerated.length;i++){
if(dojo.hostenv.localesGenerated[i] == loc){
dojo["require"]("nls.dojo_"+loc);
return true; // Boolean
}
}
return false; // Boolean
});
}
preload();
var extra = djConfig.extraLocale||[];
for(var i=0; i<extra.length; i++){
preload(extra[i]);
}
}
dojo.hostenv.preloadLocalizations = function(){};
}
 
dojo.requireLocalization = function(/*String*/moduleName, /*String*/bundleName, /*String?*/locale, /*String?*/availableFlatLocales){
// summary:
// Declares translated resources and loads them if necessary, in the same style as dojo.require.
// Contents of the resource bundle are typically strings, but may be any name/value pair,
// represented in JSON format. See also dojo.i18n.getLocalization.
//
// moduleName: name of the package containing the "nls" directory in which the bundle is found
// bundleName: bundle name, i.e. the filename without the '.js' suffix
// locale: the locale to load (optional) By default, the browser's user locale as defined by dojo.locale
// availableFlatLocales: A comma-separated list of the available, flattened locales for this bundle.
// This argument should only be set by the build process.
//
// description:
// Load translated resource bundles provided underneath the "nls" directory within a package.
// Translated resources may be located in different packages throughout the source tree. For example,
// a particular widget may define one or more resource bundles, structured in a program as follows,
// where moduleName is mycode.mywidget and bundleNames available include bundleone and bundletwo:
// ...
// mycode/
// mywidget/
// nls/
// bundleone.js (the fallback translation, English in this example)
// bundletwo.js (also a fallback translation)
// de/
// bundleone.js
// bundletwo.js
// de-at/
// bundleone.js
// en/
// (empty; use the fallback translation)
// en-us/
// bundleone.js
// en-gb/
// bundleone.js
// es/
// bundleone.js
// bundletwo.js
// ...etc
// ...
// Each directory is named for a locale as specified by RFC 3066, (http://www.ietf.org/rfc/rfc3066.txt),
// normalized in lowercase. Note that the two bundles in the example do not define all the same variants.
// For a given locale, bundles will be loaded for that locale and all more general locales above it, including
// a fallback at the root directory. For example, a declaration for the "de-at" locale will first
// load nls/de-at/bundleone.js, then nls/de/bundleone.js and finally nls/bundleone.js. The data will
// be flattened into a single Object so that lookups will follow this cascading pattern. An optional build
// step can preload the bundles to avoid data redundancy and the multiple network hits normally required to
// load these resources.
 
dojo.hostenv.preloadLocalizations();
var targetLocale = dojo.hostenv.normalizeLocale(locale);
var bundlePackage = [moduleName, "nls", bundleName].join(".");
//NOTE: When loading these resources, the packaging does not match what is on disk. This is an
// implementation detail, as this is just a private data structure to hold the loaded resources.
// e.g. tests/hello/nls/en-us/salutations.js is loaded as the object tests.hello.nls.salutations.en_us={...}
// The structure on disk is intended to be most convenient for developers and translators, but in memory
// it is more logical and efficient to store in a different order. Locales cannot use dashes, since the
// resulting path will not evaluate as valid JS, so we translate them to underscores.
//Find the best-match locale to load if we have available flat locales.
var bestLocale = "";
if(availableFlatLocales){
var flatLocales = availableFlatLocales.split(",");
for(var i = 0; i < flatLocales.length; i++){
//Locale must match from start of string.
if(targetLocale.indexOf(flatLocales[i]) == 0){
if(flatLocales[i].length > bestLocale.length){
bestLocale = flatLocales[i];
}
}
}
if(!bestLocale){
bestLocale = "ROOT";
}
}
 
//See if the desired locale is already loaded.
var tempLocale = availableFlatLocales ? bestLocale : targetLocale;
var bundle = dojo.hostenv.findModule(bundlePackage);
var localizedBundle = null;
if(bundle){
if(djConfig.localizationComplete && bundle._built){return;}
var jsLoc = tempLocale.replace('-', '_');
var translationPackage = bundlePackage+"."+jsLoc;
localizedBundle = dojo.hostenv.findModule(translationPackage);
}
 
if(!localizedBundle){
bundle = dojo.hostenv.startPackage(bundlePackage);
var syms = dojo.hostenv.getModuleSymbols(moduleName);
var modpath = syms.concat("nls").join("/");
var parent;
 
dojo.hostenv.searchLocalePath(tempLocale, availableFlatLocales, function(loc){
var jsLoc = loc.replace('-', '_');
var translationPackage = bundlePackage + "." + jsLoc;
var loaded = false;
if(!dojo.hostenv.findModule(translationPackage)){
// Mark loaded whether it's found or not, so that further load attempts will not be made
dojo.hostenv.startPackage(translationPackage);
var module = [modpath];
if(loc != "ROOT"){module.push(loc);}
module.push(bundleName);
var filespec = module.join("/") + '.js';
loaded = dojo.hostenv.loadPath(filespec, null, function(hash){
// Use singleton with prototype to point to parent bundle, then mix-in result from loadPath
var clazz = function(){};
clazz.prototype = parent;
bundle[jsLoc] = new clazz();
for(var j in hash){ bundle[jsLoc][j] = hash[j]; }
});
}else{
loaded = true;
}
if(loaded && bundle[jsLoc]){
parent = bundle[jsLoc];
}else{
bundle[jsLoc] = parent;
}
if(availableFlatLocales){
//Stop the locale path searching if we know the availableFlatLocales, since
//the first call to this function will load the only bundle that is needed.
return true;
}
});
}
 
//Save the best locale bundle as the target locale bundle when we know the
//the available bundles.
if(availableFlatLocales && targetLocale != bestLocale){
bundle[targetLocale.replace('-', '_')] = bundle[bestLocale.replace('-', '_')];
}
};
 
(function(){
// If other locales are used, dojo.requireLocalization should load them as well, by default.
// Override dojo.requireLocalization to do load the default bundle, then iterate through the
// extraLocale list and load those translations as well, unless a particular locale was requested.
 
var extra = djConfig.extraLocale;
if(extra){
if(!extra instanceof Array){
extra = [extra];
}
 
var req = dojo.requireLocalization;
dojo.requireLocalization = function(m, b, locale, availableFlatLocales){
req(m,b,locale, availableFlatLocales);
if(locale){return;}
for(var i=0; i<extra.length; i++){
req(m,b,extra[i], availableFlatLocales);
}
};
}
})();
 
};
 
if(typeof window != 'undefined'){
 
// attempt to figure out the path to dojo if it isn't set in the config
(function(){
// before we get any further with the config options, try to pick them out
// of the URL. Most of this code is from NW
if(djConfig.allowQueryConfig){
var baseUrl = document.location.toString(); // FIXME: use location.query instead?
var params = baseUrl.split("?", 2);
if(params.length > 1){
var paramStr = params[1];
var pairs = paramStr.split("&");
for(var x in pairs){
var sp = pairs[x].split("=");
// FIXME: is this eval dangerous?
if((sp[0].length > 9)&&(sp[0].substr(0, 9) == "djConfig.")){
var opt = sp[0].substr(9);
try{
djConfig[opt]=eval(sp[1]);
}catch(e){
djConfig[opt]=sp[1];
}
}
}
}
}
 
if(
((djConfig["baseScriptUri"] == "")||(djConfig["baseRelativePath"] == "")) &&
(document && document.getElementsByTagName)
){
var scripts = document.getElementsByTagName("script");
var rePkg = /(__package__|dojo|bootstrap1)\.js([\?\.]|$)/i;
for(var i = 0; i < scripts.length; i++) {
var src = scripts[i].getAttribute("src");
if(!src) { continue; }
var m = src.match(rePkg);
if(m) {
var root = src.substring(0, m.index);
if(src.indexOf("bootstrap1") > -1) { root += "../"; }
if(!this["djConfig"]) { djConfig = {}; }
if(djConfig["baseScriptUri"] == "") { djConfig["baseScriptUri"] = root; }
if(djConfig["baseRelativePath"] == "") { djConfig["baseRelativePath"] = root; }
break;
}
}
}
 
// fill in the rendering support information in dojo.render.*
var dr = dojo.render;
var drh = dojo.render.html;
var drs = dojo.render.svg;
var dua = (drh.UA = navigator.userAgent);
var dav = (drh.AV = navigator.appVersion);
var t = true;
var f = false;
drh.capable = t;
drh.support.builtin = t;
 
dr.ver = parseFloat(drh.AV);
dr.os.mac = dav.indexOf("Macintosh") >= 0;
dr.os.win = dav.indexOf("Windows") >= 0;
// could also be Solaris or something, but it's the same browser
dr.os.linux = dav.indexOf("X11") >= 0;
 
drh.opera = dua.indexOf("Opera") >= 0;
drh.khtml = (dav.indexOf("Konqueror") >= 0)||(dav.indexOf("Safari") >= 0);
drh.safari = dav.indexOf("Safari") >= 0;
var geckoPos = dua.indexOf("Gecko");
drh.mozilla = drh.moz = (geckoPos >= 0)&&(!drh.khtml);
if (drh.mozilla) {
// gecko version is YYYYMMDD
drh.geckoVersion = dua.substring(geckoPos + 6, geckoPos + 14);
}
drh.ie = (document.all)&&(!drh.opera);
drh.ie50 = drh.ie && dav.indexOf("MSIE 5.0")>=0;
drh.ie55 = drh.ie && dav.indexOf("MSIE 5.5")>=0;
drh.ie60 = drh.ie && dav.indexOf("MSIE 6.0")>=0;
drh.ie70 = drh.ie && dav.indexOf("MSIE 7.0")>=0;
 
var cm = document["compatMode"];
drh.quirks = (cm == "BackCompat")||(cm == "QuirksMode")||drh.ie55||drh.ie50;
 
// TODO: is the HTML LANG attribute relevant?
dojo.locale = dojo.locale || (drh.ie ? navigator.userLanguage : navigator.language).toLowerCase();
 
dr.vml.capable=drh.ie;
drs.capable = f;
drs.support.plugin = f;
drs.support.builtin = f;
var tdoc = window["document"];
var tdi = tdoc["implementation"];
 
if((tdi)&&(tdi["hasFeature"])&&(tdi.hasFeature("org.w3c.dom.svg", "1.0"))){
drs.capable = t;
drs.support.builtin = t;
drs.support.plugin = f;
}
// webkits after 420 support SVG natively. The test string is "AppleWebKit/420+"
if(drh.safari){
var tmp = dua.split("AppleWebKit/")[1];
var ver = parseFloat(tmp.split(" ")[0]);
if(ver >= 420){
drs.capable = t;
drs.support.builtin = t;
drs.support.plugin = f;
}
}else{
}
})();
 
dojo.hostenv.startPackage("dojo.hostenv");
 
dojo.render.name = dojo.hostenv.name_ = 'browser';
dojo.hostenv.searchIds = [];
 
// These are in order of decreasing likelihood; this will change in time.
dojo.hostenv._XMLHTTP_PROGIDS = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'];
 
dojo.hostenv.getXmlhttpObject = function(){
// summary: does the work of portably generating a new XMLHTTPRequest object.
var http = null;
var last_e = null;
try{ http = new XMLHttpRequest(); }catch(e){}
if(!http){
for(var i=0; i<3; ++i){
var progid = dojo.hostenv._XMLHTTP_PROGIDS[i];
try{
http = new ActiveXObject(progid);
}catch(e){
last_e = e;
}
 
if(http){
dojo.hostenv._XMLHTTP_PROGIDS = [progid]; // so faster next time
break;
}
}
 
/*if(http && !http.toString) {
http.toString = function() { "[object XMLHttpRequest]"; }
}*/
}
 
if(!http){
return dojo.raise("XMLHTTP not available", last_e);
}
 
return http; // XMLHTTPRequest instance
}
 
dojo.hostenv._blockAsync = false;
dojo.hostenv.getText = function(uri, async_cb, fail_ok){
// summary: Read the contents of the specified uri and return those contents.
// uri:
// A relative or absolute uri. If absolute, it still must be in
// the same "domain" as we are.
// async_cb:
// If not specified, load synchronously. If specified, load
// asynchronously, and use async_cb as the progress handler which
// takes the xmlhttp object as its argument. If async_cb, this
// function returns null.
// fail_ok:
// Default false. If fail_ok and !async_cb and loading fails,
// return null instead of throwing.
 
// need to block async callbacks from snatching this thread as the result
// of an async callback might call another sync XHR, this hangs khtml forever
// hostenv._blockAsync must also be checked in BrowserIO's watchInFlight()
// NOTE: must be declared before scope switches ie. this.getXmlhttpObject()
if(!async_cb){ this._blockAsync = true; }
 
var http = this.getXmlhttpObject();
 
function isDocumentOk(http){
var stat = http["status"];
// allow a 304 use cache, needed in konq (is this compliant with the http spec?)
return Boolean((!stat)||((200 <= stat)&&(300 > stat))||(stat==304));
}
 
if(async_cb){
var _this = this, timer = null, gbl = dojo.global();
var xhr = dojo.evalObjPath("dojo.io.XMLHTTPTransport");
http.onreadystatechange = function(){
if(timer){ gbl.clearTimeout(timer); timer = null; }
if(_this._blockAsync || (xhr && xhr._blockAsync)){
timer = gbl.setTimeout(function () { http.onreadystatechange.apply(this); }, 10);
}else{
if(4==http.readyState){
if(isDocumentOk(http)){
// dojo.debug("LOADED URI: "+uri);
async_cb(http.responseText);
}
}
}
}
}
 
http.open('GET', uri, async_cb ? true : false);
try{
http.send(null);
if(async_cb){
return null;
}
if(!isDocumentOk(http)){
var err = Error("Unable to load "+uri+" status:"+ http.status);
err.status = http.status;
err.responseText = http.responseText;
throw err;
}
}catch(e){
this._blockAsync = false;
if((fail_ok)&&(!async_cb)){
return null;
}else{
throw e;
}
}
 
this._blockAsync = false;
return http.responseText; // String
}
 
dojo.hostenv.defaultDebugContainerId = 'dojoDebug';
dojo.hostenv._println_buffer = [];
dojo.hostenv._println_safe = false;
dojo.hostenv.println = function(/*String*/line){
// summary:
// prints the provided line to whatever logging container is
// available. If the page isn't loaded yet, the line may be added
// to a buffer for printing later.
if(!dojo.hostenv._println_safe){
dojo.hostenv._println_buffer.push(line);
}else{
try {
var console = document.getElementById(djConfig.debugContainerId ?
djConfig.debugContainerId : dojo.hostenv.defaultDebugContainerId);
if(!console) { console = dojo.body(); }
 
var div = document.createElement("div");
div.appendChild(document.createTextNode(line));
console.appendChild(div);
} catch (e) {
try{
// safari needs the output wrapped in an element for some reason
document.write("<div>" + line + "</div>");
}catch(e2){
window.status = line;
}
}
}
}
 
dojo.addOnLoad(function(){
dojo.hostenv._println_safe = true;
while(dojo.hostenv._println_buffer.length > 0){
dojo.hostenv.println(dojo.hostenv._println_buffer.shift());
}
});
 
function dj_addNodeEvtHdlr(/*DomNode*/node, /*String*/evtName, /*Function*/fp){
// summary:
// non-destructively adds the specified function to the node's
// evtName handler.
// node: the DomNode to add the handler to
// evtName: should be in the form "click" for "onclick" handlers
var oldHandler = node["on"+evtName] || function(){};
node["on"+evtName] = function(){
fp.apply(node, arguments);
oldHandler.apply(node, arguments);
}
return true;
}
 
// BEGIN DOMContentLoaded, from Dean Edwards (http://dean.edwards.name/weblog/2006/06/again/)
function dj_load_init(e){
// allow multiple calls, only first one will take effect
// A bug in khtml calls events callbacks for document for event which isnt supported
// for example a created contextmenu event calls DOMContentLoaded, workaround
var type = (e && e.type) ? e.type.toLowerCase() : "load";
if(arguments.callee.initialized || (type!="domcontentloaded" && type!="load")){ return; }
arguments.callee.initialized = true;
if(typeof(_timer) != 'undefined'){
clearInterval(_timer);
delete _timer;
}
 
var initFunc = function(){
//perform initialization
if(dojo.render.html.ie){
dojo.hostenv.makeWidgets();
}
};
 
if(dojo.hostenv.inFlightCount == 0){
initFunc();
dojo.hostenv.modulesLoaded();
}else{
//This else case should be xdomain loading.
//Make sure this is the first thing in the load listener array.
//Part of the dojo.addOnLoad guarantee is that when the listeners are notified,
//It means the DOM (or page) has loaded and that widgets have been parsed.
dojo.hostenv.modulesLoadedListeners.unshift(initFunc);
}
}
 
// START DOMContentLoaded
// Mozilla and Opera 9 expose the event we could use
if(document.addEventListener){
// NOTE:
// due to a threading issue in Firefox 2.0, we can't enable
// DOMContentLoaded on that platform. For more information, see:
// http://trac.dojotoolkit.org/ticket/1704
if(dojo.render.html.opera || (dojo.render.html.moz && (djConfig["enableMozDomContentLoaded"] === true))){
document.addEventListener("DOMContentLoaded", dj_load_init, null);
}
 
// mainly for Opera 8.5, won't be fired if DOMContentLoaded fired already.
// also used for Mozilla because of trac #1640
window.addEventListener("load", dj_load_init, null);
}
 
// for Internet Explorer. readyState will not be achieved on init call, but dojo doesn't need it
// however, we'll include it because we don't know if there are other functions added that might.
// Note that this has changed because the build process strips all comments--including conditional
// ones.
if(dojo.render.html.ie && dojo.render.os.win){
document.attachEvent("onreadystatechange", function(e){
if(document.readyState == "complete"){
dj_load_init();
}
});
}
 
if (/(WebKit|khtml)/i.test(navigator.userAgent)) { // sniff
var _timer = setInterval(function() {
if (/loaded|complete/.test(document.readyState)) {
dj_load_init(); // call the onload handler
}
}, 10);
}
// END DOMContentLoaded
 
// IE WebControl hosted in an application can fire "beforeunload" and "unload"
// events when control visibility changes, causing Dojo to unload too soon. The
// following code fixes the problem
// Reference: http://support.microsoft.com/default.aspx?scid=kb;en-us;199155
if(dojo.render.html.ie){
dj_addNodeEvtHdlr(window, "beforeunload", function(){
dojo.hostenv._unloading = true;
window.setTimeout(function() {
dojo.hostenv._unloading = false;
}, 0);
});
}
 
dj_addNodeEvtHdlr(window, "unload", function(){
dojo.hostenv.unloaded();
if((!dojo.render.html.ie)||(dojo.render.html.ie && dojo.hostenv._unloading)){
dojo.hostenv.unloaded();
}
});
 
dojo.hostenv.makeWidgets = function(){
// you can put searchIds in djConfig and dojo.hostenv at the moment
// we should probably eventually move to one or the other
var sids = [];
if(djConfig.searchIds && djConfig.searchIds.length > 0) {
sids = sids.concat(djConfig.searchIds);
}
if(dojo.hostenv.searchIds && dojo.hostenv.searchIds.length > 0) {
sids = sids.concat(dojo.hostenv.searchIds);
}
 
if((djConfig.parseWidgets)||(sids.length > 0)){
if(dojo.evalObjPath("dojo.widget.Parse")){
// we must do this on a delay to avoid:
// http://www.shaftek.org/blog/archives/000212.html
// (IE bug)
var parser = new dojo.xml.Parse();
if(sids.length > 0){
for(var x=0; x<sids.length; x++){
var tmpNode = document.getElementById(sids[x]);
if(!tmpNode){ continue; }
var frag = parser.parseElement(tmpNode, null, true);
dojo.widget.getParser().createComponents(frag);
}
}else if(djConfig.parseWidgets){
var frag = parser.parseElement(dojo.body(), null, true);
dojo.widget.getParser().createComponents(frag);
}
}
}
}
 
dojo.addOnLoad(function(){
if(!dojo.render.html.ie) {
dojo.hostenv.makeWidgets();
}
});
 
try{
if(dojo.render.html.ie){
document.namespaces.add("v","urn:schemas-microsoft-com:vml");
document.createStyleSheet().addRule("v\\:*", "behavior:url(#default#VML)");
}
}catch(e){ }
 
// stub, over-ridden by debugging code. This will at least keep us from
// breaking when it's not included
dojo.hostenv.writeIncludes = function(){}
 
//TODOC: HOW TO DOC THIS?
// @global: dj_currentDocument
// summary:
// Current document object. 'dj_currentDocument' can be modified for temporary context shifting.
// description:
// dojo.doc() returns dojo.currentDocument.
// Refer to dojo.doc() rather than referring to 'window.document' to ensure your
// code runs correctly in managed contexts.
if(!dj_undef("document", this)){
dj_currentDocument = this.document;
}
 
dojo.doc = function(){
// summary:
// return the document object associated with the dojo.global()
return dj_currentDocument;
}
 
dojo.body = function(){
// summary:
// return the body object associated with dojo.doc()
// Note: document.body is not defined for a strict xhtml document
return dojo.doc().body || dojo.doc().getElementsByTagName("body")[0];
}
 
dojo.byId = function(/*String*/id, /*DocumentElement*/doc){
// summary:
// similar to other library's "$" function, takes a string
// representing a DOM id or a DomNode and returns the
// corresponding DomNode. If a Node is passed, this function is a
// no-op. Returns a single DOM node or null, working around
// several browser-specific bugs to do so.
// id: DOM id or DOM Node
// doc:
// optional, defaults to the current value of dj_currentDocument.
// Can be used to retreive node references from other documents.
if((id)&&((typeof id == "string")||(id instanceof String))){
if(!doc){ doc = dj_currentDocument; }
var ele = doc.getElementById(id);
// workaround bug in IE and Opera 8.2 where getElementById returns wrong element
if(ele && (ele.id != id) && doc.all){
ele = null;
// get all matching elements with this id
eles = doc.all[id];
if(eles){
// if more than 1, choose first with the correct id
if(eles.length){
for(var i=0; i<eles.length; i++){
if(eles[i].id == id){
ele = eles[i];
break;
}
}
// return 1 and only element
}else{
ele = eles;
}
}
}
return ele; // DomNode
}
return id; // DomNode
}
 
dojo.setContext = function(/*Object*/globalObject, /*DocumentElement*/globalDocument){
// summary:
// changes the behavior of many core Dojo functions that deal with
// namespace and DOM lookup, changing them to work in a new global
// context. The varibles dj_currentContext and dj_currentDocument
// are modified as a result of calling this function.
dj_currentContext = globalObject;
dj_currentDocument = globalDocument;
};
 
dojo._fireCallback = function(callback, context, cbArguments){
if((context)&&((typeof callback == "string")||(callback instanceof String))){
callback=context[callback];
}
return (context ? callback.apply(context, cbArguments || [ ]) : callback());
}
 
dojo.withGlobal = function(/*Object*/globalObject, /*Function*/callback, /*Object?*/thisObject, /*Array?*/cbArguments){
// summary:
// Call callback with globalObject as dojo.global() and globalObject.document
// as dojo.doc(). If provided, globalObject will be executed in the context of
// object thisObject
// description:
// When callback() returns or throws an error, the dojo.global() and dojo.doc() will
// be restored to its previous state.
var rval;
var oldGlob = dj_currentContext;
var oldDoc = dj_currentDocument;
try{
dojo.setContext(globalObject, globalObject.document);
rval = dojo._fireCallback(callback, thisObject, cbArguments);
}finally{
dojo.setContext(oldGlob, oldDoc);
}
return rval;
}
 
dojo.withDoc = function (/*Object*/documentObject, /*Function*/callback, /*Object?*/thisObject, /*Array?*/cbArguments) {
// summary:
// Call callback with documentObject as dojo.doc(). If provided, callback will be executed
// in the context of object thisObject
// description:
// When callback() returns or throws an error, the dojo.doc() will
// be restored to its previous state.
var rval;
var oldDoc = dj_currentDocument;
try{
dj_currentDocument = documentObject;
rval = dojo._fireCallback(callback, thisObject, cbArguments);
}finally{
dj_currentDocument = oldDoc;
}
return rval;
}
 
} //if (typeof window != 'undefined')
 
//Load debug code if necessary.
dojo.requireIf((djConfig["isDebug"] || djConfig["debugAtAllCosts"]), "dojo.debug");
 
//window.widget is for Dashboard detection
//The full conditionals are spelled out to avoid issues during builds.
//Builds may be looking for require/requireIf statements and processing them.
dojo.requireIf(djConfig["debugAtAllCosts"] && !window.widget && !djConfig["useXDomain"], "dojo.browser_debug");
dojo.requireIf(djConfig["debugAtAllCosts"] && !window.widget && djConfig["useXDomain"], "dojo.browser_debug_xd");
 
dojo.provide("dojo.string.common");
 
dojo.string.trim = function(/* string */str, /* integer? */wh){
// summary
// Trim whitespace from str. If wh > 0, trim from start, if wh < 0, trim from end, else both
if(!str.replace){ return str; }
if(!str.length){ return str; }
var re = (wh > 0) ? (/^\s+/) : (wh < 0) ? (/\s+$/) : (/^\s+|\s+$/g);
return str.replace(re, ""); // string
}
 
dojo.string.trimStart = function(/* string */str) {
// summary
// Trim whitespace at the beginning of 'str'
return dojo.string.trim(str, 1); // string
}
 
dojo.string.trimEnd = function(/* string */str) {
// summary
// Trim whitespace at the end of 'str'
return dojo.string.trim(str, -1);
}
 
dojo.string.repeat = function(/* string */str, /* integer */count, /* string? */separator) {
// summary
// Return 'str' repeated 'count' times, optionally placing 'separator' between each rep
var out = "";
for(var i = 0; i < count; i++) {
out += str;
if(separator && i < count - 1) {
out += separator;
}
}
return out; // string
}
 
dojo.string.pad = function(/* string */str, /* integer */len/*=2*/, /* string */ c/*='0'*/, /* integer */dir/*=1*/) {
// summary
// Pad 'str' to guarantee that it is at least 'len' length with the character 'c' at either the
// start (dir=1) or end (dir=-1) of the string
var out = String(str);
if(!c) {
c = '0';
}
if(!dir) {
dir = 1;
}
while(out.length < len) {
if(dir > 0) {
out = c + out;
} else {
out += c;
}
}
return out; // string
}
 
dojo.string.padLeft = function(/* string */str, /* integer */len, /* string */c) {
// summary
// same as dojo.string.pad(str, len, c, 1)
return dojo.string.pad(str, len, c, 1); // string
}
 
dojo.string.padRight = function(/* string */str, /* integer */len, /* string */c) {
// summary
// same as dojo.string.pad(str, len, c, -1)
return dojo.string.pad(str, len, c, -1); // string
}
 
dojo.provide("dojo.string");
 
 
dojo.provide("dojo.lang.common");
 
dojo.lang.inherits = function(/*Function*/subclass, /*Function*/superclass){
// summary: Set up inheritance between two classes.
if(!dojo.lang.isFunction(superclass)){
dojo.raise("dojo.inherits: superclass argument ["+superclass+"] must be a function (subclass: ["+subclass+"']");
}
subclass.prototype = new superclass();
subclass.prototype.constructor = subclass;
subclass.superclass = superclass.prototype;
// DEPRECATED: super is a reserved word, use 'superclass'
subclass['super'] = superclass.prototype;
}
 
dojo.lang._mixin = function(/*Object*/ obj, /*Object*/ props){
// summary:
// Adds all properties and methods of props to obj. This addition is
// "prototype extension safe", so that instances of objects will not
// pass along prototype defaults.
var tobj = {};
for(var x in props){
// the "tobj" condition avoid copying properties in "props"
// inherited from Object.prototype. For example, if obj has a custom
// toString() method, don't overwrite it with the toString() method
// that props inherited from Object.protoype
if((typeof tobj[x] == "undefined") || (tobj[x] != props[x])){
obj[x] = props[x];
}
}
// IE doesn't recognize custom toStrings in for..in
if(dojo.render.html.ie
&& (typeof(props["toString"]) == "function")
&& (props["toString"] != obj["toString"])
&& (props["toString"] != tobj["toString"]))
{
obj.toString = props.toString;
}
return obj; // Object
}
 
dojo.lang.mixin = function(/*Object*/obj, /*Object...*/props){
// summary: Adds all properties and methods of props to obj.
for(var i=1, l=arguments.length; i<l; i++){
dojo.lang._mixin(obj, arguments[i]);
}
return obj; // Object
}
 
dojo.lang.extend = function(/*Object*/ constructor, /*Object...*/ props){
// summary:
// Adds all properties and methods of props to constructor's
// prototype, making them available to all instances created with
// constructor.
for(var i=1, l=arguments.length; i<l; i++){
dojo.lang._mixin(constructor.prototype, arguments[i]);
}
return constructor; // Object
}
 
// Promote to dojo module
dojo.inherits = dojo.lang.inherits;
//dojo.lang._mixin = dojo.lang._mixin;
dojo.mixin = dojo.lang.mixin;
dojo.extend = dojo.lang.extend;
 
dojo.lang.find = function( /*Array*/ array,
/*Object*/ value,
/*Boolean?*/ identity,
/*Boolean?*/ findLast){
// summary:
// Return the index of value in array, returning -1 if not found.
// array: just what you think
// value: the value to locate
// identity:
// If true, matches with identity comparison (===). If false, uses
// normal comparison (==).
// findLast:
// If true, returns index of last instance of value.
// examples:
// find(array, value[, identity [findLast]]) // recommended
// find(value, array[, identity [findLast]]) // deprecated
// support both (array, value) and (value, array)
if(!dojo.lang.isArrayLike(array) && dojo.lang.isArrayLike(value)) {
dojo.deprecated('dojo.lang.find(value, array)', 'use dojo.lang.find(array, value) instead', "0.5");
var temp = array;
array = value;
value = temp;
}
var isString = dojo.lang.isString(array);
if(isString) { array = array.split(""); }
 
if(findLast) {
var step = -1;
var i = array.length - 1;
var end = -1;
} else {
var step = 1;
var i = 0;
var end = array.length;
}
if(identity){
while(i != end) {
if(array[i] === value){ return i; }
i += step;
}
}else{
while(i != end) {
if(array[i] == value){ return i; }
i += step;
}
}
return -1; // number
}
 
dojo.lang.indexOf = dojo.lang.find;
 
dojo.lang.findLast = function(/*Array*/array, /*Object*/value, /*boolean?*/identity){
// summary:
// Return index of last occurance of value in array, returning -1 if
// not found. This is a shortcut for dojo.lang.find() with a true
// value for its "findLast" parameter.
// identity:
// If true, matches with identity comparison (===). If false, uses
// normal comparison (==).
return dojo.lang.find(array, value, identity, true); // number
}
 
dojo.lang.lastIndexOf = dojo.lang.findLast;
 
dojo.lang.inArray = function(array /*Array*/, value /*Object*/){
// summary: Return true if value is present in array.
return dojo.lang.find(array, value) > -1; // boolean
}
 
/**
* Partial implmentation of is* functions from
* http://www.crockford.com/javascript/recommend.html
* NOTE: some of these may not be the best thing to use in all situations
* as they aren't part of core JS and therefore can't work in every case.
* See WARNING messages inline for tips.
*
* The following is* functions are fairly "safe"
*/
 
dojo.lang.isObject = function(/*anything*/ it){
// summary: Return true if it is an Object, Array or Function.
if(typeof it == "undefined"){ return false; }
return (typeof it == "object" || it === null || dojo.lang.isArray(it) || dojo.lang.isFunction(it)); // Boolean
}
 
dojo.lang.isArray = function(/*anything*/ it){
// summary: Return true if it is an Array.
return (it && it instanceof Array || typeof it == "array"); // Boolean
}
 
dojo.lang.isArrayLike = function(/*anything*/ it){
// summary:
// Return true if it can be used as an array (i.e. is an object with
// an integer length property).
if((!it)||(dojo.lang.isUndefined(it))){ return false; }
if(dojo.lang.isString(it)){ return false; }
if(dojo.lang.isFunction(it)){ return false; } // keeps out built-in constructors (Number, String, ...) which have length properties
if(dojo.lang.isArray(it)){ return true; }
// form node itself is ArrayLike, but not always iterable. Use form.elements instead.
if((it.tagName)&&(it.tagName.toLowerCase()=='form')){ return false; }
if(dojo.lang.isNumber(it.length) && isFinite(it.length)){ return true; }
return false; // Boolean
}
 
dojo.lang.isFunction = function(/*anything*/ it){
// summary: Return true if it is a Function.
return (it instanceof Function || typeof it == "function"); // Boolean
};
 
(function(){
// webkit treats NodeList as a function, which is bad
if((dojo.render.html.capable)&&(dojo.render.html["safari"])){
dojo.lang.isFunction = function(/*anything*/ it){
if((typeof(it) == "function") && (it == "[object NodeList]")) { return false; }
return (it instanceof Function || typeof it == "function"); // Boolean
}
}
})();
 
dojo.lang.isString = function(/*anything*/ it){
// summary: Return true if it is a String.
return (typeof it == "string" || it instanceof String);
}
 
dojo.lang.isAlien = function(/*anything*/ it){
// summary: Return true if it is not a built-in function. False if not.
if(!it){ return false; }
return !dojo.lang.isFunction(it) && /\{\s*\[native code\]\s*\}/.test(String(it)); // Boolean
}
 
dojo.lang.isBoolean = function(/*anything*/ it){
// summary: Return true if it is a Boolean.
return (it instanceof Boolean || typeof it == "boolean"); // Boolean
}
 
/**
* The following is***() functions are somewhat "unsafe". Fortunately,
* there are workarounds the the language provides and are mentioned
* in the WARNING messages.
*
*/
dojo.lang.isNumber = function(/*anything*/ it){
// summary: Return true if it is a number.
// description:
// WARNING - In most cases, isNaN(it) is sufficient to determine whether or not
// something is a number or can be used as such. For example, a number or string
// can be used interchangably when accessing array items (array["1"] is the same as
// array[1]) and isNaN will return false for both values ("1" and 1). However,
// isNumber("1") will return false, which is generally not too useful.
// Also, isNumber(NaN) returns true, again, this isn't generally useful, but there
// are corner cases (like when you want to make sure that two things are really
// the same type of thing). That is really where isNumber "shines".
//
// Recommendation - Use isNaN(it) when possible
return (it instanceof Number || typeof it == "number"); // Boolean
}
 
/*
* FIXME: Should isUndefined go away since it is error prone?
*/
dojo.lang.isUndefined = function(/*anything*/ it){
// summary: Return true if it is not defined.
// description:
// WARNING - In some cases, isUndefined will not behave as you
// might expect. If you do isUndefined(foo) and there is no earlier
// reference to foo, an error will be thrown before isUndefined is
// called. It behaves correctly if you scope yor object first, i.e.
// isUndefined(foo.bar) where foo is an object and bar isn't a
// property of the object.
//
// Recommendation - Use typeof foo == "undefined" when possible
 
return ((typeof(it) == "undefined")&&(it == undefined)); // Boolean
}
 
// end Crockford functions
 
dojo.provide("dojo.lang.extras");
 
 
 
dojo.lang.setTimeout = function(/*Function*/func, /*int*/delay /*, ...*/){
// summary:
// Sets a timeout in milliseconds to execute a function in a given
// context with optional arguments.
// usage:
// dojo.lang.setTimeout(Object context, function func, number delay[, arg1[, ...]]);
// dojo.lang.setTimeout(function func, number delay[, arg1[, ...]]);
 
var context = window, argsStart = 2;
if(!dojo.lang.isFunction(func)){
context = func;
func = delay;
delay = arguments[2];
argsStart++;
}
 
if(dojo.lang.isString(func)){
func = context[func];
}
var args = [];
for (var i = argsStart; i < arguments.length; i++){
args.push(arguments[i]);
}
return dojo.global().setTimeout(function(){ func.apply(context, args); }, delay); // int
}
 
dojo.lang.clearTimeout = function(/*int*/timer){
// summary: clears timer by number from the execution queue
 
// FIXME:
// why do we have this function? It's not portable outside of browser
// environments and it's a stupid wrapper on something that browsers
// provide anyway.
dojo.global().clearTimeout(timer);
}
 
dojo.lang.getNameInObj = function(/*Object*/ns, /*unknown*/item){
// summary:
// looks for a value in the object ns with a value matching item and
// returns the property name
// ns: if null, dj_global is used
// item: value to return a name for
if(!ns){ ns = dj_global; }
 
for(var x in ns){
if(ns[x] === item){
return new String(x); // String
}
}
return null; // null
}
 
dojo.lang.shallowCopy = function(/*Object*/obj, /*Boolean?*/deep){
// summary:
// copies object obj one level deep, or full depth if deep is true
var i, ret;
 
if(obj === null){ /*obj: null*/ return null; } // null
if(dojo.lang.isObject(obj)){
// obj: Object
ret = new obj.constructor();
for(i in obj){
if(dojo.lang.isUndefined(ret[i])){
ret[i] = deep ? dojo.lang.shallowCopy(obj[i], deep) : obj[i];
}
}
}else if(dojo.lang.isArray(obj)){
// obj: Array
ret = [];
for(i=0; i<obj.length; i++){
ret[i] = deep ? dojo.lang.shallowCopy(obj[i], deep) : obj[i];
}
}else{
// obj: Object
ret = obj;
}
 
return ret; // Object
}
 
dojo.lang.firstValued = function(/* ... */){
// summary: Return the first argument that isn't undefined
 
for(var i = 0; i < arguments.length; i++){
if(typeof arguments[i] != "undefined"){
return arguments[i]; // Object
}
}
return undefined; // undefined
}
 
dojo.lang.getObjPathValue = function(/*String*/objpath, /*Object?*/context, /*Boolean?*/create){
// summary:
// Gets a value from a reference specified as a string descriptor,
// (e.g. "A.B") in the given context.
// context: if not specified, dj_global is used
// create: if true, undefined objects in the path are created.
with(dojo.parseObjPath(objpath, context, create)){
return dojo.evalProp(prop, obj, create); // Object
}
}
 
dojo.lang.setObjPathValue = function(/*String*/objpath, /*anything*/value, /*Object?*/context, /*Boolean?*/create){
// summary:
// Sets a value on a reference specified as a string descriptor.
// (e.g. "A.B") in the given context. This is similar to straight
// assignment, except that the object structure in question can
// optionally be created if it does not exist.
// context: if not specified, dj_global is used
// create: if true, undefined objects in the path are created.
 
// FIXME: why is this function valuable? It should be scheduled for
// removal on the grounds that dojo.parseObjPath does most of it's work and
// is more straightforward and has fewer dependencies. Also, the order of
// arguments is bone-headed. "context" should clearly come after "create".
// *sigh*
dojo.deprecated("dojo.lang.setObjPathValue", "use dojo.parseObjPath and the '=' operator", "0.6");
 
if(arguments.length < 4){
create = true;
}
with(dojo.parseObjPath(objpath, context, create)){
if(obj && (create || (prop in obj))){
obj[prop] = value;
}
}
}
 
dojo.provide("dojo.io.common");
 
 
 
/******************************************************************************
* Notes about dojo.io design:
*
* The dojo.io.* package has the unenviable task of making a lot of different
* types of I/O feel natural, despite a universal lack of good (or even
* reasonable!) I/O capability in the host environment. So lets pin this down
* a little bit further.
*
* Rhino:
* perhaps the best situation anywhere. Access to Java classes allows you
* to do anything one might want in terms of I/O, both synchronously and
* async. Can open TCP sockets and perform low-latency client/server
* interactions. HTTP transport is available through Java HTTP client and
* server classes. Wish it were always this easy.
*
* xpcshell:
* XPCOM for I/O.
*
* spidermonkey:
* S.O.L.
*
* Browsers:
* Browsers generally do not provide any useable filesystem access. We are
* therefore limited to HTTP for moving information to and from Dojo
* instances living in a browser.
*
* XMLHTTP:
* Sync or async, allows reading of arbitrary text files (including
* JS, which can then be eval()'d), writing requires server
* cooperation and is limited to HTTP mechanisms (POST and GET).
*
* <iframe> hacks:
* iframe document hacks allow browsers to communicate asynchronously
* with a server via HTTP POST and GET operations. With significant
* effort and server cooperation, low-latency data transit between
* client and server can be acheived via iframe mechanisms (repubsub).
*
* SVG:
* Adobe's SVG viewer implements helpful primitives for XML-based
* requests, but receipt of arbitrary text data seems unlikely w/o
* <![CDATA[]]> sections.
*
*
* A discussion between Dylan, Mark, Tom, and Alex helped to lay down a lot
* the IO API interface. A transcript of it can be found at:
* http://dojotoolkit.org/viewcvs/viewcvs.py/documents/irc/irc_io_api_log.txt?rev=307&view=auto
*
* Also referenced in the design of the API was the DOM 3 L&S spec:
* http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-save.html
******************************************************************************/
 
// a map of the available transport options. Transports should add themselves
// by calling add(name)
dojo.io.transports = [];
dojo.io.hdlrFuncNames = [ "load", "error", "timeout" ]; // we're omitting a progress() event for now
 
dojo.io.Request = function(/*String*/ url, /*String*/ mimetype, /*String*/ transport, /*String or Boolean*/ changeUrl){
// summary:
// Constructs a Request object that is used by dojo.io.bind().
// description:
// dojo.io.bind() will create one of these for you if
// you call dojo.io.bind() with an plain object containing the bind parameters.
// This method can either take the arguments specified, or an Object containing all of the parameters that you
// want to use to create the dojo.io.Request (similar to how dojo.io.bind() is called.
// The named parameters to this constructor represent the minimum set of parameters need
if((arguments.length == 1)&&(arguments[0].constructor == Object)){
this.fromKwArgs(arguments[0]);
}else{
this.url = url;
if(mimetype){ this.mimetype = mimetype; }
if(transport){ this.transport = transport; }
if(arguments.length >= 4){ this.changeUrl = changeUrl; }
}
}
 
dojo.lang.extend(dojo.io.Request, {
 
/** The URL to hit */
url: "",
/** The mime type used to interrpret the response body */
mimetype: "text/plain",
/** The HTTP method to use */
method: "GET",
/** An Object containing key-value pairs to be included with the request */
content: undefined, // Object
/** The transport medium to use */
transport: undefined, // String
/** If defined the URL of the page is physically changed */
changeUrl: undefined, // String
/** A form node to use in the request */
formNode: undefined, // HTMLFormElement
/** Whether the request should be made synchronously */
sync: false,
bindSuccess: false,
 
/** Cache/look for the request in the cache before attempting to request?
* NOTE: this isn't a browser cache, this is internal and would only cache in-page
*/
useCache: false,
 
/** Prevent the browser from caching this by adding a query string argument to the URL */
preventCache: false,
// events stuff
load: function(/*String*/type, /*Object*/data, /*Object*/transportImplementation, /*Object*/kwArgs){
// summary:
// Called on successful completion of a bind.
// type: String
// A string with value "load"
// data: Object
// The object representing the result of the bind. The actual structure
// of the data object will depend on the mimetype that was given to bind
// in the bind arguments.
// transportImplementation: Object
// The object that implements a particular transport. Structure is depedent
// on the transport. For XMLHTTPTransport (dojo.io.BrowserIO), it will be the
// XMLHttpRequest object from the browser.
// kwArgs: Object
// Object that contains the request parameters that were given to the
// bind call. Useful for storing and retrieving state from when bind
// was called.
},
error: function(/*String*/type, /*Object*/error, /*Object*/transportImplementation, /*Object*/kwArgs){
// summary:
// Called when there is an error with a bind.
// type: String
// A string with value "error"
// error: Object
// The error object. Should be a dojo.io.Error object, but not guaranteed.
// transportImplementation: Object
// The object that implements a particular transport. Structure is depedent
// on the transport. For XMLHTTPTransport (dojo.io.BrowserIO), it will be the
// XMLHttpRequest object from the browser.
// kwArgs: Object
// Object that contains the request parameters that were given to the
// bind call. Useful for storing and retrieving state from when bind
// was called.
},
timeout: function(/*String*/type, /*Object*/empty, /*Object*/transportImplementation, /*Object*/kwArgs){
// summary:
// Called when there is an error with a bind. Only implemented in certain transports at this time.
// type: String
// A string with value "timeout"
// empty: Object
// Should be null. Just a spacer argument so that load, error, timeout and handle have the
// same signatures.
// transportImplementation: Object
// The object that implements a particular transport. Structure is depedent
// on the transport. For XMLHTTPTransport (dojo.io.BrowserIO), it will be the
// XMLHttpRequest object from the browser. May be null for the timeout case for
// some transports.
// kwArgs: Object
// Object that contains the request parameters that were given to the
// bind call. Useful for storing and retrieving state from when bind
// was called.
},
handle: function(/*String*/type, /*Object*/data, /*Object*/transportImplementation, /*Object*/kwArgs){
// summary:
// The handle method can be defined instead of defining separate load, error and timeout
// callbacks.
// type: String
// A string with the type of callback: "load", "error", or "timeout".
// data: Object
// See the above callbacks for what this parameter could be.
// transportImplementation: Object
// The object that implements a particular transport. Structure is depedent
// on the transport. For XMLHTTPTransport (dojo.io.BrowserIO), it will be the
// XMLHttpRequest object from the browser.
// kwArgs: Object
// Object that contains the request parameters that were given to the
// bind call. Useful for storing and retrieving state from when bind
// was called.
},
 
//FIXME: change IframeIO.js to use timeouts?
// The number of seconds to wait until firing a timeout callback.
// If it is zero, that means, don't do a timeout check.
timeoutSeconds: 0,
// the abort method needs to be filled in by the transport that accepts the
// bind() request
abort: function(){ },
// backButton: function(){ },
// forwardButton: function(){ },
 
fromKwArgs: function(/*Object*/ kwArgs){
// summary:
// Creates a dojo.io.Request from a simple object (kwArgs object).
 
// normalize args
if(kwArgs["url"]){ kwArgs.url = kwArgs.url.toString(); }
if(kwArgs["formNode"]) { kwArgs.formNode = dojo.byId(kwArgs.formNode); }
if(!kwArgs["method"] && kwArgs["formNode"] && kwArgs["formNode"].method) {
kwArgs.method = kwArgs["formNode"].method;
}
// backwards compatibility
if(!kwArgs["handle"] && kwArgs["handler"]){ kwArgs.handle = kwArgs.handler; }
if(!kwArgs["load"] && kwArgs["loaded"]){ kwArgs.load = kwArgs.loaded; }
if(!kwArgs["changeUrl"] && kwArgs["changeURL"]) { kwArgs.changeUrl = kwArgs.changeURL; }
 
// encoding fun!
kwArgs.encoding = dojo.lang.firstValued(kwArgs["encoding"], djConfig["bindEncoding"], "");
 
kwArgs.sendTransport = dojo.lang.firstValued(kwArgs["sendTransport"], djConfig["ioSendTransport"], false);
 
var isFunction = dojo.lang.isFunction;
for(var x=0; x<dojo.io.hdlrFuncNames.length; x++){
var fn = dojo.io.hdlrFuncNames[x];
if(kwArgs[fn] && isFunction(kwArgs[fn])){ continue; }
if(kwArgs["handle"] && isFunction(kwArgs["handle"])){
kwArgs[fn] = kwArgs.handle;
}
// handler is aliased above, shouldn't need this check
/* else if(dojo.lang.isObject(kwArgs.handler)){
if(isFunction(kwArgs.handler[fn])){
kwArgs[fn] = kwArgs.handler[fn]||kwArgs.handler["handle"]||function(){};
}
}*/
}
dojo.lang.mixin(this, kwArgs);
}
 
});
 
dojo.io.Error = function(/*String*/ msg, /*String*/ type, /*Number*/num){
// summary:
// Constructs an object representing a bind error.
this.message = msg;
this.type = type || "unknown"; // must be one of "io", "parse", "unknown"
this.number = num || 0; // per-substrate error number, not normalized
}
 
dojo.io.transports.addTransport = function(/*String*/name){
// summary:
// Used to register transports that can support bind calls.
this.push(name);
// FIXME: do we need to handle things that aren't direct children of the
// dojo.io module? (say, dojo.io.foo.fooTransport?)
this[name] = dojo.io[name];
}
 
// binding interface, the various implementations register their capabilities
// and the bind() method dispatches
dojo.io.bind = function(/*dojo.io.Request or Object*/request){
// summary:
// Binding interface for IO. Loading different IO transports, like
// dojo.io.BrowserIO or dojo.io.IframeIO, will register with bind
// to handle particular types of bind calls.
// request: Object
// Object containing bind arguments. This object is converted to
// a dojo.io.Request object, and that request object is the return
// value for this method.
if(!(request instanceof dojo.io.Request)){
try{
request = new dojo.io.Request(request);
}catch(e){ dojo.debug(e); }
}
 
// if the request asks for a particular implementation, use it
var tsName = "";
if(request["transport"]){
tsName = request["transport"];
if(!this[tsName]){
dojo.io.sendBindError(request, "No dojo.io.bind() transport with name '"
+ request["transport"] + "'.");
return request; //dojo.io.Request
}
if(!this[tsName].canHandle(request)){
dojo.io.sendBindError(request, "dojo.io.bind() transport with name '"
+ request["transport"] + "' cannot handle this type of request.");
return request; //dojo.io.Request
}
}else{
// otherwise we do our best to auto-detect what available transports
// will handle
for(var x=0; x<dojo.io.transports.length; x++){
var tmp = dojo.io.transports[x];
if((this[tmp])&&(this[tmp].canHandle(request))){
tsName = tmp;
break;
}
}
if(tsName == ""){
dojo.io.sendBindError(request, "None of the loaded transports for dojo.io.bind()"
+ " can handle the request.");
return request; //dojo.io.Request
}
}
this[tsName].bind(request);
request.bindSuccess = true;
return request; //dojo.io.Request
}
 
dojo.io.sendBindError = function(/* Object */request, /* String */message){
// summary:
// Used internally by dojo.io.bind() to return/raise a bind error.
 
//Need to be careful since not all hostenvs support setTimeout.
if((typeof request.error == "function" || typeof request.handle == "function")
&& (typeof setTimeout == "function" || typeof setTimeout == "object")){
var errorObject = new dojo.io.Error(message);
setTimeout(function(){
request[(typeof request.error == "function") ? "error" : "handle"]("error", errorObject, null, request);
}, 50);
}else{
dojo.raise(message);
}
}
 
dojo.io.queueBind = function(/*dojo.io.Request or Object*/request){
// summary:
// queueBind will use dojo.io.bind() but guarantee that only one bind
// call is handled at a time.
// description:
// If queueBind is called while a bind call
// is in process, it will queue up the other calls to bind and call them
// in order as bind calls complete.
// request: Object
// Same sort of request object as used for dojo.io.bind().
if(!(request instanceof dojo.io.Request)){
try{
request = new dojo.io.Request(request);
}catch(e){ dojo.debug(e); }
}
 
// make sure we get called if/when we get a response
var oldLoad = request.load;
request.load = function(){
dojo.io._queueBindInFlight = false;
var ret = oldLoad.apply(this, arguments);
dojo.io._dispatchNextQueueBind();
return ret;
}
 
var oldErr = request.error;
request.error = function(){
dojo.io._queueBindInFlight = false;
var ret = oldErr.apply(this, arguments);
dojo.io._dispatchNextQueueBind();
return ret;
}
 
dojo.io._bindQueue.push(request);
dojo.io._dispatchNextQueueBind();
return request; //dojo.io.Request
}
 
dojo.io._dispatchNextQueueBind = function(){
// summary:
// Private method used by dojo.io.queueBind().
if(!dojo.io._queueBindInFlight){
dojo.io._queueBindInFlight = true;
if(dojo.io._bindQueue.length > 0){
dojo.io.bind(dojo.io._bindQueue.shift());
}else{
dojo.io._queueBindInFlight = false;
}
}
}
dojo.io._bindQueue = [];
dojo.io._queueBindInFlight = false;
 
dojo.io.argsFromMap = function(/*Object*/map, /*String?*/encoding, /*String?*/last){
// summary:
// Converts name/values pairs in the map object to an URL-encoded string
// with format of name1=value1&name2=value2...
// map: Object
// Object that has the contains the names and values.
// encoding: String?
// String to specify how to encode the name and value. If the encoding string
// contains "utf" (case-insensitive), then encodeURIComponent is used. Otherwise
// dojo.string.encodeAscii is used.
// last: String?
// The last parameter in the list. Helps with final string formatting?
var enc = /utf/i.test(encoding||"") ? encodeURIComponent : dojo.string.encodeAscii;
var mapped = [];
var control = new Object();
for(var name in map){
var domap = function(elt){
var val = enc(name)+"="+enc(elt);
mapped[(last == name) ? "push" : "unshift"](val);
}
if(!control[name]){
var value = map[name];
// FIXME: should be isArrayLike?
if (dojo.lang.isArray(value)){
dojo.lang.forEach(value, domap);
}else{
domap(value);
}
}
}
return mapped.join("&"); //String
}
 
dojo.io.setIFrameSrc = function(/*DOMNode*/ iframe, /*String*/ src, /*Boolean*/ replace){
//summary:
// Sets the URL that is loaded in an IFrame. The replace parameter indicates whether
// location.replace() should be used when changing the location of the iframe.
try{
var r = dojo.render.html;
// dojo.debug(iframe);
if(!replace){
if(r.safari){
iframe.location = src;
}else{
frames[iframe.name].location = src;
}
}else{
// Fun with DOM 0 incompatibilities!
var idoc;
if(r.ie){
idoc = iframe.contentWindow.document;
}else if(r.safari){
idoc = iframe.document;
}else{ // if(r.moz){
idoc = iframe.contentWindow;
}
 
//For Safari (at least 2.0.3) and Opera, if the iframe
//has just been created but it doesn't have content
//yet, then iframe.document may be null. In that case,
//use iframe.location and return.
if(!idoc){
iframe.location = src;
return;
}else{
idoc.location.replace(src);
}
}
}catch(e){
dojo.debug(e);
dojo.debug("setIFrameSrc: "+e);
}
}
 
/*
dojo.io.sampleTranport = new function(){
this.canHandle = function(kwArgs){
// canHandle just tells dojo.io.bind() if this is a good transport to
// use for the particular type of request.
if(
(
(kwArgs["mimetype"] == "text/plain") ||
(kwArgs["mimetype"] == "text/html") ||
(kwArgs["mimetype"] == "text/javascript")
)&&(
(kwArgs["method"] == "get") ||
( (kwArgs["method"] == "post") && (!kwArgs["formNode"]) )
)
){
return true;
}
 
return false;
}
 
this.bind = function(kwArgs){
var hdlrObj = {};
 
// set up a handler object
for(var x=0; x<dojo.io.hdlrFuncNames.length; x++){
var fn = dojo.io.hdlrFuncNames[x];
if(typeof kwArgs.handler == "object"){
if(typeof kwArgs.handler[fn] == "function"){
hdlrObj[fn] = kwArgs.handler[fn]||kwArgs.handler["handle"];
}
}else if(typeof kwArgs[fn] == "function"){
hdlrObj[fn] = kwArgs[fn];
}else{
hdlrObj[fn] = kwArgs["handle"]||function(){};
}
}
 
// build a handler function that calls back to the handler obj
var hdlrFunc = function(evt){
if(evt.type == "onload"){
hdlrObj.load("load", evt.data, evt);
}else if(evt.type == "onerr"){
var errObj = new dojo.io.Error("sampleTransport Error: "+evt.msg);
hdlrObj.error("error", errObj);
}
}
 
// the sample transport would attach the hdlrFunc() when sending the
// request down the pipe at this point
var tgtURL = kwArgs.url+"?"+dojo.io.argsFromMap(kwArgs.content);
// sampleTransport.sendRequest(tgtURL, hdlrFunc);
}
 
dojo.io.transports.addTransport("sampleTranport");
}
*/
 
dojo.provide("dojo.lang.array");
 
 
 
// FIXME: Is this worthless since you can do: if(name in obj)
// is this the right place for this?
 
dojo.lang.mixin(dojo.lang, {
has: function(/*Object*/obj, /*String*/name){
// summary: is there a property with the passed name in obj?
try{
return typeof obj[name] != "undefined"; // Boolean
}catch(e){ return false; } // Boolean
},
 
isEmpty: function(/*Object*/obj){
// summary:
// can be used to determine if the passed object is "empty". In
// the case of array-like objects, the length, property is
// examined, but for other types of objects iteration is used to
// examine the iterable "surface area" to determine if any
// non-prototypal properties have been assigned. This iteration is
// prototype-extension safe.
if(dojo.lang.isObject(obj)){
var tmp = {};
var count = 0;
for(var x in obj){
if(obj[x] && (!tmp[x])){
count++;
break;
}
}
return count == 0; // boolean
}else if(dojo.lang.isArrayLike(obj) || dojo.lang.isString(obj)){
return obj.length == 0; // boolean
}
},
 
map: function(/*Array*/arr, /*Object|Function*/obj, /*Function?*/unary_func){
// summary:
// returns a new array constituded from the return values of
// passing each element of arr into unary_func. The obj parameter
// may be passed to enable the passed function to be called in
// that scope. In environments that support JavaScript 1.6, this
// function is a passthrough to the built-in map() function
// provided by Array instances. For details on this, see:
// http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:map
// examples:
// dojo.lang.map([1, 2, 3, 4], function(item){ return item+1 });
// // returns [2, 3, 4, 5]
var isString = dojo.lang.isString(arr);
if(isString){
// arr: String
arr = arr.split("");
}
if(dojo.lang.isFunction(obj)&&(!unary_func)){
unary_func = obj;
obj = dj_global;
}else if(dojo.lang.isFunction(obj) && unary_func){
// ff 1.5 compat
var tmpObj = obj;
obj = unary_func;
unary_func = tmpObj;
}
if(Array.map){
var outArr = Array.map(arr, unary_func, obj);
}else{
var outArr = [];
for(var i=0;i<arr.length;++i){
outArr.push(unary_func.call(obj, arr[i]));
}
}
if(isString) {
return outArr.join(""); // String
} else {
return outArr; // Array
}
},
 
reduce: function(/*Array*/arr, initialValue, /*Object|Function*/obj, /*Function*/binary_func){
// summary:
// similar to Python's builtin reduce() function. The result of
// the previous computation is passed as the first argument to
// binary_func along with the next value from arr. The result of
// this call is used along with the subsequent value from arr, and
// this continues until arr is exhausted. The return value is the
// last result. The "obj" and "initialValue" parameters may be
// safely omitted and the order of obj and binary_func may be
// reversed. The default order of the obj and binary_func argument
// will probably be reversed in a future release, and this call
// order is supported today.
// examples:
// dojo.lang.reduce([1, 2, 3, 4], function(last, next){ return last+next});
// returns 10
var reducedValue = initialValue;
if(arguments.length == 2){
binary_func = initialValue;
reducedValue = arr[0];
arr = arr.slice(1);
}else if(arguments.length == 3){
if(dojo.lang.isFunction(obj)){
binary_func = obj;
obj = null;
}
}else{
// un-fsck the default order
// FIXME:
// could be wrong for some strange function object cases. Not
// sure how to test for them.
if(dojo.lang.isFunction(obj)){
var tmp = binary_func;
binary_func = obj;
obj = tmp;
}
}
 
var ob = obj || dj_global;
dojo.lang.map(arr,
function(val){
reducedValue = binary_func.call(ob, reducedValue, val);
}
);
return reducedValue;
},
 
forEach: function(/*Array*/anArray, /*Function*/callback, /*Object?*/thisObject){
// summary:
// for every item in anArray, call callback with that item as its
// only parameter. Return values are ignored. This funciton
// corresponds (and wraps) the JavaScript 1.6 forEach method. For
// more details, see:
// http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:forEach
if(dojo.lang.isString(anArray)){
// anArray: String
anArray = anArray.split("");
}
if(Array.forEach){
Array.forEach(anArray, callback, thisObject);
}else{
// FIXME: there are several ways of handilng thisObject. Is dj_global always the default context?
if(!thisObject){
thisObject=dj_global;
}
for(var i=0,l=anArray.length; i<l; i++){
callback.call(thisObject, anArray[i], i, anArray);
}
}
},
 
_everyOrSome: function(/*Boolean*/every, /*Array*/arr, /*Function*/callback, /*Object?*/thisObject){
if(dojo.lang.isString(arr)){
//arr: String
arr = arr.split("");
}
if(Array.every){
return Array[ every ? "every" : "some" ](arr, callback, thisObject);
}else{
if(!thisObject){
thisObject = dj_global;
}
for(var i=0,l=arr.length; i<l; i++){
var result = callback.call(thisObject, arr[i], i, arr);
if(every && !result){
return false; // Boolean
}else if((!every)&&(result)){
return true; // Boolean
}
}
return Boolean(every); // Boolean
}
},
 
every: function(/*Array*/arr, /*Function*/callback, /*Object?*/thisObject){
// summary:
// determines whether or not every item in the array satisfies the
// condition implemented by callback. thisObject may be used to
// scope the call to callback. The function signature is derived
// from the JavaScript 1.6 Array.every() function. More
// information on this can be found here:
// http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:every
// examples:
// dojo.lang.every([1, 2, 3, 4], function(item){ return item>1; });
// // returns false
// dojo.lang.every([1, 2, 3, 4], function(item){ return item>0; });
// // returns true
return this._everyOrSome(true, arr, callback, thisObject); // Boolean
},
 
some: function(/*Array*/arr, /*Function*/callback, /*Object?*/thisObject){
// summary:
// determines whether or not any item in the array satisfies the
// condition implemented by callback. thisObject may be used to
// scope the call to callback. The function signature is derived
// from the JavaScript 1.6 Array.some() function. More
// information on this can be found here:
// http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:some
// examples:
// dojo.lang.some([1, 2, 3, 4], function(item){ return item>1; });
// // returns true
// dojo.lang.some([1, 2, 3, 4], function(item){ return item<1; });
// // returns false
return this._everyOrSome(false, arr, callback, thisObject); // Boolean
},
 
filter: function(/*Array*/arr, /*Function*/callback, /*Object?*/thisObject){
// summary:
// returns a new Array with those items from arr that match the
// condition implemented by callback.thisObject may be used to
// scope the call to callback. The function signature is derived
// from the JavaScript 1.6 Array.filter() function, although
// special accomidation is made in our implementation for strings.
// More information on the JS 1.6 API can be found here:
// http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:filter
// examples:
// dojo.lang.some([1, 2, 3, 4], function(item){ return item>1; });
// // returns [2, 3, 4]
var isString = dojo.lang.isString(arr);
if(isString){ /*arr: String*/arr = arr.split(""); }
var outArr;
if(Array.filter){
outArr = Array.filter(arr, callback, thisObject);
}else{
if(!thisObject){
if(arguments.length >= 3){ dojo.raise("thisObject doesn't exist!"); }
thisObject = dj_global;
}
 
outArr = [];
for(var i = 0; i < arr.length; i++){
if(callback.call(thisObject, arr[i], i, arr)){
outArr.push(arr[i]);
}
}
}
if(isString){
return outArr.join(""); // String
} else {
return outArr; // Array
}
},
 
unnest: function(/* ... */){
// summary:
// Creates a 1-D array out of all the arguments passed,
// unravelling any array-like objects in the process
// usage:
// unnest(1, 2, 3) ==> [1, 2, 3]
// unnest(1, [2, [3], [[[4]]]]) ==> [1, 2, 3, 4]
 
var out = [];
for(var i = 0; i < arguments.length; i++){
if(dojo.lang.isArrayLike(arguments[i])){
var add = dojo.lang.unnest.apply(this, arguments[i]);
out = out.concat(add);
}else{
out.push(arguments[i]);
}
}
return out; // Array
},
 
toArray: function(/*Object*/arrayLike, /*Number*/startOffset){
// summary:
// Converts an array-like object (i.e. arguments, DOMCollection)
// to an array. Returns a new Array object.
var array = [];
for(var i = startOffset||0; i < arrayLike.length; i++){
array.push(arrayLike[i]);
}
return array; // Array
}
});
 
dojo.provide("dojo.lang.func");
 
 
dojo.lang.hitch = function(/*Object*/thisObject, /*Function|String*/method){
// summary:
// Returns a function that will only ever execute in the a given scope
// (thisObject). This allows for easy use of object member functions
// in callbacks and other places in which the "this" keyword may
// otherwise not reference the expected scope. Note that the order of
// arguments may be reversed in a future version.
// thisObject: the scope to run the method in
// method:
// a function to be "bound" to thisObject or the name of the method in
// thisObject to be used as the basis for the binding
// usage:
// dojo.lang.hitch(foo, "bar")(); // runs foo.bar() in the scope of foo
// dojo.lang.hitch(foo, myFunction); // returns a function that runs myFunction in the scope of foo
 
// FIXME:
// should this be extended to "fixate" arguments in a manner similar
// to dojo.lang.curry, but without the default execution of curry()?
var fcn = (dojo.lang.isString(method) ? thisObject[method] : method) || function(){};
return function(){
return fcn.apply(thisObject, arguments); // Function
};
}
 
dojo.lang.anonCtr = 0;
dojo.lang.anon = {};
 
dojo.lang.nameAnonFunc = function(/*Function*/anonFuncPtr, /*Object*/thisObj, /*Boolean*/searchForNames){
// summary:
// Creates a reference to anonFuncPtr in thisObj with a completely
// unique name. The new name is returned as a String. If
// searchForNames is true, an effort will be made to locate an
// existing reference to anonFuncPtr in thisObj, and if one is found,
// the existing name will be returned instead. The default is for
// searchForNames to be false.
var nso = (thisObj|| dojo.lang.anon);
if( (searchForNames) ||
((dj_global["djConfig"])&&(djConfig["slowAnonFuncLookups"] == true)) ){
for(var x in nso){
try{
if(nso[x] === anonFuncPtr){
return x;
}
}catch(e){} // window.external fails in IE embedded in Eclipse (Eclipse bug #151165)
}
}
var ret = "__"+dojo.lang.anonCtr++;
while(typeof nso[ret] != "undefined"){
ret = "__"+dojo.lang.anonCtr++;
}
nso[ret] = anonFuncPtr;
return ret; // String
}
 
dojo.lang.forward = function(funcName){
// summary:
// Returns a function that forwards a method call to
// this.funcName(...). Unlike dojo.lang.hitch(), the "this" scope is
// not fixed on a single object. Ported from MochiKit.
return function(){
return this[funcName].apply(this, arguments);
}; // Function
}
 
dojo.lang.curry = function(thisObj, func /* args ... */){
// summary:
// similar to the curry() method found in many functional programming
// environments, this function returns an "argument accumulator"
// function, bound to a particular scope, and "primed" with a variable
// number of arguments. The curry method is unique in that it returns
// a function that may return other "partial" function which can be
// called repeatedly. New functions are returned until the arity of
// the original function is reached, at which point the underlying
// function (func) is called in the scope thisObj with all of the
// accumulated arguments (plus any extras) in positional order.
// examples:
// assuming a function defined like this:
// var foo = {
// bar: function(arg1, arg2, arg3){
// dojo.debug.apply(dojo, arguments);
// }
// };
//
// dojo.lang.curry() can be used most simply in this way:
//
// tmp = dojo.lang.curry(foo, foo.bar, "arg one", "thinger");
// tmp("blah", "this is superfluous");
// // debugs: "arg one thinger blah this is superfluous"
// tmp("blah");
// // debugs: "arg one thinger blah"
// tmp();
// // returns a function exactly like tmp that expects one argument
//
// other intermittent functions could be created until the 3
// positional arguments are filled:
//
// tmp = dojo.lang.curry(foo, foo.bar, "arg one");
// tmp2 = tmp("arg two");
// tmp2("blah blah");
// // debugs: "arg one arg two blah blah"
// tmp2("oy");
// // debugs: "arg one arg two oy"
//
// curry() can also be used to call the function if enough arguments
// are passed in the initial invocation:
//
// dojo.lang.curry(foo, foo.bar, "one", "two", "three", "four");
// // debugs: "one two three four"
// dojo.lang.curry(foo, foo.bar, "one", "two", "three");
// // debugs: "one two three"
 
 
// FIXME: the order of func and thisObj should be changed!!!
var outerArgs = [];
thisObj = thisObj||dj_global;
if(dojo.lang.isString(func)){
func = thisObj[func];
}
for(var x=2; x<arguments.length; x++){
outerArgs.push(arguments[x]);
}
// since the event system replaces the original function with a new
// join-point runner with an arity of 0, we check to see if it's left us
// any clues about the original arity in lieu of the function's actual
// length property
var ecount = (func["__preJoinArity"]||func.length) - outerArgs.length;
// borrowed from svend tofte
function gather(nextArgs, innerArgs, expected){
var texpected = expected;
var totalArgs = innerArgs.slice(0); // copy
for(var x=0; x<nextArgs.length; x++){
totalArgs.push(nextArgs[x]);
}
// check the list of provided nextArgs to see if it, plus the
// number of innerArgs already supplied, meets the total
// expected.
expected = expected-nextArgs.length;
if(expected<=0){
var res = func.apply(thisObj, totalArgs);
expected = texpected;
return res;
}else{
return function(){
return gather(arguments,// check to see if we've been run
// with enough args
totalArgs, // a copy
expected); // how many more do we need to run?;
};
}
}
return gather([], outerArgs, ecount);
}
 
dojo.lang.curryArguments = function(/*Object*/thisObj, /*Function*/func, /*Array*/args, /*Integer, optional*/offset){
// summary:
// similar to dojo.lang.curry(), except that a list of arguments to
// start the curry with may be provided as an array instead of as
// positional arguments. An offset may be specified from the 0 index
// to skip some elements in args.
var targs = [];
var x = offset||0;
for(x=offset; x<args.length; x++){
targs.push(args[x]); // ensure that it's an arr
}
return dojo.lang.curry.apply(dojo.lang, [thisObj, func].concat(targs));
}
 
dojo.lang.tryThese = function(/*...*/){
// summary:
// executes each function argument in turn, returning the return value
// from the first one which does not throw an exception in execution.
// Any number of functions may be passed.
for(var x=0; x<arguments.length; x++){
try{
if(typeof arguments[x] == "function"){
var ret = (arguments[x]());
if(ret){
return ret;
}
}
}catch(e){
dojo.debug(e);
}
}
}
 
dojo.lang.delayThese = function(/*Array*/farr, /*Function, optional*/cb, /*Integer*/delay, /*Function, optional*/onend){
// summary:
// executes a series of functions contained in farr, but spaces out
// calls to each function by the millisecond delay provided. If cb is
// provided, it will be called directly after each item in farr is
// called and if onend is passed, it will be called when all items
// have completed executing.
 
/**
* alternate: (array funcArray, function callback, function onend)
* alternate: (array funcArray, function callback)
* alternate: (array funcArray)
*/
if(!farr.length){
if(typeof onend == "function"){
onend();
}
return;
}
if((typeof delay == "undefined")&&(typeof cb == "number")){
delay = cb;
cb = function(){};
}else if(!cb){
cb = function(){};
if(!delay){ delay = 0; }
}
setTimeout(function(){
(farr.shift())();
cb();
dojo.lang.delayThese(farr, cb, delay, onend);
}, delay);
}
 
dojo.provide("dojo.string.extras");
 
 
 
 
 
//TODO: should we use ${} substitution syntax instead, like widgets do?
dojo.string.substituteParams = function(/*string*/template, /* object - optional or ... */hash){
// summary:
// Performs parameterized substitutions on a string. Throws an exception if any parameter is unmatched.
//
// description:
// For example,
// dojo.string.substituteParams("File '%{0}' is not found in directory '%{1}'.","foo.html","/temp");
// returns
// "File 'foo.html' is not found in directory '/temp'."
//
// template: the original string template with %{values} to be replaced
// hash: name/value pairs (type object) to provide substitutions. Alternatively, substitutions may be
// included as arguments 1..n to this function, corresponding to template parameters 0..n-1
 
var map = (typeof hash == 'object') ? hash : dojo.lang.toArray(arguments, 1);
 
return template.replace(/\%\{(\w+)\}/g, function(match, key){
if(typeof(map[key]) != "undefined" && map[key] != null){
return map[key];
}
dojo.raise("Substitution not found: " + key);
}); // string
};
 
dojo.string.capitalize = function(/*string*/str){
// summary:
// Uppercases the first letter of each word
 
if(!dojo.lang.isString(str)){ return ""; }
if(arguments.length == 0){ str = this; }
 
var words = str.split(' ');
for(var i=0; i<words.length; i++){
words[i] = words[i].charAt(0).toUpperCase() + words[i].substring(1);
}
return words.join(" "); // string
}
 
dojo.string.isBlank = function(/*string*/str){
// summary:
// Return true if the entire string is whitespace characters
 
if(!dojo.lang.isString(str)){ return true; }
return (dojo.string.trim(str).length == 0); // boolean
}
 
//FIXME: not sure exactly what encodeAscii is trying to do, or if it's working right
dojo.string.encodeAscii = function(/*string*/str){
if(!dojo.lang.isString(str)){ return str; } // unknown
var ret = "";
var value = escape(str);
var match, re = /%u([0-9A-F]{4})/i;
while((match = value.match(re))){
var num = Number("0x"+match[1]);
var newVal = escape("&#" + num + ";");
ret += value.substring(0, match.index) + newVal;
value = value.substring(match.index+match[0].length);
}
ret += value.replace(/\+/g, "%2B");
return ret; // string
}
 
dojo.string.escape = function(/*string*/type, /*string*/str){
// summary:
// Adds escape sequences for special characters according to the convention of 'type'
//
// type: one of xml|html|xhtml|sql|regexp|regex|javascript|jscript|js|ascii
// str: the string to be escaped
 
var args = dojo.lang.toArray(arguments, 1);
switch(type.toLowerCase()){
case "xml":
case "html":
case "xhtml":
return dojo.string.escapeXml.apply(this, args); // string
case "sql":
return dojo.string.escapeSql.apply(this, args); // string
case "regexp":
case "regex":
return dojo.string.escapeRegExp.apply(this, args); // string
case "javascript":
case "jscript":
case "js":
return dojo.string.escapeJavaScript.apply(this, args); // string
case "ascii":
// so it's encode, but it seems useful
return dojo.string.encodeAscii.apply(this, args); // string
default:
return str; // string
}
}
 
dojo.string.escapeXml = function(/*string*/str, /*boolean*/noSingleQuotes){
//summary:
// Adds escape sequences for special characters in XML: &<>"'
// Optionally skips escapes for single quotes
 
str = str.replace(/&/gm, "&amp;").replace(/</gm, "&lt;")
.replace(/>/gm, "&gt;").replace(/"/gm, "&quot;");
if(!noSingleQuotes){ str = str.replace(/'/gm, "&#39;"); }
return str; // string
}
 
dojo.string.escapeSql = function(/*string*/str){
//summary:
// Adds escape sequences for single quotes in SQL expressions
 
return str.replace(/'/gm, "''"); //string
}
 
dojo.string.escapeRegExp = function(/*string*/str){
//summary:
// Adds escape sequences for special characters in regular expressions
 
return str.replace(/\\/gm, "\\\\").replace(/([\f\b\n\t\r[\^$|?*+(){}])/gm, "\\$1"); // string
}
 
//FIXME: should this one also escape backslash?
dojo.string.escapeJavaScript = function(/*string*/str){
//summary:
// Adds escape sequences for single and double quotes as well
// as non-visible characters in JavaScript string literal expressions
 
return str.replace(/(["'\f\b\n\t\r])/gm, "\\$1"); // string
}
 
//FIXME: looks a lot like escapeJavaScript, just adds quotes? deprecate one?
dojo.string.escapeString = function(/*string*/str){
//summary:
// Adds escape sequences for non-visual characters, double quote and backslash
// and surrounds with double quotes to form a valid string literal.
return ('"' + str.replace(/(["\\])/g, '\\$1') + '"'
).replace(/[\f]/g, "\\f"
).replace(/[\b]/g, "\\b"
).replace(/[\n]/g, "\\n"
).replace(/[\t]/g, "\\t"
).replace(/[\r]/g, "\\r"); // string
}
 
// TODO: make an HTML version
dojo.string.summary = function(/*string*/str, /*number*/len){
// summary:
// Truncates 'str' after 'len' characters and appends periods as necessary so that it ends with "..."
 
if(!len || str.length <= len){
return str; // string
}
 
return str.substring(0, len).replace(/\.+$/, "") + "..."; // string
}
 
dojo.string.endsWith = function(/*string*/str, /*string*/end, /*boolean*/ignoreCase){
// summary:
// Returns true if 'str' ends with 'end'
 
if(ignoreCase){
str = str.toLowerCase();
end = end.toLowerCase();
}
if((str.length - end.length) < 0){
return false; // boolean
}
return str.lastIndexOf(end) == str.length - end.length; // boolean
}
 
dojo.string.endsWithAny = function(/*string*/str /* , ... */){
// summary:
// Returns true if 'str' ends with any of the arguments[2 -> n]
 
for(var i = 1; i < arguments.length; i++) {
if(dojo.string.endsWith(str, arguments[i])) {
return true; // boolean
}
}
return false; // boolean
}
 
dojo.string.startsWith = function(/*string*/str, /*string*/start, /*boolean*/ignoreCase){
// summary:
// Returns true if 'str' starts with 'start'
 
if(ignoreCase) {
str = str.toLowerCase();
start = start.toLowerCase();
}
return str.indexOf(start) == 0; // boolean
}
 
dojo.string.startsWithAny = function(/*string*/str /* , ... */){
// summary:
// Returns true if 'str' starts with any of the arguments[2 -> n]
 
for(var i = 1; i < arguments.length; i++) {
if(dojo.string.startsWith(str, arguments[i])) {
return true; // boolean
}
}
return false; // boolean
}
 
dojo.string.has = function(/*string*/str /* , ... */) {
// summary:
// Returns true if 'str' contains any of the arguments 2 -> n
 
for(var i = 1; i < arguments.length; i++) {
if(str.indexOf(arguments[i]) > -1){
return true; // boolean
}
}
return false; // boolean
}
 
dojo.string.normalizeNewlines = function(/*string*/text, /*string? (\n or \r)*/newlineChar){
// summary:
// Changes occurences of CR and LF in text to CRLF, or if newlineChar is provided as '\n' or '\r',
// substitutes newlineChar for occurrences of CR/LF and CRLF
 
if (newlineChar == "\n"){
text = text.replace(/\r\n/g, "\n");
text = text.replace(/\r/g, "\n");
} else if (newlineChar == "\r"){
text = text.replace(/\r\n/g, "\r");
text = text.replace(/\n/g, "\r");
}else{
text = text.replace(/([^\r])\n/g, "$1\r\n").replace(/\r([^\n])/g, "\r\n$1");
}
return text; // string
}
 
dojo.string.splitEscaped = function(/*string*/str, /*string of length=1*/charac){
// summary:
// Splits 'str' into an array separated by 'charac', but skips characters escaped with a backslash
 
var components = [];
for (var i = 0, prevcomma = 0; i < str.length; i++){
if (str.charAt(i) == '\\'){ i++; continue; }
if (str.charAt(i) == charac){
components.push(str.substring(prevcomma, i));
prevcomma = i + 1;
}
}
components.push(str.substr(prevcomma));
return components; // array
}
 
dojo.provide("dojo.dom");
 
dojo.dom.ELEMENT_NODE = 1;
dojo.dom.ATTRIBUTE_NODE = 2;
dojo.dom.TEXT_NODE = 3;
dojo.dom.CDATA_SECTION_NODE = 4;
dojo.dom.ENTITY_REFERENCE_NODE = 5;
dojo.dom.ENTITY_NODE = 6;
dojo.dom.PROCESSING_INSTRUCTION_NODE = 7;
dojo.dom.COMMENT_NODE = 8;
dojo.dom.DOCUMENT_NODE = 9;
dojo.dom.DOCUMENT_TYPE_NODE = 10;
dojo.dom.DOCUMENT_FRAGMENT_NODE = 11;
dojo.dom.NOTATION_NODE = 12;
dojo.dom.dojoml = "http://www.dojotoolkit.org/2004/dojoml";
 
/**
* comprehensive list of XML namespaces
**/
dojo.dom.xmlns = {
// summary
// aliases for various common XML namespaces
svg : "http://www.w3.org/2000/svg",
smil : "http://www.w3.org/2001/SMIL20/",
mml : "http://www.w3.org/1998/Math/MathML",
cml : "http://www.xml-cml.org",
xlink : "http://www.w3.org/1999/xlink",
xhtml : "http://www.w3.org/1999/xhtml",
xul : "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
xbl : "http://www.mozilla.org/xbl",
fo : "http://www.w3.org/1999/XSL/Format",
xsl : "http://www.w3.org/1999/XSL/Transform",
xslt : "http://www.w3.org/1999/XSL/Transform",
xi : "http://www.w3.org/2001/XInclude",
xforms : "http://www.w3.org/2002/01/xforms",
saxon : "http://icl.com/saxon",
xalan : "http://xml.apache.org/xslt",
xsd : "http://www.w3.org/2001/XMLSchema",
dt: "http://www.w3.org/2001/XMLSchema-datatypes",
xsi : "http://www.w3.org/2001/XMLSchema-instance",
rdf : "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
rdfs : "http://www.w3.org/2000/01/rdf-schema#",
dc : "http://purl.org/dc/elements/1.1/",
dcq: "http://purl.org/dc/qualifiers/1.0",
"soap-env" : "http://schemas.xmlsoap.org/soap/envelope/",
wsdl : "http://schemas.xmlsoap.org/wsdl/",
AdobeExtensions : "http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
};
 
dojo.dom.isNode = function(/* object */wh){
// summary:
// checks to see if wh is actually a node.
if(typeof Element == "function") {
try {
return wh instanceof Element; // boolean
} catch(e) {}
} else {
// best-guess
return wh && !isNaN(wh.nodeType); // boolean
}
}
 
dojo.dom.getUniqueId = function(){
// summary:
// returns a unique string for use with any DOM element
var _document = dojo.doc();
do {
var id = "dj_unique_" + (++arguments.callee._idIncrement);
}while(_document.getElementById(id));
return id; // string
}
dojo.dom.getUniqueId._idIncrement = 0;
 
dojo.dom.firstElement = dojo.dom.getFirstChildElement = function(/* Element */parentNode, /* string? */tagName){
// summary:
// returns the first child element matching tagName
var node = parentNode.firstChild;
while(node && node.nodeType != dojo.dom.ELEMENT_NODE){
node = node.nextSibling;
}
if(tagName && node && node.tagName && node.tagName.toLowerCase() != tagName.toLowerCase()) {
node = dojo.dom.nextElement(node, tagName);
}
return node; // Element
}
 
dojo.dom.lastElement = dojo.dom.getLastChildElement = function(/* Element */parentNode, /* string? */tagName){
// summary:
// returns the last child element matching tagName
var node = parentNode.lastChild;
while(node && node.nodeType != dojo.dom.ELEMENT_NODE) {
node = node.previousSibling;
}
if(tagName && node && node.tagName && node.tagName.toLowerCase() != tagName.toLowerCase()) {
node = dojo.dom.prevElement(node, tagName);
}
return node; // Element
}
 
dojo.dom.nextElement = dojo.dom.getNextSiblingElement = function(/* Node */node, /* string? */tagName){
// summary:
// returns the next sibling element matching tagName
if(!node) { return null; }
do {
node = node.nextSibling;
} while(node && node.nodeType != dojo.dom.ELEMENT_NODE);
 
if(node && tagName && tagName.toLowerCase() != node.tagName.toLowerCase()) {
return dojo.dom.nextElement(node, tagName);
}
return node; // Element
}
 
dojo.dom.prevElement = dojo.dom.getPreviousSiblingElement = function(/* Node */node, /* string? */tagName){
// summary:
// returns the previous sibling element matching tagName
if(!node) { return null; }
if(tagName) { tagName = tagName.toLowerCase(); }
do {
node = node.previousSibling;
} while(node && node.nodeType != dojo.dom.ELEMENT_NODE);
 
if(node && tagName && tagName.toLowerCase() != node.tagName.toLowerCase()) {
return dojo.dom.prevElement(node, tagName);
}
return node; // Element
}
 
// TODO: hmph
/*this.forEachChildTag = function(node, unaryFunc) {
var child = this.getFirstChildTag(node);
while(child) {
if(unaryFunc(child) == "break") { break; }
child = this.getNextSiblingTag(child);
}
}*/
 
dojo.dom.moveChildren = function(/*Element*/srcNode, /*Element*/destNode, /*boolean?*/trim){
// summary:
// Moves children from srcNode to destNode and returns the count of
// children moved; will trim off text nodes if trim == true
var count = 0;
if(trim) {
while(srcNode.hasChildNodes() &&
srcNode.firstChild.nodeType == dojo.dom.TEXT_NODE) {
srcNode.removeChild(srcNode.firstChild);
}
while(srcNode.hasChildNodes() &&
srcNode.lastChild.nodeType == dojo.dom.TEXT_NODE) {
srcNode.removeChild(srcNode.lastChild);
}
}
while(srcNode.hasChildNodes()){
destNode.appendChild(srcNode.firstChild);
count++;
}
return count; // number
}
 
dojo.dom.copyChildren = function(/*Element*/srcNode, /*Element*/destNode, /*boolean?*/trim){
// summary:
// Copies children from srcNde to destNode and returns the count of
// children copied; will trim off text nodes if trim == true
var clonedNode = srcNode.cloneNode(true);
return this.moveChildren(clonedNode, destNode, trim); // number
}
 
dojo.dom.replaceChildren = function(/*Element*/node, /*Node*/newChild){
// summary:
// Removes all children of node and appends newChild. All the existing
// children will be destroyed.
// FIXME: what if newChild is an array-like object?
var nodes = [];
if(dojo.render.html.ie){
for(var i=0;i<node.childNodes.length;i++){
nodes.push(node.childNodes[i]);
}
}
dojo.dom.removeChildren(node);
node.appendChild(newChild);
for(var i=0;i<nodes.length;i++){
dojo.dom.destroyNode(nodes[i]);
}
}
 
dojo.dom.removeChildren = function(/*Element*/node){
// summary:
// removes all children from node and returns the count of children removed.
// The children nodes are not destroyed. Be sure to call destroyNode on them
// after they are not used anymore.
var count = node.childNodes.length;
while(node.hasChildNodes()){ dojo.dom.removeNode(node.firstChild); }
return count; // int
}
 
dojo.dom.replaceNode = function(/*Element*/node, /*Element*/newNode){
// summary:
// replaces node with newNode and returns a reference to the removed node.
// To prevent IE memory leak, call destroyNode on the returned node when
// it is no longer needed.
return node.parentNode.replaceChild(newNode, node); // Node
}
 
dojo.dom.destroyNode = function(/*Node*/node){
// summary:
// destroy a node (it can not be used any more). For IE, this is the
// right function to call to prevent memory leaks. While for other
// browsers, this is identical to dojo.dom.removeNode
if(node.parentNode){
node = dojo.dom.removeNode(node);
}
if(node.nodeType != 3){ // ingore TEXT_NODE
if(dojo.evalObjPath("dojo.event.browser.clean", false)){
dojo.event.browser.clean(node);
}
if(dojo.render.html.ie){
node.outerHTML=''; //prevent ugly IE mem leak associated with Node.removeChild (ticket #1727)
}
}
}
 
dojo.dom.removeNode = function(/*Node*/node){
// summary:
// if node has a parent, removes node from parent and returns a
// reference to the removed child.
// To prevent IE memory leak, call destroyNode on the returned node when
// it is no longer needed.
// node:
// the node to remove from its parent.
 
if(node && node.parentNode){
// return a ref to the removed child
return node.parentNode.removeChild(node); //Node
}
}
 
dojo.dom.getAncestors = function(/*Node*/node, /*function?*/filterFunction, /*boolean?*/returnFirstHit){
// summary:
// returns all ancestors matching optional filterFunction; will return
// only the first if returnFirstHit
var ancestors = [];
var isFunction = (filterFunction && (filterFunction instanceof Function || typeof filterFunction == "function"));
while(node){
if(!isFunction || filterFunction(node)){
ancestors.push(node);
}
if(returnFirstHit && ancestors.length > 0){
return ancestors[0]; // Node
}
node = node.parentNode;
}
if(returnFirstHit){ return null; }
return ancestors; // array
}
 
dojo.dom.getAncestorsByTag = function(/*Node*/node, /*String*/tag, /*boolean?*/returnFirstHit){
// summary:
// returns all ancestors matching tag (as tagName), will only return
// first one if returnFirstHit
tag = tag.toLowerCase();
return dojo.dom.getAncestors(node, function(el){
return ((el.tagName)&&(el.tagName.toLowerCase() == tag));
}, returnFirstHit); // Node || array
}
 
dojo.dom.getFirstAncestorByTag = function(/*Node*/node, /*string*/tag){
// summary:
// Returns first ancestor of node with tag tagName
return dojo.dom.getAncestorsByTag(node, tag, true); // Node
}
 
dojo.dom.isDescendantOf = function(/* Node */node, /* Node */ancestor, /* boolean? */guaranteeDescendant){
// summary
// Returns boolean if node is a descendant of ancestor
// guaranteeDescendant allows us to be a "true" isDescendantOf function
if(guaranteeDescendant && node) { node = node.parentNode; }
while(node) {
if(node == ancestor){
return true; // boolean
}
node = node.parentNode;
}
return false; // boolean
}
 
dojo.dom.innerXML = function(/*Node*/node){
// summary:
// Implementation of MS's innerXML function.
if(node.innerXML){
return node.innerXML; // string
}else if (node.xml){
return node.xml; // string
}else if(typeof XMLSerializer != "undefined"){
return (new XMLSerializer()).serializeToString(node); // string
}
}
 
dojo.dom.createDocument = function(){
// summary:
// cross-browser implementation of creating an XML document object.
var doc = null;
var _document = dojo.doc();
 
if(!dj_undef("ActiveXObject")){
var prefixes = [ "MSXML2", "Microsoft", "MSXML", "MSXML3" ];
for(var i = 0; i<prefixes.length; i++){
try{
doc = new ActiveXObject(prefixes[i]+".XMLDOM");
}catch(e){ /* squelch */ };
 
if(doc){ break; }
}
}else if((_document.implementation)&&
(_document.implementation.createDocument)){
doc = _document.implementation.createDocument("", "", null);
}
return doc; // DOMDocument
}
 
dojo.dom.createDocumentFromText = function(/*string*/str, /*string?*/mimetype){
// summary:
// attempts to create a Document object based on optional mime-type,
// using str as the contents of the document
if(!mimetype){ mimetype = "text/xml"; }
if(!dj_undef("DOMParser")){
var parser = new DOMParser();
return parser.parseFromString(str, mimetype); // DOMDocument
}else if(!dj_undef("ActiveXObject")){
var domDoc = dojo.dom.createDocument();
if(domDoc){
domDoc.async = false;
domDoc.loadXML(str);
return domDoc; // DOMDocument
}else{
dojo.debug("toXml didn't work?");
}
/*
}else if((dojo.render.html.capable)&&(dojo.render.html.safari)){
// FIXME: this doesn't appear to work!
// from: http://web-graphics.com/mtarchive/001606.php
// var xml = '<?xml version="1.0"?>'+str;
var mtype = "text/xml";
var xml = '<?xml version="1.0"?>'+str;
var url = "data:"+mtype+";charset=utf-8,"+encodeURIComponent(xml);
var req = new XMLHttpRequest();
req.open("GET", url, false);
req.overrideMimeType(mtype);
req.send(null);
return req.responseXML;
*/
}else{
var _document = dojo.doc();
if(_document.createElement){
// FIXME: this may change all tags to uppercase!
var tmp = _document.createElement("xml");
tmp.innerHTML = str;
if(_document.implementation && _document.implementation.createDocument){
var xmlDoc = _document.implementation.createDocument("foo", "", null);
for(var i = 0; i < tmp.childNodes.length; i++) {
xmlDoc.importNode(tmp.childNodes.item(i), true);
}
return xmlDoc; // DOMDocument
}
// FIXME: probably not a good idea to have to return an HTML fragment
// FIXME: the tmp.doc.firstChild is as tested from IE, so it may not
// work that way across the board
return ((tmp.document)&&
(tmp.document.firstChild ? tmp.document.firstChild : tmp)); // DOMDocument
}
}
return null;
}
 
dojo.dom.prependChild = function(/*Element*/node, /*Element*/parent){
// summary:
// prepends node to parent's children nodes
if(parent.firstChild) {
parent.insertBefore(node, parent.firstChild);
} else {
parent.appendChild(node);
}
return true; // boolean
}
 
dojo.dom.insertBefore = function(/*Node*/node, /*Node*/ref, /*boolean?*/force){
// summary:
// Try to insert node before ref
if( (force != true)&&
(node === ref || node.nextSibling === ref)){ return false; }
var parent = ref.parentNode;
parent.insertBefore(node, ref);
return true; // boolean
}
 
dojo.dom.insertAfter = function(/*Node*/node, /*Node*/ref, /*boolean?*/force){
// summary:
// Try to insert node after ref
var pn = ref.parentNode;
if(ref == pn.lastChild){
if((force != true)&&(node === ref)){
return false; // boolean
}
pn.appendChild(node);
}else{
return this.insertBefore(node, ref.nextSibling, force); // boolean
}
return true; // boolean
}
 
dojo.dom.insertAtPosition = function(/*Node*/node, /*Node*/ref, /*string*/position){
// summary:
// attempt to insert node in relation to ref based on position
if((!node)||(!ref)||(!position)){
return false; // boolean
}
switch(position.toLowerCase()){
case "before":
return dojo.dom.insertBefore(node, ref); // boolean
case "after":
return dojo.dom.insertAfter(node, ref); // boolean
case "first":
if(ref.firstChild){
return dojo.dom.insertBefore(node, ref.firstChild); // boolean
}else{
ref.appendChild(node);
return true; // boolean
}
break;
default: // aka: last
ref.appendChild(node);
return true; // boolean
}
}
 
dojo.dom.insertAtIndex = function(/*Node*/node, /*Element*/containingNode, /*number*/insertionIndex){
// summary:
// insert node into child nodes nodelist of containingNode at
// insertionIndex. insertionIndex should be between 0 and
// the number of the childNodes in containingNode. insertionIndex
// specifys after how many childNodes in containingNode the node
// shall be inserted. If 0 is given, node will be appended to
// containingNode.
var siblingNodes = containingNode.childNodes;
 
// if there aren't any kids yet, just add it to the beginning
 
if (!siblingNodes.length || siblingNodes.length == insertionIndex){
containingNode.appendChild(node);
return true; // boolean
}
 
if(insertionIndex == 0){
return dojo.dom.prependChild(node, containingNode); // boolean
}
// otherwise we need to walk the childNodes
// and find our spot
 
return dojo.dom.insertAfter(node, siblingNodes[insertionIndex-1]); // boolean
}
dojo.dom.textContent = function(/*Node*/node, /*string*/text){
// summary:
// implementation of the DOM Level 3 attribute; scan node for text
if (arguments.length>1) {
var _document = dojo.doc();
dojo.dom.replaceChildren(node, _document.createTextNode(text));
return text; // string
} else {
if(node.textContent != undefined){ //FF 1.5
return node.textContent; // string
}
var _result = "";
if (node == null) { return _result; }
for (var i = 0; i < node.childNodes.length; i++) {
switch (node.childNodes[i].nodeType) {
case 1: // ELEMENT_NODE
case 5: // ENTITY_REFERENCE_NODE
_result += dojo.dom.textContent(node.childNodes[i]);
break;
case 3: // TEXT_NODE
case 2: // ATTRIBUTE_NODE
case 4: // CDATA_SECTION_NODE
_result += node.childNodes[i].nodeValue;
break;
default:
break;
}
}
return _result; // string
}
}
 
dojo.dom.hasParent = function(/*Node*/node){
// summary:
// returns whether or not node is a child of another node.
return Boolean(node && node.parentNode && dojo.dom.isNode(node.parentNode)); // boolean
}
 
/**
* Examples:
*
* myFooNode = <foo />
* isTag(myFooNode, "foo"); // returns "foo"
* isTag(myFooNode, "bar"); // returns ""
* isTag(myFooNode, "FOO"); // returns ""
* isTag(myFooNode, "hey", "foo", "bar"); // returns "foo"
**/
dojo.dom.isTag = function(/* Node */node /* ... */){
// summary:
// determines if node has any of the provided tag names and returns
// the tag name that matches, empty string otherwise.
if(node && node.tagName) {
for(var i=1; i<arguments.length; i++){
if(node.tagName==String(arguments[i])){
return String(arguments[i]); // string
}
}
}
return ""; // string
}
 
dojo.dom.setAttributeNS = function( /*Element*/elem, /*string*/namespaceURI,
/*string*/attrName, /*string*/attrValue){
// summary:
// implementation of DOM2 setAttributeNS that works cross browser.
if(elem == null || ((elem == undefined)&&(typeof elem == "undefined"))){
dojo.raise("No element given to dojo.dom.setAttributeNS");
}
if(!((elem.setAttributeNS == undefined)&&(typeof elem.setAttributeNS == "undefined"))){ // w3c
elem.setAttributeNS(namespaceURI, attrName, attrValue);
}else{ // IE
// get a root XML document
var ownerDoc = elem.ownerDocument;
var attribute = ownerDoc.createNode(
2, // node type
attrName,
namespaceURI
);
// set value
attribute.nodeValue = attrValue;
// attach to element
elem.setAttributeNode(attribute);
}
}
 
dojo.provide("dojo.undo.browser");
 
 
try{
if((!djConfig["preventBackButtonFix"])&&(!dojo.hostenv.post_load_)){
document.write("<iframe style='border: 0px; width: 1px; height: 1px; position: absolute; bottom: 0px; right: 0px; visibility: visible;' name='djhistory' id='djhistory' src='" + (djConfig["dojoIframeHistoryUrl"] || dojo.hostenv.getBaseScriptUri()+'iframe_history.html') + "'></iframe>");
}
}catch(e){/* squelch */}
 
if(dojo.render.html.opera){
dojo.debug("Opera is not supported with dojo.undo.browser, so back/forward detection will not work.");
}
 
dojo.undo.browser = {
initialHref: (!dj_undef("window")) ? window.location.href : "",
initialHash: (!dj_undef("window")) ? window.location.hash : "",
 
moveForward: false,
historyStack: [],
forwardStack: [],
historyIframe: null,
bookmarkAnchor: null,
locationTimer: null,
 
/**
*
*/
setInitialState: function(/*Object*/args){
//summary: Sets the state object and back callback for the very first page that is loaded.
//description: It is recommended that you call this method as part of an event listener that is registered via
//dojo.addOnLoad().
//args: Object
// See the addToHistory() function for the list of valid args properties.
this.initialState = this._createState(this.initialHref, args, this.initialHash);
},
 
//FIXME: Would like to support arbitrary back/forward jumps. Have to rework iframeLoaded among other things.
//FIXME: is there a slight race condition in moz using change URL with the timer check and when
// the hash gets set? I think I have seen a back/forward call in quick succession, but not consistent.
addToHistory: function(args){
//summary: adds a state object (args) to the history list. You must set
//djConfig.preventBackButtonFix = false to use dojo.undo.browser.
 
//args: Object
// args can have the following properties:
// To support getting back button notifications, the object argument should implement a
// function called either "back", "backButton", or "handle". The string "back" will be
// passed as the first and only argument to this callback.
// - To support getting forward button notifications, the object argument should implement a
// function called either "forward", "forwardButton", or "handle". The string "forward" will be
// passed as the first and only argument to this callback.
// - If you want the browser location string to change, define "changeUrl" on the object. If the
// value of "changeUrl" is true, then a unique number will be appended to the URL as a fragment
// identifier (http://some.domain.com/path#uniquenumber). If it is any other value that does
// not evaluate to false, that value will be used as the fragment identifier. For example,
// if changeUrl: 'page1', then the URL will look like: http://some.domain.com/path#page1
// Full example:
// dojo.undo.browser.addToHistory({
// back: function() { alert('back pressed'); },
// forward: function() { alert('forward pressed'); },
// changeUrl: true
// });
//
// BROWSER NOTES:
// Safari 1.2:
// back button "works" fine, however it's not possible to actually
// DETECT that you've moved backwards by inspecting window.location.
// Unless there is some other means of locating.
// FIXME: perhaps we can poll on history.length?
// Safari 2.0.3+ (and probably 1.3.2+):
// works fine, except when changeUrl is used. When changeUrl is used,
// Safari jumps all the way back to whatever page was shown before
// the page that uses dojo.undo.browser support.
// IE 5.5 SP2:
// back button behavior is macro. It does not move back to the
// previous hash value, but to the last full page load. This suggests
// that the iframe is the correct way to capture the back button in
// these cases.
// Don't test this page using local disk for MSIE. MSIE will not create
// a history list for iframe_history.html if served from a file: URL.
// The XML served back from the XHR tests will also not be properly
// created if served from local disk. Serve the test pages from a web
// server to test in that browser.
// IE 6.0:
// same behavior as IE 5.5 SP2
// Firefox 1.0+:
// the back button will return us to the previous hash on the same
// page, thereby not requiring an iframe hack, although we do then
// need to run a timer to detect inter-page movement.
 
//If addToHistory is called, then that means we prune the
//forward stack -- the user went back, then wanted to
//start a new forward path.
this.forwardStack = [];
 
var hash = null;
var url = null;
if(!this.historyIframe){
if(djConfig["useXDomain"] && !djConfig["dojoIframeHistoryUrl"]){
dojo.debug("dojo.undo.browser: When using cross-domain Dojo builds,"
+ " please save iframe_history.html to your domain and set djConfig.dojoIframeHistoryUrl"
+ " to the path on your domain to iframe_history.html");
}
this.historyIframe = window.frames["djhistory"];
}
if(!this.bookmarkAnchor){
this.bookmarkAnchor = document.createElement("a");
dojo.body().appendChild(this.bookmarkAnchor);
this.bookmarkAnchor.style.display = "none";
}
if(args["changeUrl"]){
hash = "#"+ ((args["changeUrl"]!==true) ? args["changeUrl"] : (new Date()).getTime());
//If the current hash matches the new one, just replace the history object with
//this new one. It doesn't make sense to track different state objects for the same
//logical URL. This matches the browser behavior of only putting in one history
//item no matter how many times you click on the same #hash link, at least in Firefox
//and Safari, and there is no reliable way in those browsers to know if a #hash link
//has been clicked on multiple times. So making this the standard behavior in all browsers
//so that dojo.undo.browser's behavior is the same in all browsers.
if(this.historyStack.length == 0 && this.initialState.urlHash == hash){
this.initialState = this._createState(url, args, hash);
return;
}else if(this.historyStack.length > 0 && this.historyStack[this.historyStack.length - 1].urlHash == hash){
this.historyStack[this.historyStack.length - 1] = this._createState(url, args, hash);
return;
}
 
this.changingUrl = true;
setTimeout("window.location.href = '"+hash+"'; dojo.undo.browser.changingUrl = false;", 1);
this.bookmarkAnchor.href = hash;
if(dojo.render.html.ie){
url = this._loadIframeHistory();
 
var oldCB = args["back"]||args["backButton"]||args["handle"];
 
//The function takes handleName as a parameter, in case the
//callback we are overriding was "handle". In that case,
//we will need to pass the handle name to handle.
var tcb = function(handleName){
if(window.location.hash != ""){
setTimeout("window.location.href = '"+hash+"';", 1);
}
//Use apply to set "this" to args, and to try to avoid memory leaks.
oldCB.apply(this, [handleName]);
}
//Set interceptor function in the right place.
if(args["back"]){
args.back = tcb;
}else if(args["backButton"]){
args.backButton = tcb;
}else if(args["handle"]){
args.handle = tcb;
}
var oldFW = args["forward"]||args["forwardButton"]||args["handle"];
//The function takes handleName as a parameter, in case the
//callback we are overriding was "handle". In that case,
//we will need to pass the handle name to handle.
var tfw = function(handleName){
if(window.location.hash != ""){
window.location.href = hash;
}
if(oldFW){ // we might not actually have one
//Use apply to set "this" to args, and to try to avoid memory leaks.
oldFW.apply(this, [handleName]);
}
}
 
//Set interceptor function in the right place.
if(args["forward"]){
args.forward = tfw;
}else if(args["forwardButton"]){
args.forwardButton = tfw;
}else if(args["handle"]){
args.handle = tfw;
}
 
}else if(dojo.render.html.moz){
// start the timer
if(!this.locationTimer){
this.locationTimer = setInterval("dojo.undo.browser.checkLocation();", 200);
}
}
}else{
url = this._loadIframeHistory();
}
 
this.historyStack.push(this._createState(url, args, hash));
},
 
checkLocation: function(){
//summary: private method. Do not call this directly.
if (!this.changingUrl){
var hsl = this.historyStack.length;
 
if((window.location.hash == this.initialHash||window.location.href == this.initialHref)&&(hsl == 1)){
// FIXME: could this ever be a forward button?
// we can't clear it because we still need to check for forwards. Ugg.
// clearInterval(this.locationTimer);
this.handleBackButton();
return;
}
// first check to see if we could have gone forward. We always halt on
// a no-hash item.
if(this.forwardStack.length > 0){
if(this.forwardStack[this.forwardStack.length-1].urlHash == window.location.hash){
this.handleForwardButton();
return;
}
}
// ok, that didn't work, try someplace back in the history stack
if((hsl >= 2)&&(this.historyStack[hsl-2])){
if(this.historyStack[hsl-2].urlHash==window.location.hash){
this.handleBackButton();
return;
}
}
}
},
 
iframeLoaded: function(evt, ifrLoc){
//summary: private method. Do not call this directly.
if(!dojo.render.html.opera){
var query = this._getUrlQuery(ifrLoc.href);
if(query == null){
// alert("iframeLoaded");
// we hit the end of the history, so we should go back
if(this.historyStack.length == 1){
this.handleBackButton();
}
return;
}
if(this.moveForward){
// we were expecting it, so it's not either a forward or backward movement
this.moveForward = false;
return;
}
//Check the back stack first, since it is more likely.
//Note that only one step back or forward is supported.
if(this.historyStack.length >= 2 && query == this._getUrlQuery(this.historyStack[this.historyStack.length-2].url)){
this.handleBackButton();
}
else if(this.forwardStack.length > 0 && query == this._getUrlQuery(this.forwardStack[this.forwardStack.length-1].url)){
this.handleForwardButton();
}
}
},
 
handleBackButton: function(){
//summary: private method. Do not call this directly.
 
//The "current" page is always at the top of the history stack.
var current = this.historyStack.pop();
if(!current){ return; }
var last = this.historyStack[this.historyStack.length-1];
if(!last && this.historyStack.length == 0){
last = this.initialState;
}
if (last){
if(last.kwArgs["back"]){
last.kwArgs["back"]();
}else if(last.kwArgs["backButton"]){
last.kwArgs["backButton"]();
}else if(last.kwArgs["handle"]){
last.kwArgs.handle("back");
}
}
this.forwardStack.push(current);
},
 
handleForwardButton: function(){
//summary: private method. Do not call this directly.
 
var last = this.forwardStack.pop();
if(!last){ return; }
if(last.kwArgs["forward"]){
last.kwArgs.forward();
}else if(last.kwArgs["forwardButton"]){
last.kwArgs.forwardButton();
}else if(last.kwArgs["handle"]){
last.kwArgs.handle("forward");
}
this.historyStack.push(last);
},
 
_createState: function(url, args, hash){
//summary: private method. Do not call this directly.
 
return {"url": url, "kwArgs": args, "urlHash": hash}; //Object
},
 
_getUrlQuery: function(url){
//summary: private method. Do not call this directly.
var segments = url.split("?");
if (segments.length < 2){
return null; //null
}
else{
return segments[1]; //String
}
},
_loadIframeHistory: function(){
//summary: private method. Do not call this directly.
var url = (djConfig["dojoIframeHistoryUrl"] || dojo.hostenv.getBaseScriptUri()+'iframe_history.html')
+ "?" + (new Date()).getTime();
this.moveForward = true;
dojo.io.setIFrameSrc(this.historyIframe, url, false);
return url; //String
}
}
 
dojo.provide("dojo.io.BrowserIO");
 
 
 
 
 
 
 
 
if(!dj_undef("window")) {
 
dojo.io.checkChildrenForFile = function(/*DOMNode*/node){
//summary: Checks any child nodes of node for an input type="file" element.
var hasFile = false;
var inputs = node.getElementsByTagName("input");
dojo.lang.forEach(inputs, function(input){
if(hasFile){ return; }
if(input.getAttribute("type")=="file"){
hasFile = true;
}
});
return hasFile; //boolean
}
 
dojo.io.formHasFile = function(/*DOMNode*/formNode){
//summary: Just calls dojo.io.checkChildrenForFile().
return dojo.io.checkChildrenForFile(formNode); //boolean
}
 
dojo.io.updateNode = function(/*DOMNode*/node, /*String or Object*/urlOrArgs){
//summary: Updates a DOMnode with the result of a dojo.io.bind() call.
//node: DOMNode
//urlOrArgs: String or Object
// Either a String that has an URL, or an object containing dojo.io.bind()
// arguments.
node = dojo.byId(node);
var args = urlOrArgs;
if(dojo.lang.isString(urlOrArgs)){
args = { url: urlOrArgs };
}
args.mimetype = "text/html";
args.load = function(t, d, e){
while(node.firstChild){
dojo.dom.destroyNode(node.firstChild);
}
node.innerHTML = d;
};
dojo.io.bind(args);
}
 
dojo.io.formFilter = function(/*DOMNode*/node) {
//summary: Returns true if the node is an input element that is enabled, has
//a name, and whose type is one of the following values: ["file", "submit", "image", "reset", "button"]
var type = (node.type||"").toLowerCase();
return !node.disabled && node.name
&& !dojo.lang.inArray(["file", "submit", "image", "reset", "button"], type); //boolean
}
 
// TODO: Move to htmlUtils
dojo.io.encodeForm = function(/*DOMNode*/formNode, /*String?*/encoding, /*Function?*/formFilter){
//summary: Converts the names and values of form elements into an URL-encoded
//string (name=value&name=value...).
//formNode: DOMNode
//encoding: String?
// The encoding to use for the values. Specify a string that starts with
// "utf" (for instance, "utf8"), to use encodeURIComponent() as the encoding
// function. Otherwise, dojo.string.encodeAscii will be used.
//formFilter: Function?
// A function used to filter out form elements. The element node will be passed
// to the formFilter function, and a boolean result is expected (true indicating
// indicating that the element should have its name/value included in the output).
// If no formFilter is specified, then dojo.io.formFilter() will be used.
if((!formNode)||(!formNode.tagName)||(!formNode.tagName.toLowerCase() == "form")){
dojo.raise("Attempted to encode a non-form element.");
}
if(!formFilter) { formFilter = dojo.io.formFilter; }
var enc = /utf/i.test(encoding||"") ? encodeURIComponent : dojo.string.encodeAscii;
var values = [];
 
for(var i = 0; i < formNode.elements.length; i++){
var elm = formNode.elements[i];
if(!elm || elm.tagName.toLowerCase() == "fieldset" || !formFilter(elm)) { continue; }
var name = enc(elm.name);
var type = elm.type.toLowerCase();
 
if(type == "select-multiple"){
for(var j = 0; j < elm.options.length; j++){
if(elm.options[j].selected) {
values.push(name + "=" + enc(elm.options[j].value));
}
}
}else if(dojo.lang.inArray(["radio", "checkbox"], type)){
if(elm.checked){
values.push(name + "=" + enc(elm.value));
}
}else{
values.push(name + "=" + enc(elm.value));
}
}
 
// now collect input type="image", which doesn't show up in the elements array
var inputs = formNode.getElementsByTagName("input");
for(var i = 0; i < inputs.length; i++) {
var input = inputs[i];
if(input.type.toLowerCase() == "image" && input.form == formNode
&& formFilter(input)) {
var name = enc(input.name);
values.push(name + "=" + enc(input.value));
values.push(name + ".x=0");
values.push(name + ".y=0");
}
}
return values.join("&") + "&"; //String
}
 
dojo.io.FormBind = function(/*DOMNode or Object*/args) {
//summary: constructor for a dojo.io.FormBind object. See the Dojo Book for
//some information on usage: http://manual.dojotoolkit.org/WikiHome/DojoDotBook/Book23
//args: DOMNode or Object
// args can either be the DOMNode for a form element, or an object containing
// dojo.io.bind() arguments, one of which should be formNode with the value of
// a form element DOMNode.
this.bindArgs = {};
 
if(args && args.formNode) {
this.init(args);
} else if(args) {
this.init({formNode: args});
}
}
dojo.lang.extend(dojo.io.FormBind, {
form: null,
 
bindArgs: null,
 
clickedButton: null,
 
init: function(/*DOMNode or Object*/args) {
//summary: Internal function called by the dojo.io.FormBind() constructor
//do not call this method directly.
var form = dojo.byId(args.formNode);
 
if(!form || !form.tagName || form.tagName.toLowerCase() != "form") {
throw new Error("FormBind: Couldn't apply, invalid form");
} else if(this.form == form) {
return;
} else if(this.form) {
throw new Error("FormBind: Already applied to a form");
}
 
dojo.lang.mixin(this.bindArgs, args);
this.form = form;
 
this.connect(form, "onsubmit", "submit");
 
for(var i = 0; i < form.elements.length; i++) {
var node = form.elements[i];
if(node && node.type && dojo.lang.inArray(["submit", "button"], node.type.toLowerCase())) {
this.connect(node, "onclick", "click");
}
}
 
var inputs = form.getElementsByTagName("input");
for(var i = 0; i < inputs.length; i++) {
var input = inputs[i];
if(input.type.toLowerCase() == "image" && input.form == form) {
this.connect(input, "onclick", "click");
}
}
},
 
onSubmit: function(/*DOMNode*/form) {
//summary: Function used to verify that the form is OK to submit.
//Override this function if you want specific form validation done.
return true; //boolean
},
 
submit: function(/*Event*/e) {
//summary: internal function that is connected as a listener to the
//form's onsubmit event.
e.preventDefault();
if(this.onSubmit(this.form)) {
dojo.io.bind(dojo.lang.mixin(this.bindArgs, {
formFilter: dojo.lang.hitch(this, "formFilter")
}));
}
},
 
click: function(/*Event*/e) {
//summary: internal method that is connected as a listener to the
//form's elements whose click event can submit a form.
var node = e.currentTarget;
if(node.disabled) { return; }
this.clickedButton = node;
},
 
formFilter: function(/*DOMNode*/node) {
//summary: internal function used to know which form element values to include
// in the dojo.io.bind() request.
var type = (node.type||"").toLowerCase();
var accept = false;
if(node.disabled || !node.name) {
accept = false;
} else if(dojo.lang.inArray(["submit", "button", "image"], type)) {
if(!this.clickedButton) { this.clickedButton = node; }
accept = node == this.clickedButton;
} else {
accept = !dojo.lang.inArray(["file", "submit", "reset", "button"], type);
}
return accept; //boolean
},
 
// in case you don't have dojo.event.* pulled in
connect: function(/*Object*/srcObj, /*Function*/srcFcn, /*Function*/targetFcn) {
//summary: internal function used to connect event listeners to form elements
//that trigger events. Used in case dojo.event is not loaded.
if(dojo.evalObjPath("dojo.event.connect")) {
dojo.event.connect(srcObj, srcFcn, this, targetFcn);
} else {
var fcn = dojo.lang.hitch(this, targetFcn);
srcObj[srcFcn] = function(e) {
if(!e) { e = window.event; }
if(!e.currentTarget) { e.currentTarget = e.srcElement; }
if(!e.preventDefault) { e.preventDefault = function() { window.event.returnValue = false; } }
fcn(e);
}
}
}
});
 
dojo.io.XMLHTTPTransport = new function(){
//summary: The object that implements the dojo.io.bind transport for XMLHttpRequest.
var _this = this;
 
var _cache = {}; // FIXME: make this public? do we even need to?
this.useCache = false; // if this is true, we'll cache unless kwArgs.useCache = false
this.preventCache = false; // if this is true, we'll always force GET requests to cache
 
// FIXME: Should this even be a function? or do we just hard code it in the next 2 functions?
function getCacheKey(url, query, method) {
return url + "|" + query + "|" + method.toLowerCase();
}
 
function addToCache(url, query, method, http) {
_cache[getCacheKey(url, query, method)] = http;
}
 
function getFromCache(url, query, method) {
return _cache[getCacheKey(url, query, method)];
}
 
this.clearCache = function() {
_cache = {};
}
 
// moved successful load stuff here
function doLoad(kwArgs, http, url, query, useCache) {
if( ((http.status>=200)&&(http.status<300))|| // allow any 2XX response code
(http.status==304)|| // get it out of the cache
(location.protocol=="file:" && (http.status==0 || http.status==undefined))||
(location.protocol=="chrome:" && (http.status==0 || http.status==undefined))
){
var ret;
if(kwArgs.method.toLowerCase() == "head"){
var headers = http.getAllResponseHeaders();
ret = {};
ret.toString = function(){ return headers; }
var values = headers.split(/[\r\n]+/g);
for(var i = 0; i < values.length; i++) {
var pair = values[i].match(/^([^:]+)\s*:\s*(.+)$/i);
if(pair) {
ret[pair[1]] = pair[2];
}
}
}else if(kwArgs.mimetype == "text/javascript"){
try{
ret = dj_eval(http.responseText);
}catch(e){
dojo.debug(e);
dojo.debug(http.responseText);
ret = null;
}
}else if(kwArgs.mimetype == "text/json" || kwArgs.mimetype == "application/json"){
try{
ret = dj_eval("("+http.responseText+")");
}catch(e){
dojo.debug(e);
dojo.debug(http.responseText);
ret = false;
}
}else if((kwArgs.mimetype == "application/xml")||
(kwArgs.mimetype == "text/xml")){
ret = http.responseXML;
if(!ret || typeof ret == "string" || !http.getResponseHeader("Content-Type")) {
ret = dojo.dom.createDocumentFromText(http.responseText);
}
}else{
ret = http.responseText;
}
 
if(useCache){ // only cache successful responses
addToCache(url, query, kwArgs.method, http);
}
kwArgs[(typeof kwArgs.load == "function") ? "load" : "handle"]("load", ret, http, kwArgs);
}else{
var errObj = new dojo.io.Error("XMLHttpTransport Error: "+http.status+" "+http.statusText);
kwArgs[(typeof kwArgs.error == "function") ? "error" : "handle"]("error", errObj, http, kwArgs);
}
}
 
// set headers (note: Content-Type will get overriden if kwArgs.contentType is set)
function setHeaders(http, kwArgs){
if(kwArgs["headers"]) {
for(var header in kwArgs["headers"]) {
if(header.toLowerCase() == "content-type" && !kwArgs["contentType"]) {
kwArgs["contentType"] = kwArgs["headers"][header];
} else {
http.setRequestHeader(header, kwArgs["headers"][header]);
}
}
}
}
 
this.inFlight = [];
this.inFlightTimer = null;
 
this.startWatchingInFlight = function(){
//summary: internal method used to trigger a timer to watch all inflight
//XMLHttpRequests.
if(!this.inFlightTimer){
// setInterval broken in mozilla x86_64 in some circumstances, see
// https://bugzilla.mozilla.org/show_bug.cgi?id=344439
// using setTimeout instead
this.inFlightTimer = setTimeout("dojo.io.XMLHTTPTransport.watchInFlight();", 10);
}
}
 
this.watchInFlight = function(){
//summary: internal method that checks each inflight XMLHttpRequest to see
//if it has completed or if the timeout situation applies.
var now = null;
// make sure sync calls stay thread safe, if this callback is called during a sync call
// and this results in another sync call before the first sync call ends the browser hangs
if(!dojo.hostenv._blockAsync && !_this._blockAsync){
for(var x=this.inFlight.length-1; x>=0; x--){
try{
var tif = this.inFlight[x];
if(!tif || tif.http._aborted || !tif.http.readyState){
this.inFlight.splice(x, 1); continue;
}
if(4==tif.http.readyState){
// remove it so we can clean refs
this.inFlight.splice(x, 1);
doLoad(tif.req, tif.http, tif.url, tif.query, tif.useCache);
}else if (tif.startTime){
//See if this is a timeout case.
if(!now){
now = (new Date()).getTime();
}
if(tif.startTime + (tif.req.timeoutSeconds * 1000) < now){
//Stop the request.
if(typeof tif.http.abort == "function"){
tif.http.abort();
}
// remove it so we can clean refs
this.inFlight.splice(x, 1);
tif.req[(typeof tif.req.timeout == "function") ? "timeout" : "handle"]("timeout", null, tif.http, tif.req);
}
}
}catch(e){
try{
var errObj = new dojo.io.Error("XMLHttpTransport.watchInFlight Error: " + e);
tif.req[(typeof tif.req.error == "function") ? "error" : "handle"]("error", errObj, tif.http, tif.req);
}catch(e2){
dojo.debug("XMLHttpTransport error callback failed: " + e2);
}
}
}
}
 
clearTimeout(this.inFlightTimer);
if(this.inFlight.length == 0){
this.inFlightTimer = null;
return;
}
this.inFlightTimer = setTimeout("dojo.io.XMLHTTPTransport.watchInFlight();", 10);
}
 
var hasXmlHttp = dojo.hostenv.getXmlhttpObject() ? true : false;
this.canHandle = function(/*dojo.io.Request*/kwArgs){
//summary: Tells dojo.io.bind() if this is a good transport to
//use for the particular type of request. This type of transport cannot
//handle forms that have an input type="file" element.
 
// FIXME: we need to determine when form values need to be
// multi-part mime encoded and avoid using this transport for those
// requests.
return hasXmlHttp
&& dojo.lang.inArray(["text/plain", "text/html", "application/xml", "text/xml", "text/javascript", "text/json", "application/json"], (kwArgs["mimetype"].toLowerCase()||""))
&& !( kwArgs["formNode"] && dojo.io.formHasFile(kwArgs["formNode"]) ); //boolean
}
 
this.multipartBoundary = "45309FFF-BD65-4d50-99C9-36986896A96F"; // unique guid as a boundary value for multipart posts
 
this.bind = function(/*dojo.io.Request*/kwArgs){
//summary: function that sends the request to the server.
 
//This function will attach an abort() function to the kwArgs dojo.io.Request object,
//so if you need to abort the request, you can call that method on the request object.
//The following are acceptable properties in kwArgs (in addition to the
//normal dojo.io.Request object properties).
//url: String: URL the server URL to use for the request.
//method: String: the HTTP method to use (GET, POST, etc...).
//mimetype: Specifies what format the result data should be given to the load/handle callback. Valid values are:
// text/javascript, text/json, application/json, application/xml, text/xml. Any other mimetype will give back a text
// string.
//transport: String: specify "XMLHTTPTransport" to force the use of this XMLHttpRequest transport.
//headers: Object: The object property names and values will be sent as HTTP request header
// names and values.
//sendTransport: boolean: If true, then dojo.transport=xmlhttp will be added to the request.
//encoding: String: The type of encoding to use when dealing with the content kwArgs property.
//content: Object: The content object is converted into a name=value&name=value string, by
// using dojo.io.argsFromMap(). The encoding kwArgs property is passed to dojo.io.argsFromMap()
// for use in encoding the names and values. The resulting string is added to the request.
//formNode: DOMNode: a form element node. This should not normally be used. Use new dojo.io.FormBind() instead.
// If formNode is used, then the names and values of the form elements will be converted
// to a name=value&name=value string and added to the request. The encoding kwArgs property is used
// to encode the names and values.
//postContent: String: Raw name=value&name=value string to be included as part of the request.
//back or backButton: Function: A function to be called if the back button is pressed. If this kwArgs property
// is used, then back button support via dojo.undo.browser will be used. See notes for dojo.undo.browser on usage.
// You need to set djConfig.preventBackButtonFix = false to enable back button support.
//changeUrl: boolean or String: Used as part of back button support. See notes for dojo.undo.browser on usage.
//user: String: The user name. Used in conjuction with password. Passed to XMLHttpRequest.open().
//password: String: The user's password. Used in conjuction with user. Passed to XMLHttpRequest.open().
//file: Object or Array of Objects: an object simulating a file to be uploaded. file objects should have the following properties:
// name or fileName: the name of the file
// contentType: the MIME content type for the file.
// content: the actual content of the file.
//multipart: boolean: indicates whether this should be a multipart mime request. If kwArgs.file exists, then this
// property is set to true automatically.
//sync: boolean: if true, then a synchronous XMLHttpRequest call is done,
// if false (the default), then an asynchronous call is used.
//preventCache: boolean: If true, then a cache busting parameter is added to the request URL.
// default value is false.
//useCache: boolean: If true, then XMLHttpTransport will keep an internal cache of the server
// response and use that response if a similar request is done again.
// A similar request is one that has the same URL, query string and HTTP method value.
// default is false.
if(!kwArgs["url"]){
// are we performing a history action?
if( !kwArgs["formNode"]
&& (kwArgs["backButton"] || kwArgs["back"] || kwArgs["changeUrl"] || kwArgs["watchForURL"])
&& (!djConfig.preventBackButtonFix)) {
dojo.deprecated("Using dojo.io.XMLHTTPTransport.bind() to add to browser history without doing an IO request",
"Use dojo.undo.browser.addToHistory() instead.", "0.4");
dojo.undo.browser.addToHistory(kwArgs);
return true;
}
}
 
// build this first for cache purposes
var url = kwArgs.url;
var query = "";
if(kwArgs["formNode"]){
var ta = kwArgs.formNode.getAttribute("action");
if((ta)&&(!kwArgs["url"])){ url = ta; }
var tp = kwArgs.formNode.getAttribute("method");
if((tp)&&(!kwArgs["method"])){ kwArgs.method = tp; }
query += dojo.io.encodeForm(kwArgs.formNode, kwArgs.encoding, kwArgs["formFilter"]);
}
 
if(url.indexOf("#") > -1) {
dojo.debug("Warning: dojo.io.bind: stripping hash values from url:", url);
url = url.split("#")[0];
}
 
if(kwArgs["file"]){
// force post for file transfer
kwArgs.method = "post";
}
 
if(!kwArgs["method"]){
kwArgs.method = "get";
}
 
// guess the multipart value
if(kwArgs.method.toLowerCase() == "get"){
// GET cannot use multipart
kwArgs.multipart = false;
}else{
if(kwArgs["file"]){
// enforce multipart when sending files
kwArgs.multipart = true;
}else if(!kwArgs["multipart"]){
// default
kwArgs.multipart = false;
}
}
 
if(kwArgs["backButton"] || kwArgs["back"] || kwArgs["changeUrl"]){
dojo.undo.browser.addToHistory(kwArgs);
}
 
var content = kwArgs["content"] || {};
 
if(kwArgs.sendTransport) {
content["dojo.transport"] = "xmlhttp";
}
 
do { // break-block
if(kwArgs.postContent){
query = kwArgs.postContent;
break;
}
 
if(content) {
query += dojo.io.argsFromMap(content, kwArgs.encoding);
}
if(kwArgs.method.toLowerCase() == "get" || !kwArgs.multipart){
break;
}
 
var t = [];
if(query.length){
var q = query.split("&");
for(var i = 0; i < q.length; ++i){
if(q[i].length){
var p = q[i].split("=");
t.push( "--" + this.multipartBoundary,
"Content-Disposition: form-data; name=\"" + p[0] + "\"",
"",
p[1]);
}
}
}
 
if(kwArgs.file){
if(dojo.lang.isArray(kwArgs.file)){
for(var i = 0; i < kwArgs.file.length; ++i){
var o = kwArgs.file[i];
t.push( "--" + this.multipartBoundary,
"Content-Disposition: form-data; name=\"" + o.name + "\"; filename=\"" + ("fileName" in o ? o.fileName : o.name) + "\"",
"Content-Type: " + ("contentType" in o ? o.contentType : "application/octet-stream"),
"",
o.content);
}
}else{
var o = kwArgs.file;
t.push( "--" + this.multipartBoundary,
"Content-Disposition: form-data; name=\"" + o.name + "\"; filename=\"" + ("fileName" in o ? o.fileName : o.name) + "\"",
"Content-Type: " + ("contentType" in o ? o.contentType : "application/octet-stream"),
"",
o.content);
}
}
 
if(t.length){
t.push("--"+this.multipartBoundary+"--", "");
query = t.join("\r\n");
}
}while(false);
 
// kwArgs.Connection = "close";
 
var async = kwArgs["sync"] ? false : true;
 
var preventCache = kwArgs["preventCache"] ||
(this.preventCache == true && kwArgs["preventCache"] != false);
var useCache = kwArgs["useCache"] == true ||
(this.useCache == true && kwArgs["useCache"] != false );
 
// preventCache is browser-level (add query string junk), useCache
// is for the local cache. If we say preventCache, then don't attempt
// to look in the cache, but if useCache is true, we still want to cache
// the response
if(!preventCache && useCache){
var cachedHttp = getFromCache(url, query, kwArgs.method);
if(cachedHttp){
doLoad(kwArgs, cachedHttp, url, query, false);
return;
}
}
 
// much of this is from getText, but reproduced here because we need
// more flexibility
var http = dojo.hostenv.getXmlhttpObject(kwArgs);
var received = false;
 
// build a handler function that calls back to the handler obj
if(async){
var startTime =
// FIXME: setting up this callback handler leaks on IE!!!
this.inFlight.push({
"req": kwArgs,
"http": http,
"url": url,
"query": query,
"useCache": useCache,
"startTime": kwArgs.timeoutSeconds ? (new Date()).getTime() : 0
});
this.startWatchingInFlight();
}else{
// block async callbacks until sync is in, needed in khtml, others?
_this._blockAsync = true;
}
 
if(kwArgs.method.toLowerCase() == "post"){
// FIXME: need to hack in more flexible Content-Type setting here!
if (!kwArgs.user) {
http.open("POST", url, async);
}else{
http.open("POST", url, async, kwArgs.user, kwArgs.password);
}
setHeaders(http, kwArgs);
http.setRequestHeader("Content-Type", kwArgs.multipart ? ("multipart/form-data; boundary=" + this.multipartBoundary) :
(kwArgs.contentType || "application/x-www-form-urlencoded"));
try{
http.send(query);
}catch(e){
if(typeof http.abort == "function"){
http.abort();
}
doLoad(kwArgs, {status: 404}, url, query, useCache);
}
}else{
var tmpUrl = url;
if(query != "") {
tmpUrl += (tmpUrl.indexOf("?") > -1 ? "&" : "?") + query;
}
if(preventCache) {
tmpUrl += (dojo.string.endsWithAny(tmpUrl, "?", "&")
? "" : (tmpUrl.indexOf("?") > -1 ? "&" : "?")) + "dojo.preventCache=" + new Date().valueOf();
}
if (!kwArgs.user) {
http.open(kwArgs.method.toUpperCase(), tmpUrl, async);
}else{
http.open(kwArgs.method.toUpperCase(), tmpUrl, async, kwArgs.user, kwArgs.password);
}
setHeaders(http, kwArgs);
try {
http.send(null);
}catch(e) {
if(typeof http.abort == "function"){
http.abort();
}
doLoad(kwArgs, {status: 404}, url, query, useCache);
}
}
 
if( !async ) {
doLoad(kwArgs, http, url, query, useCache);
_this._blockAsync = false;
}
 
kwArgs.abort = function(){
try{// khtml doesent reset readyState on abort, need this workaround
http._aborted = true;
}catch(e){/*squelsh*/}
return http.abort();
}
 
return;
}
dojo.io.transports.addTransport("XMLHTTPTransport");
}
 
}
 
dojo.provide("dojo.io.cookie");
 
dojo.io.cookie.setCookie = function(/*String*/name, /*String*/value,
/*Number?*/days, /*String?*/path,
/*String?*/domain, /*boolean?*/secure){
//summary: sets a cookie.
var expires = -1;
if((typeof days == "number")&&(days >= 0)){
var d = new Date();
d.setTime(d.getTime()+(days*24*60*60*1000));
expires = d.toGMTString();
}
value = escape(value);
document.cookie = name + "=" + value + ";"
+ (expires != -1 ? " expires=" + expires + ";" : "")
+ (path ? "path=" + path : "")
+ (domain ? "; domain=" + domain : "")
+ (secure ? "; secure" : "");
}
 
dojo.io.cookie.set = dojo.io.cookie.setCookie;
 
dojo.io.cookie.getCookie = function(/*String*/name){
//summary: Gets a cookie with the given name.
 
// FIXME: Which cookie should we return?
// If there are cookies set for different sub domains in the current
// scope there could be more than one cookie with the same name.
// I think taking the last one in the list takes the one from the
// deepest subdomain, which is what we're doing here.
var idx = document.cookie.lastIndexOf(name+'=');
if(idx == -1) { return null; }
var value = document.cookie.substring(idx+name.length+1);
var end = value.indexOf(';');
if(end == -1) { end = value.length; }
value = value.substring(0, end);
value = unescape(value);
return value; //String
}
 
dojo.io.cookie.get = dojo.io.cookie.getCookie;
 
dojo.io.cookie.deleteCookie = function(/*String*/name){
//summary: Deletes a cookie with the given name.
dojo.io.cookie.setCookie(name, "-", 0);
}
 
dojo.io.cookie.setObjectCookie = function( /*String*/name, /*Object*/obj,
/*Number?*/days, /*String?*/path,
/*String?*/domain, /*boolean?*/secure,
/*boolean?*/clearCurrent){
//summary: Takes an object, serializes it to a cookie value, and either
//sets a cookie with the serialized value.
//description: If clearCurrent is true, then any current cookie value
//for this object will be replaced with the the new serialized object value.
//If clearCurrent is false, then the existing cookie value will be modified
//with any changes from the new object value.
//Objects must be simple name/value pairs where the value is either a string
//or a number. Any other value will be ignored.
if(arguments.length == 5){ // for backwards compat
clearCurrent = domain;
domain = null;
secure = null;
}
var pairs = [], cookie, value = "";
if(!clearCurrent){
cookie = dojo.io.cookie.getObjectCookie(name);
}
if(days >= 0){
if(!cookie){ cookie = {}; }
for(var prop in obj){
if(obj[prop] == null){
delete cookie[prop];
}else if((typeof obj[prop] == "string")||(typeof obj[prop] == "number")){
cookie[prop] = obj[prop];
}
}
prop = null;
for(var prop in cookie){
pairs.push(escape(prop) + "=" + escape(cookie[prop]));
}
value = pairs.join("&");
}
dojo.io.cookie.setCookie(name, value, days, path, domain, secure);
}
 
dojo.io.cookie.getObjectCookie = function(/*String*/name){
//summary: Gets an object value for the given cookie name. The complement of
//dojo.io.cookie.setObjectCookie().
var values = null, cookie = dojo.io.cookie.getCookie(name);
if(cookie){
values = {};
var pairs = cookie.split("&");
for(var i = 0; i < pairs.length; i++){
var pair = pairs[i].split("=");
var value = pair[1];
if( isNaN(value) ){ value = unescape(pair[1]); }
values[ unescape(pair[0]) ] = value;
}
}
return values;
}
 
dojo.io.cookie.isSupported = function(){
//summary: Tests the browser to see if cookies are enabled.
if(typeof navigator.cookieEnabled != "boolean"){
dojo.io.cookie.setCookie("__TestingYourBrowserForCookieSupport__",
"CookiesAllowed", 90, null);
var cookieVal = dojo.io.cookie.getCookie("__TestingYourBrowserForCookieSupport__");
navigator.cookieEnabled = (cookieVal == "CookiesAllowed");
if(navigator.cookieEnabled){
// FIXME: should we leave this around?
this.deleteCookie("__TestingYourBrowserForCookieSupport__");
}
}
return navigator.cookieEnabled; //boolean
}
 
// need to leave this in for backwards-compat from 0.1 for when it gets pulled in by dojo.io.*
if(!dojo.io.cookies){ dojo.io.cookies = dojo.io.cookie; }
 
dojo.kwCompoundRequire({
common: ["dojo.io.common"],
rhino: ["dojo.io.RhinoIO"],
browser: ["dojo.io.BrowserIO", "dojo.io.cookie"],
dashboard: ["dojo.io.BrowserIO", "dojo.io.cookie"]
});
dojo.provide("dojo.io.*");
 
dojo.provide("dojo.event.common");
 
 
 
 
 
// TODO: connection filter functions
// these are functions that accept a method invocation (like around
// advice) and return a boolean based on it. That value determines
// whether or not the connection proceeds. It could "feel" like around
// advice for those who know what it is (calling proceed() or not),
// but I think presenting it as a "filter" and/or calling it with the
// function args and not the MethodInvocation might make it more
// palletable to "normal" users than around-advice currently is
// TODO: execution scope mangling
// YUI's event facility by default executes listeners in the context
// of the source object. This is very odd, but should probably be
// supported as an option (both for the source and for the dest). It
// can be thought of as a connection-specific hitch().
// TODO: more resiliency for 4+ arguments to connect()
 
dojo.event = new function(){
this._canTimeout = dojo.lang.isFunction(dj_global["setTimeout"])||dojo.lang.isAlien(dj_global["setTimeout"]);
 
// FIXME: where should we put this method (not here!)?
function interpolateArgs(args, searchForNames){
var dl = dojo.lang;
var ao = {
srcObj: dj_global,
srcFunc: null,
adviceObj: dj_global,
adviceFunc: null,
aroundObj: null,
aroundFunc: null,
adviceType: (args.length>2) ? args[0] : "after",
precedence: "last",
once: false,
delay: null,
rate: 0,
adviceMsg: false,
maxCalls: -1
};
 
switch(args.length){
case 0: return;
case 1: return;
case 2:
ao.srcFunc = args[0];
ao.adviceFunc = args[1];
break;
case 3:
if((dl.isObject(args[0]))&&(dl.isString(args[1]))&&(dl.isString(args[2]))){
ao.adviceType = "after";
ao.srcObj = args[0];
ao.srcFunc = args[1];
ao.adviceFunc = args[2];
}else if((dl.isString(args[1]))&&(dl.isString(args[2]))){
ao.srcFunc = args[1];
ao.adviceFunc = args[2];
}else if((dl.isObject(args[0]))&&(dl.isString(args[1]))&&(dl.isFunction(args[2]))){
ao.adviceType = "after";
ao.srcObj = args[0];
ao.srcFunc = args[1];
var tmpName = dl.nameAnonFunc(args[2], ao.adviceObj, searchForNames);
ao.adviceFunc = tmpName;
}else if((dl.isFunction(args[0]))&&(dl.isObject(args[1]))&&(dl.isString(args[2]))){
ao.adviceType = "after";
ao.srcObj = dj_global;
var tmpName = dl.nameAnonFunc(args[0], ao.srcObj, searchForNames);
ao.srcFunc = tmpName;
ao.adviceObj = args[1];
ao.adviceFunc = args[2];
}
break;
case 4:
if((dl.isObject(args[0]))&&(dl.isObject(args[2]))){
// we can assume that we've got an old-style "connect" from
// the sigslot school of event attachment. We therefore
// assume after-advice.
ao.adviceType = "after";
ao.srcObj = args[0];
ao.srcFunc = args[1];
ao.adviceObj = args[2];
ao.adviceFunc = args[3];
}else if((dl.isString(args[0]))&&(dl.isString(args[1]))&&(dl.isObject(args[2]))){
ao.adviceType = args[0];
ao.srcObj = dj_global;
ao.srcFunc = args[1];
ao.adviceObj = args[2];
ao.adviceFunc = args[3];
}else if((dl.isString(args[0]))&&(dl.isFunction(args[1]))&&(dl.isObject(args[2]))){
ao.adviceType = args[0];
ao.srcObj = dj_global;
var tmpName = dl.nameAnonFunc(args[1], dj_global, searchForNames);
ao.srcFunc = tmpName;
ao.adviceObj = args[2];
ao.adviceFunc = args[3];
}else if((dl.isString(args[0]))&&(dl.isObject(args[1]))&&(dl.isString(args[2]))&&(dl.isFunction(args[3]))){
ao.srcObj = args[1];
ao.srcFunc = args[2];
var tmpName = dl.nameAnonFunc(args[3], dj_global, searchForNames);
ao.adviceObj = dj_global;
ao.adviceFunc = tmpName;
}else if(dl.isObject(args[1])){
ao.srcObj = args[1];
ao.srcFunc = args[2];
ao.adviceObj = dj_global;
ao.adviceFunc = args[3];
}else if(dl.isObject(args[2])){
ao.srcObj = dj_global;
ao.srcFunc = args[1];
ao.adviceObj = args[2];
ao.adviceFunc = args[3];
}else{
ao.srcObj = ao.adviceObj = ao.aroundObj = dj_global;
ao.srcFunc = args[1];
ao.adviceFunc = args[2];
ao.aroundFunc = args[3];
}
break;
case 6:
ao.srcObj = args[1];
ao.srcFunc = args[2];
ao.adviceObj = args[3]
ao.adviceFunc = args[4];
ao.aroundFunc = args[5];
ao.aroundObj = dj_global;
break;
default:
ao.srcObj = args[1];
ao.srcFunc = args[2];
ao.adviceObj = args[3]
ao.adviceFunc = args[4];
ao.aroundObj = args[5];
ao.aroundFunc = args[6];
ao.once = args[7];
ao.delay = args[8];
ao.rate = args[9];
ao.adviceMsg = args[10];
ao.maxCalls = (!isNaN(parseInt(args[11]))) ? args[11] : -1;
break;
}
 
if(dl.isFunction(ao.aroundFunc)){
var tmpName = dl.nameAnonFunc(ao.aroundFunc, ao.aroundObj, searchForNames);
ao.aroundFunc = tmpName;
}
 
if(dl.isFunction(ao.srcFunc)){
ao.srcFunc = dl.getNameInObj(ao.srcObj, ao.srcFunc);
}
 
if(dl.isFunction(ao.adviceFunc)){
ao.adviceFunc = dl.getNameInObj(ao.adviceObj, ao.adviceFunc);
}
 
if((ao.aroundObj)&&(dl.isFunction(ao.aroundFunc))){
ao.aroundFunc = dl.getNameInObj(ao.aroundObj, ao.aroundFunc);
}
 
if(!ao.srcObj){
dojo.raise("bad srcObj for srcFunc: "+ao.srcFunc);
}
if(!ao.adviceObj){
dojo.raise("bad adviceObj for adviceFunc: "+ao.adviceFunc);
}
if(!ao.adviceFunc){
dojo.debug("bad adviceFunc for srcFunc: "+ao.srcFunc);
dojo.debugShallow(ao);
}
return ao;
}
 
this.connect = function(/*...*/){
// summary:
// dojo.event.connect is the glue that holds most Dojo-based
// applications together. Most combinations of arguments are
// supported, with the connect() method attempting to disambiguate
// the implied types of positional parameters. The following will
// all work:
// dojo.event.connect("globalFunctionName1", "globalFunctionName2");
// dojo.event.connect(functionReference1, functionReference2);
// dojo.event.connect("globalFunctionName1", functionReference2);
// dojo.event.connect(functionReference1, "globalFunctionName2");
// dojo.event.connect(scope1, "functionName1", "globalFunctionName2");
// dojo.event.connect("globalFunctionName1", scope2, "functionName2");
// dojo.event.connect(scope1, "functionName1", scope2, "functionName2");
// dojo.event.connect("after", scope1, "functionName1", scope2, "functionName2");
// dojo.event.connect("before", scope1, "functionName1", scope2, "functionName2");
// dojo.event.connect("around", scope1, "functionName1",
// scope2, "functionName2",
// aroundFunctionReference);
// dojo.event.connect("around", scope1, "functionName1",
// scope2, "functionName2",
// scope3, "aroundFunctionName");
// dojo.event.connect("before-around", scope1, "functionName1",
// scope2, "functionName2",
// aroundFunctionReference);
// dojo.event.connect("after-around", scope1, "functionName1",
// scope2, "functionName2",
// aroundFunctionReference);
// dojo.event.connect("after-around", scope1, "functionName1",
// scope2, "functionName2",
// scope3, "aroundFunctionName");
// dojo.event.connect("around", scope1, "functionName1",
// scope2, "functionName2",
// scope3, "aroundFunctionName", true, 30);
// dojo.event.connect("around", scope1, "functionName1",
// scope2, "functionName2",
// scope3, "aroundFunctionName", null, null, 10);
// adviceType:
// Optional. String. One of "before", "after", "around",
// "before-around", or "after-around". FIXME
// srcObj:
// the scope in which to locate/execute the named srcFunc. Along
// with srcFunc, this creates a way to dereference the function to
// call. So if the function in question is "foo.bar", the
// srcObj/srcFunc pair would be foo and "bar", where "bar" is a
// string and foo is an object reference.
// srcFunc:
// the name of the function to connect to. When it is executed,
// the listener being registered with this call will be called.
// The adviceType defines the call order between the source and
// the target functions.
// adviceObj:
// the scope in which to locate/execute the named adviceFunc.
// adviceFunc:
// the name of the function being conected to srcObj.srcFunc
// aroundObj:
// the scope in which to locate/execute the named aroundFunc.
// aroundFunc:
// the name of, or a reference to, the function that will be used
// to mediate the advice call. Around advice requires a special
// unary function that will be passed a "MethodInvocation" object.
// These objects have several important properties, namely:
// - args
// a mutable array of arguments to be passed into the
// wrapped function
// - proceed
// a function that "continues" the invocation. The result
// of this function is the return of the wrapped function.
// You can then manipulate this return before passing it
// back out (or take further action based on it).
// once:
// boolean that determines whether or not this connect() will
// create a new connection if an identical connect() has already
// been made. Defaults to "false".
// delay:
// an optional delay (in ms), as an integer, for dispatch of a
// listener after the source has been fired.
// rate:
// an optional rate throttling parameter (integer, in ms). When
// specified, this particular connection will not fire more than
// once in the interval specified by the rate
// adviceMsg:
// boolean. Should the listener have all the parameters passed in
// as a single argument?
 
/*
ao.adviceType = args[0];
ao.srcObj = args[1];
ao.srcFunc = args[2];
ao.adviceObj = args[3]
ao.adviceFunc = args[4];
ao.aroundObj = args[5];
ao.aroundFunc = args[6];
ao.once = args[7];
ao.delay = args[8];
ao.rate = args[9];
ao.adviceMsg = args[10];
ao.maxCalls = args[11];
*/
if(arguments.length == 1){
var ao = arguments[0];
}else{
var ao = interpolateArgs(arguments, true);
}
/*
if(dojo.lang.isString(ao.srcFunc) && (ao.srcFunc.toLowerCase() == "onkey") ){
if(dojo.render.html.ie){
ao.srcFunc = "onkeydown";
this.connect(ao);
}
ao.srcFunc = "onkeypress";
}
*/
 
if(dojo.lang.isArray(ao.srcObj) && ao.srcObj!=""){
var tmpAO = {};
for(var x in ao){
tmpAO[x] = ao[x];
}
var mjps = [];
dojo.lang.forEach(ao.srcObj, function(src){
if((dojo.render.html.capable)&&(dojo.lang.isString(src))){
src = dojo.byId(src);
// dojo.debug(src);
}
tmpAO.srcObj = src;
// dojo.debug(tmpAO.srcObj, tmpAO.srcFunc);
// dojo.debug(tmpAO.adviceObj, tmpAO.adviceFunc);
mjps.push(dojo.event.connect.call(dojo.event, tmpAO));
});
return mjps;
}
 
// FIXME: just doing a "getForMethod()" seems to be enough to put this into infinite recursion!!
var mjp = dojo.event.MethodJoinPoint.getForMethod(ao.srcObj, ao.srcFunc);
if(ao.adviceFunc){
var mjp2 = dojo.event.MethodJoinPoint.getForMethod(ao.adviceObj, ao.adviceFunc);
}
 
mjp.kwAddAdvice(ao);
 
// advanced users might want to fsck w/ the join point manually
return mjp; // a MethodJoinPoint object
}
 
this.log = function(/*object or funcName*/ a1, /*funcName*/ a2){
// summary:
// a function that will wrap and log all calls to the specified
// a1.a2() function. If only a1 is passed, it'll be used as a
// function or function name on the global context. Logging will
// be sent to dojo.debug
// a1:
// if a2 is passed, this should be an object. If not, it can be a
// function or function name.
// a2:
// a function name
var kwArgs;
if((arguments.length == 1)&&(typeof a1 == "object")){
kwArgs = a1;
}else{
kwArgs = {
srcObj: a1,
srcFunc: a2
};
}
kwArgs.adviceFunc = function(){
var argsStr = [];
for(var x=0; x<arguments.length; x++){
argsStr.push(arguments[x]);
}
dojo.debug("("+kwArgs.srcObj+")."+kwArgs.srcFunc, ":", argsStr.join(", "));
};
this.kwConnect(kwArgs);
}
 
this.connectBefore = function(){
// summary:
// takes the same parameters as dojo.event.connect(), except that
// the advice type will always be "before"
var args = ["before"];
for(var i = 0; i < arguments.length; i++){ args.push(arguments[i]); }
return this.connect.apply(this, args); // a MethodJoinPoint object
}
 
this.connectAround = function(){
// summary:
// takes the same parameters as dojo.event.connect(), except that
// the advice type will always be "around"
var args = ["around"];
for(var i = 0; i < arguments.length; i++){ args.push(arguments[i]); }
return this.connect.apply(this, args); // a MethodJoinPoint object
}
 
this.connectOnce = function(){
// summary:
// takes the same parameters as dojo.event.connect(), except that
// the "once" flag will always be set to "true"
var ao = interpolateArgs(arguments, true);
ao.once = true;
return this.connect(ao); // a MethodJoinPoint object
}
 
this.connectRunOnce = function(){
// summary:
// takes the same parameters as dojo.event.connect(), except that
// the "maxCalls" flag will always be set to 1
var ao = interpolateArgs(arguments, true);
ao.maxCalls = 1;
return this.connect(ao); // a MethodJoinPoint object
}
 
this._kwConnectImpl = function(kwArgs, disconnect){
var fn = (disconnect) ? "disconnect" : "connect";
if(typeof kwArgs["srcFunc"] == "function"){
kwArgs.srcObj = kwArgs["srcObj"]||dj_global;
var tmpName = dojo.lang.nameAnonFunc(kwArgs.srcFunc, kwArgs.srcObj, true);
kwArgs.srcFunc = tmpName;
}
if(typeof kwArgs["adviceFunc"] == "function"){
kwArgs.adviceObj = kwArgs["adviceObj"]||dj_global;
var tmpName = dojo.lang.nameAnonFunc(kwArgs.adviceFunc, kwArgs.adviceObj, true);
kwArgs.adviceFunc = tmpName;
}
kwArgs.srcObj = kwArgs["srcObj"]||dj_global;
kwArgs.adviceObj = kwArgs["adviceObj"]||kwArgs["targetObj"]||dj_global;
kwArgs.adviceFunc = kwArgs["adviceFunc"]||kwArgs["targetFunc"];
// pass kwargs to avoid unrolling/repacking
return dojo.event[fn](kwArgs);
}
 
this.kwConnect = function(/*Object*/ kwArgs){
// summary:
// A version of dojo.event.connect() that takes a map of named
// parameters instead of the positional parameters that
// dojo.event.connect() uses. For many advanced connection types,
// this can be a much more readable (and potentially faster)
// alternative.
// kwArgs:
// An object that can have the following properties:
// - adviceType
// - srcObj
// - srcFunc
// - adviceObj
// - adviceFunc
// - aroundObj
// - aroundFunc
// - once
// - delay
// - rate
// - adviceMsg
// As with connect, only srcFunc and adviceFunc are generally
// required
 
return this._kwConnectImpl(kwArgs, false); // a MethodJoinPoint object
 
}
 
this.disconnect = function(){
// summary:
// Takes the same parameters as dojo.event.connect() but destroys
// an existing connection instead of building a new one. For
// multiple identical connections, multiple disconnect() calls
// will unroll one each time it's called.
if(arguments.length == 1){
var ao = arguments[0];
}else{
var ao = interpolateArgs(arguments, true);
}
if(!ao.adviceFunc){ return; } // nothing to disconnect
if(dojo.lang.isString(ao.srcFunc) && (ao.srcFunc.toLowerCase() == "onkey") ){
if(dojo.render.html.ie){
ao.srcFunc = "onkeydown";
this.disconnect(ao);
}
ao.srcFunc = "onkeypress";
}
if(!ao.srcObj[ao.srcFunc]){ return null; } // prevent un-necessaray joinpoint creation
var mjp = dojo.event.MethodJoinPoint.getForMethod(ao.srcObj, ao.srcFunc, true);
mjp.removeAdvice(ao.adviceObj, ao.adviceFunc, ao.adviceType, ao.once); // a MethodJoinPoint object
return mjp;
}
 
this.kwDisconnect = function(kwArgs){
// summary:
// Takes the same parameters as dojo.event.kwConnect() but
// destroys an existing connection instead of building a new one.
return this._kwConnectImpl(kwArgs, true);
}
}
 
// exactly one of these is created whenever a method with a joint point is run,
// if there is at least one 'around' advice.
dojo.event.MethodInvocation = function(/*dojo.event.MethodJoinPoint*/join_point, /*Object*/obj, /*Array*/args){
// summary:
// a class the models the call into a function. This is used under the
// covers for all method invocations on both ends of a
// connect()-wrapped function dispatch. This allows us to "pickle"
// calls, such as in the case of around advice.
// join_point:
// a dojo.event.MethodJoinPoint object that represents a connection
// obj:
// the scope the call will execute in
// args:
// an array of parameters that will get passed to the callee
this.jp_ = join_point;
this.object = obj;
this.args = [];
// make sure we don't lock into a mutable object which can change under us.
// It's ok if the individual items change, though.
for(var x=0; x<args.length; x++){
this.args[x] = args[x];
}
// the index of the 'around' that is currently being executed.
this.around_index = -1;
}
 
dojo.event.MethodInvocation.prototype.proceed = function(){
// summary:
// proceed with the method call that's represented by this invocation
// object
this.around_index++;
if(this.around_index >= this.jp_.around.length){
return this.jp_.object[this.jp_.methodname].apply(this.jp_.object, this.args);
// return this.jp_.run_before_after(this.object, this.args);
}else{
var ti = this.jp_.around[this.around_index];
var mobj = ti[0]||dj_global;
var meth = ti[1];
return mobj[meth].call(mobj, this);
}
}
 
 
dojo.event.MethodJoinPoint = function(/*Object*/obj, /*String*/funcName){
this.object = obj||dj_global;
this.methodname = funcName;
this.methodfunc = this.object[funcName];
this.squelch = false;
// this.before = [];
// this.after = [];
// this.around = [];
}
 
dojo.event.MethodJoinPoint.getForMethod = function(/*Object*/obj, /*String*/funcName){
// summary:
// "static" class function for returning a MethodJoinPoint from a
// scoped function. If one doesn't exist, one is created.
// obj:
// the scope to search for the function in
// funcName:
// the name of the function to return a MethodJoinPoint for
if(!obj){ obj = dj_global; }
var ofn = obj[funcName];
if(!ofn){
// supply a do-nothing method implementation
ofn = obj[funcName] = function(){};
if(!obj[funcName]){
// e.g. cannot add to inbuilt objects in IE6
dojo.raise("Cannot set do-nothing method on that object "+funcName);
}
}else if((typeof ofn != "function")&&(!dojo.lang.isFunction(ofn))&&(!dojo.lang.isAlien(ofn))){
// FIXME: should we throw an exception here instead?
return null;
}
// we hide our joinpoint instance in obj[funcName + '$joinpoint']
var jpname = funcName + "$joinpoint";
var jpfuncname = funcName + "$joinpoint$method";
var joinpoint = obj[jpname];
if(!joinpoint){
var isNode = false;
if(dojo.event["browser"]){
if( (obj["attachEvent"])||
(obj["nodeType"])||
(obj["addEventListener"]) ){
isNode = true;
dojo.event.browser.addClobberNodeAttrs(obj, [jpname, jpfuncname, funcName]);
}
}
var origArity = ofn.length;
obj[jpfuncname] = ofn;
// joinpoint = obj[jpname] = new dojo.event.MethodJoinPoint(obj, funcName);
joinpoint = obj[jpname] = new dojo.event.MethodJoinPoint(obj, jpfuncname);
 
if(!isNode){
obj[funcName] = function(){
// var args = [];
// for(var x=0; x<arguments.length; x++){
// args.push(arguments[x]);
// }
// return joinpoint.run.apply(joinpoint, args);
return joinpoint.run.apply(joinpoint, arguments);
}
}else{
obj[funcName] = function(){
var args = [];
 
if(!arguments.length){
var evt = null;
try{
if(obj.ownerDocument){
evt = obj.ownerDocument.parentWindow.event;
}else if(obj.documentElement){
evt = obj.documentElement.ownerDocument.parentWindow.event;
}else if(obj.event){ //obj is a window
evt = obj.event;
}else{
evt = window.event;
}
}catch(e){
evt = window.event;
}
 
if(evt){
args.push(dojo.event.browser.fixEvent(evt, this));
}
}else{
for(var x=0; x<arguments.length; x++){
if((x==0)&&(dojo.event.browser.isEvent(arguments[x]))){
args.push(dojo.event.browser.fixEvent(arguments[x], this));
}else{
args.push(arguments[x]);
}
}
}
// return joinpoint.run.apply(joinpoint, arguments);
return joinpoint.run.apply(joinpoint, args);
}
}
obj[funcName].__preJoinArity = origArity;
}
return joinpoint; // dojo.event.MethodJoinPoint
}
 
dojo.lang.extend(dojo.event.MethodJoinPoint, {
squelch: false,
 
unintercept: function(){
// summary:
// destroy the connection to all listeners that may have been
// registered on this joinpoint
this.object[this.methodname] = this.methodfunc;
this.before = [];
this.after = [];
this.around = [];
},
 
disconnect: dojo.lang.forward("unintercept"),
 
run: function(){
// summary:
// execute the connection represented by this join point. The
// arguments passed to run() will be passed to the function and
// its listeners.
var obj = this.object||dj_global;
var args = arguments;
 
// optimization. We only compute once the array version of the arguments
// pseudo-arr in order to prevent building it each time advice is unrolled.
var aargs = [];
for(var x=0; x<args.length; x++){
aargs[x] = args[x];
}
 
var unrollAdvice = function(marr){
if(!marr){
dojo.debug("Null argument to unrollAdvice()");
return;
}
var callObj = marr[0]||dj_global;
var callFunc = marr[1];
if(!callObj[callFunc]){
dojo.raise("function \"" + callFunc + "\" does not exist on \"" + callObj + "\"");
}
var aroundObj = marr[2]||dj_global;
var aroundFunc = marr[3];
var msg = marr[6];
var maxCount = marr[7];
if(maxCount > -1){
if(maxCount == 0){
return;
}
marr[7]--;
}
var undef;
 
var to = {
args: [],
jp_: this,
object: obj,
proceed: function(){
return callObj[callFunc].apply(callObj, to.args);
}
};
to.args = aargs;
 
var delay = parseInt(marr[4]);
var hasDelay = ((!isNaN(delay))&&(marr[4]!==null)&&(typeof marr[4] != "undefined"));
if(marr[5]){
var rate = parseInt(marr[5]);
var cur = new Date();
var timerSet = false;
if((marr["last"])&&((cur-marr.last)<=rate)){
if(dojo.event._canTimeout){
if(marr["delayTimer"]){
clearTimeout(marr.delayTimer);
}
var tod = parseInt(rate*2); // is rate*2 naive?
var mcpy = dojo.lang.shallowCopy(marr);
marr.delayTimer = setTimeout(function(){
// FIXME: on IE at least, event objects from the
// browser can go out of scope. How (or should?) we
// deal with it?
mcpy[5] = 0;
unrollAdvice(mcpy);
}, tod);
}
return;
}else{
marr.last = cur;
}
}
 
// FIXME: need to enforce rates for a connection here!
 
if(aroundFunc){
// NOTE: around advice can't delay since we might otherwise depend
// on execution order!
aroundObj[aroundFunc].call(aroundObj, to);
}else{
// var tmjp = dojo.event.MethodJoinPoint.getForMethod(obj, methname);
if((hasDelay)&&((dojo.render.html)||(dojo.render.svg))){ // FIXME: the render checks are grotty!
dj_global["setTimeout"](function(){
if(msg){
callObj[callFunc].call(callObj, to);
}else{
callObj[callFunc].apply(callObj, args);
}
}, delay);
}else{ // many environments can't support delay!
if(msg){
callObj[callFunc].call(callObj, to);
}else{
callObj[callFunc].apply(callObj, args);
}
}
}
};
 
var unRollSquelch = function(){
if(this.squelch){
try{
return unrollAdvice.apply(this, arguments);
}catch(e){
dojo.debug(e);
}
}else{
return unrollAdvice.apply(this, arguments);
}
};
 
if((this["before"])&&(this.before.length>0)){
// pass a cloned array, if this event disconnects this event forEach on this.before wont work
dojo.lang.forEach(this.before.concat(new Array()), unRollSquelch);
}
 
var result;
try{
if((this["around"])&&(this.around.length>0)){
var mi = new dojo.event.MethodInvocation(this, obj, args);
result = mi.proceed();
}else if(this.methodfunc){
result = this.object[this.methodname].apply(this.object, args);
}
}catch(e){
if(!this.squelch){
dojo.debug(e,"when calling",this.methodname,"on",this.object,"with arguments",args);
dojo.raise(e);
}
}
 
if((this["after"])&&(this.after.length>0)){
// see comment on this.before above
dojo.lang.forEach(this.after.concat(new Array()), unRollSquelch);
}
 
return (this.methodfunc) ? result : null;
},
 
getArr: function(/*String*/kind){
// summary: return a list of listeners of the past "kind"
// kind:
// can be one of: "before", "after", "around", "before-around", or
// "after-around"
var type = "after";
// FIXME: we should be able to do this through props or Array.in()
if((typeof kind == "string")&&(kind.indexOf("before")!=-1)){
type = "before";
}else if(kind=="around"){
type = "around";
}
if(!this[type]){ this[type] = []; }
return this[type]; // Array
},
 
kwAddAdvice: function(/*Object*/args){
// summary:
// adds advice to the joinpoint with arguments in a map
// args:
// An object that can have the following properties:
// - adviceType
// - adviceObj
// - adviceFunc
// - aroundObj
// - aroundFunc
// - once
// - delay
// - rate
// - adviceMsg
// - maxCalls
this.addAdvice( args["adviceObj"], args["adviceFunc"],
args["aroundObj"], args["aroundFunc"],
args["adviceType"], args["precedence"],
args["once"], args["delay"], args["rate"],
args["adviceMsg"], args["maxCalls"]);
},
 
addAdvice: function( thisAdviceObj, thisAdvice,
thisAroundObj, thisAround,
adviceType, precedence,
once, delay, rate, asMessage,
maxCalls){
// summary:
// add advice to this joinpoint using positional parameters
// thisAdviceObj:
// the scope in which to locate/execute the named adviceFunc.
// thisAdviceFunc:
// the name of the function being conected
// thisAroundObj:
// the scope in which to locate/execute the named aroundFunc.
// thisAroundFunc:
// the name of the function that will be used to mediate the
// advice call.
// adviceType:
// Optional. String. One of "before", "after", "around",
// "before-around", or "after-around". FIXME
// once:
// boolean that determines whether or not this advice will create
// a new connection if an identical advice set has already been
// provided. Defaults to "false".
// delay:
// an optional delay (in ms), as an integer, for dispatch of a
// listener after the source has been fired.
// rate:
// an optional rate throttling parameter (integer, in ms). When
// specified, this particular connection will not fire more than
// once in the interval specified by the rate
// adviceMsg:
// boolean. Should the listener have all the parameters passed in
// as a single argument?
// maxCalls:
// Integer. The maximum number of times this connection can be
// used before being auto-disconnected. -1 signals that the
// connection should never be disconnected.
var arr = this.getArr(adviceType);
if(!arr){
dojo.raise("bad this: " + this);
}
 
var ao = [thisAdviceObj, thisAdvice, thisAroundObj, thisAround, delay, rate, asMessage, maxCalls];
if(once){
if(this.hasAdvice(thisAdviceObj, thisAdvice, adviceType, arr) >= 0){
return;
}
}
 
if(precedence == "first"){
arr.unshift(ao);
}else{
arr.push(ao);
}
},
 
hasAdvice: function(thisAdviceObj, thisAdvice, adviceType, arr){
// summary:
// returns the array index of the first existing connection
// betweened the passed advice and this joinpoint. Will be -1 if
// none exists.
// thisAdviceObj:
// the scope in which to locate/execute the named adviceFunc.
// thisAdviceFunc:
// the name of the function being conected
// adviceType:
// Optional. String. One of "before", "after", "around",
// "before-around", or "after-around". FIXME
// arr:
// Optional. The list of advices to search. Will be found via
// adviceType if not passed
if(!arr){ arr = this.getArr(adviceType); }
var ind = -1;
for(var x=0; x<arr.length; x++){
var aao = (typeof thisAdvice == "object") ? (new String(thisAdvice)).toString() : thisAdvice;
var a1o = (typeof arr[x][1] == "object") ? (new String(arr[x][1])).toString() : arr[x][1];
if((arr[x][0] == thisAdviceObj)&&(a1o == aao)){
ind = x;
}
}
return ind; // Integer
},
 
removeAdvice: function(thisAdviceObj, thisAdvice, adviceType, once){
// summary:
// returns the array index of the first existing connection
// betweened the passed advice and this joinpoint. Will be -1 if
// none exists.
// thisAdviceObj:
// the scope in which to locate/execute the named adviceFunc.
// thisAdviceFunc:
// the name of the function being conected
// adviceType:
// Optional. String. One of "before", "after", "around",
// "before-around", or "after-around". FIXME
// once:
// Optional. Should this only remove the first occurance of the
// connection?
var arr = this.getArr(adviceType);
var ind = this.hasAdvice(thisAdviceObj, thisAdvice, adviceType, arr);
if(ind == -1){
return false;
}
while(ind != -1){
arr.splice(ind, 1);
if(once){ break; }
ind = this.hasAdvice(thisAdviceObj, thisAdvice, adviceType, arr);
}
return true;
}
});
 
 
dojo.provide("dojo.event.topic");
 
dojo.event.topic = new function(){
this.topics = {};
 
this.getTopic = function(/*String*/topic){
// summary:
// returns a topic implementation object of type
// dojo.event.topic.TopicImpl
// topic:
// a unique, opaque string that names the topic
if(!this.topics[topic]){
this.topics[topic] = new this.TopicImpl(topic);
}
return this.topics[topic]; // a dojo.event.topic.TopicImpl object
}
 
this.registerPublisher = function(/*String*/topic, /*Object*/obj, /*String*/funcName){
// summary:
// registers a function as a publisher on a topic. Subsequent
// calls to the function will cause a publish event on the topic
// with the arguments passed to the function passed to registered
// listeners.
// topic:
// a unique, opaque string that names the topic
// obj:
// the scope to locate the function in
// funcName:
// the name of the function to register
var topic = this.getTopic(topic);
topic.registerPublisher(obj, funcName);
}
 
this.subscribe = function(/*String*/topic, /*Object*/obj, /*String*/funcName){
// summary:
// susbscribes the function to the topic. Subsequent events
// dispached to the topic will create a function call for the
// obj.funcName() function.
// topic:
// a unique, opaque string that names the topic
// obj:
// the scope to locate the function in
// funcName:
// the name of the function to being registered as a listener
var topic = this.getTopic(topic);
topic.subscribe(obj, funcName);
}
 
this.unsubscribe = function(/*String*/topic, /*Object*/obj, /*String*/funcName){
// summary:
// unsubscribes the obj.funcName() from the topic
// topic:
// a unique, opaque string that names the topic
// obj:
// the scope to locate the function in
// funcName:
// the name of the function to being unregistered as a listener
var topic = this.getTopic(topic);
topic.unsubscribe(obj, funcName);
}
 
this.destroy = function(/*String*/topic){
// summary:
// destroys the topic and unregisters all listeners
// topic:
// a unique, opaque string that names the topic
this.getTopic(topic).destroy();
delete this.topics[topic];
}
 
this.publishApply = function(/*String*/topic, /*Array*/args){
// summary:
// dispatches an event to the topic using the args array as the
// source for the call arguments to each listener. This is similar
// to JavaScript's built-in Function.apply()
// topic:
// a unique, opaque string that names the topic
// args:
// the arguments to be passed into listeners of the topic
var topic = this.getTopic(topic);
topic.sendMessage.apply(topic, args);
}
 
this.publish = function(/*String*/topic, /*Object*/message){
// summary:
// manually "publish" to the passed topic
// topic:
// a unique, opaque string that names the topic
// message:
// can be an array of parameters (similar to publishApply), or
// will be treated as one of many arguments to be passed along in
// a "flat" unrolling
var topic = this.getTopic(topic);
// if message is an array, we treat it as a set of arguments,
// otherwise, we just pass on the arguments passed in as-is
var args = [];
// could we use concat instead here?
for(var x=1; x<arguments.length; x++){
args.push(arguments[x]);
}
topic.sendMessage.apply(topic, args);
}
}
 
dojo.event.topic.TopicImpl = function(topicName){
// summary: a class to represent topics
 
this.topicName = topicName;
 
this.subscribe = function(/*Object*/listenerObject, /*Function or String*/listenerMethod){
// summary:
// use dojo.event.connect() to attach the passed listener to the
// topic represented by this object
// listenerObject:
// if a string and listenerMethod is ommitted, this is treated as
// the name of a function in the global namespace. If
// listenerMethod is provided, this is the scope to find/execute
// the function in.
// listenerMethod:
// Optional. The function to register.
var tf = listenerMethod||listenerObject;
var to = (!listenerMethod) ? dj_global : listenerObject;
return dojo.event.kwConnect({ // dojo.event.MethodJoinPoint
srcObj: this,
srcFunc: "sendMessage",
adviceObj: to,
adviceFunc: tf
});
}
 
this.unsubscribe = function(/*Object*/listenerObject, /*Function or String*/listenerMethod){
// summary:
// use dojo.event.disconnect() to attach the passed listener to the
// topic represented by this object
// listenerObject:
// if a string and listenerMethod is ommitted, this is treated as
// the name of a function in the global namespace. If
// listenerMethod is provided, this is the scope to find the
// function in.
// listenerMethod:
// Optional. The function to unregister.
var tf = (!listenerMethod) ? listenerObject : listenerMethod;
var to = (!listenerMethod) ? null : listenerObject;
return dojo.event.kwDisconnect({ // dojo.event.MethodJoinPoint
srcObj: this,
srcFunc: "sendMessage",
adviceObj: to,
adviceFunc: tf
});
}
 
this._getJoinPoint = function(){
return dojo.event.MethodJoinPoint.getForMethod(this, "sendMessage");
}
 
this.setSquelch = function(/*Boolean*/shouldSquelch){
// summary:
// determine whether or not exceptions in the calling of a
// listener in the chain should stop execution of the chain.
this._getJoinPoint().squelch = shouldSquelch;
}
 
this.destroy = function(){
// summary: disconnects all listeners from this topic
this._getJoinPoint().disconnect();
}
 
this.registerPublisher = function( /*Object*/publisherObject,
/*Function or String*/publisherMethod){
// summary:
// registers the passed function as a publisher on this topic.
// Each time the function is called, an event will be published on
// this topic.
// publisherObject:
// if a string and listenerMethod is ommitted, this is treated as
// the name of a function in the global namespace. If
// listenerMethod is provided, this is the scope to find the
// function in.
// publisherMethod:
// Optional. The function to register.
dojo.event.connect(publisherObject, publisherMethod, this, "sendMessage");
}
 
this.sendMessage = function(message){
// summary: a stub to be called when a message is sent to the topic.
 
// The message has been propagated
}
}
 
 
dojo.provide("dojo.event.browser");
 
 
// FIXME: any particular reason this is in the global scope?
dojo._ie_clobber = new function(){
this.clobberNodes = [];
 
function nukeProp(node, prop){
// try{ node.removeAttribute(prop); }catch(e){ /* squelch */ }
try{ node[prop] = null; }catch(e){ /* squelch */ }
try{ delete node[prop]; }catch(e){ /* squelch */ }
// FIXME: JotLive needs this, but I'm not sure if it's too slow or not
try{ node.removeAttribute(prop); }catch(e){ /* squelch */ }
}
 
this.clobber = function(nodeRef){
var na;
var tna;
if(nodeRef){
tna = nodeRef.all || nodeRef.getElementsByTagName("*");
na = [nodeRef];
for(var x=0; x<tna.length; x++){
// if we're gonna be clobbering the thing, at least make sure
// we aren't trying to do it twice
if(tna[x]["__doClobber__"]){
na.push(tna[x]);
}
}
}else{
try{ window.onload = null; }catch(e){}
na = (this.clobberNodes.length) ? this.clobberNodes : document.all;
}
tna = null;
var basis = {};
for(var i = na.length-1; i>=0; i=i-1){
var el = na[i];
try{
if(el && el["__clobberAttrs__"]){
for(var j=0; j<el.__clobberAttrs__.length; j++){
nukeProp(el, el.__clobberAttrs__[j]);
}
nukeProp(el, "__clobberAttrs__");
nukeProp(el, "__doClobber__");
}
}catch(e){ /* squelch! */};
}
na = null;
}
}
 
if(dojo.render.html.ie){
dojo.addOnUnload(function(){
dojo._ie_clobber.clobber();
try{
if((dojo["widget"])&&(dojo.widget["manager"])){
dojo.widget.manager.destroyAll();
}
}catch(e){}
 
// Workaround for IE leak recommended in ticket #1727 by schallm
if(dojo.widget){
for(var name in dojo.widget._templateCache){
if(dojo.widget._templateCache[name].node){
dojo.dom.destroyNode(dojo.widget._templateCache[name].node);
dojo.widget._templateCache[name].node = null;
delete dojo.widget._templateCache[name].node;
}
}
}
 
try{ window.onload = null; }catch(e){}
try{ window.onunload = null; }catch(e){}
dojo._ie_clobber.clobberNodes = [];
// CollectGarbage();
});
}
 
dojo.event.browser = new function(){
 
var clobberIdx = 0;
 
this.normalizedEventName = function(/*String*/eventName){
switch(eventName){
case "CheckboxStateChange":
case "DOMAttrModified":
case "DOMMenuItemActive":
case "DOMMenuItemInactive":
case "DOMMouseScroll":
case "DOMNodeInserted":
case "DOMNodeRemoved":
case "RadioStateChange":
return eventName;
break;
default:
var lcn = eventName.toLowerCase();
return (lcn.indexOf("on") == 0) ? lcn.substr(2) : lcn;
break;
}
}
this.clean = function(/*DOMNode*/node){
// summary:
// removes native event handlers so that destruction of the node
// will not leak memory. On most browsers this is a no-op, but
// it's critical for manual node removal on IE.
// node:
// A DOM node. All of it's children will also be cleaned.
if(dojo.render.html.ie){
dojo._ie_clobber.clobber(node);
}
}
 
this.addClobberNode = function(/*DOMNode*/node){
// summary:
// register the passed node to support event stripping
// node:
// A DOM node
if(!dojo.render.html.ie){ return; }
if(!node["__doClobber__"]){
node.__doClobber__ = true;
dojo._ie_clobber.clobberNodes.push(node);
// this might not be the most efficient thing to do, but it's
// much less error prone than other approaches which were
// previously tried and failed
node.__clobberAttrs__ = [];
}
}
 
this.addClobberNodeAttrs = function(/*DOMNode*/node, /*Array*/props){
// summary:
// register the passed node to support event stripping
// node:
// A DOM node to stip properties from later
// props:
// A list of propeties to strip from the node
if(!dojo.render.html.ie){ return; }
this.addClobberNode(node);
for(var x=0; x<props.length; x++){
node.__clobberAttrs__.push(props[x]);
}
}
 
this.removeListener = function( /*DOMNode*/ node,
/*String*/ evtName,
/*Function*/fp,
/*Boolean*/ capture){
// summary:
// clobbers the listener from the node
// evtName:
// the name of the handler to remove the function from
// node:
// DOM node to attach the event to
// fp:
// the function to register
// capture:
// Optional. should this listener prevent propigation?
if(!capture){ var capture = false; }
evtName = dojo.event.browser.normalizedEventName(evtName);
if(evtName == "key"){
if(dojo.render.html.ie){
this.removeListener(node, "onkeydown", fp, capture);
}
evtName = "keypress";
}
// FIXME: this is mostly a punt, we aren't actually doing anything on IE
if(node.removeEventListener){
node.removeEventListener(evtName, fp, capture);
}
}
 
this.addListener = function(/*DOMNode*/node, /*String*/evtName, /*Function*/fp, /*Boolean*/capture, /*Boolean*/dontFix){
// summary:
// adds a listener to the node
// evtName:
// the name of the handler to add the listener to can be either of
// the form "onclick" or "click"
// node:
// DOM node to attach the event to
// fp:
// the function to register
// capture:
// Optional. Should this listener prevent propigation?
// dontFix:
// Optional. Should we avoid registering a new closure around the
// listener to enable fixEvent for dispatch of the registered
// function?
if(!node){ return; } // FIXME: log and/or bail?
if(!capture){ var capture = false; }
evtName = dojo.event.browser.normalizedEventName(evtName);
if(evtName == "key"){
if(dojo.render.html.ie){
this.addListener(node, "onkeydown", fp, capture, dontFix);
}
evtName = "keypress";
}
 
if(!dontFix){
// build yet another closure around fp in order to inject fixEvent
// around the resulting event
var newfp = function(evt){
if(!evt){ evt = window.event; }
var ret = fp(dojo.event.browser.fixEvent(evt, this));
if(capture){
dojo.event.browser.stopEvent(evt);
}
return ret;
}
}else{
newfp = fp;
}
 
if(node.addEventListener){
node.addEventListener(evtName, newfp, capture);
return newfp;
}else{
evtName = "on"+evtName;
if(typeof node[evtName] == "function" ){
var oldEvt = node[evtName];
node[evtName] = function(e){
oldEvt(e);
return newfp(e);
}
}else{
node[evtName]=newfp;
}
if(dojo.render.html.ie){
this.addClobberNodeAttrs(node, [evtName]);
}
return newfp;
}
}
 
this.isEvent = function(/*Object*/obj){
// summary:
// Tries to determine whether or not the object is a DOM event.
 
// FIXME: event detection hack ... could test for additional attributes
// if necessary
return (typeof obj != "undefined")&&(obj)&&(typeof Event != "undefined")&&(obj.eventPhase); // Boolean
// Event does not support instanceof in Opera, otherwise:
//return (typeof Event != "undefined")&&(obj instanceof Event);
}
 
this.currentEvent = null;
this.callListener = function(/*Function*/listener, /*DOMNode*/curTarget){
// summary:
// calls the specified listener in the context of the passed node
// with the current DOM event object as the only parameter
// listener:
// the function to call
// curTarget:
// the Node to call the function in the scope of
if(typeof listener != 'function'){
dojo.raise("listener not a function: " + listener);
}
dojo.event.browser.currentEvent.currentTarget = curTarget;
return listener.call(curTarget, dojo.event.browser.currentEvent);
}
 
this._stopPropagation = function(){
dojo.event.browser.currentEvent.cancelBubble = true;
}
 
this._preventDefault = function(){
dojo.event.browser.currentEvent.returnValue = false;
}
 
this.keys = {
KEY_BACKSPACE: 8,
KEY_TAB: 9,
KEY_CLEAR: 12,
KEY_ENTER: 13,
KEY_SHIFT: 16,
KEY_CTRL: 17,
KEY_ALT: 18,
KEY_PAUSE: 19,
KEY_CAPS_LOCK: 20,
KEY_ESCAPE: 27,
KEY_SPACE: 32,
KEY_PAGE_UP: 33,
KEY_PAGE_DOWN: 34,
KEY_END: 35,
KEY_HOME: 36,
KEY_LEFT_ARROW: 37,
KEY_UP_ARROW: 38,
KEY_RIGHT_ARROW: 39,
KEY_DOWN_ARROW: 40,
KEY_INSERT: 45,
KEY_DELETE: 46,
KEY_HELP: 47,
KEY_LEFT_WINDOW: 91,
KEY_RIGHT_WINDOW: 92,
KEY_SELECT: 93,
KEY_NUMPAD_0: 96,
KEY_NUMPAD_1: 97,
KEY_NUMPAD_2: 98,
KEY_NUMPAD_3: 99,
KEY_NUMPAD_4: 100,
KEY_NUMPAD_5: 101,
KEY_NUMPAD_6: 102,
KEY_NUMPAD_7: 103,
KEY_NUMPAD_8: 104,
KEY_NUMPAD_9: 105,
KEY_NUMPAD_MULTIPLY: 106,
KEY_NUMPAD_PLUS: 107,
KEY_NUMPAD_ENTER: 108,
KEY_NUMPAD_MINUS: 109,
KEY_NUMPAD_PERIOD: 110,
KEY_NUMPAD_DIVIDE: 111,
KEY_F1: 112,
KEY_F2: 113,
KEY_F3: 114,
KEY_F4: 115,
KEY_F5: 116,
KEY_F6: 117,
KEY_F7: 118,
KEY_F8: 119,
KEY_F9: 120,
KEY_F10: 121,
KEY_F11: 122,
KEY_F12: 123,
KEY_F13: 124,
KEY_F14: 125,
KEY_F15: 126,
KEY_NUM_LOCK: 144,
KEY_SCROLL_LOCK: 145
};
 
// reverse lookup
this.revKeys = [];
for(var key in this.keys){
this.revKeys[this.keys[key]] = key;
}
 
this.fixEvent = function(/*Event*/evt, /*DOMNode*/sender){
// summary:
// normalizes properties on the event object including event
// bubbling methods, keystroke normalization, and x/y positions
// evt: the native event object
// sender: the node to treat as "currentTarget"
if(!evt){
if(window["event"]){
evt = window.event;
}
}
if((evt["type"])&&(evt["type"].indexOf("key") == 0)){ // key events
evt.keys = this.revKeys;
// FIXME: how can we eliminate this iteration?
for(var key in this.keys){
evt[key] = this.keys[key];
}
if(evt["type"] == "keydown" && dojo.render.html.ie){
switch(evt.keyCode){
case evt.KEY_SHIFT:
case evt.KEY_CTRL:
case evt.KEY_ALT:
case evt.KEY_CAPS_LOCK:
case evt.KEY_LEFT_WINDOW:
case evt.KEY_RIGHT_WINDOW:
case evt.KEY_SELECT:
case evt.KEY_NUM_LOCK:
case evt.KEY_SCROLL_LOCK:
// I'll get these in keypress after the OS munges them based on numlock
case evt.KEY_NUMPAD_0:
case evt.KEY_NUMPAD_1:
case evt.KEY_NUMPAD_2:
case evt.KEY_NUMPAD_3:
case evt.KEY_NUMPAD_4:
case evt.KEY_NUMPAD_5:
case evt.KEY_NUMPAD_6:
case evt.KEY_NUMPAD_7:
case evt.KEY_NUMPAD_8:
case evt.KEY_NUMPAD_9:
case evt.KEY_NUMPAD_PERIOD:
break; // just ignore the keys that can morph
case evt.KEY_NUMPAD_MULTIPLY:
case evt.KEY_NUMPAD_PLUS:
case evt.KEY_NUMPAD_ENTER:
case evt.KEY_NUMPAD_MINUS:
case evt.KEY_NUMPAD_DIVIDE:
break; // I could handle these but just pick them up in keypress
case evt.KEY_PAUSE:
case evt.KEY_TAB:
case evt.KEY_BACKSPACE:
case evt.KEY_ENTER:
case evt.KEY_ESCAPE:
case evt.KEY_PAGE_UP:
case evt.KEY_PAGE_DOWN:
case evt.KEY_END:
case evt.KEY_HOME:
case evt.KEY_LEFT_ARROW:
case evt.KEY_UP_ARROW:
case evt.KEY_RIGHT_ARROW:
case evt.KEY_DOWN_ARROW:
case evt.KEY_INSERT:
case evt.KEY_DELETE:
case evt.KEY_F1:
case evt.KEY_F2:
case evt.KEY_F3:
case evt.KEY_F4:
case evt.KEY_F5:
case evt.KEY_F6:
case evt.KEY_F7:
case evt.KEY_F8:
case evt.KEY_F9:
case evt.KEY_F10:
case evt.KEY_F11:
case evt.KEY_F12:
case evt.KEY_F12:
case evt.KEY_F13:
case evt.KEY_F14:
case evt.KEY_F15:
case evt.KEY_CLEAR:
case evt.KEY_HELP:
evt.key = evt.keyCode;
break;
default:
if(evt.ctrlKey || evt.altKey){
var unifiedCharCode = evt.keyCode;
// if lower case but keycode is uppercase, convert it
if(unifiedCharCode >= 65 && unifiedCharCode <= 90 && evt.shiftKey == false){
unifiedCharCode += 32;
}
if(unifiedCharCode >= 1 && unifiedCharCode <= 26 && evt.ctrlKey){
unifiedCharCode += 96; // 001-032 = ctrl+[a-z]
}
evt.key = String.fromCharCode(unifiedCharCode);
}
}
} else if(evt["type"] == "keypress"){
if(dojo.render.html.opera){
if(evt.which == 0){
evt.key = evt.keyCode;
}else if(evt.which > 0){
switch(evt.which){
case evt.KEY_SHIFT:
case evt.KEY_CTRL:
case evt.KEY_ALT:
case evt.KEY_CAPS_LOCK:
case evt.KEY_NUM_LOCK:
case evt.KEY_SCROLL_LOCK:
break;
case evt.KEY_PAUSE:
case evt.KEY_TAB:
case evt.KEY_BACKSPACE:
case evt.KEY_ENTER:
case evt.KEY_ESCAPE:
evt.key = evt.which;
break;
default:
var unifiedCharCode = evt.which;
if((evt.ctrlKey || evt.altKey || evt.metaKey) && (evt.which >= 65 && evt.which <= 90 && evt.shiftKey == false)){
unifiedCharCode += 32;
}
evt.key = String.fromCharCode(unifiedCharCode);
}
}
}else if(dojo.render.html.ie){ // catch some IE keys that are hard to get in keyDown
// key combinations were handled in onKeyDown
if(!evt.ctrlKey && !evt.altKey && evt.keyCode >= evt.KEY_SPACE){
evt.key = String.fromCharCode(evt.keyCode);
}
}else if(dojo.render.html.safari){
switch(evt.keyCode){
case 25: evt.key = evt.KEY_TAB; evt.shift = true;break;
case 63232: evt.key = evt.KEY_UP_ARROW; break;
case 63233: evt.key = evt.KEY_DOWN_ARROW; break;
case 63234: evt.key = evt.KEY_LEFT_ARROW; break;
case 63235: evt.key = evt.KEY_RIGHT_ARROW; break;
case 63236: evt.key = evt.KEY_F1; break;
case 63237: evt.key = evt.KEY_F2; break;
case 63238: evt.key = evt.KEY_F3; break;
case 63239: evt.key = evt.KEY_F4; break;
case 63240: evt.key = evt.KEY_F5; break;
case 63241: evt.key = evt.KEY_F6; break;
case 63242: evt.key = evt.KEY_F7; break;
case 63243: evt.key = evt.KEY_F8; break;
case 63244: evt.key = evt.KEY_F9; break;
case 63245: evt.key = evt.KEY_F10; break;
case 63246: evt.key = evt.KEY_F11; break;
case 63247: evt.key = evt.KEY_F12; break;
case 63250: evt.key = evt.KEY_PAUSE; break;
case 63272: evt.key = evt.KEY_DELETE; break;
case 63273: evt.key = evt.KEY_HOME; break;
case 63275: evt.key = evt.KEY_END; break;
case 63276: evt.key = evt.KEY_PAGE_UP; break;
case 63277: evt.key = evt.KEY_PAGE_DOWN; break;
case 63302: evt.key = evt.KEY_INSERT; break;
case 63248://prtscr
case 63249://scrolllock
case 63289://numlock
break;
default:
evt.key = evt.charCode >= evt.KEY_SPACE ? String.fromCharCode(evt.charCode) : evt.keyCode;
}
}else{
evt.key = evt.charCode > 0 ? String.fromCharCode(evt.charCode) : evt.keyCode;
}
}
}
if(dojo.render.html.ie){
if(!evt.target){ evt.target = evt.srcElement; }
if(!evt.currentTarget){ evt.currentTarget = (sender ? sender : evt.srcElement); }
if(!evt.layerX){ evt.layerX = evt.offsetX; }
if(!evt.layerY){ evt.layerY = evt.offsetY; }
// FIXME: scroll position query is duped from dojo.html to avoid dependency on that entire module
// DONOT replace the following to use dojo.body(), in IE, document.documentElement should be used
// here rather than document.body
var doc = (evt.srcElement && evt.srcElement.ownerDocument) ? evt.srcElement.ownerDocument : document;
var docBody = ((dojo.render.html.ie55)||(doc["compatMode"] == "BackCompat")) ? doc.body : doc.documentElement;
if(!evt.pageX){ evt.pageX = evt.clientX + (docBody.scrollLeft || 0) }
if(!evt.pageY){ evt.pageY = evt.clientY + (docBody.scrollTop || 0) }
// mouseover
if(evt.type == "mouseover"){ evt.relatedTarget = evt.fromElement; }
// mouseout
if(evt.type == "mouseout"){ evt.relatedTarget = evt.toElement; }
this.currentEvent = evt;
evt.callListener = this.callListener;
evt.stopPropagation = this._stopPropagation;
evt.preventDefault = this._preventDefault;
}
return evt; // Event
}
 
this.stopEvent = function(/*Event*/evt){
// summary:
// prevents propigation and clobbers the default action of the
// passed event
// evt: Optional for IE. The native event object.
if(window.event){
evt.cancelBubble = true;
evt.returnValue = false;
}else{
evt.preventDefault();
evt.stopPropagation();
}
}
}
 
dojo.kwCompoundRequire({
common: ["dojo.event.common", "dojo.event.topic"],
browser: ["dojo.event.browser"],
dashboard: ["dojo.event.browser"]
});
dojo.provide("dojo.event.*");
 
dojo.provide("dojo.gfx.color");
 
 
 
// TODO: rewrite the "x2y" methods to take advantage of the parsing
// abilities of the Color object. Also, beef up the Color
// object (as possible) to parse most common formats
 
// takes an r, g, b, a(lpha) value, [r, g, b, a] array, "rgb(...)" string, hex string (#aaa, #aaaaaa, aaaaaaa)
dojo.gfx.color.Color = function(r, g, b, a) {
// dojo.debug("r:", r[0], "g:", r[1], "b:", r[2]);
if(dojo.lang.isArray(r)){
this.r = r[0];
this.g = r[1];
this.b = r[2];
this.a = r[3]||1.0;
}else if(dojo.lang.isString(r)){
var rgb = dojo.gfx.color.extractRGB(r);
this.r = rgb[0];
this.g = rgb[1];
this.b = rgb[2];
this.a = g||1.0;
}else if(r instanceof dojo.gfx.color.Color){
// why does this create a new instance if we were passed one?
this.r = r.r;
this.b = r.b;
this.g = r.g;
this.a = r.a;
}else{
this.r = r;
this.g = g;
this.b = b;
this.a = a;
}
}
 
dojo.gfx.color.Color.fromArray = function(arr) {
return new dojo.gfx.color.Color(arr[0], arr[1], arr[2], arr[3]);
}
 
dojo.extend(dojo.gfx.color.Color, {
toRgb: function(includeAlpha) {
if(includeAlpha) {
return this.toRgba();
} else {
return [this.r, this.g, this.b];
}
},
toRgba: function() {
return [this.r, this.g, this.b, this.a];
},
toHex: function() {
return dojo.gfx.color.rgb2hex(this.toRgb());
},
toCss: function() {
return "rgb(" + this.toRgb().join() + ")";
},
toString: function() {
return this.toHex(); // decent default?
},
blend: function(color, weight){
var rgb = null;
if(dojo.lang.isArray(color)){
rgb = color;
}else if(color instanceof dojo.gfx.color.Color){
rgb = color.toRgb();
}else{
rgb = new dojo.gfx.color.Color(color).toRgb();
}
return dojo.gfx.color.blend(this.toRgb(), rgb, weight);
}
});
 
dojo.gfx.color.named = {
white: [255,255,255],
black: [0,0,0],
red: [255,0,0],
green: [0,255,0],
lime: [0,255,0],
blue: [0,0,255],
navy: [0,0,128],
gray: [128,128,128],
silver: [192,192,192]
};
 
dojo.gfx.color.blend = function(a, b, weight){
// summary:
// blend colors a and b (both as RGB array or hex strings) with weight
// from -1 to +1, 0 being a 50/50 blend
if(typeof a == "string"){
return dojo.gfx.color.blendHex(a, b, weight);
}
if(!weight){
weight = 0;
}
weight = Math.min(Math.max(-1, weight), 1);
 
// alex: this interface blows.
// map -1 to 1 to the range 0 to 1
weight = ((weight + 1)/2);
var c = [];
 
// var stop = (1000*weight);
for(var x = 0; x < 3; x++){
c[x] = parseInt( b[x] + ( (a[x] - b[x]) * weight) );
}
return c;
}
 
// very convenient blend that takes and returns hex values
// (will get called automatically by blend when blend gets strings)
dojo.gfx.color.blendHex = function(a, b, weight) {
return dojo.gfx.color.rgb2hex(dojo.gfx.color.blend(dojo.gfx.color.hex2rgb(a), dojo.gfx.color.hex2rgb(b), weight));
}
 
// get RGB array from css-style color declarations
dojo.gfx.color.extractRGB = function(color) {
var hex = "0123456789abcdef";
color = color.toLowerCase();
if( color.indexOf("rgb") == 0 ) {
var matches = color.match(/rgba*\((\d+), *(\d+), *(\d+)/i);
var ret = matches.splice(1, 3);
return ret;
} else {
var colors = dojo.gfx.color.hex2rgb(color);
if(colors) {
return colors;
} else {
// named color (how many do we support?)
return dojo.gfx.color.named[color] || [255, 255, 255];
}
}
}
 
dojo.gfx.color.hex2rgb = function(hex) {
var hexNum = "0123456789ABCDEF";
var rgb = new Array(3);
if( hex.indexOf("#") == 0 ) { hex = hex.substring(1); }
hex = hex.toUpperCase();
if(hex.replace(new RegExp("["+hexNum+"]", "g"), "") != "") {
return null;
}
if( hex.length == 3 ) {
rgb[0] = hex.charAt(0) + hex.charAt(0)
rgb[1] = hex.charAt(1) + hex.charAt(1)
rgb[2] = hex.charAt(2) + hex.charAt(2);
} else {
rgb[0] = hex.substring(0, 2);
rgb[1] = hex.substring(2, 4);
rgb[2] = hex.substring(4);
}
for(var i = 0; i < rgb.length; i++) {
rgb[i] = hexNum.indexOf(rgb[i].charAt(0)) * 16 + hexNum.indexOf(rgb[i].charAt(1));
}
return rgb;
}
 
dojo.gfx.color.rgb2hex = function(r, g, b) {
if(dojo.lang.isArray(r)) {
g = r[1] || 0;
b = r[2] || 0;
r = r[0] || 0;
}
var ret = dojo.lang.map([r, g, b], function(x) {
x = new Number(x);
var s = x.toString(16);
while(s.length < 2) { s = "0" + s; }
return s;
});
ret.unshift("#");
return ret.join("");
}
 
dojo.provide("dojo.lfx.Animation");
 
 
 
/*
Animation package based on Dan Pupius' work: http://pupius.co.uk/js/Toolkit.Drawing.js
*/
dojo.lfx.Line = function(/*int*/ start, /*int*/ end){
// summary: dojo.lfx.Line is the object used to generate values
// from a start value to an end value
this.start = start;
this.end = end;
if(dojo.lang.isArray(start)){
/* start: Array
end: Array
pId: a */
var diff = [];
dojo.lang.forEach(this.start, function(s,i){
diff[i] = this.end[i] - s;
}, this);
this.getValue = function(/*float*/ n){
var res = [];
dojo.lang.forEach(this.start, function(s, i){
res[i] = (diff[i] * n) + s;
}, this);
return res; // Array
}
}else{
var diff = end - start;
this.getValue = function(/*float*/ n){
// summary: returns the point on the line
// n: a floating point number greater than 0 and less than 1
return (diff * n) + this.start; // Decimal
}
}
}
 
if((dojo.render.html.khtml)&&(!dojo.render.html.safari)){
// the cool kids are obviously not using konqueror...
// found a very wierd bug in floats constants, 1.5 evals as 1
// seems somebody mixed up ints and floats in 3.5.4 ??
// FIXME: investigate more and post a KDE bug (Fredrik)
dojo.lfx.easeDefault = function(/*Decimal?*/ n){
// summary: Returns the point for point n on a sin wave.
return (parseFloat("0.5")+((Math.sin( (n+parseFloat("1.5")) * Math.PI))/2));
}
}else{
dojo.lfx.easeDefault = function(/*Decimal?*/ n){
return (0.5+((Math.sin( (n+1.5) * Math.PI))/2));
}
}
 
dojo.lfx.easeIn = function(/*Decimal?*/ n){
// summary: returns the point on an easing curve
// n: a floating point number greater than 0 and less than 1
return Math.pow(n, 3);
}
 
dojo.lfx.easeOut = function(/*Decimal?*/ n){
// summary: returns the point on the line
// n: a floating point number greater than 0 and less than 1
return ( 1 - Math.pow(1 - n, 3) );
}
 
dojo.lfx.easeInOut = function(/*Decimal?*/ n){
// summary: returns the point on the line
// n: a floating point number greater than 0 and less than 1
return ( (3 * Math.pow(n, 2)) - (2 * Math.pow(n, 3)) );
}
 
dojo.lfx.IAnimation = function(){
// summary: dojo.lfx.IAnimation is an interface that implements
// commonly used functions of animation objects
}
dojo.lang.extend(dojo.lfx.IAnimation, {
// public properties
curve: null,
duration: 1000,
easing: null,
repeatCount: 0,
rate: 10,
// events
handler: null,
beforeBegin: null,
onBegin: null,
onAnimate: null,
onEnd: null,
onPlay: null,
onPause: null,
onStop: null,
// public methods
play: null,
pause: null,
stop: null,
connect: function(/*Event*/ evt, /*Object*/ scope, /*Function*/ newFunc){
// summary: Convenience function. Quickly connect to an event
// of this object and save the old functions connected to it.
// evt: The name of the event to connect to.
// scope: the scope in which to run newFunc.
// newFunc: the function to run when evt is fired.
if(!newFunc){
/* scope: Function
newFunc: null
pId: f */
newFunc = scope;
scope = this;
}
newFunc = dojo.lang.hitch(scope, newFunc);
var oldFunc = this[evt]||function(){};
this[evt] = function(){
var ret = oldFunc.apply(this, arguments);
newFunc.apply(this, arguments);
return ret;
}
return this; // dojo.lfx.IAnimation
},
 
fire: function(/*Event*/ evt, /*Array*/ args){
// summary: Convenience function. Fire event "evt" and pass it
// the arguments specified in "args".
// evt: The event to fire.
// args: The arguments to pass to the event.
if(this[evt]){
this[evt].apply(this, (args||[]));
}
return this; // dojo.lfx.IAnimation
},
repeat: function(/*int*/ count){
// summary: Set the repeat count of this object.
// count: How many times to repeat the animation.
this.repeatCount = count;
return this; // dojo.lfx.IAnimation
},
 
// private properties
_active: false,
_paused: false
});
 
dojo.lfx.Animation = function( /*Object*/ handlers,
/*int*/ duration,
/*dojo.lfx.Line*/ curve,
/*function*/ easing,
/*int*/ repeatCount,
/*int*/ rate){
// summary
// a generic animation object that fires callbacks into it's handlers
// object at various states
// handlers: { handler: Function?, onstart: Function?, onstop: Function?, onanimate: Function? }
dojo.lfx.IAnimation.call(this);
if(dojo.lang.isNumber(handlers)||(!handlers && duration.getValue)){
// no handlers argument:
rate = repeatCount;
repeatCount = easing;
easing = curve;
curve = duration;
duration = handlers;
handlers = null;
}else if(handlers.getValue||dojo.lang.isArray(handlers)){
// no handlers or duration:
rate = easing;
repeatCount = curve;
easing = duration;
curve = handlers;
duration = null;
handlers = null;
}
if(dojo.lang.isArray(curve)){
/* curve: Array
pId: a */
this.curve = new dojo.lfx.Line(curve[0], curve[1]);
}else{
this.curve = curve;
}
if(duration != null && duration > 0){ this.duration = duration; }
if(repeatCount){ this.repeatCount = repeatCount; }
if(rate){ this.rate = rate; }
if(handlers){
dojo.lang.forEach([
"handler", "beforeBegin", "onBegin",
"onEnd", "onPlay", "onStop", "onAnimate"
], function(item){
if(handlers[item]){
this.connect(item, handlers[item]);
}
}, this);
}
if(easing && dojo.lang.isFunction(easing)){
this.easing=easing;
}
}
dojo.inherits(dojo.lfx.Animation, dojo.lfx.IAnimation);
dojo.lang.extend(dojo.lfx.Animation, {
// "private" properties
_startTime: null,
_endTime: null,
_timer: null,
_percent: 0,
_startRepeatCount: 0,
 
// public methods
play: function(/*int?*/ delay, /*bool?*/ gotoStart){
// summary: Start the animation.
// delay: How many milliseconds to delay before starting.
// gotoStart: If true, starts the animation from the beginning; otherwise,
// starts it from its current position.
if(gotoStart){
clearTimeout(this._timer);
this._active = false;
this._paused = false;
this._percent = 0;
}else if(this._active && !this._paused){
return this; // dojo.lfx.Animation
}
this.fire("handler", ["beforeBegin"]);
this.fire("beforeBegin");
 
if(delay > 0){
setTimeout(dojo.lang.hitch(this, function(){ this.play(null, gotoStart); }), delay);
return this; // dojo.lfx.Animation
}
this._startTime = new Date().valueOf();
if(this._paused){
this._startTime -= (this.duration * this._percent / 100);
}
this._endTime = this._startTime + this.duration;
 
this._active = true;
this._paused = false;
var step = this._percent / 100;
var value = this.curve.getValue(step);
if(this._percent == 0 ){
if(!this._startRepeatCount){
this._startRepeatCount = this.repeatCount;
}
this.fire("handler", ["begin", value]);
this.fire("onBegin", [value]);
}
 
this.fire("handler", ["play", value]);
this.fire("onPlay", [value]);
 
this._cycle();
return this; // dojo.lfx.Animation
},
 
pause: function(){
// summary: Pauses a running animation.
clearTimeout(this._timer);
if(!this._active){ return this; /*dojo.lfx.Animation*/}
this._paused = true;
var value = this.curve.getValue(this._percent / 100);
this.fire("handler", ["pause", value]);
this.fire("onPause", [value]);
return this; // dojo.lfx.Animation
},
 
gotoPercent: function(/*Decimal*/ pct, /*bool?*/ andPlay){
// summary: Sets the progress of the animation.
// pct: A percentage in decimal notation (between and including 0.0 and 1.0).
// andPlay: If true, play the animation after setting the progress.
clearTimeout(this._timer);
this._active = true;
this._paused = true;
this._percent = pct;
if(andPlay){ this.play(); }
return this; // dojo.lfx.Animation
},
 
stop: function(/*bool?*/ gotoEnd){
// summary: Stops a running animation.
// gotoEnd: If true, the animation will end.
clearTimeout(this._timer);
var step = this._percent / 100;
if(gotoEnd){
step = 1;
}
var value = this.curve.getValue(step);
this.fire("handler", ["stop", value]);
this.fire("onStop", [value]);
this._active = false;
this._paused = false;
return this; // dojo.lfx.Animation
},
 
status: function(){
// summary: Returns a string representation of the status of
// the animation.
if(this._active){
return this._paused ? "paused" : "playing"; // String
}else{
return "stopped"; // String
}
return this;
},
 
// "private" methods
_cycle: function(){
clearTimeout(this._timer);
if(this._active){
var curr = new Date().valueOf();
var step = (curr - this._startTime) / (this._endTime - this._startTime);
 
if(step >= 1){
step = 1;
this._percent = 100;
}else{
this._percent = step * 100;
}
// Perform easing
if((this.easing)&&(dojo.lang.isFunction(this.easing))){
step = this.easing(step);
}
 
var value = this.curve.getValue(step);
this.fire("handler", ["animate", value]);
this.fire("onAnimate", [value]);
 
if( step < 1 ){
this._timer = setTimeout(dojo.lang.hitch(this, "_cycle"), this.rate);
}else{
this._active = false;
this.fire("handler", ["end"]);
this.fire("onEnd");
 
if(this.repeatCount > 0){
this.repeatCount--;
this.play(null, true);
}else if(this.repeatCount == -1){
this.play(null, true);
}else{
if(this._startRepeatCount){
this.repeatCount = this._startRepeatCount;
this._startRepeatCount = 0;
}
}
}
}
return this; // dojo.lfx.Animation
}
});
 
dojo.lfx.Combine = function(/*dojo.lfx.IAnimation...*/ animations){
// summary: An animation object to play animations passed to it at the same time.
dojo.lfx.IAnimation.call(this);
this._anims = [];
this._animsEnded = 0;
var anims = arguments;
if(anims.length == 1 && (dojo.lang.isArray(anims[0]) || dojo.lang.isArrayLike(anims[0]))){
/* animations: dojo.lfx.IAnimation[]
pId: a */
anims = anims[0];
}
dojo.lang.forEach(anims, function(anim){
this._anims.push(anim);
anim.connect("onEnd", dojo.lang.hitch(this, "_onAnimsEnded"));
}, this);
}
dojo.inherits(dojo.lfx.Combine, dojo.lfx.IAnimation);
dojo.lang.extend(dojo.lfx.Combine, {
// private members
_animsEnded: 0,
// public methods
play: function(/*int?*/ delay, /*bool?*/ gotoStart){
// summary: Start the animations.
// delay: How many milliseconds to delay before starting.
// gotoStart: If true, starts the animations from the beginning; otherwise,
// starts them from their current position.
if( !this._anims.length ){ return this; /*dojo.lfx.Combine*/}
 
this.fire("beforeBegin");
 
if(delay > 0){
setTimeout(dojo.lang.hitch(this, function(){ this.play(null, gotoStart); }), delay);
return this; // dojo.lfx.Combine
}
if(gotoStart || this._anims[0].percent == 0){
this.fire("onBegin");
}
this.fire("onPlay");
this._animsCall("play", null, gotoStart);
return this; // dojo.lfx.Combine
},
pause: function(){
// summary: Pauses the running animations.
this.fire("onPause");
this._animsCall("pause");
return this; // dojo.lfx.Combine
},
stop: function(/*bool?*/ gotoEnd){
// summary: Stops the running animations.
// gotoEnd: If true, the animations will end.
this.fire("onStop");
this._animsCall("stop", gotoEnd);
return this; // dojo.lfx.Combine
},
// private methods
_onAnimsEnded: function(){
this._animsEnded++;
if(this._animsEnded >= this._anims.length){
this.fire("onEnd");
}
return this; // dojo.lfx.Combine
},
_animsCall: function(/*String*/ funcName){
var args = [];
if(arguments.length > 1){
for(var i = 1 ; i < arguments.length ; i++){
args.push(arguments[i]);
}
}
var _this = this;
dojo.lang.forEach(this._anims, function(anim){
anim[funcName](args);
}, _this);
return this; // dojo.lfx.Combine
}
});
 
dojo.lfx.Chain = function(/*dojo.lfx.IAnimation...*/ animations) {
// summary: An animation object to play animations passed to it
// one after another.
dojo.lfx.IAnimation.call(this);
this._anims = [];
this._currAnim = -1;
var anims = arguments;
if(anims.length == 1 && (dojo.lang.isArray(anims[0]) || dojo.lang.isArrayLike(anims[0]))){
/* animations: dojo.lfx.IAnimation[]
pId: a */
anims = anims[0];
}
var _this = this;
dojo.lang.forEach(anims, function(anim, i, anims_arr){
this._anims.push(anim);
if(i < anims_arr.length - 1){
anim.connect("onEnd", dojo.lang.hitch(this, "_playNext") );
}else{
anim.connect("onEnd", dojo.lang.hitch(this, function(){ this.fire("onEnd"); }) );
}
}, this);
}
dojo.inherits(dojo.lfx.Chain, dojo.lfx.IAnimation);
dojo.lang.extend(dojo.lfx.Chain, {
// private members
_currAnim: -1,
// public methods
play: function(/*int?*/ delay, /*bool?*/ gotoStart){
// summary: Start the animation sequence.
// delay: How many milliseconds to delay before starting.
// gotoStart: If true, starts the sequence from the beginning; otherwise,
// starts it from its current position.
if( !this._anims.length ) { return this; /*dojo.lfx.Chain*/}
if( gotoStart || !this._anims[this._currAnim] ) {
this._currAnim = 0;
}
 
var currentAnimation = this._anims[this._currAnim];
 
this.fire("beforeBegin");
if(delay > 0){
setTimeout(dojo.lang.hitch(this, function(){ this.play(null, gotoStart); }), delay);
return this; // dojo.lfx.Chain
}
if(currentAnimation){
if(this._currAnim == 0){
this.fire("handler", ["begin", this._currAnim]);
this.fire("onBegin", [this._currAnim]);
}
this.fire("onPlay", [this._currAnim]);
currentAnimation.play(null, gotoStart);
}
return this; // dojo.lfx.Chain
},
pause: function(){
// summary: Pauses the running animation sequence.
if( this._anims[this._currAnim] ) {
this._anims[this._currAnim].pause();
this.fire("onPause", [this._currAnim]);
}
return this; // dojo.lfx.Chain
},
playPause: function(){
// summary: If the animation sequence is playing, pause it; otherwise,
// play it.
if(this._anims.length == 0){ return this; }
if(this._currAnim == -1){ this._currAnim = 0; }
var currAnim = this._anims[this._currAnim];
if( currAnim ) {
if( !currAnim._active || currAnim._paused ) {
this.play();
} else {
this.pause();
}
}
return this; // dojo.lfx.Chain
},
stop: function(){
// summary: Stops the running animations.
var currAnim = this._anims[this._currAnim];
if(currAnim){
currAnim.stop();
this.fire("onStop", [this._currAnim]);
}
return currAnim; // dojo.lfx.IAnimation
},
// private methods
_playNext: function(){
if( this._currAnim == -1 || this._anims.length == 0 ) { return this; }
this._currAnim++;
if( this._anims[this._currAnim] ){
this._anims[this._currAnim].play(null, true);
}
return this; // dojo.lfx.Chain
}
});
 
dojo.lfx.combine = function(/*dojo.lfx.IAnimation...*/ animations){
// summary: Convenience function. Returns a dojo.lfx.Combine created
// using the animations passed in.
var anims = arguments;
if(dojo.lang.isArray(arguments[0])){
/* animations: dojo.lfx.IAnimation[]
pId: a */
anims = arguments[0];
}
if(anims.length == 1){ return anims[0]; }
return new dojo.lfx.Combine(anims); // dojo.lfx.Combine
}
 
dojo.lfx.chain = function(/*dojo.lfx.IAnimation...*/ animations){
// summary: Convenience function. Returns a dojo.lfx.Chain created
// using the animations passed in.
var anims = arguments;
if(dojo.lang.isArray(arguments[0])){
/* animations: dojo.lfx.IAnimation[]
pId: a */
anims = arguments[0];
}
if(anims.length == 1){ return anims[0]; }
return new dojo.lfx.Chain(anims); // dojo.lfx.Combine
}
 
dojo.provide("dojo.html.common");
 
 
 
dojo.lang.mixin(dojo.html, dojo.dom);
 
dojo.html.body = function(){
dojo.deprecated("dojo.html.body() moved to dojo.body()", "0.5");
return dojo.body();
}
 
// FIXME: we are going to assume that we can throw any and every rendering
// engine into the IE 5.x box model. In Mozilla, we do this w/ CSS.
// Need to investigate for KHTML and Opera
 
dojo.html.getEventTarget = function(/* DOMEvent */evt){
// summary
// Returns the target of an event
if(!evt) { evt = dojo.global().event || {} };
var t = (evt.srcElement ? evt.srcElement : (evt.target ? evt.target : null));
while((t)&&(t.nodeType!=1)){ t = t.parentNode; }
return t; // HTMLElement
}
 
dojo.html.getViewport = function(){
// summary
// Returns the dimensions of the viewable area of a browser window
var _window = dojo.global();
var _document = dojo.doc();
var w = 0;
var h = 0;
 
if(dojo.render.html.mozilla){
// mozilla
w = _document.documentElement.clientWidth;
h = _window.innerHeight;
}else if(!dojo.render.html.opera && _window.innerWidth){
//in opera9, dojo.body().clientWidth should be used, instead
//of window.innerWidth/document.documentElement.clientWidth
//so we have to check whether it is opera
w = _window.innerWidth;
h = _window.innerHeight;
} else if (!dojo.render.html.opera && dojo.exists(_document, "documentElement.clientWidth")){
// IE6 Strict
var w2 = _document.documentElement.clientWidth;
// this lets us account for scrollbars
if(!w || w2 && w2 < w) {
w = w2;
}
h = _document.documentElement.clientHeight;
} else if (dojo.body().clientWidth){
// IE, Opera
w = dojo.body().clientWidth;
h = dojo.body().clientHeight;
}
return { width: w, height: h }; // object
}
 
dojo.html.getScroll = function(){
// summary
// Returns the scroll position of the document
var _window = dojo.global();
var _document = dojo.doc();
var top = _window.pageYOffset || _document.documentElement.scrollTop || dojo.body().scrollTop || 0;
var left = _window.pageXOffset || _document.documentElement.scrollLeft || dojo.body().scrollLeft || 0;
return {
top: top,
left: left,
offset:{ x: left, y: top } // note the change, NOT an Array with added properties.
}; // object
}
 
dojo.html.getParentByType = function(/* HTMLElement */node, /* string */type) {
// summary
// Returns the first ancestor of node with tagName type.
var _document = dojo.doc();
var parent = dojo.byId(node);
type = type.toLowerCase();
while((parent)&&(parent.nodeName.toLowerCase()!=type)){
if(parent==(_document["body"]||_document["documentElement"])){
return null;
}
parent = parent.parentNode;
}
return parent; // HTMLElement
}
 
dojo.html.getAttribute = function(/* HTMLElement */node, /* string */attr){
// summary
// Returns the value of attribute attr from node.
node = dojo.byId(node);
// FIXME: need to add support for attr-specific accessors
if((!node)||(!node.getAttribute)){
// if(attr !== 'nwType'){
// alert("getAttr of '" + attr + "' with bad node");
// }
return null;
}
var ta = typeof attr == 'string' ? attr : new String(attr);
 
// first try the approach most likely to succeed
var v = node.getAttribute(ta.toUpperCase());
if((v)&&(typeof v == 'string')&&(v!="")){
return v; // string
}
 
// try returning the attributes value, if we couldn't get it as a string
if(v && v.value){
return v.value; // string
}
 
// this should work on Opera 7, but it's a little on the crashy side
if((node.getAttributeNode)&&(node.getAttributeNode(ta))){
return (node.getAttributeNode(ta)).value; // string
}else if(node.getAttribute(ta)){
return node.getAttribute(ta); // string
}else if(node.getAttribute(ta.toLowerCase())){
return node.getAttribute(ta.toLowerCase()); // string
}
return null; // string
}
dojo.html.hasAttribute = function(/* HTMLElement */node, /* string */attr){
// summary
// Determines whether or not the specified node carries a value for the attribute in question.
return dojo.html.getAttribute(dojo.byId(node), attr) ? true : false; // boolean
}
dojo.html.getCursorPosition = function(/* DOMEvent */e){
// summary
// Returns the mouse position relative to the document (not the viewport).
// For example, if you have a document that is 10000px tall,
// but your browser window is only 100px tall,
// if you scroll to the bottom of the document and call this function it
// will return {x: 0, y: 10000}
// NOTE: for events delivered via dojo.event.connect() and/or dojoAttachEvent (for widgets),
// you can just access evt.pageX and evt.pageY, rather than calling this function.
e = e || dojo.global().event;
var cursor = {x:0, y:0};
if(e.pageX || e.pageY){
cursor.x = e.pageX;
cursor.y = e.pageY;
}else{
var de = dojo.doc().documentElement;
var db = dojo.body();
cursor.x = e.clientX + ((de||db)["scrollLeft"]) - ((de||db)["clientLeft"]);
cursor.y = e.clientY + ((de||db)["scrollTop"]) - ((de||db)["clientTop"]);
}
return cursor; // object
}
 
dojo.html.isTag = function(/* HTMLElement */node) {
// summary
// Like dojo.dom.isTag, except case-insensitive
node = dojo.byId(node);
if(node && node.tagName) {
for (var i=1; i<arguments.length; i++){
if (node.tagName.toLowerCase()==String(arguments[i]).toLowerCase()){
return String(arguments[i]).toLowerCase(); // string
}
}
}
return ""; // string
}
 
//define dojo.html.createExternalElement for IE to workaround the annoying activation "feature" in new IE
//details: http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/overview/activating_activex.asp
if(dojo.render.html.ie && !dojo.render.html.ie70){
//only define createExternalElement for IE in none https to avoid "mixed content" warning dialog
if(window.location.href.substr(0,6).toLowerCase() != "https:"){
(function(){
// FIXME: this seems not to work correctly on IE 7!!
 
//The trick is to define a function in a script.src property:
// <script src="javascript:'function createExternalElement(){...}'"></script>,
//which will be treated as an external javascript file in IE
var xscript = dojo.doc().createElement('script');
xscript.src = "javascript:'dojo.html.createExternalElement=function(doc, tag){ return doc.createElement(tag); }'";
dojo.doc().getElementsByTagName("head")[0].appendChild(xscript);
})();
}
}else{
//for other browsers, simply use document.createElement
//is enough
dojo.html.createExternalElement = function(/* HTMLDocument */doc, /* string */tag){
// summary
// Creates an element in the HTML document, here for ActiveX activation workaround.
return doc.createElement(tag); // HTMLElement
}
}
 
dojo.html._callDeprecated = function(inFunc, replFunc, args, argName, retValue){
dojo.deprecated("dojo.html." + inFunc,
"replaced by dojo.html." + replFunc + "(" + (argName ? "node, {"+ argName + ": " + argName + "}" : "" ) + ")" + (retValue ? "." + retValue : ""), "0.5");
var newArgs = [];
if(argName){ var argsIn = {}; argsIn[argName] = args[1]; newArgs.push(args[0]); newArgs.push(argsIn); }
else { newArgs = args }
var ret = dojo.html[replFunc].apply(dojo.html, args);
if(retValue){ return ret[retValue]; }
else { return ret; }
}
 
dojo.html.getViewportWidth = function(){
return dojo.html._callDeprecated("getViewportWidth", "getViewport", arguments, null, "width");
}
dojo.html.getViewportHeight = function(){
return dojo.html._callDeprecated("getViewportHeight", "getViewport", arguments, null, "height");
}
dojo.html.getViewportSize = function(){
return dojo.html._callDeprecated("getViewportSize", "getViewport", arguments);
}
dojo.html.getScrollTop = function(){
return dojo.html._callDeprecated("getScrollTop", "getScroll", arguments, null, "top");
}
dojo.html.getScrollLeft = function(){
return dojo.html._callDeprecated("getScrollLeft", "getScroll", arguments, null, "left");
}
dojo.html.getScrollOffset = function(){
return dojo.html._callDeprecated("getScrollOffset", "getScroll", arguments, null, "offset");
}
 
dojo.provide("dojo.uri.Uri");
 
dojo.uri = new function() {
this.dojoUri = function (/*dojo.uri.Uri||String*/uri) {
// summary: returns a Uri object resolved relative to the dojo root
return new dojo.uri.Uri(dojo.hostenv.getBaseScriptUri(), uri);
}
 
this.moduleUri = function(/*String*/module, /*dojo.uri.Uri||String*/uri){
// summary: returns a Uri object relative to a module
// description: Examples: dojo.uri.moduleUri("dojo.widget","templates/template.html"), or dojo.uri.moduleUri("acme","images/small.png")
var loc = dojo.hostenv.getModuleSymbols(module).join('/');
if(!loc){
return null;
}
if(loc.lastIndexOf("/") != loc.length-1){
loc += "/";
}
//If the path is an absolute path (starts with a / or is on another domain/xdomain)
//then don't add the baseScriptUri.
var colonIndex = loc.indexOf(":");
var slashIndex = loc.indexOf("/");
if(loc.charAt(0) != "/" && (colonIndex == -1 || colonIndex > slashIndex)){
loc = dojo.hostenv.getBaseScriptUri() + loc;
}
 
return new dojo.uri.Uri(loc,uri);
}
 
this.Uri = function (/*dojo.uri.Uri||String...*/) {
// summary: Constructor to create an object representing a URI.
// description:
// Each argument is evaluated in order relative to the next until
// a canonical uri is produced. To get an absolute Uri relative
// to the current document use
// new dojo.uri.Uri(document.baseURI, uri)
 
// TODO: support for IPv6, see RFC 2732
 
// resolve uri components relative to each other
var uri = arguments[0];
for (var i = 1; i < arguments.length; i++) {
if(!arguments[i]) { continue; }
 
// Safari doesn't support this.constructor so we have to be explicit
var relobj = new dojo.uri.Uri(arguments[i].toString());
var uriobj = new dojo.uri.Uri(uri.toString());
 
if ((relobj.path=="")&&(relobj.scheme==null)&&(relobj.authority==null)&&(relobj.query==null)) {
if (relobj.fragment != null) { uriobj.fragment = relobj.fragment; }
relobj = uriobj;
} else if (relobj.scheme == null) {
relobj.scheme = uriobj.scheme;
 
if (relobj.authority == null) {
relobj.authority = uriobj.authority;
 
if (relobj.path.charAt(0) != "/") {
var path = uriobj.path.substring(0,
uriobj.path.lastIndexOf("/") + 1) + relobj.path;
 
var segs = path.split("/");
for (var j = 0; j < segs.length; j++) {
if (segs[j] == ".") {
if (j == segs.length - 1) { segs[j] = ""; }
else { segs.splice(j, 1); j--; }
} else if (j > 0 && !(j == 1 && segs[0] == "") &&
segs[j] == ".." && segs[j-1] != "..") {
 
if (j == segs.length - 1) { segs.splice(j, 1); segs[j - 1] = ""; }
else { segs.splice(j - 1, 2); j -= 2; }
}
}
relobj.path = segs.join("/");
}
}
}
 
uri = "";
if (relobj.scheme != null) { uri += relobj.scheme + ":"; }
if (relobj.authority != null) { uri += "//" + relobj.authority; }
uri += relobj.path;
if (relobj.query != null) { uri += "?" + relobj.query; }
if (relobj.fragment != null) { uri += "#" + relobj.fragment; }
}
 
this.uri = uri.toString();
 
// break the uri into its main components
var regexp = "^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$";
var r = this.uri.match(new RegExp(regexp));
 
this.scheme = r[2] || (r[1] ? "" : null);
this.authority = r[4] || (r[3] ? "" : null);
this.path = r[5]; // can never be undefined
this.query = r[7] || (r[6] ? "" : null);
this.fragment = r[9] || (r[8] ? "" : null);
 
if (this.authority != null) {
// server based naming authority
regexp = "^((([^:]+:)?([^@]+))@)?([^:]*)(:([0-9]+))?$";
r = this.authority.match(new RegExp(regexp));
 
this.user = r[3] || null;
this.password = r[4] || null;
this.host = r[5];
this.port = r[7] || null;
}
 
this.toString = function(){ return this.uri; }
}
};
 
dojo.provide("dojo.html.style");
 
 
 
dojo.html.getClass = function(/* HTMLElement */node){
// summary
// Returns the string value of the list of CSS classes currently assigned directly
// to the node in question. Returns an empty string if no class attribute is found;
node = dojo.byId(node);
if(!node){ return ""; }
var cs = "";
if(node.className){
cs = node.className;
}else if(dojo.html.hasAttribute(node, "class")){
cs = dojo.html.getAttribute(node, "class");
}
return cs.replace(/^\s+|\s+$/g, ""); // string
}
 
dojo.html.getClasses = function(/* HTMLElement */node) {
// summary
// Returns an array of CSS classes currently assigned directly to the node in question.
// Returns an empty array if no classes are found;
var c = dojo.html.getClass(node);
return (c == "") ? [] : c.split(/\s+/g); // array
}
 
dojo.html.hasClass = function(/* HTMLElement */node, /* string */classname){
// summary
// Returns whether or not the specified classname is a portion of the
// class list currently applied to the node. Does not cover cascaded
// styles, only classes directly applied to the node.
return (new RegExp('(^|\\s+)'+classname+'(\\s+|$)')).test(dojo.html.getClass(node)) // boolean
}
 
dojo.html.prependClass = function(/* HTMLElement */node, /* string */classStr){
// summary
// Adds the specified class to the beginning of the class list on the
// passed node. This gives the specified class the highest precidence
// when style cascading is calculated for the node. Returns true or
// false; indicating success or failure of the operation, respectively.
classStr += " " + dojo.html.getClass(node);
return dojo.html.setClass(node, classStr); // boolean
}
 
dojo.html.addClass = function(/* HTMLElement */node, /* string */classStr){
// summary
// Adds the specified class to the end of the class list on the
// passed &node;. Returns &true; or &false; indicating success or failure.
if (dojo.html.hasClass(node, classStr)) {
return false;
}
classStr = (dojo.html.getClass(node) + " " + classStr).replace(/^\s+|\s+$/g,"");
return dojo.html.setClass(node, classStr); // boolean
}
 
dojo.html.setClass = function(/* HTMLElement */node, /* string */classStr){
// summary
// Clobbers the existing list of classes for the node, replacing it with
// the list given in the 2nd argument. Returns true or false
// indicating success or failure.
node = dojo.byId(node);
var cs = new String(classStr);
try{
if(typeof node.className == "string"){
node.className = cs;
}else if(node.setAttribute){
node.setAttribute("class", classStr);
node.className = cs;
}else{
return false;
}
}catch(e){
dojo.debug("dojo.html.setClass() failed", e);
}
return true;
}
 
dojo.html.removeClass = function(/* HTMLElement */node, /* string */classStr, /* boolean? */allowPartialMatches){
// summary
// Removes the className from the node;. Returns true or false indicating success or failure.
try{
if (!allowPartialMatches) {
var newcs = dojo.html.getClass(node).replace(new RegExp('(^|\\s+)'+classStr+'(\\s+|$)'), "$1$2");
} else {
var newcs = dojo.html.getClass(node).replace(classStr,'');
}
dojo.html.setClass(node, newcs);
}catch(e){
dojo.debug("dojo.html.removeClass() failed", e);
}
return true; // boolean
}
 
dojo.html.replaceClass = function(/* HTMLElement */node, /* string */newClass, /* string */oldClass) {
// summary
// Replaces 'oldClass' and adds 'newClass' to node
dojo.html.removeClass(node, oldClass);
dojo.html.addClass(node, newClass);
}
 
// Enum type for getElementsByClass classMatchType arg:
dojo.html.classMatchType = {
ContainsAll : 0, // all of the classes are part of the node's class (default)
ContainsAny : 1, // any of the classes are part of the node's class
IsOnly : 2 // only all of the classes are part of the node's class
}
 
 
dojo.html.getElementsByClass = function(
/* string */classStr,
/* HTMLElement? */parent,
/* string? */nodeType,
/* integer? */classMatchType,
/* boolean? */useNonXpath
){
// summary
// Returns an array of nodes for the given classStr, children of a
// parent, and optionally of a certain nodeType
// FIXME: temporarily set to false because of several dojo tickets related
// to the xpath version not working consistently in firefox.
useNonXpath = false;
var _document = dojo.doc();
parent = dojo.byId(parent) || _document;
var classes = classStr.split(/\s+/g);
var nodes = [];
if( classMatchType != 1 && classMatchType != 2 ) classMatchType = 0; // make it enum
var reClass = new RegExp("(\\s|^)((" + classes.join(")|(") + "))(\\s|$)");
var srtLength = classes.join(" ").length;
var candidateNodes = [];
if(!useNonXpath && _document.evaluate) { // supports dom 3 xpath
var xpath = ".//" + (nodeType || "*") + "[contains(";
if(classMatchType != dojo.html.classMatchType.ContainsAny){
xpath += "concat(' ',@class,' '), ' " +
classes.join(" ') and contains(concat(' ',@class,' '), ' ") +
" ')";
if (classMatchType == 2) {
xpath += " and string-length(@class)="+srtLength+"]";
}else{
xpath += "]";
}
}else{
xpath += "concat(' ',@class,' '), ' " +
classes.join(" ') or contains(concat(' ',@class,' '), ' ") +
" ')]";
}
var xpathResult = _document.evaluate(xpath, parent, null, XPathResult.ANY_TYPE, null);
var result = xpathResult.iterateNext();
while(result){
try{
candidateNodes.push(result);
result = xpathResult.iterateNext();
}catch(e){ break; }
}
return candidateNodes; // NodeList
}else{
if(!nodeType){
nodeType = "*";
}
candidateNodes = parent.getElementsByTagName(nodeType);
 
var node, i = 0;
outer:
while(node = candidateNodes[i++]){
var nodeClasses = dojo.html.getClasses(node);
if(nodeClasses.length == 0){ continue outer; }
var matches = 0;
for(var j = 0; j < nodeClasses.length; j++){
if(reClass.test(nodeClasses[j])){
if(classMatchType == dojo.html.classMatchType.ContainsAny){
nodes.push(node);
continue outer;
}else{
matches++;
}
}else{
if(classMatchType == dojo.html.classMatchType.IsOnly){
continue outer;
}
}
}
if(matches == classes.length){
if( (classMatchType == dojo.html.classMatchType.IsOnly)&&
(matches == nodeClasses.length)){
nodes.push(node);
}else if(classMatchType == dojo.html.classMatchType.ContainsAll){
nodes.push(node);
}
}
}
return nodes; // NodeList
}
}
dojo.html.getElementsByClassName = dojo.html.getElementsByClass;
 
dojo.html.toCamelCase = function(/* string */selector){
// summary
// Translates a CSS selector string to a camel-cased one.
var arr = selector.split('-'), cc = arr[0];
for(var i = 1; i < arr.length; i++) {
cc += arr[i].charAt(0).toUpperCase() + arr[i].substring(1);
}
return cc; // string
}
 
dojo.html.toSelectorCase = function(/* string */selector){
// summary
// Translates a camel cased string to a selector cased one.
return selector.replace(/([A-Z])/g, "-$1" ).toLowerCase(); // string
}
 
if (dojo.render.html.ie) {
// IE branch
dojo.html.getComputedStyle = function(/*HTMLElement|String*/node, /*String*/property, /*String*/value) {
// summary
// Get the computed style value for style "property" on "node" (IE).
node = dojo.byId(node); // FIXME: remove ability to access nodes by id for this time-critical function
if(!node || !node.style){return value;}
// FIXME: standardize on camel-case input to improve speed
return node.currentStyle[dojo.html.toCamelCase(property)]; // String
}
// SJM: getComputedStyle should be abandoned and replaced with the below function.
// All our supported browsers can return CSS2 compliant CssStyleDeclaration objects
// which can be queried directly for multiple styles.
dojo.html.getComputedStyles = function(/*HTMLElement*/node) {
// summary
// Get a style object containing computed styles for HTML Element node (IE).
return node.currentStyle; // CSSStyleDeclaration
}
} else {
// non-IE branch
dojo.html.getComputedStyle = function(/*HTMLElement|String*/node, /*String*/property, /*Any*/value) {
// summary
// Get the computed style value for style "property" on "node" (non-IE).
node = dojo.byId(node);
if(!node || !node.style){return value;}
var s = document.defaultView.getComputedStyle(node, null);
// s may be null on Safari
return (s&&s[dojo.html.toCamelCase(property)])||''; // String
}
// SJM: getComputedStyle should be abandoned and replaced with the below function.
// All our supported browsers can return CSS2 compliant CssStyleDeclaration objects
// which can be queried directly for multiple styles.
dojo.html.getComputedStyles = function(node) {
// summary
// Get a style object containing computed styles for HTML Element node (non-IE).
return document.defaultView.getComputedStyle(node, null); // CSSStyleDeclaration
}
}
 
dojo.html.getStyleProperty = function(/* HTMLElement */node, /* string */cssSelector){
// summary
// Returns the value of the passed style
node = dojo.byId(node);
return (node && node.style ? node.style[dojo.html.toCamelCase(cssSelector)] : undefined); // string
}
 
dojo.html.getStyle = function(/* HTMLElement */node, /* string */cssSelector){
// summary
// Returns the computed value of the passed style
var value = dojo.html.getStyleProperty(node, cssSelector);
return (value ? value : dojo.html.getComputedStyle(node, cssSelector)); // string || integer
}
 
dojo.html.setStyle = function(/* HTMLElement */node, /* string */cssSelector, /* string */value){
// summary
// Set the value of passed style on node
node = dojo.byId(node);
if(node && node.style){
var camelCased = dojo.html.toCamelCase(cssSelector);
node.style[camelCased] = value;
}
}
 
dojo.html.setStyleText = function (/* HTMLElement */target, /* string */text) {
// summary
// Try to set the entire cssText property of the passed target; equiv of setting style attribute.
try {
target.style.cssText = text;
} catch (e) {
target.setAttribute("style", text);
}
}
 
dojo.html.copyStyle = function(/* HTMLElement */target, /* HTMLElement */source){
// summary
// work around for opera which doesn't have cssText, and for IE which fails on setAttribute
if(!source.style.cssText){
target.setAttribute("style", source.getAttribute("style"));
}else{
target.style.cssText = source.style.cssText;
}
dojo.html.addClass(target, dojo.html.getClass(source));
}
 
dojo.html.getUnitValue = function(/* HTMLElement */node, /* string */cssSelector, /* boolean? */autoIsZero){
// summary
// Get the value of passed selector, with the specific units used
var s = dojo.html.getComputedStyle(node, cssSelector);
if((!s)||((s == 'auto')&&(autoIsZero))){
return { value: 0, units: 'px' }; // object
}
// FIXME: is regex inefficient vs. parseInt or some manual test?
var match = s.match(/(\-?[\d.]+)([a-z%]*)/i);
if (!match){return dojo.html.getUnitValue.bad;}
return { value: Number(match[1]), units: match[2].toLowerCase() }; // object
}
dojo.html.getUnitValue.bad = { value: NaN, units: '' };
 
if (dojo.render.html.ie) {
// IE branch
dojo.html.toPixelValue = function(/* HTMLElement */element, /* String */styleValue){
// summary
// Extract value in pixels from styleValue (IE version).
// If a value cannot be extracted, zero is returned.
if(!styleValue){return 0;}
if(styleValue.slice(-2) == 'px'){return parseFloat(styleValue);}
var pixelValue = 0;
with(element){
var sLeft = style.left;
var rsLeft = runtimeStyle.left;
runtimeStyle.left = currentStyle.left;
try {
style.left = styleValue || 0;
pixelValue = style.pixelLeft;
style.left = sLeft;
runtimeStyle.left = rsLeft;
}catch(e){
// FIXME: it's possible for styleValue to be incompatible with
// style.left. In particular, border width values of
// "thick", "medium", or "thin" will provoke an exception.
}
}
return pixelValue; // Number
}
} else {
// non-IE branch
dojo.html.toPixelValue = function(/* HTMLElement */element, /* String */styleValue){
// summary
// Extract value in pixels from styleValue (non-IE version).
// If a value cannot be extracted, zero is returned.
return (styleValue && (styleValue.slice(-2)=='px') ? parseFloat(styleValue) : 0); // Number
}
}
 
dojo.html.getPixelValue = function(/* HTMLElement */node, /* string */styleProperty, /* boolean? */autoIsZero){
// summary
// Get a computed style value, in pixels.
// node: HTMLElement
// Node to interrogate
// styleProperty: String
// Style property to query, in either css-selector or camelCase (property) format.
// autoIsZero: Boolean
// Deprecated. Any value that cannot be converted to pixels is returned as zero.
//
// summary
// Get the value of passed selector in pixels.
//
return dojo.html.toPixelValue(node, dojo.html.getComputedStyle(node, styleProperty));
}
 
dojo.html.setPositivePixelValue = function(/* HTMLElement */node, /* string */selector, /* integer */value){
// summary
// Attempt to set the value of selector on node as a positive pixel value.
if(isNaN(value)){return false;}
node.style[selector] = Math.max(0, value) + 'px';
return true; // boolean
}
 
dojo.html.styleSheet = null;
 
// FIXME: this is a really basic stub for adding and removing cssRules, but
// it assumes that you know the index of the cssRule that you want to add
// or remove, making it less than useful. So we need something that can
// search for the selector that you you want to remove.
dojo.html.insertCssRule = function(/* string */selector, /* string */declaration, /* integer? */index) {
// summary
// Attempt to insert declaration as selector on the internal stylesheet; if index try to set it there.
if (!dojo.html.styleSheet) {
if (document.createStyleSheet) { // IE
dojo.html.styleSheet = document.createStyleSheet();
} else if (document.styleSheets[0]) { // rest
// FIXME: should create a new style sheet here
// fall back on an exsiting style sheet
dojo.html.styleSheet = document.styleSheets[0];
} else {
return null; // integer
} // fail
}
 
if (arguments.length < 3) { // index may == 0
if (dojo.html.styleSheet.cssRules) { // W3
index = dojo.html.styleSheet.cssRules.length;
} else if (dojo.html.styleSheet.rules) { // IE
index = dojo.html.styleSheet.rules.length;
} else {
return null; // integer
} // fail
}
 
if (dojo.html.styleSheet.insertRule) { // W3
var rule = selector + " { " + declaration + " }";
return dojo.html.styleSheet.insertRule(rule, index); // integer
} else if (dojo.html.styleSheet.addRule) { // IE
return dojo.html.styleSheet.addRule(selector, declaration, index); // integer
} else {
return null; // integer
} // fail
}
 
dojo.html.removeCssRule = function(/* integer? */index){
// summary
// Attempt to remove the rule at index.
if(!dojo.html.styleSheet){
dojo.debug("no stylesheet defined for removing rules");
return false;
}
if(dojo.render.html.ie){
if(!index){
index = dojo.html.styleSheet.rules.length;
dojo.html.styleSheet.removeRule(index);
}
}else if(document.styleSheets[0]){
if(!index){
index = dojo.html.styleSheet.cssRules.length;
}
dojo.html.styleSheet.deleteRule(index);
}
return true; // boolean
}
 
dojo.html._insertedCssFiles = []; // cache container needed because IE reformats cssText when added to DOM
dojo.html.insertCssFile = function(/* string */URI, /* HTMLDocument? */doc, /* boolean? */checkDuplicates, /* boolean */fail_ok){
// summary
// calls css by XmlHTTP and inserts it into DOM as <style [widgetType="widgetType"]> *downloaded cssText*</style>
if(!URI){ return; }
if(!doc){ doc = document; }
var cssStr = dojo.hostenv.getText(URI, false, fail_ok);
if(cssStr===null){ return; }
cssStr = dojo.html.fixPathsInCssText(cssStr, URI);
 
if(checkDuplicates){
var idx = -1, node, ent = dojo.html._insertedCssFiles;
for(var i = 0; i < ent.length; i++){
if((ent[i].doc == doc) && (ent[i].cssText == cssStr)){
idx = i; node = ent[i].nodeRef;
break;
}
}
// make sure we havent deleted our node
if(node){
var styles = doc.getElementsByTagName("style");
for(var i = 0; i < styles.length; i++){
if(styles[i] == node){
return;
}
}
// delete this entry
dojo.html._insertedCssFiles.shift(idx, 1);
}
}
 
var style = dojo.html.insertCssText(cssStr, doc);
dojo.html._insertedCssFiles.push({'doc': doc, 'cssText': cssStr, 'nodeRef': style});
 
// insert custom attribute ex dbgHref="../foo.css" usefull when debugging in DOM inspectors, no?
if(style && djConfig.isDebug){
style.setAttribute("dbgHref", URI);
}
return style; // HTMLStyleElement
}
 
dojo.html.insertCssText = function(/* string */cssStr, /* HTMLDocument? */doc, /* string? */URI){
// summary
// Attempt to insert CSS rules into the document through inserting a style element
// DomNode Style = insertCssText(String ".dojoMenu {color: green;}"[, DomDoc document, dojo.uri.Uri Url ])
if(!cssStr){
return; // HTMLStyleElement
}
if(!doc){ doc = document; }
if(URI){// fix paths in cssStr
cssStr = dojo.html.fixPathsInCssText(cssStr, URI);
}
var style = doc.createElement("style");
style.setAttribute("type", "text/css");
// IE is b0rken enough to require that we add the element to the doc
// before changing it's properties
var head = doc.getElementsByTagName("head")[0];
if(!head){ // must have a head tag
dojo.debug("No head tag in document, aborting styles");
return; // HTMLStyleElement
}else{
head.appendChild(style);
}
if(style.styleSheet){// IE
var setFunc = function(){
try{
style.styleSheet.cssText = cssStr;
}catch(e){ dojo.debug(e); }
};
if(style.styleSheet.disabled){
setTimeout(setFunc, 10);
}else{
setFunc();
}
}else{ // w3c
var cssText = doc.createTextNode(cssStr);
style.appendChild(cssText);
}
return style; // HTMLStyleElement
}
 
dojo.html.fixPathsInCssText = function(/* string */cssStr, /* string */URI){
// summary
// usage: cssText comes from dojoroot/src/widget/templates/Foobar.css
// it has .dojoFoo { background-image: url(images/bar.png);} then uri should point to dojoroot/src/widget/templates/
if(!cssStr || !URI){ return; }
var match, str = "", url = "", urlChrs = "[\\t\\s\\w\\(\\)\\/\\.\\\\'\"-:#=&?~]+";
var regex = new RegExp('url\\(\\s*('+urlChrs+')\\s*\\)');
var regexProtocol = /(file|https?|ftps?):\/\//;
regexTrim = new RegExp("^[\\s]*(['\"]?)("+urlChrs+")\\1[\\s]*?$");
if(dojo.render.html.ie55 || dojo.render.html.ie60){
var regexIe = new RegExp("AlphaImageLoader\\((.*)src\=['\"]("+urlChrs+")['\"]");
// TODO: need to decide how to handle relative paths and AlphaImageLoader see #1441
// current implementation breaks on build with intern_strings
while(match = regexIe.exec(cssStr)){
url = match[2].replace(regexTrim, "$2");
if(!regexProtocol.exec(url)){
url = (new dojo.uri.Uri(URI, url).toString());
}
str += cssStr.substring(0, match.index) + "AlphaImageLoader(" + match[1] + "src='" + url + "'";
cssStr = cssStr.substr(match.index + match[0].length);
}
cssStr = str + cssStr;
str = "";
}
 
while(match = regex.exec(cssStr)){
url = match[1].replace(regexTrim, "$2");
if(!regexProtocol.exec(url)){
url = (new dojo.uri.Uri(URI, url).toString());
}
str += cssStr.substring(0, match.index) + "url(" + url + ")";
cssStr = cssStr.substr(match.index + match[0].length);
}
return str + cssStr; // string
}
 
dojo.html.setActiveStyleSheet = function(/* string */title){
// summary
// Activate style sheet with specified title.
var i = 0, a, els = dojo.doc().getElementsByTagName("link");
while (a = els[i++]) {
if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")){
a.disabled = true;
if (a.getAttribute("title") == title) { a.disabled = false; }
}
}
}
 
dojo.html.getActiveStyleSheet = function(){
// summary
// return the title of the currently active stylesheet
var i = 0, a, els = dojo.doc().getElementsByTagName("link");
while (a = els[i++]) {
if (a.getAttribute("rel").indexOf("style") != -1
&& a.getAttribute("title")
&& !a.disabled
){
return a.getAttribute("title"); // string
}
}
return null; // string
}
 
dojo.html.getPreferredStyleSheet = function(){
// summary
// Return the preferred stylesheet title (i.e. link without alt attribute)
var i = 0, a, els = dojo.doc().getElementsByTagName("link");
while (a = els[i++]) {
if(a.getAttribute("rel").indexOf("style") != -1
&& a.getAttribute("rel").indexOf("alt") == -1
&& a.getAttribute("title")
){
return a.getAttribute("title"); // string
}
}
return null; // string
}
 
dojo.html.applyBrowserClass = function(/* HTMLElement */node){
// summary
// Applies pre-set class names based on browser & version to the passed node.
// Modified version of Morris' CSS hack.
var drh=dojo.render.html;
var classes = {
dj_ie: drh.ie,
dj_ie55: drh.ie55,
dj_ie6: drh.ie60,
dj_ie7: drh.ie70,
dj_iequirks: drh.ie && drh.quirks,
dj_opera: drh.opera,
dj_opera8: drh.opera && (Math.floor(dojo.render.version)==8),
dj_opera9: drh.opera && (Math.floor(dojo.render.version)==9),
dj_khtml: drh.khtml,
dj_safari: drh.safari,
dj_gecko: drh.mozilla
}; // no dojo unsupported browsers
for(var p in classes){
if(classes[p]){
dojo.html.addClass(node, p);
}
}
};
 
dojo.provide("dojo.html.display");
 
 
dojo.html._toggle = function(node, tester, setter){
node = dojo.byId(node);
setter(node, !tester(node));
return tester(node);
}
 
dojo.html.show = function(/* HTMLElement */node){
// summary
// Show the passed element by reverting display property set by dojo.html.hide
node = dojo.byId(node);
if(dojo.html.getStyleProperty(node, 'display')=='none'){
dojo.html.setStyle(node, 'display', (node.dojoDisplayCache||''));
node.dojoDisplayCache = undefined; // cannot use delete on a node in IE6
}
}
 
dojo.html.hide = function(/* HTMLElement */node){
// summary
// Hide the passed element by setting display:none
node = dojo.byId(node);
if(typeof node["dojoDisplayCache"] == "undefined"){ // it could == '', so we cannot say !node.dojoDisplayCount
var d = dojo.html.getStyleProperty(node, 'display')
if(d!='none'){
node.dojoDisplayCache = d;
}
}
dojo.html.setStyle(node, 'display', 'none');
}
 
dojo.html.setShowing = function(/* HTMLElement */node, /* boolean? */showing){
// summary
// Calls show() if showing is true, hide() otherwise
dojo.html[(showing ? 'show' : 'hide')](node);
}
 
dojo.html.isShowing = function(/* HTMLElement */node){
// summary
// Returns whether the element is displayed or not.
// FIXME: returns true if node is bad, isHidden would be easier to make correct
return (dojo.html.getStyleProperty(node, 'display') != 'none'); // boolean
}
 
dojo.html.toggleShowing = function(/* HTMLElement */node){
// summary
// Call setShowing() on node with the complement of isShowing(), then return the new value of isShowing()
return dojo.html._toggle(node, dojo.html.isShowing, dojo.html.setShowing); // boolean
}
 
// Simple mapping of tag names to display values
// FIXME: simplistic
dojo.html.displayMap = { tr: '', td: '', th: '', img: 'inline', span: 'inline', input: 'inline', button: 'inline' };
 
dojo.html.suggestDisplayByTagName = function(/* HTMLElement */node){
// summary
// Suggest a value for the display property that will show 'node' based on it's tag
node = dojo.byId(node);
if(node && node.tagName){
var tag = node.tagName.toLowerCase();
return (tag in dojo.html.displayMap ? dojo.html.displayMap[tag] : 'block'); // string
}
}
 
dojo.html.setDisplay = function(/* HTMLElement */node, /* string */display){
// summary
// Sets the value of style.display to value of 'display' parameter if it is a string.
// Otherwise, if 'display' is false, set style.display to 'none'.
// Finally, set 'display' to a suggested display value based on the node's tag
dojo.html.setStyle(node, 'display', ((display instanceof String || typeof display == "string") ? display : (display ? dojo.html.suggestDisplayByTagName(node) : 'none')));
}
 
dojo.html.isDisplayed = function(/* HTMLElement */node){
// summary
// Is true if the the computed display style for node is not 'none'
// FIXME: returns true if node is bad, isNotDisplayed would be easier to make correct
return (dojo.html.getComputedStyle(node, 'display') != 'none'); // boolean
}
 
dojo.html.toggleDisplay = function(/* HTMLElement */node){
// summary
// Call setDisplay() on node with the complement of isDisplayed(), then
// return the new value of isDisplayed()
return dojo.html._toggle(node, dojo.html.isDisplayed, dojo.html.setDisplay); // boolean
}
 
dojo.html.setVisibility = function(/* HTMLElement */node, /* string */visibility){
// summary
// Sets the value of style.visibility to value of 'visibility' parameter if it is a string.
// Otherwise, if 'visibility' is false, set style.visibility to 'hidden'. Finally, set style.visibility to 'visible'.
dojo.html.setStyle(node, 'visibility', ((visibility instanceof String || typeof visibility == "string") ? visibility : (visibility ? 'visible' : 'hidden')));
}
 
dojo.html.isVisible = function(/* HTMLElement */node){
// summary
// Returns true if the the computed visibility style for node is not 'hidden'
// FIXME: returns true if node is bad, isInvisible would be easier to make correct
return (dojo.html.getComputedStyle(node, 'visibility') != 'hidden'); // boolean
}
 
dojo.html.toggleVisibility = function(node){
// summary
// Call setVisibility() on node with the complement of isVisible(), then return the new value of isVisible()
return dojo.html._toggle(node, dojo.html.isVisible, dojo.html.setVisibility); // boolean
}
 
dojo.html.setOpacity = function(/* HTMLElement */node, /* float */opacity, /* boolean? */dontFixOpacity){
// summary
// Sets the opacity of node in a cross-browser way.
// float between 0.0 (transparent) and 1.0 (opaque)
node = dojo.byId(node);
var h = dojo.render.html;
if(!dontFixOpacity){
if( opacity >= 1.0){
if(h.ie){
dojo.html.clearOpacity(node);
return;
}else{
opacity = 0.999999;
}
}else if( opacity < 0.0){ opacity = 0; }
}
if(h.ie){
if(node.nodeName.toLowerCase() == "tr"){
// FIXME: is this too naive? will we get more than we want?
var tds = node.getElementsByTagName("td");
for(var x=0; x<tds.length; x++){
tds[x].style.filter = "Alpha(Opacity="+opacity*100+")";
}
}
node.style.filter = "Alpha(Opacity="+opacity*100+")";
}else if(h.moz){
node.style.opacity = opacity; // ffox 1.0 directly supports "opacity"
node.style.MozOpacity = opacity;
}else if(h.safari){
node.style.opacity = opacity; // 1.3 directly supports "opacity"
node.style.KhtmlOpacity = opacity;
}else{
node.style.opacity = opacity;
}
}
 
dojo.html.clearOpacity = function(/* HTMLElement */node){
// summary
// Clears any opacity setting on the passed element.
node = dojo.byId(node);
var ns = node.style;
var h = dojo.render.html;
if(h.ie){
try {
if( node.filters && node.filters.alpha ){
ns.filter = ""; // FIXME: may get rid of other filter effects
}
} catch(e) {
/*
* IE7 gives error if node.filters not set;
* don't know why or how to workaround (other than this)
*/
}
}else if(h.moz){
ns.opacity = 1;
ns.MozOpacity = 1;
}else if(h.safari){
ns.opacity = 1;
ns.KhtmlOpacity = 1;
}else{
ns.opacity = 1;
}
}
 
dojo.html.getOpacity = function(/* HTMLElement */node){
// summary
// Returns the opacity of the passed element
node = dojo.byId(node);
var h = dojo.render.html;
if(h.ie){
var opac = (node.filters && node.filters.alpha &&
typeof node.filters.alpha.opacity == "number"
? node.filters.alpha.opacity : 100) / 100;
}else{
var opac = node.style.opacity || node.style.MozOpacity ||
node.style.KhtmlOpacity || 1;
}
return opac >= 0.999999 ? 1.0 : Number(opac); // float
}
 
 
dojo.provide("dojo.html.color");
 
 
 
 
dojo.html.getBackgroundColor = function(/* HTMLElement */node){
// summary
// returns the background color of the passed node as a 32-bit color (RGBA)
node = dojo.byId(node);
var color;
do{
color = dojo.html.getStyle(node, "background-color");
// Safari doesn't say "transparent"
if(color.toLowerCase() == "rgba(0, 0, 0, 0)") { color = "transparent"; }
if(node == document.getElementsByTagName("body")[0]) { node = null; break; }
node = node.parentNode;
}while(node && dojo.lang.inArray(["transparent", ""], color));
if(color == "transparent"){
color = [255, 255, 255, 0];
}else{
color = dojo.gfx.color.extractRGB(color);
}
return color; // array
}
 
dojo.provide("dojo.html.layout");
 
 
 
 
 
dojo.html.sumAncestorProperties = function(/* HTMLElement */node, /* string */prop){
// summary
// Returns the sum of the passed property on all ancestors of node.
node = dojo.byId(node);
if(!node){ return 0; } // FIXME: throw an error?
var retVal = 0;
while(node){
if(dojo.html.getComputedStyle(node, 'position') == 'fixed'){
return 0;
}
var val = node[prop];
if(val){
retVal += val - 0;
if(node==dojo.body()){ break; }// opera and khtml #body & #html has the same values, we only need one value
}
node = node.parentNode;
}
return retVal; // integer
}
 
dojo.html.setStyleAttributes = function(/* HTMLElement */node, /* string */attributes) {
// summary
// allows a dev to pass a string similar to what you'd pass in style="", and apply it to a node.
node = dojo.byId(node);
var splittedAttribs=attributes.replace(/(;)?\s*$/, "").split(";");
for(var i=0; i<splittedAttribs.length; i++){
var nameValue=splittedAttribs[i].split(":");
var name=nameValue[0].replace(/\s*$/, "").replace(/^\s*/, "").toLowerCase();
var value=nameValue[1].replace(/\s*$/, "").replace(/^\s*/, "");
switch(name){
case "opacity":
dojo.html.setOpacity(node, value);
break;
case "content-height":
dojo.html.setContentBox(node, {height: value});
break;
case "content-width":
dojo.html.setContentBox(node, {width: value});
break;
case "outer-height":
dojo.html.setMarginBox(node, {height: value});
break;
case "outer-width":
dojo.html.setMarginBox(node, {width: value});
break;
default:
node.style[dojo.html.toCamelCase(name)]=value;
}
}
}
 
dojo.html.boxSizing = {
MARGIN_BOX: "margin-box",
BORDER_BOX: "border-box",
PADDING_BOX: "padding-box",
CONTENT_BOX: "content-box"
};
 
dojo.html.getAbsolutePosition = dojo.html.abs = function(/* HTMLElement */node, /* boolean? */includeScroll, /* string? */boxType){
// summary
// Gets the absolute position of the passed element based on the document itself.
node = dojo.byId(node, node.ownerDocument);
var ret = {
x: 0,
y: 0
};
 
var bs = dojo.html.boxSizing;
if(!boxType) { boxType = bs.CONTENT_BOX; }
var nativeBoxType = 2; //BORDER box
var targetBoxType;
switch(boxType){
case bs.MARGIN_BOX:
targetBoxType = 3;
break;
case bs.BORDER_BOX:
targetBoxType = 2;
break;
case bs.PADDING_BOX:
default:
targetBoxType = 1;
break;
case bs.CONTENT_BOX:
targetBoxType = 0;
break;
}
 
var h = dojo.render.html;
var db = document["body"]||document["documentElement"];
 
if(h.ie){
with(node.getBoundingClientRect()){
ret.x = left-2;
ret.y = top-2;
}
}else if(document.getBoxObjectFor){
// mozilla
nativeBoxType = 1; //getBoxObjectFor return padding box coordinate
try{
var bo = document.getBoxObjectFor(node);
ret.x = bo.x - dojo.html.sumAncestorProperties(node, "scrollLeft");
ret.y = bo.y - dojo.html.sumAncestorProperties(node, "scrollTop");
}catch(e){
// squelch
}
}else{
if(node["offsetParent"]){
var endNode;
// in Safari, if the node is an absolutely positioned child of
// the body and the body has a margin the offset of the child
// and the body contain the body's margins, so we need to end
// at the body
if( (h.safari)&&
(node.style.getPropertyValue("position") == "absolute")&&
(node.parentNode == db)){
endNode = db;
}else{
endNode = db.parentNode;
}
 
//TODO: set correct nativeBoxType for safari/konqueror
 
if(node.parentNode != db){
var nd = node;
if(dojo.render.html.opera){ nd = db; }
ret.x -= dojo.html.sumAncestorProperties(nd, "scrollLeft");
ret.y -= dojo.html.sumAncestorProperties(nd, "scrollTop");
}
var curnode = node;
do{
var n = curnode["offsetLeft"];
//FIXME: ugly hack to workaround the submenu in
//popupmenu2 does not shown up correctly in opera.
//Someone have a better workaround?
if(!h.opera || n>0){
ret.x += isNaN(n) ? 0 : n;
}
var m = curnode["offsetTop"];
ret.y += isNaN(m) ? 0 : m;
curnode = curnode.offsetParent;
}while((curnode != endNode)&&(curnode != null));
}else if(node["x"]&&node["y"]){
ret.x += isNaN(node.x) ? 0 : node.x;
ret.y += isNaN(node.y) ? 0 : node.y;
}
}
 
// account for document scrolling!
if(includeScroll){
var scroll = dojo.html.getScroll();
ret.y += scroll.top;
ret.x += scroll.left;
}
 
var extentFuncArray=[dojo.html.getPaddingExtent, dojo.html.getBorderExtent, dojo.html.getMarginExtent];
if(nativeBoxType > targetBoxType){
for(var i=targetBoxType;i<nativeBoxType;++i){
ret.y += extentFuncArray[i](node, 'top');
ret.x += extentFuncArray[i](node, 'left');
}
}else if(nativeBoxType < targetBoxType){
for(var i=targetBoxType;i>nativeBoxType;--i){
ret.y -= extentFuncArray[i-1](node, 'top');
ret.x -= extentFuncArray[i-1](node, 'left');
}
}
ret.top = ret.y;
ret.left = ret.x;
return ret; // object
}
 
dojo.html.isPositionAbsolute = function(/* HTMLElement */node){
// summary
// Returns true if the element is absolutely positioned.
return (dojo.html.getComputedStyle(node, 'position') == 'absolute'); // boolean
}
 
dojo.html._sumPixelValues = function(/* HTMLElement */node, selectors, autoIsZero){
var total = 0;
for(var x=0; x<selectors.length; x++){
total += dojo.html.getPixelValue(node, selectors[x], autoIsZero);
}
return total;
}
 
dojo.html.getMargin = function(/* HTMLElement */node){
// summary
// Returns the width and height of the passed node's margin
return {
width: dojo.html._sumPixelValues(node, ["margin-left", "margin-right"], (dojo.html.getComputedStyle(node, 'position') == 'absolute')),
height: dojo.html._sumPixelValues(node, ["margin-top", "margin-bottom"], (dojo.html.getComputedStyle(node, 'position') == 'absolute'))
}; // object
}
 
dojo.html.getBorder = function(/* HTMLElement */node){
// summary
// Returns the width and height of the passed node's border
return {
width: dojo.html.getBorderExtent(node, 'left') + dojo.html.getBorderExtent(node, 'right'),
height: dojo.html.getBorderExtent(node, 'top') + dojo.html.getBorderExtent(node, 'bottom')
}; // object
}
 
dojo.html.getBorderExtent = function(/* HTMLElement */node, /* string */side){
// summary
// returns the width of the requested border
return (dojo.html.getStyle(node, 'border-' + side + '-style') == 'none' ? 0 : dojo.html.getPixelValue(node, 'border-' + side + '-width')); // integer
}
 
dojo.html.getMarginExtent = function(/* HTMLElement */node, /* string */side){
// summary
// returns the width of the requested margin
return dojo.html._sumPixelValues(node, ["margin-" + side], dojo.html.isPositionAbsolute(node)); // integer
}
 
dojo.html.getPaddingExtent = function(/* HTMLElement */node, /* string */side){
// summary
// Returns the width of the requested padding
return dojo.html._sumPixelValues(node, ["padding-" + side], true); // integer
}
 
dojo.html.getPadding = function(/* HTMLElement */node){
// summary
// Returns the width and height of the passed node's padding
return {
width: dojo.html._sumPixelValues(node, ["padding-left", "padding-right"], true),
height: dojo.html._sumPixelValues(node, ["padding-top", "padding-bottom"], true)
}; // object
}
 
dojo.html.getPadBorder = function(/* HTMLElement */node){
// summary
// Returns the width and height of the passed node's padding and border
var pad = dojo.html.getPadding(node);
var border = dojo.html.getBorder(node);
return { width: pad.width + border.width, height: pad.height + border.height }; // object
}
 
dojo.html.getBoxSizing = function(/* HTMLElement */node){
// summary
// Returns which box model the passed element is working with
var h = dojo.render.html;
var bs = dojo.html.boxSizing;
if(((h.ie)||(h.opera)) && node.nodeName.toLowerCase() != "img"){
var cm = document["compatMode"];
if((cm == "BackCompat")||(cm == "QuirksMode")){
return bs.BORDER_BOX; // string
}else{
return bs.CONTENT_BOX; // string
}
}else{
if(arguments.length == 0){ node = document.documentElement; }
var sizing;
if(!h.ie){
sizing = dojo.html.getStyle(node, "-moz-box-sizing");
if(!sizing){
sizing = dojo.html.getStyle(node, "box-sizing");
}
}
return (sizing ? sizing : bs.CONTENT_BOX); // string
}
}
 
dojo.html.isBorderBox = function(/* HTMLElement */node){
// summary
// returns whether the passed element is using border box sizing or not.
return (dojo.html.getBoxSizing(node) == dojo.html.boxSizing.BORDER_BOX); // boolean
}
 
dojo.html.getBorderBox = function(/* HTMLElement */node){
// summary
// Returns the dimensions of the passed element based on border-box sizing.
node = dojo.byId(node);
return { width: node.offsetWidth, height: node.offsetHeight }; // object
}
 
dojo.html.getPaddingBox = function(/* HTMLElement */node){
// summary
// Returns the dimensions of the padding box (see http://www.w3.org/TR/CSS21/box.html)
var box = dojo.html.getBorderBox(node);
var border = dojo.html.getBorder(node);
return {
width: box.width - border.width,
height:box.height - border.height
}; // object
}
 
dojo.html.getContentBox = function(/* HTMLElement */node){
// summary
// Returns the dimensions of the content box (see http://www.w3.org/TR/CSS21/box.html)
node = dojo.byId(node);
var padborder = dojo.html.getPadBorder(node);
return {
width: node.offsetWidth - padborder.width,
height: node.offsetHeight - padborder.height
}; // object
}
 
dojo.html.setContentBox = function(/* HTMLElement */node, /* object */args){
// summary
// Sets the dimensions of the passed node according to content sizing.
node = dojo.byId(node);
var width = 0; var height = 0;
var isbb = dojo.html.isBorderBox(node);
var padborder = (isbb ? dojo.html.getPadBorder(node) : { width: 0, height: 0});
var ret = {};
if(typeof args.width != "undefined"){
width = args.width + padborder.width;
ret.width = dojo.html.setPositivePixelValue(node, "width", width);
}
if(typeof args.height != "undefined"){
height = args.height + padborder.height;
ret.height = dojo.html.setPositivePixelValue(node, "height", height);
}
return ret; // object
}
 
dojo.html.getMarginBox = function(/* HTMLElement */node){
// summary
// returns the dimensions of the passed node including any margins.
var borderbox = dojo.html.getBorderBox(node);
var margin = dojo.html.getMargin(node);
return { width: borderbox.width + margin.width, height: borderbox.height + margin.height }; // object
}
 
dojo.html.setMarginBox = function(/* HTMLElement */node, /* object */args){
// summary
// Sets the dimensions of the passed node using margin box calcs.
node = dojo.byId(node);
var width = 0; var height = 0;
var isbb = dojo.html.isBorderBox(node);
var padborder = (!isbb ? dojo.html.getPadBorder(node) : { width: 0, height: 0 });
var margin = dojo.html.getMargin(node);
var ret = {};
if(typeof args.width != "undefined"){
width = args.width - padborder.width;
width -= margin.width;
ret.width = dojo.html.setPositivePixelValue(node, "width", width);
}
if(typeof args.height != "undefined"){
height = args.height - padborder.height;
height -= margin.height;
ret.height = dojo.html.setPositivePixelValue(node, "height", height);
}
return ret; // object
}
 
dojo.html.getElementBox = function(/* HTMLElement */node, /* string */type){
// summary
// return dimesions of a node based on the passed box model type.
var bs = dojo.html.boxSizing;
switch(type){
case bs.MARGIN_BOX:
return dojo.html.getMarginBox(node); // object
case bs.BORDER_BOX:
return dojo.html.getBorderBox(node); // object
case bs.PADDING_BOX:
return dojo.html.getPaddingBox(node); // object
case bs.CONTENT_BOX:
default:
return dojo.html.getContentBox(node); // object
}
}
// in: coordinate array [x,y,w,h] or dom node
// return: coordinate object
dojo.html.toCoordinateObject = dojo.html.toCoordinateArray = function(/* array */coords, /* boolean? */includeScroll, /* string? */boxtype) {
// summary
// Converts an array of coordinates into an object of named arguments.
if(coords instanceof Array || typeof coords == "array"){
dojo.deprecated("dojo.html.toCoordinateArray", "use dojo.html.toCoordinateObject({left: , top: , width: , height: }) instead", "0.5");
// coords is already an array (of format [x,y,w,h]), just return it
while ( coords.length < 4 ) { coords.push(0); }
while ( coords.length > 4 ) { coords.pop(); }
var ret = {
left: coords[0],
top: coords[1],
width: coords[2],
height: coords[3]
};
}else if(!coords.nodeType && !(coords instanceof String || typeof coords == "string") &&
('width' in coords || 'height' in coords || 'left' in coords ||
'x' in coords || 'top' in coords || 'y' in coords)){
// coords is a coordinate object or at least part of one
var ret = {
left: coords.left||coords.x||0,
top: coords.top||coords.y||0,
width: coords.width||0,
height: coords.height||0
};
}else{
// coords is an dom object (or dom object id); return it's coordinates
var node = dojo.byId(coords);
var pos = dojo.html.abs(node, includeScroll, boxtype);
var marginbox = dojo.html.getMarginBox(node);
var ret = {
left: pos.left,
top: pos.top,
width: marginbox.width,
height: marginbox.height
};
}
ret.x = ret.left;
ret.y = ret.top;
return ret; // object
}
 
dojo.html.setMarginBoxWidth = dojo.html.setOuterWidth = function(node, width){
return dojo.html._callDeprecated("setMarginBoxWidth", "setMarginBox", arguments, "width");
}
dojo.html.setMarginBoxHeight = dojo.html.setOuterHeight = function(){
return dojo.html._callDeprecated("setMarginBoxHeight", "setMarginBox", arguments, "height");
}
dojo.html.getMarginBoxWidth = dojo.html.getOuterWidth = function(){
return dojo.html._callDeprecated("getMarginBoxWidth", "getMarginBox", arguments, null, "width");
}
dojo.html.getMarginBoxHeight = dojo.html.getOuterHeight = function(){
return dojo.html._callDeprecated("getMarginBoxHeight", "getMarginBox", arguments, null, "height");
}
dojo.html.getTotalOffset = function(node, type, includeScroll){
return dojo.html._callDeprecated("getTotalOffset", "getAbsolutePosition", arguments, null, type);
}
dojo.html.getAbsoluteX = function(node, includeScroll){
return dojo.html._callDeprecated("getAbsoluteX", "getAbsolutePosition", arguments, null, "x");
}
dojo.html.getAbsoluteY = function(node, includeScroll){
return dojo.html._callDeprecated("getAbsoluteY", "getAbsolutePosition", arguments, null, "y");
}
dojo.html.totalOffsetLeft = function(node, includeScroll){
return dojo.html._callDeprecated("totalOffsetLeft", "getAbsolutePosition", arguments, null, "left");
}
dojo.html.totalOffsetTop = function(node, includeScroll){
return dojo.html._callDeprecated("totalOffsetTop", "getAbsolutePosition", arguments, null, "top");
}
dojo.html.getMarginWidth = function(node){
return dojo.html._callDeprecated("getMarginWidth", "getMargin", arguments, null, "width");
}
dojo.html.getMarginHeight = function(node){
return dojo.html._callDeprecated("getMarginHeight", "getMargin", arguments, null, "height");
}
dojo.html.getBorderWidth = function(node){
return dojo.html._callDeprecated("getBorderWidth", "getBorder", arguments, null, "width");
}
dojo.html.getBorderHeight = function(node){
return dojo.html._callDeprecated("getBorderHeight", "getBorder", arguments, null, "height");
}
dojo.html.getPaddingWidth = function(node){
return dojo.html._callDeprecated("getPaddingWidth", "getPadding", arguments, null, "width");
}
dojo.html.getPaddingHeight = function(node){
return dojo.html._callDeprecated("getPaddingHeight", "getPadding", arguments, null, "height");
}
dojo.html.getPadBorderWidth = function(node){
return dojo.html._callDeprecated("getPadBorderWidth", "getPadBorder", arguments, null, "width");
}
dojo.html.getPadBorderHeight = function(node){
return dojo.html._callDeprecated("getPadBorderHeight", "getPadBorder", arguments, null, "height");
}
dojo.html.getBorderBoxWidth = dojo.html.getInnerWidth = function(){
return dojo.html._callDeprecated("getBorderBoxWidth", "getBorderBox", arguments, null, "width");
}
dojo.html.getBorderBoxHeight = dojo.html.getInnerHeight = function(){
return dojo.html._callDeprecated("getBorderBoxHeight", "getBorderBox", arguments, null, "height");
}
dojo.html.getContentBoxWidth = dojo.html.getContentWidth = function(){
return dojo.html._callDeprecated("getContentBoxWidth", "getContentBox", arguments, null, "width");
}
dojo.html.getContentBoxHeight = dojo.html.getContentHeight = function(){
return dojo.html._callDeprecated("getContentBoxHeight", "getContentBox", arguments, null, "height");
}
dojo.html.setContentBoxWidth = dojo.html.setContentWidth = function(node, width){
return dojo.html._callDeprecated("setContentBoxWidth", "setContentBox", arguments, "width");
}
dojo.html.setContentBoxHeight = dojo.html.setContentHeight = function(node, height){
return dojo.html._callDeprecated("setContentBoxHeight", "setContentBox", arguments, "height");
}
 
dojo.provide("dojo.lfx.html");
 
 
 
 
 
 
 
 
dojo.lfx.html._byId = function(nodes){
if(!nodes){ return []; }
if(dojo.lang.isArrayLike(nodes)){
if(!nodes.alreadyChecked){
var n = [];
dojo.lang.forEach(nodes, function(node){
n.push(dojo.byId(node));
});
n.alreadyChecked = true;
return n;
}else{
return nodes;
}
}else{
var n = [];
n.push(dojo.byId(nodes));
n.alreadyChecked = true;
return n;
}
}
 
dojo.lfx.html.propertyAnimation = function( /*DOMNode[]*/ nodes,
/*Object[]*/ propertyMap,
/*int*/ duration,
/*function*/ easing,
/*Object*/ handlers){
// summary: Returns an animation that will transition the properties of "nodes"
// depending how they are defined in "propertyMap".
// nodes: An array of DOMNodes or one DOMNode.
// propertyMap: { property: String, start: Decimal?, end: Decimal?, units: String? }
// An array of objects defining properties to change.
// duration: Duration of the animation in milliseconds.
// easing: An easing function.
// handlers: { handler: Function?, onstart: Function?, onstop: Function?, onanimate: Function? }
nodes = dojo.lfx.html._byId(nodes);
 
var targs = {
"propertyMap": propertyMap,
"nodes": nodes,
"duration": duration,
"easing": easing||dojo.lfx.easeDefault
};
var setEmUp = function(args){
if(args.nodes.length==1){
// FIXME: we're only supporting start-value filling when one node is
// passed
var pm = args.propertyMap;
if(!dojo.lang.isArray(args.propertyMap)){
// it's stupid to have to pack an array with a set of objects
// when you can just pass in an object list
var parr = [];
for(var pname in pm){
pm[pname].property = pname;
parr.push(pm[pname]);
}
pm = args.propertyMap = parr;
}
dojo.lang.forEach(pm, function(prop){
if(dj_undef("start", prop)){
if(prop.property != "opacity"){
prop.start = parseInt(dojo.html.getComputedStyle(args.nodes[0], prop.property));
}else{
prop.start = dojo.html.getOpacity(args.nodes[0]);
}
}
});
}
}
 
var coordsAsInts = function(coords){
var cints = [];
dojo.lang.forEach(coords, function(c){
cints.push(Math.round(c));
});
return cints;
}
 
var setStyle = function(n, style){
n = dojo.byId(n);
if(!n || !n.style){ return; }
for(var s in style){
try{
if(s == "opacity"){
dojo.html.setOpacity(n, style[s]);
}else{
n.style[s] = style[s];
}
}catch(e){ dojo.debug(e); }
}
}
 
var propLine = function(properties){
this._properties = properties;
this.diffs = new Array(properties.length);
dojo.lang.forEach(properties, function(prop, i){
// calculate the end - start to optimize a bit
if(dojo.lang.isFunction(prop.start)){
prop.start = prop.start(prop, i);
}
if(dojo.lang.isFunction(prop.end)){
prop.end = prop.end(prop, i);
}
if(dojo.lang.isArray(prop.start)){
// don't loop through the arrays
this.diffs[i] = null;
}else if(prop.start instanceof dojo.gfx.color.Color){
// save these so we don't have to call toRgb() every getValue() call
prop.startRgb = prop.start.toRgb();
prop.endRgb = prop.end.toRgb();
}else{
this.diffs[i] = prop.end - prop.start;
}
}, this);
 
this.getValue = function(n){
var ret = {};
dojo.lang.forEach(this._properties, function(prop, i){
var value = null;
if(dojo.lang.isArray(prop.start)){
// FIXME: what to do here?
}else if(prop.start instanceof dojo.gfx.color.Color){
value = (prop.units||"rgb") + "(";
for(var j = 0 ; j < prop.startRgb.length ; j++){
value += Math.round(((prop.endRgb[j] - prop.startRgb[j]) * n) + prop.startRgb[j]) + (j < prop.startRgb.length - 1 ? "," : "");
}
value += ")";
}else{
value = ((this.diffs[i]) * n) + prop.start + (prop.property != "opacity" ? prop.units||"px" : "");
}
ret[dojo.html.toCamelCase(prop.property)] = value;
}, this);
return ret;
}
}
var anim = new dojo.lfx.Animation({
beforeBegin: function(){
setEmUp(targs);
anim.curve = new propLine(targs.propertyMap);
},
onAnimate: function(propValues){
dojo.lang.forEach(targs.nodes, function(node){
setStyle(node, propValues);
});
}
},
targs.duration,
null,
targs.easing
);
if(handlers){
for(var x in handlers){
if(dojo.lang.isFunction(handlers[x])){
anim.connect(x, anim, handlers[x]);
}
}
}
return anim; // dojo.lfx.Animation
}
 
dojo.lfx.html._makeFadeable = function(nodes){
var makeFade = function(node){
if(dojo.render.html.ie){
// only set the zoom if the "tickle" value would be the same as the
// default
if( (node.style.zoom.length == 0) &&
(dojo.html.getStyle(node, "zoom") == "normal") ){
// make sure the node "hasLayout"
// NOTE: this has been tested with larger and smaller user-set text
// sizes and works fine
node.style.zoom = "1";
// node.style.zoom = "normal";
}
// don't set the width to auto if it didn't already cascade that way.
// We don't want to f anyones designs
if( (node.style.width.length == 0) &&
(dojo.html.getStyle(node, "width") == "auto") ){
node.style.width = "auto";
}
}
}
if(dojo.lang.isArrayLike(nodes)){
dojo.lang.forEach(nodes, makeFade);
}else{
makeFade(nodes);
}
}
 
dojo.lfx.html.fade = function(/*DOMNode[]*/ nodes,
/*Object*/values,
/*int?*/ duration,
/*Function?*/ easing,
/*Function?*/ callback){
// summary:Returns an animation that will fade the "nodes" from the start to end values passed.
// nodes: An array of DOMNodes or one DOMNode.
// values: { start: Decimal?, end: Decimal? }
// duration: Duration of the animation in milliseconds.
// easing: An easing function.
// callback: Function to run at the end of the animation.
nodes = dojo.lfx.html._byId(nodes);
var props = { property: "opacity" };
if(!dj_undef("start", values)){
props.start = values.start;
}else{
props.start = function(){ return dojo.html.getOpacity(nodes[0]); };
}
 
if(!dj_undef("end", values)){
props.end = values.end;
}else{
dojo.raise("dojo.lfx.html.fade needs an end value");
}
 
var anim = dojo.lfx.propertyAnimation(nodes, [ props ], duration, easing);
anim.connect("beforeBegin", function(){
dojo.lfx.html._makeFadeable(nodes);
});
if(callback){
anim.connect("onEnd", function(){ callback(nodes, anim); });
}
 
return anim; // dojo.lfx.Animation
}
 
dojo.lfx.html.fadeIn = function(/*DOMNode[]*/ nodes, /*int?*/ duration, /*Function?*/ easing, /*Function?*/ callback){
// summary: Returns an animation that will fade "nodes" from its current opacity to fully opaque.
// nodes: An array of DOMNodes or one DOMNode.
// duration: Duration of the animation in milliseconds.
// easing: An easing function.
// callback: Function to run at the end of the animation.
return dojo.lfx.html.fade(nodes, { end: 1 }, duration, easing, callback); // dojo.lfx.Animation
}
 
dojo.lfx.html.fadeOut = function(/*DOMNode[]*/ nodes, /*int?*/ duration, /*Function?*/ easing, /*Function?*/ callback){
// summary: Returns an animation that will fade "nodes" from its current opacity to fully transparent.
// nodes: An array of DOMNodes or one DOMNode.
// duration: Duration of the animation in milliseconds.
// easing: An easing function.
// callback: Function to run at the end of the animation.
return dojo.lfx.html.fade(nodes, { end: 0 }, duration, easing, callback); // dojo.lfx.Animation
}
 
dojo.lfx.html.fadeShow = function(/*DOMNode[]*/ nodes, /*int?*/ duration, /*Function?*/ easing, /*Function?*/ callback){
// summary: Returns an animation that will fade "nodes" from transparent to opaque and shows
// "nodes" at the end if it is hidden.
// nodes: An array of DOMNodes or one DOMNode.
// duration: Duration of the animation in milliseconds.
// easing: An easing function.
// callback: Function to run at the end of the animation.
nodes=dojo.lfx.html._byId(nodes);
dojo.lang.forEach(nodes, function(node){
dojo.html.setOpacity(node, 0.0);
});
 
var anim = dojo.lfx.html.fadeIn(nodes, duration, easing, callback);
anim.connect("beforeBegin", function(){
if(dojo.lang.isArrayLike(nodes)){
dojo.lang.forEach(nodes, dojo.html.show);
}else{
dojo.html.show(nodes);
}
});
 
return anim; // dojo.lfx.Animation
}
 
dojo.lfx.html.fadeHide = function(/*DOMNode[]*/ nodes, /*int?*/ duration, /*Function?*/ easing, /*Function?*/ callback){
// summary: Returns an animation that will fade "nodes" from its current opacity to opaque and hides
// "nodes" at the end.
// nodes: An array of DOMNodes or one DOMNode.
// duration: Duration of the animation in milliseconds.
// easing: An easing function.
// callback: Function to run at the end of the animation.
var anim = dojo.lfx.html.fadeOut(nodes, duration, easing, function(){
if(dojo.lang.isArrayLike(nodes)){
dojo.lang.forEach(nodes, dojo.html.hide);
}else{
dojo.html.hide(nodes);
}
if(callback){ callback(nodes, anim); }
});
return anim; // dojo.lfx.Animation
}
 
dojo.lfx.html.wipeIn = function(/*DOMNode[]*/ nodes, /*int?*/ duration, /*Function?*/ easing, /*Function?*/ callback){
// summary: Returns an animation that will show and wipe in "nodes".
// nodes: An array of DOMNodes or one DOMNode.
// duration: Duration of the animation in milliseconds.
// easing: An easing function.
// callback: Function to run at the end of the animation.
nodes = dojo.lfx.html._byId(nodes);
var anims = [];
 
dojo.lang.forEach(nodes, function(node){
var oprop = { }; // old properties of node (before we mucked w/them)
// get node height, either it's natural height or it's height specified via style or class attributes
// (for FF, the node has to be (temporarily) rendered to measure height)
// TODO: should this offscreen code be part of dojo.html, so that getBorderBox() works on hidden nodes?
var origTop, origLeft, origPosition;
with(node.style){
origTop=top; origLeft=left; origPosition=position;
top="-9999px"; left="-9999px"; position="absolute";
display="";
}
var nodeHeight = dojo.html.getBorderBox(node).height;
with(node.style){
top=origTop; left=origLeft; position=origPosition;
display="none";
}
 
var anim = dojo.lfx.propertyAnimation(node,
{ "height": {
start: 1, // 0 causes IE to display the whole panel
end: function(){ return nodeHeight; }
}
},
duration,
easing);
anim.connect("beforeBegin", function(){
oprop.overflow = node.style.overflow;
oprop.height = node.style.height;
with(node.style){
overflow = "hidden";
height = "1px"; // 0 causes IE to display the whole panel
}
dojo.html.show(node);
});
anim.connect("onEnd", function(){
with(node.style){
overflow = oprop.overflow;
height = oprop.height;
}
if(callback){ callback(node, anim); }
});
anims.push(anim);
});
return dojo.lfx.combine(anims); // dojo.lfx.Combine
}
 
dojo.lfx.html.wipeOut = function(/*DOMNode[]*/ nodes, /*int?*/ duration, /*Function?*/ easing, /*Function?*/ callback){
// summary: Returns an animation that will wipe out and hide "nodes".
// nodes: An array of DOMNodes or one DOMNode.
// duration: Duration of the animation in milliseconds.
// easing: An easing function.
// callback: Function to run at the end of the animation.
nodes = dojo.lfx.html._byId(nodes);
var anims = [];
dojo.lang.forEach(nodes, function(node){
var oprop = { }; // old properties of node (before we mucked w/them)
var anim = dojo.lfx.propertyAnimation(node,
{ "height": {
start: function(){ return dojo.html.getContentBox(node).height; },
end: 1 // 0 causes IE to display the whole panel
}
},
duration,
easing,
{
"beforeBegin": function(){
oprop.overflow = node.style.overflow;
oprop.height = node.style.height;
with(node.style){
overflow = "hidden";
}
dojo.html.show(node);
},
"onEnd": function(){
dojo.html.hide(node);
with(node.style){
overflow = oprop.overflow;
height = oprop.height;
}
if(callback){ callback(node, anim); }
}
}
);
anims.push(anim);
});
 
return dojo.lfx.combine(anims); // dojo.lfx.Combine
}
 
dojo.lfx.html.slideTo = function(/*DOMNode*/ nodes,
/*Object*/ coords,
/*int?*/ duration,
/*Function?*/ easing,
/*Function?*/ callback){
// summary: Returns an animation that will slide "nodes" from its current position to
// the position defined in "coords".
// nodes: An array of DOMNodes or one DOMNode.
// coords: { top: Decimal?, left: Decimal? }
// duration: Duration of the animation in milliseconds.
// easing: An easing function.
// callback: Function to run at the end of the animation.
nodes = dojo.lfx.html._byId(nodes);
var anims = [];
var compute = dojo.html.getComputedStyle;
if(dojo.lang.isArray(coords)){
/* coords: Array
pId: a */
dojo.deprecated('dojo.lfx.html.slideTo(node, array)', 'use dojo.lfx.html.slideTo(node, {top: value, left: value});', '0.5');
coords = { top: coords[0], left: coords[1] };
}
dojo.lang.forEach(nodes, function(node){
var top = null;
var left = null;
var init = (function(){
var innerNode = node;
return function(){
var pos = compute(innerNode, 'position');
top = (pos == 'absolute' ? node.offsetTop : parseInt(compute(node, 'top')) || 0);
left = (pos == 'absolute' ? node.offsetLeft : parseInt(compute(node, 'left')) || 0);
 
if (!dojo.lang.inArray(['absolute', 'relative'], pos)) {
var ret = dojo.html.abs(innerNode, true);
dojo.html.setStyleAttributes(innerNode, "position:absolute;top:"+ret.y+"px;left:"+ret.x+"px;");
top = ret.y;
left = ret.x;
}
}
})();
init();
var anim = dojo.lfx.propertyAnimation(node,
{ "top": { start: top, end: (coords.top||0) },
"left": { start: left, end: (coords.left||0) }
},
duration,
easing,
{ "beforeBegin": init }
);
 
if(callback){
anim.connect("onEnd", function(){ callback(nodes, anim); });
}
 
anims.push(anim);
});
return dojo.lfx.combine(anims); // dojo.lfx.Combine
}
 
dojo.lfx.html.slideBy = function(/*DOMNode*/ nodes, /*Object*/ coords, /*int?*/ duration, /*Function?*/ easing, /*Function?*/ callback){
// summary: Returns an animation that will slide "nodes" from its current position
// to its current position plus the numbers defined in "coords".
// nodes: An array of DOMNodes or one DOMNode.
// coords: { top: Decimal?, left: Decimal? }
// duration: Duration of the animation in milliseconds.
// easing: An easing function.
// callback: Function to run at the end of the animation.
nodes = dojo.lfx.html._byId(nodes);
var anims = [];
var compute = dojo.html.getComputedStyle;
 
if(dojo.lang.isArray(coords)){
/* coords: Array
pId: a */
dojo.deprecated('dojo.lfx.html.slideBy(node, array)', 'use dojo.lfx.html.slideBy(node, {top: value, left: value});', '0.5');
coords = { top: coords[0], left: coords[1] };
}
 
dojo.lang.forEach(nodes, function(node){
var top = null;
var left = null;
var init = (function(){
var innerNode = node;
return function(){
var pos = compute(innerNode, 'position');
top = (pos == 'absolute' ? node.offsetTop : parseInt(compute(node, 'top')) || 0);
left = (pos == 'absolute' ? node.offsetLeft : parseInt(compute(node, 'left')) || 0);
 
if (!dojo.lang.inArray(['absolute', 'relative'], pos)) {
var ret = dojo.html.abs(innerNode, true);
dojo.html.setStyleAttributes(innerNode, "position:absolute;top:"+ret.y+"px;left:"+ret.x+"px;");
top = ret.y;
left = ret.x;
}
}
})();
init();
var anim = dojo.lfx.propertyAnimation(node,
{
"top": { start: top, end: top+(coords.top||0) },
"left": { start: left, end: left+(coords.left||0) }
},
duration,
easing).connect("beforeBegin", init);
 
if(callback){
anim.connect("onEnd", function(){ callback(nodes, anim); });
}
 
anims.push(anim);
});
 
return dojo.lfx.combine(anims); // dojo.lfx.Combine
}
 
dojo.lfx.html.explode = function(/*DOMNode*/ start,
/*DOMNode*/ endNode,
/*int?*/ duration,
/*Function?*/ easing,
/*Function?*/ callback){
// summary: Returns an animation that will
// start:
// endNode:
// duration: Duration of the animation in milliseconds.
// easing: An easing function.
// callback: Function to run at the end of the animation.
var h = dojo.html;
start = dojo.byId(start);
endNode = dojo.byId(endNode);
var startCoords = h.toCoordinateObject(start, true);
var outline = document.createElement("div");
h.copyStyle(outline, endNode);
if(endNode.explodeClassName){ outline.className = endNode.explodeClassName; }
with(outline.style){
position = "absolute";
display = "none";
// border = "1px solid black";
var backgroundStyle = h.getStyle(start, "background-color");
backgroundColor = backgroundStyle ? backgroundStyle.toLowerCase() : "transparent";
backgroundColor = (backgroundColor == "transparent") ? "rgb(221, 221, 221)" : backgroundColor;
}
dojo.body().appendChild(outline);
 
with(endNode.style){
visibility = "hidden";
display = "block";
}
var endCoords = h.toCoordinateObject(endNode, true);
with(endNode.style){
display = "none";
visibility = "visible";
}
 
var props = { opacity: { start: 0.5, end: 1.0 } };
dojo.lang.forEach(["height", "width", "top", "left"], function(type){
props[type] = { start: startCoords[type], end: endCoords[type] }
});
var anim = new dojo.lfx.propertyAnimation(outline,
props,
duration,
easing,
{
"beforeBegin": function(){
h.setDisplay(outline, "block");
},
"onEnd": function(){
h.setDisplay(endNode, "block");
outline.parentNode.removeChild(outline);
}
}
);
 
if(callback){
anim.connect("onEnd", function(){ callback(endNode, anim); });
}
return anim; // dojo.lfx.Animation
}
 
dojo.lfx.html.implode = function(/*DOMNode*/ startNode,
/*DOMNode*/ end,
/*int?*/ duration,
/*Function?*/ easing,
/*Function?*/ callback){
// summary: Returns an animation that will
// startNode:
// end:
// duration: Duration of the animation in milliseconds.
// easing: An easing function.
// callback: Function to run at the end of the animation.
var h = dojo.html;
startNode = dojo.byId(startNode);
end = dojo.byId(end);
var startCoords = dojo.html.toCoordinateObject(startNode, true);
var endCoords = dojo.html.toCoordinateObject(end, true);
 
var outline = document.createElement("div");
dojo.html.copyStyle(outline, startNode);
if (startNode.explodeClassName) { outline.className = startNode.explodeClassName; }
dojo.html.setOpacity(outline, 0.3);
with(outline.style){
position = "absolute";
display = "none";
backgroundColor = h.getStyle(startNode, "background-color").toLowerCase();
}
dojo.body().appendChild(outline);
 
var props = { opacity: { start: 1.0, end: 0.5 } };
dojo.lang.forEach(["height", "width", "top", "left"], function(type){
props[type] = { start: startCoords[type], end: endCoords[type] }
});
var anim = new dojo.lfx.propertyAnimation(outline,
props,
duration,
easing,
{
"beforeBegin": function(){
dojo.html.hide(startNode);
dojo.html.show(outline);
},
"onEnd": function(){
outline.parentNode.removeChild(outline);
}
}
);
 
if(callback){
anim.connect("onEnd", function(){ callback(startNode, anim); });
}
return anim; // dojo.lfx.Animation
}
 
dojo.lfx.html.highlight = function(/*DOMNode[]*/ nodes,
/*dojo.gfx.color.Color*/ startColor,
/*int?*/ duration,
/*Function?*/ easing,
/*Function?*/ callback){
// summary: Returns an animation that will set the background color
// of "nodes" to startColor and transition it to "nodes"
// original color.
// startColor: Color to transition from.
// duration: Duration of the animation in milliseconds.
// easing: An easing function.
// callback: Function to run at the end of the animation.
nodes = dojo.lfx.html._byId(nodes);
var anims = [];
 
dojo.lang.forEach(nodes, function(node){
var color = dojo.html.getBackgroundColor(node);
var bg = dojo.html.getStyle(node, "background-color").toLowerCase();
var bgImage = dojo.html.getStyle(node, "background-image");
var wasTransparent = (bg == "transparent" || bg == "rgba(0, 0, 0, 0)");
while(color.length > 3) { color.pop(); }
 
var rgb = new dojo.gfx.color.Color(startColor);
var endRgb = new dojo.gfx.color.Color(color);
 
var anim = dojo.lfx.propertyAnimation(node,
{ "background-color": { start: rgb, end: endRgb } },
duration,
easing,
{
"beforeBegin": function(){
if(bgImage){
node.style.backgroundImage = "none";
}
node.style.backgroundColor = "rgb(" + rgb.toRgb().join(",") + ")";
},
"onEnd": function(){
if(bgImage){
node.style.backgroundImage = bgImage;
}
if(wasTransparent){
node.style.backgroundColor = "transparent";
}
if(callback){
callback(node, anim);
}
}
}
);
 
anims.push(anim);
});
return dojo.lfx.combine(anims); // dojo.lfx.Combine
}
 
dojo.lfx.html.unhighlight = function(/*DOMNode[]*/ nodes,
/*dojo.gfx.color.Color*/ endColor,
/*int?*/ duration,
/*Function?*/ easing,
/*Function?*/ callback){
// summary: Returns an animation that will transition "nodes" background color
// from its current color to "endColor".
// endColor: Color to transition to.
// duration: Duration of the animation in milliseconds.
// easing: An easing function.
// callback: Function to run at the end of the animation.
nodes = dojo.lfx.html._byId(nodes);
var anims = [];
 
dojo.lang.forEach(nodes, function(node){
var color = new dojo.gfx.color.Color(dojo.html.getBackgroundColor(node));
var rgb = new dojo.gfx.color.Color(endColor);
 
var bgImage = dojo.html.getStyle(node, "background-image");
var anim = dojo.lfx.propertyAnimation(node,
{ "background-color": { start: color, end: rgb } },
duration,
easing,
{
"beforeBegin": function(){
if(bgImage){
node.style.backgroundImage = "none";
}
node.style.backgroundColor = "rgb(" + color.toRgb().join(",") + ")";
},
"onEnd": function(){
if(callback){
callback(node, anim);
}
}
}
);
anims.push(anim);
});
return dojo.lfx.combine(anims); // dojo.lfx.Combine
}
 
dojo.lang.mixin(dojo.lfx, dojo.lfx.html);
 
dojo.kwCompoundRequire({
browser: ["dojo.lfx.html"],
dashboard: ["dojo.lfx.html"]
});
dojo.provide("dojo.lfx.*");
 
/tags/Racine_livraison_narmer/api/js/dojo/iframe_history.html
New file
0,0 → 1,84
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
<script type="text/javascript">
// <!--
var noInit = false;
var domain = "";
// document.domain = "localhost";
function defineParams(sparams){
if(sparams){
var ss = (sparams.indexOf("&amp;") >= 0) ? "&amp;" : "&";
sparams = sparams.split(ss);
for(var x=0; x<sparams.length; x++){
var tp = sparams[x].split("=");
if(typeof window[tp[0]] != "undefined"){
window[tp[0]] = ((tp[1]=="true")||(tp[1]=="false")) ? eval(tp[1]) : tp[1];
}
}
}
}
function init(){
// parse the query string if there is one to try to get params that
// we can act on. Also allow params to be in a fragment identifier.
var query = null;
var frag = null;
var url = document.location.href;
var hashIndex = url.indexOf("#");
//Extract fragment identifier
if(hashIndex != -1){
frag = url.substring(hashIndex + 1, url.length);
url = url.substring(0, hashIndex);
}
 
//Extract querystring
var parts = url.split("?");
if(parts.length == 2){
query = parts[1];
}
 
defineParams(query);
defineParams(frag);
 
if(noInit){ return; }
if(domain.length > 0){
document.domain = domain;
}
var hasParentDojo = false;
try{
hasParentDojo = window.parent != window && window.parent["dojo"];
}catch(e){
alert("Initializing iframe_history.html failed. If you are using a cross-domain Dojo build,"
+ " please save iframe_history.html to your domain and set djConfig.dojoIframeHistoryUrl"
+ " to the path on your domain to iframe_history.html");
throw e;
}
 
if(hasParentDojo){
//Set the page title so IE history shows up with a somewhat correct name.
document.title = window.parent.document.title;
//Notify parent that we are loaded.
var pdj = window.parent.dojo;
if(pdj["undo"] && pdj["undo"]["browser"]){
pdj.undo.browser.iframeLoaded(null, window.location);
}
}
 
}
// -->
</script>
</head>
<body onload="try{ init(); }catch(e){ alert(e); }">
<h4>The Dojo Toolkit -- iframe_history.html</h4>
 
<p>This file is used in Dojo's back/fwd button management.</p>
</body>
</html>
/tags/Racine_livraison_narmer/api/js/dojo/src/json.js
New file
0,0 → 1,96
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.json");
dojo.require("dojo.lang.func");
dojo.require("dojo.string.extras");
dojo.require("dojo.AdapterRegistry");
dojo.json = {jsonRegistry:new dojo.AdapterRegistry(), register:function (name, check, wrap, override) {
dojo.json.jsonRegistry.register(name, check, wrap, override);
}, evalJson:function (json) {
try {
return eval("(" + json + ")");
}
catch (e) {
dojo.debug(e);
return json;
}
}, serialize:function (o) {
var objtype = typeof (o);
if (objtype == "undefined") {
return "undefined";
} else {
if ((objtype == "number") || (objtype == "boolean")) {
return o + "";
} else {
if (o === null) {
return "null";
}
}
}
if (objtype == "string") {
return dojo.string.escapeString(o);
}
var me = arguments.callee;
var newObj;
if (typeof (o.__json__) == "function") {
newObj = o.__json__();
if (o !== newObj) {
return me(newObj);
}
}
if (typeof (o.json) == "function") {
newObj = o.json();
if (o !== newObj) {
return me(newObj);
}
}
if (objtype != "function" && typeof (o.length) == "number") {
var res = [];
for (var i = 0; i < o.length; i++) {
var val = me(o[i]);
if (typeof (val) != "string") {
val = "undefined";
}
res.push(val);
}
return "[" + res.join(",") + "]";
}
try {
window.o = o;
newObj = dojo.json.jsonRegistry.match(o);
return me(newObj);
}
catch (e) {
}
if (objtype == "function") {
return null;
}
res = [];
for (var k in o) {
var useKey;
if (typeof (k) == "number") {
useKey = "\"" + k + "\"";
} else {
if (typeof (k) == "string") {
useKey = dojo.string.escapeString(k);
} else {
continue;
}
}
val = me(o[k]);
if (typeof (val) != "string") {
continue;
}
res.push(useKey + ":" + val);
}
return "{" + res.join(",") + "}";
}};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/selection/Selection.js
New file
0,0 → 1,314
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.selection.Selection");
dojo.require("dojo.lang.array");
dojo.require("dojo.lang.func");
dojo.require("dojo.lang.common");
dojo.require("dojo.math");
dojo.declare("dojo.selection.Selection", null, {initializer:function (items, isCollection) {
this.items = [];
this.selection = [];
this._pivotItems = [];
this.clearItems();
if (items) {
if (isCollection) {
this.setItemsCollection(items);
} else {
this.setItems(items);
}
}
}, items:null, selection:null, lastSelected:null, allowImplicit:true, length:0, isGrowable:true, _pivotItems:null, _pivotItem:null, onSelect:function (item) {
}, onDeselect:function (item) {
}, onSelectChange:function (item, selected) {
}, _find:function (item, inSelection) {
if (inSelection) {
return dojo.lang.find(this.selection, item);
} else {
return dojo.lang.find(this.items, item);
}
}, isSelectable:function (item) {
return true;
}, setItems:function () {
this.clearItems();
this.addItems.call(this, arguments);
}, setItemsCollection:function (collection) {
this.items = collection;
}, addItems:function () {
var args = dojo.lang.unnest(arguments);
for (var i = 0; i < args.length; i++) {
this.items.push(args[i]);
}
}, addItemsAt:function (item, before) {
if (this.items.length == 0) {
return this.addItems(dojo.lang.toArray(arguments, 2));
}
if (!this.isItem(item)) {
item = this.items[item];
}
if (!item) {
throw new Error("addItemsAt: item doesn't exist");
}
var idx = this._find(item);
if (idx > 0 && before) {
idx--;
}
for (var i = 2; i < arguments.length; i++) {
if (!this.isItem(arguments[i])) {
this.items.splice(idx++, 0, arguments[i]);
}
}
}, removeItem:function (item) {
var idx = this._find(item);
if (idx > -1) {
this.items.splice(idx, 1);
}
idx = this._find(item, true);
if (idx > -1) {
this.selection.splice(idx, 1);
}
}, clearItems:function () {
this.items = [];
this.deselectAll();
}, isItem:function (item) {
return this._find(item) > -1;
}, isSelected:function (item) {
return this._find(item, true) > -1;
}, selectFilter:function (item, selection, add, grow) {
return true;
}, update:function (item, add, grow, noToggle) {
if (!this.isItem(item)) {
return false;
}
if (this.isGrowable && grow) {
if ((!this.isSelected(item)) && this.selectFilter(item, this.selection, false, true)) {
this.grow(item);
this.lastSelected = item;
}
} else {
if (add) {
if (this.selectFilter(item, this.selection, true, false)) {
if (noToggle) {
if (this.select(item)) {
this.lastSelected = item;
}
} else {
if (this.toggleSelected(item)) {
this.lastSelected = item;
}
}
}
} else {
this.deselectAll();
this.select(item);
}
}
this.length = this.selection.length;
return true;
}, grow:function (toItem, fromItem) {
if (!this.isGrowable) {
return;
}
if (arguments.length == 1) {
fromItem = this._pivotItem;
if (!fromItem && this.allowImplicit) {
fromItem = this.items[0];
}
}
if (!toItem || !fromItem) {
return false;
}
var fromIdx = this._find(fromItem);
var toDeselect = {};
var lastIdx = -1;
if (this.lastSelected) {
lastIdx = this._find(this.lastSelected);
var step = fromIdx < lastIdx ? -1 : 1;
var range = dojo.math.range(lastIdx, fromIdx, step);
for (var i = 0; i < range.length; i++) {
toDeselect[range[i]] = true;
}
}
var toIdx = this._find(toItem);
var step = fromIdx < toIdx ? -1 : 1;
var shrink = lastIdx >= 0 && step == 1 ? lastIdx < toIdx : lastIdx > toIdx;
var range = dojo.math.range(toIdx, fromIdx, step);
if (range.length) {
for (var i = range.length - 1; i >= 0; i--) {
var item = this.items[range[i]];
if (this.selectFilter(item, this.selection, false, true)) {
if (this.select(item, true) || shrink) {
this.lastSelected = item;
}
if (range[i] in toDeselect) {
delete toDeselect[range[i]];
}
}
}
} else {
this.lastSelected = fromItem;
}
for (var i in toDeselect) {
if (this.items[i] == this.lastSelected) {
}
this.deselect(this.items[i]);
}
this._updatePivot();
}, growUp:function () {
if (!this.isGrowable) {
return;
}
var idx = this._find(this.lastSelected) - 1;
while (idx >= 0) {
if (this.selectFilter(this.items[idx], this.selection, false, true)) {
this.grow(this.items[idx]);
break;
}
idx--;
}
}, growDown:function () {
if (!this.isGrowable) {
return;
}
var idx = this._find(this.lastSelected);
if (idx < 0 && this.allowImplicit) {
this.select(this.items[0]);
idx = 0;
}
idx++;
while (idx > 0 && idx < this.items.length) {
if (this.selectFilter(this.items[idx], this.selection, false, true)) {
this.grow(this.items[idx]);
break;
}
idx++;
}
}, toggleSelected:function (item, noPivot) {
if (this.isItem(item)) {
if (this.select(item, noPivot)) {
return 1;
}
if (this.deselect(item)) {
return -1;
}
}
return 0;
}, select:function (item, noPivot) {
if (this.isItem(item) && !this.isSelected(item) && this.isSelectable(item)) {
this.selection.push(item);
this.lastSelected = item;
this.onSelect(item);
this.onSelectChange(item, true);
if (!noPivot) {
this._addPivot(item);
}
this.length = this.selection.length;
return true;
}
return false;
}, deselect:function (item) {
var idx = this._find(item, true);
if (idx > -1) {
this.selection.splice(idx, 1);
this.onDeselect(item);
this.onSelectChange(item, false);
if (item == this.lastSelected) {
this.lastSelected = null;
}
this._removePivot(item);
this.length = this.selection.length;
return true;
}
return false;
}, selectAll:function () {
for (var i = 0; i < this.items.length; i++) {
this.select(this.items[i]);
}
}, deselectAll:function () {
while (this.selection && this.selection.length) {
this.deselect(this.selection[0]);
}
}, selectNext:function () {
var idx = this._find(this.lastSelected);
while (idx > -1 && ++idx < this.items.length) {
if (this.isSelectable(this.items[idx])) {
this.deselectAll();
this.select(this.items[idx]);
return true;
}
}
return false;
}, selectPrevious:function () {
var idx = this._find(this.lastSelected);
while (idx-- > 0) {
if (this.isSelectable(this.items[idx])) {
this.deselectAll();
this.select(this.items[idx]);
return true;
}
}
return false;
}, selectFirst:function () {
this.deselectAll();
var idx = 0;
while (this.items[idx] && !this.select(this.items[idx])) {
idx++;
}
return this.items[idx] ? true : false;
}, selectLast:function () {
this.deselectAll();
var idx = this.items.length - 1;
while (this.items[idx] && !this.select(this.items[idx])) {
idx--;
}
return this.items[idx] ? true : false;
}, _addPivot:function (item, andClear) {
this._pivotItem = item;
if (andClear) {
this._pivotItems = [item];
} else {
this._pivotItems.push(item);
}
}, _removePivot:function (item) {
var i = dojo.lang.find(this._pivotItems, item);
if (i > -1) {
this._pivotItems.splice(i, 1);
this._pivotItem = this._pivotItems[this._pivotItems.length - 1];
}
this._updatePivot();
}, _updatePivot:function () {
if (this._pivotItems.length == 0) {
if (this.lastSelected) {
this._addPivot(this.lastSelected);
}
}
}, sorted:function () {
return dojo.lang.toArray(this.selection).sort(dojo.lang.hitch(this, function (a, b) {
var A = this._find(a), B = this._find(b);
if (A > B) {
return 1;
} else {
if (A < B) {
return -1;
} else {
return 0;
}
}
}));
}, updateSelected:function () {
for (var i = 0; i < this.selection.length; i++) {
if (this._find(this.selection[i]) < 0) {
var removed = this.selection.splice(i, 1);
this._removePivot(removed[0]);
}
}
this.length = this.selection.length;
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/math/__package__.js
New file
0,0 → 1,13
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.kwCompoundRequire({common:[["dojo.math", false, false], ["dojo.math.curves", false, false], ["dojo.math.points", false, false]]});
dojo.provide("dojo.math.*");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/math/curves.js
New file
0,0 → 1,182
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.math.curves");
dojo.require("dojo.math");
dojo.math.curves = {Line:function (start, end) {
this.start = start;
this.end = end;
this.dimensions = start.length;
for (var i = 0; i < start.length; i++) {
start[i] = Number(start[i]);
}
for (var i = 0; i < end.length; i++) {
end[i] = Number(end[i]);
}
this.getValue = function (n) {
var retVal = new Array(this.dimensions);
for (var i = 0; i < this.dimensions; i++) {
retVal[i] = ((this.end[i] - this.start[i]) * n) + this.start[i];
}
return retVal;
};
return this;
}, Bezier:function (pnts) {
this.getValue = function (step) {
if (step >= 1) {
return this.p[this.p.length - 1];
}
if (step <= 0) {
return this.p[0];
}
var retVal = new Array(this.p[0].length);
for (var k = 0; j < this.p[0].length; k++) {
retVal[k] = 0;
}
for (var j = 0; j < this.p[0].length; j++) {
var C = 0;
var D = 0;
for (var i = 0; i < this.p.length; i++) {
C += this.p[i][j] * this.p[this.p.length - 1][0] * dojo.math.bernstein(step, this.p.length, i);
}
for (var l = 0; l < this.p.length; l++) {
D += this.p[this.p.length - 1][0] * dojo.math.bernstein(step, this.p.length, l);
}
retVal[j] = C / D;
}
return retVal;
};
this.p = pnts;
return this;
}, CatmullRom:function (pnts, c) {
this.getValue = function (step) {
var percent = step * (this.p.length - 1);
var node = Math.floor(percent);
var progress = percent - node;
var i0 = node - 1;
if (i0 < 0) {
i0 = 0;
}
var i = node;
var i1 = node + 1;
if (i1 >= this.p.length) {
i1 = this.p.length - 1;
}
var i2 = node + 2;
if (i2 >= this.p.length) {
i2 = this.p.length - 1;
}
var u = progress;
var u2 = progress * progress;
var u3 = progress * progress * progress;
var retVal = new Array(this.p[0].length);
for (var k = 0; k < this.p[0].length; k++) {
var x1 = (-this.c * this.p[i0][k]) + ((2 - this.c) * this.p[i][k]) + ((this.c - 2) * this.p[i1][k]) + (this.c * this.p[i2][k]);
var x2 = (2 * this.c * this.p[i0][k]) + ((this.c - 3) * this.p[i][k]) + ((3 - 2 * this.c) * this.p[i1][k]) + (-this.c * this.p[i2][k]);
var x3 = (-this.c * this.p[i0][k]) + (this.c * this.p[i1][k]);
var x4 = this.p[i][k];
retVal[k] = x1 * u3 + x2 * u2 + x3 * u + x4;
}
return retVal;
};
if (!c) {
this.c = 0.7;
} else {
this.c = c;
}
this.p = pnts;
return this;
}, Arc:function (start, end, ccw) {
var center = dojo.math.points.midpoint(start, end);
var sides = dojo.math.points.translate(dojo.math.points.invert(center), start);
var rad = Math.sqrt(Math.pow(sides[0], 2) + Math.pow(sides[1], 2));
var theta = dojo.math.radToDeg(Math.atan(sides[1] / sides[0]));
if (sides[0] < 0) {
theta -= 90;
} else {
theta += 90;
}
dojo.math.curves.CenteredArc.call(this, center, rad, theta, theta + (ccw ? -180 : 180));
}, CenteredArc:function (center, radius, start, end) {
this.center = center;
this.radius = radius;
this.start = start || 0;
this.end = end;
this.getValue = function (n) {
var retVal = new Array(2);
var theta = dojo.math.degToRad(this.start + ((this.end - this.start) * n));
retVal[0] = this.center[0] + this.radius * Math.sin(theta);
retVal[1] = this.center[1] - this.radius * Math.cos(theta);
return retVal;
};
return this;
}, Circle:function (center, radius) {
dojo.math.curves.CenteredArc.call(this, center, radius, 0, 360);
return this;
}, Path:function () {
var curves = [];
var weights = [];
var ranges = [];
var totalWeight = 0;
this.add = function (curve, weight) {
if (weight < 0) {
dojo.raise("dojo.math.curves.Path.add: weight cannot be less than 0");
}
curves.push(curve);
weights.push(weight);
totalWeight += weight;
computeRanges();
};
this.remove = function (curve) {
for (var i = 0; i < curves.length; i++) {
if (curves[i] == curve) {
curves.splice(i, 1);
totalWeight -= weights.splice(i, 1)[0];
break;
}
}
computeRanges();
};
this.removeAll = function () {
curves = [];
weights = [];
totalWeight = 0;
};
this.getValue = function (n) {
var found = false, value = 0;
for (var i = 0; i < ranges.length; i++) {
var r = ranges[i];
if (n >= r[0] && n < r[1]) {
var subN = (n - r[0]) / r[2];
value = curves[i].getValue(subN);
found = true;
break;
}
}
if (!found) {
value = curves[curves.length - 1].getValue(1);
}
for (var j = 0; j < i; j++) {
value = dojo.math.points.translate(value, curves[j].getValue(1));
}
return value;
};
function computeRanges() {
var start = 0;
for (var i = 0; i < weights.length; i++) {
var end = start + weights[i] / totalWeight;
var len = end - start;
ranges[i] = [start, end, len];
start = end;
}
}
return this;
}};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/math/points.js
New file
0,0 → 1,40
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.math.points");
dojo.require("dojo.math");
dojo.math.points = {translate:function (a, b) {
if (a.length != b.length) {
dojo.raise("dojo.math.translate: points not same size (a:[" + a + "], b:[" + b + "])");
}
var c = new Array(a.length);
for (var i = 0; i < a.length; i++) {
c[i] = a[i] + b[i];
}
return c;
}, midpoint:function (a, b) {
if (a.length != b.length) {
dojo.raise("dojo.math.midpoint: points not same size (a:[" + a + "], b:[" + b + "])");
}
var c = new Array(a.length);
for (var i = 0; i < a.length; i++) {
c[i] = (a[i] + b[i]) / 2;
}
return c;
}, invert:function (a) {
var b = new Array(a.length);
for (var i = 0; i < a.length; i++) {
b[i] = -a[i];
}
return b;
}, distance:function (a, b) {
return Math.sqrt(Math.pow(b[0] - a[0], 2) + Math.pow(b[1] - a[1], 2));
}};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/math/matrix.js
New file
0,0 → 1,301
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.math.matrix");
dojo.math.matrix.iDF = 0;
dojo.math.matrix.ALMOST_ZERO = 1e-10;
dojo.math.matrix.multiply = function (a, b) {
var ay = a.length;
var ax = a[0].length;
var by = b.length;
var bx = b[0].length;
if (ax != by) {
dojo.debug("Can't multiply matricies of sizes " + ax + "," + ay + " and " + bx + "," + by);
return [[0]];
}
var c = [];
for (var k = 0; k < ay; k++) {
c[k] = [];
for (var i = 0; i < bx; i++) {
c[k][i] = 0;
for (var m = 0; m < ax; m++) {
c[k][i] += a[k][m] * b[m][i];
}
}
}
return c;
};
dojo.math.matrix.product = function () {
if (arguments.length == 0) {
dojo.debug("can't multiply 0 matrices!");
return 1;
}
var result = arguments[0];
for (var i = 1; i < arguments.length; i++) {
result = dojo.math.matrix.multiply(result, arguments[i]);
}
return result;
};
dojo.math.matrix.sum = function () {
if (arguments.length == 0) {
dojo.debug("can't sum 0 matrices!");
return 0;
}
var result = dojo.math.matrix.copy(arguments[0]);
var rows = result.length;
if (rows == 0) {
dojo.debug("can't deal with matrices of 0 rows!");
return 0;
}
var cols = result[0].length;
if (cols == 0) {
dojo.debug("can't deal with matrices of 0 cols!");
return 0;
}
for (var i = 1; i < arguments.length; ++i) {
var arg = arguments[i];
if (arg.length != rows || arg[0].length != cols) {
dojo.debug("can't add matrices of different dimensions: first dimensions were " + rows + "x" + cols + ", current dimensions are " + arg.length + "x" + arg[0].length);
return 0;
}
for (var r = 0; r < rows; r++) {
for (var c = 0; c < cols; c++) {
result[r][c] += arg[r][c];
}
}
}
return result;
};
dojo.math.matrix.inverse = function (a) {
if (a.length == 1 && a[0].length == 1) {
return [[1 / a[0][0]]];
}
var tms = a.length;
var m = dojo.math.matrix.create(tms, tms);
var mm = dojo.math.matrix.adjoint(a);
var det = dojo.math.matrix.determinant(a);
var dd = 0;
if (det == 0) {
dojo.debug("Determinant Equals 0, Not Invertible.");
return [[0]];
} else {
dd = 1 / det;
}
for (var i = 0; i < tms; i++) {
for (var j = 0; j < tms; j++) {
m[i][j] = dd * mm[i][j];
}
}
return m;
};
dojo.math.matrix.determinant = function (a) {
if (a.length != a[0].length) {
dojo.debug("Can't calculate the determiant of a non-squre matrix!");
return 0;
}
var tms = a.length;
var det = 1;
var b = dojo.math.matrix.upperTriangle(a);
for (var i = 0; i < tms; i++) {
var bii = b[i][i];
if (Math.abs(bii) < dojo.math.matrix.ALMOST_ZERO) {
return 0;
}
det *= bii;
}
det = det * dojo.math.matrix.iDF;
return det;
};
dojo.math.matrix.upperTriangle = function (m) {
m = dojo.math.matrix.copy(m);
var f1 = 0;
var temp = 0;
var tms = m.length;
var v = 1;
dojo.math.matrix.iDF = 1;
for (var col = 0; col < tms - 1; col++) {
if (typeof m[col][col] != "number") {
dojo.debug("non-numeric entry found in a numeric matrix: m[" + col + "][" + col + "]=" + m[col][col]);
}
v = 1;
var stop_loop = 0;
while ((m[col][col] == 0) && !stop_loop) {
if (col + v >= tms) {
dojo.math.matrix.iDF = 0;
stop_loop = 1;
} else {
for (var r = 0; r < tms; r++) {
temp = m[col][r];
m[col][r] = m[col + v][r];
m[col + v][r] = temp;
}
v++;
dojo.math.matrix.iDF *= -1;
}
}
for (var row = col + 1; row < tms; row++) {
if (typeof m[row][col] != "number") {
dojo.debug("non-numeric entry found in a numeric matrix: m[" + row + "][" + col + "]=" + m[row][col]);
}
if (typeof m[col][row] != "number") {
dojo.debug("non-numeric entry found in a numeric matrix: m[" + col + "][" + row + "]=" + m[col][row]);
}
if (m[col][col] != 0) {
var f1 = (-1) * m[row][col] / m[col][col];
for (var i = col; i < tms; i++) {
m[row][i] = f1 * m[col][i] + m[row][i];
}
}
}
}
return m;
};
dojo.math.matrix.create = function (a, b, value) {
if (!value) {
value = 0;
}
var m = [];
for (var i = 0; i < b; i++) {
m[i] = [];
for (var j = 0; j < a; j++) {
m[i][j] = value;
}
}
return m;
};
dojo.math.matrix.ones = function (a, b) {
return dojo.math.matrix.create(a, b, 1);
};
dojo.math.matrix.zeros = function (a, b) {
return dojo.math.matrix.create(a, b, 0);
};
dojo.math.matrix.identity = function (size, scale) {
if (!scale) {
scale = 1;
}
var m = [];
for (var i = 0; i < size; i++) {
m[i] = [];
for (var j = 0; j < size; j++) {
m[i][j] = (i == j ? scale : 0);
}
}
return m;
};
dojo.math.matrix.adjoint = function (a) {
var tms = a.length;
if (tms <= 1) {
dojo.debug("Can't find the adjoint of a matrix with a dimension less than 2");
return [[0]];
}
if (a.length != a[0].length) {
dojo.debug("Can't find the adjoint of a non-square matrix");
return [[0]];
}
var m = dojo.math.matrix.create(tms, tms);
var ii = 0;
var jj = 0;
var ia = 0;
var ja = 0;
var det = 0;
var ap = dojo.math.matrix.create(tms - 1, tms - 1);
for (var i = 0; i < tms; i++) {
for (var j = 0; j < tms; j++) {
ia = 0;
for (ii = 0; ii < tms; ii++) {
if (ii == i) {
continue;
}
ja = 0;
for (jj = 0; jj < tms; jj++) {
if (jj == j) {
continue;
}
ap[ia][ja] = a[ii][jj];
ja++;
}
ia++;
}
det = dojo.math.matrix.determinant(ap);
m[i][j] = Math.pow(-1, (i + j)) * det;
}
}
m = dojo.math.matrix.transpose(m);
return m;
};
dojo.math.matrix.transpose = function (a) {
var m = dojo.math.matrix.create(a.length, a[0].length);
for (var i = 0; i < a.length; i++) {
for (var j = 0; j < a[i].length; j++) {
m[j][i] = a[i][j];
}
}
return m;
};
dojo.math.matrix.format = function (a, decimal_points) {
if (arguments.length <= 1) {
decimal_points = 5;
}
function format_int(x, dp) {
var fac = Math.pow(10, dp);
var a = Math.round(x * fac) / fac;
var b = a.toString();
if (b.charAt(0) != "-") {
b = " " + b;
}
var has_dp = 0;
for (var i = 1; i < b.length; i++) {
if (b.charAt(i) == ".") {
has_dp = 1;
}
}
if (!has_dp) {
b += ".";
}
while (b.length < dp + 3) {
b += "0";
}
return b;
}
var ya = a.length;
var xa = ya > 0 ? a[0].length : 0;
var buffer = "";
for (var y = 0; y < ya; y++) {
buffer += "| ";
for (var x = 0; x < xa; x++) {
buffer += format_int(a[y][x], decimal_points) + " ";
}
buffer += "|\n";
}
return buffer;
};
dojo.math.matrix.copy = function (a) {
var ya = a.length;
var xa = a[0].length;
var m = dojo.math.matrix.create(xa, ya);
for (var y = 0; y < ya; y++) {
for (var x = 0; x < xa; x++) {
m[y][x] = a[y][x];
}
}
return m;
};
dojo.math.matrix.scale = function (k, a) {
a = dojo.math.matrix.copy(a);
var ya = a.length;
var xa = a[0].length;
for (var y = 0; y < ya; y++) {
for (var x = 0; x < xa; x++) {
a[y][x] *= k;
}
}
return a;
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/animation.js
New file
0,0 → 1,14
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.animation");
dojo.require("dojo.animation.Animation");
dojo.deprecated("dojo.animation is slated for removal in 0.5; use dojo.lfx instead.", "0.5");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/Deferred.js
New file
0,0 → 1,163
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.Deferred");
dojo.require("dojo.lang.func");
dojo.Deferred = function (canceller) {
this.chain = [];
this.id = this._nextId();
this.fired = -1;
this.paused = 0;
this.results = [null, null];
this.canceller = canceller;
this.silentlyCancelled = false;
};
dojo.lang.extend(dojo.Deferred, {getFunctionFromArgs:function () {
var a = arguments;
if ((a[0]) && (!a[1])) {
if (dojo.lang.isFunction(a[0])) {
return a[0];
} else {
if (dojo.lang.isString(a[0])) {
return dj_global[a[0]];
}
}
} else {
if ((a[0]) && (a[1])) {
return dojo.lang.hitch(a[0], a[1]);
}
}
return null;
}, makeCalled:function () {
var deferred = new dojo.Deferred();
deferred.callback();
return deferred;
}, repr:function () {
var state;
if (this.fired == -1) {
state = "unfired";
} else {
if (this.fired == 0) {
state = "success";
} else {
state = "error";
}
}
return "Deferred(" + this.id + ", " + state + ")";
}, toString:dojo.lang.forward("repr"), _nextId:(function () {
var n = 1;
return function () {
return n++;
};
})(), cancel:function () {
if (this.fired == -1) {
if (this.canceller) {
this.canceller(this);
} else {
this.silentlyCancelled = true;
}
if (this.fired == -1) {
this.errback(new Error(this.repr()));
}
} else {
if ((this.fired == 0) && (this.results[0] instanceof dojo.Deferred)) {
this.results[0].cancel();
}
}
}, _pause:function () {
this.paused++;
}, _unpause:function () {
this.paused--;
if ((this.paused == 0) && (this.fired >= 0)) {
this._fire();
}
}, _continue:function (res) {
this._resback(res);
this._unpause();
}, _resback:function (res) {
this.fired = ((res instanceof Error) ? 1 : 0);
this.results[this.fired] = res;
this._fire();
}, _check:function () {
if (this.fired != -1) {
if (!this.silentlyCancelled) {
dojo.raise("already called!");
}
this.silentlyCancelled = false;
return;
}
}, callback:function (res) {
this._check();
this._resback(res);
}, errback:function (res) {
this._check();
if (!(res instanceof Error)) {
res = new Error(res);
}
this._resback(res);
}, addBoth:function (cb, cbfn) {
var enclosed = this.getFunctionFromArgs(cb, cbfn);
if (arguments.length > 2) {
enclosed = dojo.lang.curryArguments(null, enclosed, arguments, 2);
}
return this.addCallbacks(enclosed, enclosed);
}, addCallback:function (cb, cbfn) {
var enclosed = this.getFunctionFromArgs(cb, cbfn);
if (arguments.length > 2) {
enclosed = dojo.lang.curryArguments(null, enclosed, arguments, 2);
}
return this.addCallbacks(enclosed, null);
}, addErrback:function (cb, cbfn) {
var enclosed = this.getFunctionFromArgs(cb, cbfn);
if (arguments.length > 2) {
enclosed = dojo.lang.curryArguments(null, enclosed, arguments, 2);
}
return this.addCallbacks(null, enclosed);
return this.addCallbacks(null, cbfn);
}, addCallbacks:function (cb, eb) {
this.chain.push([cb, eb]);
if (this.fired >= 0) {
this._fire();
}
return this;
}, _fire:function () {
var chain = this.chain;
var fired = this.fired;
var res = this.results[fired];
var self = this;
var cb = null;
while (chain.length > 0 && this.paused == 0) {
var pair = chain.shift();
var f = pair[fired];
if (f == null) {
continue;
}
try {
res = f(res);
fired = ((res instanceof Error) ? 1 : 0);
if (res instanceof dojo.Deferred) {
cb = function (res) {
self._continue(res);
};
this._pause();
}
}
catch (err) {
fired = 1;
res = err;
}
}
this.fired = fired;
this.results[fired] = res;
if ((cb) && (this.paused)) {
res.addBoth(cb);
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/lang.js
New file
0,0 → 1,14
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.lang");
dojo.require("dojo.lang.common");
dojo.deprecated("dojo.lang", "replaced by dojo.lang.common", "0.5");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/hostenv_jsc.js
New file
0,0 → 1,78
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
/*
* JScript .NET jsc
*
*/
 
dojo.hostenv.name_ = 'jsc';
 
// Sanity check this is the right hostenv.
// See the Rotor source code jscript/engine/globalobject.cs for what globals
// are available.
if((typeof ScriptEngineMajorVersion != 'function')||(ScriptEngineMajorVersion() < 7)){
dojo.raise("attempt to use JScript .NET host environment with inappropriate ScriptEngine");
}
 
// for more than you wanted to know about why this import is required even if
// we fully qualify all symbols, see
// http://groups.google.com/groups?th=f050c7aeefdcbde2&rnum=12
import System;
 
dojo.hostenv.getText = function(uri){
if(!System.IO.File.Exists(uri)){
// dojo.raise("No such file '" + uri + "'");
return 0;
}
var reader = new System.IO.StreamReader(uri);
var contents : String = reader.ReadToEnd();
return contents;
}
 
dojo.hostenv.loadUri = function(uri){
var contents = this.getText(uri);
if(!contents){
dojo.raise("got no back contents from uri '" + uri + "': " + contents);
}
// TODO: in JScript .NET, eval will not affect the symbol table of the current code?
var value = dj_eval(contents);
dojo.debug("jsc eval of contents returned: ", value);
return 1;
 
// for an example doing runtime code compilation, see:
// http://groups.google.com/groups?selm=eQ1aeciCBHA.1644%40tkmsftngp05&rnum=6
// Microsoft.JScript or System.CodeDom.Compiler ?
// var engine = new Microsoft.JScript.Vsa.VsaEngine()
// what about loading a js file vs. a dll?
// GetObject("script:" . uri);
}
 
/* The System.Environment object is useful:
print ("CommandLine='" + System.Environment.CommandLine + "' " +
"program name='" + System.Environment.GetCommandLineArgs()[0] + "' " +
"CurrentDirectory='" + System.Environment.CurrentDirectory + "' " +
"StackTrace='" + System.Environment.StackTrace + "'");
*/
 
// same as System.Console.WriteLine
// sigh; Rotor treats symbol "print" at parse time without actually putting it
// in the builtin symbol table.
// Note that the print symbol is not available if jsc is run with the "/print-"
// option.
dojo.hostenv.println = function(s){
print(s); // = print
}
 
dojo.hostenv.getLibraryScriptUri = function(){
return System.Environment.GetCommandLineArgs()[0];
}
 
dojo.requireIf((djConfig["isDebug"] || djConfig["debugAtAllCosts"]), "dojo.debug");
/tags/Racine_livraison_narmer/api/js/dojo/src/html/color.js
New file
0,0 → 1,36
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.require("dojo.html.style");
dojo.provide("dojo.html.color");
dojo.require("dojo.gfx.color");
dojo.require("dojo.lang.common");
dojo.html.getBackgroundColor = function (node) {
node = dojo.byId(node);
var color;
do {
color = dojo.html.getStyle(node, "background-color");
if (color.toLowerCase() == "rgba(0, 0, 0, 0)") {
color = "transparent";
}
if (node == document.getElementsByTagName("body")[0]) {
node = null;
break;
}
node = node.parentNode;
} while (node && dojo.lang.inArray(["transparent", ""], color));
if (color == "transparent") {
color = [255, 255, 255, 0];
} else {
color = dojo.gfx.color.extractRGB(color);
}
return color;
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/html/style.js
New file
0,0 → 1,481
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.html.style");
dojo.require("dojo.html.common");
dojo.require("dojo.uri.Uri");
dojo.html.getClass = function (node) {
node = dojo.byId(node);
if (!node) {
return "";
}
var cs = "";
if (node.className) {
cs = node.className;
} else {
if (dojo.html.hasAttribute(node, "class")) {
cs = dojo.html.getAttribute(node, "class");
}
}
return cs.replace(/^\s+|\s+$/g, "");
};
dojo.html.getClasses = function (node) {
var c = dojo.html.getClass(node);
return (c == "") ? [] : c.split(/\s+/g);
};
dojo.html.hasClass = function (node, classname) {
return (new RegExp("(^|\\s+)" + classname + "(\\s+|$)")).test(dojo.html.getClass(node));
};
dojo.html.prependClass = function (node, classStr) {
classStr += " " + dojo.html.getClass(node);
return dojo.html.setClass(node, classStr);
};
dojo.html.addClass = function (node, classStr) {
if (dojo.html.hasClass(node, classStr)) {
return false;
}
classStr = (dojo.html.getClass(node) + " " + classStr).replace(/^\s+|\s+$/g, "");
return dojo.html.setClass(node, classStr);
};
dojo.html.setClass = function (node, classStr) {
node = dojo.byId(node);
var cs = new String(classStr);
try {
if (typeof node.className == "string") {
node.className = cs;
} else {
if (node.setAttribute) {
node.setAttribute("class", classStr);
node.className = cs;
} else {
return false;
}
}
}
catch (e) {
dojo.debug("dojo.html.setClass() failed", e);
}
return true;
};
dojo.html.removeClass = function (node, classStr, allowPartialMatches) {
try {
if (!allowPartialMatches) {
var newcs = dojo.html.getClass(node).replace(new RegExp("(^|\\s+)" + classStr + "(\\s+|$)"), "$1$2");
} else {
var newcs = dojo.html.getClass(node).replace(classStr, "");
}
dojo.html.setClass(node, newcs);
}
catch (e) {
dojo.debug("dojo.html.removeClass() failed", e);
}
return true;
};
dojo.html.replaceClass = function (node, newClass, oldClass) {
dojo.html.removeClass(node, oldClass);
dojo.html.addClass(node, newClass);
};
dojo.html.classMatchType = {ContainsAll:0, ContainsAny:1, IsOnly:2};
dojo.html.getElementsByClass = function (classStr, parent, nodeType, classMatchType, useNonXpath) {
useNonXpath = false;
var _document = dojo.doc();
parent = dojo.byId(parent) || _document;
var classes = classStr.split(/\s+/g);
var nodes = [];
if (classMatchType != 1 && classMatchType != 2) {
classMatchType = 0;
}
var reClass = new RegExp("(\\s|^)((" + classes.join(")|(") + "))(\\s|$)");
var srtLength = classes.join(" ").length;
var candidateNodes = [];
if (!useNonXpath && _document.evaluate) {
var xpath = ".//" + (nodeType || "*") + "[contains(";
if (classMatchType != dojo.html.classMatchType.ContainsAny) {
xpath += "concat(' ',@class,' '), ' " + classes.join(" ') and contains(concat(' ',@class,' '), ' ") + " ')";
if (classMatchType == 2) {
xpath += " and string-length(@class)=" + srtLength + "]";
} else {
xpath += "]";
}
} else {
xpath += "concat(' ',@class,' '), ' " + classes.join(" ') or contains(concat(' ',@class,' '), ' ") + " ')]";
}
var xpathResult = _document.evaluate(xpath, parent, null, XPathResult.ANY_TYPE, null);
var result = xpathResult.iterateNext();
while (result) {
try {
candidateNodes.push(result);
result = xpathResult.iterateNext();
}
catch (e) {
break;
}
}
return candidateNodes;
} else {
if (!nodeType) {
nodeType = "*";
}
candidateNodes = parent.getElementsByTagName(nodeType);
var node, i = 0;
outer:
while (node = candidateNodes[i++]) {
var nodeClasses = dojo.html.getClasses(node);
if (nodeClasses.length == 0) {
continue outer;
}
var matches = 0;
for (var j = 0; j < nodeClasses.length; j++) {
if (reClass.test(nodeClasses[j])) {
if (classMatchType == dojo.html.classMatchType.ContainsAny) {
nodes.push(node);
continue outer;
} else {
matches++;
}
} else {
if (classMatchType == dojo.html.classMatchType.IsOnly) {
continue outer;
}
}
}
if (matches == classes.length) {
if ((classMatchType == dojo.html.classMatchType.IsOnly) && (matches == nodeClasses.length)) {
nodes.push(node);
} else {
if (classMatchType == dojo.html.classMatchType.ContainsAll) {
nodes.push(node);
}
}
}
}
return nodes;
}
};
dojo.html.getElementsByClassName = dojo.html.getElementsByClass;
dojo.html.toCamelCase = function (selector) {
var arr = selector.split("-"), cc = arr[0];
for (var i = 1; i < arr.length; i++) {
cc += arr[i].charAt(0).toUpperCase() + arr[i].substring(1);
}
return cc;
};
dojo.html.toSelectorCase = function (selector) {
return selector.replace(/([A-Z])/g, "-$1").toLowerCase();
};
if (dojo.render.html.ie) {
dojo.html.getComputedStyle = function (node, property, value) {
node = dojo.byId(node);
if (!node || !node.style) {
return value;
}
return node.currentStyle[dojo.html.toCamelCase(property)];
};
dojo.html.getComputedStyles = function (node) {
return node.currentStyle;
};
} else {
dojo.html.getComputedStyle = function (node, property, value) {
node = dojo.byId(node);
if (!node || !node.style) {
return value;
}
var s = document.defaultView.getComputedStyle(node, null);
return (s && s[dojo.html.toCamelCase(property)]) || "";
};
dojo.html.getComputedStyles = function (node) {
return document.defaultView.getComputedStyle(node, null);
};
}
dojo.html.getStyleProperty = function (node, cssSelector) {
node = dojo.byId(node);
return (node && node.style ? node.style[dojo.html.toCamelCase(cssSelector)] : undefined);
};
dojo.html.getStyle = function (node, cssSelector) {
var value = dojo.html.getStyleProperty(node, cssSelector);
return (value ? value : dojo.html.getComputedStyle(node, cssSelector));
};
dojo.html.setStyle = function (node, cssSelector, value) {
node = dojo.byId(node);
if (node && node.style) {
var camelCased = dojo.html.toCamelCase(cssSelector);
node.style[camelCased] = value;
}
};
dojo.html.setStyleText = function (target, text) {
try {
target.style.cssText = text;
}
catch (e) {
target.setAttribute("style", text);
}
};
dojo.html.copyStyle = function (target, source) {
if (!source.style.cssText) {
target.setAttribute("style", source.getAttribute("style"));
} else {
target.style.cssText = source.style.cssText;
}
dojo.html.addClass(target, dojo.html.getClass(source));
};
dojo.html.getUnitValue = function (node, cssSelector, autoIsZero) {
var s = dojo.html.getComputedStyle(node, cssSelector);
if ((!s) || ((s == "auto") && (autoIsZero))) {
return {value:0, units:"px"};
}
var match = s.match(/(\-?[\d.]+)([a-z%]*)/i);
if (!match) {
return dojo.html.getUnitValue.bad;
}
return {value:Number(match[1]), units:match[2].toLowerCase()};
};
dojo.html.getUnitValue.bad = {value:NaN, units:""};
if (dojo.render.html.ie) {
dojo.html.toPixelValue = function (element, styleValue) {
if (!styleValue) {
return 0;
}
if (styleValue.slice(-2) == "px") {
return parseFloat(styleValue);
}
var pixelValue = 0;
with (element) {
var sLeft = style.left;
var rsLeft = runtimeStyle.left;
runtimeStyle.left = currentStyle.left;
try {
style.left = styleValue || 0;
pixelValue = style.pixelLeft;
style.left = sLeft;
runtimeStyle.left = rsLeft;
}
catch (e) {
}
}
return pixelValue;
};
} else {
dojo.html.toPixelValue = function (element, styleValue) {
return (styleValue && (styleValue.slice(-2) == "px") ? parseFloat(styleValue) : 0);
};
}
dojo.html.getPixelValue = function (node, styleProperty, autoIsZero) {
return dojo.html.toPixelValue(node, dojo.html.getComputedStyle(node, styleProperty));
};
dojo.html.setPositivePixelValue = function (node, selector, value) {
if (isNaN(value)) {
return false;
}
node.style[selector] = Math.max(0, value) + "px";
return true;
};
dojo.html.styleSheet = null;
dojo.html.insertCssRule = function (selector, declaration, index) {
if (!dojo.html.styleSheet) {
if (document.createStyleSheet) {
dojo.html.styleSheet = document.createStyleSheet();
} else {
if (document.styleSheets[0]) {
dojo.html.styleSheet = document.styleSheets[0];
} else {
return null;
}
}
}
if (arguments.length < 3) {
if (dojo.html.styleSheet.cssRules) {
index = dojo.html.styleSheet.cssRules.length;
} else {
if (dojo.html.styleSheet.rules) {
index = dojo.html.styleSheet.rules.length;
} else {
return null;
}
}
}
if (dojo.html.styleSheet.insertRule) {
var rule = selector + " { " + declaration + " }";
return dojo.html.styleSheet.insertRule(rule, index);
} else {
if (dojo.html.styleSheet.addRule) {
return dojo.html.styleSheet.addRule(selector, declaration, index);
} else {
return null;
}
}
};
dojo.html.removeCssRule = function (index) {
if (!dojo.html.styleSheet) {
dojo.debug("no stylesheet defined for removing rules");
return false;
}
if (dojo.render.html.ie) {
if (!index) {
index = dojo.html.styleSheet.rules.length;
dojo.html.styleSheet.removeRule(index);
}
} else {
if (document.styleSheets[0]) {
if (!index) {
index = dojo.html.styleSheet.cssRules.length;
}
dojo.html.styleSheet.deleteRule(index);
}
}
return true;
};
dojo.html._insertedCssFiles = [];
dojo.html.insertCssFile = function (URI, doc, checkDuplicates, fail_ok) {
if (!URI) {
return;
}
if (!doc) {
doc = document;
}
var cssStr = dojo.hostenv.getText(URI, false, fail_ok);
if (cssStr === null) {
return;
}
cssStr = dojo.html.fixPathsInCssText(cssStr, URI);
if (checkDuplicates) {
var idx = -1, node, ent = dojo.html._insertedCssFiles;
for (var i = 0; i < ent.length; i++) {
if ((ent[i].doc == doc) && (ent[i].cssText == cssStr)) {
idx = i;
node = ent[i].nodeRef;
break;
}
}
if (node) {
var styles = doc.getElementsByTagName("style");
for (var i = 0; i < styles.length; i++) {
if (styles[i] == node) {
return;
}
}
dojo.html._insertedCssFiles.shift(idx, 1);
}
}
var style = dojo.html.insertCssText(cssStr, doc);
dojo.html._insertedCssFiles.push({"doc":doc, "cssText":cssStr, "nodeRef":style});
if (style && djConfig.isDebug) {
style.setAttribute("dbgHref", URI);
}
return style;
};
dojo.html.insertCssText = function (cssStr, doc, URI) {
if (!cssStr) {
return;
}
if (!doc) {
doc = document;
}
if (URI) {
cssStr = dojo.html.fixPathsInCssText(cssStr, URI);
}
var style = doc.createElement("style");
style.setAttribute("type", "text/css");
var head = doc.getElementsByTagName("head")[0];
if (!head) {
dojo.debug("No head tag in document, aborting styles");
return;
} else {
head.appendChild(style);
}
if (style.styleSheet) {
var setFunc = function () {
try {
style.styleSheet.cssText = cssStr;
}
catch (e) {
dojo.debug(e);
}
};
if (style.styleSheet.disabled) {
setTimeout(setFunc, 10);
} else {
setFunc();
}
} else {
var cssText = doc.createTextNode(cssStr);
style.appendChild(cssText);
}
return style;
};
dojo.html.fixPathsInCssText = function (cssStr, URI) {
if (!cssStr || !URI) {
return;
}
var match, str = "", url = "", urlChrs = "[\\t\\s\\w\\(\\)\\/\\.\\\\'\"-:#=&?~]+";
var regex = new RegExp("url\\(\\s*(" + urlChrs + ")\\s*\\)");
var regexProtocol = /(file|https?|ftps?):\/\//;
regexTrim = new RegExp("^[\\s]*(['\"]?)(" + urlChrs + ")\\1[\\s]*?$");
if (dojo.render.html.ie55 || dojo.render.html.ie60) {
var regexIe = new RegExp("AlphaImageLoader\\((.*)src=['\"](" + urlChrs + ")['\"]");
while (match = regexIe.exec(cssStr)) {
url = match[2].replace(regexTrim, "$2");
if (!regexProtocol.exec(url)) {
url = (new dojo.uri.Uri(URI, url).toString());
}
str += cssStr.substring(0, match.index) + "AlphaImageLoader(" + match[1] + "src='" + url + "'";
cssStr = cssStr.substr(match.index + match[0].length);
}
cssStr = str + cssStr;
str = "";
}
while (match = regex.exec(cssStr)) {
url = match[1].replace(regexTrim, "$2");
if (!regexProtocol.exec(url)) {
url = (new dojo.uri.Uri(URI, url).toString());
}
str += cssStr.substring(0, match.index) + "url(" + url + ")";
cssStr = cssStr.substr(match.index + match[0].length);
}
return str + cssStr;
};
dojo.html.setActiveStyleSheet = function (title) {
var i = 0, a, els = dojo.doc().getElementsByTagName("link");
while (a = els[i++]) {
if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
a.disabled = true;
if (a.getAttribute("title") == title) {
a.disabled = false;
}
}
}
};
dojo.html.getActiveStyleSheet = function () {
var i = 0, a, els = dojo.doc().getElementsByTagName("link");
while (a = els[i++]) {
if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) {
return a.getAttribute("title");
}
}
return null;
};
dojo.html.getPreferredStyleSheet = function () {
var i = 0, a, els = dojo.doc().getElementsByTagName("link");
while (a = els[i++]) {
if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("rel").indexOf("alt") == -1 && a.getAttribute("title")) {
return a.getAttribute("title");
}
}
return null;
};
dojo.html.applyBrowserClass = function (node) {
var drh = dojo.render.html;
var classes = {dj_ie:drh.ie, dj_ie55:drh.ie55, dj_ie6:drh.ie60, dj_ie7:drh.ie70, dj_iequirks:drh.ie && drh.quirks, dj_opera:drh.opera, dj_opera8:drh.opera && (Math.floor(dojo.render.version) == 8), dj_opera9:drh.opera && (Math.floor(dojo.render.version) == 9), dj_khtml:drh.khtml, dj_safari:drh.safari, dj_gecko:drh.mozilla};
for (var p in classes) {
if (classes[p]) {
dojo.html.addClass(node, p);
}
}
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/html/iframe.js
New file
0,0 → 1,82
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.html.iframe");
dojo.require("dojo.html.util");
dojo.html.iframeContentWindow = function (iframe_el) {
var win = dojo.html.getDocumentWindow(dojo.html.iframeContentDocument(iframe_el)) || dojo.html.iframeContentDocument(iframe_el).__parent__ || (iframe_el.name && document.frames[iframe_el.name]) || null;
return win;
};
dojo.html.iframeContentDocument = function (iframe_el) {
var doc = iframe_el.contentDocument || ((iframe_el.contentWindow) && (iframe_el.contentWindow.document)) || ((iframe_el.name) && (document.frames[iframe_el.name]) && (document.frames[iframe_el.name].document)) || null;
return doc;
};
dojo.html.BackgroundIframe = function (node) {
if (dojo.render.html.ie55 || dojo.render.html.ie60) {
var html = "<iframe src='javascript:false'" + " style='position: absolute; left: 0px; top: 0px; width: 100%; height: 100%;" + "z-index: -1; filter:Alpha(Opacity=\"0\");' " + ">";
this.iframe = dojo.doc().createElement(html);
this.iframe.tabIndex = -1;
if (node) {
node.appendChild(this.iframe);
this.domNode = node;
} else {
dojo.body().appendChild(this.iframe);
this.iframe.style.display = "none";
}
}
};
dojo.lang.extend(dojo.html.BackgroundIframe, {iframe:null, onResized:function () {
if (this.iframe && this.domNode && this.domNode.parentNode) {
var outer = dojo.html.getMarginBox(this.domNode);
if (outer.width == 0 || outer.height == 0) {
dojo.lang.setTimeout(this, this.onResized, 100);
return;
}
this.iframe.style.width = outer.width + "px";
this.iframe.style.height = outer.height + "px";
}
}, size:function (node) {
if (!this.iframe) {
return;
}
var coords = dojo.html.toCoordinateObject(node, true, dojo.html.boxSizing.BORDER_BOX);
with (this.iframe.style) {
width = coords.width + "px";
height = coords.height + "px";
left = coords.left + "px";
top = coords.top + "px";
}
}, setZIndex:function (node) {
if (!this.iframe) {
return;
}
if (dojo.dom.isNode(node)) {
this.iframe.style.zIndex = dojo.html.getStyle(node, "z-index") - 1;
} else {
if (!isNaN(node)) {
this.iframe.style.zIndex = node;
}
}
}, show:function () {
if (this.iframe) {
this.iframe.style.display = "block";
}
}, hide:function () {
if (this.iframe) {
this.iframe.style.display = "none";
}
}, remove:function () {
if (this.iframe) {
dojo.html.removeNode(this.iframe, true);
delete this.iframe;
this.iframe = null;
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/html/display.js
New file
0,0 → 1,145
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.html.display");
dojo.require("dojo.html.style");
dojo.html._toggle = function (node, tester, setter) {
node = dojo.byId(node);
setter(node, !tester(node));
return tester(node);
};
dojo.html.show = function (node) {
node = dojo.byId(node);
if (dojo.html.getStyleProperty(node, "display") == "none") {
dojo.html.setStyle(node, "display", (node.dojoDisplayCache || ""));
node.dojoDisplayCache = undefined;
}
};
dojo.html.hide = function (node) {
node = dojo.byId(node);
if (typeof node["dojoDisplayCache"] == "undefined") {
var d = dojo.html.getStyleProperty(node, "display");
if (d != "none") {
node.dojoDisplayCache = d;
}
}
dojo.html.setStyle(node, "display", "none");
};
dojo.html.setShowing = function (node, showing) {
dojo.html[(showing ? "show" : "hide")](node);
};
dojo.html.isShowing = function (node) {
return (dojo.html.getStyleProperty(node, "display") != "none");
};
dojo.html.toggleShowing = function (node) {
return dojo.html._toggle(node, dojo.html.isShowing, dojo.html.setShowing);
};
dojo.html.displayMap = {tr:"", td:"", th:"", img:"inline", span:"inline", input:"inline", button:"inline"};
dojo.html.suggestDisplayByTagName = function (node) {
node = dojo.byId(node);
if (node && node.tagName) {
var tag = node.tagName.toLowerCase();
return (tag in dojo.html.displayMap ? dojo.html.displayMap[tag] : "block");
}
};
dojo.html.setDisplay = function (node, display) {
dojo.html.setStyle(node, "display", ((display instanceof String || typeof display == "string") ? display : (display ? dojo.html.suggestDisplayByTagName(node) : "none")));
};
dojo.html.isDisplayed = function (node) {
return (dojo.html.getComputedStyle(node, "display") != "none");
};
dojo.html.toggleDisplay = function (node) {
return dojo.html._toggle(node, dojo.html.isDisplayed, dojo.html.setDisplay);
};
dojo.html.setVisibility = function (node, visibility) {
dojo.html.setStyle(node, "visibility", ((visibility instanceof String || typeof visibility == "string") ? visibility : (visibility ? "visible" : "hidden")));
};
dojo.html.isVisible = function (node) {
return (dojo.html.getComputedStyle(node, "visibility") != "hidden");
};
dojo.html.toggleVisibility = function (node) {
return dojo.html._toggle(node, dojo.html.isVisible, dojo.html.setVisibility);
};
dojo.html.setOpacity = function (node, opacity, dontFixOpacity) {
node = dojo.byId(node);
var h = dojo.render.html;
if (!dontFixOpacity) {
if (opacity >= 1) {
if (h.ie) {
dojo.html.clearOpacity(node);
return;
} else {
opacity = 0.999999;
}
} else {
if (opacity < 0) {
opacity = 0;
}
}
}
if (h.ie) {
if (node.nodeName.toLowerCase() == "tr") {
var tds = node.getElementsByTagName("td");
for (var x = 0; x < tds.length; x++) {
tds[x].style.filter = "Alpha(Opacity=" + opacity * 100 + ")";
}
}
node.style.filter = "Alpha(Opacity=" + opacity * 100 + ")";
} else {
if (h.moz) {
node.style.opacity = opacity;
node.style.MozOpacity = opacity;
} else {
if (h.safari) {
node.style.opacity = opacity;
node.style.KhtmlOpacity = opacity;
} else {
node.style.opacity = opacity;
}
}
}
};
dojo.html.clearOpacity = function (node) {
node = dojo.byId(node);
var ns = node.style;
var h = dojo.render.html;
if (h.ie) {
try {
if (node.filters && node.filters.alpha) {
ns.filter = "";
}
}
catch (e) {
}
} else {
if (h.moz) {
ns.opacity = 1;
ns.MozOpacity = 1;
} else {
if (h.safari) {
ns.opacity = 1;
ns.KhtmlOpacity = 1;
} else {
ns.opacity = 1;
}
}
}
};
dojo.html.getOpacity = function (node) {
node = dojo.byId(node);
var h = dojo.render.html;
if (h.ie) {
var opac = (node.filters && node.filters.alpha && typeof node.filters.alpha.opacity == "number" ? node.filters.alpha.opacity : 100) / 100;
} else {
var opac = node.style.opacity || node.style.MozOpacity || node.style.KhtmlOpacity || 1;
}
return opac >= 0.999999 ? 1 : Number(opac);
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/html/selection.js
New file
0,0 → 1,337
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.require("dojo.html.common");
dojo.provide("dojo.html.selection");
dojo.require("dojo.dom");
dojo.require("dojo.lang.common");
dojo.html.selectionType = {NONE:0, TEXT:1, CONTROL:2};
dojo.html.clearSelection = function () {
var _window = dojo.global();
var _document = dojo.doc();
try {
if (_window["getSelection"]) {
if (dojo.render.html.safari) {
_window.getSelection().collapse();
} else {
_window.getSelection().removeAllRanges();
}
} else {
if (_document.selection) {
if (_document.selection.empty) {
_document.selection.empty();
} else {
if (_document.selection.clear) {
_document.selection.clear();
}
}
}
}
return true;
}
catch (e) {
dojo.debug(e);
return false;
}
};
dojo.html.disableSelection = function (element) {
element = dojo.byId(element) || dojo.body();
var h = dojo.render.html;
if (h.mozilla) {
element.style.MozUserSelect = "none";
} else {
if (h.safari) {
element.style.KhtmlUserSelect = "none";
} else {
if (h.ie) {
element.unselectable = "on";
} else {
return false;
}
}
}
return true;
};
dojo.html.enableSelection = function (element) {
element = dojo.byId(element) || dojo.body();
var h = dojo.render.html;
if (h.mozilla) {
element.style.MozUserSelect = "";
} else {
if (h.safari) {
element.style.KhtmlUserSelect = "";
} else {
if (h.ie) {
element.unselectable = "off";
} else {
return false;
}
}
}
return true;
};
dojo.html.selectElement = function (element) {
dojo.deprecated("dojo.html.selectElement", "replaced by dojo.html.selection.selectElementChildren", 0.5);
};
dojo.html.selectInputText = function (element) {
var _window = dojo.global();
var _document = dojo.doc();
element = dojo.byId(element);
if (_document["selection"] && dojo.body()["createTextRange"]) {
var range = element.createTextRange();
range.moveStart("character", 0);
range.moveEnd("character", element.value.length);
range.select();
} else {
if (_window["getSelection"]) {
var selection = _window.getSelection();
element.setSelectionRange(0, element.value.length);
}
}
element.focus();
};
dojo.html.isSelectionCollapsed = function () {
dojo.deprecated("dojo.html.isSelectionCollapsed", "replaced by dojo.html.selection.isCollapsed", 0.5);
return dojo.html.selection.isCollapsed();
};
dojo.lang.mixin(dojo.html.selection, {getType:function () {
if (dojo.doc()["selection"]) {
return dojo.html.selectionType[dojo.doc().selection.type.toUpperCase()];
} else {
var stype = dojo.html.selectionType.TEXT;
var oSel;
try {
oSel = dojo.global().getSelection();
}
catch (e) {
}
if (oSel && oSel.rangeCount == 1) {
var oRange = oSel.getRangeAt(0);
if (oRange.startContainer == oRange.endContainer && (oRange.endOffset - oRange.startOffset) == 1 && oRange.startContainer.nodeType != dojo.dom.TEXT_NODE) {
stype = dojo.html.selectionType.CONTROL;
}
}
return stype;
}
}, isCollapsed:function () {
var _window = dojo.global();
var _document = dojo.doc();
if (_document["selection"]) {
return _document.selection.createRange().text == "";
} else {
if (_window["getSelection"]) {
var selection = _window.getSelection();
if (dojo.lang.isString(selection)) {
return selection == "";
} else {
return selection.isCollapsed || selection.toString() == "";
}
}
}
}, getSelectedElement:function () {
if (dojo.html.selection.getType() == dojo.html.selectionType.CONTROL) {
if (dojo.doc()["selection"]) {
var range = dojo.doc().selection.createRange();
if (range && range.item) {
return dojo.doc().selection.createRange().item(0);
}
} else {
var selection = dojo.global().getSelection();
return selection.anchorNode.childNodes[selection.anchorOffset];
}
}
}, getParentElement:function () {
if (dojo.html.selection.getType() == dojo.html.selectionType.CONTROL) {
var p = dojo.html.selection.getSelectedElement();
if (p) {
return p.parentNode;
}
} else {
if (dojo.doc()["selection"]) {
return dojo.doc().selection.createRange().parentElement();
} else {
var selection = dojo.global().getSelection();
if (selection) {
var node = selection.anchorNode;
while (node && node.nodeType != dojo.dom.ELEMENT_NODE) {
node = node.parentNode;
}
return node;
}
}
}
}, getSelectedText:function () {
if (dojo.doc()["selection"]) {
if (dojo.html.selection.getType() == dojo.html.selectionType.CONTROL) {
return null;
}
return dojo.doc().selection.createRange().text;
} else {
var selection = dojo.global().getSelection();
if (selection) {
return selection.toString();
}
}
}, getSelectedHtml:function () {
if (dojo.doc()["selection"]) {
if (dojo.html.selection.getType() == dojo.html.selectionType.CONTROL) {
return null;
}
return dojo.doc().selection.createRange().htmlText;
} else {
var selection = dojo.global().getSelection();
if (selection && selection.rangeCount) {
var frag = selection.getRangeAt(0).cloneContents();
var div = document.createElement("div");
div.appendChild(frag);
return div.innerHTML;
}
return null;
}
}, hasAncestorElement:function (tagName) {
return (dojo.html.selection.getAncestorElement.apply(this, arguments) != null);
}, getAncestorElement:function (tagName) {
var node = dojo.html.selection.getSelectedElement() || dojo.html.selection.getParentElement();
while (node) {
if (dojo.html.selection.isTag(node, arguments).length > 0) {
return node;
}
node = node.parentNode;
}
return null;
}, isTag:function (node, tags) {
if (node && node.tagName) {
for (var i = 0; i < tags.length; i++) {
if (node.tagName.toLowerCase() == String(tags[i]).toLowerCase()) {
return String(tags[i]).toLowerCase();
}
}
}
return "";
}, selectElement:function (element) {
var _window = dojo.global();
var _document = dojo.doc();
element = dojo.byId(element);
if (_document.selection && dojo.body().createTextRange) {
try {
var range = dojo.body().createControlRange();
range.addElement(element);
range.select();
}
catch (e) {
dojo.html.selection.selectElementChildren(element);
}
} else {
if (_window["getSelection"]) {
var selection = _window.getSelection();
if (selection["removeAllRanges"]) {
var range = _document.createRange();
range.selectNode(element);
selection.removeAllRanges();
selection.addRange(range);
}
}
}
}, selectElementChildren:function (element) {
var _window = dojo.global();
var _document = dojo.doc();
element = dojo.byId(element);
if (_document.selection && dojo.body().createTextRange) {
var range = dojo.body().createTextRange();
range.moveToElementText(element);
range.select();
} else {
if (_window["getSelection"]) {
var selection = _window.getSelection();
if (selection["setBaseAndExtent"]) {
selection.setBaseAndExtent(element, 0, element, element.innerText.length - 1);
} else {
if (selection["selectAllChildren"]) {
selection.selectAllChildren(element);
}
}
}
}
}, getBookmark:function () {
var bookmark;
var _document = dojo.doc();
if (_document["selection"]) {
var range = _document.selection.createRange();
bookmark = range.getBookmark();
} else {
var selection;
try {
selection = dojo.global().getSelection();
}
catch (e) {
}
if (selection) {
var range = selection.getRangeAt(0);
bookmark = range.cloneRange();
} else {
dojo.debug("No idea how to store the current selection for this browser!");
}
}
return bookmark;
}, moveToBookmark:function (bookmark) {
var _document = dojo.doc();
if (_document["selection"]) {
var range = _document.selection.createRange();
range.moveToBookmark(bookmark);
range.select();
} else {
var selection;
try {
selection = dojo.global().getSelection();
}
catch (e) {
}
if (selection && selection["removeAllRanges"]) {
selection.removeAllRanges();
selection.addRange(bookmark);
} else {
dojo.debug("No idea how to restore selection for this browser!");
}
}
}, collapse:function (beginning) {
if (dojo.global()["getSelection"]) {
var selection = dojo.global().getSelection();
if (selection.removeAllRanges) {
if (beginning) {
selection.collapseToStart();
} else {
selection.collapseToEnd();
}
} else {
dojo.global().getSelection().collapse(beginning);
}
} else {
if (dojo.doc().selection) {
var range = dojo.doc().selection.createRange();
range.collapse(beginning);
range.select();
}
}
}, remove:function () {
if (dojo.doc().selection) {
var selection = dojo.doc().selection;
if (selection.type.toUpperCase() != "NONE") {
selection.clear();
}
return selection;
} else {
var selection = dojo.global().getSelection();
for (var i = 0; i < selection.rangeCount; i++) {
selection.getRangeAt(i).deleteContents();
}
return selection;
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/html/shadow.js
New file
0,0 → 1,15
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.html.shadow");
dojo.require("dojo.lfx.shadow");
dojo.deprecated("dojo.html.shadow has been moved to dojo.lfx.", "0.5");
dojo.html.shadow = dojo.lfx.shadow;
 
/tags/Racine_livraison_narmer/api/js/dojo/src/html/metrics.js
New file
0,0 → 1,213
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.html.metrics");
dojo.require("dojo.html.layout");
dojo.html.getScrollbar = function () {
var scroll = document.createElement("div");
scroll.style.width = "100px";
scroll.style.height = "100px";
scroll.style.overflow = "scroll";
scroll.style.position = "absolute";
scroll.style.top = "-300px";
scroll.style.left = "0px";
var test = document.createElement("div");
test.style.width = "400px";
test.style.height = "400px";
scroll.appendChild(test);
dojo.body().appendChild(scroll);
var width = scroll.offsetWidth - scroll.clientWidth;
dojo.body().removeChild(scroll);
scroll.removeChild(test);
scroll = test = null;
return {width:width};
};
dojo.html.getFontMeasurements = function () {
var heights = {"1em":0, "1ex":0, "100%":0, "12pt":0, "16px":0, "xx-small":0, "x-small":0, "small":0, "medium":0, "large":0, "x-large":0, "xx-large":0};
if (dojo.render.html.ie) {
document.documentElement.style.fontSize = "100%";
}
var div = document.createElement("div");
div.style.position = "absolute";
div.style.left = "-100px";
div.style.top = "0";
div.style.width = "30px";
div.style.height = "1000em";
div.style.border = "0";
div.style.margin = "0";
div.style.padding = "0";
div.style.outline = "0";
div.style.lineHeight = "1";
div.style.overflow = "hidden";
dojo.body().appendChild(div);
for (var p in heights) {
div.style.fontSize = p;
heights[p] = Math.round(div.offsetHeight * 12 / 16) * 16 / 12 / 1000;
}
dojo.body().removeChild(div);
div = null;
return heights;
};
dojo.html._fontMeasurements = null;
dojo.html.getCachedFontMeasurements = function (recalculate) {
if (recalculate || !dojo.html._fontMeasurements) {
dojo.html._fontMeasurements = dojo.html.getFontMeasurements();
}
return dojo.html._fontMeasurements;
};
dojo.html.measureFragment = function (node, html, boxType) {
var clone = node.cloneNode(true);
clone.innerHTML = html;
node.parentNode.appendChild(clone);
var ret = dojo.html.getElementBox(clone, boxType);
node.parentNode.removeChild(clone);
clone = null;
return ret;
};
dojo.html.getFittedFragment = function (node, html) {
function cl(node) {
var element = document.createElement(node.tagName);
element.id = node.id + "-clone";
element.className = node.className;
for (var j = 0; j < node.attributes.length; j++) {
if (node.attributes[j].specified) {
if (node.attributes[j].nodeName.toLowerCase() != "style" && node.attributes[j].nodeName.toLowerCase() != "edited" && node.attributes[j].nodeName.toLowerCase() != "contenteditable" && node.attributes[j].nodeName.toLowerCase() != "id" && node.attributes[j].nodeName.toLowerCase() != "class") {
element.setAttribute(node.attributes[j].nodeName.toLowerCase(), node.attributes[j].nodeValue);
}
}
}
return element;
}
var height = dojo.html.getFontMeasurements()["16px"];
var n = cl(node);
n.style.width = dojo.html.getBorderBox(node).width + "px";
n.style.height = (height + 4) + "px";
node.parentNode.appendChild(n);
var rem = dojo.html.fitToElement(n, html);
var ret = n.innerHTML;
n.parentNode.removeChild(n);
return ret;
};
dojo.html.fitToElement = function (node, html) {
function cl(node) {
var element = document.createElement(node.tagName);
element.id = node.id + "-clone";
element.className = node.className;
for (var j = 0; j < node.attributes.length; j++) {
if (node.attributes[j].specified) {
if (node.attributes[j].nodeName.toLowerCase() != "style" && node.attributes[j].nodeName.toLowerCase() != "edited" && node.attributes[j].nodeName.toLowerCase() != "contenteditable" && node.attributes[j].nodeName.toLowerCase() != "id" && node.attributes[j].nodeName.toLowerCase() != "class") {
element.setAttribute(node.attributes[j].nodeName.toLowerCase(), node.attributes[j].nodeValue);
}
}
}
return element;
}
var clone = cl(node);
node.parentNode.appendChild(clone);
var t = dojo.html.getBorderBox(node);
clone.style.width = t.width + "px";
var singletons = ["br", "img", "hr", "input", "!--"];
var chop = ["<BR>", "<br>", "<br/>", "<br />", "<p></p>", "<P></P>"];
var openTags = [];
var str = html;
var i = 0;
var limit = str.length;
var add = 0;
var doLoop = true;
clone.innerHTML = str;
while (doLoop) {
add = Math.round((limit - i) / 2);
if (add <= 1) {
doLoop = false;
}
i += add;
clone.innerHTML = str.substr(0, i);
if (clone.offsetHeight > t.height) {
limit = i;
i -= add;
}
}
if (str.substr(0, i) != str) {
var lastSpace = str.substr(0, i).lastIndexOf(" ");
var lastNewLine = str.substr(0, i).lastIndexOf("\n");
var lastGreater = str.substr(0, i).lastIndexOf(">");
var lastLess = str.substr(0, i).lastIndexOf("<");
if (lastLess <= lastGreater && lastNewLine == i - 1) {
i = i;
} else {
if (lastSpace != -1 && lastSpace > lastGreater && lastGreater > lastLess) {
i = lastSpace + 1;
} else {
if (lastLess > lastGreater) {
i = lastLess;
} else {
if (lastGreater != -1) {
i = lastGreater + 1;
}
}
}
}
}
str = str.substr(0, i);
var ret = html.substr(str.length);
var doPush = true;
var tags = str.split("<");
tags.shift();
for (var j = 0; j < tags.length; j++) {
tags[j] = tags[j].split(">")[0];
if (tags[j].charAt(tags[j].length - 1) == "/") {
continue;
}
if (tags[j].charAt(0) != "/") {
for (var k = 0; k < singletons.length; k++) {
if (tags[j].split(" ")[0].toLowerCase() == singletons[k]) {
doPush = false;
}
}
if (doPush) {
openTags.push(tags[j]);
}
doPush = true;
} else {
openTags.pop();
}
}
for (var j = 0; j < chop.length; j++) {
if (ret.charAt(0) == "\n") {
ret = ret.substr(1);
}
while (ret.indexOf(chop[j]) == 0) {
ret = ret.substr(chop[j].length);
}
}
for (var j = openTags.length - 1; j >= 0; j--) {
if (str.lastIndexOf(openTags[j]) == (str.length - openTags[j].length - 1)) {
str = str.substring(0, str.lastIndexOf(openTags[j]));
} else {
str += "</" + openTags[j] + ">";
}
if (ret.length > 0) {
ret = "<" + openTags[j] + ">" + ret;
}
}
for (var j = 0; j < chop.length; j++) {
if (ret.charAt(0) == "\n") {
ret = ret.substr(1);
}
while (ret.indexOf(chop[j]) == 0) {
ret = ret.substr(chop[j].length);
}
}
node.innerHTML = str;
clone.parentNode.removeChild(clone);
clone = null;
return ret;
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/html/__package__.js
New file
0,0 → 1,13
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.kwCompoundRequire({common:["dojo.html.common", "dojo.html.style"]});
dojo.provide("dojo.html.*");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/html/common.js
New file
0,0 → 1,180
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.html.common");
dojo.require("dojo.lang.common");
dojo.require("dojo.dom");
dojo.lang.mixin(dojo.html, dojo.dom);
dojo.html.body = function () {
dojo.deprecated("dojo.html.body() moved to dojo.body()", "0.5");
return dojo.body();
};
dojo.html.getEventTarget = function (evt) {
if (!evt) {
evt = dojo.global().event || {};
}
var t = (evt.srcElement ? evt.srcElement : (evt.target ? evt.target : null));
while ((t) && (t.nodeType != 1)) {
t = t.parentNode;
}
return t;
};
dojo.html.getViewport = function () {
var _window = dojo.global();
var _document = dojo.doc();
var w = 0;
var h = 0;
if (dojo.render.html.mozilla) {
w = _document.documentElement.clientWidth;
h = _window.innerHeight;
} else {
if (!dojo.render.html.opera && _window.innerWidth) {
w = _window.innerWidth;
h = _window.innerHeight;
} else {
if (!dojo.render.html.opera && dojo.exists(_document, "documentElement.clientWidth")) {
var w2 = _document.documentElement.clientWidth;
if (!w || w2 && w2 < w) {
w = w2;
}
h = _document.documentElement.clientHeight;
} else {
if (dojo.body().clientWidth) {
w = dojo.body().clientWidth;
h = dojo.body().clientHeight;
}
}
}
}
return {width:w, height:h};
};
dojo.html.getScroll = function () {
var _window = dojo.global();
var _document = dojo.doc();
var top = _window.pageYOffset || _document.documentElement.scrollTop || dojo.body().scrollTop || 0;
var left = _window.pageXOffset || _document.documentElement.scrollLeft || dojo.body().scrollLeft || 0;
return {top:top, left:left, offset:{x:left, y:top}};
};
dojo.html.getParentByType = function (node, type) {
var _document = dojo.doc();
var parent = dojo.byId(node);
type = type.toLowerCase();
while ((parent) && (parent.nodeName.toLowerCase() != type)) {
if (parent == (_document["body"] || _document["documentElement"])) {
return null;
}
parent = parent.parentNode;
}
return parent;
};
dojo.html.getAttribute = function (node, attr) {
node = dojo.byId(node);
if ((!node) || (!node.getAttribute)) {
return null;
}
var ta = typeof attr == "string" ? attr : new String(attr);
var v = node.getAttribute(ta.toUpperCase());
if ((v) && (typeof v == "string") && (v != "")) {
return v;
}
if (v && v.value) {
return v.value;
}
if ((node.getAttributeNode) && (node.getAttributeNode(ta))) {
return (node.getAttributeNode(ta)).value;
} else {
if (node.getAttribute(ta)) {
return node.getAttribute(ta);
} else {
if (node.getAttribute(ta.toLowerCase())) {
return node.getAttribute(ta.toLowerCase());
}
}
}
return null;
};
dojo.html.hasAttribute = function (node, attr) {
return dojo.html.getAttribute(dojo.byId(node), attr) ? true : false;
};
dojo.html.getCursorPosition = function (e) {
e = e || dojo.global().event;
var cursor = {x:0, y:0};
if (e.pageX || e.pageY) {
cursor.x = e.pageX;
cursor.y = e.pageY;
} else {
var de = dojo.doc().documentElement;
var db = dojo.body();
cursor.x = e.clientX + ((de || db)["scrollLeft"]) - ((de || db)["clientLeft"]);
cursor.y = e.clientY + ((de || db)["scrollTop"]) - ((de || db)["clientTop"]);
}
return cursor;
};
dojo.html.isTag = function (node) {
node = dojo.byId(node);
if (node && node.tagName) {
for (var i = 1; i < arguments.length; i++) {
if (node.tagName.toLowerCase() == String(arguments[i]).toLowerCase()) {
return String(arguments[i]).toLowerCase();
}
}
}
return "";
};
if (dojo.render.html.ie && !dojo.render.html.ie70) {
if (window.location.href.substr(0, 6).toLowerCase() != "https:") {
(function () {
var xscript = dojo.doc().createElement("script");
xscript.src = "javascript:'dojo.html.createExternalElement=function(doc, tag){ return doc.createElement(tag); }'";
dojo.doc().getElementsByTagName("head")[0].appendChild(xscript);
})();
}
} else {
dojo.html.createExternalElement = function (doc, tag) {
return doc.createElement(tag);
};
}
dojo.html._callDeprecated = function (inFunc, replFunc, args, argName, retValue) {
dojo.deprecated("dojo.html." + inFunc, "replaced by dojo.html." + replFunc + "(" + (argName ? "node, {" + argName + ": " + argName + "}" : "") + ")" + (retValue ? "." + retValue : ""), "0.5");
var newArgs = [];
if (argName) {
var argsIn = {};
argsIn[argName] = args[1];
newArgs.push(args[0]);
newArgs.push(argsIn);
} else {
newArgs = args;
}
var ret = dojo.html[replFunc].apply(dojo.html, args);
if (retValue) {
return ret[retValue];
} else {
return ret;
}
};
dojo.html.getViewportWidth = function () {
return dojo.html._callDeprecated("getViewportWidth", "getViewport", arguments, null, "width");
};
dojo.html.getViewportHeight = function () {
return dojo.html._callDeprecated("getViewportHeight", "getViewport", arguments, null, "height");
};
dojo.html.getViewportSize = function () {
return dojo.html._callDeprecated("getViewportSize", "getViewport", arguments);
};
dojo.html.getScrollTop = function () {
return dojo.html._callDeprecated("getScrollTop", "getScroll", arguments, null, "top");
};
dojo.html.getScrollLeft = function () {
return dojo.html._callDeprecated("getScrollLeft", "getScroll", arguments, null, "left");
};
dojo.html.getScrollOffset = function () {
return dojo.html._callDeprecated("getScrollOffset", "getScroll", arguments, null, "offset");
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/html/images/shadowTR.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/html/images/shadowTR.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/html/images/shadowL.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/html/images/shadowL.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/html/images/shadowBL.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/html/images/shadowBL.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/html/images/shadowTL.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/html/images/shadowTL.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/html/images/shadowB.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/html/images/shadowB.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/html/images/shadowR.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/html/images/shadowR.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/html/images/shadowBR.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/html/images/shadowBR.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/html/images/shadowT.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/html/images/shadowT.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/html/layout.js
New file
0,0 → 1,386
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.html.layout");
dojo.require("dojo.html.common");
dojo.require("dojo.html.style");
dojo.require("dojo.html.display");
dojo.html.sumAncestorProperties = function (node, prop) {
node = dojo.byId(node);
if (!node) {
return 0;
}
var retVal = 0;
while (node) {
if (dojo.html.getComputedStyle(node, "position") == "fixed") {
return 0;
}
var val = node[prop];
if (val) {
retVal += val - 0;
if (node == dojo.body()) {
break;
}
}
node = node.parentNode;
}
return retVal;
};
dojo.html.setStyleAttributes = function (node, attributes) {
node = dojo.byId(node);
var splittedAttribs = attributes.replace(/(;)?\s*$/, "").split(";");
for (var i = 0; i < splittedAttribs.length; i++) {
var nameValue = splittedAttribs[i].split(":");
var name = nameValue[0].replace(/\s*$/, "").replace(/^\s*/, "").toLowerCase();
var value = nameValue[1].replace(/\s*$/, "").replace(/^\s*/, "");
switch (name) {
case "opacity":
dojo.html.setOpacity(node, value);
break;
case "content-height":
dojo.html.setContentBox(node, {height:value});
break;
case "content-width":
dojo.html.setContentBox(node, {width:value});
break;
case "outer-height":
dojo.html.setMarginBox(node, {height:value});
break;
case "outer-width":
dojo.html.setMarginBox(node, {width:value});
break;
default:
node.style[dojo.html.toCamelCase(name)] = value;
}
}
};
dojo.html.boxSizing = {MARGIN_BOX:"margin-box", BORDER_BOX:"border-box", PADDING_BOX:"padding-box", CONTENT_BOX:"content-box"};
dojo.html.getAbsolutePosition = dojo.html.abs = function (node, includeScroll, boxType) {
node = dojo.byId(node, node.ownerDocument);
var ret = {x:0, y:0};
var bs = dojo.html.boxSizing;
if (!boxType) {
boxType = bs.CONTENT_BOX;
}
var nativeBoxType = 2;
var targetBoxType;
switch (boxType) {
case bs.MARGIN_BOX:
targetBoxType = 3;
break;
case bs.BORDER_BOX:
targetBoxType = 2;
break;
case bs.PADDING_BOX:
default:
targetBoxType = 1;
break;
case bs.CONTENT_BOX:
targetBoxType = 0;
break;
}
var h = dojo.render.html;
var db = document["body"] || document["documentElement"];
if (h.ie) {
with (node.getBoundingClientRect()) {
ret.x = left - 2;
ret.y = top - 2;
}
} else {
if (document.getBoxObjectFor) {
nativeBoxType = 1;
try {
var bo = document.getBoxObjectFor(node);
ret.x = bo.x - dojo.html.sumAncestorProperties(node, "scrollLeft");
ret.y = bo.y - dojo.html.sumAncestorProperties(node, "scrollTop");
}
catch (e) {
}
} else {
if (node["offsetParent"]) {
var endNode;
if ((h.safari) && (node.style.getPropertyValue("position") == "absolute") && (node.parentNode == db)) {
endNode = db;
} else {
endNode = db.parentNode;
}
if (node.parentNode != db) {
var nd = node;
if (dojo.render.html.opera) {
nd = db;
}
ret.x -= dojo.html.sumAncestorProperties(nd, "scrollLeft");
ret.y -= dojo.html.sumAncestorProperties(nd, "scrollTop");
}
var curnode = node;
do {
var n = curnode["offsetLeft"];
if (!h.opera || n > 0) {
ret.x += isNaN(n) ? 0 : n;
}
var m = curnode["offsetTop"];
ret.y += isNaN(m) ? 0 : m;
curnode = curnode.offsetParent;
} while ((curnode != endNode) && (curnode != null));
} else {
if (node["x"] && node["y"]) {
ret.x += isNaN(node.x) ? 0 : node.x;
ret.y += isNaN(node.y) ? 0 : node.y;
}
}
}
}
if (includeScroll) {
var scroll = dojo.html.getScroll();
ret.y += scroll.top;
ret.x += scroll.left;
}
var extentFuncArray = [dojo.html.getPaddingExtent, dojo.html.getBorderExtent, dojo.html.getMarginExtent];
if (nativeBoxType > targetBoxType) {
for (var i = targetBoxType; i < nativeBoxType; ++i) {
ret.y += extentFuncArray[i](node, "top");
ret.x += extentFuncArray[i](node, "left");
}
} else {
if (nativeBoxType < targetBoxType) {
for (var i = targetBoxType; i > nativeBoxType; --i) {
ret.y -= extentFuncArray[i - 1](node, "top");
ret.x -= extentFuncArray[i - 1](node, "left");
}
}
}
ret.top = ret.y;
ret.left = ret.x;
return ret;
};
dojo.html.isPositionAbsolute = function (node) {
return (dojo.html.getComputedStyle(node, "position") == "absolute");
};
dojo.html._sumPixelValues = function (node, selectors, autoIsZero) {
var total = 0;
for (var x = 0; x < selectors.length; x++) {
total += dojo.html.getPixelValue(node, selectors[x], autoIsZero);
}
return total;
};
dojo.html.getMargin = function (node) {
return {width:dojo.html._sumPixelValues(node, ["margin-left", "margin-right"], (dojo.html.getComputedStyle(node, "position") == "absolute")), height:dojo.html._sumPixelValues(node, ["margin-top", "margin-bottom"], (dojo.html.getComputedStyle(node, "position") == "absolute"))};
};
dojo.html.getBorder = function (node) {
return {width:dojo.html.getBorderExtent(node, "left") + dojo.html.getBorderExtent(node, "right"), height:dojo.html.getBorderExtent(node, "top") + dojo.html.getBorderExtent(node, "bottom")};
};
dojo.html.getBorderExtent = function (node, side) {
return (dojo.html.getStyle(node, "border-" + side + "-style") == "none" ? 0 : dojo.html.getPixelValue(node, "border-" + side + "-width"));
};
dojo.html.getMarginExtent = function (node, side) {
return dojo.html._sumPixelValues(node, ["margin-" + side], dojo.html.isPositionAbsolute(node));
};
dojo.html.getPaddingExtent = function (node, side) {
return dojo.html._sumPixelValues(node, ["padding-" + side], true);
};
dojo.html.getPadding = function (node) {
return {width:dojo.html._sumPixelValues(node, ["padding-left", "padding-right"], true), height:dojo.html._sumPixelValues(node, ["padding-top", "padding-bottom"], true)};
};
dojo.html.getPadBorder = function (node) {
var pad = dojo.html.getPadding(node);
var border = dojo.html.getBorder(node);
return {width:pad.width + border.width, height:pad.height + border.height};
};
dojo.html.getBoxSizing = function (node) {
var h = dojo.render.html;
var bs = dojo.html.boxSizing;
if (((h.ie) || (h.opera)) && node.nodeName.toLowerCase() != "img") {
var cm = document["compatMode"];
if ((cm == "BackCompat") || (cm == "QuirksMode")) {
return bs.BORDER_BOX;
} else {
return bs.CONTENT_BOX;
}
} else {
if (arguments.length == 0) {
node = document.documentElement;
}
var sizing;
if (!h.ie) {
sizing = dojo.html.getStyle(node, "-moz-box-sizing");
if (!sizing) {
sizing = dojo.html.getStyle(node, "box-sizing");
}
}
return (sizing ? sizing : bs.CONTENT_BOX);
}
};
dojo.html.isBorderBox = function (node) {
return (dojo.html.getBoxSizing(node) == dojo.html.boxSizing.BORDER_BOX);
};
dojo.html.getBorderBox = function (node) {
node = dojo.byId(node);
return {width:node.offsetWidth, height:node.offsetHeight};
};
dojo.html.getPaddingBox = function (node) {
var box = dojo.html.getBorderBox(node);
var border = dojo.html.getBorder(node);
return {width:box.width - border.width, height:box.height - border.height};
};
dojo.html.getContentBox = function (node) {
node = dojo.byId(node);
var padborder = dojo.html.getPadBorder(node);
return {width:node.offsetWidth - padborder.width, height:node.offsetHeight - padborder.height};
};
dojo.html.setContentBox = function (node, args) {
node = dojo.byId(node);
var width = 0;
var height = 0;
var isbb = dojo.html.isBorderBox(node);
var padborder = (isbb ? dojo.html.getPadBorder(node) : {width:0, height:0});
var ret = {};
if (typeof args.width != "undefined") {
width = args.width + padborder.width;
ret.width = dojo.html.setPositivePixelValue(node, "width", width);
}
if (typeof args.height != "undefined") {
height = args.height + padborder.height;
ret.height = dojo.html.setPositivePixelValue(node, "height", height);
}
return ret;
};
dojo.html.getMarginBox = function (node) {
var borderbox = dojo.html.getBorderBox(node);
var margin = dojo.html.getMargin(node);
return {width:borderbox.width + margin.width, height:borderbox.height + margin.height};
};
dojo.html.setMarginBox = function (node, args) {
node = dojo.byId(node);
var width = 0;
var height = 0;
var isbb = dojo.html.isBorderBox(node);
var padborder = (!isbb ? dojo.html.getPadBorder(node) : {width:0, height:0});
var margin = dojo.html.getMargin(node);
var ret = {};
if (typeof args.width != "undefined") {
width = args.width - padborder.width;
width -= margin.width;
ret.width = dojo.html.setPositivePixelValue(node, "width", width);
}
if (typeof args.height != "undefined") {
height = args.height - padborder.height;
height -= margin.height;
ret.height = dojo.html.setPositivePixelValue(node, "height", height);
}
return ret;
};
dojo.html.getElementBox = function (node, type) {
var bs = dojo.html.boxSizing;
switch (type) {
case bs.MARGIN_BOX:
return dojo.html.getMarginBox(node);
case bs.BORDER_BOX:
return dojo.html.getBorderBox(node);
case bs.PADDING_BOX:
return dojo.html.getPaddingBox(node);
case bs.CONTENT_BOX:
default:
return dojo.html.getContentBox(node);
}
};
dojo.html.toCoordinateObject = dojo.html.toCoordinateArray = function (coords, includeScroll, boxtype) {
if (coords instanceof Array || typeof coords == "array") {
dojo.deprecated("dojo.html.toCoordinateArray", "use dojo.html.toCoordinateObject({left: , top: , width: , height: }) instead", "0.5");
while (coords.length < 4) {
coords.push(0);
}
while (coords.length > 4) {
coords.pop();
}
var ret = {left:coords[0], top:coords[1], width:coords[2], height:coords[3]};
} else {
if (!coords.nodeType && !(coords instanceof String || typeof coords == "string") && ("width" in coords || "height" in coords || "left" in coords || "x" in coords || "top" in coords || "y" in coords)) {
var ret = {left:coords.left || coords.x || 0, top:coords.top || coords.y || 0, width:coords.width || 0, height:coords.height || 0};
} else {
var node = dojo.byId(coords);
var pos = dojo.html.abs(node, includeScroll, boxtype);
var marginbox = dojo.html.getMarginBox(node);
var ret = {left:pos.left, top:pos.top, width:marginbox.width, height:marginbox.height};
}
}
ret.x = ret.left;
ret.y = ret.top;
return ret;
};
dojo.html.setMarginBoxWidth = dojo.html.setOuterWidth = function (node, width) {
return dojo.html._callDeprecated("setMarginBoxWidth", "setMarginBox", arguments, "width");
};
dojo.html.setMarginBoxHeight = dojo.html.setOuterHeight = function () {
return dojo.html._callDeprecated("setMarginBoxHeight", "setMarginBox", arguments, "height");
};
dojo.html.getMarginBoxWidth = dojo.html.getOuterWidth = function () {
return dojo.html._callDeprecated("getMarginBoxWidth", "getMarginBox", arguments, null, "width");
};
dojo.html.getMarginBoxHeight = dojo.html.getOuterHeight = function () {
return dojo.html._callDeprecated("getMarginBoxHeight", "getMarginBox", arguments, null, "height");
};
dojo.html.getTotalOffset = function (node, type, includeScroll) {
return dojo.html._callDeprecated("getTotalOffset", "getAbsolutePosition", arguments, null, type);
};
dojo.html.getAbsoluteX = function (node, includeScroll) {
return dojo.html._callDeprecated("getAbsoluteX", "getAbsolutePosition", arguments, null, "x");
};
dojo.html.getAbsoluteY = function (node, includeScroll) {
return dojo.html._callDeprecated("getAbsoluteY", "getAbsolutePosition", arguments, null, "y");
};
dojo.html.totalOffsetLeft = function (node, includeScroll) {
return dojo.html._callDeprecated("totalOffsetLeft", "getAbsolutePosition", arguments, null, "left");
};
dojo.html.totalOffsetTop = function (node, includeScroll) {
return dojo.html._callDeprecated("totalOffsetTop", "getAbsolutePosition", arguments, null, "top");
};
dojo.html.getMarginWidth = function (node) {
return dojo.html._callDeprecated("getMarginWidth", "getMargin", arguments, null, "width");
};
dojo.html.getMarginHeight = function (node) {
return dojo.html._callDeprecated("getMarginHeight", "getMargin", arguments, null, "height");
};
dojo.html.getBorderWidth = function (node) {
return dojo.html._callDeprecated("getBorderWidth", "getBorder", arguments, null, "width");
};
dojo.html.getBorderHeight = function (node) {
return dojo.html._callDeprecated("getBorderHeight", "getBorder", arguments, null, "height");
};
dojo.html.getPaddingWidth = function (node) {
return dojo.html._callDeprecated("getPaddingWidth", "getPadding", arguments, null, "width");
};
dojo.html.getPaddingHeight = function (node) {
return dojo.html._callDeprecated("getPaddingHeight", "getPadding", arguments, null, "height");
};
dojo.html.getPadBorderWidth = function (node) {
return dojo.html._callDeprecated("getPadBorderWidth", "getPadBorder", arguments, null, "width");
};
dojo.html.getPadBorderHeight = function (node) {
return dojo.html._callDeprecated("getPadBorderHeight", "getPadBorder", arguments, null, "height");
};
dojo.html.getBorderBoxWidth = dojo.html.getInnerWidth = function () {
return dojo.html._callDeprecated("getBorderBoxWidth", "getBorderBox", arguments, null, "width");
};
dojo.html.getBorderBoxHeight = dojo.html.getInnerHeight = function () {
return dojo.html._callDeprecated("getBorderBoxHeight", "getBorderBox", arguments, null, "height");
};
dojo.html.getContentBoxWidth = dojo.html.getContentWidth = function () {
return dojo.html._callDeprecated("getContentBoxWidth", "getContentBox", arguments, null, "width");
};
dojo.html.getContentBoxHeight = dojo.html.getContentHeight = function () {
return dojo.html._callDeprecated("getContentBoxHeight", "getContentBox", arguments, null, "height");
};
dojo.html.setContentBoxWidth = dojo.html.setContentWidth = function (node, width) {
return dojo.html._callDeprecated("setContentBoxWidth", "setContentBox", arguments, "width");
};
dojo.html.setContentBoxHeight = dojo.html.setContentHeight = function (node, height) {
return dojo.html._callDeprecated("setContentBoxHeight", "setContentBox", arguments, "height");
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/html/util.js
New file
0,0 → 1,354
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.html.util");
dojo.require("dojo.html.layout");
dojo.html.getElementWindow = function (element) {
return dojo.html.getDocumentWindow(element.ownerDocument);
};
dojo.html.getDocumentWindow = function (doc) {
if (dojo.render.html.safari && !doc._parentWindow) {
var fix = function (win) {
win.document._parentWindow = win;
for (var i = 0; i < win.frames.length; i++) {
fix(win.frames[i]);
}
};
fix(window.top);
}
if (dojo.render.html.ie && window !== document.parentWindow && !doc._parentWindow) {
doc.parentWindow.execScript("document._parentWindow = window;", "Javascript");
var win = doc._parentWindow;
doc._parentWindow = null;
return win;
}
return doc._parentWindow || doc.parentWindow || doc.defaultView;
};
dojo.html.gravity = function (node, e) {
node = dojo.byId(node);
var mouse = dojo.html.getCursorPosition(e);
with (dojo.html) {
var absolute = getAbsolutePosition(node, true);
var bb = getBorderBox(node);
var nodecenterx = absolute.x + (bb.width / 2);
var nodecentery = absolute.y + (bb.height / 2);
}
with (dojo.html.gravity) {
return ((mouse.x < nodecenterx ? WEST : EAST) | (mouse.y < nodecentery ? NORTH : SOUTH));
}
};
dojo.html.gravity.NORTH = 1;
dojo.html.gravity.SOUTH = 1 << 1;
dojo.html.gravity.EAST = 1 << 2;
dojo.html.gravity.WEST = 1 << 3;
dojo.html.overElement = function (element, e) {
element = dojo.byId(element);
var mouse = dojo.html.getCursorPosition(e);
var bb = dojo.html.getBorderBox(element);
var absolute = dojo.html.getAbsolutePosition(element, true, dojo.html.boxSizing.BORDER_BOX);
var top = absolute.y;
var bottom = top + bb.height;
var left = absolute.x;
var right = left + bb.width;
return (mouse.x >= left && mouse.x <= right && mouse.y >= top && mouse.y <= bottom);
};
dojo.html.renderedTextContent = function (node) {
node = dojo.byId(node);
var result = "";
if (node == null) {
return result;
}
for (var i = 0; i < node.childNodes.length; i++) {
switch (node.childNodes[i].nodeType) {
case 1:
case 5:
var display = "unknown";
try {
display = dojo.html.getStyle(node.childNodes[i], "display");
}
catch (E) {
}
switch (display) {
case "block":
case "list-item":
case "run-in":
case "table":
case "table-row-group":
case "table-header-group":
case "table-footer-group":
case "table-row":
case "table-column-group":
case "table-column":
case "table-cell":
case "table-caption":
result += "\n";
result += dojo.html.renderedTextContent(node.childNodes[i]);
result += "\n";
break;
case "none":
break;
default:
if (node.childNodes[i].tagName && node.childNodes[i].tagName.toLowerCase() == "br") {
result += "\n";
} else {
result += dojo.html.renderedTextContent(node.childNodes[i]);
}
break;
}
break;
case 3:
case 2:
case 4:
var text = node.childNodes[i].nodeValue;
var textTransform = "unknown";
try {
textTransform = dojo.html.getStyle(node, "text-transform");
}
catch (E) {
}
switch (textTransform) {
case "capitalize":
var words = text.split(" ");
for (var i = 0; i < words.length; i++) {
words[i] = words[i].charAt(0).toUpperCase() + words[i].substring(1);
}
text = words.join(" ");
break;
case "uppercase":
text = text.toUpperCase();
break;
case "lowercase":
text = text.toLowerCase();
break;
default:
break;
}
switch (textTransform) {
case "nowrap":
break;
case "pre-wrap":
break;
case "pre-line":
break;
case "pre":
break;
default:
text = text.replace(/\s+/, " ");
if (/\s$/.test(result)) {
text.replace(/^\s/, "");
}
break;
}
result += text;
break;
default:
break;
}
}
return result;
};
dojo.html.createNodesFromText = function (txt, trim) {
if (trim) {
txt = txt.replace(/^\s+|\s+$/g, "");
}
var tn = dojo.doc().createElement("div");
tn.style.visibility = "hidden";
dojo.body().appendChild(tn);
var tableType = "none";
if ((/^<t[dh][\s\r\n>]/i).test(txt.replace(/^\s+/))) {
txt = "<table><tbody><tr>" + txt + "</tr></tbody></table>";
tableType = "cell";
} else {
if ((/^<tr[\s\r\n>]/i).test(txt.replace(/^\s+/))) {
txt = "<table><tbody>" + txt + "</tbody></table>";
tableType = "row";
} else {
if ((/^<(thead|tbody|tfoot)[\s\r\n>]/i).test(txt.replace(/^\s+/))) {
txt = "<table>" + txt + "</table>";
tableType = "section";
}
}
}
tn.innerHTML = txt;
if (tn["normalize"]) {
tn.normalize();
}
var parent = null;
switch (tableType) {
case "cell":
parent = tn.getElementsByTagName("tr")[0];
break;
case "row":
parent = tn.getElementsByTagName("tbody")[0];
break;
case "section":
parent = tn.getElementsByTagName("table")[0];
break;
default:
parent = tn;
break;
}
var nodes = [];
for (var x = 0; x < parent.childNodes.length; x++) {
nodes.push(parent.childNodes[x].cloneNode(true));
}
tn.style.display = "none";
dojo.html.destroyNode(tn);
return nodes;
};
dojo.html.placeOnScreen = function (node, desiredX, desiredY, padding, hasScroll, corners, tryOnly) {
if (desiredX instanceof Array || typeof desiredX == "array") {
tryOnly = corners;
corners = hasScroll;
hasScroll = padding;
padding = desiredY;
desiredY = desiredX[1];
desiredX = desiredX[0];
}
if (corners instanceof String || typeof corners == "string") {
corners = corners.split(",");
}
if (!isNaN(padding)) {
padding = [Number(padding), Number(padding)];
} else {
if (!(padding instanceof Array || typeof padding == "array")) {
padding = [0, 0];
}
}
var scroll = dojo.html.getScroll().offset;
var view = dojo.html.getViewport();
node = dojo.byId(node);
var oldDisplay = node.style.display;
node.style.display = "";
var bb = dojo.html.getBorderBox(node);
var w = bb.width;
var h = bb.height;
node.style.display = oldDisplay;
if (!(corners instanceof Array || typeof corners == "array")) {
corners = ["TL"];
}
var bestx, besty, bestDistance = Infinity, bestCorner;
for (var cidex = 0; cidex < corners.length; ++cidex) {
var corner = corners[cidex];
var match = true;
var tryX = desiredX - (corner.charAt(1) == "L" ? 0 : w) + padding[0] * (corner.charAt(1) == "L" ? 1 : -1);
var tryY = desiredY - (corner.charAt(0) == "T" ? 0 : h) + padding[1] * (corner.charAt(0) == "T" ? 1 : -1);
if (hasScroll) {
tryX -= scroll.x;
tryY -= scroll.y;
}
if (tryX < 0) {
tryX = 0;
match = false;
}
if (tryY < 0) {
tryY = 0;
match = false;
}
var x = tryX + w;
if (x > view.width) {
x = view.width - w;
match = false;
} else {
x = tryX;
}
x = Math.max(padding[0], x) + scroll.x;
var y = tryY + h;
if (y > view.height) {
y = view.height - h;
match = false;
} else {
y = tryY;
}
y = Math.max(padding[1], y) + scroll.y;
if (match) {
bestx = x;
besty = y;
bestDistance = 0;
bestCorner = corner;
break;
} else {
var dist = Math.pow(x - tryX - scroll.x, 2) + Math.pow(y - tryY - scroll.y, 2);
if (bestDistance > dist) {
bestDistance = dist;
bestx = x;
besty = y;
bestCorner = corner;
}
}
}
if (!tryOnly) {
node.style.left = bestx + "px";
node.style.top = besty + "px";
}
return {left:bestx, top:besty, x:bestx, y:besty, dist:bestDistance, corner:bestCorner};
};
dojo.html.placeOnScreenPoint = function (node, desiredX, desiredY, padding, hasScroll) {
dojo.deprecated("dojo.html.placeOnScreenPoint", "use dojo.html.placeOnScreen() instead", "0.5");
return dojo.html.placeOnScreen(node, desiredX, desiredY, padding, hasScroll, ["TL", "TR", "BL", "BR"]);
};
dojo.html.placeOnScreenAroundElement = function (node, aroundNode, padding, aroundType, aroundCorners, tryOnly) {
var best, bestDistance = Infinity;
aroundNode = dojo.byId(aroundNode);
var oldDisplay = aroundNode.style.display;
aroundNode.style.display = "";
var mb = dojo.html.getElementBox(aroundNode, aroundType);
var aroundNodeW = mb.width;
var aroundNodeH = mb.height;
var aroundNodePos = dojo.html.getAbsolutePosition(aroundNode, true, aroundType);
aroundNode.style.display = oldDisplay;
for (var nodeCorner in aroundCorners) {
var pos, desiredX, desiredY;
var corners = aroundCorners[nodeCorner];
desiredX = aroundNodePos.x + (nodeCorner.charAt(1) == "L" ? 0 : aroundNodeW);
desiredY = aroundNodePos.y + (nodeCorner.charAt(0) == "T" ? 0 : aroundNodeH);
pos = dojo.html.placeOnScreen(node, desiredX, desiredY, padding, true, corners, true);
if (pos.dist == 0) {
best = pos;
break;
} else {
if (bestDistance > pos.dist) {
bestDistance = pos.dist;
best = pos;
}
}
}
if (!tryOnly) {
node.style.left = best.left + "px";
node.style.top = best.top + "px";
}
return best;
};
dojo.html.scrollIntoView = function (node) {
if (!node) {
return;
}
if (dojo.render.html.ie) {
if (dojo.html.getBorderBox(node.parentNode).height <= node.parentNode.scrollHeight) {
node.scrollIntoView(false);
}
} else {
if (dojo.render.html.mozilla) {
node.scrollIntoView(false);
} else {
var parent = node.parentNode;
var parentBottom = parent.scrollTop + dojo.html.getBorderBox(parent).height;
var nodeBottom = node.offsetTop + dojo.html.getMarginBox(node).height;
if (parentBottom < nodeBottom) {
parent.scrollTop += (nodeBottom - parentBottom);
} else {
if (parent.scrollTop > node.offsetTop) {
parent.scrollTop -= (parent.scrollTop - node.offsetTop);
}
}
}
}
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/hostenv_dashboard.js
New file
0,0 → 1,178
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.render.name = dojo.hostenv.name_ = "dashboard";
dojo.hostenv.println = function (message) {
return alert(message);
};
dojo.hostenv.getXmlhttpObject = function (kwArgs) {
if (widget.system && kwArgs) {
if ((kwArgs.contentType && kwArgs.contentType.indexOf("text/") != 0) || (kwArgs.headers && kwArgs.headers["content-type"] && kwArgs.headers["content-type"].indexOf("text/") != 0)) {
var curl = new dojo.hostenv.CurlRequest;
curl._save = true;
return curl;
} else {
if (kwArgs.method && kwArgs.method.toUpperCase() == "HEAD") {
return new dojo.hostenv.CurlRequest;
} else {
if (kwArgs.headers && kwArgs.header.referer) {
return new dojo.hostenv.CurlRequest;
}
}
}
}
return new XMLHttpRequest;
};
dojo.hostenv.CurlRequest = function () {
this.onreadystatechange = null;
this.readyState = 0;
this.responseText = "";
this.responseXML = null;
this.status = 0;
this.statusText = "";
this._method = "";
this._url = "";
this._async = true;
this._referrer = "";
this._headers = [];
this._save = false;
this._responseHeader = "";
this._responseHeaders = {};
this._fileName = "";
this._username = "";
this._password = "";
};
dojo.hostenv.CurlRequest.prototype.open = function (method, url, async, username, password) {
this._method = method;
this._url = url;
if (async) {
this._async = async;
}
if (username) {
this._username = username;
}
if (password) {
this._password = password;
}
};
dojo.hostenv.CurlRequest.prototype.setRequestHeader = function (label, value) {
switch (label) {
case "Referer":
this._referrer = value;
break;
case "content-type":
break;
default:
this._headers.push(label + "=" + value);
break;
}
};
dojo.hostenv.CurlRequest.prototype.getAllResponseHeaders = function () {
return this._responseHeader;
};
dojo.hostenv.CurlRequest.prototype.getResponseHeader = function (headerLabel) {
return this._responseHeaders[headerLabel];
};
dojo.hostenv.CurlRequest.prototype.send = function (content) {
this.readyState = 1;
if (this.onreadystatechange) {
this.onreadystatechange.call(this);
}
var query = {sS:""};
if (this._referrer) {
query.e = this._referrer;
}
if (this._headers.length) {
query.H = this._headers.join("&");
}
if (this._username) {
if (this._password) {
query.u = this._username + ":" + this._password;
} else {
query.u = this._username;
}
}
if (content) {
query.d = this.content;
if (this._method != "POST") {
query.G = "";
}
}
if (this._method == "HEAD") {
query.I = "";
} else {
if (this._save) {
query.I = "";
} else {
query.i = "";
}
}
var system = widget.system(dojo.hostenv.CurlRequest._formatCall(query, this._url), null);
this.readyState = 2;
if (this.onreadystatechange) {
this.onreadystatechange.call(this);
}
if (system.errorString) {
this.responseText = system.errorString;
this.status = 0;
} else {
if (this._save) {
this._responseHeader = system.outputString;
} else {
var split = system.outputString.replace(/\r/g, "").split("\n\n", 2);
this._responseHeader = split[0];
this.responseText = split[1];
}
split = this._responseHeader.split("\n");
this.statusText = split.shift();
this.status = this.statusText.split(" ")[1];
for (var i = 0, header; header = split[i]; i++) {
var header_split = header.split(": ", 2);
this._responseHeaders[header_split[0]] = header_split[1];
}
if (this._save) {
widget.system("/bin/mkdir cache", null);
this._fileName = this._url.split("/").pop().replace(/\W/g, "");
this._fileName += "." + this._responseHeaders["Content-Type"].replace(/[\r\n]/g, "").split("/").pop();
delete query.I;
query.o = "cache/" + this._fileName;
system = widget.system(dojo.hostenv.CurlRequest._formatCall(query, this._url), null);
if (!system.errorString) {
this.responseText = "cache/" + this._fileName;
}
} else {
if (this._method == "HEAD") {
this.responseText = this._responseHeader;
}
}
}
this.readyState = 4;
if (this.onreadystatechange) {
this.onreadystatechange.call(this);
}
};
dojo.hostenv.CurlRequest._formatCall = function (query, url) {
var call = ["/usr/bin/curl"];
for (var key in query) {
if (query[key] != "") {
call.push("-" + key + " '" + query[key].replace(/'/g, "'") + "'");
} else {
call.push("-" + key);
}
}
call.push("'" + url.replace(/'/g, "'") + "'");
return call.join(" ");
};
dojo.hostenv.exit = function () {
if (widget.system) {
widget.system("/bin/rm -rf cache/*", null);
}
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/data/YahooStore.js
New file
0,0 → 1,42
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.data.YahooStore");
dojo.require("dojo.data.core.RemoteStore");
dojo.require("dojo.lang.declare");
dojo.require("dojo.io.ScriptSrcIO");
dojo.declare("dojo.data.YahooStore", dojo.data.core.RemoteStore, {_setupQueryRequest:function (result, requestKw) {
var start = 1;
var count = 1;
if (result) {
start = result.start || start;
count = result.count || count;
}
var sourceUrl = "http://api.search.yahoo.com/WebSearchService/V1/webSearch?appid=dojo&language=en&query=" + result.query + "&start=" + start + "&results=" + count + "&output=json";
requestKw.url = sourceUrl;
requestKw.transport = "ScriptSrcTransport";
requestKw.mimetype = "text/json";
requestKw.jsonParamName = "callback";
}, _resultToQueryMetadata:function (json) {
return json.ResultSet;
}, _resultToQueryData:function (json) {
var data = {};
for (var i = 0; i < json.ResultSet.totalResultsReturned; ++i) {
var record = json.ResultSet.Result[i];
var item = {};
item["Url"] = [record.Url];
item["Title"] = [record.Title];
item["Summary"] = [record.Summary];
var arrayIndex = (json.ResultSet.firstResultPosition - 1) + i;
data[arrayIndex.toString()] = item;
}
return data;
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/data/core/Write.js
New file
0,0 → 1,42
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.data.core.Write");
dojo.require("dojo.data.core.Read");
dojo.require("dojo.lang.declare");
dojo.require("dojo.experimental");
dojo.experimental("dojo.data.core.Write");
dojo.declare("dojo.data.core.Write", dojo.data.core.Read, {newItem:function (keywordArgs) {
var newItem;
dojo.unimplemented("dojo.data.core.Write.newItem");
return newItem;
}, deleteItem:function (item) {
dojo.unimplemented("dojo.data.core.Write.deleteItem");
return false;
}, set:function (item, attribute, value) {
dojo.unimplemented("dojo.data.core.Write.set");
return false;
}, setValues:function (item, attribute, values) {
dojo.unimplemented("dojo.data.core.Write.setValues");
return false;
}, unsetAttribute:function (item, attribute) {
dojo.unimplemented("dojo.data.core.Write.clear");
return false;
}, save:function () {
dojo.unimplemented("dojo.data.core.Write.save");
return false;
}, revert:function () {
dojo.unimplemented("dojo.data.core.Write.revert");
return false;
}, isDirty:function (item) {
dojo.unimplemented("dojo.data.core.Write.isDirty");
return false;
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/data/core/Read.js
New file
0,0 → 1,53
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.data.core.Read");
dojo.require("dojo.data.core.Result");
dojo.require("dojo.lang.declare");
dojo.require("dojo.experimental");
dojo.experimental("dojo.data.core.Read");
dojo.declare("dojo.data.core.Read", null, {get:function (item, attribute, defaultValue) {
dojo.unimplemented("dojo.data.core.Read.get");
var attributeValue = null;
return attributeValue;
}, getValues:function (item, attribute) {
dojo.unimplemented("dojo.data.core.Read.getValues");
var array = null;
return array;
}, getAttributes:function (item) {
dojo.unimplemented("dojo.data.core.Read.getAttributes");
var array = null;
return array;
}, hasAttribute:function (item, attribute) {
dojo.unimplemented("dojo.data.core.Read.hasAttribute");
return false;
}, containsValue:function (item, attribute, value) {
dojo.unimplemented("dojo.data.core.Read.containsValue");
return false;
}, isItem:function (something) {
dojo.unimplemented("dojo.data.core.Read.isItem");
return false;
}, isItemAvailable:function (something) {
dojo.unimplemented("dojo.data.core.Read.isItemAvailable");
return false;
}, find:function (keywordArgs) {
dojo.unimplemented("dojo.data.core.Read.find");
var result = null;
return result;
}, getIdentity:function (item) {
dojo.unimplemented("dojo.data.core.Read.getIdentity");
var itemIdentifyString = null;
return itemIdentifyString;
}, findByIdentity:function (identity) {
dojo.unimplemented("dojo.data.core.Read.getByIdentity");
var item = null;
return item;
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/data/core/Result.js
New file
0,0 → 1,34
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.data.core.Result");
dojo.require("dojo.lang.declare");
dojo.require("dojo.experimental");
dojo.experimental("dojo.data.core.Result");
dojo.declare("dojo.data.core.Result", null, {initializer:function (keywordArgs, store) {
this.fromKwArgs(keywordArgs || {});
this.items = null;
this.resultMetadata = null;
this.length = -1;
this.store = store;
this._aborted = false;
this._abortFunc = null;
}, sync:true, abort:function () {
this._aborted = true;
if (this._abortFunc) {
this._abortFunc();
}
}, fromKwArgs:function (kwArgs) {
if (typeof kwArgs.saveResult == "undefined") {
this.saveResult = kwArgs.onnext ? false : true;
}
dojo.lang.mixin(this, kwArgs);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/data/core/RemoteStore.js
New file
0,0 → 1,352
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.data.core.RemoteStore");
dojo.require("dojo.data.core.Read");
dojo.require("dojo.data.core.Write");
dojo.require("dojo.data.core.Result");
dojo.require("dojo.experimental");
dojo.require("dojo.Deferred");
dojo.require("dojo.lang.declare");
dojo.require("dojo.json");
dojo.require("dojo.io.*");
dojo.experimental("dojo.data.core.RemoteStore");
dojo.lang.declare("dojo.data.core.RemoteStore", [dojo.data.core.Read, dojo.data.core.Write], {_datatypeMap:{}, _jsonRegistry:dojo.json.jsonRegistry, initializer:function (kwArgs) {
if (!kwArgs) {
kwArgs = {};
}
this._serverQueryUrl = kwArgs.queryUrl || "";
this._serverSaveUrl = kwArgs.saveUrl || "";
this._deleted = {};
this._changed = {};
this._added = {};
this._results = {};
this._data = {};
this._numItems = 0;
}, _setupQueryRequest:function (result, requestKw) {
result.query = result.query || "";
requestKw.url = this._serverQueryUrl + encodeURIComponent(result.query);
requestKw.method = "get";
requestKw.mimetype = "text/json";
}, _resultToQueryMetadata:function (serverResponseData) {
return serverResponseData;
}, _resultToQueryData:function (serverResponseData) {
return serverResponseData.data;
}, _remoteToLocalValues:function (attributes) {
for (var key in attributes) {
var values = attributes[key];
for (var i = 0; i < values.length; i++) {
var value = values[i];
var type = value.datatype || value.type;
if (type) {
var localValue = value.value;
if (this._datatypeMap[type]) {
localValue = this._datatypeMap[type](value);
}
values[i] = localValue;
}
}
}
return attributes;
}, _queryToQueryKey:function (query) {
if (typeof query == "string") {
return query;
} else {
return dojo.json.serialize(query);
}
}, _assertIsItem:function (item) {
if (!this.isItem(item)) {
throw new Error("dojo.data.RemoteStore: a function was passed an item argument that was not an item");
}
}, get:function (item, attribute, defaultValue) {
var valueArray = this.getValues(item, attribute);
if (valueArray.length == 0) {
return defaultValue;
}
return valueArray[0];
}, getValues:function (item, attribute) {
var itemIdentity = this.getIdentity(item);
this._assertIsItem(itemIdentity);
var changes = this._changed[itemIdentity];
if (changes) {
var newvalues = changes[attribute];
if (newvalues !== undefined) {
return newvalues;
} else {
return [];
}
}
return this._data[itemIdentity][0][attribute];
}, getAttributes:function (item) {
var itemIdentity = this.getIdentity(item);
if (!itemIdentity) {
return undefined;
}
var atts = [];
var attrDict = this._data[itemIdentity][0];
for (var att in attrDict) {
atts.push(att);
}
return atts;
}, hasAttribute:function (item, attribute) {
var valueArray = this.getValues(item, attribute);
return valueArray.length ? true : false;
}, containsValue:function (item, attribute, value) {
var valueArray = this.getValues(item, attribute);
for (var i = 0; i < valueArray.length; i++) {
if (valueArray[i] == value) {
return true;
}
}
return false;
}, isItem:function (something) {
if (!something) {
return false;
}
var itemIdentity = something;
if (this._deleted[itemIdentity]) {
return false;
}
if (this._data[itemIdentity]) {
return true;
}
if (this._added[itemIdentity]) {
return true;
}
return false;
}, find:function (keywordArgs) {
var result = null;
if (keywordArgs instanceof dojo.data.core.Result) {
result = keywordArgs;
result.store = this;
} else {
result = new dojo.data.core.Result(keywordArgs, this);
}
var query = result.query;
var self = this;
var bindfunc = function (type, data, evt) {
var scope = result.scope || dj_global;
if (type == "load") {
result.resultMetadata = self._resultToQueryMetadata(data);
var dataDict = self._resultToQueryData(data);
if (result.onbegin) {
result.onbegin.call(scope, result);
}
var count = 0;
var resultData = [];
var newItemCount = 0;
for (var key in dataDict) {
if (result._aborted) {
break;
}
if (!self._deleted[key]) {
var values = dataDict[key];
var attributeDict = self._remoteToLocalValues(values);
var existingValue = self._data[key];
var refCount = 1;
if (existingValue) {
refCount = ++existingValue[1];
} else {
newItemCount++;
}
self._data[key] = [attributeDict, refCount];
resultData.push(key);
count++;
if (result.onnext) {
result.onnext.call(scope, key, result);
}
}
}
self._results[self._queryToQueryKey(query)] = resultData;
self._numItems += newItemCount;
result.length = count;
if (result.saveResult) {
result.items = resultData;
}
if (!result._aborted && result.oncompleted) {
result.oncompleted.call(scope, result);
}
} else {
if (type == "error" || type == "timeout") {
dojo.debug("find error: " + dojo.json.serialize(data));
if (result.onerror) {
result.onerror.call(scope, data);
}
}
}
};
var bindKw = keywordArgs.bindArgs || {};
bindKw.sync = result.sync;
bindKw.handle = bindfunc;
this._setupQueryRequest(result, bindKw);
var request = dojo.io.bind(bindKw);
result._abortFunc = request.abort;
return result;
}, getIdentity:function (item) {
if (!this.isItem(item)) {
return null;
}
return (item.id ? item.id : item);
}, newItem:function (attributes, keywordArgs) {
var itemIdentity = keywordArgs["identity"];
if (this._deleted[itemIdentity]) {
delete this._deleted[itemIdentity];
} else {
this._added[itemIdentity] = 1;
}
if (attributes) {
for (var attribute in attributes) {
var valueOrArrayOfValues = attributes[attribute];
if (dojo.lang.isArray(valueOrArrayOfValues)) {
this.setValues(itemIdentity, attribute, valueOrArrayOfValues);
} else {
this.set(itemIdentity, attribute, valueOrArrayOfValues);
}
}
}
return {id:itemIdentity};
}, deleteItem:function (item) {
var identity = this.getIdentity(item);
if (!identity) {
return false;
}
if (this._added[identity]) {
delete this._added[identity];
} else {
this._deleted[identity] = 1;
}
if (this._changed[identity]) {
delete this._changed[identity];
}
return true;
}, setValues:function (item, attribute, values) {
var identity = this.getIdentity(item);
if (!identity) {
return undefined;
}
var changes = this._changed[identity];
if (!changes) {
changes = {};
this._changed[identity] = changes;
}
changes[attribute] = values;
return true;
}, set:function (item, attribute, value) {
return this.setValues(item, attribute, [value]);
}, unsetAttribute:function (item, attribute) {
return this.setValues(item, attribute, []);
}, _initChanges:function () {
this._deleted = {};
this._changed = {};
this._added = {};
}, _setupSaveRequest:function (saveKeywordArgs, requestKw) {
requestKw.url = this._serverSaveUrl;
requestKw.method = "post";
requestKw.mimetype = "text/plain";
var deleted = [];
for (var key in this._deleted) {
deleted.push(key);
}
var saveStruct = {"changed":this._changed, "deleted":deleted};
var oldRegistry = dojo.json.jsonRegistry;
dojo.json.jsonRegistry = this._jsonRegistry;
var jsonString = dojo.json.serialize(saveStruct);
dojo.json.jsonRegistry = oldRegistry;
requestKw.postContent = jsonString;
}, save:function (keywordArgs) {
keywordArgs = keywordArgs || {};
var result = new dojo.Deferred();
var self = this;
var bindfunc = function (type, data, evt) {
if (type == "load") {
if (result.fired == 1) {
return;
}
var key = null;
for (key in self._added) {
if (!self._data[key]) {
self._data[key] = [{}, 1];
}
}
for (key in self._changed) {
var existing = self._data[key];
var changes = self._changed[key];
if (existing) {
existing[0] = changes;
} else {
self._data[key] = [changes, 1];
}
}
for (key in self._deleted) {
if (self._data[key]) {
delete self._data[key];
}
}
self._initChanges();
result.callback(true);
} else {
if (type == "error" || type == "timeout") {
result.errback(data);
}
}
};
var bindKw = {sync:keywordArgs["sync"], handle:bindfunc};
this._setupSaveRequest(keywordArgs, bindKw);
var request = dojo.io.bind(bindKw);
result.canceller = function (deferred) {
request.abort();
};
return result;
}, revert:function () {
this._initChanges();
return true;
}, isDirty:function (item) {
if (item) {
var identity = item.id || item;
return this._deleted[identity] || this._changed[identity];
} else {
var key = null;
for (key in this._changed) {
return true;
}
for (key in this._deleted) {
return true;
}
for (key in this._added) {
return true;
}
return false;
}
}, createReference:function (idstring) {
return {id:idstring};
}, getSize:function () {
return this._numItems;
}, forgetResults:function (query) {
var queryKey = this._queryToQueryKey(query);
var results = this._results[queryKey];
if (!results) {
return false;
}
var removed = 0;
for (var i = 0; i < results.length; i++) {
var key = results[i];
var existingValue = this._data[key];
if (existingValue[1] <= 1) {
delete this._data[key];
removed++;
} else {
existingValue[1] = --existingValue[1];
}
}
delete this._results[queryKey];
this._numItems -= removed;
return true;
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/data/old/Attribute.js
New file
0,0 → 1,33
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.data.old.Attribute");
dojo.require("dojo.data.old.Item");
dojo.require("dojo.lang.assert");
dojo.data.old.Attribute = function (dataProvider, attributeId) {
dojo.lang.assertType(dataProvider, dojo.data.old.provider.Base, {optional:true});
dojo.lang.assertType(attributeId, String);
dojo.data.old.Item.call(this, dataProvider);
this._attributeId = attributeId;
};
dojo.inherits(dojo.data.old.Attribute, dojo.data.old.Item);
dojo.data.old.Attribute.prototype.toString = function () {
return this._attributeId;
};
dojo.data.old.Attribute.prototype.getAttributeId = function () {
return this._attributeId;
};
dojo.data.old.Attribute.prototype.getType = function () {
return this.get("type");
};
dojo.data.old.Attribute.prototype.setType = function (type) {
this.set("type", type);
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/data/old/Observable.js
New file
0,0 → 1,38
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.data.old.Observable");
dojo.require("dojo.lang.common");
dojo.require("dojo.lang.assert");
dojo.data.old.Observable = function () {
};
dojo.data.old.Observable.prototype.addObserver = function (observer) {
dojo.lang.assertType(observer, Object);
dojo.lang.assertType(observer.observedObjectHasChanged, Function);
if (!this._arrayOfObservers) {
this._arrayOfObservers = [];
}
if (!dojo.lang.inArray(this._arrayOfObservers, observer)) {
this._arrayOfObservers.push(observer);
}
};
dojo.data.old.Observable.prototype.removeObserver = function (observer) {
if (!this._arrayOfObservers) {
return;
}
var index = dojo.lang.indexOf(this._arrayOfObservers, observer);
if (index != -1) {
this._arrayOfObservers.splice(index, 1);
}
};
dojo.data.old.Observable.prototype.getObservers = function () {
return this._arrayOfObservers;
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/data/old/Kind.js
New file
0,0 → 1,17
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.data.old.Kind");
dojo.require("dojo.data.old.Item");
dojo.data.old.Kind = function (dataProvider) {
dojo.data.old.Item.call(this, dataProvider);
};
dojo.inherits(dojo.data.old.Kind, dojo.data.old.Item);
 
/tags/Racine_livraison_narmer/api/js/dojo/src/data/old/__package__.js
New file
0,0 → 1,15
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.require("dojo.experimental");
dojo.experimental("dojo.data.old.*");
dojo.kwCompoundRequire({common:["dojo.data.old.Item", "dojo.data.old.ResultSet", "dojo.data.old.provider.FlatFile"]});
dojo.provide("dojo.data.old.*");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/data/old/to_do.txt
New file
0,0 → 1,45
Existing Features
* can import data from .json or .csv format files
* can import data from del.icio.us
* can create and modify data programmatically
* can bind data to dojo.widget.Chart
* can bind data to dojo.widget.SortableTable
* can bind one data set to multiple widgets
* notifications: widgets are notified when data changes
* notification available per-item or per-resultSet
* can create ad-hoc attributes
* attributes can be loosely-typed
* attributes can have meta-data like type and display name
* half-implemented support for sorting
* half-implemented support for export to .json
* API for getting data in simple arrays
* API for getting ResultSets with iterators (precursor to support for something like the openrico.org live grid)
~~~~~~~~~~~~~~~~~~~~~~~~
To-Do List
* be able to import data from an html <table></table>
* think about being able to import data from some type of XML
* think about integration with dojo.undo.Manager
* think more about how to represent the notion of different data types
* think about what problems we'll run into when we have a MySQL data provider
* in TableBindingHack, improve support for data types in the SortableTable binding
* deal with ids (including MySQL multi-field keys)
* add support for item-references: employeeItem.set('department', departmentItem);
* deal with Attributes as instances of Items, not just subclasses of Items
* unit tests for compare/sort code
* unit tests for everything
* implement item.toString('json') and item.toString('xml')
* implement dataProvider.newItem({name: 'foo', age: 26})
* deal better with transactions
* add support for deleting items
* don't send out multiple notifications to the same observer
* deal with item versions
* prototype a Yahoo data provider -- http://developer.yahoo.net/common/json.html
* prototype a data provider that enforces strong typing
* prototype a data provider that prevents ad-hoc attributes
* prototype a data provider that enforces single-kind item
* prototype a data provider that allows for login/authentication
* have loosely typed result sets play nicely with widgets that expect strong typing
* prototype an example of spreadsheet-style formulas or derivation rules
* experiment with some sort of fetch() that returns only a subset of a data provider's items
 
/tags/Racine_livraison_narmer/api/js/dojo/src/data/old/ResultSet.js
New file
0,0 → 1,50
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.data.old.ResultSet");
dojo.require("dojo.lang.assert");
dojo.require("dojo.collections.Collections");
dojo.data.old.ResultSet = function (dataProvider, arrayOfItems) {
dojo.lang.assertType(dataProvider, dojo.data.old.provider.Base, {optional:true});
dojo.lang.assertType(arrayOfItems, Array, {optional:true});
dojo.data.old.Observable.call(this);
this._dataProvider = dataProvider;
this._arrayOfItems = [];
if (arrayOfItems) {
this._arrayOfItems = arrayOfItems;
}
};
dojo.inherits(dojo.data.old.ResultSet, dojo.data.old.Observable);
dojo.data.old.ResultSet.prototype.toString = function () {
var returnString = this._arrayOfItems.join(", ");
return returnString;
};
dojo.data.old.ResultSet.prototype.toArray = function () {
return this._arrayOfItems;
};
dojo.data.old.ResultSet.prototype.getIterator = function () {
return new dojo.collections.Iterator(this._arrayOfItems);
};
dojo.data.old.ResultSet.prototype.getLength = function () {
return this._arrayOfItems.length;
};
dojo.data.old.ResultSet.prototype.getItemAt = function (index) {
return this._arrayOfItems[index];
};
dojo.data.old.ResultSet.prototype.indexOf = function (item) {
return dojo.lang.indexOf(this._arrayOfItems, item);
};
dojo.data.old.ResultSet.prototype.contains = function (item) {
return dojo.lang.inArray(this._arrayOfItems, item);
};
dojo.data.old.ResultSet.prototype.getDataProvider = function () {
return this._dataProvider;
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/data/old/Value.js
New file
0,0 → 1,33
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.data.old.Value");
dojo.require("dojo.lang.assert");
dojo.data.old.Value = function (value) {
this._value = value;
this._type = null;
};
dojo.data.old.Value.prototype.toString = function () {
return this._value.toString();
};
dojo.data.old.Value.prototype.getValue = function () {
return this._value;
};
dojo.data.old.Value.prototype.getType = function () {
dojo.unimplemented("dojo.data.old.Value.prototype.getType");
return this._type;
};
dojo.data.old.Value.prototype.compare = function () {
dojo.unimplemented("dojo.data.old.Value.prototype.compare");
};
dojo.data.old.Value.prototype.isEqual = function () {
dojo.unimplemented("dojo.data.old.Value.prototype.isEqual");
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/data/old/format/Json.js
New file
0,0 → 1,69
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.data.old.format.Json");
dojo.require("dojo.lang.assert");
dojo.data.old.format.Json = new function () {
this.loadDataProviderFromFileContents = function (dataProvider, jsonFileContents) {
dojo.lang.assertType(dataProvider, dojo.data.old.provider.Base);
dojo.lang.assertType(jsonFileContents, String);
var arrayOfJsonData = eval("(" + jsonFileContents + ")");
this.loadDataProviderFromArrayOfJsonData(dataProvider, arrayOfJsonData);
};
this.loadDataProviderFromArrayOfJsonData = function (dataProvider, arrayOfJsonData) {
dojo.lang.assertType(arrayOfJsonData, Array, {optional:true});
if (arrayOfJsonData && (arrayOfJsonData.length > 0)) {
var firstRow = arrayOfJsonData[0];
dojo.lang.assertType(firstRow, [Array, "pureobject"]);
if (dojo.lang.isArray(firstRow)) {
_loadDataProviderFromArrayOfArrays(dataProvider, arrayOfJsonData);
} else {
dojo.lang.assertType(firstRow, "pureobject");
_loadDataProviderFromArrayOfObjects(dataProvider, arrayOfJsonData);
}
}
};
this.getJsonStringFromResultSet = function (resultSet) {
dojo.unimplemented("dojo.data.old.format.Json.getJsonStringFromResultSet");
var jsonString = null;
return jsonString;
};
function _loadDataProviderFromArrayOfArrays(dataProvider, arrayOfJsonData) {
var arrayOfKeys = arrayOfJsonData[0];
for (var i = 1; i < arrayOfJsonData.length; ++i) {
var row = arrayOfJsonData[i];
var item = dataProvider.getNewItemToLoad();
for (var j in row) {
var value = row[j];
var key = arrayOfKeys[j];
item.load(key, value);
}
}
}
function _loadDataProviderFromArrayOfObjects(dataProvider, arrayOfJsonData) {
for (var i in arrayOfJsonData) {
var row = arrayOfJsonData[i];
var item = dataProvider.getNewItemToLoad();
for (var key in row) {
var value = row[key];
if (dojo.lang.isArray(value)) {
var arrayOfValues = value;
for (var j in arrayOfValues) {
value = arrayOfValues[j];
item.load(key, value);
}
} else {
item.load(key, value);
}
}
}
}
}();
 
/tags/Racine_livraison_narmer/api/js/dojo/src/data/old/format/Csv.js
New file
0,0 → 1,79
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.data.old.format.Csv");
dojo.require("dojo.lang.assert");
dojo.data.old.format.Csv = new function () {
this.getArrayStructureFromCsvFileContents = function (csvFileContents) {
dojo.lang.assertType(csvFileContents, String);
var lineEndingCharacters = new RegExp("\r\n|\n|\r");
var leadingWhiteSpaceCharacters = new RegExp("^\\s+", "g");
var trailingWhiteSpaceCharacters = new RegExp("\\s+$", "g");
var doubleQuotes = new RegExp("\"\"", "g");
var arrayOfOutputRecords = [];
var arrayOfInputLines = csvFileContents.split(lineEndingCharacters);
for (var i in arrayOfInputLines) {
var singleLine = arrayOfInputLines[i];
if (singleLine.length > 0) {
var listOfFields = singleLine.split(",");
var j = 0;
while (j < listOfFields.length) {
var space_field_space = listOfFields[j];
var field_space = space_field_space.replace(leadingWhiteSpaceCharacters, "");
var field = field_space.replace(trailingWhiteSpaceCharacters, "");
var firstChar = field.charAt(0);
var lastChar = field.charAt(field.length - 1);
var secondToLastChar = field.charAt(field.length - 2);
var thirdToLastChar = field.charAt(field.length - 3);
if ((firstChar == "\"") && ((lastChar != "\"") || ((lastChar == "\"") && (secondToLastChar == "\"") && (thirdToLastChar != "\"")))) {
if (j + 1 === listOfFields.length) {
return null;
}
var nextField = listOfFields[j + 1];
listOfFields[j] = field_space + "," + nextField;
listOfFields.splice(j + 1, 1);
} else {
if ((firstChar == "\"") && (lastChar == "\"")) {
field = field.slice(1, (field.length - 1));
field = field.replace(doubleQuotes, "\"");
}
listOfFields[j] = field;
j += 1;
}
}
arrayOfOutputRecords.push(listOfFields);
}
}
return arrayOfOutputRecords;
};
this.loadDataProviderFromFileContents = function (dataProvider, csvFileContents) {
dojo.lang.assertType(dataProvider, dojo.data.old.provider.Base);
dojo.lang.assertType(csvFileContents, String);
var arrayOfArrays = this.getArrayStructureFromCsvFileContents(csvFileContents);
if (arrayOfArrays) {
var arrayOfKeys = arrayOfArrays[0];
for (var i = 1; i < arrayOfArrays.length; ++i) {
var row = arrayOfArrays[i];
var item = dataProvider.getNewItemToLoad();
for (var j in row) {
var value = row[j];
var key = arrayOfKeys[j];
item.load(key, value);
}
}
}
};
this.getCsvStringFromResultSet = function (resultSet) {
dojo.unimplemented("dojo.data.old.format.Csv.getCsvStringFromResultSet");
var csvString = null;
return csvString;
};
}();
 
/tags/Racine_livraison_narmer/api/js/dojo/src/data/old/Item.js
New file
0,0 → 1,221
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.data.old.Item");
dojo.require("dojo.data.old.Observable");
dojo.require("dojo.data.old.Value");
dojo.require("dojo.lang.common");
dojo.require("dojo.lang.assert");
dojo.data.old.Item = function (dataProvider) {
dojo.lang.assertType(dataProvider, dojo.data.old.provider.Base, {optional:true});
dojo.data.old.Observable.call(this);
this._dataProvider = dataProvider;
this._dictionaryOfAttributeValues = {};
};
dojo.inherits(dojo.data.old.Item, dojo.data.old.Observable);
dojo.data.old.Item.compare = function (itemOne, itemTwo) {
dojo.lang.assertType(itemOne, dojo.data.old.Item);
if (!dojo.lang.isOfType(itemTwo, dojo.data.old.Item)) {
return -1;
}
var nameOne = itemOne.getName();
var nameTwo = itemTwo.getName();
if (nameOne == nameTwo) {
var attributeArrayOne = itemOne.getAttributes();
var attributeArrayTwo = itemTwo.getAttributes();
if (attributeArrayOne.length != attributeArrayTwo.length) {
if (attributeArrayOne.length > attributeArrayTwo.length) {
return 1;
} else {
return -1;
}
}
for (var i in attributeArrayOne) {
var attribute = attributeArrayOne[i];
var arrayOfValuesOne = itemOne.getValues(attribute);
var arrayOfValuesTwo = itemTwo.getValues(attribute);
dojo.lang.assert(arrayOfValuesOne && (arrayOfValuesOne.length > 0));
if (!arrayOfValuesTwo) {
return 1;
}
if (arrayOfValuesOne.length != arrayOfValuesTwo.length) {
if (arrayOfValuesOne.length > arrayOfValuesTwo.length) {
return 1;
} else {
return -1;
}
}
for (var j in arrayOfValuesOne) {
var value = arrayOfValuesOne[j];
if (!itemTwo.hasAttributeValue(value)) {
return 1;
}
}
return 0;
}
} else {
if (nameOne > nameTwo) {
return 1;
} else {
return -1;
}
}
};
dojo.data.old.Item.prototype.toString = function () {
var arrayOfStrings = [];
var attributes = this.getAttributes();
for (var i in attributes) {
var attribute = attributes[i];
var arrayOfValues = this.getValues(attribute);
var valueString;
if (arrayOfValues.length == 1) {
valueString = arrayOfValues[0];
} else {
valueString = "[";
valueString += arrayOfValues.join(", ");
valueString += "]";
}
arrayOfStrings.push(" " + attribute + ": " + valueString);
}
var returnString = "{ ";
returnString += arrayOfStrings.join(",\n");
returnString += " }";
return returnString;
};
dojo.data.old.Item.prototype.compare = function (otherItem) {
return dojo.data.old.Item.compare(this, otherItem);
};
dojo.data.old.Item.prototype.isEqual = function (otherItem) {
return (this.compare(otherItem) == 0);
};
dojo.data.old.Item.prototype.getName = function () {
return this.get("name");
};
dojo.data.old.Item.prototype.get = function (attributeId) {
var literalOrValueOrArray = this._dictionaryOfAttributeValues[attributeId];
if (dojo.lang.isUndefined(literalOrValueOrArray)) {
return null;
}
if (literalOrValueOrArray instanceof dojo.data.old.Value) {
return literalOrValueOrArray.getValue();
}
if (dojo.lang.isArray(literalOrValueOrArray)) {
var dojoDataValue = literalOrValueOrArray[0];
return dojoDataValue.getValue();
}
return literalOrValueOrArray;
};
dojo.data.old.Item.prototype.getValue = function (attributeId) {
var literalOrValueOrArray = this._dictionaryOfAttributeValues[attributeId];
if (dojo.lang.isUndefined(literalOrValueOrArray)) {
return null;
}
if (literalOrValueOrArray instanceof dojo.data.old.Value) {
return literalOrValueOrArray;
}
if (dojo.lang.isArray(literalOrValueOrArray)) {
var dojoDataValue = literalOrValueOrArray[0];
return dojoDataValue;
}
var literal = literalOrValueOrArray;
dojoDataValue = new dojo.data.old.Value(literal);
this._dictionaryOfAttributeValues[attributeId] = dojoDataValue;
return dojoDataValue;
};
dojo.data.old.Item.prototype.getValues = function (attributeId) {
var literalOrValueOrArray = this._dictionaryOfAttributeValues[attributeId];
if (dojo.lang.isUndefined(literalOrValueOrArray)) {
return null;
}
if (literalOrValueOrArray instanceof dojo.data.old.Value) {
var array = [literalOrValueOrArray];
this._dictionaryOfAttributeValues[attributeId] = array;
return array;
}
if (dojo.lang.isArray(literalOrValueOrArray)) {
return literalOrValueOrArray;
}
var literal = literalOrValueOrArray;
var dojoDataValue = new dojo.data.old.Value(literal);
array = [dojoDataValue];
this._dictionaryOfAttributeValues[attributeId] = array;
return array;
};
dojo.data.old.Item.prototype.load = function (attributeId, value) {
this._dataProvider.registerAttribute(attributeId);
var literalOrValueOrArray = this._dictionaryOfAttributeValues[attributeId];
if (dojo.lang.isUndefined(literalOrValueOrArray)) {
this._dictionaryOfAttributeValues[attributeId] = value;
return;
}
if (!(value instanceof dojo.data.old.Value)) {
value = new dojo.data.old.Value(value);
}
if (literalOrValueOrArray instanceof dojo.data.old.Value) {
var array = [literalOrValueOrArray, value];
this._dictionaryOfAttributeValues[attributeId] = array;
return;
}
if (dojo.lang.isArray(literalOrValueOrArray)) {
literalOrValueOrArray.push(value);
return;
}
var literal = literalOrValueOrArray;
var dojoDataValue = new dojo.data.old.Value(literal);
array = [dojoDataValue, value];
this._dictionaryOfAttributeValues[attributeId] = array;
};
dojo.data.old.Item.prototype.set = function (attributeId, value) {
this._dataProvider.registerAttribute(attributeId);
this._dictionaryOfAttributeValues[attributeId] = value;
this._dataProvider.noteChange(this, attributeId, value);
};
dojo.data.old.Item.prototype.setValue = function (attributeId, value) {
this.set(attributeId, value);
};
dojo.data.old.Item.prototype.addValue = function (attributeId, value) {
this.load(attributeId, value);
this._dataProvider.noteChange(this, attributeId, value);
};
dojo.data.old.Item.prototype.setValues = function (attributeId, arrayOfValues) {
dojo.lang.assertType(arrayOfValues, Array);
this._dataProvider.registerAttribute(attributeId);
var finalArray = [];
this._dictionaryOfAttributeValues[attributeId] = finalArray;
for (var i in arrayOfValues) {
var value = arrayOfValues[i];
if (!(value instanceof dojo.data.old.Value)) {
value = new dojo.data.old.Value(value);
}
finalArray.push(value);
this._dataProvider.noteChange(this, attributeId, value);
}
};
dojo.data.old.Item.prototype.getAttributes = function () {
var arrayOfAttributes = [];
for (var key in this._dictionaryOfAttributeValues) {
arrayOfAttributes.push(this._dataProvider.getAttribute(key));
}
return arrayOfAttributes;
};
dojo.data.old.Item.prototype.hasAttribute = function (attributeId) {
return (attributeId in this._dictionaryOfAttributeValues);
};
dojo.data.old.Item.prototype.hasAttributeValue = function (attributeId, value) {
var arrayOfValues = this.getValues(attributeId);
for (var i in arrayOfValues) {
var candidateValue = arrayOfValues[i];
if (candidateValue.isEqual(value)) {
return true;
}
}
return false;
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/data/old/provider/Delicious.js
New file
0,0 → 1,31
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.data.old.provider.Delicious");
dojo.require("dojo.data.old.provider.FlatFile");
dojo.require("dojo.data.old.format.Json");
dojo.data.old.provider.Delicious = function () {
dojo.data.old.provider.FlatFile.call(this);
if (Delicious && Delicious.posts) {
dojo.data.old.format.Json.loadDataProviderFromArrayOfJsonData(this, Delicious.posts);
} else {
}
var u = this.registerAttribute("u");
var d = this.registerAttribute("d");
var t = this.registerAttribute("t");
u.load("name", "Bookmark");
d.load("name", "Description");
t.load("name", "Tags");
u.load("type", "String");
d.load("type", "String");
t.load("type", "String");
};
dojo.inherits(dojo.data.old.provider.Delicious, dojo.data.old.provider.FlatFile);
 
/tags/Racine_livraison_narmer/api/js/dojo/src/data/old/provider/JotSpot.js
New file
0,0 → 1,17
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.data.old.provider.JotSpot");
dojo.require("dojo.data.old.provider.Base");
dojo.data.old.provider.JotSpot = function () {
dojo.unimplemented("dojo.data.old.provider.JotSpot");
};
dojo.inherits(dojo.data.old.provider.JotSpot, dojo.data.old.provider.Base);
 
/tags/Racine_livraison_narmer/api/js/dojo/src/data/old/provider/MySql.js
New file
0,0 → 1,17
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.data.old.provider.MySql");
dojo.require("dojo.data.old.provider.Base");
dojo.data.old.provider.MySql = function () {
dojo.unimplemented("dojo.data.old.provider.MySql");
};
dojo.inherits(dojo.data.old.provider.MySql, dojo.data.old.provider.Base);
 
/tags/Racine_livraison_narmer/api/js/dojo/src/data/old/provider/FlatFile.js
New file
0,0 → 1,111
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.data.old.provider.FlatFile");
dojo.require("dojo.data.old.provider.Base");
dojo.require("dojo.data.old.Item");
dojo.require("dojo.data.old.Attribute");
dojo.require("dojo.data.old.ResultSet");
dojo.require("dojo.data.old.format.Json");
dojo.require("dojo.data.old.format.Csv");
dojo.require("dojo.lang.assert");
dojo.data.old.provider.FlatFile = function (keywordParameters) {
dojo.lang.assertType(keywordParameters, "pureobject", {optional:true});
dojo.data.old.provider.Base.call(this);
this._arrayOfItems = [];
this._resultSet = null;
this._dictionaryOfAttributes = {};
if (keywordParameters) {
var jsonObjects = keywordParameters["jsonObjects"];
var jsonString = keywordParameters["jsonString"];
var fileUrl = keywordParameters["url"];
if (jsonObjects) {
dojo.data.old.format.Json.loadDataProviderFromArrayOfJsonData(this, jsonObjects);
}
if (jsonString) {
dojo.data.old.format.Json.loadDataProviderFromFileContents(this, jsonString);
}
if (fileUrl) {
var arrayOfParts = fileUrl.split(".");
var lastPart = arrayOfParts[(arrayOfParts.length - 1)];
var formatParser = null;
if (lastPart == "json") {
formatParser = dojo.data.old.format.Json;
}
if (lastPart == "csv") {
formatParser = dojo.data.old.format.Csv;
}
if (formatParser) {
var fileContents = dojo.hostenv.getText(fileUrl);
formatParser.loadDataProviderFromFileContents(this, fileContents);
} else {
dojo.lang.assert(false, "new dojo.data.old.provider.FlatFile({url: }) was passed a file without a .csv or .json suffix");
}
}
}
};
dojo.inherits(dojo.data.old.provider.FlatFile, dojo.data.old.provider.Base);
dojo.data.old.provider.FlatFile.prototype.getProviderCapabilities = function (keyword) {
dojo.lang.assertType(keyword, String, {optional:true});
if (!this._ourCapabilities) {
this._ourCapabilities = {transactions:false, undo:false, login:false, versioning:false, anonymousRead:true, anonymousWrite:false, permissions:false, queries:false, strongTyping:false, datatypes:[String, Date, Number]};
}
if (keyword) {
return this._ourCapabilities[keyword];
} else {
return this._ourCapabilities;
}
};
dojo.data.old.provider.FlatFile.prototype.registerAttribute = function (attributeId) {
var registeredAttribute = this.getAttribute(attributeId);
if (!registeredAttribute) {
var newAttribute = new dojo.data.old.Attribute(this, attributeId);
this._dictionaryOfAttributes[attributeId] = newAttribute;
registeredAttribute = newAttribute;
}
return registeredAttribute;
};
dojo.data.old.provider.FlatFile.prototype.getAttribute = function (attributeId) {
var attribute = (this._dictionaryOfAttributes[attributeId] || null);
return attribute;
};
dojo.data.old.provider.FlatFile.prototype.getAttributes = function () {
var arrayOfAttributes = [];
for (var key in this._dictionaryOfAttributes) {
var attribute = this._dictionaryOfAttributes[key];
arrayOfAttributes.push(attribute);
}
return arrayOfAttributes;
};
dojo.data.old.provider.FlatFile.prototype.fetchArray = function (query) {
return this._arrayOfItems;
};
dojo.data.old.provider.FlatFile.prototype.fetchResultSet = function (query) {
if (!this._resultSet) {
this._resultSet = new dojo.data.old.ResultSet(this, this.fetchArray(query));
}
return this._resultSet;
};
dojo.data.old.provider.FlatFile.prototype._newItem = function () {
var item = new dojo.data.old.Item(this);
this._arrayOfItems.push(item);
return item;
};
dojo.data.old.provider.FlatFile.prototype._newAttribute = function (attributeId) {
dojo.lang.assertType(attributeId, String);
dojo.lang.assert(this.getAttribute(attributeId) === null);
var attribute = new dojo.data.old.Attribute(this, attributeId);
this._dictionaryOfAttributes[attributeId] = attribute;
return attribute;
};
dojo.data.old.provider.Base.prototype._getResultSets = function () {
return [this._resultSet];
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/data/old/provider/Base.js
New file
0,0 → 1,122
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.data.old.provider.Base");
dojo.require("dojo.lang.assert");
dojo.data.old.provider.Base = function () {
this._countOfNestedTransactions = 0;
this._changesInCurrentTransaction = null;
};
dojo.data.old.provider.Base.prototype.beginTransaction = function () {
if (this._countOfNestedTransactions === 0) {
this._changesInCurrentTransaction = [];
}
this._countOfNestedTransactions += 1;
};
dojo.data.old.provider.Base.prototype.endTransaction = function () {
this._countOfNestedTransactions -= 1;
dojo.lang.assert(this._countOfNestedTransactions >= 0);
if (this._countOfNestedTransactions === 0) {
var listOfChangesMade = this._saveChanges();
this._changesInCurrentTransaction = null;
if (listOfChangesMade.length > 0) {
this._notifyObserversOfChanges(listOfChangesMade);
}
}
};
dojo.data.old.provider.Base.prototype.getNewItemToLoad = function () {
return this._newItem();
};
dojo.data.old.provider.Base.prototype.newItem = function (itemName) {
dojo.lang.assertType(itemName, String, {optional:true});
var item = this._newItem();
if (itemName) {
item.set("name", itemName);
}
return item;
};
dojo.data.old.provider.Base.prototype.newAttribute = function (attributeId) {
dojo.lang.assertType(attributeId, String, {optional:true});
var attribute = this._newAttribute(attributeId);
return attribute;
};
dojo.data.old.provider.Base.prototype.getAttribute = function (attributeId) {
dojo.unimplemented("dojo.data.old.provider.Base");
var attribute;
return attribute;
};
dojo.data.old.provider.Base.prototype.getAttributes = function () {
dojo.unimplemented("dojo.data.old.provider.Base");
return this._arrayOfAttributes;
};
dojo.data.old.provider.Base.prototype.fetchArray = function () {
dojo.unimplemented("dojo.data.old.provider.Base");
return [];
};
dojo.data.old.provider.Base.prototype.fetchResultSet = function () {
dojo.unimplemented("dojo.data.old.provider.Base");
var resultSet;
return resultSet;
};
dojo.data.old.provider.Base.prototype.noteChange = function (item, attribute, value) {
var change = {item:item, attribute:attribute, value:value};
if (this._countOfNestedTransactions === 0) {
this.beginTransaction();
this._changesInCurrentTransaction.push(change);
this.endTransaction();
} else {
this._changesInCurrentTransaction.push(change);
}
};
dojo.data.old.provider.Base.prototype.addItemObserver = function (item, observer) {
dojo.lang.assertType(item, dojo.data.old.Item);
item.addObserver(observer);
};
dojo.data.old.provider.Base.prototype.removeItemObserver = function (item, observer) {
dojo.lang.assertType(item, dojo.data.old.Item);
item.removeObserver(observer);
};
dojo.data.old.provider.Base.prototype._newItem = function () {
var item = new dojo.data.old.Item(this);
return item;
};
dojo.data.old.provider.Base.prototype._newAttribute = function (attributeId) {
var attribute = new dojo.data.old.Attribute(this);
return attribute;
};
dojo.data.old.provider.Base.prototype._saveChanges = function () {
var arrayOfChangesMade = this._changesInCurrentTransaction;
return arrayOfChangesMade;
};
dojo.data.old.provider.Base.prototype._notifyObserversOfChanges = function (arrayOfChanges) {
var arrayOfResultSets = this._getResultSets();
for (var i in arrayOfChanges) {
var change = arrayOfChanges[i];
var changedItem = change.item;
var arrayOfItemObservers = changedItem.getObservers();
for (var j in arrayOfItemObservers) {
var observer = arrayOfItemObservers[j];
observer.observedObjectHasChanged(changedItem, change);
}
for (var k in arrayOfResultSets) {
var resultSet = arrayOfResultSets[k];
var arrayOfResultSetObservers = resultSet.getObservers();
for (var m in arrayOfResultSetObservers) {
observer = arrayOfResultSetObservers[m];
observer.observedObjectHasChanged(resultSet, change);
}
}
}
};
dojo.data.old.provider.Base.prototype._getResultSets = function () {
dojo.unimplemented("dojo.data.old.provider.Base");
return [];
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/data/old/Type.js
New file
0,0 → 1,17
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.data.old.Type");
dojo.require("dojo.data.old.Item");
dojo.data.old.Type = function (dataProvider) {
dojo.data.old.Item.call(this, dataProvider);
};
dojo.inherits(dojo.data.old.Type, dojo.data.old.Item);
 
/tags/Racine_livraison_narmer/api/js/dojo/src/data/OpmlStore.js
New file
0,0 → 1,164
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.data.OpmlStore");
dojo.require("dojo.data.core.Read");
dojo.require("dojo.data.core.Result");
dojo.require("dojo.lang.assert");
dojo.require("dojo.json");
dojo.require("dojo.experimental");
dojo.experimental("dojo.data.OpmlStore");
dojo.declare("dojo.data.OpmlStore", dojo.data.core.Read, {initializer:function (keywordParameters) {
this._arrayOfTopLevelItems = [];
this._metadataNodes = null;
this._loadFinished = false;
this._opmlFileUrl = keywordParameters["url"];
}, _assertIsItem:function (item) {
if (!this.isItem(item)) {
throw new Error("dojo.data.OpmlStore: a function was passed an item argument that was not an item");
}
}, _removeChildNodesThatAreNotElementNodes:function (node, recursive) {
var childNodes = node.childNodes;
if (childNodes.length == 0) {
return;
}
var nodesToRemove = [];
var i, childNode;
for (i = 0; i < childNodes.length; ++i) {
childNode = childNodes[i];
if (childNode.nodeType != Node.ELEMENT_NODE) {
nodesToRemove.push(childNode);
}
}
for (i = 0; i < nodesToRemove.length; ++i) {
childNode = nodesToRemove[i];
node.removeChild(childNode);
}
if (recursive) {
for (i = 0; i < childNodes.length; ++i) {
childNode = childNodes[i];
this._removeChildNodesThatAreNotElementNodes(childNode, recursive);
}
}
}, _processRawXmlTree:function (rawXmlTree) {
var headNodes = rawXmlTree.getElementsByTagName("head");
var headNode = headNodes[0];
this._removeChildNodesThatAreNotElementNodes(headNode);
this._metadataNodes = headNode.childNodes;
var bodyNodes = rawXmlTree.getElementsByTagName("body");
var bodyNode = bodyNodes[0];
this._removeChildNodesThatAreNotElementNodes(bodyNode, true);
var bodyChildNodes = bodyNodes[0].childNodes;
for (var i = 0; i < bodyChildNodes.length; ++i) {
var node = bodyChildNodes[i];
if (node.tagName == "outline") {
this._arrayOfTopLevelItems.push(node);
}
}
}, get:function (item, attribute, defaultValue) {
this._assertIsItem(item);
if (attribute == "children") {
return (item.firstChild || defaultValue);
} else {
var value = item.getAttribute(attribute);
value = (value != undefined) ? value : defaultValue;
return value;
}
}, getValues:function (item, attribute) {
this._assertIsItem(item);
if (attribute == "children") {
var array = [];
for (var i = 0; i < item.childNodes.length; ++i) {
array.push(item.childNodes[i]);
}
return array;
} else {
return [item.getAttribute(attribute)];
}
}, getAttributes:function (item) {
this._assertIsItem(item);
var attributes = [];
var xmlNode = item;
var xmlAttributes = xmlNode.attributes;
for (var i = 0; i < xmlAttributes.length; ++i) {
var xmlAttribute = xmlAttributes.item(i);
attributes.push(xmlAttribute.nodeName);
}
if (xmlNode.childNodes.length > 0) {
attributes.push("children");
}
return attributes;
}, hasAttribute:function (item, attribute) {
return (this.getValues(item, attribute).length > 0);
}, containsValue:function (item, attribute, value) {
var values = this.getValues(item, attribute);
for (var i = 0; i < values.length; ++i) {
var possibleValue = values[i];
if (value == possibleValue) {
return true;
}
}
return false;
}, isItem:function (something) {
return (something && something.nodeType == Node.ELEMENT_NODE && something.tagName == "outline");
}, isItemAvailable:function (something) {
return this.isItem(something);
}, find:function (keywordArgs) {
var result = null;
if (keywordArgs instanceof dojo.data.core.Result) {
result = keywordArgs;
result.store = this;
} else {
result = new dojo.data.core.Result(keywordArgs, this);
}
var self = this;
var bindHandler = function (type, data, evt) {
var scope = result.scope || dj_global;
if (type == "load") {
self._processRawXmlTree(data);
if (result.saveResult) {
result.items = self._arrayOfTopLevelItems;
}
if (result.onbegin) {
result.onbegin.call(scope, result);
}
for (var i = 0; i < self._arrayOfTopLevelItems.length; i++) {
var item = self._arrayOfTopLevelItems[i];
if (result.onnext && !result._aborted) {
result.onnext.call(scope, item, result);
}
}
if (result.oncompleted && !result._aborted) {
result.oncompleted.call(scope, result);
}
} else {
if (type == "error" || type == "timeout") {
var errorObject = data;
if (result.onerror) {
result.onerror.call(scope, data);
}
}
}
};
if (!this._loadFinished) {
if (this._opmlFileUrl) {
var bindRequest = dojo.io.bind({url:this._opmlFileUrl, handle:bindHandler, mimetype:"text/xml", sync:(result.sync || false)});
result._abortFunc = bindRequest.abort;
}
}
return result;
}, getIdentity:function (item) {
dojo.unimplemented("dojo.data.OpmlStore.getIdentity()");
return null;
}, findByIdentity:function (identity) {
dojo.unimplemented("dojo.data.OpmlStore.findByIdentity()");
return null;
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/data/CsvStore.js
New file
0,0 → 1,113
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.data.CsvStore");
dojo.require("dojo.data.core.RemoteStore");
dojo.require("dojo.lang.assert");
dojo.declare("dojo.data.CsvStore", dojo.data.core.RemoteStore, {_setupQueryRequest:function (result, requestKw) {
var serverQueryUrl = this._serverQueryUrl ? this._serverQueryUrl : "";
var queryUrl = result.query ? result.query : "";
requestKw.url = serverQueryUrl + queryUrl;
requestKw.method = "get";
}, _resultToQueryData:function (serverResponseData) {
var csvFileContentString = serverResponseData;
var arrayOfArrays = this._getArrayOfArraysFromCsvFileContents(csvFileContentString);
var arrayOfObjects = this._getArrayOfObjectsFromArrayOfArrays(arrayOfArrays);
var remoteStoreData = this._getRemoteStoreDataFromArrayOfObjects(arrayOfObjects);
return remoteStoreData;
}, _setupSaveRequest:function (saveKeywordArgs, requestKw) {
}, _getArrayOfArraysFromCsvFileContents:function (csvFileContents) {
dojo.lang.assertType(csvFileContents, String);
var lineEndingCharacters = new RegExp("\r\n|\n|\r");
var leadingWhiteSpaceCharacters = new RegExp("^\\s+", "g");
var trailingWhiteSpaceCharacters = new RegExp("\\s+$", "g");
var doubleQuotes = new RegExp("\"\"", "g");
var arrayOfOutputRecords = [];
var arrayOfInputLines = csvFileContents.split(lineEndingCharacters);
for (var i in arrayOfInputLines) {
var singleLine = arrayOfInputLines[i];
if (singleLine.length > 0) {
var listOfFields = singleLine.split(",");
var j = 0;
while (j < listOfFields.length) {
var space_field_space = listOfFields[j];
var field_space = space_field_space.replace(leadingWhiteSpaceCharacters, "");
var field = field_space.replace(trailingWhiteSpaceCharacters, "");
var firstChar = field.charAt(0);
var lastChar = field.charAt(field.length - 1);
var secondToLastChar = field.charAt(field.length - 2);
var thirdToLastChar = field.charAt(field.length - 3);
if ((firstChar == "\"") && ((lastChar != "\"") || ((lastChar == "\"") && (secondToLastChar == "\"") && (thirdToLastChar != "\"")))) {
if (j + 1 === listOfFields.length) {
return null;
}
var nextField = listOfFields[j + 1];
listOfFields[j] = field_space + "," + nextField;
listOfFields.splice(j + 1, 1);
} else {
if ((firstChar == "\"") && (lastChar == "\"")) {
field = field.slice(1, (field.length - 1));
field = field.replace(doubleQuotes, "\"");
}
listOfFields[j] = field;
j += 1;
}
}
arrayOfOutputRecords.push(listOfFields);
}
}
return arrayOfOutputRecords;
}, _getArrayOfObjectsFromArrayOfArrays:function (arrayOfArrays) {
dojo.lang.assertType(arrayOfArrays, Array);
var arrayOfItems = [];
if (arrayOfArrays.length > 1) {
var arrayOfKeys = arrayOfArrays[0];
for (var i = 1; i < arrayOfArrays.length; ++i) {
var row = arrayOfArrays[i];
var item = {};
for (var j in row) {
var value = row[j];
var key = arrayOfKeys[j];
item[key] = value;
}
arrayOfItems.push(item);
}
}
return arrayOfItems;
}, _getRemoteStoreDataFromArrayOfObjects:function (arrayOfObjects) {
dojo.lang.assertType(arrayOfObjects, Array);
var output = {};
for (var i = 0; i < arrayOfObjects.length; ++i) {
var object = arrayOfObjects[i];
for (var key in object) {
var value = object[key];
object[key] = [value];
}
output[i] = object;
}
return output;
}, newItem:function (attributes, keywordArgs) {
dojo.unimplemented("dojo.data.CsvStore.newItem");
}, deleteItem:function (item) {
dojo.unimplemented("dojo.data.CsvStore.deleteItem");
}, setValues:function (item, attribute, values) {
dojo.unimplemented("dojo.data.CsvStore.setValues");
}, set:function (item, attribute, value) {
dojo.unimplemented("dojo.data.CsvStore.set");
}, unsetAttribute:function (item, attribute) {
dojo.unimplemented("dojo.data.CsvStore.unsetAttribute");
}, save:function (keywordArgs) {
dojo.unimplemented("dojo.data.CsvStore.save");
}, revert:function () {
dojo.unimplemented("dojo.data.CsvStore.revert");
}, isDirty:function (item) {
dojo.unimplemented("dojo.data.CsvStore.isDirty");
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/data/RdfStore.js
New file
0,0 → 1,183
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.data.RdfStore");
dojo.provide("dojo.data.RhizomeStore");
dojo.require("dojo.lang.declare");
dojo.require("dojo.data.core.RemoteStore");
dojo.require("dojo.experimental");
dojo.data.RdfDatatypeSerializer = function (type, convertFunc, uri) {
this.type = type;
this._converter = convertFunc;
this.uri = uri;
this.serialize = function (value) {
return this._converter.call(value, value);
};
};
dojo.declare("dojo.data.RdfStore", dojo.data.core.RemoteStore, {_datatypeMap:{literal:function (value) {
var literal = value.value;
if (value["xml:lang"]) {
literal.lang = value["xml:lang"];
}
return literal;
}, uri:function (value) {
return {id:value.value};
}, bnode:function (value) {
return {id:"_:" + value.value};
}, "http://www.w3.org/2001/XMLSchema#int":function (value) {
return parseInt(value.value);
}, "http://www.w3.org/2001/XMLSchema#integer":function (value) {
return parseInt(value.value);
}, "http://www.w3.org/2001/XMLSchema#long":function (value) {
return parseInt(value.value);
}, "http://www.w3.org/2001/XMLSchema#float":function (value) {
return parseFloat(value.value);
}, "http://www.w3.org/2001/XMLSchema#double":function (value) {
return parseFloat(value.value);
}, "http://www.w3.org/2001/XMLSchema#boolean":function (value) {
return !value || value == "false" || value == "0" ? false : true;
}}, _datatypeSerializers:[new dojo.data.RdfDatatypeSerializer(Number, Number.toString, "http://www.w3.org/2001/XMLSchema#float"), new dojo.data.RdfDatatypeSerializer(Boolean, Boolean.toString, "http://www.w3.org/2001/XMLSchema#boolean")], _findDatatypeSerializer:function (value) {
var length = this._datatypeSerializers.length;
for (var i = 0; i < length; i++) {
var datatype = this._datatypeSerializers[i];
if (value instanceof datatype.type) {
return datatype;
}
}
}, _toRDFValue:function (value) {
var rdfvalue = {};
if (value.id) {
if (value.id.slice(0, 2) == "_:") {
rdfvalue.type = "bnode";
rdfvalue.value = value.id.substring(2);
} else {
rdfvalue.type = "uri";
rdfvalue.value = value.id;
}
} else {
if (typeof value == "string" || value instanceof String) {
rdfvalue.type = "literal";
rdfvalue.value = value;
if (value.lang) {
rdfvalue["xml:lang"] = value.lang;
}
} else {
if (typeof value == "number") {
value = new Number(value);
} else {
if (typeof value == "boolean") {
value = new Boolean(value);
}
}
var datatype = this._findDatatypeSerializer(value);
if (datatype) {
rdfvalue = {"type":"typed-literal", "datatype":datatype.uri, "value":value.toString()};
} else {
rdfvalue = {"type":"literal", "value":value.toString()};
}
}
}
return rdfvalue;
}, _setupSaveRequest:function (saveKeywordArgs, requestKw) {
var rdfResult = {"head":{"vars":["s", "p", "o"]}, "results":{"bindings":[]}};
var resources = [];
for (var key in this._deleted) {
resources.push(key);
}
rdfResult.results.deleted = resources;
for (key in this._changed) {
var subject = this._toRDFValue(this.getIdentity(key));
var attributes = this._changed[key];
for (var attr in attributes) {
var predicate = {type:"uri", value:attr};
var values = attributes[attr];
if (!values.length) {
continue;
}
var rdfvalues = [];
for (var i = 0; i < values.length; i++) {
var rdfvalue = this._toRDFValue(values[i]);
rdfResult.results.bindings.push({s:subject, p:predicate, o:rdfvalue});
}
}
}
var oldRegistry = dojo.json.jsonRegistry;
dojo.json.jsonRegistry = this._jsonRegistry;
var jsonString = dojo.json.serialize(rdfResult);
dojo.json.jsonRegistry = oldRegistry;
requestKw.postContent = jsonString;
}, _resultToQueryMetadata:function (json) {
return json.head;
}, _resultToQueryData:function (json) {
var items = {};
var stmts = json.results.bindings;
for (var i = 0; i < stmts.length; i++) {
var stmt = stmts[i];
var subject = stmt.s.value;
if (stmt.s.type == "bnode") {
subject = "_:" + subject;
}
var attributes = data[subject];
if (!attributes) {
attributes = {};
data[stmt.s] = attributes;
}
var attr = attributes[stmt.p.value];
if (!attr) {
attributes[stmt.p.value] = [stmt.o];
} else {
attr.push(stmt.o);
}
}
return items;
}});
dojo.declare("dojo.data.RhizomeStore", dojo.data.RdfStore, {initializer:function (kwArgs) {
this._serverQueryUrl = kwArgs.baseUrl + "search?view=json&searchType=RxPath&search=";
this._serverSaveUrl = kwArgs.baseUrl + "save-metadata";
}, _resultToQueryMetadata:function (json) {
return json;
}, _resultToQueryData:function (json) {
return json;
}, _setupSaveRequest:function (saveKeywordArgs, requestKw) {
requestKw.url = this._serverSaveUrl;
requestKw.method = "post";
requestKw.mimetype = "text/plain";
var resources = [];
for (var key in this._deleted) {
resources.push(key);
}
var changes = {};
for (key in this._changed) {
if (!this._added[key]) {
resources.push(key);
}
var attributes = this._changed[key];
var rdfattributes = {};
for (var attr in attributes) {
var values = attributes[attr];
if (!values.length) {
continue;
}
var rdfvalues = [];
for (var i = 0; i < values.length; i++) {
var rdfvalue = this._toRDFValue(values[i]);
rdfvalues.push(rdfvalue);
}
rdfattributes[attr] = rdfvalues;
}
changes[key] = rdfattributes;
}
var oldRegistry = dojo.json.jsonRegistry;
dojo.json.jsonRegistry = this._jsonRegistry;
var jsonString = dojo.json.serialize(changes);
dojo.json.jsonRegistry = oldRegistry;
requestKw.content = {rdfFormat:"json", resource:resources, metadata:jsonString};
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/svg.js
New file
0,0 → 1,257
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.svg");
dojo.require("dojo.lang.common");
dojo.require("dojo.dom");
dojo.mixin(dojo.svg, dojo.dom);
dojo.svg.graphics = dojo.svg.g = new function (d) {
this.suspend = function () {
try {
d.documentElement.suspendRedraw(0);
}
catch (e) {
}
};
this.resume = function () {
try {
d.documentElement.unsuspendRedraw(0);
}
catch (e) {
}
};
this.force = function () {
try {
d.documentElement.forceRedraw();
}
catch (e) {
}
};
}(document);
dojo.svg.animations = dojo.svg.anim = new function (d) {
this.arePaused = function () {
try {
return d.documentElement.animationsPaused();
}
catch (e) {
return false;
}
};
this.pause = function () {
try {
d.documentElement.pauseAnimations();
}
catch (e) {
}
};
this.resume = function () {
try {
d.documentElement.unpauseAnimations();
}
catch (e) {
}
};
}(document);
dojo.svg.toCamelCase = function (selector) {
var arr = selector.split("-"), cc = arr[0];
for (var i = 1; i < arr.length; i++) {
cc += arr[i].charAt(0).toUpperCase() + arr[i].substring(1);
}
return cc;
};
dojo.svg.toSelectorCase = function (selector) {
return selector.replace(/([A-Z])/g, "-$1").toLowerCase();
};
dojo.svg.getStyle = function (node, cssSelector) {
return document.defaultView.getComputedStyle(node, cssSelector);
};
dojo.svg.getNumericStyle = function (node, cssSelector) {
return parseFloat(dojo.svg.getStyle(node, cssSelector));
};
dojo.svg.getOpacity = function (node) {
return Math.min(1, dojo.svg.getNumericStyle(node, "fill-opacity"));
};
dojo.svg.setOpacity = function (node, opacity) {
node.setAttributeNS(this.xmlns.svg, "fill-opacity", opacity);
node.setAttributeNS(this.xmlns.svg, "stroke-opacity", opacity);
};
dojo.svg.clearOpacity = function (node) {
node.setAttributeNS(this.xmlns.svg, "fill-opacity", "1.0");
node.setAttributeNS(this.xmlns.svg, "stroke-opacity", "1.0");
};
dojo.svg.getCoords = function (node) {
if (node.getBBox) {
var box = node.getBBox();
return {x:box.x, y:box.y};
}
return null;
};
dojo.svg.setCoords = function (node, coords) {
var p = dojo.svg.getCoords();
if (!p) {
return;
}
var dx = p.x - coords.x;
var dy = p.y - coords.y;
dojo.svg.translate(node, dx, dy);
};
dojo.svg.getDimensions = function (node) {
if (node.getBBox) {
var box = node.getBBox();
return {width:box.width, height:box.height};
}
return null;
};
dojo.svg.setDimensions = function (node, dim) {
if (node.width) {
node.width.baseVal.value = dim.width;
node.height.baseVal.value = dim.height;
} else {
if (node.r) {
node.r.baseVal.value = Math.min(dim.width, dim.height) / 2;
} else {
if (node.rx) {
node.rx.baseVal.value = dim.width / 2;
node.ry.baseVal.value = dim.height / 2;
}
}
}
};
dojo.svg.translate = function (node, dx, dy) {
if (node.transform && node.ownerSVGElement && node.ownerSVGElement.createSVGTransform) {
var t = node.ownerSVGElement.createSVGTransform();
t.setTranslate(dx, dy);
node.transform.baseVal.appendItem(t);
}
};
dojo.svg.scale = function (node, scaleX, scaleY) {
if (!scaleY) {
var scaleY = scaleX;
}
if (node.transform && node.ownerSVGElement && node.ownerSVGElement.createSVGTransform) {
var t = node.ownerSVGElement.createSVGTransform();
t.setScale(scaleX, scaleY);
node.transform.baseVal.appendItem(t);
}
};
dojo.svg.rotate = function (node, ang, cx, cy) {
if (node.transform && node.ownerSVGElement && node.ownerSVGElement.createSVGTransform) {
var t = node.ownerSVGElement.createSVGTransform();
if (cx == null) {
t.setMatrix(t.matrix.rotate(ang));
} else {
t.setRotate(ang, cx, cy);
}
node.transform.baseVal.appendItem(t);
}
};
dojo.svg.skew = function (node, ang, axis) {
var dir = axis || "x";
if (node.transform && node.ownerSVGElement && node.ownerSVGElement.createSVGTransform) {
var t = node.ownerSVGElement.createSVGTransform();
if (dir != "x") {
t.setSkewY(ang);
} else {
t.setSkewX(ang);
}
node.transform.baseVal.appendItem(t);
}
};
dojo.svg.flip = function (node, axis) {
var dir = axis || "x";
if (node.transform && node.ownerSVGElement && node.ownerSVGElement.createSVGTransform) {
var t = node.ownerSVGElement.createSVGTransform();
t.setMatrix((dir != "x") ? t.matrix.flipY() : t.matrix.flipX());
node.transform.baseVal.appendItem(t);
}
};
dojo.svg.invert = function (node) {
if (node.transform && node.ownerSVGElement && node.ownerSVGElement.createSVGTransform) {
var t = node.ownerSVGElement.createSVGTransform();
t.setMatrix(t.matrix.inverse());
node.transform.baseVal.appendItem(t);
}
};
dojo.svg.applyMatrix = function (node, a, b, c, d, e, f) {
if (node.transform && node.ownerSVGElement && node.ownerSVGElement.createSVGTransform) {
var m;
if (b) {
var m = node.ownerSVGElement.createSVGMatrix();
m.a = a;
m.b = b;
m.c = c;
m.d = d;
m.e = e;
m.f = f;
} else {
m = a;
}
var t = node.ownerSVGElement.createSVGTransform();
t.setMatrix(m);
node.transform.baseVal.appendItem(t);
}
};
dojo.svg.group = function (nodes) {
var p = nodes.item(0).parentNode;
var g = document.createElementNS(this.xmlns.svg, "g");
for (var i = 0; i < nodes.length; i++) {
g.appendChild(nodes.item(i));
}
p.appendChild(g);
return g;
};
dojo.svg.ungroup = function (g) {
var p = g.parentNode;
while (g.childNodes.length > 0) {
p.appendChild(g.childNodes.item(0));
}
p.removeChild(g);
};
dojo.svg.getGroup = function (node) {
var a = this.getAncestors(node);
for (var i = 0; i < a.length; i++) {
if (a[i].nodeType == this.ELEMENT_NODE && a[i].nodeName.toLowerCase() == "g") {
return a[i];
}
}
return null;
};
dojo.svg.bringToFront = function (node) {
var n = this.getGroup(node) || node;
n.ownerSVGElement.appendChild(n);
};
dojo.svg.sendToBack = function (node) {
var n = this.getGroup(node) || node;
n.ownerSVGElement.insertBefore(n, n.ownerSVGElement.firstChild);
};
dojo.svg.bringForward = function (node) {
var n = this.getGroup(node) || node;
if (this.getLastChildElement(n.parentNode) != n) {
this.insertAfter(n, this.getNextSiblingElement(n), true);
}
};
dojo.svg.sendBackward = function (node) {
var n = this.getGroup(node) || node;
if (this.getFirstChildElement(n.parentNode) != n) {
this.insertBefore(n, this.getPreviousSiblingElement(n), true);
}
};
dojo.svg.createNodesFromText = function (txt, wrap) {
var docFrag = (new DOMParser()).parseFromString(txt, "text/xml").normalize();
if (wrap) {
return [docFrag.firstChild.cloneNode(true)];
}
var nodes = [];
for (var x = 0; x < docFrag.childNodes.length; x++) {
nodes.push(docFrag.childNodes.item(x).cloneNode(true));
}
return nodes;
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/hostenv_adobesvg.js
New file
0,0 → 1,378
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
if (typeof window == "undefined") {
dojo.raise("attempt to use adobe svg hostenv when no window object");
}
with (dojo.render) {
name = navigator.appName;
ver = parseFloat(navigator.appVersion, 10);
switch (navigator.platform) {
case "MacOS":
os.osx = true;
break;
case "Linux":
os.linux = true;
break;
case "Windows":
os.win = true;
break;
default:
os.linux = true;
break;
}
svg.capable = true;
svg.support.builtin = true;
svg.adobe = true;
}
dojo.hostenv.println = function (s) {
try {
var ti = document.createElement("text");
ti.setAttribute("x", "50");
var yPos = 25 + 15 * document.getElementsByTagName("text").length;
ti.setAttribute("y", yPos);
var tn = document.createTextNode(s);
ti.appendChild(tn);
document.documentElement.appendChild(ti);
}
catch (e) {
}
};
dojo.debug = function () {
if (!djConfig.isDebug) {
return;
}
var args = arguments;
if (typeof dojo.hostenv.println != "function") {
dojo.raise("attempt to call dojo.debug when there is no dojo.hostenv println implementation (yet?)");
}
var isJUM = dj_global["jum"];
var s = isJUM ? "" : "DEBUG: ";
for (var i = 0; i < args.length; ++i) {
s += args[i];
}
if (isJUM) {
jum.debug(s);
} else {
dojo.hostenv.println(s);
}
};
dojo.hostenv.startPackage("dojo.hostenv");
dojo.hostenv.name_ = "adobesvg";
dojo.hostenv.anonCtr = 0;
dojo.hostenv.anon = {};
dojo.hostenv.nameAnonFunc = function (anonFuncPtr, namespaceObj) {
var ret = "_" + this.anonCtr++;
var nso = (namespaceObj || this.anon);
while (typeof nso[ret] != "undefined") {
ret = "_" + this.anonCtr++;
}
nso[ret] = anonFuncPtr;
return ret;
};
dojo.hostenv.modulesLoadedFired = false;
dojo.hostenv.modulesLoadedListeners = [];
dojo.hostenv.getTextStack = [];
dojo.hostenv.loadUriStack = [];
dojo.hostenv.loadedUris = [];
dojo.hostenv.modulesLoaded = function () {
if (this.modulesLoadedFired) {
return;
}
if ((this.loadUriStack.length == 0) && (this.getTextStack.length == 0)) {
if (this.inFlightCount > 0) {
dojo.debug("couldn't initialize, there are files still in flight");
return;
}
this.modulesLoadedFired = true;
var mll = this.modulesLoadedListeners;
for (var x = 0; x < mll.length; x++) {
mll[x]();
}
}
};
dojo.hostenv.getNewAnonFunc = function () {
var ret = "_" + this.anonCtr++;
while (typeof this.anon[ret] != "undefined") {
ret = "_" + this.anonCtr++;
}
eval("dojo.nostenv.anon." + ret + " = function(){};");
return [ret, this.anon[ret]];
};
dojo.hostenv.displayStack = function () {
var oa = [];
var stack = this.loadUriStack;
for (var x = 0; x < stack.length; x++) {
oa.unshift([stack[x][0], (typeof stack[x][2])]);
}
dojo.debug("<pre>" + oa.join("\n") + "</pre>");
};
dojo.hostenv.unwindUriStack = function () {
var stack = this.loadUriStack;
for (var x in dojo.hostenv.loadedUris) {
for (var y = stack.length - 1; y >= 0; y--) {
if (stack[y][0] == x) {
stack.splice(y, 1);
}
}
}
var next = stack.pop();
if ((!next) && (stack.length == 0)) {
return;
}
for (var x = 0; x < stack.length; x++) {
if ((stack[x][0] == next[0]) && (stack[x][2])) {
next[2] == stack[x][2];
}
}
var last = next;
while (dojo.hostenv.loadedUris[next[0]]) {
last = next;
next = stack.pop();
}
while (typeof next[2] == "string") {
try {
dj_eval(next[2]);
next[1](true);
}
catch (e) {
dojo.debug("we got an error when loading " + next[0]);
dojo.debug("error: " + e);
}
dojo.hostenv.loadedUris[next[0]] = true;
dojo.hostenv.loadedUris.push(next[0]);
last = next;
next = stack.pop();
if ((!next) && (stack.length == 0)) {
break;
}
while (dojo.hostenv.loadedUris[next[0]]) {
last = next;
next = stack.pop();
}
}
if (next) {
stack.push(next);
dojo.debug("### CHOKED ON: " + next[0]);
}
};
dojo.hostenv.loadUri = function (uri, cb) {
if (dojo.hostenv.loadedUris[uri]) {
return;
}
var stack = this.loadUriStack;
stack.push([uri, cb, null]);
var tcb = function (contents) {
if (contents.content) {
contents = contents.content;
}
var next = stack.pop();
if ((!next) && (stack.length == 0)) {
dojo.hostenv.modulesLoaded();
return;
}
if (typeof contents == "string") {
stack.push(next);
for (var x = 0; x < stack.length; x++) {
if (stack[x][0] == uri) {
stack[x][2] = contents;
}
}
next = stack.pop();
}
if (dojo.hostenv.loadedUris[next[0]]) {
dojo.hostenv.unwindUriStack();
return;
}
stack.push(next);
if (next[0] != uri) {
if (typeof next[2] == "string") {
dojo.hostenv.unwindUriStack();
}
} else {
if (!contents) {
next[1](false);
} else {
var deps = dojo.hostenv.getDepsForEval(next[2]);
if (deps.length > 0) {
eval(deps.join(";"));
} else {
dojo.hostenv.unwindUriStack();
}
}
}
};
this.getText(uri, tcb, true);
};
dojo.hostenv.loadModule = function (modulename, exact_only, omit_module_check) {
var module = this.findModule(modulename, 0);
if (module) {
return module;
}
if (typeof this.loading_modules_[modulename] !== "undefined") {
dojo.debug("recursive attempt to load module '" + modulename + "'");
} else {
this.addedToLoadingCount.push(modulename);
}
this.loading_modules_[modulename] = 1;
var relpath = modulename.replace(/\./g, "/") + ".js";
var syms = modulename.split(".");
var nsyms = modulename.split(".");
if (syms[0] == "dojo") {
syms[0] = "src";
}
var last = syms.pop();
syms.push(last);
var _this = this;
var pfn = this.pkgFileName;
if (last == "*") {
modulename = (nsyms.slice(0, -1)).join(".");
var module = this.findModule(modulename, 0);
if (module) {
_this.removedFromLoadingCount.push(modulename);
return module;
}
var nextTry = function (lastStatus) {
if (lastStatus) {
module = _this.findModule(modulename, false);
if ((!module) && (syms[syms.length - 1] != pfn)) {
dojo.raise("Module symbol '" + modulename + "' is not defined after loading '" + relpath + "'");
}
if (module) {
_this.removedFromLoadingCount.push(modulename);
dojo.hostenv.modulesLoaded();
return;
}
}
syms.pop();
syms.push(pfn);
relpath = syms.join("/") + ".js";
if (relpath.charAt(0) == "/") {
relpath = relpath.slice(1);
}
_this.loadPath(relpath, ((!omit_module_check) ? modulename : null), nextTry);
};
nextTry();
} else {
relpath = syms.join("/") + ".js";
modulename = nsyms.join(".");
var nextTry = function (lastStatus) {
if (lastStatus) {
module = _this.findModule(modulename, false);
if ((!module) && (syms[syms.length - 1] != pfn)) {
dojo.raise("Module symbol '" + modulename + "' is not defined after loading '" + relpath + "'");
}
if (module) {
_this.removedFromLoadingCount.push(modulename);
dojo.hostenv.modulesLoaded();
return;
}
}
var setPKG = (syms[syms.length - 1] == pfn) ? false : true;
syms.pop();
if (setPKG) {
syms.push(pfn);
}
relpath = syms.join("/") + ".js";
if (relpath.charAt(0) == "/") {
relpath = relpath.slice(1);
}
_this.loadPath(relpath, ((!omit_module_check) ? modulename : null), nextTry);
};
this.loadPath(relpath, ((!omit_module_check) ? modulename : null), nextTry);
}
return;
};
dojo.hostenv.async_cb = null;
dojo.hostenv.unWindGetTextStack = function () {
if (dojo.hostenv.inFlightCount > 0) {
setTimeout("dojo.hostenv.unWindGetTextStack()", 100);
return;
}
dojo.hostenv.inFlightCount++;
var next = dojo.hostenv.getTextStack.pop();
if ((!next) && (dojo.hostenv.getTextStack.length == 0)) {
dojo.hostenv.inFlightCount--;
dojo.hostenv.async_cb = function () {
};
return;
}
dojo.hostenv.async_cb = next[1];
window.getURL(next[0], function (result) {
dojo.hostenv.inFlightCount--;
dojo.hostenv.async_cb(result.content);
dojo.hostenv.unWindGetTextStack();
});
};
dojo.hostenv.getText = function (uri, async_cb, fail_ok) {
try {
if (async_cb) {
dojo.hostenv.getTextStack.push([uri, async_cb, fail_ok]);
dojo.hostenv.unWindGetTextStack();
} else {
return dojo.raise("No synchronous XMLHTTP implementation available, for uri " + uri);
}
}
catch (e) {
return dojo.raise("No XMLHTTP implementation available, for uri " + uri);
}
};
dojo.hostenv.postText = function (uri, async_cb, text, fail_ok, mime_type, encoding) {
var http = null;
var async_callback = function (httpResponse) {
if (!httpResponse.success) {
dojo.raise("Request for uri '" + uri + "' resulted in " + httpResponse.status);
}
if (!httpResponse.content) {
if (!fail_ok) {
dojo.raise("Request for uri '" + uri + "' resulted in no content");
}
return null;
}
async_cb(httpResponse.content);
};
try {
if (async_cb) {
http = window.postURL(uri, text, async_callback, mimeType, encoding);
} else {
return dojo.raise("No synchronous XMLHTTP post implementation available, for uri " + uri);
}
}
catch (e) {
return dojo.raise("No XMLHTTP post implementation available, for uri " + uri);
}
};
function dj_last_script_src() {
var scripts = window.document.getElementsByTagName("script");
if (scripts.length < 1) {
dojo.raise("No script elements in window.document, so can't figure out my script src");
}
var li = scripts.length - 1;
var xlinkNS = "http://www.w3.org/1999/xlink";
var src = null;
var script = null;
while (!src) {
script = scripts.item(li);
src = script.getAttributeNS(xlinkNS, "href");
li--;
if (li < 0) {
break;
}
}
if (!src) {
dojo.raise("Last script element (out of " + scripts.length + ") has no src");
}
return src;
}
if (!dojo.hostenv["library_script_uri_"]) {
dojo.hostenv.library_script_uri_ = dj_last_script_src();
}
dojo.requireIf((djConfig["isDebug"] || djConfig["debugAtAllCosts"]), "dojo.debug");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/date/serialize.js
New file
0,0 → 1,127
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.date.serialize");
dojo.require("dojo.string.common");
dojo.date.setIso8601 = function (dateObject, formattedString) {
var comps = (formattedString.indexOf("T") == -1) ? formattedString.split(" ") : formattedString.split("T");
dateObject = dojo.date.setIso8601Date(dateObject, comps[0]);
if (comps.length == 2) {
dateObject = dojo.date.setIso8601Time(dateObject, comps[1]);
}
return dateObject;
};
dojo.date.fromIso8601 = function (formattedString) {
return dojo.date.setIso8601(new Date(0, 0), formattedString);
};
dojo.date.setIso8601Date = function (dateObject, formattedString) {
var regexp = "^([0-9]{4})((-?([0-9]{2})(-?([0-9]{2}))?)|" + "(-?([0-9]{3}))|(-?W([0-9]{2})(-?([1-7]))?))?$";
var d = formattedString.match(new RegExp(regexp));
if (!d) {
dojo.debug("invalid date string: " + formattedString);
return null;
}
var year = d[1];
var month = d[4];
var date = d[6];
var dayofyear = d[8];
var week = d[10];
var dayofweek = d[12] ? d[12] : 1;
dateObject.setFullYear(year);
if (dayofyear) {
dateObject.setMonth(0);
dateObject.setDate(Number(dayofyear));
} else {
if (week) {
dateObject.setMonth(0);
dateObject.setDate(1);
var gd = dateObject.getDay();
var day = gd ? gd : 7;
var offset = Number(dayofweek) + (7 * Number(week));
if (day <= 4) {
dateObject.setDate(offset + 1 - day);
} else {
dateObject.setDate(offset + 8 - day);
}
} else {
if (month) {
dateObject.setDate(1);
dateObject.setMonth(month - 1);
}
if (date) {
dateObject.setDate(date);
}
}
}
return dateObject;
};
dojo.date.fromIso8601Date = function (formattedString) {
return dojo.date.setIso8601Date(new Date(0, 0), formattedString);
};
dojo.date.setIso8601Time = function (dateObject, formattedString) {
var timezone = "Z|(([-+])([0-9]{2})(:?([0-9]{2}))?)$";
var d = formattedString.match(new RegExp(timezone));
var offset = 0;
if (d) {
if (d[0] != "Z") {
offset = (Number(d[3]) * 60) + Number(d[5]);
offset *= ((d[2] == "-") ? 1 : -1);
}
offset -= dateObject.getTimezoneOffset();
formattedString = formattedString.substr(0, formattedString.length - d[0].length);
}
var regexp = "^([0-9]{2})(:?([0-9]{2})(:?([0-9]{2})(.([0-9]+))?)?)?$";
d = formattedString.match(new RegExp(regexp));
if (!d) {
dojo.debug("invalid time string: " + formattedString);
return null;
}
var hours = d[1];
var mins = Number((d[3]) ? d[3] : 0);
var secs = (d[5]) ? d[5] : 0;
var ms = d[7] ? (Number("0." + d[7]) * 1000) : 0;
dateObject.setHours(hours);
dateObject.setMinutes(mins);
dateObject.setSeconds(secs);
dateObject.setMilliseconds(ms);
if (offset !== 0) {
dateObject.setTime(dateObject.getTime() + offset * 60000);
}
return dateObject;
};
dojo.date.fromIso8601Time = function (formattedString) {
return dojo.date.setIso8601Time(new Date(0, 0), formattedString);
};
dojo.date.toRfc3339 = function (dateObject, selector) {
if (!dateObject) {
dateObject = new Date();
}
var _ = dojo.string.pad;
var formattedDate = [];
if (selector != "timeOnly") {
var date = [_(dateObject.getFullYear(), 4), _(dateObject.getMonth() + 1, 2), _(dateObject.getDate(), 2)].join("-");
formattedDate.push(date);
}
if (selector != "dateOnly") {
var time = [_(dateObject.getHours(), 2), _(dateObject.getMinutes(), 2), _(dateObject.getSeconds(), 2)].join(":");
var timezoneOffset = dateObject.getTimezoneOffset();
time += (timezoneOffset > 0 ? "-" : "+") + _(Math.floor(Math.abs(timezoneOffset) / 60), 2) + ":" + _(Math.abs(timezoneOffset) % 60, 2);
formattedDate.push(time);
}
return formattedDate.join("T");
};
dojo.date.fromRfc3339 = function (rfcDate) {
if (rfcDate.indexOf("Tany") != -1) {
rfcDate = rfcDate.replace("Tany", "");
}
var dateObject = new Date();
return dojo.date.setIso8601(dateObject, rfcDate);
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/date/common.js
New file
0,0 → 1,314
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.date.common");
dojo.date.setDayOfYear = function (dateObject, dayOfYear) {
dateObject.setMonth(0);
dateObject.setDate(dayOfYear);
return dateObject;
};
dojo.date.getDayOfYear = function (dateObject) {
var fullYear = dateObject.getFullYear();
var lastDayOfPrevYear = new Date(fullYear - 1, 11, 31);
return Math.floor((dateObject.getTime() - lastDayOfPrevYear.getTime()) / 86400000);
};
dojo.date.setWeekOfYear = function (dateObject, week, firstDay) {
if (arguments.length == 1) {
firstDay = 0;
}
dojo.unimplemented("dojo.date.setWeekOfYear");
};
dojo.date.getWeekOfYear = function (dateObject, firstDay) {
if (arguments.length == 1) {
firstDay = 0;
}
var firstDayOfYear = new Date(dateObject.getFullYear(), 0, 1);
var day = firstDayOfYear.getDay();
firstDayOfYear.setDate(firstDayOfYear.getDate() - day + firstDay - (day > firstDay ? 7 : 0));
return Math.floor((dateObject.getTime() - firstDayOfYear.getTime()) / 604800000);
};
dojo.date.setIsoWeekOfYear = function (dateObject, week, firstDay) {
if (arguments.length == 1) {
firstDay = 1;
}
dojo.unimplemented("dojo.date.setIsoWeekOfYear");
};
dojo.date.getIsoWeekOfYear = function (dateObject, firstDay) {
if (arguments.length == 1) {
firstDay = 1;
}
dojo.unimplemented("dojo.date.getIsoWeekOfYear");
};
dojo.date.shortTimezones = ["IDLW", "BET", "HST", "MART", "AKST", "PST", "MST", "CST", "EST", "AST", "NFT", "BST", "FST", "AT", "GMT", "CET", "EET", "MSK", "IRT", "GST", "AFT", "AGTT", "IST", "NPT", "ALMT", "MMT", "JT", "AWST", "JST", "ACST", "AEST", "LHST", "VUT", "NFT", "NZT", "CHAST", "PHOT", "LINT"];
dojo.date.timezoneOffsets = [-720, -660, -600, -570, -540, -480, -420, -360, -300, -240, -210, -180, -120, -60, 0, 60, 120, 180, 210, 240, 270, 300, 330, 345, 360, 390, 420, 480, 540, 570, 600, 630, 660, 690, 720, 765, 780, 840];
dojo.date.getDaysInMonth = function (dateObject) {
var month = dateObject.getMonth();
var days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
if (month == 1 && dojo.date.isLeapYear(dateObject)) {
return 29;
} else {
return days[month];
}
};
dojo.date.isLeapYear = function (dateObject) {
var year = dateObject.getFullYear();
return (year % 400 == 0) ? true : (year % 100 == 0) ? false : (year % 4 == 0) ? true : false;
};
dojo.date.getTimezoneName = function (dateObject) {
var str = dateObject.toString();
var tz = "";
var match;
var pos = str.indexOf("(");
if (pos > -1) {
pos++;
tz = str.substring(pos, str.indexOf(")"));
} else {
var pat = /([A-Z\/]+) \d{4}$/;
if ((match = str.match(pat))) {
tz = match[1];
} else {
str = dateObject.toLocaleString();
pat = / ([A-Z\/]+)$/;
if ((match = str.match(pat))) {
tz = match[1];
}
}
}
return tz == "AM" || tz == "PM" ? "" : tz;
};
dojo.date.getOrdinal = function (dateObject) {
var date = dateObject.getDate();
if (date % 100 != 11 && date % 10 == 1) {
return "st";
} else {
if (date % 100 != 12 && date % 10 == 2) {
return "nd";
} else {
if (date % 100 != 13 && date % 10 == 3) {
return "rd";
} else {
return "th";
}
}
}
};
dojo.date.compareTypes = {DATE:1, TIME:2};
dojo.date.compare = function (dateA, dateB, options) {
var dA = dateA;
var dB = dateB || new Date();
var now = new Date();
with (dojo.date.compareTypes) {
var opt = options || (DATE | TIME);
var d1 = new Date((opt & DATE) ? dA.getFullYear() : now.getFullYear(), (opt & DATE) ? dA.getMonth() : now.getMonth(), (opt & DATE) ? dA.getDate() : now.getDate(), (opt & TIME) ? dA.getHours() : 0, (opt & TIME) ? dA.getMinutes() : 0, (opt & TIME) ? dA.getSeconds() : 0);
var d2 = new Date((opt & DATE) ? dB.getFullYear() : now.getFullYear(), (opt & DATE) ? dB.getMonth() : now.getMonth(), (opt & DATE) ? dB.getDate() : now.getDate(), (opt & TIME) ? dB.getHours() : 0, (opt & TIME) ? dB.getMinutes() : 0, (opt & TIME) ? dB.getSeconds() : 0);
}
if (d1.valueOf() > d2.valueOf()) {
return 1;
}
if (d1.valueOf() < d2.valueOf()) {
return -1;
}
return 0;
};
dojo.date.dateParts = {YEAR:0, MONTH:1, DAY:2, HOUR:3, MINUTE:4, SECOND:5, MILLISECOND:6, QUARTER:7, WEEK:8, WEEKDAY:9};
dojo.date.add = function (dt, interv, incr) {
if (typeof dt == "number") {
dt = new Date(dt);
}
function fixOvershoot() {
if (sum.getDate() < dt.getDate()) {
sum.setDate(0);
}
}
var sum = new Date(dt);
with (dojo.date.dateParts) {
switch (interv) {
case YEAR:
sum.setFullYear(dt.getFullYear() + incr);
fixOvershoot();
break;
case QUARTER:
incr *= 3;
case MONTH:
sum.setMonth(dt.getMonth() + incr);
fixOvershoot();
break;
case WEEK:
incr *= 7;
case DAY:
sum.setDate(dt.getDate() + incr);
break;
case WEEKDAY:
var dat = dt.getDate();
var weeks = 0;
var days = 0;
var strt = 0;
var trgt = 0;
var adj = 0;
var mod = incr % 5;
if (mod == 0) {
days = (incr > 0) ? 5 : -5;
weeks = (incr > 0) ? ((incr - 5) / 5) : ((incr + 5) / 5);
} else {
days = mod;
weeks = parseInt(incr / 5);
}
strt = dt.getDay();
if (strt == 6 && incr > 0) {
adj = 1;
} else {
if (strt == 0 && incr < 0) {
adj = -1;
}
}
trgt = (strt + days);
if (trgt == 0 || trgt == 6) {
adj = (incr > 0) ? 2 : -2;
}
sum.setDate(dat + (7 * weeks) + days + adj);
break;
case HOUR:
sum.setHours(sum.getHours() + incr);
break;
case MINUTE:
sum.setMinutes(sum.getMinutes() + incr);
break;
case SECOND:
sum.setSeconds(sum.getSeconds() + incr);
break;
case MILLISECOND:
sum.setMilliseconds(sum.getMilliseconds() + incr);
break;
default:
break;
}
}
return sum;
};
dojo.date.diff = function (dtA, dtB, interv) {
if (typeof dtA == "number") {
dtA = new Date(dtA);
}
if (typeof dtB == "number") {
dtB = new Date(dtB);
}
var yeaDiff = dtB.getFullYear() - dtA.getFullYear();
var monDiff = (dtB.getMonth() - dtA.getMonth()) + (yeaDiff * 12);
var msDiff = dtB.getTime() - dtA.getTime();
var secDiff = msDiff / 1000;
var minDiff = secDiff / 60;
var houDiff = minDiff / 60;
var dayDiff = houDiff / 24;
var weeDiff = dayDiff / 7;
var delta = 0;
with (dojo.date.dateParts) {
switch (interv) {
case YEAR:
delta = yeaDiff;
break;
case QUARTER:
var mA = dtA.getMonth();
var mB = dtB.getMonth();
var qA = Math.floor(mA / 3) + 1;
var qB = Math.floor(mB / 3) + 1;
qB += (yeaDiff * 4);
delta = qB - qA;
break;
case MONTH:
delta = monDiff;
break;
case WEEK:
delta = parseInt(weeDiff);
break;
case DAY:
delta = dayDiff;
break;
case WEEKDAY:
var days = Math.round(dayDiff);
var weeks = parseInt(days / 7);
var mod = days % 7;
if (mod == 0) {
days = weeks * 5;
} else {
var adj = 0;
var aDay = dtA.getDay();
var bDay = dtB.getDay();
weeks = parseInt(days / 7);
mod = days % 7;
var dtMark = new Date(dtA);
dtMark.setDate(dtMark.getDate() + (weeks * 7));
var dayMark = dtMark.getDay();
if (dayDiff > 0) {
switch (true) {
case aDay == 6:
adj = -1;
break;
case aDay == 0:
adj = 0;
break;
case bDay == 6:
adj = -1;
break;
case bDay == 0:
adj = -2;
break;
case (dayMark + mod) > 5:
adj = -2;
break;
default:
break;
}
} else {
if (dayDiff < 0) {
switch (true) {
case aDay == 6:
adj = 0;
break;
case aDay == 0:
adj = 1;
break;
case bDay == 6:
adj = 2;
break;
case bDay == 0:
adj = 1;
break;
case (dayMark + mod) < 0:
adj = 2;
break;
default:
break;
}
}
}
days += adj;
days -= (weeks * 2);
}
delta = days;
break;
case HOUR:
delta = houDiff;
break;
case MINUTE:
delta = minDiff;
break;
case SECOND:
delta = secDiff;
break;
case MILLISECOND:
delta = msDiff;
break;
default:
break;
}
}
return Math.round(delta);
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/date/format.js
New file
0,0 → 1,711
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.date.format");
dojo.require("dojo.date.common");
dojo.require("dojo.date.supplemental");
dojo.require("dojo.lang.array");
dojo.require("dojo.lang.common");
dojo.require("dojo.lang.func");
dojo.require("dojo.string.common");
dojo.require("dojo.i18n.common");
dojo.requireLocalization("dojo.i18n.calendar", "gregorian", null, "de,en,es,fi,fr,hu,ja,it,ko,nl,pt,sv,zh,pt-br,zh-cn,zh-hk,zh-tw,ROOT");
dojo.requireLocalization("dojo.i18n.calendar", "gregorianExtras", null, "ja,zh,ROOT");
(function () {
dojo.date.format = function (dateObject, options) {
if (typeof options == "string") {
dojo.deprecated("dojo.date.format", "To format dates with POSIX-style strings, please use dojo.date.strftime instead", "0.5");
return dojo.date.strftime(dateObject, options);
}
function formatPattern(dateObject, pattern) {
return pattern.replace(/([a-z])\1*/ig, function (match) {
var s;
var c = match.charAt(0);
var l = match.length;
var pad;
var widthList = ["abbr", "wide", "narrow"];
switch (c) {
case "G":
if (l > 3) {
dojo.unimplemented("Era format not implemented");
}
s = info.eras[dateObject.getFullYear() < 0 ? 1 : 0];
break;
case "y":
s = dateObject.getFullYear();
switch (l) {
case 1:
break;
case 2:
s = String(s).substr(-2);
break;
default:
pad = true;
}
break;
case "Q":
case "q":
s = Math.ceil((dateObject.getMonth() + 1) / 3);
switch (l) {
case 1:
case 2:
pad = true;
break;
case 3:
case 4:
dojo.unimplemented("Quarter format not implemented");
}
break;
case "M":
case "L":
var m = dateObject.getMonth();
var width;
switch (l) {
case 1:
case 2:
s = m + 1;
pad = true;
break;
case 3:
case 4:
case 5:
width = widthList[l - 3];
break;
}
if (width) {
var type = (c == "L") ? "standalone" : "format";
var prop = ["months", type, width].join("-");
s = info[prop][m];
}
break;
case "w":
var firstDay = 0;
s = dojo.date.getWeekOfYear(dateObject, firstDay);
pad = true;
break;
case "d":
s = dateObject.getDate();
pad = true;
break;
case "D":
s = dojo.date.getDayOfYear(dateObject);
pad = true;
break;
case "E":
case "e":
case "c":
var d = dateObject.getDay();
var width;
switch (l) {
case 1:
case 2:
if (c == "e") {
var first = dojo.date.getFirstDayOfWeek(options.locale);
d = (d - first + 7) % 7;
}
if (c != "c") {
s = d + 1;
pad = true;
break;
}
case 3:
case 4:
case 5:
width = widthList[l - 3];
break;
}
if (width) {
var type = (c == "c") ? "standalone" : "format";
var prop = ["days", type, width].join("-");
s = info[prop][d];
}
break;
case "a":
var timePeriod = (dateObject.getHours() < 12) ? "am" : "pm";
s = info[timePeriod];
break;
case "h":
case "H":
case "K":
case "k":
var h = dateObject.getHours();
switch (c) {
case "h":
s = (h % 12) || 12;
break;
case "H":
s = h;
break;
case "K":
s = (h % 12);
break;
case "k":
s = h || 24;
break;
}
pad = true;
break;
case "m":
s = dateObject.getMinutes();
pad = true;
break;
case "s":
s = dateObject.getSeconds();
pad = true;
break;
case "S":
s = Math.round(dateObject.getMilliseconds() * Math.pow(10, l - 3));
break;
case "v":
case "z":
s = dojo.date.getTimezoneName(dateObject);
if (s) {
break;
}
l = 4;
case "Z":
var offset = dateObject.getTimezoneOffset();
var tz = [(offset <= 0 ? "+" : "-"), dojo.string.pad(Math.floor(Math.abs(offset) / 60), 2), dojo.string.pad(Math.abs(offset) % 60, 2)];
if (l == 4) {
tz.splice(0, 0, "GMT");
tz.splice(3, 0, ":");
}
s = tz.join("");
break;
case "Y":
case "u":
case "W":
case "F":
case "g":
case "A":
dojo.debug(match + " modifier not yet implemented");
s = "?";
break;
default:
dojo.raise("dojo.date.format: invalid pattern char: " + pattern);
}
if (pad) {
s = dojo.string.pad(s, l);
}
return s;
});
}
options = options || {};
var locale = dojo.hostenv.normalizeLocale(options.locale);
var formatLength = options.formatLength || "full";
var info = dojo.date._getGregorianBundle(locale);
var str = [];
var sauce = dojo.lang.curry(this, formatPattern, dateObject);
if (options.selector != "timeOnly") {
var datePattern = options.datePattern || info["dateFormat-" + formatLength];
if (datePattern) {
str.push(_processPattern(datePattern, sauce));
}
}
if (options.selector != "dateOnly") {
var timePattern = options.timePattern || info["timeFormat-" + formatLength];
if (timePattern) {
str.push(_processPattern(timePattern, sauce));
}
}
var result = str.join(" ");
return result;
};
dojo.date.parse = function (value, options) {
options = options || {};
var locale = dojo.hostenv.normalizeLocale(options.locale);
var info = dojo.date._getGregorianBundle(locale);
var formatLength = options.formatLength || "full";
if (!options.selector) {
options.selector = "dateOnly";
}
var datePattern = options.datePattern || info["dateFormat-" + formatLength];
var timePattern = options.timePattern || info["timeFormat-" + formatLength];
var pattern;
if (options.selector == "dateOnly") {
pattern = datePattern;
} else {
if (options.selector == "timeOnly") {
pattern = timePattern;
} else {
if (options.selector == "dateTime") {
pattern = datePattern + " " + timePattern;
} else {
var msg = "dojo.date.parse: Unknown selector param passed: '" + options.selector + "'.";
msg += " Defaulting to date pattern.";
dojo.debug(msg);
pattern = datePattern;
}
}
}
var groups = [];
var dateREString = _processPattern(pattern, dojo.lang.curry(this, _buildDateTimeRE, groups, info, options));
var dateRE = new RegExp("^" + dateREString + "$");
var match = dateRE.exec(value);
if (!match) {
return null;
}
var widthList = ["abbr", "wide", "narrow"];
var result = new Date(1972, 0);
var expected = {};
for (var i = 1; i < match.length; i++) {
var grp = groups[i - 1];
var l = grp.length;
var v = match[i];
switch (grp.charAt(0)) {
case "y":
if (l != 2) {
result.setFullYear(v);
expected.year = v;
} else {
if (v < 100) {
v = Number(v);
var year = "" + new Date().getFullYear();
var century = year.substring(0, 2) * 100;
var yearPart = Number(year.substring(2, 4));
var cutoff = Math.min(yearPart + 20, 99);
var num = (v < cutoff) ? century + v : century - 100 + v;
result.setFullYear(num);
expected.year = num;
} else {
if (options.strict) {
return null;
}
result.setFullYear(v);
expected.year = v;
}
}
break;
case "M":
if (l > 2) {
if (!options.strict) {
v = v.replace(/\./g, "");
v = v.toLowerCase();
}
var months = info["months-format-" + widthList[l - 3]].concat();
for (var j = 0; j < months.length; j++) {
if (!options.strict) {
months[j] = months[j].toLowerCase();
}
if (v == months[j]) {
result.setMonth(j);
expected.month = j;
break;
}
}
if (j == months.length) {
dojo.debug("dojo.date.parse: Could not parse month name: '" + v + "'.");
return null;
}
} else {
result.setMonth(v - 1);
expected.month = v - 1;
}
break;
case "E":
case "e":
if (!options.strict) {
v = v.toLowerCase();
}
var days = info["days-format-" + widthList[l - 3]].concat();
for (var j = 0; j < days.length; j++) {
if (!options.strict) {
days[j] = days[j].toLowerCase();
}
if (v == days[j]) {
break;
}
}
if (j == days.length) {
dojo.debug("dojo.date.parse: Could not parse weekday name: '" + v + "'.");
return null;
}
break;
case "d":
result.setDate(v);
expected.date = v;
break;
case "a":
var am = options.am || info.am;
var pm = options.pm || info.pm;
if (!options.strict) {
v = v.replace(/\./g, "").toLowerCase();
am = am.replace(/\./g, "").toLowerCase();
pm = pm.replace(/\./g, "").toLowerCase();
}
if (options.strict && v != am && v != pm) {
dojo.debug("dojo.date.parse: Could not parse am/pm part.");
return null;
}
var hours = result.getHours();
if (v == pm && hours < 12) {
result.setHours(hours + 12);
} else {
if (v == am && hours == 12) {
result.setHours(0);
}
}
break;
case "K":
if (v == 24) {
v = 0;
}
case "h":
case "H":
case "k":
if (v > 23) {
dojo.debug("dojo.date.parse: Illegal hours value");
return null;
}
result.setHours(v);
break;
case "m":
result.setMinutes(v);
break;
case "s":
result.setSeconds(v);
break;
case "S":
result.setMilliseconds(v);
break;
default:
dojo.unimplemented("dojo.date.parse: unsupported pattern char=" + grp.charAt(0));
}
}
if (expected.year && result.getFullYear() != expected.year) {
dojo.debug("Parsed year: '" + result.getFullYear() + "' did not match input year: '" + expected.year + "'.");
return null;
}
if (expected.month && result.getMonth() != expected.month) {
dojo.debug("Parsed month: '" + result.getMonth() + "' did not match input month: '" + expected.month + "'.");
return null;
}
if (expected.date && result.getDate() != expected.date) {
dojo.debug("Parsed day of month: '" + result.getDate() + "' did not match input day of month: '" + expected.date + "'.");
return null;
}
return result;
};
function _processPattern(pattern, applyPattern, applyLiteral, applyAll) {
var identity = function (x) {
return x;
};
applyPattern = applyPattern || identity;
applyLiteral = applyLiteral || identity;
applyAll = applyAll || identity;
var chunks = pattern.match(/(''|[^'])+/g);
var literal = false;
for (var i = 0; i < chunks.length; i++) {
if (!chunks[i]) {
chunks[i] = "";
} else {
chunks[i] = (literal ? applyLiteral : applyPattern)(chunks[i]);
literal = !literal;
}
}
return applyAll(chunks.join(""));
}
function _buildDateTimeRE(groups, info, options, pattern) {
return pattern.replace(/([a-z])\1*/ig, function (match) {
var s;
var c = match.charAt(0);
var l = match.length;
switch (c) {
case "y":
s = "\\d" + ((l == 2) ? "{2,4}" : "+");
break;
case "M":
s = (l > 2) ? "\\S+" : "\\d{1,2}";
break;
case "d":
s = "\\d{1,2}";
break;
case "E":
s = "\\S+";
break;
case "h":
case "H":
case "K":
case "k":
s = "\\d{1,2}";
break;
case "m":
case "s":
s = "[0-5]\\d";
break;
case "S":
s = "\\d{1,3}";
break;
case "a":
var am = options.am || info.am || "AM";
var pm = options.pm || info.pm || "PM";
if (options.strict) {
s = am + "|" + pm;
} else {
s = am;
s += (am != am.toLowerCase()) ? "|" + am.toLowerCase() : "";
s += "|";
s += (pm != pm.toLowerCase()) ? pm + "|" + pm.toLowerCase() : pm;
}
break;
default:
dojo.unimplemented("parse of date format, pattern=" + pattern);
}
if (groups) {
groups.push(match);
}
return "\\s*(" + s + ")\\s*";
});
}
})();
dojo.date.strftime = function (dateObject, format, locale) {
var padChar = null;
function _(s, n) {
return dojo.string.pad(s, n || 2, padChar || "0");
}
var info = dojo.date._getGregorianBundle(locale);
function $(property) {
switch (property) {
case "a":
return dojo.date.getDayShortName(dateObject, locale);
case "A":
return dojo.date.getDayName(dateObject, locale);
case "b":
case "h":
return dojo.date.getMonthShortName(dateObject, locale);
case "B":
return dojo.date.getMonthName(dateObject, locale);
case "c":
return dojo.date.format(dateObject, {locale:locale});
case "C":
return _(Math.floor(dateObject.getFullYear() / 100));
case "d":
return _(dateObject.getDate());
case "D":
return $("m") + "/" + $("d") + "/" + $("y");
case "e":
if (padChar == null) {
padChar = " ";
}
return _(dateObject.getDate());
case "f":
if (padChar == null) {
padChar = " ";
}
return _(dateObject.getMonth() + 1);
case "g":
break;
case "G":
dojo.unimplemented("unimplemented modifier 'G'");
break;
case "F":
return $("Y") + "-" + $("m") + "-" + $("d");
case "H":
return _(dateObject.getHours());
case "I":
return _(dateObject.getHours() % 12 || 12);
case "j":
return _(dojo.date.getDayOfYear(dateObject), 3);
case "k":
if (padChar == null) {
padChar = " ";
}
return _(dateObject.getHours());
case "l":
if (padChar == null) {
padChar = " ";
}
return _(dateObject.getHours() % 12 || 12);
case "m":
return _(dateObject.getMonth() + 1);
case "M":
return _(dateObject.getMinutes());
case "n":
return "\n";
case "p":
return info[dateObject.getHours() < 12 ? "am" : "pm"];
case "r":
return $("I") + ":" + $("M") + ":" + $("S") + " " + $("p");
case "R":
return $("H") + ":" + $("M");
case "S":
return _(dateObject.getSeconds());
case "t":
return "\t";
case "T":
return $("H") + ":" + $("M") + ":" + $("S");
case "u":
return String(dateObject.getDay() || 7);
case "U":
return _(dojo.date.getWeekOfYear(dateObject));
case "V":
return _(dojo.date.getIsoWeekOfYear(dateObject));
case "W":
return _(dojo.date.getWeekOfYear(dateObject, 1));
case "w":
return String(dateObject.getDay());
case "x":
return dojo.date.format(dateObject, {selector:"dateOnly", locale:locale});
case "X":
return dojo.date.format(dateObject, {selector:"timeOnly", locale:locale});
case "y":
return _(dateObject.getFullYear() % 100);
case "Y":
return String(dateObject.getFullYear());
case "z":
var timezoneOffset = dateObject.getTimezoneOffset();
return (timezoneOffset > 0 ? "-" : "+") + _(Math.floor(Math.abs(timezoneOffset) / 60)) + ":" + _(Math.abs(timezoneOffset) % 60);
case "Z":
return dojo.date.getTimezoneName(dateObject);
case "%":
return "%";
}
}
var string = "";
var i = 0;
var index = 0;
var switchCase = null;
while ((index = format.indexOf("%", i)) != -1) {
string += format.substring(i, index++);
switch (format.charAt(index++)) {
case "_":
padChar = " ";
break;
case "-":
padChar = "";
break;
case "0":
padChar = "0";
break;
case "^":
switchCase = "upper";
break;
case "*":
switchCase = "lower";
break;
case "#":
switchCase = "swap";
break;
default:
padChar = null;
index--;
break;
}
var property = $(format.charAt(index++));
switch (switchCase) {
case "upper":
property = property.toUpperCase();
break;
case "lower":
property = property.toLowerCase();
break;
case "swap":
var compareString = property.toLowerCase();
var swapString = "";
var j = 0;
var ch = "";
while (j < property.length) {
ch = property.charAt(j);
swapString += (ch == compareString.charAt(j)) ? ch.toUpperCase() : ch.toLowerCase();
j++;
}
property = swapString;
break;
default:
break;
}
switchCase = null;
string += property;
i = index;
}
string += format.substring(i);
return string;
};
(function () {
var _customFormats = [];
dojo.date.addCustomFormats = function (packageName, bundleName) {
_customFormats.push({pkg:packageName, name:bundleName});
};
dojo.date._getGregorianBundle = function (locale) {
var gregorian = {};
dojo.lang.forEach(_customFormats, function (desc) {
var bundle = dojo.i18n.getLocalization(desc.pkg, desc.name, locale);
gregorian = dojo.lang.mixin(gregorian, bundle);
}, this);
return gregorian;
};
})();
dojo.date.addCustomFormats("dojo.i18n.calendar", "gregorian");
dojo.date.addCustomFormats("dojo.i18n.calendar", "gregorianExtras");
dojo.date.getNames = function (item, type, use, locale) {
var label;
var lookup = dojo.date._getGregorianBundle(locale);
var props = [item, use, type];
if (use == "standAlone") {
label = lookup[props.join("-")];
}
props[1] = "format";
return (label || lookup[props.join("-")]).concat();
};
dojo.date.getDayName = function (dateObject, locale) {
return dojo.date.getNames("days", "wide", "format", locale)[dateObject.getDay()];
};
dojo.date.getDayShortName = function (dateObject, locale) {
return dojo.date.getNames("days", "abbr", "format", locale)[dateObject.getDay()];
};
dojo.date.getMonthName = function (dateObject, locale) {
return dojo.date.getNames("months", "wide", "format", locale)[dateObject.getMonth()];
};
dojo.date.getMonthShortName = function (dateObject, locale) {
return dojo.date.getNames("months", "abbr", "format", locale)[dateObject.getMonth()];
};
dojo.date.toRelativeString = function (dateObject) {
var now = new Date();
var diff = (now - dateObject) / 1000;
var end = " ago";
var future = false;
if (diff < 0) {
future = true;
end = " from now";
diff = -diff;
}
if (diff < 60) {
diff = Math.round(diff);
return diff + " second" + (diff == 1 ? "" : "s") + end;
}
if (diff < 60 * 60) {
diff = Math.round(diff / 60);
return diff + " minute" + (diff == 1 ? "" : "s") + end;
}
if (diff < 60 * 60 * 24) {
diff = Math.round(diff / 3600);
return diff + " hour" + (diff == 1 ? "" : "s") + end;
}
if (diff < 60 * 60 * 24 * 7) {
diff = Math.round(diff / (3600 * 24));
if (diff == 1) {
return future ? "Tomorrow" : "Yesterday";
} else {
return diff + " days" + end;
}
}
return dojo.date.format(dateObject);
};
dojo.date.toSql = function (dateObject, noTime) {
return dojo.date.strftime(dateObject, "%F" + !noTime ? " %T" : "");
};
dojo.date.fromSql = function (sqlDate) {
var parts = sqlDate.split(/[\- :]/g);
while (parts.length < 6) {
parts.push(0);
}
return new Date(parts[0], (parseInt(parts[1], 10) - 1), parts[2], parts[3], parts[4], parts[5]);
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/date/supplemental.js
New file
0,0 → 1,45
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.date.supplemental");
dojo.date.getFirstDayOfWeek = function (locale) {
var firstDay = {mv:5, ae:6, af:6, bh:6, dj:6, dz:6, eg:6, er:6, et:6, iq:6, ir:6, jo:6, ke:6, kw:6, lb:6, ly:6, ma:6, om:6, qa:6, sa:6, sd:6, so:6, tn:6, ye:6, as:0, au:0, az:0, bw:0, ca:0, cn:0, fo:0, ge:0, gl:0, gu:0, hk:0, ie:0, il:0, is:0, jm:0, jp:0, kg:0, kr:0, la:0, mh:0, mo:0, mp:0, mt:0, nz:0, ph:0, pk:0, sg:0, th:0, tt:0, tw:0, um:0, us:0, uz:0, vi:0, za:0, zw:0, et:0, mw:0, ng:0, tj:0, gb:0, sy:4};
locale = dojo.hostenv.normalizeLocale(locale);
var country = locale.split("-")[1];
var dow = firstDay[country];
return (typeof dow == "undefined") ? 1 : dow;
};
dojo.date.getWeekend = function (locale) {
var weekendStart = {eg:5, il:5, sy:5, "in":0, ae:4, bh:4, dz:4, iq:4, jo:4, kw:4, lb:4, ly:4, ma:4, om:4, qa:4, sa:4, sd:4, tn:4, ye:4};
var weekendEnd = {ae:5, bh:5, dz:5, iq:5, jo:5, kw:5, lb:5, ly:5, ma:5, om:5, qa:5, sa:5, sd:5, tn:5, ye:5, af:5, ir:5, eg:6, il:6, sy:6};
locale = dojo.hostenv.normalizeLocale(locale);
var country = locale.split("-")[1];
var start = weekendStart[country];
var end = weekendEnd[country];
if (typeof start == "undefined") {
start = 6;
}
if (typeof end == "undefined") {
end = 0;
}
return {start:start, end:end};
};
dojo.date.isWeekend = function (dateObj, locale) {
var weekend = dojo.date.getWeekend(locale);
var day = (dateObj || new Date()).getDay();
if (weekend.end < weekend.start) {
weekend.end += 7;
if (day < weekend.start) {
day += 7;
}
}
return day >= weekend.start && day <= weekend.end;
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/collections/SkipList.js
New file
0,0 → 1,167
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.collections.SkipList");
dojo.require("dojo.collections.Collections");
dojo.require("dojo.experimental");
dojo.experimental("dojo.collections.SkipList");
dojo.collections.SkipList = function () {
function node(height, val) {
this.value = val;
this.height = height;
this.nodes = new nodeList(height);
this.compare = function (val) {
if (this.value > val) {
return 1;
}
if (this.value < val) {
return -1;
}
return 0;
};
this.incrementHeight = function () {
this.nodes.incrementHeight();
this.height++;
};
this.decrementHeight = function () {
this.nodes.decrementHeight();
this.height--;
};
}
function nodeList(height) {
var arr = [];
this.height = height;
for (var i = 0; i < height; i++) {
arr[i] = null;
}
this.item = function (i) {
return arr[i];
};
this.incrementHeight = function () {
this.height++;
arr[this.height] = null;
};
this.decrementHeight = function () {
arr.splice(arr.length - 1, 1);
this.height--;
};
}
function iterator(list) {
this.element = list.head;
this.atEnd = function () {
return (this.element == null);
};
this.get = function () {
if (this.atEnd()) {
return null;
}
this.element = this.element.nodes[0];
return this.element;
};
this.reset = function () {
this.element = list.head;
};
}
function chooseRandomHeight(max) {
var level = 1;
while (Math.random() < PROB && level < max) {
level++;
}
return level;
}
var PROB = 0.5;
var comparisons = 0;
this.head = new node(1);
this.count = 0;
this.add = function (val) {
var updates = [];
var current = this.head;
for (var i = this.head.height; i >= 0; i--) {
if (!(current.nodes[i] != null && current.nodes[i].compare(val) < 0)) {
comparisons++;
}
while (current.nodes[i] != null && current.nodes[i].compare(val) < 0) {
current = current.nodes[i];
comparisons++;
}
updates[i] = current;
}
if (current.nodes[0] != null && current.nodes[0].compare(val) == 0) {
return;
}
var n = new node(val, chooseRandomHeight(this.head.height + 1));
this.count++;
if (n.height > this.head.height) {
this.head.incrementHeight();
this.head.nodes[this.head.height - 1] = n;
}
for (i = 0; i < n.height; i++) {
if (i < updates.length) {
n.nodes[i] = updates[i].nodes[i];
updates[i].nodes[i] = n;
}
}
};
this.contains = function (val) {
var current = this.head;
var i;
for (i = this.head.height - 1; i >= 0; i--) {
while (current.item(i) != null) {
comparisons++;
var result = current.nodes[i].compare(val);
if (result == 0) {
return true;
} else {
if (result < 0) {
current = current.nodes[i];
} else {
break;
}
}
}
}
return false;
};
this.getIterator = function () {
return new iterator(this);
};
this.remove = function (val) {
var updates = [];
var current = this.head;
for (var i = this.head.height - 1; i >= 0; i--) {
if (!(current.nodes[i] != null && current.nodes[i].compare(val) < 0)) {
comparisons++;
}
while (current.nodes[i] != null && current.nodes[i].compare(val) < 0) {
current = current.nodes[i];
comparisons++;
}
updates[i] = current;
}
current = current.nodes[0];
if (current != null && current.compare(val) == 0) {
this.count--;
for (var i = 0; i < this.head.height; i++) {
if (updates[i].nodes[i] != current) {
break;
} else {
updates[i].nodes[i] = current.nodes[i];
}
}
if (this.head.nodes[this.head.height - 1] == null) {
this.head.decrementHeight();
}
}
};
this.resetComparisons = function () {
comparisons = 0;
};
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/collections/BinaryTree.js
New file
0,0 → 1,255
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.collections.BinaryTree");
dojo.require("dojo.collections.Collections");
dojo.require("dojo.experimental");
dojo.experimental("dojo.collections.BinaryTree");
dojo.collections.BinaryTree = function (data) {
function node(data, rnode, lnode) {
this.value = data || null;
this.right = rnode || null;
this.left = lnode || null;
this.clone = function () {
var c = new node();
if (this.value.value) {
c.value = this.value.clone();
} else {
c.value = this.value;
}
if (this.left) {
c.left = this.left.clone();
}
if (this.right) {
c.right = this.right.clone();
}
};
this.compare = function (n) {
if (this.value > n.value) {
return 1;
}
if (this.value < n.value) {
return -1;
}
return 0;
};
this.compareData = function (d) {
if (this.value > d) {
return 1;
}
if (this.value < d) {
return -1;
}
return 0;
};
}
function inorderTraversalBuildup(current, a) {
if (current) {
inorderTraversalBuildup(current.left, a);
a.add(current);
inorderTraversalBuildup(current.right, a);
}
}
function preorderTraversal(current, sep) {
var s = "";
if (current) {
s = current.value.toString() + sep;
s += preorderTraversal(current.left, sep);
s += preorderTraversal(current.right, sep);
}
return s;
}
function inorderTraversal(current, sep) {
var s = "";
if (current) {
s = inorderTraversal(current.left, sep);
s += current.value.toString() + sep;
s += inorderTraversal(current.right, sep);
}
return s;
}
function postorderTraversal(current, sep) {
var s = "";
if (current) {
s = postorderTraversal(current.left, sep);
s += postorderTraversal(current.right, sep);
s += current.value.toString() + sep;
}
return s;
}
function searchHelper(current, data) {
if (!current) {
return null;
}
var i = current.compareData(data);
if (i == 0) {
return current;
}
if (i > 0) {
return searchHelper(current.left, data);
} else {
return searchHelper(current.right, data);
}
}
this.add = function (data) {
var n = new node(data);
var i;
var current = root;
var parent = null;
while (current) {
i = current.compare(n);
if (i == 0) {
return;
}
parent = current;
if (i > 0) {
current = current.left;
} else {
current = current.right;
}
}
this.count++;
if (!parent) {
root = n;
} else {
i = parent.compare(n);
if (i > 0) {
parent.left = n;
} else {
parent.right = n;
}
}
};
this.clear = function () {
root = null;
this.count = 0;
};
this.clone = function () {
var c = new dojo.collections.BinaryTree();
c.root = root.clone();
c.count = this.count;
return c;
};
this.contains = function (data) {
return this.search(data) != null;
};
this.deleteData = function (data) {
var current = root;
var parent = null;
var i = current.compareData(data);
while (i != 0 && current != null) {
if (i > 0) {
parent = current;
current = current.left;
} else {
if (i < 0) {
parent = current;
current = current.right;
}
}
i = current.compareData(data);
}
if (!current) {
return;
}
this.count--;
if (!current.right) {
if (!parent) {
root = current.left;
} else {
i = parent.compare(current);
if (i > 0) {
parent.left = current.left;
} else {
if (i < 0) {
parent.right = current.left;
}
}
}
} else {
if (!current.right.left) {
if (!parent) {
root = current.right;
} else {
i = parent.compare(current);
if (i > 0) {
parent.left = current.right;
} else {
if (i < 0) {
parent.right = current.right;
}
}
}
} else {
var leftmost = current.right.left;
var lmParent = current.right;
while (leftmost.left != null) {
lmParent = leftmost;
leftmost = leftmost.left;
}
lmParent.left = leftmost.right;
leftmost.left = current.left;
leftmost.right = current.right;
if (!parent) {
root = leftmost;
} else {
i = parent.compare(current);
if (i > 0) {
parent.left = leftmost;
} else {
if (i < 0) {
parent.right = leftmost;
}
}
}
}
}
};
this.getIterator = function () {
var a = [];
inorderTraversalBuildup(root, a);
return new dojo.collections.Iterator(a);
};
this.search = function (data) {
return searchHelper(root, data);
};
this.toString = function (order, sep) {
if (!order) {
var order = dojo.collections.BinaryTree.TraversalMethods.Inorder;
}
if (!sep) {
var sep = " ";
}
var s = "";
switch (order) {
case dojo.collections.BinaryTree.TraversalMethods.Preorder:
s = preorderTraversal(root, sep);
break;
case dojo.collections.BinaryTree.TraversalMethods.Inorder:
s = inorderTraversal(root, sep);
break;
case dojo.collections.BinaryTree.TraversalMethods.Postorder:
s = postorderTraversal(root, sep);
break;
}
if (s.length == 0) {
return "";
} else {
return s.substring(0, s.length - sep.length);
}
};
this.count = 0;
var root = this.root = null;
if (data) {
this.add(data);
}
};
dojo.collections.BinaryTree.TraversalMethods = {Preorder:1, Inorder:2, Postorder:3};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/collections/Queue.js
New file
0,0 → 1,65
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.collections.Queue");
dojo.require("dojo.collections.Collections");
dojo.collections.Queue = function (arr) {
var q = [];
if (arr) {
q = q.concat(arr);
}
this.count = q.length;
this.clear = function () {
q = [];
this.count = q.length;
};
this.clone = function () {
return new dojo.collections.Queue(q);
};
this.contains = function (o) {
for (var i = 0; i < q.length; i++) {
if (q[i] == o) {
return true;
}
}
return false;
};
this.copyTo = function (arr, i) {
arr.splice(i, 0, q);
};
this.dequeue = function () {
var r = q.shift();
this.count = q.length;
return r;
};
this.enqueue = function (o) {
this.count = q.push(o);
};
this.forEach = function (fn, scope) {
var s = scope || dj_global;
if (Array.forEach) {
Array.forEach(q, fn, s);
} else {
for (var i = 0; i < q.length; i++) {
fn.call(s, q[i], i, q);
}
}
};
this.getIterator = function () {
return new dojo.collections.Iterator(q);
};
this.peek = function () {
return q[0];
};
this.toArray = function () {
return [].concat(q);
};
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/collections/Dictionary.js
New file
0,0 → 1,99
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.collections.Dictionary");
dojo.require("dojo.collections.Collections");
dojo.collections.Dictionary = function (dictionary) {
var items = {};
this.count = 0;
var testObject = {};
this.add = function (k, v) {
var b = (k in items);
items[k] = new dojo.collections.DictionaryEntry(k, v);
if (!b) {
this.count++;
}
};
this.clear = function () {
items = {};
this.count = 0;
};
this.clone = function () {
return new dojo.collections.Dictionary(this);
};
this.contains = this.containsKey = function (k) {
if (testObject[k]) {
return false;
}
return (items[k] != null);
};
this.containsValue = function (v) {
var e = this.getIterator();
while (e.get()) {
if (e.element.value == v) {
return true;
}
}
return false;
};
this.entry = function (k) {
return items[k];
};
this.forEach = function (fn, scope) {
var a = [];
for (var p in items) {
if (!testObject[p]) {
a.push(items[p]);
}
}
var s = scope || dj_global;
if (Array.forEach) {
Array.forEach(a, fn, s);
} else {
for (var i = 0; i < a.length; i++) {
fn.call(s, a[i], i, a);
}
}
};
this.getKeyList = function () {
return (this.getIterator()).map(function (entry) {
return entry.key;
});
};
this.getValueList = function () {
return (this.getIterator()).map(function (entry) {
return entry.value;
});
};
this.item = function (k) {
if (k in items) {
return items[k].valueOf();
}
return undefined;
};
this.getIterator = function () {
return new dojo.collections.DictionaryIterator(items);
};
this.remove = function (k) {
if (k in items && !testObject[k]) {
delete items[k];
this.count--;
return true;
}
return false;
};
if (dictionary) {
var e = dictionary.getIterator();
while (e.get()) {
this.add(e.element.key, e.element.value);
}
}
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/collections/Stack.js
New file
0,0 → 1,65
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.collections.Stack");
dojo.require("dojo.collections.Collections");
dojo.collections.Stack = function (arr) {
var q = [];
if (arr) {
q = q.concat(arr);
}
this.count = q.length;
this.clear = function () {
q = [];
this.count = q.length;
};
this.clone = function () {
return new dojo.collections.Stack(q);
};
this.contains = function (o) {
for (var i = 0; i < q.length; i++) {
if (q[i] == o) {
return true;
}
}
return false;
};
this.copyTo = function (arr, i) {
arr.splice(i, 0, q);
};
this.forEach = function (fn, scope) {
var s = scope || dj_global;
if (Array.forEach) {
Array.forEach(q, fn, s);
} else {
for (var i = 0; i < q.length; i++) {
fn.call(s, q[i], i, q);
}
}
};
this.getIterator = function () {
return new dojo.collections.Iterator(q);
};
this.peek = function () {
return q[(q.length - 1)];
};
this.pop = function () {
var r = q.pop();
this.count = q.length;
return r;
};
this.push = function (o) {
this.count = q.push(o);
};
this.toArray = function () {
return [].concat(q);
};
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/collections/__package__.js
New file
0,0 → 1,13
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.kwCompoundRequire({common:["dojo.collections.Collections", "dojo.collections.SortedList", "dojo.collections.Dictionary", "dojo.collections.Queue", "dojo.collections.ArrayList", "dojo.collections.Stack", "dojo.collections.Set"]});
dojo.provide("dojo.collections.*");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/collections/ArrayList.js
New file
0,0 → 1,112
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.collections.ArrayList");
dojo.require("dojo.collections.Collections");
dojo.collections.ArrayList = function (arr) {
var items = [];
if (arr) {
items = items.concat(arr);
}
this.count = items.length;
this.add = function (obj) {
items.push(obj);
this.count = items.length;
};
this.addRange = function (a) {
if (a.getIterator) {
var e = a.getIterator();
while (!e.atEnd()) {
this.add(e.get());
}
this.count = items.length;
} else {
for (var i = 0; i < a.length; i++) {
items.push(a[i]);
}
this.count = items.length;
}
};
this.clear = function () {
items.splice(0, items.length);
this.count = 0;
};
this.clone = function () {
return new dojo.collections.ArrayList(items);
};
this.contains = function (obj) {
for (var i = 0; i < items.length; i++) {
if (items[i] == obj) {
return true;
}
}
return false;
};
this.forEach = function (fn, scope) {
var s = scope || dj_global;
if (Array.forEach) {
Array.forEach(items, fn, s);
} else {
for (var i = 0; i < items.length; i++) {
fn.call(s, items[i], i, items);
}
}
};
this.getIterator = function () {
return new dojo.collections.Iterator(items);
};
this.indexOf = function (obj) {
for (var i = 0; i < items.length; i++) {
if (items[i] == obj) {
return i;
}
}
return -1;
};
this.insert = function (i, obj) {
items.splice(i, 0, obj);
this.count = items.length;
};
this.item = function (i) {
return items[i];
};
this.remove = function (obj) {
var i = this.indexOf(obj);
if (i >= 0) {
items.splice(i, 1);
}
this.count = items.length;
};
this.removeAt = function (i) {
items.splice(i, 1);
this.count = items.length;
};
this.reverse = function () {
items.reverse();
};
this.sort = function (fn) {
if (fn) {
items.sort(fn);
} else {
items.sort();
}
};
this.setByIndex = function (i, obj) {
items[i] = obj;
this.count = items.length;
};
this.toArray = function () {
return [].concat(items);
};
this.toString = function (delim) {
return items.join((delim || ","));
};
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/collections/Set.js
New file
0,0 → 1,112
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.collections.Set");
dojo.require("dojo.collections.Collections");
dojo.require("dojo.collections.ArrayList");
dojo.collections.Set = new function () {
this.union = function (setA, setB) {
if (setA.constructor == Array) {
var setA = new dojo.collections.ArrayList(setA);
}
if (setB.constructor == Array) {
var setB = new dojo.collections.ArrayList(setB);
}
if (!setA.toArray || !setB.toArray) {
dojo.raise("Set operations can only be performed on array-based collections.");
}
var result = new dojo.collections.ArrayList(setA.toArray());
var e = setB.getIterator();
while (!e.atEnd()) {
var item = e.get();
if (!result.contains(item)) {
result.add(item);
}
}
return result;
};
this.intersection = function (setA, setB) {
if (setA.constructor == Array) {
var setA = new dojo.collections.ArrayList(setA);
}
if (setB.constructor == Array) {
var setB = new dojo.collections.ArrayList(setB);
}
if (!setA.toArray || !setB.toArray) {
dojo.raise("Set operations can only be performed on array-based collections.");
}
var result = new dojo.collections.ArrayList();
var e = setB.getIterator();
while (!e.atEnd()) {
var item = e.get();
if (setA.contains(item)) {
result.add(item);
}
}
return result;
};
this.difference = function (setA, setB) {
if (setA.constructor == Array) {
var setA = new dojo.collections.ArrayList(setA);
}
if (setB.constructor == Array) {
var setB = new dojo.collections.ArrayList(setB);
}
if (!setA.toArray || !setB.toArray) {
dojo.raise("Set operations can only be performed on array-based collections.");
}
var result = new dojo.collections.ArrayList();
var e = setA.getIterator();
while (!e.atEnd()) {
var item = e.get();
if (!setB.contains(item)) {
result.add(item);
}
}
return result;
};
this.isSubSet = function (setA, setB) {
if (setA.constructor == Array) {
var setA = new dojo.collections.ArrayList(setA);
}
if (setB.constructor == Array) {
var setB = new dojo.collections.ArrayList(setB);
}
if (!setA.toArray || !setB.toArray) {
dojo.raise("Set operations can only be performed on array-based collections.");
}
var e = setA.getIterator();
while (!e.atEnd()) {
if (!setB.contains(e.get())) {
return false;
}
}
return true;
};
this.isSuperSet = function (setA, setB) {
if (setA.constructor == Array) {
var setA = new dojo.collections.ArrayList(setA);
}
if (setB.constructor == Array) {
var setB = new dojo.collections.ArrayList(setB);
}
if (!setA.toArray || !setB.toArray) {
dojo.raise("Set operations can only be performed on array-based collections.");
}
var e = setB.getIterator();
while (!e.atEnd()) {
if (!setA.contains(e.get())) {
return false;
}
}
return true;
};
}();
 
/tags/Racine_livraison_narmer/api/js/dojo/src/collections/SortedList.js
New file
0,0 → 1,169
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.collections.SortedList");
dojo.require("dojo.collections.Collections");
dojo.collections.SortedList = function (dictionary) {
var _this = this;
var items = {};
var q = [];
var sorter = function (a, b) {
if (a.key > b.key) {
return 1;
}
if (a.key < b.key) {
return -1;
}
return 0;
};
var build = function () {
q = [];
var e = _this.getIterator();
while (!e.atEnd()) {
q.push(e.get());
}
q.sort(sorter);
};
var testObject = {};
this.count = q.length;
this.add = function (k, v) {
if (!items[k]) {
items[k] = new dojo.collections.DictionaryEntry(k, v);
this.count = q.push(items[k]);
q.sort(sorter);
}
};
this.clear = function () {
items = {};
q = [];
this.count = q.length;
};
this.clone = function () {
return new dojo.collections.SortedList(this);
};
this.contains = this.containsKey = function (k) {
if (testObject[k]) {
return false;
}
return (items[k] != null);
};
this.containsValue = function (o) {
var e = this.getIterator();
while (!e.atEnd()) {
var item = e.get();
if (item.value == o) {
return true;
}
}
return false;
};
this.copyTo = function (arr, i) {
var e = this.getIterator();
var idx = i;
while (!e.atEnd()) {
arr.splice(idx, 0, e.get());
idx++;
}
};
this.entry = function (k) {
return items[k];
};
this.forEach = function (fn, scope) {
var s = scope || dj_global;
if (Array.forEach) {
Array.forEach(q, fn, s);
} else {
for (var i = 0; i < q.length; i++) {
fn.call(s, q[i], i, q);
}
}
};
this.getByIndex = function (i) {
return q[i].valueOf();
};
this.getIterator = function () {
return new dojo.collections.DictionaryIterator(items);
};
this.getKey = function (i) {
return q[i].key;
};
this.getKeyList = function () {
var arr = [];
var e = this.getIterator();
while (!e.atEnd()) {
arr.push(e.get().key);
}
return arr;
};
this.getValueList = function () {
var arr = [];
var e = this.getIterator();
while (!e.atEnd()) {
arr.push(e.get().value);
}
return arr;
};
this.indexOfKey = function (k) {
for (var i = 0; i < q.length; i++) {
if (q[i].key == k) {
return i;
}
}
return -1;
};
this.indexOfValue = function (o) {
for (var i = 0; i < q.length; i++) {
if (q[i].value == o) {
return i;
}
}
return -1;
};
this.item = function (k) {
if (k in items && !testObject[k]) {
return items[k].valueOf();
}
return undefined;
};
this.remove = function (k) {
delete items[k];
build();
this.count = q.length;
};
this.removeAt = function (i) {
delete items[q[i].key];
build();
this.count = q.length;
};
this.replace = function (k, v) {
if (!items[k]) {
this.add(k, v);
return false;
} else {
items[k] = new dojo.collections.DictionaryEntry(k, v);
q.sort(sorter);
return true;
}
};
this.setByIndex = function (i, o) {
items[q[i].key].value = o;
build();
this.count = q.length;
};
if (dictionary) {
var e = dictionary.getIterator();
while (!e.atEnd()) {
var item = e.get();
q[q.length] = items[item.key] = new dojo.collections.DictionaryEntry(item.key, item.value);
}
q.sort(sorter);
}
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/collections/Store.js
New file
0,0 → 1,291
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.collections.Store");
dojo.require("dojo.lang.common");
dojo.collections.Store = function (jsonArray) {
var data = [];
var items = {};
this.keyField = "Id";
this.get = function () {
return data;
};
this.getByKey = function (key) {
return items[key];
};
this.getByIndex = function (idx) {
return data[idx];
};
this.getIndexOf = function (key) {
for (var i = 0; i < data.length; i++) {
if (data[i].key == key) {
return i;
}
}
return -1;
};
this.getData = function () {
var arr = [];
for (var i = 0; i < data.length; i++) {
arr.push(data[i].src);
}
return arr;
};
this.getDataByKey = function (key) {
if (items[key] != null) {
return items[key].src;
}
return null;
};
this.getIndexOfData = function (obj) {
for (var i = 0; i < data.length; i++) {
if (data[i].src == obj) {
return i;
}
}
return -1;
};
this.getDataByIndex = function (idx) {
if (data[idx]) {
return data[idx].src;
}
return null;
};
this.update = function (obj, fieldPath, val, bDontFire) {
var parts = fieldPath.split("."), i = 0, o = obj, field;
if (parts.length > 1) {
field = parts.pop();
do {
if (parts[i].indexOf("()") > -1) {
var temp = parts[i++].split("()")[0];
if (!o[temp]) {
dojo.raise("dojo.collections.Store.getField(obj, '" + field + "'): '" + temp + "' is not a property of the passed object.");
} else {
o = o[temp]();
}
} else {
o = o[parts[i++]];
}
} while (i < parts.length && o != null);
} else {
field = parts[0];
}
obj[field] = val;
if (!bDontFire) {
this.onUpdateField(obj, fieldPath, val);
}
};
this.forEach = function (fn) {
if (Array.forEach) {
Array.forEach(data, fn, this);
} else {
for (var i = 0; i < data.length; i++) {
fn.call(this, data[i]);
}
}
};
this.forEachData = function (fn) {
if (Array.forEach) {
Array.forEach(this.getData(), fn, this);
} else {
var a = this.getData();
for (var i = 0; i < a.length; i++) {
fn.call(this, a[i]);
}
}
};
this.setData = function (arr, bDontFire) {
data = [];
for (var i = 0; i < arr.length; i++) {
var o = {key:arr[i][this.keyField], src:arr[i]};
data.push(o);
items[o.key] = o;
}
if (!bDontFire) {
this.onSetData();
}
};
this.clearData = function (bDontFire) {
data = [];
items = {};
if (!bDontFire) {
this.onClearData();
}
};
this.addData = function (obj, key, bDontFire) {
var k = key || obj[this.keyField];
if (items[k] != null) {
var o = items[k];
o.src = obj;
} else {
var o = {key:k, src:obj};
data.push(o);
items[o.key] = o;
}
if (!bDontFire) {
this.onAddData(o);
}
};
this.addDataRange = function (arr, bDontFire) {
var objects = [];
for (var i = 0; i < arr.length; i++) {
var k = arr[i][this.keyField];
if (items[k] != null) {
var o = items[k];
o.src = arr[i];
} else {
var o = {key:k, src:arr[i]};
data.push(o);
items[k] = o;
}
objects.push(o);
}
if (!bDontFire) {
this.onAddDataRange(objects);
}
};
this.addDataByIndex = function (obj, idx, key, bDontFire) {
var k = key || obj[this.keyField];
if (items[k] != null) {
var i = this.getIndexOf(k);
var o = data.splice(i, 1);
o.src = obj;
} else {
var o = {key:k, src:obj};
items[k] = o;
}
data.splice(idx, 0, o);
if (!bDontFire) {
this.onAddData(o);
}
};
this.addDataRangeByIndex = function (arr, idx, bDontFire) {
var objects = [];
for (var i = 0; i < arr.length; i++) {
var k = arr[i][this.keyField];
if (items[k] != null) {
var j = this.getIndexOf(k);
var o = data.splice(j, 1);
o.src = arr[i];
} else {
var o = {key:k, src:arr[i]};
items[k] = o;
}
objects.push(o);
}
data.splice(idx, 0, objects);
if (!bDontFire) {
this.onAddDataRange(objects);
}
};
this.removeData = function (obj, bDontFire) {
var idx = -1;
var o = null;
for (var i = 0; i < data.length; i++) {
if (data[i].src == obj) {
idx = i;
o = data[i];
break;
}
}
if (!bDontFire) {
this.onRemoveData(o);
}
if (idx > -1) {
data.splice(idx, 1);
delete items[o.key];
}
};
this.removeDataRange = function (idx, range, bDontFire) {
var ret = data.splice(idx, range);
for (var i = 0; i < ret.length; i++) {
delete items[ret[i].key];
}
if (!bDontFire) {
this.onRemoveDataRange(ret);
}
return ret;
};
this.removeDataByKey = function (key, bDontFire) {
this.removeData(this.getDataByKey(key), bDontFire);
};
this.removeDataByIndex = function (idx, bDontFire) {
this.removeData(this.getDataByIndex(idx), bDontFire);
};
if (jsonArray && jsonArray.length && jsonArray[0]) {
this.setData(jsonArray, true);
}
};
dojo.extend(dojo.collections.Store, {getField:function (obj, field) {
var parts = field.split("."), i = 0, o = obj;
do {
if (parts[i].indexOf("()") > -1) {
var temp = parts[i++].split("()")[0];
if (!o[temp]) {
dojo.raise("dojo.collections.Store.getField(obj, '" + field + "'): '" + temp + "' is not a property of the passed object.");
} else {
o = o[temp]();
}
} else {
o = o[parts[i++]];
}
} while (i < parts.length && o != null);
if (i < parts.length) {
dojo.raise("dojo.collections.Store.getField(obj, '" + field + "'): '" + field + "' is not a property of the passed object.");
}
return o;
}, getFromHtml:function (meta, body, fnMod) {
var rows = body.rows;
var ctor = function (row) {
var obj = {};
for (var i = 0; i < meta.length; i++) {
var o = obj;
var data = row.cells[i].innerHTML;
var p = meta[i].getField();
if (p.indexOf(".") > -1) {
p = p.split(".");
while (p.length > 1) {
var pr = p.shift();
o[pr] = {};
o = o[pr];
}
p = p[0];
}
var type = meta[i].getType();
if (type == String) {
o[p] = data;
} else {
if (data) {
o[p] = new type(data);
} else {
o[p] = new type();
}
}
}
return obj;
};
var arr = [];
for (var i = 0; i < rows.length; i++) {
var o = ctor(rows[i]);
if (fnMod) {
fnMod(o, rows[i]);
}
arr.push(o);
}
return arr;
}, onSetData:function () {
}, onClearData:function () {
}, onAddData:function (obj) {
}, onAddDataRange:function (arr) {
}, onRemoveData:function (obj) {
}, onRemoveDataRange:function (arr) {
}, onUpdateField:function (obj, field, val) {
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/collections/Collections.js
New file
0,0 → 1,90
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.collections.Collections");
dojo.collections.DictionaryEntry = function (k, v) {
this.key = k;
this.value = v;
this.valueOf = function () {
return this.value;
};
this.toString = function () {
return String(this.value);
};
};
dojo.collections.Iterator = function (arr) {
var a = arr;
var position = 0;
this.element = a[position] || null;
this.atEnd = function () {
return (position >= a.length);
};
this.get = function () {
if (this.atEnd()) {
return null;
}
this.element = a[position++];
return this.element;
};
this.map = function (fn, scope) {
var s = scope || dj_global;
if (Array.map) {
return Array.map(a, fn, s);
} else {
var arr = [];
for (var i = 0; i < a.length; i++) {
arr.push(fn.call(s, a[i]));
}
return arr;
}
};
this.reset = function () {
position = 0;
this.element = a[position];
};
};
dojo.collections.DictionaryIterator = function (obj) {
var a = [];
var testObject = {};
for (var p in obj) {
if (!testObject[p]) {
a.push(obj[p]);
}
}
var position = 0;
this.element = a[position] || null;
this.atEnd = function () {
return (position >= a.length);
};
this.get = function () {
if (this.atEnd()) {
return null;
}
this.element = a[position++];
return this.element;
};
this.map = function (fn, scope) {
var s = scope || dj_global;
if (Array.map) {
return Array.map(a, fn, s);
} else {
var arr = [];
for (var i = 0; i < a.length; i++) {
arr.push(fn.call(s, a[i]));
}
return arr;
}
};
this.reset = function () {
position = 0;
this.element = a[position];
};
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/collections/Graph.js
New file
0,0 → 1,149
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.collections.Graph");
dojo.require("dojo.collections.Collections");
dojo.experimental("dojo.collections.Graph");
dojo.collections.Graph = function (nodes) {
function node(key, data, neighbors) {
this.key = key;
this.data = data;
this.neighbors = neighbors || new adjacencyList();
this.addDirected = function () {
if (arguments[0].constructor == edgeToNeighbor) {
this.neighbors.add(arguments[0]);
} else {
var n = arguments[0];
var cost = arguments[1] || 0;
this.neighbors.add(new edgeToNeighbor(n, cost));
}
};
}
function nodeList() {
var d = new dojo.collections.Dictionary();
function nodelistiterator() {
var o = [];
var e = d.getIterator();
while (e.get()) {
o[o.length] = e.element;
}
var position = 0;
this.element = o[position] || null;
this.atEnd = function () {
return (position >= o.length);
};
this.get = function () {
if (this.atEnd()) {
return null;
}
this.element = o[position++];
return this.element;
};
this.map = function (fn, scope) {
var s = scope || dj_global;
if (Array.map) {
return Array.map(o, fn, s);
} else {
var arr = [];
for (var i = 0; i < o.length; i++) {
arr.push(fn.call(s, o[i]));
}
return arr;
}
};
this.reset = function () {
position = 0;
this.element = o[position];
};
}
this.add = function (node) {
d.add(node.key, node);
};
this.clear = function () {
d.clear();
};
this.containsKey = function (key) {
return d.containsKey(key);
};
this.getIterator = function () {
return new nodelistiterator(this);
};
this.item = function (key) {
return d.item(key);
};
this.remove = function (node) {
d.remove(node.key);
};
}
function edgeToNeighbor(node, cost) {
this.neighbor = node;
this.cost = cost;
}
function adjacencyList() {
var d = [];
this.add = function (o) {
d.push(o);
};
this.item = function (i) {
return d[i];
};
this.getIterator = function () {
return new dojo.collections.Iterator([].concat(d));
};
}
this.nodes = nodes || new nodeList();
this.count = this.nodes.count;
this.clear = function () {
this.nodes.clear();
this.count = 0;
};
this.addNode = function () {
var n = arguments[0];
if (arguments.length > 1) {
n = new node(arguments[0], arguments[1]);
}
if (!this.nodes.containsKey(n.key)) {
this.nodes.add(n);
this.count++;
}
};
this.addDirectedEdge = function (uKey, vKey, cost) {
var uNode, vNode;
if (uKey.constructor != node) {
uNode = this.nodes.item(uKey);
vNode = this.nodes.item(vKey);
} else {
uNode = uKey;
vNode = vKey;
}
var c = cost || 0;
uNode.addDirected(vNode, c);
};
this.addUndirectedEdge = function (uKey, vKey, cost) {
var uNode, vNode;
if (uKey.constructor != node) {
uNode = this.nodes.item(uKey);
vNode = this.nodes.item(vKey);
} else {
uNode = uKey;
vNode = vKey;
}
var c = cost || 0;
uNode.addDirected(vNode, c);
vNode.addDirected(uNode, c);
};
this.contains = function (n) {
return this.nodes.containsKey(n.key);
};
this.containsKey = function (k) {
return this.nodes.containsKey(k);
};
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/namespaces/dojo.js
New file
0,0 → 1,163
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.namespaces.dojo");
dojo.require("dojo.ns");
 
(function(){
// Mapping of all widget short names to their full package names
// This is used for widget autoloading - no dojo.require() is necessary.
// If you use a widget in markup or create one dynamically, then this
// mapping is used to find and load any dependencies not already loaded.
// You should use your own namespace for any custom widgets.
// For extra widgets you use, dojo.declare() may be used to explicitly load them.
// Experimental and deprecated widgets are not included in this table
var map = {
html: {
"accordioncontainer": "dojo.widget.AccordionContainer",
"animatedpng": "dojo.widget.AnimatedPng",
"button": "dojo.widget.Button",
"chart": "dojo.widget.Chart",
"checkbox": "dojo.widget.Checkbox",
"clock": "dojo.widget.Clock",
"colorpalette": "dojo.widget.ColorPalette",
"combobox": "dojo.widget.ComboBox",
"combobutton": "dojo.widget.Button",
"contentpane": "dojo.widget.ContentPane",
"currencytextbox": "dojo.widget.CurrencyTextbox",
"datepicker": "dojo.widget.DatePicker",
"datetextbox": "dojo.widget.DateTextbox",
"debugconsole": "dojo.widget.DebugConsole",
"dialog": "dojo.widget.Dialog",
"dropdownbutton": "dojo.widget.Button",
"dropdowndatepicker": "dojo.widget.DropdownDatePicker",
"dropdowntimepicker": "dojo.widget.DropdownTimePicker",
"emaillisttextbox": "dojo.widget.InternetTextbox",
"emailtextbox": "dojo.widget.InternetTextbox",
"editor": "dojo.widget.Editor",
"editor2": "dojo.widget.Editor2",
"filteringtable": "dojo.widget.FilteringTable",
"fisheyelist": "dojo.widget.FisheyeList",
"fisheyelistitem": "dojo.widget.FisheyeList",
"floatingpane": "dojo.widget.FloatingPane",
"modalfloatingpane": "dojo.widget.FloatingPane",
"form": "dojo.widget.Form",
"googlemap": "dojo.widget.GoogleMap",
"inlineeditbox": "dojo.widget.InlineEditBox",
"integerspinner": "dojo.widget.Spinner",
"integertextbox": "dojo.widget.IntegerTextbox",
"ipaddresstextbox": "dojo.widget.InternetTextbox",
"layoutcontainer": "dojo.widget.LayoutContainer",
"linkpane": "dojo.widget.LinkPane",
"popupmenu2": "dojo.widget.Menu2",
"menuitem2": "dojo.widget.Menu2",
"menuseparator2": "dojo.widget.Menu2",
"menubar2": "dojo.widget.Menu2",
"menubaritem2": "dojo.widget.Menu2",
"pagecontainer": "dojo.widget.PageContainer",
"pagecontroller": "dojo.widget.PageContainer",
"popupcontainer": "dojo.widget.PopupContainer",
"progressbar": "dojo.widget.ProgressBar",
"radiogroup": "dojo.widget.RadioGroup",
"realnumbertextbox": "dojo.widget.RealNumberTextbox",
"regexptextbox": "dojo.widget.RegexpTextbox",
"repeater": "dojo.widget.Repeater",
"resizabletextarea": "dojo.widget.ResizableTextarea",
"richtext": "dojo.widget.RichText",
"select": "dojo.widget.Select",
"show": "dojo.widget.Show",
"showaction": "dojo.widget.ShowAction",
"showslide": "dojo.widget.ShowSlide",
"slidervertical": "dojo.widget.Slider",
"sliderhorizontal": "dojo.widget.Slider",
"slider":"dojo.widget.Slider",
"slideshow": "dojo.widget.SlideShow",
"sortabletable": "dojo.widget.SortableTable",
"splitcontainer": "dojo.widget.SplitContainer",
"tabcontainer": "dojo.widget.TabContainer",
"tabcontroller": "dojo.widget.TabContainer",
"taskbar": "dojo.widget.TaskBar",
"textbox": "dojo.widget.Textbox",
"timepicker": "dojo.widget.TimePicker",
"timetextbox": "dojo.widget.DateTextbox",
"titlepane": "dojo.widget.TitlePane",
"toaster": "dojo.widget.Toaster",
"toggler": "dojo.widget.Toggler",
"toolbar": "dojo.widget.Toolbar",
"toolbarcontainer": "dojo.widget.Toolbar",
"toolbaritem": "dojo.widget.Toolbar",
"toolbarbuttongroup": "dojo.widget.Toolbar",
"toolbarbutton": "dojo.widget.Toolbar",
"toolbardialog": "dojo.widget.Toolbar",
"toolbarmenu": "dojo.widget.Toolbar",
"toolbarseparator": "dojo.widget.Toolbar",
"toolbarspace": "dojo.widget.Toolbar",
"toolbarselect": "dojo.widget.Toolbar",
"toolbarcolordialog": "dojo.widget.Toolbar",
"tooltip": "dojo.widget.Tooltip",
"tree": "dojo.widget.Tree",
"treebasiccontroller": "dojo.widget.TreeBasicController",
"treecontextmenu": "dojo.widget.TreeContextMenu",
"treedisablewrapextension": "dojo.widget.TreeDisableWrapExtension",
"treedociconextension": "dojo.widget.TreeDocIconExtension",
"treeeditor": "dojo.widget.TreeEditor",
"treeemphasizeonselect": "dojo.widget.TreeEmphasizeOnSelect",
"treeexpandtonodeonselect": "dojo.widget.TreeExpandToNodeOnSelect",
"treelinkextension": "dojo.widget.TreeLinkExtension",
"treeloadingcontroller": "dojo.widget.TreeLoadingController",
"treemenuitem": "dojo.widget.TreeContextMenu",
"treenode": "dojo.widget.TreeNode",
"treerpccontroller": "dojo.widget.TreeRPCController",
"treeselector": "dojo.widget.TreeSelector",
"treetoggleonselect": "dojo.widget.TreeToggleOnSelect",
"treev3": "dojo.widget.TreeV3",
"treebasiccontrollerv3": "dojo.widget.TreeBasicControllerV3",
"treecontextmenuv3": "dojo.widget.TreeContextMenuV3",
"treedndcontrollerv3": "dojo.widget.TreeDndControllerV3",
"treeloadingcontrollerv3": "dojo.widget.TreeLoadingControllerV3",
"treemenuitemv3": "dojo.widget.TreeContextMenuV3",
"treerpccontrollerv3": "dojo.widget.TreeRpcControllerV3",
"treeselectorv3": "dojo.widget.TreeSelectorV3",
"urltextbox": "dojo.widget.InternetTextbox",
"usphonenumbertextbox": "dojo.widget.UsTextbox",
"ussocialsecuritynumbertextbox": "dojo.widget.UsTextbox",
"usstatetextbox": "dojo.widget.UsTextbox",
"usziptextbox": "dojo.widget.UsTextbox",
"validationtextbox": "dojo.widget.ValidationTextbox",
"treeloadingcontroller": "dojo.widget.TreeLoadingController",
"wizardcontainer": "dojo.widget.Wizard",
"wizardpane": "dojo.widget.Wizard",
"yahoomap": "dojo.widget.YahooMap"
},
svg: {
"chart": "dojo.widget.svg.Chart"
},
vml: {
"chart": "dojo.widget.vml.Chart"
}
};
 
dojo.addDojoNamespaceMapping = function(/*String*/shortName, /*String*/packageName){
// summary:
// Add an entry to the mapping table for the dojo: namespace
//
// shortName: the name to be used as the widget's tag name in the dojo: namespace
// packageName: the path to the Javascript module in dotted package notation
map[shortName]=packageName;
};
function dojoNamespaceResolver(name, domain){
if(!domain){ domain="html"; }
if(!map[domain]){ return null; }
return map[domain][name];
}
 
dojo.registerNamespaceResolver("dojo", dojoNamespaceResolver);
})();
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/currency.js
New file
0,0 → 1,136
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.i18n.currency");
dojo.require("dojo.experimental");
dojo.experimental("dojo.i18n.currency");
dojo.require("dojo.regexp");
dojo.require("dojo.i18n.common");
dojo.require("dojo.i18n.number");
dojo.require("dojo.lang.common");
dojo.i18n.currency.format = function (value, iso, flags, locale) {
flags = (typeof flags == "object") ? flags : {};
var formatData = dojo.i18n.currency._mapToLocalizedFormatData(dojo.i18n.currency.FORMAT_TABLE, iso, locale);
if (typeof flags.places == "undefined") {
flags.places = formatData.places;
}
if (typeof flags.places == "undefined") {
flags.places = 2;
}
flags.signed = false;
var result = dojo.i18n.number.format(value, flags, locale);
var sym = formatData.symbol;
if (formatData.adjSpace == "symbol") {
if (formatData.placement == "after") {
sym = " " + sym;
} else {
sym = sym + " ";
}
}
if (value < 0) {
if (formatData.signPlacement == "before") {
sym = "-" + sym;
} else {
if (formatData.signPlacement == "after") {
sym = sym + "-";
}
}
}
var spc = (formatData.adjSpace == "number") ? " " : "";
if (formatData.placement == "after") {
result = result + spc + sym;
} else {
result = sym + spc + result;
}
if (value < 0) {
if (formatData.signPlacement == "around") {
result = "(" + result + ")";
} else {
if (formatData.signPlacement == "end") {
result = result + "-";
} else {
if (!formatData.signPlacement || formatData.signPlacement == "begin") {
result = "-" + result;
}
}
}
}
return result;
};
dojo.i18n.currency.parse = function (value, iso, locale, flags) {
if (typeof flags.validate == "undefined") {
flags.validate = true;
}
if (flags.validate && !dojo.i18n.number.isCurrency(value, iso, locale, flags)) {
return Number.NaN;
}
var sign = (value.indexOf("-") != -1);
var abs = abs.replace(/\-/, "");
var formatData = dojo.i18n.currency._mapToLocalizedFormatData(dojo.i18n.currency.FORMAT_TABLE, iso, locale);
abs = abs.replace(new RegExp("\\" + formatData.symbol), "");
var number = dojo.i18n.number.parse(abs, locale, flags);
if (sign) {
number = number * -1;
}
return number;
};
dojo.i18n.currency.isCurrency = function (value, iso, locale, flags) {
flags = (typeof flags == "object") ? flags : {};
var numberFormatData = dojo.i18n.number._mapToLocalizedFormatData(dojo.i18n.number.FORMAT_TABLE, locale);
if (typeof flags.separator == "undefined") {
flags.separator = numberFormatData[0];
} else {
if (dojo.lang.isArray(flags.separator) && flags.separator.length == 0) {
flags.separator = [numberFormatData[0], ""];
}
}
if (typeof flags.decimal == "undefined") {
flags.decimal = numberFormatData[2];
}
if (typeof flags.groupSize == "undefined") {
flags.groupSize = numberFormatData[3];
}
if (typeof flags.groupSize2 == "undefined") {
flags.groupSize2 = numberFormatData[4];
}
var formatData = dojo.i18n.currency._mapToLocalizedFormatData(dojo.i18n.currency.FORMAT_TABLE, iso, locale);
if (typeof flags.places == "undefined") {
flags.places = formatData.places;
}
if (typeof flags.places == "undefined") {
flags.places = 2;
}
if (typeof flags.symbol == "undefined") {
flags.symbol = formatData.symbol;
} else {
if (dojo.lang.isArray(flags.symbol) && flags.symbol.length == 0) {
flags.symbol = [formatData.symbol, ""];
}
}
if (typeof flags.placement == "undefined") {
flags.placement = formatData.placement;
}
var re = new RegExp("^" + dojo.regexp.currency(flags) + "$");
return re.test(value);
};
dojo.i18n.currency._mapToLocalizedFormatData = function (table, iso, locale) {
var formatData = dojo.i18n.currency.FORMAT_TABLE[iso];
if (!dojo.lang.isArray(formatData)) {
return formatData;
}
return dojo.i18n.number._mapToLocalizedFormatData(formatData[0], locale);
};
(function () {
var arabic = {symbol:"\u062c", placement:"after", htmlSymbol:"?"};
var euro = {symbol:"\u20ac", placement:"before", adjSpace:"symbol", htmlSymbol:"&euro;"};
var euroAfter = {symbol:"\u20ac", placement:"after", htmlSymbol:"&euro;"};
dojo.i18n.currency.FORMAT_TABLE = {AED:{symbol:"\u062c", placement:"after"}, ARS:{symbol:"$", signPlacement:"after"}, ATS:{symbol:"\u20ac", adjSpace:"number", signPlacement:"after", htmlSymbol:"&euro;"}, AUD:{symbol:"$"}, BOB:{symbol:"$b"}, BRL:{symbol:"R$", adjSpace:"symbol"}, BEF:euroAfter, BHD:arabic, CAD:[{"*":{symbol:"$"}, "fr-ca":{symbol:"$", placement:"after", signPlacement:"around"}}], CHF:{symbol:"CHF", adjSpace:"symbol", signPlacement:"after"}, CLP:{symbol:"$"}, COP:{symbol:"$", signPlacement:"around"}, CNY:{symbol:"\xa5", htmlSymbol:"&yen;"}, CRC:{symbol:"\u20a1", signPlacement:"after", htmlSymbol:"?"}, CZK:{symbol:"Kc", adjSpace:"symbol", signPlacement:"after"}, DEM:euroAfter, DKK:{symbol:"kr.", adjSpace:"symbol", signPlacement:"after"}, DOP:{symbol:"$"}, DZD:arabic, ECS:{symbol:"$", signPlacement:"after"}, EGP:arabic, ESP:euroAfter, EUR:euro, FIM:euroAfter, FRF:euroAfter, GBP:{symbol:"\xa3", htmlSymbol:"&pound;"}, GRD:{symbol:"\u20ac", signPlacement:"end", htmlSymbol:"&euro;"}, GTQ:{symbol:"Q", signPlacement:"after"}, HKD:{symbol:"HK$"}, HNL:{symbol:"L.", signPlacement:"end"}, HUF:{symbol:"Ft", placement:"after", adjSpace:"symbol"}, IEP:{symbol:"\u20ac", htmlSymbol:"&euro;"}, ILS:{symbol:"\u05e9\"\u05d7", placement:"after", htmlSymbol:"?"}, INR:{symbol:"Rs."}, ITL:{symbol:"\u20ac", signPlacement:"after", htmlSymbol:"&euro;"}, JOD:arabic, JPY:{symbol:"\xa5", places:0, htmlSymbol:"&yen;"}, KRW:{symbol:"\u20a9", places:0, htmlSymbol:"?"}, KWD:arabic, LBP:arabic, LUF:euroAfter, MAD:arabic, MXN:{symbol:"$", signPlacement:"around"}, NIO:{symbol:"C$", adjSpace:"symbol", signPlacement:"after"}, NLG:{symbol:"\u20ac", signPlacement:"end", htmlSymbol:"&euro;"}, NOK:{symbol:"kr", adjSpace:"symbol", signPlacement:"after"}, NZD:{symbol:"$"}, OMR:arabic, PAB:{symbol:"B/", adjSpace:"symbol", signPlacement:"after"}, PEN:{symbol:"S/", signPlacement:"after"}, PLN:{symbol:"z", placement:"after"}, PTE:euroAfter, PYG:{symbol:"Gs.", signPlacement:"after"}, QAR:arabic, RUR:{symbol:"rub.", placement:"after"}, SAR:arabic, SEK:{symbol:"kr", placement:"after", adjSpace:"symbol"}, SGD:{symbol:"$"}, SVC:{symbol:"\u20a1", signPlacement:"after", adjSpace:"symbol"}, SYP:arabic, TND:arabic, TRL:{symbol:"TL", placement:"after"}, TWD:{symbol:"NT$"}, USD:{symbol:"$"}, UYU:{symbol:"$U", signplacement:"after", adjSpace:"symbol"}, VEB:{symbol:"Bs", signplacement:"after", adjSpace:"symbol"}, YER:arabic, ZAR:{symbol:"R", signPlacement:"around"}};
})();
 
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/calendar/nls/en/gregorian.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"months-standAlone-narrow":["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"], "dateFormat-long":"MMMM d, yyyy", "timeFormat-full":"h:mm:ss a v", "eras":["BC", "AD"], "timeFormat-medium":"h:mm:ss a", "dateFormat-medium":"MMM d, yyyy", "months-format-abbr":["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], "dateFormat-full":"EEEE, MMMM d, yyyy", "days-format-abbr":["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], "timeFormat-long":"h:mm:ss a z", "timeFormat-short":"h:mm a", "dateFormat-short":"M/d/yy", "months-format-wide":["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], "days-standAlone-narrow":["S", "M", "T", "W", "T", "F", "S"], "days-format-wide":["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], "field-weekday":"Day of the Week", "field-second":"Second", "field-week":"Week", "pm":"PM", "am":"AM", "field-year":"Year", "field-minute":"Minute", "field-hour":"Hour", "field-day":"Day", "field-dayperiod":"Dayperiod", "field-month":"Month", "field-era":"Era", "field-zone":"Zone"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/calendar/nls/es/gregorian.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"field-weekday":"d\xeda de la semana", "dateFormat-medium":"dd-MMM-yy", "field-second":"segundo", "field-week":"semana", "pm":"p.m.", "timeFormat-full":"HH'H'mm''ss\" z", "months-standAlone-narrow":["E", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"], "am":"a.m.", "days-standAlone-narrow":["D", "L", "M", "M", "J", "V", "S"], "field-year":"a\xf1o", "eras":["a.C.", "d.C."], "field-minute":"minuto", "field-hour":"hora", "dateFormat-long":"d' de 'MMMM' de 'yyyy", "field-day":"d\xeda", "field-dayperiod":"periodo del d\xeda", "field-month":"mes", "dateFormat-short":"d/MM/yy", "months-format-wide":["enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"], "field-era":"era", "months-format-abbr":["ene", "feb", "mar", "abr", "may", "jun", "jul", "ago", "sep", "oct", "nov", "dic"], "days-format-wide":["domingo", "lunes", "martes", "mi\xe9rcoles", "jueves", "viernes", "s\xe1bado"], "dateFormat-full":"EEEE d' de 'MMMM' de 'yyyy", "field-zone":"zona", "days-format-abbr":["dom", "lun", "mar", "mi\xe9", "jue", "vie", "s\xe1b"], "timeFormat-medium":"HH:mm:ss", "timeFormat-short":"HH:mm", "timeFormat-long":"HH:mm:ss z"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/calendar/nls/fr/gregorian.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"field-weekday":"jour de la semaine", "dateFormat-medium":"d MMM yy", "field-second":"seconde", "field-week":"semaine", "pm":"ap. m.", "timeFormat-full":"HH' h 'mm z", "months-standAlone-narrow":["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"], "am":"matin", "days-standAlone-narrow":["D", "L", "M", "M", "J", "V", "S"], "field-year":"ann\xe9e", "eras":["av. J.-C.", "apr. J.-C."], "field-minute":"minute", "field-hour":"heure", "dateFormat-long":"d MMMM yyyy", "field-day":"jour", "field-dayperiod":"p\xe9riode de la journ\xe9e", "field-month":"mois", "dateFormat-short":"dd/MM/yy", "months-format-wide":["janvier", "f\xe9vrier", "mars", "avril", "mai", "juin", "juillet", "ao\xfbt", "septembre", "octobre", "novembre", "d\xe9cembre"], "field-era":"\xe9poque", "months-format-abbr":["janv.", "f\xe9vr.", "mars", "avr.", "mai", "juin", "juil.", "ao\xfbt", "sept.", "oct.", "nov.", "d\xe9c."], "days-format-wide":["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"], "dateFormat-full":"EEEE d MMMM yyyy", "field-zone":"zone", "days-format-abbr":["dim.", "lun.", "mar.", "mer.", "jeu.", "ven.", "sam."], "timeFormat-medium":"HH:mm:ss", "timeFormat-short":"HH:mm", "timeFormat-long":"HH:mm:ss z"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/calendar/nls/zh-tw/gregorian.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"dateFormat-medium":"yyyy'\u5e74'M'\u6708'd'\u65e5'", "field-second":"\u79d2", "field-week":"\u9031", "timeFormat-full":"ahh'\u6642'mm'\u5206'ss'\u79d2' z", "eras":["\u897f\u5143\u524d", "\u897f\u5143"], "field-year":"\u5e74", "field-minute":"\u5206\u9418", "timeFormat-medium":"ahh:mm:ss", "field-hour":"\u5c0f\u6642", "dateFormat-long":"yyyy'\u5e74'M'\u6708'd'\u65e5'", "field-day":"\u6574\u65e5", "field-dayperiod":"\u65e5\u9593", "field-month":"\u6708", "dateFormat-short":"yy'\u5e74'M'\u6708'd'\u65e5'", "field-era":"\u5e74\u4ee3", "timeFormat-short":"ah:mm", "months-format-abbr":["1\u6708", "2\u6708", "3\u6708", "4\u6708", "5\u6708", "6\u6708", "7\u6708", "8\u6708", "9\u6708", "10\u6708", "11\u6708", "12\u6708"], "timeFormat-long":"ahh'\u6642'mm'\u5206'ss'\u79d2'", "field-weekday":"\u9031\u5929", "dateFormat-full":"yyyy'\u5e74'M'\u6708'd'\u65e5'EEEE", "field-zone":"\u5340\u57df", "days-standAlone-narrow":["\u65e5", "\u4e00", "\u4e8c", "\u4e09", "\u56db", "\u4e94", "\u516d"], "am":"\u4e0a\u5348", "days-format-abbr":["\u5468\u65e5", "\u5468\u4e00", "\u5468\u4e8c", "\u5468\u4e09", "\u5468\u56db", "\u5468\u4e94", "\u5468\u516d"], "pm":"\u4e0b\u5348", "months-format-wide":["\u4e00\u6708", "\u4e8c\u6708", "\u4e09\u6708", "\u56db\u6708", "\u4e94\u6708", "\u516d\u6708", "\u4e03\u6708", "\u516b\u6708", "\u4e5d\u6708", "\u5341\u6708", "\u5341\u4e00\u6708", "\u5341\u4e8c\u6708"], "months-standAlone-narrow":["1\u6708", "2\u6708", "3\u6708", "4\u6708", "5\u6708", "6\u6708", "7\u6708", "8\u6708", "9\u6708", "10\u6708", "11\u6708", "12\u6708"], "days-format-wide":["\u661f\u671f\u65e5", "\u661f\u671f\u4e00", "\u661f\u671f\u4e8c", "\u661f\u671f\u4e09", "\u661f\u671f\u56db", "\u661f\u671f\u4e94", "\u661f\u671f\u516d"]})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/calendar/nls/ko/gregorian.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"months-standAlone-narrow":["1\uc6d4", "2\uc6d4", "3\uc6d4", "4\uc6d4", "5\uc6d4", "6\uc6d4", "7\uc6d4", "8\uc6d4", "9\uc6d4", "10\uc6d4", "11\uc6d4", "12\uc6d4"], "dateFormat-long":"yyyy'\ub144' M'\uc6d4' d'\uc77c'", "timeFormat-full":"a hh'\uc2dc' mm'\ubd84' ss'\ucd08' z", "eras":["\uae30\uc6d0\uc804", "\uc11c\uae30"], "timeFormat-medium":"a hh'\uc2dc' mm'\ubd84'", "dateFormat-medium":"yyyy. MM. dd", "am":"\uc624\uc804", "months-format-abbr":["1\uc6d4", "2\uc6d4", "3\uc6d4", "4\uc6d4", "5\uc6d4", "6\uc6d4", "7\uc6d4", "8\uc6d4", "9\uc6d4", "10\uc6d4", "11\uc6d4", "12\uc6d4"], "dateFormat-full":"yyyy'\ub144' M'\uc6d4' d'\uc77c' EEEE", "days-format-abbr":["\uc77c", "\uc6d4", "\ud654", "\uc218", "\ubaa9", "\uae08", "\ud1a0"], "timeFormat-long":"a hh'\uc2dc' mm'\ubd84' ss'\ucd08'", "timeFormat-short":"a hh'\uc2dc' mm'\ubd84'", "dateFormat-short":"yy. MM. dd", "pm":"\uc624\ud6c4", "months-format-wide":["1\uc6d4", "2\uc6d4", "3\uc6d4", "4\uc6d4", "5\uc6d4", "6\uc6d4", "7\uc6d4", "8\uc6d4", "9\uc6d4", "10\uc6d4", "11\uc6d4", "12\uc6d4"], "days-standAlone-narrow":["\uc77c", "\uc6d4", "\ud654", "\uc218", "\ubaa9", "\uae08", "\ud1a0"], "days-format-wide":["\uc77c\uc694\uc77c", "\uc6d4\uc694\uc77c", "\ud654\uc694\uc77c", "\uc218\uc694\uc77c", "\ubaa9\uc694\uc77c", "\uae08\uc694\uc77c", "\ud1a0\uc694\uc77c"], "field-weekday":"Day of the Week", "field-second":"Second", "field-week":"Week", "field-year":"Year", "field-minute":"Minute", "field-hour":"Hour", "field-day":"Day", "field-dayperiod":"Dayperiod", "field-month":"Month", "field-era":"Era", "field-zone":"Zone"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/calendar/nls/nl/gregorian.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"dateFormat-medium":"d MMM yyyy", "field-second":"Seconde", "timeFormat-full":"HH:mm:ss v", "months-standAlone-narrow":["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"], "days-standAlone-narrow":["Z", "M", "D", "W", "D", "V", "Z"], "field-year":"Jaar", "eras":["v. Chr.", "n. Chr."], "field-minute":"Minuut", "field-hour":"Uur", "dateFormat-long":"d MMMM yyyy", "field-day":"Dag", "field-dayperiod":"Dagdeel", "field-month":"Maand", "dateFormat-short":"dd-MM-yy", "months-format-wide":["januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december"], "field-era":"Tijdperk", "months-format-abbr":["jan", "feb", "mrt", "apr", "mei", "jun", "jul", "aug", "sep", "okt", "nov", "dec"], "days-format-wide":["zondag", "maandag", "dinsdag", "woensdag", "donderdag", "vrijdag", "zaterdag"], "dateFormat-full":"EEEE d MMMM yyyy", "days-format-abbr":["zo", "ma", "di", "wo", "do", "vr", "za"], "field-weekday":"Dag van de week", "field-week":"Week", "pm":"PM", "am":"AM", "timeFormat-medium":"HH:mm:ss", "timeFormat-short":"HH:mm", "timeFormat-long":"HH:mm:ss z", "field-zone":"Zone"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/calendar/nls/hu/gregorian.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"field-weekday":"h\xe9t napja", "dateFormat-medium":"yyyy MMM d", "field-second":"m\xe1sodperc", "field-week":"h\xe9t", "pm":"d.u.", "timeFormat-full":"h:mm:ss a v", "months-standAlone-narrow":["J", "F", "M", "\xc1", "M", "J", "J", "A", "S", "O", "N", "D"], "am":"d.e.", "days-standAlone-narrow":["V", "H", "K", "Sz", "Cs", "P", "Sz"], "field-year":"\xe9v", "eras":["k.e.", "k.u."], "field-minute":"perc", "timeFormat-medium":"h:mm:ss a", "field-hour":"\xf3ra", "dateFormat-long":"yyyy MMMM d", "field-day":"nap", "field-dayperiod":"napszak", "field-month":"h\xf3nap", "dateFormat-short":"yyyy-M-d", "months-format-wide":["janu\xe1r", "febru\xe1r", "m\xe1rcius", "\xe1prilis", "m\xe1jus", "j\xfanius", "j\xfalius", "augusztus", "szeptember", "okt\xf3ber", "november", "december"], "field-era":"\xe9ra", "timeFormat-short":"h:mm a", "months-format-abbr":["jan", "feb", "m\xe1r", "apr", "m\xe1j", "j\xfan", "j\xfal", "aug", "sze", "okt", "nov", "dec"], "timeFormat-long":"h:mm:ss a z", "days-format-wide":["vas\xe1rnap", "h\xe9tf\u0151", "kedd", "szerda", "cs\xfct\xf6rt\xf6k", "p\xe9ntek", "szombat"], "dateFormat-full":"yyyy MMMM d, EEEE", "field-zone":"z\xf3na", "days-format-abbr":["Va", "H\xe9", "Ke", "Sze", "Cs\xfc", "P\xe9", "Szo"]})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/calendar/nls/it/gregorian.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"field-weekday":"giorno della settimana", "dateFormat-medium":"dd/MMM/yy", "field-second":"secondo", "field-week":"settimana", "pm":"p.", "months-standAlone-narrow":["G", "F", "M", "A", "M", "G", "L", "A", "S", "O", "N", "D"], "am":"m.", "days-standAlone-narrow":["D", "L", "M", "M", "G", "V", "S"], "field-year":"anno", "eras":["aC", "dC"], "field-minute":"minuto", "field-hour":"ora", "dateFormat-long":"dd MMMM yyyy", "field-day":"giorno", "field-dayperiod":"periodo del giorno", "field-month":"mese", "dateFormat-short":"dd/MM/yy", "months-format-wide":["gennaio", "febbraio", "marzo", "aprile", "maggio", "giugno", "luglio", "agosto", "settembre", "ottobre", "novembre", "dicembre"], "field-era":"era", "months-format-abbr":["gen", "feb", "mar", "apr", "mag", "giu", "lug", "ago", "set", "ott", "nov", "dic"], "days-format-wide":["domenica", "luned\xec", "marted\xec", "mercoled\xec", "gioved\xec", "venerd\xec", "sabato"], "dateFormat-full":"EEEE d MMMM yyyy", "field-zone":"zona", "days-format-abbr":["dom", "lun", "mar", "mer", "gio", "ven", "sab"], "timeFormat-full":"HH:mm:ss z", "timeFormat-medium":"HH:mm:ss", "timeFormat-short":"HH:mm", "timeFormat-long":"HH:mm:ss z"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/calendar/nls/zh-cn/gregorian.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"dateFormat-medium":"yyyy-M-d", "field-second":"\u79d2\u949f", "field-week":"\u5468", "timeFormat-full":"ahh'\u65f6'mm'\u5206'ss'\u79d2' z", "field-year":"\u5e74", "field-minute":"\u5206\u949f", "timeFormat-medium":"ahh:mm:ss", "field-hour":"\u5c0f\u65f6", "dateFormat-long":"yyyy'\u5e74'M'\u6708'd'\u65e5'", "field-day":"\u65e5", "field-dayperiod":"\u4e0a\u5348/\u4e0b\u5348", "field-month":"\u6708", "dateFormat-short":"yy-M-d", "field-era":"\u65f6\u671f", "timeFormat-short":"ah:mm", "timeFormat-long":"ahh'\u65f6'mm'\u5206'ss'\u79d2'", "dateFormat-full":"yyyy'\u5e74'M'\u6708'd'\u65e5'EEEE", "field-weekday":"\u5468\u5929", "field-zone":"\u533a\u57df", "days-standAlone-narrow":["\u65e5", "\u4e00", "\u4e8c", "\u4e09", "\u56db", "\u4e94", "\u516d"], "eras":["\u516c\u5143\u524d", "\u516c\u5143"], "am":"\u4e0a\u5348", "months-format-abbr":["\u4e00\u6708", "\u4e8c\u6708", "\u4e09\u6708", "\u56db\u6708", "\u4e94\u6708", "\u516d\u6708", "\u4e03\u6708", "\u516b\u6708", "\u4e5d\u6708", "\u5341\u6708", "\u5341\u4e00\u6708", "\u5341\u4e8c\u6708"], "days-format-abbr":["\u5468\u65e5", "\u5468\u4e00", "\u5468\u4e8c", "\u5468\u4e09", "\u5468\u56db", "\u5468\u4e94", "\u5468\u516d"], "pm":"\u4e0b\u5348", "months-format-wide":["\u4e00\u6708", "\u4e8c\u6708", "\u4e09\u6708", "\u56db\u6708", "\u4e94\u6708", "\u516d\u6708", "\u4e03\u6708", "\u516b\u6708", "\u4e5d\u6708", "\u5341\u6708", "\u5341\u4e00\u6708", "\u5341\u4e8c\u6708"], "months-standAlone-narrow":["1\u6708", "2\u6708", "3\u6708", "4\u6708", "5\u6708", "6\u6708", "7\u6708", "8\u6708", "9\u6708", "10\u6708", "11\u6708", "12\u6708"], "days-format-wide":["\u661f\u671f\u65e5", "\u661f\u671f\u4e00", "\u661f\u671f\u4e8c", "\u661f\u671f\u4e09", "\u661f\u671f\u56db", "\u661f\u671f\u4e94", "\u661f\u671f\u516d"]})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/calendar/nls/gregorianExtras.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"dateFormat-yearOnly":"yyyy"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/calendar/nls/zh/gregorianExtras.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"dateFormat-yearOnly":"yyyy'\u5e74'"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/calendar/nls/zh/gregorian.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"days-standAlone-narrow":["\u65e5", "\u4e00", "\u4e8c", "\u4e09", "\u56db", "\u4e94", "\u516d"], "eras":["\u516c\u5143\u524d", "\u516c\u5143"], "am":"\u4e0a\u5348", "months-format-abbr":["\u4e00\u6708", "\u4e8c\u6708", "\u4e09\u6708", "\u56db\u6708", "\u4e94\u6708", "\u516d\u6708", "\u4e03\u6708", "\u516b\u6708", "\u4e5d\u6708", "\u5341\u6708", "\u5341\u4e00\u6708", "\u5341\u4e8c\u6708"], "days-format-abbr":["\u5468\u65e5", "\u5468\u4e00", "\u5468\u4e8c", "\u5468\u4e09", "\u5468\u56db", "\u5468\u4e94", "\u5468\u516d"], "pm":"\u4e0b\u5348", "months-format-wide":["\u4e00\u6708", "\u4e8c\u6708", "\u4e09\u6708", "\u56db\u6708", "\u4e94\u6708", "\u516d\u6708", "\u4e03\u6708", "\u516b\u6708", "\u4e5d\u6708", "\u5341\u6708", "\u5341\u4e00\u6708", "\u5341\u4e8c\u6708"], "months-standAlone-narrow":["1\u6708", "2\u6708", "3\u6708", "4\u6708", "5\u6708", "6\u6708", "7\u6708", "8\u6708", "9\u6708", "10\u6708", "11\u6708", "12\u6708"], "days-format-wide":["\u661f\u671f\u65e5", "\u661f\u671f\u4e00", "\u661f\u671f\u4e8c", "\u661f\u671f\u4e09", "\u661f\u671f\u56db", "\u661f\u671f\u4e94", "\u661f\u671f\u516d"], "field-weekday":"Day of the Week", "dateFormat-medium":"yyyy MMM d", "field-second":"Second", "field-week":"Week", "timeFormat-full":"HH:mm:ss z", "field-year":"Year", "field-minute":"Minute", "timeFormat-medium":"HH:mm:ss", "field-hour":"Hour", "dateFormat-long":"yyyy MMMM d", "field-day":"Day", "field-dayperiod":"Dayperiod", "field-month":"Month", "dateFormat-short":"yy/MM/dd", "field-era":"Era", "timeFormat-short":"HH:mm", "timeFormat-long":"HH:mm:ss z", "dateFormat-full":"EEEE, yyyy MMMM dd", "field-zone":"Zone"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/calendar/nls/zh-hk/gregorian.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"timeFormat-full":"ahh'\u6642'mm'\u5206'ss'\u79d2' z", "eras":["\u897f\u5143\u524d", "\u897f\u5143"], "timeFormat-medium":"a h:mm:ss", "dateFormat-medium":"yyyy/M/d", "dateFormat-full":"yyyy'\u5e74'M'\u6708'd'\u65e5'EEEE", "days-format-abbr":["\u9031\u65e5", "\u9031\u4e00", "\u9031\u4e8c", "\u9031\u4e09", "\u9031\u56db", "\u9031\u4e94", "\u9031\u516d"], "timeFormat-long":"ahh'\u6642'mm'\u5206'ss'\u79d2'", "timeFormat-short":"a h:mm", "dateFormat-short":"yyyy/M/d", "dateFormat-long":"yyyy'\u5e74'M'\u6708'd'\u65e5'", "days-standAlone-narrow":["\u65e5", "\u4e00", "\u4e8c", "\u4e09", "\u56db", "\u4e94", "\u516d"], "am":"\u4e0a\u5348", "months-format-abbr":["\u4e00\u6708", "\u4e8c\u6708", "\u4e09\u6708", "\u56db\u6708", "\u4e94\u6708", "\u516d\u6708", "\u4e03\u6708", "\u516b\u6708", "\u4e5d\u6708", "\u5341\u6708", "\u5341\u4e00\u6708", "\u5341\u4e8c\u6708"], "pm":"\u4e0b\u5348", "months-format-wide":["\u4e00\u6708", "\u4e8c\u6708", "\u4e09\u6708", "\u56db\u6708", "\u4e94\u6708", "\u516d\u6708", "\u4e03\u6708", "\u516b\u6708", "\u4e5d\u6708", "\u5341\u6708", "\u5341\u4e00\u6708", "\u5341\u4e8c\u6708"], "months-standAlone-narrow":["1\u6708", "2\u6708", "3\u6708", "4\u6708", "5\u6708", "6\u6708", "7\u6708", "8\u6708", "9\u6708", "10\u6708", "11\u6708", "12\u6708"], "days-format-wide":["\u661f\u671f\u65e5", "\u661f\u671f\u4e00", "\u661f\u671f\u4e8c", "\u661f\u671f\u4e09", "\u661f\u671f\u56db", "\u661f\u671f\u4e94", "\u661f\u671f\u516d"], "field-weekday":"Day of the Week", "field-second":"Second", "field-week":"Week", "field-year":"Year", "field-minute":"Minute", "field-hour":"Hour", "field-day":"Day", "field-dayperiod":"Dayperiod", "field-month":"Month", "field-era":"Era", "field-zone":"Zone"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/calendar/nls/pt/gregorian.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"months-standAlone-narrow":["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"], "dateFormat-long":"d' de 'MMMM' de 'yyyy", "timeFormat-full":"HH'H'mm'm'ss's' z", "eras":["a.C.", "d.C."], "dateFormat-medium":"d/MMM/yyyy", "months-format-abbr":["jan", "fev", "mar", "abr", "mai", "jun", "jul", "ago", "set", "out", "nov", "dez"], "dateFormat-full":"EEEE, d' de 'MMMM' de 'yyyy", "days-format-abbr":["dom", "seg", "ter", "qua", "qui", "sex", "s\xe1b"], "dateFormat-short":"dd-MM-yyyy", "months-format-wide":["janeiro", "fevereiro", "mar\xe7o", "abril", "maio", "junho", "julho", "agosto", "setembro", "outubro", "novembro", "dezembro"], "days-standAlone-narrow":["D", "S", "T", "Q", "Q", "S", "S"], "days-format-wide":["domingo", "segunda-feira", "ter\xe7a-feira", "quarta-feira", "quinta-feira", "sexta-feira", "s\xe1bado"], "field-weekday":"Day of the Week", "field-second":"Second", "field-week":"Week", "pm":"PM", "am":"AM", "field-year":"Year", "field-minute":"Minute", "timeFormat-medium":"HH:mm:ss", "field-hour":"Hour", "field-day":"Day", "field-dayperiod":"Dayperiod", "field-month":"Month", "field-era":"Era", "timeFormat-short":"HH:mm", "timeFormat-long":"HH:mm:ss z", "field-zone":"Zone"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/calendar/nls/pt-br/gregorian.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"field-hour":"Hora", "field-dayperiod":"Per\xedodo do dia", "field-minute":"Minuto", "timeFormat-full":"HH'h'mm'min'ss's' z", "field-weekday":"Dia da semana", "field-week":"Semana", "field-second":"Segundo", "dateFormat-medium":"dd/MM/yyyy", "field-day":"Dia", "timeFormat-long":"H'h'm'min's's' z", "field-month":"M\xeas", "field-year":"Ano", "dateFormat-short":"dd/MM/yy", "field-zone":"Fuso", "months-standAlone-narrow":["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"], "dateFormat-long":"d' de 'MMMM' de 'yyyy", "eras":["a.C.", "d.C."], "months-format-abbr":["jan", "fev", "mar", "abr", "mai", "jun", "jul", "ago", "set", "out", "nov", "dez"], "dateFormat-full":"EEEE, d' de 'MMMM' de 'yyyy", "days-format-abbr":["dom", "seg", "ter", "qua", "qui", "sex", "s\xe1b"], "months-format-wide":["janeiro", "fevereiro", "mar\xe7o", "abril", "maio", "junho", "julho", "agosto", "setembro", "outubro", "novembro", "dezembro"], "days-standAlone-narrow":["D", "S", "T", "Q", "Q", "S", "S"], "days-format-wide":["domingo", "segunda-feira", "ter\xe7a-feira", "quarta-feira", "quinta-feira", "sexta-feira", "s\xe1bado"], "pm":"PM", "am":"AM", "timeFormat-medium":"HH:mm:ss", "field-era":"Era", "timeFormat-short":"HH:mm"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/calendar/nls/de/gregorian.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"field-weekday":"Wochentag", "dateFormat-medium":"dd.MM.yyyy", "field-second":"Sekunde", "field-week":"Woche", "pm":"nachm.", "timeFormat-full":"H:mm' Uhr 'z", "months-standAlone-narrow":["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"], "am":"vorm.", "days-standAlone-narrow":["S", "M", "D", "M", "D", "F", "S"], "field-year":"Jahr", "eras":["v. Chr.", "n. Chr."], "field-hour":"Stunde", "dateFormat-long":"d. MMMM yyyy", "field-day":"Tag", "field-dayperiod":"Tagesh\xe4lfte", "field-month":"Monat", "dateFormat-short":"dd.MM.yy", "months-format-wide":["Januar", "Februar", "M\xe4rz", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"], "field-era":"Epoche", "months-format-abbr":["Jan", "Feb", "Mrz", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"], "days-format-wide":["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"], "dateFormat-full":"EEEE, d. MMMM yyyy", "field-zone":"Zone", "days-format-abbr":["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"], "field-minute":"Minute", "timeFormat-medium":"HH:mm:ss", "timeFormat-short":"HH:mm", "timeFormat-long":"HH:mm:ss z"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/calendar/nls/gregorian.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"field-weekday":"Day of the Week", "dateFormat-medium":"yyyy MMM d", "field-second":"Second", "field-week":"Week", "pm":"PM", "timeFormat-full":"HH:mm:ss z", "months-standAlone-narrow":["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"], "am":"AM", "days-standAlone-narrow":["1", "2", "3", "4", "5", "6", "7"], "field-year":"Year", "eras":["BCE", "CE"], "field-minute":"Minute", "timeFormat-medium":"HH:mm:ss", "field-hour":"Hour", "dateFormat-long":"yyyy MMMM d", "field-day":"Day", "field-dayperiod":"Dayperiod", "field-month":"Month", "dateFormat-short":"yy/MM/dd", "months-format-wide":["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"], "field-era":"Era", "timeFormat-short":"HH:mm", "months-format-abbr":["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"], "timeFormat-long":"HH:mm:ss z", "days-format-wide":["1", "2", "3", "4", "5", "6", "7"], "dateFormat-full":"EEEE, yyyy MMMM dd", "field-zone":"Zone", "days-format-abbr":["1", "2", "3", "4", "5", "6", "7"]})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/calendar/nls/sv/gregorian.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"field-weekday":"veckodag", "dateFormat-medium":"d MMM yyyy", "field-second":"sekund", "field-week":"vecka", "pm":"em", "timeFormat-full":"'kl. 'HH.mm.ss z", "months-standAlone-narrow":["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"], "am":"fm", "days-standAlone-narrow":["S", "M", "T", "O", "T", "F", "L"], "field-year":"\xe5r", "eras":["f.Kr.", "e.Kr."], "field-minute":"minut", "timeFormat-medium":"HH.mm.ss", "field-hour":"timme", "dateFormat-long":"EEEE d MMM yyyy", "field-day":"dag", "field-dayperiod":"dagsperiod", "field-month":"m\xe5nad", "dateFormat-short":"yyyy-MM-dd", "months-format-wide":["januari", "februari", "mars", "april", "maj", "juni", "juli", "augusti", "september", "oktober", "november", "december"], "field-era":"era", "timeFormat-short":"HH.mm", "months-format-abbr":["jan", "feb", "mar", "apr", "maj", "jun", "jul", "aug", "sep", "okt", "nov", "dec"], "timeFormat-long":"HH.mm.ss z", "days-format-wide":["s\xf6ndag", "m\xe5ndag", "tisdag", "onsdag", "torsdag", "fredag", "l\xf6rdag"], "dateFormat-full":"EEEE'en den' d MMMM yyyy", "field-zone":"tidszon", "days-format-abbr":["s\xf6", "m\xe5", "ti", "on", "to", "fr", "l\xf6"]})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/calendar/nls/ja/gregorian.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"days-standAlone-narrow":["\u65e5", "\u6708", "\u706b", "\u6c34", "\u6728", "\u91d1", "\u571f"], "timeFormat-full":"H'\u6642'mm'\u5206'ss'\u79d2'z", "eras":["\u7d00\u5143\u524d", "\u897f\u66a6"], "timeFormat-medium":"H:mm:ss", "dateFormat-medium":"yyyy/MM/dd", "am":"\u5348\u524d", "months-format-abbr":["1 \u6708", "2 \u6708", "3 \u6708", "4 \u6708", "5 \u6708", "6 \u6708", "7 \u6708", "8 \u6708", "9 \u6708", "10 \u6708", "11 \u6708", "12 \u6708"], "dateFormat-full":"yyyy'\u5e74'M'\u6708'd'\u65e5'EEEE", "days-format-abbr":["\u65e5", "\u6708", "\u706b", "\u6c34", "\u6728", "\u91d1", "\u571f"], "timeFormat-long":"H:mm:ss:z", "timeFormat-short":"H:mm", "pm":"\u5348\u5f8c", "months-format-wide":["1 \u6708", "2 \u6708", "3 \u6708", "4 \u6708", "5 \u6708", "6 \u6708", "7 \u6708", "8 \u6708", "9 \u6708", "10 \u6708", "11 \u6708", "12 \u6708"], "dateFormat-long":"yyyy'\u5e74'M'\u6708'd'\u65e5'", "days-format-wide":["\u65e5\u66dc\u65e5", "\u6708\u66dc\u65e5", "\u706b\u66dc\u65e5", "\u6c34\u66dc\u65e5", "\u6728\u66dc\u65e5", "\u91d1\u66dc\u65e5", "\u571f\u66dc\u65e5"], "field-weekday":"Day of the Week", "field-second":"Second", "field-week":"Week", "months-standAlone-narrow":["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"], "field-year":"Year", "field-minute":"Minute", "field-hour":"Hour", "field-day":"Day", "field-dayperiod":"Dayperiod", "field-month":"Month", "dateFormat-short":"yy/MM/dd", "field-era":"Era", "field-zone":"Zone"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/calendar/nls/ja/gregorianExtras.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"dateFormat-yearOnly":"yyyy\u5e74"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/calendar/nls/README
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/calendar/nls/README
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/calendar/nls/fi/gregorian.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"field-weekday":"viikonp\xe4iv\xe4", "dateFormat-medium":"d.M.yyyy", "field-second":"sekunti", "field-week":"viikko", "pm":"ip.", "timeFormat-full":"H.mm.ss v", "months-standAlone-narrow":["T", "H", "M", "H", "T", "K", "H", "E", "S", "L", "M", "J"], "am":"ap.", "days-standAlone-narrow":["S", "M", "T", "K", "T", "P", "L"], "field-year":"vuosi", "eras":["eKr.", "jKr."], "field-minute":"minuutti", "timeFormat-medium":"H.mm.ss", "field-hour":"tunti", "dateFormat-long":"d. MMMM'ta 'yyyy", "field-day":"p\xe4iv\xe4", "field-dayperiod":"ap/ip-valinta", "field-month":"kuukausi", "dateFormat-short":"d.M.yyyy", "months-format-wide":["tammikuu", "helmikuu", "maaliskuu", "huhtikuu", "toukokuu", "kes\xe4kuu", "hein\xe4kuu", "elokuu", "syyskuu", "lokakuu", "marraskuu", "joulukuu"], "field-era":"aikakausi", "timeFormat-short":"H.mm", "months-format-abbr":["tammi", "helmi", "maalis", "huhti", "touko", "kes\xe4", "hein\xe4", "elo", "syys", "loka", "marras", "joulu"], "timeFormat-long":"'klo 'H.mm.ss", "days-format-wide":["sunnuntai", "maanantai", "tiistai", "keskiviikko", "torstai", "perjantai", "lauantai"], "dateFormat-full":"EEEE'na 'd. MMMM'ta 'yyyy", "field-zone":"aikavy\xf6hyke", "days-format-abbr":["su", "ma", "ti", "ke", "to", "pe", "la"]})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/currency/common.js
New file
0,0 → 1,136
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.i18n.currency.common");
dojo.require("dojo.experimental");
dojo.experimental("dojo.i18n.currency");
dojo.require("dojo.regexp");
dojo.require("dojo.i18n.common");
dojo.require("dojo.i18n.number");
dojo.require("dojo.lang.common");
dojo.i18n.currency.format = function (value, iso, flags, locale) {
flags = (typeof flags == "object") ? flags : {};
var formatData = dojo.i18n.currency._mapToLocalizedFormatData(dojo.i18n.currency.FORMAT_TABLE, iso, locale);
if (typeof flags.places == "undefined") {
flags.places = formatData.places;
}
if (typeof flags.places == "undefined") {
flags.places = 2;
}
flags.signed = false;
var result = dojo.i18n.number.format(value, flags, locale);
var sym = formatData.symbol;
if (formatData.adjSpace == "symbol") {
if (formatData.placement == "after") {
sym = " " + sym;
} else {
sym = sym + " ";
}
}
if (value < 0) {
if (formatData.signPlacement == "before") {
sym = "-" + sym;
} else {
if (formatData.signPlacement == "after") {
sym = sym + "-";
}
}
}
var spc = (formatData.adjSpace == "number") ? " " : "";
if (formatData.placement == "after") {
result = result + spc + sym;
} else {
result = sym + spc + result;
}
if (value < 0) {
if (formatData.signPlacement == "around") {
result = "(" + result + ")";
} else {
if (formatData.signPlacement == "end") {
result = result + "-";
} else {
if (!formatData.signPlacement || formatData.signPlacement == "begin") {
result = "-" + result;
}
}
}
}
return result;
};
dojo.i18n.currency.parse = function (value, iso, locale, flags) {
if (typeof flags.validate == "undefined") {
flags.validate = true;
}
if (flags.validate && !dojo.i18n.number.isCurrency(value, iso, locale, flags)) {
return Number.NaN;
}
var sign = (value.indexOf("-") != -1);
var abs = abs.replace(/\-/, "");
var formatData = dojo.i18n.currency._mapToLocalizedFormatData(dojo.i18n.currency.FORMAT_TABLE, iso, locale);
abs = abs.replace(new RegExp("\\" + formatData.symbol), "");
var number = dojo.i18n.number.parse(abs, locale, flags);
if (sign) {
number = number * -1;
}
return number;
};
dojo.i18n.currency.isCurrency = function (value, iso, locale, flags) {
flags = (typeof flags == "object") ? flags : {};
var numberFormatData = dojo.i18n.number._mapToLocalizedFormatData(dojo.i18n.number.FORMAT_TABLE, locale);
if (typeof flags.separator == "undefined") {
flags.separator = numberFormatData[0];
} else {
if (dojo.lang.isArray(flags.separator) && flags.separator.length == 0) {
flags.separator = [numberFormatData[0], ""];
}
}
if (typeof flags.decimal == "undefined") {
flags.decimal = numberFormatData[2];
}
if (typeof flags.groupSize == "undefined") {
flags.groupSize = numberFormatData[3];
}
if (typeof flags.groupSize2 == "undefined") {
flags.groupSize2 = numberFormatData[4];
}
var formatData = dojo.i18n.currency._mapToLocalizedFormatData(dojo.i18n.currency.FORMAT_TABLE, iso, locale);
if (typeof flags.places == "undefined") {
flags.places = formatData.places;
}
if (typeof flags.places == "undefined") {
flags.places = 2;
}
if (typeof flags.symbol == "undefined") {
flags.symbol = formatData.symbol;
} else {
if (dojo.lang.isArray(flags.symbol) && flags.symbol.length == 0) {
flags.symbol = [formatData.symbol, ""];
}
}
if (typeof flags.placement == "undefined") {
flags.placement = formatData.placement;
}
var re = new RegExp("^" + dojo.regexp.currency(flags) + "$");
return re.test(value);
};
dojo.i18n.currency._mapToLocalizedFormatData = function (table, iso, locale) {
var formatData = dojo.i18n.currency.FORMAT_TABLE[iso];
if (!dojo.lang.isArray(formatData)) {
return formatData;
}
return dojo.i18n.number._mapToLocalizedFormatData(formatData[0], locale);
};
(function () {
var arabic = {symbol:"\u062c", placement:"after", htmlSymbol:"?"};
var euro = {symbol:"\u20ac", placement:"before", adjSpace:"symbol", htmlSymbol:"&euro;"};
var euroAfter = {symbol:"\u20ac", placement:"after", htmlSymbol:"&euro;"};
dojo.i18n.currency.FORMAT_TABLE = {AED:{symbol:"\u062c", placement:"after"}, ARS:{symbol:"$", signPlacement:"after"}, ATS:{symbol:"\u20ac", adjSpace:"number", signPlacement:"after", htmlSymbol:"&euro;"}, AUD:{symbol:"$"}, BOB:{symbol:"$b"}, BRL:{symbol:"R$", adjSpace:"symbol"}, BEF:euroAfter, BHD:arabic, CAD:[{"*":{symbol:"$"}, "fr-ca":{symbol:"$", placement:"after", signPlacement:"around"}}], CHF:{symbol:"CHF", adjSpace:"symbol", signPlacement:"after"}, CLP:{symbol:"$"}, COP:{symbol:"$", signPlacement:"around"}, CNY:{symbol:"\xa5", htmlSymbol:"&yen;"}, CRC:{symbol:"\u20a1", signPlacement:"after", htmlSymbol:"?"}, CZK:{symbol:"Kc", adjSpace:"symbol", signPlacement:"after"}, DEM:euroAfter, DKK:{symbol:"kr.", adjSpace:"symbol", signPlacement:"after"}, DOP:{symbol:"$"}, DZD:arabic, ECS:{symbol:"$", signPlacement:"after"}, EGP:arabic, ESP:euroAfter, EUR:euro, FIM:euroAfter, FRF:euroAfter, GBP:{symbol:"\xa3", htmlSymbol:"&pound;"}, GRD:{symbol:"\u20ac", signPlacement:"end", htmlSymbol:"&euro;"}, GTQ:{symbol:"Q", signPlacement:"after"}, HKD:{symbol:"HK$"}, HNL:{symbol:"L.", signPlacement:"end"}, HUF:{symbol:"Ft", placement:"after", adjSpace:"symbol"}, IEP:{symbol:"\u20ac", htmlSymbol:"&euro;"}, ILS:{symbol:"\u05e9\"\u05d7", placement:"after", htmlSymbol:"?"}, INR:{symbol:"Rs."}, ITL:{symbol:"\u20ac", signPlacement:"after", htmlSymbol:"&euro;"}, JOD:arabic, JPY:{symbol:"\xa5", places:0, htmlSymbol:"&yen;"}, KRW:{symbol:"\u20a9", places:0, htmlSymbol:"?"}, KWD:arabic, LBP:arabic, LUF:euroAfter, MAD:arabic, MXN:{symbol:"$", signPlacement:"around"}, NIO:{symbol:"C$", adjSpace:"symbol", signPlacement:"after"}, NLG:{symbol:"\u20ac", signPlacement:"end", htmlSymbol:"&euro;"}, NOK:{symbol:"kr", adjSpace:"symbol", signPlacement:"after"}, NZD:{symbol:"$"}, OMR:arabic, PAB:{symbol:"B/", adjSpace:"symbol", signPlacement:"after"}, PEN:{symbol:"S/", signPlacement:"after"}, PLN:{symbol:"z", placement:"after"}, PTE:euroAfter, PYG:{symbol:"Gs.", signPlacement:"after"}, QAR:arabic, RUR:{symbol:"rub.", placement:"after"}, SAR:arabic, SEK:{symbol:"kr", placement:"after", adjSpace:"symbol"}, SGD:{symbol:"$"}, SVC:{symbol:"\u20a1", signPlacement:"after", adjSpace:"symbol"}, SYP:arabic, TND:arabic, TRL:{symbol:"TL", placement:"after"}, TWD:{symbol:"NT$"}, USD:{symbol:"$"}, UYU:{symbol:"$U", signplacement:"after", adjSpace:"symbol"}, VEB:{symbol:"Bs", signplacement:"after", adjSpace:"symbol"}, YER:arabic, ZAR:{symbol:"R", signPlacement:"around"}};
})();
 
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/currency/nls/JPY.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"displayName":"JPY", "symbol":"\xa5"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/currency/nls/README
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/currency/nls/README
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/currency/nls/hi/EUR.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"displayName":"\u092f\u0941\u0930\u094b", "symbol":"\u20ac"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/currency/nls/hi/USD.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"displayName":"\u0905\u092e\u0930\u0940\u0915\u0940 \u0921\u093e\u0932\u0930", "symbol":"$"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/currency/nls/hi/JPY.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"displayName":"\u091c\u093e\u092a\u093e\u0928\u0940 \u092f\u0947\u0928", "symbol":"\xa5"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/currency/nls/hi/GBP.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"displayName":"\u092c\u094d\u0930\u093f\u0924\u0928 \u0915\u093e \u092a\u094c\u0928\u094d\u0921 \u0938\u094d\u091f\u0930\u094d\u0932\u093f\u0917", "symbol":"\xa3"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/currency/nls/hi/INR.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"displayName":"\u092d\u093e\u0930\u0924\u0940\u092f \u0930\u0942\u092a\u092f\u093e", "symbol":"\u0930\u0941."})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/currency/nls/hi/ITL.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"displayName":"\u0907\u0924\u0932\u0940 \u0915\u093e \u0932\u0940\u0930\u093e", "symbol":"\u20a4"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/currency/nls/en/GBP.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"displayName":"British Pound Sterling", "symbol":"\xa3"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/currency/nls/en/INR.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"displayName":"Indian Rupee"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/currency/nls/en/ITL.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"displayName":"Italian Lira", "symbol":"\u20a4"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/currency/nls/en/EUR.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"displayName":"Euro", "symbol":"\u20ac"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/currency/nls/en/USD.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"displayName":"US Dollar", "symbol":"US$"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/currency/nls/en/JPY.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"displayName":"Japanese Yen", "symbol":"\xa5"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/currency/nls/GBP.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"displayName":"GBP", "symbol":"\xa3"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/currency/nls/INR.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"displayName":"INR"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/currency/nls/ITL.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"displayName":"ITL", "symbol":"\u20a4"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/currency/nls/EUR.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"displayName":"EUR", "symbol":"\u20ac"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/currency/nls/USD.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"displayName":"USD", "symbol":"$"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/currency/nls/en-us/USD.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"symbol":"$", "displayName":"US Dollar"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/currency/nls/ja/EUR.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"displayName":"\u30e6\u30fc\u30ed", "symbol":"\u20ac"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/currency/nls/ja/USD.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"displayName":"\u7c73\u30c9\u30eb", "symbol":"$"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/currency/nls/ja/JPY.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"displayName":"\u65e5\u672c\u5186", "symbol":"\uffe5"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/currency/nls/ja/GBP.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"displayName":"\u82f1\u56fd\u30dd\u30f3\u30c9", "symbol":"\xa3"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/currency/nls/ja/INR.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"displayName":"\u30a4\u30f3\u30c9 \u30eb\u30d4\u30fc", "symbol":"INR"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/currency/nls/ja/ITL.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"displayName":"\u30a4\u30bf\u30ea\u30a2 \u30ea\u30e9", "symbol":"\u20a4"})
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/common.js
New file
0,0 → 1,42
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.i18n.common");
dojo.i18n.getLocalization = function (packageName, bundleName, locale) {
dojo.hostenv.preloadLocalizations();
locale = dojo.hostenv.normalizeLocale(locale);
var elements = locale.split("-");
var module = [packageName, "nls", bundleName].join(".");
var bundle = dojo.hostenv.findModule(module, true);
var localization;
for (var i = elements.length; i > 0; i--) {
var loc = elements.slice(0, i).join("_");
if (bundle[loc]) {
localization = bundle[loc];
break;
}
}
if (!localization) {
localization = bundle.ROOT;
}
if (localization) {
var clazz = function () {
};
clazz.prototype = localization;
return new clazz();
}
dojo.raise("Bundle not found: " + bundleName + " in " + packageName + " , locale=" + locale);
};
dojo.i18n.isLTR = function (locale) {
var lang = dojo.hostenv.normalizeLocale(locale).split("-")[0];
var RTL = {ar:true, fa:true, he:true, ur:true, yi:true};
return !RTL[lang];
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/i18n/number.js
New file
0,0 → 1,149
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.i18n.number");
dojo.require("dojo.experimental");
dojo.experimental("dojo.i18n.number");
dojo.require("dojo.regexp");
dojo.require("dojo.i18n.common");
dojo.require("dojo.lang.common");
dojo.i18n.number.format = function (value, flags, locale) {
flags = (typeof flags == "object") ? flags : {};
var formatData = dojo.i18n.number._mapToLocalizedFormatData(dojo.i18n.number.FORMAT_TABLE, locale);
if (typeof flags.separator == "undefined") {
flags.separator = formatData[1];
}
if (typeof flags.decimal == "undefined") {
flags.decimal = formatData[2];
}
if (typeof flags.groupSize == "undefined") {
flags.groupSize = formatData[3];
}
if (typeof flags.groupSize2 == "undefined") {
flags.groupSize2 = formatData[4];
}
if (typeof flags.round == "undefined") {
flags.round = true;
}
if (typeof flags.signed == "undefined") {
flags.signed = true;
}
var output = (flags.signed && (value < 0)) ? "-" : "";
value = Math.abs(value);
var whole = String((((flags.places > 0) || !flags.round) ? Math.floor : Math.round)(value));
function splitSubstrings(str, count) {
for (var subs = []; str.length >= count; str = str.substr(0, str.length - count)) {
subs.push(str.substr(-count));
}
if (str.length > 0) {
subs.push(str);
}
return subs.reverse();
}
if (flags.groupSize2 && (whole.length > flags.groupSize)) {
var groups = splitSubstrings(whole.substr(0, whole.length - flags.groupSize), flags.groupSize2);
groups.push(whole.substr(-flags.groupSize));
output = output + groups.join(flags.separator);
} else {
if (flags.groupSize) {
output = output + splitSubstrings(whole, flags.groupSize).join(flags.separator);
} else {
output = output + whole;
}
}
if (flags.places > 0) {
var fract = value - Math.floor(value);
fract = (flags.round ? Math.round : Math.floor)(fract * Math.pow(10, flags.places));
output = output + flags.decimal + fract;
}
return output;
};
dojo.i18n.number.parse = function (value, locale, flags) {
flags = (typeof flags == "object") ? flags : {};
var formatData = dojo.i18n.number._mapToLocalizedFormatData(dojo.i18n.number.FORMAT_TABLE, locale);
if (typeof flags.separator == "undefined") {
flags.separator = formatData[1];
}
if (typeof flags.decimal == "undefined") {
flags.decimal = formatData[2];
}
if (typeof flags.groupSize == "undefined") {
flags.groupSize = formatData[3];
}
if (typeof flags.groupSize2 == "undefined") {
flags.groupSize2 = formatData[4];
}
if (typeof flags.validate == "undefined") {
flags.validate = true;
}
if (flags.validate && !dojo.i18n.number.isReal(value, locale, flags)) {
return Number.NaN;
}
var numbers = value.split(flags.decimal);
if (numbers.length > 2) {
return Number.NaN;
}
var whole = Number(numbers[0].replace(new RegExp("\\" + flags.separator, "g"), ""));
var fract = (numbers.length == 1) ? 0 : Number(numbers[1]) / Math.pow(10, String(numbers[1]).length);
return whole + fract;
};
dojo.i18n.number.isInteger = function (value, locale, flags) {
flags = (typeof flags == "object") ? flags : {};
var formatData = dojo.i18n.number._mapToLocalizedFormatData(dojo.i18n.number.FORMAT_TABLE, locale);
if (typeof flags.separator == "undefined") {
flags.separator = formatData[1];
} else {
if (dojo.lang.isArray(flags.separator) && flags.separator.length === 0) {
flags.separator = [formatData[1], ""];
}
}
if (typeof flags.groupSize == "undefined") {
flags.groupSize = formatData[3];
}
if (typeof flags.groupSize2 == "undefined") {
flags.groupSize2 = formatData[4];
}
var re = new RegExp("^" + dojo.regexp.integer(flags) + "$");
return re.test(value);
};
dojo.i18n.number.isReal = function (value, locale, flags) {
flags = (typeof flags == "object") ? flags : {};
var formatData = dojo.i18n.number._mapToLocalizedFormatData(dojo.i18n.number.FORMAT_TABLE, locale);
if (typeof flags.separator == "undefined") {
flags.separator = formatData[1];
} else {
if (dojo.lang.isArray(flags.separator) && flags.separator.length === 0) {
flags.separator = [formatData[1], ""];
}
}
if (typeof flags.decimal == "undefined") {
flags.decimal = formatData[2];
}
if (typeof flags.groupSize == "undefined") {
flags.groupSize = formatData[3];
}
if (typeof flags.groupSize2 == "undefined") {
flags.groupSize2 = formatData[4];
}
var re = new RegExp("^" + dojo.regexp.realNumber(flags) + "$");
return re.test(value);
};
(function () {
dojo.i18n.number.FORMAT_TABLE = {"ar-ae":["", "", ",", 1], "ar-bh":["", "", ",", 1], "ar-dz":["", "", ",", 1], "ar-eg":["", "", ",", 1], "ar-jo":["", "", ",", 1], "ar-kw":["", "", ",", 1], "ar-lb":["", "", ",", 1], "ar-ma":["", "", ",", 1], "ar-om":["", "", ",", 1], "ar-qa":["", "", ",", 1], "ar-sa":["", "", ",", 1], "ar-sy":["", "", ",", 1], "ar-tn":["", "", ",", 1], "ar-ye":["", "", ",", 1], "cs-cz":[".", ".", ",", 3], "da-dk":[".", ".", ",", 3], "de-at":[".", ".", ",", 3], "de-de":[".", ".", ",", 3], "de-lu":[".", ".", ",", 3], "de-ch":["'", "'", ".", 3], "el-gr":[".", ".", ",", 3], "en-au":[",", ",", ".", 3], "en-ca":[",", ",", ".", 3], "en-gb":[",", ",", ".", 3], "en-hk":[",", ",", ".", 3], "en-ie":[",", ",", ".", 3], "en-in":[",", ",", ".", 3, 2], "en-nz":[",", ",", ".", 3], "en-us":[",", ",", ".", 3], "en-za":[",", ",", ".", 3], "es-ar":[".", ".", ",", 3], "es-bo":[".", ".", ",", 3], "es-cl":[".", ".", ",", 3], "es-co":[".", ".", ",", 3], "es-cr":[".", ".", ",", 3], "es-do":[".", ".", ",", 3], "es-ec":[".", ".", ",", 3], "es-es":[".", ".", ",", 3], "es-gt":[",", ",", ".", 3], "es-hn":[",", ",", ".", 3], "es-mx":[",", ",", ".", 3], "es-ni":[",", ",", ".", 3], "es-pa":[",", ",", ".", 3], "es-pe":[",", ",", ".", 3], "es-pr":[",", ",", ".", 3], "es-py":[".", ".", ",", 3], "es-sv":[",", ",", ".", 3], "es-uy":[".", ".", ",", 3], "es-ve":[".", ".", ",", 3], "fi-fi":[" ", " ", ",", 3], "fr-be":[".", ".", ",", 3], "fr-ca":[" ", " ", ",", 3], "fr-ch":[" ", " ", ".", 3], "fr-fr":[" ", " ", ",", 3], "fr-lu":[".", ".", ",", 3], "he-il":[",", ",", ".", 3], "hu-hu":[" ", " ", ",", 3], "it-ch":[" ", " ", ".", 3], "it-it":[".", ".", ",", 3], "ja-jp":[",", ",", ".", 3], "ko-kr":[",", ",", ".", 3], "no-no":[".", ".", ",", 3], "nl-be":[" ", " ", ",", 3], "nl-nl":[".", ".", ",", 3], "pl-pl":[".", ".", ",", 3], "pt-br":[".", ".", ",", 3], "pt-pt":[".", ".", "$", 3], "ru-ru":[" ", " ", ",", 3], "sv-se":[".", " ", ",", 3], "tr-tr":[".", ".", ",", 3], "zh-cn":[",", ",", ".", 3], "zh-hk":[",", ",", ".", 3], "zh-tw":[",", ",", ".", 3], "*":[",", ",", ".", 3]};
})();
dojo.i18n.number._mapToLocalizedFormatData = function (table, locale) {
locale = dojo.hostenv.normalizeLocale(locale);
var data = table[locale];
if (typeof data == "undefined") {
data = table["*"];
}
return data;
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/animation/Animation.js
New file
0,0 → 1,178
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.animation.Animation");
dojo.require("dojo.animation.AnimationEvent");
dojo.require("dojo.lang.func");
dojo.require("dojo.math");
dojo.require("dojo.math.curves");
dojo.deprecated("dojo.animation.Animation is slated for removal in 0.5; use dojo.lfx.* instead.", "0.5");
dojo.animation.Animation = function (curve, duration, accel, repeatCount, rate) {
if (dojo.lang.isArray(curve)) {
curve = new dojo.math.curves.Line(curve[0], curve[1]);
}
this.curve = curve;
this.duration = duration;
this.repeatCount = repeatCount || 0;
this.rate = rate || 25;
if (accel) {
if (dojo.lang.isFunction(accel.getValue)) {
this.accel = accel;
} else {
var i = 0.35 * accel + 0.5;
this.accel = new dojo.math.curves.CatmullRom([[0], [i], [1]], 0.45);
}
}
};
dojo.lang.extend(dojo.animation.Animation, {curve:null, duration:0, repeatCount:0, accel:null, onBegin:null, onAnimate:null, onEnd:null, onPlay:null, onPause:null, onStop:null, handler:null, _animSequence:null, _startTime:null, _endTime:null, _lastFrame:null, _timer:null, _percent:0, _active:false, _paused:false, _startRepeatCount:0, play:function (gotoStart) {
if (gotoStart) {
clearTimeout(this._timer);
this._active = false;
this._paused = false;
this._percent = 0;
} else {
if (this._active && !this._paused) {
return;
}
}
this._startTime = new Date().valueOf();
if (this._paused) {
this._startTime -= (this.duration * this._percent / 100);
}
this._endTime = this._startTime + this.duration;
this._lastFrame = this._startTime;
var e = new dojo.animation.AnimationEvent(this, null, this.curve.getValue(this._percent), this._startTime, this._startTime, this._endTime, this.duration, this._percent, 0);
this._active = true;
this._paused = false;
if (this._percent == 0) {
if (!this._startRepeatCount) {
this._startRepeatCount = this.repeatCount;
}
e.type = "begin";
if (typeof this.handler == "function") {
this.handler(e);
}
if (typeof this.onBegin == "function") {
this.onBegin(e);
}
}
e.type = "play";
if (typeof this.handler == "function") {
this.handler(e);
}
if (typeof this.onPlay == "function") {
this.onPlay(e);
}
if (this._animSequence) {
this._animSequence._setCurrent(this);
}
this._cycle();
}, pause:function () {
clearTimeout(this._timer);
if (!this._active) {
return;
}
this._paused = true;
var e = new dojo.animation.AnimationEvent(this, "pause", this.curve.getValue(this._percent), this._startTime, new Date().valueOf(), this._endTime, this.duration, this._percent, 0);
if (typeof this.handler == "function") {
this.handler(e);
}
if (typeof this.onPause == "function") {
this.onPause(e);
}
}, playPause:function () {
if (!this._active || this._paused) {
this.play();
} else {
this.pause();
}
}, gotoPercent:function (pct, andPlay) {
clearTimeout(this._timer);
this._active = true;
this._paused = true;
this._percent = pct;
if (andPlay) {
this.play();
}
}, stop:function (gotoEnd) {
clearTimeout(this._timer);
var step = this._percent / 100;
if (gotoEnd) {
step = 1;
}
var e = new dojo.animation.AnimationEvent(this, "stop", this.curve.getValue(step), this._startTime, new Date().valueOf(), this._endTime, this.duration, this._percent);
if (typeof this.handler == "function") {
this.handler(e);
}
if (typeof this.onStop == "function") {
this.onStop(e);
}
this._active = false;
this._paused = false;
}, status:function () {
if (this._active) {
return this._paused ? "paused" : "playing";
} else {
return "stopped";
}
}, _cycle:function () {
clearTimeout(this._timer);
if (this._active) {
var curr = new Date().valueOf();
var step = (curr - this._startTime) / (this._endTime - this._startTime);
var fps = 1000 / (curr - this._lastFrame);
this._lastFrame = curr;
if (step >= 1) {
step = 1;
this._percent = 100;
} else {
this._percent = step * 100;
}
if (this.accel && this.accel.getValue) {
step = this.accel.getValue(step);
}
var e = new dojo.animation.AnimationEvent(this, "animate", this.curve.getValue(step), this._startTime, curr, this._endTime, this.duration, this._percent, Math.round(fps));
if (typeof this.handler == "function") {
this.handler(e);
}
if (typeof this.onAnimate == "function") {
this.onAnimate(e);
}
if (step < 1) {
this._timer = setTimeout(dojo.lang.hitch(this, "_cycle"), this.rate);
} else {
e.type = "end";
this._active = false;
if (typeof this.handler == "function") {
this.handler(e);
}
if (typeof this.onEnd == "function") {
this.onEnd(e);
}
if (this.repeatCount > 0) {
this.repeatCount--;
this.play(true);
} else {
if (this.repeatCount == -1) {
this.play(true);
} else {
if (this._startRepeatCount) {
this.repeatCount = this._startRepeatCount;
this._startRepeatCount = 0;
}
if (this._animSequence) {
this._animSequence._playNext();
}
}
}
}
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/animation/Timer.js
New file
0,0 → 1,15
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.animation.Timer");
dojo.require("dojo.lang.timing.Timer");
dojo.deprecated("dojo.animation.Timer is now dojo.lang.timing.Timer", "0.5");
dojo.animation.Timer = dojo.lang.timing.Timer;
 
/tags/Racine_livraison_narmer/api/js/dojo/src/animation/AnimationEvent.js
New file
0,0 → 1,35
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.animation.AnimationEvent");
dojo.require("dojo.lang.common");
dojo.deprecated("dojo.animation.AnimationEvent is slated for removal in 0.5; use dojo.lfx.* instead.", "0.5");
dojo.animation.AnimationEvent = function (animation, type, coords, startTime, currentTime, endTime, duration, percent, fps) {
this.type = type;
this.animation = animation;
this.coords = coords;
this.x = coords[0];
this.y = coords[1];
this.z = coords[2];
this.startTime = startTime;
this.currentTime = currentTime;
this.endTime = endTime;
this.duration = duration;
this.percent = percent;
this.fps = fps;
};
dojo.extend(dojo.animation.AnimationEvent, {coordsAsInts:function () {
var cints = new Array(this.coords.length);
for (var i = 0; i < this.coords.length; i++) {
cints[i] = Math.round(this.coords[i]);
}
return cints;
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/animation/__package__.js
New file
0,0 → 1,14
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.kwCompoundRequire({common:["dojo.animation.AnimationEvent", "dojo.animation.Animation", "dojo.animation.AnimationSequence"]});
dojo.provide("dojo.animation.*");
dojo.deprecated("dojo.Animation.* is slated for removal in 0.5; use dojo.lfx.* instead.", "0.5");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/animation/AnimationSequence.js
New file
0,0 → 1,126
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.animation.AnimationSequence");
dojo.require("dojo.animation.AnimationEvent");
dojo.require("dojo.animation.Animation");
dojo.deprecated("dojo.animation.AnimationSequence is slated for removal in 0.5; use dojo.lfx.* instead.", "0.5");
dojo.animation.AnimationSequence = function (repeatCount) {
this._anims = [];
this.repeatCount = repeatCount || 0;
};
dojo.lang.extend(dojo.animation.AnimationSequence, {repeatCount:0, _anims:[], _currAnim:-1, onBegin:null, onEnd:null, onNext:null, handler:null, add:function () {
for (var i = 0; i < arguments.length; i++) {
this._anims.push(arguments[i]);
arguments[i]._animSequence = this;
}
}, remove:function (anim) {
for (var i = 0; i < this._anims.length; i++) {
if (this._anims[i] == anim) {
this._anims[i]._animSequence = null;
this._anims.splice(i, 1);
break;
}
}
}, removeAll:function () {
for (var i = 0; i < this._anims.length; i++) {
this._anims[i]._animSequence = null;
}
this._anims = [];
this._currAnim = -1;
}, clear:function () {
this.removeAll();
}, play:function (gotoStart) {
if (this._anims.length == 0) {
return;
}
if (gotoStart || !this._anims[this._currAnim]) {
this._currAnim = 0;
}
if (this._anims[this._currAnim]) {
if (this._currAnim == 0) {
var e = {type:"begin", animation:this._anims[this._currAnim]};
if (typeof this.handler == "function") {
this.handler(e);
}
if (typeof this.onBegin == "function") {
this.onBegin(e);
}
}
this._anims[this._currAnim].play(gotoStart);
}
}, pause:function () {
if (this._anims[this._currAnim]) {
this._anims[this._currAnim].pause();
}
}, playPause:function () {
if (this._anims.length == 0) {
return;
}
if (this._currAnim == -1) {
this._currAnim = 0;
}
if (this._anims[this._currAnim]) {
this._anims[this._currAnim].playPause();
}
}, stop:function () {
if (this._anims[this._currAnim]) {
this._anims[this._currAnim].stop();
}
}, status:function () {
if (this._anims[this._currAnim]) {
return this._anims[this._currAnim].status();
} else {
return "stopped";
}
}, _setCurrent:function (anim) {
for (var i = 0; i < this._anims.length; i++) {
if (this._anims[i] == anim) {
this._currAnim = i;
break;
}
}
}, _playNext:function () {
if (this._currAnim == -1 || this._anims.length == 0) {
return;
}
this._currAnim++;
if (this._anims[this._currAnim]) {
var e = {type:"next", animation:this._anims[this._currAnim]};
if (typeof this.handler == "function") {
this.handler(e);
}
if (typeof this.onNext == "function") {
this.onNext(e);
}
this._anims[this._currAnim].play(true);
} else {
var e = {type:"end", animation:this._anims[this._anims.length - 1]};
if (typeof this.handler == "function") {
this.handler(e);
}
if (typeof this.onEnd == "function") {
this.onEnd(e);
}
if (this.repeatCount > 0) {
this._currAnim = 0;
this.repeatCount--;
this._anims[this._currAnim].play(true);
} else {
if (this.repeatCount == -1) {
this._currAnim = 0;
this._anims[this._currAnim].play(true);
} else {
this._currAnim = -1;
}
}
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/hostenv_wsh.js
New file
0,0 → 1,33
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.hostenv.name_ = "wsh";
if (typeof WScript == "undefined") {
dojo.raise("attempt to use WSH host environment when no WScript global");
}
dojo.hostenv.println = WScript.Echo;
dojo.hostenv.getCurrentScriptUri = function () {
return WScript.ScriptFullName();
};
dojo.hostenv.getText = function (fpath) {
var fso = new ActiveXObject("Scripting.FileSystemObject");
var istream = fso.OpenTextFile(fpath, 1);
if (!istream) {
return null;
}
var contents = istream.ReadAll();
istream.Close();
return contents;
};
dojo.hostenv.exit = function (exitcode) {
WScript.Quit(exitcode);
};
dojo.requireIf((djConfig["isDebug"] || djConfig["debugAtAllCosts"]), "dojo.debug");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/rpc/RpcService.js
New file
0,0 → 1,72
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.rpc.RpcService");
dojo.require("dojo.io.*");
dojo.require("dojo.json");
dojo.require("dojo.lang.func");
dojo.require("dojo.Deferred");
dojo.rpc.RpcService = function (url) {
if (url) {
this.connect(url);
}
};
dojo.lang.extend(dojo.rpc.RpcService, {strictArgChecks:true, serviceUrl:"", parseResults:function (obj) {
return obj;
}, errorCallback:function (deferredRequestHandler) {
return function (type, e) {
deferredRequestHandler.errback(new Error(e.message));
};
}, resultCallback:function (deferredRequestHandler) {
var tf = dojo.lang.hitch(this, function (type, obj, e) {
if (obj["error"] != null) {
var err = new Error(obj.error);
err.id = obj.id;
deferredRequestHandler.errback(err);
} else {
var results = this.parseResults(obj);
deferredRequestHandler.callback(results);
}
});
return tf;
}, generateMethod:function (method, parameters, url) {
return dojo.lang.hitch(this, function () {
var deferredRequestHandler = new dojo.Deferred();
if ((this.strictArgChecks) && (parameters != null) && (arguments.length != parameters.length)) {
dojo.raise("Invalid number of parameters for remote method.");
} else {
this.bind(method, arguments, deferredRequestHandler, url);
}
return deferredRequestHandler;
});
}, processSmd:function (object) {
dojo.debug("RpcService: Processing returned SMD.");
if (object.methods) {
dojo.lang.forEach(object.methods, function (m) {
if (m && m["name"]) {
dojo.debug("RpcService: Creating Method: this.", m.name, "()");
this[m.name] = this.generateMethod(m.name, m.parameters, m["url"] || m["serviceUrl"] || m["serviceURL"]);
if (dojo.lang.isFunction(this[m.name])) {
dojo.debug("RpcService: Successfully created", m.name, "()");
} else {
dojo.debug("RpcService: Failed to create", m.name, "()");
}
}
}, this);
}
this.serviceUrl = object.serviceUrl || object.serviceURL;
dojo.debug("RpcService: Dojo RpcService is ready for use.");
}, connect:function (smdUrl) {
dojo.debug("RpcService: Attempting to load SMD document from:", smdUrl);
dojo.io.bind({url:smdUrl, mimetype:"text/json", load:dojo.lang.hitch(this, function (type, object, e) {
return this.processSmd(object);
}), sync:true});
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/rpc/yahoo.smd
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/rpc/yahoo.smd
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/rpc/__package__.js
New file
0,0 → 1,13
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.kwCompoundRequire({common:[["dojo.rpc.JsonService", false, false]]});
dojo.provide("dojo.rpc.*");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/rpc/JsonService.js
New file
0,0 → 1,69
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.rpc.JsonService");
dojo.require("dojo.rpc.RpcService");
dojo.require("dojo.io.*");
dojo.require("dojo.json");
dojo.require("dojo.lang.common");
dojo.rpc.JsonService = function (args) {
if (args) {
if (dojo.lang.isString(args)) {
this.connect(args);
} else {
if (args["smdUrl"]) {
this.connect(args.smdUrl);
}
if (args["smdStr"]) {
this.processSmd(dj_eval("(" + args.smdStr + ")"));
}
if (args["smdObj"]) {
this.processSmd(args.smdObj);
}
if (args["serviceUrl"]) {
this.serviceUrl = args.serviceUrl;
}
if (typeof args["strictArgChecks"] != "undefined") {
this.strictArgChecks = args.strictArgChecks;
}
}
}
};
dojo.inherits(dojo.rpc.JsonService, dojo.rpc.RpcService);
dojo.extend(dojo.rpc.JsonService, {bustCache:false, contentType:"application/json-rpc", lastSubmissionId:0, callRemote:function (method, params) {
var deferred = new dojo.Deferred();
this.bind(method, params, deferred);
return deferred;
}, bind:function (method, parameters, deferredRequestHandler, url) {
dojo.io.bind({url:url || this.serviceUrl, postContent:this.createRequest(method, parameters), method:"POST", contentType:this.contentType, mimetype:"text/json", load:this.resultCallback(deferredRequestHandler), error:this.errorCallback(deferredRequestHandler), preventCache:this.bustCache});
}, createRequest:function (method, params) {
var req = {"params":params, "method":method, "id":++this.lastSubmissionId};
var data = dojo.json.serialize(req);
dojo.debug("JsonService: JSON-RPC Request: " + data);
return data;
}, parseResults:function (obj) {
if (!obj) {
return;
}
if (obj["Result"] != null) {
return obj["Result"];
} else {
if (obj["result"] != null) {
return obj["result"];
} else {
if (obj["ResultSet"]) {
return obj["ResultSet"];
} else {
return obj;
}
}
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/rpc/JotService.js
New file
0,0 → 1,25
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.rpc.JotService");
dojo.require("dojo.rpc.RpcService");
dojo.require("dojo.rpc.JsonService");
dojo.require("dojo.json");
dojo.rpc.JotService = function () {
this.serviceUrl = "/_/jsonrpc";
};
dojo.inherits(dojo.rpc.JotService, dojo.rpc.JsonService);
dojo.lang.extend(dojo.rpc.JotService, {bind:function (method, parameters, deferredRequestHandler, url) {
dojo.io.bind({url:url || this.serviceUrl, content:{json:this.createRequest(method, parameters)}, method:"POST", mimetype:"text/json", load:this.resultCallback(deferredRequestHandler), error:this.errorCallback(deferredRequestHandler), preventCache:true});
}, createRequest:function (method, params) {
var req = {"params":params, "method":method, "id":this.lastSubmissionId++};
return dojo.json.serialize(req);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/rpc/Deferred.js
New file
0,0 → 1,16
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.rpc.Deferred");
dojo.require("dojo.Deferred");
dojo.deprecated("dojo.rpc.Deferred", "replaced by dojo.Deferred", "0.6");
dojo.rpc.Deferred = dojo.Deferred;
dojo.rpc.Deferred.prototype = dojo.Deferred.prototype;
 
/tags/Racine_livraison_narmer/api/js/dojo/src/rpc/YahooService.js
New file
0,0 → 1,39
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.rpc.YahooService");
dojo.require("dojo.rpc.RpcService");
dojo.require("dojo.rpc.JsonService");
dojo.require("dojo.json");
dojo.require("dojo.uri.*");
dojo.require("dojo.io.ScriptSrcIO");
dojo.rpc.YahooService = function (appId) {
this.appId = appId;
if (!appId) {
this.appId = "dojotoolkit";
dojo.debug("please initialize the YahooService class with your own", "application ID. Using the default may cause problems during", "deployment of your application");
}
if (djConfig["useXDomain"] && !djConfig["yahooServiceSmdUrl"]) {
dojo.debug("dojo.rpc.YahooService: When using cross-domain Dojo builds," + " please save yahoo.smd to your domain and set djConfig.yahooServiceSmdUrl" + " to the path on your domain to yahoo.smd");
}
this.connect(djConfig["yahooServiceSmdUrl"] || dojo.uri.moduleUri("dojo.rpc", "yahoo.smd"));
this.strictArgChecks = false;
};
dojo.inherits(dojo.rpc.YahooService, dojo.rpc.JsonService);
dojo.lang.extend(dojo.rpc.YahooService, {strictArgChecks:false, bind:function (method, parameters, deferredRequestHandler, url) {
var params = parameters;
if ((dojo.lang.isArrayLike(parameters)) && (parameters.length == 1)) {
params = parameters[0];
}
params.output = "json";
params.appid = this.appId;
dojo.io.bind({url:url || this.serviceUrl, transport:"ScriptSrcTransport", content:params, jsonParamName:"callback", mimetype:"text/json", load:this.resultCallback(deferredRequestHandler), error:this.errorCallback(deferredRequestHandler), preventCache:true});
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/gfx/shape.js
New file
0,0 → 1,174
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.gfx.shape");
dojo.require("dojo.lang.declare");
dojo.require("dojo.gfx.common");
dojo.declare("dojo.gfx.Shape", null, {initializer:function () {
this.rawNode = null;
this.shape = null;
this.matrix = null;
this.fillStyle = null;
this.strokeStyle = null;
this.bbox = null;
this.parent = null;
this.parentMatrix = null;
}, getNode:function () {
return this.rawNode;
}, getShape:function () {
return this.shape;
}, getTransform:function () {
return this.matrix;
}, getFill:function () {
return this.fillStyle;
}, getStroke:function () {
return this.strokeStyle;
}, getParent:function () {
return this.parent;
}, getBoundingBox:function () {
return this.bbox;
}, getEventSource:function () {
return this.rawNode;
}, setShape:function (shape) {
return this;
}, setFill:function (fill) {
return this;
}, setStroke:function (stroke) {
return this;
}, moveToFront:function () {
return this;
}, moveToBack:function () {
return this;
}, setTransform:function (matrix) {
this.matrix = dojo.gfx.matrix.clone(matrix ? dojo.gfx.matrix.normalize(matrix) : dojo.gfx.identity, true);
return this._applyTransform();
}, applyRightTransform:function (matrix) {
return matrix ? this.setTransform([this.matrix, matrix]) : this;
}, applyLeftTransform:function (matrix) {
return matrix ? this.setTransform([matrix, this.matrix]) : this;
}, applyTransform:function (matrix) {
return matrix ? this.setTransform([this.matrix, matrix]) : this;
}, remove:function (silently) {
if (this.parent) {
this.parent.remove(this, silently);
}
return this;
}, _setParent:function (parent, matrix) {
this.parent = parent;
return this._updateParentMatrix(matrix);
}, _updateParentMatrix:function (matrix) {
this.parentMatrix = matrix ? dojo.gfx.matrix.clone(matrix) : null;
return this._applyTransform();
}, _getRealMatrix:function () {
return this.parentMatrix ? new dojo.gfx.matrix.Matrix2D([this.parentMatrix, this.matrix]) : this.matrix;
}});
dojo.declare("dojo.gfx.shape.VirtualGroup", dojo.gfx.Shape, {initializer:function () {
this.children = [];
}, add:function (shape) {
var oldParent = shape.getParent();
if (oldParent) {
oldParent.remove(shape, true);
}
this.children.push(shape);
return shape._setParent(this, this._getRealMatrix());
}, remove:function (shape, silently) {
for (var i = 0; i < this.children.length; ++i) {
if (this.children[i] == shape) {
if (silently) {
} else {
shape._setParent(null, null);
}
this.children.splice(i, 1);
break;
}
}
return this;
}, _applyTransform:function () {
var matrix = this._getRealMatrix();
for (var i = 0; i < this.children.length; ++i) {
this.children[i]._updateParentMatrix(matrix);
}
return this;
}});
dojo.declare("dojo.gfx.shape.Rect", dojo.gfx.Shape, {initializer:function (rawNode) {
this.shape = dojo.lang.shallowCopy(dojo.gfx.defaultRect, true);
this.attach(rawNode);
}, getBoundingBox:function () {
return this.shape;
}});
dojo.declare("dojo.gfx.shape.Ellipse", dojo.gfx.Shape, {initializer:function (rawNode) {
this.shape = dojo.lang.shallowCopy(dojo.gfx.defaultEllipse, true);
this.attach(rawNode);
}, getBoundingBox:function () {
if (!this.bbox) {
var shape = this.shape;
this.bbox = {x:shape.cx - shape.rx, y:shape.cy - shape.ry, width:2 * shape.rx, height:2 * shape.ry};
}
return this.bbox;
}});
dojo.declare("dojo.gfx.shape.Circle", dojo.gfx.Shape, {initializer:function (rawNode) {
this.shape = dojo.lang.shallowCopy(dojo.gfx.defaultCircle, true);
this.attach(rawNode);
}, getBoundingBox:function () {
if (!this.bbox) {
var shape = this.shape;
this.bbox = {x:shape.cx - shape.r, y:shape.cy - shape.r, width:2 * shape.r, height:2 * shape.r};
}
return this.bbox;
}});
dojo.declare("dojo.gfx.shape.Line", dojo.gfx.Shape, {initializer:function (rawNode) {
this.shape = dojo.lang.shallowCopy(dojo.gfx.defaultLine, true);
this.attach(rawNode);
}, getBoundingBox:function () {
if (!this.bbox) {
var shape = this.shape;
this.bbox = {x:Math.min(shape.x1, shape.x2), y:Math.min(shape.y1, shape.y2), width:Math.abs(shape.x2 - shape.x1), height:Math.abs(shape.y2 - shape.y1)};
}
return this.bbox;
}});
dojo.declare("dojo.gfx.shape.Polyline", dojo.gfx.Shape, {initializer:function (rawNode) {
this.shape = dojo.lang.shallowCopy(dojo.gfx.defaultPolyline, true);
this.attach(rawNode);
}, getBoundingBox:function () {
if (!this.bbox && this.shape.points.length) {
var p = this.shape.points;
var l = p.length;
var t = p[0];
var bbox = {l:t.x, t:t.y, r:t.x, b:t.y};
for (var i = 1; i < l; ++i) {
t = p[i];
if (bbox.l > t.x) {
bbox.l = t.x;
}
if (bbox.r < t.x) {
bbox.r = t.x;
}
if (bbox.t > t.y) {
bbox.t = t.y;
}
if (bbox.b < t.y) {
bbox.b = t.y;
}
}
this.bbox = {x:bbox.l, y:bbox.t, width:bbox.r - bbox.l, height:bbox.b - bbox.t};
}
return this.bbox;
}});
dojo.declare("dojo.gfx.shape.Image", dojo.gfx.Shape, {initializer:function (rawNode) {
this.shape = dojo.lang.shallowCopy(dojo.gfx.defaultImage, true);
this.attach(rawNode);
}, getBoundingBox:function () {
if (!this.bbox) {
var shape = this.shape;
this.bbox = {x:0, y:0, width:shape.width, height:shape.height};
}
return this.bbox;
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/gfx/color/hsv.js
New file
0,0 → 1,208
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.gfx.color.hsv");
dojo.require("dojo.lang.array");
dojo.require("dojo.math");
dojo.lang.extend(dojo.gfx.color.Color, {toHsv:function () {
return dojo.gfx.color.rgb2hsv(this.toRgb());
}});
dojo.gfx.color.rgb2hsv = function (r, g, b, options) {
if (dojo.lang.isArray(r)) {
if (g) {
options = g;
}
b = r[2] || 0;
g = r[1] || 0;
r = r[0] || 0;
}
var opt = {inputRange:(options && options.inputRange) ? options.inputRange : 255, outputRange:(options && options.outputRange) ? options.outputRange : [255, 255, 255]};
var h = null;
var s = null;
var v = null;
switch (opt.inputRange) {
case 1:
r = (r * 255);
g = (g * 255);
b = (b * 255);
break;
case 100:
r = (r / 100) * 255;
g = (g / 100) * 255;
b = (b / 100) * 255;
break;
default:
break;
}
var min = Math.min(r, g, b);
v = Math.max(r, g, b);
var delta = v - min;
s = (v == 0) ? 0 : delta / v;
if (s == 0) {
h = 0;
} else {
if (r == v) {
h = 60 * (g - b) / delta;
} else {
if (g == v) {
h = 120 + 60 * (b - r) / delta;
} else {
if (b == v) {
h = 240 + 60 * (r - g) / delta;
}
}
}
if (h <= 0) {
h += 360;
}
}
switch (opt.outputRange[0]) {
case 360:
break;
case 100:
h = (h / 360) * 100;
break;
case 1:
h = (h / 360);
break;
default:
h = (h / 360) * 255;
break;
}
switch (opt.outputRange[1]) {
case 100:
s = s * 100;
case 1:
break;
default:
s = s * 255;
break;
}
switch (opt.outputRange[2]) {
case 100:
v = (v / 255) * 100;
break;
case 1:
v = (v / 255);
break;
default:
break;
}
h = dojo.math.round(h);
s = dojo.math.round(s);
v = dojo.math.round(v);
return [h, s, v];
};
dojo.gfx.color.hsv2rgb = function (h, s, v, options) {
if (dojo.lang.isArray(h)) {
if (s) {
options = s;
}
v = h[2] || 0;
s = h[1] || 0;
h = h[0] || 0;
}
var opt = {inputRange:(options && options.inputRange) ? options.inputRange : [255, 255, 255], outputRange:(options && options.outputRange) ? options.outputRange : 255};
switch (opt.inputRange[0]) {
case 1:
h = h * 360;
break;
case 100:
h = (h / 100) * 360;
break;
case 360:
h = h;
break;
default:
h = (h / 255) * 360;
}
if (h == 360) {
h = 0;
}
switch (opt.inputRange[1]) {
case 100:
s /= 100;
break;
case 255:
s /= 255;
}
switch (opt.inputRange[2]) {
case 100:
v /= 100;
break;
case 255:
v /= 255;
}
var r = null;
var g = null;
var b = null;
if (s == 0) {
r = v;
g = v;
b = v;
} else {
var hTemp = h / 60;
var i = Math.floor(hTemp);
var f = hTemp - i;
var p = v * (1 - s);
var q = v * (1 - (s * f));
var t = v * (1 - (s * (1 - f)));
switch (i) {
case 0:
r = v;
g = t;
b = p;
break;
case 1:
r = q;
g = v;
b = p;
break;
case 2:
r = p;
g = v;
b = t;
break;
case 3:
r = p;
g = q;
b = v;
break;
case 4:
r = t;
g = p;
b = v;
break;
case 5:
r = v;
g = p;
b = q;
break;
}
}
switch (opt.outputRange) {
case 1:
r = dojo.math.round(r, 2);
g = dojo.math.round(g, 2);
b = dojo.math.round(b, 2);
break;
case 100:
r = Math.round(r * 100);
g = Math.round(g * 100);
b = Math.round(b * 100);
break;
default:
r = Math.round(r * 255);
g = Math.round(g * 255);
b = Math.round(b * 255);
}
return [r, g, b];
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/gfx/color/hsl.js
New file
0,0 → 1,116
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.gfx.color.hsl");
dojo.require("dojo.lang.array");
dojo.lang.extend(dojo.gfx.color.Color, {toHsl:function () {
return dojo.gfx.color.rgb2hsl(this.toRgb());
}});
dojo.gfx.color.rgb2hsl = function (r, g, b) {
if (dojo.lang.isArray(r)) {
b = r[2] || 0;
g = r[1] || 0;
r = r[0] || 0;
}
r /= 255;
g /= 255;
b /= 255;
var h = null;
var s = null;
var l = null;
var min = Math.min(r, g, b);
var max = Math.max(r, g, b);
var delta = max - min;
l = (min + max) / 2;
s = 0;
if ((l > 0) && (l < 1)) {
s = delta / ((l < 0.5) ? (2 * l) : (2 - 2 * l));
}
h = 0;
if (delta > 0) {
if ((max == r) && (max != g)) {
h += (g - b) / delta;
}
if ((max == g) && (max != b)) {
h += (2 + (b - r) / delta);
}
if ((max == b) && (max != r)) {
h += (4 + (r - g) / delta);
}
h *= 60;
}
h = (h == 0) ? 360 : Math.ceil((h / 360) * 255);
s = Math.ceil(s * 255);
l = Math.ceil(l * 255);
return [h, s, l];
};
dojo.gfx.color.hsl2rgb = function (h, s, l) {
if (dojo.lang.isArray(h)) {
l = h[2] || 0;
s = h[1] || 0;
h = h[0] || 0;
}
h = (h / 255) * 360;
if (h == 360) {
h = 0;
}
s = s / 255;
l = l / 255;
while (h < 0) {
h += 360;
}
while (h > 360) {
h -= 360;
}
var r, g, b;
if (h < 120) {
r = (120 - h) / 60;
g = h / 60;
b = 0;
} else {
if (h < 240) {
r = 0;
g = (240 - h) / 60;
b = (h - 120) / 60;
} else {
r = (h - 240) / 60;
g = 0;
b = (360 - h) / 60;
}
}
r = Math.min(r, 1);
g = Math.min(g, 1);
b = Math.min(b, 1);
r = 2 * s * r + (1 - s);
g = 2 * s * g + (1 - s);
b = 2 * s * b + (1 - s);
if (l < 0.5) {
r = l * r;
g = l * g;
b = l * b;
} else {
r = (1 - l) * r + 2 * l - 1;
g = (1 - l) * g + 2 * l - 1;
b = (1 - l) * b + 2 * l - 1;
}
r = Math.ceil(r * 255);
g = Math.ceil(g * 255);
b = Math.ceil(b * 255);
return [r, g, b];
};
dojo.gfx.color.hsl2hex = function (h, s, l) {
var rgb = dojo.gfx.color.hsl2rgb(h, s, l);
return dojo.gfx.color.rgb2hex(rgb[0], rgb[1], rgb[2]);
};
dojo.gfx.color.hex2hsl = function (hex) {
var rgb = dojo.gfx.color.hex2rgb(hex);
return dojo.gfx.color.rgb2hsl(rgb[0], rgb[1], rgb[2]);
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/gfx/matrix.js
New file
0,0 → 1,146
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.gfx.matrix");
dojo.require("dojo.lang.common");
dojo.require("dojo.math.*");
dojo.gfx.matrix.Matrix2D = function (arg) {
if (arg) {
if (arg instanceof Array) {
if (arg.length > 0) {
var m = dojo.gfx.matrix.normalize(arg[0]);
for (var i = 1; i < arg.length; ++i) {
var l = m;
var r = dojo.gfx.matrix.normalize(arg[i]);
m = new dojo.gfx.matrix.Matrix2D();
m.xx = l.xx * r.xx + l.xy * r.yx;
m.xy = l.xx * r.xy + l.xy * r.yy;
m.yx = l.yx * r.xx + l.yy * r.yx;
m.yy = l.yx * r.xy + l.yy * r.yy;
m.dx = l.xx * r.dx + l.xy * r.dy + l.dx;
m.dy = l.yx * r.dx + l.yy * r.dy + l.dy;
}
dojo.mixin(this, m);
}
} else {
dojo.mixin(this, arg);
}
}
};
dojo.extend(dojo.gfx.matrix.Matrix2D, {xx:1, xy:0, yx:0, yy:1, dx:0, dy:0});
dojo.mixin(dojo.gfx.matrix, {identity:new dojo.gfx.matrix.Matrix2D(), flipX:new dojo.gfx.matrix.Matrix2D({xx:-1}), flipY:new dojo.gfx.matrix.Matrix2D({yy:-1}), flipXY:new dojo.gfx.matrix.Matrix2D({xx:-1, yy:-1}), translate:function (a, b) {
if (arguments.length > 1) {
return new dojo.gfx.matrix.Matrix2D({dx:a, dy:b});
}
return new dojo.gfx.matrix.Matrix2D({dx:a.x, dy:a.y});
}, scale:function (a, b) {
if (arguments.length > 1) {
return new dojo.gfx.matrix.Matrix2D({xx:a, yy:b});
}
if (typeof a == "number") {
return new dojo.gfx.matrix.Matrix2D({xx:a, yy:a});
}
return new dojo.gfx.matrix.Matrix2D({xx:a.x, yy:a.y});
}, rotate:function (angle) {
var c = Math.cos(angle);
var s = Math.sin(angle);
return new dojo.gfx.matrix.Matrix2D({xx:c, xy:s, yx:-s, yy:c});
}, rotateg:function (degree) {
return dojo.gfx.matrix.rotate(dojo.math.degToRad(degree));
}, skewX:function (angle) {
return new dojo.gfx.matrix.Matrix2D({xy:Math.tan(angle)});
}, skewXg:function (degree) {
return dojo.gfx.matrix.skewX(dojo.math.degToRad(degree));
}, skewY:function (angle) {
return new dojo.gfx.matrix.Matrix2D({yx:-Math.tan(angle)});
}, skewYg:function (degree) {
return dojo.gfx.matrix.skewY(dojo.math.degToRad(degree));
}, normalize:function (matrix) {
return (matrix instanceof dojo.gfx.matrix.Matrix2D) ? matrix : new dojo.gfx.matrix.Matrix2D(matrix);
}, clone:function (matrix) {
var obj = new dojo.gfx.matrix.Matrix2D();
for (var i in matrix) {
if (typeof (matrix[i]) == "number" && typeof (obj[i]) == "number" && obj[i] != matrix[i]) {
obj[i] = matrix[i];
}
}
return obj;
}, invert:function (matrix) {
var m = dojo.gfx.matrix.normalize(matrix);
var D = m.xx * m.yy - m.xy * m.yx;
var M = new dojo.gfx.matrix.Matrix2D({xx:m.yy / D, xy:-m.xy / D, yx:-m.yx / D, yy:m.xx / D, dx:(m.yx * m.dy - m.yy * m.dx) / D, dy:(m.xy * m.dx - m.xx * m.dy) / D});
return M;
}, _multiplyPoint:function (m, x, y) {
return {x:m.xx * x + m.xy * y + m.dx, y:m.yx * x + m.yy * y + m.dy};
}, multiplyPoint:function (matrix, a, b) {
var m = dojo.gfx.matrix.normalize(matrix);
if (typeof a == "number" && typeof b == "number") {
return dojo.gfx.matrix._multiplyPoint(m, a, b);
}
return dojo.gfx.matrix._multiplyPoint(m, a.x, a.y);
}, multiply:function (matrix) {
var m = dojo.gfx.matrix.normalize(matrix);
for (var i = 1; i < arguments.length; ++i) {
var l = m;
var r = dojo.gfx.matrix.normalize(arguments[i]);
m = new dojo.gfx.matrix.Matrix2D();
m.xx = l.xx * r.xx + l.xy * r.yx;
m.xy = l.xx * r.xy + l.xy * r.yy;
m.yx = l.yx * r.xx + l.yy * r.yx;
m.yy = l.yx * r.xy + l.yy * r.yy;
m.dx = l.xx * r.dx + l.xy * r.dy + l.dx;
m.dy = l.yx * r.dx + l.yy * r.dy + l.dy;
}
return m;
}, _sandwich:function (m, x, y) {
return dojo.gfx.matrix.multiply(dojo.gfx.matrix.translate(x, y), m, dojo.gfx.matrix.translate(-x, -y));
}, scaleAt:function (a, b, c, d) {
switch (arguments.length) {
case 4:
return dojo.gfx.matrix._sandwich(dojo.gfx.matrix.scale(a, b), c, d);
case 3:
if (typeof c == "number") {
return dojo.gfx.matrix._sandwich(dojo.gfx.matrix.scale(a), b, c);
}
return dojo.gfx.matrix._sandwich(dojo.gfx.matrix.scale(a, b), c.x, c.y);
}
return dojo.gfx.matrix._sandwich(dojo.gfx.matrix.scale(a), b.x, b.y);
}, rotateAt:function (angle, a, b) {
if (arguments.length > 2) {
return dojo.gfx.matrix._sandwich(dojo.gfx.matrix.rotate(angle), a, b);
}
return dojo.gfx.matrix._sandwich(dojo.gfx.matrix.rotate(angle), a.x, a.y);
}, rotategAt:function (degree, a, b) {
if (arguments.length > 2) {
return dojo.gfx.matrix._sandwich(dojo.gfx.matrix.rotateg(degree), a, b);
}
return dojo.gfx.matrix._sandwich(dojo.gfx.matrix.rotateg(degree), a.x, a.y);
}, skewXAt:function (angle, a, b) {
if (arguments.length > 2) {
return dojo.gfx.matrix._sandwich(dojo.gfx.matrix.skewX(angle), a, b);
}
return dojo.gfx.matrix._sandwich(dojo.gfx.matrix.skewX(angle), a.x, a.y);
}, skewXgAt:function (degree, a, b) {
if (arguments.length > 2) {
return dojo.gfx.matrix._sandwich(dojo.gfx.matrix.skewXg(degree), a, b);
}
return dojo.gfx.matrix._sandwich(dojo.gfx.matrix.skewXg(degree), a.x, a.y);
}, skewYAt:function (angle, a, b) {
if (arguments.length > 2) {
return dojo.gfx.matrix._sandwich(dojo.gfx.matrix.skewY(angle), a, b);
}
return dojo.gfx.matrix._sandwich(dojo.gfx.matrix.skewY(angle), a.x, a.y);
}, skewYgAt:function (degree, a, b) {
if (arguments.length > 2) {
return dojo.gfx.matrix._sandwich(dojo.gfx.matrix.skewYg(degree), a, b);
}
return dojo.gfx.matrix._sandwich(dojo.gfx.matrix.skewYg(degree), a.x, a.y);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/gfx/__package__.js
New file
0,0 → 1,15
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.kwCompoundRequire({common:["dojo.gfx.color", "dojo.gfx.matrix", "dojo.gfx.common"]});
dojo.requireIf(dojo.render.svg.capable, "dojo.gfx.svg");
dojo.requireIf(dojo.render.vml.capable, "dojo.gfx.vml");
dojo.provide("dojo.gfx.*");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/gfx/common.js
New file
0,0 → 1,61
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.gfx.common");
dojo.require("dojo.gfx.color");
dojo.require("dojo.lang.declare");
dojo.require("dojo.lang.extras");
dojo.require("dojo.dom");
dojo.lang.mixin(dojo.gfx, {defaultPath:{type:"path", path:""}, defaultPolyline:{type:"polyline", points:[]}, defaultRect:{type:"rect", x:0, y:0, width:100, height:100, r:0}, defaultEllipse:{type:"ellipse", cx:0, cy:0, rx:200, ry:100}, defaultCircle:{type:"circle", cx:0, cy:0, r:100}, defaultLine:{type:"line", x1:0, y1:0, x2:100, y2:100}, defaultImage:{type:"image", width:0, height:0, src:""}, defaultStroke:{color:"black", width:1, cap:"butt", join:4}, defaultLinearGradient:{type:"linear", x1:0, y1:0, x2:100, y2:100, colors:[{offset:0, color:"black"}, {offset:1, color:"white"}]}, defaultRadialGradient:{type:"radial", cx:0, cy:0, r:100, colors:[{offset:0, color:"black"}, {offset:1, color:"white"}]}, defaultPattern:{type:"pattern", x:0, y:0, width:0, height:0, src:""}, normalizeColor:function (color) {
return (color instanceof dojo.gfx.color.Color) ? color : new dojo.gfx.color.Color(color);
}, normalizeParameters:function (existed, update) {
if (update) {
var empty = {};
for (var x in existed) {
if (x in update && !(x in empty)) {
existed[x] = update[x];
}
}
}
return existed;
}, makeParameters:function (defaults, update) {
if (!update) {
return dojo.lang.shallowCopy(defaults, true);
}
var result = {};
for (var i in defaults) {
if (!(i in result)) {
result[i] = dojo.lang.shallowCopy((i in update) ? update[i] : defaults[i], true);
}
}
return result;
}, formatNumber:function (x, addSpace) {
var val = x.toString();
if (val.indexOf("e") >= 0) {
val = x.toFixed(4);
} else {
var point = val.indexOf(".");
if (point >= 0 && val.length - point > 5) {
val = x.toFixed(4);
}
}
if (x < 0) {
return val;
}
return addSpace ? " " + val : val;
}, pathRegExp:/([A-Za-z]+)|(\d+(\.\d+)?)|(\.\d+)|(-\d+(\.\d+)?)|(-\.\d+)/g});
dojo.declare("dojo.gfx.Surface", null, {initializer:function () {
this.rawNode = null;
}, getEventSource:function () {
return this.rawNode;
}});
dojo.declare("dojo.gfx.Point", null, {});
dojo.declare("dojo.gfx.Rectangle", null, {});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/gfx/Colorspace.js
New file
0,0 → 1,721
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.gfx.Colorspace");
dojo.require("dojo.lang.common");
dojo.require("dojo.math.matrix");
dojo.gfx.Colorspace = function () {
this.whitePoint = "D65";
this.stdObserver = "10";
this.chromaticAdaptationAlg = "bradford";
this.RGBWorkingSpace = "s_rgb";
this.useApproxCIELabMapping = 1;
this.chainMaps = {"RGB_to_xyY":["XYZ"], "xyY_to_RGB":["XYZ"], "RGB_to_Lab":["XYZ"], "Lab_to_RGB":["XYZ"], "RGB_to_LCHab":["XYZ", "Lab"], "LCHab_to_RGB":["Lab"], "xyY_to_Lab":["XYZ"], "Lab_to_xyY":["XYZ"], "XYZ_to_LCHab":["Lab"], "LCHab_to_XYZ":["Lab"], "xyY_to_LCHab":["XYZ", "Lab"], "LCHab_to_xyY":["Lab", "XYZ"], "RGB_to_Luv":["XYZ"], "Luv_to_RGB":["XYZ"], "xyY_to_Luv":["XYZ"], "Luv_to_xyY":["XYZ"], "Lab_to_Luv":["XYZ"], "Luv_to_Lab":["XYZ"], "LCHab_to_Luv":["Lab", "XYZ"], "Luv_to_LCHab":["XYZ", "Lab"], "RGB_to_LCHuv":["XYZ", "Luv"], "LCHuv_to_RGB":["Luv", "XYZ"], "XYZ_to_LCHuv":["Luv"], "LCHuv_to_XYZ":["Luv"], "xyY_to_LCHuv":["XYZ", "Luv"], "LCHuv_to_xyY":["Luv", "XYZ"], "Lab_to_LCHuv":["XYZ", "Luv"], "LCHuv_to_Lab":["Luv", "XYZ"], "LCHab_to_LCHuv":["Lab", "XYZ", "Luv"], "LCHuv_to_LCHab":["Luv", "XYZ", "Lab"], "XYZ_to_CMY":["RGB"], "CMY_to_XYZ":["RGB"], "xyY_to_CMY":["RGB"], "CMY_to_xyY":["RGB"], "Lab_to_CMY":["RGB"], "CMY_to_Lab":["RGB"], "LCHab_to_CMY":["RGB"], "CMY_to_LCHab":["RGB"], "Luv_to_CMY":["RGB"], "CMY_to_Luv":["RGB"], "LCHuv_to_CMY":["RGB"], "CMY_to_LCHuv":["RGB"], "XYZ_to_HSL":["RGB"], "HSL_to_XYZ":["RGB"], "xyY_to_HSL":["RGB"], "HSL_to_xyY":["RGB"], "Lab_to_HSL":["RGB"], "HSL_to_Lab":["RGB"], "LCHab_to_HSL":["RGB"], "HSL_to_LCHab":["RGB"], "Luv_to_HSL":["RGB"], "HSL_to_Luv":["RGB"], "LCHuv_to_HSL":["RGB"], "HSL_to_LCHuv":["RGB"], "CMY_to_HSL":["RGB"], "HSL_to_CMY":["RGB"], "CMYK_to_HSL":["RGB"], "HSL_to_CMYK":["RGB"], "XYZ_to_HSV":["RGB"], "HSV_to_XYZ":["RGB"], "xyY_to_HSV":["RGB"], "HSV_to_xyY":["RGB"], "Lab_to_HSV":["RGB"], "HSV_to_Lab":["RGB"], "LCHab_to_HSV":["RGB"], "HSV_to_LCHab":["RGB"], "Luv_to_HSV":["RGB"], "HSV_to_Luv":["RGB"], "LCHuv_to_HSV":["RGB"], "HSV_to_LCHuv":["RGB"], "CMY_to_HSV":["RGB"], "HSV_to_CMY":["RGB"], "CMYK_to_HSV":["RGB"], "HSV_to_CMYK":["RGB"], "HSL_to_HSV":["RGB"], "HSV_to_HSL":["RGB"], "XYZ_to_CMYK":["RGB"], "CMYK_to_XYZ":["RGB"], "xyY_to_CMYK":["RGB"], "CMYK_to_xyY":["RGB"], "Lab_to_CMYK":["RGB"], "CMYK_to_Lab":["RGB"], "LCHab_to_CMYK":["RGB"], "CMYK_to_LCHab":["RGB"], "Luv_to_CMYK":["RGB"], "CMYK_to_Luv":["RGB"], "LCHuv_to_CMYK":["RGB"], "CMYK_to_LCHuv":["RGB"]};
return this;
};
dojo.gfx.Colorspace.prototype.convert = function (col, model_from, model_to) {
var k = model_from + "_to_" + model_to;
if (this[k]) {
return this[k](col);
} else {
if (this.chainMaps[k]) {
var cur = model_from;
var models = this.chainMaps[k].concat();
models.push(model_to);
for (var i = 0; i < models.length; i++) {
col = this.convert(col, cur, models[i]);
cur = models[i];
}
return col;
} else {
dojo.debug("Can't convert from " + model_from + " to " + model_to);
}
}
};
dojo.gfx.Colorspace.prototype.munge = function (keys, args) {
if (dojo.lang.isArray(args[0])) {
args = args[0];
}
var out = new Array();
for (var i = 0; i < keys.length; i++) {
out[keys.charAt(i)] = args[i];
}
return out;
};
dojo.gfx.Colorspace.prototype.getWhitePoint = function () {
var x = 0;
var y = 0;
var t = 0;
switch (this.stdObserver) {
case "2":
switch (this.whitePoint) {
case "E":
x = 1 / 3;
y = 1 / 3;
t = 5400;
break;
case "D50":
x = 0.34567;
y = 0.3585;
t = 5000;
break;
case "D55":
x = 0.33242;
y = 0.34743;
t = 5500;
break;
case "D65":
x = 0.31271;
y = 0.32902;
t = 6500;
break;
case "D75":
x = 0.29902;
y = 0.31485;
t = 7500;
break;
case "A":
x = 0.44757;
y = 0.40745;
t = 2856;
break;
case "B":
x = 0.34842;
y = 0.35161;
t = 4874;
break;
case "C":
x = 0.31006;
y = 0.31616;
t = 6774;
break;
case "9300":
x = 0.2848;
y = 0.2932;
t = 9300;
break;
case "F2":
x = 0.37207;
y = 0.37512;
t = 4200;
break;
case "F7":
x = 0.31285;
y = 0.32918;
t = 6500;
break;
case "F11":
x = 0.38054;
y = 0.37691;
t = 4000;
break;
default:
dojo.debug("White point " + this.whitePoint + " isn't defined for Std. Observer " + this.strObserver);
}
break;
case "10":
switch (this.whitePoint) {
case "E":
x = 1 / 3;
y = 1 / 3;
t = 5400;
break;
case "D50":
x = 0.34773;
y = 0.35952;
t = 5000;
break;
case "D55":
x = 0.33411;
y = 0.34877;
t = 5500;
break;
case "D65":
x = 0.31382;
y = 0.331;
t = 6500;
break;
case "D75":
x = 0.29968;
y = 0.3174;
t = 7500;
break;
case "A":
x = 0.45117;
y = 0.40594;
t = 2856;
break;
case "B":
x = 0.3498;
y = 0.3527;
t = 4874;
break;
case "C":
x = 0.31039;
y = 0.31905;
t = 6774;
break;
case "F2":
x = 0.37928;
y = 0.36723;
t = 4200;
break;
case "F7":
x = 0.31565;
y = 0.32951;
t = 6500;
break;
case "F11":
x = 0.38543;
y = 0.3711;
t = 4000;
break;
default:
dojo.debug("White point " + this.whitePoint + " isn't defined for Std. Observer " + this.strObserver);
}
break;
default:
dojo.debug("Std. Observer " + this.strObserver + " isn't defined");
}
var z = 1 - x - y;
var wp = {"x":x, "y":y, "z":z, "t":t};
wp.Y = 1;
var XYZ = this.xyY_to_XYZ([wp.x, wp.y, wp.Y]);
wp.X = XYZ[0];
wp.Y = XYZ[1];
wp.Z = XYZ[2];
return wp;
};
dojo.gfx.Colorspace.prototype.getPrimaries = function () {
var m = [];
switch (this.RGBWorkingSpace) {
case "adobe_rgb_1998":
m = [2.2, "D65", 0.64, 0.33, 0.297361, 0.21, 0.71, 0.627355, 0.15, 0.06, 0.075285];
break;
case "apple_rgb":
m = [1.8, "D65", 0.625, 0.34, 0.244634, 0.28, 0.595, 0.672034, 0.155, 0.07, 0.083332];
break;
case "best_rgb":
m = [2.2, "D50", 0.7347, 0.2653, 0.228457, 0.215, 0.775, 0.737352, 0.13, 0.035, 0.034191];
break;
case "beta_rgb":
m = [2.2, "D50", 0.6888, 0.3112, 0.303273, 0.1986, 0.7551, 0.663786, 0.1265, 0.0352, 0.032941];
break;
case "bruce_rgb":
m = [2.2, "D65", 0.64, 0.33, 0.240995, 0.28, 0.65, 0.683554, 0.15, 0.06, 0.075452];
break;
case "cie_rgb":
m = [2.2, "E", 0.735, 0.265, 0.176204, 0.274, 0.717, 0.812985, 0.167, 0.009, 0.010811];
break;
case "color_match_rgb":
m = [1.8, "D50", 0.63, 0.34, 0.274884, 0.295, 0.605, 0.658132, 0.15, 0.075, 0.066985];
break;
case "don_rgb_4":
m = [2.2, "D50", 0.696, 0.3, 0.27835, 0.215, 0.765, 0.68797, 0.13, 0.035, 0.03368];
break;
case "eci_rgb":
m = [1.8, "D50", 0.67, 0.33, 0.32025, 0.21, 0.71, 0.602071, 0.14, 0.08, 0.077679];
break;
case "ekta_space_ps5":
m = [2.2, "D50", 0.695, 0.305, 0.260629, 0.26, 0.7, 0.734946, 0.11, 0.005, 0.004425];
break;
case "ntsc_rgb":
m = [2.2, "C", 0.67, 0.33, 0.298839, 0.21, 0.71, 0.586811, 0.14, 0.08, 0.11435];
break;
case "pal_secam_rgb":
m = [2.2, "D65", 0.64, 0.33, 0.222021, 0.29, 0.6, 0.706645, 0.15, 0.06, 0.071334];
break;
case "pro_photo_rgb":
m = [1.8, "D50", 0.7347, 0.2653, 0.28804, 0.1596, 0.8404, 0.711874, 0.0366, 0.0001, 0.000086];
break;
case "smpte-c_rgb":
m = [2.2, "D65", 0.63, 0.34, 0.212395, 0.31, 0.595, 0.701049, 0.155, 0.07, 0.086556];
break;
case "s_rgb":
m = [2.2, "D65", 0.64, 0.33, 0.212656, 0.3, 0.6, 0.715158, 0.15, 0.06, 0.072186];
break;
case "wide_gamut_rgb":
m = [2.2, "D50", 0.735, 0.265, 0.258187, 0.115, 0.826, 0.724938, 0.157, 0.018, 0.016875];
break;
default:
dojo.debug("RGB working space " + this.RGBWorkingSpace + " isn't defined");
}
var p = {name:this.RGBWorkingSpace, gamma:m[0], wp:m[1], xr:m[2], yr:m[3], Yr:m[4], xg:m[5], yg:m[6], Yg:m[7], xb:m[8], yb:m[9], Yb:m[10]};
if (p.wp != this.whitePoint) {
var r = this.XYZ_to_xyY(this.chromaticAdaptation(this.xyY_to_XYZ([p.xr, p.yr, p.Yr]), p.wp, this.whitePoint));
var g = this.XYZ_to_xyY(this.chromaticAdaptation(this.xyY_to_XYZ([p.xg, p.yg, p.Yg]), p.wp, this.whitePoint));
var b = this.XYZ_to_xyY(this.chromaticAdaptation(this.xyY_to_XYZ([p.xb, p.yb, p.Yb]), p.wp, this.whitePoint));
p.xr = r[0];
p.yr = r[1];
p.Yr = r[2];
p.xg = g[0];
p.yg = g[1];
p.Yg = g[2];
p.xb = b[0];
p.yb = b[1];
p.Yb = b[2];
p.wp = this.whitePoint;
}
p.zr = 1 - p.xr - p.yr;
p.zg = 1 - p.xg - p.yg;
p.zb = 1 - p.xb - p.yb;
return p;
};
dojo.gfx.Colorspace.prototype.epsilon = function () {
return this.useApproxCIELabMapping ? 0.008856 : 216 / 24289;
};
dojo.gfx.Colorspace.prototype.kappa = function () {
return this.useApproxCIELabMapping ? 903.3 : 24389 / 27;
};
dojo.gfx.Colorspace.prototype.XYZ_to_xyY = function () {
var src = this.munge("XYZ", arguments);
var sum = src.X + src.Y + src.Z;
if (sum == 0) {
var wp = this.getWhitePoint();
var x = wp.x;
var y = wp.y;
} else {
var x = src.X / sum;
var y = src.Y / sum;
}
var Y = src.Y;
return [x, y, Y];
};
dojo.gfx.Colorspace.prototype.xyY_to_XYZ = function () {
var src = this.munge("xyY", arguments);
if (src.y == 0) {
var X = 0;
var Y = 0;
var Z = 0;
} else {
var X = (src.x * src.Y) / src.y;
var Y = src.Y;
var Z = ((1 - src.x - src.y) * src.Y) / src.y;
}
return [X, Y, Z];
};
dojo.gfx.Colorspace.prototype.RGB_to_XYZ = function () {
var src = this.munge("RGB", arguments);
var m = this.getRGB_XYZ_Matrix();
var pr = this.getPrimaries();
if (this.RGBWorkingSpace == "s_rgb") {
var r = (src.R > 0.04045) ? Math.pow(((src.R + 0.055) / 1.055), 2.4) : src.R / 12.92;
var g = (src.G > 0.04045) ? Math.pow(((src.G + 0.055) / 1.055), 2.4) : src.G / 12.92;
var b = (src.B > 0.04045) ? Math.pow(((src.B + 0.055) / 1.055), 2.4) : src.B / 12.92;
} else {
var r = Math.pow(src.R, pr.gamma);
var g = Math.pow(src.G, pr.gamma);
var b = Math.pow(src.B, pr.gamma);
}
var XYZ = dojo.math.matrix.multiply([[r, g, b]], m);
return [XYZ[0][0], XYZ[0][1], XYZ[0][2]];
};
dojo.gfx.Colorspace.prototype.XYZ_to_RGB = function () {
var src = this.munge("XYZ", arguments);
var mi = this.getXYZ_RGB_Matrix();
var pr = this.getPrimaries();
var rgb = dojo.math.matrix.multiply([[src.X, src.Y, src.Z]], mi);
var r = rgb[0][0];
var g = rgb[0][1];
var b = rgb[0][2];
if (this.RGBWorkingSpace == "s_rgb") {
var R = (r > 0.0031308) ? (1.055 * Math.pow(r, 1 / 2.4)) - 0.055 : 12.92 * r;
var G = (g > 0.0031308) ? (1.055 * Math.pow(g, 1 / 2.4)) - 0.055 : 12.92 * g;
var B = (b > 0.0031308) ? (1.055 * Math.pow(b, 1 / 2.4)) - 0.055 : 12.92 * b;
} else {
var R = Math.pow(r, 1 / pr.gamma);
var G = Math.pow(g, 1 / pr.gamma);
var B = Math.pow(b, 1 / pr.gamma);
}
return [R, G, B];
};
dojo.gfx.Colorspace.prototype.XYZ_to_Lab = function () {
var src = this.munge("XYZ", arguments);
var wp = this.getWhitePoint();
var xr = src.X / wp.X;
var yr = src.Y / wp.Y;
var zr = src.Z / wp.Z;
var fx = (xr > this.epsilon()) ? Math.pow(xr, 1 / 3) : (this.kappa() * xr + 16) / 116;
var fy = (yr > this.epsilon()) ? Math.pow(yr, 1 / 3) : (this.kappa() * yr + 16) / 116;
var fz = (zr > this.epsilon()) ? Math.pow(zr, 1 / 3) : (this.kappa() * zr + 16) / 116;
var L = 116 * fy - 16;
var a = 500 * (fx - fy);
var b = 200 * (fy - fz);
return [L, a, b];
};
dojo.gfx.Colorspace.prototype.Lab_to_XYZ = function () {
var src = this.munge("Lab", arguments);
var wp = this.getWhitePoint();
var yr = (src.L > (this.kappa() * this.epsilon())) ? Math.pow((src.L + 16) / 116, 3) : src.L / this.kappa();
var fy = (yr > this.epsilon()) ? (src.L + 16) / 116 : (this.kappa() * yr + 16) / 116;
var fx = (src.a / 500) + fy;
var fz = fy - (src.b / 200);
var fxcube = Math.pow(fx, 3);
var fzcube = Math.pow(fz, 3);
var xr = (fxcube > this.epsilon()) ? fxcube : (116 * fx - 16) / this.kappa();
var zr = (fzcube > this.epsilon()) ? fzcube : (116 * fz - 16) / this.kappa();
var X = xr * wp.X;
var Y = yr * wp.Y;
var Z = zr * wp.Z;
return [X, Y, Z];
};
dojo.gfx.Colorspace.prototype.Lab_to_LCHab = function () {
var src = this.munge("Lab", arguments);
var L = src.L;
var C = Math.pow(src.a * src.a + src.b * src.b, 0.5);
var H = Math.atan2(src.b, src.a) * (180 / Math.PI);
if (H < 0) {
H += 360;
}
if (H > 360) {
H -= 360;
}
return [L, C, H];
};
dojo.gfx.Colorspace.prototype.LCHab_to_Lab = function () {
var src = this.munge("LCH", arguments);
var H_rad = src.H * (Math.PI / 180);
var L = src.L;
var a = src.C / Math.pow(Math.pow(Math.tan(H_rad), 2) + 1, 0.5);
if ((90 < src.H) && (src.H < 270)) {
a = -a;
}
var b = Math.pow(Math.pow(src.C, 2) - Math.pow(a, 2), 0.5);
if (src.H > 180) {
b = -b;
}
return [L, a, b];
};
dojo.gfx.Colorspace.prototype.chromaticAdaptation = function (col, src_w, dst_w) {
col = this.munge("XYZ", [col]);
var old_wp = this.whitePoint;
this.whitePoint = src_w;
var wp_src = this.getWhitePoint();
this.whitePoint = dst_w;
var wp_dst = this.getWhitePoint();
this.whitePoint = old_wp;
switch (this.chromaticAdaptationAlg) {
case "xyz_scaling":
var ma = [[1, 0, 0], [0, 1, 0], [0, 0, 1]];
var mai = [[1, 0, 0], [0, 1, 0], [0, 0, 1]];
break;
case "bradford":
var ma = [[0.8951, -0.7502, 0.0389], [0.2664, 1.7135, -0.0685], [-0.1614, 0.0367, 1.0296]];
var mai = [[0.986993, 0.432305, -0.008529], [-0.147054, 0.51836, 0.040043], [0.159963, 0.049291, 0.968487]];
break;
case "von_kries":
var ma = [[0.40024, -0.2263, 0], [0.7076, 1.16532, 0], [-0.08081, 0.0457, 0.91822]];
var mai = [[1.859936, 0.361191, 0], [-1.129382, 0.638812, 0], [0.219897, -0.000006, 1.089064]];
break;
default:
dojo.debug("The " + this.chromaticAdaptationAlg + " chromatic adaptation algorithm matricies are not defined");
}
var domain_src = dojo.math.matrix.multiply([[wp_src.x, wp_src.y, wp_src.z]], ma);
var domain_dst = dojo.math.matrix.multiply([[wp_dst.x, wp_dst.y, wp_dst.z]], ma);
var centre = [[domain_dst[0][0] / domain_src[0][0], 0, 0], [0, domain_dst[0][1] / domain_src[0][1], 0], [0, 0, domain_dst[0][2] / domain_src[0][2]]];
var m = dojo.math.matrix.multiply(dojo.math.matrix.multiply(ma, centre), mai);
var dst = dojo.math.matrix.multiply([[col.X, col.Y, col.Z]], m);
return dst[0];
};
dojo.gfx.Colorspace.prototype.getRGB_XYZ_Matrix = function () {
var wp = this.getWhitePoint();
var pr = this.getPrimaries();
var Xr = pr.xr / pr.yr;
var Yr = 1;
var Zr = (1 - pr.xr - pr.yr) / pr.yr;
var Xg = pr.xg / pr.yg;
var Yg = 1;
var Zg = (1 - pr.xg - pr.yg) / pr.yg;
var Xb = pr.xb / pr.yb;
var Yb = 1;
var Zb = (1 - pr.xb - pr.yb) / pr.yb;
var m1 = [[Xr, Yr, Zr], [Xg, Yg, Zg], [Xb, Yb, Zb]];
var m2 = [[wp.X, wp.Y, wp.Z]];
var sm = dojo.math.matrix.multiply(m2, dojo.math.matrix.inverse(m1));
var Sr = sm[0][0];
var Sg = sm[0][1];
var Sb = sm[0][2];
var m4 = [[Sr * Xr, Sr * Yr, Sr * Zr], [Sg * Xg, Sg * Yg, Sg * Zg], [Sb * Xb, Sb * Yb, Sb * Zb]];
return m4;
};
dojo.gfx.Colorspace.prototype.getXYZ_RGB_Matrix = function () {
var m = this.getRGB_XYZ_Matrix();
return dojo.math.matrix.inverse(m);
};
dojo.gfx.Colorspace.prototype.XYZ_to_Luv = function () {
var src = this.munge("XYZ", arguments);
var wp = this.getWhitePoint();
var ud = (4 * src.X) / (src.X + 15 * src.Y + 3 * src.Z);
var vd = (9 * src.Y) / (src.X + 15 * src.Y + 3 * src.Z);
var udr = (4 * wp.X) / (wp.X + 15 * wp.Y + 3 * wp.Z);
var vdr = (9 * wp.Y) / (wp.X + 15 * wp.Y + 3 * wp.Z);
var yr = src.Y / wp.Y;
var L = (yr > this.epsilon()) ? 116 * Math.pow(yr, 1 / 3) - 16 : this.kappa() * yr;
var u = 13 * L * (ud - udr);
var v = 13 * L * (vd - vdr);
return [L, u, v];
};
dojo.gfx.Colorspace.prototype.Luv_to_XYZ = function () {
var src = this.munge("Luv", arguments);
var wp = this.getWhitePoint();
var uz = (4 * wp.X) / (wp.X + 15 * wp.Y + 3 * wp.Z);
var vz = (9 * wp.Y) / (wp.X + 15 * wp.Y + 3 * wp.Z);
var Y = (src.L > this.kappa() * this.epsilon()) ? Math.pow((src.L + 16) / 116, 3) : src.L / this.kappa();
var a = (1 / 3) * (((52 * src.L) / (src.u + 13 * src.L * uz)) - 1);
var b = -5 * Y;
var c = -(1 / 3);
var d = Y * (((39 * src.L) / (src.v + 13 * src.L * vz)) - 5);
var X = (d - b) / (a - c);
var Z = X * a + b;
return [X, Y, Z];
};
dojo.gfx.Colorspace.prototype.Luv_to_LCHuv = function () {
var src = this.munge("Luv", arguments);
var L = src.L;
var C = Math.pow(src.u * src.u + src.v * src.v, 0.5);
var H = Math.atan2(src.v, src.u) * (180 / Math.PI);
if (H < 0) {
H += 360;
}
if (H > 360) {
H -= 360;
}
return [L, C, H];
};
dojo.gfx.Colorspace.prototype.LCHuv_to_Luv = function () {
var src = this.munge("LCH", arguments);
var H_rad = src.H * (Math.PI / 180);
var L = src.L;
var u = src.C / Math.pow(Math.pow(Math.tan(H_rad), 2) + 1, 0.5);
var v = Math.pow(src.C * src.C - u * u, 0.5);
if ((90 < src.H) && (src.H < 270)) {
u *= -1;
}
if (src.H > 180) {
v *= -1;
}
return [L, u, v];
};
dojo.gfx.Colorspace.colorTemp_to_whitePoint = function (T) {
if (T < 4000) {
dojo.debug("Can't find a white point for temperatures under 4000K");
return [0, 0];
}
if (T > 25000) {
dojo.debug("Can't find a white point for temperatures over 25000K");
return [0, 0];
}
var T1 = T;
var T2 = T * T;
var T3 = T2 * T;
var ten9 = Math.pow(10, 9);
var ten6 = Math.pow(10, 6);
var ten3 = Math.pow(10, 3);
if (T <= 7000) {
var x = (-4.607 * ten9 / T3) + (2.9678 * ten6 / T2) + (0.09911 * ten3 / T) + 0.244063;
} else {
var x = (-2.0064 * ten9 / T3) + (1.9018 * ten6 / T2) + (0.24748 * ten3 / T) + 0.23704;
}
var y = -3 * x * x + 2.87 * x - 0.275;
return [x, y];
};
dojo.gfx.Colorspace.prototype.RGB_to_CMY = function () {
var src = this.munge("RGB", arguments);
var C = 1 - src.R;
var M = 1 - src.G;
var Y = 1 - src.B;
return [C, M, Y];
};
dojo.gfx.Colorspace.prototype.CMY_to_RGB = function () {
var src = this.munge("CMY", arguments);
var R = 1 - src.C;
var G = 1 - src.M;
var B = 1 - src.Y;
return [R, G, B];
};
dojo.gfx.Colorspace.prototype.RGB_to_CMYK = function () {
var src = this.munge("RGB", arguments);
var K = Math.min(1 - src.R, 1 - src.G, 1 - src.B);
var C = (1 - src.R - K) / (1 - K);
var M = (1 - src.G - K) / (1 - K);
var Y = (1 - src.B - K) / (1 - K);
return [C, M, Y, K];
};
dojo.gfx.Colorspace.prototype.CMYK_to_RGB = function () {
var src = this.munge("CMYK", arguments);
var R = 1 - Math.min(1, src.C * (1 - src.K) + src.K);
var G = 1 - Math.min(1, src.M * (1 - src.K) + src.K);
var B = 1 - Math.min(1, src.Y * (1 - src.K) + src.K);
return [R, G, B];
};
dojo.gfx.Colorspace.prototype.CMY_to_CMYK = function () {
var src = this.munge("CMY", arguments);
var K = Math.min(src.C, src.M, src.Y);
var C = (src.C - K) / (1 - K);
var M = (src.M - K) / (1 - K);
var Y = (src.Y - K) / (1 - K);
return [C, M, Y, K];
};
dojo.gfx.Colorspace.prototype.CMYK_to_CMY = function () {
var src = this.munge("CMYK", arguments);
var C = Math.min(1, src.C * (1 - src.K) + src.K);
var M = Math.min(1, src.M * (1 - src.K) + src.K);
var Y = Math.min(1, src.Y * (1 - src.K) + src.K);
return [C, M, Y];
};
dojo.gfx.Colorspace.prototype.RGB_to_HSV = function () {
var src = this.munge("RGB", arguments);
var min = Math.min(src.R, src.G, src.B);
var V = Math.max(src.R, src.G, src.B);
var delta = V - min;
var H = null;
var S = (V == 0) ? 0 : delta / V;
if (S == 0) {
H = 0;
} else {
if (src.R == V) {
H = 60 * (src.G - src.B) / delta;
} else {
if (src.G == V) {
H = 120 + 60 * (src.B - src.R) / delta;
} else {
if (src.B == V) {
H = 240 + 60 * (src.R - src.G) / delta;
}
}
}
if (H < 0) {
H += 360;
}
}
H = (H == 0) ? 360 : H;
return [H, S, V];
};
dojo.gfx.Colorspace.prototype.HSV_to_RGB = function () {
var src = this.munge("HSV", arguments);
if (src.H == 360) {
src.H = 0;
}
var r = null;
var g = null;
var b = null;
if (src.S == 0) {
var R = src.V;
var G = src.V;
var B = src.V;
} else {
var hTemp = src.H / 60;
var i = Math.floor(hTemp);
var f = hTemp - i;
var p = src.V * (1 - src.S);
var q = src.V * (1 - (src.S * f));
var t = src.V * (1 - (src.S * (1 - f)));
switch (i) {
case 0:
R = src.V;
G = t;
B = p;
break;
case 1:
R = q;
G = src.V;
B = p;
break;
case 2:
R = p;
G = src.V;
B = t;
break;
case 3:
R = p;
G = q;
B = src.V;
break;
case 4:
R = t;
G = p;
B = src.V;
break;
case 5:
R = src.V;
G = p;
B = q;
break;
}
}
return [R, G, B];
};
dojo.gfx.Colorspace.prototype.RGB_to_HSL = function () {
var src = this.munge("RGB", arguments);
var min = Math.min(src.R, src.G, src.B);
var max = Math.max(src.R, src.G, src.B);
var delta = max - min;
var H = 0;
var S = 0;
var L = (min + max) / 2;
if ((L > 0) && (L < 1)) {
S = delta / ((L < 0.5) ? (2 * L) : (2 - 2 * L));
}
if (delta > 0) {
if ((max == src.R) && (max != src.G)) {
H += (src.G - src.B) / delta;
}
if ((max == src.G) && (max != src.B)) {
H += (2 + (src.B - src.R) / delta);
}
if ((max == src.B) && (max != src.R)) {
H += (4 + (src.R - src.G) / delta);
}
H *= 60;
}
H = (H == 0) ? 360 : H;
return [H, S, L];
};
dojo.gfx.Colorspace.prototype.HSL_to_RGB = function () {
var src = this.munge("HSL", arguments);
while (src.H < 0) {
src.H += 360;
}
while (src.H >= 360) {
src.H -= 360;
}
var R = 0;
var G = 0;
var B = 0;
if (src.H < 120) {
R = (120 - src.H) / 60;
G = src.H / 60;
B = 0;
} else {
if (src.H < 240) {
R = 0;
G = (240 - src.H) / 60;
B = (src.H - 120) / 60;
} else {
R = (src.H - 240) / 60;
G = 0;
B = (360 - src.H) / 60;
}
}
R = 2 * src.S * Math.min(R, 1) + (1 - src.S);
G = 2 * src.S * Math.min(G, 1) + (1 - src.S);
B = 2 * src.S * Math.min(B, 1) + (1 - src.S);
if (src.L < 0.5) {
R = src.L * R;
G = src.L * G;
B = src.L * B;
} else {
R = (1 - src.L) * R + 2 * src.L - 1;
G = (1 - src.L) * G + 2 * src.L - 1;
B = (1 - src.L) * B + 2 * src.L - 1;
}
return [R, G, B];
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/gfx/path.js
New file
0,0 → 1,266
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.gfx.path");
dojo.require("dojo.math");
dojo.require("dojo.gfx.shape");
dojo.declare("dojo.gfx.path.Path", dojo.gfx.Shape, {initializer:function (rawNode) {
this.shape = dojo.lang.shallowCopy(dojo.gfx.defaultPath, true);
this.segments = [];
this.absolute = true;
this.last = {};
this.attach(rawNode);
}, setAbsoluteMode:function (mode) {
this.absolute = typeof (mode) == "string" ? (mode == "absolute") : mode;
return this;
}, getAbsoluteMode:function () {
return this.absolute;
}, getBoundingBox:function () {
return "l" in this.bbox ? {x:this.bbox.l, y:this.bbox.t, width:this.bbox.r - this.bbox.l, height:this.bbox.b - this.bbox.t} : null;
}, getLastPosition:function () {
return "x" in this.last ? this.last : null;
}, _updateBBox:function (x, y) {
if ("l" in this.bbox) {
if (this.bbox.l > x) {
this.bbox.l = x;
}
if (this.bbox.r < x) {
this.bbox.r = x;
}
if (this.bbox.t > y) {
this.bbox.t = y;
}
if (this.bbox.b < y) {
this.bbox.b = y;
}
} else {
this.bbox = {l:x, b:y, r:x, t:y};
}
}, _updateWithSegment:function (segment) {
var n = segment.args;
var l = n.length;
switch (segment.action) {
case "M":
case "L":
case "C":
case "S":
case "Q":
case "T":
for (var i = 0; i < l; i += 2) {
this._updateBBox(this.bbox, n[i], n[i + 1]);
}
this.last.x = n[l - 2];
this.last.y = n[l - 1];
this.absolute = true;
break;
case "H":
for (var i = 0; i < l; ++i) {
this._updateBBox(this.bbox, n[i], this.last.y);
}
this.last.x = n[l - 1];
this.absolute = true;
break;
case "V":
for (var i = 0; i < l; ++i) {
this._updateBBox(this.bbox, this.last.x, n[i]);
}
this.last.y = n[l - 1];
this.absolute = true;
break;
case "m":
var start = 0;
if (!("x" in this.last)) {
this._updateBBox(this.bbox, this.last.x = n[0], this.last.y = n[1]);
start = 2;
}
for (var i = start; i < l; i += 2) {
this._updateBBox(this.bbox, this.last.x += n[i], this.last.y += n[i + 1]);
}
this.absolute = false;
break;
case "l":
case "t":
for (var i = 0; i < l; i += 2) {
this._updateBBox(this.bbox, this.last.x += n[i], this.last.y += n[i + 1]);
}
this.absolute = false;
break;
case "h":
for (var i = 0; i < l; ++i) {
this._updateBBox(this.bbox, this.last.x += n[i], this.last.y);
}
this.absolute = false;
break;
case "v":
for (var i = 0; i < l; ++i) {
this._updateBBox(this.bbox, this.last.x, this.last.y += n[i]);
}
this.absolute = false;
break;
case "c":
for (var i = 0; i < l; i += 6) {
this._updateBBox(this.bbox, this.last.x + n[i], this.last.y + n[i + 1]);
this._updateBBox(this.bbox, this.last.x + n[i + 2], this.last.y + n[i + 3]);
this._updateBBox(this.bbox, this.last.x += n[i + 4], this.last.y += n[i + 5]);
}
this.absolute = false;
break;
case "s":
case "q":
for (var i = 0; i < l; i += 4) {
this._updateBBox(this.bbox, this.last.x + n[i], this.last.y + n[i + 1]);
this._updateBBox(this.bbox, this.last.x += n[i + 2], this.last.y += n[i + 3]);
}
this.absolute = false;
break;
case "A":
for (var i = 0; i < l; i += 7) {
this._updateBBox(this.bbox, n[i + 5], n[i + 6]);
}
this.last.x = n[l - 2];
this.last.y = n[l - 1];
this.absolute = true;
break;
case "a":
for (var i = 0; i < l; i += 7) {
this._updateBBox(this.bbox, this.last.x += n[i + 5], this.last.y += n[i + 6]);
}
this.absolute = false;
break;
}
var path = [segment.action];
for (var i = 0; i < l; ++i) {
path.push(dojo.gfx.formatNumber(n[i], true));
}
if (typeof (this.shape.path) == "string") {
this.shape.path += path.join("");
} else {
this.shape.path = this.shape.path.concat(path);
}
}, _validSegments:{m:2, l:2, h:1, v:1, c:6, s:4, q:4, t:2, a:7, z:0}, _pushSegment:function (action, args) {
var group = this._validSegments[action.toLowerCase()];
if (typeof (group) == "number") {
if (group) {
if (args.length >= group) {
var segment = {action:action, args:args.slice(0, args.length - args.length % group)};
this.segments.push(segment);
this._updateWithSegment(segment);
}
} else {
var segment = {action:action, args:[]};
this.segments.push(segment);
this._updateWithSegment(segment);
}
}
}, _collectArgs:function (array, args) {
for (var i = 0; i < args.length; ++i) {
var t = args[i];
if (typeof (t) == "boolean") {
array.push(t ? 1 : 0);
} else {
if (typeof (t) == "number") {
array.push(t);
} else {
if (t instanceof Array) {
this._collectArgs(array, t);
} else {
if ("x" in t && "y" in t) {
array.push(t.x);
array.push(t.y);
}
}
}
}
}
}, moveTo:function () {
var args = [];
this._collectArgs(args, arguments);
this._pushSegment(this.absolute ? "M" : "m", args);
return this;
}, lineTo:function () {
var args = [];
this._collectArgs(args, arguments);
this._pushSegment(this.absolute ? "L" : "l", args);
return this;
}, hLineTo:function () {
var args = [];
this._collectArgs(args, arguments);
this._pushSegment(this.absolute ? "H" : "h", args);
return this;
}, vLineTo:function () {
var args = [];
this._collectArgs(args, arguments);
this._pushSegment(this.absolute ? "V" : "v", args);
return this;
}, curveTo:function () {
var args = [];
this._collectArgs(args, arguments);
this._pushSegment(this.absolute ? "C" : "c", args);
return this;
}, smoothCurveTo:function () {
var args = [];
this._collectArgs(args, arguments);
this._pushSegment(this.absolute ? "S" : "s", args);
return this;
}, qCurveTo:function () {
var args = [];
this._collectArgs(args, arguments);
this._pushSegment(this.absolute ? "Q" : "q", args);
return this;
}, qSmoothCurveTo:function () {
var args = [];
this._collectArgs(args, arguments);
this._pushSegment(this.absolute ? "T" : "t", args);
return this;
}, arcTo:function () {
var args = [];
this._collectArgs(args, arguments);
for (var i = 2; i < args.length; i += 7) {
args[i] = -args[i];
}
this._pushSegment(this.absolute ? "A" : "a", args);
return this;
}, closePath:function () {
this._pushSegment("Z", []);
return this;
}, _setPath:function (path) {
var p = path.match(dojo.gfx.pathRegExp);
this.segments = [];
this.absolute = true;
this.bbox = {};
this.last = {};
if (!p) {
return;
}
var action = "";
var args = [];
for (var i = 0; i < p.length; ++i) {
var t = p[i];
var x = parseFloat(t);
if (isNaN(x)) {
if (action) {
this._pushSegment(action, args);
}
args = [];
action = t;
} else {
args.push(x);
}
}
this._pushSegment(action, args);
}, setShape:function (newShape) {
this.shape = dojo.gfx.makeParameters(this.shape, typeof (newShape) == "string" ? {path:newShape} : newShape);
var path = this.shape.path;
this.shape.path = [];
this._setPath(path);
this.shape.path = this.shape.path.join("");
return this;
}, _2PI:Math.PI * 2});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/gfx/color.js
New file
0,0 → 1,148
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.gfx.color");
dojo.require("dojo.lang.common");
dojo.require("dojo.lang.array");
dojo.gfx.color.Color = function (r, g, b, a) {
if (dojo.lang.isArray(r)) {
this.r = r[0];
this.g = r[1];
this.b = r[2];
this.a = r[3] || 1;
} else {
if (dojo.lang.isString(r)) {
var rgb = dojo.gfx.color.extractRGB(r);
this.r = rgb[0];
this.g = rgb[1];
this.b = rgb[2];
this.a = g || 1;
} else {
if (r instanceof dojo.gfx.color.Color) {
this.r = r.r;
this.b = r.b;
this.g = r.g;
this.a = r.a;
} else {
this.r = r;
this.g = g;
this.b = b;
this.a = a;
}
}
}
};
dojo.gfx.color.Color.fromArray = function (arr) {
return new dojo.gfx.color.Color(arr[0], arr[1], arr[2], arr[3]);
};
dojo.extend(dojo.gfx.color.Color, {toRgb:function (includeAlpha) {
if (includeAlpha) {
return this.toRgba();
} else {
return [this.r, this.g, this.b];
}
}, toRgba:function () {
return [this.r, this.g, this.b, this.a];
}, toHex:function () {
return dojo.gfx.color.rgb2hex(this.toRgb());
}, toCss:function () {
return "rgb(" + this.toRgb().join() + ")";
}, toString:function () {
return this.toHex();
}, blend:function (color, weight) {
var rgb = null;
if (dojo.lang.isArray(color)) {
rgb = color;
} else {
if (color instanceof dojo.gfx.color.Color) {
rgb = color.toRgb();
} else {
rgb = new dojo.gfx.color.Color(color).toRgb();
}
}
return dojo.gfx.color.blend(this.toRgb(), rgb, weight);
}});
dojo.gfx.color.named = {white:[255, 255, 255], black:[0, 0, 0], red:[255, 0, 0], green:[0, 255, 0], lime:[0, 255, 0], blue:[0, 0, 255], navy:[0, 0, 128], gray:[128, 128, 128], silver:[192, 192, 192]};
dojo.gfx.color.blend = function (a, b, weight) {
if (typeof a == "string") {
return dojo.gfx.color.blendHex(a, b, weight);
}
if (!weight) {
weight = 0;
}
weight = Math.min(Math.max(-1, weight), 1);
weight = ((weight + 1) / 2);
var c = [];
for (var x = 0; x < 3; x++) {
c[x] = parseInt(b[x] + ((a[x] - b[x]) * weight));
}
return c;
};
dojo.gfx.color.blendHex = function (a, b, weight) {
return dojo.gfx.color.rgb2hex(dojo.gfx.color.blend(dojo.gfx.color.hex2rgb(a), dojo.gfx.color.hex2rgb(b), weight));
};
dojo.gfx.color.extractRGB = function (color) {
var hex = "0123456789abcdef";
color = color.toLowerCase();
if (color.indexOf("rgb") == 0) {
var matches = color.match(/rgba*\((\d+), *(\d+), *(\d+)/i);
var ret = matches.splice(1, 3);
return ret;
} else {
var colors = dojo.gfx.color.hex2rgb(color);
if (colors) {
return colors;
} else {
return dojo.gfx.color.named[color] || [255, 255, 255];
}
}
};
dojo.gfx.color.hex2rgb = function (hex) {
var hexNum = "0123456789ABCDEF";
var rgb = new Array(3);
if (hex.indexOf("#") == 0) {
hex = hex.substring(1);
}
hex = hex.toUpperCase();
if (hex.replace(new RegExp("[" + hexNum + "]", "g"), "") != "") {
return null;
}
if (hex.length == 3) {
rgb[0] = hex.charAt(0) + hex.charAt(0);
rgb[1] = hex.charAt(1) + hex.charAt(1);
rgb[2] = hex.charAt(2) + hex.charAt(2);
} else {
rgb[0] = hex.substring(0, 2);
rgb[1] = hex.substring(2, 4);
rgb[2] = hex.substring(4);
}
for (var i = 0; i < rgb.length; i++) {
rgb[i] = hexNum.indexOf(rgb[i].charAt(0)) * 16 + hexNum.indexOf(rgb[i].charAt(1));
}
return rgb;
};
dojo.gfx.color.rgb2hex = function (r, g, b) {
if (dojo.lang.isArray(r)) {
g = r[1] || 0;
b = r[2] || 0;
r = r[0] || 0;
}
var ret = dojo.lang.map([r, g, b], function (x) {
x = new Number(x);
var s = x.toString(16);
while (s.length < 2) {
s = "0" + s;
}
return s;
});
ret.unshift("#");
return ret.join("");
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/gfx/vml.js
New file
0,0 → 1,1008
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.gfx.vml");
dojo.require("dojo.dom");
dojo.require("dojo.math");
dojo.require("dojo.lang.declare");
dojo.require("dojo.lang.extras");
dojo.require("dojo.string.*");
dojo.require("dojo.html.metrics");
dojo.require("dojo.gfx.color");
dojo.require("dojo.gfx.common");
dojo.require("dojo.gfx.shape");
dojo.require("dojo.gfx.path");
dojo.require("dojo.experimental");
dojo.experimental("dojo.gfx.vml");
dojo.gfx.vml.xmlns = "urn:schemas-microsoft-com:vml";
dojo.gfx.vml._parseFloat = function (str) {
return str.match(/^\d+f$/i) ? parseInt(str) / 65536 : parseFloat(str);
};
dojo.gfx.vml.cm_in_pt = 72 / 2.54;
dojo.gfx.vml.mm_in_pt = 7.2 / 2.54;
dojo.gfx.vml.px_in_pt = function () {
return dojo.html.getCachedFontMeasurements()["12pt"] / 12;
};
dojo.gfx.vml.pt2px = function (len) {
return len * this.px_in_pt();
};
dojo.gfx.vml.px2pt = function (len) {
return len / this.px_in_pt();
};
dojo.gfx.vml.normalizedLength = function (len) {
if (len.length == 0) {
return 0;
}
if (len.length > 2) {
var px_in_pt = this.px_in_pt();
var val = parseFloat(len);
switch (len.slice(-2)) {
case "px":
return val;
case "pt":
return val * px_in_pt;
case "in":
return val * 72 * px_in_pt;
case "pc":
return val * 12 * px_in_pt;
case "mm":
return val / this.mm_in_pt * px_in_pt;
case "cm":
return val / this.cm_in_pt * px_in_pt;
}
}
return parseFloat(len);
};
dojo.lang.extend(dojo.gfx.Shape, {setFill:function (fill) {
if (!fill) {
this.fillStyle = null;
this.rawNode.filled = false;
return this;
}
if (typeof (fill) == "object" && "type" in fill) {
switch (fill.type) {
case "linear":
var f = dojo.gfx.makeParameters(dojo.gfx.defaultLinearGradient, fill);
this.fillStyle = f;
var s = "";
for (var i = 0; i < f.colors.length; ++i) {
f.colors[i].color = dojo.gfx.normalizeColor(f.colors[i].color);
s += f.colors[i].offset.toFixed(8) + " " + f.colors[i].color.toHex() + ";";
}
var fo = this.rawNode.fill;
fo.colors.value = s;
fo.method = "sigma";
fo.type = "gradient";
fo.angle = (dojo.math.radToDeg(Math.atan2(f.x2 - f.x1, f.y2 - f.y1)) + 180) % 360;
fo.on = true;
break;
case "radial":
var f = dojo.gfx.makeParameters(dojo.gfx.defaultRadialGradient, fill);
this.fillStyle = f;
var w = parseFloat(this.rawNode.style.width);
var h = parseFloat(this.rawNode.style.height);
var c = isNaN(w) ? 1 : 2 * f.r / w;
var i = f.colors.length - 1;
f.colors[i].color = dojo.gfx.normalizeColor(f.colors[i].color);
var s = "0 " + f.colors[i].color.toHex();
for (; i >= 0; --i) {
f.colors[i].color = dojo.gfx.normalizeColor(f.colors[i].color);
s += (1 - c * f.colors[i].offset).toFixed(8) + " " + f.colors[i].color.toHex() + ";";
}
var fo = this.rawNode.fill;
fo.colors.value = s;
fo.method = "sigma";
fo.type = "gradientradial";
if (isNaN(w) || isNaN(h)) {
fo.focusposition = "0.5 0.5";
} else {
fo.focusposition = (f.cx / w).toFixed(8) + " " + (f.cy / h).toFixed(8);
}
fo.focussize = "0 0";
fo.on = true;
break;
case "pattern":
var f = dojo.gfx.makeParameters(dojo.gfx.defaultPattern, fill);
this.fillStyle = f;
var fo = this.rawNode.fill;
fo.type = "tile";
fo.src = f.src;
if (f.width && f.height) {
fo.size.x = dojo.gfx.vml.px2pt(f.width);
fo.size.y = dojo.gfx.vml.px2pt(f.height);
}
fo.alignShape = false;
fo.position.x = 0;
fo.position.y = 0;
fo.origin.x = f.width ? f.x / f.width : 0;
fo.origin.y = f.height ? f.y / f.height : 0;
fo.on = true;
break;
}
this.rawNode.fill.opacity = 1;
return this;
}
this.fillStyle = dojo.gfx.normalizeColor(fill);
this.rawNode.fillcolor = this.fillStyle.toHex();
this.rawNode.fill.opacity = this.fillStyle.a;
this.rawNode.filled = true;
return this;
}, setStroke:function (stroke) {
if (!stroke) {
this.strokeStyle = null;
this.rawNode.stroked = false;
return this;
}
this.strokeStyle = dojo.gfx.makeParameters(dojo.gfx.defaultStroke, stroke);
this.strokeStyle.color = dojo.gfx.normalizeColor(this.strokeStyle.color);
var s = this.strokeStyle;
this.rawNode.stroked = true;
this.rawNode.strokecolor = s.color.toCss();
this.rawNode.strokeweight = s.width + "px";
if (this.rawNode.stroke) {
this.rawNode.stroke.opacity = s.color.a;
this.rawNode.stroke.endcap = this._translate(this._capMap, s.cap);
if (typeof (s.join) == "number") {
this.rawNode.stroke.joinstyle = "miter";
this.rawNode.stroke.miterlimit = s.join;
} else {
this.rawNode.stroke.joinstyle = s.join;
}
}
return this;
}, _capMap:{butt:"flat"}, _capMapReversed:{flat:"butt"}, _translate:function (dict, value) {
return (value in dict) ? dict[value] : value;
}, _applyTransform:function () {
var matrix = this._getRealMatrix();
if (!matrix) {
return this;
}
var skew = this.rawNode.skew;
if (typeof (skew) == "undefined") {
for (var i = 0; i < this.rawNode.childNodes.length; ++i) {
if (this.rawNode.childNodes[i].tagName == "skew") {
skew = this.rawNode.childNodes[i];
break;
}
}
}
if (skew) {
skew.on = false;
var mt = matrix.xx.toFixed(8) + " " + matrix.xy.toFixed(8) + " " + matrix.yx.toFixed(8) + " " + matrix.yy.toFixed(8) + " 0 0";
var offset = Math.floor(matrix.dx).toFixed() + "px " + Math.floor(matrix.dy).toFixed() + "px";
var l = parseFloat(this.rawNode.style.left);
var t = parseFloat(this.rawNode.style.top);
var w = parseFloat(this.rawNode.style.width);
var h = parseFloat(this.rawNode.style.height);
if (isNaN(l)) {
l = 0;
}
if (isNaN(t)) {
t = 0;
}
if (isNaN(w)) {
w = 1;
}
if (isNaN(h)) {
h = 1;
}
var origin = (-l / w - 0.5).toFixed(8) + " " + (-t / h - 0.5).toFixed(8);
skew.matrix = mt;
skew.origin = origin;
skew.offset = offset;
skew.on = true;
}
return this;
}, setRawNode:function (rawNode) {
rawNode.stroked = false;
rawNode.filled = false;
this.rawNode = rawNode;
}, attachFill:function (rawNode) {
var fillStyle = null;
var fo = rawNode.fill;
if (rawNode) {
if (fo.on && fo.type == "gradient") {
var fillStyle = dojo.lang.shallowCopy(dojo.gfx.defaultLinearGradient, true);
var rad = dojo.math.degToRad(fo.angle);
fillStyle.x2 = Math.cos(rad);
fillStyle.y2 = Math.sin(rad);
fillStyle.colors = [];
var stops = fo.colors.value.split(";");
for (var i = 0; i < stops.length; ++i) {
var t = stops[i].match(/\S+/g);
if (!t || t.length != 2) {
continue;
}
fillStyle.colors.push({offset:dojo.gfx.vml._parseFloat(t[0]), color:new dojo.gfx.color.Color(t[1])});
}
} else {
if (fo.on && fo.type == "gradientradial") {
var fillStyle = dojo.lang.shallowCopy(dojo.gfx.defaultRadialGradient, true);
var w = parseFloat(rawNode.style.width);
var h = parseFloat(rawNode.style.height);
fillStyle.cx = isNaN(w) ? 0 : fo.focusposition.x * w;
fillStyle.cy = isNaN(h) ? 0 : fo.focusposition.y * h;
fillStyle.r = isNaN(w) ? 1 : w / 2;
fillStyle.colors = [];
var stops = fo.colors.value.split(";");
for (var i = stops.length - 1; i >= 0; --i) {
var t = stops[i].match(/\S+/g);
if (!t || t.length != 2) {
continue;
}
fillStyle.colors.push({offset:dojo.gfx.vml._parseFloat(t[0]), color:new dojo.gfx.color.Color(t[1])});
}
} else {
if (fo.on && fo.type == "tile") {
var fillStyle = dojo.lang.shallowCopy(dojo.gfx.defaultPattern, true);
fillStyle.width = dojo.gfx.vml.pt2px(fo.size.x);
fillStyle.height = dojo.gfx.vml.pt2px(fo.size.y);
fillStyle.x = fo.origin.x * fillStyle.width;
fillStyle.y = fo.origin.y * fillStyle.height;
fillStyle.src = fo.src;
} else {
if (fo.on && rawNode.fillcolor) {
fillStyle = new dojo.gfx.color.Color(rawNode.fillcolor + "");
fillStyle.a = fo.opacity;
}
}
}
}
}
return fillStyle;
}, attachStroke:function (rawNode) {
var strokeStyle = dojo.lang.shallowCopy(dojo.gfx.defaultStroke, true);
if (rawNode && rawNode.stroked) {
strokeStyle.color = new dojo.gfx.color.Color(rawNode.strokecolor.value);
dojo.debug("We are expecting an .75pt here, instead of strokeweight = " + rawNode.strokeweight);
strokeStyle.width = dojo.gfx.vml.normalizedLength(rawNode.strokeweight + "");
strokeStyle.color.a = rawNode.stroke.opacity;
strokeStyle.cap = this._translate(this._capMapReversed, rawNode.stroke.endcap);
strokeStyle.join = rawNode.stroke.joinstyle == "miter" ? rawNode.stroke.miterlimit : rawNode.stroke.joinstyle;
} else {
return null;
}
return strokeStyle;
}, attachTransform:function (rawNode) {
var matrix = {};
if (rawNode) {
var s = rawNode.skew;
matrix.xx = s.matrix.xtox;
matrix.xy = s.matrix.ytox;
matrix.yx = s.matrix.xtoy;
matrix.yy = s.matrix.ytoy;
matrix.dx = dojo.gfx.vml.pt2px(s.offset.x);
matrix.dy = dojo.gfx.vml.pt2px(s.offset.y);
}
return dojo.gfx.matrix.normalize(matrix);
}, attach:function (rawNode) {
if (rawNode) {
this.rawNode = rawNode;
this.shape = this.attachShape(rawNode);
this.fillStyle = this.attachFill(rawNode);
this.strokeStyle = this.attachStroke(rawNode);
this.matrix = this.attachTransform(rawNode);
}
}});
dojo.declare("dojo.gfx.Group", dojo.gfx.shape.VirtualGroup, {add:function (shape) {
if (this != shape.getParent()) {
this.rawNode.appendChild(shape.rawNode);
dojo.gfx.Group.superclass.add.apply(this, arguments);
}
return this;
}, remove:function (shape, silently) {
if (this == shape.getParent()) {
if (this.rawNode == shape.rawNode.parentNode) {
this.rawNode.removeChild(shape.rawNode);
}
dojo.gfx.Group.superclass.remove.apply(this, arguments);
}
return this;
}, attach:function (rawNode) {
if (rawNode) {
this.rawNode = rawNode;
this.shape = null;
this.fillStyle = null;
this.strokeStyle = null;
this.matrix = null;
}
}});
dojo.gfx.Group.nodeType = "group";
var zIndex = {moveToFront:function () {
this.rawNode.parentNode.appendChild(this.rawNode);
return this;
}, moveToBack:function () {
this.rawNode.parentNode.insertBefore(this.rawNode, this.rawNode.parentNode.firstChild);
return this;
}};
dojo.lang.extend(dojo.gfx.Shape, zIndex);
dojo.lang.extend(dojo.gfx.Group, zIndex);
delete zIndex;
dojo.declare("dojo.gfx.Rect", dojo.gfx.shape.Rect, {attachShape:function (rawNode) {
var arcsize = rawNode.outerHTML.match(/arcsize = \"(\d*\.?\d+[%f]?)\"/)[1];
arcsize = (arcsize.indexOf("%") >= 0) ? parseFloat(arcsize) / 100 : dojo.gfx.vml._parseFloat(arcsize);
var style = rawNode.style;
var width = parseFloat(style.width);
var height = parseFloat(style.height);
var o = dojo.gfx.makeParameters(dojo.gfx.defaultRect, {x:parseInt(style.left), y:parseInt(style.top), width:width, height:height, r:Math.min(width, height) * arcsize});
return o;
}, setShape:function (newShape) {
var shape = this.shape = dojo.gfx.makeParameters(this.shape, newShape);
this.bbox = null;
var style = this.rawNode.style;
style.left = shape.x.toFixed();
style.top = shape.y.toFixed();
style.width = (typeof (shape.width) == "string" && shape.width.indexOf("%") >= 0) ? shape.width : shape.width.toFixed();
style.height = (typeof (shape.width) == "string" && shape.height.indexOf("%") >= 0) ? shape.height : shape.height.toFixed();
var r = Math.min(1, (shape.r / Math.min(parseFloat(shape.width), parseFloat(shape.height)))).toFixed(8);
var parent = this.rawNode.parentNode;
var before = null;
if (parent) {
if (parent.lastChild != this.rawNode) {
for (var i = 0; i < parent.childNodes.length; ++i) {
if (parent.childNodes[i] == this.rawNode) {
before = parent.childNodes[i + 1];
break;
}
}
}
parent.removeChild(this.rawNode);
}
this.rawNode.arcsize = r;
if (parent) {
if (before) {
parent.insertBefore(this.rawNode, before);
} else {
parent.appendChild(this.rawNode);
}
}
return this.setTransform(this.matrix);
}});
dojo.gfx.Rect.nodeType = "roundrect";
dojo.declare("dojo.gfx.Ellipse", dojo.gfx.shape.Ellipse, {attachShape:function (rawNode) {
var style = this.rawNode.style;
var rx = parseInt(style.width) / 2;
var ry = parseInt(style.height) / 2;
var o = dojo.gfx.makeParameters(dojo.gfx.defaultEllipse, {cx:parseInt(style.left) + rx, cy:parseInt(style.top) + ry, rx:rx, ry:ry});
return o;
}, setShape:function (newShape) {
var shape = this.shape = dojo.gfx.makeParameters(this.shape, newShape);
this.bbox = null;
var style = this.rawNode.style;
style.left = (shape.cx - shape.rx).toFixed();
style.top = (shape.cy - shape.ry).toFixed();
style.width = (shape.rx * 2).toFixed();
style.height = (shape.ry * 2).toFixed();
return this.setTransform(this.matrix);
}});
dojo.gfx.Ellipse.nodeType = "oval";
dojo.declare("dojo.gfx.Circle", dojo.gfx.shape.Circle, {attachShape:function (rawNode) {
var style = this.rawNode.style;
var r = parseInt(style.width) / 2;
var o = dojo.gfx.makeParameters(dojo.gfx.defaultCircle, {cx:parseInt(style.left) + r, cy:parseInt(style.top) + r, r:r});
return o;
}, setShape:function (newShape) {
var shape = this.shape = dojo.gfx.makeParameters(this.shape, newShape);
this.bbox = null;
var style = this.rawNode.style;
style.left = (shape.cx - shape.r).toFixed();
style.top = (shape.cy - shape.r).toFixed();
style.width = (shape.r * 2).toFixed();
style.height = (shape.r * 2).toFixed();
return this;
}});
dojo.gfx.Circle.nodeType = "oval";
dojo.declare("dojo.gfx.Line", dojo.gfx.shape.Line, function (rawNode) {
if (rawNode) {
rawNode.setAttribute("dojoGfxType", "line");
}
}, {attachShape:function (rawNode) {
var p = rawNode.path.v.match(dojo.gfx.pathRegExp);
var shape = {};
do {
if (p.length < 7 || p[0] != "m" || p[3] != "l" || p[6] != "e") {
break;
}
shape.x1 = parseInt(p[1]);
shape.y1 = parseInt(p[2]);
shape.x2 = parseInt(p[4]);
shape.y2 = parseInt(p[5]);
} while (false);
return dojo.gfx.makeParameters(dojo.gfx.defaultLine, shape);
}, setShape:function (newShape) {
var shape = this.shape = dojo.gfx.makeParameters(this.shape, newShape);
this.bbox = null;
this.rawNode.path.v = "m" + shape.x1.toFixed() + " " + shape.y1.toFixed() + "l" + shape.x2.toFixed() + " " + shape.y2.toFixed() + "e";
return this.setTransform(this.matrix);
}});
dojo.gfx.Line.nodeType = "shape";
dojo.declare("dojo.gfx.Polyline", dojo.gfx.shape.Polyline, function (rawNode) {
if (rawNode) {
rawNode.setAttribute("dojoGfxType", "polyline");
}
}, {attachShape:function (rawNode) {
var shape = dojo.lang.shallowCopy(dojo.gfx.defaultPolyline, true);
var p = rawNode.path.v.match(dojo.gfx.pathRegExp);
do {
if (p.length < 3 || p[0] != "m") {
break;
}
var x = parseInt(p[0]);
var y = parseInt(p[1]);
if (isNaN(x) || isNaN(y)) {
break;
}
shape.points.push({x:x, y:y});
if (p.length < 6 || p[3] != "l") {
break;
}
for (var i = 4; i < p.length; i += 2) {
x = parseInt(p[i]);
y = parseInt(p[i + 1]);
if (isNaN(x) || isNaN(y)) {
break;
}
shape.points.push({x:x, y:y});
}
} while (false);
return shape;
}, setShape:function (points, closed) {
if (points && points instanceof Array) {
this.shape = dojo.gfx.makeParameters(this.shape, {points:points});
if (closed && this.shape.points.length) {
this.shape.points.push(this.shape.points[0]);
}
} else {
this.shape = dojo.gfx.makeParameters(this.shape, points);
}
this.bbox = null;
var attr = [];
var p = this.shape.points;
if (p.length > 0) {
attr.push("m");
attr.push(p[0].x.toFixed());
attr.push(p[0].y.toFixed());
if (p.length > 1) {
attr.push("l");
for (var i = 1; i < p.length; ++i) {
attr.push(p[i].x.toFixed());
attr.push(p[i].y.toFixed());
}
}
}
attr.push("e");
this.rawNode.path.v = attr.join(" ");
return this.setTransform(this.matrix);
}});
dojo.gfx.Polyline.nodeType = "shape";
dojo.declare("dojo.gfx.Image", dojo.gfx.shape.Image, {getEventSource:function () {
return this.rawNode ? this.rawNode.firstChild : null;
}, attachShape:function (rawNode) {
var shape = dojo.lang.shallowCopy(dojo.gfx.defaultImage, true);
shape.src = rawNode.firstChild.src;
return shape;
}, setShape:function (newShape) {
var shape = this.shape = dojo.gfx.makeParameters(this.shape, newShape);
this.bbox = null;
var firstChild = this.rawNode.firstChild;
firstChild.src = shape.src;
if (shape.width || shape.height) {
firstChild.style.width = shape.width;
firstChild.style.height = shape.height;
}
return this.setTransform(this.matrix);
}, setStroke:function () {
return this;
}, setFill:function () {
return this;
}, attachStroke:function (rawNode) {
return null;
}, attachFill:function (rawNode) {
return null;
}, attachTransform:function (rawNode) {
var matrix = {};
if (rawNode) {
var m = rawNode.filters["DXImageTransform.Microsoft.Matrix"];
matrix.xx = m.M11;
matrix.xy = m.M12;
matrix.yx = m.M21;
matrix.yy = m.M22;
matrix.dx = m.Dx;
matrix.dy = m.Dy;
}
return dojo.gfx.matrix.normalize(matrix);
}, _applyTransform:function () {
var matrix = this._getRealMatrix();
if (!matrix) {
return this;
}
with (this.rawNode.filters["DXImageTransform.Microsoft.Matrix"]) {
M11 = matrix.xx;
M12 = matrix.xy;
M21 = matrix.yx;
M22 = matrix.yy;
Dx = matrix.dx;
Dy = matrix.dy;
}
return this;
}});
dojo.gfx.Image.nodeType = "image";
dojo.gfx.path._calcArc = function (alpha) {
var cosa = Math.cos(alpha);
var sina = Math.sin(alpha);
var p2 = {x:cosa + (4 / 3) * (1 - cosa), y:sina - (4 / 3) * cosa * (1 - cosa) / sina};
return {s:{x:cosa, y:sina}, c1:p2, c2:{x:p2.x, y:-p2.y}, e:{x:cosa, y:-sina}};
};
dojo.declare("dojo.gfx.Path", dojo.gfx.path.Path, function (rawNode) {
if (rawNode) {
rawNode.setAttribute("dojoGfxType", "path");
}
this.vmlPath = "";
this.lastControl = {};
}, {_updateWithSegment:function (segment) {
var last = dojo.lang.shallowCopy(this.last);
dojo.gfx.Path.superclass._updateWithSegment.apply(this, arguments);
var path = this[this.renderers[segment.action]](segment, last);
if (typeof (this.vmlPath) == "string") {
this.vmlPath += path.join("");
} else {
this.vmlPath = this.vmlPath.concat(path);
}
if (typeof (this.vmlPath) == "string") {
this.rawNode.path.v = this.vmlPath + " e";
}
}, attachShape:function (rawNode) {
var shape = dojo.lang.shallowCopy(dojo.gfx.defaultPath, true);
var p = rawNode.path.v.match(dojo.gfx.pathRegExp);
var t = [], skip = false;
for (var i = 0; i < p.length; ++p) {
var s = p[i];
if (s in this._pathVmlToSvgMap) {
skip = false;
t.push(this._pathVmlToSvgMap[s]);
} else {
if (!skip) {
var n = parseInt(s);
if (isNaN(n)) {
skip = true;
} else {
t.push(n);
}
}
}
}
if (t.length) {
shape.path = t.join(" ");
}
return shape;
}, setShape:function (newShape) {
this.vmlPath = [];
this.lastControl = {};
dojo.gfx.Path.superclass.setShape.apply(this, arguments);
this.vmlPath = this.vmlPath.join("");
this.rawNode.path.v = this.vmlPath + " e";
return this;
}, _pathVmlToSvgMap:{m:"M", l:"L", t:"m", r:"l", c:"C", v:"c", qb:"Q", x:"z", e:""}, renderers:{M:"_moveToA", m:"_moveToR", L:"_lineToA", l:"_lineToR", H:"_hLineToA", h:"_hLineToR", V:"_vLineToA", v:"_vLineToR", C:"_curveToA", c:"_curveToR", S:"_smoothCurveToA", s:"_smoothCurveToR", Q:"_qCurveToA", q:"_qCurveToR", T:"_qSmoothCurveToA", t:"_qSmoothCurveToR", A:"_arcTo", a:"_arcTo", Z:"_closePath", z:"_closePath"}, _addArgs:function (path, args, from, upto) {
if (typeof (upto) == "undefined") {
upto = args.length;
}
if (typeof (from) == "undefined") {
from = 0;
}
for (var i = from; i < upto; ++i) {
path.push(" ");
path.push(args[i].toFixed());
}
}, _addArgsAdjusted:function (path, last, args, from, upto) {
if (typeof (upto) == "undefined") {
upto = args.length;
}
if (typeof (from) == "undefined") {
from = 0;
}
for (var i = from; i < upto; i += 2) {
path.push(" ");
path.push((last.x + args[i]).toFixed());
path.push(" ");
path.push((last.y + args[i + 1]).toFixed());
}
}, _moveToA:function (segment) {
var p = [" m"];
var n = segment.args;
var l = n.length;
if (l == 2) {
this._addArgs(p, n);
} else {
this._addArgs(p, n, 0, 2);
p.push(" l");
this._addArgs(p, n, 2);
}
this.lastControl = {};
return p;
}, _moveToR:function (segment, last) {
var p = ["x" in last ? " t" : " m"];
var n = segment.args;
var l = n.length;
if (l == 2) {
this._addArgs(p, n);
} else {
this._addArgs(p, n, 0, 2);
p.push(" r");
this._addArgs(p, n, 2);
}
this.lastControl = {};
return p;
}, _lineToA:function (segment) {
var p = [" l"];
this._addArgs(p, segment.args);
this.lastControl = {};
return p;
}, _lineToR:function (segment) {
var p = [" r"];
this._addArgs(p, segment.args);
this.lastControl = {};
return p;
}, _hLineToA:function (segment, last) {
var p = [" l"];
var n = segment.args;
var l = n.length;
var y = " " + last.y.toFixed();
for (var i = 0; i < l; ++i) {
p.push(" ");
p.push(n[i].toFixed());
p.push(y);
}
this.lastControl = {};
return p;
}, _hLineToR:function (segment) {
var p = [" r"];
var n = segment.args;
var l = n.length;
for (var i = 0; i < l; ++i) {
p.push(" ");
p.push(n[i].toFixed());
p.push(" 0");
}
this.lastControl = {};
return p;
}, _vLineToA:function (segment, last) {
var p = [" l"];
var n = segment.args;
var l = n.length;
var x = " " + last.x.toFixed();
for (var i = 0; i < l; ++i) {
p.push(x);
p.push(" ");
p.push(n[i].toFixed());
}
this.lastControl = {};
return p;
}, _vLineToR:function (segment) {
var p = [" r"];
var n = segment.args;
var l = n.length;
for (var i = 0; i < l; ++i) {
p.push(" 0 ");
p.push(n[i].toFixed());
}
this.lastControl = {};
return p;
}, _curveToA:function (segment) {
var p = [];
var n = segment.args;
var l = n.length;
for (var i = 0; i < l; i += 6) {
p.push(" c");
this._addArgs(p, n, i, i + 6);
}
this.lastControl = {x:n[l - 4], y:n[l - 3], type:"C"};
return p;
}, _curveToR:function (segment, last) {
var p = [];
var n = segment.args;
var l = n.length;
for (var i = 0; i < l; i += 6) {
p.push(" v");
this._addArgs(p, n, i, i + 6);
this.lastControl = {x:last.x + n[i + 2], y:last.y + n[i + 3]};
last.x += n[i + 4];
last.y += n[i + 5];
}
this.lastControl.type = "C";
return p;
}, _smoothCurveToA:function (segment, last) {
var p = [];
var n = segment.args;
var l = n.length;
for (var i = 0; i < l; i += 4) {
p.push(" c");
if (this.lastControl.type == "C") {
this._addArgs(p, [2 * last.x - this.lastControl.x, 2 * last.y - this.lastControl.y]);
} else {
this._addArgs(p, [last.x, last.y]);
}
this._addArgs(p, n, i, i + 4);
}
this.lastControl = {x:n[l - 4], y:n[l - 3], type:"C"};
return p;
}, _smoothCurveToR:function (segment, last) {
var p = [];
var n = segment.args;
var l = n.length;
for (var i = 0; i < l; i += 4) {
p.push(" v");
if (this.lastControl.type == "C") {
this._addArgs(p, [last.x - this.lastControl.x, last.y - this.lastControl.y]);
} else {
this._addArgs(p, [0, 0]);
}
this._addArgs(p, n, i, i + 4);
this.lastControl = {x:last.x + n[i], y:last.y + n[i + 1]};
last.x += n[i + 2];
last.y += n[i + 3];
}
this.lastControl.type = "C";
return p;
}, _qCurveToA:function (segment) {
var p = [];
var n = segment.args;
var l = n.length;
for (var i = 0; i < l; i += 4) {
p.push(" qb");
this._addArgs(p, n, i, i + 4);
}
this.lastControl = {x:n[l - 4], y:n[l - 3], type:"Q"};
return p;
}, _qCurveToR:function (segment, last) {
var p = [];
var n = segment.args;
var l = n.length;
for (var i = 0; i < l; i += 4) {
p.push(" qb");
this._addArgsAdjusted(p, last, n, i, i + 4);
this.lastControl = {x:last.x + n[i], y:last.y + n[i + 1]};
last.x += n[i + 2];
last.y += n[i + 3];
}
this.lastControl.type = "Q";
return p;
}, _qSmoothCurveToA:function (segment, last) {
var p = [];
var n = segment.args;
var l = n.length;
for (var i = 0; i < l; i += 2) {
p.push(" qb");
if (this.lastControl.type == "Q") {
this._addArgs(p, [this.lastControl.x = 2 * last.x - this.lastControl.x, this.lastControl.y = 2 * last.y - this.lastControl.y]);
} else {
this._addArgs(p, [this.lastControl.x = last.x, this.lastControl.y = last.y]);
}
this._addArgs(p, n, i, i + 2);
}
this.lastControl.type = "Q";
return p;
}, _qSmoothCurveToR:function (segment, last) {
var p = [];
var n = segment.args;
var l = n.length;
for (var i = 0; i < l; i += 2) {
p.push(" qb");
if (this.lastControl.type == "Q") {
this._addArgs(p, [this.lastControl.x = 2 * last.x - this.lastControl.x, this.lastControl.y = 2 * last.y - this.lastControl.y]);
} else {
this._addArgs(p, [this.lastControl.x = last.x, this.lastControl.y = last.y]);
}
this._addArgsAdjusted(p, last, n, i, i + 2);
}
this.lastControl.type = "Q";
return p;
}, _PI4:Math.PI / 4, _curvePI4:dojo.gfx.path._calcArc(Math.PI / 8), _calcArcTo:function (path, last, rx, ry, xRotg, large, cw, x, y) {
var m = dojo.gfx.matrix;
var xRot = -dojo.math.degToRad(xRotg);
var rx2 = rx * rx;
var ry2 = ry * ry;
var pa = m.multiplyPoint(m.rotate(-xRot), {x:(last.x - x) / 2, y:(last.y - y) / 2});
var pax2 = pa.x * pa.x;
var pay2 = pa.y * pa.y;
var c1 = Math.sqrt((rx2 * ry2 - rx2 * pay2 - ry2 * pax2) / (rx2 * pay2 + ry2 * pax2));
var ca = {x:c1 * rx * pa.y / ry, y:-c1 * ry * pa.x / rx};
if (large == cw) {
ca = {x:-ca.x, y:-ca.y};
}
var c = m.multiplyPoint([m.translate((last.x + x) / 2, (last.y + y) / 2), m.rotate(xRot)], ca);
var startAngle = Math.atan2(c.y - last.y, last.x - c.x) - xRot;
var endAngle = Math.atan2(c.y - y, x - c.x) - xRot;
var theta = cw ? startAngle - endAngle : endAngle - startAngle;
if (theta < 0) {
theta += this._2PI;
} else {
if (theta > this._2PI) {
theta = this._2PI;
}
}
var elliptic_transform = m.normalize([m.translate(c.x, c.y), m.rotate(xRot), m.scale(rx, ry)]);
var alpha = this._PI4 / 2;
var curve = this._curvePI4;
var step = cw ? -alpha : alpha;
for (var angle = theta; angle > 0; angle -= this._PI4) {
if (angle < this._PI4) {
alpha = angle / 2;
curve = dojo.gfx.path._calcArc(alpha);
step = cw ? -alpha : alpha;
}
var c1, c2, e;
var M = m.normalize([elliptic_transform, m.rotate(startAngle + step)]);
if (cw) {
c1 = m.multiplyPoint(M, curve.c2);
c2 = m.multiplyPoint(M, curve.c1);
e = m.multiplyPoint(M, curve.s);
} else {
c1 = m.multiplyPoint(M, curve.c1);
c2 = m.multiplyPoint(M, curve.c2);
e = m.multiplyPoint(M, curve.e);
}
path.push(" c");
this._addArgs(path, [c1.x, c1.y, c2.x, c2.y, e.x, e.y]);
startAngle += 2 * step;
}
}, _arcTo:function (segment, last) {
var p = [];
var n = segment.args;
var l = n.length;
var relative = segment.action == "a";
for (var i = 0; i < l; i += 7) {
var x1 = n[i + 5];
var y1 = n[i + 6];
if (relative) {
x1 += last.x;
y1 += last.y;
}
this._calcArcTo(p, last, n[i], n[i + 1], n[i + 2], n[i + 3] ? 1 : 0, n[i + 4] ? 1 : 0, x1, y1);
last = {x:x1, y:y1};
}
this.lastControl = {};
return p;
}, _closePath:function () {
this.lastControl = {};
return ["x"];
}});
dojo.gfx.Path.nodeType = "shape";
dojo.gfx._creators = {createPath:function (path) {
return this.createObject(dojo.gfx.Path, path, true);
}, createRect:function (rect) {
return this.createObject(dojo.gfx.Rect, rect);
}, createCircle:function (circle) {
return this.createObject(dojo.gfx.Circle, circle);
}, createEllipse:function (ellipse) {
return this.createObject(dojo.gfx.Ellipse, ellipse);
}, createLine:function (line) {
return this.createObject(dojo.gfx.Line, line, true);
}, createPolyline:function (points) {
return this.createObject(dojo.gfx.Polyline, points, true);
}, createImage:function (image) {
if (!this.rawNode) {
return null;
}
var shape = new dojo.gfx.Image();
var node = document.createElement("div");
node.style.position = "relative";
node.style.width = this.rawNode.style.width;
node.style.height = this.rawNode.style.height;
node.style.filter = "progid:DXImageTransform.Microsoft.Matrix(M11=1, M12=0, M21=0, M22=1, Dx=0, Dy=0)";
var img = document.createElement("img");
node.appendChild(img);
shape.setRawNode(node);
this.rawNode.appendChild(node);
shape.setShape(image);
this.add(shape);
return shape;
}, createGroup:function () {
return this.createObject(dojo.gfx.Group, null, true);
}, createObject:function (shapeType, rawShape, overrideSize) {
if (!this.rawNode) {
return null;
}
var shape = new shapeType();
var node = document.createElement("v:" + shapeType.nodeType);
shape.setRawNode(node);
this.rawNode.appendChild(node);
if (overrideSize) {
this._overrideSize(node);
}
shape.setShape(rawShape);
this.add(shape);
return shape;
}, _overrideSize:function (node) {
node.style.width = this.rawNode.style.width;
node.style.height = this.rawNode.style.height;
node.coordsize = parseFloat(node.style.width) + " " + parseFloat(node.style.height);
}};
dojo.lang.extend(dojo.gfx.Group, dojo.gfx._creators);
dojo.lang.extend(dojo.gfx.Surface, dojo.gfx._creators);
delete dojo.gfx._creators;
dojo.gfx.attachNode = function (node) {
if (!node) {
return null;
}
var s = null;
switch (node.tagName.toLowerCase()) {
case dojo.gfx.Rect.nodeType:
s = new dojo.gfx.Rect();
break;
case dojo.gfx.Ellipse.nodeType:
s = (node.style.width == node.style.height) ? new dojo.gfx.Circle() : new dojo.gfx.Ellipse();
break;
case dojo.gfx.Path.nodeType:
switch (node.getAttribute("dojoGfxType")) {
case "line":
s = new dojo.gfx.Line();
break;
case "polyline":
s = new dojo.gfx.Polyline();
break;
case "path":
s = new dojo.gfx.Path();
break;
}
break;
case dojo.gfx.Image.nodeType:
s = new dojo.gfx.Image();
break;
default:
dojo.debug("FATAL ERROR! tagName = " + node.tagName);
}
s.attach(node);
return s;
};
dojo.lang.extend(dojo.gfx.Surface, {setDimensions:function (width, height) {
if (!this.rawNode) {
return this;
}
this.rawNode.style.width = width;
this.rawNode.style.height = height;
this.rawNode.coordsize = width + " " + height;
return this;
}, getDimensions:function () {
return this.rawNode ? {width:this.rawNode.style.width, height:this.rawNode.style.height} : null;
}, add:function (shape) {
var oldParent = shape.getParent();
if (this != oldParent) {
this.rawNode.appendChild(shape.rawNode);
if (oldParent) {
oldParent.remove(shape, true);
}
shape._setParent(this, null);
}
return this;
}, remove:function (shape, silently) {
if (this == shape.getParent()) {
if (this.rawNode == shape.rawNode.parentNode) {
this.rawNode.removeChild(shape.rawNode);
}
shape._setParent(null, null);
}
return this;
}});
dojo.gfx.createSurface = function (parentNode, width, height) {
var s = new dojo.gfx.Surface();
s.rawNode = document.createElement("v:group");
s.rawNode.style.width = width ? width : "100%";
s.rawNode.style.height = height ? height : "100%";
s.rawNode.coordsize = (width && height) ? (parseFloat(width) + " " + parseFloat(height)) : "100% 100%";
s.rawNode.coordorigin = "0 0";
dojo.byId(parentNode).appendChild(s.rawNode);
return s;
};
dojo.gfx.attachSurface = function (node) {
var s = new dojo.gfx.Surface();
s.rawNode = node;
return s;
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/gfx/svg.js
New file
0,0 → 1,471
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.gfx.svg");
dojo.require("dojo.lang.declare");
dojo.require("dojo.svg");
dojo.require("dojo.gfx.color");
dojo.require("dojo.gfx.common");
dojo.require("dojo.gfx.shape");
dojo.require("dojo.gfx.path");
dojo.require("dojo.experimental");
dojo.experimental("dojo.gfx.svg");
dojo.gfx.svg.getRef = function (fill) {
if (!fill || fill == "none") {
return null;
}
if (fill.match(/^url\(#.+\)$/)) {
return dojo.byId(fill.slice(5, -1));
}
if (dojo.render.html.opera && fill.match(/^#dj_unique_.+$/)) {
return dojo.byId(fill.slice(1));
}
return null;
};
dojo.lang.extend(dojo.gfx.Shape, {setFill:function (fill) {
if (!fill) {
this.fillStyle = null;
this.rawNode.setAttribute("fill", "none");
this.rawNode.setAttribute("fill-opacity", 0);
return this;
}
if (typeof (fill) == "object" && "type" in fill) {
switch (fill.type) {
case "linear":
var f = dojo.gfx.makeParameters(dojo.gfx.defaultLinearGradient, fill);
var gradient = this._setFillObject(f, "linearGradient");
dojo.lang.forEach(["x1", "y1", "x2", "y2"], function (x) {
gradient.setAttribute(x, f[x].toFixed(8));
});
break;
case "radial":
var f = dojo.gfx.makeParameters(dojo.gfx.defaultRadialGradient, fill);
var gradient = this._setFillObject(f, "radialGradient");
dojo.lang.forEach(["cx", "cy", "r"], function (x) {
gradient.setAttribute(x, f[x].toFixed(8));
});
break;
case "pattern":
var f = dojo.gfx.makeParameters(dojo.gfx.defaultPattern, fill);
var pattern = this._setFillObject(f, "pattern");
dojo.lang.forEach(["x", "y", "width", "height"], function (x) {
pattern.setAttribute(x, f[x].toFixed(8));
});
break;
}
return this;
}
var f = dojo.gfx.normalizeColor(fill);
this.fillStyle = f;
this.rawNode.setAttribute("fill", f.toCss());
this.rawNode.setAttribute("fill-opacity", f.a);
return this;
}, setStroke:function (stroke) {
if (!stroke) {
this.strokeStyle = null;
this.rawNode.setAttribute("stroke", "none");
this.rawNode.setAttribute("stroke-opacity", 0);
return this;
}
this.strokeStyle = dojo.gfx.makeParameters(dojo.gfx.defaultStroke, stroke);
this.strokeStyle.color = dojo.gfx.normalizeColor(this.strokeStyle.color);
var s = this.strokeStyle;
var rn = this.rawNode;
if (s) {
rn.setAttribute("stroke", s.color.toCss());
rn.setAttribute("stroke-opacity", s.color.a);
rn.setAttribute("stroke-width", s.width);
rn.setAttribute("stroke-linecap", s.cap);
if (typeof (s.join) == "number") {
rn.setAttribute("stroke-linejoin", "miter");
rn.setAttribute("stroke-miterlimit", s.join);
} else {
rn.setAttribute("stroke-linejoin", s.join);
}
}
return this;
}, _setFillObject:function (f, nodeType) {
var def_elems = this.rawNode.parentNode.getElementsByTagName("defs");
if (def_elems.length == 0) {
return this;
}
this.fillStyle = f;
var defs = def_elems[0];
var fill = this.rawNode.getAttribute("fill");
var ref = dojo.gfx.svg.getRef(fill);
if (ref) {
fill = ref;
if (fill.tagName.toLowerCase() != nodeType.toLowerCase()) {
var id = fill.id;
fill.parentNode.removeChild(fill);
fill = document.createElementNS(dojo.svg.xmlns.svg, nodeType);
fill.setAttribute("id", id);
defs.appendChild(fill);
} else {
while (fill.childNodes.length) {
fill.removeChild(fill.lastChild);
}
}
} else {
fill = document.createElementNS(dojo.svg.xmlns.svg, nodeType);
fill.setAttribute("id", dojo.dom.getUniqueId());
defs.appendChild(fill);
}
if (nodeType == "pattern") {
fill.setAttribute("patternUnits", "userSpaceOnUse");
var img = document.createElementNS(dojo.svg.xmlns.svg, "image");
img.setAttribute("x", 0);
img.setAttribute("y", 0);
img.setAttribute("width", f.width.toFixed(8));
img.setAttribute("height", f.height.toFixed(8));
img.setAttributeNS(dojo.svg.xmlns.xlink, "href", f.src);
fill.appendChild(img);
} else {
fill.setAttribute("gradientUnits", "userSpaceOnUse");
for (var i = 0; i < f.colors.length; ++i) {
f.colors[i].color = dojo.gfx.normalizeColor(f.colors[i].color);
var t = document.createElementNS(dojo.svg.xmlns.svg, "stop");
t.setAttribute("offset", f.colors[i].offset.toFixed(8));
t.setAttribute("stop-color", f.colors[i].color.toCss());
fill.appendChild(t);
}
}
this.rawNode.setAttribute("fill", "url(#" + fill.getAttribute("id") + ")");
this.rawNode.removeAttribute("fill-opacity");
return fill;
}, _applyTransform:function () {
var matrix = this._getRealMatrix();
if (matrix) {
var tm = this.matrix;
this.rawNode.setAttribute("transform", "matrix(" + tm.xx.toFixed(8) + "," + tm.yx.toFixed(8) + "," + tm.xy.toFixed(8) + "," + tm.yy.toFixed(8) + "," + tm.dx.toFixed(8) + "," + tm.dy.toFixed(8) + ")");
} else {
this.rawNode.removeAttribute("transform");
}
return this;
}, setRawNode:function (rawNode) {
with (rawNode) {
setAttribute("fill", "none");
setAttribute("fill-opacity", 0);
setAttribute("stroke", "none");
setAttribute("stroke-opacity", 0);
setAttribute("stroke-width", 1);
setAttribute("stroke-linecap", "butt");
setAttribute("stroke-linejoin", "miter");
setAttribute("stroke-miterlimit", 4);
}
this.rawNode = rawNode;
}, moveToFront:function () {
this.rawNode.parentNode.appendChild(this.rawNode);
return this;
}, moveToBack:function () {
this.rawNode.parentNode.insertBefore(this.rawNode, this.rawNode.parentNode.firstChild);
return this;
}, setShape:function (newShape) {
this.shape = dojo.gfx.makeParameters(this.shape, newShape);
for (var i in this.shape) {
if (i != "type") {
this.rawNode.setAttribute(i, this.shape[i]);
}
}
return this;
}, attachFill:function (rawNode) {
var fillStyle = null;
if (rawNode) {
var fill = rawNode.getAttribute("fill");
if (fill == "none") {
return;
}
var ref = dojo.gfx.svg.getRef(fill);
if (ref) {
var gradient = ref;
switch (gradient.tagName.toLowerCase()) {
case "lineargradient":
fillStyle = this._getGradient(dojo.gfx.defaultLinearGradient, gradient);
dojo.lang.forEach(["x1", "y1", "x2", "y2"], function (x) {
fillStyle[x] = gradient.getAttribute(x);
});
break;
case "radialgradient":
fillStyle = this._getGradient(dojo.gfx.defaultRadialGradient, gradient);
dojo.lang.forEach(["cx", "cy", "r"], function (x) {
fillStyle[x] = gradient.getAttribute(x);
});
fillStyle.cx = gradient.getAttribute("cx");
fillStyle.cy = gradient.getAttribute("cy");
fillStyle.r = gradient.getAttribute("r");
break;
case "pattern":
fillStyle = dojo.lang.shallowCopy(dojo.gfx.defaultPattern, true);
dojo.lang.forEach(["x", "y", "width", "height"], function (x) {
fillStyle[x] = gradient.getAttribute(x);
});
fillStyle.src = gradient.firstChild.getAttributeNS(dojo.svg.xmlns.xlink, "href");
break;
}
} else {
fillStyle = new dojo.gfx.color.Color(fill);
var opacity = rawNode.getAttribute("fill-opacity");
if (opacity != null) {
fillStyle.a = opacity;
}
}
}
return fillStyle;
}, _getGradient:function (defaultGradient, gradient) {
var fillStyle = dojo.lang.shallowCopy(defaultGradient, true);
fillStyle.colors = [];
for (var i = 0; i < gradient.childNodes.length; ++i) {
fillStyle.colors.push({offset:gradient.childNodes[i].getAttribute("offset"), color:new dojo.gfx.color.Color(gradient.childNodes[i].getAttribute("stop-color"))});
}
return fillStyle;
}, attachStroke:function (rawNode) {
if (!rawNode) {
return;
}
var stroke = rawNode.getAttribute("stroke");
if (stroke == null || stroke == "none") {
return null;
}
var strokeStyle = dojo.lang.shallowCopy(dojo.gfx.defaultStroke, true);
var color = new dojo.gfx.color.Color(stroke);
if (color) {
strokeStyle.color = color;
strokeStyle.color.a = rawNode.getAttribute("stroke-opacity");
strokeStyle.width = rawNode.getAttribute("stroke-width");
strokeStyle.cap = rawNode.getAttribute("stroke-linecap");
strokeStyle.join = rawNode.getAttribute("stroke-linejoin");
if (strokeStyle.join == "miter") {
strokeStyle.join = rawNode.getAttribute("stroke-miterlimit");
}
}
return strokeStyle;
}, attachTransform:function (rawNode) {
var matrix = null;
if (rawNode) {
matrix = rawNode.getAttribute("transform");
if (matrix.match(/^matrix\(.+\)$/)) {
var t = matrix.slice(7, -1).split(",");
matrix = dojo.gfx.matrix.normalize({xx:parseFloat(t[0]), xy:parseFloat(t[2]), yx:parseFloat(t[1]), yy:parseFloat(t[3]), dx:parseFloat(t[4]), dy:parseFloat(t[5])});
}
}
return matrix;
}, attachShape:function (rawNode) {
var shape = null;
if (rawNode) {
shape = dojo.lang.shallowCopy(this.shape, true);
for (var i in shape) {
shape[i] = rawNode.getAttribute(i);
}
}
return shape;
}, attach:function (rawNode) {
if (rawNode) {
this.rawNode = rawNode;
this.fillStyle = this.attachFill(rawNode);
this.strokeStyle = this.attachStroke(rawNode);
this.matrix = this.attachTransform(rawNode);
this.shape = this.attachShape(rawNode);
}
}});
dojo.declare("dojo.gfx.Group", dojo.gfx.Shape, {setRawNode:function (rawNode) {
this.rawNode = rawNode;
}});
dojo.gfx.Group.nodeType = "g";
dojo.declare("dojo.gfx.Rect", dojo.gfx.shape.Rect, {attachShape:function (rawNode) {
var shape = null;
if (rawNode) {
shape = dojo.gfx.Rect.superclass.attachShape.apply(this, arguments);
shape.r = Math.min(rawNode.getAttribute("rx"), rawNode.getAttribute("ry"));
}
return shape;
}, setShape:function (newShape) {
this.shape = dojo.gfx.makeParameters(this.shape, newShape);
this.bbox = null;
for (var i in this.shape) {
if (i != "type" && i != "r") {
this.rawNode.setAttribute(i, this.shape[i]);
}
}
this.rawNode.setAttribute("rx", this.shape.r);
this.rawNode.setAttribute("ry", this.shape.r);
return this;
}});
dojo.gfx.Rect.nodeType = "rect";
dojo.gfx.Ellipse = dojo.gfx.shape.Ellipse;
dojo.gfx.Ellipse.nodeType = "ellipse";
dojo.gfx.Circle = dojo.gfx.shape.Circle;
dojo.gfx.Circle.nodeType = "circle";
dojo.gfx.Line = dojo.gfx.shape.Line;
dojo.gfx.Line.nodeType = "line";
dojo.declare("dojo.gfx.Polyline", dojo.gfx.shape.Polyline, {setShape:function (points) {
if (points && points instanceof Array) {
this.shape = dojo.gfx.makeParameters(this.shape, {points:points});
if (closed && this.shape.points.length) {
this.shape.points.push(this.shape.points[0]);
}
} else {
this.shape = dojo.gfx.makeParameters(this.shape, points);
}
this.box = null;
var attr = [];
var p = this.shape.points;
for (var i = 0; i < p.length; ++i) {
attr.push(p[i].x.toFixed(8));
attr.push(p[i].y.toFixed(8));
}
this.rawNode.setAttribute("points", attr.join(" "));
return this;
}});
dojo.gfx.Polyline.nodeType = "polyline";
dojo.declare("dojo.gfx.Image", dojo.gfx.shape.Image, {setShape:function (newShape) {
this.shape = dojo.gfx.makeParameters(this.shape, newShape);
this.bbox = null;
var rawNode = this.rawNode;
for (var i in this.shape) {
if (i != "type" && i != "src") {
rawNode.setAttribute(i, this.shape[i]);
}
}
rawNode.setAttributeNS(dojo.svg.xmlns.xlink, "href", this.shape.src);
return this;
}, setStroke:function () {
return this;
}, setFill:function () {
return this;
}, attachStroke:function (rawNode) {
return null;
}, attachFill:function (rawNode) {
return null;
}});
dojo.gfx.Image.nodeType = "image";
dojo.declare("dojo.gfx.Path", dojo.gfx.path.Path, {_updateWithSegment:function (segment) {
dojo.gfx.Path.superclass._updateWithSegment.apply(this, arguments);
if (typeof (this.shape.path) == "string") {
this.rawNode.setAttribute("d", this.shape.path);
}
}, setShape:function (newShape) {
dojo.gfx.Path.superclass.setShape.apply(this, arguments);
this.rawNode.setAttribute("d", this.shape.path);
return this;
}});
dojo.gfx.Path.nodeType = "path";
dojo.gfx._creators = {createPath:function (path) {
return this.createObject(dojo.gfx.Path, path);
}, createRect:function (rect) {
return this.createObject(dojo.gfx.Rect, rect);
}, createCircle:function (circle) {
return this.createObject(dojo.gfx.Circle, circle);
}, createEllipse:function (ellipse) {
return this.createObject(dojo.gfx.Ellipse, ellipse);
}, createLine:function (line) {
return this.createObject(dojo.gfx.Line, line);
}, createPolyline:function (points) {
return this.createObject(dojo.gfx.Polyline, points);
}, createImage:function (image) {
return this.createObject(dojo.gfx.Image, image);
}, createGroup:function () {
return this.createObject(dojo.gfx.Group);
}, createObject:function (shapeType, rawShape) {
if (!this.rawNode) {
return null;
}
var shape = new shapeType();
var node = document.createElementNS(dojo.svg.xmlns.svg, shapeType.nodeType);
shape.setRawNode(node);
this.rawNode.appendChild(node);
shape.setShape(rawShape);
this.add(shape);
return shape;
}, add:function (shape) {
var oldParent = shape.getParent();
if (oldParent) {
oldParent.remove(shape, true);
}
shape._setParent(this, null);
this.rawNode.appendChild(shape.rawNode);
return this;
}, remove:function (shape, silently) {
if (this.rawNode == shape.rawNode.parentNode) {
this.rawNode.removeChild(shape.rawNode);
}
shape._setParent(null, null);
return this;
}};
dojo.gfx.attachNode = function (node) {
if (!node) {
return null;
}
var s = null;
switch (node.tagName.toLowerCase()) {
case dojo.gfx.Rect.nodeType:
s = new dojo.gfx.Rect();
break;
case dojo.gfx.Ellipse.nodeType:
s = new dojo.gfx.Ellipse();
break;
case dojo.gfx.Polyline.nodeType:
s = new dojo.gfx.Polyline();
break;
case dojo.gfx.Path.nodeType:
s = new dojo.gfx.Path();
break;
case dojo.gfx.Circle.nodeType:
s = new dojo.gfx.Circle();
break;
case dojo.gfx.Line.nodeType:
s = new dojo.gfx.Line();
break;
case dojo.gfx.Image.nodeType:
s = new dojo.gfx.Image();
break;
default:
dojo.debug("FATAL ERROR! tagName = " + node.tagName);
}
s.attach(node);
return s;
};
dojo.lang.extend(dojo.gfx.Surface, {setDimensions:function (width, height) {
if (!this.rawNode) {
return this;
}
this.rawNode.setAttribute("width", width);
this.rawNode.setAttribute("height", height);
return this;
}, getDimensions:function () {
return this.rawNode ? {width:this.rawNode.getAttribute("width"), height:this.rawNode.getAttribute("height")} : null;
}});
dojo.gfx.createSurface = function (parentNode, width, height) {
var s = new dojo.gfx.Surface();
s.rawNode = document.createElementNS(dojo.svg.xmlns.svg, "svg");
s.rawNode.setAttribute("width", width);
s.rawNode.setAttribute("height", height);
var defs = new dojo.gfx.svg.Defines();
var node = document.createElementNS(dojo.svg.xmlns.svg, dojo.gfx.svg.Defines.nodeType);
defs.setRawNode(node);
s.rawNode.appendChild(node);
dojo.byId(parentNode).appendChild(s.rawNode);
return s;
};
dojo.gfx.attachSurface = function (node) {
var s = new dojo.gfx.Surface();
s.rawNode = node;
return s;
};
dojo.lang.extend(dojo.gfx.Group, dojo.gfx._creators);
dojo.lang.extend(dojo.gfx.Surface, dojo.gfx._creators);
delete dojo.gfx._creators;
dojo.gfx.svg.Defines = function () {
this.rawNode = null;
};
dojo.lang.extend(dojo.gfx.svg.Defines, {setRawNode:function (rawNode) {
this.rawNode = rawNode;
}});
dojo.gfx.svg.Defines.nodeType = "defs";
 
/tags/Racine_livraison_narmer/api/js/dojo/src/a11y.js
New file
0,0 → 1,52
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.a11y");
dojo.require("dojo.uri.*");
dojo.require("dojo.html.common");
dojo.a11y = {imgPath:dojo.uri.moduleUri("dojo.widget", "templates/images"), doAccessibleCheck:true, accessible:null, checkAccessible:function () {
if (this.accessible === null) {
this.accessible = false;
if (this.doAccessibleCheck == true) {
this.accessible = this.testAccessible();
}
}
return this.accessible;
}, testAccessible:function () {
this.accessible = false;
if (dojo.render.html.ie || dojo.render.html.mozilla) {
var div = document.createElement("div");
div.style.backgroundImage = "url(\"" + this.imgPath + "/tab_close.gif\")";
dojo.body().appendChild(div);
var bkImg = null;
if (window.getComputedStyle) {
var cStyle = getComputedStyle(div, "");
bkImg = cStyle.getPropertyValue("background-image");
} else {
bkImg = div.currentStyle.backgroundImage;
}
var bUseImgElem = false;
if (bkImg != null && (bkImg == "none" || bkImg == "url(invalid-url:)")) {
this.accessible = true;
}
dojo.body().removeChild(div);
}
return this.accessible;
}, setCheckAccessible:function (bTest) {
this.doAccessibleCheck = bTest;
}, setAccessibleMode:function () {
if (this.accessible === null) {
if (this.checkAccessible()) {
dojo.render.html.prefixes.unshift("a11y");
}
}
return this.accessible;
}};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/debug/arrow_hide.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/debug/arrow_hide.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/debug/console.js
New file
0,0 → 1,95
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.debug.console");
dojo.require("dojo.logging.ConsoleLogger");
if (window.console) {
if (console.info != null) {
dojo.hostenv.println = function () {
if (!djConfig.isDebug) {
return;
}
console.info.apply(console, arguments);
};
dojo.debug = dojo.hostenv.println;
dojo.debugDeep = dojo.debug;
dojo.debugShallow = function (obj, showMethods, sort) {
if (!djConfig.isDebug) {
return;
}
showMethods = (showMethods != false);
sort = (sort != false);
if (obj == null || obj.constructor == null) {
return dojo.debug(obj);
}
var type = obj.declaredClass;
if (type == null) {
type = obj.constructor.toString().match(/function\s*(.*)\(/);
if (type) {
type = type[1];
}
}
if (type) {
if (type == "String" || type == "Number") {
return dojo.debug(type + ": ", obj);
}
if (showMethods && !sort) {
var sortedObj = obj;
} else {
var propNames = [];
if (showMethods) {
for (var prop in obj) {
propNames.push(prop);
}
} else {
for (var prop in obj) {
if (typeof obj[prop] != "function") {
propNames.push(prop);
} else {
dojo.debug(prop);
}
}
}
if (sort) {
propNames.sort();
}
var sortedObj = {};
dojo.lang.forEach(propNames, function (prop) {
sortedObj[prop] = obj[prop];
});
}
return dojo.debug(type + ": %o\n%2.o", obj, sortedObj);
}
return dojo.debug(obj.constructor + ": ", obj);
};
} else {
if (console.log != null) {
dojo.hostenv.println = function () {
if (!djConfig.isDebug) {
return;
}
var args = dojo.lang.toArray(arguments);
console.log("DEBUG: " + args.join(" "));
};
dojo.debug = dojo.hostenv.println;
} else {
dojo.debug("dojo.debug.console requires Firebug > 0.4");
}
}
} else {
if (dojo.render.html.opera) {
if (opera && opera.postError) {
dojo.hostenv.println = opera.postError;
} else {
dojo.debug("dojo.debug.Opera requires Opera > 8.0");
}
}
}
 
/tags/Racine_livraison_narmer/api/js/dojo/src/debug/Firebug.js
New file
0,0 → 1,55
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.debug.Firebug");
dojo.deprecated("dojo.debug.Firebug is slated for removal in 0.5; use dojo.debug.console instead.", "0.5");
if (dojo.render.html.moz) {
if (console && console.log) {
var consoleLog = function () {
if (!djConfig.isDebug) {
return;
}
var args = dojo.lang.toArray(arguments);
args.splice(0, 0, "DEBUG: ");
console.log.apply(console, args);
};
dojo.debug = consoleLog;
dojo.debugDeep = consoleLog;
dojo.debugShallow = function (obj) {
if (!djConfig.isDebug) {
return;
}
if (dojo.lang.isArray(obj)) {
console.log("Array: ", obj);
for (var i = 0; x < obj.length; i++) {
console.log(" ", "[" + i + "]", obj[i]);
}
} else {
console.log("Object: ", obj);
var propNames = [];
for (var prop in obj) {
propNames.push(prop);
}
propNames.sort();
dojo.lang.forEach(propNames, function (prop) {
try {
console.log(" ", prop, obj[prop]);
}
catch (e) {
console.log(" ", prop, "ERROR", e.message, e);
}
});
}
};
} else {
dojo.debug("dojo.debug.Firebug requires Firebug > 0.4");
}
}
 
/tags/Racine_livraison_narmer/api/js/dojo/src/debug/arrow_show.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/debug/arrow_show.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/debug/deep.html
New file
0,0 → 1,362
<html>
<head>
<title>Deep Debugger</title>
<script>
 
var tableRows = {};
var tableCels = {};
var tableObjs = {};
var tablesBuilt = {};
var tableShows = {};
var tableHides = {};
 
// IE: nodes w/id need to be redeclared or getElementById is b0rked
var frame = null;
 
window.onload = function(){
// if IE loads this page too quickly (instantly) then
// window.debugVar might not have been set
window.setTimeout(startMeUp, 100);
}
 
function startMeUp(){
frame = document.getElementById('frame');
// GET string
var index = location.search.split("=").pop();
var debugObj = window.opener.dojo.debugDeep;
var debugVar = debugObj.debugVars[index] || window.debugVar;
buildTable('root', frame, debugVar);
}
 
function buildTable(path, parent, obj){
var keys = [];
var vals = [];
for(var prop in obj){
keys.push(prop);
try {
vals[prop] = obj[prop];
} catch(E) {
vals[prop] = 'ERROR: ' + E.message;
}
}
keys.sort(keySorter);
 
if (!keys.length){
 
var div = document.createElement('div');
div.appendChild(document.createTextNode('Object has no properties.'));
 
parent.appendChild(div);
return;
}
 
 
var t = document.createElement('table');
t.border = "1";
 
var tb = document.createElement('tbody');
t.appendChild(tb);
 
 
for(var i = 0; i < keys.length; i++) {
buildTableRow(path+'-'+keys[i], tb, keys[i], vals[keys[i]]);
}
 
if (path == 'root'){
//t.style.width = '90%';
}
t.style.width = '100%';
 
parent.appendChild(t);
 
tablesBuilt[path] = true;
}
 
function buildTableRow(path, tb, name, value) {
 
var simpleType = typeof(value);
var createSubrow = (simpleType == 'object');
var complexType = simpleType;
 
if (simpleType == 'object'){
var cls = getConstructorClass(value);
if (cls){
if (cls == 'Object'){
}else if (cls == 'Array'){
complexType = 'array';
}else{
complexType += ' ('+cls+')';
}
}
}
 
/*var tr1 = document.createElement('tr');
var td1 = document.createElement('td');
var td2 = document.createElement('td');
var td3 = document.createElement('td');
var td4 = document.createElement('td');*/
 
var row = tb.rows.length;
var tr1 = tb.insertRow(row++);
var td1 = tr1.insertCell(0);
var td2 = tr1.insertCell(1);
var td3 = tr1.insertCell(2);
var td4 = tr1.insertCell(3);
tr1.style.verticalAlign = 'top';
td1.style.verticalAlign = 'middle';
 
td1.className = 'propPlus';
td2.className = 'propName';
td3.className = 'propType';
td4.className = 'propVal';
 
//tr1.appendChild(td1);
//tr1.appendChild(td2);
//tr1.appendChild(td3);
//tr1.appendChild(td4);
 
if (createSubrow){
var img1 = document.createElement('img');
img1.width = 9;
img1.height = 9;
img1.src = 'arrow_show.gif';
var a1 = document.createElement('a');
a1.appendChild(img1);
a1.href = '#';
a1.onclick = function(){ showTableRow(path); return false; };
 
var img2 = document.createElement('img');
img2.width = 9;
img2.height = 9;
img2.src = 'arrow_hide.gif';
var a2 = document.createElement('a');
a2.appendChild(img2);
a2.href = '#';
a2.onclick = function(){ hideTableRow(path); return false; };
a2.style.display = 'none';
 
tableShows[path] = a1;
tableHides[path] = a2;
 
td1.appendChild(a1);
td1.appendChild(a2);
}else{
var img = document.createElement('img');
img.width = 9;
img.height = 9;
img.src = 'spacer.gif';
 
td1.appendChild(img);
}
 
td2.appendChild(document.createTextNode(name));
td3.appendChild(document.createTextNode(complexType));
td4.appendChild(buildPreBlock(value));
 
//tb.appendChild(tr1);
 
if (createSubrow){
var tr2 = tb.insertRow(row++);
var td5 = tr2.insertCell(0);
var td6 = tr2.insertCell(1);
//var tr2 = document.createElement('tr');
//var td5 = document.createElement('td');
//var td6 = document.createElement('td');
 
td5.innerHTML = '&nbsp;';
//td6.innerHTML = '&nbsp;';
 
td6.colSpan = '3';
 
tr2.appendChild(td5);
tr2.appendChild(td6);
 
tr2.style.display = 'none';
 
tb.appendChild(tr2);
 
tableRows[path] = tr2;
tableCels[path] = td6;
tableObjs[path] = value;
}
}
 
function showTableRow(path){
 
var tr = tableRows[path];
var td = tableCels[path];
var a1 = tableShows[path];
var a2 = tableHides[path];
 
if (!tablesBuilt[path]){
 
//alert('building table for '+path);
buildTable(path, td, tableObjs[path]);
}
 
tr.style.display = 'table-row';
 
a1.style.display = 'none';
a2.style.display = 'inline';
}
 
function hideTableRow(path){
 
var tr = tableRows[path];
var a1 = tableShows[path];
var a2 = tableHides[path];
 
tr.style.display = 'none';
 
a1.style.display = 'inline';
a2.style.display = 'none';
}
 
function buildPreBlock(value){
 
//
// how many lines ?
//
 
var s = ''+value;
s = s.replace("\r\n", "\n");
s = s.replace("\r", "");
var lines = s.split("\n");
 
 
if (lines.length < 2){
 
if (lines[0].length < 60){
 
var pre = document.createElement('pre');
pre.appendChild(document.createTextNode(s));
return pre;
}
}
 
 
//
// multiple lines :(
//
 
var preview = lines[0].substr(0, 60) + ' ...';
 
var pre1 = document.createElement('pre');
pre1.appendChild(document.createTextNode(preview));
pre1.className = 'clicky';
 
var pre2 = document.createElement('pre');
pre2.appendChild(document.createTextNode(s));
pre2.style.display = 'none';
pre2.className = 'clicky';
 
pre1.onclick = function(){
pre1.style.display = 'none';
pre2.style.display = 'block';
}
 
pre2.onclick = function(){
pre1.style.display = 'block';
pre2.style.display = 'none';
}
 
var pre = document.createElement('div');
 
pre.appendChild(pre1);
pre.appendChild(pre2);
 
return pre;
}
 
function getConstructorClass(obj){
 
if (!obj.constructor || !obj.constructor.toString) return;
 
var m = obj.constructor.toString().match(/function\s*(\w+)/);
 
if (m && m.length == 2) return m[1];
 
return null;
}
 
function keySorter(a, b){
 
if (a == parseInt(a) && b == parseInt(b)){
 
return (parseInt(a) > parseInt(b)) ? 1 : ((parseInt(a) < parseInt(b)) ? -1 : 0);
}
 
// sort by lowercase string
 
var a2 = String(a).toLowerCase();
var b2 = String(b).toLowerCase();
 
return (a2 > b2) ? 1 : ((a2 < b2) ? -1 : 0);
}
 
</script>
<style>
 
body {
font-family: arial, helvetica, sans-serif;
}
 
table {
border-width: 0px;
border-spacing: 1px;
border-collapse: separate;
}
 
td {
border-width: 0px;
padding: 2px;
}
 
img {
border: 0;
}
 
pre {
margin: 0;
padding: 0;
white-space: -moz-pre-wrap; /* Mozilla, supported since 1999 */
white-space: -pre-wrap; /* Opera 4 - 6 */
white-space: -o-pre-wrap; /* Opera 7 */
white-space: pre-wrap; /* CSS3 - Text module (Candidate Recommendation) http://www.w3.org/TR/css3-text/#white-space */
word-wrap: break-word; /* IE 5.5+ */
}
 
pre.clicky {
cursor: hand;
cursor: pointer;
}
 
td.propPlus {
width: 9px;
background-color: #ddd;
}
 
td.propName {
background-color: #ddd;
}
 
td.propType {
background-color: #ddd;
}
 
td.propVal {
background-color: #ddd;
}
 
</style>
</head>
<body>
 
<h2>Javascript Object Browser</h2>
 
<div id="frame"></div>
 
</body>
</html>
/tags/Racine_livraison_narmer/api/js/dojo/src/debug/spacer.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/debug/spacer.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/crypto.js
New file
0,0 → 1,14
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.crypto");
dojo.crypto.cipherModes = {ECB:0, CBC:1, PCBC:2, CFB:3, OFB:4, CTR:5};
dojo.crypto.outputTypes = {Base64:0, Hex:1, String:2, Raw:3};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/event.js
New file
0,0 → 1,14
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.event");
dojo.require("dojo.event.*");
dojo.deprecated("dojo.event", "replaced by dojo.event.*", "0.5");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/uri/cache.js
New file
0,0 → 1,30
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.uri.cache");
dojo.uri.cache = {_cache:{}, set:function (uri, content) {
this._cache[uri.toString()] = content;
return uri;
}, remove:function (uri) {
delete this._cache[uri.toString()];
}, get:function (uri) {
var key = uri.toString();
var value = this._cache[key];
if (!value) {
value = dojo.hostenv.getText(key);
if (value) {
this._cache[key] = value;
}
}
return value;
}, allow:function (uri) {
return uri;
}};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/uri/__package__.js
New file
0,0 → 1,13
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.kwCompoundRequire({common:[["dojo.uri.Uri", false, false]]});
dojo.provide("dojo.uri.*");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/uri/Uri.js
New file
0,0 → 1,113
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.uri.Uri");
dojo.uri = new function () {
this.dojoUri = function (uri) {
return new dojo.uri.Uri(dojo.hostenv.getBaseScriptUri(), uri);
};
this.moduleUri = function (module, uri) {
var loc = dojo.hostenv.getModuleSymbols(module).join("/");
if (!loc) {
return null;
}
if (loc.lastIndexOf("/") != loc.length - 1) {
loc += "/";
}
var colonIndex = loc.indexOf(":");
var slashIndex = loc.indexOf("/");
if (loc.charAt(0) != "/" && (colonIndex == -1 || colonIndex > slashIndex)) {
loc = dojo.hostenv.getBaseScriptUri() + loc;
}
return new dojo.uri.Uri(loc, uri);
};
this.Uri = function () {
var uri = arguments[0];
for (var i = 1; i < arguments.length; i++) {
if (!arguments[i]) {
continue;
}
var relobj = new dojo.uri.Uri(arguments[i].toString());
var uriobj = new dojo.uri.Uri(uri.toString());
if ((relobj.path == "") && (relobj.scheme == null) && (relobj.authority == null) && (relobj.query == null)) {
if (relobj.fragment != null) {
uriobj.fragment = relobj.fragment;
}
relobj = uriobj;
} else {
if (relobj.scheme == null) {
relobj.scheme = uriobj.scheme;
if (relobj.authority == null) {
relobj.authority = uriobj.authority;
if (relobj.path.charAt(0) != "/") {
var path = uriobj.path.substring(0, uriobj.path.lastIndexOf("/") + 1) + relobj.path;
var segs = path.split("/");
for (var j = 0; j < segs.length; j++) {
if (segs[j] == ".") {
if (j == segs.length - 1) {
segs[j] = "";
} else {
segs.splice(j, 1);
j--;
}
} else {
if (j > 0 && !(j == 1 && segs[0] == "") && segs[j] == ".." && segs[j - 1] != "..") {
if (j == segs.length - 1) {
segs.splice(j, 1);
segs[j - 1] = "";
} else {
segs.splice(j - 1, 2);
j -= 2;
}
}
}
}
relobj.path = segs.join("/");
}
}
}
}
uri = "";
if (relobj.scheme != null) {
uri += relobj.scheme + ":";
}
if (relobj.authority != null) {
uri += "//" + relobj.authority;
}
uri += relobj.path;
if (relobj.query != null) {
uri += "?" + relobj.query;
}
if (relobj.fragment != null) {
uri += "#" + relobj.fragment;
}
}
this.uri = uri.toString();
var regexp = "^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$";
var r = this.uri.match(new RegExp(regexp));
this.scheme = r[2] || (r[1] ? "" : null);
this.authority = r[4] || (r[3] ? "" : null);
this.path = r[5];
this.query = r[7] || (r[6] ? "" : null);
this.fragment = r[9] || (r[8] ? "" : null);
if (this.authority != null) {
regexp = "^((([^:]+:)?([^@]+))@)?([^:]*)(:([0-9]+))?$";
r = this.authority.match(new RegExp(regexp));
this.user = r[3] || null;
this.password = r[4] || null;
this.host = r[5];
this.port = r[7] || null;
}
this.toString = function () {
return this.uri;
};
};
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/debug.js
New file
0,0 → 1,83
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.debug");
dojo.debug = function () {
if (!djConfig.isDebug) {
return;
}
var args = arguments;
if (dj_undef("println", dojo.hostenv)) {
dojo.raise("dojo.debug not available (yet?)");
}
var isJUM = dj_global["jum"] && !dj_global["jum"].isBrowser;
var s = [(isJUM ? "" : "DEBUG: ")];
for (var i = 0; i < args.length; ++i) {
if (!false && args[i] && args[i] instanceof Error) {
var msg = "[" + args[i].name + ": " + dojo.errorToString(args[i]) + (args[i].fileName ? ", file: " + args[i].fileName : "") + (args[i].lineNumber ? ", line: " + args[i].lineNumber : "") + "]";
} else {
try {
var msg = String(args[i]);
}
catch (e) {
if (dojo.render.html.ie) {
var msg = "[ActiveXObject]";
} else {
var msg = "[unknown]";
}
}
}
s.push(msg);
}
dojo.hostenv.println(s.join(" "));
};
dojo.debugShallow = function (obj) {
if (!djConfig.isDebug) {
return;
}
dojo.debug("------------------------------------------------------------");
dojo.debug("Object: " + obj);
var props = [];
for (var prop in obj) {
try {
props.push(prop + ": " + obj[prop]);
}
catch (E) {
props.push(prop + ": ERROR - " + E.message);
}
}
props.sort();
for (var i = 0; i < props.length; i++) {
dojo.debug(props[i]);
}
dojo.debug("------------------------------------------------------------");
};
dojo.debugDeep = function (obj) {
if (!djConfig.isDebug) {
return;
}
if (!dojo.uri || !dojo.uri.dojoUri) {
return dojo.debug("You'll need to load dojo.uri.* for deep debugging - sorry!");
}
if (!window.open) {
return dojo.debug("Deep debugging is only supported in host environments with window.open");
}
var idx = dojo.debugDeep.debugVars.length;
dojo.debugDeep.debugVars.push(obj);
var url = (djConfig["dojoDebugDeepHtmlUrl"] || new dojo.uri.Uri(location, dojo.uri.moduleUri("dojo.debug", "deep.html")).toString()) + "?var=" + idx;
var win = window.open(url, "_blank", "width=600, height=400, resizable=yes, scrollbars=yes, status=yes");
try {
win.debugVar = obj;
}
catch (e) {
}
};
dojo.debugDeep.debugVars = [];
 
/tags/Racine_livraison_narmer/api/js/dojo/src/hostenv_browser.js
New file
0,0 → 1,413
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
if (typeof window != "undefined") {
(function () {
if (djConfig.allowQueryConfig) {
var baseUrl = document.location.toString();
var params = baseUrl.split("?", 2);
if (params.length > 1) {
var paramStr = params[1];
var pairs = paramStr.split("&");
for (var x in pairs) {
var sp = pairs[x].split("=");
if ((sp[0].length > 9) && (sp[0].substr(0, 9) == "djConfig.")) {
var opt = sp[0].substr(9);
try {
djConfig[opt] = eval(sp[1]);
}
catch (e) {
djConfig[opt] = sp[1];
}
}
}
}
}
if (((djConfig["baseScriptUri"] == "") || (djConfig["baseRelativePath"] == "")) && (document && document.getElementsByTagName)) {
var scripts = document.getElementsByTagName("script");
var rePkg = /(__package__|dojo|bootstrap1)\.js([\?\.]|$)/i;
for (var i = 0; i < scripts.length; i++) {
var src = scripts[i].getAttribute("src");
if (!src) {
continue;
}
var m = src.match(rePkg);
if (m) {
var root = src.substring(0, m.index);
if (src.indexOf("bootstrap1") > -1) {
root += "../";
}
if (!this["djConfig"]) {
djConfig = {};
}
if (djConfig["baseScriptUri"] == "") {
djConfig["baseScriptUri"] = root;
}
if (djConfig["baseRelativePath"] == "") {
djConfig["baseRelativePath"] = root;
}
break;
}
}
}
var dr = dojo.render;
var drh = dojo.render.html;
var drs = dojo.render.svg;
var dua = (drh.UA = navigator.userAgent);
var dav = (drh.AV = navigator.appVersion);
var t = true;
var f = false;
drh.capable = t;
drh.support.builtin = t;
dr.ver = parseFloat(drh.AV);
dr.os.mac = dav.indexOf("Macintosh") >= 0;
dr.os.win = dav.indexOf("Windows") >= 0;
dr.os.linux = dav.indexOf("X11") >= 0;
drh.opera = dua.indexOf("Opera") >= 0;
drh.khtml = (dav.indexOf("Konqueror") >= 0) || (dav.indexOf("Safari") >= 0);
drh.safari = dav.indexOf("Safari") >= 0;
var geckoPos = dua.indexOf("Gecko");
drh.mozilla = drh.moz = (geckoPos >= 0) && (!drh.khtml);
if (drh.mozilla) {
drh.geckoVersion = dua.substring(geckoPos + 6, geckoPos + 14);
}
drh.ie = (document.all) && (!drh.opera);
drh.ie50 = drh.ie && dav.indexOf("MSIE 5.0") >= 0;
drh.ie55 = drh.ie && dav.indexOf("MSIE 5.5") >= 0;
drh.ie60 = drh.ie && dav.indexOf("MSIE 6.0") >= 0;
drh.ie70 = drh.ie && dav.indexOf("MSIE 7.0") >= 0;
var cm = document["compatMode"];
drh.quirks = (cm == "BackCompat") || (cm == "QuirksMode") || drh.ie55 || drh.ie50;
dojo.locale = dojo.locale || (drh.ie ? navigator.userLanguage : navigator.language).toLowerCase();
dr.vml.capable = drh.ie;
drs.capable = f;
drs.support.plugin = f;
drs.support.builtin = f;
var tdoc = window["document"];
var tdi = tdoc["implementation"];
if ((tdi) && (tdi["hasFeature"]) && (tdi.hasFeature("org.w3c.dom.svg", "1.0"))) {
drs.capable = t;
drs.support.builtin = t;
drs.support.plugin = f;
}
if (drh.safari) {
var tmp = dua.split("AppleWebKit/")[1];
var ver = parseFloat(tmp.split(" ")[0]);
if (ver >= 420) {
drs.capable = t;
drs.support.builtin = t;
drs.support.plugin = f;
}
} else {
}
})();
dojo.hostenv.startPackage("dojo.hostenv");
dojo.render.name = dojo.hostenv.name_ = "browser";
dojo.hostenv.searchIds = [];
dojo.hostenv._XMLHTTP_PROGIDS = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP", "Msxml2.XMLHTTP.4.0"];
dojo.hostenv.getXmlhttpObject = function () {
var http = null;
var last_e = null;
try {
http = new XMLHttpRequest();
}
catch (e) {
}
if (!http) {
for (var i = 0; i < 3; ++i) {
var progid = dojo.hostenv._XMLHTTP_PROGIDS[i];
try {
http = new ActiveXObject(progid);
}
catch (e) {
last_e = e;
}
if (http) {
dojo.hostenv._XMLHTTP_PROGIDS = [progid];
break;
}
}
}
if (!http) {
return dojo.raise("XMLHTTP not available", last_e);
}
return http;
};
dojo.hostenv._blockAsync = false;
dojo.hostenv.getText = function (uri, async_cb, fail_ok) {
if (!async_cb) {
this._blockAsync = true;
}
var http = this.getXmlhttpObject();
function isDocumentOk(http) {
var stat = http["status"];
return Boolean((!stat) || ((200 <= stat) && (300 > stat)) || (stat == 304));
}
if (async_cb) {
var _this = this, timer = null, gbl = dojo.global();
var xhr = dojo.evalObjPath("dojo.io.XMLHTTPTransport");
http.onreadystatechange = function () {
if (timer) {
gbl.clearTimeout(timer);
timer = null;
}
if (_this._blockAsync || (xhr && xhr._blockAsync)) {
timer = gbl.setTimeout(function () {
http.onreadystatechange.apply(this);
}, 10);
} else {
if (4 == http.readyState) {
if (isDocumentOk(http)) {
async_cb(http.responseText);
}
}
}
};
}
http.open("GET", uri, async_cb ? true : false);
try {
http.send(null);
if (async_cb) {
return null;
}
if (!isDocumentOk(http)) {
var err = Error("Unable to load " + uri + " status:" + http.status);
err.status = http.status;
err.responseText = http.responseText;
throw err;
}
}
catch (e) {
this._blockAsync = false;
if ((fail_ok) && (!async_cb)) {
return null;
} else {
throw e;
}
}
this._blockAsync = false;
return http.responseText;
};
dojo.hostenv.defaultDebugContainerId = "dojoDebug";
dojo.hostenv._println_buffer = [];
dojo.hostenv._println_safe = false;
dojo.hostenv.println = function (line) {
if (!dojo.hostenv._println_safe) {
dojo.hostenv._println_buffer.push(line);
} else {
try {
var console = document.getElementById(djConfig.debugContainerId ? djConfig.debugContainerId : dojo.hostenv.defaultDebugContainerId);
if (!console) {
console = dojo.body();
}
var div = document.createElement("div");
div.appendChild(document.createTextNode(line));
console.appendChild(div);
}
catch (e) {
try {
document.write("<div>" + line + "</div>");
}
catch (e2) {
window.status = line;
}
}
}
};
dojo.addOnLoad(function () {
dojo.hostenv._println_safe = true;
while (dojo.hostenv._println_buffer.length > 0) {
dojo.hostenv.println(dojo.hostenv._println_buffer.shift());
}
});
function dj_addNodeEvtHdlr(node, evtName, fp) {
var oldHandler = node["on" + evtName] || function () {
};
node["on" + evtName] = function () {
fp.apply(node, arguments);
oldHandler.apply(node, arguments);
};
return true;
}
function dj_load_init(e) {
var type = (e && e.type) ? e.type.toLowerCase() : "load";
if (arguments.callee.initialized || (type != "domcontentloaded" && type != "load")) {
return;
}
arguments.callee.initialized = true;
if (typeof (_timer) != "undefined") {
clearInterval(_timer);
delete _timer;
}
var initFunc = function () {
if (dojo.render.html.ie) {
dojo.hostenv.makeWidgets();
}
};
if (dojo.hostenv.inFlightCount == 0) {
initFunc();
dojo.hostenv.modulesLoaded();
} else {
dojo.hostenv.modulesLoadedListeners.unshift(initFunc);
}
}
if (document.addEventListener) {
if (dojo.render.html.opera || (dojo.render.html.moz && (djConfig["enableMozDomContentLoaded"] === true))) {
document.addEventListener("DOMContentLoaded", dj_load_init, null);
}
window.addEventListener("load", dj_load_init, null);
}
if (dojo.render.html.ie && dojo.render.os.win) {
document.attachEvent("onreadystatechange", function (e) {
if (document.readyState == "complete") {
dj_load_init();
}
});
}
if (/(WebKit|khtml)/i.test(navigator.userAgent)) {
var _timer = setInterval(function () {
if (/loaded|complete/.test(document.readyState)) {
dj_load_init();
}
}, 10);
}
if (dojo.render.html.ie) {
dj_addNodeEvtHdlr(window, "beforeunload", function () {
dojo.hostenv._unloading = true;
window.setTimeout(function () {
dojo.hostenv._unloading = false;
}, 0);
});
}
dj_addNodeEvtHdlr(window, "unload", function () {
dojo.hostenv.unloaded();
if ((!dojo.render.html.ie) || (dojo.render.html.ie && dojo.hostenv._unloading)) {
dojo.hostenv.unloaded();
}
});
dojo.hostenv.makeWidgets = function () {
var sids = [];
if (djConfig.searchIds && djConfig.searchIds.length > 0) {
sids = sids.concat(djConfig.searchIds);
}
if (dojo.hostenv.searchIds && dojo.hostenv.searchIds.length > 0) {
sids = sids.concat(dojo.hostenv.searchIds);
}
if ((djConfig.parseWidgets) || (sids.length > 0)) {
if (dojo.evalObjPath("dojo.widget.Parse")) {
var parser = new dojo.xml.Parse();
if (sids.length > 0) {
for (var x = 0; x < sids.length; x++) {
var tmpNode = document.getElementById(sids[x]);
if (!tmpNode) {
continue;
}
var frag = parser.parseElement(tmpNode, null, true);
dojo.widget.getParser().createComponents(frag);
}
} else {
if (djConfig.parseWidgets) {
var frag = parser.parseElement(dojo.body(), null, true);
dojo.widget.getParser().createComponents(frag);
}
}
}
}
};
dojo.addOnLoad(function () {
if (!dojo.render.html.ie) {
dojo.hostenv.makeWidgets();
}
});
try {
if (dojo.render.html.ie) {
document.namespaces.add("v", "urn:schemas-microsoft-com:vml");
document.createStyleSheet().addRule("v\\:*", "behavior:url(#default#VML)");
}
}
catch (e) {
}
dojo.hostenv.writeIncludes = function () {
};
if (!dj_undef("document", this)) {
dj_currentDocument = this.document;
}
dojo.doc = function () {
return dj_currentDocument;
};
dojo.body = function () {
return dojo.doc().body || dojo.doc().getElementsByTagName("body")[0];
};
dojo.byId = function (id, doc) {
if ((id) && ((typeof id == "string") || (id instanceof String))) {
if (!doc) {
doc = dj_currentDocument;
}
var ele = doc.getElementById(id);
if (ele && (ele.id != id) && doc.all) {
ele = null;
eles = doc.all[id];
if (eles) {
if (eles.length) {
for (var i = 0; i < eles.length; i++) {
if (eles[i].id == id) {
ele = eles[i];
break;
}
}
} else {
ele = eles;
}
}
}
return ele;
}
return id;
};
dojo.setContext = function (globalObject, globalDocument) {
dj_currentContext = globalObject;
dj_currentDocument = globalDocument;
};
dojo._fireCallback = function (callback, context, cbArguments) {
if ((context) && ((typeof callback == "string") || (callback instanceof String))) {
callback = context[callback];
}
return (context ? callback.apply(context, cbArguments || []) : callback());
};
dojo.withGlobal = function (globalObject, callback, thisObject, cbArguments) {
var rval;
var oldGlob = dj_currentContext;
var oldDoc = dj_currentDocument;
try {
dojo.setContext(globalObject, globalObject.document);
rval = dojo._fireCallback(callback, thisObject, cbArguments);
}
finally {
dojo.setContext(oldGlob, oldDoc);
}
return rval;
};
dojo.withDoc = function (documentObject, callback, thisObject, cbArguments) {
var rval;
var oldDoc = dj_currentDocument;
try {
dj_currentDocument = documentObject;
rval = dojo._fireCallback(callback, thisObject, cbArguments);
}
finally {
dj_currentDocument = oldDoc;
}
return rval;
};
}
dojo.requireIf((djConfig["isDebug"] || djConfig["debugAtAllCosts"]), "dojo.debug");
dojo.requireIf(djConfig["debugAtAllCosts"] && !window.widget && !djConfig["useXDomain"], "dojo.browser_debug");
dojo.requireIf(djConfig["debugAtAllCosts"] && !window.widget && djConfig["useXDomain"], "dojo.browser_debug_xd");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/math.js
New file
0,0 → 1,106
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.math");
dojo.math.degToRad = function (x) {
return (x * Math.PI) / 180;
};
dojo.math.radToDeg = function (x) {
return (x * 180) / Math.PI;
};
dojo.math.factorial = function (n) {
if (n < 1) {
return 0;
}
var retVal = 1;
for (var i = 1; i <= n; i++) {
retVal *= i;
}
return retVal;
};
dojo.math.permutations = function (n, k) {
if (n == 0 || k == 0) {
return 1;
}
return (dojo.math.factorial(n) / dojo.math.factorial(n - k));
};
dojo.math.combinations = function (n, r) {
if (n == 0 || r == 0) {
return 1;
}
return (dojo.math.factorial(n) / (dojo.math.factorial(n - r) * dojo.math.factorial(r)));
};
dojo.math.bernstein = function (t, n, i) {
return (dojo.math.combinations(n, i) * Math.pow(t, i) * Math.pow(1 - t, n - i));
};
dojo.math.gaussianRandom = function () {
var k = 2;
do {
var i = 2 * Math.random() - 1;
var j = 2 * Math.random() - 1;
k = i * i + j * j;
} while (k >= 1);
k = Math.sqrt((-2 * Math.log(k)) / k);
return i * k;
};
dojo.math.mean = function () {
var array = dojo.lang.isArray(arguments[0]) ? arguments[0] : arguments;
var mean = 0;
for (var i = 0; i < array.length; i++) {
mean += array[i];
}
return mean / array.length;
};
dojo.math.round = function (number, places) {
if (!places) {
var shift = 1;
} else {
var shift = Math.pow(10, places);
}
return Math.round(number * shift) / shift;
};
dojo.math.sd = dojo.math.standardDeviation = function () {
var array = dojo.lang.isArray(arguments[0]) ? arguments[0] : arguments;
return Math.sqrt(dojo.math.variance(array));
};
dojo.math.variance = function () {
var array = dojo.lang.isArray(arguments[0]) ? arguments[0] : arguments;
var mean = 0, squares = 0;
for (var i = 0; i < array.length; i++) {
mean += array[i];
squares += Math.pow(array[i], 2);
}
return (squares / array.length) - Math.pow(mean / array.length, 2);
};
dojo.math.range = function (a, b, step) {
if (arguments.length < 2) {
b = a;
a = 0;
}
if (arguments.length < 3) {
step = 1;
}
var range = [];
if (step > 0) {
for (var i = a; i < b; i += step) {
range.push(i);
}
} else {
if (step < 0) {
for (var i = a; i > b; i += step) {
range.push(i);
}
} else {
throw new Error("dojo.math.range: step must be non-zero");
}
}
return range;
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/regexp.js
New file
0,0 → 1,363
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.regexp");
dojo.evalObjPath("dojo.regexp.us", true);
dojo.regexp.tld = function (flags) {
flags = (typeof flags == "object") ? flags : {};
if (typeof flags.allowCC != "boolean") {
flags.allowCC = true;
}
if (typeof flags.allowInfra != "boolean") {
flags.allowInfra = true;
}
if (typeof flags.allowGeneric != "boolean") {
flags.allowGeneric = true;
}
var infraRE = "arpa";
var genericRE = "aero|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|xxx|jobs|mobi|post";
var ccRE = "ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|" + "bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|" + "ec|ee|eg|er|eu|es|et|fi|fj|fk|fm|fo|fr|ga|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|" + "gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kr|kw|ky|kz|" + "la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|" + "my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|" + "re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sk|sl|sm|sn|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|" + "tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw";
var a = [];
if (flags.allowInfra) {
a.push(infraRE);
}
if (flags.allowGeneric) {
a.push(genericRE);
}
if (flags.allowCC) {
a.push(ccRE);
}
var tldRE = "";
if (a.length > 0) {
tldRE = "(" + a.join("|") + ")";
}
return tldRE;
};
dojo.regexp.ipAddress = function (flags) {
flags = (typeof flags == "object") ? flags : {};
if (typeof flags.allowDottedDecimal != "boolean") {
flags.allowDottedDecimal = true;
}
if (typeof flags.allowDottedHex != "boolean") {
flags.allowDottedHex = true;
}
if (typeof flags.allowDottedOctal != "boolean") {
flags.allowDottedOctal = true;
}
if (typeof flags.allowDecimal != "boolean") {
flags.allowDecimal = true;
}
if (typeof flags.allowHex != "boolean") {
flags.allowHex = true;
}
if (typeof flags.allowIPv6 != "boolean") {
flags.allowIPv6 = true;
}
if (typeof flags.allowHybrid != "boolean") {
flags.allowHybrid = true;
}
var dottedDecimalRE = "((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";
var dottedHexRE = "(0[xX]0*[\\da-fA-F]?[\\da-fA-F]\\.){3}0[xX]0*[\\da-fA-F]?[\\da-fA-F]";
var dottedOctalRE = "(0+[0-3][0-7][0-7]\\.){3}0+[0-3][0-7][0-7]";
var decimalRE = "(0|[1-9]\\d{0,8}|[1-3]\\d{9}|4[01]\\d{8}|42[0-8]\\d{7}|429[0-3]\\d{6}|" + "4294[0-8]\\d{5}|42949[0-5]\\d{4}|429496[0-6]\\d{3}|4294967[01]\\d{2}|42949672[0-8]\\d|429496729[0-5])";
var hexRE = "0[xX]0*[\\da-fA-F]{1,8}";
var ipv6RE = "([\\da-fA-F]{1,4}\\:){7}[\\da-fA-F]{1,4}";
var hybridRE = "([\\da-fA-F]{1,4}\\:){6}" + "((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";
var a = [];
if (flags.allowDottedDecimal) {
a.push(dottedDecimalRE);
}
if (flags.allowDottedHex) {
a.push(dottedHexRE);
}
if (flags.allowDottedOctal) {
a.push(dottedOctalRE);
}
if (flags.allowDecimal) {
a.push(decimalRE);
}
if (flags.allowHex) {
a.push(hexRE);
}
if (flags.allowIPv6) {
a.push(ipv6RE);
}
if (flags.allowHybrid) {
a.push(hybridRE);
}
var ipAddressRE = "";
if (a.length > 0) {
ipAddressRE = "(" + a.join("|") + ")";
}
return ipAddressRE;
};
dojo.regexp.host = function (flags) {
flags = (typeof flags == "object") ? flags : {};
if (typeof flags.allowIP != "boolean") {
flags.allowIP = true;
}
if (typeof flags.allowLocal != "boolean") {
flags.allowLocal = false;
}
if (typeof flags.allowPort != "boolean") {
flags.allowPort = true;
}
var domainNameRE = "([0-9a-zA-Z]([-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?\\.)+" + dojo.regexp.tld(flags);
var portRE = (flags.allowPort) ? "(\\:" + dojo.regexp.integer({signed:false}) + ")?" : "";
var hostNameRE = domainNameRE;
if (flags.allowIP) {
hostNameRE += "|" + dojo.regexp.ipAddress(flags);
}
if (flags.allowLocal) {
hostNameRE += "|localhost";
}
return "(" + hostNameRE + ")" + portRE;
};
dojo.regexp.url = function (flags) {
flags = (typeof flags == "object") ? flags : {};
if (typeof flags.scheme == "undefined") {
flags.scheme = [true, false];
}
var protocolRE = dojo.regexp.buildGroupRE(flags.scheme, function (q) {
if (q) {
return "(https?|ftps?)\\://";
}
return "";
});
var pathRE = "(/([^?#\\s/]+/)*)?([^?#\\s/]+(\\?[^?#\\s/]*)?(#[A-Za-z][\\w.:-]*)?)?";
return protocolRE + dojo.regexp.host(flags) + pathRE;
};
dojo.regexp.emailAddress = function (flags) {
flags = (typeof flags == "object") ? flags : {};
if (typeof flags.allowCruft != "boolean") {
flags.allowCruft = false;
}
flags.allowPort = false;
var usernameRE = "([\\da-z]+[-._+&'])*[\\da-z]+";
var emailAddressRE = usernameRE + "@" + dojo.regexp.host(flags);
if (flags.allowCruft) {
emailAddressRE = "<?(mailto\\:)?" + emailAddressRE + ">?";
}
return emailAddressRE;
};
dojo.regexp.emailAddressList = function (flags) {
flags = (typeof flags == "object") ? flags : {};
if (typeof flags.listSeparator != "string") {
flags.listSeparator = "\\s;,";
}
var emailAddressRE = dojo.regexp.emailAddress(flags);
var emailAddressListRE = "(" + emailAddressRE + "\\s*[" + flags.listSeparator + "]\\s*)*" + emailAddressRE + "\\s*[" + flags.listSeparator + "]?\\s*";
return emailAddressListRE;
};
dojo.regexp.integer = function (flags) {
flags = (typeof flags == "object") ? flags : {};
if (typeof flags.signed == "undefined") {
flags.signed = [true, false];
}
if (typeof flags.separator == "undefined") {
flags.separator = "";
} else {
if (typeof flags.groupSize == "undefined") {
flags.groupSize = 3;
}
}
var signRE = dojo.regexp.buildGroupRE(flags.signed, function (q) {
return q ? "[-+]" : "";
});
var numberRE = dojo.regexp.buildGroupRE(flags.separator, function (sep) {
if (sep == "") {
return "(0|[1-9]\\d*)";
}
var grp = flags.groupSize, grp2 = flags.groupSize2;
if (typeof grp2 != "undefined") {
var grp2RE = "(0|[1-9]\\d{0," + (grp2 - 1) + "}([" + sep + "]\\d{" + grp2 + "})*[" + sep + "]\\d{" + grp + "})";
return ((grp - grp2) > 0) ? "(" + grp2RE + "|(0|[1-9]\\d{0," + (grp - 1) + "}))" : grp2RE;
}
return "(0|[1-9]\\d{0," + (grp - 1) + "}([" + sep + "]\\d{" + grp + "})*)";
});
return signRE + numberRE;
};
dojo.regexp.realNumber = function (flags) {
flags = (typeof flags == "object") ? flags : {};
if (typeof flags.places != "number") {
flags.places = Infinity;
}
if (typeof flags.decimal != "string") {
flags.decimal = ".";
}
if (typeof flags.fractional == "undefined") {
flags.fractional = [true, false];
}
if (typeof flags.exponent == "undefined") {
flags.exponent = [true, false];
}
if (typeof flags.eSigned == "undefined") {
flags.eSigned = [true, false];
}
var integerRE = dojo.regexp.integer(flags);
var decimalRE = dojo.regexp.buildGroupRE(flags.fractional, function (q) {
var re = "";
if (q && (flags.places > 0)) {
re = "\\" + flags.decimal;
if (flags.places == Infinity) {
re = "(" + re + "\\d+)?";
} else {
re = re + "\\d{" + flags.places + "}";
}
}
return re;
});
var exponentRE = dojo.regexp.buildGroupRE(flags.exponent, function (q) {
if (q) {
return "([eE]" + dojo.regexp.integer({signed:flags.eSigned}) + ")";
}
return "";
});
return integerRE + decimalRE + exponentRE;
};
dojo.regexp.currency = function (flags) {
flags = (typeof flags == "object") ? flags : {};
if (typeof flags.signed == "undefined") {
flags.signed = [true, false];
}
if (typeof flags.symbol == "undefined") {
flags.symbol = "$";
}
if (typeof flags.placement != "string") {
flags.placement = "before";
}
if (typeof flags.signPlacement != "string") {
flags.signPlacement = "before";
}
if (typeof flags.separator == "undefined") {
flags.separator = ",";
}
if (typeof flags.fractional == "undefined" && typeof flags.cents != "undefined") {
dojo.deprecated("dojo.regexp.currency: flags.cents", "use flags.fractional instead", "0.5");
flags.fractional = flags.cents;
}
if (typeof flags.decimal != "string") {
flags.decimal = ".";
}
var signRE = dojo.regexp.buildGroupRE(flags.signed, function (q) {
if (q) {
return "[-+]";
}
return "";
});
var symbolRE = dojo.regexp.buildGroupRE(flags.symbol, function (symbol) {
return "\\s?" + symbol.replace(/([.$?*!=:|\\\/^])/g, "\\$1") + "\\s?";
});
switch (flags.signPlacement) {
case "before":
symbolRE = signRE + symbolRE;
break;
case "after":
symbolRE = symbolRE + signRE;
break;
}
var flagsCopy = flags;
flagsCopy.signed = false;
flagsCopy.exponent = false;
var numberRE = dojo.regexp.realNumber(flagsCopy);
var currencyRE;
switch (flags.placement) {
case "before":
currencyRE = symbolRE + numberRE;
break;
case "after":
currencyRE = numberRE + symbolRE;
break;
}
switch (flags.signPlacement) {
case "around":
currencyRE = "(" + currencyRE + "|" + "\\(" + currencyRE + "\\)" + ")";
break;
case "begin":
currencyRE = signRE + currencyRE;
break;
case "end":
currencyRE = currencyRE + signRE;
break;
}
return currencyRE;
};
dojo.regexp.us.state = function (flags) {
flags = (typeof flags == "object") ? flags : {};
if (typeof flags.allowTerritories != "boolean") {
flags.allowTerritories = true;
}
if (typeof flags.allowMilitary != "boolean") {
flags.allowMilitary = true;
}
var statesRE = "AL|AK|AZ|AR|CA|CO|CT|DE|DC|FL|GA|HI|ID|IL|IN|IA|KS|KY|LA|ME|MD|MA|MI|MN|MS|MO|MT|" + "NE|NV|NH|NJ|NM|NY|NC|ND|OH|OK|OR|PA|RI|SC|SD|TN|TX|UT|VT|VA|WA|WV|WI|WY";
var territoriesRE = "AS|FM|GU|MH|MP|PW|PR|VI";
var militaryRE = "AA|AE|AP";
if (flags.allowTerritories) {
statesRE += "|" + territoriesRE;
}
if (flags.allowMilitary) {
statesRE += "|" + militaryRE;
}
return "(" + statesRE + ")";
};
dojo.regexp.time = function (flags) {
dojo.deprecated("dojo.regexp.time", "Use dojo.date.parse instead", "0.5");
flags = (typeof flags == "object") ? flags : {};
if (typeof flags.format == "undefined") {
flags.format = "h:mm:ss t";
}
if (typeof flags.amSymbol != "string") {
flags.amSymbol = "AM";
}
if (typeof flags.pmSymbol != "string") {
flags.pmSymbol = "PM";
}
var timeRE = function (format) {
format = format.replace(/([.$?*!=:|{}\(\)\[\]\\\/^])/g, "\\$1");
var amRE = flags.amSymbol.replace(/([.$?*!=:|{}\(\)\[\]\\\/^])/g, "\\$1");
var pmRE = flags.pmSymbol.replace(/([.$?*!=:|{}\(\)\[\]\\\/^])/g, "\\$1");
format = format.replace("hh", "(0[1-9]|1[0-2])");
format = format.replace("h", "([1-9]|1[0-2])");
format = format.replace("HH", "([01][0-9]|2[0-3])");
format = format.replace("H", "([0-9]|1[0-9]|2[0-3])");
format = format.replace("mm", "([0-5][0-9])");
format = format.replace("m", "([1-5][0-9]|[0-9])");
format = format.replace("ss", "([0-5][0-9])");
format = format.replace("s", "([1-5][0-9]|[0-9])");
format = format.replace("t", "\\s?(" + amRE + "|" + pmRE + ")\\s?");
return format;
};
return dojo.regexp.buildGroupRE(flags.format, timeRE);
};
dojo.regexp.numberFormat = function (flags) {
flags = (typeof flags == "object") ? flags : {};
if (typeof flags.format == "undefined") {
flags.format = "###-###-####";
}
var digitRE = function (format) {
format = format.replace(/([.$*!=:|{}\(\)\[\]\\\/^])/g, "\\$1");
format = format.replace(/\?/g, "\\d?");
format = format.replace(/#/g, "\\d");
return format;
};
return dojo.regexp.buildGroupRE(flags.format, digitRE);
};
dojo.regexp.buildGroupRE = function (a, re) {
if (!(a instanceof Array)) {
return re(a);
}
var b = [];
for (var i = 0; i < a.length; i++) {
b.push(re(a[i]));
}
return "(" + b.join("|") + ")";
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/uuid/TimeBasedGenerator.js
New file
0,0 → 1,243
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.uuid.TimeBasedGenerator");
dojo.require("dojo.lang.common");
dojo.require("dojo.lang.type");
dojo.require("dojo.lang.assert");
dojo.uuid.TimeBasedGenerator = new function () {
this.GREGORIAN_CHANGE_OFFSET_IN_HOURS = 3394248;
var _uuidPseudoNodeString = null;
var _uuidClockSeqString = null;
var _dateValueOfPreviousUuid = null;
var _nextIntraMillisecondIncrement = 0;
var _cachedMillisecondsBetween1582and1970 = null;
var _cachedHundredNanosecondIntervalsPerMillisecond = null;
var _uniformNode = null;
var HEX_RADIX = 16;
function _carry(arrayA) {
arrayA[2] += arrayA[3] >>> 16;
arrayA[3] &= 65535;
arrayA[1] += arrayA[2] >>> 16;
arrayA[2] &= 65535;
arrayA[0] += arrayA[1] >>> 16;
arrayA[1] &= 65535;
dojo.lang.assert((arrayA[0] >>> 16) === 0);
}
function _get64bitArrayFromFloat(x) {
var result = new Array(0, 0, 0, 0);
result[3] = x % 65536;
x -= result[3];
x /= 65536;
result[2] = x % 65536;
x -= result[2];
x /= 65536;
result[1] = x % 65536;
x -= result[1];
x /= 65536;
result[0] = x;
return result;
}
function _addTwo64bitArrays(arrayA, arrayB) {
dojo.lang.assertType(arrayA, Array);
dojo.lang.assertType(arrayB, Array);
dojo.lang.assert(arrayA.length == 4);
dojo.lang.assert(arrayB.length == 4);
var result = new Array(0, 0, 0, 0);
result[3] = arrayA[3] + arrayB[3];
result[2] = arrayA[2] + arrayB[2];
result[1] = arrayA[1] + arrayB[1];
result[0] = arrayA[0] + arrayB[0];
_carry(result);
return result;
}
function _multiplyTwo64bitArrays(arrayA, arrayB) {
dojo.lang.assertType(arrayA, Array);
dojo.lang.assertType(arrayB, Array);
dojo.lang.assert(arrayA.length == 4);
dojo.lang.assert(arrayB.length == 4);
var overflow = false;
if (arrayA[0] * arrayB[0] !== 0) {
overflow = true;
}
if (arrayA[0] * arrayB[1] !== 0) {
overflow = true;
}
if (arrayA[0] * arrayB[2] !== 0) {
overflow = true;
}
if (arrayA[1] * arrayB[0] !== 0) {
overflow = true;
}
if (arrayA[1] * arrayB[1] !== 0) {
overflow = true;
}
if (arrayA[2] * arrayB[0] !== 0) {
overflow = true;
}
dojo.lang.assert(!overflow);
var result = new Array(0, 0, 0, 0);
result[0] += arrayA[0] * arrayB[3];
_carry(result);
result[0] += arrayA[1] * arrayB[2];
_carry(result);
result[0] += arrayA[2] * arrayB[1];
_carry(result);
result[0] += arrayA[3] * arrayB[0];
_carry(result);
result[1] += arrayA[1] * arrayB[3];
_carry(result);
result[1] += arrayA[2] * arrayB[2];
_carry(result);
result[1] += arrayA[3] * arrayB[1];
_carry(result);
result[2] += arrayA[2] * arrayB[3];
_carry(result);
result[2] += arrayA[3] * arrayB[2];
_carry(result);
result[3] += arrayA[3] * arrayB[3];
_carry(result);
return result;
}
function _padWithLeadingZeros(string, desiredLength) {
while (string.length < desiredLength) {
string = "0" + string;
}
return string;
}
function _generateRandomEightCharacterHexString() {
var random32bitNumber = Math.floor((Math.random() % 1) * Math.pow(2, 32));
var eightCharacterString = random32bitNumber.toString(HEX_RADIX);
while (eightCharacterString.length < 8) {
eightCharacterString = "0" + eightCharacterString;
}
return eightCharacterString;
}
function _generateUuidString(node) {
dojo.lang.assertType(node, String, {optional:true});
if (node) {
dojo.lang.assert(node.length == 12);
} else {
if (_uniformNode) {
node = _uniformNode;
} else {
if (!_uuidPseudoNodeString) {
var pseudoNodeIndicatorBit = 32768;
var random15bitNumber = Math.floor((Math.random() % 1) * Math.pow(2, 15));
var leftmost4HexCharacters = (pseudoNodeIndicatorBit | random15bitNumber).toString(HEX_RADIX);
_uuidPseudoNodeString = leftmost4HexCharacters + _generateRandomEightCharacterHexString();
}
node = _uuidPseudoNodeString;
}
}
if (!_uuidClockSeqString) {
var variantCodeForDCEUuids = 32768;
var random14bitNumber = Math.floor((Math.random() % 1) * Math.pow(2, 14));
_uuidClockSeqString = (variantCodeForDCEUuids | random14bitNumber).toString(HEX_RADIX);
}
var now = new Date();
var millisecondsSince1970 = now.valueOf();
var nowArray = _get64bitArrayFromFloat(millisecondsSince1970);
if (!_cachedMillisecondsBetween1582and1970) {
var arraySecondsPerHour = _get64bitArrayFromFloat(60 * 60);
var arrayHoursBetween1582and1970 = _get64bitArrayFromFloat(dojo.uuid.TimeBasedGenerator.GREGORIAN_CHANGE_OFFSET_IN_HOURS);
var arraySecondsBetween1582and1970 = _multiplyTwo64bitArrays(arrayHoursBetween1582and1970, arraySecondsPerHour);
var arrayMillisecondsPerSecond = _get64bitArrayFromFloat(1000);
_cachedMillisecondsBetween1582and1970 = _multiplyTwo64bitArrays(arraySecondsBetween1582and1970, arrayMillisecondsPerSecond);
_cachedHundredNanosecondIntervalsPerMillisecond = _get64bitArrayFromFloat(10000);
}
var arrayMillisecondsSince1970 = nowArray;
var arrayMillisecondsSince1582 = _addTwo64bitArrays(_cachedMillisecondsBetween1582and1970, arrayMillisecondsSince1970);
var arrayHundredNanosecondIntervalsSince1582 = _multiplyTwo64bitArrays(arrayMillisecondsSince1582, _cachedHundredNanosecondIntervalsPerMillisecond);
if (now.valueOf() == _dateValueOfPreviousUuid) {
arrayHundredNanosecondIntervalsSince1582[3] += _nextIntraMillisecondIncrement;
_carry(arrayHundredNanosecondIntervalsSince1582);
_nextIntraMillisecondIncrement += 1;
if (_nextIntraMillisecondIncrement == 10000) {
while (now.valueOf() == _dateValueOfPreviousUuid) {
now = new Date();
}
}
} else {
_dateValueOfPreviousUuid = now.valueOf();
_nextIntraMillisecondIncrement = 1;
}
var hexTimeLowLeftHalf = arrayHundredNanosecondIntervalsSince1582[2].toString(HEX_RADIX);
var hexTimeLowRightHalf = arrayHundredNanosecondIntervalsSince1582[3].toString(HEX_RADIX);
var hexTimeLow = _padWithLeadingZeros(hexTimeLowLeftHalf, 4) + _padWithLeadingZeros(hexTimeLowRightHalf, 4);
var hexTimeMid = arrayHundredNanosecondIntervalsSince1582[1].toString(HEX_RADIX);
hexTimeMid = _padWithLeadingZeros(hexTimeMid, 4);
var hexTimeHigh = arrayHundredNanosecondIntervalsSince1582[0].toString(HEX_RADIX);
hexTimeHigh = _padWithLeadingZeros(hexTimeHigh, 3);
var hyphen = "-";
var versionCodeForTimeBasedUuids = "1";
var resultUuid = hexTimeLow + hyphen + hexTimeMid + hyphen + versionCodeForTimeBasedUuids + hexTimeHigh + hyphen + _uuidClockSeqString + hyphen + node;
resultUuid = resultUuid.toLowerCase();
return resultUuid;
}
this.setNode = function (node) {
dojo.lang.assert((node === null) || (node.length == 12));
_uniformNode = node;
};
this.getNode = function () {
return _uniformNode;
};
this.generate = function (input) {
var nodeString = null;
var returnType = null;
if (input) {
if (dojo.lang.isObject(input) && !dojo.lang.isBuiltIn(input)) {
var namedParameters = input;
dojo.lang.assertValidKeywords(namedParameters, ["node", "hardwareNode", "pseudoNode", "returnType"]);
var node = namedParameters["node"];
var hardwareNode = namedParameters["hardwareNode"];
var pseudoNode = namedParameters["pseudoNode"];
nodeString = (node || pseudoNode || hardwareNode);
if (nodeString) {
var firstCharacter = nodeString.charAt(0);
var firstDigit = parseInt(firstCharacter, HEX_RADIX);
if (hardwareNode) {
dojo.lang.assert((firstDigit >= 0) && (firstDigit <= 7));
}
if (pseudoNode) {
dojo.lang.assert((firstDigit >= 8) && (firstDigit <= 15));
}
}
returnType = namedParameters["returnType"];
dojo.lang.assertType(returnType, Function, {optional:true});
} else {
if (dojo.lang.isString(input)) {
nodeString = input;
returnType = null;
} else {
if (dojo.lang.isFunction(input)) {
nodeString = null;
returnType = input;
}
}
}
if (nodeString) {
dojo.lang.assert(nodeString.length == 12);
var integer = parseInt(nodeString, HEX_RADIX);
dojo.lang.assert(isFinite(integer));
}
dojo.lang.assertType(returnType, Function, {optional:true});
}
var uuidString = _generateUuidString(nodeString);
var returnValue;
if (returnType && (returnType != String)) {
returnValue = new returnType(uuidString);
} else {
returnValue = uuidString;
}
return returnValue;
};
}();
 
/tags/Racine_livraison_narmer/api/js/dojo/src/uuid/LightweightGenerator.js
New file
0,0 → 1,40
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.uuid.LightweightGenerator");
dojo.uuid.LightweightGenerator = new function () {
var HEX_RADIX = 16;
function _generateRandomEightCharacterHexString() {
var random32bitNumber = Math.floor((Math.random() % 1) * Math.pow(2, 32));
var eightCharacterHexString = random32bitNumber.toString(HEX_RADIX);
while (eightCharacterHexString.length < 8) {
eightCharacterHexString = "0" + eightCharacterHexString;
}
return eightCharacterHexString;
}
this.generate = function (returnType) {
var hyphen = "-";
var versionCodeForRandomlyGeneratedUuids = "4";
var variantCodeForDCEUuids = "8";
var a = _generateRandomEightCharacterHexString();
var b = _generateRandomEightCharacterHexString();
b = b.substring(0, 4) + hyphen + versionCodeForRandomlyGeneratedUuids + b.substring(5, 8);
var c = _generateRandomEightCharacterHexString();
c = variantCodeForDCEUuids + c.substring(1, 4) + hyphen + c.substring(4, 8);
var d = _generateRandomEightCharacterHexString();
var returnValue = a + hyphen + b + hyphen + c + d;
returnValue = returnValue.toLowerCase();
if (returnType && (returnType != String)) {
returnValue = new returnType(returnValue);
}
return returnValue;
};
}();
 
/tags/Racine_livraison_narmer/api/js/dojo/src/uuid/NameBasedGenerator.js
New file
0,0 → 1,22
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.uuid.NameBasedGenerator");
dojo.uuid.NameBasedGenerator = new function () {
this.generate = function (returnType) {
dojo.unimplemented("dojo.uuid.NameBasedGenerator.generate");
var returnValue = "00000000-0000-0000-0000-000000000000";
if (returnType && (returnType != String)) {
returnValue = new returnType(returnValue);
}
return returnValue;
};
}();
 
/tags/Racine_livraison_narmer/api/js/dojo/src/uuid/Uuid.js
New file
0,0 → 1,213
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.uuid.Uuid");
dojo.require("dojo.lang.common");
dojo.require("dojo.lang.assert");
dojo.uuid.Uuid = function (input) {
this._uuidString = dojo.uuid.Uuid.NIL_UUID;
if (input) {
if (dojo.lang.isString(input)) {
this._uuidString = input.toLowerCase();
dojo.lang.assert(this.isValid());
} else {
if (dojo.lang.isObject(input) && input.generate) {
var generator = input;
this._uuidString = generator.generate();
dojo.lang.assert(this.isValid());
} else {
dojo.lang.assert(false, "The dojo.uuid.Uuid() constructor must be initializated with a UUID string.");
}
}
} else {
var ourGenerator = dojo.uuid.Uuid.getGenerator();
if (ourGenerator) {
this._uuidString = ourGenerator.generate();
dojo.lang.assert(this.isValid());
}
}
};
dojo.uuid.Uuid.NIL_UUID = "00000000-0000-0000-0000-000000000000";
dojo.uuid.Uuid.Version = {UNKNOWN:0, TIME_BASED:1, DCE_SECURITY:2, NAME_BASED_MD5:3, RANDOM:4, NAME_BASED_SHA1:5};
dojo.uuid.Uuid.Variant = {NCS:"0", DCE:"10", MICROSOFT:"110", UNKNOWN:"111"};
dojo.uuid.Uuid.HEX_RADIX = 16;
dojo.uuid.Uuid.compare = function (uuidOne, uuidTwo) {
var uuidStringOne = uuidOne.toString();
var uuidStringTwo = uuidTwo.toString();
if (uuidStringOne > uuidStringTwo) {
return 1;
}
if (uuidStringOne < uuidStringTwo) {
return -1;
}
return 0;
};
dojo.uuid.Uuid.setGenerator = function (generator) {
dojo.lang.assert(!generator || (dojo.lang.isObject(generator) && generator.generate));
dojo.uuid.Uuid._ourGenerator = generator;
};
dojo.uuid.Uuid.getGenerator = function () {
return dojo.uuid.Uuid._ourGenerator;
};
dojo.uuid.Uuid.prototype.toString = function (format) {
if (format) {
switch (format) {
case "{}":
return "{" + this._uuidString + "}";
break;
case "()":
return "(" + this._uuidString + ")";
break;
case "\"\"":
return "\"" + this._uuidString + "\"";
break;
case "''":
return "'" + this._uuidString + "'";
break;
case "urn":
return "urn:uuid:" + this._uuidString;
break;
case "!-":
return this._uuidString.split("-").join("");
break;
default:
dojo.lang.assert(false, "The toString() method of dojo.uuid.Uuid was passed a bogus format.");
}
} else {
return this._uuidString;
}
};
dojo.uuid.Uuid.prototype.compare = function (otherUuid) {
return dojo.uuid.Uuid.compare(this, otherUuid);
};
dojo.uuid.Uuid.prototype.isEqual = function (otherUuid) {
return (this.compare(otherUuid) == 0);
};
dojo.uuid.Uuid.prototype.isValid = function () {
try {
dojo.lang.assertType(this._uuidString, String);
dojo.lang.assert(this._uuidString.length == 36);
dojo.lang.assert(this._uuidString == this._uuidString.toLowerCase());
var arrayOfParts = this._uuidString.split("-");
dojo.lang.assert(arrayOfParts.length == 5);
dojo.lang.assert(arrayOfParts[0].length == 8);
dojo.lang.assert(arrayOfParts[1].length == 4);
dojo.lang.assert(arrayOfParts[2].length == 4);
dojo.lang.assert(arrayOfParts[3].length == 4);
dojo.lang.assert(arrayOfParts[4].length == 12);
for (var i in arrayOfParts) {
var part = arrayOfParts[i];
var integer = parseInt(part, dojo.uuid.Uuid.HEX_RADIX);
dojo.lang.assert(isFinite(integer));
}
return true;
}
catch (e) {
return false;
}
};
dojo.uuid.Uuid.prototype.getVariant = function () {
var variantCharacter = this._uuidString.charAt(19);
var variantNumber = parseInt(variantCharacter, dojo.uuid.Uuid.HEX_RADIX);
dojo.lang.assert((variantNumber >= 0) && (variantNumber <= 16));
if (!dojo.uuid.Uuid._ourVariantLookupTable) {
var Variant = dojo.uuid.Uuid.Variant;
var lookupTable = [];
lookupTable[0] = Variant.NCS;
lookupTable[1] = Variant.NCS;
lookupTable[2] = Variant.NCS;
lookupTable[3] = Variant.NCS;
lookupTable[4] = Variant.NCS;
lookupTable[5] = Variant.NCS;
lookupTable[6] = Variant.NCS;
lookupTable[7] = Variant.NCS;
lookupTable[8] = Variant.DCE;
lookupTable[9] = Variant.DCE;
lookupTable[10] = Variant.DCE;
lookupTable[11] = Variant.DCE;
lookupTable[12] = Variant.MICROSOFT;
lookupTable[13] = Variant.MICROSOFT;
lookupTable[14] = Variant.UNKNOWN;
lookupTable[15] = Variant.UNKNOWN;
dojo.uuid.Uuid._ourVariantLookupTable = lookupTable;
}
return dojo.uuid.Uuid._ourVariantLookupTable[variantNumber];
};
dojo.uuid.Uuid.prototype.getVersion = function () {
if (!this._versionNumber) {
var errorMessage = "Called getVersion() on a dojo.uuid.Uuid that was not a DCE Variant UUID.";
dojo.lang.assert(this.getVariant() == dojo.uuid.Uuid.Variant.DCE, errorMessage);
var versionCharacter = this._uuidString.charAt(14);
this._versionNumber = parseInt(versionCharacter, dojo.uuid.Uuid.HEX_RADIX);
}
return this._versionNumber;
};
dojo.uuid.Uuid.prototype.getNode = function () {
if (!this._nodeString) {
var errorMessage = "Called getNode() on a dojo.uuid.Uuid that was not a TIME_BASED UUID.";
dojo.lang.assert(this.getVersion() == dojo.uuid.Uuid.Version.TIME_BASED, errorMessage);
var arrayOfStrings = this._uuidString.split("-");
this._nodeString = arrayOfStrings[4];
}
return this._nodeString;
};
dojo.uuid.Uuid.prototype.getTimestamp = function (returnType) {
var errorMessage = "Called getTimestamp() on a dojo.uuid.Uuid that was not a TIME_BASED UUID.";
dojo.lang.assert(this.getVersion() == dojo.uuid.Uuid.Version.TIME_BASED, errorMessage);
if (!returnType) {
returnType = null;
}
switch (returnType) {
case "string":
case String:
return this.getTimestamp(Date).toUTCString();
break;
case "hex":
if (!this._timestampAsHexString) {
var arrayOfStrings = this._uuidString.split("-");
var hexTimeLow = arrayOfStrings[0];
var hexTimeMid = arrayOfStrings[1];
var hexTimeHigh = arrayOfStrings[2];
hexTimeHigh = hexTimeHigh.slice(1);
this._timestampAsHexString = hexTimeHigh + hexTimeMid + hexTimeLow;
dojo.lang.assert(this._timestampAsHexString.length == 15);
}
return this._timestampAsHexString;
break;
case null:
case "date":
case Date:
if (!this._timestampAsDate) {
var GREGORIAN_CHANGE_OFFSET_IN_HOURS = 3394248;
var arrayOfParts = this._uuidString.split("-");
var timeLow = parseInt(arrayOfParts[0], dojo.uuid.Uuid.HEX_RADIX);
var timeMid = parseInt(arrayOfParts[1], dojo.uuid.Uuid.HEX_RADIX);
var timeHigh = parseInt(arrayOfParts[2], dojo.uuid.Uuid.HEX_RADIX);
var hundredNanosecondIntervalsSince1582 = timeHigh & 4095;
hundredNanosecondIntervalsSince1582 <<= 16;
hundredNanosecondIntervalsSince1582 += timeMid;
hundredNanosecondIntervalsSince1582 *= 4294967296;
hundredNanosecondIntervalsSince1582 += timeLow;
var millisecondsSince1582 = hundredNanosecondIntervalsSince1582 / 10000;
var secondsPerHour = 60 * 60;
var hoursBetween1582and1970 = GREGORIAN_CHANGE_OFFSET_IN_HOURS;
var secondsBetween1582and1970 = hoursBetween1582and1970 * secondsPerHour;
var millisecondsBetween1582and1970 = secondsBetween1582and1970 * 1000;
var millisecondsSince1970 = millisecondsSince1582 - millisecondsBetween1582and1970;
this._timestampAsDate = new Date(millisecondsSince1970);
}
return this._timestampAsDate;
break;
default:
dojo.lang.assert(false, "The getTimestamp() method dojo.uuid.Uuid was passed a bogus returnType: " + returnType);
break;
}
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/uuid/RandomGenerator.js
New file
0,0 → 1,22
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.uuid.RandomGenerator");
dojo.uuid.RandomGenerator = new function () {
this.generate = function (returnType) {
dojo.unimplemented("dojo.uuid.RandomGenerator.generate");
var returnValue = "00000000-0000-0000-0000-000000000000";
if (returnType && (returnType != String)) {
returnValue = new returnType(returnValue);
}
return returnValue;
};
}();
 
/tags/Racine_livraison_narmer/api/js/dojo/src/uuid/__package__.js
New file
0,0 → 1,13
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.kwCompoundRequire({common:["dojo.uuid.Uuid", "dojo.uuid.LightweightGenerator", "dojo.uuid.RandomGenerator", "dojo.uuid.TimeBasedGenerator", "dojo.uuid.NameBasedGenerator", "dojo.uuid.NilGenerator"]});
dojo.provide("dojo.uuid.*");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/uuid/NilGenerator.js
New file
0,0 → 1,21
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.uuid.NilGenerator");
dojo.uuid.NilGenerator = new function () {
this.generate = function (returnType) {
var returnValue = "00000000-0000-0000-0000-000000000000";
if (returnType && (returnType != String)) {
returnValue = new returnType(returnValue);
}
return returnValue;
};
}();
 
/tags/Racine_livraison_narmer/api/js/dojo/src/string/Builder.js
New file
0,0 → 1,102
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.string.Builder");
dojo.require("dojo.string");
dojo.require("dojo.lang.common");
dojo.string.Builder = function (str) {
this.arrConcat = (dojo.render.html.capable && dojo.render.html["ie"]);
var a = [];
var b = "";
var length = this.length = b.length;
if (this.arrConcat) {
if (b.length > 0) {
a.push(b);
}
b = "";
}
this.toString = this.valueOf = function () {
return (this.arrConcat) ? a.join("") : b;
};
this.append = function () {
for (var x = 0; x < arguments.length; x++) {
var s = arguments[x];
if (dojo.lang.isArrayLike(s)) {
this.append.apply(this, s);
} else {
if (this.arrConcat) {
a.push(s);
} else {
b += s;
}
length += s.length;
this.length = length;
}
}
return this;
};
this.clear = function () {
a = [];
b = "";
length = this.length = 0;
return this;
};
this.remove = function (f, l) {
var s = "";
if (this.arrConcat) {
b = a.join("");
}
a = [];
if (f > 0) {
s = b.substring(0, (f - 1));
}
b = s + b.substring(f + l);
length = this.length = b.length;
if (this.arrConcat) {
a.push(b);
b = "";
}
return this;
};
this.replace = function (o, n) {
if (this.arrConcat) {
b = a.join("");
}
a = [];
b = b.replace(o, n);
length = this.length = b.length;
if (this.arrConcat) {
a.push(b);
b = "";
}
return this;
};
this.insert = function (idx, s) {
if (this.arrConcat) {
b = a.join("");
}
a = [];
if (idx == 0) {
b = s + b;
} else {
var t = b.split("");
t.splice(idx, 0, s);
b = t.join("");
}
length = this.length = b.length;
if (this.arrConcat) {
a.push(b);
b = "";
}
return this;
};
this.append.apply(this, arguments);
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/string/extras.js
New file
0,0 → 1,176
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.string.extras");
dojo.require("dojo.string.common");
dojo.require("dojo.lang.common");
dojo.require("dojo.lang.array");
dojo.string.substituteParams = function (template, hash) {
var map = (typeof hash == "object") ? hash : dojo.lang.toArray(arguments, 1);
return template.replace(/\%\{(\w+)\}/g, function (match, key) {
if (typeof (map[key]) != "undefined" && map[key] != null) {
return map[key];
}
dojo.raise("Substitution not found: " + key);
});
};
dojo.string.capitalize = function (str) {
if (!dojo.lang.isString(str)) {
return "";
}
if (arguments.length == 0) {
str = this;
}
var words = str.split(" ");
for (var i = 0; i < words.length; i++) {
words[i] = words[i].charAt(0).toUpperCase() + words[i].substring(1);
}
return words.join(" ");
};
dojo.string.isBlank = function (str) {
if (!dojo.lang.isString(str)) {
return true;
}
return (dojo.string.trim(str).length == 0);
};
dojo.string.encodeAscii = function (str) {
if (!dojo.lang.isString(str)) {
return str;
}
var ret = "";
var value = escape(str);
var match, re = /%u([0-9A-F]{4})/i;
while ((match = value.match(re))) {
var num = Number("0x" + match[1]);
var newVal = escape("&#" + num + ";");
ret += value.substring(0, match.index) + newVal;
value = value.substring(match.index + match[0].length);
}
ret += value.replace(/\+/g, "%2B");
return ret;
};
dojo.string.escape = function (type, str) {
var args = dojo.lang.toArray(arguments, 1);
switch (type.toLowerCase()) {
case "xml":
case "html":
case "xhtml":
return dojo.string.escapeXml.apply(this, args);
case "sql":
return dojo.string.escapeSql.apply(this, args);
case "regexp":
case "regex":
return dojo.string.escapeRegExp.apply(this, args);
case "javascript":
case "jscript":
case "js":
return dojo.string.escapeJavaScript.apply(this, args);
case "ascii":
return dojo.string.encodeAscii.apply(this, args);
default:
return str;
}
};
dojo.string.escapeXml = function (str, noSingleQuotes) {
str = str.replace(/&/gm, "&amp;").replace(/</gm, "&lt;").replace(/>/gm, "&gt;").replace(/"/gm, "&quot;");
if (!noSingleQuotes) {
str = str.replace(/'/gm, "&#39;");
}
return str;
};
dojo.string.escapeSql = function (str) {
return str.replace(/'/gm, "''");
};
dojo.string.escapeRegExp = function (str) {
return str.replace(/\\/gm, "\\\\").replace(/([\f\b\n\t\r[\^$|?*+(){}])/gm, "\\$1");
};
dojo.string.escapeJavaScript = function (str) {
return str.replace(/(["'\f\b\n\t\r])/gm, "\\$1");
};
dojo.string.escapeString = function (str) {
return ("\"" + str.replace(/(["\\])/g, "\\$1") + "\"").replace(/[\f]/g, "\\f").replace(/[\b]/g, "\\b").replace(/[\n]/g, "\\n").replace(/[\t]/g, "\\t").replace(/[\r]/g, "\\r");
};
dojo.string.summary = function (str, len) {
if (!len || str.length <= len) {
return str;
}
return str.substring(0, len).replace(/\.+$/, "") + "...";
};
dojo.string.endsWith = function (str, end, ignoreCase) {
if (ignoreCase) {
str = str.toLowerCase();
end = end.toLowerCase();
}
if ((str.length - end.length) < 0) {
return false;
}
return str.lastIndexOf(end) == str.length - end.length;
};
dojo.string.endsWithAny = function (str) {
for (var i = 1; i < arguments.length; i++) {
if (dojo.string.endsWith(str, arguments[i])) {
return true;
}
}
return false;
};
dojo.string.startsWith = function (str, start, ignoreCase) {
if (ignoreCase) {
str = str.toLowerCase();
start = start.toLowerCase();
}
return str.indexOf(start) == 0;
};
dojo.string.startsWithAny = function (str) {
for (var i = 1; i < arguments.length; i++) {
if (dojo.string.startsWith(str, arguments[i])) {
return true;
}
}
return false;
};
dojo.string.has = function (str) {
for (var i = 1; i < arguments.length; i++) {
if (str.indexOf(arguments[i]) > -1) {
return true;
}
}
return false;
};
dojo.string.normalizeNewlines = function (text, newlineChar) {
if (newlineChar == "\n") {
text = text.replace(/\r\n/g, "\n");
text = text.replace(/\r/g, "\n");
} else {
if (newlineChar == "\r") {
text = text.replace(/\r\n/g, "\r");
text = text.replace(/\n/g, "\r");
} else {
text = text.replace(/([^\r])\n/g, "$1\r\n").replace(/\r([^\n])/g, "\r\n$1");
}
}
return text;
};
dojo.string.splitEscaped = function (str, charac) {
var components = [];
for (var i = 0, prevcomma = 0; i < str.length; i++) {
if (str.charAt(i) == "\\") {
i++;
continue;
}
if (str.charAt(i) == charac) {
components.push(str.substring(prevcomma, i));
prevcomma = i + 1;
}
}
components.push(str.substr(prevcomma));
return components;
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/string/__package__.js
New file
0,0 → 1,13
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.kwCompoundRequire({common:["dojo.string", "dojo.string.common", "dojo.string.extras", "dojo.string.Builder"]});
dojo.provide("dojo.string.*");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/string/common.js
New file
0,0 → 1,61
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.string.common");
dojo.string.trim = function (str, wh) {
if (!str.replace) {
return str;
}
if (!str.length) {
return str;
}
var re = (wh > 0) ? (/^\s+/) : (wh < 0) ? (/\s+$/) : (/^\s+|\s+$/g);
return str.replace(re, "");
};
dojo.string.trimStart = function (str) {
return dojo.string.trim(str, 1);
};
dojo.string.trimEnd = function (str) {
return dojo.string.trim(str, -1);
};
dojo.string.repeat = function (str, count, separator) {
var out = "";
for (var i = 0; i < count; i++) {
out += str;
if (separator && i < count - 1) {
out += separator;
}
}
return out;
};
dojo.string.pad = function (str, len, c, dir) {
var out = String(str);
if (!c) {
c = "0";
}
if (!dir) {
dir = 1;
}
while (out.length < len) {
if (dir > 0) {
out = c + out;
} else {
out += c;
}
}
return out;
};
dojo.string.padLeft = function (str, len, c) {
return dojo.string.pad(str, len, c, 1);
};
dojo.string.padRight = function (str, len, c) {
return dojo.string.pad(str, len, c, -1);
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/storage.js
New file
0,0 → 1,125
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.storage");
dojo.require("dojo.lang.*");
dojo.require("dojo.event.*");
dojo.storage = new function () {
};
dojo.declare("dojo.storage", null, {SUCCESS:"success", FAILED:"failed", PENDING:"pending", SIZE_NOT_AVAILABLE:"Size not available", SIZE_NO_LIMIT:"No size limit", namespace:"default", onHideSettingsUI:null, initialize:function () {
dojo.unimplemented("dojo.storage.initialize");
}, isAvailable:function () {
dojo.unimplemented("dojo.storage.isAvailable");
}, put:function (key, value, resultsHandler) {
dojo.unimplemented("dojo.storage.put");
}, get:function (key) {
dojo.unimplemented("dojo.storage.get");
}, hasKey:function (key) {
return (this.get(key) != null);
}, getKeys:function () {
dojo.unimplemented("dojo.storage.getKeys");
}, clear:function () {
dojo.unimplemented("dojo.storage.clear");
}, remove:function (key) {
dojo.unimplemented("dojo.storage.remove");
}, isPermanent:function () {
dojo.unimplemented("dojo.storage.isPermanent");
}, getMaximumSize:function () {
dojo.unimplemented("dojo.storage.getMaximumSize");
}, hasSettingsUI:function () {
return false;
}, showSettingsUI:function () {
dojo.unimplemented("dojo.storage.showSettingsUI");
}, hideSettingsUI:function () {
dojo.unimplemented("dojo.storage.hideSettingsUI");
}, getType:function () {
dojo.unimplemented("dojo.storage.getType");
}, isValidKey:function (keyName) {
if ((keyName == null) || (typeof keyName == "undefined")) {
return false;
}
return /^[0-9A-Za-z_]*$/.test(keyName);
}});
dojo.storage.manager = new function () {
this.currentProvider = null;
this.available = false;
this._initialized = false;
this._providers = [];
this.namespace = "default";
this.initialize = function () {
this.autodetect();
};
this.register = function (name, instance) {
this._providers[this._providers.length] = instance;
this._providers[name] = instance;
};
this.setProvider = function (storageClass) {
};
this.autodetect = function () {
if (this._initialized == true) {
return;
}
var providerToUse = null;
for (var i = 0; i < this._providers.length; i++) {
providerToUse = this._providers[i];
if (dojo.lang.isUndefined(djConfig["forceStorageProvider"]) == false && providerToUse.getType() == djConfig["forceStorageProvider"]) {
providerToUse.isAvailable();
break;
} else {
if (dojo.lang.isUndefined(djConfig["forceStorageProvider"]) == true && providerToUse.isAvailable()) {
break;
}
}
}
if (providerToUse == null) {
this._initialized = true;
this.available = false;
this.currentProvider = null;
dojo.raise("No storage provider found for this platform");
}
this.currentProvider = providerToUse;
for (var i in providerToUse) {
dojo.storage[i] = providerToUse[i];
}
dojo.storage.manager = this;
dojo.storage.initialize();
this._initialized = true;
this.available = true;
};
this.isAvailable = function () {
return this.available;
};
this.isInitialized = function () {
if (this.currentProvider.getType() == "dojo.storage.browser.FlashStorageProvider" && dojo.flash.ready == false) {
return false;
} else {
return this._initialized;
}
};
this.supportsProvider = function (storageClass) {
try {
var provider = eval("new " + storageClass + "()");
var results = provider.isAvailable();
if (results == null || typeof results == "undefined") {
return false;
}
return results;
}
catch (exception) {
return false;
}
};
this.getProvider = function () {
return this.currentProvider;
};
this.loaded = function () {
};
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/hostenv_svg.js
New file
0,0 → 1,245
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
if (typeof window == "undefined") {
dojo.raise("attempt to use adobe svg hostenv when no window object");
}
dojo.debug = function () {
if (!djConfig.isDebug) {
return;
}
var args = arguments;
var isJUM = dj_global["jum"];
var s = isJUM ? "" : "DEBUG: ";
for (var i = 0; i < args.length; ++i) {
s += args[i];
}
if (isJUM) {
jum.debug(s);
} else {
dojo.hostenv.println(s);
}
};
dojo.render.name = navigator.appName;
dojo.render.ver = parseFloat(navigator.appVersion, 10);
switch (navigator.platform) {
case "MacOS":
dojo.render.os.osx = true;
break;
case "Linux":
dojo.render.os.linux = true;
break;
case "Windows":
dojo.render.os.win = true;
break;
default:
dojo.render.os.linux = true;
break;
}
dojo.render.svg.capable = true;
dojo.render.svg.support.builtin = true;
dojo.render.svg.moz = ((navigator.userAgent.indexOf("Gecko") >= 0) && (!((navigator.appVersion.indexOf("Konqueror") >= 0) || (navigator.appVersion.indexOf("Safari") >= 0))));
dojo.render.svg.adobe = (window.parseXML != null);
dojo.hostenv.startPackage("dojo.hostenv");
dojo.hostenv.println = function (s) {
try {
var ti = document.createElement("text");
ti.setAttribute("x", "50");
ti.setAttribute("y", (25 + 15 * document.getElementsByTagName("text").length));
ti.appendChild(document.createTextNode(s));
document.documentElement.appendChild(ti);
}
catch (e) {
}
};
dojo.hostenv.name_ = "svg";
dojo.hostenv.setModulePrefix = function (module, prefix) {
};
dojo.hostenv.getModulePrefix = function (module) {
};
dojo.hostenv.getTextStack = [];
dojo.hostenv.loadUriStack = [];
dojo.hostenv.loadedUris = [];
dojo.hostenv.modules_ = {};
dojo.hostenv.modulesLoadedFired = false;
dojo.hostenv.modulesLoadedListeners = [];
dojo.hostenv.getText = function (uri, cb, data) {
if (!cb) {
var cb = function (result) {
window.alert(result);
};
}
if (!data) {
window.getUrl(uri, cb);
} else {
window.postUrl(uri, data, cb);
}
};
dojo.hostenv.getLibaryScriptUri = function () {
};
dojo.hostenv.loadUri = function (uri) {
};
dojo.hostenv.loadUriAndCheck = function (uri, module) {
};
dojo.hostenv.loadModule = function (moduleName) {
var a = moduleName.split(".");
var currentObj = window;
var s = [];
for (var i = 0; i < a.length; i++) {
if (a[i] == "*") {
continue;
}
s.push(a[i]);
if (!currentObj[a[i]]) {
dojo.raise("dojo.require('" + moduleName + "'): module does not exist.");
} else {
currentObj = currentObj[a[i]];
}
}
return;
};
dojo.hostenv.startPackage = function (moduleName) {
var a = moduleName.split(".");
var currentObj = window;
var s = [];
for (var i = 0; i < a.length; i++) {
if (a[i] == "*") {
continue;
}
s.push(a[i]);
if (!currentObj[a[i]]) {
currentObj[a[i]] = {};
}
currentObj = currentObj[a[i]];
}
return;
};
if (window.parseXML) {
window.XMLSerialzer = function () {
function nodeToString(n, a) {
function fixText(s) {
return String(s).replace(/\&/g, "&amp;").replace(/>/g, "&gt;").replace(/</g, "&lt;");
}
function fixAttribute(s) {
return fixText(s).replace(/\"/g, "&quot;");
}
switch (n.nodeType) {
case 1:
var name = n.nodeName;
a.push("<" + name);
for (var i = 0; i < n.attributes.length; i++) {
if (n.attributes.item(i).specified) {
a.push(" " + n.attributes.item(i).nodeName.toLowerCase() + "=\"" + fixAttribute(n.attributes.item(i).nodeValue) + "\"");
}
}
if (n.canHaveChildren || n.hasChildNodes()) {
a.push(">");
for (var i = 0; i < n.childNodes.length; i++) {
nodeToString(n.childNodes.item(i), a);
}
a.push("</" + name + ">\n");
} else {
a.push(" />\n");
}
break;
case 3:
a.push(fixText(n.nodeValue));
break;
case 4:
a.push("<![CDA" + "TA[\n" + n.nodeValue + "\n]" + "]>");
break;
case 7:
a.push(n.nodeValue);
if (/(^<\?xml)|(^<\!DOCTYPE)/.test(n.nodeValue)) {
a.push("\n");
}
break;
case 8:
a.push("<!-- " + n.nodeValue + " -->\n");
break;
case 9:
case 11:
for (var i = 0; i < n.childNodes.length; i++) {
nodeToString(n.childNodes.item(i), a);
}
break;
default:
a.push("<!--\nNot Supported:\n\n" + "nodeType: " + n.nodeType + "\nnodeName: " + n.nodeName + "\n-->");
}
}
this.serializeToString = function (node) {
var a = [];
nodeToString(node, a);
return a.join("");
};
};
window.DOMParser = function () {
this.parseFromString = function (s) {
return parseXML(s, window.document);
};
};
window.XMLHttpRequest = function () {
var uri = null;
var method = "POST";
var isAsync = true;
var cb = function (d) {
this.responseText = d.content;
try {
this.responseXML = parseXML(this.responseText, window.document);
}
catch (e) {
}
this.status = "200";
this.statusText = "OK";
if (!d.success) {
this.status = "500";
this.statusText = "Internal Server Error";
}
this.onload();
this.onreadystatechange();
};
this.onload = function () {
};
this.readyState = 4;
this.onreadystatechange = function () {
};
this.status = 0;
this.statusText = "";
this.responseBody = null;
this.responseStream = null;
this.responseXML = null;
this.responseText = null;
this.abort = function () {
return;
};
this.getAllResponseHeaders = function () {
return [];
};
this.getResponseHeader = function (n) {
return null;
};
this.setRequestHeader = function (nm, val) {
};
this.open = function (meth, url, async) {
method = meth;
uri = url;
};
this.send = function (data) {
var d = data || null;
if (method == "GET") {
getURL(uri, cb);
} else {
postURL(uri, data, cb);
}
};
};
}
dojo.requireIf((djConfig["isDebug"] || djConfig["debugAtAllCosts"]), "dojo.debug");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/string.js
New file
0,0 → 1,13
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.string");
dojo.require("dojo.string.common");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/ResizeHandle.js
New file
0,0 → 1,66
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.ResizeHandle");
dojo.require("dojo.widget.*");
dojo.require("dojo.html.layout");
dojo.require("dojo.event.*");
dojo.widget.defineWidget("dojo.widget.ResizeHandle", dojo.widget.HtmlWidget, {targetElmId:"", templateCssString:".dojoHtmlResizeHandle {\n\tfloat: right;\n\tposition: absolute;\n\tright: 2px;\n\tbottom: 2px;\n\twidth: 13px;\n\theight: 13px;\n\tz-index: 20;\n\tcursor: nw-resize;\n\tbackground-image: url(grabCorner.gif);\n\tline-height: 0px;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/ResizeHandle.css"), templateString:"<div class=\"dojoHtmlResizeHandle\"><div></div></div>", postCreate:function () {
dojo.event.connect(this.domNode, "onmousedown", this, "_beginSizing");
}, _beginSizing:function (e) {
if (this._isSizing) {
return false;
}
this.targetWidget = dojo.widget.byId(this.targetElmId);
this.targetDomNode = this.targetWidget ? this.targetWidget.domNode : dojo.byId(this.targetElmId);
if (!this.targetDomNode) {
return;
}
this._isSizing = true;
this.startPoint = {"x":e.clientX, "y":e.clientY};
var mb = dojo.html.getMarginBox(this.targetDomNode);
this.startSize = {"w":mb.width, "h":mb.height};
dojo.event.kwConnect({srcObj:dojo.body(), srcFunc:"onmousemove", targetObj:this, targetFunc:"_changeSizing", rate:25});
dojo.event.connect(dojo.body(), "onmouseup", this, "_endSizing");
e.preventDefault();
}, _changeSizing:function (e) {
try {
if (!e.clientX || !e.clientY) {
return;
}
}
catch (e) {
return;
}
var dx = this.startPoint.x - e.clientX;
var dy = this.startPoint.y - e.clientY;
var newW = this.startSize.w - dx;
var newH = this.startSize.h - dy;
if (this.minSize) {
var mb = dojo.html.getMarginBox(this.targetDomNode);
if (newW < this.minSize.w) {
newW = mb.width;
}
if (newH < this.minSize.h) {
newH = mb.height;
}
}
if (this.targetWidget) {
this.targetWidget.resizeTo(newW, newH);
} else {
dojo.html.setMarginBox(this.targetDomNode, {width:newW, height:newH});
}
e.preventDefault();
}, _endSizing:function (e) {
dojo.event.disconnect(dojo.body(), "onmousemove", this, "_changeSizing");
dojo.event.disconnect(dojo.body(), "onmouseup", this, "_endSizing");
this._isSizing = false;
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Select.js
New file
0,0 → 1,37
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Select");
dojo.require("dojo.widget.ComboBox");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.html.stabile");
dojo.widget.defineWidget("dojo.widget.Select", dojo.widget.ComboBox, {forceValidOption:true, setValue:function (value) {
this.comboBoxValue.value = value;
dojo.widget.html.stabile.setState(this.widgetId, this.getState(), true);
this.onValueChanged(value);
}, setLabel:function (value) {
this.comboBoxSelectionValue.value = value;
if (this.textInputNode.value != value) {
this.textInputNode.value = value;
}
}, getLabel:function () {
return this.comboBoxSelectionValue.value;
}, getState:function () {
return {value:this.getValue(), label:this.getLabel()};
}, onKeyUp:function (evt) {
this.setLabel(this.textInputNode.value);
}, setState:function (state) {
this.setValue(state.value);
this.setLabel(state.label);
}, setAllValues:function (value1, value2) {
this.setLabel(value1);
this.setValue(value2);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/PageContainer.js
New file
0,0 → 1,200
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.PageContainer");
dojo.require("dojo.lang.func");
dojo.require("dojo.widget.*");
dojo.require("dojo.event.*");
dojo.require("dojo.html.selection");
dojo.widget.defineWidget("dojo.widget.PageContainer", dojo.widget.HtmlWidget, {isContainer:true, doLayout:true, templateString:"<div dojoAttachPoint='containerNode'></div>", selectedChild:"", fillInTemplate:function (args, frag) {
var source = this.getFragNodeRef(frag);
dojo.html.copyStyle(this.domNode, source);
dojo.widget.PageContainer.superclass.fillInTemplate.apply(this, arguments);
}, postCreate:function (args, frag) {
if (this.children.length) {
dojo.lang.forEach(this.children, this._setupChild, this);
var initialChild;
if (this.selectedChild) {
this.selectChild(this.selectedChild);
} else {
for (var i = 0; i < this.children.length; i++) {
if (this.children[i].selected) {
this.selectChild(this.children[i]);
break;
}
}
if (!this.selectedChildWidget) {
this.selectChild(this.children[0]);
}
}
}
}, addChild:function (child) {
dojo.widget.PageContainer.superclass.addChild.apply(this, arguments);
this._setupChild(child);
this.onResized();
if (!this.selectedChildWidget) {
this.selectChild(child);
}
}, _setupChild:function (page) {
page.hide();
page.domNode.style.position = "relative";
dojo.event.topic.publish(this.widgetId + "-addChild", page);
}, removeChild:function (page) {
dojo.widget.PageContainer.superclass.removeChild.apply(this, arguments);
if (this._beingDestroyed) {
return;
}
dojo.event.topic.publish(this.widgetId + "-removeChild", page);
this.onResized();
if (this.selectedChildWidget === page) {
this.selectedChildWidget = undefined;
if (this.children.length > 0) {
this.selectChild(this.children[0], true);
}
}
}, selectChild:function (page, callingWidget) {
page = dojo.widget.byId(page);
this.correspondingPageButton = callingWidget;
if (this.selectedChildWidget) {
this._hideChild(this.selectedChildWidget);
}
this.selectedChildWidget = page;
this.selectedChild = page.widgetId;
this._showChild(page);
page.isFirstChild = (page == this.children[0]);
page.isLastChild = (page == this.children[this.children.length - 1]);
dojo.event.topic.publish(this.widgetId + "-selectChild", page);
}, forward:function () {
var index = dojo.lang.find(this.children, this.selectedChildWidget);
this.selectChild(this.children[index + 1]);
}, back:function () {
var index = dojo.lang.find(this.children, this.selectedChildWidget);
this.selectChild(this.children[index - 1]);
}, onResized:function () {
if (this.doLayout && this.selectedChildWidget) {
with (this.selectedChildWidget.domNode.style) {
top = dojo.html.getPixelValue(this.containerNode, "padding-top", true);
left = dojo.html.getPixelValue(this.containerNode, "padding-left", true);
}
var content = dojo.html.getContentBox(this.containerNode);
this.selectedChildWidget.resizeTo(content.width, content.height);
}
}, _showChild:function (page) {
if (this.doLayout) {
var content = dojo.html.getContentBox(this.containerNode);
page.resizeTo(content.width, content.height);
}
page.selected = true;
page.show();
}, _hideChild:function (page) {
page.selected = false;
page.hide();
}, closeChild:function (page) {
var remove = page.onClose(this, page);
if (remove) {
this.removeChild(page);
page.destroy();
}
}, destroy:function () {
this._beingDestroyed = true;
dojo.event.topic.destroy(this.widgetId + "-addChild");
dojo.event.topic.destroy(this.widgetId + "-removeChild");
dojo.event.topic.destroy(this.widgetId + "-selectChild");
dojo.widget.PageContainer.superclass.destroy.apply(this, arguments);
}});
dojo.widget.defineWidget("dojo.widget.PageController", dojo.widget.HtmlWidget, {templateString:"<span wairole='tablist' dojoAttachEvent='onKey'></span>", isContainer:true, containerId:"", buttonWidget:"PageButton", "class":"dojoPageController", fillInTemplate:function () {
dojo.html.addClass(this.domNode, this["class"]);
dojo.widget.wai.setAttr(this.domNode, "waiRole", "role", "tablist");
}, postCreate:function () {
this.pane2button = {};
var container = dojo.widget.byId(this.containerId);
if (container) {
dojo.lang.forEach(container.children, this.onAddChild, this);
}
dojo.event.topic.subscribe(this.containerId + "-addChild", this, "onAddChild");
dojo.event.topic.subscribe(this.containerId + "-removeChild", this, "onRemoveChild");
dojo.event.topic.subscribe(this.containerId + "-selectChild", this, "onSelectChild");
}, destroy:function () {
dojo.event.topic.unsubscribe(this.containerId + "-addChild", this, "onAddChild");
dojo.event.topic.unsubscribe(this.containerId + "-removeChild", this, "onRemoveChild");
dojo.event.topic.unsubscribe(this.containerId + "-selectChild", this, "onSelectChild");
dojo.widget.PageController.superclass.destroy.apply(this, arguments);
}, onAddChild:function (page) {
var button = dojo.widget.createWidget(this.buttonWidget, {label:page.label, closeButton:page.closable});
this.addChild(button);
this.domNode.appendChild(button.domNode);
this.pane2button[page] = button;
page.controlButton = button;
var _this = this;
dojo.event.connect(button, "onClick", function () {
_this.onButtonClick(page);
});
dojo.event.connect(button, "onCloseButtonClick", function () {
_this.onCloseButtonClick(page);
});
}, onRemoveChild:function (page) {
if (this._currentChild == page) {
this._currentChild = null;
}
var button = this.pane2button[page];
if (button) {
button.destroy();
}
this.pane2button[page] = null;
}, onSelectChild:function (page) {
if (this._currentChild) {
var oldButton = this.pane2button[this._currentChild];
oldButton.clearSelected();
}
var newButton = this.pane2button[page];
newButton.setSelected();
this._currentChild = page;
}, onButtonClick:function (page) {
var container = dojo.widget.byId(this.containerId);
container.selectChild(page, false, this);
}, onCloseButtonClick:function (page) {
var container = dojo.widget.byId(this.containerId);
container.closeChild(page);
}, onKey:function (evt) {
if ((evt.keyCode == evt.KEY_RIGHT_ARROW) || (evt.keyCode == evt.KEY_LEFT_ARROW)) {
var current = 0;
var next = null;
var current = dojo.lang.find(this.children, this.pane2button[this._currentChild]);
if (evt.keyCode == evt.KEY_RIGHT_ARROW) {
next = this.children[(current + 1) % this.children.length];
} else {
next = this.children[(current + (this.children.length - 1)) % this.children.length];
}
dojo.event.browser.stopEvent(evt);
next.onClick();
}
}});
dojo.widget.defineWidget("dojo.widget.PageButton", dojo.widget.HtmlWidget, {templateString:"<span class='item'>" + "<span dojoAttachEvent='onClick' dojoAttachPoint='titleNode' class='selectButton'>${this.label}</span>" + "<span dojoAttachEvent='onClick:onCloseButtonClick' class='closeButton'>[X]</span>" + "</span>", label:"foo", closeButton:false, onClick:function () {
this.focus();
}, onCloseButtonMouseOver:function () {
dojo.html.addClass(this.closeButtonNode, "closeHover");
}, onCloseButtonMouseOut:function () {
dojo.html.removeClass(this.closeButtonNode, "closeHover");
}, onCloseButtonClick:function (evt) {
}, setSelected:function () {
dojo.html.addClass(this.domNode, "current");
this.titleNode.setAttribute("tabIndex", "0");
}, clearSelected:function () {
dojo.html.removeClass(this.domNode, "current");
this.titleNode.setAttribute("tabIndex", "-1");
}, focus:function () {
if (this.titleNode.focus) {
this.titleNode.focus();
}
}});
dojo.lang.extend(dojo.widget.Widget, {label:"", selected:false, closable:false, onClose:function () {
return true;
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Toaster.js
New file
0,0 → 1,161
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Toaster");
dojo.require("dojo.widget.*");
dojo.require("dojo.lfx.*");
dojo.require("dojo.html.iframe");
dojo.widget.defineWidget("dojo.widget.Toaster", dojo.widget.HtmlWidget, {templateString:"<div dojoAttachPoint=\"clipNode\"><div dojoAttachPoint=\"containerNode\" dojoAttachEvent=\"onClick:onSelect\"><div dojoAttachPoint=\"contentNode\"></div></div></div>", templateCssString:".dojoToasterClip {\n\tposition: absolute;\n\toverflow: hidden;\n}\n\n.dojoToasterContainer {\n\tdisplay: block;\n\tposition: absolute;\n\twidth: 17.5em;\n\tz-index: 5000;\n\tmargin: 0px;\n\tfont:0.75em Tahoma, Helvetica, Verdana, Arial;\n}\n\n.dojoToasterContent{\n\tpadding:1em;\n\tpadding-top:0.25em;\n\tbackground:#73c74a;\n}\n\n.dojoToasterMessage{ \n\tcolor:#fff;\n}\n.dojoToasterWarning{ }\n.dojoToasterError,\n.dojoToasterFatal{\n\tfont-weight:bold;\n\tcolor:#fff;\n}\n\n\n.dojoToasterWarning .dojoToasterContent{\n\tpadding:1em;\n\tpadding-top:0.25em;\n\tbackground:#d4d943;\n} \n\n.dojoToasterError .dojoToasterContent{\n\tpadding:1em;\n\tpadding-top:0.25em;\n\tbackground:#c46600;\n} \n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/Toaster.css"), messageTopic:"", messageTypes:{MESSAGE:"MESSAGE", WARNING:"WARNING", ERROR:"ERROR", FATAL:"FATAL"}, defaultType:"MESSAGE", clipCssClass:"dojoToasterClip", containerCssClass:"dojoToasterContainer", contentCssClass:"dojoToasterContent", messageCssClass:"dojoToasterMessage", warningCssClass:"dojoToasterWarning", errorCssClass:"dojoToasterError", fatalCssClass:"dojoToasterFatal", positionDirection:"br-up", positionDirectionTypes:["br-up", "br-left", "bl-up", "bl-right", "tr-down", "tr-left", "tl-down", "tl-right"], showDelay:2000, postCreate:function () {
this.hide();
dojo.html.setClass(this.clipNode, this.clipCssClass);
dojo.html.addClass(this.containerNode, this.containerCssClass);
dojo.html.setClass(this.contentNode, this.contentCssClass);
if (this.messageTopic) {
dojo.event.topic.subscribe(this.messageTopic, this, "_handleMessage");
}
if (!this.positionDirection || !dojo.lang.inArray(this.positionDirectionTypes, this.positionDirection)) {
this.positionDirection = this.positionDirectionTypes.BRU;
}
}, _handleMessage:function (msg) {
if (dojo.lang.isString(msg)) {
this.setContent(msg);
} else {
this.setContent(msg["message"], msg["type"], msg["delay"]);
}
}, setContent:function (msg, messageType, delay) {
var delay = delay || this.showDelay;
if (this.slideAnim && this.slideAnim.status() == "playing") {
dojo.lang.setTimeout(50, dojo.lang.hitch(this, function () {
this.setContent(msg, messageType);
}));
return;
} else {
if (this.slideAnim) {
this.slideAnim.stop();
if (this.fadeAnim) {
this.fadeAnim.stop();
}
}
}
if (!msg) {
dojo.debug(this.widgetId + ".setContent() incoming content was null, ignoring.");
return;
}
if (!this.positionDirection || !dojo.lang.inArray(this.positionDirectionTypes, this.positionDirection)) {
dojo.raise(this.widgetId + ".positionDirection is an invalid value: " + this.positionDirection);
}
dojo.html.removeClass(this.containerNode, this.messageCssClass);
dojo.html.removeClass(this.containerNode, this.warningCssClass);
dojo.html.removeClass(this.containerNode, this.errorCssClass);
dojo.html.removeClass(this.containerNode, this.fatalCssClass);
dojo.html.clearOpacity(this.containerNode);
if (msg instanceof String || typeof msg == "string") {
this.contentNode.innerHTML = msg;
} else {
if (dojo.html.isNode(msg)) {
this.contentNode.innerHTML = dojo.html.getContentAsString(msg);
} else {
dojo.raise("Toaster.setContent(): msg is of unknown type:" + msg);
}
}
switch (messageType) {
case this.messageTypes.WARNING:
dojo.html.addClass(this.containerNode, this.warningCssClass);
break;
case this.messageTypes.ERROR:
dojo.html.addClass(this.containerNode, this.errorCssClass);
break;
case this.messageTypes.FATAL:
dojo.html.addClass(this.containerNode, this.fatalCssClass);
break;
case this.messageTypes.MESSAGE:
default:
dojo.html.addClass(this.containerNode, this.messageCssClass);
break;
}
this.show();
var nodeSize = dojo.html.getMarginBox(this.containerNode);
if (this.positionDirection.indexOf("-up") >= 0) {
this.containerNode.style.left = 0 + "px";
this.containerNode.style.top = nodeSize.height + 10 + "px";
} else {
if (this.positionDirection.indexOf("-left") >= 0) {
this.containerNode.style.left = nodeSize.width + 10 + "px";
this.containerNode.style.top = 0 + "px";
} else {
if (this.positionDirection.indexOf("-right") >= 0) {
this.containerNode.style.left = 0 - nodeSize.width - 10 + "px";
this.containerNode.style.top = 0 + "px";
} else {
if (this.positionDirection.indexOf("-down") >= 0) {
this.containerNode.style.left = 0 + "px";
this.containerNode.style.top = 0 - nodeSize.height - 10 + "px";
} else {
dojo.raise(this.widgetId + ".positionDirection is an invalid value: " + this.positionDirection);
}
}
}
}
this.slideAnim = dojo.lfx.html.slideTo(this.containerNode, {top:0, left:0}, 450, null, dojo.lang.hitch(this, function (nodes, anim) {
dojo.lang.setTimeout(dojo.lang.hitch(this, function (evt) {
if (this.bgIframe) {
this.bgIframe.hide();
}
this.fadeAnim = dojo.lfx.html.fadeOut(this.containerNode, 1000, null, dojo.lang.hitch(this, function (evt) {
this.hide();
})).play();
}), delay);
})).play();
}, _placeClip:function () {
var scroll = dojo.html.getScroll();
var view = dojo.html.getViewport();
var nodeSize = dojo.html.getMarginBox(this.containerNode);
this.clipNode.style.height = nodeSize.height + "px";
this.clipNode.style.width = nodeSize.width + "px";
if (this.positionDirection.match(/^t/)) {
this.clipNode.style.top = scroll.top + "px";
} else {
if (this.positionDirection.match(/^b/)) {
this.clipNode.style.top = (view.height - nodeSize.height - 2 + scroll.top) + "px";
}
}
if (this.positionDirection.match(/^[tb]r-/)) {
this.clipNode.style.left = (view.width - nodeSize.width - 1 - scroll.left) + "px";
} else {
if (this.positionDirection.match(/^[tb]l-/)) {
this.clipNode.style.left = 0 + "px";
}
}
this.clipNode.style.clip = "rect(0px, " + nodeSize.width + "px, " + nodeSize.height + "px, 0px)";
if (dojo.render.html.ie) {
if (!this.bgIframe) {
this.bgIframe = new dojo.html.BackgroundIframe(this.containerNode);
this.bgIframe.setZIndex(this.containerNode);
}
this.bgIframe.onResized();
this.bgIframe.show();
}
}, onSelect:function (e) {
}, show:function () {
dojo.widget.Toaster.superclass.show.call(this);
this._placeClip();
if (!this._scrollConnected) {
this._scrollConnected = true;
dojo.event.connect(window, "onscroll", this, "_placeClip");
}
}, hide:function () {
dojo.widget.Toaster.superclass.hide.call(this);
if (this._scrollConnected) {
this._scrollConnected = false;
dojo.event.disconnect(window, "onscroll", this, "_placeClip");
}
dojo.html.setOpacity(this.containerNode, 1);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Slider.js
New file
0,0 → 1,473
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Slider");
dojo.require("dojo.event.*");
dojo.require("dojo.dnd.*");
dojo.require("dojo.dnd.HtmlDragMove");
dojo.require("dojo.widget.*");
dojo.require("dojo.html.layout");
dojo.widget.defineWidget("dojo.widget.Slider", dojo.widget.HtmlWidget, {minimumX:0, minimumY:0, maximumX:10, maximumY:10, snapValuesX:0, snapValuesY:0, _snapToGrid:true, isEnableX:true, isEnableY:true, _valueSizeX:0, _valueSizeY:0, _minX:0, _minY:0, _constraintWidth:0, _constraintHeight:0, _clipLeft:0, _clipRight:0, _clipTop:0, _clipBottom:0, _clipXdelta:0, _clipYdelta:0, initialValueX:0, initialValueY:0, flipX:false, flipY:false, clickSelect:true, activeDrag:false, templateCssString:".sliderMain {\n border: 0px !important;\n border-spacing: 0px !important;\n line-height: 0px !important;\n padding: 0px !important;\n display: -moz-inline-table !important;\n display: inline !important;\n -moz-user-focus: normal !important;\n}\n\n.sliderComponent {\n border: 0px;\n padding: 0px;\n margin: 0px;\n}\n\n.sliderHandle { \n top: 0px;\n left: 0px;\n z-index: 1000;\n position: absolute !important;\n}\n\n.sliderOutsetButton { \n border-style: outset;\n border-width: 0px 1px 1px 0px;\n border-color: black;\n}\n\n.sliderInsetButton { \n border-style: inset;\n border-width: 1px 0px 0px 1px;\n border-color: black;\n}\n\n.sliderButtonY {\n margin: 0px;\n padding: 0px;\n z-index: 900;\n}\n\n.sliderButtonX {\n margin: 0px;\n padding: 0px;\n z-index: 900;\n}\n\n.sliderBackground { \n z-index: 0;\n display: block !important;\n position: relative !important;\n}\n\n.sliderProgressBackground { \n z-index: 800;\n position: absolute !important;\n clip: rect(0px,0px,0px,0px);\n}\n\n.sliderBackgroundSizeOnly { \n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/Slider.css"), templateString:"<table _=\"weird end tag formatting is to prevent whitespace from becoming &nbsp;\" \n\tclass=\"sliderMain\" \n\tdojoAttachPoint=\"focusNode\" \n\tdojoAttachEvent=\"onmousedown:_setFocus; onkey:_handleKeyEvents; onkeyup:_buttonReleased; onmouseup:_buttonReleased; onmousewheel:_mouseWheeled;\"\n\ttabindex=\"0\" cols=3 cellpadding=0 cellspacing=0 style=\"\">\n\t<tr valign=middle align=center>\n\t\t<td class=\"sliderComponent\" colspan=3 dojoAttachPoint=topBorderNode style=\"\"\n\t\t\t><img class=\"sliderOutsetButton sliderButtonY\"\n\t\t\t\tdojoAttachPoint=topButtonNode \n\t\t\t\tdojoAttachEvent=\"onmousedown:_topButtonPressed; onmousemove:_discardEvent; ondblclick:_topButtonDoubleClicked;\"\n\t\t\t\tsrc=\"${this.topButtonSrc}\" \n\t\t\t\tstyle=\"${this.buttonStyleY}\"\n\t\t></td>\n\t</tr>\n\t<tr valign=middle align=center>\n\t\t<td class=\"sliderComponent\" dojoAttachPoint=leftBorderNode style=\"\"\n\t\t\t><img class=\"sliderOutsetButton sliderButtonX\"\n\t\t\t\tdojoAttachPoint=leftButtonNode\n\t\t\t\tdojoAttachEvent=\"onmousedown:_leftButtonPressed; onmousemove:_discardEvent; ondblclick:_leftButtonDoubleClicked;\"\n\t\t\t\tsrc=\"${this.leftButtonSrc}\" \n\t\t\t\tstyle=\"${this.buttonStyleX}\"\n\t\t></td>\n\t\t<td dojoAttachPoint=constrainingContainerNode \n\t\t\tclass=\"sliderComponent sliderBackground\"\n\t\t\tstyle=\"${this.backgroundStyle}\"\n\t\t\t><img src=\"${this.handleSrc}\" \n\t\t\t\tclass=sliderHandle\n\t\t\t\tdojoAttachPoint=sliderHandleNode\n\t\t\t\tstyle=\"${this.handleStyle}\"\n\t\t\t><img src=\"${this.progressBackgroundSrc}\"\n\t\t\t\tclass=\"sliderBackgroundSizeOnly sliderProgressBackground\"\n\t\t\t\tdojoAttachPoint=progressBackgroundNode\n\t\t\t\tstyle=\"${this.backgroundSize}\"\n\t\t\t><img src=\"${this.backgroundSrc}\" \n\t\t\t\tclass=sliderBackgroundSizeOnly\n\t\t\t\tdojoAttachPoint=sliderBackgroundNode\n\t\t\t\tstyle=\"${this.backgroundSize}\"\n\t\t></td>\n\t\t<td class=\"sliderComponent\" dojoAttachPoint=rightBorderNode style=\"\"\n\t\t\t><img class=\"sliderOutsetButton sliderButtonX\"\n\t\t\t\tdojoAttachPoint=rightButtonNode\n\t\t\t\tdojoAttachEvent=\"onmousedown:_rightButtonPressed; onmousemove:_discardEvent; ondblclick:_rightButtonDoubleClicked;\"\n\t\t\t\tsrc=\"${this.rightButtonSrc}\" \n\t\t\t\tstyle=\"${this.buttonStyleX}\"\n\t\t></td>\n\t</tr>\n\t<tr valign=middle align=center>\n\t\t<td class=\"sliderComponent\" colspan=3 dojoAttachPoint=bottomBorderNode style=\"\"\n\t\t\t><img class=\"sliderOutsetButton sliderButtonY\"\n\t\t\t\tdojoAttachPoint=bottomButtonNode \n\t\t\t\tdojoAttachEvent=\"onmousedown:_bottomButtonPressed; onmousemove:_discardEvent; ondblclick:_bottomButtonDoubleClicked;\"\n\t\t\t\tsrc=\"${this.bottomButtonSrc}\" \n\t\t\t\tstyle=\"${this.buttonStyleY}\"\n\t\t></td>\n\t</tr>\n</table>\n", _isDragInProgress:false, bottomButtonSrc:dojo.uri.moduleUri("dojo.widget", "templates/images/slider_down_arrow.png"), topButtonSrc:dojo.uri.moduleUri("dojo.widget", "templates/images/slider_up_arrow.png"), leftButtonSrc:dojo.uri.moduleUri("dojo.widget", "templates/images/slider_left_arrow.png"), rightButtonSrc:dojo.uri.moduleUri("dojo.widget", "templates/images/slider_right_arrow.png"), backgroundSrc:dojo.uri.moduleUri("dojo.widget", "templates/images/blank.gif"), progressBackgroundSrc:dojo.uri.moduleUri("dojo.widget", "templates/images/blank.gif"), backgroundSize:"width:200px;height:200px;", backgroundStyle:"", buttonStyleX:"", buttonStyleY:"", handleStyle:"", handleSrc:dojo.uri.moduleUri("dojo.widget", "templates/images/slider-button.png"), showButtons:true, _eventCount:0, _typamaticTimer:null, _typamaticFunction:null, defaultTimeout:500, timeoutChangeRate:0.9, _currentTimeout:this.defaultTimeout, _handleKeyEvents:function (evt) {
if (!evt.key) {
return;
}
if (!evt.ctrlKey && !evt.altKey) {
switch (evt.key) {
case evt.KEY_LEFT_ARROW:
dojo.event.browser.stopEvent(evt);
this._leftButtonPressed(evt);
return;
case evt.KEY_RIGHT_ARROW:
dojo.event.browser.stopEvent(evt);
this._rightButtonPressed(evt);
return;
case evt.KEY_DOWN_ARROW:
dojo.event.browser.stopEvent(evt);
this._bottomButtonPressed(evt);
return;
case evt.KEY_UP_ARROW:
dojo.event.browser.stopEvent(evt);
this._topButtonPressed(evt);
return;
}
}
this._eventCount++;
}, _pressButton:function (buttonNode) {
buttonNode.className = buttonNode.className.replace("Outset", "Inset");
}, _releaseButton:function (buttonNode) {
buttonNode.className = buttonNode.className.replace("Inset", "Outset");
}, _buttonPressed:function (evt, buttonNode) {
this._setFocus();
if (typeof evt == "object") {
if (this._typamaticTimer != null) {
if (this._typamaticNode == buttonNode) {
return;
}
clearTimeout(this._typamaticTimer);
}
this._buttonReleased(null);
this._eventCount++;
this._typamaticTimer = null;
this._currentTimeout = this.defaultTimeout;
dojo.event.browser.stopEvent(evt);
} else {
if (evt != this._eventCount) {
this._buttonReleased(null);
return false;
}
}
if (buttonNode == this.leftButtonNode && this.isEnableX) {
this._snapX(dojo.html.getPixelValue(this.sliderHandleNode, "left") - this._valueSizeX);
} else {
if (buttonNode == this.rightButtonNode && this.isEnableX) {
this._snapX(dojo.html.getPixelValue(this.sliderHandleNode, "left") + this._valueSizeX);
} else {
if (buttonNode == this.topButtonNode && this.isEnableY) {
this._snapY(dojo.html.getPixelValue(this.sliderHandleNode, "top") - this._valueSizeY);
} else {
if (buttonNode == this.bottomButtonNode && this.isEnableY) {
this._snapY(dojo.html.getPixelValue(this.sliderHandleNode, "top") + this._valueSizeY);
} else {
return false;
}
}
}
}
this._pressButton(buttonNode);
this.notifyListeners();
this._typamaticNode = buttonNode;
this._typamaticTimer = dojo.lang.setTimeout(this, "_buttonPressed", this._currentTimeout, this._eventCount, buttonNode);
this._currentTimeout = Math.round(this._currentTimeout * this.timeoutChangeRate);
return false;
}, _bottomButtonPressed:function (evt) {
return this._buttonPressed(evt, this.bottomButtonNode);
}, _bottomButtonDoubleClicked:function (evt) {
var rc = this._bottomButtonPressed(evt);
dojo.lang.setTimeout(this, "_buttonReleased", 50, null);
return rc;
}, _topButtonPressed:function (evt) {
return this._buttonPressed(evt, this.topButtonNode);
}, _topButtonDoubleClicked:function (evt) {
var rc = this._topButtonPressed(evt);
dojo.lang.setTimeout(this, "_buttonReleased", 50, null);
return rc;
}, _leftButtonPressed:function (evt) {
return this._buttonPressed(evt, this.leftButtonNode);
}, _leftButtonDoubleClicked:function (evt) {
var rc = this._leftButtonPressed(evt);
dojo.lang.setTimeout(this, "_buttonReleased", 50, null);
return rc;
}, _rightButtonPressed:function (evt) {
return this._buttonPressed(evt, this.rightButtonNode);
}, _rightButtonDoubleClicked:function (evt) {
var rc = this._rightButtonPressed(evt);
dojo.lang.setTimeout(this, "_buttonReleased", 50, null);
return rc;
}, _buttonReleased:function (evt) {
if (typeof evt == "object" && evt != null && typeof evt.keyCode != "undefined" && evt.keyCode != null) {
var keyCode = evt.keyCode;
switch (keyCode) {
case evt.KEY_LEFT_ARROW:
case evt.KEY_RIGHT_ARROW:
case evt.KEY_DOWN_ARROW:
case evt.KEY_UP_ARROW:
dojo.event.browser.stopEvent(evt);
break;
}
}
this._releaseButton(this.topButtonNode);
this._releaseButton(this.bottomButtonNode);
this._releaseButton(this.leftButtonNode);
this._releaseButton(this.rightButtonNode);
this._eventCount++;
if (this._typamaticTimer != null) {
clearTimeout(this._typamaticTimer);
}
this._typamaticTimer = null;
this._currentTimeout = this.defaultTimeout;
}, _mouseWheeled:function (evt) {
var scrollAmount = 0;
if (typeof evt.wheelDelta == "number") {
scrollAmount = evt.wheelDelta;
} else {
if (typeof evt.detail == "number") {
scrollAmount = -evt.detail;
}
}
if (this.isEnableY) {
if (scrollAmount > 0) {
this._topButtonPressed(evt);
this._buttonReleased(evt);
} else {
if (scrollAmount < 0) {
this._bottomButtonPressed(evt);
this._buttonReleased(evt);
}
}
} else {
if (this.isEnableX) {
if (scrollAmount > 0) {
this._rightButtonPressed(evt);
this._buttonReleased(evt);
} else {
if (scrollAmount < 0) {
this._leftButtonPressed(evt);
this._buttonReleased(evt);
}
}
}
}
}, _discardEvent:function (evt) {
dojo.event.browser.stopEvent(evt);
}, _setFocus:function () {
if (this.focusNode.focus) {
this.focusNode.focus();
}
}, fillInTemplate:function (args, frag) {
var source = this.getFragNodeRef(frag);
dojo.html.copyStyle(this.domNode, source);
var padding = this.domNode.style.padding;
if (dojo.lang.isString(padding) && padding != "" && padding != "0px" && padding != "0px 0px 0px 0px") {
this.topBorderNode.style.padding = this.bottomBorderNode.style.padding = padding;
this.topBorderNode.style.paddingBottom = "0px";
this.bottomBorderNode.style.paddingTop = "0px";
this.rightBorderNode.style.paddingRight = this.domNode.style.paddingRight;
this.leftBorderNode.style.paddingLeft = this.domNode.style.paddingLeft;
this.domNode.style.padding = "0px 0px 0px 0px";
}
var borderWidth = this.domNode.style.borderWidth;
if (dojo.lang.isString(borderWidth) && borderWidth != "" && borderWidth != "0px" && borderWidth != "0px 0px 0px 0px") {
this.topBorderNode.style.borderStyle = this.rightBorderNode.style.borderStyle = this.bottomBorderNode.style.borderStyle = this.leftBorderNode.style.borderStyle = this.domNode.style.borderStyle;
this.topBorderNode.style.borderColor = this.rightBorderNode.style.borderColor = this.bottomBorderNode.style.borderColor = this.leftBorderNode.style.borderColor = this.domNode.style.borderColor;
this.topBorderNode.style.borderWidth = this.bottomBorderNode.style.borderWidth = borderWidth;
this.topBorderNode.style.borderBottomWidth = "0px";
this.bottomBorderNode.style.borderTopWidth = "0px";
this.rightBorderNode.style.borderRightWidth = this.domNode.style.borderRightWidth;
this.leftBorderNode.style.borderLeftWidth = this.domNode.style.borderLeftWidth;
this.domNode.style.borderWidth = "0px 0px 0px 0px";
}
this._handleMove = new dojo.widget._SliderDragMoveSource(this.sliderHandleNode);
this._handleMove.setParent(this);
if (this.clickSelect) {
dojo.event.connect(this.constrainingContainerNode, "onmousedown", this, "_onClick");
}
if (this.isEnableX) {
this.setValueX(!isNaN(this.initialValueX) ? this.initialValueX : (!isNaN(this.minimumX) ? this.minimumX : 0));
}
if (!this.isEnableX || !this.showButtons) {
this.rightButtonNode.style.width = "1px";
this.rightButtonNode.style.visibility = "hidden";
this.leftButtonNode.style.width = "1px";
this.leftButtonNode.style.visibility = "hidden";
}
if (this.isEnableY) {
this.setValueY(!isNaN(this.initialValueY) ? this.initialValueY : (!isNaN(this.minimumY) ? this.minimumY : 0));
}
if (!this.isEnableY || !this.showButtons) {
this.bottomButtonNode.style.width = "1px";
this.bottomButtonNode.style.visibility = "hidden";
this.topButtonNode.style.width = "1px";
this.topButtonNode.style.visibility = "hidden";
}
if (this.focusNode.addEventListener) {
this.focusNode.addEventListener("DOMMouseScroll", dojo.lang.hitch(this, "_mouseWheeled"), false);
}
}, _snapX:function (x) {
if (x < 0) {
x = 0;
} else {
if (x > this._constraintWidth) {
x = this._constraintWidth;
} else {
var selectedValue = Math.round(x / this._valueSizeX);
x = Math.round(selectedValue * this._valueSizeX);
}
}
this.sliderHandleNode.style.left = x + "px";
if (this.flipX) {
this._clipLeft = x + this._clipXdelta;
} else {
this._clipRight = x + this._clipXdelta;
}
this.progressBackgroundNode.style.clip = "rect(" + this._clipTop + "px," + this._clipRight + "px," + this._clipBottom + "px," + this._clipLeft + "px)";
}, _calc_valueSizeX:function () {
var constrainingCtrBox = dojo.html.getContentBox(this.constrainingContainerNode);
var sliderHandleBox = dojo.html.getContentBox(this.sliderHandleNode);
if (isNaN(constrainingCtrBox.width) || isNaN(sliderHandleBox.width) || constrainingCtrBox.width <= 0 || sliderHandleBox.width <= 0) {
return false;
}
this._constraintWidth = constrainingCtrBox.width + dojo.html.getPadding(this.constrainingContainerNode).width - sliderHandleBox.width;
if (this.flipX) {
this._clipLeft = this._clipRight = constrainingCtrBox.width;
} else {
this._clipLeft = this._clipRight = 0;
}
this._clipXdelta = sliderHandleBox.width >> 1;
if (!this.isEnableY) {
this._clipTop = 0;
this._clipBottom = constrainingCtrBox.height;
}
if (this._constraintWidth <= 0) {
return false;
}
if (this.snapValuesX == 0) {
this.snapValuesX = this._constraintWidth + 1;
}
this._valueSizeX = this._constraintWidth / (this.snapValuesX - 1);
return true;
}, setValueX:function (value) {
if (0 == this._valueSizeX) {
if (this._calc_valueSizeX() == false) {
dojo.lang.setTimeout(this, "setValueX", 100, value);
return;
}
}
if (isNaN(value)) {
value = 0;
}
if (value > this.maximumX) {
value = this.maximumX;
} else {
if (value < this.minimumX) {
value = this.minimumX;
}
}
var pixelPercent = (value - this.minimumX) / (this.maximumX - this.minimumX);
if (this.flipX) {
pixelPercent = 1 - pixelPercent;
}
this._snapX(pixelPercent * this._constraintWidth);
this.notifyListeners();
}, getValueX:function () {
var pixelPercent = dojo.html.getPixelValue(this.sliderHandleNode, "left") / this._constraintWidth;
if (this.flipX) {
pixelPercent = 1 - pixelPercent;
}
return Math.round(pixelPercent * (this.snapValuesX - 1)) * ((this.maximumX - this.minimumX) / (this.snapValuesX - 1)) + this.minimumX;
}, _snapY:function (y) {
if (y < 0) {
y = 0;
} else {
if (y > this._constraintHeight) {
y = this._constraintHeight;
} else {
var selectedValue = Math.round(y / this._valueSizeY);
y = Math.round(selectedValue * this._valueSizeY);
}
}
this.sliderHandleNode.style.top = y + "px";
if (this.flipY) {
this._clipTop = y + this._clipYdelta;
} else {
this._clipBottom = y + this._clipYdelta;
}
this.progressBackgroundNode.style.clip = "rect(" + this._clipTop + "px," + this._clipRight + "px," + this._clipBottom + "px," + this._clipLeft + "px)";
}, _calc_valueSizeY:function () {
var constrainingCtrBox = dojo.html.getContentBox(this.constrainingContainerNode);
var sliderHandleBox = dojo.html.getContentBox(this.sliderHandleNode);
if (isNaN(constrainingCtrBox.height) || isNaN(sliderHandleBox.height) || constrainingCtrBox.height <= 0 || sliderHandleBox.height <= 0) {
return false;
}
this._constraintHeight = constrainingCtrBox.height + dojo.html.getPadding(this.constrainingContainerNode).height - sliderHandleBox.height;
if (this.flipY) {
this._clipTop = this._clipBottom = constrainingCtrBox.height;
} else {
this._clipTop = this._clipBottom = 0;
}
this._clipYdelta = sliderHandleBox.height >> 1;
if (!this.isEnableX) {
this._clipLeft = 0;
this._clipRight = constrainingCtrBox.width;
}
if (this._constraintHeight <= 0) {
return false;
}
if (this.snapValuesY == 0) {
this.snapValuesY = this._constraintHeight + 1;
}
this._valueSizeY = this._constraintHeight / (this.snapValuesY - 1);
return true;
}, setValueY:function (value) {
if (0 == this._valueSizeY) {
if (this._calc_valueSizeY() == false) {
dojo.lang.setTimeout(this, "setValueY", 100, value);
return;
}
}
if (isNaN(value)) {
value = 0;
}
if (value > this.maximumY) {
value = this.maximumY;
} else {
if (value < this.minimumY) {
value = this.minimumY;
}
}
var pixelPercent = (value - this.minimumY) / (this.maximumY - this.minimumY);
if (this.flipY) {
pixelPercent = 1 - pixelPercent;
}
this._snapY(pixelPercent * this._constraintHeight);
this.notifyListeners();
}, getValueY:function () {
var pixelPercent = dojo.html.getPixelValue(this.sliderHandleNode, "top") / this._constraintHeight;
if (this.flipY) {
pixelPercent = 1 - pixelPercent;
}
return Math.round(pixelPercent * (this.snapValuesY - 1)) * ((this.maximumY - this.minimumY) / (this.snapValuesY - 1)) + this.minimumY;
}, _onClick:function (evt) {
if (this._isDragInProgress) {
return;
}
var parent = dojo.html.getAbsolutePosition(this.constrainingContainerNode, true, dojo.html.boxSizing.MARGIN_BOX);
var content = dojo.html.getContentBox(this._handleMove.domNode);
if (this.isEnableX) {
var x = evt.pageX - parent.x - (content.width >> 1);
this._snapX(x);
}
if (this.isEnableY) {
var y = evt.pageY - parent.y - (content.height >> 1);
this._snapY(y);
}
this.notifyListeners();
}, notifyListeners:function () {
this.onValueChanged(this.getValueX(), this.getValueY());
}, onValueChanged:function (x, y) {
}});
dojo.widget.defineWidget("dojo.widget.SliderHorizontal", dojo.widget.Slider, {isEnableX:true, isEnableY:false, initialValue:"", snapValues:"", minimum:"", maximum:"", buttonStyle:"", backgroundSize:"height:10px;width:200px;", backgroundSrc:dojo.uri.moduleUri("dojo.widget", "templates/images/slider-bg.gif"), flip:false, postMixInProperties:function () {
dojo.widget.SliderHorizontal.superclass.postMixInProperties.apply(this, arguments);
if (!isNaN(parseFloat(this.initialValue))) {
this.initialValueX = parseFloat(this.initialValue);
}
if (!isNaN(parseFloat(this.minimum))) {
this.minimumX = parseFloat(this.minimum);
}
if (!isNaN(parseFloat(this.maximum))) {
this.maximumX = parseFloat(this.maximum);
}
if (!isNaN(parseInt(this.snapValues))) {
this.snapValuesX = parseInt(this.snapValues);
}
if (dojo.lang.isString(this.buttonStyle) && this.buttonStyle != "") {
this.buttonStyleX = this.buttonStyle;
}
if (dojo.lang.isBoolean(this.flip)) {
this.flipX = this.flip;
}
}, notifyListeners:function () {
this.onValueChanged(this.getValueX());
}, getValue:function () {
return this.getValueX();
}, setValue:function (value) {
this.setValueX(value);
}, onValueChanged:function (value) {
}});
dojo.widget.defineWidget("dojo.widget.SliderVertical", dojo.widget.Slider, {isEnableX:false, isEnableY:true, initialValue:"", snapValues:"", minimum:"", maximum:"", buttonStyle:"", backgroundSize:"width:10px;height:200px;", backgroundSrc:dojo.uri.moduleUri("dojo.widget", "templates/images/slider-bg-vert.gif"), flip:false, postMixInProperties:function () {
dojo.widget.SliderVertical.superclass.postMixInProperties.apply(this, arguments);
if (!isNaN(parseFloat(this.initialValue))) {
this.initialValueY = parseFloat(this.initialValue);
}
if (!isNaN(parseFloat(this.minimum))) {
this.minimumY = parseFloat(this.minimum);
}
if (!isNaN(parseFloat(this.maximum))) {
this.maximumY = parseFloat(this.maximum);
}
if (!isNaN(parseInt(this.snapValues))) {
this.snapValuesY = parseInt(this.snapValues);
}
if (dojo.lang.isString(this.buttonStyle) && this.buttonStyle != "") {
this.buttonStyleY = this.buttonStyle;
}
if (dojo.lang.isBoolean(this.flip)) {
this.flipY = this.flip;
}
}, notifyListeners:function () {
this.onValueChanged(this.getValueY());
}, getValue:function () {
return this.getValueY();
}, setValue:function (value) {
this.setValueY(value);
}, onValueChanged:function (value) {
}});
dojo.declare("dojo.widget._SliderDragMoveSource", dojo.dnd.HtmlDragMoveSource, {slider:null, onDragStart:function (evt) {
this.slider._isDragInProgress = true;
var dragObj = this.createDragMoveObject();
this.slider.notifyListeners();
return dragObj;
}, onDragEnd:function (evt) {
this.slider._isDragInProgress = false;
this.slider.notifyListeners();
}, createDragMoveObject:function () {
var dragObj = new dojo.widget._SliderDragMoveObject(this.dragObject, this.type);
dragObj.slider = this.slider;
if (this.dragClass) {
dragObj.dragClass = this.dragClass;
}
return dragObj;
}, setParent:function (slider) {
this.slider = slider;
}});
dojo.declare("dojo.widget._SliderDragMoveObject", dojo.dnd.HtmlDragMoveObject, {slider:null, onDragMove:function (evt) {
this.updateDragOffset();
if (this.slider.isEnableX) {
var x = this.dragOffset.x + evt.pageX;
this.slider._snapX(x);
}
if (this.slider.isEnableY) {
var y = this.dragOffset.y + evt.pageY;
this.slider._snapY(y);
}
if (this.slider.activeDrag) {
this.slider.notifyListeners();
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/vml/Chart.js
New file
0,0 → 1,525
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.vml.Chart");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.Chart");
dojo.require("dojo.math");
dojo.require("dojo.html.layout");
dojo.require("dojo.gfx.color");
dojo.widget.defineWidget("dojo.widget.vml.Chart", [dojo.widget.HtmlWidget, dojo.widget.Chart], function () {
this.templatePath = null;
this.templateCssPath = null;
this._isInitialize = false;
this.hasData = false;
this.vectorNode = null;
this.plotArea = null;
this.dataGroup = null;
this.axisGroup = null;
this.properties = {height:0, width:0, defaultWidth:600, defaultHeight:400, plotType:null, padding:{top:10, bottom:2, left:60, right:30}, axes:{x:{plotAt:0, label:"", unitLabel:"", unitType:Number, nUnitsToShow:10, range:{min:0, max:200}}, y:{plotAt:0, label:"", unitLabel:"", unitType:Number, nUnitsToShow:10, range:{min:0, max:200}}}};
}, {parseProperties:function (node) {
var bRangeX = false;
var bRangeY = false;
if (node.getAttribute("width")) {
this.properties.width = node.getAttribute("width");
}
if (node.getAttribute("height")) {
this.properties.height = node.getAttribute("height");
}
if (node.getAttribute("plotType")) {
this.properties.plotType = node.getAttribute("plotType");
}
if (node.getAttribute("padding")) {
if (node.getAttribute("padding").indexOf(",") > -1) {
var p = node.getAttribute("padding").split(",");
} else {
var p = node.getAttribute("padding").split(" ");
}
if (p.length == 1) {
var pad = parseFloat(p[0]);
this.properties.padding.top = pad;
this.properties.padding.right = pad;
this.properties.padding.bottom = pad;
this.properties.padding.left = pad;
} else {
if (p.length == 2) {
var padV = parseFloat(p[0]);
var padH = parseFloat(p[1]);
this.properties.padding.top = padV;
this.properties.padding.right = padH;
this.properties.padding.bottom = padV;
this.properties.padding.left = padH;
} else {
if (p.length == 4) {
this.properties.padding.top = parseFloat(p[0]);
this.properties.padding.right = parseFloat(p[1]);
this.properties.padding.bottom = parseFloat(p[2]);
this.properties.padding.left = parseFloat(p[3]);
}
}
}
}
if (node.getAttribute("rangeX")) {
var p = node.getAttribute("rangeX");
if (p.indexOf(",") > -1) {
p = p.split(",");
} else {
p = p.split(" ");
}
this.properties.axes.x.range.min = parseFloat(p[0]);
this.properties.axes.x.range.max = parseFloat(p[1]);
bRangeX = true;
}
if (node.getAttribute("rangeY")) {
var p = node.getAttribute("rangeY");
if (p.indexOf(",") > -1) {
p = p.split(",");
} else {
p = p.split(" ");
}
this.properties.axes.y.range.min = parseFloat(p[0]);
this.properties.axes.y.range.max = parseFloat(p[1]);
bRangeY = true;
}
return {rangeX:bRangeX, rangeY:bRangeY};
}, setAxesPlot:function (table) {
if (table.getAttribute("axisAt")) {
var p = table.getAttribute("axisAt");
if (p.indexOf(",") > -1) {
p = p.split(",");
} else {
p = p.split(" ");
}
if (!isNaN(parseFloat(p[0]))) {
this.properties.axes.x.plotAt = parseFloat(p[0]);
} else {
if (p[0].toLowerCase() == "ymin") {
this.properties.axes.x.plotAt = this.properties.axes.y.range.min;
} else {
if (p[0].toLowerCase() == "ymax") {
this.properties.axes.x.plotAt = this.properties.axes.y.range.max;
}
}
}
if (!isNaN(parseFloat(p[1]))) {
this.properties.axes.y.plotAt = parseFloat(p[1]);
} else {
if (p[1].toLowerCase() == "xmin") {
this.properties.axes.y.plotAt = this.properties.axes.x.range.min;
} else {
if (p[1].toLowerCase() == "xmax") {
this.properties.axes.y.plotAt = this.properties.axes.x.range.max;
}
}
}
} else {
this.properties.axes.x.plotAt = this.properties.axes.y.range.min;
this.properties.axes.y.plotAt = this.properties.axes.x.range.min;
}
}, drawVectorNode:function () {
if (this.vectorNode) {
this.destroy();
}
this.vectorNode = document.createElement("div");
this.vectorNode.style.width = this.properties.width + "px";
this.vectorNode.style.height = this.properties.height + "px";
this.vectorNode.style.position = "relative";
this.domNode.appendChild(this.vectorNode);
}, drawPlotArea:function () {
var plotWidth = this.properties.width - this.properties.padding.left - this.properties.padding.right;
var plotHeight = this.properties.height - this.properties.padding.top - this.properties.padding.bottom;
if (this.plotArea) {
this.plotArea.parentNode.removeChild(this.plotArea);
this.plotArea = null;
}
this.plotArea = document.createElement("div");
this.plotArea.style.position = "absolute";
this.plotArea.style.backgroundColor = "#fff";
this.plotArea.style.top = (this.properties.padding.top) - 2 + "px";
this.plotArea.style.left = (this.properties.padding.left - 1) + "px";
this.plotArea.style.width = plotWidth + "px";
this.plotArea.style.height = plotHeight + "px";
this.plotArea.style.clip = "rect(0 " + plotWidth + " " + plotHeight + " 0)";
this.vectorNode.appendChild(this.plotArea);
}, drawDataGroup:function () {
var plotWidth = this.properties.width - this.properties.padding.left - this.properties.padding.right;
var plotHeight = this.properties.height - this.properties.padding.top - this.properties.padding.bottom;
if (this.dataGroup) {
this.dataGroup.parentNode.removeChild(this.dataGroup);
this.dataGroup = null;
}
this.dataGroup = document.createElement("div");
this.dataGroup.style.position = "absolute";
this.dataGroup.setAttribute("title", "Data Group");
this.dataGroup.style.top = "0px";
this.dataGroup.style.left = "0px";
this.dataGroup.style.width = plotWidth + "px";
this.dataGroup.style.height = plotHeight + "px";
this.plotArea.appendChild(this.dataGroup);
}, drawAxes:function () {
var plotWidth = this.properties.width - this.properties.padding.left - this.properties.padding.right;
var plotHeight = this.properties.height - this.properties.padding.top - this.properties.padding.bottom;
if (this.axisGroup) {
this.axisGroup.parentNode.removeChild(this.axisGroup);
this.axisGroup = null;
}
this.axisGroup = document.createElement("div");
this.axisGroup.style.position = "absolute";
this.axisGroup.setAttribute("title", "Axis Group");
this.axisGroup.style.top = "0px";
this.axisGroup.style.left = "0px";
this.axisGroup.style.width = plotWidth + "px";
this.axisGroup.style.height = plotHeight + "px";
this.plotArea.appendChild(this.axisGroup);
var stroke = 1;
var line = document.createElement("v:line");
var y = dojo.widget.vml.Chart.Plotter.getY(this.properties.axes.x.plotAt, this);
line.setAttribute("from", "0px," + y + "px");
line.setAttribute("to", plotWidth + "px," + y + "px");
line.style.position = "absolute";
line.style.top = "0px";
line.style.left = "0px";
line.style.antialias = "false";
line.setAttribute("strokecolor", "#666");
line.setAttribute("strokeweight", stroke * 2 + "px");
this.axisGroup.appendChild(line);
var line = document.createElement("v:line");
var x = dojo.widget.vml.Chart.Plotter.getX(this.properties.axes.y.plotAt, this);
line.setAttribute("from", x + "px,0px");
line.setAttribute("to", x + "px," + plotHeight + "px");
line.style.position = "absolute";
line.style.top = "0px";
line.style.left = "0px";
line.style.antialias = "false";
line.setAttribute("strokecolor", "#666");
line.setAttribute("strokeweight", stroke * 2 + "px");
this.axisGroup.appendChild(line);
var size = 10;
var t = document.createElement("div");
t.style.position = "absolute";
t.style.top = (this.properties.height - this.properties.padding.bottom) + "px";
t.style.left = this.properties.padding.left + "px";
t.style.fontFamily = "sans-serif";
t.style.fontSize = size + "px";
t.innerHTML = dojo.math.round(parseFloat(this.properties.axes.x.range.min), 2);
this.vectorNode.appendChild(t);
t = document.createElement("div");
t.style.position = "absolute";
t.style.top = (this.properties.height - this.properties.padding.bottom) + "px";
t.style.left = (this.properties.width - this.properties.padding.right - size) + "px";
t.style.fontFamily = "sans-serif";
t.style.fontSize = size + "px";
t.innerHTML = dojo.math.round(parseFloat(this.properties.axes.x.range.max), 2);
this.vectorNode.appendChild(t);
t = document.createElement("div");
t.style.position = "absolute";
t.style.top = (size / 2) + "px";
t.style.left = "0px";
t.style.width = this.properties.padding.left + "px";
t.style.textAlign = "right";
t.style.paddingRight = "4px";
t.style.fontFamily = "sans-serif";
t.style.fontSize = size + "px";
t.innerHTML = dojo.math.round(parseFloat(this.properties.axes.y.range.max), 2);
this.vectorNode.appendChild(t);
t = document.createElement("div");
t.style.position = "absolute";
t.style.top = (this.properties.height - this.properties.padding.bottom - size) + "px";
t.style.left = "0px";
t.style.width = this.properties.padding.left + "px";
t.style.textAlign = "right";
t.style.paddingRight = "4px";
t.style.fontFamily = "sans-serif";
t.style.fontSize = size + "px";
t.innerHTML = dojo.math.round(parseFloat(this.properties.axes.y.range.min), 2);
this.vectorNode.appendChild(t);
}, init:function () {
if (!this.properties.width || !this.properties.height) {
var box = dojo.html.getContentBox(this.domNode);
if (!this.properties.width) {
this.properties.width = (box.width < 32) ? this.properties.defaultWidth : box.width;
}
if (!this.properties.height) {
this.properties.height = (box.height < 32) ? this.properties.defaultHeight : box.height;
}
}
this.drawVectorNode();
this.drawPlotArea();
this.drawDataGroup();
this.drawAxes();
this.assignColors();
this._isInitialized = true;
}, destroy:function () {
while (this.domNode.childNodes.length > 0) {
this.domNode.removeChild(this.domNode.childNodes[0]);
}
this.vectorNode = this.plotArea = this.dataGroup = this.axisGroup = null;
}, render:function () {
if (this.dataGroup) {
while (this.dataGroup.childNodes.length > 0) {
this.dataGroup.removeChild(this.dataGroup.childNodes[0]);
}
} else {
this.init();
}
for (var i = 0; i < this.series.length; i++) {
dojo.widget.vml.Chart.Plotter.plot(this.series[i], this);
}
}, postCreate:function () {
var table = this.domNode.getElementsByTagName("table")[0];
if (table) {
var ranges = this.parseProperties(table);
var bRangeX = false;
var bRangeY = false;
var axisValues = this.parseData(table);
if (!bRangeX) {
this.properties.axes.x.range = {min:axisValues.x.min, max:axisValues.x.max};
}
if (!bRangeY) {
this.properties.axes.y.range = {min:axisValues.y.min, max:axisValues.y.max};
}
this.setAxesPlot(table);
this.domNode.removeChild(table);
}
if (this.series.length > 0) {
this.render();
}
}});
dojo.widget.vml.Chart.Plotter = new function () {
var self = this;
var plotters = {};
var types = dojo.widget.Chart.PlotTypes;
this.getX = function (value, chart) {
var v = parseFloat(value);
var min = chart.properties.axes.x.range.min;
var max = chart.properties.axes.x.range.max;
var ofst = 0 - min;
min += ofst;
max += ofst;
v += ofst;
var xmin = 0;
var xmax = chart.properties.width - chart.properties.padding.left - chart.properties.padding.right;
var x = (v * ((xmax - xmin) / max)) + xmin;
return x;
};
this.getY = function (value, chart) {
var v = parseFloat(value);
var max = chart.properties.axes.y.range.max;
var min = chart.properties.axes.y.range.min;
var ofst = 0;
if (min < 0) {
ofst += Math.abs(min);
}
min += ofst;
max += ofst;
v += ofst;
var ymin = chart.properties.height - chart.properties.padding.top - chart.properties.padding.bottom;
var ymax = 0;
var y = (((ymin - ymax) / (max - min)) * (max - v)) + ymax;
return y;
};
this.addPlotter = function (name, func) {
plotters[name] = func;
};
this.plot = function (series, chart) {
if (series.values.length == 0) {
return;
}
if (series.plotType && plotters[series.plotType]) {
return plotters[series.plotType](series, chart);
} else {
if (chart.plotType && plotters[chart.plotType]) {
return plotters[chart.plotType](series, chart);
}
}
};
plotters["bar"] = function (series, chart) {
var space = 1;
var lastW = 0;
var ys = [];
var yAxis = self.getY(chart.properties.axes.x.plotAt, chart);
var yA = yAxis;
for (var i = 0; i < series.values.length; i++) {
var x = self.getX(series.values[i].x, chart);
var w;
if (i == series.values.length - 1) {
w = lastW;
} else {
w = self.getX(series.values[i + 1].x, chart) - x - space;
lastW = w;
}
x -= (w / 2);
var y = self.getY(series.values[i].value, chart);
var h = Math.abs(yA - y);
if (parseFloat(series.values[i].value) < chart.properties.axes.x.plotAt) {
y = yA;
}
var bar = document.createElement("v:rect");
bar.style.position = "absolute";
bar.style.top = y + "px";
bar.style.left = x + "px";
bar.style.width = w + "px";
bar.style.height = h + "px";
bar.setAttribute("fillColor", series.color);
bar.setAttribute("stroked", "false");
bar.style.antialias = "false";
bar.setAttribute("title", series.label + " (" + i + "): " + series.values[i].value);
var fill = document.createElement("v:fill");
fill.setAttribute("opacity", "0.9");
bar.appendChild(fill);
chart.dataGroup.appendChild(bar);
}
};
plotters["line"] = function (series, chart) {
var tension = 1.5;
var line = document.createElement("v:shape");
line.setAttribute("strokeweight", "2px");
line.setAttribute("strokecolor", series.color);
line.setAttribute("fillcolor", "none");
line.setAttribute("filled", "false");
line.setAttribute("title", series.label);
line.setAttribute("coordsize", chart.properties.width + "," + chart.properties.height);
line.style.position = "absolute";
line.style.top = "0px";
line.style.left = "0px";
line.style.width = chart.properties.width + "px";
line.style.height = chart.properties.height + "px";
var stroke = document.createElement("v:stroke");
stroke.setAttribute("opacity", "0.85");
line.appendChild(stroke);
var path = [];
for (var i = 0; i < series.values.length; i++) {
var x = Math.round(self.getX(series.values[i].x, chart));
var y = Math.round(self.getY(series.values[i].value, chart));
if (i == 0) {
path.push("m");
path.push(x + "," + y);
} else {
var lastx = Math.round(self.getX(series.values[i - 1].x, chart));
var lasty = Math.round(self.getY(series.values[i - 1].value, chart));
var dx = x - lastx;
var dy = y - lasty;
path.push("c");
var cx = Math.round((x - (tension - 1) * (dx / tension)));
path.push(cx + "," + lasty);
cx = Math.round((x - (dx / tension)));
path.push(cx + "," + y);
path.push(x + "," + y);
}
}
line.setAttribute("path", path.join(" ") + " e");
chart.dataGroup.appendChild(line);
};
plotters["area"] = function (series, chart) {
var tension = 1.5;
var line = document.createElement("v:shape");
line.setAttribute("strokeweight", "1px");
line.setAttribute("strokecolor", series.color);
line.setAttribute("fillcolor", series.color);
line.setAttribute("title", series.label);
line.setAttribute("coordsize", chart.properties.width + "," + chart.properties.height);
line.style.position = "absolute";
line.style.top = "0px";
line.style.left = "0px";
line.style.width = chart.properties.width + "px";
line.style.height = chart.properties.height + "px";
var stroke = document.createElement("v:stroke");
stroke.setAttribute("opacity", "0.8");
line.appendChild(stroke);
var fill = document.createElement("v:fill");
fill.setAttribute("opacity", "0.4");
line.appendChild(fill);
var path = [];
for (var i = 0; i < series.values.length; i++) {
var x = Math.round(self.getX(series.values[i].x, chart));
var y = Math.round(self.getY(series.values[i].value, chart));
if (i == 0) {
path.push("m");
path.push(x + "," + y);
} else {
var lastx = Math.round(self.getX(series.values[i - 1].x, chart));
var lasty = Math.round(self.getY(series.values[i - 1].value, chart));
var dx = x - lastx;
var dy = y - lasty;
path.push("c");
var cx = Math.round((x - (tension - 1) * (dx / tension)));
path.push(cx + "," + lasty);
cx = Math.round((x - (dx / tension)));
path.push(cx + "," + y);
path.push(x + "," + y);
}
}
path.push("l");
path.push(x + "," + self.getY(0, chart));
path.push("l");
path.push(self.getX(0, chart) + "," + self.getY(0, chart));
line.setAttribute("path", path.join(" ") + " x e");
chart.dataGroup.appendChild(line);
};
plotters["scatter"] = function (series, chart) {
var r = 6;
for (var i = 0; i < series.values.length; i++) {
var x = self.getX(series.values[i].x, chart);
var y = self.getY(series.values[i].value, chart);
var mod = r / 2;
var point = document.createElement("v:rect");
point.setAttribute("fillcolor", series.color);
point.setAttribute("strokecolor", series.color);
point.setAttribute("title", series.label + ": " + series.values[i].value);
point.style.position = "absolute";
point.style.rotation = "45";
point.style.top = (y - mod) + "px";
point.style.left = (x - mod) + "px";
point.style.width = r + "px";
point.style.height = r + "px";
var fill = document.createElement("v:fill");
fill.setAttribute("opacity", "0.6");
point.appendChild(fill);
chart.dataGroup.appendChild(point);
}
};
plotters["bubble"] = function (series, chart) {
var minR = 1;
var min = chart.properties.axes.x.range.min;
var max = chart.properties.axes.x.range.max;
var ofst = 0 - min;
min += ofst;
max += ofst;
var xmin = chart.properties.padding.left;
var xmax = chart.properties.width - chart.properties.padding.right;
var factor = (max - min) / (xmax - xmin) * 25;
for (var i = 0; i < series.values.length; i++) {
var size = series.values[i].size;
if (isNaN(parseFloat(size))) {
size = minR;
}
var radius = (parseFloat(size) * factor) / 2;
var diameter = radius * 2;
var cx = self.getX(series.values[i].x, chart);
var cy = self.getY(series.values[i].value, chart);
var top = cy - radius;
var left = cx - radius;
var point = document.createElement("v:oval");
point.setAttribute("fillcolor", series.color);
point.setAttribute("title", series.label + ": " + series.values[i].value + " (" + size + ")");
point.setAttribute("stroked", "false");
point.style.position = "absolute";
point.style.top = top + "px";
point.style.left = left + "px";
point.style.width = diameter + "px";
point.style.height = diameter + "px";
var fill = document.createElement("v:fill");
fill.setAttribute("opacity", "0.8");
point.appendChild(fill);
chart.dataGroup.appendChild(point);
}
};
}();
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/SortableTable.js
New file
0,0 → 1,498
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.SortableTable");
dojo.deprecated("SortableTable will be removed in favor of FilteringTable.", "0.5");
dojo.require("dojo.lang.common");
dojo.require("dojo.date.format");
dojo.require("dojo.html.*");
dojo.require("dojo.html.selection");
dojo.require("dojo.html.util");
dojo.require("dojo.html.style");
dojo.require("dojo.event.*");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.widget.defineWidget("dojo.widget.SortableTable", dojo.widget.HtmlWidget, function () {
this.data = [];
this.selected = [];
this.columns = [];
}, {enableMultipleSelect:false, maximumNumberOfSelections:0, enableAlternateRows:false, minRows:0, defaultDateFormat:"%D", sortIndex:0, sortDirection:0, valueField:"Id", headClass:"", tbodyClass:"", headerClass:"", headerSortUpClass:"selected", headerSortDownClass:"selected", rowClass:"", rowAlternateClass:"alt", rowSelectedClass:"selected", columnSelected:"sorted-column", isContainer:false, templatePath:null, templateCssPath:null, getTypeFromString:function (s) {
var parts = s.split("."), i = 0, obj = dj_global;
do {
obj = obj[parts[i++]];
} while (i < parts.length && obj);
return (obj != dj_global) ? obj : null;
}, compare:function (o1, o2) {
for (var p in o1) {
if (!(p in o2)) {
return false;
}
if (o1[p].valueOf() != o2[p].valueOf()) {
return false;
}
}
return true;
}, isSelected:function (o) {
for (var i = 0; i < this.selected.length; i++) {
if (this.compare(this.selected[i], o)) {
return true;
}
}
return false;
}, removeFromSelected:function (o) {
var idx = -1;
for (var i = 0; i < this.selected.length; i++) {
if (this.compare(this.selected[i], o)) {
idx = i;
break;
}
}
if (idx >= 0) {
this.selected.splice(idx, 1);
}
}, getSelection:function () {
return this.selected;
}, getValue:function () {
var a = [];
for (var i = 0; i < this.selected.length; i++) {
if (this.selected[i][this.valueField]) {
a.push(this.selected[i][this.valueField]);
}
}
return a.join();
}, reset:function () {
this.columns = [];
this.data = [];
this.resetSelections(this.domNode.getElementsByTagName("tbody")[0]);
}, resetSelections:function (body) {
this.selected = [];
var idx = 0;
var rows = body.getElementsByTagName("tr");
for (var i = 0; i < rows.length; i++) {
if (rows[i].parentNode == body) {
rows[i].removeAttribute("selected");
if (this.enableAlternateRows && idx % 2 == 1) {
rows[i].className = this.rowAlternateClass;
} else {
rows[i].className = "";
}
idx++;
}
}
}, getObjectFromRow:function (row) {
var cells = row.getElementsByTagName("td");
var o = {};
for (var i = 0; i < this.columns.length; i++) {
if (this.columns[i].sortType == "__markup__") {
o[this.columns[i].getField()] = cells[i].innerHTML;
} else {
var text = dojo.html.renderedTextContent(cells[i]);
var val = text;
if (this.columns[i].getType() != String) {
var val = new (this.columns[i].getType())(text);
}
o[this.columns[i].getField()] = val;
}
}
if (dojo.html.hasAttribute(row, "value")) {
o[this.valueField] = dojo.html.getAttribute(row, "value");
}
return o;
}, setSelectionByRow:function (row) {
var o = this.getObjectFromRow(row);
var b = false;
for (var i = 0; i < this.selected.length; i++) {
if (this.compare(this.selected[i], o)) {
b = true;
break;
}
}
if (!b) {
this.selected.push(o);
}
}, parseColumns:function (node) {
this.reset();
var row = node.getElementsByTagName("tr")[0];
var cells = row.getElementsByTagName("td");
if (cells.length == 0) {
cells = row.getElementsByTagName("th");
}
for (var i = 0; i < cells.length; i++) {
var o = {field:null, format:null, noSort:false, sortType:"String", dataType:String, sortFunction:null, label:null, align:"left", valign:"middle", getField:function () {
return this.field || this.label;
}, getType:function () {
return this.dataType;
}};
if (dojo.html.hasAttribute(cells[i], "align")) {
o.align = dojo.html.getAttribute(cells[i], "align");
}
if (dojo.html.hasAttribute(cells[i], "valign")) {
o.valign = dojo.html.getAttribute(cells[i], "valign");
}
if (dojo.html.hasAttribute(cells[i], "nosort")) {
o.noSort = dojo.html.getAttribute(cells[i], "nosort") == "true";
}
if (dojo.html.hasAttribute(cells[i], "sortusing")) {
var trans = dojo.html.getAttribute(cells[i], "sortusing");
var f = this.getTypeFromString(trans);
if (f != null && f != window && typeof (f) == "function") {
o.sortFunction = f;
}
}
if (dojo.html.hasAttribute(cells[i], "field")) {
o.field = dojo.html.getAttribute(cells[i], "field");
}
if (dojo.html.hasAttribute(cells[i], "format")) {
o.format = dojo.html.getAttribute(cells[i], "format");
}
if (dojo.html.hasAttribute(cells[i], "dataType")) {
var sortType = dojo.html.getAttribute(cells[i], "dataType");
if (sortType.toLowerCase() == "html" || sortType.toLowerCase() == "markup") {
o.sortType = "__markup__";
o.noSort = true;
} else {
var type = this.getTypeFromString(sortType);
if (type) {
o.sortType = sortType;
o.dataType = type;
}
}
}
o.label = dojo.html.renderedTextContent(cells[i]);
this.columns.push(o);
if (dojo.html.hasAttribute(cells[i], "sort")) {
this.sortIndex = i;
var dir = dojo.html.getAttribute(cells[i], "sort");
if (!isNaN(parseInt(dir))) {
dir = parseInt(dir);
this.sortDirection = (dir != 0) ? 1 : 0;
} else {
this.sortDirection = (dir.toLowerCase() == "desc") ? 1 : 0;
}
}
}
}, parseData:function (data) {
this.data = [];
this.selected = [];
for (var i = 0; i < data.length; i++) {
var o = {};
for (var j = 0; j < this.columns.length; j++) {
var field = this.columns[j].getField();
if (this.columns[j].sortType == "__markup__") {
o[field] = String(data[i][field]);
} else {
var type = this.columns[j].getType();
var val = data[i][field];
var t = this.columns[j].sortType.toLowerCase();
if (type == String) {
o[field] = val;
} else {
if (val != null) {
o[field] = new type(val);
} else {
o[field] = new type();
}
}
}
}
if (data[i][this.valueField] && !o[this.valueField]) {
o[this.valueField] = data[i][this.valueField];
}
this.data.push(o);
}
}, parseDataFromTable:function (tbody) {
this.data = [];
this.selected = [];
var rows = tbody.getElementsByTagName("tr");
for (var i = 0; i < rows.length; i++) {
if (dojo.html.getAttribute(rows[i], "ignoreIfParsed") == "true") {
continue;
}
var o = {};
var cells = rows[i].getElementsByTagName("td");
for (var j = 0; j < this.columns.length; j++) {
var field = this.columns[j].getField();
if (this.columns[j].sortType == "__markup__") {
o[field] = cells[j].innerHTML;
} else {
var type = this.columns[j].getType();
var val = dojo.html.renderedTextContent(cells[j]);
if (type == String) {
o[field] = val;
} else {
if (val != null) {
o[field] = new type(val);
} else {
o[field] = new type();
}
}
}
}
if (dojo.html.hasAttribute(rows[i], "value") && !o[this.valueField]) {
o[this.valueField] = dojo.html.getAttribute(rows[i], "value");
}
this.data.push(o);
if (dojo.html.getAttribute(rows[i], "selected") == "true") {
this.selected.push(o);
}
}
}, showSelections:function () {
var body = this.domNode.getElementsByTagName("tbody")[0];
var rows = body.getElementsByTagName("tr");
var idx = 0;
for (var i = 0; i < rows.length; i++) {
if (rows[i].parentNode == body) {
if (dojo.html.getAttribute(rows[i], "selected") == "true") {
rows[i].className = this.rowSelectedClass;
} else {
if (this.enableAlternateRows && idx % 2 == 1) {
rows[i].className = this.rowAlternateClass;
} else {
rows[i].className = "";
}
}
idx++;
}
}
}, render:function (bDontPreserve) {
var data = [];
var body = this.domNode.getElementsByTagName("tbody")[0];
if (!bDontPreserve) {
this.parseDataFromTable(body);
}
for (var i = 0; i < this.data.length; i++) {
data.push(this.data[i]);
}
var col = this.columns[this.sortIndex];
if (!col.noSort) {
var field = col.getField();
if (col.sortFunction) {
var sort = col.sortFunction;
} else {
var sort = function (a, b) {
if (a[field] > b[field]) {
return 1;
}
if (a[field] < b[field]) {
return -1;
}
return 0;
};
}
data.sort(sort);
if (this.sortDirection != 0) {
data.reverse();
}
}
while (body.childNodes.length > 0) {
body.removeChild(body.childNodes[0]);
}
for (var i = 0; i < data.length; i++) {
var row = document.createElement("tr");
dojo.html.disableSelection(row);
if (data[i][this.valueField]) {
row.setAttribute("value", data[i][this.valueField]);
}
if (this.isSelected(data[i])) {
row.className = this.rowSelectedClass;
row.setAttribute("selected", "true");
} else {
if (this.enableAlternateRows && i % 2 == 1) {
row.className = this.rowAlternateClass;
}
}
for (var j = 0; j < this.columns.length; j++) {
var cell = document.createElement("td");
cell.setAttribute("align", this.columns[j].align);
cell.setAttribute("valign", this.columns[j].valign);
dojo.html.disableSelection(cell);
if (this.sortIndex == j) {
cell.className = this.columnSelected;
}
if (this.columns[j].sortType == "__markup__") {
cell.innerHTML = data[i][this.columns[j].getField()];
for (var k = 0; k < cell.childNodes.length; k++) {
var node = cell.childNodes[k];
if (node && node.nodeType == dojo.html.ELEMENT_NODE) {
dojo.html.disableSelection(node);
}
}
} else {
if (this.columns[j].getType() == Date) {
var format = this.defaultDateFormat;
if (this.columns[j].format) {
format = this.columns[j].format;
}
cell.appendChild(document.createTextNode(dojo.date.strftime(data[i][this.columns[j].getField()], format)));
} else {
cell.appendChild(document.createTextNode(data[i][this.columns[j].getField()]));
}
}
row.appendChild(cell);
}
body.appendChild(row);
dojo.event.connect(row, "onclick", this, "onUISelect");
}
var minRows = parseInt(this.minRows);
if (!isNaN(minRows) && minRows > 0 && data.length < minRows) {
var mod = 0;
if (data.length % 2 == 0) {
mod = 1;
}
var nRows = minRows - data.length;
for (var i = 0; i < nRows; i++) {
var row = document.createElement("tr");
row.setAttribute("ignoreIfParsed", "true");
if (this.enableAlternateRows && i % 2 == mod) {
row.className = this.rowAlternateClass;
}
for (var j = 0; j < this.columns.length; j++) {
var cell = document.createElement("td");
cell.appendChild(document.createTextNode("\xa0"));
row.appendChild(cell);
}
body.appendChild(row);
}
}
}, onSelect:function (e) {
}, onUISelect:function (e) {
var row = dojo.html.getParentByType(e.target, "tr");
var body = dojo.html.getParentByType(row, "tbody");
if (this.enableMultipleSelect) {
if (e.metaKey || e.ctrlKey) {
if (this.isSelected(this.getObjectFromRow(row))) {
this.removeFromSelected(this.getObjectFromRow(row));
row.removeAttribute("selected");
} else {
this.setSelectionByRow(row);
row.setAttribute("selected", "true");
}
} else {
if (e.shiftKey) {
var startRow;
var rows = body.getElementsByTagName("tr");
for (var i = 0; i < rows.length; i++) {
if (rows[i].parentNode == body) {
if (rows[i] == row) {
break;
}
if (dojo.html.getAttribute(rows[i], "selected") == "true") {
startRow = rows[i];
}
}
}
if (!startRow) {
startRow = row;
for (; i < rows.length; i++) {
if (dojo.html.getAttribute(rows[i], "selected") == "true") {
row = rows[i];
break;
}
}
}
this.resetSelections(body);
if (startRow == row) {
row.setAttribute("selected", "true");
this.setSelectionByRow(row);
} else {
var doSelect = false;
for (var i = 0; i < rows.length; i++) {
if (rows[i].parentNode == body) {
rows[i].removeAttribute("selected");
if (rows[i] == startRow) {
doSelect = true;
}
if (doSelect) {
this.setSelectionByRow(rows[i]);
rows[i].setAttribute("selected", "true");
}
if (rows[i] == row) {
doSelect = false;
}
}
}
}
} else {
this.resetSelections(body);
row.setAttribute("selected", "true");
this.setSelectionByRow(row);
}
}
} else {
this.resetSelections(body);
row.setAttribute("selected", "true");
this.setSelectionByRow(row);
}
this.showSelections();
this.onSelect(e);
e.stopPropagation();
e.preventDefault();
}, onHeaderClick:function (e) {
var oldIndex = this.sortIndex;
var oldDirection = this.sortDirection;
var source = e.target;
var row = dojo.html.getParentByType(source, "tr");
var cellTag = "td";
if (row.getElementsByTagName(cellTag).length == 0) {
cellTag = "th";
}
var headers = row.getElementsByTagName(cellTag);
var header = dojo.html.getParentByType(source, cellTag);
for (var i = 0; i < headers.length; i++) {
if (headers[i] == header) {
if (i != oldIndex) {
this.sortIndex = i;
this.sortDirection = 0;
headers[i].className = this.headerSortDownClass;
} else {
this.sortDirection = (oldDirection == 0) ? 1 : 0;
if (this.sortDirection == 0) {
headers[i].className = this.headerSortDownClass;
} else {
headers[i].className = this.headerSortUpClass;
}
}
} else {
headers[i].className = this.headerClass;
}
}
this.render();
}, postCreate:function () {
var thead = this.domNode.getElementsByTagName("thead")[0];
if (this.headClass.length > 0) {
thead.className = this.headClass;
}
dojo.html.disableSelection(this.domNode);
this.parseColumns(thead);
var header = "td";
if (thead.getElementsByTagName(header).length == 0) {
header = "th";
}
var headers = thead.getElementsByTagName(header);
for (var i = 0; i < headers.length; i++) {
if (!this.columns[i].noSort) {
dojo.event.connect(headers[i], "onclick", this, "onHeaderClick");
}
if (this.sortIndex == i) {
if (this.sortDirection == 0) {
headers[i].className = this.headerSortDownClass;
} else {
headers[i].className = this.headerSortUpClass;
}
}
}
var tbody = this.domNode.getElementsByTagName("tbody")[0];
if (this.tbodyClass.length > 0) {
tbody.className = this.tbodyClass;
}
this.parseDataFromTable(tbody);
this.render(true);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/MonthlyCalendar.js
New file
0,0 → 1,147
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.MonthlyCalendar");
dojo.require("dojo.date.common");
dojo.require("dojo.date.format");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.DatePicker");
dojo.require("dojo.event.*");
dojo.require("dojo.html.*");
dojo.require("dojo.experimental");
dojo.experimental("dojo.widget.MonthlyCalendar");
dojo.widget.defineWidget("dojo.widget.MonthlyCalendar", dojo.widget.DatePicker, {dayWidth:"wide", templateString:"<div class=\"datePickerContainer\" dojoAttachPoint=\"datePickerContainerNode\">\n\t<h3 class=\"monthLabel\">\n\t<!--\n\t<span \n\t\tdojoAttachPoint=\"decreaseWeekNode\" \n\t\tdojoAttachEvent=\"onClick: onIncrementWeek;\" \n\t\tclass=\"incrementControl\">\n\t\t<img src=\"${dojoWidgetModuleUri}templates/decrementWeek.gif\" alt=\"&uarr;\" />\n\t</span>\n\t-->\n\t<span \n\t\tdojoAttachPoint=\"decreaseMonthNode\" \n\t\tdojoAttachEvent=\"onClick: onIncrementMonth;\" class=\"incrementControl\">\n\t\t<img src=\"${dojoWidgetModuleUri}templates/decrementMonth.gif\" \n\t\t\talt=\"&uarr;\" dojoAttachPoint=\"decrementMonthImageNode\">\n\t</span>\n\t<span dojoAttachPoint=\"monthLabelNode\" class=\"month\">July</span>\n\t<span \n\t\tdojoAttachPoint=\"increaseMonthNode\" \n\t\tdojoAttachEvent=\"onClick: onIncrementMonth;\" class=\"incrementControl\">\n\t\t<img src=\"${dojoWidgetModuleUri}templates/incrementMonth.gif\" \n\t\t\talt=\"&darr;\" dojoAttachPoint=\"incrementMonthImageNode\">\n\t</span>\n\t<!--\n\t\t<span dojoAttachPoint=\"increaseWeekNode\" \n\t\t\tdojoAttachEvent=\"onClick: onIncrementWeek;\" \n\t\t\tclass=\"incrementControl\">\n\t\t\t<img src=\"${dojoWidgetModuleUri}templates/incrementWeek.gif\" \n\t\t\talt=\"&darr;\" />\n\t\t</span>\n\t-->\n\t</h3>\n\t<table class=\"calendarContainer\">\n\t\t<thead>\n\t\t\t<tr dojoAttachPoint=\"dayLabelsRow\">\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t</tr>\n\t\t</thead>\n\t\t<tbody dojoAttachPoint=\"calendarDatesContainerNode\" \n\t\t\tdojoAttachEvent=\"onClick: onSetDate;\">\n\t\t\t<tr dojoAttachPoint=\"calendarRow0\">\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t</tr>\n\t\t\t<tr dojoAttachPoint=\"calendarRow1\">\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t</tr>\n\t\t\t<tr dojoAttachPoint=\"calendarRow2\">\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t</tr>\n\t\t\t<tr dojoAttachPoint=\"calendarRow3\">\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t</tr>\n\t\t\t<tr dojoAttachPoint=\"calendarRow4\">\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t</tr>\n\t\t\t<tr dojoAttachPoint=\"calendarRow5\">\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t</table>\n\t<h3 class=\"yearLabel\">\n\t\t<span dojoAttachPoint=\"previousYearLabelNode\"\n\t\t\tdojoAttachEvent=\"onClick: onIncrementYear;\" class=\"previousYear\"></span>\n\t\t<span class=\"selectedYear\" dojoAttachPoint=\"currentYearLabelNode\"></span>\n\t\t<span dojoAttachPoint=\"nextYearLabelNode\" \n\t\t\tdojoAttachEvent=\"onClick: onIncrementYear;\" class=\"nextYear\"></span>\n\t</h3>\n</div>\n", templateCssString:".datePickerContainer {\n\tmargin:0.5em 2em 0.5em 0;\n\t/*width:10em;*/\n\tfloat:left;\n}\n\n.previousMonth {\n\tbackground-color:#bbbbbb;\n}\n\n.currentMonth {\n\tbackground-color:#8f8f8f;\n}\n\n.nextMonth {\n\tbackground-color:#eeeeee;\n}\n\n.currentDate {\n\ttext-decoration:underline;\n\tfont-style:italic;\n}\n\n.selectedItem {\n\tbackground-color:#3a3a3a;\n\tcolor:#ffffff;\n}\n\n.calendarContainer {\n\tborder-collapse:collapse;\n\tborder-spacing:0;\n\tborder-bottom:1px solid #e6e6e6;\n\toverflow: hidden;\n\ttext-align: right;\n}\n\n.calendarContainer thead{\n\tborder-bottom:1px solid #e6e6e6;\n}\n\n.calendarContainer tbody * td {\n height: 100px;\n border: 1px solid gray;\n}\n\n.calendarContainer td {\n width: 100px;\n padding: 2px;\n\tvertical-align: top;\n}\n\n.monthLabel {\n\tfont-size:0.9em;\n\tfont-weight:400;\n\tmargin:0;\n\ttext-align:center;\n}\n\n.monthLabel .month {\n\tpadding:0 0.4em 0 0.4em;\n}\n\n.yearLabel {\n\tfont-size:0.9em;\n\tfont-weight:400;\n\tmargin:0.25em 0 0 0;\n\ttext-align:right;\n\tcolor:#a3a3a3;\n}\n\n.yearLabel .selectedYear {\n\tcolor:#000;\n\tpadding:0 0.2em;\n}\n\n.nextYear, .previousYear {\n\tcursor:pointer;cursor:hand;\n}\n\n.incrementControl {\n\tcursor:pointer;cursor:hand;\n\twidth:1em;\n}\n\n.dojoMonthlyCalendarEvent {\n\tfont-size:0.7em;\n\toverflow: hidden;\n\tfont-color: grey;\n\twhite-space: nowrap;\n\ttext-align: left;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/MonthlyCalendar.css"), initializer:function () {
this.iCalendars = [];
}, addCalendar:function (cal) {
dojo.debug("Adding Calendar");
this.iCalendars.push(cal);
dojo.debug("Starting init");
this.initUI();
dojo.debug("done init");
}, createDayContents:function (node, mydate) {
dojo.html.removeChildren(node);
node.appendChild(document.createTextNode(mydate.getDate()));
for (var x = 0; x < this.iCalendars.length; x++) {
var evts = this.iCalendars[x].getEvents(mydate);
if ((dojo.lang.isArray(evts)) && (evts.length > 0)) {
for (var y = 0; y < evts.length; y++) {
var el = document.createElement("div");
dojo.html.addClass(el, "dojoMonthlyCalendarEvent");
el.appendChild(document.createTextNode(evts[y].summary.value));
el.width = dojo.html.getContentBox(node).width;
node.appendChild(el);
}
}
}
}, initUI:function () {
var dayLabels = dojo.date.getNames("days", this.dayWidth, "standAlone", this.lang);
var dayLabelNodes = this.dayLabelsRow.getElementsByTagName("td");
for (var i = 0; i < 7; i++) {
dayLabelNodes.item(i).innerHTML = dayLabels[i];
}
this.selectedIsUsed = false;
this.currentIsUsed = false;
var currentClassName = "";
var previousDate = new Date();
var calendarNodes = this.calendarDatesContainerNode.getElementsByTagName("td");
var currentCalendarNode;
previousDate.setHours(8);
var nextDate = new Date(this.firstSaturday.year, this.firstSaturday.month, this.firstSaturday.date, 8);
var lastDay = new Date(this.firstSaturday.year, this.firstSaturday.month, this.firstSaturday.date + 42, 8);
if (this.iCalendars.length > 0) {
for (var x = 0; x < this.iCalendars.length; x++) {
this.iCalendars[x].preComputeRecurringEvents(lastDay);
}
}
if (this.firstSaturday.date < 7) {
var dayInWeek = 6;
for (var i = this.firstSaturday.date; i > 0; i--) {
currentCalendarNode = calendarNodes.item(dayInWeek);
this.createDayContents(currentCalendarNode, nextDate);
dojo.html.setClass(currentCalendarNode, this.getDateClassName(nextDate, "current"));
dayInWeek--;
previousDate = nextDate;
nextDate = this.incrementDate(nextDate, false);
}
for (var i = dayInWeek; i > -1; i--) {
currentCalendarNode = calendarNodes.item(i);
this.createDayContents(currentCalendarNode, nextDate);
dojo.html.setClass(currentCalendarNode, this.getDateClassName(nextDate, "previous"));
previousDate = nextDate;
nextDate = this.incrementDate(nextDate, false);
}
} else {
nextDate.setDate(1);
for (var i = 0; i < 7; i++) {
currentCalendarNode = calendarNodes.item(i);
this.createDayContents(currentCalendarNode, nextDate);
dojo.html.setClass(currentCalendarNode, this.getDateClassName(nextDate, "current"));
previousDate = nextDate;
nextDate = this.incrementDate(nextDate, true);
}
}
previousDate.setDate(this.firstSaturday.date);
previousDate.setMonth(this.firstSaturday.month);
previousDate.setFullYear(this.firstSaturday.year);
nextDate = this.incrementDate(previousDate, true);
var count = 7;
currentCalendarNode = calendarNodes.item(count);
while ((nextDate.getMonth() == previousDate.getMonth()) && (count < 42)) {
this.createDayContents(currentCalendarNode, nextDate);
dojo.html.setClass(currentCalendarNode, this.getDateClassName(nextDate, "current"));
currentCalendarNode = calendarNodes.item(++count);
previousDate = nextDate;
nextDate = this.incrementDate(nextDate, true);
}
while (count < 42) {
this.createDayContents(currentCalendarNode, nextDate);
dojo.html.setClass(currentCalendarNode, this.getDateClassName(nextDate, "next"));
currentCalendarNode = calendarNodes.item(++count);
previousDate = nextDate;
nextDate = this.incrementDate(nextDate, true);
}
this.setMonthLabel(this.firstSaturday.month);
this.setYearLabels(this.firstSaturday.year);
}});
dojo.widget.MonthlyCalendar.util = new function () {
this.toRfcDate = function (jsDate) {
if (!jsDate) {
jsDate = this.today;
}
var year = jsDate.getFullYear();
var month = jsDate.getMonth() + 1;
if (month < 10) {
month = "0" + month.toString();
}
var date = jsDate.getDate();
if (date < 10) {
date = "0" + date.toString();
}
return year + "-" + month + "-" + date + "T00:00:00+00:00";
};
this.fromRfcDate = function (rfcDate) {
var tempDate = rfcDate.split("-");
if (tempDate.length < 3) {
return new Date();
}
return new Date(parseInt(tempDate[0]), (parseInt(tempDate[1], 10) - 1), parseInt(tempDate[2].substr(0, 2), 10));
};
this.initFirstSaturday = function (month, year) {
if (!month) {
month = this.date.getMonth();
}
if (!year) {
year = this.date.getFullYear();
}
var firstOfMonth = new Date(year, month, 1);
return {year:year, month:month, date:7 - firstOfMonth.getDay()};
};
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Editor.js
New file
0,0 → 1,388
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Editor");
dojo.deprecated("dojo.widget.Editor", "is replaced by dojo.widget.Editor2", "0.5");
dojo.require("dojo.io.*");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.Toolbar");
dojo.require("dojo.widget.RichText");
dojo.require("dojo.widget.ColorPalette");
dojo.require("dojo.string.extras");
dojo.widget.tags.addParseTreeHandler("dojo:Editor");
dojo.widget.Editor = function () {
dojo.widget.HtmlWidget.call(this);
this.contentFilters = [];
this._toolbars = [];
};
dojo.inherits(dojo.widget.Editor, dojo.widget.HtmlWidget);
dojo.widget.Editor.itemGroups = {textGroup:["bold", "italic", "underline", "strikethrough"], blockGroup:["formatBlock", "fontName", "fontSize"], justifyGroup:["justifyleft", "justifycenter", "justifyright"], commandGroup:["save", "cancel"], colorGroup:["forecolor", "hilitecolor"], listGroup:["insertorderedlist", "insertunorderedlist"], indentGroup:["outdent", "indent"], linkGroup:["createlink", "insertimage", "inserthorizontalrule"]};
dojo.widget.Editor.formatBlockValues = {"Normal":"p", "Main heading":"h2", "Sub heading":"h3", "Sub sub heading":"h4", "Preformatted":"pre"};
dojo.widget.Editor.fontNameValues = {"Arial":"Arial, Helvetica, sans-serif", "Verdana":"Verdana, sans-serif", "Times New Roman":"Times New Roman, serif", "Courier":"Courier New, monospace"};
dojo.widget.Editor.fontSizeValues = {"1 (8 pt)":"1", "2 (10 pt)":"2", "3 (12 pt)":"3", "4 (14 pt)":"4", "5 (18 pt)":"5", "6 (24 pt)":"6", "7 (36 pt)":"7"};
dojo.widget.Editor.defaultItems = ["commandGroup", "|", "blockGroup", "|", "textGroup", "|", "colorGroup", "|", "justifyGroup", "|", "listGroup", "indentGroup", "|", "linkGroup"];
dojo.widget.Editor.supportedCommands = ["save", "cancel", "|", "-", "/", " "];
dojo.lang.extend(dojo.widget.Editor, {widgetType:"Editor", saveUrl:"", saveMethod:"post", saveArgName:"editorContent", closeOnSave:false, items:dojo.widget.Editor.defaultItems, formatBlockItems:dojo.lang.shallowCopy(dojo.widget.Editor.formatBlockValues), fontNameItems:dojo.lang.shallowCopy(dojo.widget.Editor.fontNameValues), fontSizeItems:dojo.lang.shallowCopy(dojo.widget.Editor.fontSizeValues), getItemProperties:function (name) {
var props = {};
switch (name.toLowerCase()) {
case "bold":
case "italic":
case "underline":
case "strikethrough":
props.toggleItem = true;
break;
case "justifygroup":
props.defaultButton = "justifyleft";
props.preventDeselect = true;
props.buttonGroup = true;
break;
case "listgroup":
props.buttonGroup = true;
break;
case "save":
case "cancel":
props.label = dojo.string.capitalize(name);
break;
case "forecolor":
case "hilitecolor":
props.name = name;
props.toggleItem = true;
props.icon = this.getCommandImage(name);
break;
case "formatblock":
props.name = "formatBlock";
props.values = this.formatBlockItems;
break;
case "fontname":
props.name = "fontName";
props.values = this.fontNameItems;
case "fontsize":
props.name = "fontSize";
props.values = this.fontSizeItems;
}
return props;
}, validateItems:true, focusOnLoad:true, minHeight:"1em", _richText:null, _richTextType:"RichText", _toolbarContainer:null, _toolbarContainerType:"ToolbarContainer", _toolbars:[], _toolbarType:"Toolbar", _toolbarItemType:"ToolbarItem", buildRendering:function (args, frag) {
var node = frag["dojo:" + this.widgetType.toLowerCase()]["nodeRef"];
var trt = dojo.widget.createWidget(this._richTextType, {focusOnLoad:this.focusOnLoad, minHeight:this.minHeight}, node);
var _this = this;
setTimeout(function () {
_this.setRichText(trt);
_this.initToolbar();
_this.fillInTemplate(args, frag);
}, 0);
}, setRichText:function (richText) {
if (this._richText && this._richText == richText) {
dojo.debug("Already set the richText to this richText!");
return;
}
if (this._richText && !this._richText.isClosed) {
dojo.debug("You are switching richTexts yet you haven't closed the current one. Losing reference!");
}
this._richText = richText;
dojo.event.connect(this._richText, "close", this, "onClose");
dojo.event.connect(this._richText, "onLoad", this, "onLoad");
dojo.event.connect(this._richText, "onDisplayChanged", this, "updateToolbar");
if (this._toolbarContainer) {
this._toolbarContainer.enable();
this.updateToolbar(true);
}
}, initToolbar:function () {
if (this._toolbarContainer) {
return;
}
this._toolbarContainer = dojo.widget.createWidget(this._toolbarContainerType);
var tb = this.addToolbar();
var last = true;
for (var i = 0; i < this.items.length; i++) {
if (this.items[i] == "\n") {
tb = this.addToolbar();
} else {
if ((this.items[i] == "|") && (!last)) {
last = true;
} else {
last = this.addItem(this.items[i], tb);
}
}
}
this.insertToolbar(this._toolbarContainer.domNode, this._richText.domNode);
}, insertToolbar:function (tbNode, richTextNode) {
dojo.html.insertBefore(tbNode, richTextNode);
}, addToolbar:function (toolbar) {
this.initToolbar();
if (!(toolbar instanceof dojo.widget.Toolbar)) {
toolbar = dojo.widget.createWidget(this._toolbarType);
}
this._toolbarContainer.addChild(toolbar);
this._toolbars.push(toolbar);
return toolbar;
}, addItem:function (item, tb, dontValidate) {
if (!tb) {
tb = this._toolbars[0];
}
var cmd = ((item) && (!dojo.lang.isUndefined(item["getValue"]))) ? cmd = item["getValue"]() : item;
var groups = dojo.widget.Editor.itemGroups;
if (item instanceof dojo.widget.ToolbarItem) {
tb.addChild(item);
} else {
if (groups[cmd]) {
var group = groups[cmd];
var worked = true;
if (cmd == "justifyGroup" || cmd == "listGroup") {
var btnGroup = [cmd];
for (var i = 0; i < group.length; i++) {
if (dontValidate || this.isSupportedCommand(group[i])) {
btnGroup.push(this.getCommandImage(group[i]));
} else {
worked = false;
}
}
if (btnGroup.length) {
var btn = tb.addChild(btnGroup, null, this.getItemProperties(cmd));
dojo.event.connect(btn, "onClick", this, "_action");
dojo.event.connect(btn, "onChangeSelect", this, "_action");
}
return worked;
} else {
for (var i = 0; i < group.length; i++) {
if (!this.addItem(group[i], tb)) {
worked = false;
}
}
return worked;
}
} else {
if ((!dontValidate) && (!this.isSupportedCommand(cmd))) {
return false;
}
if (dontValidate || this.isSupportedCommand(cmd)) {
cmd = cmd.toLowerCase();
if (cmd == "formatblock") {
var select = dojo.widget.createWidget("ToolbarSelect", {name:"formatBlock", values:this.formatBlockItems});
tb.addChild(select);
var _this = this;
dojo.event.connect(select, "onSetValue", function (item, value) {
_this.onAction("formatBlock", value);
});
} else {
if (cmd == "fontname") {
var select = dojo.widget.createWidget("ToolbarSelect", {name:"fontName", values:this.fontNameItems});
tb.addChild(select);
dojo.event.connect(select, "onSetValue", dojo.lang.hitch(this, function (item, value) {
this.onAction("fontName", value);
}));
} else {
if (cmd == "fontsize") {
var select = dojo.widget.createWidget("ToolbarSelect", {name:"fontSize", values:this.fontSizeItems});
tb.addChild(select);
dojo.event.connect(select, "onSetValue", dojo.lang.hitch(this, function (item, value) {
this.onAction("fontSize", value);
}));
} else {
if (dojo.lang.inArray(cmd, ["forecolor", "hilitecolor"])) {
var btn = tb.addChild(dojo.widget.createWidget("ToolbarColorDialog", this.getItemProperties(cmd)));
dojo.event.connect(btn, "onSetValue", this, "_setValue");
} else {
var btn = tb.addChild(this.getCommandImage(cmd), null, this.getItemProperties(cmd));
if (cmd == "save") {
dojo.event.connect(btn, "onClick", this, "_save");
} else {
if (cmd == "cancel") {
dojo.event.connect(btn, "onClick", this, "_close");
} else {
dojo.event.connect(btn, "onClick", this, "_action");
dojo.event.connect(btn, "onChangeSelect", this, "_action");
}
}
}
}
}
}
}
}
}
return true;
}, enableToolbar:function () {
if (this._toolbarContainer) {
this._toolbarContainer.domNode.style.display = "";
this._toolbarContainer.enable();
}
}, disableToolbar:function (hide) {
if (hide) {
if (this._toolbarContainer) {
this._toolbarContainer.domNode.style.display = "none";
}
} else {
if (this._toolbarContainer) {
this._toolbarContainer.disable();
}
}
}, _updateToolbarLastRan:null, _updateToolbarTimer:null, _updateToolbarFrequency:500, updateToolbar:function (force) {
if (!this._toolbarContainer) {
return;
}
var diff = new Date() - this._updateToolbarLastRan;
if (!force && this._updateToolbarLastRan && (diff < this._updateToolbarFrequency)) {
clearTimeout(this._updateToolbarTimer);
var _this = this;
this._updateToolbarTimer = setTimeout(function () {
_this.updateToolbar();
}, this._updateToolbarFrequency / 2);
return;
} else {
this._updateToolbarLastRan = new Date();
}
var items = this._toolbarContainer.getItems();
for (var i = 0; i < items.length; i++) {
var item = items[i];
if (item instanceof dojo.widget.ToolbarSeparator) {
continue;
}
var cmd = item._name;
if (cmd == "save" || cmd == "cancel") {
continue;
} else {
if (cmd == "justifyGroup") {
try {
if (!this._richText.queryCommandEnabled("justifyleft")) {
item.disable(false, true);
} else {
item.enable(false, true);
var jitems = item.getItems();
for (var j = 0; j < jitems.length; j++) {
var name = jitems[j]._name;
var value = this._richText.queryCommandValue(name);
if (typeof value == "boolean" && value) {
value = name;
break;
} else {
if (typeof value == "string") {
value = "justify" + value;
} else {
value = null;
}
}
}
if (!value) {
value = "justifyleft";
}
item.setValue(value, false, true);
}
}
catch (err) {
}
} else {
if (cmd == "listGroup") {
var litems = item.getItems();
for (var j = 0; j < litems.length; j++) {
this.updateItem(litems[j]);
}
} else {
this.updateItem(item);
}
}
}
}
}, updateItem:function (item) {
try {
var cmd = item._name;
var enabled = this._richText.queryCommandEnabled(cmd);
item.setEnabled(enabled, false, true);
var active = this._richText.queryCommandState(cmd);
if (active && cmd == "underline") {
active = !this._richText.queryCommandEnabled("unlink");
}
item.setSelected(active, false, true);
return true;
}
catch (err) {
return false;
}
}, supportedCommands:dojo.widget.Editor.supportedCommands.concat(), isSupportedCommand:function (cmd) {
var yes = dojo.lang.inArray(cmd, this.supportedCommands);
if (!yes) {
try {
var richText = this._richText || dojo.widget.HtmlRichText.prototype;
yes = richText.queryCommandAvailable(cmd);
}
catch (E) {
}
}
return yes;
}, getCommandImage:function (cmd) {
if (cmd == "|") {
return cmd;
} else {
return dojo.uri.moduleUri("dojo.widget", "templates/buttons/" + cmd + ".gif");
}
}, _action:function (e) {
this._fire("onAction", e.getValue());
}, _setValue:function (a, b) {
this._fire("onAction", a.getValue(), b);
}, _save:function (e) {
if (!this._richText.isClosed) {
if (this.saveUrl.length) {
var content = {};
content[this.saveArgName] = this.getHtml();
dojo.io.bind({method:this.saveMethod, url:this.saveUrl, content:content});
} else {
dojo.debug("please set a saveUrl for the editor");
}
if (this.closeOnSave) {
this._richText.close(e.getName().toLowerCase() == "save");
}
}
}, _close:function (e) {
if (!this._richText.isClosed) {
this._richText.close(e.getName().toLowerCase() == "save");
}
}, onAction:function (cmd, value) {
switch (cmd) {
case "createlink":
if (!(value = prompt("Please enter the URL of the link:", "http://"))) {
return;
}
break;
case "insertimage":
if (!(value = prompt("Please enter the URL of the image:", "http://"))) {
return;
}
break;
}
this._richText.execCommand(cmd, value);
}, fillInTemplate:function (args, frag) {
}, _fire:function (eventName) {
if (dojo.lang.isFunction(this[eventName])) {
var args = [];
if (arguments.length == 1) {
args.push(this);
} else {
for (var i = 1; i < arguments.length; i++) {
args.push(arguments[i]);
}
}
this[eventName].apply(this, args);
}
}, getHtml:function () {
this._richText.contentFilters = this._richText.contentFilters.concat(this.contentFilters);
return this._richText.getEditorContent();
}, getEditorContent:function () {
return this.getHtml();
}, onClose:function (save, hide) {
this.disableToolbar(hide);
if (save) {
this._fire("onSave");
} else {
this._fire("onCancel");
}
}, onLoad:function () {
}, onSave:function () {
}, onCancel:function () {
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/html/stabile.js
New file
0,0 → 1,126
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.html.stabile");
dojo.widget.html.stabile = {_sqQuotables:new RegExp("([\\\\'])", "g"), _depth:0, _recur:false, depthLimit:2};
dojo.widget.html.stabile.getState = function (id) {
dojo.widget.html.stabile.setup();
return dojo.widget.html.stabile.widgetState[id];
};
dojo.widget.html.stabile.setState = function (id, state, isCommit) {
dojo.widget.html.stabile.setup();
dojo.widget.html.stabile.widgetState[id] = state;
if (isCommit) {
dojo.widget.html.stabile.commit(dojo.widget.html.stabile.widgetState);
}
};
dojo.widget.html.stabile.setup = function () {
if (!dojo.widget.html.stabile.widgetState) {
var text = dojo.widget.html.stabile._getStorage().value;
dojo.widget.html.stabile.widgetState = text ? dj_eval("(" + text + ")") : {};
}
};
dojo.widget.html.stabile.commit = function (state) {
dojo.widget.html.stabile._getStorage().value = dojo.widget.html.stabile.description(state);
};
dojo.widget.html.stabile.description = function (v, showAll) {
var depth = dojo.widget.html.stabile._depth;
var describeThis = function () {
return this.description(this, true);
};
try {
if (v === void (0)) {
return "undefined";
}
if (v === null) {
return "null";
}
if (typeof (v) == "boolean" || typeof (v) == "number" || v instanceof Boolean || v instanceof Number) {
return v.toString();
}
if (typeof (v) == "string" || v instanceof String) {
var v1 = v.replace(dojo.widget.html.stabile._sqQuotables, "\\$1");
v1 = v1.replace(/\n/g, "\\n");
v1 = v1.replace(/\r/g, "\\r");
return "'" + v1 + "'";
}
if (v instanceof Date) {
return "new Date(" + d.getFullYear + "," + d.getMonth() + "," + d.getDate() + ")";
}
var d;
if (v instanceof Array || v.push) {
if (depth >= dojo.widget.html.stabile.depthLimit) {
return "[ ... ]";
}
d = "[";
var first = true;
dojo.widget.html.stabile._depth++;
for (var i = 0; i < v.length; i++) {
if (first) {
first = false;
} else {
d += ",";
}
d += arguments.callee(v[i], showAll);
}
return d + "]";
}
if (v.constructor == Object || v.toString == describeThis) {
if (depth >= dojo.widget.html.stabile.depthLimit) {
return "{ ... }";
}
if (typeof (v.hasOwnProperty) != "function" && v.prototype) {
throw new Error("description: " + v + " not supported by script engine");
}
var first = true;
d = "{";
dojo.widget.html.stabile._depth++;
for (var key in v) {
if (v[key] == void (0) || typeof (v[key]) == "function") {
continue;
}
if (first) {
first = false;
} else {
d += ", ";
}
var kd = key;
if (!kd.match(/^[a-zA-Z_][a-zA-Z0-9_]*$/)) {
kd = arguments.callee(key, showAll);
}
d += kd + ": " + arguments.callee(v[key], showAll);
}
return d + "}";
}
if (showAll) {
if (dojo.widget.html.stabile._recur) {
var objectToString = Object.prototype.toString;
return objectToString.apply(v, []);
} else {
dojo.widget.html.stabile._recur = true;
return v.toString();
}
} else {
throw new Error("Unknown type: " + v);
return "'unknown'";
}
}
finally {
dojo.widget.html.stabile._depth = depth;
}
};
dojo.widget.html.stabile._getStorage = function () {
if (dojo.widget.html.stabile.dataField) {
return dojo.widget.html.stabile.dataField;
}
var form = document.forms._dojo_form;
return dojo.widget.html.stabile.dataField = form ? form.stabile : {value:""};
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/html/loader.js
New file
0,0 → 1,620
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.html.loader");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.io.*");
dojo.require("dojo.lang.common");
dojo.require("dojo.lang.extras");
dojo.require("dojo.experimental");
dojo.experimental("dojo.widget.html.loader");
dojo.widget.html.loader = new (function () {
this.toString = function () {
return "dojo.widget.html.loader";
};
var _loader = this;
dojo.addOnLoad(function () {
dojo.experimental(_loader.toString());
var undo = dojo.evalObjPath("dojo.undo.browser");
if (djConfig["preventBackButtonFix"] && undo && !undo.initialState) {
undo.setInitialState(new trackerObj);
}
});
var logger = {};
var trackerObj = function (id, data) {
this.id = id;
this.data = data;
};
trackerObj.prototype.handle = function (type) {
if (typeof dojo == "undefined") {
return;
}
var wg = dojo.widget.byId(this.id);
if (wg) {
wg.setContent(this.data, true);
}
};
this._log = function (widget, data) {
if (widget.trackHistory) {
if (!logger[widget.widgetId]) {
logger[widget.widgetId] = {childrenIds:[], stack:[data]};
}
var children = logger[widget.widgetId].childrenIds;
while (children && children.length) {
delete logger[children.pop()];
}
for (var child in widget.children) {
logger[widget.widgetId].childrenIds = child.widgetId;
}
dojo.undo.browser.addToHistory(new trackerObj(widget.widgetId, dojo.lang.shallowCopy(data, true)));
}
};
var undef = dojo.lang.isUndefined;
var isFunc = dojo.lang.isFunction;
function handleDefaults(e, handler, useAlert) {
if (!handler) {
handler = "onContentError";
}
if (dojo.lang.isString(e)) {
e = {_text:e};
}
if (!e._text) {
e._text = e.toString();
}
e.toString = function () {
return this._text;
};
if (typeof e.returnValue != "boolean") {
e.returnValue = true;
}
if (typeof e.preventDefault != "function") {
e.preventDefault = function () {
this.returnValue = false;
};
}
this[handler](e);
if (e.returnValue) {
if (useAlert) {
alert(e.toString());
} else {
this.loader.callOnUnLoad.call(this, false);
this.onSetContent(e.toString());
}
}
}
function downloader(bindArgs) {
for (var x in this.bindArgs) {
bindArgs[x] = (undef(bindArgs[x]) ? this.bindArgs[x] : undefined);
}
var cache = this.cacheContent;
if (undef(bindArgs.useCache)) {
bindArgs.useCache = cache;
}
if (undef(bindArgs.preventCache)) {
bindArgs.preventCache = !cache;
}
if (undef(bindArgs.mimetype)) {
bindArgs.mimetype = "text/html";
}
this.loader.bindObj = dojo.io.bind(bindArgs);
}
function stackRunner(st) {
var err = "", func = null;
var scope = this.scriptScope || dojo.global();
while (st.length) {
func = st.shift();
try {
func.call(scope);
}
catch (e) {
err += "\n" + func + " failed: " + e;
}
}
if (err.length) {
var name = (st == this.loader.addOnLoads) ? "addOnLoad" : "addOnUnLoad";
handleDefaults.call(this, name + " failure\n " + err, "onExecError", true);
}
}
function stackPusher(st, obj, func) {
if (typeof func == "undefined") {
st.push(obj);
} else {
st.push(function () {
obj[func]();
});
}
}
function refreshed() {
this.onResized();
this.onLoad();
this.isLoaded = true;
}
function asyncParse(data) {
if (this.executeScripts) {
this.onExecScript.call(this, data.scripts);
}
if (this.parseContent) {
this.onContentParse.call(this);
}
refreshed.call(this);
}
function runHandler() {
if (dojo.lang.isFunction(this.handler)) {
this.handler(this, this.containerNode || this.domNode);
refreshed.call(this);
return false;
}
return true;
}
this.htmlContentBasicFix = function (s, url) {
var titles = [], styles = [];
var regex = /<title[^>]*>([\s\S]*?)<\/title>/i;
var match, attr;
while (match = regex.exec(s)) {
titles.push(match[1]);
s = s.substring(0, match.index) + s.substr(match.index + match[0].length);
}
regex = /(?:<(style)[^>]*>([\s\S]*?)<\/style>|<link ([^>]*rel=['"]?stylesheet['"]?[^>]*)>)/i;
while (match = regex.exec(s)) {
if (match[1] && match[1].toLowerCase() == "style") {
styles.push(dojo.html.fixPathsInCssText(match[2], url));
} else {
if (attr = match[3].match(/href=(['"]?)([^'">]*)\1/i)) {
styles.push({path:attr[2]});
}
}
s = s.substring(0, match.index) + s.substr(match.index + match[0].length);
}
return {"s":s, "titles":titles, "styles":styles};
};
this.htmlContentAdjustPaths = function (s, url) {
var tag = "", str = "", tagFix = "", path = "";
var attr = [], origPath = "", fix = "";
var regexFindTag = /<[a-z][a-z0-9]*[^>]*\s(?:(?:src|href|style)=[^>])+[^>]*>/i;
var regexFindAttr = /\s(src|href|style)=(['"]?)([\w()\[\]\/.,\\'"-:;#=&?\s@]+?)\2/i;
var regexProtocols = /^(?:[#]|(?:(?:https?|ftps?|file|javascript|mailto|news):))/;
while (tag = regexFindTag.exec(s)) {
str += s.substring(0, tag.index);
s = s.substring((tag.index + tag[0].length), s.length);
tag = tag[0];
tagFix = "";
while (attr = regexFindAttr.exec(tag)) {
path = "";
origPath = attr[3];
switch (attr[1].toLowerCase()) {
case "src":
case "href":
if (regexProtocols.exec(origPath)) {
path = origPath;
} else {
path = (new dojo.uri.Uri(url, origPath).toString());
}
break;
case "style":
path = dojo.html.fixPathsInCssText(origPath, url);
break;
default:
path = origPath;
}
fix = " " + attr[1] + "=" + attr[2] + path + attr[2];
tagFix += tag.substring(0, attr.index) + fix;
tag = tag.substring((attr.index + attr[0].length), tag.length);
}
str += tagFix + tag;
}
return str + s;
};
this.htmlContentScripts = function (s, collectScripts) {
var scripts = [], requires = [], match = [];
var attr = "", tmp = null, tag = "", sc = "", str = "";
var regex = /<script([^>]*)>([\s\S]*?)<\/script>/i;
var regexSrc = /src=(['"]?)([^"']*)\1/i;
var regexDojoJs = /.*(\bdojo\b\.js(?:\.uncompressed\.js)?)$/;
var regexInvalid = /(?:var )?\bdjConfig\b(?:[\s]*=[\s]*\{[^}]+\}|\.[\w]*[\s]*=[\s]*[^;\n]*)?;?|dojo\.hostenv\.writeIncludes\(\s*\);?/g;
var regexRequires = /dojo\.(?:(?:require(?:After)?(?:If)?)|(?:widget\.(?:manager\.)?registerWidgetPackage)|(?:(?:hostenv\.)?setModulePrefix)|defineNamespace)\((['"]).*?\1\)\s*;?/;
while (match = regex.exec(s)) {
if (this.executeScripts && match[1]) {
if (attr = regexSrc.exec(match[1])) {
if (regexDojoJs.exec(attr[2])) {
dojo.debug("Security note! inhibit:" + attr[2] + " from beeing loaded again.");
} else {
scripts.push({path:attr[2]});
}
}
}
if (match[2]) {
sc = match[2].replace(regexInvalid, "");
if (!sc) {
continue;
}
while (tmp = regexRequires.exec(sc)) {
requires.push(tmp[0]);
sc = sc.substring(0, tmp.index) + sc.substr(tmp.index + tmp[0].length);
}
if (collectScripts) {
scripts.push(sc);
}
}
s = s.substr(0, match.index) + s.substr(match.index + match[0].length);
}
if (collectScripts) {
var regex = /(<[a-zA-Z][a-zA-Z0-9]*\s[^>]*\S=(['"])[^>]*[^\.\]])scriptScope([^>]*>)/;
str = "";
while (tag = regex.exec(s)) {
tmp = ((tag[2] == "'") ? "\"" : "'");
str += s.substring(0, tag.index);
s = s.substr(tag.index).replace(regex, "$1dojo.widget.byId(" + tmp + this.widgetId + tmp + ").scriptScope$3");
}
s = str + s;
}
return {"s":s, "requires":requires, "scripts":scripts};
};
this.splitAndFixPaths = function (args) {
if (!args.url) {
args.url = "./";
}
url = new dojo.uri.Uri(location, args.url).toString();
var ret = {"xml":"", "styles":[], "titles":[], "requires":[], "scripts":[], "url":url};
if (args.content) {
var tmp = null, content = args.content;
if (args.adjustPaths) {
content = _loader.htmlContentAdjustPaths.call(this, content, url);
}
tmp = _loader.htmlContentBasicFix.call(this, content, url);
content = tmp.s;
ret.styles = tmp.styles;
ret.titles = tmp.titles;
if (args.collectRequires || args.collectScripts) {
tmp = _loader.htmlContentScripts.call(this, content, args.collectScripts);
content = tmp.s;
ret.requires = tmp.requires;
ret.scripts = tmp.scripts;
}
var match = [];
if (args.bodyExtract) {
match = content.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);
if (match) {
content = match[1];
}
}
ret.xml = content;
}
return ret;
};
this.hookUp = function (args) {
var widget = args.widget;
if (dojo.lang.isString(widget)) {
if (args.mixin) {
dojo.raise(this.toString() + ", cant use mixin when widget is a string");
}
widget = dojo.evalObjPath(widget);
}
if (!widget || !(widget instanceof dojo.widget.HtmlWidget)) {
dojo.raise(this.toString() + " Widget isn't defined or isn't a HtmlWidget instance");
}
if (widget.loader && widget.setUrl) {
return;
}
var widgetProto = (args.mixin) ? widget : widget.constructor.prototype;
widget.loader = {isLoaded:false, styleNodes:[], addOnLoads:[], addOnUnLoads:[], callOnUnLoad:(function (canCall) {
return function (after) {
this.abort();
if (canCall) {
this.onUnLoad();
}
canCall = after;
};
})(false), bindObj:null, unHook:(function (w, wg) {
var oldProps = {isContainer:w.isContainer, adjustPats:w.adjustPaths, href:w.href, extractContent:w.extractContent, parseContent:w.parseContent, cacheContent:w.cacheContent, bindArgs:w.bindArgs, preload:w.preload, refreshOnShow:w.refreshOnShow, handler:w.handler, trackHistory:w.trackHistory, executeScripts:w.executeScripts, scriptScope:w.scriptScope, postCreate:w.postCreate, show:w.show, refresh:w.refresh, loadContents:w.loadContents, abort:w.abort, destroy:w.destroy, onLoad:w.onLoad, onUnLoad:w.onUnLoad, addOnLoad:w.addOnLoad, addOnUnLoad:w.addOnUnLoad, onDownloadStart:w.onDownloadStart, onDownloadEnd:w.onDownloadEnd, onDownloadError:w.onDownloadError, onContentError:w.onContentError, onExecError:w.onExecError, onSetContent:w.onSetContent, setUrl:w.setUrl, setContent:w.setContent, onContentParse:w.onContentParse, onExecScript:w.onExecScript, setHandler:w.setHandler};
return function () {
if (wg.abort) {
wg.abort();
}
if ((w != wg) && (dojo.widget.byType(wg.widgetType).length > 1)) {
return;
}
for (var x in oldProps) {
if (oldProps[x] === undefined) {
delete w[x];
continue;
}
w[x] = oldProps[x];
}
delete wg._loader_defined;
delete wg.loader;
};
})(widgetProto, widget)};
if (widgetProto._loader_defined || widget._loader_defined) {
return;
}
dojo.mixin(widgetProto, {isContainer:true, adjustPaths:undef(widgetProto.adjustPaths) ? true : widgetProto.adjustPaths, href:undef(widgetProto.href) ? "" : widgetProto.href, extractContent:undef(widgetProto.extractContent) ? true : widgetProto.extractContent, parseContent:undef(widgetProto.parseContent) ? true : widgetProto.parseContent, cacheContent:undef(widgetProto.cacheContent) ? true : widgetProto.cacheContent, bindArgs:undef(widgetProto.bindArgs) ? {} : widgetProto.bindArgs, preload:undef(widgetProto.preload) ? false : widgetProto.preload, refreshOnShow:undef(widgetProto.refreshOnShow) ? false : widgetProto.refreshOnShow, handler:undef(widgetProto.handler) ? "" : widgetProto.handler, executeScripts:undef(widgetProto.executeScripts) ? false : widgetProto.executeScripts, trackHistory:undef(widgetProto.tracHistory) ? false : widgetProto.trackHistory, scriptScope:null});
widgetProto.postCreate = (function (postCreate) {
return function () {
if (widgetProto.constructor.superclass.postCreate != postCreate) {
postCreate.apply(this, arguments);
} else {
widgetProto.constructor.superclass.postCreate.apply(this, arguments);
}
if (this.handler !== "") {
this.setHandler(this.handler);
}
if (this.isShowing() || this.preload) {
this.loadContents();
if (!this.href) {
_loader._log(this, (this.domNode || this.containerNode).innerHTML);
}
}
};
})(widgetProto.postCreate);
widgetProto.show = (function (show) {
return function () {
if (this.refreshOnShow) {
this.refresh();
} else {
this.loadContents();
}
if ((widgetProto.constructor.superclass.show == show) || !isFunc(show)) {
widgetProto.constructor.superclass.show.apply(this, arguments);
} else {
show.apply(this, arguments);
}
};
})(widgetProto.show);
widgetProto.destroy = (function (destroy) {
return function (destroy) {
this.onUnLoad();
this.abort();
this.loader.unHook();
if ((widgetProto.constructor.superclass.destroy != destroy) && isFunc(destroy)) {
destroy.apply(this, arguments);
} else {
widgetProto.constructor.superclass.destroy.apply(this, arguments);
}
};
})(widgetProto.destroy);
if (!widgetProto.refresh) {
widgetProto.refresh = function () {
this.loader.isLoaded = false;
this.loadContents();
};
}
if (!widgetProto.loadContents) {
widgetProto.loadContents = function () {
if (this.loader.isLoaded) {
return;
}
if (isFunc(this.handler)) {
runHandler.call(this);
} else {
if (this.href !== "") {
handleDefaults.call(this, "Loading...", "onDownloadStart");
var self = this, url = this.href;
downloader.call(this, {url:url, load:function (type, data, xhr) {
self.onDownloadEnd.call(self, url, data);
}, error:function (type, err, xhr) {
var e = {responseText:xhr.responseText, status:xhr.status, statusText:xhr.statusText, responseHeaders:(xhr.getAllResponseHeaders) ? xhr.getAllResponseHeaders() : [], _text:"Error loading '" + url + "' (" + xhr.status + " " + xhr.statusText + ")"};
handleDefaults.call(self, e, "onDownloadError");
self.onLoad();
}});
}
}
};
}
if (!widgetProto.abort) {
widgetProto.abort = function () {
if (!this.loader || !this.loader.bindObj || !this.loader.bindObj.abort) {
return;
}
this.loader.bindObj.abort();
this.loader.bindObj = null;
};
}
if (!widgetProto.onLoad) {
widgetProto.onLoad = function () {
stackRunner.call(this, this.loader.addOnLoads);
this.loader.isLoaded = true;
};
}
if (!widgetProto.onUnLoad) {
widgetProto.onUnLoad = function () {
stackRunner.call(this, this.loader.addOnUnLoads);
delete this.scriptScope;
};
}
if (!widgetProto.addOnLoad) {
widgetProto.addOnLoad = function (obj, func) {
stackPusher.call(this, this.loader.addOnLoads, obj, func);
};
}
if (!widgetProto.addOnUnLoad) {
widgetProto.addOnUnLoad = function (obj, func) {
stackPusher.call(this, this.loader.addOnUnLoads, obj, func);
};
}
if (!widgetProto.onExecError) {
widgetProto.onExecError = function () {
};
}
if (!widgetProto.onContentError) {
widgetProto.onContentError = function () {
};
}
if (!widgetProto.onDownloadError) {
widgetProto.onDownloadError = function () {
};
}
if (!widgetProto.onDownloadStart) {
widgetProto.onDownloadStart = function (onDownloadStart) {
};
}
if (!widgetProto.onDownloadEnd) {
widgetProto.onDownloadEnd = function (url, data) {
var args = {content:data, url:url, adjustPaths:this.adjustPaths, collectScripts:this.executeScripts, collectRequires:this.parseContent, bodyExtract:this.extractContent};
data = _loader.splitAndFixPaths.call(this, args);
this.setContent(data);
};
}
if (!widgetProto.onSetContent) {
widgetProto.onSetContent = function (cont) {
this.destroyChildren();
var styleNodes = this.loader.styleNodes;
while (styleNodes.length) {
var st = styleNodes.pop();
if (st && st.parentNode) {
st.parentNode.removeChild(st);
}
}
var node = this.containerNode || this.domNode;
while (node.firstChild) {
try {
dojo.event.browser.clean(node.firstChild);
}
catch (e) {
}
node.removeChild(node.firstChild);
}
try {
if (typeof cont != "string") {
node.appendChild(cont);
} else {
try {
node.innerHTML = cont;
}
catch (e) {
var tmp;
(tmp = dojo.doc().createElement("div")).innerHTML = cont;
while (tmp.firstChild) {
node.appendChild(tmp.removeChild(tmp.firstChild));
}
}
}
}
catch (e) {
e._text = "Could'nt load content: " + e;
var useAlert = (this.loader._onSetContent_err == e._text);
this.loader._onSetContent_err = e._text;
handleDefaults.call(this, e, "onContentError", useAlert);
}
};
}
if (!widgetProto.setUrl) {
widgetProto.setUrl = function (url) {
this.href = url;
this.loader.isLoaded = false;
if (this.preload || this.isShowing()) {
this.loadContents();
}
};
}
if (!widgetProto.setContent) {
widgetProto.setContent = function (data, dontLog) {
this.loader.callOnUnLoad.call(this, true);
if (!data || dojo.html.isNode(data)) {
this.onSetContent(data);
refreshed.call(this);
} else {
if (typeof data.xml != "string") {
this.href = "";
var args = {content:data, url:this.href, adjustPaths:this.adjustPaths, collectScripts:this.executeScripts, collectRequires:this.parseContent, bodyExtract:this.extractContent};
data = _loader.splitAndFixPaths.call(this, args);
} else {
if (data.url != "./") {
this.url = data.url;
}
}
this.onSetContent(data.xml);
for (var i = 0, styles = data.styles; i < styles.length; i++) {
if (styles[i].path) {
this.loader.styleNodes.push(dojo.html.insertCssFile(styles[i].path));
} else {
this.loader.styleNodes.push(dojo.html.insertCssText(styles[i]));
}
}
if (this.parseContent) {
for (var i = 0, requires = data.requires; i < requires.length; i++) {
try {
eval(requires[i]);
}
catch (e) {
e._text = "dojo.widget.html.loader.hookUp: error in package loading calls, " + (e.description || e);
handleDefaults.call(this, e, "onContentError", true);
}
}
}
if (dojo.hostenv.isXDomain && data.requires.length) {
dojo.addOnLoad(function () {
asyncParse.call(this, data);
if (!dontLog) {
_loader._log(this, data);
}
});
dontLog = true;
} else {
asyncParse.call(this, data);
}
}
if (!dontLog) {
}
};
}
if (!widgetProto.onContentParse) {
widgetProto.onContentParse = function () {
var node = this.containerNode || this.domNode;
var parser = new dojo.xml.Parse();
var frag = parser.parseElement(node, null, true);
dojo.widget.getParser().createSubComponents(frag, this);
};
}
if (!widgetProto.onExecScript) {
widgetProto.onExecScript = function (scripts) {
var self = this, tmp = "", code = "";
for (var i = 0; i < scripts.length; i++) {
if (scripts[i].path) {
var url = scripts[i].path;
downloader.call(this, {"url":url, "load":function (type, scriptStr) {
(function () {
tmp = scriptStr;
scripts[i] = scriptStr;
}).call(self);
}, "error":function (type, error) {
error._text = type + " downloading remote script";
handleDefaults.call(self, error, "onExecError", true);
}, "mimetype":"text/plain", "sync":true});
code += tmp;
} else {
code += scripts[i];
}
}
try {
delete this.scriptScope;
this.scriptScope = new (new Function("_container_", code + "; return this;"))(self);
}
catch (e) {
e._text = "Error running scripts from content:\n" + (e.description || e.toString());
handleDefaults.call(this, e, "onExecError", true);
}
};
}
if (!widgetProto.setHandler) {
widgetProto.setHandler = function (handler) {
var fcn = dojo.lang.isFunction(handler) ? handler : window[handler];
if (!isFunc(fcn)) {
handleDefaults.call(this, "Unable to set handler, '" + handler + "' not a function.", "onExecError", true);
return;
}
this.handler = function () {
return fcn.apply(this, arguments);
};
};
}
widgetProto._loader_defined = true;
};
})();
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/html/layout.js
New file
0,0 → 1,92
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.html.layout");
dojo.require("dojo.lang.common");
dojo.require("dojo.string.extras");
dojo.require("dojo.html.style");
dojo.require("dojo.html.layout");
dojo.widget.html.layout = function (container, children, layoutPriority) {
dojo.html.addClass(container, "dojoLayoutContainer");
children = dojo.lang.filter(children, function (child, idx) {
child.idx = idx;
return dojo.lang.inArray(["top", "bottom", "left", "right", "client", "flood"], child.layoutAlign);
});
if (layoutPriority && layoutPriority != "none") {
var rank = function (child) {
switch (child.layoutAlign) {
case "flood":
return 1;
case "left":
case "right":
return (layoutPriority == "left-right") ? 2 : 3;
case "top":
case "bottom":
return (layoutPriority == "left-right") ? 3 : 2;
default:
return 4;
}
};
children.sort(function (a, b) {
return (rank(a) - rank(b)) || (a.idx - b.idx);
});
}
var f = {top:dojo.html.getPixelValue(container, "padding-top", true), left:dojo.html.getPixelValue(container, "padding-left", true)};
dojo.lang.mixin(f, dojo.html.getContentBox(container));
dojo.lang.forEach(children, function (child) {
var elm = child.domNode;
var pos = child.layoutAlign;
with (elm.style) {
left = f.left + "px";
top = f.top + "px";
bottom = "auto";
right = "auto";
}
dojo.html.addClass(elm, "dojoAlign" + dojo.string.capitalize(pos));
if ((pos == "top") || (pos == "bottom")) {
dojo.html.setMarginBox(elm, {width:f.width});
var h = dojo.html.getMarginBox(elm).height;
f.height -= h;
if (pos == "top") {
f.top += h;
} else {
elm.style.top = f.top + f.height + "px";
}
if (child.onResized) {
child.onResized();
}
} else {
if (pos == "left" || pos == "right") {
var w = dojo.html.getMarginBox(elm).width;
if (child.resizeTo) {
child.resizeTo(w, f.height);
} else {
dojo.html.setMarginBox(elm, {width:w, height:f.height});
}
f.width -= w;
if (pos == "left") {
f.left += w;
} else {
elm.style.left = f.left + f.width + "px";
}
} else {
if (pos == "flood" || pos == "client") {
if (child.resizeTo) {
child.resizeTo(f.width, f.height);
} else {
dojo.html.setMarginBox(elm, {width:f.width, height:f.height});
}
}
}
}
});
};
dojo.html.insertCssText(".dojoLayoutContainer{ position: relative; display: block; overflow: hidden; }\n" + "body .dojoAlignTop, body .dojoAlignBottom, body .dojoAlignLeft, body .dojoAlignRight { position: absolute; overflow: hidden; }\n" + "body .dojoAlignClient { position: absolute }\n" + ".dojoAlignClient { overflow: auto; }\n");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/TreeDocIconExtension.js
New file
0,0 → 1,52
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeDocIconExtension");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.TreeExtension");
dojo.widget.defineWidget("dojo.widget.TreeDocIconExtension", [dojo.widget.TreeExtension], {templateCssString:"\n/* CSS for TreeDocIconExtension */\n\n\n/* long vertical line under docIcon, connecting w/ children */\n.TreeStateChildrenYes-ExpandOpen .TreeIconContent {\n background-image : url('../templates/images/TreeV3/i_long.gif');\n background-repeat : no-repeat;\n background-position: 18px 9px;\n}\n\n/* close has higher priority */\n.TreeStateChildrenYes-ExpandClosed .TreeIconContent {\n background-image : url();\n}\n\n/* higher priotity: same length and appear after background-definition */\n.TreeStateChildrenNo-ExpandLeaf .TreeIconContent {\n background-image : url();\n}\n\n.TreeStateChildrenNo-ExpandClosed .TreeIconContent {\n background-image : url();\n}\n\n.TreeStateChildrenNo-ExpandOpen .TreeIconContent {\n background-image : url();\n}\n\n\n/* highest priority */\n.TreeIconDocument {\n background-image: url('../templates/images/TreeV3/document.gif');\n}\n\n.TreeExpandOpen .TreeIconFolder {\n background-image: url('../templates/images/TreeV3/open.gif');\n}\n\n.TreeExpandClosed .TreeIconFolder {\n background-image: url('../templates/images/TreeV3/closed.gif');\n}\n\n/* generic class for docIcon */\n.TreeIcon {\n width: 18px;\n height: 18px;\n float: left;\n display: inline;\n background-repeat : no-repeat;\n}\n\ndiv.TreeContent {\n margin-left: 36px;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/TreeDocIcon.css"), listenTreeEvents:["afterChangeTree", "afterSetFolder", "afterUnsetFolder"], listenNodeFilter:function (elem) {
return elem instanceof dojo.widget.Widget;
}, getnodeDocType:function (node) {
var nodeDocType = node.getnodeDocType();
if (!nodeDocType) {
nodeDocType = node.isFolder ? "Folder" : "Document";
}
return nodeDocType;
}, setnodeDocTypeClass:function (node) {
var reg = new RegExp("(^|\\s)" + node.tree.classPrefix + "Icon\\w+", "g");
var clazz = dojo.html.getClass(node.iconNode).replace(reg, "") + " " + node.tree.classPrefix + "Icon" + this.getnodeDocType(node);
dojo.html.setClass(node.iconNode, clazz);
}, onAfterSetFolder:function (message) {
if (message.source.iconNode) {
this.setnodeDocTypeClass(message.source);
}
}, onAfterUnsetFolder:function (message) {
this.setnodeDocTypeClass(message.source);
}, listenNode:function (node) {
node.contentIconNode = document.createElement("div");
var clazz = node.tree.classPrefix + "IconContent";
if (dojo.render.html.ie) {
clazz = clazz + " " + node.tree.classPrefix + "IEIconContent";
}
dojo.html.setClass(node.contentIconNode, clazz);
node.contentNode.parentNode.replaceChild(node.contentIconNode, node.expandNode);
node.iconNode = document.createElement("div");
dojo.html.setClass(node.iconNode, node.tree.classPrefix + "Icon" + " " + node.tree.classPrefix + "Icon" + this.getnodeDocType(node));
node.contentIconNode.appendChild(node.expandNode);
node.contentIconNode.appendChild(node.iconNode);
dojo.dom.removeNode(node.contentNode);
node.contentIconNode.appendChild(node.contentNode);
}, onAfterChangeTree:function (message) {
var _this = this;
if (!message.oldTree || !this.listenedTrees[message.oldTree.widgetId]) {
this.processDescendants(message.node, this.listenNodeFilter, this.listenNode);
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Clock.js
New file
0,0 → 1,140
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Clock");
dojo.require("dojo.widget.*");
dojo.require("dojo.gfx.*");
dojo.require("dojo.uri.Uri");
dojo.require("dojo.lang.common");
dojo.require("dojo.lang.timing.Timer");
dojo.widget.defineWidget("dojo.widget.Clock", dojo.widget.HtmlWidget, function () {
var self = this;
this.timeZoneOffset = 0;
this.label = "";
this.date = new Date();
this.handColor = "#788598";
this.handStroke = "#6f7b8c";
this.secondHandColor = [201, 4, 5, 0.8];
this.topLabelColor = "#efefef";
this.labelColor = "#fff";
this.timer = new dojo.lang.timing.Timer(1000);
this.center = {x:75, y:75};
this.hands = {hour:null, minute:null, second:null};
this.shadows = {hour:{shadow:null, shift:{dx:2, dy:2}}, minute:{shadow:null, shift:{dx:2, dy:3}}, second:{shadow:null, shift:{dx:4, dy:4}}};
this.image = dojo.uri.moduleUri("dojo.widget", "templates/images/clock.png");
this.surface = null;
this.labelNode = null;
this.topLabelNode = null;
this.draw = function () {
self.date = new Date();
var h = (self.date.getHours() + self.timeZoneOffset) % 12;
var m = self.date.getMinutes();
var s = self.date.getSeconds();
self.placeHour(h, m, s);
self.placeMinute(m, s);
self.placeSecond(s);
self.topLabelNode.innerHTML = ((self.date.getHours() + self.timeZoneOffset) > 11) ? "PM" : "AM";
};
this.timer.onTick = self.draw;
}, {set:function (dt) {
this.date = dt;
if (!this.timer.isRunning) {
this.draw();
}
}, start:function () {
this.timer.start();
}, stop:function () {
this.timer.stop();
}, _initPoly:function (parent, points) {
var path = parent.createPath();
var first = true;
dojo.lang.forEach(points, function (c) {
if (first) {
path.moveTo(c.x, c.y);
first = false;
} else {
path.lineTo(c.x, c.y);
}
});
return path;
}, _placeHand:function (shape, angle, shift) {
var move = {dx:this.center.x + (shift ? shift.dx : 0), dy:this.center.y + (shift ? shift.dy : 0)};
return shape.setTransform([move, dojo.gfx.matrix.rotateg(-angle)]);
}, placeHour:function (h, m, s) {
var angle = 30 * (h + m / 60 + s / 3600);
this._placeHand(this.hands.hour, angle);
this._placeHand(this.shadows.hour.shadow, angle, this.shadows.hour.shift);
}, placeMinute:function (m, s) {
var angle = 6 * (m + s / 60);
this._placeHand(this.hands.minute, angle);
this._placeHand(this.shadows.minute.shadow, angle, this.shadows.minute.shift);
}, placeSecond:function (s) {
var angle = 6 * s;
this._placeHand(this.hands.second, angle);
this._placeHand(this.shadows.second.shadow, angle, this.shadows.second.shift);
}, init:function () {
if (this.domNode.style.position != "absolute") {
this.domNode.style.position = "relative";
}
while (this.domNode.childNodes.length > 0) {
this.domNode.removeChild(this.domNode.childNodes[0]);
}
this.domNode.style.width = "150px";
this.domNode.style.height = "150px";
this.surface = dojo.gfx.createSurface(this.domNode, 150, 150);
this.surface.createRect({width:150, height:150});
this.surface.createImage({width:150, height:150, src:this.image + ""});
var hP = [{x:-3, y:-4}, {x:3, y:-4}, {x:1, y:-27}, {x:-1, y:-27}, {x:-3, y:-4}];
var mP = [{x:-3, y:-4}, {x:3, y:-4}, {x:1, y:-38}, {x:-1, y:-38}, {x:-3, y:-4}];
var sP = [{x:-2, y:-2}, {x:2, y:-2}, {x:1, y:-45}, {x:-1, y:-45}, {x:-2, y:-2}];
this.shadows.hour.shadow = this._initPoly(this.surface, hP).setFill([0, 0, 0, 0.1]);
this.hands.hour = this._initPoly(this.surface, hP).setStroke({color:this.handStroke, width:1}).setFill({type:"linear", x1:0, y1:0, x2:0, y2:-27, colors:[{offset:0, color:"#fff"}, {offset:0.33, color:this.handColor}]});
this.shadows.minute.shadow = this._initPoly(this.surface, mP).setFill([0, 0, 0, 0.1]);
this.hands.minute = this._initPoly(this.surface, mP).setStroke({color:this.handStroke, width:1}).setFill({type:"linear", x1:0, y1:0, x2:0, y2:-38, colors:[{offset:0, color:"#fff"}, {offset:0.33, color:this.handColor}]});
this.surface.createCircle({r:6}).setStroke({color:this.handStroke, width:2}).setFill("#fff").setTransform({dx:75, dy:75});
this.shadows.second.shadow = this._initPoly(this.surface, sP).setFill([0, 0, 0, 0.1]);
this.hands.second = this._initPoly(this.surface, sP).setFill(this.secondHandColor);
this.surface.createCircle({r:4}).setFill(this.secondHandColor).setTransform({dx:75, dy:75});
this.topLabelNode = document.createElement("div");
with (this.topLabelNode.style) {
position = "absolute";
top = "3px";
left = "0px";
color = this.topLabelColor;
textAlign = "center";
width = "150px";
fontFamily = "sans-serif";
fontSize = "11px";
textTransform = "uppercase";
fontWeight = "bold";
}
this.topLabelNode.innerHTML = ((this.date.getHours() + this.timeZoneOffset) > 11) ? "PM" : "AM";
this.domNode.appendChild(this.topLabelNode);
this.labelNode = document.createElement("div");
with (this.labelNode.style) {
position = "absolute";
top = "134px";
left = "0px";
color = this.labelColor;
textAlign = "center";
width = "150px";
fontFamily = "sans-serif";
fontSize = "10px";
textTransform = "uppercase";
fontWeight = "bold";
}
this.labelNode.innerHTML = this.label || "&nbsp;";
this.domNode.appendChild(this.labelNode);
this.draw();
}, postCreate:function () {
this.init();
this.start();
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/TimePicker.js
New file
0,0 → 1,276
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TimePicker");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.event.*");
dojo.require("dojo.date.serialize");
dojo.require("dojo.date.format");
dojo.require("dojo.dom");
dojo.require("dojo.html.style");
dojo.requireLocalization("dojo.i18n.calendar", "gregorian", null, "de,en,es,fi,fr,hu,ja,it,ko,nl,pt,sv,zh,pt-br,zh-cn,zh-hk,zh-tw,ROOT");
dojo.requireLocalization("dojo.widget", "TimePicker", null, "ROOT");
dojo.widget.defineWidget("dojo.widget.TimePicker", dojo.widget.HtmlWidget, function () {
this.time = "";
this.useDefaultTime = false;
this.useDefaultMinutes = false;
this.storedTime = "";
this.currentTime = {};
this.classNames = {selectedTime:"selectedItem"};
this.any = "any";
this.selectedTime = {hour:"", minute:"", amPm:"", anyTime:false};
this.hourIndexMap = ["", 2, 4, 6, 8, 10, 1, 3, 5, 7, 9, 11, 0];
this.minuteIndexMap = [0, 2, 4, 6, 8, 10, 1, 3, 5, 7, 9, 11];
}, {isContainer:false, templateString:"<div class=\"timePickerContainer\" dojoAttachPoint=\"timePickerContainerNode\">\n\t<table class=\"timeContainer\" cellspacing=\"0\" >\n\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<td class=\"timeCorner cornerTopLeft\" valign=\"top\">&nbsp;</td>\n\t\t\t\t<td class=\"timeLabelContainer hourSelector\">${this.calendar.field-hour}</td>\n\t\t\t\t<td class=\"timeLabelContainer minutesHeading\">${this.calendar.field-minute}</td>\n\t\t\t\t<td class=\"timeCorner cornerTopRight\" valign=\"top\">&nbsp;</td>\n\t\t\t</tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td valign=\"top\" colspan=\"2\" class=\"hours\">\n\t\t\t\t\t<table align=\"center\">\n\t\t\t\t\t\t<tbody dojoAttachPoint=\"hourContainerNode\" \n\t\t\t\t\t\t\tdojoAttachEvent=\"onClick: onSetSelectedHour;\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>12</td>\n\t\t\t\t\t\t\t\t<td>6</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>1</td>\n\t\t\t\t\t\t\t\t<td>7</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>2</td>\n\t\t\t\t\t\t\t\t<td>8</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>3</td>\n\t\t\t\t\t\t\t\t<td>9</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>4</td>\n\t\t\t\t\t\t\t\t<td>10</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>5</td>\n\t\t\t\t\t\t\t\t<td>11</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t\t<td valign=\"top\" class=\"minutes\" colspan=\"2\">\n\t\t\t\t\t<table align=\"center\">\n\t\t\t\t\t\t<tbody dojoAttachPoint=\"minuteContainerNode\" \n\t\t\t\t\t\t\tdojoAttachEvent=\"onClick: onSetSelectedMinute;\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>00</td>\n\t\t\t\t\t\t\t\t<td>30</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>05</td>\n\t\t\t\t\t\t\t\t<td>35</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>10</td>\n\t\t\t\t\t\t\t\t<td>40</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>15</td>\n\t\t\t\t\t\t\t\t<td>45</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>20</td>\n\t\t\t\t\t\t\t\t<td>50</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>25</td>\n\t\t\t\t\t\t\t\t<td>55</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class=\"cornerBottomLeft\">&nbsp;</td>\n\t\t\t\t<td valign=\"top\" class=\"timeOptions\">\n\t\t\t\t\t<table class=\"amPmContainer\">\n\t\t\t\t\t\t<tbody dojoAttachPoint=\"amPmContainerNode\" \n\t\t\t\t\t\t\tdojoAttachEvent=\"onClick: onSetSelectedAmPm;\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td id=\"am\">${this.calendar.am}</td>\n\t\t\t\t\t\t\t\t<td id=\"pm\">${this.calendar.pm}</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t\t<td class=\"timeOptions\">\n\t\t\t\t\t<div dojoAttachPoint=\"anyTimeContainerNode\" \n\t\t\t\t\t\tdojoAttachEvent=\"onClick: onSetSelectedAnyTime;\" \n\t\t\t\t\t\tclass=\"anyTimeContainer\">${this.widgetStrings.any}</div>\n\t\t\t\t</td>\n\t\t\t\t<td class=\"cornerBottomRight\">&nbsp;</td>\n\t\t\t</tr>\n\t\t</tbody>\n\t</table>\n</div>\n", templateCssString:"/*Time Picker */\n.timePickerContainer {\n\twidth:122px;\n\tfont-family:Tahoma, Myriad, Helvetica, Arial, Verdana, sans-serif;\n\tfont-size:16px;\n}\n\n.timeContainer {\n\tborder-collapse:collapse;\n\tborder-spacing:0;\n}\n\n.timeContainer thead {\n\tcolor:#293a4b;\n\tfont-size:0.9em;\n\tfont-weight:700;\n}\n\n.timeContainer thead td {\n\tpadding:0.25em;\n\tfont-size:0.80em;\n\tborder-bottom:1px solid #6782A8;\n}\n\n.timeCorner {\n\twidth:10px;\n}\n\n.cornerTopLeft {\n\tbackground: url(\"images/dpCurveTL.png\") top left no-repeat;\n}\n\n.cornerTopRight {\n\tbackground: url(\"images/dpCurveTR.png\") top right no-repeat;\n}\n\n.timeLabelContainer {\n\tbackground: url(\"images/dpMonthBg.png\") top left repeat-x;\n}\n\n.hours, .minutes, .timeBorder {\n\tbackground: #7591bc url(\"images/dpBg.gif\") top left repeat-x;\n\n}\n\n.hours td, .minutes td {\n\tpadding:0.2em;\n\ttext-align:center;\n\tfont-size:0.7em;\n\tfont-weight:bold;\n\tcursor:pointer;\n\tcursor:hand;\n\tcolor:#fff;\n}\n\n.minutes {\n\tborder-left:1px solid #f5d1db;\n}\n\n.hours {\n\tborder-right:1px solid #6782A8;\n}\n\n.hourSelector {\n\tborder-right:1px solid #6782A8;\n\tpadding:5px;\n\tpadding-right:10px;\n}\n\n.minutesSelector {\n\tpadding:5px;\n\tborder-left:1px solid #f5c7d4;\n\ttext-align:center;\n}\n\n.minutesHeading {\n\tpadding-left:9px !important;\n}\n\n.timeOptions {\n\tbackground-color:#F9C9D7;\n}\n\n.timeContainer .cornerBottomLeft, .timeContainer .cornerBottomRight, .timeContainer .timeOptions {\n\tborder-top:1px solid #6782A8;\n}\n\n.timeContainer .cornerBottomLeft {\n\tbackground: url(\"images/dpCurveBL.png\") bottom left no-repeat !important;\n\twidth:9px !important;\n\tpadding:0;\n\tmargin:0;\n}\n\n.timeContainer .cornerBottomRight {\n\tbackground: url(\"images/dpCurveBR.png\") bottom right no-repeat !important;\n\twidth:9px !important;\n\tpadding:0;\n\tmargin:0;\n}\n\n.timeOptions {\n\tcolor:#fff;\n\tbackground:url(\"images/dpYearBg.png\") top left repeat-x;\n\n}\n\n.selectedItem {\n\tbackground-color:#fff;\n\tcolor:#6782a8 !important;\n}\n\n.timeOptions .selectedItem {\n\tcolor:#fff !important;\n\tbackground-color:#9ec3fb !important;\n}\n\n.anyTimeContainer {\n\ttext-align:center;\n\tfont-weight:bold;\n\tfont-size:0.7em;\n\tpadding:0.1em;\n\tcursor:pointer;\n\tcursor:hand;\n\tcolor:#fff !important;\n}\n\n.amPmContainer {\n\twidth:100%;\n}\n\n.amPmContainer td {\n\ttext-align:center;\n\tfont-size:0.7em;\n\tfont-weight:bold;\n\tcursor:pointer;\n\tcursor:hand;\n\tcolor:#fff;\n}\n\n\n\n/*.timePickerContainer {\n\tmargin:1.75em 0 0.5em 0;\n\twidth:10em;\n\tfloat:left;\n}\n\n.timeContainer {\n\tborder-collapse:collapse;\n\tborder-spacing:0;\n}\n\n.timeContainer thead td{\n\tborder-bottom:1px solid #e6e6e6;\n\tpadding:0 0.4em 0.2em 0.4em;\n}\n\n.timeContainer td {\n\tfont-size:0.9em;\n\tpadding:0 0.25em 0 0.25em;\n\ttext-align:left;\n\tcursor:pointer;cursor:hand;\n}\n\n.timeContainer td.minutesHeading {\n\tborder-left:1px solid #e6e6e6;\n\tborder-right:1px solid #e6e6e6;\t\n}\n\n.timeContainer .minutes {\n\tborder-left:1px solid #e6e6e6;\n\tborder-right:1px solid #e6e6e6;\n}\n\n.selectedItem {\n\tbackground-color:#3a3a3a;\n\tcolor:#ffffff;\n}*/\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/TimePicker.css"), postMixInProperties:function (localProperties, frag) {
dojo.widget.TimePicker.superclass.postMixInProperties.apply(this, arguments);
this.calendar = dojo.i18n.getLocalization("dojo.i18n.calendar", "gregorian", this.lang);
this.widgetStrings = dojo.i18n.getLocalization("dojo.widget", "TimePicker", this.lang);
}, fillInTemplate:function (args, frag) {
var source = this.getFragNodeRef(frag);
dojo.html.copyStyle(this.domNode, source);
if (args.value) {
if (args.value instanceof Date) {
this.storedTime = dojo.date.toRfc3339(args.value);
} else {
this.storedTime = args.value;
}
}
this.initData();
this.initUI();
}, initData:function () {
if (this.storedTime.indexOf("T") != -1 && this.storedTime.split("T")[1] && this.storedTime != " " && this.storedTime.split("T")[1] != "any") {
this.time = dojo.widget.TimePicker.util.fromRfcDateTime(this.storedTime, this.useDefaultMinutes, this.selectedTime.anyTime);
} else {
if (this.useDefaultTime) {
this.time = dojo.widget.TimePicker.util.fromRfcDateTime("", this.useDefaultMinutes, this.selectedTime.anyTime);
} else {
this.selectedTime.anyTime = true;
this.time = dojo.widget.TimePicker.util.fromRfcDateTime("", 0, 1);
}
}
}, initUI:function () {
if (!this.selectedTime.anyTime && this.time) {
var amPmHour = dojo.widget.TimePicker.util.toAmPmHour(this.time.getHours());
var hour = amPmHour[0];
var isAm = amPmHour[1];
var minute = this.time.getMinutes();
var minuteIndex = parseInt(minute / 5);
this.onSetSelectedHour(this.hourIndexMap[hour]);
this.onSetSelectedMinute(this.minuteIndexMap[minuteIndex]);
this.onSetSelectedAmPm(isAm);
} else {
this.onSetSelectedAnyTime();
}
}, setTime:function (date) {
if (date) {
this.selectedTime.anyTime = false;
this.setDateTime(dojo.date.toRfc3339(date));
} else {
this.selectedTime.anyTime = true;
}
this.initData();
this.initUI();
}, setDateTime:function (rfcDate) {
this.storedTime = rfcDate;
}, onClearSelectedHour:function (evt) {
this.clearSelectedHour();
}, onClearSelectedMinute:function (evt) {
this.clearSelectedMinute();
}, onClearSelectedAmPm:function (evt) {
this.clearSelectedAmPm();
}, onClearSelectedAnyTime:function (evt) {
this.clearSelectedAnyTime();
if (this.selectedTime.anyTime) {
this.selectedTime.anyTime = false;
this.time = dojo.widget.TimePicker.util.fromRfcDateTime("", this.useDefaultMinutes);
this.initUI();
}
}, clearSelectedHour:function () {
var hourNodes = this.hourContainerNode.getElementsByTagName("td");
for (var i = 0; i < hourNodes.length; i++) {
dojo.html.setClass(hourNodes.item(i), "");
}
}, clearSelectedMinute:function () {
var minuteNodes = this.minuteContainerNode.getElementsByTagName("td");
for (var i = 0; i < minuteNodes.length; i++) {
dojo.html.setClass(minuteNodes.item(i), "");
}
}, clearSelectedAmPm:function () {
var amPmNodes = this.amPmContainerNode.getElementsByTagName("td");
for (var i = 0; i < amPmNodes.length; i++) {
dojo.html.setClass(amPmNodes.item(i), "");
}
}, clearSelectedAnyTime:function () {
dojo.html.setClass(this.anyTimeContainerNode, "anyTimeContainer");
}, onSetSelectedHour:function (evt) {
this.onClearSelectedAnyTime();
this.onClearSelectedHour();
this.setSelectedHour(evt);
this.onSetTime();
}, setSelectedHour:function (evt) {
if (evt && evt.target) {
if (evt.target.nodeType == dojo.dom.ELEMENT_NODE) {
var eventTarget = evt.target;
} else {
var eventTarget = evt.target.parentNode;
}
dojo.event.browser.stopEvent(evt);
dojo.html.setClass(eventTarget, this.classNames.selectedTime);
this.selectedTime["hour"] = eventTarget.innerHTML;
} else {
if (!isNaN(evt)) {
var hourNodes = this.hourContainerNode.getElementsByTagName("td");
if (hourNodes.item(evt)) {
dojo.html.setClass(hourNodes.item(evt), this.classNames.selectedTime);
this.selectedTime["hour"] = hourNodes.item(evt).innerHTML;
}
}
}
this.selectedTime.anyTime = false;
}, onSetSelectedMinute:function (evt) {
this.onClearSelectedAnyTime();
this.onClearSelectedMinute();
this.setSelectedMinute(evt);
this.selectedTime.anyTime = false;
this.onSetTime();
}, setSelectedMinute:function (evt) {
if (evt && evt.target) {
if (evt.target.nodeType == dojo.dom.ELEMENT_NODE) {
var eventTarget = evt.target;
} else {
var eventTarget = evt.target.parentNode;
}
dojo.event.browser.stopEvent(evt);
dojo.html.setClass(eventTarget, this.classNames.selectedTime);
this.selectedTime["minute"] = eventTarget.innerHTML;
} else {
if (!isNaN(evt)) {
var minuteNodes = this.minuteContainerNode.getElementsByTagName("td");
if (minuteNodes.item(evt)) {
dojo.html.setClass(minuteNodes.item(evt), this.classNames.selectedTime);
this.selectedTime["minute"] = minuteNodes.item(evt).innerHTML;
}
}
}
}, onSetSelectedAmPm:function (evt) {
this.onClearSelectedAnyTime();
this.onClearSelectedAmPm();
this.setSelectedAmPm(evt);
this.selectedTime.anyTime = false;
this.onSetTime();
}, setSelectedAmPm:function (evt) {
var eventTarget = evt.target;
if (evt && eventTarget) {
if (eventTarget.nodeType != dojo.dom.ELEMENT_NODE) {
eventTarget = eventTarget.parentNode;
}
dojo.event.browser.stopEvent(evt);
this.selectedTime.amPm = eventTarget.id;
dojo.html.setClass(eventTarget, this.classNames.selectedTime);
} else {
evt = evt ? 0 : 1;
var amPmNodes = this.amPmContainerNode.getElementsByTagName("td");
if (amPmNodes.item(evt)) {
this.selectedTime.amPm = amPmNodes.item(evt).id;
dojo.html.setClass(amPmNodes.item(evt), this.classNames.selectedTime);
}
}
}, onSetSelectedAnyTime:function (evt) {
this.onClearSelectedHour();
this.onClearSelectedMinute();
this.onClearSelectedAmPm();
this.setSelectedAnyTime();
this.onSetTime();
}, setSelectedAnyTime:function (evt) {
this.selectedTime.anyTime = true;
dojo.html.setClass(this.anyTimeContainerNode, this.classNames.selectedTime + " " + "anyTimeContainer");
}, onClick:function (evt) {
dojo.event.browser.stopEvent(evt);
}, onSetTime:function () {
if (this.selectedTime.anyTime) {
this.time = new Date();
var tempDateTime = dojo.widget.TimePicker.util.toRfcDateTime(this.time);
this.setDateTime(tempDateTime.split("T")[0]);
} else {
var hour = 12;
var minute = 0;
var isAm = false;
if (this.selectedTime["hour"]) {
hour = parseInt(this.selectedTime["hour"], 10);
}
if (this.selectedTime["minute"]) {
minute = parseInt(this.selectedTime["minute"], 10);
}
if (this.selectedTime["amPm"]) {
isAm = (this.selectedTime["amPm"].toLowerCase() == "am");
}
this.time = new Date();
this.time.setHours(dojo.widget.TimePicker.util.fromAmPmHour(hour, isAm));
this.time.setMinutes(minute);
this.setDateTime(dojo.widget.TimePicker.util.toRfcDateTime(this.time));
}
this.onValueChanged(this.time);
}, onValueChanged:function (date) {
}});
dojo.widget.TimePicker.util = new function () {
this.toRfcDateTime = function (jsDate) {
if (!jsDate) {
jsDate = new Date();
}
jsDate.setSeconds(0);
return dojo.date.strftime(jsDate, "%Y-%m-%dT%H:%M:00%z");
};
this.fromRfcDateTime = function (rfcDate, useDefaultMinutes, isAnyTime) {
var tempDate = new Date();
if (!rfcDate || rfcDate.indexOf("T") == -1) {
if (useDefaultMinutes) {
tempDate.setMinutes(Math.floor(tempDate.getMinutes() / 5) * 5);
} else {
tempDate.setMinutes(0);
}
} else {
var tempTime = rfcDate.split("T")[1].split(":");
var tempDate = new Date();
tempDate.setHours(tempTime[0]);
tempDate.setMinutes(tempTime[1]);
}
return tempDate;
};
this.toAmPmHour = function (hour) {
var amPmHour = hour;
var isAm = true;
if (amPmHour == 0) {
amPmHour = 12;
} else {
if (amPmHour > 12) {
amPmHour = amPmHour - 12;
isAm = false;
} else {
if (amPmHour == 12) {
isAm = false;
}
}
}
return [amPmHour, isAm];
};
this.fromAmPmHour = function (amPmHour, isAm) {
var hour = parseInt(amPmHour, 10);
if (isAm && hour == 12) {
hour = 0;
} else {
if (!isAm && hour < 12) {
hour = hour + 12;
}
}
return hour;
};
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/ColorPalette.js
New file
0,0 → 1,58
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.ColorPalette");
dojo.require("dojo.widget.*");
dojo.require("dojo.html.layout");
dojo.require("dojo.html.display");
dojo.require("dojo.html.selection");
dojo.widget.defineWidget("dojo.widget.ColorPalette", dojo.widget.HtmlWidget, {palette:"7x10", _palettes:{"7x10":[["fff", "fcc", "fc9", "ff9", "ffc", "9f9", "9ff", "cff", "ccf", "fcf"], ["ccc", "f66", "f96", "ff6", "ff3", "6f9", "3ff", "6ff", "99f", "f9f"], ["c0c0c0", "f00", "f90", "fc6", "ff0", "3f3", "6cc", "3cf", "66c", "c6c"], ["999", "c00", "f60", "fc3", "fc0", "3c0", "0cc", "36f", "63f", "c3c"], ["666", "900", "c60", "c93", "990", "090", "399", "33f", "60c", "939"], ["333", "600", "930", "963", "660", "060", "366", "009", "339", "636"], ["000", "300", "630", "633", "330", "030", "033", "006", "309", "303"]], "3x4":[["ffffff", "00ff00", "008000", "0000ff"], ["c0c0c0", "ffff00", "ff00ff", "000080"], ["808080", "ff0000", "800080", "000000"]]}, buildRendering:function () {
this.domNode = document.createElement("table");
dojo.html.disableSelection(this.domNode);
dojo.event.connect(this.domNode, "onmousedown", function (e) {
e.preventDefault();
});
with (this.domNode) {
cellPadding = "0";
cellSpacing = "1";
border = "1";
style.backgroundColor = "white";
}
var colors = this._palettes[this.palette];
for (var i = 0; i < colors.length; i++) {
var tr = this.domNode.insertRow(-1);
for (var j = 0; j < colors[i].length; j++) {
if (colors[i][j].length == 3) {
colors[i][j] = colors[i][j].replace(/(.)(.)(.)/, "$1$1$2$2$3$3");
}
var td = tr.insertCell(-1);
with (td.style) {
backgroundColor = "#" + colors[i][j];
border = "1px solid gray";
width = height = "15px";
fontSize = "1px";
}
td.color = "#" + colors[i][j];
td.onmouseover = function (e) {
this.style.borderColor = "white";
};
td.onmouseout = function (e) {
this.style.borderColor = "gray";
};
dojo.event.connect(td, "onmousedown", this, "onClick");
td.innerHTML = "&nbsp;";
}
}
}, onClick:function (e) {
this.onColorSelect(e.currentTarget.color);
e.currentTarget.style.borderColor = "gray";
}, onColorSelect:function (color) {
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Tree.js
New file
0,0 → 1,234
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Tree");
dojo.require("dojo.widget.*");
dojo.require("dojo.event.*");
dojo.require("dojo.io.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.TreeNode");
dojo.require("dojo.html.common");
dojo.require("dojo.html.selection");
dojo.widget.defineWidget("dojo.widget.Tree", dojo.widget.HtmlWidget, function () {
this.eventNames = {};
this.tree = this;
this.DNDAcceptTypes = [];
this.actionsDisabled = [];
}, {widgetType:"Tree", eventNamesDefault:{createDOMNode:"createDOMNode", treeCreate:"treeCreate", treeDestroy:"treeDestroy", treeClick:"treeClick", iconClick:"iconClick", titleClick:"titleClick", moveFrom:"moveFrom", moveTo:"moveTo", addChild:"addChild", removeNode:"removeNode", expand:"expand", collapse:"collapse"}, isContainer:true, DNDMode:"off", lockLevel:0, strictFolders:true, DNDModes:{BETWEEN:1, ONTO:2}, DNDAcceptTypes:"", templateCssString:"\n.dojoTree {\n\tfont: caption;\n\tfont-size: 11px;\n\tfont-weight: normal;\n\toverflow: auto;\n}\n\n\n.dojoTreeNodeLabelTitle {\n\tpadding-left: 2px;\n\tcolor: WindowText;\n}\n\n.dojoTreeNodeLabel {\n\tcursor:hand;\n\tcursor:pointer;\n}\n\n.dojoTreeNodeLabelTitle:hover {\n\ttext-decoration: underline;\n}\n\n.dojoTreeNodeLabelSelected {\n\tbackground-color: Highlight;\n\tcolor: HighlightText;\n}\n\n.dojoTree div {\n\twhite-space: nowrap;\n}\n\n.dojoTree img, .dojoTreeNodeLabel img {\n\tvertical-align: middle;\n}\n\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/Tree.css"), templateString:"<div class=\"dojoTree\"></div>", isExpanded:true, isTree:true, objectId:"", controller:"", selector:"", menu:"", expandLevel:"", blankIconSrc:dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_blank.gif"), gridIconSrcT:dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_grid_t.gif"), gridIconSrcL:dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_grid_l.gif"), gridIconSrcV:dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_grid_v.gif"), gridIconSrcP:dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_grid_p.gif"), gridIconSrcC:dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_grid_c.gif"), gridIconSrcX:dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_grid_x.gif"), gridIconSrcY:dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_grid_y.gif"), gridIconSrcZ:dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_grid_z.gif"), expandIconSrcPlus:dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_expand_plus.gif"), expandIconSrcMinus:dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_expand_minus.gif"), expandIconSrcLoading:dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/treenode_loading.gif"), iconWidth:18, iconHeight:18, showGrid:true, showRootGrid:true, actionIsDisabled:function (action) {
var _this = this;
return dojo.lang.inArray(_this.actionsDisabled, action);
}, actions:{ADDCHILD:"ADDCHILD"}, getInfo:function () {
var info = {widgetId:this.widgetId, objectId:this.objectId};
return info;
}, initializeController:function () {
if (this.controller != "off") {
if (this.controller) {
this.controller = dojo.widget.byId(this.controller);
} else {
dojo.require("dojo.widget.TreeBasicController");
this.controller = dojo.widget.createWidget("TreeBasicController", {DNDController:(this.DNDMode ? "create" : ""), dieWithTree:true});
}
this.controller.listenTree(this);
} else {
this.controller = null;
}
}, initializeSelector:function () {
if (this.selector != "off") {
if (this.selector) {
this.selector = dojo.widget.byId(this.selector);
} else {
dojo.require("dojo.widget.TreeSelector");
this.selector = dojo.widget.createWidget("TreeSelector", {dieWithTree:true});
}
this.selector.listenTree(this);
} else {
this.selector = null;
}
}, initialize:function (args, frag) {
var _this = this;
for (name in this.eventNamesDefault) {
if (dojo.lang.isUndefined(this.eventNames[name])) {
this.eventNames[name] = this.widgetId + "/" + this.eventNamesDefault[name];
}
}
for (var i = 0; i < this.actionsDisabled.length; i++) {
this.actionsDisabled[i] = this.actionsDisabled[i].toUpperCase();
}
if (this.DNDMode == "off") {
this.DNDMode = 0;
} else {
if (this.DNDMode == "between") {
this.DNDMode = this.DNDModes.ONTO | this.DNDModes.BETWEEN;
} else {
if (this.DNDMode == "onto") {
this.DNDMode = this.DNDModes.ONTO;
}
}
}
this.expandLevel = parseInt(this.expandLevel);
this.initializeSelector();
this.initializeController();
if (this.menu) {
this.menu = dojo.widget.byId(this.menu);
this.menu.listenTree(this);
}
this.containerNode = this.domNode;
}, postCreate:function () {
this.createDOMNode();
}, createDOMNode:function () {
dojo.html.disableSelection(this.domNode);
for (var i = 0; i < this.children.length; i++) {
this.children[i].parent = this;
var node = this.children[i].createDOMNode(this, 0);
this.domNode.appendChild(node);
}
if (!this.showRootGrid) {
for (var i = 0; i < this.children.length; i++) {
this.children[i].expand();
}
}
dojo.event.topic.publish(this.eventNames.treeCreate, {source:this});
}, destroy:function () {
dojo.event.topic.publish(this.tree.eventNames.treeDestroy, {source:this});
return dojo.widget.HtmlWidget.prototype.destroy.apply(this, arguments);
}, addChild:function (child, index) {
var message = {child:child, index:index, parent:this, domNodeInitialized:child.domNodeInitialized};
this.doAddChild.apply(this, arguments);
dojo.event.topic.publish(this.tree.eventNames.addChild, message);
}, doAddChild:function (child, index) {
if (dojo.lang.isUndefined(index)) {
index = this.children.length;
}
if (!child.isTreeNode) {
dojo.raise("You can only add TreeNode widgets to a " + this.widgetType + " widget!");
return;
}
if (this.isTreeNode) {
if (!this.isFolder) {
this.setFolder();
}
}
var _this = this;
dojo.lang.forEach(child.getDescendants(), function (elem) {
elem.tree = _this.tree;
});
child.parent = this;
if (this.isTreeNode) {
this.state = this.loadStates.LOADED;
}
if (index < this.children.length) {
dojo.html.insertBefore(child.domNode, this.children[index].domNode);
} else {
this.containerNode.appendChild(child.domNode);
if (this.isExpanded && this.isTreeNode) {
this.showChildren();
}
}
this.children.splice(index, 0, child);
if (child.domNodeInitialized) {
var d = this.isTreeNode ? this.depth : -1;
child.adjustDepth(d - child.depth + 1);
child.updateIconTree();
} else {
child.depth = this.isTreeNode ? this.depth + 1 : 0;
child.createDOMNode(child.tree, child.depth);
}
var prevSibling = child.getPreviousSibling();
if (child.isLastChild() && prevSibling) {
prevSibling.updateExpandGridColumn();
}
}, makeBlankImg:function () {
var img = document.createElement("img");
img.style.width = this.iconWidth + "px";
img.style.height = this.iconHeight + "px";
img.src = this.blankIconSrc;
img.style.verticalAlign = "middle";
return img;
}, updateIconTree:function () {
if (!this.isTree) {
this.updateIcons();
}
for (var i = 0; i < this.children.length; i++) {
this.children[i].updateIconTree();
}
}, toString:function () {
return "[" + this.widgetType + " ID:" + this.widgetId + "]";
}, move:function (child, newParent, index) {
var oldParent = child.parent;
var oldTree = child.tree;
this.doMove.apply(this, arguments);
var newParent = child.parent;
var newTree = child.tree;
var message = {oldParent:oldParent, oldTree:oldTree, newParent:newParent, newTree:newTree, child:child};
dojo.event.topic.publish(oldTree.eventNames.moveFrom, message);
dojo.event.topic.publish(newTree.eventNames.moveTo, message);
}, doMove:function (child, newParent, index) {
child.parent.doRemoveNode(child);
newParent.doAddChild(child, index);
}, removeNode:function (child) {
if (!child.parent) {
return;
}
var oldTree = child.tree;
var oldParent = child.parent;
var removedChild = this.doRemoveNode.apply(this, arguments);
dojo.event.topic.publish(this.tree.eventNames.removeNode, {child:removedChild, tree:oldTree, parent:oldParent});
return removedChild;
}, doRemoveNode:function (child) {
if (!child.parent) {
return;
}
var parent = child.parent;
var children = parent.children;
var index = child.getParentIndex();
if (index < 0) {
dojo.raise("Couldn't find node " + child + " for removal");
}
children.splice(index, 1);
dojo.html.removeNode(child.domNode);
if (parent.children.length == 0 && !parent.isTree) {
parent.containerNode.style.display = "none";
}
if (index == children.length && index > 0) {
children[index - 1].updateExpandGridColumn();
}
if (parent instanceof dojo.widget.Tree && index == 0 && children.length > 0) {
children[0].updateExpandGrid();
}
child.parent = child.tree = null;
return child;
}, markLoading:function () {
}, unMarkLoading:function () {
}, lock:function () {
!this.lockLevel && this.markLoading();
this.lockLevel++;
}, unlock:function () {
if (!this.lockLevel) {
dojo.raise("unlock: not locked");
}
this.lockLevel--;
!this.lockLevel && this.unMarkLoading();
}, isLocked:function () {
var node = this;
while (true) {
if (node.lockLevel) {
return true;
}
if (node instanceof dojo.widget.Tree) {
break;
}
node = node.parent;
}
return false;
}, flushLock:function () {
this.lockLevel = 0;
this.unMarkLoading();
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/TreeControllerExtension.js
New file
0,0 → 1,58
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeControllerExtension");
dojo.declare("dojo.widget.TreeControllerExtension", null, {saveExpandedIndices:function (node, field) {
var obj = {};
for (var i = 0; i < node.children.length; i++) {
if (node.children[i].isExpanded) {
var key = dojo.lang.isUndefined(field) ? i : node.children[i][field];
obj[key] = this.saveExpandedIndices(node.children[i], field);
}
}
return obj;
}, restoreExpandedIndices:function (node, savedIndices, field) {
var _this = this;
var handler = function (node, savedIndices) {
this.node = node;
this.savedIndices = savedIndices;
this.process = function () {
_this.restoreExpandedIndices(this.node, this.savedIndices, field);
};
};
for (var i = 0; i < node.children.length; i++) {
var child = node.children[i];
var found = false;
var key = -1;
if (dojo.lang.isUndefined(field) && savedIndices[i]) {
found = true;
key = i;
}
if (field) {
for (var key in savedIndices) {
if (key == child[field]) {
found = true;
break;
}
}
}
if (found) {
var h = new handler(child, savedIndices[key]);
_this.expand(child, false, h, h.process);
} else {
if (child.isExpanded) {
dojo.lang.forEach(child.getDescendants(), function (elem) {
_this.collapse(elem);
});
}
}
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Wizard.js
New file
0,0 → 1,125
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Wizard");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.LayoutContainer");
dojo.require("dojo.widget.ContentPane");
dojo.require("dojo.event.*");
dojo.require("dojo.html.style");
dojo.widget.defineWidget("dojo.widget.WizardContainer", dojo.widget.LayoutContainer, {templateString:"<div class=\"WizardContainer\" dojoAttachPoint=\"wizardNode\">\n <div class=\"WizardText\" dojoAttachPoint=\"wizardPanelContainerNode\">\n </div>\n <div class=\"WizardButtonHolder\" dojoAttachPoint=\"wizardControlContainerNode\">\n <input class=\"WizardButton\" type=\"button\" dojoAttachPoint=\"previousButton\"/>\n <input class=\"WizardButton\" type=\"button\" dojoAttachPoint=\"nextButton\"/>\n <input class=\"WizardButton\" type=\"button\" dojoAttachPoint=\"doneButton\" style=\"display:none\"/>\n <input class=\"WizardButton\" type=\"button\" dojoAttachPoint=\"cancelButton\"/>\n </div>\n</div>\n", templateCssString:".WizardContainer {\n\tbackground: #EEEEEE;\n\tborder: #798EC5 1px solid;\n\tpadding: 2px;\n}\n\n.WizardTitle {\n\tcolor: #003366;\n\tpadding: 8px 5px 15px 2px;\n\tfont-weight: bold;\n\tfont-size: x-small;\n\tfont-style: normal;\n\tfont-family: Verdana, Arial, Helvetica;\n\ttext-align: left;\n}\n\n.WizardText {\n\tcolor: #000033;\n\tfont-weight: normal;\n\tfont-size: xx-small;\n\tfont-family: Verdana, Arial, Helvetica;\n\tpadding: 2 50; text-align: justify;\n}\n\n.WizardLightText {\n\tcolor: #666666;\n\tfont-weight: normal;\n\tfont-size: xx-small;\n\tfont-family: verdana, arial, helvetica;\n\tpadding: 2px 50px;\n\ttext-align: justify;\n}\n\n.WizardButtonHolder {\n\ttext-align: right;\n\tpadding: 10px 5px;\n}\n\n.WizardButton {\n\tcolor: #ffffff;\n\tbackground: #798EC5;\n\tfont-size: xx-small;\n\tfont-family: verdana, arial, helvetica, sans-serif;\n\tborder-right: #000000 1px solid;\n\tborder-bottom: #000000 1px solid;\n\tborder-left: #666666 1px solid;\n\tborder-top: #666666 1px solid;\n\tpadding-right: 4px;\n\tpadding-left: 4px;\n\ttext-decoration: none; height: 18px;\n}\n\n.WizardButton:hover {\n\tcursor: pointer;\n}\n\n.WizardButtonDisabled {\n\tcolor: #eeeeee;\n\tbackground-color: #999999;\n\tfont-size: xx-small;\n\tFONT-FAMILY: verdana, arial, helvetica, sans-serif;\n\tborder-right: #000000 1px solid;\n\tborder-bottom: #000000 1px solid;\n\tborder-left: #798EC5 1px solid;\n\tborder-top: #798EC5 1px solid;\n\tpadding-right: 4px;\n\tpadding-left: 4px;\n\ttext-decoration: none;\n\theight: 18px;\n}\n\n\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/Wizard.css"), selected:null, nextButtonLabel:"next", previousButtonLabel:"previous", cancelButtonLabel:"cancel", doneButtonLabel:"done", cancelFunction:"", hideDisabledButtons:false, fillInTemplate:function (args, frag) {
dojo.event.connect(this.nextButton, "onclick", this, "_onNextButtonClick");
dojo.event.connect(this.previousButton, "onclick", this, "_onPreviousButtonClick");
if (this.cancelFunction) {
dojo.event.connect(this.cancelButton, "onclick", this.cancelFunction);
} else {
this.cancelButton.style.display = "none";
}
dojo.event.connect(this.doneButton, "onclick", this, "done");
this.nextButton.value = this.nextButtonLabel;
this.previousButton.value = this.previousButtonLabel;
this.cancelButton.value = this.cancelButtonLabel;
this.doneButton.value = this.doneButtonLabel;
}, _checkButtons:function () {
var lastStep = !this.hasNextPanel();
this.nextButton.disabled = lastStep;
this._setButtonClass(this.nextButton);
if (this.selected.doneFunction) {
this.doneButton.style.display = "";
if (lastStep) {
this.nextButton.style.display = "none";
}
} else {
this.doneButton.style.display = "none";
}
this.previousButton.disabled = ((!this.hasPreviousPanel()) || (!this.selected.canGoBack));
this._setButtonClass(this.previousButton);
}, _setButtonClass:function (button) {
if (!this.hideDisabledButtons) {
button.style.display = "";
dojo.html.setClass(button, button.disabled ? "WizardButtonDisabled" : "WizardButton");
} else {
button.style.display = button.disabled ? "none" : "";
}
}, registerChild:function (panel, insertionIndex) {
dojo.widget.WizardContainer.superclass.registerChild.call(this, panel, insertionIndex);
this.wizardPanelContainerNode.appendChild(panel.domNode);
panel.hide();
if (!this.selected) {
this.onSelected(panel);
}
this._checkButtons();
}, onSelected:function (panel) {
if (this.selected) {
if (this.selected._checkPass()) {
this.selected.hide();
} else {
return;
}
}
panel.show();
this.selected = panel;
}, getPanels:function () {
return this.getChildrenOfType("WizardPane", false);
}, selectedIndex:function () {
if (this.selected) {
return dojo.lang.indexOf(this.getPanels(), this.selected);
}
return -1;
}, _onNextButtonClick:function () {
var selectedIndex = this.selectedIndex();
if (selectedIndex > -1) {
var childPanels = this.getPanels();
if (childPanels[selectedIndex + 1]) {
this.onSelected(childPanels[selectedIndex + 1]);
}
}
this._checkButtons();
}, _onPreviousButtonClick:function () {
var selectedIndex = this.selectedIndex();
if (selectedIndex > -1) {
var childPanels = this.getPanels();
if (childPanels[selectedIndex - 1]) {
this.onSelected(childPanels[selectedIndex - 1]);
}
}
this._checkButtons();
}, hasNextPanel:function () {
var selectedIndex = this.selectedIndex();
return (selectedIndex < (this.getPanels().length - 1));
}, hasPreviousPanel:function () {
var selectedIndex = this.selectedIndex();
return (selectedIndex > 0);
}, done:function () {
this.selected.done();
}});
dojo.widget.defineWidget("dojo.widget.WizardPane", dojo.widget.ContentPane, {canGoBack:true, passFunction:"", doneFunction:"", postMixInProperties:function (args, frag) {
if (this.passFunction) {
this.passFunction = dj_global[this.passFunction];
}
if (this.doneFunction) {
this.doneFunction = dj_global[this.doneFunction];
}
dojo.widget.WizardPane.superclass.postMixInProperties.apply(this, arguments);
}, _checkPass:function () {
if (this.passFunction && dojo.lang.isFunction(this.passFunction)) {
var failMessage = this.passFunction();
if (failMessage) {
alert(failMessage);
return false;
}
}
return true;
}, done:function () {
if (this.doneFunction && dojo.lang.isFunction(this.doneFunction)) {
this.doneFunction();
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/TreeSelector.js
New file
0,0 → 1,100
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeSelector");
dojo.require("dojo.widget.HtmlWidget");
dojo.widget.defineWidget("dojo.widget.TreeSelector", dojo.widget.HtmlWidget, function () {
this.eventNames = {};
this.listenedTrees = [];
}, {widgetType:"TreeSelector", selectedNode:null, dieWithTree:false, eventNamesDefault:{select:"select", destroy:"destroy", deselect:"deselect", dblselect:"dblselect"}, initialize:function () {
for (name in this.eventNamesDefault) {
if (dojo.lang.isUndefined(this.eventNames[name])) {
this.eventNames[name] = this.widgetId + "/" + this.eventNamesDefault[name];
}
}
}, destroy:function () {
dojo.event.topic.publish(this.eventNames.destroy, {source:this});
return dojo.widget.HtmlWidget.prototype.destroy.apply(this, arguments);
}, listenTree:function (tree) {
dojo.event.topic.subscribe(tree.eventNames.titleClick, this, "select");
dojo.event.topic.subscribe(tree.eventNames.iconClick, this, "select");
dojo.event.topic.subscribe(tree.eventNames.collapse, this, "onCollapse");
dojo.event.topic.subscribe(tree.eventNames.moveFrom, this, "onMoveFrom");
dojo.event.topic.subscribe(tree.eventNames.removeNode, this, "onRemoveNode");
dojo.event.topic.subscribe(tree.eventNames.treeDestroy, this, "onTreeDestroy");
this.listenedTrees.push(tree);
}, unlistenTree:function (tree) {
dojo.event.topic.unsubscribe(tree.eventNames.titleClick, this, "select");
dojo.event.topic.unsubscribe(tree.eventNames.iconClick, this, "select");
dojo.event.topic.unsubscribe(tree.eventNames.collapse, this, "onCollapse");
dojo.event.topic.unsubscribe(tree.eventNames.moveFrom, this, "onMoveFrom");
dojo.event.topic.unsubscribe(tree.eventNames.removeNode, this, "onRemoveNode");
dojo.event.topic.unsubscribe(tree.eventNames.treeDestroy, this, "onTreeDestroy");
for (var i = 0; i < this.listenedTrees.length; i++) {
if (this.listenedTrees[i] === tree) {
this.listenedTrees.splice(i, 1);
break;
}
}
}, onTreeDestroy:function (message) {
this.unlistenTree(message.source);
if (this.dieWithTree) {
this.destroy();
}
}, onCollapse:function (message) {
if (!this.selectedNode) {
return;
}
var node = message.source;
var parent = this.selectedNode.parent;
while (parent !== node && parent.isTreeNode) {
parent = parent.parent;
}
if (parent.isTreeNode) {
this.deselect();
}
}, select:function (message) {
var node = message.source;
var e = message.event;
if (this.selectedNode === node) {
if (e.ctrlKey || e.shiftKey || e.metaKey) {
this.deselect();
return;
}
dojo.event.topic.publish(this.eventNames.dblselect, {node:node});
return;
}
if (this.selectedNode) {
this.deselect();
}
this.doSelect(node);
dojo.event.topic.publish(this.eventNames.select, {node:node});
}, onMoveFrom:function (message) {
if (message.child !== this.selectedNode) {
return;
}
if (!dojo.lang.inArray(this.listenedTrees, message.newTree)) {
this.deselect();
}
}, onRemoveNode:function (message) {
if (message.child !== this.selectedNode) {
return;
}
this.deselect();
}, doSelect:function (node) {
node.markSelected();
this.selectedNode = node;
}, deselect:function () {
var node = this.selectedNode;
this.selectedNode = null;
node.unMarkSelected();
dojo.event.topic.publish(this.eventNames.deselect, {node:node});
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/SlideShow.js
New file
0,0 → 1,75
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.SlideShow");
dojo.require("dojo.event.*");
dojo.require("dojo.widget.*");
dojo.require("dojo.lfx.*");
dojo.require("dojo.html.display");
dojo.widget.defineWidget("dojo.widget.SlideShow", dojo.widget.HtmlWidget, {templateString:"<div style=\"position: relative; padding: 3px;\">\n\t\t<div>\n\t\t\t<input type=\"button\" value=\"pause\" \n\t\t\t\tdojoAttachPoint=\"startStopButton\"\n\t\t\t\tdojoAttachEvent=\"onClick: togglePaused;\">\n\t\t</div>\n\t\t<div style=\"position: relative; width: ${this.width}; height: ${this.height};\"\n\t\t\tdojoAttachPoint=\"imagesContainer\"\n\t\t\tdojoAttachEvent=\"onClick: togglePaused;\">\n\t\t\t<img dojoAttachPoint=\"img1\" class=\"slideShowImg\" \n\t\t\t\tstyle=\"z-index: 1; width: ${this.width}; height: ${this.height};\" />\n\t\t\t<img dojoAttachPoint=\"img2\" class=\"slideShowImg\" \n\t\t\t\tstyle=\"z-index: 0; width: ${this.width}; height: ${this.height};\" />\n\t\t</div>\t\n</div>\n", templateCssString:".slideShowImg {\n\tposition: absolute;\n\tleft: 0px;\n\ttop: 0px; \n\tborder: 2px solid #4d4d4d;\n\tpadding: 0px;\n\tmargin: 0px;\n}\n\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/SlideShow.css"), imgUrls:[], imgUrlBase:"", delay:4000, transitionInterval:2000, imgWidth:800, imgHeight:600, preventCache:false, stopped:false, _urlsIdx:0, _background:"img2", _foreground:"img1", fadeAnim:null, startStopButton:null, img1:null, img2:null, postMixInProperties:function () {
this.width = this.imgWidth + "px";
this.height = this.imgHeight + "px";
}, fillInTemplate:function () {
if (dojo.render.html.safari && this.imgUrls.length == 2) {
this.preventCache = true;
}
dojo.html.setOpacity(this.img1, 0.9999);
dojo.html.setOpacity(this.img2, 0.9999);
if (this.imgUrls.length > 1) {
this.img2.src = this.imgUrlBase + this.imgUrls[this._urlsIdx++] + this._getUrlSuffix();
this._endTransition();
} else {
this.img1.src = this.imgUrlBase + this.imgUrls[this._urlsIdx++] + this._getUrlSuffix();
}
}, _getUrlSuffix:function () {
if (this.preventCache) {
return "?ts=" + (new Date()).getTime();
} else {
return "";
}
}, togglePaused:function () {
if (this.stopped) {
this.stopped = false;
this._backgroundImageLoaded();
this.startStopButton.value = "pause";
} else {
this.stopped = true;
this.startStopButton.value = "play";
}
}, _backgroundImageLoaded:function () {
if (this.stopped) {
return;
}
if (this.fadeAnim) {
this.fadeAnim.stop();
}
this.fadeAnim = dojo.lfx.fadeOut(this[this._foreground], this.transitionInterval, null);
dojo.event.connect(this.fadeAnim, "onEnd", this, "_endTransition");
this.fadeAnim.play();
}, _endTransition:function () {
with (this[this._background].style) {
zIndex = parseInt(zIndex) + 1;
}
with (this[this._foreground].style) {
zIndex = parseInt(zIndex) - 1;
}
var tmp = this._foreground;
this._foreground = this._background;
this._background = tmp;
this._loadNextImage();
}, _loadNextImage:function () {
dojo.event.kwConnect({srcObj:this[this._background], srcFunc:"onload", adviceObj:this, adviceFunc:"_backgroundImageLoaded", once:true, delay:this.delay});
dojo.html.setOpacity(this[this._background], 1);
this[this._background].src = this.imgUrlBase + this.imgUrls[this._urlsIdx++];
if (this._urlsIdx > (this.imgUrls.length - 1)) {
this._urlsIdx = 0;
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/UsTextbox.js
New file
0,0 → 1,34
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.UsTextbox");
dojo.require("dojo.widget.ValidationTextbox");
dojo.require("dojo.validate.us");
dojo.widget.defineWidget("dojo.widget.UsStateTextbox", dojo.widget.ValidationTextbox, {mixInProperties:function (localProperties) {
dojo.widget.UsStateTextbox.superclass.mixInProperties.apply(this, arguments);
if (localProperties.allowterritories) {
this.flags.allowTerritories = (localProperties.allowterritories == "true");
}
if (localProperties.allowmilitary) {
this.flags.allowMilitary = (localProperties.allowmilitary == "true");
}
}, isValid:function () {
return dojo.validate.us.isState(this.textbox.value, this.flags);
}});
dojo.widget.defineWidget("dojo.widget.UsZipTextbox", dojo.widget.ValidationTextbox, {isValid:function () {
return dojo.validate.us.isZipCode(this.textbox.value);
}});
dojo.widget.defineWidget("dojo.widget.UsSocialSecurityNumberTextbox", dojo.widget.ValidationTextbox, {isValid:function () {
return dojo.validate.us.isSocialSecurityNumber(this.textbox.value);
}});
dojo.widget.defineWidget("dojo.widget.UsPhoneNumberTextbox", dojo.widget.ValidationTextbox, {isValid:function () {
return dojo.validate.us.isPhoneNumber(this.textbox.value);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Repeater.js
New file
0,0 → 1,126
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Repeater");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.string");
dojo.require("dojo.event.*");
dojo.require("dojo.experimental");
dojo.experimental("dojo.widget.Repeater");
dojo.widget.defineWidget("dojo.widget.Repeater", dojo.widget.HtmlWidget, {name:"", rowTemplate:"", myObject:null, pattern:"", useDnd:false, isContainer:true, initialize:function (args, frag) {
var node = this.getFragNodeRef(frag);
node.removeAttribute("dojotype");
this.setRow(dojo.string.trim(node.innerHTML), {});
node.innerHTML = "";
frag = null;
}, postCreate:function (args, frag) {
if (this.useDnd) {
dojo.require("dojo.dnd.*");
var dnd = new dojo.dnd.HtmlDropTarget(this.domNode, [this.widgetId]);
}
}, _reIndexRows:function () {
for (var i = 0, len = this.domNode.childNodes.length; i < len; i++) {
var elems = ["INPUT", "SELECT", "TEXTAREA"];
for (var k = 0; k < elems.length; k++) {
var list = this.domNode.childNodes[i].getElementsByTagName(elems[k]);
for (var j = 0, len2 = list.length; j < len2; j++) {
var name = list[j].name;
var index = dojo.string.escape("regexp", this.pattern);
index = index.replace(/(%\\\{index\\\})/g, "%{index}");
var nameRegexp = dojo.string.substituteParams(index, {"index":"[0-9]*"});
var newName = dojo.string.substituteParams(this.pattern, {"index":"" + i});
var re = new RegExp(nameRegexp, "g");
list[j].name = name.replace(re, newName);
}
}
}
}, onDeleteRow:function (e) {
var index = dojo.string.escape("regexp", this.pattern);
index = index.replace(/%\\\{index\\\}/g, "%{index}");
var nameRegexp = dojo.string.substituteParams(index, {"index":"([0-9]*)"});
var re = new RegExp(nameRegexp, "g");
this.deleteRow(re.exec(e.target.name)[1]);
}, hasRows:function () {
if (this.domNode.childNodes.length > 0) {
return true;
}
return false;
}, getRowCount:function () {
return this.domNode.childNodes.length;
}, deleteRow:function (idx) {
this.domNode.removeChild(this.domNode.childNodes[idx]);
this._reIndexRows();
}, _changeRowPosition:function (e) {
if (e.dragStatus == "dropFailure") {
this.domNode.removeChild(e["dragSource"].domNode);
} else {
if (e.dragStatus == "dropSuccess") {
}
}
this._reIndexRows();
}, setRow:function (template, myObject) {
template = template.replace(/\%\{(index)\}/g, "0");
this.rowTemplate = template;
this.myObject = myObject;
}, getRow:function () {
return this.rowTemplate;
}, _initRow:function (node) {
if (typeof (node) == "number") {
node = this.domNode.childNodes[node];
}
var elems = ["INPUT", "SELECT", "IMG"];
for (var k = 0; k < elems.length; k++) {
var list = node.getElementsByTagName(elems[k]);
for (var i = 0, len = list.length; i < len; i++) {
var child = list[i];
if (child.nodeType != 1) {
continue;
}
if (child.getAttribute("rowFunction") != null) {
if (typeof (this.myObject[child.getAttribute("rowFunction")]) == "undefined") {
dojo.debug("Function " + child.getAttribute("rowFunction") + " not found");
} else {
this.myObject[child.getAttribute("rowFunction")](child);
}
} else {
if (child.getAttribute("rowAction") != null) {
if (child.getAttribute("rowAction") == "delete") {
child.name = dojo.string.substituteParams(this.pattern, {"index":"" + (this.getRowCount() - 1)});
dojo.event.connect(child, "onclick", this, "onDeleteRow");
}
}
}
}
}
}, onAddRow:function (e) {
}, addRow:function (doInit) {
if (typeof (doInit) == "undefined") {
doInit = true;
}
var node = document.createElement("span");
node.innerHTML = this.getRow();
if (node.childNodes.length == 1) {
node = node.childNodes[0];
}
this.domNode.appendChild(node);
var parser = new dojo.xml.Parse();
var frag = parser.parseElement(node, null, true);
dojo.widget.getParser().createSubComponents(frag, this);
this._reIndexRows();
if (doInit) {
this._initRow(node);
}
if (this.useDnd) {
node = new dojo.dnd.HtmlDragSource(node, this.widgetId);
dojo.event.connect(node, "onDragEnd", this, "_changeRowPosition");
}
this.onAddRow(node);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/HtmlWidget.js
New file
0,0 → 1,99
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.DomWidget");
dojo.require("dojo.html.util");
dojo.require("dojo.html.display");
dojo.require("dojo.html.layout");
dojo.require("dojo.lang.extras");
dojo.require("dojo.lang.func");
dojo.require("dojo.lfx.toggle");
dojo.declare("dojo.widget.HtmlWidget", dojo.widget.DomWidget, {templateCssPath:null, templatePath:null, lang:"", toggle:"plain", toggleDuration:150, initialize:function (args, frag) {
}, postMixInProperties:function (args, frag) {
if (this.lang === "") {
this.lang = null;
}
this.toggleObj = dojo.lfx.toggle[this.toggle.toLowerCase()] || dojo.lfx.toggle.plain;
}, createNodesFromText:function (txt, wrap) {
return dojo.html.createNodesFromText(txt, wrap);
}, destroyRendering:function (finalize) {
try {
if (this.bgIframe) {
this.bgIframe.remove();
delete this.bgIframe;
}
if (!finalize && this.domNode) {
dojo.event.browser.clean(this.domNode);
}
dojo.widget.HtmlWidget.superclass.destroyRendering.call(this);
}
catch (e) {
}
}, isShowing:function () {
return dojo.html.isShowing(this.domNode);
}, toggleShowing:function () {
if (this.isShowing()) {
this.hide();
} else {
this.show();
}
}, show:function () {
if (this.isShowing()) {
return;
}
this.animationInProgress = true;
this.toggleObj.show(this.domNode, this.toggleDuration, null, dojo.lang.hitch(this, this.onShow), this.explodeSrc);
}, onShow:function () {
this.animationInProgress = false;
this.checkSize();
}, hide:function () {
if (!this.isShowing()) {
return;
}
this.animationInProgress = true;
this.toggleObj.hide(this.domNode, this.toggleDuration, null, dojo.lang.hitch(this, this.onHide), this.explodeSrc);
}, onHide:function () {
this.animationInProgress = false;
}, _isResized:function (w, h) {
if (!this.isShowing()) {
return false;
}
var wh = dojo.html.getMarginBox(this.domNode);
var width = w || wh.width;
var height = h || wh.height;
if (this.width == width && this.height == height) {
return false;
}
this.width = width;
this.height = height;
return true;
}, checkSize:function () {
if (!this._isResized()) {
return;
}
this.onResized();
}, resizeTo:function (w, h) {
dojo.html.setMarginBox(this.domNode, {width:w, height:h});
if (this.isShowing()) {
this.onResized();
}
}, resizeSoon:function () {
if (this.isShowing()) {
dojo.lang.setTimeout(this, this.onResized, 0);
}
}, onResized:function () {
dojo.lang.forEach(this.children, function (child) {
if (child.checkSize) {
child.checkSize();
}
});
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/ValidationTextbox.js
New file
0,0 → 1,122
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.ValidationTextbox");
dojo.require("dojo.widget.Textbox");
dojo.require("dojo.i18n.common");
dojo.widget.defineWidget("dojo.widget.ValidationTextbox", dojo.widget.Textbox, function () {
this.flags = {};
}, {required:false, rangeClass:"range", invalidClass:"invalid", missingClass:"missing", classPrefix:"dojoValidate", size:"", maxlength:"", promptMessage:"", invalidMessage:"", missingMessage:"", rangeMessage:"", listenOnKeyPress:true, htmlfloat:"none", lastCheckedValue:null, templateString:"<span style='float:${this.htmlfloat};'>\n\t<input dojoAttachPoint='textbox' type='${this.type}' dojoAttachEvent='onblur;onfocus;onkeyup'\n\t\tid='${this.widgetId}' name='${this.name}' size='${this.size}' maxlength='${this.maxlength}'\n\t\tclass='${this.className}' style=''>\n\t<span dojoAttachPoint='invalidSpan' class='${this.invalidClass}'>${this.messages.invalidMessage}</span>\n\t<span dojoAttachPoint='missingSpan' class='${this.missingClass}'>${this.messages.missingMessage}</span>\n\t<span dojoAttachPoint='rangeSpan' class='${this.rangeClass}'>${this.messages.rangeMessage}</span>\n</span>\n", templateCssString:".dojoValidateEmpty{\n\tbackground-color: #00FFFF;\n}\n.dojoValidateValid{\n\tbackground-color: #cfc;\n}\n.dojoValidateInvalid{\n\tbackground-color: #fcc;\n}\n.dojoValidateRange{\n\tbackground-color: #ccf;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/Validate.css"), invalidSpan:null, missingSpan:null, rangeSpan:null, getValue:function () {
return this.textbox.value;
}, setValue:function (value) {
this.textbox.value = value;
this.update();
}, isValid:function () {
return true;
}, isInRange:function () {
return true;
}, isEmpty:function () {
return (/^\s*$/.test(this.textbox.value));
}, isMissing:function () {
return (this.required && this.isEmpty());
}, update:function () {
this.lastCheckedValue = this.textbox.value;
this.missingSpan.style.display = "none";
this.invalidSpan.style.display = "none";
this.rangeSpan.style.display = "none";
var empty = this.isEmpty();
var valid = true;
if (this.promptMessage != this.textbox.value) {
valid = this.isValid();
}
var missing = this.isMissing();
if (missing) {
this.missingSpan.style.display = "";
} else {
if (!empty && !valid) {
this.invalidSpan.style.display = "";
} else {
if (!empty && !this.isInRange()) {
this.rangeSpan.style.display = "";
}
}
}
this.highlight();
}, updateClass:function (className) {
var pre = this.classPrefix;
dojo.html.removeClass(this.textbox, pre + "Empty");
dojo.html.removeClass(this.textbox, pre + "Valid");
dojo.html.removeClass(this.textbox, pre + "Invalid");
dojo.html.addClass(this.textbox, pre + className);
}, highlight:function () {
if (this.isEmpty()) {
this.updateClass("Empty");
} else {
if (this.isValid() && this.isInRange()) {
this.updateClass("Valid");
} else {
if (this.textbox.value != this.promptMessage) {
this.updateClass("Invalid");
} else {
this.updateClass("Empty");
}
}
}
}, onfocus:function (evt) {
if (!this.listenOnKeyPress) {
this.updateClass("Empty");
}
}, onblur:function (evt) {
this.filter();
this.update();
}, onkeyup:function (evt) {
if (this.listenOnKeyPress) {
this.update();
} else {
if (this.textbox.value != this.lastCheckedValue) {
this.updateClass("Empty");
}
}
}, postMixInProperties:function (localProperties, frag) {
dojo.widget.ValidationTextbox.superclass.postMixInProperties.apply(this, arguments);
this.messages = dojo.i18n.getLocalization("dojo.widget", "validate", this.lang);
dojo.lang.forEach(["invalidMessage", "missingMessage", "rangeMessage"], function (prop) {
if (this[prop]) {
this.messages[prop] = this[prop];
}
}, this);
}, fillInTemplate:function () {
dojo.widget.ValidationTextbox.superclass.fillInTemplate.apply(this, arguments);
this.textbox.isValid = function () {
this.isValid.call(this);
};
this.textbox.isMissing = function () {
this.isMissing.call(this);
};
this.textbox.isInRange = function () {
this.isInRange.call(this);
};
dojo.html.setClass(this.invalidSpan, this.invalidClass);
this.update();
this.filter();
if (dojo.render.html.ie) {
dojo.html.addClass(this.domNode, "ie");
}
if (dojo.render.html.moz) {
dojo.html.addClass(this.domNode, "moz");
}
if (dojo.render.html.opera) {
dojo.html.addClass(this.domNode, "opera");
}
if (dojo.render.html.safari) {
dojo.html.addClass(this.domNode, "safari");
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/GoogleMap.js
New file
0,0 → 1,167
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.GoogleMap");
dojo.require("dojo.event.*");
dojo.require("dojo.math");
dojo.require("dojo.widget.*");
dojo.require("dojo.uri.Uri");
dojo.require("dojo.widget.HtmlWidget");
(function () {
var gkey = djConfig["gMapKey"] || djConfig["googleMapKey"];
var uri = new dojo.uri.Uri(window.location.href);
if (uri.host == "www.dojotoolkit.org") {
gkey = "ABQIAAAACUNdgv_7FGOmUslbm9l6_hRqjp7ri2mNiOEYqetD3xnFHpt5rBSjszDd1sdufPyQKUTyCf_YxoIxvw";
} else {
if (uri.host == "blog.dojotoolkit.org") {
gkey = "ABQIAAAACUNdgv_7FGOmUslbm9l6_hSkep6Av1xaMhVn3yCLkorJeXeLARQ6fammI_P3qSGleTJhoI5_1JmP_Q";
} else {
if (uri.host == "archive.dojotoolkit.org") {
gkey = "ABQIAAAACUNdgv_7FGOmUslbm9l6_hTaQpDt0dyGLIHbXMPTzg1kWeAfwRTwZNyrUfbfxYE9yIvRivEjcXoDTg";
} else {
if (uri.host == "dojotoolkit.org") {
gkey = "ABQIAAAACUNdgv_7FGOmUslbm9l6_hSaOaO_TgJ5c3mtQFnk5JO2zD5dZBRZk-ieqVs7BORREYNzAERmcJoEjQ";
}
}
}
}
if (!dojo.hostenv.post_load_) {
if (!gkey || gkey == "") {
dojo.raise("dojo.widget.GoogleMap: The Google Map widget requires a proper API key in order to be used.");
}
var tag = "<scr" + "ipt src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=" + gkey + "'></scri" + "pt>";
if (!dj_global["GMap2"]) {
document.write(tag);
}
} else {
dojo.debug("Cannot initialize Google Map system after the page has been loaded! Please either manually include the script block provided by Google in your page or require() the GoogleMap widget before onload has fired.");
}
})();
dojo.widget.defineWidget("dojo.widget.GoogleMap", dojo.widget.HtmlWidget, function () {
this.map = null;
this.geocoder = null;
this.data = [];
this.datasrc = "";
this.controls = ["largemap", "scale", "maptype"];
}, {templatePath:null, templateCssPath:null, isContainer:false, _defaultPoint:{lat:39.10662, lng:-94.578209}, setControls:function () {
var methodmap = {largemap:GLargeMapControl, smallmap:GSmallMapControl, smallzoom:GSmallZoomControl, scale:GScaleControl, maptype:GMapTypeControl, overview:GOverviewMapControl};
for (var i = 0; i < this.controls.length; i++) {
this.map.addControl(new (methodmap[this.controls[i].toLowerCase()])());
}
}, findCenter:function (bounds) {
if (this.data.length == 1) {
return (new GLatLng(this.data[0].lat, this.data[0].lng));
}
var clat = (bounds.getNorthEast().lat() + bounds.getSouthWest().lat()) / 2;
var clng = (bounds.getNorthEast().lng() + bounds.getSouthWest().lng()) / 2;
return (new GLatLng(clat, clng));
}, createPinpoint:function (pt, overlay) {
var m = new GMarker(pt);
if (overlay) {
GEvent.addListener(m, "click", function () {
m.openInfoWindowHtml("<div>" + overlay + "</div>");
});
}
return m;
}, plot:function (obj) {
var p = new GLatLng(obj.lat, obj.lng);
var d = obj.description || null;
var m = this.createPinpoint(p, d);
this.map.addOverlay(m);
}, plotAddress:function (address) {
var self = this;
this.geocoder.getLocations(address, function (response) {
if (!response || response.Status.code != 200) {
alert("The address \"" + address + "\" was not found.");
return;
}
var obj = {lat:response.Placemark[0].Point.coordinates[1], lng:response.Placemark[0].Point.coordinates[0], description:response.Placemark[0].address};
self.data.push(obj);
self.render();
});
}, parse:function (table) {
this.data = [];
var h = table.getElementsByTagName("thead")[0];
if (!h) {
return;
}
var a = [];
var cols = h.getElementsByTagName("td");
if (cols.length == 0) {
cols = h.getElementsByTagName("th");
}
for (var i = 0; i < cols.length; i++) {
var c = cols[i].innerHTML.toLowerCase();
if (c == "long") {
c = "lng";
}
a.push(c);
}
var b = table.getElementsByTagName("tbody")[0];
if (!b) {
return;
}
for (var i = 0; i < b.childNodes.length; i++) {
if (!(b.childNodes[i].nodeName && b.childNodes[i].nodeName.toLowerCase() == "tr")) {
continue;
}
var cells = b.childNodes[i].getElementsByTagName("td");
var o = {};
for (var j = 0; j < a.length; j++) {
var col = a[j];
if (col == "lat" || col == "lng") {
o[col] = parseFloat(cells[j].innerHTML);
} else {
o[col] = cells[j].innerHTML;
}
}
this.data.push(o);
}
}, render:function () {
if (this.data.length == 0) {
this.map.setCenter(new GLatLng(this._defaultPoint.lat, this._defaultPoint.lng), 4);
return;
}
this.map.clearOverlays();
var bounds = new GLatLngBounds();
var d = this.data;
for (var i = 0; i < d.length; i++) {
bounds.extend(new GLatLng(d[i].lat, d[i].lng));
}
var zoom = Math.min((this.map.getBoundsZoomLevel(bounds) - 1), 14);
this.map.setCenter(this.findCenter(bounds), zoom);
for (var i = 0; i < this.data.length; i++) {
this.plot(this.data[i]);
}
}, initialize:function (args, frag) {
if (this.datasrc) {
this.parse(dojo.byId(this.datasrc));
} else {
if (this.domNode.getElementsByTagName("table")[0]) {
this.parse(this.domNode.getElementsByTagName("table")[0]);
}
}
}, postCreate:function () {
while (this.domNode.childNodes.length > 0) {
this.domNode.removeChild(this.domNode.childNodes[0]);
}
if (this.domNode.style.position != "absolute") {
this.domNode.style.position = "relative";
}
this.map = new GMap2(this.domNode);
try {
this.geocoder = new GClientGeocoder();
}
catch (ex) {
}
this.render();
this.setControls();
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/TreeLoadingControllerV3.js
New file
0,0 → 1,248
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeLoadingControllerV3");
dojo.require("dojo.widget.TreeBasicControllerV3");
dojo.require("dojo.event.*");
dojo.require("dojo.json");
dojo.require("dojo.io.*");
dojo.require("dojo.Deferred");
dojo.require("dojo.DeferredList");
dojo.declare("dojo.Error", Error, function (message, extra) {
this.message = message;
this.extra = extra;
this.stack = (new Error()).stack;
});
dojo.declare("dojo.CommunicationError", dojo.Error, function () {
this.name = "CommunicationError";
});
dojo.declare("dojo.LockedError", dojo.Error, function () {
this.name = "LockedError";
});
dojo.declare("dojo.FormatError", dojo.Error, function () {
this.name = "FormatError";
});
dojo.declare("dojo.RpcError", dojo.Error, function () {
this.name = "RpcError";
});
dojo.widget.defineWidget("dojo.widget.TreeLoadingControllerV3", dojo.widget.TreeBasicControllerV3, {RpcUrl:"", RpcActionParam:"action", preventCache:true, checkValidRpcResponse:function (type, obj) {
if (type != "load") {
var extra = {};
for (var i = 1; i < arguments.length; i++) {
dojo.lang.mixin(extra, arguments[i]);
}
return new dojo.CommunicationError(obj, extra);
}
if (typeof obj != "object") {
return new dojo.FormatError("Wrong server answer format " + (obj && obj.toSource ? obj.toSource() : obj) + " type " + (typeof obj), obj);
}
if (!dojo.lang.isUndefined(obj.error)) {
return new dojo.RpcError(obj.error, obj);
}
return false;
}, getDeferredBindHandler:function (deferred) {
return dojo.lang.hitch(this, function (type, obj) {
var error = this.checkValidRpcResponse.apply(this, arguments);
if (error) {
deferred.errback(error);
return;
}
deferred.callback(obj);
});
}, getRpcUrl:function (action) {
if (this.RpcUrl == "local") {
var dir = document.location.href.substr(0, document.location.href.lastIndexOf("/"));
var localUrl = dir + "/local/" + action;
return localUrl;
}
if (!this.RpcUrl) {
dojo.raise("Empty RpcUrl: can't load");
}
var url = this.RpcUrl;
if (url.indexOf("/") != 0) {
var protocol = document.location.href.replace(/:\/\/.*/, "");
var prefix = document.location.href.substring(protocol.length + 3);
if (prefix.lastIndexOf("/") != prefix.length - 1) {
prefix = prefix.replace(/\/[^\/]+$/, "/");
}
if (prefix.lastIndexOf("/") != prefix.length - 1) {
prefix = prefix + "/";
}
url = protocol + "://" + prefix + url;
}
return url + (url.indexOf("?") > -1 ? "&" : "?") + this.RpcActionParam + "=" + action;
}, loadProcessResponse:function (node, result) {
if (!dojo.lang.isArray(result)) {
throw new dojo.FormatError("loadProcessResponse: Not array loaded: " + result);
}
node.setChildren(result);
}, runRpc:function (kw) {
var _this = this;
var deferred = new dojo.Deferred();
dojo.io.bind({url:kw.url, handle:this.getDeferredBindHandler(deferred), mimetype:"text/javascript", preventCache:this.preventCache, sync:kw.sync, content:{data:dojo.json.serialize(kw.params)}});
return deferred;
}, loadRemote:function (node, sync) {
var _this = this;
var params = {node:this.getInfo(node), tree:this.getInfo(node.tree)};
var deferred = this.runRpc({url:this.getRpcUrl("getChildren"), sync:sync, params:params});
deferred.addCallback(function (res) {
return _this.loadProcessResponse(node, res);
});
return deferred;
}, batchExpandTimeout:0, recurseToLevel:function (widget, level, callFunc, callObj, skipFirst, sync) {
if (level == 0) {
return;
}
if (!skipFirst) {
var deferred = callFunc.call(callObj, widget, sync);
} else {
var deferred = dojo.Deferred.prototype.makeCalled();
}
var _this = this;
var recurseOnExpand = function () {
var children = widget.children;
var deferreds = [];
for (var i = 0; i < children.length; i++) {
deferreds.push(_this.recurseToLevel(children[i], level - 1, callFunc, callObj, sync));
}
return new dojo.DeferredList(deferreds);
};
deferred.addCallback(recurseOnExpand);
return deferred;
}, expandToLevel:function (nodeOrTree, level, sync) {
return this.recurseToLevel(nodeOrTree, nodeOrTree.isTree ? level + 1 : level, this.expand, this, nodeOrTree.isTree, sync);
}, loadToLevel:function (nodeOrTree, level, sync) {
return this.recurseToLevel(nodeOrTree, nodeOrTree.isTree ? level + 1 : level, this.loadIfNeeded, this, nodeOrTree.isTree, sync);
}, loadAll:function (nodeOrTree, sync) {
return this.loadToLevel(nodeOrTree, Number.POSITIVE_INFINITY, sync);
}, expand:function (node, sync) {
var _this = this;
var deferred = this.startProcessing(node);
deferred.addCallback(function () {
return _this.loadIfNeeded(node, sync);
});
deferred.addCallback(function (res) {
dojo.widget.TreeBasicControllerV3.prototype.expand(node);
return res;
});
deferred.addBoth(function (res) {
_this.finishProcessing(node);
return res;
});
return deferred;
}, loadIfNeeded:function (node, sync) {
var deferred;
if (node.state == node.loadStates.UNCHECKED && node.isFolder && !node.children.length) {
deferred = this.loadRemote(node, sync);
} else {
deferred = new dojo.Deferred();
deferred.callback();
}
return deferred;
}, runStages:function (check, prepare, make, finalize, expose, args) {
var _this = this;
if (check && !check.apply(this, args)) {
return false;
}
var deferred = dojo.Deferred.prototype.makeCalled();
if (prepare) {
deferred.addCallback(function () {
return prepare.apply(_this, args);
});
}
if (make) {
deferred.addCallback(function () {
var res = make.apply(_this, args);
return res;
});
}
if (finalize) {
deferred.addBoth(function (res) {
finalize.apply(_this, args);
return res;
});
}
if (expose) {
deferred.addCallback(function (res) {
expose.apply(_this, args);
return res;
});
}
return deferred;
}, startProcessing:function (nodesArray) {
var deferred = new dojo.Deferred();
var nodes = dojo.lang.isArray(nodesArray) ? nodesArray : arguments;
for (var i = 0; i < nodes.length; i++) {
if (nodes[i].isLocked()) {
deferred.errback(new dojo.LockedError("item locked " + nodes[i], nodes[i]));
return deferred;
}
if (nodes[i].isTreeNode) {
nodes[i].markProcessing();
}
nodes[i].lock();
}
deferred.callback();
return deferred;
}, finishProcessing:function (nodesArray) {
var nodes = dojo.lang.isArray(nodesArray) ? nodesArray : arguments;
for (var i = 0; i < nodes.length; i++) {
if (!nodes[i].hasLock()) {
continue;
}
nodes[i].unlock();
if (nodes[i].isTreeNode) {
nodes[i].unmarkProcessing();
}
}
}, refreshChildren:function (nodeOrTree, sync) {
return this.runStages(null, this.prepareRefreshChildren, this.doRefreshChildren, this.finalizeRefreshChildren, this.exposeRefreshChildren, arguments);
}, prepareRefreshChildren:function (nodeOrTree, sync) {
var deferred = this.startProcessing(nodeOrTree);
nodeOrTree.destroyChildren();
nodeOrTree.state = nodeOrTree.loadStates.UNCHECKED;
return deferred;
}, doRefreshChildren:function (nodeOrTree, sync) {
return this.loadRemote(nodeOrTree, sync);
}, finalizeRefreshChildren:function (nodeOrTree, sync) {
this.finishProcessing(nodeOrTree);
}, exposeRefreshChildren:function (nodeOrTree, sync) {
nodeOrTree.expand();
}, move:function (child, newParent, index) {
return this.runStages(this.canMove, this.prepareMove, this.doMove, this.finalizeMove, this.exposeMove, arguments);
}, doMove:function (child, newParent, index) {
child.tree.move(child, newParent, index);
return true;
}, prepareMove:function (child, newParent, index, sync) {
var deferred = this.startProcessing(newParent);
deferred.addCallback(dojo.lang.hitch(this, function () {
return this.loadIfNeeded(newParent, sync);
}));
return deferred;
}, finalizeMove:function (child, newParent) {
this.finishProcessing(newParent);
}, prepareCreateChild:function (parent, index, data, sync) {
var deferred = this.startProcessing(parent);
deferred.addCallback(dojo.lang.hitch(this, function () {
return this.loadIfNeeded(parent, sync);
}));
return deferred;
}, finalizeCreateChild:function (parent) {
this.finishProcessing(parent);
}, prepareClone:function (child, newParent, index, deep, sync) {
var deferred = this.startProcessing(child, newParent);
deferred.addCallback(dojo.lang.hitch(this, function () {
return this.loadIfNeeded(newParent, sync);
}));
return deferred;
}, finalizeClone:function (child, newParent) {
this.finishProcessing(child, newParent);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/TreeDisableWrapExtension.js
New file
0,0 → 1,35
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeDisableWrapExtension");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.TreeExtension");
dojo.widget.defineWidget("dojo.widget.TreeDisableWrapExtension", dojo.widget.TreeExtension, {templateCssString:"\n/* CSS for TreeDisableWrapExtension */\n\n.TreeDisableWrap {\n\twhite-space: nowrap;\n}\n.TreeIEDisableWrap {\n\twidth: expression( 5 + firstChild.offsetWidth );\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/TreeDisableWrap.css"), listenTree:function (tree) {
var wrappingDiv = document.createElement("div");
var clazz = tree.classPrefix + "DisableWrap";
if (dojo.render.html.ie) {
clazz = clazz + " " + tree.classPrefix + "IEDisableWrap";
}
dojo.html.setClass(wrappingDiv, clazz);
var table = document.createElement("table");
wrappingDiv.appendChild(table);
var tbody = document.createElement("tbody");
table.appendChild(tbody);
var tr = document.createElement("tr");
tbody.appendChild(tr);
var td = document.createElement("td");
tr.appendChild(td);
if (tree.domNode.parentNode) {
tree.domNode.parentNode.replaceChild(wrappingDiv, tree.domNode);
}
td.appendChild(tree.domNode);
tree.domNode = wrappingDiv;
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/RadioGroup.js
New file
0,0 → 1,120
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.RadioGroup");
dojo.require("dojo.lang.common");
dojo.require("dojo.event.browser");
dojo.require("dojo.html.selection");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.widget.defineWidget("dojo.widget.RadioGroup", dojo.widget.HtmlWidget, function () {
this.selectedItem = null;
this.items = [];
this.selected = [];
this.groupCssClass = "radioGroup";
this.selectedCssClass = "selected";
this.itemContentCssClass = "itemContent";
}, {isContainer:false, templatePath:null, templateCssPath:null, postCreate:function () {
this._parseStructure();
dojo.html.addClass(this.domNode, this.groupCssClass);
this._setupChildren();
dojo.event.browser.addListener(this.domNode, "onclick", dojo.lang.hitch(this, "onSelect"));
if (this.selectedItem) {
this._selectItem(this.selectedItem);
}
}, _parseStructure:function () {
if (this.domNode.tagName.toLowerCase() != "ul" && this.domNode.tagName.toLowerCase() != "ol") {
dojo.raise("RadioGroup: Expected ul or ol content.");
return;
}
this.items = [];
var nl = this.domNode.getElementsByTagName("li");
for (var i = 0; i < nl.length; i++) {
if (nl[i].parentNode == this.domNode) {
this.items.push(nl[i]);
}
}
}, add:function (node) {
if (node.parentNode != this.domNode) {
this.domNode.appendChild(node);
}
this.items.push(node);
this._setup(node);
}, remove:function (node) {
var idx = -1;
for (var i = 0; i < this.items.length; i++) {
if (this.items[i] == node) {
idx = i;
break;
}
}
if (idx < 0) {
return;
}
this.items.splice(idx, 1);
node.parentNode.removeChild(node);
}, clear:function () {
for (var i = 0; i < this.items.length; i++) {
this.domNode.removeChild(this.items[i]);
}
this.items = [];
}, clearSelections:function () {
for (var i = 0; i < this.items.length; i++) {
dojo.html.removeClass(this.items[i], this.selectedCssClass);
}
this.selectedItem = null;
}, _setup:function (node) {
var span = document.createElement("span");
dojo.html.disableSelection(span);
dojo.html.addClass(span, this.itemContentCssClass);
dojo.dom.moveChildren(node, span);
node.appendChild(span);
if (this.selected.length > 0) {
var uid = dojo.html.getAttribute(node, "id");
if (uid && uid == this.selected) {
this.selectedItem = node;
}
}
dojo.event.browser.addListener(node, "onclick", dojo.lang.hitch(this, "onItemSelect"));
if (dojo.html.hasAttribute(node, "onitemselect")) {
var tn = dojo.lang.nameAnonFunc(new Function(dojo.html.getAttribute(node, "onitemselect")), this);
dojo.event.browser.addListener(node, "onclick", dojo.lang.hitch(this, tn));
}
}, _setupChildren:function () {
for (var i = 0; i < this.items.length; i++) {
this._setup(this.items[i]);
}
}, _selectItem:function (node, event, nofire) {
if (this.selectedItem) {
dojo.html.removeClass(this.selectedItem, this.selectedCssClass);
}
this.selectedItem = node;
dojo.html.addClass(this.selectedItem, this.selectedCssClass);
if (!dj_undef("currentTarget", event)) {
return;
}
if (!nofire) {
if (dojo.render.html.ie) {
this.selectedItem.fireEvent("onclick");
} else {
var e = document.createEvent("MouseEvents");
e.initEvent("click", true, false);
this.selectedItem.dispatchEvent(e);
}
}
}, getValue:function () {
return this.selectedItem;
}, onSelect:function (e) {
}, onItemSelect:function (e) {
if (!dj_undef("currentTarget", e)) {
this._selectItem(e.currentTarget, e);
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Editor2Plugin/FindReplace.js
New file
0,0 → 1,59
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Editor2Plugin.FindReplace");
dojo.require("dojo.widget.Editor2");
dojo.declare("dojo.widget.Editor2Plugin.FindCommand", dojo.widget.Editor2DialogCommand, {SearchOption:{CaseSensitive:4, SearchBackwards:64, WholeWord:2, WrapSearch:128}, find:function (text, option) {
this._editor.focus();
if (window.find) {
this._editor.window.find(text, option & this.SearchOption.CaseSensitive ? true : false, option & this.SearchOption.SearchBackwards ? true : false, option & this.SearchOption.WrapSearch ? true : false, option & this.SearchOption.WholeWord ? true : false);
} else {
if (dojo.body().createTextRange) {
var range = this._editor.document.body.createTextRange();
var found = range.findText(text, (option & this.SearchOption.SearchBackwards) ? 1 : -1, option);
if (found) {
range.scrollIntoView();
range.select();
} else {
alert("Can not find " + text + " in the document");
}
} else {
alert("No idea how to search in this browser. Please submit patch if you know.");
}
}
}, getText:function () {
return "Find";
}});
dojo.widget.Editor2Plugin.FindReplace = {getCommand:function (editor, name) {
var name = name.toLowerCase();
var command;
if (name == "find") {
command = new dojo.widget.Editor2Plugin.FindCommand(editor, "find", {contentFile:"dojo.widget.Editor2Plugin.FindReplaceDialog", contentClass:"Editor2FindDialog", title:"Find", width:"350px", height:"150px", modal:false});
} else {
if (name == "replace") {
command = new dojo.widget.Editor2DialogCommand(editor, "replace", {contentFile:"dojo.widget.Editor2Plugin.FindReplaceDialog", contentClass:"Editor2ReplaceDialog", href:dojo.uri.cache.set(dojo.uri.moduleUri("dojo.widget", "templates/Editor2/Dialog/replace.html"), "<table style=\"white-space: nowrap;\">\n<tr><td>Find: </td><td> <input type=\"text\" dojoAttachPoint=\"replace_text\" /></td></tr>\n<tr><td>Replace with: </td><td> <input type=\"text\" dojoAttachPoint=\"replace_text\" /></td></tr>\n<tr><td colspan='2'><table><tr><td><input type=\"checkbox\" dojoType=\"CheckBox\" dojoAttachPoint=\"replace_option_casesens\" id=\"dojo_replace_option_casesens\" />\n\t\t<label for=\"dojo_replace_option_casesens\">Case Sensitive</label></td>\n\t\t\t<td><input type=\"checkbox\" dojoType=\"CheckBox\" dojoAttachPoint=\"replace_option_backwards\" id=\"dojo_replace_option_backwards\" />\n\t\t<label for=\"dojo_replace_option_backwards\">Search Backwards</label></td></tr></table></td></tr>\n<tr><td colspan=2\">\n\t<table><tr>\n\t<td><button dojoType='Button' dojoAttachEvent='onClick:replace'>Replace</button></td>\n\t<td><button dojoType='Button' dojoAttachEvent='onClick:replaceAll'>Replace All</button></td>\n\t<td><button dojoType='Button' dojoAttachEvent='onClick:cancel'>Close</button></td>\n\t</tr></table>\n\t</td></tr>\n</table>\n"), title:"Replace", width:"350px", height:"200px", modal:false});
}
}
return command;
}, getToolbarItem:function (name) {
var name = name.toLowerCase();
var item;
if (name == "replace") {
item = new dojo.widget.Editor2ToolbarButton("Replace");
} else {
if (name == "find") {
item = new dojo.widget.Editor2ToolbarButton("Find");
}
}
return item;
}};
dojo.widget.Editor2Manager.registerHandler(dojo.widget.Editor2Plugin.FindReplace.getCommand);
dojo.widget.Editor2ToolbarItemManager.registerHandler(dojo.widget.Editor2Plugin.FindReplace.getToolbarItem);
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Editor2Plugin/FindReplaceDialog.js
New file
0,0 → 1,32
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Editor2Plugin.FindReplaceDialog");
dojo.widget.defineWidget("dojo.widget.Editor2FindDialog", dojo.widget.Editor2DialogContent, {templateString:"<table style=\"white-space: nowrap;\">\n<tr><td colspan='2'>Find: <input type=\"text\" dojoAttachPoint=\"find_text\" /></td></tr>\n<tr><td><input type=\"checkbox\" dojoType=\"CheckBox\" dojoAttachPoint=\"find_option_casesens\" />\n\t\t<label for=\"find_option_casesens\">Case Sensitive</label></td>\n\t\t\t<td><input type=\"checkbox\" dojoType=\"CheckBox\" dojoAttachPoint=\"find_option_backwards\" />\n\t\t<label for=\"find_option_backwards\">Search Backwards</label></td></tr>\n<tr><td style=\"display: none;\"><input type=\"checkbox\" dojoType=\"CheckBox\" dojoAttachPoint=\"find_option_wholeword\" />\n\t\t<label for=\"find_option_wholeword\">Whole Word</label></td>\n<tr><td colspan=\"1\">\n\t<table><tr>\n\t<td><button dojoType='Button' dojoAttachEvent='onClick:find'>Find</button></td>\n\t<td><button dojoType='Button' dojoAttachEvent='onClick:cancel'>Close</button></td>\n\t</tr></table>\n\t</td></tr>\n</table>\n", find:function () {
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
var findcmd = curInst.getCommand("find");
var option = 0;
if (this["find_option_casesens"].checked) {
option |= findcmd.SearchOption.CaseSensitive;
}
if (this["find_option_backwards"].checked) {
option |= findcmd.SearchOption.SearchBackwards;
}
if (this["find_option_wholeword"].checked) {
option |= findcmd.SearchOption.WholeWord;
}
findcmd.find(this["find_text"].value, option);
}});
dojo.widget.defineWidget("dojo.widget.Editor2ReplaceDialog", dojo.widget.Editor2DialogContent, {templateString:"<table style=\"white-space: nowrap;\">\n<tr><td>Find: </td><td> <input type=\"text\" dojoAttachPoint=\"replace_text\" /></td></tr>\n<tr><td>Replace with: </td><td> <input type=\"text\" dojoAttachPoint=\"replace_text\" /></td></tr>\n<tr><td colspan='2'><table><tr><td><input type=\"checkbox\" dojoType=\"CheckBox\" dojoAttachPoint=\"replace_option_casesens\" id=\"dojo_replace_option_casesens\" />\n\t\t<label for=\"dojo_replace_option_casesens\">Case Sensitive</label></td>\n\t\t\t<td><input type=\"checkbox\" dojoType=\"CheckBox\" dojoAttachPoint=\"replace_option_backwards\" id=\"dojo_replace_option_backwards\" />\n\t\t<label for=\"dojo_replace_option_backwards\">Search Backwards</label></td></tr></table></td></tr>\n<tr><td colspan=2\">\n\t<table><tr>\n\t<td><button dojoType='Button' dojoAttachEvent='onClick:replace'>Replace</button></td>\n\t<td><button dojoType='Button' dojoAttachEvent='onClick:replaceAll'>Replace All</button></td>\n\t<td><button dojoType='Button' dojoAttachEvent='onClick:cancel'>Close</button></td>\n\t</tr></table>\n\t</td></tr>\n</table>\n", replace:function () {
alert("not implemented yet");
}, replaceAll:function () {
alert("not implemented yet");
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Editor2Plugin/InsertTableDialog.js
New file
0,0 → 1,129
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Editor2Plugin.InsertTableDialog");
dojo.widget.defineWidget("dojo.widget.Editor2InsertTableDialog", dojo.widget.Editor2DialogContent, {templateString:"<div>\n<table cellSpacing=\"1\" cellPadding=\"1\" width=\"100%\" border=\"0\">\n\t<tr>\n\t\t<td valign=\"top\">\n\t\t\t<table cellSpacing=\"0\" cellPadding=\"0\" border=\"0\">\n\t\t\t\t<tr>\n\n\t\t\t\t\t<td><span>Rows</span>:</td>\n\t\t\t\t\t<td>&nbsp;<input dojoAttachPoint=\"table_rows\" type=\"text\" maxLength=\"3\" size=\"2\" value=\"3\"></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><span>Columns</span>:</td>\n\t\t\t\t\t<td>&nbsp;<input dojoAttachPoint=\"table_cols\" type=\"text\" maxLength=\"2\" size=\"2\" value=\"2\"></td>\n\t\t\t\t</tr>\n\n\t\t\t\t<tr>\n\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><span>Border size</span>:</td>\n\t\t\t\t\t<td>&nbsp;<INPUT dojoAttachPoint=\"table_border\" type=\"text\" maxLength=\"2\" size=\"2\" value=\"1\"></td>\n\t\t\t\t</tr>\n\n\t\t\t\t<tr>\n\t\t\t\t\t<td><span>Alignment</span>:</td>\n\t\t\t\t\t<td>&nbsp;<select dojoAttachPoint=\"table_align\">\n\t\t\t\t\t\t\t<option value=\"\" selected>&lt;Not set&gt;</option>\n\t\t\t\t\t\t\t<option value=\"left\">Left</option>\n\t\t\t\t\t\t\t<option value=\"center\">Center</option>\n\t\t\t\t\t\t\t<option value=\"right\">Right</option>\n\t\t\t\t\t\t</select></td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t</td>\n\t\t<td>&nbsp;&nbsp;&nbsp;</td>\n\t\t<td align=\"right\" valign=\"top\">\n\t\t\t<table cellSpacing=\"0\" cellPadding=\"0\" border=\"0\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td><span>Width</span>:</td>\n\t\t\t\t\t<td>&nbsp;<input dojoAttachPoint=\"table_width\" type=\"text\" maxLength=\"4\" size=\"3\"></td>\n\t\t\t\t\t<td>&nbsp;<select dojoAttachPoint=\"table_widthtype\">\n\t\t\t\t\t\t\t<option value=\"percent\" selected>percent</option>\n\t\t\t\t\t\t\t<option value=\"pixels\">pixels</option>\n\t\t\t\t\t\t</select></td>\n\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><span>Height</span>:</td>\n\t\t\t\t\t<td>&nbsp;<INPUT dojoAttachPoint=\"table_height\" type=\"text\" maxLength=\"4\" size=\"3\"></td>\n\t\t\t\t\t<td>&nbsp;<span>pixels</span></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td nowrap><span>Cell spacing</span>:</td>\n\t\t\t\t\t<td>&nbsp;<input dojoAttachPoint=\"table_cellspacing\" type=\"text\" maxLength=\"2\" size=\"2\" value=\"1\"></td>\n\t\t\t\t\t<td>&nbsp;</td>\n\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td nowrap><span>Cell padding</span>:</td>\n\t\t\t\t\t<td>&nbsp;<input dojoAttachPoint=\"table_cellpadding\" type=\"text\" maxLength=\"2\" size=\"2\" value=\"1\"></td>\n\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t</td>\n\t</tr>\n</table>\n<table cellSpacing=\"0\" cellPadding=\"0\" width=\"100%\" border=\"0\">\n\t<tr>\n\t\t<td nowrap><span>Caption</span>:</td>\n\t\t<td>&nbsp;</td>\n\t\t<td width=\"100%\" nowrap>&nbsp;\n\t\t\t<input dojoAttachPoint=\"table_caption\" type=\"text\" style=\"WIDTH: 90%\"></td>\n\t</tr>\n\t<tr>\n\t\t<td nowrap><span>Summary</span>:</td>\n\t\t<td>&nbsp;</td>\n\t\t<td width=\"100%\" nowrap>&nbsp;\n\t\t\t<input dojoAttachPoint=\"table_summary\" type=\"text\" style=\"WIDTH: 90%\"></td>\n\t</tr>\n</table>\n<table><tr>\n<td><button dojoType='Button' dojoAttachEvent='onClick:ok'>Ok</button></td>\n<td><button dojoType='Button' dojoAttachEvent='onClick:cancel'>Cancel</button></td>\n</tr></table>\n</div>\n", editableAttributes:["summary", "height", "cellspacing", "cellpadding", "border", "align"], loadContent:function () {
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
curInst.saveSelection();
this.tableNode = dojo.withGlobal(curInst.window, "getSelectedElement", dojo.html.selection);
if (!this.tableNode || this.tableNode.tagName.toLowerCase() != "table") {
this.tableNode = dojo.withGlobal(curInst.window, "getAncestorElement", dojo.html.selection, ["table"]);
}
var tableAttributes = {};
this.extraAttribText = "";
if (this.tableNode) {
this["table_rows"].value = this.tableNode.rows.length;
this["table_rows"].disabled = true;
this["table_cols"].value = this.tableNode.rows[0].cells.length;
this["table_cols"].disabled = true;
if (this.tableNode.caption) {
this["table_caption"].value = this.tableNode.caption.innerHTML;
} else {
this["table_caption"].value = "";
}
var width = this.tableNode.style.width || this.tableNode.width;
if (width) {
this["table_width"].value = parseInt(width);
if (width.indexOf("%") > -1) {
this["table_widthtype"].value = "percent";
} else {
this["table_widthtype"].value = "pixels";
}
} else {
this["table_width"].value = "100";
}
var height = this.tableNode.style.height || this.tableNode.height;
if (height) {
this["table_height"].value = parseInt(width);
} else {
this["table_height"].value = "";
}
var attrs = this.tableNode.attributes;
for (var i = 0; i < attrs.length; i++) {
if (dojo.lang.find(this.editableAttributes, attrs[i].name.toLowerCase()) > -1) {
tableAttributes[attrs[i].name] = attrs[i].value;
} else {
this.extraAttribText += attrs[i].name + "=\"" + attrs[i].value + "\" ";
}
}
} else {
this["table_rows"].value = 3;
this["table_rows"].disabled = false;
this["table_cols"].value = 2;
this["table_cols"].disabled = false;
this["table_width"].value = 100;
this["table_widthtype"].value = "percent";
this["table_height"].value = "";
}
for (var i = 0; i < this.editableAttributes.length; ++i) {
name = this.editableAttributes[i];
this["table_" + name].value = (tableAttributes[name] == undefined) ? "" : tableAttributes[name];
if (name == "height" && tableAttributes[name] != undefined) {
this["table_" + name].value = tableAttributes[name];
}
}
return true;
}, ok:function () {
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
var args = {};
args["rows"] = this["table_rows"].value;
args["cols"] = this["table_cols"].value;
args["caption"] = this["table_caption"].value;
args["tableattrs"] = "";
if (this["table_widthtype"].value == "percent") {
args["tableattrs"] += "width=\"" + this["table_width"].value + "%\" ";
} else {
args["tableattrs"] += "width=\"" + this["table_width"].value + "px\" ";
}
for (var i = 0; i < this.editableAttributes.length; ++i) {
var name = this.editableAttributes[i];
var value = this["table_" + name].value;
if (value.length > 0) {
args["tableattrs"] += name + "=\"" + value + "\" ";
}
}
if (!args["tableattrs"]) {
args["tableattrs"] = "";
}
if (dojo.render.html.ie && !this["table_border"].value) {
args["tableattrs"] += "class=\"dojoShowIETableBorders\" ";
}
var html = "<table " + args["tableattrs"] + ">";
if (args["caption"]) {
html += "<caption>" + args["caption"] + "</caption>";
}
var outertbody = "<tbody>";
if (this.tableNode) {
var tbody = this.tableNode.getElementsByTagName("tbody")[0];
outertbody = tbody.outerHTML;
if (!outertbody) {
var cnode = tbody.cloneNode(true);
var tmpnode = tbody.ownerDocument.createElement("div");
tmpnode.appendChild(cnode);
outertbody = tmpnode.innerHTML;
}
dojo.withGlobal(curInst.window, "selectElement", dojo.html.selection, [this.tableNode]);
} else {
var cols = "<tr>";
for (var i = 0; i < +args.cols; i++) {
cols += "<td></td>";
}
cols += "</tr>";
for (var i = 0; i < args.rows; i++) {
outertbody += cols;
}
outertbody += "</tbody>";
}
html += outertbody + "</table>";
curInst.restoreSelection();
curInst.execCommand("inserthtml", html);
this.cancel();
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Editor2Plugin/CreateLinkDialog.js
New file
0,0 → 1,61
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Editor2Plugin.CreateLinkDialog");
dojo.widget.defineWidget("dojo.widget.Editor2CreateLinkDialog", dojo.widget.Editor2DialogContent, {templateString:"<table>\n<tr><td>URL</td><td> <input type=\"text\" dojoAttachPoint=\"link_href\" name=\"dojo_createLink_href\"/></td></tr>\n<tr><td>Target </td><td><select dojoAttachPoint=\"link_target\">\n\t<option value=\"\">Self</option>\n\t<option value=\"_blank\">New Window</option>\n\t<option value=\"_top\">Top Window</option>\n\t</select></td></tr>\n<tr><td>Class </td><td><input type=\"text\" dojoAttachPoint=\"link_class\" /></td></tr>\n<tr><td colspan=\"2\">\n\t<table><tr>\n\t<td><button dojoType='Button' dojoAttachEvent='onClick:ok'>OK</button></td>\n\t<td><button dojoType='Button' dojoAttachEvent='onClick:cancel'>Cancel</button></td>\n\t</tr></table>\n\t</td></tr>\n</table>\n", editableAttributes:["href", "target", "class"], loadContent:function () {
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
curInst.saveSelection();
this.linkNode = dojo.withGlobal(curInst.window, "getAncestorElement", dojo.html.selection, ["a"]);
var linkAttributes = {};
this.extraAttribText = "";
if (this.linkNode) {
var attrs = this.linkNode.attributes;
for (var i = 0; i < attrs.length; i++) {
if (dojo.lang.find(this.editableAttributes, attrs[i].name.toLowerCase()) > -1) {
linkAttributes[attrs[i].name] = attrs[i].value;
} else {
if (attrs[i].specified == undefined || attrs[i].specified) {
this.extraAttribText += attrs[i].name + "=\"" + attrs[i].value + "\" ";
}
}
}
} else {
var html = dojo.withGlobal(curInst.window, "getSelectedText", dojo.html.selection);
if (html == null || html.length == 0) {
alert("Please select some text to create a link.");
return false;
}
}
for (var i = 0; i < this.editableAttributes.length; ++i) {
name = this.editableAttributes[i];
this["link_" + name].value = (linkAttributes[name] == undefined) ? "" : linkAttributes[name];
}
return true;
}, ok:function () {
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
curInst.restoreSelection();
if (!this.linkNode) {
var html = dojo.withGlobal(curInst.window, "getSelectedHtml", dojo.html.selection);
} else {
var html = this.linkNode.innerHTML;
dojo.withGlobal(curInst.window, "selectElement", dojo.html.selection, [this.linkNode]);
}
var attstr = "";
for (var i = 0; i < this.editableAttributes.length; ++i) {
name = this.editableAttributes[i];
var value = this["link_" + name].value;
if (value.length > 0) {
attstr += name + "=\"" + value + "\" ";
}
}
curInst.execCommand("inserthtml", "<a " + attstr + this.extraAttribText + ">" + html + "</a>");
this.cancel();
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Editor2Plugin/AlwaysShowToolbar.js
New file
0,0 → 1,116
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Editor2Plugin.AlwaysShowToolbar");
dojo.event.topic.subscribe("dojo.widget.Editor2::onLoad", function (editor) {
if (editor.toolbarAlwaysVisible) {
var p = new dojo.widget.Editor2Plugin.AlwaysShowToolbar(editor);
}
});
dojo.declare("dojo.widget.Editor2Plugin.AlwaysShowToolbar", null, function (editor) {
this.editor = editor;
this.editor.registerLoadedPlugin(this);
this.setup();
}, {_scrollSetUp:false, _fixEnabled:false, _scrollThreshold:false, _handleScroll:true, setup:function () {
var tdn = this.editor.toolbarWidget;
if (!tdn.tbBgIframe) {
tdn.tbBgIframe = new dojo.html.BackgroundIframe(tdn.domNode);
tdn.tbBgIframe.onResized();
}
this.scrollInterval = setInterval(dojo.lang.hitch(this, "globalOnScrollHandler"), 100);
dojo.event.connect("before", this.editor.toolbarWidget, "destroy", this, "destroy");
}, globalOnScrollHandler:function () {
var isIE = dojo.render.html.ie;
if (!this._handleScroll) {
return;
}
var dh = dojo.html;
var tdn = this.editor.toolbarWidget.domNode;
var db = dojo.body();
if (!this._scrollSetUp) {
this._scrollSetUp = true;
var editorWidth = dh.getMarginBox(this.editor.domNode).width;
this._scrollThreshold = dh.abs(tdn, true).y;
if ((isIE) && (db) && (dh.getStyle(db, "background-image") == "none")) {
with (db.style) {
backgroundImage = "url(" + dojo.uri.moduleUri("dojo.widget", "templates/images/blank.gif") + ")";
backgroundAttachment = "fixed";
}
}
}
var scrollPos = (window["pageYOffset"]) ? window["pageYOffset"] : (document["documentElement"] || document["body"]).scrollTop;
if (scrollPos > this._scrollThreshold) {
if (!this._fixEnabled) {
var tdnbox = dojo.html.getMarginBox(tdn);
this.editor.editorObject.style.marginTop = tdnbox.height + "px";
if (isIE) {
tdn.style.left = dojo.html.abs(tdn, dojo.html.boxSizing.MARGIN_BOX).x;
if (tdn.previousSibling) {
this._IEOriginalPos = ["after", tdn.previousSibling];
} else {
if (tdn.nextSibling) {
this._IEOriginalPos = ["before", tdn.nextSibling];
} else {
this._IEOriginalPos = ["", tdn.parentNode];
}
}
dojo.body().appendChild(tdn);
dojo.html.addClass(tdn, "IEFixedToolbar");
} else {
with (tdn.style) {
position = "fixed";
top = "0px";
}
}
tdn.style.width = tdnbox.width + "px";
tdn.style.zIndex = 1000;
this._fixEnabled = true;
}
if (!dojo.render.html.safari) {
var eHeight = (this.height) ? parseInt(this.editor.height) : this.editor._lastHeight;
if (scrollPos > (this._scrollThreshold + eHeight)) {
tdn.style.display = "none";
} else {
tdn.style.display = "";
}
}
} else {
if (this._fixEnabled) {
(this.editor.object || this.editor.iframe).style.marginTop = null;
with (tdn.style) {
position = "";
top = "";
zIndex = "";
display = "";
}
if (isIE) {
tdn.style.left = "";
dojo.html.removeClass(tdn, "IEFixedToolbar");
if (this._IEOriginalPos) {
dojo.html.insertAtPosition(tdn, this._IEOriginalPos[1], this._IEOriginalPos[0]);
this._IEOriginalPos = null;
} else {
dojo.html.insertBefore(tdn, this.editor.object || this.editor.iframe);
}
}
tdn.style.width = "";
this._fixEnabled = false;
}
}
}, destroy:function () {
this._IEOriginalPos = null;
this._handleScroll = false;
clearInterval(this.scrollInterval);
this.editor.unregisterLoadedPlugin(this);
if (dojo.render.html.ie) {
dojo.html.removeClass(this.editor.toolbarWidget.domNode, "IEFixedToolbar");
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Editor2Plugin/ToolbarDndSupport.js
New file
0,0 → 1,44
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Editor2Plugin.ToolbarDndSupport");
dojo.require("dojo.dnd.*");
dojo.event.topic.subscribe("dojo.widget.Editor2::preLoadingToolbar", function (editor) {
dojo.dnd.dragManager.nestedTargets = true;
var p = new dojo.widget.Editor2Plugin.ToolbarDndSupport(editor);
});
dojo.declare("dojo.widget.Editor2Plugin.ToolbarDndSupport", null, {lookForClass:"dojoEditorToolbarDnd TB_ToolbarSet TB_Toolbar", initializer:function (editor) {
this.editor = editor;
dojo.event.connect(this.editor, "toolbarLoaded", this, "setup");
this.editor.registerLoadedPlugin(this);
}, setup:function () {
dojo.event.disconnect(this.editor, "toolbarLoaded", this, "setup");
var tbw = this.editor.toolbarWidget;
dojo.event.connect("before", tbw, "destroy", this, "destroy");
var nodes = dojo.html.getElementsByClass(this.lookForClass, tbw.domNode, null, dojo.html.classMatchType.ContainsAny);
if (!nodes) {
dojo.debug("dojo.widget.Editor2Plugin.ToolbarDndSupport: No dom node with class in " + this.lookForClass);
return;
}
for (var i = 0; i < nodes.length; i++) {
var node = nodes[i];
var droptarget = node.getAttribute("dojoETDropTarget");
if (droptarget) {
(new dojo.dnd.HtmlDropTarget(node, [droptarget + tbw.widgetId])).vertical = true;
}
var dragsource = node.getAttribute("dojoETDragSource");
if (dragsource) {
new dojo.dnd.HtmlDragSource(node, dragsource + tbw.widgetId);
}
}
}, destroy:function () {
this.editor.unregisterLoadedPlugin(this);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Editor2Plugin/InsertImageDialog.js
New file
0,0 → 1,53
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Editor2Plugin.InsertImageDialog");
dojo.widget.defineWidget("dojo.widget.Editor2InsertImageDialog", dojo.widget.Editor2DialogContent, {templateString:"<table cellspacing=\"1\" cellpadding=\"1\" border=\"0\" width=\"100%\" height=\"100%\">\n\t<tr>\n\t\t<td>\n\t\t\t<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" border=\"0\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td width=\"100%\">\n\t\t\t\t\t\t<span>URL</span>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td style=\"display: none\" nowrap=\"nowrap\" rowspan=\"2\">\n\t\t\t\t\t\t<!--input id=\"btnBrowse\" onclick=\"BrowseServer();\" type=\"button\" value=\"Browse Server\"/-->\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td valign=\"top\">\n\t\t\t\t\t\t<input dojoAttachPoint=\"image_src\" style=\"width: 100%\" type=\"text\" />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td>\n\t\t\t<span>Alternative Text</span><br />\n\t\t\t<input dojoAttachPoint=\"image_alt\" style=\"width: 100%\" type=\"text\" /><br />\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td valign=\"top\">\n\t\t\t<table><tr><td>\n\t\t\t\t\t\t<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td nowrap=\"nowrap\">\n\t\t\t\t\t\t\t\t\t<span>Width</span>&nbsp;</td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<input type=\"text\" size=\"3\" dojoAttachPoint=\"image_width\" /></td>\n\n\t\t\t\t\t\t\t\t<td rowspan=\"2\">\n\t\t\t\t\t\t\t\t\t<!--div id=\"btnLockSizes\" class=\"BtnLocked\" onmouseover=\"this.className = (bLockRatio ? 'BtnLocked' : 'BtnUnlocked' ) + ' BtnOver';\"\n\t\t\t\t\t\t\t\t\t\tonmouseout=\"this.className = (bLockRatio ? 'BtnLocked' : 'BtnUnlocked' );\" title=\"Lock Sizes\"\n\t\t\t\t\t\t\t\t\t\tonclick=\"SwitchLock(this);\">\n\t\t\t\t\t\t\t\t\t</div-->\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td rowspan=\"2\">\n\t\t\t\t\t\t\t\t\t<!--div id=\"btnResetSize\" class=\"BtnReset\" onmouseover=\"this.className='BtnReset BtnOver';\"\n\t\t\t\t\t\t\t\t\t\tonmouseout=\"this.className='BtnReset';\" title=\"Reset Size\" onclick=\"ResetSizes();\">\n\t\t\t\t\t\t\t\t\t</div-->\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td nowrap=\"nowrap\">\n\t\t\t\t\t\t\t\t\t<span>Height</span>&nbsp;</td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<input type=\"text\" size=\"3\" dojoAttachPoint=\"image_height\" /></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td><td>\n\n\t\t\t\t\t\t<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n\t\t\t\t\t\t\t<tr>\n\n\t\t\t\t\t\t\t\t<td nowrap=\"nowrap\">\n\t\t\t\t\t\t\t\t\t<span >HSpace</span>&nbsp;</td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<input type=\"text\" size=\"2\" dojoAttachPoint=\"image_hspace\"/></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td nowrap=\"nowrap\">\n\t\t\t\t\t\t\t\t\t<span >VSpace</span>&nbsp;</td>\n\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<input type=\"text\" size=\"2\" dojoAttachPoint=\"image_vspace\" /></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td></tr>\n\t\t\t\t\t<tr><td colspan=\"2\">\n\t\t\t\t\t\t<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td nowrap=\"nowrap\">\n\t\t\t\t\t\t\t\t\t<span>Border</span>&nbsp;</td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<input type=\"text\" size=\"2\" value=\"\" dojoAttachPoint=\"image_border\" /></td>\n\t\t\t\t\t\t\t\t<td>&nbsp;&nbsp;&nbsp;</td>\n\t\t\t\t\t\t\t\t<td nowrap=\"nowrap\">\n\t\t\t\t\t\t\t\t\t<span >Align</span>&nbsp;</td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<select dojoAttachPoint=\"image_align\">\n\n\t\t\t\t\t\t\t\t\t\t<option value=\"\" selected=\"selected\"></option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"left\">Left</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"absBottom\">Abs Bottom</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"absMiddle\">Abs Middle</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"baseline\">Baseline</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"bottom\">Bottom</option>\n\n\t\t\t\t\t\t\t\t\t\t<option value=\"middle\">Middle</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"right\">Right</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"textTop\">Text Top</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"top\">Top</option>\n\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t</tr></table>\n\t\t</td>\n\t</tr>\n\t<tr><td>\n\t\t<table><tr>\n\t\t<td><button dojoType='Button' dojoAttachEvent='onClick:ok'>OK</button></td>\n\t\t<td><button dojoType='Button' dojoAttachEvent='onClick:cancel'>Cancel</button></td>\n\t\t</tr></table>\n\t</td></tr>\n</table>\n", editableAttributes:["src", "alt", "width", "height", "hspace", "vspace", "border", "align"], loadContent:function () {
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
this.imageNode = dojo.withGlobal(curInst.window, "getSelectedElement", dojo.html.selection);
if (!this.imageNode) {
this.imageNode = dojo.withGlobal(curInst.window, "getAncestorElement", dojo.html.selection, ["img"]);
}
var imageAttributes = {};
this.extraAttribText = "";
if (this.imageNode) {
var attrs = this.imageNode.attributes;
for (var i = 0; i < attrs.length; i++) {
if (dojo.lang.find(this.editableAttributes, attrs[i].name.toLowerCase()) > -1) {
imageAttributes[attrs[i].name] = attrs[i].value;
} else {
this.extraAttribText += attrs[i].name + "=\"" + attrs[i].value + "\" ";
}
}
}
for (var i = 0; i < this.editableAttributes.length; ++i) {
name = this.editableAttributes[i];
this["image_" + name].value = (imageAttributes[name] == undefined) ? "" : imageAttributes[name];
}
return true;
}, ok:function () {
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
var insertcmd = curInst.getCommand("inserthtml");
var option = 0;
var attstr = "";
for (var i = 0; i < this.editableAttributes.length; ++i) {
name = this.editableAttributes[i];
var value = this["image_" + name].value;
if (value.length > 0) {
attstr += name + "=\"" + value + "\" ";
}
}
if (this.imageNode) {
dojo.withGlobal(curInst.window, "selectElement", dojo.html.selection, [this.imageNode]);
}
insertcmd.execute("<img " + attstr + this.extraAttribText + "/>");
this.cancel();
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Editor2Plugin/__package__.js
New file
0,0 → 1,13
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.kwCompoundRequire({common:["dojo.widget.Editor2", "dojo.widget.Editor2Toolbar"]});
dojo.provide("dojo.widget.Editor2Plugin.*");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Editor2Plugin/TableOperation.js
New file
0,0 → 1,118
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Editor2Plugin.TableOperation");
dojo.require("dojo.widget.Editor2");
dojo.event.topic.subscribe("dojo.widget.RichText::init", function (editor) {
if (dojo.render.html.ie) {
editor.contentDomPreFilters.push(dojo.widget.Editor2Plugin.TableOperation.showIETableBorder);
editor.contentDomPostFilters.push(dojo.widget.Editor2Plugin.TableOperation.removeIEFakeClass);
}
editor.getCommand("toggletableborder");
});
dojo.lang.declare("dojo.widget.Editor2Plugin.deleteTableCommand", dojo.widget.Editor2Command, {execute:function () {
var table = dojo.withGlobal(this._editor.window, "getAncestorElement", dojo.html.selection, ["table"]);
if (table) {
dojo.withGlobal(this._editor.window, "selectElement", dojo.html.selection, [table]);
this._editor.execCommand("inserthtml", " ");
}
}, getState:function () {
if (this._editor._lastStateTimestamp > this._updateTime || this._state == undefined) {
this._updateTime = this._editor._lastStateTimestamp;
var table = dojo.withGlobal(this._editor.window, "hasAncestorElement", dojo.html.selection, ["table"]);
this._state = table ? dojo.widget.Editor2Manager.commandState.Enabled : dojo.widget.Editor2Manager.commandState.Disabled;
}
return this._state;
}, getText:function () {
return "Delete Table";
}});
dojo.lang.declare("dojo.widget.Editor2Plugin.toggleTableBorderCommand", dojo.widget.Editor2Command, function () {
this._showTableBorder = false;
dojo.event.connect(this._editor, "editorOnLoad", this, "execute");
}, {execute:function () {
if (this._showTableBorder) {
this._showTableBorder = false;
if (dojo.render.html.moz) {
this._editor.removeStyleSheet(dojo.uri.moduleUri("dojo.widget", "templates/Editor2/showtableborder_gecko.css"));
} else {
if (dojo.render.html.ie) {
this._editor.removeStyleSheet(dojo.uri.moduleUri("dojo.widget", "templates/Editor2/showtableborder_ie.css"));
}
}
} else {
this._showTableBorder = true;
if (dojo.render.html.moz) {
this._editor.addStyleSheet(dojo.uri.moduleUri("dojo.widget", "templates/Editor2/showtableborder_gecko.css"));
} else {
if (dojo.render.html.ie) {
this._editor.addStyleSheet(dojo.uri.moduleUri("dojo.widget", "templates/Editor2/showtableborder_ie.css"));
}
}
}
}, getText:function () {
return "Toggle Table Border";
}, getState:function () {
return this._showTableBorder ? dojo.widget.Editor2Manager.commandState.Latched : dojo.widget.Editor2Manager.commandState.Enabled;
}});
dojo.widget.Editor2Plugin.TableOperation = {getCommand:function (editor, name) {
switch (name.toLowerCase()) {
case "toggletableborder":
return new dojo.widget.Editor2Plugin.toggleTableBorderCommand(editor, name);
case "inserttable":
return new dojo.widget.Editor2DialogCommand(editor, "inserttable", {contentFile:"dojo.widget.Editor2Plugin.InsertTableDialog", contentClass:"Editor2InsertTableDialog", title:"Insert/Edit Table", width:"450px", height:"250px"});
case "deletetable":
return new dojo.widget.Editor2Plugin.deleteTableCommand(editor, name);
}
}, getToolbarItem:function (name) {
var name = name.toLowerCase();
var item;
switch (name) {
case "inserttable":
case "toggletableborder":
item = new dojo.widget.Editor2ToolbarButton(name);
}
return item;
}, getContextMenuGroup:function (name, contextmenuplugin) {
return new dojo.widget.Editor2Plugin.TableContextMenuGroup(contextmenuplugin);
}, showIETableBorder:function (dom) {
var tables = dom.getElementsByTagName("table");
dojo.lang.forEach(tables, function (t) {
dojo.html.addClass(t, "dojoShowIETableBorders");
});
return dom;
}, removeIEFakeClass:function (dom) {
var tables = dom.getElementsByTagName("table");
dojo.lang.forEach(tables, function (t) {
dojo.html.removeClass(t, "dojoShowIETableBorders");
});
return dom;
}};
dojo.widget.Editor2Manager.registerHandler(dojo.widget.Editor2Plugin.TableOperation.getCommand);
dojo.widget.Editor2ToolbarItemManager.registerHandler(dojo.widget.Editor2Plugin.TableOperation.getToolbarItem);
if (dojo.widget.Editor2Plugin.ContextMenuManager) {
dojo.widget.Editor2Plugin.ContextMenuManager.registerGroup("Table", dojo.widget.Editor2Plugin.TableOperation.getContextMenuGroup);
dojo.declare("dojo.widget.Editor2Plugin.TableContextMenuGroup", dojo.widget.Editor2Plugin.SimpleContextMenuGroup, {createItems:function () {
this.items.push(dojo.widget.createWidget("Editor2ContextMenuItem", {caption:"Delete Table", command:"deletetable"}));
this.items.push(dojo.widget.createWidget("Editor2ContextMenuItem", {caption:"Table Property", command:"inserttable", iconClass:"TB_Button_Icon TB_Button_Table"}));
}, checkVisibility:function () {
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
var table = dojo.withGlobal(curInst.window, "hasAncestorElement", dojo.html.selection, ["table"]);
if (dojo.withGlobal(curInst.window, "hasAncestorElement", dojo.html.selection, ["table"])) {
this.items[0].show();
this.items[1].show();
return true;
} else {
this.items[0].hide();
this.items[1].hide();
return false;
}
}});
}
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Editor2Plugin/ContextMenu.js
New file
0,0 → 1,201
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Editor2Plugin.ContextMenu");
dojo.require("dojo.widget.Menu2");
dojo.event.topic.subscribe("dojo.widget.Editor2::onLoad", function (editor) {
dojo.widget.Editor2Plugin.ContextMenuManager.getContextMenu(editor);
});
dojo.widget.Editor2Plugin.ContextMenuManager = {menuGroups:["Generic", "Link", "Anchor", "Image", "List", "Table"], _contextMenuGroupSets:{}, _registeredGroups:{}, _menus:{}, registerGroup:function (name, handler) {
if (this._registeredGroups[name]) {
alert("dojo.widget.Editor2Plugin.ContextMenuManager.registerGroup: menu group " + name + "is already registered. Ignored.");
return;
}
this._registeredGroups[name] = handler;
}, removeGroup:function (name) {
delete this._registeredGroups[name];
}, getGroup:function (name, contextmenuplugin) {
if (this._registeredGroups[name]) {
var item = this._registeredGroups[name](name, contextmenuplugin);
if (item) {
return item;
}
}
switch (name) {
case "Generic":
case "Link":
case "Image":
return new dojo.widget.Editor2Plugin[name + "ContextMenuGroup"](contextmenuplugin);
case "Anchor":
case "List":
}
}, registerGroupSet:function (name, set) {
this._contextMenuGroupSets[name] = set;
}, removeGroupSet:function (name) {
var set = this._contextMenuGroupSets[name];
delete this._contextMenuGroupSets[name];
return set;
}, getContextMenu:function (editor) {
var set = editor.contextMenuGroupSet || "defaultDojoEditor2MenuGroupSet";
if (this._menus[set]) {
this._menus[set].bindEditor(editor);
return this._menus[set];
}
var gs = (editor.contextMenuGroupSet && this._contextMenuGroupSets[editor.contextMenuGroupSet]) || this.menuGroups;
var menu = new dojo.widget.Editor2Plugin.ContextMenu(editor, gs);
this._menus[set] = menu;
return menu;
}};
dojo.declare("dojo.widget.Editor2Plugin.ContextMenu", null, function (editor, gs) {
this.groups = [];
this.separators = [];
this.editor = editor;
this.editor.registerLoadedPlugin(this);
this.contextMenu = dojo.widget.createWidget("PopupMenu2", {});
dojo.body().appendChild(this.contextMenu.domNode);
this.bindEditor(this.editor);
dojo.event.connect(this.contextMenu, "aboutToShow", this, "aboutToShow");
dojo.event.connect(this.editor, "destroy", this, "destroy");
this.setup(gs);
}, {bindEditor:function (editor) {
this.contextMenu.bindDomNode(editor.document.body);
}, setup:function (gs) {
for (var i in gs) {
var g = dojo.widget.Editor2Plugin.ContextMenuManager.getGroup(gs[i], this);
if (g) {
this.groups.push(g);
}
}
}, aboutToShow:function () {
var first = true;
for (var i in this.groups) {
if (i > 0 && this.separators.length != this.groups.length - 1) {
this.separators.push(dojo.widget.createWidget("MenuSeparator2", {}));
this.contextMenu.addChild(this.separators[this.separators.length - 1]);
}
if (this.groups[i].refresh()) {
if (i > 0) {
if (first) {
this.separators[i - 1].hide();
} else {
this.separators[i - 1].show();
}
}
if (first) {
first = false;
}
} else {
if (i > 0) {
this.separators[i - 1].hide();
}
}
}
}, destroy:function () {
this.editor.unregisterLoadedPlugin(this);
delete this.groups;
delete this.separators;
this.contextMenu.destroy();
delete this.contextMenu;
}});
dojo.widget.defineWidget("dojo.widget.Editor2ContextMenuItem", dojo.widget.MenuItem2, {command:"", buildRendering:function () {
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
this.caption = curInst.getCommand(this.command).getText();
dojo.widget.Editor2ContextMenuItem.superclass.buildRendering.apply(this, arguments);
}, onClick:function () {
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
if (curInst) {
var _command = curInst.getCommand(this.command);
if (_command) {
_command.execute();
}
}
}, refresh:function () {
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
if (curInst) {
var _command = curInst.getCommand(this.command);
if (_command) {
if (_command.getState() == dojo.widget.Editor2Manager.commandState.Disabled) {
this.disable();
return false;
} else {
this.enable();
return true;
}
}
}
}, hide:function () {
this.domNode.style.display = "none";
}, show:function () {
this.domNode.style.display = "";
}});
dojo.declare("dojo.widget.Editor2Plugin.SimpleContextMenuGroup", null, function (contextmenuplugin) {
this.contextMenu = contextmenuplugin.contextMenu;
this.items = [];
dojo.event.connect(contextmenuplugin, "destroy", this, "destroy");
}, {refresh:function () {
if (!this.items.length) {
this.createItems();
for (var i in this.items) {
this.contextMenu.addChild(this.items[i]);
}
}
return this.checkVisibility();
}, destroy:function () {
this.contextmenu = null;
delete this.items;
delete this.contextMenu;
}, createItems:function () {
}, checkVisibility:function () {
var show = false;
for (var i in this.items) {
show = show || this.items[i].refresh();
}
var action = show ? "show" : "hide";
for (var i in this.items) {
this.items[i][action]();
}
return show;
}});
dojo.declare("dojo.widget.Editor2Plugin.GenericContextMenuGroup", dojo.widget.Editor2Plugin.SimpleContextMenuGroup, {createItems:function () {
this.items.push(dojo.widget.createWidget("Editor2ContextMenuItem", {command:"cut", iconClass:"dojoE2TBIcon dojoE2TBIcon_Cut"}));
this.items.push(dojo.widget.createWidget("Editor2ContextMenuItem", {command:"copy", iconClass:"dojoE2TBIcon dojoE2TBIcon_Copy"}));
this.items.push(dojo.widget.createWidget("Editor2ContextMenuItem", {command:"paste", iconClass:"dojoE2TBIcon dojoE2TBIcon_Paste"}));
}});
dojo.declare("dojo.widget.Editor2Plugin.LinkContextMenuGroup", dojo.widget.Editor2Plugin.SimpleContextMenuGroup, {createItems:function () {
this.items.push(dojo.widget.createWidget("Editor2ContextMenuItem", {command:"createlink", iconClass:"dojoE2TBIcon dojoE2TBIcon_Link"}));
this.items.push(dojo.widget.createWidget("Editor2ContextMenuItem", {command:"unlink", iconClass:"dojoE2TBIcon dojoE2TBIcon_UnLink"}));
}, checkVisibility:function () {
var show = this.items[1].refresh();
if (show) {
this.items[0].refresh();
for (var i in this.items) {
this.items[i].show();
}
} else {
for (var i in this.items) {
this.items[i].hide();
}
}
return show;
}});
dojo.declare("dojo.widget.Editor2Plugin.ImageContextMenuGroup", dojo.widget.Editor2Plugin.SimpleContextMenuGroup, {createItems:function () {
this.items.push(dojo.widget.createWidget("Editor2ContextMenuItem", {command:"insertimage", iconClass:"dojoE2TBIcon dojoE2TBIcon_Image"}));
}, checkVisibility:function () {
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
var img = dojo.withGlobal(curInst.window, "getSelectedElement", dojo.html.selection);
if (img && img.tagName.toLowerCase() == "img") {
this.items[0].show();
return true;
} else {
this.items[0].hide();
return false;
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Editor2Plugin/SimpleSignalCommands.js
New file
0,0 → 1,50
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Editor2Plugin.SimpleSignalCommands");
dojo.require("dojo.widget.Editor2");
dojo.declare("dojo.widget.Editor2Plugin.SimpleSignalCommand", dojo.widget.Editor2Command, function (editor, name) {
if (dojo.widget.Editor2.prototype[name] == undefined) {
dojo.widget.Editor2.prototype[name] = function () {
};
}
}, {execute:function () {
this._editor[this._name]();
}});
if (dojo.widget.Editor2Plugin["SimpleSignalCommands"]) {
dojo.widget.Editor2Plugin["_SimpleSignalCommands"] = dojo.widget.Editor2Plugin["SimpleSignalCommands"];
}
dojo.widget.Editor2Plugin.SimpleSignalCommands = {signals:["save", "insertImage"], Handler:function (name) {
if (name.toLowerCase() == "save") {
return new dojo.widget.Editor2ToolbarButton("Save");
} else {
if (name.toLowerCase() == "insertimage") {
return new dojo.widget.Editor2ToolbarButton("InsertImage");
}
}
}, getCommand:function (editor, name) {
var signal;
dojo.lang.every(this.signals, function (s) {
if (s.toLowerCase() == name.toLowerCase()) {
signal = s;
return false;
}
return true;
});
if (signal) {
return new dojo.widget.Editor2Plugin.SimpleSignalCommand(editor, signal);
}
}};
if (dojo.widget.Editor2Plugin["_SimpleSignalCommands"]) {
dojo.lang.mixin(dojo.widget.Editor2Plugin.SimpleSignalCommands, dojo.widget.Editor2Plugin["_SimpleSignalCommands"]);
}
dojo.widget.Editor2Manager.registerHandler(dojo.widget.Editor2Plugin.SimpleSignalCommands, "getCommand");
dojo.widget.Editor2ToolbarItemManager.registerHandler(dojo.widget.Editor2Plugin.SimpleSignalCommands.Handler);
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/TreeTimeoutIterator.js
New file
0,0 → 1,86
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeTimeoutIterator");
dojo.require("dojo.event.*");
dojo.require("dojo.json");
dojo.require("dojo.io.*");
dojo.require("dojo.widget.TreeCommon");
dojo.declare("dojo.widget.TreeTimeoutIterator", null, function (elem, callFunc, callObj) {
var _this = this;
this.currentParent = elem;
this.callFunc = callFunc;
this.callObj = callObj ? callObj : this;
this.stack = [];
}, {maxStackDepth:Number.POSITIVE_INFINITY, stack:null, currentParent:null, currentIndex:0, filterFunc:function () {
return true;
}, finishFunc:function () {
return true;
}, setFilter:function (func, obj) {
this.filterFunc = func;
this.filterObj = obj;
}, setMaxLevel:function (level) {
this.maxStackDepth = level - 2;
}, forward:function (timeout) {
var _this = this;
if (this.timeout) {
var tid = setTimeout(function () {
_this.processNext();
clearTimeout(tid);
}, _this.timeout);
} else {
return this.processNext();
}
}, start:function (processFirst) {
if (processFirst) {
return this.callFunc.call(this.callObj, this.currentParent, this);
}
return this.processNext();
}, processNext:function () {
var handler;
var _this = this;
var found;
var next;
if (this.maxStackDepth == -2) {
return;
}
while (true) {
var children = this.currentParent.children;
if (children && children.length) {
do {
next = children[this.currentIndex];
} while (this.currentIndex++ < children.length && !(found = this.filterFunc.call(this.filterObj, next)));
if (found) {
if (next.isFolder && this.stack.length <= this.maxStackDepth) {
this.moveParent(next, 0);
}
return this.callFunc.call(this.callObj, next, this);
}
}
if (this.stack.length) {
this.popParent();
continue;
}
break;
}
return this.finishFunc.call(this.finishObj);
}, setFinish:function (func, obj) {
this.finishFunc = func;
this.finishObj = obj;
}, popParent:function () {
var p = this.stack.pop();
this.currentParent = p[0];
this.currentIndex = p[1];
}, moveParent:function (nextParent, nextIndex) {
this.stack.push([this.currentParent, this.currentIndex]);
this.currentParent = nextParent;
this.currentIndex = nextIndex;
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/DomWidget.js
New file
0,0 → 1,505
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.DomWidget");
dojo.require("dojo.event.*");
dojo.require("dojo.widget.Widget");
dojo.require("dojo.dom");
dojo.require("dojo.html.style");
dojo.require("dojo.xml.Parse");
dojo.require("dojo.uri.*");
dojo.require("dojo.lang.func");
dojo.require("dojo.lang.extras");
dojo.widget._cssFiles = {};
dojo.widget._cssStrings = {};
dojo.widget._templateCache = {};
dojo.widget.defaultStrings = {dojoRoot:dojo.hostenv.getBaseScriptUri(), dojoWidgetModuleUri:dojo.uri.moduleUri("dojo.widget"), baseScriptUri:dojo.hostenv.getBaseScriptUri()};
dojo.widget.fillFromTemplateCache = function (obj, templatePath, templateString, avoidCache) {
var tpath = templatePath || obj.templatePath;
var tmplts = dojo.widget._templateCache;
if (!tpath && !obj["widgetType"]) {
do {
var dummyName = "__dummyTemplate__" + dojo.widget._templateCache.dummyCount++;
} while (tmplts[dummyName]);
obj.widgetType = dummyName;
}
var wt = tpath ? tpath.toString() : obj.widgetType;
var ts = tmplts[wt];
if (!ts) {
tmplts[wt] = {"string":null, "node":null};
if (avoidCache) {
ts = {};
} else {
ts = tmplts[wt];
}
}
if ((!obj.templateString) && (!avoidCache)) {
obj.templateString = templateString || ts["string"];
}
if (obj.templateString) {
obj.templateString = this._sanitizeTemplateString(obj.templateString);
}
if ((!obj.templateNode) && (!avoidCache)) {
obj.templateNode = ts["node"];
}
if ((!obj.templateNode) && (!obj.templateString) && (tpath)) {
var tstring = this._sanitizeTemplateString(dojo.hostenv.getText(tpath));
obj.templateString = tstring;
if (!avoidCache) {
tmplts[wt]["string"] = tstring;
}
}
if ((!ts["string"]) && (!avoidCache)) {
ts.string = obj.templateString;
}
};
dojo.widget._sanitizeTemplateString = function (tString) {
if (tString) {
tString = tString.replace(/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im, "");
var matches = tString.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);
if (matches) {
tString = matches[1];
}
} else {
tString = "";
}
return tString;
};
dojo.widget._templateCache.dummyCount = 0;
dojo.widget.attachProperties = ["dojoAttachPoint", "id"];
dojo.widget.eventAttachProperty = "dojoAttachEvent";
dojo.widget.onBuildProperty = "dojoOnBuild";
dojo.widget.waiNames = ["waiRole", "waiState"];
dojo.widget.wai = {waiRole:{name:"waiRole", "namespace":"http://www.w3.org/TR/xhtml2", alias:"x2", prefix:"wairole:"}, waiState:{name:"waiState", "namespace":"http://www.w3.org/2005/07/aaa", alias:"aaa", prefix:""}, setAttr:function (node, ns, attr, value) {
if (dojo.render.html.ie) {
node.setAttribute(this[ns].alias + ":" + attr, this[ns].prefix + value);
} else {
node.setAttributeNS(this[ns]["namespace"], attr, this[ns].prefix + value);
}
}, getAttr:function (node, ns, attr) {
if (dojo.render.html.ie) {
return node.getAttribute(this[ns].alias + ":" + attr);
} else {
return node.getAttributeNS(this[ns]["namespace"], attr);
}
}, removeAttr:function (node, ns, attr) {
var success = true;
if (dojo.render.html.ie) {
success = node.removeAttribute(this[ns].alias + ":" + attr);
} else {
node.removeAttributeNS(this[ns]["namespace"], attr);
}
return success;
}};
dojo.widget.attachTemplateNodes = function (rootNode, targetObj, events) {
var elementNodeType = dojo.dom.ELEMENT_NODE;
function trim(str) {
return str.replace(/^\s+|\s+$/g, "");
}
if (!rootNode) {
rootNode = targetObj.domNode;
}
if (rootNode.nodeType != elementNodeType) {
return;
}
var nodes = rootNode.all || rootNode.getElementsByTagName("*");
var _this = targetObj;
for (var x = -1; x < nodes.length; x++) {
var baseNode = (x == -1) ? rootNode : nodes[x];
var attachPoint = [];
if (!targetObj.widgetsInTemplate || !baseNode.getAttribute("dojoType")) {
for (var y = 0; y < this.attachProperties.length; y++) {
var tmpAttachPoint = baseNode.getAttribute(this.attachProperties[y]);
if (tmpAttachPoint) {
attachPoint = tmpAttachPoint.split(";");
for (var z = 0; z < attachPoint.length; z++) {
if (dojo.lang.isArray(targetObj[attachPoint[z]])) {
targetObj[attachPoint[z]].push(baseNode);
} else {
targetObj[attachPoint[z]] = baseNode;
}
}
break;
}
}
var attachEvent = baseNode.getAttribute(this.eventAttachProperty);
if (attachEvent) {
var evts = attachEvent.split(";");
for (var y = 0; y < evts.length; y++) {
if ((!evts[y]) || (!evts[y].length)) {
continue;
}
var thisFunc = null;
var tevt = trim(evts[y]);
if (evts[y].indexOf(":") >= 0) {
var funcNameArr = tevt.split(":");
tevt = trim(funcNameArr[0]);
thisFunc = trim(funcNameArr[1]);
}
if (!thisFunc) {
thisFunc = tevt;
}
var tf = function () {
var ntf = new String(thisFunc);
return function (evt) {
if (_this[ntf]) {
_this[ntf](dojo.event.browser.fixEvent(evt, this));
}
};
}();
dojo.event.browser.addListener(baseNode, tevt, tf, false, true);
}
}
for (var y = 0; y < events.length; y++) {
var evtVal = baseNode.getAttribute(events[y]);
if ((evtVal) && (evtVal.length)) {
var thisFunc = null;
var domEvt = events[y].substr(4);
thisFunc = trim(evtVal);
var funcs = [thisFunc];
if (thisFunc.indexOf(";") >= 0) {
funcs = dojo.lang.map(thisFunc.split(";"), trim);
}
for (var z = 0; z < funcs.length; z++) {
if (!funcs[z].length) {
continue;
}
var tf = function () {
var ntf = new String(funcs[z]);
return function (evt) {
if (_this[ntf]) {
_this[ntf](dojo.event.browser.fixEvent(evt, this));
}
};
}();
dojo.event.browser.addListener(baseNode, domEvt, tf, false, true);
}
}
}
}
var tmpltPoint = baseNode.getAttribute(this.templateProperty);
if (tmpltPoint) {
targetObj[tmpltPoint] = baseNode;
}
dojo.lang.forEach(dojo.widget.waiNames, function (name) {
var wai = dojo.widget.wai[name];
var val = baseNode.getAttribute(wai.name);
if (val) {
if (val.indexOf("-") == -1) {
dojo.widget.wai.setAttr(baseNode, wai.name, "role", val);
} else {
var statePair = val.split("-");
dojo.widget.wai.setAttr(baseNode, wai.name, statePair[0], statePair[1]);
}
}
}, this);
var onBuild = baseNode.getAttribute(this.onBuildProperty);
if (onBuild) {
eval("var node = baseNode; var widget = targetObj; " + onBuild);
}
}
};
dojo.widget.getDojoEventsFromStr = function (str) {
var re = /(dojoOn([a-z]+)(\s?))=/gi;
var evts = str ? str.match(re) || [] : [];
var ret = [];
var lem = {};
for (var x = 0; x < evts.length; x++) {
if (evts[x].length < 1) {
continue;
}
var cm = evts[x].replace(/\s/, "");
cm = (cm.slice(0, cm.length - 1));
if (!lem[cm]) {
lem[cm] = true;
ret.push(cm);
}
}
return ret;
};
dojo.declare("dojo.widget.DomWidget", dojo.widget.Widget, function () {
if ((arguments.length > 0) && (typeof arguments[0] == "object")) {
this.create(arguments[0]);
}
}, {templateNode:null, templateString:null, templateCssString:null, preventClobber:false, domNode:null, containerNode:null, widgetsInTemplate:false, addChild:function (widget, overrideContainerNode, pos, ref, insertIndex) {
if (!this.isContainer) {
dojo.debug("dojo.widget.DomWidget.addChild() attempted on non-container widget");
return null;
} else {
if (insertIndex == undefined) {
insertIndex = this.children.length;
}
this.addWidgetAsDirectChild(widget, overrideContainerNode, pos, ref, insertIndex);
this.registerChild(widget, insertIndex);
}
return widget;
}, addWidgetAsDirectChild:function (widget, overrideContainerNode, pos, ref, insertIndex) {
if ((!this.containerNode) && (!overrideContainerNode)) {
this.containerNode = this.domNode;
}
var cn = (overrideContainerNode) ? overrideContainerNode : this.containerNode;
if (!pos) {
pos = "after";
}
if (!ref) {
if (!cn) {
cn = dojo.body();
}
ref = cn.lastChild;
}
if (!insertIndex) {
insertIndex = 0;
}
widget.domNode.setAttribute("dojoinsertionindex", insertIndex);
if (!ref) {
cn.appendChild(widget.domNode);
} else {
if (pos == "insertAtIndex") {
dojo.dom.insertAtIndex(widget.domNode, ref.parentNode, insertIndex);
} else {
if ((pos == "after") && (ref === cn.lastChild)) {
cn.appendChild(widget.domNode);
} else {
dojo.dom.insertAtPosition(widget.domNode, cn, pos);
}
}
}
}, registerChild:function (widget, insertionIndex) {
widget.dojoInsertionIndex = insertionIndex;
var idx = -1;
for (var i = 0; i < this.children.length; i++) {
if (this.children[i].dojoInsertionIndex <= insertionIndex) {
idx = i;
}
}
this.children.splice(idx + 1, 0, widget);
widget.parent = this;
widget.addedTo(this, idx + 1);
delete dojo.widget.manager.topWidgets[widget.widgetId];
}, removeChild:function (widget) {
dojo.dom.removeNode(widget.domNode);
return dojo.widget.DomWidget.superclass.removeChild.call(this, widget);
}, getFragNodeRef:function (frag) {
if (!frag) {
return null;
}
if (!frag[this.getNamespacedType()]) {
dojo.raise("Error: no frag for widget type " + this.getNamespacedType() + ", id " + this.widgetId + " (maybe a widget has set it's type incorrectly)");
}
return frag[this.getNamespacedType()]["nodeRef"];
}, postInitialize:function (args, frag, parentComp) {
var sourceNodeRef = this.getFragNodeRef(frag);
if (parentComp && (parentComp.snarfChildDomOutput || !sourceNodeRef)) {
parentComp.addWidgetAsDirectChild(this, "", "insertAtIndex", "", args["dojoinsertionindex"], sourceNodeRef);
} else {
if (sourceNodeRef) {
if (this.domNode && (this.domNode !== sourceNodeRef)) {
this._sourceNodeRef = dojo.dom.replaceNode(sourceNodeRef, this.domNode);
}
}
}
if (parentComp) {
parentComp.registerChild(this, args.dojoinsertionindex);
} else {
dojo.widget.manager.topWidgets[this.widgetId] = this;
}
if (this.widgetsInTemplate) {
var parser = new dojo.xml.Parse();
var subContainerNode;
var subnodes = this.domNode.getElementsByTagName("*");
for (var i = 0; i < subnodes.length; i++) {
if (subnodes[i].getAttribute("dojoAttachPoint") == "subContainerWidget") {
subContainerNode = subnodes[i];
}
if (subnodes[i].getAttribute("dojoType")) {
subnodes[i].setAttribute("isSubWidget", true);
}
}
if (this.isContainer && !this.containerNode) {
if (subContainerNode) {
var src = this.getFragNodeRef(frag);
if (src) {
dojo.dom.moveChildren(src, subContainerNode);
frag["dojoDontFollow"] = true;
}
} else {
dojo.debug("No subContainerWidget node can be found in template file for widget " + this);
}
}
var templatefrag = parser.parseElement(this.domNode, null, true);
dojo.widget.getParser().createSubComponents(templatefrag, this);
var subwidgets = [];
var stack = [this];
var w;
while ((w = stack.pop())) {
for (var i = 0; i < w.children.length; i++) {
var cwidget = w.children[i];
if (cwidget._processedSubWidgets || !cwidget.extraArgs["issubwidget"]) {
continue;
}
subwidgets.push(cwidget);
if (cwidget.isContainer) {
stack.push(cwidget);
}
}
}
for (var i = 0; i < subwidgets.length; i++) {
var widget = subwidgets[i];
if (widget._processedSubWidgets) {
dojo.debug("This should not happen: widget._processedSubWidgets is already true!");
return;
}
widget._processedSubWidgets = true;
if (widget.extraArgs["dojoattachevent"]) {
var evts = widget.extraArgs["dojoattachevent"].split(";");
for (var j = 0; j < evts.length; j++) {
var thisFunc = null;
var tevt = dojo.string.trim(evts[j]);
if (tevt.indexOf(":") >= 0) {
var funcNameArr = tevt.split(":");
tevt = dojo.string.trim(funcNameArr[0]);
thisFunc = dojo.string.trim(funcNameArr[1]);
}
if (!thisFunc) {
thisFunc = tevt;
}
if (dojo.lang.isFunction(widget[tevt])) {
dojo.event.kwConnect({srcObj:widget, srcFunc:tevt, targetObj:this, targetFunc:thisFunc});
} else {
alert(tevt + " is not a function in widget " + widget);
}
}
}
if (widget.extraArgs["dojoattachpoint"]) {
this[widget.extraArgs["dojoattachpoint"]] = widget;
}
}
}
if (this.isContainer && !frag["dojoDontFollow"]) {
dojo.widget.getParser().createSubComponents(frag, this);
}
}, buildRendering:function (args, frag) {
var ts = dojo.widget._templateCache[this.widgetType];
if (args["templatecsspath"]) {
args["templateCssPath"] = args["templatecsspath"];
}
var cpath = args["templateCssPath"] || this.templateCssPath;
if (cpath && !dojo.widget._cssFiles[cpath.toString()]) {
if ((!this.templateCssString) && (cpath)) {
this.templateCssString = dojo.hostenv.getText(cpath);
this.templateCssPath = null;
}
dojo.widget._cssFiles[cpath.toString()] = true;
}
if ((this["templateCssString"]) && (!dojo.widget._cssStrings[this.templateCssString])) {
dojo.html.insertCssText(this.templateCssString, null, cpath);
dojo.widget._cssStrings[this.templateCssString] = true;
}
if ((!this.preventClobber) && ((this.templatePath) || (this.templateNode) || ((this["templateString"]) && (this.templateString.length)) || ((typeof ts != "undefined") && ((ts["string"]) || (ts["node"]))))) {
this.buildFromTemplate(args, frag);
} else {
this.domNode = this.getFragNodeRef(frag);
}
this.fillInTemplate(args, frag);
}, buildFromTemplate:function (args, frag) {
var avoidCache = false;
if (args["templatepath"]) {
args["templatePath"] = args["templatepath"];
}
dojo.widget.fillFromTemplateCache(this, args["templatePath"], null, avoidCache);
var ts = dojo.widget._templateCache[this.templatePath ? this.templatePath.toString() : this.widgetType];
if ((ts) && (!avoidCache)) {
if (!this.templateString.length) {
this.templateString = ts["string"];
}
if (!this.templateNode) {
this.templateNode = ts["node"];
}
}
var matches = false;
var node = null;
var tstr = this.templateString;
if ((!this.templateNode) && (this.templateString)) {
matches = this.templateString.match(/\$\{([^\}]+)\}/g);
if (matches) {
var hash = this.strings || {};
for (var key in dojo.widget.defaultStrings) {
if (dojo.lang.isUndefined(hash[key])) {
hash[key] = dojo.widget.defaultStrings[key];
}
}
for (var i = 0; i < matches.length; i++) {
var key = matches[i];
key = key.substring(2, key.length - 1);
var kval = (key.substring(0, 5) == "this.") ? dojo.lang.getObjPathValue(key.substring(5), this) : hash[key];
var value;
if ((kval) || (dojo.lang.isString(kval))) {
value = new String((dojo.lang.isFunction(kval)) ? kval.call(this, key, this.templateString) : kval);
while (value.indexOf("\"") > -1) {
value = value.replace("\"", "&quot;");
}
tstr = tstr.replace(matches[i], value);
}
}
} else {
this.templateNode = this.createNodesFromText(this.templateString, true)[0];
if (!avoidCache) {
ts.node = this.templateNode;
}
}
}
if ((!this.templateNode) && (!matches)) {
dojo.debug("DomWidget.buildFromTemplate: could not create template");
return false;
} else {
if (!matches) {
node = this.templateNode.cloneNode(true);
if (!node) {
return false;
}
} else {
node = this.createNodesFromText(tstr, true)[0];
}
}
this.domNode = node;
this.attachTemplateNodes();
if (this.isContainer && this.containerNode) {
var src = this.getFragNodeRef(frag);
if (src) {
dojo.dom.moveChildren(src, this.containerNode);
}
}
}, attachTemplateNodes:function (baseNode, targetObj) {
if (!baseNode) {
baseNode = this.domNode;
}
if (!targetObj) {
targetObj = this;
}
return dojo.widget.attachTemplateNodes(baseNode, targetObj, dojo.widget.getDojoEventsFromStr(this.templateString));
}, fillInTemplate:function () {
}, destroyRendering:function () {
try {
dojo.dom.destroyNode(this.domNode);
delete this.domNode;
}
catch (e) {
}
if (this._sourceNodeRef) {
try {
dojo.dom.destroyNode(this._sourceNodeRef);
}
catch (e) {
}
}
}, createNodesFromText:function () {
dojo.unimplemented("dojo.widget.DomWidget.createNodesFromText");
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/TitlePane.js
New file
0,0 → 1,41
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TitlePane");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.ContentPane");
dojo.require("dojo.html.style");
dojo.require("dojo.lfx.*");
dojo.widget.defineWidget("dojo.widget.TitlePane", dojo.widget.ContentPane, {labelNodeClass:"", containerNodeClass:"", label:"", open:true, templateString:"<div dojoAttachPoint=\"domNode\">\n<div dojoAttachPoint=\"labelNode\" dojoAttachEvent=\"onclick: onLabelClick\"></div>\n<div dojoAttachPoint=\"containerNode\"></div>\n</div>\n", postCreate:function () {
if (this.label) {
this.labelNode.appendChild(document.createTextNode(this.label));
}
if (this.labelNodeClass) {
dojo.html.addClass(this.labelNode, this.labelNodeClass);
}
if (this.containerNodeClass) {
dojo.html.addClass(this.containerNode, this.containerNodeClass);
}
if (!this.open) {
dojo.html.hide(this.containerNode);
}
dojo.widget.TitlePane.superclass.postCreate.apply(this, arguments);
}, onLabelClick:function () {
if (this.open) {
dojo.lfx.wipeOut(this.containerNode, 250).play();
this.open = false;
} else {
dojo.lfx.wipeIn(this.containerNode, 250).play();
this.open = true;
}
}, setLabel:function (label) {
this.labelNode.innerHTML = label;
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/DropdownDatePicker.js
New file
0,0 → 1,108
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.DropdownDatePicker");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.DropdownContainer");
dojo.require("dojo.widget.DatePicker");
dojo.require("dojo.event.*");
dojo.require("dojo.html.*");
dojo.require("dojo.date.format");
dojo.require("dojo.date.serialize");
dojo.require("dojo.string.common");
dojo.require("dojo.i18n.common");
dojo.requireLocalization("dojo.widget", "DropdownDatePicker", null, "ROOT");
dojo.widget.defineWidget("dojo.widget.DropdownDatePicker", dojo.widget.DropdownContainer, {iconURL:dojo.uri.moduleUri("dojo.widget", "templates/images/dateIcon.gif"), formatLength:"short", displayFormat:"", saveFormat:"", value:"", name:"", displayWeeks:6, adjustWeeks:false, startDate:"1492-10-12", endDate:"2941-10-12", weekStartsOn:"", staticDisplay:false, postMixInProperties:function (localProperties, frag) {
dojo.widget.DropdownDatePicker.superclass.postMixInProperties.apply(this, arguments);
var messages = dojo.i18n.getLocalization("dojo.widget", "DropdownDatePicker", this.lang);
this.iconAlt = messages.selectDate;
if (typeof (this.value) == "string" && this.value.toLowerCase() == "today") {
this.value = new Date();
}
if (this.value && isNaN(this.value)) {
var orig = this.value;
this.value = dojo.date.fromRfc3339(this.value);
if (!this.value) {
this.value = new Date(orig);
dojo.deprecated("dojo.widget.DropdownDatePicker", "date attributes must be passed in Rfc3339 format", "0.5");
}
}
if (this.value && !isNaN(this.value)) {
this.value = new Date(this.value);
}
}, fillInTemplate:function (args, frag) {
dojo.widget.DropdownDatePicker.superclass.fillInTemplate.call(this, args, frag);
var dpArgs = {widgetContainerId:this.widgetId, lang:this.lang, value:this.value, startDate:this.startDate, endDate:this.endDate, displayWeeks:this.displayWeeks, weekStartsOn:this.weekStartsOn, adjustWeeks:this.adjustWeeks, staticDisplay:this.staticDisplay};
this.datePicker = dojo.widget.createWidget("DatePicker", dpArgs, this.containerNode, "child");
dojo.event.connect(this.datePicker, "onValueChanged", this, "_updateText");
dojo.event.connect(this.inputNode, "onChange", this, "_updateText");
if (this.value) {
this._updateText();
}
this.containerNode.explodeClassName = "calendarBodyContainer";
this.valueNode.name = this.name;
}, getValue:function () {
return this.valueNode.value;
}, getDate:function () {
return this.datePicker.value;
}, setValue:function (rfcDate) {
this.setDate(rfcDate);
}, setDate:function (dateObj) {
this.datePicker.setDate(dateObj);
this._syncValueNode();
}, _updateText:function () {
this.inputNode.value = this.datePicker.value ? dojo.date.format(this.datePicker.value, {formatLength:this.formatLength, datePattern:this.displayFormat, selector:"dateOnly", locale:this.lang}) : "";
if (this.value < this.datePicker.startDate || this.value > this.datePicker.endDate) {
this.inputNode.value = "";
}
this._syncValueNode();
this.onValueChanged(this.getDate());
this.hideContainer();
}, onValueChanged:function (dateObj) {
}, onInputChange:function () {
var input = dojo.string.trim(this.inputNode.value);
if (input) {
var inputDate = dojo.date.parse(input, {formatLength:this.formatLength, datePattern:this.displayFormat, selector:"dateOnly", locale:this.lang});
if (!this.datePicker._isDisabledDate(inputDate)) {
this.setDate(inputDate);
}
} else {
if (input == "") {
this.datePicker.setDate("");
}
this.valueNode.value = input;
}
if (input) {
this._updateText();
}
}, _syncValueNode:function () {
var date = this.datePicker.value;
var value = "";
switch (this.saveFormat.toLowerCase()) {
case "rfc":
case "iso":
case "":
value = dojo.date.toRfc3339(date, "dateOnly");
break;
case "posix":
case "unix":
value = Number(date);
break;
default:
if (date) {
value = dojo.date.format(date, {datePattern:this.saveFormat, selector:"dateOnly", locale:this.lang});
}
}
this.valueNode.value = value;
}, destroy:function (finalize) {
this.datePicker.destroy(finalize);
dojo.widget.DropdownDatePicker.superclass.destroy.apply(this, arguments);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/FisheyeList.js
New file
0,0 → 1,444
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.FisheyeList");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.html.style");
dojo.require("dojo.html.selection");
dojo.require("dojo.html.util");
dojo.require("dojo.event.*");
dojo.widget.defineWidget("dojo.widget.FisheyeList", dojo.widget.HtmlWidget, function () {
this.pos = {x:-1, y:-1};
this.EDGE = {CENTER:0, LEFT:1, RIGHT:2, TOP:3, BOTTOM:4};
this.timerScale = 1;
}, {templateString:"<div class=\"dojoHtmlFisheyeListBar\"></div>", templateCssString:".dojoHtmlFisheyeListItemLabel {\n\tfont-family: Arial, Helvetica, sans-serif;\n\tbackground-color: #eee;\n\tborder: 2px solid #666;\n\tpadding: 2px;\n\ttext-align: center;\n\tposition: absolute;\n\tdisplay: none;\n}\n\n.dojoHtmlFisheyeListItemLabel.selected {\n\tdisplay: block;\n}\n\n.dojoHtmlFisheyeListItemImage {\n\tborder: 0px;\n\tposition: absolute;\n}\n\n.dojoHtmlFisheyeListItem {\n\tposition: absolute;\n\tz-index: 2;\n}\n\n.dojoHtmlFisheyeListBar {\n\tposition: relative;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/FisheyeList.css"), isContainer:true, snarfChildDomOutput:true, itemWidth:40, itemHeight:40, itemMaxWidth:150, itemMaxHeight:150, orientation:"horizontal", conservativeTrigger:false, effectUnits:2, itemPadding:10, attachEdge:"center", labelEdge:"bottom", enableCrappySvgSupport:false, fillInTemplate:function () {
dojo.html.disableSelection(this.domNode);
this.isHorizontal = (this.orientation == "horizontal");
this.selectedNode = -1;
this.isOver = false;
this.hitX1 = -1;
this.hitY1 = -1;
this.hitX2 = -1;
this.hitY2 = -1;
this.anchorEdge = this._toEdge(this.attachEdge, this.EDGE.CENTER);
this.labelEdge = this._toEdge(this.labelEdge, this.EDGE.TOP);
if (this.isHorizontal && (this.anchorEdge == this.EDGE.LEFT)) {
this.anchorEdge = this.EDGE.CENTER;
}
if (this.isHorizontal && (this.anchorEdge == this.EDGE.RIGHT)) {
this.anchorEdge = this.EDGE.CENTER;
}
if (!this.isHorizontal && (this.anchorEdge == this.EDGE.TOP)) {
this.anchorEdge = this.EDGE.CENTER;
}
if (!this.isHorizontal && (this.anchorEdge == this.EDGE.BOTTOM)) {
this.anchorEdge = this.EDGE.CENTER;
}
if (this.labelEdge == this.EDGE.CENTER) {
this.labelEdge = this.EDGE.TOP;
}
if (this.isHorizontal && (this.labelEdge == this.EDGE.LEFT)) {
this.labelEdge = this.EDGE.TOP;
}
if (this.isHorizontal && (this.labelEdge == this.EDGE.RIGHT)) {
this.labelEdge = this.EDGE.TOP;
}
if (!this.isHorizontal && (this.labelEdge == this.EDGE.TOP)) {
this.labelEdge = this.EDGE.LEFT;
}
if (!this.isHorizontal && (this.labelEdge == this.EDGE.BOTTOM)) {
this.labelEdge = this.EDGE.LEFT;
}
this.proximityLeft = this.itemWidth * (this.effectUnits - 0.5);
this.proximityRight = this.itemWidth * (this.effectUnits - 0.5);
this.proximityTop = this.itemHeight * (this.effectUnits - 0.5);
this.proximityBottom = this.itemHeight * (this.effectUnits - 0.5);
if (this.anchorEdge == this.EDGE.LEFT) {
this.proximityLeft = 0;
}
if (this.anchorEdge == this.EDGE.RIGHT) {
this.proximityRight = 0;
}
if (this.anchorEdge == this.EDGE.TOP) {
this.proximityTop = 0;
}
if (this.anchorEdge == this.EDGE.BOTTOM) {
this.proximityBottom = 0;
}
if (this.anchorEdge == this.EDGE.CENTER) {
this.proximityLeft /= 2;
this.proximityRight /= 2;
this.proximityTop /= 2;
this.proximityBottom /= 2;
}
}, postCreate:function () {
this._initializePositioning();
if (!this.conservativeTrigger) {
dojo.event.connect(document.documentElement, "onmousemove", this, "_onMouseMove");
}
dojo.event.connect(document.documentElement, "onmouseout", this, "_onBodyOut");
dojo.event.connect(this, "addChild", this, "_initializePositioning");
}, _initializePositioning:function () {
this.itemCount = this.children.length;
this.barWidth = (this.isHorizontal ? this.itemCount : 1) * this.itemWidth;
this.barHeight = (this.isHorizontal ? 1 : this.itemCount) * this.itemHeight;
this.totalWidth = this.proximityLeft + this.proximityRight + this.barWidth;
this.totalHeight = this.proximityTop + this.proximityBottom + this.barHeight;
for (var i = 0; i < this.children.length; i++) {
this.children[i].posX = this.itemWidth * (this.isHorizontal ? i : 0);
this.children[i].posY = this.itemHeight * (this.isHorizontal ? 0 : i);
this.children[i].cenX = this.children[i].posX + (this.itemWidth / 2);
this.children[i].cenY = this.children[i].posY + (this.itemHeight / 2);
var isz = this.isHorizontal ? this.itemWidth : this.itemHeight;
var r = this.effectUnits * isz;
var c = this.isHorizontal ? this.children[i].cenX : this.children[i].cenY;
var lhs = this.isHorizontal ? this.proximityLeft : this.proximityTop;
var rhs = this.isHorizontal ? this.proximityRight : this.proximityBottom;
var siz = this.isHorizontal ? this.barWidth : this.barHeight;
var range_lhs = r;
var range_rhs = r;
if (range_lhs > c + lhs) {
range_lhs = c + lhs;
}
if (range_rhs > (siz - c + rhs)) {
range_rhs = siz - c + rhs;
}
this.children[i].effectRangeLeft = range_lhs / isz;
this.children[i].effectRangeRght = range_rhs / isz;
}
this.domNode.style.width = this.barWidth + "px";
this.domNode.style.height = this.barHeight + "px";
for (var i = 0; i < this.children.length; i++) {
var itm = this.children[i];
var elm = itm.domNode;
elm.style.left = itm.posX + "px";
elm.style.top = itm.posY + "px";
elm.style.width = this.itemWidth + "px";
elm.style.height = this.itemHeight + "px";
if (itm.svgNode) {
itm.svgNode.style.position = "absolute";
itm.svgNode.style.left = this.itemPadding + "%";
itm.svgNode.style.top = this.itemPadding + "%";
itm.svgNode.style.width = (100 - 2 * this.itemPadding) + "%";
itm.svgNode.style.height = (100 - 2 * this.itemPadding) + "%";
itm.svgNode.style.zIndex = 1;
itm.svgNode.setSize(this.itemWidth, this.itemHeight);
} else {
itm.imgNode.style.left = this.itemPadding + "%";
itm.imgNode.style.top = this.itemPadding + "%";
itm.imgNode.style.width = (100 - 2 * this.itemPadding) + "%";
itm.imgNode.style.height = (100 - 2 * this.itemPadding) + "%";
}
}
this._calcHitGrid();
}, _onBodyOut:function (e) {
if (dojo.html.overElement(dojo.body(), e)) {
return;
}
this._setDormant(e);
}, _setDormant:function (e) {
if (!this.isOver) {
return;
}
this.isOver = false;
if (this.conservativeTrigger) {
dojo.event.disconnect(document.documentElement, "onmousemove", this, "_onMouseMove");
}
this._onGridMouseMove(-1, -1);
}, _setActive:function (e) {
if (this.isOver) {
return;
}
this.isOver = true;
if (this.conservativeTrigger) {
dojo.event.connect(document.documentElement, "onmousemove", this, "_onMouseMove");
this.timerScale = 0;
this._onMouseMove(e);
this._expandSlowly();
}
}, _onMouseMove:function (e) {
if ((e.pageX >= this.hitX1) && (e.pageX <= this.hitX2) && (e.pageY >= this.hitY1) && (e.pageY <= this.hitY2)) {
if (!this.isOver) {
this._setActive(e);
}
this._onGridMouseMove(e.pageX - this.hitX1, e.pageY - this.hitY1);
} else {
if (this.isOver) {
this._setDormant(e);
}
}
}, onResized:function () {
this._calcHitGrid();
}, _onGridMouseMove:function (x, y) {
this.pos = {x:x, y:y};
this._paint();
}, _paint:function () {
var x = this.pos.x;
var y = this.pos.y;
if (this.itemCount <= 0) {
return;
}
var pos = this.isHorizontal ? x : y;
var prx = this.isHorizontal ? this.proximityLeft : this.proximityTop;
var siz = this.isHorizontal ? this.itemWidth : this.itemHeight;
var sim = this.isHorizontal ? (1 - this.timerScale) * this.itemWidth + this.timerScale * this.itemMaxWidth : (1 - this.timerScale) * this.itemHeight + this.timerScale * this.itemMaxHeight;
var cen = ((pos - prx) / siz) - 0.5;
var max_off_cen = (sim / siz) - 0.5;
if (max_off_cen > this.effectUnits) {
max_off_cen = this.effectUnits;
}
var off_weight = 0;
if (this.anchorEdge == this.EDGE.BOTTOM) {
var cen2 = (y - this.proximityTop) / this.itemHeight;
off_weight = (cen2 > 0.5) ? 1 : y / (this.proximityTop + (this.itemHeight / 2));
}
if (this.anchorEdge == this.EDGE.TOP) {
var cen2 = (y - this.proximityTop) / this.itemHeight;
off_weight = (cen2 < 0.5) ? 1 : (this.totalHeight - y) / (this.proximityBottom + (this.itemHeight / 2));
}
if (this.anchorEdge == this.EDGE.RIGHT) {
var cen2 = (x - this.proximityLeft) / this.itemWidth;
off_weight = (cen2 > 0.5) ? 1 : x / (this.proximityLeft + (this.itemWidth / 2));
}
if (this.anchorEdge == this.EDGE.LEFT) {
var cen2 = (x - this.proximityLeft) / this.itemWidth;
off_weight = (cen2 < 0.5) ? 1 : (this.totalWidth - x) / (this.proximityRight + (this.itemWidth / 2));
}
if (this.anchorEdge == this.EDGE.CENTER) {
if (this.isHorizontal) {
off_weight = y / (this.totalHeight);
} else {
off_weight = x / (this.totalWidth);
}
if (off_weight > 0.5) {
off_weight = 1 - off_weight;
}
off_weight *= 2;
}
for (var i = 0; i < this.itemCount; i++) {
var weight = this._weighAt(cen, i);
if (weight < 0) {
weight = 0;
}
this._setItemSize(i, weight * off_weight);
}
var main_p = Math.round(cen);
var offset = 0;
if (cen < 0) {
main_p = 0;
} else {
if (cen > this.itemCount - 1) {
main_p = this.itemCount - 1;
} else {
offset = (cen - main_p) * ((this.isHorizontal ? this.itemWidth : this.itemHeight) - this.children[main_p].sizeMain);
}
}
this._positionElementsFrom(main_p, offset);
}, _weighAt:function (cen, i) {
var dist = Math.abs(cen - i);
var limit = ((cen - i) > 0) ? this.children[i].effectRangeRght : this.children[i].effectRangeLeft;
return (dist > limit) ? 0 : (1 - dist / limit);
}, _setItemSize:function (p, scale) {
scale *= this.timerScale;
var w = Math.round(this.itemWidth + ((this.itemMaxWidth - this.itemWidth) * scale));
var h = Math.round(this.itemHeight + ((this.itemMaxHeight - this.itemHeight) * scale));
if (this.isHorizontal) {
this.children[p].sizeW = w;
this.children[p].sizeH = h;
this.children[p].sizeMain = w;
this.children[p].sizeOff = h;
var y = 0;
if (this.anchorEdge == this.EDGE.TOP) {
y = (this.children[p].cenY - (this.itemHeight / 2));
} else {
if (this.anchorEdge == this.EDGE.BOTTOM) {
y = (this.children[p].cenY - (h - (this.itemHeight / 2)));
} else {
y = (this.children[p].cenY - (h / 2));
}
}
this.children[p].usualX = Math.round(this.children[p].cenX - (w / 2));
this.children[p].domNode.style.top = y + "px";
this.children[p].domNode.style.left = this.children[p].usualX + "px";
} else {
this.children[p].sizeW = w;
this.children[p].sizeH = h;
this.children[p].sizeOff = w;
this.children[p].sizeMain = h;
var x = 0;
if (this.anchorEdge == this.EDGE.LEFT) {
x = this.children[p].cenX - (this.itemWidth / 2);
} else {
if (this.anchorEdge == this.EDGE.RIGHT) {
x = this.children[p].cenX - (w - (this.itemWidth / 2));
} else {
x = this.children[p].cenX - (w / 2);
}
}
this.children[p].domNode.style.left = x + "px";
this.children[p].usualY = Math.round(this.children[p].cenY - (h / 2));
this.children[p].domNode.style.top = this.children[p].usualY + "px";
}
this.children[p].domNode.style.width = w + "px";
this.children[p].domNode.style.height = h + "px";
if (this.children[p].svgNode) {
this.children[p].svgNode.setSize(w, h);
}
}, _positionElementsFrom:function (p, offset) {
var pos = 0;
if (this.isHorizontal) {
pos = Math.round(this.children[p].usualX + offset);
this.children[p].domNode.style.left = pos + "px";
} else {
pos = Math.round(this.children[p].usualY + offset);
this.children[p].domNode.style.top = pos + "px";
}
this._positionLabel(this.children[p]);
var bpos = pos;
for (var i = p - 1; i >= 0; i--) {
bpos -= this.children[i].sizeMain;
if (this.isHorizontal) {
this.children[i].domNode.style.left = bpos + "px";
} else {
this.children[i].domNode.style.top = bpos + "px";
}
this._positionLabel(this.children[i]);
}
var apos = pos;
for (var i = p + 1; i < this.itemCount; i++) {
apos += this.children[i - 1].sizeMain;
if (this.isHorizontal) {
this.children[i].domNode.style.left = apos + "px";
} else {
this.children[i].domNode.style.top = apos + "px";
}
this._positionLabel(this.children[i]);
}
}, _positionLabel:function (itm) {
var x = 0;
var y = 0;
var mb = dojo.html.getMarginBox(itm.lblNode);
if (this.labelEdge == this.EDGE.TOP) {
x = Math.round((itm.sizeW / 2) - (mb.width / 2));
y = -mb.height;
}
if (this.labelEdge == this.EDGE.BOTTOM) {
x = Math.round((itm.sizeW / 2) - (mb.width / 2));
y = itm.sizeH;
}
if (this.labelEdge == this.EDGE.LEFT) {
x = -mb.width;
y = Math.round((itm.sizeH / 2) - (mb.height / 2));
}
if (this.labelEdge == this.EDGE.RIGHT) {
x = itm.sizeW;
y = Math.round((itm.sizeH / 2) - (mb.height / 2));
}
itm.lblNode.style.left = x + "px";
itm.lblNode.style.top = y + "px";
}, _calcHitGrid:function () {
var pos = dojo.html.getAbsolutePosition(this.domNode, true);
this.hitX1 = pos.x - this.proximityLeft;
this.hitY1 = pos.y - this.proximityTop;
this.hitX2 = this.hitX1 + this.totalWidth;
this.hitY2 = this.hitY1 + this.totalHeight;
}, _toEdge:function (inp, def) {
return this.EDGE[inp.toUpperCase()] || def;
}, _expandSlowly:function () {
if (!this.isOver) {
return;
}
this.timerScale += 0.2;
this._paint();
if (this.timerScale < 1) {
dojo.lang.setTimeout(this, "_expandSlowly", 10);
}
}, destroy:function () {
dojo.event.disconnect(document.documentElement, "onmouseout", this, "_onBodyOut");
dojo.event.disconnect(document.documentElement, "onmousemove", this, "_onMouseMove");
dojo.widget.FisheyeList.superclass.destroy.call(this);
}});
dojo.widget.defineWidget("dojo.widget.FisheyeListItem", dojo.widget.HtmlWidget, {iconSrc:"", svgSrc:"", caption:"", id:"", _blankImgPath:dojo.uri.moduleUri("dojo.widget", "templates/images/blank.gif"), templateString:"<div class=\"dojoHtmlFisheyeListItem\">" + " <img class=\"dojoHtmlFisheyeListItemImage\" dojoAttachPoint=\"imgNode\" dojoAttachEvent=\"onMouseOver;onMouseOut;onClick\">" + " <div class=\"dojoHtmlFisheyeListItemLabel\" dojoAttachPoint=\"lblNode\"></div>" + "</div>", fillInTemplate:function () {
if (this.svgSrc != "") {
this.svgNode = this._createSvgNode(this.svgSrc);
this.domNode.appendChild(this.svgNode);
this.imgNode.style.display = "none";
} else {
if ((this.iconSrc.toLowerCase().substring(this.iconSrc.length - 4) == ".png") && (dojo.render.html.ie) && (!dojo.render.html.ie70)) {
if (dojo.dom.hasParent(this.imgNode) && this.id != "") {
var parent = this.imgNode.parentNode;
parent.setAttribute("id", this.id);
}
this.imgNode.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.iconSrc + "', sizingMethod='scale')";
this.imgNode.src = this._blankImgPath.toString();
} else {
if (dojo.dom.hasParent(this.imgNode) && this.id != "") {
var parent = this.imgNode.parentNode;
parent.setAttribute("id", this.id);
}
this.imgNode.src = this.iconSrc;
}
}
if (this.lblNode) {
this.lblNode.appendChild(document.createTextNode(this.caption));
}
dojo.html.disableSelection(this.domNode);
}, _createSvgNode:function (src) {
var elm = document.createElement("embed");
elm.src = src;
elm.type = "image/svg+xml";
elm.style.width = "1px";
elm.style.height = "1px";
elm.loaded = 0;
elm.setSizeOnLoad = false;
elm.onload = function () {
this.svgRoot = this.getSVGDocument().rootElement;
this.svgDoc = this.getSVGDocument().documentElement;
this.zeroWidth = this.svgRoot.width.baseVal.value;
this.zeroHeight = this.svgRoot.height.baseVal.value;
this.loaded = true;
if (this.setSizeOnLoad) {
this.setSize(this.setWidth, this.setHeight);
}
};
elm.setSize = function (w, h) {
if (!this.loaded) {
this.setWidth = w;
this.setHeight = h;
this.setSizeOnLoad = true;
return;
}
this.style.width = w + "px";
this.style.height = h + "px";
this.svgRoot.width.baseVal.value = w;
this.svgRoot.height.baseVal.value = h;
var scale_x = w / this.zeroWidth;
var scale_y = h / this.zeroHeight;
for (var i = 0; i < this.svgDoc.childNodes.length; i++) {
if (this.svgDoc.childNodes[i].setAttribute) {
this.svgDoc.childNodes[i].setAttribute("transform", "scale(" + scale_x + "," + scale_y + ")");
}
}
};
return elm;
}, onMouseOver:function (e) {
if (!this.parent.isOver) {
this.parent._setActive(e);
}
if (this.caption != "") {
dojo.html.addClass(this.lblNode, "selected");
this.parent._positionLabel(this);
}
}, onMouseOut:function (e) {
dojo.html.removeClass(this.lblNode, "selected");
}, onClick:function (e) {
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/ProgressBar.js
New file
0,0 → 1,185
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.ProgressBar");
dojo.require("dojo.widget.*");
dojo.require("dojo.event");
dojo.require("dojo.dom");
dojo.require("dojo.html.style");
dojo.require("dojo.string.*");
dojo.require("dojo.lfx.*");
dojo.widget.defineWidget("dojo.widget.ProgressBar", dojo.widget.HtmlWidget, {progressValue:0, maxProgressValue:100, width:300, height:30, frontPercentClass:"frontPercent", backPercentClass:"backPercent", frontBarClass:"frontBar", backBarClass:"backBar", hasText:false, isVertical:false, showOnlyIntegers:false, dataSource:"", pollInterval:3000, duration:1000, templateString:"<div dojoAttachPoint=\"containerNode\" style=\"position:relative;overflow:hidden\">\n\t<div style=\"position:absolute;display:none;width:100%;text-align:center\" dojoAttachPoint=\"backPercentLabel\" class=\"dojoBackPercentLabel\"></div>\n\t<div style=\"position:absolute;overflow:hidden;width:100%;height:100%\" dojoAttachPoint=\"internalProgress\">\n\t<div style=\"position:absolute;display:none;width:100%;text-align:center\" dojoAttachPoint=\"frontPercentLabel\" class=\"dojoFrontPercentLabel\"></div></div>\n</div>\n", templateCssString:".backBar{\n\tborder:1px solid #84a3d1;\n}\n.frontBar{\n\tbackground:url(\"images/bar.gif\") repeat bottom left;\n\tbackground-attachment: fixed;\n}\n.h-frontBar{\n\tbackground:url(\"images/h-bar.gif\") repeat bottom left;\n\tbackground-attachment: fixed;\n}\n.simpleFrontBar{\n\tbackground: red;\n}\n.frontPercent,.backPercent{\n\tfont:bold 13px helvetica;\n}\n.backPercent{\n\tcolor:#293a4b;\n}\n.frontPercent{\n\tcolor:#fff;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/ProgressBar.css"), containerNode:null, internalProgress:null, _pixelUnitRatio:0, _pixelPercentRatio:0, _unitPercentRatio:0, _unitPixelRatio:0, _floatDimension:0, _intDimension:0, _progressPercentValue:"0%", _floatMaxProgressValue:0, _dimension:"width", _pixelValue:0, _oInterval:null, _animation:null, _animationStopped:true, _progressValueBak:false, _hasTextBak:false, fillInTemplate:function (args, frag) {
this.internalProgress.className = this.frontBarClass;
this.containerNode.className = this.backBarClass;
if (this.isVertical) {
this.internalProgress.style.bottom = "0px";
this.internalProgress.style.left = "0px";
this._dimension = "height";
} else {
this.internalProgress.style.top = "0px";
this.internalProgress.style.left = "0px";
this._dimension = "width";
}
this.frontPercentLabel.className = this.frontPercentClass;
this.backPercentLabel.className = this.backPercentClass;
this.progressValue = "" + this.progressValue;
this.domNode.style.height = this.height + "px";
this.domNode.style.width = this.width + "px";
this._intDimension = parseInt("0" + eval("this." + this._dimension));
this._floatDimension = parseFloat("0" + eval("this." + this._dimension));
this._pixelPercentRatio = this._floatDimension / 100;
this.setMaxProgressValue(this.maxProgressValue, true);
this.setProgressValue(dojo.string.trim(this.progressValue), true);
dojo.debug("float dimension: " + this._floatDimension);
dojo.debug("this._unitPixelRatio: " + this._unitPixelRatio);
this.showText(this.hasText);
}, showText:function (visible) {
if (visible) {
this.backPercentLabel.style.display = "block";
this.frontPercentLabel.style.display = "block";
} else {
this.backPercentLabel.style.display = "none";
this.frontPercentLabel.style.display = "none";
}
this.hasText = visible;
}, postCreate:function (args, frag) {
this.render();
}, _backupValues:function () {
this._progressValueBak = this.progressValue;
this._hasTextBak = this.hasText;
}, _restoreValues:function () {
this.setProgressValue(this._progressValueBak);
this.showText(this._hasTextBak);
}, _setupAnimation:function () {
var _self = this;
dojo.debug("internalProgress width: " + this.internalProgress.style.width);
this._animation = dojo.lfx.html.slideTo(this.internalProgress, {top:0, left:parseInt(this.width) - parseInt(this.internalProgress.style.width)}, parseInt(this.duration), null, function () {
var _backAnim = dojo.lfx.html.slideTo(_self.internalProgress, {top:0, left:0}, parseInt(_self.duration));
dojo.event.connect(_backAnim, "onEnd", function () {
if (!_self._animationStopped) {
_self._animation.play();
}
});
if (!_self._animationStopped) {
_backAnim.play();
}
_backAnim = null;
});
}, getMaxProgressValue:function () {
return this.maxProgressValue;
}, setMaxProgressValue:function (maxValue, noRender) {
if (!this._animationStopped) {
return;
}
this.maxProgressValue = maxValue;
this._floatMaxProgressValue = parseFloat("0" + this.maxProgressValue);
this._pixelUnitRatio = this._floatDimension / this.maxProgressValue;
this._unitPercentRatio = this._floatMaxProgressValue / 100;
this._unitPixelRatio = this._floatMaxProgressValue / this._floatDimension;
this.setProgressValue(this.progressValue, true);
if (!noRender) {
this.render();
}
}, setProgressValue:function (value, noRender) {
if (!this._animationStopped) {
return;
}
this._progressPercentValue = "0%";
var _value = dojo.string.trim("" + value);
var _floatValue = parseFloat("0" + _value);
var _intValue = parseInt("0" + _value);
var _pixelValue = 0;
if (dojo.string.endsWith(_value, "%", false)) {
this._progressPercentValue = Math.min(_floatValue.toFixed(1), 100) + "%";
_value = Math.min((_floatValue) * this._unitPercentRatio, this.maxProgressValue);
_pixelValue = Math.min((_floatValue) * this._pixelPercentRatio, eval("this." + this._dimension));
} else {
this.progressValue = Math.min(_floatValue, this.maxProgressValue);
this._progressPercentValue = Math.min((_floatValue / this._unitPercentRatio).toFixed(1), 100) + "%";
_pixelValue = Math.min(_floatValue / this._unitPixelRatio, eval("this." + this._dimension));
}
this.progressValue = dojo.string.trim(_value);
this._pixelValue = _pixelValue;
if (!noRender) {
this.render();
}
}, getProgressValue:function () {
return this.progressValue;
}, getProgressPercentValue:function () {
return this._progressPercentValue;
}, setDataSource:function (dataSource) {
this.dataSource = dataSource;
}, setPollInterval:function (pollInterval) {
this.pollInterval = pollInterval;
}, start:function () {
var _showFunction = dojo.lang.hitch(this, this._showRemoteProgress);
this._oInterval = setInterval(_showFunction, this.pollInterval);
}, startAnimation:function () {
if (this._animationStopped) {
this._backupValues();
this.setProgressValue("10%");
this._animationStopped = false;
this._setupAnimation();
this.showText(false);
this.internalProgress.style.height = "105%";
this._animation.play();
}
}, stopAnimation:function () {
if (this._animation) {
this._animationStopped = true;
this._animation.stop();
this.internalProgress.style.height = "100%";
this.internalProgress.style.left = "0px";
this._restoreValues();
this._setLabelPosition();
}
}, _showRemoteProgress:function () {
var _self = this;
if ((this.getMaxProgressValue() == this.getProgressValue()) && this._oInterval) {
clearInterval(this._oInterval);
this._oInterval = null;
this.setProgressValue("100%");
return;
}
var bArgs = {url:_self.dataSource, method:"POST", mimetype:"text/json", error:function (type, errorObj) {
dojo.debug("[ProgressBar] showRemoteProgress error");
}, load:function (type, data, evt) {
_self.setProgressValue((_self._oInterval ? data["progress"] : "100%"));
}};
dojo.io.bind(bArgs);
}, render:function () {
this._setPercentLabel(dojo.string.trim(this._progressPercentValue));
this._setPixelValue(this._pixelValue);
this._setLabelPosition();
}, _setLabelPosition:function () {
var _widthFront = dojo.html.getContentBox(this.frontPercentLabel).width;
var _heightFront = dojo.html.getContentBox(this.frontPercentLabel).height;
var _widthBack = dojo.html.getContentBox(this.backPercentLabel).width;
var _heightBack = dojo.html.getContentBox(this.backPercentLabel).height;
var _leftFront = (parseInt(this.width) - _widthFront) / 2 + "px";
var _bottomFront = (parseInt(this.height) - parseInt(_heightFront)) / 2 + "px";
var _leftBack = (parseInt(this.width) - _widthBack) / 2 + "px";
var _bottomBack = (parseInt(this.height) - parseInt(_heightBack)) / 2 + "px";
this.frontPercentLabel.style.left = _leftFront;
this.backPercentLabel.style.left = _leftBack;
this.frontPercentLabel.style.bottom = _bottomFront;
this.backPercentLabel.style.bottom = _bottomBack;
}, _setPercentLabel:function (percentValue) {
dojo.dom.removeChildren(this.frontPercentLabel);
dojo.dom.removeChildren(this.backPercentLabel);
var _percentValue = this.showOnlyIntegers == false ? percentValue : parseInt(percentValue) + "%";
this.frontPercentLabel.appendChild(document.createTextNode(_percentValue));
this.backPercentLabel.appendChild(document.createTextNode(_percentValue));
}, _setPixelValue:function (value) {
eval("this.internalProgress.style." + this._dimension + " = " + value + " + 'px'");
this.onChange();
}, onChange:function () {
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/validate.js
New file
0,0 → 1,13
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.validate");
dojo.deprecated("dojo.widget.validate", "use one of the specific widgets in dojo.widget.<name>Textbox instead", "0.5");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/FilteringTable.js
New file
0,0 → 1,708
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.FilteringTable");
dojo.require("dojo.date.format");
dojo.require("dojo.math");
dojo.require("dojo.collections.Store");
dojo.require("dojo.html.*");
dojo.require("dojo.html.util");
dojo.require("dojo.html.style");
dojo.require("dojo.html.selection");
dojo.require("dojo.event.*");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.widget.defineWidget("dojo.widget.FilteringTable", dojo.widget.HtmlWidget, function () {
this.store = new dojo.collections.Store();
this.valueField = "Id";
this.multiple = false;
this.maxSelect = 0;
this.maxSortable = 1;
this.minRows = 0;
this.defaultDateFormat = "%D";
this.isInitialized = false;
this.alternateRows = false;
this.columns = [];
this.sortInformation = [{index:0, direction:0}];
this.headClass = "";
this.tbodyClass = "";
this.headerClass = "";
this.headerUpClass = "selectedUp";
this.headerDownClass = "selectedDown";
this.rowClass = "";
this.rowAlternateClass = "alt";
this.rowSelectedClass = "selected";
this.columnSelected = "sorted-column";
}, {isContainer:false, templatePath:null, templateCssPath:null, getTypeFromString:function (s) {
var parts = s.split("."), i = 0, obj = dj_global;
do {
obj = obj[parts[i++]];
} while (i < parts.length && obj);
return (obj != dj_global) ? obj : null;
}, getByRow:function (row) {
return this.store.getByKey(dojo.html.getAttribute(row, "value"));
}, getDataByRow:function (row) {
return this.store.getDataByKey(dojo.html.getAttribute(row, "value"));
}, getRow:function (obj) {
var rows = this.domNode.tBodies[0].rows;
for (var i = 0; i < rows.length; i++) {
if (this.store.getDataByKey(dojo.html.getAttribute(rows[i], "value")) == obj) {
return rows[i];
}
}
return null;
}, getColumnIndex:function (fieldPath) {
for (var i = 0; i < this.columns.length; i++) {
if (this.columns[i].getField() == fieldPath) {
return i;
}
}
return -1;
}, getSelectedData:function () {
var data = this.store.get();
var a = [];
for (var i = 0; i < data.length; i++) {
if (data[i].isSelected) {
a.push(data[i].src);
}
}
if (this.multiple) {
return a;
} else {
return a[0];
}
}, isSelected:function (obj) {
var data = this.store.get();
for (var i = 0; i < data.length; i++) {
if (data[i].src == obj) {
return true;
}
}
return false;
}, isValueSelected:function (val) {
var v = this.store.getByKey(val);
if (v) {
return v.isSelected;
}
return false;
}, isIndexSelected:function (idx) {
var v = this.store.getByIndex(idx);
if (v) {
return v.isSelected;
}
return false;
}, isRowSelected:function (row) {
var v = this.getByRow(row);
if (v) {
return v.isSelected;
}
return false;
}, reset:function () {
this.store.clearData();
this.columns = [];
this.sortInformation = [{index:0, direction:0}];
this.resetSelections();
this.isInitialized = false;
this.onReset();
}, resetSelections:function () {
this.store.forEach(function (element) {
element.isSelected = false;
});
}, onReset:function () {
}, select:function (obj) {
var data = this.store.get();
for (var i = 0; i < data.length; i++) {
if (data[i].src == obj) {
data[i].isSelected = true;
break;
}
}
this.onDataSelect(obj);
}, selectByValue:function (val) {
this.select(this.store.getDataByKey(val));
}, selectByIndex:function (idx) {
this.select(this.store.getDataByIndex(idx));
}, selectByRow:function (row) {
this.select(this.getDataByRow(row));
}, selectAll:function () {
this.store.forEach(function (element) {
element.isSelected = true;
});
}, onDataSelect:function (obj) {
}, toggleSelection:function (obj) {
var data = this.store.get();
for (var i = 0; i < data.length; i++) {
if (data[i].src == obj) {
data[i].isSelected = !data[i].isSelected;
break;
}
}
this.onDataToggle(obj);
}, toggleSelectionByValue:function (val) {
this.toggleSelection(this.store.getDataByKey(val));
}, toggleSelectionByIndex:function (idx) {
this.toggleSelection(this.store.getDataByIndex(idx));
}, toggleSelectionByRow:function (row) {
this.toggleSelection(this.getDataByRow(row));
}, toggleAll:function () {
this.store.forEach(function (element) {
element.isSelected = !element.isSelected;
});
}, onDataToggle:function (obj) {
}, _meta:{field:null, format:null, filterer:null, noSort:false, sortType:"String", dataType:String, sortFunction:null, filterFunction:null, label:null, align:"left", valign:"middle", getField:function () {
return this.field || this.label;
}, getType:function () {
return this.dataType;
}}, createMetaData:function (obj) {
for (var p in this._meta) {
if (!obj[p]) {
obj[p] = this._meta[p];
}
}
if (!obj.label) {
obj.label = obj.field;
}
if (!obj.filterFunction) {
obj.filterFunction = this._defaultFilter;
}
return obj;
}, parseMetadata:function (head) {
this.columns = [];
this.sortInformation = [];
var row = head.getElementsByTagName("tr")[0];
var cells = row.getElementsByTagName("td");
if (cells.length == 0) {
cells = row.getElementsByTagName("th");
}
for (var i = 0; i < cells.length; i++) {
var o = this.createMetaData({});
if (dojo.html.hasAttribute(cells[i], "align")) {
o.align = dojo.html.getAttribute(cells[i], "align");
}
if (dojo.html.hasAttribute(cells[i], "valign")) {
o.valign = dojo.html.getAttribute(cells[i], "valign");
}
if (dojo.html.hasAttribute(cells[i], "nosort")) {
o.noSort = (dojo.html.getAttribute(cells[i], "nosort") == "true");
}
if (dojo.html.hasAttribute(cells[i], "sortusing")) {
var trans = dojo.html.getAttribute(cells[i], "sortusing");
var f = this.getTypeFromString(trans);
if (f != null && f != window && typeof (f) == "function") {
o.sortFunction = f;
}
}
o.label = dojo.html.renderedTextContent(cells[i]);
if (dojo.html.hasAttribute(cells[i], "field")) {
o.field = dojo.html.getAttribute(cells[i], "field");
} else {
if (o.label.length > 0) {
o.field = o.label;
} else {
o.field = "field" + i;
}
}
if (dojo.html.hasAttribute(cells[i], "format")) {
o.format = dojo.html.getAttribute(cells[i], "format");
}
if (dojo.html.hasAttribute(cells[i], "dataType")) {
var sortType = dojo.html.getAttribute(cells[i], "dataType");
if (sortType.toLowerCase() == "html" || sortType.toLowerCase() == "markup") {
o.sortType = "__markup__";
} else {
var type = this.getTypeFromString(sortType);
if (type) {
o.sortType = sortType;
o.dataType = type;
}
}
}
if (dojo.html.hasAttribute(cells[i], "filterusing")) {
var trans = dojo.html.getAttribute(cells[i], "filterusing");
var f = this.getTypeFromString(trans);
if (f != null && f != window && typeof (f) == "function") {
o.filterFunction = f;
}
}
this.columns.push(o);
if (dojo.html.hasAttribute(cells[i], "sort")) {
var info = {index:i, direction:0};
var dir = dojo.html.getAttribute(cells[i], "sort");
if (!isNaN(parseInt(dir))) {
dir = parseInt(dir);
info.direction = (dir != 0) ? 1 : 0;
} else {
info.direction = (dir.toLowerCase() == "desc") ? 1 : 0;
}
this.sortInformation.push(info);
}
}
if (this.sortInformation.length == 0) {
this.sortInformation.push({index:0, direction:0});
} else {
if (this.sortInformation.length > this.maxSortable) {
this.sortInformation.length = this.maxSortable;
}
}
}, parseData:function (body) {
if (body.rows.length == 0 && this.columns.length == 0) {
return;
}
var self = this;
this["__selected__"] = [];
var arr = this.store.getFromHtml(this.columns, body, function (obj, row) {
if (typeof (obj[self.valueField]) == "undefined" || obj[self.valueField] == null) {
obj[self.valueField] = dojo.html.getAttribute(row, "value");
}
if (dojo.html.getAttribute(row, "selected") == "true") {
self["__selected__"].push(obj);
}
});
this.store.setData(arr, true);
this.render();
for (var i = 0; i < this["__selected__"].length; i++) {
this.select(this["__selected__"][i]);
}
this.renderSelections();
delete this["__selected__"];
this.isInitialized = true;
}, onSelect:function (e) {
var row = dojo.html.getParentByType(e.target, "tr");
if (dojo.html.hasAttribute(row, "emptyRow")) {
return;
}
var body = dojo.html.getParentByType(row, "tbody");
if (this.multiple) {
if (e.shiftKey) {
var startRow;
var rows = body.rows;
for (var i = 0; i < rows.length; i++) {
if (rows[i] == row) {
break;
}
if (this.isRowSelected(rows[i])) {
startRow = rows[i];
}
}
if (!startRow) {
startRow = row;
for (; i < rows.length; i++) {
if (this.isRowSelected(rows[i])) {
row = rows[i];
break;
}
}
}
this.resetSelections();
if (startRow == row) {
this.toggleSelectionByRow(row);
} else {
var doSelect = false;
for (var i = 0; i < rows.length; i++) {
if (rows[i] == startRow) {
doSelect = true;
}
if (doSelect) {
this.selectByRow(rows[i]);
}
if (rows[i] == row) {
doSelect = false;
}
}
}
} else {
this.toggleSelectionByRow(row);
}
} else {
this.resetSelections();
this.toggleSelectionByRow(row);
}
this.renderSelections();
}, onSort:function (e) {
var oldIndex = this.sortIndex;
var oldDirection = this.sortDirection;
var source = e.target;
var row = dojo.html.getParentByType(source, "tr");
var cellTag = "td";
if (row.getElementsByTagName(cellTag).length == 0) {
cellTag = "th";
}
var headers = row.getElementsByTagName(cellTag);
var header = dojo.html.getParentByType(source, cellTag);
for (var i = 0; i < headers.length; i++) {
dojo.html.setClass(headers[i], this.headerClass);
if (headers[i] == header) {
if (this.sortInformation[0].index != i) {
this.sortInformation.unshift({index:i, direction:0});
} else {
this.sortInformation[0] = {index:i, direction:(~this.sortInformation[0].direction) & 1};
}
}
}
this.sortInformation.length = Math.min(this.sortInformation.length, this.maxSortable);
for (var i = 0; i < this.sortInformation.length; i++) {
var idx = this.sortInformation[i].index;
var dir = (~this.sortInformation[i].direction) & 1;
dojo.html.setClass(headers[idx], dir == 0 ? this.headerDownClass : this.headerUpClass);
}
this.render();
}, onFilter:function () {
}, _defaultFilter:function (obj) {
return true;
}, setFilter:function (field, fn) {
for (var i = 0; i < this.columns.length; i++) {
if (this.columns[i].getField() == field) {
this.columns[i].filterFunction = fn;
break;
}
}
this.applyFilters();
}, setFilterByIndex:function (idx, fn) {
this.columns[idx].filterFunction = fn;
this.applyFilters();
}, clearFilter:function (field) {
for (var i = 0; i < this.columns.length; i++) {
if (this.columns[i].getField() == field) {
this.columns[i].filterFunction = this._defaultFilter;
break;
}
}
this.applyFilters();
}, clearFilterByIndex:function (idx) {
this.columns[idx].filterFunction = this._defaultFilter;
this.applyFilters();
}, clearFilters:function () {
for (var i = 0; i < this.columns.length; i++) {
this.columns[i].filterFunction = this._defaultFilter;
}
var rows = this.domNode.tBodies[0].rows;
for (var i = 0; i < rows.length; i++) {
rows[i].style.display = "";
if (this.alternateRows) {
dojo.html[((i % 2 == 1) ? "addClass" : "removeClass")](rows[i], this.rowAlternateClass);
}
}
this.onFilter();
}, applyFilters:function () {
var alt = 0;
var rows = this.domNode.tBodies[0].rows;
for (var i = 0; i < rows.length; i++) {
var b = true;
var row = rows[i];
for (var j = 0; j < this.columns.length; j++) {
var value = this.store.getField(this.getDataByRow(row), this.columns[j].getField());
if (this.columns[j].getType() == Date && value != null && !value.getYear) {
value = new Date(value);
}
if (!this.columns[j].filterFunction(value)) {
b = false;
break;
}
}
row.style.display = (b ? "" : "none");
if (b && this.alternateRows) {
dojo.html[((alt++ % 2 == 1) ? "addClass" : "removeClass")](row, this.rowAlternateClass);
}
}
this.onFilter();
}, createSorter:function (info) {
var self = this;
var sortFunctions = [];
function createSortFunction(fieldIndex, dir) {
var meta = self.columns[fieldIndex];
var field = meta.getField();
return function (rowA, rowB) {
if (dojo.html.hasAttribute(rowA, "emptyRow")) {
return 1;
}
if (dojo.html.hasAttribute(rowB, "emptyRow")) {
return -1;
}
var a = self.store.getField(self.getDataByRow(rowA), field);
var b = self.store.getField(self.getDataByRow(rowB), field);
var ret = 0;
if (a > b) {
ret = 1;
}
if (a < b) {
ret = -1;
}
return dir * ret;
};
}
var current = 0;
var max = Math.min(info.length, this.maxSortable, this.columns.length);
while (current < max) {
var direction = (info[current].direction == 0) ? 1 : -1;
sortFunctions.push(createSortFunction(info[current].index, direction));
current++;
}
return function (rowA, rowB) {
var idx = 0;
while (idx < sortFunctions.length) {
var ret = sortFunctions[idx++](rowA, rowB);
if (ret != 0) {
return ret;
}
}
return 0;
};
}, createRow:function (obj) {
var row = document.createElement("tr");
dojo.html.disableSelection(row);
if (obj.key != null) {
row.setAttribute("value", obj.key);
}
for (var j = 0; j < this.columns.length; j++) {
var cell = document.createElement("td");
cell.setAttribute("align", this.columns[j].align);
cell.setAttribute("valign", this.columns[j].valign);
dojo.html.disableSelection(cell);
var val = this.store.getField(obj.src, this.columns[j].getField());
if (typeof (val) == "undefined") {
val = "";
}
this.fillCell(cell, this.columns[j], val);
row.appendChild(cell);
}
return row;
}, fillCell:function (cell, meta, val) {
if (meta.sortType == "__markup__") {
cell.innerHTML = val;
} else {
if (meta.getType() == Date) {
val = new Date(val);
if (!isNaN(val)) {
var format = this.defaultDateFormat;
if (meta.format) {
format = meta.format;
}
cell.innerHTML = dojo.date.strftime(val, format);
} else {
cell.innerHTML = val;
}
} else {
if ("Number number int Integer float Float".indexOf(meta.getType()) > -1) {
if (val.length == 0) {
val = "0";
}
var n = parseFloat(val, 10) + "";
if (n.indexOf(".") > -1) {
n = dojo.math.round(parseFloat(val, 10), 2);
}
cell.innerHTML = n;
} else {
cell.innerHTML = val;
}
}
}
}, prefill:function () {
this.isInitialized = false;
var body = this.domNode.tBodies[0];
while (body.childNodes.length > 0) {
body.removeChild(body.childNodes[0]);
}
if (this.minRows > 0) {
for (var i = 0; i < this.minRows; i++) {
var row = document.createElement("tr");
if (this.alternateRows) {
dojo.html[((i % 2 == 1) ? "addClass" : "removeClass")](row, this.rowAlternateClass);
}
row.setAttribute("emptyRow", "true");
for (var j = 0; j < this.columns.length; j++) {
var cell = document.createElement("td");
cell.innerHTML = "&nbsp;";
row.appendChild(cell);
}
body.appendChild(row);
}
}
}, init:function () {
this.isInitialized = false;
var head = this.domNode.getElementsByTagName("thead")[0];
if (head.getElementsByTagName("tr").length == 0) {
var row = document.createElement("tr");
for (var i = 0; i < this.columns.length; i++) {
var cell = document.createElement("td");
cell.setAttribute("align", this.columns[i].align);
cell.setAttribute("valign", this.columns[i].valign);
dojo.html.disableSelection(cell);
cell.innerHTML = this.columns[i].label;
row.appendChild(cell);
if (!this.columns[i].noSort) {
dojo.event.connect(cell, "onclick", this, "onSort");
}
}
dojo.html.prependChild(row, head);
}
if (this.store.get().length == 0) {
return false;
}
var idx = this.domNode.tBodies[0].rows.length;
if (!idx || idx == 0 || this.domNode.tBodies[0].rows[0].getAttribute("emptyRow") == "true") {
idx = 0;
var body = this.domNode.tBodies[0];
while (body.childNodes.length > 0) {
body.removeChild(body.childNodes[0]);
}
var data = this.store.get();
for (var i = 0; i < data.length; i++) {
var row = this.createRow(data[i]);
body.appendChild(row);
idx++;
}
}
if (this.minRows > 0 && idx < this.minRows) {
idx = this.minRows - idx;
for (var i = 0; i < idx; i++) {
row = document.createElement("tr");
row.setAttribute("emptyRow", "true");
for (var j = 0; j < this.columns.length; j++) {
cell = document.createElement("td");
cell.innerHTML = "&nbsp;";
row.appendChild(cell);
}
body.appendChild(row);
}
}
var row = this.domNode.getElementsByTagName("thead")[0].rows[0];
var cellTag = "td";
if (row.getElementsByTagName(cellTag).length == 0) {
cellTag = "th";
}
var headers = row.getElementsByTagName(cellTag);
for (var i = 0; i < headers.length; i++) {
dojo.html.setClass(headers[i], this.headerClass);
}
for (var i = 0; i < this.sortInformation.length; i++) {
var idx = this.sortInformation[i].index;
var dir = (~this.sortInformation[i].direction) & 1;
dojo.html.setClass(headers[idx], dir == 0 ? this.headerDownClass : this.headerUpClass);
}
this.isInitialized = true;
return this.isInitialized;
}, render:function () {
if (!this.isInitialized) {
var b = this.init();
if (!b) {
this.prefill();
return;
}
}
var rows = [];
var body = this.domNode.tBodies[0];
var emptyRowIdx = -1;
for (var i = 0; i < body.rows.length; i++) {
rows.push(body.rows[i]);
}
var sortFunction = this.createSorter(this.sortInformation);
if (sortFunction) {
rows.sort(sortFunction);
}
for (var i = 0; i < rows.length; i++) {
if (this.alternateRows) {
dojo.html[((i % 2 == 1) ? "addClass" : "removeClass")](rows[i], this.rowAlternateClass);
}
dojo.html[(this.isRowSelected(body.rows[i]) ? "addClass" : "removeClass")](body.rows[i], this.rowSelectedClass);
body.appendChild(rows[i]);
}
}, renderSelections:function () {
var body = this.domNode.tBodies[0];
for (var i = 0; i < body.rows.length; i++) {
dojo.html[(this.isRowSelected(body.rows[i]) ? "addClass" : "removeClass")](body.rows[i], this.rowSelectedClass);
}
}, initialize:function () {
var self = this;
dojo.event.connect(this.store, "onSetData", function () {
self.store.forEach(function (element) {
element.isSelected = false;
});
self.isInitialized = false;
var body = self.domNode.tBodies[0];
if (body) {
while (body.childNodes.length > 0) {
body.removeChild(body.childNodes[0]);
}
}
self.render();
});
dojo.event.connect(this.store, "onClearData", function () {
self.isInitialized = false;
self.render();
});
dojo.event.connect(this.store, "onAddData", function (addedObject) {
var row = self.createRow(addedObject);
self.domNode.tBodies[0].appendChild(row);
self.render();
});
dojo.event.connect(this.store, "onAddDataRange", function (arr) {
for (var i = 0; i < arr.length; i++) {
arr[i].isSelected = false;
var row = self.createRow(arr[i]);
self.domNode.tBodies[0].appendChild(row);
}
self.render();
});
dojo.event.connect(this.store, "onRemoveData", function (removedObject) {
var rows = self.domNode.tBodies[0].rows;
for (var i = 0; i < rows.length; i++) {
if (self.getDataByRow(rows[i]) == removedObject.src) {
rows[i].parentNode.removeChild(rows[i]);
break;
}
}
self.render();
});
dojo.event.connect(this.store, "onUpdateField", function (obj, fieldPath, val) {
var row = self.getRow(obj);
var idx = self.getColumnIndex(fieldPath);
if (row && row.cells[idx] && self.columns[idx]) {
self.fillCell(row.cells[idx], self.columns[idx], val);
}
});
}, postCreate:function () {
this.store.keyField = this.valueField;
if (this.domNode) {
if (this.domNode.nodeName.toLowerCase() != "table") {
}
if (this.domNode.getElementsByTagName("thead")[0]) {
var head = this.domNode.getElementsByTagName("thead")[0];
if (this.headClass.length > 0) {
head.className = this.headClass;
}
dojo.html.disableSelection(this.domNode);
this.parseMetadata(head);
var header = "td";
if (head.getElementsByTagName(header).length == 0) {
header = "th";
}
var headers = head.getElementsByTagName(header);
for (var i = 0; i < headers.length; i++) {
if (!this.columns[i].noSort) {
dojo.event.connect(headers[i], "onclick", this, "onSort");
}
}
} else {
this.domNode.appendChild(document.createElement("thead"));
}
if (this.domNode.tBodies.length < 1) {
var body = document.createElement("tbody");
this.domNode.appendChild(body);
} else {
var body = this.domNode.tBodies[0];
}
if (this.tbodyClass.length > 0) {
body.className = this.tbodyClass;
}
dojo.event.connect(body, "onclick", this, "onSelect");
this.parseData(body);
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Editor2Toolbar.js
New file
0,0 → 1,494
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Editor2Toolbar");
dojo.require("dojo.lang.*");
dojo.require("dojo.widget.*");
dojo.require("dojo.event.*");
dojo.require("dojo.html.layout");
dojo.require("dojo.html.display");
dojo.require("dojo.widget.RichText");
dojo.require("dojo.widget.PopupContainer");
dojo.require("dojo.widget.ColorPalette");
dojo.lang.declare("dojo.widget.HandlerManager", null, function () {
this._registeredHandlers = [];
}, {registerHandler:function (obj, func) {
if (arguments.length == 2) {
this._registeredHandlers.push(function () {
return obj[func].apply(obj, arguments);
});
} else {
this._registeredHandlers.push(obj);
}
}, removeHandler:function (func) {
for (var i = 0; i < this._registeredHandlers.length; i++) {
if (func === this._registeredHandlers[i]) {
delete this._registeredHandlers[i];
return;
}
}
dojo.debug("HandlerManager handler " + func + " is not registered, can not remove.");
}, destroy:function () {
for (var i = 0; i < this._registeredHandlers.length; i++) {
delete this._registeredHandlers[i];
}
}});
dojo.widget.Editor2ToolbarItemManager = new dojo.widget.HandlerManager;
dojo.lang.mixin(dojo.widget.Editor2ToolbarItemManager, {getToolbarItem:function (name) {
var item;
name = name.toLowerCase();
for (var i = 0; i < this._registeredHandlers.length; i++) {
item = this._registeredHandlers[i](name);
if (item) {
return item;
}
}
switch (name) {
case "bold":
case "copy":
case "cut":
case "delete":
case "indent":
case "inserthorizontalrule":
case "insertorderedlist":
case "insertunorderedlist":
case "italic":
case "justifycenter":
case "justifyfull":
case "justifyleft":
case "justifyright":
case "outdent":
case "paste":
case "redo":
case "removeformat":
case "selectall":
case "strikethrough":
case "subscript":
case "superscript":
case "underline":
case "undo":
case "unlink":
case "createlink":
case "insertimage":
case "htmltoggle":
item = new dojo.widget.Editor2ToolbarButton(name);
break;
case "forecolor":
case "hilitecolor":
item = new dojo.widget.Editor2ToolbarColorPaletteButton(name);
break;
case "plainformatblock":
item = new dojo.widget.Editor2ToolbarFormatBlockPlainSelect("formatblock");
break;
case "formatblock":
item = new dojo.widget.Editor2ToolbarFormatBlockSelect("formatblock");
break;
case "fontsize":
item = new dojo.widget.Editor2ToolbarFontSizeSelect("fontsize");
break;
case "fontname":
item = new dojo.widget.Editor2ToolbarFontNameSelect("fontname");
break;
case "inserttable":
case "insertcell":
case "insertcol":
case "insertrow":
case "deletecells":
case "deletecols":
case "deleterows":
case "mergecells":
case "splitcell":
dojo.debug(name + " is implemented in dojo.widget.Editor2Plugin.TableOperation, please require it first.");
break;
case "inserthtml":
case "blockdirltr":
case "blockdirrtl":
case "dirltr":
case "dirrtl":
case "inlinedirltr":
case "inlinedirrtl":
dojo.debug("Not yet implemented toolbar item: " + name);
break;
default:
dojo.debug("dojo.widget.Editor2ToolbarItemManager.getToolbarItem: Unknown toolbar item: " + name);
}
return item;
}});
dojo.addOnUnload(dojo.widget.Editor2ToolbarItemManager, "destroy");
dojo.declare("dojo.widget.Editor2ToolbarButton", null, function (name) {
this._name = name;
}, {create:function (node, toolbar, nohover) {
this._domNode = node;
var cmd = toolbar.parent.getCommand(this._name);
if (cmd) {
this._domNode.title = cmd.getText();
}
this.disableSelection(this._domNode);
this._parentToolbar = toolbar;
dojo.event.connect(this._domNode, "onclick", this, "onClick");
if (!nohover) {
dojo.event.connect(this._domNode, "onmouseover", this, "onMouseOver");
dojo.event.connect(this._domNode, "onmouseout", this, "onMouseOut");
}
}, disableSelection:function (rootnode) {
dojo.html.disableSelection(rootnode);
var nodes = rootnode.all || rootnode.getElementsByTagName("*");
for (var x = 0; x < nodes.length; x++) {
dojo.html.disableSelection(nodes[x]);
}
}, onMouseOver:function () {
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
if (curInst) {
var _command = curInst.getCommand(this._name);
if (_command && _command.getState() != dojo.widget.Editor2Manager.commandState.Disabled) {
this.highlightToolbarItem();
}
}
}, onMouseOut:function () {
this.unhighlightToolbarItem();
}, destroy:function () {
this._domNode = null;
this._parentToolbar = null;
}, onClick:function (e) {
if (this._domNode && !this._domNode.disabled && this._parentToolbar.checkAvailability()) {
e.preventDefault();
e.stopPropagation();
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
if (curInst) {
var _command = curInst.getCommand(this._name);
if (_command) {
_command.execute();
}
}
}
}, refreshState:function () {
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
var em = dojo.widget.Editor2Manager;
if (curInst) {
var _command = curInst.getCommand(this._name);
if (_command) {
var state = _command.getState();
if (state != this._lastState) {
switch (state) {
case em.commandState.Latched:
this.latchToolbarItem();
break;
case em.commandState.Enabled:
this.enableToolbarItem();
break;
case em.commandState.Disabled:
default:
this.disableToolbarItem();
}
this._lastState = state;
}
}
}
return em.commandState.Enabled;
}, latchToolbarItem:function () {
this._domNode.disabled = false;
this.removeToolbarItemStyle(this._domNode);
dojo.html.addClass(this._domNode, this._parentToolbar.ToolbarLatchedItemStyle);
}, enableToolbarItem:function () {
this._domNode.disabled = false;
this.removeToolbarItemStyle(this._domNode);
dojo.html.addClass(this._domNode, this._parentToolbar.ToolbarEnabledItemStyle);
}, disableToolbarItem:function () {
this._domNode.disabled = true;
this.removeToolbarItemStyle(this._domNode);
dojo.html.addClass(this._domNode, this._parentToolbar.ToolbarDisabledItemStyle);
}, highlightToolbarItem:function () {
dojo.html.addClass(this._domNode, this._parentToolbar.ToolbarHighlightedItemStyle);
}, unhighlightToolbarItem:function () {
dojo.html.removeClass(this._domNode, this._parentToolbar.ToolbarHighlightedItemStyle);
}, removeToolbarItemStyle:function () {
dojo.html.removeClass(this._domNode, this._parentToolbar.ToolbarEnabledItemStyle);
dojo.html.removeClass(this._domNode, this._parentToolbar.ToolbarLatchedItemStyle);
dojo.html.removeClass(this._domNode, this._parentToolbar.ToolbarDisabledItemStyle);
this.unhighlightToolbarItem();
}});
dojo.declare("dojo.widget.Editor2ToolbarDropDownButton", dojo.widget.Editor2ToolbarButton, {onClick:function () {
if (this._domNode && !this._domNode.disabled && this._parentToolbar.checkAvailability()) {
if (!this._dropdown) {
this._dropdown = dojo.widget.createWidget("PopupContainer", {});
this._domNode.appendChild(this._dropdown.domNode);
}
if (this._dropdown.isShowingNow) {
this._dropdown.close();
} else {
this.onDropDownShown();
this._dropdown.open(this._domNode, null, this._domNode);
}
}
}, destroy:function () {
this.onDropDownDestroy();
if (this._dropdown) {
this._dropdown.destroy();
}
dojo.widget.Editor2ToolbarDropDownButton.superclass.destroy.call(this);
}, onDropDownShown:function () {
}, onDropDownDestroy:function () {
}});
dojo.declare("dojo.widget.Editor2ToolbarColorPaletteButton", dojo.widget.Editor2ToolbarDropDownButton, {onDropDownShown:function () {
if (!this._colorpalette) {
this._colorpalette = dojo.widget.createWidget("ColorPalette", {});
this._dropdown.addChild(this._colorpalette);
this.disableSelection(this._dropdown.domNode);
this.disableSelection(this._colorpalette.domNode);
dojo.event.connect(this._colorpalette, "onColorSelect", this, "setColor");
dojo.event.connect(this._dropdown, "open", this, "latchToolbarItem");
dojo.event.connect(this._dropdown, "close", this, "enableToolbarItem");
}
}, setColor:function (color) {
this._dropdown.close();
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
if (curInst) {
var _command = curInst.getCommand(this._name);
if (_command) {
_command.execute(color);
}
}
}});
dojo.declare("dojo.widget.Editor2ToolbarFormatBlockPlainSelect", dojo.widget.Editor2ToolbarButton, {create:function (node, toolbar) {
this._domNode = node;
this._parentToolbar = toolbar;
this._domNode = node;
this.disableSelection(this._domNode);
dojo.event.connect(this._domNode, "onchange", this, "onChange");
}, destroy:function () {
this._domNode = null;
}, onChange:function () {
if (this._parentToolbar.checkAvailability()) {
var sv = this._domNode.value.toLowerCase();
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
if (curInst) {
var _command = curInst.getCommand(this._name);
if (_command) {
_command.execute(sv);
}
}
}
}, refreshState:function () {
if (this._domNode) {
dojo.widget.Editor2ToolbarFormatBlockPlainSelect.superclass.refreshState.call(this);
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
if (curInst) {
var _command = curInst.getCommand(this._name);
if (_command) {
var format = _command.getValue();
if (!format) {
format = "";
}
dojo.lang.forEach(this._domNode.options, function (item) {
if (item.value.toLowerCase() == format.toLowerCase()) {
item.selected = true;
}
});
}
}
}
}});
dojo.declare("dojo.widget.Editor2ToolbarComboItem", dojo.widget.Editor2ToolbarDropDownButton, {href:null, create:function (node, toolbar) {
dojo.widget.Editor2ToolbarComboItem.superclass.create.apply(this, arguments);
if (!this._contentPane) {
dojo.require("dojo.widget.ContentPane");
this._contentPane = dojo.widget.createWidget("ContentPane", {preload:"true"});
this._contentPane.addOnLoad(this, "setup");
this._contentPane.setUrl(this.href);
}
}, onMouseOver:function (e) {
if (this._lastState != dojo.widget.Editor2Manager.commandState.Disabled) {
dojo.html.addClass(e.currentTarget, this._parentToolbar.ToolbarHighlightedSelectStyle);
}
}, onMouseOut:function (e) {
dojo.html.removeClass(e.currentTarget, this._parentToolbar.ToolbarHighlightedSelectStyle);
}, onDropDownShown:function () {
if (!this._dropdown.__addedContentPage) {
this._dropdown.addChild(this._contentPane);
this._dropdown.__addedContentPage = true;
}
}, setup:function () {
}, onChange:function (e) {
if (this._parentToolbar.checkAvailability()) {
var name = e.currentTarget.getAttribute("dropDownItemName");
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
if (curInst) {
var _command = curInst.getCommand(this._name);
if (_command) {
_command.execute(name);
}
}
}
this._dropdown.close();
}, onMouseOverItem:function (e) {
dojo.html.addClass(e.currentTarget, this._parentToolbar.ToolbarHighlightedSelectItemStyle);
}, onMouseOutItem:function (e) {
dojo.html.removeClass(e.currentTarget, this._parentToolbar.ToolbarHighlightedSelectItemStyle);
}});
dojo.declare("dojo.widget.Editor2ToolbarFormatBlockSelect", dojo.widget.Editor2ToolbarComboItem, {href:dojo.uri.moduleUri("dojo.widget", "templates/Editor2/EditorToolbar_FormatBlock.html"), setup:function () {
dojo.widget.Editor2ToolbarFormatBlockSelect.superclass.setup.call(this);
var nodes = this._contentPane.domNode.all || this._contentPane.domNode.getElementsByTagName("*");
this._blockNames = {};
this._blockDisplayNames = {};
for (var x = 0; x < nodes.length; x++) {
var node = nodes[x];
dojo.html.disableSelection(node);
var name = node.getAttribute("dropDownItemName");
if (name) {
this._blockNames[name] = node;
var childrennodes = node.getElementsByTagName(name);
this._blockDisplayNames[name] = childrennodes[childrennodes.length - 1].innerHTML;
}
}
for (var name in this._blockNames) {
dojo.event.connect(this._blockNames[name], "onclick", this, "onChange");
dojo.event.connect(this._blockNames[name], "onmouseover", this, "onMouseOverItem");
dojo.event.connect(this._blockNames[name], "onmouseout", this, "onMouseOutItem");
}
}, onDropDownDestroy:function () {
if (this._blockNames) {
for (var name in this._blockNames) {
delete this._blockNames[name];
delete this._blockDisplayNames[name];
}
}
}, refreshState:function () {
dojo.widget.Editor2ToolbarFormatBlockSelect.superclass.refreshState.call(this);
if (this._lastState != dojo.widget.Editor2Manager.commandState.Disabled) {
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
if (curInst) {
var _command = curInst.getCommand(this._name);
if (_command) {
var format = _command.getValue();
if (format == this._lastSelectedFormat && this._blockDisplayNames) {
return this._lastState;
}
this._lastSelectedFormat = format;
var label = this._domNode.getElementsByTagName("label")[0];
var isSet = false;
if (this._blockDisplayNames) {
for (var name in this._blockDisplayNames) {
if (name == format) {
label.innerHTML = this._blockDisplayNames[name];
isSet = true;
break;
}
}
if (!isSet) {
label.innerHTML = "&nbsp;";
}
}
}
}
}
return this._lastState;
}});
dojo.declare("dojo.widget.Editor2ToolbarFontSizeSelect", dojo.widget.Editor2ToolbarComboItem, {href:dojo.uri.moduleUri("dojo.widget", "templates/Editor2/EditorToolbar_FontSize.html"), setup:function () {
dojo.widget.Editor2ToolbarFormatBlockSelect.superclass.setup.call(this);
var nodes = this._contentPane.domNode.all || this._contentPane.domNode.getElementsByTagName("*");
this._fontsizes = {};
this._fontSizeDisplayNames = {};
for (var x = 0; x < nodes.length; x++) {
var node = nodes[x];
dojo.html.disableSelection(node);
var name = node.getAttribute("dropDownItemName");
if (name) {
this._fontsizes[name] = node;
this._fontSizeDisplayNames[name] = node.getElementsByTagName("font")[0].innerHTML;
}
}
for (var name in this._fontsizes) {
dojo.event.connect(this._fontsizes[name], "onclick", this, "onChange");
dojo.event.connect(this._fontsizes[name], "onmouseover", this, "onMouseOverItem");
dojo.event.connect(this._fontsizes[name], "onmouseout", this, "onMouseOutItem");
}
}, onDropDownDestroy:function () {
if (this._fontsizes) {
for (var name in this._fontsizes) {
delete this._fontsizes[name];
delete this._fontSizeDisplayNames[name];
}
}
}, refreshState:function () {
dojo.widget.Editor2ToolbarFormatBlockSelect.superclass.refreshState.call(this);
if (this._lastState != dojo.widget.Editor2Manager.commandState.Disabled) {
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
if (curInst) {
var _command = curInst.getCommand(this._name);
if (_command) {
var size = _command.getValue();
if (size == this._lastSelectedSize && this._fontSizeDisplayNames) {
return this._lastState;
}
this._lastSelectedSize = size;
var label = this._domNode.getElementsByTagName("label")[0];
var isSet = false;
if (this._fontSizeDisplayNames) {
for (var name in this._fontSizeDisplayNames) {
if (name == size) {
label.innerHTML = this._fontSizeDisplayNames[name];
isSet = true;
break;
}
}
if (!isSet) {
label.innerHTML = "&nbsp;";
}
}
}
}
}
return this._lastState;
}});
dojo.declare("dojo.widget.Editor2ToolbarFontNameSelect", dojo.widget.Editor2ToolbarFontSizeSelect, {href:dojo.uri.moduleUri("dojo.widget", "templates/Editor2/EditorToolbar_FontName.html")});
dojo.widget.defineWidget("dojo.widget.Editor2Toolbar", dojo.widget.HtmlWidget, function () {
dojo.event.connect(this, "fillInTemplate", dojo.lang.hitch(this, function () {
if (dojo.render.html.ie) {
this.domNode.style.zoom = 1;
}
}));
}, {templateString:"<div dojoAttachPoint=\"domNode\" class=\"EditorToolbarDomNode\" unselectable=\"on\">\n\t<table cellpadding=\"3\" cellspacing=\"0\" border=\"0\">\n\t\t<!--\n\t\t\tour toolbar should look something like:\n\n\t\t\t+=======+=======+=======+=============================================+\n\t\t\t| w w | style | copy | bo | it | un | le | ce | ri |\n\t\t\t| w w w | style |=======|==============|==============|\n\t\t\t| w w | style | paste | undo | redo | change style |\n\t\t\t+=======+=======+=======+=============================================+\n\t\t-->\n\t\t<tbody>\n\t\t\t<tr valign=\"top\">\n\t\t\t\t<td rowspan=\"2\">\n\t\t\t\t\t<div class=\"bigIcon\" dojoAttachPoint=\"wikiWordButton\"\n\t\t\t\t\t\tdojoOnClick=\"wikiWordClick; buttonClick;\">\n\t\t\t\t\t\t<span style=\"font-size: 30px; margin-left: 5px;\">\n\t\t\t\t\t\t\tW\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t</td>\n\t\t\t\t<td rowspan=\"2\">\n\t\t\t\t\t<div class=\"bigIcon\" dojoAttachPoint=\"styleDropdownButton\"\n\t\t\t\t\t\tdojoOnClick=\"styleDropdownClick; buttonClick;\">\n\t\t\t\t\t\t<span unselectable=\"on\"\n\t\t\t\t\t\t\tstyle=\"font-size: 30px; margin-left: 5px;\">\n\t\t\t\t\t\t\tS\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"StyleDropdownContainer\" style=\"display: none;\"\n\t\t\t\t\t\tdojoAttachPoint=\"styleDropdownContainer\">\n\t\t\t\t\t\t<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\"\n\t\t\t\t\t\t\theight=\"100%\" width=\"100%\">\n\t\t\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t\t\t<td rowspan=\"2\">\n\t\t\t\t\t\t\t\t\t<div style=\"height: 245px; overflow: auto;\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"headingContainer\"\n\t\t\t\t\t\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\t\t\t\t\t\tdojoOnClick=\"normalTextClick\">normal</div>\n\t\t\t\t\t\t\t\t\t\t<h1 class=\"headingContainer\"\n\t\t\t\t\t\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\t\t\t\t\t\tdojoOnClick=\"h1TextClick\">Heading 1</h1>\n\t\t\t\t\t\t\t\t\t\t<h2 class=\"headingContainer\"\n\t\t\t\t\t\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\t\t\t\t\t\tdojoOnClick=\"h2TextClick\">Heading 2</h2>\n\t\t\t\t\t\t\t\t\t\t<h3 class=\"headingContainer\"\n\t\t\t\t\t\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\t\t\t\t\t\tdojoOnClick=\"h3TextClick\">Heading 3</h3>\n\t\t\t\t\t\t\t\t\t\t<h4 class=\"headingContainer\"\n\t\t\t\t\t\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\t\t\t\t\t\tdojoOnClick=\"h4TextClick\">Heading 4</h4>\n\t\t\t\t\t\t\t\t\t\t<div class=\"headingContainer\"\n\t\t\t\t\t\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\t\t\t\t\t\tdojoOnClick=\"blahTextClick\">blah</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"headingContainer\"\n\t\t\t\t\t\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\t\t\t\t\t\tdojoOnClick=\"blahTextClick\">blah</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"headingContainer\"\n\t\t\t\t\t\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\t\t\t\t\t\tdojoOnClick=\"blahTextClick\">blah</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"headingContainer\">blah</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"headingContainer\">blah</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"headingContainer\">blah</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"headingContainer\">blah</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<!--\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<span class=\"iconContainer\" dojoOnClick=\"buttonClick;\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"icon justifyleft\" \n\t\t\t\t\t\t\t\t\t\t\tstyle=\"float: left;\">&nbsp;</span>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t<span class=\"iconContainer\" dojoOnClick=\"buttonClick;\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"icon justifycenter\" \n\t\t\t\t\t\t\t\t\t\t\tstyle=\"float: left;\">&nbsp;</span>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t<span class=\"iconContainer\" dojoOnClick=\"buttonClick;\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"icon justifyright\" \n\t\t\t\t\t\t\t\t\t\t\tstyle=\"float: left;\">&nbsp;</span>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t<span class=\"iconContainer\" dojoOnClick=\"buttonClick;\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"icon justifyfull\" \n\t\t\t\t\t\t\t\t\t\t\tstyle=\"float: left;\">&nbsp;</span>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t-->\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\tthud\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</div>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<!-- copy -->\n\t\t\t\t\t<span class=\"iconContainer\" dojoAttachPoint=\"copyButton\"\n\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\tdojoOnClick=\"copyClick; buttonClick;\">\n\t\t\t\t\t\t<span class=\"icon copy\" \n\t\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\t\tstyle=\"float: left;\">&nbsp;</span> copy\n\t\t\t\t\t</span>\n\t\t\t\t\t<!-- \"droppable\" options -->\n\t\t\t\t\t<span class=\"iconContainer\" dojoAttachPoint=\"boldButton\"\n\t\t\t\t\t\tunselectable=\"on\"\n\t\t\t\t\t\tdojoOnClick=\"boldClick; buttonClick;\">\n\t\t\t\t\t\t<span class=\"icon bold\" unselectable=\"on\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"iconContainer\" dojoAttachPoint=\"italicButton\"\n\t\t\t\t\t\tdojoOnClick=\"italicClick; buttonClick;\">\n\t\t\t\t\t\t<span class=\"icon italic\" unselectable=\"on\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"iconContainer\" dojoAttachPoint=\"underlineButton\"\n\t\t\t\t\t\tdojoOnClick=\"underlineClick; buttonClick;\">\n\t\t\t\t\t\t<span class=\"icon underline\" unselectable=\"on\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"iconContainer\" dojoAttachPoint=\"leftButton\"\n\t\t\t\t\t\tdojoOnClick=\"leftClick; buttonClick;\">\n\t\t\t\t\t\t<span class=\"icon justifyleft\" unselectable=\"on\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"iconContainer\" dojoAttachPoint=\"fullButton\"\n\t\t\t\t\t\tdojoOnClick=\"fullClick; buttonClick;\">\n\t\t\t\t\t\t<span class=\"icon justifyfull\" unselectable=\"on\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"iconContainer\" dojoAttachPoint=\"rightButton\"\n\t\t\t\t\t\tdojoOnClick=\"rightClick; buttonClick;\">\n\t\t\t\t\t\t<span class=\"icon justifyright\" unselectable=\"on\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<!-- paste -->\n\t\t\t\t\t<span class=\"iconContainer\" dojoAttachPoint=\"pasteButton\"\n\t\t\t\t\t\tdojoOnClick=\"pasteClick; buttonClick;\" unselectable=\"on\">\n\t\t\t\t\t\t<span class=\"icon paste\" style=\"float: left;\" unselectable=\"on\">&nbsp;</span> paste\n\t\t\t\t\t</span>\n\t\t\t\t\t<!-- \"droppable\" options -->\n\t\t\t\t\t<span class=\"iconContainer\" dojoAttachPoint=\"undoButton\"\n\t\t\t\t\t\tdojoOnClick=\"undoClick; buttonClick;\" unselectable=\"on\">\n\t\t\t\t\t\t<span class=\"icon undo\" style=\"float: left;\" unselectable=\"on\">&nbsp;</span> undo\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"iconContainer\" dojoAttachPoint=\"redoButton\"\n\t\t\t\t\t\tdojoOnClick=\"redoClick; buttonClick;\" unselectable=\"on\">\n\t\t\t\t\t\t<span class=\"icon redo\" style=\"float: left;\" unselectable=\"on\">&nbsp;</span> redo\n\t\t\t\t\t</span>\n\t\t\t\t</td>\t\n\t\t\t</tr>\n\t\t</tbody>\n\t</table>\n</div>\n", templateCssString:".StyleDropdownContainer {\n\tposition: absolute;\n\tz-index: 1000;\n\toverflow: auto;\n\tcursor: default;\n\twidth: 250px;\n\theight: 250px;\n\tbackground-color: white;\n\tborder: 1px solid black;\n}\n\n.ColorDropdownContainer {\n\tposition: absolute;\n\tz-index: 1000;\n\toverflow: auto;\n\tcursor: default;\n\twidth: 250px;\n\theight: 150px;\n\tbackground-color: white;\n\tborder: 1px solid black;\n}\n\n.EditorToolbarDomNode {\n\tbackground-image: url(buttons/bg-fade.png);\n\tbackground-repeat: repeat-x;\n\tbackground-position: 0px -50px;\n}\n\n.EditorToolbarSmallBg {\n\tbackground-image: url(images/toolbar-bg.gif);\n\tbackground-repeat: repeat-x;\n\tbackground-position: 0px 0px;\n}\n\n/*\nbody {\n\tbackground:url(images/blank.gif) fixed;\n}*/\n\n.IEFixedToolbar {\n\tposition:absolute;\n\t/* top:0; */\n\ttop: expression(eval((document.documentElement||document.body).scrollTop));\n}\n\ndiv.bigIcon {\n\twidth: 40px;\n\theight: 40px; \n\t/* background-color: white; */\n\t/* border: 1px solid #a6a7a3; */\n\tfont-family: Verdana, Trebuchet, Tahoma, Arial;\n}\n\n.iconContainer {\n\tfont-family: Verdana, Trebuchet, Tahoma, Arial;\n\tfont-size: 13px;\n\tfloat: left;\n\theight: 18px;\n\tdisplay: block;\n\t/* background-color: white; */\n\tcursor: pointer;\n\tpadding: 1px 4px 1px 1px; /* almost the same as a transparent border */\n\tborder: 0px;\n}\n\n.dojoE2TBIcon {\n\tdisplay: block;\n\ttext-align: center;\n\tmin-width: 18px;\n\twidth: 18px;\n\theight: 18px;\n\t/* background-color: #a6a7a3; */\n\tbackground-repeat: no-repeat;\n\tbackground-image: url(buttons/aggregate.gif);\n}\n\n\n.dojoE2TBIcon[class~=dojoE2TBIcon] {\n}\n\n.ToolbarButtonLatched {\n border: #316ac5 1px solid; !important;\n padding: 0px 3px 0px 0px; !important; /* make room for border */\n background-color: #c1d2ee;\n}\n\n.ToolbarButtonHighlighted {\n border: #316ac5 1px solid; !important;\n padding: 0px 3px 0px 0px; !important; /* make room for border */\n background-color: #dff1ff;\n}\n\n.ToolbarButtonDisabled{\n filter: gray() alpha(opacity=30); /* IE */\n opacity: 0.30; /* Safari, Opera and Mozilla */\n}\n\n.headingContainer {\n\twidth: 150px;\n\theight: 30px;\n\tmargin: 0px;\n\t/* padding-left: 5px; */\n\toverflow: hidden;\n\tline-height: 25px;\n\tborder-bottom: 1px solid black;\n\tborder-top: 1px solid white;\n}\n\n.EditorToolbarDomNode select {\n\tfont-size: 14px;\n}\n \n.dojoE2TBIcon_Sep { width: 5px; min-width: 5px; max-width: 5px; background-position: 0px 0px}\n.dojoE2TBIcon_Backcolor { background-position: -18px 0px}\n.dojoE2TBIcon_Bold { background-position: -36px 0px}\n.dojoE2TBIcon_Cancel { background-position: -54px 0px}\n.dojoE2TBIcon_Copy { background-position: -72px 0px}\n.dojoE2TBIcon_Link { background-position: -90px 0px}\n.dojoE2TBIcon_Cut { background-position: -108px 0px}\n.dojoE2TBIcon_Delete { background-position: -126px 0px}\n.dojoE2TBIcon_TextColor { background-position: -144px 0px}\n.dojoE2TBIcon_BackgroundColor { background-position: -162px 0px}\n.dojoE2TBIcon_Indent { background-position: -180px 0px}\n.dojoE2TBIcon_HorizontalLine { background-position: -198px 0px}\n.dojoE2TBIcon_Image { background-position: -216px 0px}\n.dojoE2TBIcon_NumberedList { background-position: -234px 0px}\n.dojoE2TBIcon_Table { background-position: -252px 0px}\n.dojoE2TBIcon_BulletedList { background-position: -270px 0px}\n.dojoE2TBIcon_Italic { background-position: -288px 0px}\n.dojoE2TBIcon_CenterJustify { background-position: -306px 0px}\n.dojoE2TBIcon_BlockJustify { background-position: -324px 0px}\n.dojoE2TBIcon_LeftJustify { background-position: -342px 0px}\n.dojoE2TBIcon_RightJustify { background-position: -360px 0px}\n.dojoE2TBIcon_left_to_right { background-position: -378px 0px}\n.dojoE2TBIcon_list_bullet_indent { background-position: -396px 0px}\n.dojoE2TBIcon_list_bullet_outdent { background-position: -414px 0px}\n.dojoE2TBIcon_list_num_indent { background-position: -432px 0px}\n.dojoE2TBIcon_list_num_outdent { background-position: -450px 0px}\n.dojoE2TBIcon_Outdent { background-position: -468px 0px}\n.dojoE2TBIcon_Paste { background-position: -486px 0px}\n.dojoE2TBIcon_Redo { background-position: -504px 0px}\ndojoE2TBIcon_RemoveFormat { background-position: -522px 0px}\n.dojoE2TBIcon_right_to_left { background-position: -540px 0px}\n.dojoE2TBIcon_Save { background-position: -558px 0px}\n.dojoE2TBIcon_Space { background-position: -576px 0px}\n.dojoE2TBIcon_StrikeThrough { background-position: -594px 0px}\n.dojoE2TBIcon_Subscript { background-position: -612px 0px}\n.dojoE2TBIcon_Superscript { background-position: -630px 0px}\n.dojoE2TBIcon_Underline { background-position: -648px 0px}\n.dojoE2TBIcon_Undo { background-position: -666px 0px}\n.dojoE2TBIcon_WikiWord { background-position: -684px 0px}\n\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/EditorToolbar.css"), ToolbarLatchedItemStyle:"ToolbarButtonLatched", ToolbarEnabledItemStyle:"ToolbarButtonEnabled", ToolbarDisabledItemStyle:"ToolbarButtonDisabled", ToolbarHighlightedItemStyle:"ToolbarButtonHighlighted", ToolbarHighlightedSelectStyle:"ToolbarSelectHighlighted", ToolbarHighlightedSelectItemStyle:"ToolbarSelectHighlightedItem", postCreate:function () {
var nodes = dojo.html.getElementsByClass("dojoEditorToolbarItem", this.domNode);
this.items = {};
for (var x = 0; x < nodes.length; x++) {
var node = nodes[x];
var itemname = node.getAttribute("dojoETItemName");
if (itemname) {
var item = dojo.widget.Editor2ToolbarItemManager.getToolbarItem(itemname);
if (item) {
item.create(node, this);
this.items[itemname.toLowerCase()] = item;
} else {
node.style.display = "none";
}
}
}
}, update:function () {
for (var cmd in this.items) {
this.items[cmd].refreshState();
}
}, shareGroup:"", checkAvailability:function () {
if (!this.shareGroup) {
this.parent.focus();
return true;
}
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
if (this.shareGroup == curInst.toolbarGroup) {
return true;
}
return false;
}, destroy:function () {
for (var it in this.items) {
this.items[it].destroy();
delete this.items[it];
}
dojo.widget.Editor2Toolbar.superclass.destroy.call(this);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/DateTextbox.js
New file
0,0 → 1,45
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.DateTextbox");
dojo.require("dojo.widget.ValidationTextbox");
dojo.require("dojo.date.format");
dojo.require("dojo.validate.datetime");
dojo.widget.defineWidget("dojo.widget.DateTextbox", dojo.widget.ValidationTextbox, {displayFormat:"", formatLength:"short", mixInProperties:function (localProperties) {
dojo.widget.DateTextbox.superclass.mixInProperties.apply(this, arguments);
if (localProperties.format) {
this.flags.format = localProperties.format;
}
}, isValid:function () {
if (this.flags.format) {
dojo.deprecated("dojo.widget.DateTextbox", "format attribute is deprecated; use displayFormat or formatLength instead", "0.5");
return dojo.validate.isValidDate(this.textbox.value, this.flags.format);
}
return dojo.date.parse(this.textbox.value, {formatLength:this.formatLength, selector:"dateOnly", locale:this.lang, datePattern:this.displayFormat});
}});
dojo.widget.defineWidget("dojo.widget.TimeTextbox", dojo.widget.ValidationTextbox, {displayFormat:"", formatLength:"short", mixInProperties:function (localProperties) {
dojo.widget.TimeTextbox.superclass.mixInProperties.apply(this, arguments);
if (localProperties.format) {
this.flags.format = localProperties.format;
}
if (localProperties.amsymbol) {
this.flags.amSymbol = localProperties.amsymbol;
}
if (localProperties.pmsymbol) {
this.flags.pmSymbol = localProperties.pmsymbol;
}
}, isValid:function () {
if (this.flags.format) {
dojo.deprecated("dojo.widget.TimeTextbox", "format attribute is deprecated; use displayFormat or formatLength instead", "0.5");
return dojo.validate.isValidTime(this.textbox.value, this.flags);
}
return dojo.date.parse(this.textbox.value, {formatLength:this.formatLength, selector:"timeOnly", locale:this.lang, timePattern:this.displayFormat});
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/TreeExtension.js
New file
0,0 → 1,17
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeExtension");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.TreeCommon");
dojo.widget.defineWidget("dojo.widget.TreeExtension", [dojo.widget.HtmlWidget, dojo.widget.TreeCommon], function () {
this.listenedTrees = {};
}, {});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/InlineEditBox.js
New file
0,0 → 1,154
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.InlineEditBox");
dojo.require("dojo.widget.*");
dojo.require("dojo.event.*");
dojo.require("dojo.lfx.*");
dojo.require("dojo.gfx.color");
dojo.require("dojo.string");
dojo.require("dojo.html.*");
dojo.require("dojo.html.layout");
dojo.widget.defineWidget("dojo.widget.InlineEditBox", dojo.widget.HtmlWidget, function () {
this.history = [];
}, {templateString:"<form class=\"inlineEditBox\" style=\"display: none\" dojoAttachPoint=\"form\" dojoAttachEvent=\"onSubmit:saveEdit; onReset:cancelEdit; onKeyUp: checkForValueChange;\">\n\t<input type=\"text\" dojoAttachPoint=\"text\" style=\"display: none;\" />\n\t<textarea dojoAttachPoint=\"textarea\" style=\"display: none;\"></textarea>\n\t<input type=\"submit\" value=\"Save\" dojoAttachPoint=\"submitButton\" />\n\t<input type=\"reset\" value=\"Cancel\" dojoAttachPoint=\"cancelButton\" />\n</form>\n", templateCssString:".editLabel {\n\tfont-size : small;\n\tpadding : 0 5px;\n\tdisplay : none;\n}\n\n.editableRegionDisabled {\n\tcursor : pointer;\n\t_cursor : hand;\n}\n\n.editableRegion {\n\tbackground-color : #ffc !important;\n\tcursor : pointer;\n\t_cursor : hand;\n}\n\n.editableRegion .editLabel {\n\tdisplay : inline;\n}\n\n.editableTextareaRegion .editLabel {\n\tdisplay : block;\n}\n\n.inlineEditBox {\n\t/*background-color : #ffc;*/\n\tdisplay : inline;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/InlineEditBox.css"), mode:"text", name:"", minWidth:100, minHeight:200, editing:false, value:"", textValue:"", defaultText:"", postMixInProperties:function () {
if (this.textValue) {
dojo.deprecated("InlineEditBox: Use value parameter instead of textValue; will be removed in 0.5");
this.value = this.textValue;
}
if (this.defaultText) {
dojo.deprecated("InlineEditBox: Use value parameter instead of defaultText; will be removed in 0.5");
this.value = this.defaultText;
}
}, postCreate:function (args, frag) {
this.editable = this.getFragNodeRef(frag);
dojo.html.insertAfter(this.editable, this.form);
dojo.event.connect(this.editable, "onmouseover", this, "onMouseOver");
dojo.event.connect(this.editable, "onmouseout", this, "onMouseOut");
dojo.event.connect(this.editable, "onclick", this, "_beginEdit");
if (this.value) {
this.editable.innerHTML = this.value;
return;
} else {
this.value = dojo.string.trim(this.editable.innerHTML);
this.editable.innerHTML = this.value;
}
}, onMouseOver:function () {
if (!this.editing) {
if (this.disabled) {
dojo.html.addClass(this.editable, "editableRegionDisabled");
} else {
dojo.html.addClass(this.editable, "editableRegion");
if (this.mode == "textarea") {
dojo.html.addClass(this.editable, "editableTextareaRegion");
}
}
}
}, onMouseOut:function () {
if (!this.editing) {
dojo.html.removeClass(this.editable, "editableRegion");
dojo.html.removeClass(this.editable, "editableTextareaRegion");
dojo.html.removeClass(this.editable, "editableRegionDisabled");
}
}, _beginEdit:function (e) {
if (this.editing || this.disabled) {
return;
}
this.onMouseOut();
this.editing = true;
var ee = this[this.mode.toLowerCase()];
ee.value = dojo.string.trim(this.value);
ee.style.fontSize = dojo.html.getStyle(this.editable, "font-size");
ee.style.fontWeight = dojo.html.getStyle(this.editable, "font-weight");
ee.style.fontStyle = dojo.html.getStyle(this.editable, "font-style");
var bb = dojo.html.getBorderBox(this.editable);
ee.style.width = Math.max(bb.width, this.minWidth) + "px";
if (this.mode.toLowerCase() == "textarea") {
ee.style.display = "block";
ee.style.height = Math.max(bb.height, this.minHeight) + "px";
} else {
ee.style.display = "";
}
this.form.style.display = "";
this.editable.style.display = "none";
ee.focus();
ee.select();
this.submitButton.disabled = true;
}, saveEdit:function (e) {
e.preventDefault();
e.stopPropagation();
var ee = this[this.mode.toLowerCase()];
if ((this.value != ee.value) && (dojo.string.trim(ee.value) != "")) {
this.doFade = true;
this.history.push(this.value);
this.onSave(ee.value, this.value, this.name);
this.value = ee.value;
this.editable.innerHTML = "";
var textNode = document.createTextNode(this.value);
this.editable.appendChild(textNode);
} else {
this.doFade = false;
}
this._finishEdit(e);
}, _stopEditing:function () {
this.editing = false;
this.form.style.display = "none";
this.editable.style.display = "";
return true;
}, cancelEdit:function (e) {
this._stopEditing();
this.onCancel();
return true;
}, _finishEdit:function (e) {
this._stopEditing();
if (this.doFade) {
dojo.lfx.highlight(this.editable, dojo.gfx.color.hex2rgb("#ffc"), 700).play(300);
}
this.doFade = false;
}, setText:function (txt) {
dojo.deprecated("setText() is deprecated, call setValue() instead, will be removed in 0.5");
this.setValue(txt);
}, setValue:function (txt) {
txt = "" + txt;
var tt = dojo.string.trim(txt);
this.value = tt;
this.editable.innerHTML = tt;
}, undo:function () {
if (this.history.length > 0) {
var curValue = this.value;
var value = this.history.pop();
this.editable.innerHTML = value;
this.value = value;
this.onUndo(value);
this.onSave(value, curValue, this.name);
}
}, onChange:function (newValue, oldValue) {
}, onSave:function (newValue, oldValue, name) {
}, onCancel:function () {
}, checkForValueChange:function () {
var ee = this[this.mode.toLowerCase()];
if ((this.value != ee.value) && (dojo.string.trim(ee.value) != "")) {
this.submitButton.disabled = false;
}
this.onChange(this.value, ee.value);
}, disable:function () {
this.submitButton.disabled = true;
this.cancelButton.disabled = true;
var ee = this[this.mode.toLowerCase()];
ee.disabled = true;
dojo.widget.InlineEditBox.superclass.disable.apply(this, arguments);
}, enable:function () {
this.checkForValueChange();
this.cancelButton.disabled = false;
var ee = this[this.mode.toLowerCase()];
ee.disabled = false;
dojo.widget.InlineEditBox.superclass.enable.apply(this, arguments);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/SplitContainer.js
New file
0,0 → 1,323
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.SplitContainer");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.ContentPane");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.html.style");
dojo.require("dojo.html.layout");
dojo.require("dojo.html.selection");
dojo.require("dojo.io.cookie");
dojo.widget.defineWidget("dojo.widget.SplitContainer", dojo.widget.HtmlWidget, function () {
this.sizers = [];
}, {isContainer:true, templateCssString:".dojoSplitContainer{\n\tposition: relative;\n\toverflow: hidden;\n\tdisplay: block;\n}\n\n.dojoSplitPane{\n\tposition: absolute;\n}\n\n.dojoSplitContainerSizerH,\n.dojoSplitContainerSizerV {\n\tfont-size: 1px;\n\tcursor: move;\n\tcursor: w-resize;\n\tbackground-color: ThreeDFace;\n\tborder: 1px solid;\n\tborder-color: ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight;\n\tmargin: 0;\n}\n\n.dojoSplitContainerSizerV {\n\tcursor: n-resize;\n}\n\n.dojoSplitContainerVirtualSizerH,\n.dojoSplitContainerVirtualSizerV {\n\tfont-size: 1px;\n\tcursor: move;\n\tcursor: w-resize;\n\tbackground-color: ThreeDShadow;\n\t-moz-opacity: 0.5;\n\topacity: 0.5;\n\tfilter: Alpha(Opacity=50);\n\tmargin: 0;\n}\n\n.dojoSplitContainerVirtualSizerV {\n\tcursor: n-resize;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/SplitContainer.css"), activeSizing:false, sizerWidth:15, orientation:"horizontal", persist:true, postMixInProperties:function () {
dojo.widget.SplitContainer.superclass.postMixInProperties.apply(this, arguments);
this.isHorizontal = (this.orientation == "horizontal");
}, fillInTemplate:function () {
dojo.widget.SplitContainer.superclass.fillInTemplate.apply(this, arguments);
dojo.html.addClass(this.domNode, "dojoSplitContainer");
if (dojo.render.html.moz) {
this.domNode.style.overflow = "-moz-scrollbars-none";
}
var content = dojo.html.getContentBox(this.domNode);
this.paneWidth = content.width;
this.paneHeight = content.height;
}, onResized:function (e) {
var content = dojo.html.getContentBox(this.domNode);
this.paneWidth = content.width;
this.paneHeight = content.height;
this._layoutPanels();
}, postCreate:function (args, fragment, parentComp) {
dojo.widget.SplitContainer.superclass.postCreate.apply(this, arguments);
for (var i = 0; i < this.children.length; i++) {
with (this.children[i].domNode.style) {
position = "absolute";
}
dojo.html.addClass(this.children[i].domNode, "dojoSplitPane");
if (i == this.children.length - 1) {
break;
}
this._addSizer();
}
if (typeof this.sizerWidth == "object") {
try {
this.sizerWidth = parseInt(this.sizerWidth.toString());
}
catch (e) {
this.sizerWidth = 15;
}
}
this.virtualSizer = document.createElement("div");
this.virtualSizer.style.position = "absolute";
this.virtualSizer.style.display = "none";
this.virtualSizer.style.zIndex = 10;
this.virtualSizer.className = this.isHorizontal ? "dojoSplitContainerVirtualSizerH" : "dojoSplitContainerVirtualSizerV";
this.domNode.appendChild(this.virtualSizer);
dojo.html.disableSelection(this.virtualSizer);
if (this.persist) {
this._restoreState();
}
this.resizeSoon();
}, _injectChild:function (child) {
with (child.domNode.style) {
position = "absolute";
}
dojo.html.addClass(child.domNode, "dojoSplitPane");
}, _addSizer:function () {
var i = this.sizers.length;
this.sizers[i] = document.createElement("div");
this.sizers[i].style.position = "absolute";
this.sizers[i].className = this.isHorizontal ? "dojoSplitContainerSizerH" : "dojoSplitContainerSizerV";
var self = this;
var handler = (function () {
var sizer_i = i;
return function (e) {
self.beginSizing(e, sizer_i);
};
})();
dojo.event.connect(this.sizers[i], "onmousedown", handler);
this.domNode.appendChild(this.sizers[i]);
dojo.html.disableSelection(this.sizers[i]);
}, removeChild:function (widget) {
if (this.sizers.length > 0) {
for (var x = 0; x < this.children.length; x++) {
if (this.children[x] === widget) {
var i = this.sizers.length - 1;
this.domNode.removeChild(this.sizers[i]);
this.sizers.length = i;
break;
}
}
}
dojo.widget.SplitContainer.superclass.removeChild.call(this, widget, arguments);
this.onResized();
}, addChild:function (widget) {
dojo.widget.SplitContainer.superclass.addChild.apply(this, arguments);
this._injectChild(widget);
if (this.children.length > 1) {
this._addSizer();
}
this._layoutPanels();
}, _layoutPanels:function () {
if (this.children.length == 0) {
return;
}
var space = this.isHorizontal ? this.paneWidth : this.paneHeight;
if (this.children.length > 1) {
space -= this.sizerWidth * (this.children.length - 1);
}
var out_of = 0;
for (var i = 0; i < this.children.length; i++) {
out_of += this.children[i].sizeShare;
}
var pix_per_unit = space / out_of;
var total_size = 0;
for (var i = 0; i < this.children.length - 1; i++) {
var size = Math.round(pix_per_unit * this.children[i].sizeShare);
this.children[i].sizeActual = size;
total_size += size;
}
this.children[this.children.length - 1].sizeActual = space - total_size;
this._checkSizes();
var pos = 0;
var size = this.children[0].sizeActual;
this._movePanel(this.children[0], pos, size);
this.children[0].position = pos;
pos += size;
for (var i = 1; i < this.children.length; i++) {
this._moveSlider(this.sizers[i - 1], pos, this.sizerWidth);
this.sizers[i - 1].position = pos;
pos += this.sizerWidth;
size = this.children[i].sizeActual;
this._movePanel(this.children[i], pos, size);
this.children[i].position = pos;
pos += size;
}
}, _movePanel:function (panel, pos, size) {
if (this.isHorizontal) {
panel.domNode.style.left = pos + "px";
panel.domNode.style.top = 0;
panel.resizeTo(size, this.paneHeight);
} else {
panel.domNode.style.left = 0;
panel.domNode.style.top = pos + "px";
panel.resizeTo(this.paneWidth, size);
}
}, _moveSlider:function (slider, pos, size) {
if (this.isHorizontal) {
slider.style.left = pos + "px";
slider.style.top = 0;
dojo.html.setMarginBox(slider, {width:size, height:this.paneHeight});
} else {
slider.style.left = 0;
slider.style.top = pos + "px";
dojo.html.setMarginBox(slider, {width:this.paneWidth, height:size});
}
}, _growPane:function (growth, pane) {
if (growth > 0) {
if (pane.sizeActual > pane.sizeMin) {
if ((pane.sizeActual - pane.sizeMin) > growth) {
pane.sizeActual = pane.sizeActual - growth;
growth = 0;
} else {
growth -= pane.sizeActual - pane.sizeMin;
pane.sizeActual = pane.sizeMin;
}
}
}
return growth;
}, _checkSizes:function () {
var total_min_size = 0;
var total_size = 0;
for (var i = 0; i < this.children.length; i++) {
total_size += this.children[i].sizeActual;
total_min_size += this.children[i].sizeMin;
}
if (total_min_size <= total_size) {
var growth = 0;
for (var i = 0; i < this.children.length; i++) {
if (this.children[i].sizeActual < this.children[i].sizeMin) {
growth += this.children[i].sizeMin - this.children[i].sizeActual;
this.children[i].sizeActual = this.children[i].sizeMin;
}
}
if (growth > 0) {
if (this.isDraggingLeft) {
for (var i = this.children.length - 1; i >= 0; i--) {
growth = this._growPane(growth, this.children[i]);
}
} else {
for (var i = 0; i < this.children.length; i++) {
growth = this._growPane(growth, this.children[i]);
}
}
}
} else {
for (var i = 0; i < this.children.length; i++) {
this.children[i].sizeActual = Math.round(total_size * (this.children[i].sizeMin / total_min_size));
}
}
}, beginSizing:function (e, i) {
this.paneBefore = this.children[i];
this.paneAfter = this.children[i + 1];
this.isSizing = true;
this.sizingSplitter = this.sizers[i];
this.originPos = dojo.html.getAbsolutePosition(this.children[0].domNode, true, dojo.html.boxSizing.MARGIN_BOX);
if (this.isHorizontal) {
var client = (e.layerX ? e.layerX : e.offsetX);
var screen = e.pageX;
this.originPos = this.originPos.x;
} else {
var client = (e.layerY ? e.layerY : e.offsetY);
var screen = e.pageY;
this.originPos = this.originPos.y;
}
this.startPoint = this.lastPoint = screen;
this.screenToClientOffset = screen - client;
this.dragOffset = this.lastPoint - this.paneBefore.sizeActual - this.originPos - this.paneBefore.position;
if (!this.activeSizing) {
this._showSizingLine();
}
dojo.event.connect(document.documentElement, "onmousemove", this, "changeSizing");
dojo.event.connect(document.documentElement, "onmouseup", this, "endSizing");
dojo.event.browser.stopEvent(e);
}, changeSizing:function (e) {
this.lastPoint = this.isHorizontal ? e.pageX : e.pageY;
if (this.activeSizing) {
this.movePoint();
this._updateSize();
} else {
this.movePoint();
this._moveSizingLine();
}
dojo.event.browser.stopEvent(e);
}, endSizing:function (e) {
if (!this.activeSizing) {
this._hideSizingLine();
}
this._updateSize();
this.isSizing = false;
dojo.event.disconnect(document.documentElement, "onmousemove", this, "changeSizing");
dojo.event.disconnect(document.documentElement, "onmouseup", this, "endSizing");
if (this.persist) {
this._saveState(this);
}
}, movePoint:function () {
var p = this.lastPoint - this.screenToClientOffset;
var a = p - this.dragOffset;
a = this.legaliseSplitPoint(a);
p = a + this.dragOffset;
this.lastPoint = p + this.screenToClientOffset;
}, legaliseSplitPoint:function (a) {
a += this.sizingSplitter.position;
this.isDraggingLeft = (a > 0) ? true : false;
if (!this.activeSizing) {
if (a < this.paneBefore.position + this.paneBefore.sizeMin) {
a = this.paneBefore.position + this.paneBefore.sizeMin;
}
if (a > this.paneAfter.position + (this.paneAfter.sizeActual - (this.sizerWidth + this.paneAfter.sizeMin))) {
a = this.paneAfter.position + (this.paneAfter.sizeActual - (this.sizerWidth + this.paneAfter.sizeMin));
}
}
a -= this.sizingSplitter.position;
this._checkSizes();
return a;
}, _updateSize:function () {
var pos = this.lastPoint - this.dragOffset - this.originPos;
var start_region = this.paneBefore.position;
var end_region = this.paneAfter.position + this.paneAfter.sizeActual;
this.paneBefore.sizeActual = pos - start_region;
this.paneAfter.position = pos + this.sizerWidth;
this.paneAfter.sizeActual = end_region - this.paneAfter.position;
for (var i = 0; i < this.children.length; i++) {
this.children[i].sizeShare = this.children[i].sizeActual;
}
this._layoutPanels();
}, _showSizingLine:function () {
this._moveSizingLine();
if (this.isHorizontal) {
dojo.html.setMarginBox(this.virtualSizer, {width:this.sizerWidth, height:this.paneHeight});
} else {
dojo.html.setMarginBox(this.virtualSizer, {width:this.paneWidth, height:this.sizerWidth});
}
this.virtualSizer.style.display = "block";
}, _hideSizingLine:function () {
this.virtualSizer.style.display = "none";
}, _moveSizingLine:function () {
var pos = this.lastPoint - this.startPoint + this.sizingSplitter.position;
if (this.isHorizontal) {
this.virtualSizer.style.left = pos + "px";
} else {
var pos = (this.lastPoint - this.startPoint) + this.sizingSplitter.position;
this.virtualSizer.style.top = pos + "px";
}
}, _getCookieName:function (i) {
return this.widgetId + "_" + i;
}, _restoreState:function () {
for (var i = 0; i < this.children.length; i++) {
var cookieName = this._getCookieName(i);
var cookieValue = dojo.io.cookie.getCookie(cookieName);
if (cookieValue != null) {
var pos = parseInt(cookieValue);
if (typeof pos == "number") {
this.children[i].sizeShare = pos;
}
}
}
}, _saveState:function () {
for (var i = 0; i < this.children.length; i++) {
var cookieName = this._getCookieName(i);
dojo.io.cookie.setCookie(cookieName, this.children[i].sizeShare, null, null, null, null);
}
}});
dojo.lang.extend(dojo.widget.Widget, {sizeMin:10, sizeShare:10});
dojo.widget.defineWidget("dojo.widget.SplitContainerPanel", dojo.widget.ContentPane, {});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Dialog.js
New file
0,0 → 1,298
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Dialog");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.ContentPane");
dojo.require("dojo.event.*");
dojo.require("dojo.gfx.color");
dojo.require("dojo.html.layout");
dojo.require("dojo.html.display");
dojo.require("dojo.html.iframe");
dojo.declare("dojo.widget.ModalDialogBase", null, {isContainer:true, focusElement:"", bgColor:"black", bgOpacity:0.4, followScroll:true, closeOnBackgroundClick:false, trapTabs:function (e) {
if (e.target == this.tabStartOuter) {
if (this._fromTrap) {
this.tabStart.focus();
this._fromTrap = false;
} else {
this._fromTrap = true;
this.tabEnd.focus();
}
} else {
if (e.target == this.tabStart) {
if (this._fromTrap) {
this._fromTrap = false;
} else {
this._fromTrap = true;
this.tabEnd.focus();
}
} else {
if (e.target == this.tabEndOuter) {
if (this._fromTrap) {
this.tabEnd.focus();
this._fromTrap = false;
} else {
this._fromTrap = true;
this.tabStart.focus();
}
} else {
if (e.target == this.tabEnd) {
if (this._fromTrap) {
this._fromTrap = false;
} else {
this._fromTrap = true;
this.tabStart.focus();
}
}
}
}
}
}, clearTrap:function (e) {
var _this = this;
setTimeout(function () {
_this._fromTrap = false;
}, 100);
}, postCreate:function () {
with (this.domNode.style) {
position = "absolute";
zIndex = 999;
display = "none";
overflow = "visible";
}
var b = dojo.body();
b.appendChild(this.domNode);
this.bg = document.createElement("div");
this.bg.className = "dialogUnderlay";
with (this.bg.style) {
position = "absolute";
left = top = "0px";
zIndex = 998;
display = "none";
}
b.appendChild(this.bg);
this.setBackgroundColor(this.bgColor);
this.bgIframe = new dojo.html.BackgroundIframe();
if (this.bgIframe.iframe) {
with (this.bgIframe.iframe.style) {
position = "absolute";
left = top = "0px";
zIndex = 90;
display = "none";
}
}
if (this.closeOnBackgroundClick) {
dojo.event.kwConnect({srcObj:this.bg, srcFunc:"onclick", adviceObj:this, adviceFunc:"onBackgroundClick", once:true});
}
}, uninitialize:function () {
this.bgIframe.remove();
dojo.html.removeNode(this.bg, true);
}, setBackgroundColor:function (color) {
if (arguments.length >= 3) {
color = new dojo.gfx.color.Color(arguments[0], arguments[1], arguments[2]);
} else {
color = new dojo.gfx.color.Color(color);
}
this.bg.style.backgroundColor = color.toString();
return this.bgColor = color;
}, setBackgroundOpacity:function (op) {
if (arguments.length == 0) {
op = this.bgOpacity;
}
dojo.html.setOpacity(this.bg, op);
try {
this.bgOpacity = dojo.html.getOpacity(this.bg);
}
catch (e) {
this.bgOpacity = op;
}
return this.bgOpacity;
}, _sizeBackground:function () {
if (this.bgOpacity > 0) {
var viewport = dojo.html.getViewport();
var h = viewport.height;
var w = viewport.width;
with (this.bg.style) {
width = w + "px";
height = h + "px";
}
var scroll_offset = dojo.html.getScroll().offset;
this.bg.style.top = scroll_offset.y + "px";
this.bg.style.left = scroll_offset.x + "px";
var viewport = dojo.html.getViewport();
if (viewport.width != w) {
this.bg.style.width = viewport.width + "px";
}
if (viewport.height != h) {
this.bg.style.height = viewport.height + "px";
}
}
this.bgIframe.size(this.bg);
}, _showBackground:function () {
if (this.bgOpacity > 0) {
this.bg.style.display = "block";
}
if (this.bgIframe.iframe) {
this.bgIframe.iframe.style.display = "block";
}
}, placeModalDialog:function () {
var scroll_offset = dojo.html.getScroll().offset;
var viewport_size = dojo.html.getViewport();
var mb;
if (this.isShowing()) {
mb = dojo.html.getMarginBox(this.domNode);
} else {
dojo.html.setVisibility(this.domNode, false);
dojo.html.show(this.domNode);
mb = dojo.html.getMarginBox(this.domNode);
dojo.html.hide(this.domNode);
dojo.html.setVisibility(this.domNode, true);
}
var x = scroll_offset.x + (viewport_size.width - mb.width) / 2;
var y = scroll_offset.y + (viewport_size.height - mb.height) / 2;
with (this.domNode.style) {
left = x + "px";
top = y + "px";
}
}, _onKey:function (evt) {
if (evt.key) {
var node = evt.target;
while (node != null) {
if (node == this.domNode) {
return;
}
node = node.parentNode;
}
if (evt.key != evt.KEY_TAB) {
dojo.event.browser.stopEvent(evt);
} else {
if (!dojo.render.html.opera) {
try {
this.tabStart.focus();
}
catch (e) {
}
}
}
}
}, showModalDialog:function () {
if (this.followScroll && !this._scrollConnected) {
this._scrollConnected = true;
dojo.event.connect(window, "onscroll", this, "_onScroll");
}
dojo.event.connect(document.documentElement, "onkey", this, "_onKey");
this.placeModalDialog();
this.setBackgroundOpacity();
this._sizeBackground();
this._showBackground();
this._fromTrap = true;
setTimeout(dojo.lang.hitch(this, function () {
try {
this.tabStart.focus();
}
catch (e) {
}
}), 50);
}, hideModalDialog:function () {
if (this.focusElement) {
dojo.byId(this.focusElement).focus();
dojo.byId(this.focusElement).blur();
}
this.bg.style.display = "none";
this.bg.style.width = this.bg.style.height = "1px";
if (this.bgIframe.iframe) {
this.bgIframe.iframe.style.display = "none";
}
dojo.event.disconnect(document.documentElement, "onkey", this, "_onKey");
if (this._scrollConnected) {
this._scrollConnected = false;
dojo.event.disconnect(window, "onscroll", this, "_onScroll");
}
}, _onScroll:function () {
var scroll_offset = dojo.html.getScroll().offset;
this.bg.style.top = scroll_offset.y + "px";
this.bg.style.left = scroll_offset.x + "px";
this.placeModalDialog();
}, checkSize:function () {
if (this.isShowing()) {
this._sizeBackground();
this.placeModalDialog();
this.onResized();
}
}, onBackgroundClick:function () {
if (this.lifetime - this.timeRemaining >= this.blockDuration) {
return;
}
this.hide();
}});
dojo.widget.defineWidget("dojo.widget.Dialog", [dojo.widget.ContentPane, dojo.widget.ModalDialogBase], {templateString:"<div id=\"${this.widgetId}\" class=\"dojoDialog\" dojoattachpoint=\"wrapper\">\n\t<span dojoattachpoint=\"tabStartOuter\" dojoonfocus=\"trapTabs\" dojoonblur=\"clearTrap\"\ttabindex=\"0\"></span>\n\t<span dojoattachpoint=\"tabStart\" dojoonfocus=\"trapTabs\" dojoonblur=\"clearTrap\" tabindex=\"0\"></span>\n\t<div dojoattachpoint=\"containerNode\" style=\"position: relative; z-index: 2;\"></div>\n\t<span dojoattachpoint=\"tabEnd\" dojoonfocus=\"trapTabs\" dojoonblur=\"clearTrap\" tabindex=\"0\"></span>\n\t<span dojoattachpoint=\"tabEndOuter\" dojoonfocus=\"trapTabs\" dojoonblur=\"clearTrap\" tabindex=\"0\"></span>\n</div>\n", blockDuration:0, lifetime:0, closeNode:"", postMixInProperties:function () {
dojo.widget.Dialog.superclass.postMixInProperties.apply(this, arguments);
if (this.closeNode) {
this.setCloseControl(this.closeNode);
}
}, postCreate:function () {
dojo.widget.Dialog.superclass.postCreate.apply(this, arguments);
dojo.widget.ModalDialogBase.prototype.postCreate.apply(this, arguments);
}, show:function () {
if (this.lifetime) {
this.timeRemaining = this.lifetime;
if (this.timerNode) {
this.timerNode.innerHTML = Math.ceil(this.timeRemaining / 1000);
}
if (this.blockDuration && this.closeNode) {
if (this.lifetime > this.blockDuration) {
this.closeNode.style.visibility = "hidden";
} else {
this.closeNode.style.display = "none";
}
}
if (this.timer) {
clearInterval(this.timer);
}
this.timer = setInterval(dojo.lang.hitch(this, "_onTick"), 100);
}
this.showModalDialog();
dojo.widget.Dialog.superclass.show.call(this);
}, onLoad:function () {
this.placeModalDialog();
dojo.widget.Dialog.superclass.onLoad.call(this);
}, fillInTemplate:function () {
}, hide:function () {
this.hideModalDialog();
dojo.widget.Dialog.superclass.hide.call(this);
if (this.timer) {
clearInterval(this.timer);
}
}, setTimerNode:function (node) {
this.timerNode = node;
}, setCloseControl:function (node) {
this.closeNode = dojo.byId(node);
dojo.event.connect(this.closeNode, "onclick", this, "hide");
}, setShowControl:function (node) {
node = dojo.byId(node);
dojo.event.connect(node, "onclick", this, "show");
}, _onTick:function () {
if (this.timer) {
this.timeRemaining -= 100;
if (this.lifetime - this.timeRemaining >= this.blockDuration) {
if (this.closeNode) {
this.closeNode.style.visibility = "visible";
}
}
if (!this.timeRemaining) {
clearInterval(this.timer);
this.hide();
} else {
if (this.timerNode) {
this.timerNode.innerHTML = Math.ceil(this.timeRemaining / 1000);
}
}
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/DropdownContainer.js
New file
0,0 → 1,63
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.DropdownContainer");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.PopupContainer");
dojo.require("dojo.event.*");
dojo.require("dojo.html.layout");
dojo.require("dojo.html.display");
dojo.require("dojo.html.iframe");
dojo.require("dojo.html.util");
dojo.widget.defineWidget("dojo.widget.DropdownContainer", dojo.widget.HtmlWidget, {inputWidth:"7em", id:"", inputId:"", inputName:"", iconURL:dojo.uri.moduleUri("dojo.widget", "templates/images/combo_box_arrow.png"), copyClasses:false, iconAlt:"", containerToggle:"plain", containerToggleDuration:150, templateString:"<span style=\"white-space:nowrap\"><input type=\"hidden\" name=\"\" value=\"\" dojoAttachPoint=\"valueNode\" /><input name=\"\" type=\"text\" value=\"\" style=\"vertical-align:middle;\" dojoAttachPoint=\"inputNode\" autocomplete=\"off\" /> <img src=\"${this.iconURL}\" alt=\"${this.iconAlt}\" dojoAttachEvent=\"onclick:onIconClick\" dojoAttachPoint=\"buttonNode\" style=\"vertical-align:middle; cursor:pointer; cursor:hand\" /></span>", templateCssPath:"", isContainer:true, attachTemplateNodes:function () {
dojo.widget.DropdownContainer.superclass.attachTemplateNodes.apply(this, arguments);
this.popup = dojo.widget.createWidget("PopupContainer", {toggle:this.containerToggle, toggleDuration:this.containerToggleDuration});
this.containerNode = this.popup.domNode;
}, fillInTemplate:function (args, frag) {
this.domNode.appendChild(this.popup.domNode);
if (this.id) {
this.domNode.id = this.id;
}
if (this.inputId) {
this.inputNode.id = this.inputId;
}
if (this.inputName) {
this.inputNode.name = this.inputName;
}
this.inputNode.style.width = this.inputWidth;
this.inputNode.disabled = this.disabled;
if (this.copyClasses) {
this.inputNode.style = "";
this.inputNode.className = this.getFragNodeRef(frag).className;
}
dojo.event.connect(this.inputNode, "onchange", this, "onInputChange");
}, onIconClick:function (evt) {
if (this.disabled) {
return;
}
if (!this.popup.isShowingNow) {
this.popup.open(this.inputNode, this, this.buttonNode);
} else {
this.popup.close();
}
}, hideContainer:function () {
if (this.popup.isShowingNow) {
this.popup.close();
}
}, onInputChange:function () {
}, enable:function () {
this.inputNode.disabled = false;
dojo.widget.DropdownContainer.superclass.enable.apply(this, arguments);
}, disable:function () {
this.inputNode.disabled = true;
dojo.widget.DropdownContainer.superclass.disable.apply(this, arguments);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Rounded.js
New file
0,0 → 1,527
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Rounded");
dojo.widget.tags.addParseTreeHandler("dojo:rounded");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.ContentPane");
dojo.require("dojo.html.style");
dojo.require("dojo.html.display");
dojo.require("dojo.gfx.color");
dojo.deprecated("dojo.widget.Rounded will be removed in version 0.5; you can now apply rounded corners to any block element using dojo.lfx.rounded.", "0.5");
dojo.widget.defineWidget("dojo.widget.Rounded", dojo.widget.ContentPane, {isSafari:dojo.render.html.safari, boxMargin:"50px", radius:14, domNode:"", corners:"TR,TL,BR,BL", antiAlias:true, fillInTemplate:function (args, frag) {
dojo.widget.Rounded.superclass.fillInTemplate.call(this, args, frag);
dojo.html.insertCssFile(this.templateCssPath);
if (this.domNode.style.height <= 0) {
var minHeight = (this.radius * 1) + this.domNode.clientHeight;
this.domNode.style.height = minHeight + "px";
}
if (this.domNode.style.width <= 0) {
var minWidth = (this.radius * 1) + this.domNode.clientWidth;
this.domNode.style.width = minWidth + "px";
}
var cornersAvailable = ["TR", "TL", "BR", "BL"];
var cornersPassed = this.corners.split(",");
this.settings = {antiAlias:this.antiAlias};
var setCorner = function (currentCorner) {
var val = currentCorner.toLowerCase();
if (dojo.lang.inArray(cornersPassed, currentCorner)) {
this.settings[val] = {radius:this.radius, enabled:true};
} else {
this.settings[val] = {radius:0};
}
};
dojo.lang.forEach(cornersAvailable, setCorner, this);
this.domNode.style.margin = this.boxMargin;
this.curvyCorners(this.settings);
this.applyCorners();
}, curvyCorners:function (settings) {
this.box = this.domNode;
this.topContainer = null;
this.bottomContainer = null;
this.masterCorners = [];
var boxHeight = dojo.html.getStyle(this.box, "height");
if (boxHeight == "") {
boxHeight = "0px";
}
var boxWidth = dojo.html.getStyle(this.box, "width");
var borderWidth = dojo.html.getStyle(this.box, "borderTopWidth");
if (borderWidth == "") {
borderWidth = "0px";
}
var borderColour = dojo.html.getStyle(this.box, "borderTopColor");
if (borderWidth > 0) {
this.antiAlias = true;
}
var boxColour = dojo.html.getStyle(this.box, "backgroundColor");
var backgroundImage = dojo.html.getStyle(this.box, "backgroundImage");
var boxPosition = dojo.html.getStyle(this.box, "position");
this.boxHeight = parseInt(((boxHeight != "" && boxHeight != "auto" && boxHeight.indexOf("%") == -1) ? boxHeight.substring(0, boxHeight.indexOf("px")) : this.box.scrollHeight));
this.boxWidth = parseInt(((boxWidth != "" && boxWidth != "auto" && boxWidth.indexOf("%") == -1) ? boxWidth.substring(0, boxWidth.indexOf("px")) : this.box.scrollWidth));
this.borderWidth = parseInt(((borderWidth != "" && borderWidth.indexOf("px") !== -1) ? borderWidth.slice(0, borderWidth.indexOf("px")) : 0));
var test = new dojo.gfx.color.Color(boxColour);
this.boxColour = ((boxColour != "" && boxColour != "transparent") ? ((boxColour.substr(0, 3) == "rgb") ? this.rgb2Hex(boxColour) : boxColour) : "#ffffff");
this.borderColour = ((borderColour != "" && borderColour != "transparent" && this.borderWidth > 0) ? ((borderColour.substr(0, 3) == "rgb") ? this.rgb2Hex(borderColour) : borderColour) : this.boxColour);
this.borderString = this.borderWidth + "px" + " solid " + this.borderColour;
this.backgroundImage = ((backgroundImage != "none") ? backgroundImage : "");
if (boxPosition != "absolute") {
this.box.style.position = "relative";
}
this.applyCorners = function () {
for (var t = 0; t < 2; t++) {
switch (t) {
case 0:
if (this.settings.tl.enabled || this.settings.tr.enabled) {
var newMainContainer = document.createElement("DIV");
with (newMainContainer.style) {
width = "100%";
fontSize = "1px";
overflow = "hidden";
position = "absolute";
paddingLeft = this.borderWidth + "px";
paddingRight = this.borderWidth + "px";
var topMaxRadius = Math.max(this.settings.tl ? this.settings.tl.radius : 0, this.settings.tr ? this.settings.tr.radius : 0);
height = topMaxRadius + "px";
top = 0 - topMaxRadius + "px";
left = 0 - this.borderWidth + "px";
}
this.topContainer = this.box.appendChild(newMainContainer);
}
break;
case 1:
if (this.settings.bl.enabled || this.settings.br.enabled) {
var newMainContainer = document.createElement("DIV");
with (newMainContainer.style) {
width = "100%";
fontSize = "1px";
overflow = "hidden";
position = "absolute";
paddingLeft = this.borderWidth + "px";
paddingRight = this.borderWidth + "px";
var botMaxRadius = Math.max(this.settings.bl ? this.settings.bl.radius : 0, this.settings.br ? this.settings.br.radius : 0);
height = botMaxRadius + "px";
bottom = 0 - botMaxRadius + "px";
left = 0 - this.borderWidth + "px";
}
this.bottomContainer = this.box.appendChild(newMainContainer);
}
break;
}
}
if (this.topContainer) {
this.box.style.borderTopWidth = "0px";
}
if (this.bottomContainer) {
this.box.style.borderBottomWidth = "0px";
}
var corners = ["tr", "tl", "br", "bl"];
for (var i in corners) {
var cc = corners[i];
if (!this.settings[cc]) {
if (((cc == "tr" || cc == "tl") && this.topContainer != null) || ((cc == "br" || cc == "bl") && this.bottomContainer != null)) {
var newCorner = document.createElement("DIV");
newCorner.style.position = "relative";
newCorner.style.fontSize = "1px";
newCorner.style.overflow = "hidden";
if (this.backgroundImage == "") {
newCorner.style.backgroundColor = this.boxColour;
} else {
newCorner.style.backgroundImage = this.backgroundImage;
}
switch (cc) {
case "tl":
with (newCorner.style) {
height = topMaxRadius - this.borderWidth + "px";
marginRight = this.settings.tr.radius - (this.borderWidth * 2) + "px";
borderLeft = this.borderString;
borderTop = this.borderString;
left = -this.borderWidth + "px";
}
break;
case "tr":
with (newCorner.style) {
height = topMaxRadius - this.borderWidth + "px";
marginLeft = this.settings.tl.radius - (this.borderWidth * 2) + "px";
borderRight = this.borderString;
borderTop = this.borderString;
backgroundPosition = "-" + this.boxWidth + "px 0px";
left = this.borderWidth + "px";
}
break;
case "bl":
with (newCorner.style) {
height = botMaxRadius - this.borderWidth + "px";
marginRight = this.settings.br.radius - (this.borderWidth * 2) + "px";
borderLeft = this.borderString;
borderBottom = this.borderString;
left = -this.borderWidth + "px";
}
break;
case "br":
with (newCorner.style) {
height = botMaxRadius - this.borderWidth + "px";
marginLeft = this.settings.bl.radius - (this.borderWidth * 2) + "px";
borderRight = this.borderString;
borderBottom = this.borderString;
left = this.borderWidth + "px";
}
break;
}
}
} else {
if (this.masterCorners[this.settings[cc].radius]) {
var newCorner = this.masterCorners[this.settings[cc].radius].cloneNode(true);
} else {
var newCorner = document.createElement("DIV");
with (newCorner.style) {
height = this.settings[cc].radius + "px";
width = this.settings[cc].radius + "px";
position = "absolute";
fontSize = "1px";
overflow = "hidden";
}
var borderRadius = parseInt(this.settings[cc].radius - this.borderWidth);
for (var intx = 0, j = this.settings[cc].radius; intx < j; intx++) {
if ((intx + 1) >= borderRadius) {
var y1 = -1;
} else {
var y1 = (Math.floor(Math.sqrt(Math.pow(borderRadius, 2) - Math.pow((intx + 1), 2))) - 1);
}
if (borderRadius != j) {
if ((intx) >= borderRadius) {
var y2 = -1;
} else {
var y2 = Math.ceil(Math.sqrt(Math.pow(borderRadius, 2) - Math.pow(intx, 2)));
}
if ((intx + 1) >= j) {
var y3 = -1;
} else {
var y3 = (Math.floor(Math.sqrt(Math.pow(j, 2) - Math.pow((intx + 1), 2))) - 1);
}
}
if ((intx) >= j) {
var y4 = -1;
} else {
var y4 = Math.ceil(Math.sqrt(Math.pow(j, 2) - Math.pow(intx, 2)));
}
if (y1 > -1) {
this.drawPixel(intx, 0, this.boxColour, 100, (y1 + 1), newCorner, -1, this.settings[cc].radius);
}
if (borderRadius != j) {
if (this.antiAlias) {
for (var inty = (y1 + 1); inty < y2; inty++) {
if (this.backgroundImage != "") {
var borderFract = (this.pixelFraction(intx, inty, borderRadius) * 100);
if (borderFract < 30) {
this.drawPixel(intx, inty, this.borderColour, 100, 1, newCorner, 0, this.settings[cc].radius);
} else {
this.drawPixel(intx, inty, this.borderColour, 100, 1, newCorner, -1, this.settings[cc].radius);
}
} else {
var pixelcolour = dojo.gfx.color.blend(this.boxColour, this.borderColour, this.pixelFraction(intx, inty, borderRadius));
this.drawPixel(intx, inty, pixelcolour, 100, 1, newCorner, 0, this.settings[cc].radius);
}
}
}
if (y3 >= y2) {
if (y1 == -1) {
y1 = 0;
}
this.drawPixel(intx, y2, this.borderColour, 100, (y3 - y2 + 1), newCorner, 0, this.settings[cc].radius);
}
var outsideColour = this.borderColour;
} else {
var outsideColour = this.boxColour;
var y3 = y1;
}
if (this.antiAlias) {
for (var inty = (y3 + 1); inty < y4; inty++) {
this.drawPixel(intx, inty, outsideColour, (this.pixelFraction(intx, inty, j) * 100), 1, newCorner, ((this.borderWidth > 0) ? 0 : -1), this.settings[cc].radius);
}
}
}
this.masterCorners[this.settings[cc].radius] = newCorner.cloneNode(true);
}
if (cc != "br") {
for (var t = 0, k = newCorner.childNodes.length; t < k; t++) {
var pixelBar = newCorner.childNodes[t];
var pixelBarTop = parseInt(pixelBar.style.top.substring(0, pixelBar.style.top.indexOf("px")));
var pixelBarLeft = parseInt(pixelBar.style.left.substring(0, pixelBar.style.left.indexOf("px")));
var pixelBarHeight = parseInt(pixelBar.style.height.substring(0, pixelBar.style.height.indexOf("px")));
if (cc == "tl" || cc == "bl") {
pixelBar.style.left = this.settings[cc].radius - pixelBarLeft - 1 + "px";
}
if (cc == "tr" || cc == "tl") {
pixelBar.style.top = this.settings[cc].radius - pixelBarHeight - pixelBarTop + "px";
}
var value;
switch (cc) {
case "tr":
value = (-1 * (Math.abs((this.boxWidth - this.settings[cc].radius + this.borderWidth) + pixelBarLeft) - (Math.abs(this.settings[cc].radius - pixelBarHeight - pixelBarTop - this.borderWidth))));
pixelBar.style.backgroundPosition = value + "px";
break;
case "tl":
value = (-1 * (Math.abs((this.settings[cc].radius - pixelBarLeft - 1) - this.borderWidth) - (Math.abs(this.settings[cc].radius - pixelBarHeight - pixelBarTop - this.borderWidth))));
pixelBar.style.backgroundPosition = value + "px";
break;
case "bl":
value = (-1 * (Math.abs((this.settings[cc].radius - pixelBarLeft - 1) - this.borderWidth) - (Math.abs((this.boxHeight + this.settings[cc].radius + pixelBarTop) - this.borderWidth))));
pixelBar.style.backgroundPosition = value + "px";
break;
}
}
}
}
if (newCorner) {
switch (cc) {
case "tl":
if (newCorner.style.position == "absolute") {
newCorner.style.top = "0px";
}
if (newCorner.style.position == "absolute") {
newCorner.style.left = "0px";
}
if (this.topContainer) {
this.topContainer.appendChild(newCorner);
}
break;
case "tr":
if (newCorner.style.position == "absolute") {
newCorner.style.top = "0px";
}
if (newCorner.style.position == "absolute") {
newCorner.style.right = "0px";
}
if (this.topContainer) {
this.topContainer.appendChild(newCorner);
}
break;
case "bl":
if (newCorner.style.position == "absolute") {
newCorner.style.bottom = "0px";
}
if (newCorner.style.position == "absolute") {
newCorner.style.left = "0px";
}
if (this.bottomContainer) {
this.bottomContainer.appendChild(newCorner);
}
break;
case "br":
if (newCorner.style.position == "absolute") {
newCorner.style.bottom = "0px";
}
if (newCorner.style.position == "absolute") {
newCorner.style.right = "0px";
}
if (this.bottomContainer) {
this.bottomContainer.appendChild(newCorner);
}
break;
}
}
}
var radiusDiff = [];
radiusDiff["t"] = this.settings.tl.enabled && this.settings.tr.enabled ? Math.abs(this.settings.tl.radius - this.settings.tr.radius) : 0;
radiusDiff["b"] = this.settings.bl.enabled && this.settings.br.enabled ? Math.abs(this.settings.bl.radius - this.settings.br.radius) : 0;
for (var z in radiusDiff) {
if (radiusDiff[z]) {
var smallerCornerType = ((this.settings[z + "l"].radius < this.settings[z + "r"].radius) ? z + "l" : z + "r");
var newFiller = document.createElement("DIV");
with (newFiller.style) {
height = radiusDiff[z] + "px";
width = this.settings[smallerCornerType].radius + "px";
position = "absolute";
fontSize = "1px";
overflow = "hidden";
backgroundColor = this.boxColour;
}
switch (smallerCornerType) {
case "tl":
with (newFiller.style) {
bottom = "0px";
left = "0px";
borderLeft = this.borderString;
}
this.topContainer.appendChild(newFiller);
break;
case "tr":
with (newFiller.style) {
bottom = "0px";
right = "0px";
borderRight = this.borderString;
}
this.topContainer.appendChild(newFiller);
break;
case "bl":
with (newFiller.style) {
top = "0px";
left = "0px";
borderLeft = this.borderString;
}
this.bottomContainer.appendChild(newFiller);
break;
case "br":
with (newFiller.style) {
top = "0px";
right = "0px";
borderRight = this.borderString;
}
this.bottomContainer.appendChild(newFiller);
break;
}
}
var newFillerBar = document.createElement("DIV");
with (newFillerBar.style) {
position = "relative";
fontSize = "1px";
overflow = "hidden";
backgroundColor = this.boxColour;
}
switch (z) {
case "t":
if (this.topContainer) {
with (newFillerBar.style) {
height = topMaxRadius - this.borderWidth + "px";
marginLeft = this.settings.tl.radius - this.borderWidth + "px";
marginRight = this.settings.tr.radius - this.borderWidth + "px";
borderTop = this.borderString;
}
this.topContainer.appendChild(newFillerBar);
}
break;
case "b":
if (this.bottomContainer) {
with (newFillerBar.style) {
height = botMaxRadius - this.borderWidth + "px";
marginLeft = this.settings.bl.radius - this.borderWidth + "px";
marginRight = this.settings.br.radius - this.borderWidth + "px";
borderBottom = this.borderString;
}
this.bottomContainer.appendChild(newFillerBar);
}
break;
}
}
};
this.drawPixel = function (intx, inty, colour, transAmount, height, newCorner, image, cornerRadius) {
var pixel = document.createElement("DIV");
pixel.style.height = height + "px";
pixel.style.width = "1px";
pixel.style.position = "absolute";
pixel.style.fontSize = "1px";
pixel.style.overflow = "hidden";
if (image == -1 && this.backgroundImage != "") {
pixel.style.backgroundImage = this.backgroundImage;
pixel.style.backgroundPosition = "-" + (this.boxWidth - (cornerRadius - intx) + this.borderWidth) + "px -" + ((this.boxHeight + cornerRadius + inty) - this.borderWidth) + "px";
} else {
pixel.style.backgroundColor = colour;
}
if (transAmount != 100) {
dojo.html.setOpacity(pixel, transAmount);
}
pixel.style.top = inty + "px";
pixel.style.left = intx + "px";
newCorner.appendChild(pixel);
};
}, pixelFraction:function (x, y, r) {
var pixelfraction = 0;
var xvalues = [];
var yvalues = [];
var point = 0;
var whatsides = "";
var intersect = Math.sqrt((Math.pow(r, 2) - Math.pow(x, 2)));
if ((intersect >= y) && (intersect < (y + 1))) {
whatsides = "Left";
xvalues[point] = 0;
yvalues[point] = intersect - y;
point = point + 1;
}
var intersect = Math.sqrt((Math.pow(r, 2) - Math.pow(y + 1, 2)));
if ((intersect >= x) && (intersect < (x + 1))) {
whatsides = whatsides + "Top";
xvalues[point] = intersect - x;
yvalues[point] = 1;
point = point + 1;
}
var intersect = Math.sqrt((Math.pow(r, 2) - Math.pow(x + 1, 2)));
if ((intersect >= y) && (intersect < (y + 1))) {
whatsides = whatsides + "Right";
xvalues[point] = 1;
yvalues[point] = intersect - y;
point = point + 1;
}
var intersect = Math.sqrt((Math.pow(r, 2) - Math.pow(y, 2)));
if ((intersect >= x) && (intersect < (x + 1))) {
whatsides = whatsides + "Bottom";
xvalues[point] = intersect - x;
yvalues[point] = 0;
}
switch (whatsides) {
case "LeftRight":
pixelfraction = Math.min(yvalues[0], yvalues[1]) + ((Math.max(yvalues[0], yvalues[1]) - Math.min(yvalues[0], yvalues[1])) / 2);
break;
case "TopRight":
pixelfraction = 1 - (((1 - xvalues[0]) * (1 - yvalues[1])) / 2);
break;
case "TopBottom":
pixelfraction = Math.min(xvalues[0], xvalues[1]) + ((Math.max(xvalues[0], xvalues[1]) - Math.min(xvalues[0], xvalues[1])) / 2);
break;
case "LeftBottom":
pixelfraction = (yvalues[0] * xvalues[1]) / 2;
break;
default:
pixelfraction = 1;
}
return pixelfraction;
}, rgb2Hex:function (rgbColour) {
try {
var rgbArray = this.rgb2Array(rgbColour);
var red = parseInt(rgbArray[0]);
var green = parseInt(rgbArray[1]);
var blue = parseInt(rgbArray[2]);
var hexColour = "#" + this.intToHex(red) + this.intToHex(green) + this.intToHex(blue);
}
catch (e) {
alert("There was an error converting the RGB value to Hexadecimal in function rgb2Hex");
}
return hexColour;
}, intToHex:function (strNum) {
var base = strNum / 16;
var rem = strNum % 16;
var base = base - (rem / 16);
var baseS = this.makeHex(base);
var remS = this.makeHex(rem);
return baseS + "" + remS;
}, makeHex:function (x) {
if ((x >= 0) && (x <= 9)) {
return x;
} else {
switch (x) {
case 10:
return "A";
case 11:
return "B";
case 12:
return "C";
case 13:
return "D";
case 14:
return "E";
case 15:
return "F";
}
}
}, rgb2Array:function (rgbColour) {
var rgbValues = rgbColour.substring(4, rgbColour.indexOf(")"));
var rgbArray = rgbValues.split(", ");
return rgbArray;
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/ShowSlide.js
New file
0,0 → 1,199
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.ShowSlide");
dojo.require("dojo.widget.*");
dojo.require("dojo.lang.common");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.lfx.html");
dojo.require("dojo.html.display");
dojo.require("dojo.html.layout");
dojo.require("dojo.animation.Animation");
dojo.require("dojo.gfx.color");
dojo.widget.defineWidget("dojo.widget.ShowSlide", dojo.widget.HtmlWidget, {title:"", _action:-1, isContainer:true, _components:{}, _actions:[], gotoAction:function (action) {
this._action = action;
}, _nextAction:function (event) {
if ((this._action + 1) != this._actions.length) {
++this._action;
return true;
}
return false;
}, _previousAction:function (event) {
if ((this._action - 1) != -1) {
--this._action;
return true;
}
return false;
}, htmlTitle:null, debug:false, noClick:false, templateString:"<div class=\"dojoShowSlide\">\n\t<div class=\"dojoShowSlideTitle\">\n\t\t<h1 dojoAttachPoint=\"htmlTitle\">Title</h1>\n\t</div>\n\t<div class=\"dojoShowSlideBody\" dojoAttachPoint=\"containerNode\"></div>\n</div>\n", templateCssString:".dojoShowSlideTitle {\n\theight: 100px;\n\tbackground: #369;\n}\n.dojoShowSlideTitle h1 {\n\tmargin-top: 0;\n\tline-height: 100px;\n\tmargin-left: 30px;\n}\n.dojoShowSlideBody {\n\tmargin: 15px;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/ShowSlide.css"), postCreate:function () {
this.htmlTitle.innerHTML = this.title;
var actions = this.getChildrenOfType("ShowAction", false);
var atypes = {};
dojo.lang.forEach(actions, function (act) {
atypes[act.on] = true;
});
this._components = {};
var cn = this.containerNode;
var nodes = dojo.render.html.ie ? cn.all : cn.getElementsByTagName("*");
dojo.lang.forEach(nodes, function (node) {
var as = node.getAttribute("as");
if (as) {
if (!this._components[as]) {
this._components[as] = [];
}
this._components[as].push(node);
if (!atypes[as]) {
var tmpAction = dojo.widget.createWidget("ShowAction", {on:as});
this.addChild(tmpAction);
atypes[as] = true;
}
}
}, this);
this._actions = [];
actions = this.getChildrenOfType("ShowAction", false);
dojo.lang.forEach(actions, function (child) {
this._actions.push(child);
var components = this._components[child.on];
for (var j = 0, component; component = components[j]; j++) {
if (child["action"] && ((child.action != "remove") && (child.action != "fadeout") && (child.action != "wipeout"))) {
this.hideComponent(component);
}
}
}, this);
}, previousAction:function (event) {
if (!this.parent.stopEvent(event)) {
return false;
}
var action = this._actions[this._action];
if (!action) {
return false;
}
var on = action.on;
while (action.on == on) {
var components = this._components[on];
for (var i = 0, component; component = components[i]; i++) {
if ((action.action == "remove") || (action.action == "fadeout") || (action.action == "wipeout")) {
if (component.style.display == "none") {
component.style.display = "";
component.style.visibility = "visible";
var exits = true;
}
dojo.html.setOpacity(component, 1);
} else {
if (action.action) {
this.hideComponent(component);
}
}
}
--this._action;
if (exits) {
return true;
}
if (action.auto == "true") {
on = this._actions[this._action].on;
}
action = this._actions[this._action];
if (!action) {
return false;
}
}
return true;
}, hideComponent:function (component) {
component.style.visibility = "hidden";
component.style.backgroundColor = "transparent";
var parent = component.parentNode;
if ((parent) && (parent.tagName.toLowerCase() == "li")) {
parent.oldType = parent.style.listStyleType;
parent.style.listStyleType = "none";
}
}, nextAction:function (event) {
if (!this.parent.stopEvent(event)) {
return false;
}
if (!this._nextAction(this)) {
return false;
}
var action = this._actions[this._action];
if (!action) {
return false;
}
var tmpAction = action["action"];
var components = this._components[action.on];
for (var i = 0, component; component = components[i]; i++) {
if (tmpAction) {
var duration = action.duration || 1000;
if ((tmpAction == "fade") || (tmpAction == "fadeIn")) {
dojo.html.setOpacity(component, 0);
dojo.lfx.html.fadeShow(component, duration).play(true);
} else {
if (tmpAction == "fadeout") {
dojo.lfx.html.fadeHide(component, duration).play(true);
} else {
if (tmpAction == "fly") {
var width = dojo.html.getMarginBox(component).width;
var position = dojo.html.getAbsolutePosition(component);
component.style.position = "relative";
component.style.left = -(width + position.x) + "px";
dojo.lfx.html.slideBy(component, {top:0, left:(width + position.x)}, duration, -1, this.callWith).play(true);
} else {
if ((tmpAction == "wipe") || (tmpAction == "wipein")) {
dojo.lfx.html.wipeIn(component, duration).play();
} else {
if (tmpAction == "wipeout") {
dojo.lfx.html.wipeOut(component, duration).play();
} else {
if (tmpAction == "color") {
var from = new dojo.gfx.color.Color(action.from).toRgb();
var to = new dojo.gfx.color.Color(action.to).toRgb();
var anim = new dojo.animation.Animation(new dojo.math.curves.Line(from, to), duration, 0);
var node = component;
dojo.event.connect(anim, "onAnimate", function (e) {
node.style.color = "rgb(" + e.coordsAsInts().join(",") + ")";
});
anim.play(true);
} else {
if (tmpAction == "bgcolor") {
dojo.lfx.html.unhighlight(component, action.to, duration).play();
} else {
if (tmpAction == "remove") {
component.style.display = "none";
}
}
}
}
}
}
}
}
if (tmpAction == "hide") {
component.style.visibility = "hidden";
} else {
component.style.visibility = "visible";
}
}
}
action = this._actions[this._action + 1];
if (action && action.auto == "true") {
this.nextAction();
}
return true;
}, callWith:function (node) {
if (!node) {
return;
}
if (dojo.lang.isArray(node)) {
dojo.lang.forEach(node, arguments.callee);
return;
}
var parent = node.parentNode;
if ((parent) && (parent.tagName.toLowerCase() == "li")) {
parent.style.listStyleType = parent.oldType;
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Chart.js
New file
0,0 → 1,231
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Chart");
dojo.require("dojo.widget.*");
dojo.require("dojo.gfx.color");
dojo.require("dojo.gfx.color.hsl");
dojo.declare("dojo.widget.Chart", null, function () {
this.series = [];
}, {isContainer:false, assignColors:function () {
var hue = 30;
var sat = 120;
var lum = 120;
var steps = Math.round(330 / this.series.length);
for (var i = 0; i < this.series.length; i++) {
var c = dojo.gfx.color.hsl2rgb(hue, sat, lum);
if (!this.series[i].color) {
this.series[i].color = dojo.gfx.color.rgb2hex(c[0], c[1], c[2]);
}
hue += steps;
}
}, parseData:function (table) {
var thead = table.getElementsByTagName("thead")[0];
var tbody = table.getElementsByTagName("tbody")[0];
if (!(thead && tbody)) {
dojo.raise("dojo.widget.Chart: supplied table must define a head and a body.");
}
var columns = thead.getElementsByTagName("tr")[0].getElementsByTagName("th");
for (var i = 1; i < columns.length; i++) {
var key = "column" + i;
var label = columns[i].innerHTML;
var plotType = columns[i].getAttribute("plotType") || "line";
var color = columns[i].getAttribute("color");
var ds = new dojo.widget.Chart.DataSeries(key, label, plotType, color);
this.series.push(ds);
}
var rows = tbody.rows;
var xMin = Number.MAX_VALUE, xMax = Number.MIN_VALUE;
var yMin = Number.MAX_VALUE, yMax = Number.MIN_VALUE;
var ignore = ["accesskey", "align", "bgcolor", "class", "colspan", "height", "id", "nowrap", "rowspan", "style", "tabindex", "title", "valign", "width"];
for (var i = 0; i < rows.length; i++) {
var row = rows[i];
var cells = row.cells;
var x = Number.MIN_VALUE;
for (var j = 0; j < cells.length; j++) {
if (j == 0) {
x = parseFloat(cells[j].innerHTML);
xMin = Math.min(xMin, x);
xMax = Math.max(xMax, x);
} else {
var ds = this.series[j - 1];
var y = parseFloat(cells[j].innerHTML);
yMin = Math.min(yMin, y);
yMax = Math.max(yMax, y);
var o = {x:x, value:y};
var attrs = cells[j].attributes;
for (var k = 0; k < attrs.length; k++) {
var attr = attrs.item(k);
var bIgnore = false;
for (var l = 0; l < ignore.length; l++) {
if (attr.nodeName.toLowerCase() == ignore[l]) {
bIgnore = true;
break;
}
}
if (!bIgnore) {
o[attr.nodeName] = attr.nodeValue;
}
}
ds.add(o);
}
}
}
return {x:{min:xMin, max:xMax}, y:{min:yMin, max:yMax}};
}});
dojo.declare("dojo.widget.Chart.DataSeries", null, function (key, label, plotType, color) {
this.id = "DataSeries" + dojo.widget.Chart.DataSeries.count++;
this.key = key;
this.label = label || this.id;
this.plotType = plotType || "line";
this.color = color;
this.values = [];
}, {add:function (v) {
if (v.x == null || v.value == null) {
dojo.raise("dojo.widget.Chart.DataSeries.add: v must have both an 'x' and 'value' property.");
}
this.values.push(v);
}, clear:function () {
this.values = [];
}, createRange:function (len) {
var idx = this.values.length - 1;
var length = (len || this.values.length);
return {"index":idx, "length":length, "start":Math.max(idx - length, 0)};
}, getMean:function (len) {
var range = this.createRange(len);
if (range.index < 0) {
return 0;
}
var t = 0;
var c = 0;
for (var i = range.index; i >= range.start; i--) {
var n = parseFloat(this.values[i].value);
if (!isNaN(n)) {
t += n;
c++;
}
}
t /= Math.max(c, 1);
return t;
}, getMovingAverage:function (len) {
var range = this.createRange(len);
if (range.index < 0) {
return 0;
}
var t = 0;
var c = 0;
for (var i = range.index; i >= range.start; i--) {
var n = parseFloat(this.values[i].value);
if (!isNaN(n)) {
t += n;
c++;
}
}
t /= Math.max(c, 1);
return t;
}, getVariance:function (len) {
var range = this.createRange(len);
if (range.index < 0) {
return 0;
}
var t = 0;
var s = 0;
var c = 0;
for (var i = range.index; i >= range.start; i--) {
var n = parseFloat(this.values[i].value);
if (!isNaN(n)) {
t += n;
s += Math.pow(n, 2);
c++;
}
}
return (s / c) - Math.pow(t / c, 2);
}, getStandardDeviation:function (len) {
return Math.sqrt(this.getVariance(len));
}, getMax:function (len) {
var range = this.createRange(len);
if (range.index < 0) {
return 0;
}
var t = 0;
for (var i = range.index; i >= range.start; i--) {
var n = parseFloat(this.values[i].value);
if (!isNaN(n)) {
t = Math.max(n, t);
}
}
return t;
}, getMin:function (len) {
var range = this.createRange(len);
if (range.index < 0) {
return 0;
}
var t = 0;
for (var i = range.index; i >= range.start; i--) {
var n = parseFloat(this.values[i].value);
if (!isNaN(n)) {
t = Math.min(n, t);
}
}
return t;
}, getMedian:function (len) {
var range = this.createRange(len);
if (range.index < 0) {
return 0;
}
var a = [];
for (var i = range.index; i >= range.start; i--) {
var n = parseFloat(this.values[i].value);
if (!isNaN(n)) {
var b = false;
for (var j = 0; j < a.length && !b; j++) {
if (n == a[j]) {
b = true;
}
}
if (!b) {
a.push(n);
}
}
}
a.sort();
if (a.length > 0) {
return a[Math.ceil(a.length / 2)];
}
return 0;
}, getMode:function (len) {
var range = this.createRange(len);
if (range.index < 0) {
return 0;
}
var o = {};
var ret = 0;
var m = 0;
for (var i = range.index; i >= range.start; i--) {
var n = parseFloat(this.values[i].value);
if (!isNaN(n)) {
if (!o[this.values[i].value]) {
o[this.values[i].value] = 1;
} else {
o[this.values[i].value]++;
}
}
}
for (var p in o) {
if (m < o[p]) {
m = o[p];
ret = p;
}
}
return parseFloat(ret);
}});
dojo.requireIf(dojo.render.svg.capable, "dojo.widget.svg.Chart");
dojo.requireIf(!dojo.render.svg.capable && dojo.render.vml.capable, "dojo.widget.vml.Chart");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/TreeLoadingController.js
New file
0,0 → 1,92
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeLoadingController");
dojo.require("dojo.widget.TreeBasicController");
dojo.require("dojo.event.*");
dojo.require("dojo.json");
dojo.require("dojo.io.*");
dojo.widget.defineWidget("dojo.widget.TreeLoadingController", dojo.widget.TreeBasicController, {RPCUrl:"", RPCActionParam:"action", RPCErrorHandler:function (type, obj, evt) {
alert("RPC Error: " + (obj.message || "no message"));
}, preventCache:true, getRPCUrl:function (action) {
if (this.RPCUrl == "local") {
var dir = document.location.href.substr(0, document.location.href.lastIndexOf("/"));
var localUrl = dir + "/" + action;
return localUrl;
}
if (!this.RPCUrl) {
dojo.raise("Empty RPCUrl: can't load");
}
return this.RPCUrl + (this.RPCUrl.indexOf("?") > -1 ? "&" : "?") + this.RPCActionParam + "=" + action;
}, loadProcessResponse:function (node, result, callObj, callFunc) {
if (!dojo.lang.isUndefined(result.error)) {
this.RPCErrorHandler("server", result.error);
return false;
}
var newChildren = result;
if (!dojo.lang.isArray(newChildren)) {
dojo.raise("loadProcessResponse: Not array loaded: " + newChildren);
}
for (var i = 0; i < newChildren.length; i++) {
newChildren[i] = dojo.widget.createWidget(node.widgetType, newChildren[i]);
node.addChild(newChildren[i]);
}
node.state = node.loadStates.LOADED;
if (dojo.lang.isFunction(callFunc)) {
callFunc.apply(dojo.lang.isUndefined(callObj) ? this : callObj, [node, newChildren]);
}
}, getInfo:function (obj) {
return obj.getInfo();
}, runRPC:function (kw) {
var _this = this;
var handle = function (type, data, evt) {
if (kw.lock) {
dojo.lang.forEach(kw.lock, function (t) {
t.unlock();
});
}
if (type == "load") {
kw.load.call(this, data);
} else {
this.RPCErrorHandler(type, data, evt);
}
};
if (kw.lock) {
dojo.lang.forEach(kw.lock, function (t) {
t.lock();
});
}
dojo.io.bind({url:kw.url, handle:dojo.lang.hitch(this, handle), mimetype:"text/json", preventCache:_this.preventCache, sync:kw.sync, content:{data:dojo.json.serialize(kw.params)}});
}, loadRemote:function (node, sync, callObj, callFunc) {
var _this = this;
var params = {node:this.getInfo(node), tree:this.getInfo(node.tree)};
this.runRPC({url:this.getRPCUrl("getChildren"), load:function (result) {
_this.loadProcessResponse(node, result, callObj, callFunc);
}, sync:sync, lock:[node], params:params});
}, expand:function (node, sync, callObj, callFunc) {
if (node.state == node.loadStates.UNCHECKED && node.isFolder) {
this.loadRemote(node, sync, this, function (node, newChildren) {
this.expand(node, sync, callObj, callFunc);
});
return;
}
dojo.widget.TreeBasicController.prototype.expand.apply(this, arguments);
}, doMove:function (child, newParent, index) {
if (newParent.isTreeNode && newParent.state == newParent.loadStates.UNCHECKED) {
this.loadRemote(newParent, true);
}
return dojo.widget.TreeBasicController.prototype.doMove.apply(this, arguments);
}, doCreateChild:function (parent, index, data, callObj, callFunc) {
if (parent.state == parent.loadStates.UNCHECKED) {
this.loadRemote(parent, true);
}
return dojo.widget.TreeBasicController.prototype.doCreateChild.apply(this, arguments);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/LinkPane.js
New file
0,0 → 1,21
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.LinkPane");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.ContentPane");
dojo.require("dojo.html.style");
dojo.widget.defineWidget("dojo.widget.LinkPane", dojo.widget.ContentPane, {templateString:"<div class=\"dojoLinkPane\"></div>", fillInTemplate:function (args, frag) {
var source = this.getFragNodeRef(frag);
this.label += source.innerHTML;
var source = this.getFragNodeRef(frag);
dojo.html.copyStyle(this.domNode, source);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/TreeEmphasizeOnSelect.js
New file
0,0 → 1,24
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeEmphasizeOnSelect");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.TreeSelectorV3");
dojo.require("dojo.html.selection");
dojo.widget.defineWidget("dojo.widget.TreeEmphasizeOnSelect", dojo.widget.HtmlWidget, {selector:"", initialize:function () {
this.selector = dojo.widget.byId(this.selector);
dojo.event.topic.subscribe(this.selector.eventNames.select, this, "onSelect");
dojo.event.topic.subscribe(this.selector.eventNames.deselect, this, "onDeselect");
}, onSelect:function (message) {
message.node.viewEmphasize();
}, onDeselect:function (message) {
message.node.viewUnemphasize();
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Toolbar.js
New file
0,0 → 1,722
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Toolbar");
dojo.require("dojo.widget.*");
dojo.require("dojo.html.style");
dojo.widget.defineWidget("dojo.widget.ToolbarContainer", dojo.widget.HtmlWidget, {isContainer:true, templateString:"<div class=\"toolbarContainer\" dojoAttachPoint=\"containerNode\"></div>", templateCssString:".toolbarContainer {\n\tborder-bottom : 0;\n\tbackground-color : #def;\n\tcolor : ButtonText;\n\tfont : Menu;\n\tbackground-image: url(images/toolbar-bg.gif);\n}\n\n.toolbar {\n\tpadding : 2px 4px;\n\tmin-height : 26px;\n\t_height : 26px;\n}\n\n.toolbarItem {\n\tfloat : left;\n\tpadding : 1px 2px;\n\tmargin : 0 2px 1px 0;\n\tcursor : pointer;\n}\n\n.toolbarItem.selected, .toolbarItem.down {\n\tmargin : 1px 1px 0 1px;\n\tpadding : 0px 1px;\n\tborder : 1px solid #bbf;\n\tbackground-color : #fafaff;\n}\n\n.toolbarButton img {\n\tvertical-align : bottom;\n}\n\n.toolbarButton span {\n\tline-height : 16px;\n\tvertical-align : middle;\n}\n\n.toolbarButton.hover {\n\tpadding : 0px 1px;\n\tborder : 1px solid #99c;\n}\n\n.toolbarItem.disabled {\n\topacity : 0.3;\n\tfilter : alpha(opacity=30);\n\tcursor : default;\n}\n\n.toolbarSeparator {\n\tcursor : default;\n}\n\n.toolbarFlexibleSpace {\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/Toolbar.css"), getItem:function (name) {
if (name instanceof dojo.widget.ToolbarItem) {
return name;
}
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.Toolbar) {
var item = child.getItem(name);
if (item) {
return item;
}
}
}
return null;
}, getItems:function () {
var items = [];
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.Toolbar) {
items = items.concat(child.getItems());
}
}
return items;
}, enable:function () {
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.Toolbar) {
child.enable.apply(child, arguments);
}
}
}, disable:function () {
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.Toolbar) {
child.disable.apply(child, arguments);
}
}
}, select:function (name) {
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.Toolbar) {
child.select(arguments);
}
}
}, deselect:function (name) {
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.Toolbar) {
child.deselect(arguments);
}
}
}, getItemsState:function () {
var values = {};
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.Toolbar) {
dojo.lang.mixin(values, child.getItemsState());
}
}
return values;
}, getItemsActiveState:function () {
var values = {};
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.Toolbar) {
dojo.lang.mixin(values, child.getItemsActiveState());
}
}
return values;
}, getItemsSelectedState:function () {
var values = {};
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.Toolbar) {
dojo.lang.mixin(values, child.getItemsSelectedState());
}
}
return values;
}});
dojo.widget.defineWidget("dojo.widget.Toolbar", dojo.widget.HtmlWidget, {isContainer:true, templateString:"<div class=\"toolbar\" dojoAttachPoint=\"containerNode\" unselectable=\"on\" dojoOnMouseover=\"_onmouseover\" dojoOnMouseout=\"_onmouseout\" dojoOnClick=\"_onclick\" dojoOnMousedown=\"_onmousedown\" dojoOnMouseup=\"_onmouseup\"></div>", _getItem:function (node) {
var start = new Date();
var widget = null;
while (node && node != this.domNode) {
if (dojo.html.hasClass(node, "toolbarItem")) {
var widgets = dojo.widget.manager.getWidgetsByFilter(function (w) {
return w.domNode == node;
});
if (widgets.length == 1) {
widget = widgets[0];
break;
} else {
if (widgets.length > 1) {
dojo.raise("Toolbar._getItem: More than one widget matches the node");
}
}
}
node = node.parentNode;
}
return widget;
}, _onmouseover:function (e) {
var widget = this._getItem(e.target);
if (widget && widget._onmouseover) {
widget._onmouseover(e);
}
}, _onmouseout:function (e) {
var widget = this._getItem(e.target);
if (widget && widget._onmouseout) {
widget._onmouseout(e);
}
}, _onclick:function (e) {
var widget = this._getItem(e.target);
if (widget && widget._onclick) {
widget._onclick(e);
}
}, _onmousedown:function (e) {
var widget = this._getItem(e.target);
if (widget && widget._onmousedown) {
widget._onmousedown(e);
}
}, _onmouseup:function (e) {
var widget = this._getItem(e.target);
if (widget && widget._onmouseup) {
widget._onmouseup(e);
}
}, addChild:function (item, pos, props) {
var widget = dojo.widget.ToolbarItem.make(item, null, props);
var ret = dojo.widget.Toolbar.superclass.addChild.call(this, widget, null, pos, null);
return ret;
}, push:function () {
for (var i = 0; i < arguments.length; i++) {
this.addChild(arguments[i]);
}
}, getItem:function (name) {
if (name instanceof dojo.widget.ToolbarItem) {
return name;
}
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.ToolbarItem && child._name == name) {
return child;
}
}
return null;
}, getItems:function () {
var items = [];
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.ToolbarItem) {
items.push(child);
}
}
return items;
}, getItemsState:function () {
var values = {};
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.ToolbarItem) {
values[child._name] = {selected:child._selected, enabled:!child.disabled};
}
}
return values;
}, getItemsActiveState:function () {
var values = this.getItemsState();
for (var item in values) {
values[item] = values[item].enabled;
}
return values;
}, getItemsSelectedState:function () {
var values = this.getItemsState();
for (var item in values) {
values[item] = values[item].selected;
}
return values;
}, enable:function () {
var items = arguments.length ? arguments : this.children;
for (var i = 0; i < items.length; i++) {
var child = this.getItem(items[i]);
if (child instanceof dojo.widget.ToolbarItem) {
child.enable(false, true);
}
}
}, disable:function () {
var items = arguments.length ? arguments : this.children;
for (var i = 0; i < items.length; i++) {
var child = this.getItem(items[i]);
if (child instanceof dojo.widget.ToolbarItem) {
child.disable();
}
}
}, select:function () {
for (var i = 0; i < arguments.length; i++) {
var name = arguments[i];
var item = this.getItem(name);
if (item) {
item.select();
}
}
}, deselect:function () {
for (var i = 0; i < arguments.length; i++) {
var name = arguments[i];
var item = this.getItem(name);
if (item) {
item.disable();
}
}
}, setValue:function () {
for (var i = 0; i < arguments.length; i += 2) {
var name = arguments[i], value = arguments[i + 1];
var item = this.getItem(name);
if (item) {
if (item instanceof dojo.widget.ToolbarItem) {
item.setValue(value);
}
}
}
}});
dojo.widget.defineWidget("dojo.widget.ToolbarItem", dojo.widget.HtmlWidget, {templateString:"<span unselectable=\"on\" class=\"toolbarItem\"></span>", _name:null, getName:function () {
return this._name;
}, setName:function (value) {
return (this._name = value);
}, getValue:function () {
return this.getName();
}, setValue:function (value) {
return this.setName(value);
}, _selected:false, isSelected:function () {
return this._selected;
}, setSelected:function (is, force, preventEvent) {
if (!this._toggleItem && !force) {
return;
}
is = Boolean(is);
if (force || !this.disabled && this._selected != is) {
this._selected = is;
this.update();
if (!preventEvent) {
this._fireEvent(is ? "onSelect" : "onDeselect");
this._fireEvent("onChangeSelect");
}
}
}, select:function (force, preventEvent) {
return this.setSelected(true, force, preventEvent);
}, deselect:function (force, preventEvent) {
return this.setSelected(false, force, preventEvent);
}, _toggleItem:false, isToggleItem:function () {
return this._toggleItem;
}, setToggleItem:function (value) {
this._toggleItem = Boolean(value);
}, toggleSelected:function (force) {
return this.setSelected(!this._selected, force);
}, isEnabled:function () {
return !this.disabled;
}, setEnabled:function (is, force, preventEvent) {
is = Boolean(is);
if (force || this.disabled == is) {
this.disabled = !is;
this.update();
if (!preventEvent) {
this._fireEvent(this.disabled ? "onDisable" : "onEnable");
this._fireEvent("onChangeEnabled");
}
}
return !this.disabled;
}, enable:function (force, preventEvent) {
return this.setEnabled(true, force, preventEvent);
}, disable:function (force, preventEvent) {
return this.setEnabled(false, force, preventEvent);
}, toggleEnabled:function (force, preventEvent) {
return this.setEnabled(this.disabled, force, preventEvent);
}, _icon:null, getIcon:function () {
return this._icon;
}, setIcon:function (value) {
var icon = dojo.widget.Icon.make(value);
if (this._icon) {
this._icon.setIcon(icon);
} else {
this._icon = icon;
}
var iconNode = this._icon.getNode();
if (iconNode.parentNode != this.domNode) {
if (this.domNode.hasChildNodes()) {
this.domNode.insertBefore(iconNode, this.domNode.firstChild);
} else {
this.domNode.appendChild(iconNode);
}
}
return this._icon;
}, _label:"", getLabel:function () {
return this._label;
}, setLabel:function (value) {
var ret = (this._label = value);
if (!this.labelNode) {
this.labelNode = document.createElement("span");
this.domNode.appendChild(this.labelNode);
}
this.labelNode.innerHTML = "";
this.labelNode.appendChild(document.createTextNode(this._label));
this.update();
return ret;
}, update:function () {
if (this.disabled) {
this._selected = false;
dojo.html.addClass(this.domNode, "disabled");
dojo.html.removeClass(this.domNode, "down");
dojo.html.removeClass(this.domNode, "hover");
} else {
dojo.html.removeClass(this.domNode, "disabled");
if (this._selected) {
dojo.html.addClass(this.domNode, "selected");
} else {
dojo.html.removeClass(this.domNode, "selected");
}
}
this._updateIcon();
}, _updateIcon:function () {
if (this._icon) {
if (this.disabled) {
this._icon.disable();
} else {
if (this._cssHover) {
this._icon.hover();
} else {
if (this._selected) {
this._icon.select();
} else {
this._icon.enable();
}
}
}
}
}, _fireEvent:function (evt) {
if (typeof this[evt] == "function") {
var args = [this];
for (var i = 1; i < arguments.length; i++) {
args.push(arguments[i]);
}
this[evt].apply(this, args);
}
}, _onmouseover:function (e) {
if (this.disabled) {
return;
}
dojo.html.addClass(this.domNode, "hover");
this._fireEvent("onMouseOver");
}, _onmouseout:function (e) {
dojo.html.removeClass(this.domNode, "hover");
dojo.html.removeClass(this.domNode, "down");
if (!this._selected) {
dojo.html.removeClass(this.domNode, "selected");
}
this._fireEvent("onMouseOut");
}, _onclick:function (e) {
if (!this.disabled && !this._toggleItem) {
this._fireEvent("onClick");
}
}, _onmousedown:function (e) {
if (e.preventDefault) {
e.preventDefault();
}
if (this.disabled) {
return;
}
dojo.html.addClass(this.domNode, "down");
if (this._toggleItem) {
if (this.parent.preventDeselect && this._selected) {
return;
}
this.toggleSelected();
}
this._fireEvent("onMouseDown");
}, _onmouseup:function (e) {
dojo.html.removeClass(this.domNode, "down");
this._fireEvent("onMouseUp");
}, onClick:function () {
}, onMouseOver:function () {
}, onMouseOut:function () {
}, onMouseDown:function () {
}, onMouseUp:function () {
}, fillInTemplate:function (args, frag) {
if (args.name) {
this._name = args.name;
}
if (args.selected) {
this.select();
}
if (args.disabled) {
this.disable();
}
if (args.label) {
this.setLabel(args.label);
}
if (args.icon) {
this.setIcon(args.icon);
}
if (args.toggleitem || args.toggleItem) {
this.setToggleItem(true);
}
}});
dojo.widget.ToolbarItem.make = function (wh, whIsType, props) {
var item = null;
if (wh instanceof Array) {
item = dojo.widget.createWidget("ToolbarButtonGroup", props);
item.setName(wh[0]);
for (var i = 1; i < wh.length; i++) {
item.addChild(wh[i]);
}
} else {
if (wh instanceof dojo.widget.ToolbarItem) {
item = wh;
} else {
if (wh instanceof dojo.uri.Uri) {
item = dojo.widget.createWidget("ToolbarButton", dojo.lang.mixin(props || {}, {icon:new dojo.widget.Icon(wh.toString())}));
} else {
if (whIsType) {
item = dojo.widget.createWidget(wh, props);
} else {
if (typeof wh == "string" || wh instanceof String) {
switch (wh.charAt(0)) {
case "|":
case "-":
case "/":
item = dojo.widget.createWidget("ToolbarSeparator", props);
break;
case " ":
if (wh.length == 1) {
item = dojo.widget.createWidget("ToolbarSpace", props);
} else {
item = dojo.widget.createWidget("ToolbarFlexibleSpace", props);
}
break;
default:
if (/\.(gif|jpg|jpeg|png)$/i.test(wh)) {
item = dojo.widget.createWidget("ToolbarButton", dojo.lang.mixin(props || {}, {icon:new dojo.widget.Icon(wh.toString())}));
} else {
item = dojo.widget.createWidget("ToolbarButton", dojo.lang.mixin(props || {}, {label:wh.toString()}));
}
}
} else {
if (wh && wh.tagName && /^img$/i.test(wh.tagName)) {
item = dojo.widget.createWidget("ToolbarButton", dojo.lang.mixin(props || {}, {icon:wh}));
} else {
item = dojo.widget.createWidget("ToolbarButton", dojo.lang.mixin(props || {}, {label:wh.toString()}));
}
}
}
}
}
}
return item;
};
dojo.widget.defineWidget("dojo.widget.ToolbarButtonGroup", dojo.widget.ToolbarItem, {isContainer:true, templateString:"<span unselectable=\"on\" class=\"toolbarButtonGroup\" dojoAttachPoint=\"containerNode\"></span>", defaultButton:"", postCreate:function () {
for (var i = 0; i < this.children.length; i++) {
this._injectChild(this.children[i]);
}
}, addChild:function (item, pos, props) {
var widget = dojo.widget.ToolbarItem.make(item, null, dojo.lang.mixin(props || {}, {toggleItem:true}));
var ret = dojo.widget.ToolbarButtonGroup.superclass.addChild.call(this, widget, null, pos, null);
this._injectChild(widget);
return ret;
}, _injectChild:function (widget) {
dojo.event.connect(widget, "onSelect", this, "onChildSelected");
dojo.event.connect(widget, "onDeselect", this, "onChildDeSelected");
if (widget._name == this.defaultButton || (typeof this.defaultButton == "number" && this.children.length - 1 == this.defaultButton)) {
widget.select(false, true);
}
}, getItem:function (name) {
if (name instanceof dojo.widget.ToolbarItem) {
return name;
}
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.ToolbarItem && child._name == name) {
return child;
}
}
return null;
}, getItems:function () {
var items = [];
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.ToolbarItem) {
items.push(child);
}
}
return items;
}, onChildSelected:function (e) {
this.select(e._name);
}, onChildDeSelected:function (e) {
this._fireEvent("onChangeSelect", this._value);
}, enable:function (force, preventEvent) {
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.ToolbarItem) {
child.enable(force, preventEvent);
if (child._name == this._value) {
child.select(force, preventEvent);
}
}
}
}, disable:function (force, preventEvent) {
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.ToolbarItem) {
child.disable(force, preventEvent);
}
}
}, _value:"", getValue:function () {
return this._value;
}, select:function (name, force, preventEvent) {
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child instanceof dojo.widget.ToolbarItem) {
if (child._name == name) {
child.select(force, preventEvent);
this._value = name;
} else {
child.deselect(true, true);
}
}
}
if (!preventEvent) {
this._fireEvent("onSelect", this._value);
this._fireEvent("onChangeSelect", this._value);
}
}, setValue:this.select, preventDeselect:false});
dojo.widget.defineWidget("dojo.widget.ToolbarButton", dojo.widget.ToolbarItem, {fillInTemplate:function (args, frag) {
dojo.widget.ToolbarButton.superclass.fillInTemplate.call(this, args, frag);
dojo.html.addClass(this.domNode, "toolbarButton");
if (this._icon) {
this.setIcon(this._icon);
}
if (this._label) {
this.setLabel(this._label);
}
if (!this._name) {
if (this._label) {
this.setName(this._label);
} else {
if (this._icon) {
var src = this._icon.getSrc("enabled").match(/[\/^]([^\.\/]+)\.(gif|jpg|jpeg|png)$/i);
if (src) {
this.setName(src[1]);
}
} else {
this._name = this._widgetId;
}
}
}
}});
dojo.widget.defineWidget("dojo.widget.ToolbarDialog", dojo.widget.ToolbarButton, {fillInTemplate:function (args, frag) {
dojo.widget.ToolbarDialog.superclass.fillInTemplate.call(this, args, frag);
dojo.event.connect(this, "onSelect", this, "showDialog");
dojo.event.connect(this, "onDeselect", this, "hideDialog");
}, showDialog:function (e) {
dojo.lang.setTimeout(dojo.event.connect, 1, document, "onmousedown", this, "deselect");
}, hideDialog:function (e) {
dojo.event.disconnect(document, "onmousedown", this, "deselect");
}});
dojo.widget.defineWidget("dojo.widget.ToolbarMenu", dojo.widget.ToolbarDialog, {});
dojo.widget.ToolbarMenuItem = function () {
};
dojo.widget.defineWidget("dojo.widget.ToolbarSeparator", dojo.widget.ToolbarItem, {templateString:"<span unselectable=\"on\" class=\"toolbarItem toolbarSeparator\"></span>", defaultIconPath:new dojo.uri.moduleUri("dojo.widget", "templates/buttons/sep.gif"), fillInTemplate:function (args, frag, skip) {
dojo.widget.ToolbarSeparator.superclass.fillInTemplate.call(this, args, frag);
this._name = this.widgetId;
if (!skip) {
if (!this._icon) {
this.setIcon(this.defaultIconPath);
}
this.domNode.appendChild(this._icon.getNode());
}
}, _onmouseover:null, _onmouseout:null, _onclick:null, _onmousedown:null, _onmouseup:null});
dojo.widget.defineWidget("dojo.widget.ToolbarSpace", dojo.widget.ToolbarSeparator, {fillInTemplate:function (args, frag, skip) {
dojo.widget.ToolbarSpace.superclass.fillInTemplate.call(this, args, frag, true);
if (!skip) {
dojo.html.addClass(this.domNode, "toolbarSpace");
}
}});
dojo.widget.defineWidget("dojo.widget.ToolbarSelect", dojo.widget.ToolbarItem, {templateString:"<span class=\"toolbarItem toolbarSelect\" unselectable=\"on\"><select dojoAttachPoint=\"selectBox\" dojoOnChange=\"changed\"></select></span>", fillInTemplate:function (args, frag) {
dojo.widget.ToolbarSelect.superclass.fillInTemplate.call(this, args, frag, true);
var keys = args.values;
var i = 0;
for (var val in keys) {
var opt = document.createElement("option");
opt.setAttribute("value", keys[val]);
opt.innerHTML = val;
this.selectBox.appendChild(opt);
}
}, changed:function (e) {
this._fireEvent("onSetValue", this.selectBox.value);
}, setEnabled:function (is, force, preventEvent) {
var ret = dojo.widget.ToolbarSelect.superclass.setEnabled.call(this, is, force, preventEvent);
this.selectBox.disabled = this.disabled;
return ret;
}, _onmouseover:null, _onmouseout:null, _onclick:null, _onmousedown:null, _onmouseup:null});
dojo.widget.Icon = function (enabled, disabled, hovered, selected) {
if (!arguments.length) {
throw new Error("Icon must have at least an enabled state");
}
var states = ["enabled", "disabled", "hovered", "selected"];
var currentState = "enabled";
var domNode = document.createElement("img");
this.getState = function () {
return currentState;
};
this.setState = function (value) {
if (dojo.lang.inArray(states, value)) {
if (this[value]) {
currentState = value;
var img = this[currentState];
if ((dojo.render.html.ie55 || dojo.render.html.ie60) && img.src && img.src.match(/[.]png$/i)) {
domNode.width = img.width || img.offsetWidth;
domNode.height = img.height || img.offsetHeight;
domNode.setAttribute("src", dojo.uri.moduleUri("dojo.widget", "templates/images/blank.gif").uri);
domNode.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + img.src + "',sizingMethod='image')";
} else {
domNode.setAttribute("src", img.src);
}
}
} else {
throw new Error("Invalid state set on Icon (state: " + value + ")");
}
};
this.setSrc = function (state, value) {
if (/^img$/i.test(value.tagName)) {
this[state] = value;
} else {
if (typeof value == "string" || value instanceof String || value instanceof dojo.uri.Uri) {
this[state] = new Image();
this[state].src = value.toString();
}
}
return this[state];
};
this.setIcon = function (icon) {
for (var i = 0; i < states.length; i++) {
if (icon[states[i]]) {
this.setSrc(states[i], icon[states[i]]);
}
}
this.update();
};
this.enable = function () {
this.setState("enabled");
};
this.disable = function () {
this.setState("disabled");
};
this.hover = function () {
this.setState("hovered");
};
this.select = function () {
this.setState("selected");
};
this.getSize = function () {
return {width:domNode.width || domNode.offsetWidth, height:domNode.height || domNode.offsetHeight};
};
this.setSize = function (w, h) {
domNode.width = w;
domNode.height = h;
return {width:w, height:h};
};
this.getNode = function () {
return domNode;
};
this.getSrc = function (state) {
if (state) {
return this[state].src;
}
return domNode.src || "";
};
this.update = function () {
this.setState(currentState);
};
for (var i = 0; i < states.length; i++) {
var arg = arguments[i];
var state = states[i];
this[state] = null;
if (!arg) {
continue;
}
this.setSrc(state, arg);
}
this.enable();
};
dojo.widget.Icon.make = function (a, b, c, d) {
for (var i = 0; i < arguments.length; i++) {
if (arguments[i] instanceof dojo.widget.Icon) {
return arguments[i];
}
}
return new dojo.widget.Icon(a, b, c, d);
};
dojo.widget.defineWidget("dojo.widget.ToolbarColorDialog", dojo.widget.ToolbarDialog, {palette:"7x10", fillInTemplate:function (args, frag) {
dojo.widget.ToolbarColorDialog.superclass.fillInTemplate.call(this, args, frag);
this.dialog = dojo.widget.createWidget("ColorPalette", {palette:this.palette});
this.dialog.domNode.style.position = "absolute";
dojo.event.connect(this.dialog, "onColorSelect", this, "_setValue");
}, _setValue:function (color) {
this._value = color;
this._fireEvent("onSetValue", color);
}, showDialog:function (e) {
dojo.widget.ToolbarColorDialog.superclass.showDialog.call(this, e);
var abs = dojo.html.getAbsolutePosition(this.domNode, true);
var y = abs.y + dojo.html.getBorderBox(this.domNode).height;
this.dialog.showAt(abs.x, y);
}, hideDialog:function (e) {
dojo.widget.ToolbarColorDialog.superclass.hideDialog.call(this, e);
this.dialog.hide();
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Form.js
New file
0,0 → 1,265
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Form");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.widget.defineWidget("dojo.widget.Form", dojo.widget.HtmlWidget, {isContainer:true, templateString:"<form dojoAttachPoint='containerNode' dojoAttachEvent='onSubmit:onSubmit'></form>", formElements:[], ignoreNullValues:false, postCreate:function (args, frag) {
for (var key in args) {
if (key == "dojotype") {
continue;
}
var attr = document.createAttribute(key);
attr.nodeValue = args[key];
this.containerNode.setAttributeNode(attr);
}
}, _createRepeaters:function (obj, widget) {
for (var i = 0; i < widget.children.length; ++i) {
if (widget.children[i].widgetType == "RepeaterContainer") {
var rIndex = widget.children[i].index;
var rIndexPos = rIndex.indexOf("%{index}");
rIndex = rIndex.substr(0, rIndexPos - 1);
var myObj = this._getObject(obj, rIndex);
if (typeof (myObj) == "object" && myObj.length == 0) {
myObj = new Array();
}
var rowCount = widget.children[i].getRowCount();
for (var j = 0, len = rowCount; j < len; ++j) {
widget.children[i].deleteRow(0);
}
for (var j = 0; j < myObj.length; j++) {
widget.children[i].addRow(false);
}
}
if (widget.children[i].isContainer) {
this._createRepeaters(obj, widget.children[i]);
}
}
}, _createFormElements:function () {
if (dojo.render.html.safari) {
this.formElements = [];
var elems = ["INPUT", "SELECT", "TEXTAREA"];
for (var k = 0; k < elems.length; k++) {
var list = this.containerNode.getElementsByTagName(elems[k]);
for (var j = 0, len2 = list.length; j < len2; j++) {
this.formElements.push(list[j]);
}
}
} else {
this.formElements = this.containerNode.elements;
}
}, onSubmit:function (e) {
e.preventDefault();
}, submit:function () {
this.containerNode.submit();
}, _getFormElement:function (name) {
if (dojo.render.html.ie) {
for (var i = 0, len = this.formElements.length; i < len; i++) {
var element = this.formElements[i];
if (element.name == name) {
return element;
}
}
} else {
var elem = this.formElements[name];
if (typeof (elem) != "undefined") {
return elem;
}
}
return null;
}, _getObject:function (obj, searchString) {
var namePath = [];
namePath = searchString.split(".");
var myObj = obj;
var name = namePath[namePath.length - 1];
for (var j = 0, len = namePath.length; j < len; ++j) {
var p = namePath[j];
if (typeof (myObj[p]) == "undefined") {
myObj[p] = {};
}
myObj = myObj[p];
}
return myObj;
}, _setToContainers:function (obj, widget) {
for (var i = 0, len = widget.children.length; i < len; ++i) {
var currentWidget = widget.children[i];
if (currentWidget.widgetType == "Repeater") {
for (var j = 0, len = currentWidget.getRowCount(); j < len; ++j) {
currentWidget._initRow(j);
}
}
if (currentWidget.isContainer) {
this._setToContainers(obj, currentWidget);
continue;
}
switch (currentWidget.widgetType) {
case "Checkbox":
currentWidget.setValue(currentWidget.inputNode.checked);
break;
case "DropdownDatePicker":
currentWidget.setValue(currentWidget.getValue());
break;
case "Select":
continue;
break;
case "ComboBox":
continue;
break;
default:
break;
}
}
}, setValues:function (obj) {
this._createFormElements();
this._createRepeaters(obj, this);
for (var i = 0, len = this.formElements.length; i < len; i++) {
var element = this.formElements[i];
if (element.name == "") {
continue;
}
var namePath = new Array();
namePath = element.name.split(".");
var myObj = obj;
var name = namePath[namePath.length - 1];
for (var j = 1, len2 = namePath.length; j < len2; ++j) {
var p = namePath[j - 1];
if (typeof (myObj[p]) == "undefined") {
myObj = undefined;
break;
}
myObj = myObj[p];
}
if (typeof (myObj) == "undefined") {
continue;
}
if (typeof (myObj[name]) == "undefined" && this.ignoreNullValues) {
continue;
}
var type = element.type;
if (type == "hidden" || type == "text" || type == "textarea" || type == "password") {
type = "text";
}
switch (type) {
case "checkbox":
element.checked = false;
if (typeof (myObj[name]) == "undefined") {
continue;
}
for (var j = 0, len2 = myObj[name].length; j < len2; ++j) {
if (element.value == myObj[name][j]) {
element.checked = true;
}
}
break;
case "radio":
element.checked = false;
if (typeof (myObj[name]) == "undefined") {
continue;
}
if (myObj[name] == element.value) {
element.checked = true;
}
break;
case "select-multiple":
element.selectedIndex = -1;
for (var j = 0, len2 = element.options.length; j < len2; ++j) {
for (var k = 0, len3 = myObj[name].length; k < len3; ++k) {
if (element.options[j].value == myObj[name][k]) {
element.options[j].selected = true;
}
}
}
break;
case "select-one":
element.selectedIndex = "0";
for (var j = 0, len2 = element.options.length; j < len2; ++j) {
if (element.options[j].value == myObj[name]) {
element.options[j].selected = true;
} else {
}
}
break;
case "text":
var value = "";
if (typeof (myObj[name]) != "undefined") {
value = myObj[name];
}
element.value = value;
break;
default:
dojo.debug("Not supported type (" + type + ")");
break;
}
}
this._setToContainers(obj, this);
}, getValues:function () {
this._createFormElements();
var obj = {};
for (var i = 0, len = this.formElements.length; i < len; i++) {
var elm = this.formElements[i];
var namePath = [];
if (elm.name == "") {
continue;
}
namePath = elm.name.split(".");
var myObj = obj;
var name = namePath[namePath.length - 1];
for (var j = 1, len2 = namePath.length; j < len2; ++j) {
var nameIndex = null;
var p = namePath[j - 1];
var nameA = p.split("[");
if (nameA.length > 1) {
if (typeof (myObj[nameA[0]]) == "undefined") {
myObj[nameA[0]] = [];
}
nameIndex = parseInt(nameA[1]);
if (typeof (myObj[nameA[0]][nameIndex]) == "undefined") {
myObj[nameA[0]][nameIndex] = {};
}
} else {
if (typeof (myObj[nameA[0]]) == "undefined") {
myObj[nameA[0]] = {};
}
}
if (nameA.length == 1) {
myObj = myObj[nameA[0]];
} else {
myObj = myObj[nameA[0]][nameIndex];
}
}
if ((elm.type != "select-multiple" && elm.type != "checkbox" && elm.type != "radio") || (elm.type == "radio" && elm.checked)) {
if (name == name.split("[")[0]) {
myObj[name] = elm.value;
} else {
}
} else {
if (elm.type == "checkbox" && elm.checked) {
if (typeof (myObj[name]) == "undefined") {
myObj[name] = [];
}
myObj[name].push(elm.value);
} else {
if (elm.type == "select-multiple") {
if (typeof (myObj[name]) == "undefined") {
myObj[name] = [];
}
for (var jdx = 0, len3 = elm.options.length; jdx < len3; ++jdx) {
if (elm.options[jdx].selected) {
myObj[name].push(elm.options[jdx].value);
}
}
}
}
}
name = undefined;
}
return obj;
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Toggler.js
New file
0,0 → 1,24
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Toggler");
dojo.require("dojo.widget.*");
dojo.require("dojo.event.*");
dojo.widget.defineWidget("dojo.widget.Toggler", dojo.widget.HtmlWidget, {targetId:"", fillInTemplate:function () {
dojo.event.connect(this.domNode, "onclick", this, "onClick");
}, onClick:function () {
var pane = dojo.widget.byId(this.targetId);
if (!pane) {
return;
}
pane.explodeSrc = this.domNode;
pane.toggleShowing();
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/TreeEditor.js
New file
0,0 → 1,65
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.RichText");
dojo.provide("dojo.widget.TreeEditor");
dojo.widget.defineWidget("dojo.widget.TreeEditor", dojo.widget.HtmlWidget, {singleLineMode:false, saveOnBlur:true, sync:false, selectOnOpen:true, controller:null, node:null, richTextParams:{styleSheets:"src/widget/templates/TreeEditor.css"}, getContents:function () {
return this.richText.getEditorContent();
}, open:function (node) {
if (!this.richText) {
this.richText = dojo.widget.createWidget("RichText", this.richTextParams, node.labelNode);
dojo.event.connect("around", this.richText, "onKeyDown", this, "richText_onKeyDown");
dojo.event.connect(this.richText, "onBlur", this, "richText_onBlur");
var self = this;
dojo.event.connect(this.richText, "onLoad", function () {
if (self.selectOnOpen) {
self.richText.execCommand("selectall");
}
});
} else {
this.richText.open(node.labelNode);
}
this.node = node;
}, close:function (save) {
this.richText.close(save);
this.node = null;
}, isClosed:function () {
return !this.richText || this.richText.isClosed;
}, execCommand:function () {
this.richText.execCommand.apply(this.richText, arguments);
}, richText_onKeyDown:function (invocation) {
var e = invocation.args[0];
if ((!e) && (this.object)) {
e = dojo.event.browser.fixEvent(this.editor.window.event);
}
switch (e.keyCode) {
case e.KEY_ESCAPE:
this.finish(false);
dojo.event.browser.stopEvent(e);
break;
case e.KEY_ENTER:
if (e.ctrlKey && !this.singleLineMode) {
this.execCommand("inserthtml", "<br/>");
} else {
this.finish(true);
}
dojo.event.browser.stopEvent(e);
break;
default:
return invocation.proceed();
}
}, richText_onBlur:function () {
this.finish(this.saveOnBlur);
}, finish:function (save) {
return this.controller.editLabelFinish(save, this.sync);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/InternetTextbox.js
New file
0,0 → 1,76
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.InternetTextbox");
dojo.require("dojo.widget.ValidationTextbox");
dojo.require("dojo.validate.web");
dojo.widget.defineWidget("dojo.widget.IpAddressTextbox", dojo.widget.ValidationTextbox, {mixInProperties:function (localProperties) {
dojo.widget.IpAddressTextbox.superclass.mixInProperties.apply(this, arguments);
if (localProperties.allowdotteddecimal) {
this.flags.allowDottedDecimal = (localProperties.allowdotteddecimal == "true");
}
if (localProperties.allowdottedhex) {
this.flags.allowDottedHex = (localProperties.allowdottedhex == "true");
}
if (localProperties.allowdottedoctal) {
this.flags.allowDottedOctal = (localProperties.allowdottedoctal == "true");
}
if (localProperties.allowdecimal) {
this.flags.allowDecimal = (localProperties.allowdecimal == "true");
}
if (localProperties.allowhex) {
this.flags.allowHex = (localProperties.allowhex == "true");
}
if (localProperties.allowipv6) {
this.flags.allowIPv6 = (localProperties.allowipv6 == "true");
}
if (localProperties.allowhybrid) {
this.flags.allowHybrid = (localProperties.allowhybrid == "true");
}
}, isValid:function () {
return dojo.validate.isIpAddress(this.textbox.value, this.flags);
}});
dojo.widget.defineWidget("dojo.widget.UrlTextbox", dojo.widget.IpAddressTextbox, {mixInProperties:function (localProperties) {
dojo.widget.UrlTextbox.superclass.mixInProperties.apply(this, arguments);
if (localProperties.scheme) {
this.flags.scheme = (localProperties.scheme == "true");
}
if (localProperties.allowip) {
this.flags.allowIP = (localProperties.allowip == "true");
}
if (localProperties.allowlocal) {
this.flags.allowLocal = (localProperties.allowlocal == "true");
}
if (localProperties.allowcc) {
this.flags.allowCC = (localProperties.allowcc == "true");
}
if (localProperties.allowgeneric) {
this.flags.allowGeneric = (localProperties.allowgeneric == "true");
}
}, isValid:function () {
return dojo.validate.isUrl(this.textbox.value, this.flags);
}});
dojo.widget.defineWidget("dojo.widget.EmailTextbox", dojo.widget.UrlTextbox, {mixInProperties:function (localProperties) {
dojo.widget.EmailTextbox.superclass.mixInProperties.apply(this, arguments);
if (localProperties.allowcruft) {
this.flags.allowCruft = (localProperties.allowcruft == "true");
}
}, isValid:function () {
return dojo.validate.isEmailAddress(this.textbox.value, this.flags);
}});
dojo.widget.defineWidget("dojo.widget.EmailListTextbox", dojo.widget.EmailTextbox, {mixInProperties:function (localProperties) {
dojo.widget.EmailListTextbox.superclass.mixInProperties.apply(this, arguments);
if (localProperties.listseparator) {
this.flags.listSeparator = localProperties.listseparator;
}
}, isValid:function () {
return dojo.validate.isEmailAddressList(this.textbox.value, this.flags);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/FloatingPane.js
New file
0,0 → 1,247
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.FloatingPane");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.Manager");
dojo.require("dojo.html.*");
dojo.require("dojo.html.layout");
dojo.require("dojo.html.iframe");
dojo.require("dojo.html.selection");
dojo.require("dojo.lfx.shadow");
dojo.require("dojo.widget.html.layout");
dojo.require("dojo.widget.ContentPane");
dojo.require("dojo.dnd.HtmlDragMove");
dojo.require("dojo.widget.Dialog");
dojo.require("dojo.widget.ResizeHandle");
dojo.declare("dojo.widget.FloatingPaneBase", null, {title:"", iconSrc:"", hasShadow:false, constrainToContainer:false, taskBarId:"", resizable:true, titleBarDisplay:true, windowState:"normal", displayCloseAction:false, displayMinimizeAction:false, displayMaximizeAction:false, _max_taskBarConnectAttempts:5, _taskBarConnectAttempts:0, templateString:"<div id=\"${this.widgetId}\" dojoAttachEvent=\"onMouseDown\" class=\"dojoFloatingPane\">\n\t<div dojoAttachPoint=\"titleBar\" class=\"dojoFloatingPaneTitleBar\" style=\"display:none\">\n\t \t<img dojoAttachPoint=\"titleBarIcon\" class=\"dojoFloatingPaneTitleBarIcon\">\n\t\t<div dojoAttachPoint=\"closeAction\" dojoAttachEvent=\"onClick:closeWindow\"\n \t \t\tclass=\"dojoFloatingPaneCloseIcon\"></div>\n\t\t<div dojoAttachPoint=\"restoreAction\" dojoAttachEvent=\"onClick:restoreWindow\"\n \t \t\tclass=\"dojoFloatingPaneRestoreIcon\"></div>\n\t\t<div dojoAttachPoint=\"maximizeAction\" dojoAttachEvent=\"onClick:maximizeWindow\"\n \t \t\tclass=\"dojoFloatingPaneMaximizeIcon\"></div>\n\t\t<div dojoAttachPoint=\"minimizeAction\" dojoAttachEvent=\"onClick:minimizeWindow\"\n \t \t\tclass=\"dojoFloatingPaneMinimizeIcon\"></div>\n\t \t<div dojoAttachPoint=\"titleBarText\" class=\"dojoFloatingPaneTitleText\">${this.title}</div>\n\t</div>\n\n\t<div id=\"${this.widgetId}_container\" dojoAttachPoint=\"containerNode\" class=\"dojoFloatingPaneClient\"></div>\n\n\t<div dojoAttachPoint=\"resizeBar\" class=\"dojoFloatingPaneResizebar\" style=\"display:none\"></div>\n</div>\n", templateCssString:"\n/********** Outer Window ***************/\n\n.dojoFloatingPane {\n\t/* essential css */\n\tposition: absolute;\n\toverflow: visible;\t\t/* so drop shadow is displayed */\n\tz-index: 10;\n\n\t/* styling css */\n\tborder: 1px solid;\n\tborder-color: ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight;\n\tbackground-color: ThreeDFace;\n}\n\n\n/********** Title Bar ****************/\n\n.dojoFloatingPaneTitleBar {\n\tvertical-align: top;\n\tmargin: 2px 2px 2px 2px;\n\tz-index: 10;\n\tbackground-color: #7596c6;\n\tcursor: default;\n\toverflow: hidden;\n\tborder-color: ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight;\n\tvertical-align: middle;\n}\n\n.dojoFloatingPaneTitleText {\n\tfloat: left;\n\tpadding: 2px 4px 2px 2px;\n\twhite-space: nowrap;\n\tcolor: CaptionText;\n\tfont: small-caption;\n}\n\n.dojoTitleBarIcon {\n\tfloat: left;\n\theight: 22px;\n\twidth: 22px;\n\tvertical-align: middle;\n\tmargin-right: 5px;\n\tmargin-left: 5px;\n}\n\n.dojoFloatingPaneActions{\n\tfloat: right;\n\tposition: absolute;\n\tright: 2px;\n\ttop: 2px;\n\tvertical-align: middle;\n}\n\n\n.dojoFloatingPaneActionItem {\n\tvertical-align: middle;\n\tmargin-right: 1px;\n\theight: 22px;\n\twidth: 22px;\n}\n\n\n.dojoFloatingPaneTitleBarIcon {\n\t/* essential css */\n\tfloat: left;\n\n\t/* styling css */\n\tmargin-left: 2px;\n\tmargin-right: 4px;\n\theight: 22px;\n}\n\n/* minimize/maximize icons are specified by CSS only */\n.dojoFloatingPaneMinimizeIcon,\n.dojoFloatingPaneMaximizeIcon,\n.dojoFloatingPaneRestoreIcon,\n.dojoFloatingPaneCloseIcon {\n\tvertical-align: middle;\n\theight: 22px;\n\twidth: 22px;\n\tfloat: right;\n}\n.dojoFloatingPaneMinimizeIcon {\n\tbackground-image: url(images/floatingPaneMinimize.gif);\n}\n.dojoFloatingPaneMaximizeIcon {\n\tbackground-image: url(images/floatingPaneMaximize.gif);\n}\n.dojoFloatingPaneRestoreIcon {\n\tbackground-image: url(images/floatingPaneRestore.gif);\n}\n.dojoFloatingPaneCloseIcon {\n\tbackground-image: url(images/floatingPaneClose.gif);\n}\n\n/* bar at bottom of window that holds resize handle */\n.dojoFloatingPaneResizebar {\n\tz-index: 10;\n\theight: 13px;\n\tbackground-color: ThreeDFace;\n}\n\n/************* Client Area ***************/\n\n.dojoFloatingPaneClient {\n\tposition: relative;\n\tz-index: 10;\n\tborder: 1px solid;\n\tborder-color: ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow;\n\tmargin: 2px;\n\tbackground-color: ThreeDFace;\n\tpadding: 8px;\n\tfont-family: Verdana, Helvetica, Garamond, sans-serif;\n\tfont-size: 12px;\n\toverflow: auto;\n}\n\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/FloatingPane.css"), fillInFloatingPaneTemplate:function (args, frag) {
var source = this.getFragNodeRef(frag);
dojo.html.copyStyle(this.domNode, source);
dojo.body().appendChild(this.domNode);
if (!this.isShowing()) {
this.windowState = "minimized";
}
if (this.iconSrc == "") {
dojo.html.removeNode(this.titleBarIcon);
} else {
this.titleBarIcon.src = this.iconSrc.toString();
}
if (this.titleBarDisplay) {
this.titleBar.style.display = "";
dojo.html.disableSelection(this.titleBar);
this.titleBarIcon.style.display = (this.iconSrc == "" ? "none" : "");
this.minimizeAction.style.display = (this.displayMinimizeAction ? "" : "none");
this.maximizeAction.style.display = (this.displayMaximizeAction && this.windowState != "maximized" ? "" : "none");
this.restoreAction.style.display = (this.displayMaximizeAction && this.windowState == "maximized" ? "" : "none");
this.closeAction.style.display = (this.displayCloseAction ? "" : "none");
this.drag = new dojo.dnd.HtmlDragMoveSource(this.domNode);
if (this.constrainToContainer) {
this.drag.constrainTo();
}
this.drag.setDragHandle(this.titleBar);
var self = this;
dojo.event.topic.subscribe("dragMove", function (info) {
if (info.source.domNode == self.domNode) {
dojo.event.topic.publish("floatingPaneMove", {source:self});
}
});
}
if (this.resizable) {
this.resizeBar.style.display = "";
this.resizeHandle = dojo.widget.createWidget("ResizeHandle", {targetElmId:this.widgetId, id:this.widgetId + "_resize"});
this.resizeBar.appendChild(this.resizeHandle.domNode);
}
if (this.hasShadow) {
this.shadow = new dojo.lfx.shadow(this.domNode);
}
this.bgIframe = new dojo.html.BackgroundIframe(this.domNode);
if (this.taskBarId) {
this._taskBarSetup();
}
dojo.body().removeChild(this.domNode);
}, postCreate:function () {
if (dojo.hostenv.post_load_) {
this._setInitialWindowState();
} else {
dojo.addOnLoad(this, "_setInitialWindowState");
}
}, maximizeWindow:function (evt) {
var mb = dojo.html.getMarginBox(this.domNode);
this.previous = {width:mb.width || this.width, height:mb.height || this.height, left:this.domNode.style.left, top:this.domNode.style.top, bottom:this.domNode.style.bottom, right:this.domNode.style.right};
if (this.domNode.parentNode.style.overflow.toLowerCase() != "hidden") {
this.parentPrevious = {overflow:this.domNode.parentNode.style.overflow};
dojo.debug(this.domNode.parentNode.style.overflow);
this.domNode.parentNode.style.overflow = "hidden";
}
this.domNode.style.left = dojo.html.getPixelValue(this.domNode.parentNode, "padding-left", true) + "px";
this.domNode.style.top = dojo.html.getPixelValue(this.domNode.parentNode, "padding-top", true) + "px";
if ((this.domNode.parentNode.nodeName.toLowerCase() == "body")) {
var viewport = dojo.html.getViewport();
var padding = dojo.html.getPadding(dojo.body());
this.resizeTo(viewport.width - padding.width, viewport.height - padding.height);
} else {
var content = dojo.html.getContentBox(this.domNode.parentNode);
this.resizeTo(content.width, content.height);
}
this.maximizeAction.style.display = "none";
this.restoreAction.style.display = "";
if (this.resizeHandle) {
this.resizeHandle.domNode.style.display = "none";
}
this.drag.setDragHandle(null);
this.windowState = "maximized";
}, minimizeWindow:function (evt) {
this.hide();
for (var attr in this.parentPrevious) {
this.domNode.parentNode.style[attr] = this.parentPrevious[attr];
}
this.lastWindowState = this.windowState;
this.windowState = "minimized";
}, restoreWindow:function (evt) {
if (this.windowState == "minimized") {
this.show();
if (this.lastWindowState == "maximized") {
this.domNode.parentNode.style.overflow = "hidden";
this.windowState = "maximized";
} else {
this.windowState = "normal";
}
} else {
if (this.windowState == "maximized") {
for (var attr in this.previous) {
this.domNode.style[attr] = this.previous[attr];
}
for (var attr in this.parentPrevious) {
this.domNode.parentNode.style[attr] = this.parentPrevious[attr];
}
this.resizeTo(this.previous.width, this.previous.height);
this.previous = null;
this.parentPrevious = null;
this.restoreAction.style.display = "none";
this.maximizeAction.style.display = this.displayMaximizeAction ? "" : "none";
if (this.resizeHandle) {
this.resizeHandle.domNode.style.display = "";
}
this.drag.setDragHandle(this.titleBar);
this.windowState = "normal";
} else {
}
}
}, toggleDisplay:function () {
if (this.windowState == "minimized") {
this.restoreWindow();
} else {
this.minimizeWindow();
}
}, closeWindow:function (evt) {
dojo.html.removeNode(this.domNode);
this.destroy();
}, onMouseDown:function (evt) {
this.bringToTop();
}, bringToTop:function () {
var floatingPanes = dojo.widget.manager.getWidgetsByType(this.widgetType);
var windows = [];
for (var x = 0; x < floatingPanes.length; x++) {
if (this.widgetId != floatingPanes[x].widgetId) {
windows.push(floatingPanes[x]);
}
}
windows.sort(function (a, b) {
return a.domNode.style.zIndex - b.domNode.style.zIndex;
});
windows.push(this);
var floatingPaneStartingZ = 100;
for (x = 0; x < windows.length; x++) {
windows[x].domNode.style.zIndex = floatingPaneStartingZ + x * 2;
}
}, _setInitialWindowState:function () {
if (this.isShowing()) {
this.width = -1;
var mb = dojo.html.getMarginBox(this.domNode);
this.resizeTo(mb.width, mb.height);
}
if (this.windowState == "maximized") {
this.maximizeWindow();
this.show();
return;
}
if (this.windowState == "normal") {
this.show();
return;
}
if (this.windowState == "minimized") {
this.hide();
return;
}
this.windowState = "minimized";
}, _taskBarSetup:function () {
var taskbar = dojo.widget.getWidgetById(this.taskBarId);
if (!taskbar) {
if (this._taskBarConnectAttempts < this._max_taskBarConnectAttempts) {
dojo.lang.setTimeout(this, this._taskBarSetup, 50);
this._taskBarConnectAttempts++;
} else {
dojo.debug("Unable to connect to the taskBar");
}
return;
}
taskbar.addChild(this);
}, showFloatingPane:function () {
this.bringToTop();
}, onFloatingPaneShow:function () {
var mb = dojo.html.getMarginBox(this.domNode);
this.resizeTo(mb.width, mb.height);
}, resizeTo:function (width, height) {
dojo.html.setMarginBox(this.domNode, {width:width, height:height});
dojo.widget.html.layout(this.domNode, [{domNode:this.titleBar, layoutAlign:"top"}, {domNode:this.resizeBar, layoutAlign:"bottom"}, {domNode:this.containerNode, layoutAlign:"client"}]);
dojo.widget.html.layout(this.containerNode, this.children, "top-bottom");
this.bgIframe.onResized();
if (this.shadow) {
this.shadow.size(width, height);
}
this.onResized();
}, checkSize:function () {
}, destroyFloatingPane:function () {
if (this.resizeHandle) {
this.resizeHandle.destroy();
this.resizeHandle = null;
}
}});
dojo.widget.defineWidget("dojo.widget.FloatingPane", [dojo.widget.ContentPane, dojo.widget.FloatingPaneBase], {fillInTemplate:function (args, frag) {
this.fillInFloatingPaneTemplate(args, frag);
dojo.widget.FloatingPane.superclass.fillInTemplate.call(this, args, frag);
}, postCreate:function () {
dojo.widget.FloatingPaneBase.prototype.postCreate.apply(this, arguments);
dojo.widget.FloatingPane.superclass.postCreate.apply(this, arguments);
}, show:function () {
dojo.widget.FloatingPane.superclass.show.apply(this, arguments);
this.showFloatingPane();
}, onShow:function () {
dojo.widget.FloatingPane.superclass.onShow.call(this);
this.onFloatingPaneShow();
}, destroy:function () {
this.destroyFloatingPane();
dojo.widget.FloatingPane.superclass.destroy.apply(this, arguments);
}});
dojo.widget.defineWidget("dojo.widget.ModalFloatingPane", [dojo.widget.FloatingPane, dojo.widget.ModalDialogBase], {windowState:"minimized", displayCloseAction:true, postCreate:function () {
dojo.widget.ModalDialogBase.prototype.postCreate.call(this);
dojo.widget.ModalFloatingPane.superclass.postCreate.call(this);
}, show:function () {
this.showModalDialog();
dojo.widget.ModalFloatingPane.superclass.show.apply(this, arguments);
this.bg.style.zIndex = this.domNode.style.zIndex - 1;
}, hide:function () {
this.hideModalDialog();
dojo.widget.ModalFloatingPane.superclass.hide.apply(this, arguments);
}, closeWindow:function () {
this.hide();
dojo.widget.ModalFloatingPane.superclass.closeWindow.apply(this, arguments);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/TreeSelectorV3.js
New file
0,0 → 1,158
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeSelectorV3");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.TreeCommon");
dojo.widget.defineWidget("dojo.widget.TreeSelectorV3", [dojo.widget.HtmlWidget, dojo.widget.TreeCommon], function () {
this.eventNames = {};
this.listenedTrees = {};
this.selectedNodes = [];
this.lastClicked = {};
}, {listenTreeEvents:["afterTreeCreate", "afterCollapse", "afterChangeTree", "afterDetach", "beforeTreeDestroy"], listenNodeFilter:function (elem) {
return elem instanceof dojo.widget.Widget;
}, allowedMulti:true, dblselectTimeout:300, eventNamesDefault:{select:"select", deselect:"deselect", dblselect:"dblselect"}, onAfterTreeCreate:function (message) {
var tree = message.source;
dojo.event.browser.addListener(tree.domNode, "onclick", dojo.lang.hitch(this, this.onTreeClick));
if (dojo.render.html.ie) {
dojo.event.browser.addListener(tree.domNode, "ondblclick", dojo.lang.hitch(this, this.onTreeDblClick));
}
dojo.event.browser.addListener(tree.domNode, "onKey", dojo.lang.hitch(this, this.onKey));
}, onKey:function (e) {
if (!e.key || e.ctrkKey || e.altKey) {
return;
}
switch (e.key) {
case e.KEY_ENTER:
var node = this.domElement2TreeNode(e.target);
if (node) {
this.processNode(node, e);
}
}
}, onAfterChangeTree:function (message) {
if (!message.oldTree && message.node.selected) {
this.select(message.node);
}
if (!message.newTree || !this.listenedTrees[message.newTree.widgetId]) {
if (this.selectedNode && message.node.children) {
this.deselectIfAncestorMatch(message.node);
}
}
}, initialize:function (args) {
for (name in this.eventNamesDefault) {
if (dojo.lang.isUndefined(this.eventNames[name])) {
this.eventNames[name] = this.widgetId + "/" + this.eventNamesDefault[name];
}
}
}, onBeforeTreeDestroy:function (message) {
this.unlistenTree(message.source);
}, onAfterCollapse:function (message) {
this.deselectIfAncestorMatch(message.source);
}, onTreeDblClick:function (event) {
this.onTreeClick(event);
}, checkSpecialEvent:function (event) {
return event.shiftKey || event.ctrlKey;
}, onTreeClick:function (event) {
var node = this.domElement2TreeNode(event.target);
if (!node) {
return;
}
var checkLabelClick = function (domElement) {
return domElement === node.labelNode;
};
if (this.checkPathCondition(event.target, checkLabelClick)) {
this.processNode(node, event);
}
}, processNode:function (node, event) {
if (node.actionIsDisabled(node.actions.SELECT)) {
return;
}
if (dojo.lang.inArray(this.selectedNodes, node)) {
if (this.checkSpecialEvent(event)) {
this.deselect(node);
return;
}
var _this = this;
var i = 0;
var selectedNode;
while (this.selectedNodes.length > i) {
selectedNode = this.selectedNodes[i];
if (selectedNode !== node) {
this.deselect(selectedNode);
continue;
}
i++;
}
var wasJustClicked = this.checkRecentClick(node);
eventName = wasJustClicked ? this.eventNames.dblselect : this.eventNames.select;
if (wasJustClicked) {
eventName = this.eventNames.dblselect;
this.forgetLastClicked();
} else {
eventName = this.eventNames.select;
this.setLastClicked(node);
}
dojo.event.topic.publish(eventName, {node:node});
return;
}
this.deselectIfNoMulti(event);
this.setLastClicked(node);
this.select(node);
}, forgetLastClicked:function () {
this.lastClicked = {};
}, setLastClicked:function (node) {
this.lastClicked.date = new Date();
this.lastClicked.node = node;
}, checkRecentClick:function (node) {
var diff = new Date() - this.lastClicked.date;
if (this.lastClicked.node && diff < this.dblselectTimeout) {
return true;
} else {
return false;
}
}, deselectIfNoMulti:function (event) {
if (!this.checkSpecialEvent(event) || !this.allowedMulti) {
this.deselectAll();
}
}, deselectIfAncestorMatch:function (ancestor) {
var _this = this;
dojo.lang.forEach(this.selectedNodes, function (node) {
var selectedNode = node;
node = node.parent;
while (node && node.isTreeNode) {
if (node === ancestor) {
_this.deselect(selectedNode);
return;
}
node = node.parent;
}
});
}, onAfterDetach:function (message) {
this.deselectIfAncestorMatch(message.child);
}, select:function (node) {
var index = dojo.lang.find(this.selectedNodes, node, true);
if (index >= 0) {
return;
}
this.selectedNodes.push(node);
dojo.event.topic.publish(this.eventNames.select, {node:node});
}, deselect:function (node) {
var index = dojo.lang.find(this.selectedNodes, node, true);
if (index < 0) {
return;
}
this.selectedNodes.splice(index, 1);
dojo.event.topic.publish(this.eventNames.deselect, {node:node});
}, deselectAll:function () {
while (this.selectedNodes.length) {
this.deselect(this.selectedNodes[0]);
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/TreeLinkExtension.js
New file
0,0 → 1,44
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeLinkExtension");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.TreeExtension");
dojo.widget.defineWidget("dojo.widget.TreeLinkExtension", dojo.widget.TreeExtension, function () {
this.params = {};
}, {listenTreeEvents:["afterChangeTree"], listenTree:function (tree) {
dojo.widget.TreeCommon.prototype.listenTree.call(this, tree);
var labelNode = tree.labelNodeTemplate;
var newLabel = this.makeALabel();
dojo.html.setClass(newLabel, dojo.html.getClass(labelNode));
labelNode.parentNode.replaceChild(newLabel, labelNode);
}, makeALabel:function () {
var newLabel = document.createElement("a");
for (var key in this.params) {
if (key in {}) {
continue;
}
newLabel.setAttribute(key, this.params[key]);
}
return newLabel;
}, onAfterChangeTree:function (message) {
var _this = this;
if (!message.oldTree) {
this.listenNode(message.node);
}
}, listenNode:function (node) {
for (var key in node.object) {
if (key in {}) {
continue;
}
node.labelNode.setAttribute(key, node.object[key]);
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/RealNumberTextbox.js
New file
0,0 → 1,48
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.RealNumberTextbox");
dojo.require("dojo.widget.IntegerTextbox");
dojo.require("dojo.validate.common");
dojo.widget.defineWidget("dojo.widget.RealNumberTextbox", dojo.widget.IntegerTextbox, {mixInProperties:function (localProperties, frag) {
dojo.widget.RealNumberTextbox.superclass.mixInProperties.apply(this, arguments);
if (localProperties.places) {
this.flags.places = Number(localProperties.places);
}
if ((localProperties.exponent == "true") || (localProperties.exponent == "always")) {
this.flags.exponent = true;
} else {
if ((localProperties.exponent == "false") || (localProperties.exponent == "never")) {
this.flags.exponent = false;
} else {
this.flags.exponent = [true, false];
}
}
if ((localProperties.esigned == "true") || (localProperties.esigned == "always")) {
this.flags.eSigned = true;
} else {
if ((localProperties.esigned == "false") || (localProperties.esigned == "never")) {
this.flags.eSigned = false;
} else {
this.flags.eSigned = [true, false];
}
}
if (localProperties.min) {
this.flags.min = parseFloat(localProperties.min);
}
if (localProperties.max) {
this.flags.max = parseFloat(localProperties.max);
}
}, isValid:function () {
return dojo.validate.isRealNumber(this.textbox.value, this.flags);
}, isInRange:function () {
return dojo.validate.isInRange(this.textbox.value, this.flags);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Manager.js
New file
0,0 → 1,286
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Manager");
dojo.require("dojo.lang.array");
dojo.require("dojo.lang.func");
dojo.require("dojo.event.*");
dojo.widget.manager = new function () {
this.widgets = [];
this.widgetIds = [];
this.topWidgets = {};
var widgetTypeCtr = {};
var renderPrefixCache = [];
this.getUniqueId = function (widgetType) {
var widgetId;
do {
widgetId = widgetType + "_" + (widgetTypeCtr[widgetType] != undefined ? ++widgetTypeCtr[widgetType] : widgetTypeCtr[widgetType] = 0);
} while (this.getWidgetById(widgetId));
return widgetId;
};
this.add = function (widget) {
this.widgets.push(widget);
if (!widget.extraArgs["id"]) {
widget.extraArgs["id"] = widget.extraArgs["ID"];
}
if (widget.widgetId == "") {
if (widget["id"]) {
widget.widgetId = widget["id"];
} else {
if (widget.extraArgs["id"]) {
widget.widgetId = widget.extraArgs["id"];
} else {
widget.widgetId = this.getUniqueId(widget.ns + "_" + widget.widgetType);
}
}
}
if (this.widgetIds[widget.widgetId]) {
dojo.debug("widget ID collision on ID: " + widget.widgetId);
}
this.widgetIds[widget.widgetId] = widget;
};
this.destroyAll = function () {
for (var x = this.widgets.length - 1; x >= 0; x--) {
try {
this.widgets[x].destroy(true);
delete this.widgets[x];
}
catch (e) {
}
}
};
this.remove = function (widgetIndex) {
if (dojo.lang.isNumber(widgetIndex)) {
var tw = this.widgets[widgetIndex].widgetId;
delete this.topWidgets[tw];
delete this.widgetIds[tw];
this.widgets.splice(widgetIndex, 1);
} else {
this.removeById(widgetIndex);
}
};
this.removeById = function (id) {
if (!dojo.lang.isString(id)) {
id = id["widgetId"];
if (!id) {
dojo.debug("invalid widget or id passed to removeById");
return;
}
}
for (var i = 0; i < this.widgets.length; i++) {
if (this.widgets[i].widgetId == id) {
this.remove(i);
break;
}
}
};
this.getWidgetById = function (id) {
if (dojo.lang.isString(id)) {
return this.widgetIds[id];
}
return id;
};
this.getWidgetsByType = function (type) {
var lt = type.toLowerCase();
var getType = (type.indexOf(":") < 0 ? function (x) {
return x.widgetType.toLowerCase();
} : function (x) {
return x.getNamespacedType();
});
var ret = [];
dojo.lang.forEach(this.widgets, function (x) {
if (getType(x) == lt) {
ret.push(x);
}
});
return ret;
};
this.getWidgetsByFilter = function (unaryFunc, onlyOne) {
var ret = [];
dojo.lang.every(this.widgets, function (x) {
if (unaryFunc(x)) {
ret.push(x);
if (onlyOne) {
return false;
}
}
return true;
});
return (onlyOne ? ret[0] : ret);
};
this.getAllWidgets = function () {
return this.widgets.concat();
};
this.getWidgetByNode = function (node) {
var w = this.getAllWidgets();
node = dojo.byId(node);
for (var i = 0; i < w.length; i++) {
if (w[i].domNode == node) {
return w[i];
}
}
return null;
};
this.byId = this.getWidgetById;
this.byType = this.getWidgetsByType;
this.byFilter = this.getWidgetsByFilter;
this.byNode = this.getWidgetByNode;
var knownWidgetImplementations = {};
var widgetPackages = ["dojo.widget"];
for (var i = 0; i < widgetPackages.length; i++) {
widgetPackages[widgetPackages[i]] = true;
}
this.registerWidgetPackage = function (pname) {
if (!widgetPackages[pname]) {
widgetPackages[pname] = true;
widgetPackages.push(pname);
}
};
this.getWidgetPackageList = function () {
return dojo.lang.map(widgetPackages, function (elt) {
return (elt !== true ? elt : undefined);
});
};
this.getImplementation = function (widgetName, ctorObject, mixins, ns) {
var impl = this.getImplementationName(widgetName, ns);
if (impl) {
var ret = ctorObject ? new impl(ctorObject) : new impl();
return ret;
}
};
function buildPrefixCache() {
for (var renderer in dojo.render) {
if (dojo.render[renderer]["capable"] === true) {
var prefixes = dojo.render[renderer].prefixes;
for (var i = 0; i < prefixes.length; i++) {
renderPrefixCache.push(prefixes[i].toLowerCase());
}
}
}
}
var findImplementationInModule = function (lowerCaseWidgetName, module) {
if (!module) {
return null;
}
for (var i = 0, l = renderPrefixCache.length, widgetModule; i <= l; i++) {
widgetModule = (i < l ? module[renderPrefixCache[i]] : module);
if (!widgetModule) {
continue;
}
for (var name in widgetModule) {
if (name.toLowerCase() == lowerCaseWidgetName) {
return widgetModule[name];
}
}
}
return null;
};
var findImplementation = function (lowerCaseWidgetName, moduleName) {
var module = dojo.evalObjPath(moduleName, false);
return (module ? findImplementationInModule(lowerCaseWidgetName, module) : null);
};
this.getImplementationName = function (widgetName, ns) {
var lowerCaseWidgetName = widgetName.toLowerCase();
ns = ns || "dojo";
var imps = knownWidgetImplementations[ns] || (knownWidgetImplementations[ns] = {});
var impl = imps[lowerCaseWidgetName];
if (impl) {
return impl;
}
if (!renderPrefixCache.length) {
buildPrefixCache();
}
var nsObj = dojo.ns.get(ns);
if (!nsObj) {
dojo.ns.register(ns, ns + ".widget");
nsObj = dojo.ns.get(ns);
}
if (nsObj) {
nsObj.resolve(widgetName);
}
impl = findImplementation(lowerCaseWidgetName, nsObj.module);
if (impl) {
return (imps[lowerCaseWidgetName] = impl);
}
nsObj = dojo.ns.require(ns);
if ((nsObj) && (nsObj.resolver)) {
nsObj.resolve(widgetName);
impl = findImplementation(lowerCaseWidgetName, nsObj.module);
if (impl) {
return (imps[lowerCaseWidgetName] = impl);
}
}
dojo.deprecated("dojo.widget.Manager.getImplementationName", "Could not locate widget implementation for \"" + widgetName + "\" in \"" + nsObj.module + "\" registered to namespace \"" + nsObj.name + "\". " + "Developers must specify correct namespaces for all non-Dojo widgets", "0.5");
for (var i = 0; i < widgetPackages.length; i++) {
impl = findImplementation(lowerCaseWidgetName, widgetPackages[i]);
if (impl) {
return (imps[lowerCaseWidgetName] = impl);
}
}
throw new Error("Could not locate widget implementation for \"" + widgetName + "\" in \"" + nsObj.module + "\" registered to namespace \"" + nsObj.name + "\"");
};
this.resizing = false;
this.onWindowResized = function () {
if (this.resizing) {
return;
}
try {
this.resizing = true;
for (var id in this.topWidgets) {
var child = this.topWidgets[id];
if (child.checkSize) {
child.checkSize();
}
}
}
catch (e) {
}
finally {
this.resizing = false;
}
};
if (typeof window != "undefined") {
dojo.addOnLoad(this, "onWindowResized");
dojo.event.connect(window, "onresize", this, "onWindowResized");
}
};
(function () {
var dw = dojo.widget;
var dwm = dw.manager;
var h = dojo.lang.curry(dojo.lang, "hitch", dwm);
var g = function (oldName, newName) {
dw[(newName || oldName)] = h(oldName);
};
g("add", "addWidget");
g("destroyAll", "destroyAllWidgets");
g("remove", "removeWidget");
g("removeById", "removeWidgetById");
g("getWidgetById");
g("getWidgetById", "byId");
g("getWidgetsByType");
g("getWidgetsByFilter");
g("getWidgetsByType", "byType");
g("getWidgetsByFilter", "byFilter");
g("getWidgetByNode", "byNode");
dw.all = function (n) {
var widgets = dwm.getAllWidgets.apply(dwm, arguments);
if (arguments.length > 0) {
return widgets[n];
}
return widgets;
};
g("registerWidgetPackage");
g("getImplementation", "getWidgetImplementation");
g("getImplementationName", "getWidgetImplementationName");
dw.widgets = dwm.widgets;
dw.widgetIds = dwm.widgetIds;
dw.root = dwm.root;
})();
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/DatePicker.js
New file
0,0 → 1,347
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.DatePicker");
dojo.require("dojo.date.common");
dojo.require("dojo.date.format");
dojo.require("dojo.date.serialize");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.event.*");
dojo.require("dojo.dom");
dojo.require("dojo.html.style");
dojo.widget.defineWidget("dojo.widget.DatePicker", dojo.widget.HtmlWidget, {value:"", name:"", displayWeeks:6, adjustWeeks:false, startDate:"1492-10-12", endDate:"2941-10-12", weekStartsOn:"", staticDisplay:false, dayWidth:"narrow", classNames:{previous:"previousMonth", disabledPrevious:"previousMonthDisabled", current:"currentMonth", disabledCurrent:"currentMonthDisabled", next:"nextMonth", disabledNext:"nextMonthDisabled", currentDate:"currentDate", selectedDate:"selectedDate"}, templateString:"<div class=\"datePickerContainer\" dojoAttachPoint=\"datePickerContainerNode\">\n\t<table cellspacing=\"0\" cellpadding=\"0\" class=\"calendarContainer\">\n\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<td class=\"monthWrapper\" valign=\"top\">\n\t\t\t\t\t<table class=\"monthContainer\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td class=\"monthCurve monthCurveTL\" valign=\"top\"></td>\n\t\t\t\t\t\t\t<td class=\"monthLabelContainer\" valign=\"top\">\n\t\t\t\t\t\t\t\t<span dojoAttachPoint=\"increaseWeekNode\" \n\t\t\t\t\t\t\t\t\tdojoAttachEvent=\"onClick: onIncrementWeek;\" \n\t\t\t\t\t\t\t\t\tclass=\"incrementControl increase\">\n\t\t\t\t\t\t\t\t\t<img src=\"${dojoWidgetModuleUri}templates/images/incrementMonth.png\" \n\t\t\t\t\t\t\t\t\talt=\"&darr;\" style=\"width:7px;height:5px;\" />\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span \n\t\t\t\t\t\t\t\t\tdojoAttachPoint=\"increaseMonthNode\" \n\t\t\t\t\t\t\t\t\tdojoAttachEvent=\"onClick: onIncrementMonth;\" class=\"incrementControl increase\">\n\t\t\t\t\t\t\t\t\t<img src=\"${dojoWidgetModuleUri}templates/images/incrementMonth.png\" \n\t\t\t\t\t\t\t\t\t\talt=\"&darr;\" dojoAttachPoint=\"incrementMonthImageNode\">\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span \n\t\t\t\t\t\t\t\t\tdojoAttachPoint=\"decreaseWeekNode\" \n\t\t\t\t\t\t\t\t\tdojoAttachEvent=\"onClick: onIncrementWeek;\" \n\t\t\t\t\t\t\t\t\tclass=\"incrementControl decrease\">\n\t\t\t\t\t\t\t\t\t<img src=\"${dojoWidgetModuleUri}templates/images/decrementMonth.png\" alt=\"&uarr;\" style=\"width:7px;height:5px;\" />\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span \n\t\t\t\t\t\t\t\t\tdojoAttachPoint=\"decreaseMonthNode\" \n\t\t\t\t\t\t\t\t\tdojoAttachEvent=\"onClick: onIncrementMonth;\" class=\"incrementControl decrease\">\n\t\t\t\t\t\t\t\t\t<img src=\"${dojoWidgetModuleUri}templates/images/decrementMonth.png\" \n\t\t\t\t\t\t\t\t\t\talt=\"&uarr;\" dojoAttachPoint=\"decrementMonthImageNode\">\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span dojoAttachPoint=\"monthLabelNode\" class=\"month\"></span>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class=\"monthCurve monthCurveTR\" valign=\"top\"></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td colspan=\"3\">\n\t\t\t\t\t<table class=\"calendarBodyContainer\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t<tr dojoAttachPoint=\"dayLabelsRow\">\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t<tbody dojoAttachPoint=\"calendarDatesContainerNode\" \n\t\t\t\t\t\t\tdojoAttachEvent=\"onClick: _handleUiClick;\">\n\t\t\t\t\t\t\t<tr dojoAttachPoint=\"calendarWeekTemplate\">\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\t<tr>\n\t\t\t\t<td colspan=\"3\" class=\"yearWrapper\">\n\t\t\t\t\t<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" class=\"yearContainer\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td class=\"curveBL\" valign=\"top\"></td>\n\t\t\t\t\t\t\t<td valign=\"top\">\n\t\t\t\t\t\t\t\t<h3 class=\"yearLabel\">\n\t\t\t\t\t\t\t\t\t<span dojoAttachPoint=\"previousYearLabelNode\"\n\t\t\t\t\t\t\t\t\t\tdojoAttachEvent=\"onClick: onIncrementYear;\" class=\"previousYear\"></span>\n\t\t\t\t\t\t\t\t\t<span class=\"selectedYear\" dojoAttachPoint=\"currentYearLabelNode\"></span>\n\t\t\t\t\t\t\t\t\t<span dojoAttachPoint=\"nextYearLabelNode\" \n\t\t\t\t\t\t\t\t\t\tdojoAttachEvent=\"onClick: onIncrementYear;\" class=\"nextYear\"></span>\n\t\t\t\t\t\t\t\t</h3>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class=\"curveBR\" valign=\"top\"></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</tfoot>\n\t</table>\n</div>\n", templateCssString:".datePickerContainer {\n\twidth:164px; /* needed for proper user styling */\n}\n\n.calendarContainer {\n/*\tborder:1px solid #566f8f;*/\n}\n\n.calendarBodyContainer {\n\twidth:100%; /* needed for the explode effect (explain?) */\n\tbackground: #7591bc url(\"images/dpBg.gif\") top left repeat-x;\n}\n\n.calendarBodyContainer thead tr td {\n\tcolor:#293a4b;\n\tfont:bold 0.75em Helvetica, Arial, Verdana, sans-serif;\n\ttext-align:center;\n\tpadding:0.25em;\n\tbackground: url(\"images/dpHorizLine.gif\") bottom left repeat-x;\n}\n\n.calendarBodyContainer tbody tr td {\n\tcolor:#fff;\n\tfont:bold 0.7em Helvetica, Arial, Verdana, sans-serif;\n\ttext-align:center;\n\tpadding:0.4em;\n\tbackground: url(\"images/dpVertLine.gif\") top right repeat-y;\n\tcursor:pointer;\n\tcursor:hand;\n}\n\n\n.monthWrapper {\n\tpadding-bottom:2px;\n\tbackground: url(\"images/dpHorizLine.gif\") bottom left repeat-x;\n}\n\n.monthContainer {\n\twidth:100%;\n}\n\n.monthLabelContainer {\n\ttext-align:center;\n\tfont:bold 0.75em Helvetica, Arial, Verdana, sans-serif;\n\tbackground: url(\"images/dpMonthBg.png\") repeat-x top left !important;\n\tcolor:#293a4b;\n\tpadding:0.25em;\n}\n\n.monthCurve {\n\twidth:12px;\n}\n\n.monthCurveTL {\n\tbackground: url(\"images/dpCurveTL.png\") no-repeat top left !important;\n}\n\n.monthCurveTR {\n\t\tbackground: url(\"images/dpCurveTR.png\") no-repeat top right !important;\n}\n\n\n.yearWrapper {\n\tbackground: url(\"images/dpHorizLineFoot.gif\") top left repeat-x;\n\tpadding-top:2px;\n}\n\n.yearContainer {\n\twidth:100%;\n}\n\n.yearContainer td {\n\tbackground:url(\"images/dpYearBg.png\") top left repeat-x;\n}\n\n.yearContainer .yearLabel {\n\tmargin:0;\n\tpadding:0.45em 0 0.45em 0;\n\tcolor:#fff;\n\tfont:bold 0.75em Helvetica, Arial, Verdana, sans-serif;\n\ttext-align:center;\n}\n\n.curveBL {\n\tbackground: url(\"images/dpCurveBL.png\") bottom left no-repeat !important;\n\twidth:9px !important;\n\tpadding:0;\n\tmargin:0;\n}\n\n.curveBR {\n\tbackground: url(\"images/dpCurveBR.png\") bottom right no-repeat !important;\n\twidth:9px !important;\n\tpadding:0;\n\tmargin:0;\n}\n\n\n.previousMonth {\n\tbackground-color:#6782a8 !important;\n}\n\n.previousMonthDisabled {\n\tbackground-color:#a4a5a6 !important;\n\tcursor:default !important\n}\n.currentMonth {\n}\n\n.currentMonthDisabled {\n\tbackground-color:#bbbbbc !important;\n\tcursor:default !important\n}\n.nextMonth {\n\tbackground-color:#6782a8 !important;\n}\n.nextMonthDisabled {\n\tbackground-color:#a4a5a6 !important;\n\tcursor:default !important;\n}\n\n.currentDate {\n\ttext-decoration:underline;\n\tfont-style:italic;\n}\n\n.selectedDate {\n\tbackground-color:#fff !important;\n\tcolor:#6782a8 !important;\n}\n\n.yearLabel .selectedYear {\n\tpadding:0.2em;\n\tbackground-color:#9ec3fb !important;\n}\n\n.nextYear, .previousYear {\n\tcursor:pointer;cursor:hand;\n\tpadding:0;\n}\n\n.nextYear {\n\tmargin:0 0 0 0.55em;\n}\n\n.previousYear {\n\tmargin:0 0.55em 0 0;\n}\n\n.incrementControl {\n\tcursor:pointer;cursor:hand;\n\twidth:1em;\n}\n\n.increase {\n\tfloat:right;\n}\n\n.decrease {\n\tfloat:left;\n}\n\n.lastColumn {\n\tbackground-image:none !important;\n}\n\n\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/DatePicker.css"), postMixInProperties:function () {
dojo.widget.DatePicker.superclass.postMixInProperties.apply(this, arguments);
if (!this.weekStartsOn) {
this.weekStartsOn = dojo.date.getFirstDayOfWeek(this.lang);
}
this.today = new Date();
this.today.setHours(0, 0, 0, 0);
if (typeof (this.value) == "string" && this.value.toLowerCase() == "today") {
this.value = new Date();
} else {
if (this.value && (typeof this.value == "string") && (this.value.split("-").length > 2)) {
this.value = dojo.date.fromRfc3339(this.value);
this.value.setHours(0, 0, 0, 0);
}
}
}, fillInTemplate:function (args, frag) {
dojo.widget.DatePicker.superclass.fillInTemplate.apply(this, arguments);
var source = this.getFragNodeRef(frag);
dojo.html.copyStyle(this.domNode, source);
this.weekTemplate = dojo.dom.removeNode(this.calendarWeekTemplate);
this._preInitUI(this.value ? this.value : this.today, false, true);
var dayLabels = dojo.lang.unnest(dojo.date.getNames("days", this.dayWidth, "standAlone", this.lang));
if (this.weekStartsOn > 0) {
for (var i = 0; i < this.weekStartsOn; i++) {
dayLabels.push(dayLabels.shift());
}
}
var dayLabelNodes = this.dayLabelsRow.getElementsByTagName("td");
for (i = 0; i < 7; i++) {
dayLabelNodes.item(i).innerHTML = dayLabels[i];
}
if (this.value) {
this.setValue(this.value);
}
}, getValue:function () {
return dojo.date.toRfc3339(new Date(this.value), "dateOnly");
}, getDate:function () {
return this.value;
}, setValue:function (rfcDate) {
this.setDate(rfcDate);
}, setDate:function (dateObj) {
if (dateObj == "") {
this.value = "";
this._preInitUI(this.curMonth, false, true);
} else {
if (typeof dateObj == "string") {
this.value = dojo.date.fromRfc3339(dateObj);
this.value.setHours(0, 0, 0, 0);
} else {
this.value = new Date(dateObj);
this.value.setHours(0, 0, 0, 0);
}
}
if (this.selectedNode != null) {
dojo.html.removeClass(this.selectedNode, this.classNames.selectedDate);
}
if (this.clickedNode != null) {
dojo.debug("adding selectedDate");
dojo.html.addClass(this.clickedNode, this.classNames.selectedDate);
this.selectedNode = this.clickedNode;
} else {
this._preInitUI(this.value, false, true);
}
this.clickedNode = null;
this.onValueChanged(this.value);
}, _preInitUI:function (dateObj, initFirst, initUI) {
if (typeof (this.startDate) == "string") {
this.startDate = dojo.date.fromRfc3339(this.startDate);
}
if (typeof (this.endDate) == "string") {
this.endDate = dojo.date.fromRfc3339(this.endDate);
}
this.startDate.setHours(0, 0, 0, 0);
this.endDate.setHours(24, 0, 0, -1);
if (dateObj < this.startDate || dateObj > this.endDate) {
dateObj = new Date((dateObj < this.startDate) ? this.startDate : this.endDate);
}
this.firstDay = this._initFirstDay(dateObj, initFirst);
this.selectedIsUsed = false;
this.currentIsUsed = false;
var nextDate = new Date(this.firstDay);
var tmpMonth = nextDate.getMonth();
this.curMonth = new Date(nextDate);
this.curMonth.setDate(nextDate.getDate() + 6);
this.curMonth.setDate(1);
if (this.displayWeeks == "" || this.adjustWeeks) {
this.adjustWeeks = true;
this.displayWeeks = Math.ceil((dojo.date.getDaysInMonth(this.curMonth) + this._getAdjustedDay(this.curMonth)) / 7);
}
var days = this.displayWeeks * 7;
if (dojo.date.diff(this.startDate, this.endDate, dojo.date.dateParts.DAY) < days) {
this.staticDisplay = true;
if (dojo.date.diff(nextDate, this.endDate, dojo.date.dateParts.DAY) > days) {
this._preInitUI(this.startDate, true, false);
nextDate = new Date(this.firstDay);
}
this.curMonth = new Date(nextDate);
this.curMonth.setDate(nextDate.getDate() + 6);
this.curMonth.setDate(1);
var curClass = (nextDate.getMonth() == this.curMonth.getMonth()) ? "current" : "previous";
}
if (initUI) {
this._initUI(days);
}
}, _initUI:function (days) {
dojo.dom.removeChildren(this.calendarDatesContainerNode);
for (var i = 0; i < this.displayWeeks; i++) {
this.calendarDatesContainerNode.appendChild(this.weekTemplate.cloneNode(true));
}
var nextDate = new Date(this.firstDay);
this._setMonthLabel(this.curMonth.getMonth());
this._setYearLabels(this.curMonth.getFullYear());
var calendarNodes = this.calendarDatesContainerNode.getElementsByTagName("td");
var calendarRows = this.calendarDatesContainerNode.getElementsByTagName("tr");
var currentCalendarNode;
for (i = 0; i < days; i++) {
currentCalendarNode = calendarNodes.item(i);
currentCalendarNode.innerHTML = nextDate.getDate();
currentCalendarNode.setAttribute("djDateValue", nextDate.valueOf());
var curClass = (nextDate.getMonth() != this.curMonth.getMonth() && Number(nextDate) < Number(this.curMonth)) ? "previous" : (nextDate.getMonth() == this.curMonth.getMonth()) ? "current" : "next";
var mappedClass = curClass;
if (this._isDisabledDate(nextDate)) {
var classMap = {previous:"disabledPrevious", current:"disabledCurrent", next:"disabledNext"};
mappedClass = classMap[curClass];
}
dojo.html.setClass(currentCalendarNode, this._getDateClassName(nextDate, mappedClass));
if (dojo.html.hasClass(currentCalendarNode, this.classNames.selectedDate)) {
this.selectedNode = currentCalendarNode;
}
nextDate = dojo.date.add(nextDate, dojo.date.dateParts.DAY, 1);
}
this.lastDay = dojo.date.add(nextDate, dojo.date.dateParts.DAY, -1);
this._initControls();
}, _initControls:function () {
var d = this.firstDay;
var d2 = this.lastDay;
var decWeek, incWeek, decMonth, incMonth, decYear, incYear;
decWeek = incWeek = decMonth = incMonth = decYear = incYear = !this.staticDisplay;
with (dojo.date.dateParts) {
var add = dojo.date.add;
if (decWeek && add(d, DAY, (-1 * (this._getAdjustedDay(d) + 1))) < this.startDate) {
decWeek = decMonth = decYear = false;
}
if (incWeek && d2 > this.endDate) {
incWeek = incMonth = incYear = false;
}
if (decMonth && add(d, DAY, -1) < this.startDate) {
decMonth = decYear = false;
}
if (incMonth && add(d2, DAY, 1) > this.endDate) {
incMonth = incYear = false;
}
if (decYear && add(d2, YEAR, -1) < this.startDate) {
decYear = false;
}
if (incYear && add(d, YEAR, 1) > this.endDate) {
incYear = false;
}
}
function enableControl(node, enabled) {
dojo.html.setVisibility(node, enabled ? "" : "hidden");
}
enableControl(this.decreaseWeekNode, decWeek);
enableControl(this.increaseWeekNode, incWeek);
enableControl(this.decreaseMonthNode, decMonth);
enableControl(this.increaseMonthNode, incMonth);
enableControl(this.previousYearLabelNode, decYear);
enableControl(this.nextYearLabelNode, incYear);
}, _incrementWeek:function (evt) {
var d = new Date(this.firstDay);
switch (evt.target) {
case this.increaseWeekNode.getElementsByTagName("img").item(0):
case this.increaseWeekNode:
var tmpDate = dojo.date.add(d, dojo.date.dateParts.WEEK, 1);
if (tmpDate < this.endDate) {
d = dojo.date.add(d, dojo.date.dateParts.WEEK, 1);
}
break;
case this.decreaseWeekNode.getElementsByTagName("img").item(0):
case this.decreaseWeekNode:
if (d >= this.startDate) {
d = dojo.date.add(d, dojo.date.dateParts.WEEK, -1);
}
break;
}
this._preInitUI(d, true, true);
}, _incrementMonth:function (evt) {
var d = new Date(this.curMonth);
var tmpDate = new Date(this.firstDay);
switch (evt.currentTarget) {
case this.increaseMonthNode.getElementsByTagName("img").item(0):
case this.increaseMonthNode:
tmpDate = dojo.date.add(tmpDate, dojo.date.dateParts.DAY, this.displayWeeks * 7);
if (tmpDate < this.endDate) {
d = dojo.date.add(d, dojo.date.dateParts.MONTH, 1);
} else {
var revertToEndDate = true;
}
break;
case this.decreaseMonthNode.getElementsByTagName("img").item(0):
case this.decreaseMonthNode:
if (tmpDate > this.startDate) {
d = dojo.date.add(d, dojo.date.dateParts.MONTH, -1);
} else {
var revertToStartDate = true;
}
break;
}
if (revertToStartDate) {
d = new Date(this.startDate);
} else {
if (revertToEndDate) {
d = new Date(this.endDate);
}
}
this._preInitUI(d, false, true);
}, _incrementYear:function (evt) {
var year = this.curMonth.getFullYear();
var tmpDate = new Date(this.firstDay);
switch (evt.target) {
case this.nextYearLabelNode:
tmpDate = dojo.date.add(tmpDate, dojo.date.dateParts.YEAR, 1);
if (tmpDate < this.endDate) {
year++;
} else {
var revertToEndDate = true;
}
break;
case this.previousYearLabelNode:
tmpDate = dojo.date.add(tmpDate, dojo.date.dateParts.YEAR, -1);
if (tmpDate > this.startDate) {
year--;
} else {
var revertToStartDate = true;
}
break;
}
var d;
if (revertToStartDate) {
d = new Date(this.startDate);
} else {
if (revertToEndDate) {
d = new Date(this.endDate);
} else {
d = new Date(year, this.curMonth.getMonth(), 1);
}
}
this._preInitUI(d, false, true);
}, onIncrementWeek:function (evt) {
evt.stopPropagation();
if (!this.staticDisplay) {
this._incrementWeek(evt);
}
}, onIncrementMonth:function (evt) {
evt.stopPropagation();
if (!this.staticDisplay) {
this._incrementMonth(evt);
}
}, onIncrementYear:function (evt) {
evt.stopPropagation();
if (!this.staticDisplay) {
this._incrementYear(evt);
}
}, _setMonthLabel:function (monthIndex) {
this.monthLabelNode.innerHTML = dojo.date.getNames("months", "wide", "standAlone", this.lang)[monthIndex];
}, _setYearLabels:function (year) {
var y = year - 1;
var that = this;
function f(n) {
that[n + "YearLabelNode"].innerHTML = dojo.date.format(new Date(y++, 0), {formatLength:"yearOnly", locale:that.lang});
}
f("previous");
f("current");
f("next");
}, _getDateClassName:function (date, monthState) {
var currentClassName = this.classNames[monthState];
if ((!this.selectedIsUsed && this.value) && (Number(date) == Number(this.value))) {
currentClassName = this.classNames.selectedDate + " " + currentClassName;
this.selectedIsUsed = true;
}
if ((!this.currentIsUsed) && (Number(date) == Number(this.today))) {
currentClassName = currentClassName + " " + this.classNames.currentDate;
this.currentIsUsed = true;
}
return currentClassName;
}, onClick:function (evt) {
dojo.event.browser.stopEvent(evt);
}, _handleUiClick:function (evt) {
var eventTarget = evt.target;
if (eventTarget.nodeType != dojo.dom.ELEMENT_NODE) {
eventTarget = eventTarget.parentNode;
}
dojo.event.browser.stopEvent(evt);
this.selectedIsUsed = this.todayIsUsed = false;
if (dojo.html.hasClass(eventTarget, this.classNames["disabledPrevious"]) || dojo.html.hasClass(eventTarget, this.classNames["disabledCurrent"]) || dojo.html.hasClass(eventTarget, this.classNames["disabledNext"])) {
return;
}
this.clickedNode = eventTarget;
this.setDate(new Date(Number(dojo.html.getAttribute(eventTarget, "djDateValue"))));
}, onValueChanged:function (date) {
}, _isDisabledDate:function (dateObj) {
if (dateObj < this.startDate || dateObj > this.endDate) {
return true;
}
return this.isDisabledDate(dateObj, this.lang);
}, isDisabledDate:function (dateObj, locale) {
return false;
}, _initFirstDay:function (dateObj, adj) {
var d = new Date(dateObj);
if (!adj) {
d.setDate(1);
}
d.setDate(d.getDate() - this._getAdjustedDay(d, this.weekStartsOn));
d.setHours(0, 0, 0, 0);
return d;
}, _getAdjustedDay:function (dateObj) {
var days = [0, 1, 2, 3, 4, 5, 6];
if (this.weekStartsOn > 0) {
for (var i = 0; i < this.weekStartsOn; i++) {
days.unshift(days.pop());
}
}
return days[dateObj.getDay()];
}, destroy:function () {
dojo.widget.DatePicker.superclass.destroy.apply(this, arguments);
dojo.html.destroyNode(this.weekTemplate);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Button.js
New file
0,0 → 1,257
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Button");
dojo.require("dojo.lang.extras");
dojo.require("dojo.html.*");
dojo.require("dojo.html.selection");
dojo.require("dojo.widget.*");
dojo.widget.defineWidget("dojo.widget.Button", dojo.widget.HtmlWidget, {isContainer:true, caption:"", templateString:"<div dojoAttachPoint=\"buttonNode\" class=\"dojoButton\" style=\"position:relative;\" dojoAttachEvent=\"onMouseOver; onMouseOut; onMouseDown; onMouseUp; onClick:buttonClick; onKey:onKey; onFocus;\">\n <div class=\"dojoButtonContents\" align=center dojoAttachPoint=\"containerNode\" style=\"position:absolute;z-index:2;\"></div>\n <img dojoAttachPoint=\"leftImage\" style=\"position:absolute;left:0px;\">\n <img dojoAttachPoint=\"centerImage\" style=\"position:absolute;z-index:1;\">\n <img dojoAttachPoint=\"rightImage\" style=\"position:absolute;top:0px;right:0px;\">\n</div>\n", templateCssString:"/* ---- button --- */\n.dojoButton {\n\tpadding: 0 0 0 0;\n\tfont-size: 8pt;\n\twhite-space: nowrap;\n\tcursor: pointer;\n\tfont-family: Myriad, Tahoma, Verdana, sans-serif;\n}\n\n.dojoButton .dojoButtonContents {\n\tpadding: 2px 2px 2px 2px;\n\ttext-align: center;\t\t/* if icon and label are split across two lines, center icon */\n\tcolor: white;\n}\n\n.dojoButtonLeftPart .dojoButtonContents {\n\tpadding-right: 8px;\n}\n\n.dojoButtonDisabled {\n\tcursor: url(\"images/no.gif\"), default;\n}\n\n\n.dojoButtonContents img {\n\tvertical-align: middle;\t/* if icon and label are on same line, center them */\n}\n\n/* -------- colors ------------ */\n\n.dojoButtonHover .dojoButtonContents {\n}\n\n.dojoButtonDepressed .dojoButtonContents {\n\tcolor: #293a4b;\n}\n\n.dojoButtonDisabled .dojoButtonContents {\n\tcolor: #aaa;\n}\n\n\n/* ---------- drop down button specific ---------- */\n\n/* border between label and arrow (for drop down buttons */\n.dojoButton .border {\n\twidth: 1px;\n\tbackground: gray;\n}\n\n/* button arrow */\n.dojoButton .downArrow {\n\tpadding-left: 10px;\n\ttext-align: center;\n}\n\n.dojoButton.disabled .downArrow {\n\tcursor : default;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/ButtonTemplate.css"), inactiveImg:"templates/images/soriaButton-", activeImg:"templates/images/soriaActive-", pressedImg:"templates/images/soriaPressed-", disabledImg:"templates/images/soriaDisabled-", width2height:1 / 3, fillInTemplate:function () {
if (this.caption) {
this.containerNode.appendChild(document.createTextNode(this.caption));
}
dojo.html.disableSelection(this.containerNode);
}, postCreate:function () {
this._sizeMyself();
}, _sizeMyself:function () {
if (this.domNode.parentNode) {
var placeHolder = document.createElement("span");
dojo.html.insertBefore(placeHolder, this.domNode);
}
dojo.body().appendChild(this.domNode);
this._sizeMyselfHelper();
if (placeHolder) {
dojo.html.insertBefore(this.domNode, placeHolder);
dojo.html.removeNode(placeHolder);
}
}, _sizeMyselfHelper:function () {
var mb = dojo.html.getMarginBox(this.containerNode);
this.height = mb.height;
this.containerWidth = mb.width;
var endWidth = this.height * this.width2height;
this.containerNode.style.left = endWidth + "px";
this.leftImage.height = this.rightImage.height = this.centerImage.height = this.height;
this.leftImage.width = this.rightImage.width = endWidth + 1;
this.centerImage.width = this.containerWidth;
this.centerImage.style.left = endWidth + "px";
this._setImage(this.disabled ? this.disabledImg : this.inactiveImg);
if (this.disabled) {
dojo.html.prependClass(this.domNode, "dojoButtonDisabled");
this.domNode.removeAttribute("tabIndex");
dojo.widget.wai.setAttr(this.domNode, "waiState", "disabled", true);
} else {
dojo.html.removeClass(this.domNode, "dojoButtonDisabled");
this.domNode.setAttribute("tabIndex", "0");
dojo.widget.wai.setAttr(this.domNode, "waiState", "disabled", false);
}
this.domNode.style.height = this.height + "px";
this.domNode.style.width = (this.containerWidth + 2 * endWidth) + "px";
}, onMouseOver:function (e) {
if (this.disabled) {
return;
}
if (!dojo.html.hasClass(this.buttonNode, "dojoButtonHover")) {
dojo.html.prependClass(this.buttonNode, "dojoButtonHover");
}
this._setImage(this.activeImg);
}, onMouseDown:function (e) {
if (this.disabled) {
return;
}
dojo.html.prependClass(this.buttonNode, "dojoButtonDepressed");
dojo.html.removeClass(this.buttonNode, "dojoButtonHover");
this._setImage(this.pressedImg);
}, onMouseUp:function (e) {
if (this.disabled) {
return;
}
dojo.html.prependClass(this.buttonNode, "dojoButtonHover");
dojo.html.removeClass(this.buttonNode, "dojoButtonDepressed");
this._setImage(this.activeImg);
}, onMouseOut:function (e) {
if (this.disabled) {
return;
}
if (e.toElement && dojo.html.isDescendantOf(e.toElement, this.buttonNode)) {
return;
}
dojo.html.removeClass(this.buttonNode, "dojoButtonHover");
dojo.html.removeClass(this.buttonNode, "dojoButtonDepressed");
this._setImage(this.inactiveImg);
}, onKey:function (e) {
if (!e.key) {
return;
}
var menu = dojo.widget.getWidgetById(this.menuId);
if (e.key == e.KEY_ENTER || e.key == " ") {
this.onMouseDown(e);
this.buttonClick(e);
dojo.lang.setTimeout(this, "onMouseUp", 75, e);
dojo.event.browser.stopEvent(e);
}
if (menu && menu.isShowingNow && e.key == e.KEY_DOWN_ARROW) {
dojo.event.disconnect(this.domNode, "onblur", this, "onBlur");
}
}, onFocus:function (e) {
var menu = dojo.widget.getWidgetById(this.menuId);
if (menu) {
dojo.event.connectOnce(this.domNode, "onblur", this, "onBlur");
}
}, onBlur:function (e) {
var menu = dojo.widget.getWidgetById(this.menuId);
if (!menu) {
return;
}
if (menu.close && menu.isShowingNow) {
menu.close();
}
}, buttonClick:function (e) {
if (!this.disabled) {
try {
this.domNode.focus();
}
catch (e2) {
}
this.onClick(e);
}
}, onClick:function (e) {
}, _setImage:function (prefix) {
this.leftImage.src = dojo.uri.moduleUri("dojo.widget", prefix + "l.gif");
this.centerImage.src = dojo.uri.moduleUri("dojo.widget", prefix + "c.gif");
this.rightImage.src = dojo.uri.moduleUri("dojo.widget", prefix + "r.gif");
}, _toggleMenu:function (menuId) {
var menu = dojo.widget.getWidgetById(menuId);
if (!menu) {
return;
}
if (menu.open && !menu.isShowingNow) {
var pos = dojo.html.getAbsolutePosition(this.domNode, false);
menu.open(pos.x, pos.y + this.height, this);
dojo.event.disconnect(this.domNode, "onblur", this, "onBlur");
} else {
if (menu.close && menu.isShowingNow) {
menu.close();
} else {
menu.toggle();
}
}
}, setCaption:function (content) {
this.caption = content;
this.containerNode.innerHTML = content;
this._sizeMyself();
}, setDisabled:function (disabled) {
this.disabled = disabled;
this._sizeMyself();
}});
dojo.widget.defineWidget("dojo.widget.DropDownButton", dojo.widget.Button, {menuId:"", downArrow:"templates/images/whiteDownArrow.gif", disabledDownArrow:"templates/images/whiteDownArrow.gif", fillInTemplate:function () {
dojo.widget.DropDownButton.superclass.fillInTemplate.apply(this, arguments);
this.arrow = document.createElement("img");
dojo.html.setClass(this.arrow, "downArrow");
dojo.widget.wai.setAttr(this.domNode, "waiState", "haspopup", this.menuId);
}, _sizeMyselfHelper:function () {
this.arrow.src = dojo.uri.moduleUri("dojo.widget", this.disabled ? this.disabledDownArrow : this.downArrow);
this.containerNode.appendChild(this.arrow);
dojo.widget.DropDownButton.superclass._sizeMyselfHelper.call(this);
}, onClick:function (e) {
this._toggleMenu(this.menuId);
}});
dojo.widget.defineWidget("dojo.widget.ComboButton", dojo.widget.Button, {menuId:"", templateString:"<div class=\"dojoButton\" style=\"position:relative;top:0px;left:0px; text-align:none;\" dojoAttachEvent=\"onKey;onFocus\">\n\n\t<div dojoAttachPoint=\"buttonNode\" class=\"dojoButtonLeftPart\" style=\"position:absolute;left:0px;top:0px;\"\n\t\tdojoAttachEvent=\"onMouseOver; onMouseOut; onMouseDown; onMouseUp; onClick:buttonClick;\">\n\t\t<div class=\"dojoButtonContents\" dojoAttachPoint=\"containerNode\" style=\"position:absolute;top:0px;right:0px;z-index:2;\"></div>\n\t\t<img dojoAttachPoint=\"leftImage\" style=\"position:absolute;left:0px;top:0px;\">\n\t\t<img dojoAttachPoint=\"centerImage\" style=\"position:absolute;right:0px;top:0px;z-index:1;\">\n\t</div>\n\n\t<div dojoAttachPoint=\"rightPart\" class=\"dojoButtonRightPart\" style=\"position:absolute;top:0px;right:0px;\"\n\t\tdojoAttachEvent=\"onMouseOver:rightOver; onMouseOut:rightOut; onMouseDown:rightDown; onMouseUp:rightUp; onClick:rightClick;\">\n\t\t<img dojoAttachPoint=\"arrowBackgroundImage\" style=\"position:absolute;top:0px;left:0px;z-index:1;\">\n\t\t<img src=\"${dojoWidgetModuleUri}templates/images/whiteDownArrow.gif\"\n\t\t \t\tstyle=\"z-index:2;position:absolute;left:3px;top:50%;\">\n\t\t<img dojoAttachPoint=\"rightImage\" style=\"position:absolute;top:0px;right:0px;\">\n\t</div>\n\n</div>\n", splitWidth:2, arrowWidth:5, _sizeMyselfHelper:function (e) {
var mb = dojo.html.getMarginBox(this.containerNode);
this.height = mb.height;
this.containerWidth = mb.width;
var endWidth = this.height / 3;
if (this.disabled) {
dojo.widget.wai.setAttr(this.domNode, "waiState", "disabled", true);
this.domNode.removeAttribute("tabIndex");
} else {
dojo.widget.wai.setAttr(this.domNode, "waiState", "disabled", false);
this.domNode.setAttribute("tabIndex", "0");
}
this.leftImage.height = this.rightImage.height = this.centerImage.height = this.arrowBackgroundImage.height = this.height;
this.leftImage.width = endWidth + 1;
this.centerImage.width = this.containerWidth;
this.buttonNode.style.height = this.height + "px";
this.buttonNode.style.width = endWidth + this.containerWidth + "px";
this._setImage(this.disabled ? this.disabledImg : this.inactiveImg);
this.arrowBackgroundImage.width = this.arrowWidth;
this.rightImage.width = endWidth + 1;
this.rightPart.style.height = this.height + "px";
this.rightPart.style.width = this.arrowWidth + endWidth + "px";
this._setImageR(this.disabled ? this.disabledImg : this.inactiveImg);
this.domNode.style.height = this.height + "px";
var totalWidth = this.containerWidth + this.splitWidth + this.arrowWidth + 2 * endWidth;
this.domNode.style.width = totalWidth + "px";
}, _setImage:function (prefix) {
this.leftImage.src = dojo.uri.moduleUri("dojo.widget", prefix + "l.gif");
this.centerImage.src = dojo.uri.moduleUri("dojo.widget", prefix + "c.gif");
}, rightOver:function (e) {
if (this.disabled) {
return;
}
dojo.html.prependClass(this.rightPart, "dojoButtonHover");
this._setImageR(this.activeImg);
}, rightDown:function (e) {
if (this.disabled) {
return;
}
dojo.html.prependClass(this.rightPart, "dojoButtonDepressed");
dojo.html.removeClass(this.rightPart, "dojoButtonHover");
this._setImageR(this.pressedImg);
}, rightUp:function (e) {
if (this.disabled) {
return;
}
dojo.html.prependClass(this.rightPart, "dojoButtonHover");
dojo.html.removeClass(this.rightPart, "dojoButtonDepressed");
this._setImageR(this.activeImg);
}, rightOut:function (e) {
if (this.disabled) {
return;
}
dojo.html.removeClass(this.rightPart, "dojoButtonHover");
dojo.html.removeClass(this.rightPart, "dojoButtonDepressed");
this._setImageR(this.inactiveImg);
}, rightClick:function (e) {
if (this.disabled) {
return;
}
try {
this.domNode.focus();
}
catch (e2) {
}
this._toggleMenu(this.menuId);
}, _setImageR:function (prefix) {
this.arrowBackgroundImage.src = dojo.uri.moduleUri("dojo.widget", prefix + "c.gif");
this.rightImage.src = dojo.uri.moduleUri("dojo.widget", prefix + "r.gif");
}, onKey:function (e) {
if (!e.key) {
return;
}
var menu = dojo.widget.getWidgetById(this.menuId);
if (e.key == e.KEY_ENTER || e.key == " ") {
this.onMouseDown(e);
this.buttonClick(e);
dojo.lang.setTimeout(this, "onMouseUp", 75, e);
dojo.event.browser.stopEvent(e);
} else {
if (e.key == e.KEY_DOWN_ARROW && e.altKey) {
this.rightDown(e);
this.rightClick(e);
dojo.lang.setTimeout(this, "rightUp", 75, e);
dojo.event.browser.stopEvent(e);
} else {
if (menu && menu.isShowingNow && e.key == e.KEY_DOWN_ARROW) {
dojo.event.disconnect(this.domNode, "onblur", this, "onBlur");
}
}
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/ShowAction.js
New file
0,0 → 1,18
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.ShowAction");
dojo.require("dojo.widget.*");
dojo.widget.defineWidget("dojo.widget.ShowAction", dojo.widget.HtmlWidget, {on:"", action:"fade", duration:350, from:"", to:"", auto:"false", postMixInProperties:function () {
if (dojo.render.html.opera) {
this.action = this.action.split("/").pop();
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/TreeNodeV3.js
New file
0,0 → 1,308
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeNodeV3");
dojo.require("dojo.html.*");
dojo.require("dojo.event.*");
dojo.require("dojo.io.*");
dojo.require("dojo.widget.TreeWithNode");
dojo.widget.defineWidget("dojo.widget.TreeNodeV3", [dojo.widget.HtmlWidget, dojo.widget.TreeWithNode], function () {
this.actionsDisabled = [];
this.object = {};
}, {tryLazyInit:true, actions:{MOVE:"MOVE", DETACH:"DETACH", EDIT:"EDIT", ADDCHILD:"ADDCHILD", SELECT:"SELECT"}, labelClass:"", contentClass:"", expandNode:null, labelNode:null, nodeDocType:"", selected:false, getnodeDocType:function () {
return this.nodeDocType;
}, cloneProperties:["actionsDisabled", "tryLazyInit", "nodeDocType", "objectId", "object", "title", "isFolder", "isExpanded", "state"], clone:function (deep) {
var ret = new this.constructor();
for (var i = 0; i < this.cloneProperties.length; i++) {
var prop = this.cloneProperties[i];
ret[prop] = dojo.lang.shallowCopy(this[prop], true);
}
if (this.tree.unsetFolderOnEmpty && !deep && this.isFolder) {
ret.isFolder = false;
}
ret.toggleObj = this.toggleObj;
dojo.widget.manager.add(ret);
ret.tree = this.tree;
ret.buildRendering({}, {});
ret.initialize({}, {});
if (deep && this.children.length) {
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child.clone) {
ret.children.push(child.clone(deep));
} else {
ret.children.push(dojo.lang.shallowCopy(child, deep));
}
}
ret.setChildren();
}
return ret;
}, markProcessing:function () {
this.markProcessingSavedClass = dojo.html.getClass(this.expandNode);
dojo.html.setClass(this.expandNode, this.tree.classPrefix + "ExpandLoading");
}, unmarkProcessing:function () {
dojo.html.setClass(this.expandNode, this.markProcessingSavedClass);
}, buildRendering:function (args, fragment, parent) {
if (args.tree) {
this.tree = dojo.lang.isString(args.tree) ? dojo.widget.manager.getWidgetById(args.tree) : args.tree;
} else {
if (parent && parent.tree) {
this.tree = parent.tree;
}
}
if (!this.tree) {
dojo.raise("Can't evaluate tree from arguments or parent");
}
this.domNode = this.tree.nodeTemplate.cloneNode(true);
this.expandNode = this.domNode.firstChild;
this.contentNode = this.domNode.childNodes[1];
this.labelNode = this.contentNode.firstChild;
if (this.labelClass) {
dojo.html.addClass(this.labelNode, this.labelClass);
}
if (this.contentClass) {
dojo.html.addClass(this.contentNode, this.contentClass);
}
this.domNode.widgetId = this.widgetId;
this.labelNode.innerHTML = this.title;
}, isTreeNode:true, object:{}, title:"", isFolder:null, contentNode:null, expandClass:"", isExpanded:false, containerNode:null, getInfo:function () {
var info = {widgetId:this.widgetId, objectId:this.objectId, index:this.getParentIndex()};
return info;
}, setFolder:function () {
this.isFolder = true;
this.viewSetExpand();
if (!this.containerNode) {
this.viewAddContainer();
}
dojo.event.topic.publish(this.tree.eventNames.afterSetFolder, {source:this});
}, initialize:function (args, frag, parent) {
if (args.isFolder) {
this.isFolder = true;
}
if (this.children.length || this.isFolder) {
this.setFolder();
} else {
this.viewSetExpand();
}
for (var i = 0; i < this.actionsDisabled.length; i++) {
this.actionsDisabled[i] = this.actionsDisabled[i].toUpperCase();
}
dojo.event.topic.publish(this.tree.eventNames.afterChangeTree, {oldTree:null, newTree:this.tree, node:this});
}, unsetFolder:function () {
this.isFolder = false;
this.viewSetExpand();
dojo.event.topic.publish(this.tree.eventNames.afterUnsetFolder, {source:this});
}, insertNode:function (parent, index) {
if (!index) {
index = 0;
}
if (index == 0) {
dojo.html.prependChild(this.domNode, parent.containerNode);
} else {
dojo.html.insertAfter(this.domNode, parent.children[index - 1].domNode);
}
}, updateTree:function (newTree) {
if (this.tree === newTree) {
return;
}
var oldTree = this.tree;
dojo.lang.forEach(this.getDescendants(), function (elem) {
elem.tree = newTree;
});
if (oldTree.classPrefix != newTree.classPrefix) {
var stack = [this.domNode];
var elem;
var reg = new RegExp("(^|\\s)" + oldTree.classPrefix, "g");
while (elem = stack.pop()) {
for (var i = 0; i < elem.childNodes.length; i++) {
var childNode = elem.childNodes[i];
if (childNode.nodeDocType != 1) {
continue;
}
dojo.html.setClass(childNode, dojo.html.getClass(childNode).replace(reg, "$1" + newTree.classPrefix));
stack.push(childNode);
}
}
}
var message = {oldTree:oldTree, newTree:newTree, node:this};
dojo.event.topic.publish(this.tree.eventNames.afterChangeTree, message);
dojo.event.topic.publish(newTree.eventNames.afterChangeTree, message);
}, addedTo:function (parent, index, dontPublishEvent) {
if (this.tree !== parent.tree) {
this.updateTree(parent.tree);
}
if (parent.isTreeNode) {
if (!parent.isFolder) {
parent.setFolder();
parent.state = parent.loadStates.LOADED;
}
}
var siblingsCount = parent.children.length;
this.insertNode(parent, index);
this.viewAddLayout();
if (siblingsCount > 1) {
if (index == 0 && parent.children[1] instanceof dojo.widget.Widget) {
parent.children[1].viewUpdateLayout();
}
if (index == siblingsCount - 1 && parent.children[siblingsCount - 2] instanceof dojo.widget.Widget) {
parent.children[siblingsCount - 2].viewUpdateLayout();
}
} else {
if (parent.isTreeNode) {
parent.viewSetHasChildren();
}
}
if (!dontPublishEvent) {
var message = {child:this, index:index, parent:parent};
dojo.event.topic.publish(this.tree.eventNames.afterAddChild, message);
}
}, createSimple:function (args, parent) {
if (args.tree) {
var tree = args.tree;
} else {
if (parent) {
var tree = parent.tree;
} else {
dojo.raise("createSimple: can't evaluate tree");
}
}
tree = dojo.widget.byId(tree);
var treeNode = new tree.defaultChildWidget();
for (var x in args) {
treeNode[x] = args[x];
}
treeNode.toggleObj = dojo.lfx.toggle[treeNode.toggle.toLowerCase()] || dojo.lfx.toggle.plain;
dojo.widget.manager.add(treeNode);
treeNode.buildRendering(args, {}, parent);
treeNode.initialize(args, {}, parent);
if (treeNode.parent) {
delete dojo.widget.manager.topWidgets[treeNode.widgetId];
}
return treeNode;
}, viewUpdateLayout:function () {
this.viewRemoveLayout();
this.viewAddLayout();
}, viewAddContainer:function () {
this.containerNode = this.tree.containerNodeTemplate.cloneNode(true);
this.domNode.appendChild(this.containerNode);
}, viewAddLayout:function () {
if (this.parent["isTree"]) {
dojo.html.setClass(this.domNode, dojo.html.getClass(this.domNode) + " " + this.tree.classPrefix + "IsRoot");
}
if (this.isLastChild()) {
dojo.html.setClass(this.domNode, dojo.html.getClass(this.domNode) + " " + this.tree.classPrefix + "IsLast");
}
}, viewRemoveLayout:function () {
dojo.html.removeClass(this.domNode, this.tree.classPrefix + "IsRoot");
dojo.html.removeClass(this.domNode, this.tree.classPrefix + "IsLast");
}, viewGetExpandClass:function () {
if (this.isFolder) {
return this.isExpanded ? "ExpandOpen" : "ExpandClosed";
} else {
return "ExpandLeaf";
}
}, viewSetExpand:function () {
var expand = this.tree.classPrefix + this.viewGetExpandClass();
var reg = new RegExp("(^|\\s)" + this.tree.classPrefix + "Expand\\w+", "g");
dojo.html.setClass(this.domNode, dojo.html.getClass(this.domNode).replace(reg, "") + " " + expand);
this.viewSetHasChildrenAndExpand();
}, viewGetChildrenClass:function () {
return "Children" + (this.children.length ? "Yes" : "No");
}, viewSetHasChildren:function () {
var clazz = this.tree.classPrefix + this.viewGetChildrenClass();
var reg = new RegExp("(^|\\s)" + this.tree.classPrefix + "Children\\w+", "g");
dojo.html.setClass(this.domNode, dojo.html.getClass(this.domNode).replace(reg, "") + " " + clazz);
this.viewSetHasChildrenAndExpand();
}, viewSetHasChildrenAndExpand:function () {
var clazz = this.tree.classPrefix + "State" + this.viewGetChildrenClass() + "-" + this.viewGetExpandClass();
var reg = new RegExp("(^|\\s)" + this.tree.classPrefix + "State[\\w-]+", "g");
dojo.html.setClass(this.domNode, dojo.html.getClass(this.domNode).replace(reg, "") + " " + clazz);
}, viewUnfocus:function () {
dojo.html.removeClass(this.labelNode, this.tree.classPrefix + "LabelFocused");
}, viewFocus:function () {
dojo.html.addClass(this.labelNode, this.tree.classPrefix + "LabelFocused");
}, viewEmphasize:function () {
dojo.html.clearSelection(this.labelNode);
dojo.html.addClass(this.labelNode, this.tree.classPrefix + "NodeEmphasized");
}, viewUnemphasize:function () {
dojo.html.removeClass(this.labelNode, this.tree.classPrefix + "NodeEmphasized");
}, detach:function () {
if (!this.parent) {
return;
}
var parent = this.parent;
var index = this.getParentIndex();
this.doDetach.apply(this, arguments);
dojo.event.topic.publish(this.tree.eventNames.afterDetach, {child:this, parent:parent, index:index});
}, doDetach:function () {
var parent = this.parent;
if (!parent) {
return;
}
var index = this.getParentIndex();
this.viewRemoveLayout();
dojo.widget.DomWidget.prototype.removeChild.call(parent, this);
var siblingsCount = parent.children.length;
if (siblingsCount > 0) {
if (index == 0) {
parent.children[0].viewUpdateLayout();
}
if (index == siblingsCount) {
parent.children[siblingsCount - 1].viewUpdateLayout();
}
} else {
if (parent.isTreeNode) {
parent.viewSetHasChildren();
}
}
if (this.tree.unsetFolderOnEmpty && !parent.children.length && parent.isTreeNode) {
parent.unsetFolder();
}
this.parent = null;
}, destroy:function () {
dojo.event.topic.publish(this.tree.eventNames.beforeNodeDestroy, {source:this});
this.detach();
return dojo.widget.HtmlWidget.prototype.destroy.apply(this, arguments);
}, expand:function () {
if (this.isExpanded) {
return;
}
if (this.tryLazyInit) {
this.setChildren();
this.tryLazyInit = false;
}
this.isExpanded = true;
this.viewSetExpand();
this.showChildren();
}, collapse:function () {
if (!this.isExpanded) {
return;
}
this.isExpanded = false;
this.hideChildren();
}, hideChildren:function () {
this.tree.toggleObj.hide(this.containerNode, this.tree.toggleDuration, this.explodeSrc, dojo.lang.hitch(this, "onHideChildren"));
}, showChildren:function () {
this.tree.toggleObj.show(this.containerNode, this.tree.toggleDuration, this.explodeSrc, dojo.lang.hitch(this, "onShowChildren"));
}, onShowChildren:function () {
this.onShow();
dojo.event.topic.publish(this.tree.eventNames.afterExpand, {source:this});
}, onHideChildren:function () {
this.viewSetExpand();
this.onHide();
dojo.event.topic.publish(this.tree.eventNames.afterCollapse, {source:this});
}, setTitle:function (title) {
var oldTitle = this.title;
this.labelNode.innerHTML = this.title = title;
dojo.event.topic.publish(this.tree.eventNames.afterSetTitle, {source:this, oldTitle:oldTitle});
}, toString:function () {
return "[" + this.widgetType + ", " + this.title + "]";
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/SwtWidget.js
New file
0,0 → 1,52
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.SwtWidget");
dojo.require("dojo.experimental");
dojo.experimental("dojo.widget.SwtWidget");
dojo.require("dojo.event.*");
dojo.require("dojo.widget.Widget");
dojo.require("dojo.uri.*");
dojo.require("dojo.lang.func");
dojo.require("dojo.lang.extras");
try {
importPackage(Packages.org.eclipse.swt.widgets);
dojo.declare("dojo.widget.SwtWidget", dojo.widget.Widget, function () {
if ((arguments.length > 0) && (typeof arguments[0] == "object")) {
this.create(arguments[0]);
}
}, {display:null, shell:null, show:function () {
}, hide:function () {
}, addChild:function () {
}, registerChild:function () {
}, addWidgetAsDirectChild:function () {
}, removeChild:function () {
}, destroyRendering:function () {
}, postInitialize:function () {
}});
dojo.widget.SwtWidget.prototype.display = new Display();
dojo.widget.SwtWidget.prototype.shell = new Shell(dojo.widget.SwtWidget.prototype.display);
dojo.widget.manager.startShell = function () {
var sh = dojo.widget.SwtWidget.prototype.shell;
var d = dojo.widget.SwtWidget.prototype.display;
sh.open();
while (!sh.isDisposed()) {
dojo.widget.manager.doNext();
if (!d.readAndDispatch()) {
d.sleep();
}
}
d.dispose();
};
}
catch (e) {
dojo.debug("dojo.widget.SwtWidget not loaded. SWT classes not available");
}
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/TreeRpcControllerV3.js
New file
0,0 → 1,180
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeRpcControllerV3");
dojo.require("dojo.event.*");
dojo.require("dojo.json");
dojo.require("dojo.io.*");
dojo.require("dojo.widget.TreeLoadingControllerV3");
dojo.widget.defineWidget("dojo.widget.TreeRpcControllerV3", dojo.widget.TreeLoadingControllerV3, {extraRpcOnEdit:false, doMove:function (child, newParent, index, sync) {
var params = {child:this.getInfo(child), childTree:this.getInfo(child.tree), oldParent:this.getInfo(child.parent), oldParentTree:this.getInfo(child.parent.tree), newParent:this.getInfo(newParent), newParentTree:this.getInfo(newParent.tree), newIndex:index};
var deferred = this.runRpc({url:this.getRpcUrl("move"), sync:sync, params:params});
var _this = this;
var args = arguments;
deferred.addCallback(function () {
dojo.widget.TreeBasicControllerV3.prototype.doMove.apply(_this, args);
});
return deferred;
}, prepareDetach:function (node, sync) {
var deferred = this.startProcessing(node);
return deferred;
}, finalizeDetach:function (node) {
this.finishProcessing(node);
}, doDetach:function (node, sync) {
var params = {node:this.getInfo(node), tree:this.getInfo(node.tree)};
var deferred = this.runRpc({url:this.getRpcUrl("detach"), sync:sync, params:params});
var _this = this;
var args = arguments;
deferred.addCallback(function () {
dojo.widget.TreeBasicControllerV3.prototype.doDetach.apply(_this, args);
});
return deferred;
}, requestEditConfirmation:function (node, action, sync) {
if (!this.extraRpcOnEdit) {
return dojo.Deferred.prototype.makeCalled();
}
var _this = this;
var deferred = this.startProcessing(node);
var params = {node:this.getInfo(node), tree:this.getInfo(node.tree)};
deferred.addCallback(function () {
return _this.runRpc({url:_this.getRpcUrl(action), sync:sync, params:params});
});
deferred.addBoth(function (r) {
_this.finishProcessing(node);
return r;
});
return deferred;
}, editLabelSave:function (node, newContent, sync) {
var deferred = this.startProcessing(node);
var _this = this;
var params = {node:this.getInfo(node), tree:this.getInfo(node.tree), newContent:newContent};
deferred.addCallback(function () {
return _this.runRpc({url:_this.getRpcUrl("editLabelSave"), sync:sync, params:params});
});
deferred.addBoth(function (r) {
_this.finishProcessing(node);
return r;
});
return deferred;
}, editLabelStart:function (node, sync) {
if (!this.canEditLabel(node)) {
return false;
}
var _this = this;
if (!this.editor.isClosed()) {
var deferred = this.editLabelFinish(this.editor.saveOnBlur, sync);
deferred.addCallback(function () {
return _this.editLabelStart(node, sync);
});
return deferred;
}
var deferred = this.requestEditConfirmation(node, "editLabelStart", sync);
deferred.addCallback(function () {
_this.doEditLabelStart(node);
});
return deferred;
}, editLabelFinish:function (save, sync) {
var _this = this;
var node = this.editor.node;
var deferred = dojo.Deferred.prototype.makeCalled();
if (!save && !node.isPhantom) {
deferred = this.requestEditConfirmation(this.editor.node, "editLabelFinishCancel", sync);
}
if (save) {
if (node.isPhantom) {
deferred = this.sendCreateChildRequest(node.parent, node.getParentIndex(), {title:this.editor.getContents()}, sync);
} else {
deferred = this.editLabelSave(node, this.editor.getContents(), sync);
}
}
deferred.addCallback(function (server_data) {
_this.doEditLabelFinish(save, server_data);
});
deferred.addErrback(function (r) {
_this.doEditLabelFinish(false);
return false;
});
return deferred;
}, createAndEdit:function (parent, index, sync) {
var data = {title:parent.tree.defaultChildTitle};
if (!this.canCreateChild(parent, index, data)) {
return false;
}
if (!this.editor.isClosed()) {
var deferred = this.editLabelFinish(this.editor.saveOnBlur, sync);
deferred.addCallback(function () {
return _this.createAndEdit(parent, index, sync);
});
return deferred;
}
var _this = this;
var deferred = this.prepareCreateChild(parent, index, data, sync);
deferred.addCallback(function () {
var child = _this.makeDefaultNode(parent, index);
child.isPhantom = true;
return child;
});
deferred.addBoth(function (r) {
_this.finalizeCreateChild(parent, index, data, sync);
return r;
});
deferred.addCallback(function (child) {
var d = _this.exposeCreateChild(parent, index, data, sync);
d.addCallback(function () {
return child;
});
return d;
});
deferred.addCallback(function (child) {
_this.doEditLabelStart(child);
return child;
});
return deferred;
}, prepareDestroyChild:function (node, sync) {
var deferred = this.startProcessing(node);
return deferred;
}, finalizeDestroyChild:function (node) {
this.finishProcessing(node);
}, doDestroyChild:function (node, sync) {
var params = {node:this.getInfo(node), tree:this.getInfo(node.tree)};
var deferred = this.runRpc({url:this.getRpcUrl("destroyChild"), sync:sync, params:params});
var _this = this;
var args = arguments;
deferred.addCallback(function () {
dojo.widget.TreeBasicControllerV3.prototype.doDestroyChild.apply(_this, args);
});
return deferred;
}, sendCreateChildRequest:function (parent, index, data, sync) {
var params = {tree:this.getInfo(parent.tree), parent:this.getInfo(parent), index:index, data:data};
var deferred = this.runRpc({url:this.getRpcUrl("createChild"), sync:sync, params:params});
return deferred;
}, doCreateChild:function (parent, index, data, sync) {
if (dojo.lang.isUndefined(data.title)) {
data.title = parent.tree.defaultChildTitle;
}
var deferred = this.sendCreateChildRequest(parent, index, data, sync);
var _this = this;
var args = arguments;
deferred.addCallback(function (server_data) {
dojo.lang.mixin(data, server_data);
return dojo.widget.TreeBasicControllerV3.prototype.doCreateChild.call(_this, parent, index, data);
});
return deferred;
}, doClone:function (child, newParent, index, deep, sync) {
var params = {child:this.getInfo(child), oldParent:this.getInfo(child.parent), oldParentTree:this.getInfo(child.parent.tree), newParent:this.getInfo(newParent), newParentTree:this.getInfo(newParent.tree), index:index, deep:deep ? true : false, tree:this.getInfo(child.tree)};
var deferred = this.runRpc({url:this.getRpcUrl("clone"), sync:sync, params:params});
var _this = this;
var args = arguments;
deferred.addCallback(function () {
dojo.widget.TreeBasicControllerV3.prototype.doClone.apply(_this, args);
});
return deferred;
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Widget.js
New file
0,0 → 1,310
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Widget");
dojo.require("dojo.lang.func");
dojo.require("dojo.lang.array");
dojo.require("dojo.lang.extras");
dojo.require("dojo.lang.declare");
dojo.require("dojo.ns");
dojo.require("dojo.widget.Manager");
dojo.require("dojo.event.*");
dojo.require("dojo.a11y");
dojo.declare("dojo.widget.Widget", null, function () {
this.children = [];
this.extraArgs = {};
}, {parent:null, isTopLevel:false, disabled:false, isContainer:false, widgetId:"", widgetType:"Widget", ns:"dojo", getNamespacedType:function () {
return (this.ns ? this.ns + ":" + this.widgetType : this.widgetType).toLowerCase();
}, toString:function () {
return "[Widget " + this.getNamespacedType() + ", " + (this.widgetId || "NO ID") + "]";
}, repr:function () {
return this.toString();
}, enable:function () {
this.disabled = false;
}, disable:function () {
this.disabled = true;
}, onResized:function () {
this.notifyChildrenOfResize();
}, notifyChildrenOfResize:function () {
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (child.onResized) {
child.onResized();
}
}
}, create:function (args, fragment, parent, ns) {
if (ns) {
this.ns = ns;
}
this.satisfyPropertySets(args, fragment, parent);
this.mixInProperties(args, fragment, parent);
this.postMixInProperties(args, fragment, parent);
dojo.widget.manager.add(this);
this.buildRendering(args, fragment, parent);
this.initialize(args, fragment, parent);
this.postInitialize(args, fragment, parent);
this.postCreate(args, fragment, parent);
return this;
}, destroy:function (finalize) {
if (this.parent) {
this.parent.removeChild(this);
}
this.destroyChildren();
this.uninitialize();
this.destroyRendering(finalize);
dojo.widget.manager.removeById(this.widgetId);
}, destroyChildren:function () {
var widget;
var i = 0;
while (this.children.length > i) {
widget = this.children[i];
if (widget instanceof dojo.widget.Widget) {
this.removeChild(widget);
widget.destroy();
continue;
}
i++;
}
}, getChildrenOfType:function (type, recurse) {
var ret = [];
var isFunc = dojo.lang.isFunction(type);
if (!isFunc) {
type = type.toLowerCase();
}
for (var x = 0; x < this.children.length; x++) {
if (isFunc) {
if (this.children[x] instanceof type) {
ret.push(this.children[x]);
}
} else {
if (this.children[x].widgetType.toLowerCase() == type) {
ret.push(this.children[x]);
}
}
if (recurse) {
ret = ret.concat(this.children[x].getChildrenOfType(type, recurse));
}
}
return ret;
}, getDescendants:function () {
var result = [];
var stack = [this];
var elem;
while ((elem = stack.pop())) {
result.push(elem);
if (elem.children) {
dojo.lang.forEach(elem.children, function (elem) {
stack.push(elem);
});
}
}
return result;
}, isFirstChild:function () {
return this === this.parent.children[0];
}, isLastChild:function () {
return this === this.parent.children[this.parent.children.length - 1];
}, satisfyPropertySets:function (args) {
return args;
}, mixInProperties:function (args, frag) {
if ((args["fastMixIn"]) || (frag["fastMixIn"])) {
for (var x in args) {
this[x] = args[x];
}
return;
}
var undef;
var lcArgs = dojo.widget.lcArgsCache[this.widgetType];
if (lcArgs == null) {
lcArgs = {};
for (var y in this) {
lcArgs[((new String(y)).toLowerCase())] = y;
}
dojo.widget.lcArgsCache[this.widgetType] = lcArgs;
}
var visited = {};
for (var x in args) {
if (!this[x]) {
var y = lcArgs[(new String(x)).toLowerCase()];
if (y) {
args[y] = args[x];
x = y;
}
}
if (visited[x]) {
continue;
}
visited[x] = true;
if ((typeof this[x]) != (typeof undef)) {
if (typeof args[x] != "string") {
this[x] = args[x];
} else {
if (dojo.lang.isString(this[x])) {
this[x] = args[x];
} else {
if (dojo.lang.isNumber(this[x])) {
this[x] = new Number(args[x]);
} else {
if (dojo.lang.isBoolean(this[x])) {
this[x] = (args[x].toLowerCase() == "false") ? false : true;
} else {
if (dojo.lang.isFunction(this[x])) {
if (args[x].search(/[^\w\.]+/i) == -1) {
this[x] = dojo.evalObjPath(args[x], false);
} else {
var tn = dojo.lang.nameAnonFunc(new Function(args[x]), this);
dojo.event.kwConnect({srcObj:this, srcFunc:x, adviceObj:this, adviceFunc:tn});
}
} else {
if (dojo.lang.isArray(this[x])) {
this[x] = args[x].split(";");
} else {
if (this[x] instanceof Date) {
this[x] = new Date(Number(args[x]));
} else {
if (typeof this[x] == "object") {
if (this[x] instanceof dojo.uri.Uri) {
this[x] = dojo.uri.dojoUri(args[x]);
} else {
var pairs = args[x].split(";");
for (var y = 0; y < pairs.length; y++) {
var si = pairs[y].indexOf(":");
if ((si != -1) && (pairs[y].length > si)) {
this[x][pairs[y].substr(0, si).replace(/^\s+|\s+$/g, "")] = pairs[y].substr(si + 1);
}
}
}
} else {
this[x] = args[x];
}
}
}
}
}
}
}
}
} else {
this.extraArgs[x.toLowerCase()] = args[x];
}
}
}, postMixInProperties:function (args, frag, parent) {
}, initialize:function (args, frag, parent) {
return false;
}, postInitialize:function (args, frag, parent) {
return false;
}, postCreate:function (args, frag, parent) {
return false;
}, uninitialize:function () {
return false;
}, buildRendering:function (args, frag, parent) {
dojo.unimplemented("dojo.widget.Widget.buildRendering, on " + this.toString() + ", ");
return false;
}, destroyRendering:function () {
dojo.unimplemented("dojo.widget.Widget.destroyRendering");
return false;
}, addedTo:function (parent) {
}, addChild:function (child) {
dojo.unimplemented("dojo.widget.Widget.addChild");
return false;
}, removeChild:function (widget) {
for (var x = 0; x < this.children.length; x++) {
if (this.children[x] === widget) {
this.children.splice(x, 1);
widget.parent = null;
break;
}
}
return widget;
}, getPreviousSibling:function () {
var idx = this.getParentIndex();
if (idx <= 0) {
return null;
}
return this.parent.children[idx - 1];
}, getSiblings:function () {
return this.parent.children;
}, getParentIndex:function () {
return dojo.lang.indexOf(this.parent.children, this, true);
}, getNextSibling:function () {
var idx = this.getParentIndex();
if (idx == this.parent.children.length - 1) {
return null;
}
if (idx < 0) {
return null;
}
return this.parent.children[idx + 1];
}});
dojo.widget.lcArgsCache = {};
dojo.widget.tags = {};
dojo.widget.tags.addParseTreeHandler = function (type) {
dojo.deprecated("addParseTreeHandler", ". ParseTreeHandlers are now reserved for components. Any unfiltered DojoML tag without a ParseTreeHandler is assumed to be a widget", "0.5");
};
dojo.widget.tags["dojo:propertyset"] = function (fragment, widgetParser, parentComp) {
var properties = widgetParser.parseProperties(fragment["dojo:propertyset"]);
};
dojo.widget.tags["dojo:connect"] = function (fragment, widgetParser, parentComp) {
var properties = widgetParser.parseProperties(fragment["dojo:connect"]);
};
dojo.widget.buildWidgetFromParseTree = function (type, frag, parser, parentComp, insertionIndex, localProps) {
dojo.a11y.setAccessibleMode();
var stype = type.split(":");
stype = (stype.length == 2) ? stype[1] : type;
var localProperties = localProps || parser.parseProperties(frag[frag["ns"] + ":" + stype]);
var twidget = dojo.widget.manager.getImplementation(stype, null, null, frag["ns"]);
if (!twidget) {
throw new Error("cannot find \"" + type + "\" widget");
} else {
if (!twidget.create) {
throw new Error("\"" + type + "\" widget object has no \"create\" method and does not appear to implement *Widget");
}
}
localProperties["dojoinsertionindex"] = insertionIndex;
var ret = twidget.create(localProperties, frag, parentComp, frag["ns"]);
return ret;
};
dojo.widget.defineWidget = function (widgetClass, renderer, superclasses, init, props) {
if (dojo.lang.isString(arguments[3])) {
dojo.widget._defineWidget(arguments[0], arguments[3], arguments[1], arguments[4], arguments[2]);
} else {
var args = [arguments[0]], p = 3;
if (dojo.lang.isString(arguments[1])) {
args.push(arguments[1], arguments[2]);
} else {
args.push("", arguments[1]);
p = 2;
}
if (dojo.lang.isFunction(arguments[p])) {
args.push(arguments[p], arguments[p + 1]);
} else {
args.push(null, arguments[p]);
}
dojo.widget._defineWidget.apply(this, args);
}
};
dojo.widget.defineWidget.renderers = "html|svg|vml";
dojo.widget._defineWidget = function (widgetClass, renderer, superclasses, init, props) {
var module = widgetClass.split(".");
var type = module.pop();
var regx = "\\.(" + (renderer ? renderer + "|" : "") + dojo.widget.defineWidget.renderers + ")\\.";
var r = widgetClass.search(new RegExp(regx));
module = (r < 0 ? module.join(".") : widgetClass.substr(0, r));
dojo.widget.manager.registerWidgetPackage(module);
var pos = module.indexOf(".");
var nsName = (pos > -1) ? module.substring(0, pos) : module;
props = (props) || {};
props.widgetType = type;
if ((!init) && (props["classConstructor"])) {
init = props.classConstructor;
delete props.classConstructor;
}
dojo.declare(widgetClass, superclasses, init, props);
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Wizard.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Wizard.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/CiviCrmDatePicker.html
New file
0,0 → 1,12
<table cellpadding="0" cellspacing="0" border="0" width="400">
<tr>
<td id="dateHolderTd" width="200">
</td>
<td id="timeHolderTd" width="200">
</td>
</tr>
<tr style="display: none;" id="formItemsTr">
<td id="formItemsTd">&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/ProgressBar.html
New file
0,0 → 1,5
<div dojoAttachPoint="containerNode" style="position:relative;overflow:hidden">
<div style="position:absolute;display:none;width:100%;text-align:center" dojoAttachPoint="backPercentLabel" class="dojoBackPercentLabel"></div>
<div style="position:absolute;overflow:hidden;width:100%;height:100%" dojoAttachPoint="internalProgress">
<div style="position:absolute;display:none;width:100%;text-align:center" dojoAttachPoint="frontPercentLabel" class="dojoFrontPercentLabel"></div></div>
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/SliderHorizontal.html
New file
0,0 → 1,3
<div class="sliderMainHorizontal">
<div class="sliderHandleHorizontal" dojoAttachPoint="sliderHandle"></div>
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/ComboBox.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/ComboBox.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/DatePicker.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/DatePicker.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/incrementWeek.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/incrementWeek.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Show.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Show.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/ButtonTemplate.html
New file
0,0 → 1,6
<div dojoAttachPoint="buttonNode" class="dojoButton" style="position:relative;" dojoAttachEvent="onMouseOver; onMouseOut; onMouseDown; onMouseUp; onClick:buttonClick; onKey:onKey; onFocus;">
<div class="dojoButtonContents" align=center dojoAttachPoint="containerNode" style="position:absolute;z-index:2;"></div>
<img dojoAttachPoint="leftImage" style="position:absolute;left:0px;">
<img dojoAttachPoint="centerImage" style="position:absolute;z-index:1;">
<img dojoAttachPoint="rightImage" style="position:absolute;top:0px;right:0px;">
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/EditorToolbar.html
New file
0,0 → 1,153
<div dojoAttachPoint="domNode" class="EditorToolbarDomNode" unselectable="on">
<table cellpadding="3" cellspacing="0" border="0">
<!--
our toolbar should look something like:
 
+=======+=======+=======+=============================================+
| w w | style | copy | bo | it | un | le | ce | ri |
| w w w | style |=======|==============|==============|
| w w | style | paste | undo | redo | change style |
+=======+=======+=======+=============================================+
-->
<tbody>
<tr valign="top">
<td rowspan="2">
<div class="bigIcon" dojoAttachPoint="wikiWordButton"
dojoOnClick="wikiWordClick; buttonClick;">
<span style="font-size: 30px; margin-left: 5px;">
W
</span>
</div>
</td>
<td rowspan="2">
<div class="bigIcon" dojoAttachPoint="styleDropdownButton"
dojoOnClick="styleDropdownClick; buttonClick;">
<span unselectable="on"
style="font-size: 30px; margin-left: 5px;">
S
</span>
</div>
<div class="StyleDropdownContainer" style="display: none;"
dojoAttachPoint="styleDropdownContainer">
<table cellpadding="0" cellspacing="0" border="0"
height="100%" width="100%">
<tr valign="top">
<td rowspan="2">
<div style="height: 245px; overflow: auto;">
<div class="headingContainer"
unselectable="on"
dojoOnClick="normalTextClick">normal</div>
<h1 class="headingContainer"
unselectable="on"
dojoOnClick="h1TextClick">Heading 1</h1>
<h2 class="headingContainer"
unselectable="on"
dojoOnClick="h2TextClick">Heading 2</h2>
<h3 class="headingContainer"
unselectable="on"
dojoOnClick="h3TextClick">Heading 3</h3>
<h4 class="headingContainer"
unselectable="on"
dojoOnClick="h4TextClick">Heading 4</h4>
<div class="headingContainer"
unselectable="on"
dojoOnClick="blahTextClick">blah</div>
<div class="headingContainer"
unselectable="on"
dojoOnClick="blahTextClick">blah</div>
<div class="headingContainer"
unselectable="on"
dojoOnClick="blahTextClick">blah</div>
<div class="headingContainer">blah</div>
<div class="headingContainer">blah</div>
<div class="headingContainer">blah</div>
<div class="headingContainer">blah</div>
</div>
</td>
<!--
<td>
<span class="iconContainer" dojoOnClick="buttonClick;">
<span class="icon justifyleft"
style="float: left;">&nbsp;</span>
</span>
<span class="iconContainer" dojoOnClick="buttonClick;">
<span class="icon justifycenter"
style="float: left;">&nbsp;</span>
</span>
<span class="iconContainer" dojoOnClick="buttonClick;">
<span class="icon justifyright"
style="float: left;">&nbsp;</span>
</span>
<span class="iconContainer" dojoOnClick="buttonClick;">
<span class="icon justifyfull"
style="float: left;">&nbsp;</span>
</span>
</td>
-->
</tr>
<tr valign="top">
<td>
thud
</td>
</tr>
</table>
</div>
</td>
<td>
<!-- copy -->
<span class="iconContainer" dojoAttachPoint="copyButton"
unselectable="on"
dojoOnClick="copyClick; buttonClick;">
<span class="icon copy"
unselectable="on"
style="float: left;">&nbsp;</span> copy
</span>
<!-- "droppable" options -->
<span class="iconContainer" dojoAttachPoint="boldButton"
unselectable="on"
dojoOnClick="boldClick; buttonClick;">
<span class="icon bold" unselectable="on">&nbsp;</span>
</span>
<span class="iconContainer" dojoAttachPoint="italicButton"
dojoOnClick="italicClick; buttonClick;">
<span class="icon italic" unselectable="on">&nbsp;</span>
</span>
<span class="iconContainer" dojoAttachPoint="underlineButton"
dojoOnClick="underlineClick; buttonClick;">
<span class="icon underline" unselectable="on">&nbsp;</span>
</span>
<span class="iconContainer" dojoAttachPoint="leftButton"
dojoOnClick="leftClick; buttonClick;">
<span class="icon justifyleft" unselectable="on">&nbsp;</span>
</span>
<span class="iconContainer" dojoAttachPoint="fullButton"
dojoOnClick="fullClick; buttonClick;">
<span class="icon justifyfull" unselectable="on">&nbsp;</span>
</span>
<span class="iconContainer" dojoAttachPoint="rightButton"
dojoOnClick="rightClick; buttonClick;">
<span class="icon justifyright" unselectable="on">&nbsp;</span>
</span>
</td>
</tr>
<tr>
<td>
<!-- paste -->
<span class="iconContainer" dojoAttachPoint="pasteButton"
dojoOnClick="pasteClick; buttonClick;" unselectable="on">
<span class="icon paste" style="float: left;" unselectable="on">&nbsp;</span> paste
</span>
<!-- "droppable" options -->
<span class="iconContainer" dojoAttachPoint="undoButton"
dojoOnClick="undoClick; buttonClick;" unselectable="on">
<span class="icon undo" style="float: left;" unselectable="on">&nbsp;</span> undo
</span>
<span class="iconContainer" dojoAttachPoint="redoButton"
dojoOnClick="redoClick; buttonClick;" unselectable="on">
<span class="icon redo" style="float: left;" unselectable="on">&nbsp;</span> redo
</span>
</td>
</tr>
</tbody>
</table>
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/decrementMonth.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/decrementMonth.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/ProgressBar.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/ProgressBar.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/TreeDocIcon.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/TreeDocIcon.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/decrementWeek.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/decrementWeek.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Tree.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Tree.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/MonthlyCalendar.html
New file
0,0 → 1,110
<div class="datePickerContainer" dojoAttachPoint="datePickerContainerNode">
<h3 class="monthLabel">
<!--
<span
dojoAttachPoint="decreaseWeekNode"
dojoAttachEvent="onClick: onIncrementWeek;"
class="incrementControl">
<img src="${dojoWidgetModuleUri}templates/decrementWeek.gif" alt="&uarr;" />
</span>
-->
<span
dojoAttachPoint="decreaseMonthNode"
dojoAttachEvent="onClick: onIncrementMonth;" class="incrementControl">
<img src="${dojoWidgetModuleUri}templates/decrementMonth.gif"
alt="&uarr;" dojoAttachPoint="decrementMonthImageNode">
</span>
<span dojoAttachPoint="monthLabelNode" class="month">July</span>
<span
dojoAttachPoint="increaseMonthNode"
dojoAttachEvent="onClick: onIncrementMonth;" class="incrementControl">
<img src="${dojoWidgetModuleUri}templates/incrementMonth.gif"
alt="&darr;" dojoAttachPoint="incrementMonthImageNode">
</span>
<!--
<span dojoAttachPoint="increaseWeekNode"
dojoAttachEvent="onClick: onIncrementWeek;"
class="incrementControl">
<img src="${dojoWidgetModuleUri}templates/incrementWeek.gif"
alt="&darr;" />
</span>
-->
</h3>
<table class="calendarContainer">
<thead>
<tr dojoAttachPoint="dayLabelsRow">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</thead>
<tbody dojoAttachPoint="calendarDatesContainerNode"
dojoAttachEvent="onClick: onSetDate;">
<tr dojoAttachPoint="calendarRow0">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr dojoAttachPoint="calendarRow1">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr dojoAttachPoint="calendarRow2">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr dojoAttachPoint="calendarRow3">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr dojoAttachPoint="calendarRow4">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr dojoAttachPoint="calendarRow5">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<h3 class="yearLabel">
<span dojoAttachPoint="previousYearLabelNode"
dojoAttachEvent="onClick: onIncrementYear;" class="previousYear"></span>
<span class="selectedYear" dojoAttachPoint="currentYearLabelNode"></span>
<span dojoAttachPoint="nextYearLabelNode"
dojoAttachEvent="onClick: onIncrementYear;" class="nextYear"></span>
</h3>
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/DropDownButtonTemplate.html
New file
0,0 → 1,9
<button dojoAttachPoint="button" class="dojoButton dojoButtonNoHover" dojoAttachEvent="onMouseOver: ; onMouseOut: ; onClick: ;">
<table dojoAttachPoint="table" style="margin:0 0 0 0;"><tr>
<td class="label" dojoAttachPoint="labelCell"></td>
<td class="border" dojoAttachPoint="borderCell"></td>
<td class="downArrow" dojoAttachPoint="arrowCell">
<img dojoAttachPoint="arrow">
</td>
</tr></table>
</button>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/grabCorner.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/grabCorner.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/ComboButtonTemplate.html
New file
0,0 → 1,18
<div class="dojoButton" style="position:relative;top:0px;left:0px; text-align:none;" dojoAttachEvent="onKey;onFocus">
 
<div dojoAttachPoint="buttonNode" class="dojoButtonLeftPart" style="position:absolute;left:0px;top:0px;"
dojoAttachEvent="onMouseOver; onMouseOut; onMouseDown; onMouseUp; onClick:buttonClick;">
<div class="dojoButtonContents" dojoAttachPoint="containerNode" style="position:absolute;top:0px;right:0px;z-index:2;"></div>
<img dojoAttachPoint="leftImage" style="position:absolute;left:0px;top:0px;">
<img dojoAttachPoint="centerImage" style="position:absolute;right:0px;top:0px;z-index:1;">
</div>
 
<div dojoAttachPoint="rightPart" class="dojoButtonRightPart" style="position:absolute;top:0px;right:0px;"
dojoAttachEvent="onMouseOver:rightOver; onMouseOut:rightOut; onMouseDown:rightDown; onMouseUp:rightUp; onClick:rightClick;">
<img dojoAttachPoint="arrowBackgroundImage" style="position:absolute;top:0px;left:0px;z-index:1;">
<img src="${dojoWidgetModuleUri}templates/images/whiteDownArrow.gif"
style="z-index:2;position:absolute;left:3px;top:50%;">
<img dojoAttachPoint="rightImage" style="position:absolute;top:0px;right:0px;">
</div>
 
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/TabContainerA11y.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/TabContainerA11y.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/EditorToolbar.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/EditorToolbar.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Dialog.html
New file
0,0 → 1,7
<div id="${this.widgetId}" class="dojoDialog" dojoattachpoint="wrapper">
<span dojoattachpoint="tabStartOuter" dojoonfocus="trapTabs" dojoonblur="clearTrap" tabindex="0"></span>
<span dojoattachpoint="tabStart" dojoonfocus="trapTabs" dojoonblur="clearTrap" tabindex="0"></span>
<div dojoattachpoint="containerNode" style="position: relative; z-index: 2;"></div>
<span dojoattachpoint="tabEnd" dojoonfocus="trapTabs" dojoonblur="clearTrap" tabindex="0"></span>
<span dojoattachpoint="tabEndOuter" dojoonfocus="trapTabs" dojoonblur="clearTrap" tabindex="0"></span>
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/TreeDisableWrap.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/TreeDisableWrap.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/SlideShow.html
New file
0,0 → 1,15
<div style="position: relative; padding: 3px;">
<div>
<input type="button" value="pause"
dojoAttachPoint="startStopButton"
dojoAttachEvent="onClick: togglePaused;">
</div>
<div style="position: relative; width: ${this.width}; height: ${this.height};"
dojoAttachPoint="imagesContainer"
dojoAttachEvent="onClick: togglePaused;">
<img dojoAttachPoint="img1" class="slideShowImg"
style="z-index: 1; width: ${this.width}; height: ${this.height};" />
<img dojoAttachPoint="img2" class="slideShowImg"
style="z-index: 0; width: ${this.width}; height: ${this.height};" />
</div>
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/ResizableTextarea.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/ResizableTextarea.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Slider.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Slider.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/TabContainer.html
New file
0,0 → 1,4
<div id="${this.widgetId}" class="dojoTabContainer">
<div dojoAttachPoint="tablistNode"></div>
<div class="dojoTabPaneWrapper" dojoAttachPoint="containerNode" dojoAttachEvent="onKey" waiRole="tabpanel"></div>
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Menu2.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Menu2.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/DemoEngine.html
New file
0,0 → 1,24
<div dojoAttachPoint="domNode">
<div dojoAttachPoint="navigationNode">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1%" valign="top" class="navigationCell"><h1>Categories</h1><div dojoAttachPoint="menuNavigationNode"></div></td>
<td width="99%" valign="top">
<div dojoAttachPoint="demoNavigationNode">
</div>
</td>
</tr>
</table>
</div>
 
<div dojoAttachPoint="demoContainerNode">
 
<div dojoAttachPoint="demoPaneNode">
</div>
 
<div dojoAttachPoint="demoHeaderNode">
<span dojoAttachPoint="collapsedMenuNode" dojoAttachEvent="onclick: expandDemoNavigation"></span>
<div dojoAttachPoint="aboutNode">About this Demo</div>
</div>
</div>
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/TooltipTemplate.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/TooltipTemplate.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/DatePicker.html
New file
0,0 → 1,95
<div class="datePickerContainer" dojoAttachPoint="datePickerContainerNode">
<table cellspacing="0" cellpadding="0" class="calendarContainer">
<thead>
<tr>
<td class="monthWrapper" valign="top">
<table class="monthContainer" cellspacing="0" cellpadding="0" border="0">
<tr>
<td class="monthCurve monthCurveTL" valign="top"></td>
<td class="monthLabelContainer" valign="top">
<span dojoAttachPoint="increaseWeekNode"
dojoAttachEvent="onClick: onIncrementWeek;"
class="incrementControl increase">
<img src="${dojoWidgetModuleUri}templates/images/incrementMonth.png"
alt="&darr;" style="width:7px;height:5px;" />
</span>
<span
dojoAttachPoint="increaseMonthNode"
dojoAttachEvent="onClick: onIncrementMonth;" class="incrementControl increase">
<img src="${dojoWidgetModuleUri}templates/images/incrementMonth.png"
alt="&darr;" dojoAttachPoint="incrementMonthImageNode">
</span>
<span
dojoAttachPoint="decreaseWeekNode"
dojoAttachEvent="onClick: onIncrementWeek;"
class="incrementControl decrease">
<img src="${dojoWidgetModuleUri}templates/images/decrementMonth.png" alt="&uarr;" style="width:7px;height:5px;" />
</span>
<span
dojoAttachPoint="decreaseMonthNode"
dojoAttachEvent="onClick: onIncrementMonth;" class="incrementControl decrease">
<img src="${dojoWidgetModuleUri}templates/images/decrementMonth.png"
alt="&uarr;" dojoAttachPoint="decrementMonthImageNode">
</span>
<span dojoAttachPoint="monthLabelNode" class="month"></span>
</td>
<td class="monthCurve monthCurveTR" valign="top"></td>
</tr>
</table>
</td>
</tr>
</thead>
<tbody>
<tr>
<td colspan="3">
<table class="calendarBodyContainer" cellspacing="0" cellpadding="0" border="0">
<thead>
<tr dojoAttachPoint="dayLabelsRow">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</thead>
<tbody dojoAttachPoint="calendarDatesContainerNode"
dojoAttachEvent="onClick: _handleUiClick;">
<tr dojoAttachPoint="calendarWeekTemplate">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="3" class="yearWrapper">
<table cellspacing="0" cellpadding="0" border="0" class="yearContainer">
<tr>
<td class="curveBL" valign="top"></td>
<td valign="top">
<h3 class="yearLabel">
<span dojoAttachPoint="previousYearLabelNode"
dojoAttachEvent="onClick: onIncrementYear;" class="previousYear"></span>
<span class="selectedYear" dojoAttachPoint="currentYearLabelNode"></span>
<span dojoAttachPoint="nextYearLabelNode"
dojoAttachEvent="onClick: onIncrementYear;" class="nextYear"></span>
</h3>
</td>
<td class="curveBR" valign="top"></td>
</tr>
</table>
</td>
</tr>
</tfoot>
</table>
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/SliderVertical.html
New file
0,0 → 1,3
<div class="sliderMainVertical">
<div class="sliderHandleVertical" dojoAttachPoint="sliderHandle"></div>
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/check.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/check.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/ResizableTextarea.html
New file
0,0 → 1,14
<div>
<div style="border: 2px solid black; width: 90%; height: 200px;"
dojoAttachPoint="rootLayoutNode">
<div dojoAttachPoint="textAreaContainerNode"
style="border: 0px; margin: 0px; overflow: hidden;">
</div>
<div dojoAttachPoint="statusBarContainerNode" class="statusBar">
<div dojoAttachPoint="statusLabelNode"
class="statusPanel"
style="padding-right: 0px; z-index: 1;">drag to resize</div>
<div dojoAttachPoint="resizeHandleNode"></div>
</div>
</div>
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/CheckboxA11y.html
New file
0,0 → 1,4
<span class='dojoHtmlCheckbox'>
<input type="checkbox" name="${this.name}" tabIndex="${this.tabIndex}" id="${this.id}" value="${this.value}"
dojoAttachEvent="onClick: _onClick;" dojoAttachPoint="inputNode">
</span>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Slider.html
New file
0,0 → 1,56
<table _="weird end tag formatting is to prevent whitespace from becoming &nbsp;"
class="sliderMain"
dojoAttachPoint="focusNode"
dojoAttachEvent="onmousedown:_setFocus; onkey:_handleKeyEvents; onkeyup:_buttonReleased; onmouseup:_buttonReleased; onmousewheel:_mouseWheeled;"
tabindex="0" cols=3 cellpadding=0 cellspacing=0 style="">
<tr valign=middle align=center>
<td class="sliderComponent" colspan=3 dojoAttachPoint=topBorderNode style=""
><img class="sliderOutsetButton sliderButtonY"
dojoAttachPoint=topButtonNode
dojoAttachEvent="onmousedown:_topButtonPressed; onmousemove:_discardEvent; ondblclick:_topButtonDoubleClicked;"
src="${this.topButtonSrc}"
style="${this.buttonStyleY}"
></td>
</tr>
<tr valign=middle align=center>
<td class="sliderComponent" dojoAttachPoint=leftBorderNode style=""
><img class="sliderOutsetButton sliderButtonX"
dojoAttachPoint=leftButtonNode
dojoAttachEvent="onmousedown:_leftButtonPressed; onmousemove:_discardEvent; ondblclick:_leftButtonDoubleClicked;"
src="${this.leftButtonSrc}"
style="${this.buttonStyleX}"
></td>
<td dojoAttachPoint=constrainingContainerNode
class="sliderComponent sliderBackground"
style="${this.backgroundStyle}"
><img src="${this.handleSrc}"
class=sliderHandle
dojoAttachPoint=sliderHandleNode
style="${this.handleStyle}"
><img src="${this.progressBackgroundSrc}"
class="sliderBackgroundSizeOnly sliderProgressBackground"
dojoAttachPoint=progressBackgroundNode
style="${this.backgroundSize}"
><img src="${this.backgroundSrc}"
class=sliderBackgroundSizeOnly
dojoAttachPoint=sliderBackgroundNode
style="${this.backgroundSize}"
></td>
<td class="sliderComponent" dojoAttachPoint=rightBorderNode style=""
><img class="sliderOutsetButton sliderButtonX"
dojoAttachPoint=rightButtonNode
dojoAttachEvent="onmousedown:_rightButtonPressed; onmousemove:_discardEvent; ondblclick:_rightButtonDoubleClicked;"
src="${this.rightButtonSrc}"
style="${this.buttonStyleX}"
></td>
</tr>
<tr valign=middle align=center>
<td class="sliderComponent" colspan=3 dojoAttachPoint=bottomBorderNode style=""
><img class="sliderOutsetButton sliderButtonY"
dojoAttachPoint=bottomButtonNode
dojoAttachEvent="onmousedown:_bottomButtonPressed; onmousemove:_discardEvent; ondblclick:_bottomButtonDoubleClicked;"
src="${this.bottomButtonSrc}"
style="${this.buttonStyleY}"
></td>
</tr>
</table>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/PopUpButton.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/PopUpButton.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/SlideShow.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/SlideShow.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/TitlePane.html
New file
0,0 → 1,4
<div dojoAttachPoint="domNode">
<div dojoAttachPoint="labelNode" dojoAttachEvent="onclick: onLabelClick"></div>
<div dojoAttachPoint="containerNode"></div>
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Toolbar.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Toolbar.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/FloatingPane.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/FloatingPane.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/copy.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/copy.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/inserttable.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/inserttable.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/subscript.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/subscript.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/justifyfull.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/justifyfull.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/bold.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/bold.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/createlink.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/createlink.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/indent.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/indent.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/outdent.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/outdent.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/superscript.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/superscript.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/underline.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/underline.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/cancel.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/cancel.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/aggregate.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/aggregate.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/sep.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/sep.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/redo.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/redo.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/space.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/space.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/cut.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/cut.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/list_num_indent.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/list_num_indent.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/justifyright.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/justifyright.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/list_num_outdent.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/list_num_outdent.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/justifycenter.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/justifycenter.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/backcolor.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/backcolor.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/delete.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/delete.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/insertorderedlist.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/insertorderedlist.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/inserthorizontalrule.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/inserthorizontalrule.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/insertimage.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/insertimage.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/paste.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/paste.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/hilitecolor.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/hilitecolor.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/list_bullet_indent.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/list_bullet_indent.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/list_bullet_outdent.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/list_bullet_outdent.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/right_to_left.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/right_to_left.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/left_to_right.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/left_to_right.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/forecolor.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/forecolor.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/save.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/save.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/wikiword.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/wikiword.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/strikethrough.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/strikethrough.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/bg-fade.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/bg-fade.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/italic.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/italic.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/undo.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/undo.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/removeformat.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/removeformat.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/insertunorderedlist.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/insertunorderedlist.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/justifyleft.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/buttons/justifyleft.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/incrementMonth.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/incrementMonth.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/TimePicker.html
New file
0,0 → 1,98
<div class="timePickerContainer" dojoAttachPoint="timePickerContainerNode">
<table class="timeContainer" cellspacing="0" >
<thead>
<tr>
<td class="timeCorner cornerTopLeft" valign="top">&nbsp;</td>
<td class="timeLabelContainer hourSelector">${this.calendar.field-hour}</td>
<td class="timeLabelContainer minutesHeading">${this.calendar.field-minute}</td>
<td class="timeCorner cornerTopRight" valign="top">&nbsp;</td>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" colspan="2" class="hours">
<table align="center">
<tbody dojoAttachPoint="hourContainerNode"
dojoAttachEvent="onClick: onSetSelectedHour;">
<tr>
<td>12</td>
<td>6</td>
</tr>
<tr>
<td>1</td>
<td>7</td>
</tr>
<tr>
<td>2</td>
<td>8</td>
</tr>
<tr>
<td>3</td>
<td>9</td>
</tr>
<tr>
<td>4</td>
<td>10</td>
</tr>
<tr>
<td>5</td>
<td>11</td>
</tr>
</tbody>
</table>
</td>
<td valign="top" class="minutes" colspan="2">
<table align="center">
<tbody dojoAttachPoint="minuteContainerNode"
dojoAttachEvent="onClick: onSetSelectedMinute;">
<tr>
<td>00</td>
<td>30</td>
</tr>
<tr>
<td>05</td>
<td>35</td>
</tr>
<tr>
<td>10</td>
<td>40</td>
</tr>
<tr>
<td>15</td>
<td>45</td>
</tr>
<tr>
<td>20</td>
<td>50</td>
</tr>
<tr>
<td>25</td>
<td>55</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="cornerBottomLeft">&nbsp;</td>
<td valign="top" class="timeOptions">
<table class="amPmContainer">
<tbody dojoAttachPoint="amPmContainerNode"
dojoAttachEvent="onClick: onSetSelectedAmPm;">
<tr>
<td id="am">${this.calendar.am}</td>
<td id="pm">${this.calendar.pm}</td>
</tr>
</tbody>
</table>
</td>
<td class="timeOptions">
<div dojoAttachPoint="anyTimeContainerNode"
dojoAttachEvent="onClick: onSetSelectedAnyTime;"
class="anyTimeContainer">${this.widgetStrings.any}</div>
</td>
<td class="cornerBottomRight">&nbsp;</td>
</tr>
</tbody>
</table>
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Textbox.html
New file
0,0 → 1,5
<span style='float:${this.htmlfloat};'>
<input dojoAttachPoint='textbox' dojoAttachEvent='onblur;onfocus'
id='${this.widgetId}' name='${this.name}'
class='${this.className}' type='${this.type}' >
</span>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/TabContainer.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/TabContainer.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/InlineEditBox.html
New file
0,0 → 1,6
<form class="inlineEditBox" style="display: none" dojoAttachPoint="form" dojoAttachEvent="onSubmit:saveEdit; onReset:cancelEdit; onKeyUp: checkForValueChange;">
<input type="text" dojoAttachPoint="text" style="display: none;" />
<textarea dojoAttachPoint="textarea" style="display: none;"></textarea>
<input type="submit" value="Save" dojoAttachPoint="submitButton" />
<input type="reset" value="Cancel" dojoAttachPoint="cancelButton" />
</form>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Wizard.html
New file
0,0 → 1,10
<div class="WizardContainer" dojoAttachPoint="wizardNode">
<div class="WizardText" dojoAttachPoint="wizardPanelContainerNode">
</div>
<div class="WizardButtonHolder" dojoAttachPoint="wizardControlContainerNode">
<input class="WizardButton" type="button" dojoAttachPoint="previousButton"/>
<input class="WizardButton" type="button" dojoAttachPoint="nextButton"/>
<input class="WizardButton" type="button" dojoAttachPoint="doneButton" style="display:none"/>
<input class="WizardButton" type="button" dojoAttachPoint="cancelButton"/>
</div>
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/ShowSlide.html
New file
0,0 → 1,6
<div class="dojoShowSlide">
<div class="dojoShowSlideTitle">
<h1 dojoAttachPoint="htmlTitle">Title</h1>
</div>
<div class="dojoShowSlideBody" dojoAttachPoint="containerNode"></div>
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/ResizeHandle.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/ResizeHandle.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/AccordionPane.html
New file
0,0 → 1,4
<div dojoAttachPoint="domNode">
<div dojoAttachPoint="labelNode" dojoAttachEvent="onclick: onLabelClick" class="${this.labelNodeClass}">${this.label}</div>
<div dojoAttachPoint="containerNode" style="overflow: hidden;" class="${this.containerNodeClass}"></div>
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/ComboBox.html
New file
0,0 → 1,16
<span _="whitespace and CR's between tags adds &nbsp; in FF"
class="dojoComboBoxOuter"
><input style="display:none" tabindex="-1" name="" value=""
dojoAttachPoint="comboBoxValue"
><input style="display:none" tabindex="-1" name="" value=""
dojoAttachPoint="comboBoxSelectionValue"
><input type="text" autocomplete="off" class="dojoComboBox"
dojoAttachEvent="key:_handleKeyEvents; keyUp: onKeyUp; compositionEnd; onResize;"
dojoAttachPoint="textInputNode"
><img hspace="0"
vspace="0"
class="dojoComboBox"
dojoAttachPoint="downArrowNode"
dojoAttachEvent="onMouseUp: handleArrowClick; onResize;"
src="${this.buttonSrc}"
></span>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/MonthlyCalendar.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/MonthlyCalendar.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/DocPane.html
New file
0,0 → 1,79
<div class="dojoDocPane">
<div dojoAttachPoint="containerNode" class="container"></div>
 
<div dojoAttachPoint="dialog" class="dialog">
<div class="container" dojoAttachPoint="dialogBg">
<div class="docDialog" dojoAttachPoint="dialogFg">
<h2>Log In</h2>
<p><input id="dojoDocUserName" dojoAttachPoint="userName"><label for="dojoDocUserName">User Name:</label></p>
<p><input id="dojoDocPassword" dojoAttachPoint="password" type="password"><label for="dojoDocPassword">Password:</label></p>
<p><input type="button" dojoAttachPoint="cancel" value="cancel"> <input type="button" dojoAttachPoint="logIn" value="Log In"></p>
<p></p>
</div>
</div>
</div>
 
<div dojoAttachPoint="nav" class="nav"><span>Detail</span> | <span>Source</span> | <span>Examples</span> | <span>Walkthrough</span></div>
 
<div dojoAttachPoint="detail" class="detail">
<h1>Detail: <span class="fn" dojoAttachPoint="fn">dojo.select</span></h1>
<div class="description" dojoAttachPoint="description">Description</div>
<div class="params" dojoAttachPoint="parameters">
<h2>Parameters</h2>
<div class="row" dojoAttachPoint="pRow">
<span dojoAttachPoint="pOpt"><em>optional</em> </span>
<span><span dojoAttachPoint="pType">type</span> </span>
<a href="#" dojoAttachPoint="pLink">variable</a>
<span> - <span dojoAttachPoint="pDesc"></span></span>
</div>
</div>
<div class="variables" dojoAttachPoint="variables">
<h2>Variables</h2>
<div class"row" dojoAttachPoint="vRow">
<a href="#" dojoAttachPoint="vLink">variable</a><span> - <span dojoAttachPoint="vDesc"></span></span>
</div>
</div>
<div class="signature">
<h2>Signature</h2>
<div class="source">
<span class="return" dojoAttachPoint="sType">returnType</span>
<span class="function" dojoAttachPoint="sName">foo</span>
(<span class="params" dojoAttachPoint="sParams">
<span class="type" dojoAttachPoint="sPType">type </span>
<span class="name" dojoAttachPoint="sPName">paramName</span>
</span>)
</div>
</div>
</div>
<div dojoAttachPoint="result" class="result">
<h1>Search Results: <span dojoAttachPoint="count">0</span> matches</h1>
<div class="row" dojoAttachPoint="row">
<a href="#" dojoAttachPoint="fnLink">dojo.fnLink</a>
<span> - <span class="summary" dojoAttachPoint="summary">summary</span></span>
</div>
</div>
 
<div dojoAttachPoint="packag" class="package">
<h1>Package:
<span class="pkg" dojoAttachPoint="pkg">dojo.package</span>
<span class="edit" dojoAttachPoint="edit">[edit]</span>
<span class="save" dojoAttachPoint="save">[save]</span>
</h1>
<div dojoAttachPoint="pkgDescription" class="description">Description</div>
<div class="methods" dojoAttachPoint="methods">
<h2>Methods</h2>
<div class="row" dojoAttachPoint="mRow">
<a href="#" dojoAttachPoint="mLink">method</a>
<span> - <span class="description" dojoAttachPoint="mDesc"></span></span>
</div>
</div>
<div class="requires" dojoAttachPoint="requires">
<h2>Requires</h2>
<div class="row" dojoAttachPoint="rRow">
<h3 dojoAttachPoint="rH3">Environment</h3>
<div dojoAttachPoint="rRow2"><a href="#" dojoAttachPoint="rLink" class="package">require</a></div>
</div>
</div>
</div>
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Checkbox.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Checkbox.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Validate.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Validate.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Show.html
New file
0,0 → 1,11
<div class="dojoShow">
<div dojoAttachPoint="contentNode"></div>
<div class="dojoShowNav" dojoAttachPoint="nav">
<div class="dojoShowHider" dojoAttachPoint="hider"></div>
<span unselectable="on" style="cursor: default;" dojoAttachEvent="onClick:previousSlide">&lt;</span>
<select dojoAttachEvent="onClick:gotoSlideByEvent" dojoAttachPoint="select">
<option dojoAttachPoint="option">Title</option>
</select>
<span unselectable="on" style="cursor: default;" dojoAttachEvent="onClick:nextSlide">&gt;</span>
</div>
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/InlineEditBox.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/InlineEditBox.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/SplitContainer.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/SplitContainer.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/EditorToolbarOneline.html
New file
0,0 → 1,172
<div class="EditorToolbarDomNode EditorToolbarSmallBg">
<table cellpadding="1" cellspacing="0" border="0">
<tbody>
<tr valign="top" align="left">
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="htmltoggle">
<span class="dojoE2TBIcon"
style="background-image: none; width: 30px;" >&lt;h&gt;</span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="copy">
<span class="dojoE2TBIcon dojoE2TBIcon_Copy">&nbsp;</span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="paste">
<span class="dojoE2TBIcon dojoE2TBIcon_Paste">&nbsp;</span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="undo">
<!-- FIXME: should we have the text "undo" here? -->
<span class="dojoE2TBIcon dojoE2TBIcon_Undo">&nbsp;</span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="redo">
<span class="dojoE2TBIcon dojoE2TBIcon_Redo">&nbsp;</span>
</span>
</td>
<td isSpacer="true">
<span class="iconContainer">
<span class="dojoE2TBIcon dojoE2TBIcon_Sep" style="width: 5px; min-width: 5px;"></span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="createlink">
<span class="dojoE2TBIcon dojoE2TBIcon_Link">&nbsp;</span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="insertimage">
<span class="dojoE2TBIcon dojoE2TBIcon_Image">&nbsp;</span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="inserthorizontalrule">
<span class="dojoE2TBIcon dojoE2TBIcon_HorizontalLine ">&nbsp;</span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="bold">
<span class="dojoE2TBIcon dojoE2TBIcon_Bold">&nbsp;</span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="italic">
<span class="dojoE2TBIcon dojoE2TBIcon_Italic">&nbsp;</span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="underline">
<span class="dojoE2TBIcon dojoE2TBIcon_Underline">&nbsp;</span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="strikethrough">
<span
class="dojoE2TBIcon dojoE2TBIcon_StrikeThrough">&nbsp;</span>
</span>
</td>
<td isSpacer="true">
<span class="iconContainer">
<span class="dojoE2TBIcon dojoE2TBIcon_Sep"
style="width: 5px; min-width: 5px;"></span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="insertunorderedlist">
<span
class="dojoE2TBIcon dojoE2TBIcon_BulletedList">&nbsp;</span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="insertorderedlist">
<span
class="dojoE2TBIcon dojoE2TBIcon_NumberedList">&nbsp;</span>
</span>
</td>
<td isSpacer="true">
<span class="iconContainer">
<span class="dojoE2TBIcon dojoE2TBIcon_Sep" style="width: 5px; min-width: 5px;"></span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="indent">
<span class="dojoE2TBIcon dojoE2TBIcon_Indent"
unselectable="on">&nbsp;</span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="outdent">
<span class="dojoE2TBIcon dojoE2TBIcon_Outdent"
unselectable="on">&nbsp;</span>
</span>
</td>
<td isSpacer="true">
<span class="iconContainer">
<span class="dojoE2TBIcon dojoE2TBIcon_Sep" style="width: 5px; min-width: 5px;"></span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="forecolor">
<span class="dojoE2TBIcon dojoE2TBIcon_TextColor"
unselectable="on">&nbsp;</span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="hilitecolor">
<span class="dojoE2TBIcon dojoE2TBIcon_BackgroundColor"
unselectable="on">&nbsp;</span>
</span>
</td>
<td isSpacer="true">
<span class="iconContainer">
<span class="dojoE2TBIcon dojoE2TBIcon_Sep" style="width: 5px; min-width: 5px;"></span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="justifyleft">
<span class="dojoE2TBIcon dojoE2TBIcon_LeftJustify">&nbsp;</span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="justifycenter">
<span class="dojoE2TBIcon dojoE2TBIcon_CenterJustify">&nbsp;</span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="justifyright">
<span class="dojoE2TBIcon dojoE2TBIcon_RightJustify">&nbsp;</span>
</span>
</td>
<td>
<span class="iconContainer dojoEditorToolbarItem" dojoETItemName="justifyfull">
<span class="dojoE2TBIcon dojoE2TBIcon_BlockJustify">&nbsp;</span>
</span>
</td>
<td>
<select class="dojoEditorToolbarItem" dojoETItemName="plainformatblock">
<!-- FIXME: using "p" here inserts a paragraph in most cases! -->
<option value="">-- format --</option>
<option value="p">Normal</option>
<option value="pre">Fixed Font</option>
<option value="h1">Main Heading</option>
<option value="h2">Section Heading</option>
<option value="h3">Sub-Heading</option>
<!-- <option value="blockquote">Block Quote</option> -->
</select>
</td>
<td><!-- uncomment to enable save button -->
<!-- save -->
<!--span class="iconContainer dojoEditorToolbarItem" dojoETItemName="save">
<span class="dojoE2TBIcon dojoE2TBIcon_Save">&nbsp;</span>
</span-->
</td>
<td width="*">&nbsp;</td>
</tr>
</tbody>
</table>
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/ShowSlide.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/ShowSlide.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Checkbox.html
New file
0,0 → 1,5
<span style="display: inline-block;" tabIndex="${this.tabIndex}" waiRole="checkbox" id="${this.id}">
<img dojoAttachPoint="imageNode" class="dojoHtmlCheckbox" src="${dojoWidgetModuleUri}templates/images/blank.gif" alt="" />
<input type="checkbox" name="${this.name}" style="display: none" value="${this.value}"
dojoAttachPoint="inputNode">
</span>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Menu.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Menu.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/AccordionPane.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/AccordionPane.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/TreeEditor.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/TreeEditor.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/ButtonTemplate.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/ButtonTemplate.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/TreeV3.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/TreeV3.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/DocPane.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/DocPane.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/dpCurveTL.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/dpCurveTL.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/slider-button-vert.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/slider-button-vert.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/h-bar.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/h-bar.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/dropdownButtonsArrow-disabled.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/dropdownButtonsArrow-disabled.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/dpCurveTR.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/dpCurveTR.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/dpYearBg.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/dpYearBg.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/combo_box_arrow.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/combo_box_arrow.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/dpMonthBg.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/dpMonthBg.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/bar.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/bar.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/scBackground.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/scBackground.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/spinnerDecrement.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/spinnerDecrement.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/no.svg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/no.svg
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/treenode_expand_plus.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/treenode_expand_plus.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/soriaAccordionSelected.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/soriaAccordionSelected.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/treenode_grid_c.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/treenode_grid_c.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/slider_up_arrow.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/slider_up_arrow.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/dpMonthBg.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/dpMonthBg.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/slider.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/slider.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/whiteDownArrow.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/whiteDownArrow.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/dpMonthBg2.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/dpMonthBg2.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/soriaPressed-c.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/soriaPressed-c.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/tab_bot_left.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/tab_bot_left.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/treenode_grid_l.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/treenode_grid_l.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/dateIcon.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/dateIcon.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/treenode_grid_p.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/treenode_grid_p.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/decrementMonth.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/decrementMonth.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/soriaPressed-l.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/soriaPressed-l.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/treenode_grid_t.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/treenode_grid_t.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/verticalbar.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/verticalbar.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/treenode_grid_v.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/treenode_grid_v.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/treenode_grid_x.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/treenode_grid_x.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/treenode_grid_y.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/treenode_grid_y.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/tab_bot_right_curr.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/tab_bot_right_curr.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/slider_down_arrow.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/slider_down_arrow.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/soriaPressed-r.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/soriaPressed-r.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/treenode_grid_z.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/treenode_grid_z.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/TreeV3/expand_loading.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/TreeV3/expand_loading.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/TreeV3/document.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/TreeV3/document.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/TreeV3/expand_plus.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/TreeV3/expand_plus.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/TreeV3/i_half.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/TreeV3/i_half.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/TreeV3/plus.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/TreeV3/plus.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/TreeV3/i_bhalf.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/TreeV3/i_bhalf.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/TreeV3/i.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/TreeV3/i.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/TreeV3/expand_minus.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/TreeV3/expand_minus.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/TreeV3/l.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/TreeV3/l.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/TreeV3/minus.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/TreeV3/minus.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/TreeV3/open.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/TreeV3/open.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/TreeV3/t.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/TreeV3/t.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/TreeV3/expand_leaf.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/TreeV3/expand_leaf.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/TreeV3/i_long.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/TreeV3/i_long.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/TreeV3/x.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/TreeV3/x.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/TreeV3/closed.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/TreeV3/closed.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/dpCurveBL.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/dpCurveBL.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/slider-bg.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/slider-bg.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/submenu_off.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/submenu_off.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/treenode_child.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/treenode_child.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/floatingPaneMinimize.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/floatingPaneMinimize.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/soriaMenuBg.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/soriaMenuBg.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/soriaBarBg.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/soriaBarBg.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/dpCurveBR.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/dpCurveBR.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/floatingPaneRestore.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/floatingPaneRestore.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/decrementMonth.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/decrementMonth.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/bdYearBg.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/bdYearBg.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/slider_left_arrow.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/slider_left_arrow.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/dropdownButtonsArrow.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/dropdownButtonsArrow.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/blank.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/blank.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/slider-bg-progress-vert.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/slider-bg-progress-vert.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/toolbar-bg.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/toolbar-bg.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/soriaActive-c.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/soriaActive-c.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/slider-button-horz.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/slider-button-horz.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/tab_close.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/tab_close.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/floatingPaneClose.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/floatingPaneClose.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/soriaActive-l.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/soriaActive-l.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/tab_right.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/tab_right.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/timeIcon.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/timeIcon.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/soriaActive-r.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/soriaActive-r.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/slider_right_arrow.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/slider_right_arrow.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/incrementMonth.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/incrementMonth.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/slider-button.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/slider-button.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/clock.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/clock.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/no.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/no.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/bdYearBg.1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/bdYearBg.1.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/dpHorizLineFoot.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/dpHorizLineFoot.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/tab_right_r_curr.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/tab_right_r_curr.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/treenode_expand_minus.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/treenode_expand_minus.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/soriaDisabled-c.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/soriaDisabled-c.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/dpHorizLine.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/dpHorizLine.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/soriaButton-c.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/soriaButton-c.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/soriaAccordionOff.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/soriaAccordionOff.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/incrementMonth.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/incrementMonth.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/blank.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/blank.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/treenode_grid_p.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/treenode_grid_p.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/minus.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/minus.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/treenode_grid_t.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/treenode_grid_t.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/treenode_grid_v.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/treenode_grid_v.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/treenode_grid_x.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/treenode_grid_x.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/transparent.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/transparent.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/treenode_loading.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/treenode_loading.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/treenode_grid_y.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/treenode_grid_y.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/treenode_grid_z.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/treenode_grid_z.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/treenode_expand_plus.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/treenode_expand_plus.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/treenode_child.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/treenode_child.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/closed.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/closed.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/treenode_blank.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/treenode_blank.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/treenode_grid_c.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/treenode_grid_c.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/treenode_loading.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/treenode_loading.jpg
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/document.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/document.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/treenode_expand_minus.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/treenode_expand_minus.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/Tree.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/Tree.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/plus.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/plus.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/treenode_grid_l.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/Tree/treenode_grid_l.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/tab_left_r_curr.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/tab_left_r_curr.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/soriaDisabled-l.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/soriaDisabled-l.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/transparent.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/transparent.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/tab_left_r.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/tab_left_r.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/tab_top_left.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/tab_top_left.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/tab_close_h.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/tab_close_h.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/soriaButton-l.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/soriaButton-l.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/soriaDisabled-r.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/soriaDisabled-r.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/submenu_disabled.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/submenu_disabled.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/tab_bot_right.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/tab_bot_right.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/soriaButton-r.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/soriaButton-r.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/treenode_node.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/treenode_node.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/submenu_on.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/submenu_on.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/floatingPaneMaximize.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/floatingPaneMaximize.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/dpBg.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/dpBg.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/dpVertLine.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/dpVertLine.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/dpYearBg.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/dpYearBg.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/treenode_blank.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/treenode_blank.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/tab_bot_left_curr.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/tab_bot_left_curr.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/tab_left.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/tab_left.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/spinnerIncrement.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/spinnerIncrement.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/tab_right_r.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/tab_right_r.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/tab_top_right.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/tab_top_right.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/slider-bg-vert.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/images/slider-bg-vert.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Spinner.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Spinner.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/TaskBarItemTemplate.html
New file
0,0 → 1,2
<div class="dojoTaskBarItem" dojoAttachEvent="onClick">
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Toaster.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Toaster.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Editor2/showtableborder_ie.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Editor2/showtableborder_ie.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Editor2/EditorToolbar_FontSize.html
New file
0,0 → 1,31
<div class="SC_Panel" style="width: 150px; height: 150px;">
<table width="100%" cellspacing="0" cellpadding="0" style="table-layout: fixed;">
<tbody>
<tr>
<td nowrap="">
<div class="SC_Item" dropDownItemName="1">
<font size="1">xx-small</font>
</div>
<div class="SC_Item" dropDownItemName="2">
<font size="2">x-small</font>
</div>
<div class="SC_Item" dropDownItemName="3">
<font size="3">small</font>
</div>
<div class="SC_Item" dropDownItemName="4">
<font size="4">medium</font>
</div>
<div class="SC_Item" dropDownItemName="5">
<font size="5">large</font>
</div>
<div class="SC_Item" dropDownItemName="6">
<font size="6">x-large</font>
</div>
<div class="SC_Item" dropDownItemName="7">
<font size="7">xx-large</font>
</div>
</td>
</tr>
</tbody>
</table>
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Editor2/Dialog/replace.html
New file
0,0 → 1,15
<table style="white-space: nowrap;">
<tr><td>Find: </td><td> <input type="text" dojoAttachPoint="replace_text" /></td></tr>
<tr><td>Replace with: </td><td> <input type="text" dojoAttachPoint="replace_text" /></td></tr>
<tr><td colspan='2'><table><tr><td><input type="checkbox" dojoType="CheckBox" dojoAttachPoint="replace_option_casesens" id="dojo_replace_option_casesens" />
<label for="dojo_replace_option_casesens">Case Sensitive</label></td>
<td><input type="checkbox" dojoType="CheckBox" dojoAttachPoint="replace_option_backwards" id="dojo_replace_option_backwards" />
<label for="dojo_replace_option_backwards">Search Backwards</label></td></tr></table></td></tr>
<tr><td colspan=2">
<table><tr>
<td><button dojoType='Button' dojoAttachEvent='onClick:replace'>Replace</button></td>
<td><button dojoType='Button' dojoAttachEvent='onClick:replaceAll'>Replace All</button></td>
<td><button dojoType='Button' dojoAttachEvent='onClick:cancel'>Close</button></td>
</tr></table>
</td></tr>
</table>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Editor2/Dialog/inserttable.html
New file
0,0 → 1,91
<div>
<table cellSpacing="1" cellPadding="1" width="100%" border="0">
<tr>
<td valign="top">
<table cellSpacing="0" cellPadding="0" border="0">
<tr>
 
<td><span>Rows</span>:</td>
<td>&nbsp;<input dojoAttachPoint="table_rows" type="text" maxLength="3" size="2" value="3"></td>
</tr>
<tr>
<td><span>Columns</span>:</td>
<td>&nbsp;<input dojoAttachPoint="table_cols" type="text" maxLength="2" size="2" value="2"></td>
</tr>
 
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><span>Border size</span>:</td>
<td>&nbsp;<INPUT dojoAttachPoint="table_border" type="text" maxLength="2" size="2" value="1"></td>
</tr>
 
<tr>
<td><span>Alignment</span>:</td>
<td>&nbsp;<select dojoAttachPoint="table_align">
<option value="" selected>&lt;Not set&gt;</option>
<option value="left">Left</option>
<option value="center">Center</option>
<option value="right">Right</option>
</select></td>
</tr>
</table>
</td>
<td>&nbsp;&nbsp;&nbsp;</td>
<td align="right" valign="top">
<table cellSpacing="0" cellPadding="0" border="0">
<tr>
<td><span>Width</span>:</td>
<td>&nbsp;<input dojoAttachPoint="table_width" type="text" maxLength="4" size="3"></td>
<td>&nbsp;<select dojoAttachPoint="table_widthtype">
<option value="percent" selected>percent</option>
<option value="pixels">pixels</option>
</select></td>
 
</tr>
<tr>
<td><span>Height</span>:</td>
<td>&nbsp;<INPUT dojoAttachPoint="table_height" type="text" maxLength="4" size="3"></td>
<td>&nbsp;<span>pixels</span></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td nowrap><span>Cell spacing</span>:</td>
<td>&nbsp;<input dojoAttachPoint="table_cellspacing" type="text" maxLength="2" size="2" value="1"></td>
<td>&nbsp;</td>
 
</tr>
<tr>
<td nowrap><span>Cell padding</span>:</td>
<td>&nbsp;<input dojoAttachPoint="table_cellpadding" type="text" maxLength="2" size="2" value="1"></td>
<td>&nbsp;</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr>
<td nowrap><span>Caption</span>:</td>
<td>&nbsp;</td>
<td width="100%" nowrap>&nbsp;
<input dojoAttachPoint="table_caption" type="text" style="WIDTH: 90%"></td>
</tr>
<tr>
<td nowrap><span>Summary</span>:</td>
<td>&nbsp;</td>
<td width="100%" nowrap>&nbsp;
<input dojoAttachPoint="table_summary" type="text" style="WIDTH: 90%"></td>
</tr>
</table>
<table><tr>
<td><button dojoType='Button' dojoAttachEvent='onClick:ok'>Ok</button></td>
<td><button dojoType='Button' dojoAttachEvent='onClick:cancel'>Cancel</button></td>
</tr></table>
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Editor2/Dialog/find.html
New file
0,0 → 1,15
<table style="white-space: nowrap;">
<tr><td colspan='2'>Find: <input type="text" dojoAttachPoint="find_text" /></td></tr>
<tr><td><input type="checkbox" dojoType="CheckBox" dojoAttachPoint="find_option_casesens" />
<label for="find_option_casesens">Case Sensitive</label></td>
<td><input type="checkbox" dojoType="CheckBox" dojoAttachPoint="find_option_backwards" />
<label for="find_option_backwards">Search Backwards</label></td></tr>
<tr><td style="display: none;"><input type="checkbox" dojoType="CheckBox" dojoAttachPoint="find_option_wholeword" />
<label for="find_option_wholeword">Whole Word</label></td>
<tr><td colspan="1">
<table><tr>
<td><button dojoType='Button' dojoAttachEvent='onClick:find'>Find</button></td>
<td><button dojoType='Button' dojoAttachEvent='onClick:cancel'>Close</button></td>
</tr></table>
</td></tr>
</table>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Editor2/Dialog/createlink.html
New file
0,0 → 1,15
<table>
<tr><td>URL</td><td> <input type="text" dojoAttachPoint="link_href" name="dojo_createLink_href"/></td></tr>
<tr><td>Target </td><td><select dojoAttachPoint="link_target">
<option value="">Self</option>
<option value="_blank">New Window</option>
<option value="_top">Top Window</option>
</select></td></tr>
<tr><td>Class </td><td><input type="text" dojoAttachPoint="link_class" /></td></tr>
<tr><td colspan="2">
<table><tr>
<td><button dojoType='Button' dojoAttachEvent='onClick:ok'>OK</button></td>
<td><button dojoType='Button' dojoAttachEvent='onClick:cancel'>Cancel</button></td>
</tr></table>
</td></tr>
</table>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Editor2/Dialog/insertimage.html
New file
0,0 → 1,114
<table cellspacing="1" cellpadding="1" border="0" width="100%" height="100%">
<tr>
<td>
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td width="100%">
<span>URL</span>
</td>
<td style="display: none" nowrap="nowrap" rowspan="2">
<!--input id="btnBrowse" onclick="BrowseServer();" type="button" value="Browse Server"/-->
</td>
</tr>
<tr>
<td valign="top">
<input dojoAttachPoint="image_src" style="width: 100%" type="text" />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<span>Alternative Text</span><br />
<input dojoAttachPoint="image_alt" style="width: 100%" type="text" /><br />
</td>
</tr>
<tr>
<td valign="top">
<table><tr><td>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td nowrap="nowrap">
<span>Width</span>&nbsp;</td>
<td>
<input type="text" size="3" dojoAttachPoint="image_width" /></td>
 
<td rowspan="2">
<!--div id="btnLockSizes" class="BtnLocked" onmouseover="this.className = (bLockRatio ? 'BtnLocked' : 'BtnUnlocked' ) + ' BtnOver';"
onmouseout="this.className = (bLockRatio ? 'BtnLocked' : 'BtnUnlocked' );" title="Lock Sizes"
onclick="SwitchLock(this);">
</div-->
</td>
<td rowspan="2">
<!--div id="btnResetSize" class="BtnReset" onmouseover="this.className='BtnReset BtnOver';"
onmouseout="this.className='BtnReset';" title="Reset Size" onclick="ResetSizes();">
</div-->
</td>
</tr>
 
<tr>
<td nowrap="nowrap">
<span>Height</span>&nbsp;</td>
<td>
<input type="text" size="3" dojoAttachPoint="image_height" /></td>
</tr>
</table>
</td><td>
 
<table cellspacing="0" cellpadding="0" border="0">
<tr>
 
<td nowrap="nowrap">
<span >HSpace</span>&nbsp;</td>
<td>
<input type="text" size="2" dojoAttachPoint="image_hspace"/></td>
</tr>
<tr>
<td nowrap="nowrap">
<span >VSpace</span>&nbsp;</td>
 
<td>
<input type="text" size="2" dojoAttachPoint="image_vspace" /></td>
</tr>
</table>
</td></tr>
<tr><td colspan="2">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td nowrap="nowrap">
<span>Border</span>&nbsp;</td>
<td>
<input type="text" size="2" value="" dojoAttachPoint="image_border" /></td>
<td>&nbsp;&nbsp;&nbsp;</td>
<td nowrap="nowrap">
<span >Align</span>&nbsp;</td>
<td>
<select dojoAttachPoint="image_align">
 
<option value="" selected="selected"></option>
<option value="left">Left</option>
<option value="absBottom">Abs Bottom</option>
<option value="absMiddle">Abs Middle</option>
<option value="baseline">Baseline</option>
<option value="bottom">Bottom</option>
 
<option value="middle">Middle</option>
<option value="right">Right</option>
<option value="textTop">Text Top</option>
<option value="top">Top</option>
</select>
</td>
</tr>
</table>
</td>
</tr></table>
</td>
</tr>
<tr><td>
<table><tr>
<td><button dojoType='Button' dojoAttachEvent='onClick:ok'>OK</button></td>
<td><button dojoType='Button' dojoAttachEvent='onClick:cancel'>Cancel</button></td>
</tr></table>
</td></tr>
</table>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Editor2/EditorToolbar_FormatBlock.html
New file
0,0 → 1,52
<div class="SC_Panel" style="width: 190px; height: 150px;">
<div class="SC_Item" dropDownItemName="p">
<div class="BaseFont">
<p>Normal</p>
</div>
</div>
<div class="SC_Item" dropDownItemName="div">
<div class="BaseFont">
<div>Normal (DIV)</div>
</div>
</div>
<div class="SC_Item" dropDownItemName="pre">
<div class="BaseFont">
<pre>Formatted</pre>
</div>
</div>
<div class="SC_Item" dropDownItemName="address">
<div class="BaseFont">
<address>Address</address>
</div>
</div>
<div class="SC_Item" dropDownItemName="h1">
<div class="BaseFont">
<h1>Heading 1</h1>
</div>
</div>
<div class="SC_Item" dropDownItemName="h2">
<div class="BaseFont">
<h2>Heading 2</h2>
</div>
</div>
<div class="SC_Item" dropDownItemName="h3">
<div class="BaseFont">
<h3>Heading 3</h3>
</div>
</div>
<div class="SC_Item" dropDownItemName="h4">
<div class="BaseFont">
<h4>Heading 4</h4>
</div>
</div>
<div class="SC_Item" dropDownItemName="h5">
<div class="BaseFont">
<h5>Heading 5</h5>
</div>
</div>
<div class="SC_Item" dropDownItemName="h6">
<div class="BaseFont">
<h6>Heading 6</h6>
</div>
</div>
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Editor2/EditorToolbar_FontName.html
New file
0,0 → 1,20
<div class="SC_Panel" style="width: 150px; height: 150px;">
<div class="SC_Item" dropDownItemName="Arial">
<font face="Arial" style="font-size: 12px;">Arial</font>
</div>
<div class="SC_Item" dropDownItemName="Comic Sans MS">
<font face="Comic Sans MS" style="font-size: 12px;">Comic Sans MS</font>
</div>
<div class="SC_Item" dropDownItemName="Courier New">
<font face="Courier New" style="font-size: 12px;">Courier New</font>
</div>
<div class="SC_Item" dropDownItemName="Tahoma">
<font face="Tahoma" style="font-size: 12px;">Tahoma</font>
</div>
<div class="SC_Item" dropDownItemName="Times New Roman">
<font face="Times New Roman" style="font-size: 12px;">Times New Roman</font>
</div>
<div class="SC_Item" dropDownItemName="Verdana">
<font face="Verdana" style="font-size: 12px;">Verdana</font>
</div>
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Editor2/showtableborder_gecko.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Editor2/showtableborder_gecko.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Editor2/EditorDialog.html
New file
0,0 → 1,21
<div id="${this.widgetId}" class="dojoFloatingPane">
<span dojoattachpoint="tabStartOuter" dojoonfocus="trapTabs" dojoonblur="clearTrap" tabindex="0"></span>
<span dojoattachpoint="tabStart" dojoonfocus="trapTabs" dojoonblur="clearTrap" tabindex="0"></span>
<div dojoAttachPoint="titleBar" class="dojoFloatingPaneTitleBar" style="display:none">
<img dojoAttachPoint="titleBarIcon" class="dojoFloatingPaneTitleBarIcon">
<div dojoAttachPoint="closeAction" dojoAttachEvent="onClick:hide"
class="dojoFloatingPaneCloseIcon"></div>
<div dojoAttachPoint="restoreAction" dojoAttachEvent="onClick:restoreWindow"
class="dojoFloatingPaneRestoreIcon"></div>
<div dojoAttachPoint="maximizeAction" dojoAttachEvent="onClick:maximizeWindow"
class="dojoFloatingPaneMaximizeIcon"></div>
<div dojoAttachPoint="minimizeAction" dojoAttachEvent="onClick:minimizeWindow"
class="dojoFloatingPaneMinimizeIcon"></div>
<div dojoAttachPoint="titleBarText" class="dojoFloatingPaneTitleText">${this.title}</div>
</div>
 
<div id="${this.widgetId}_container" dojoAttachPoint="containerNode" class="dojoFloatingPaneClient"></div>
<span dojoattachpoint="tabEnd" dojoonfocus="trapTabs" dojoonblur="clearTrap" tabindex="0"></span>
<span dojoattachpoint="tabEndOuter" dojoonfocus="trapTabs" dojoonblur="clearTrap" tabindex="0"></span>
<div dojoAttachPoint="resizeBar" class="dojoFloatingPaneResizebar" style="display:none"></div>
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/richtextframe.html
New file
0,0 → 1,24
<!-- <?xml version="1.0" encoding="UTF-8"?> -->
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
<html>
<head>
<title></title>
<script type="text/javascript">
function init(){
document.designMode = 'on';
try{
parentPageDomain = document.location.href.split('#')[1];
if(parentPageDomain){
document.domain = parentPageDomain;
}
}catch(e){ }
}
window.onload = init;
</script>
</head>
<body>
<br />
</body>
</html>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/RemoteTabControl.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/RemoteTabControl.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/FloatingPane.html
New file
0,0 → 1,18
<div id="${this.widgetId}" dojoAttachEvent="onMouseDown" class="dojoFloatingPane">
<div dojoAttachPoint="titleBar" class="dojoFloatingPaneTitleBar" style="display:none">
<img dojoAttachPoint="titleBarIcon" class="dojoFloatingPaneTitleBarIcon">
<div dojoAttachPoint="closeAction" dojoAttachEvent="onClick:closeWindow"
class="dojoFloatingPaneCloseIcon"></div>
<div dojoAttachPoint="restoreAction" dojoAttachEvent="onClick:restoreWindow"
class="dojoFloatingPaneRestoreIcon"></div>
<div dojoAttachPoint="maximizeAction" dojoAttachEvent="onClick:maximizeWindow"
class="dojoFloatingPaneMaximizeIcon"></div>
<div dojoAttachPoint="minimizeAction" dojoAttachEvent="onClick:minimizeWindow"
class="dojoFloatingPaneMinimizeIcon"></div>
<div dojoAttachPoint="titleBarText" class="dojoFloatingPaneTitleText">${this.title}</div>
</div>
 
<div id="${this.widgetId}_container" dojoAttachPoint="containerNode" class="dojoFloatingPaneClient"></div>
 
<div dojoAttachPoint="resizeBar" class="dojoFloatingPaneResizebar" style="display:none"></div>
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/ValidationTextbox.html
New file
0,0 → 1,8
<span style='float:${this.htmlfloat};'>
<input dojoAttachPoint='textbox' type='${this.type}' dojoAttachEvent='onblur;onfocus;onkeyup'
id='${this.widgetId}' name='${this.name}' size='${this.size}' maxlength='${this.maxlength}'
class='${this.className}' style=''>
<span dojoAttachPoint='invalidSpan' class='${this.invalidClass}'>${this.messages.invalidMessage}</span>
<span dojoAttachPoint='missingSpan' class='${this.missingClass}'>${this.messages.missingMessage}</span>
<span dojoAttachPoint='rangeSpan' class='${this.rangeClass}'>${this.messages.rangeMessage}</span>
</span>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/TaskBar.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/TaskBar.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/FisheyeList.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/FisheyeList.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/Spinner.html
New file
0,0 → 1,25
<span _="weird end tag formatting is to prevent whitespace from becoming &nbsp;"
style='float:${this.htmlfloat};'
><table cellpadding=0 cellspacing=0 class="dojoSpinner">
<tr>
<td
><input
dojoAttachPoint='textbox' type='${this.type}'
dojoAttachEvent='onblur;onfocus;onkey:_handleKeyEvents;onKeyUp:_onSpinnerKeyUp;onresize:_resize'
id='${this.widgetId}' name='${this.name}' size='${this.size}' maxlength='${this.maxlength}'
value='${this.value}' class='${this.className}' autocomplete="off"
></td>
<td
><img dojoAttachPoint="upArrowNode"
dojoAttachEvent="onDblClick: _upArrowDoubleClicked; onMouseDown: _upArrowPressed; onMouseUp: _arrowReleased; onMouseOut: _arrowReleased; onMouseMove: _discardEvent;"
src="${this.incrementSrc}" style="width: ${this.buttonSize.width}px; height: ${this.buttonSize.height}px;"
><img dojoAttachPoint="downArrowNode"
dojoAttachEvent="onDblClick: _downArrowDoubleClicked; onMouseDown: _downArrowPressed; onMouseUp: _arrowReleased; onMouseOut: _arrowReleased; onMouseMove: _discardEvent;"
src="${this.decrementSrc}" style="width: ${this.buttonSize.width}px; height: ${this.buttonSize.height}px;"
></td>
</tr>
</table
><span dojoAttachPoint='invalidSpan' class='${this.invalidClass}'>${this.messages.invalidMessage}</span
><span dojoAttachPoint='missingSpan' class='${this.missingClass}'>${this.messages.missingMessage}</span
><span dojoAttachPoint='rangeSpan' class='${this.rangeClass}'>${this.messages.rangeMessage}</span
></span>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/TimePicker.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/templates/TimePicker.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/RemoteTabController.js
New file
0,0 → 1,26
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.RemoteTabController");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.TabContainer");
dojo.require("dojo.event.*");
dojo.deprecated("dojo.widget.RemoteTabController is slated for removal in 0.5; use PageController or TabController instead.", "0.5");
dojo.widget.defineWidget("dojo.widget.RemoteTabController", dojo.widget.TabController, {templateCssString:".dojoRemoteTabController {\n\tposition: relative;\n}\n\n.dojoRemoteTab {\n\tposition : relative;\n\tfloat : left;\n\tpadding-left : 9px;\n\tborder-bottom : 1px solid #6290d2;\n\tbackground : url(images/tab_left.gif) no-repeat left top;\n\tcursor: pointer;\n\twhite-space: nowrap;\n\tz-index: 3;\n}\n\n.dojoRemoteTab div {\n\tdisplay : block;\n\tpadding : 4px 15px 4px 6px;\n\tbackground : url(images/tab_top_right.gif) no-repeat right top;\n\tcolor : #333;\n\tfont-size : 90%;\n}\n\n.dojoRemoteTabPaneClose {\n\tposition : absolute;\n\tbottom : 0px;\n\tright : 6px;\n\theight : 12px;\n\twidth : 12px;\n\tbackground : url(images/tab_close.gif) no-repeat right top;\n}\n\n.dojoRemoteTabPaneCloseHover {\n\tbackground-image : url(images/tab_close_h.gif);\n}\n\n.dojoRemoteTabClose {\n\tdisplay : inline-block;\n\theight : 12px;\n\twidth : 12px;\n\tpadding : 0 12px 0 0;\n\tmargin : 0 -10px 0 10px;\n\tbackground : url(images/tab_close.gif) no-repeat right top;\n\tcursor : default;\n}\n\n.dojoRemoteTabCloseHover {\n\tbackground-image : url(images/tab_close_h.gif);\n}\n\n.dojoRemoteTab.current {\n\tpadding-bottom : 1px;\n\tborder-bottom : 0;\n\tbackground-position : 0 -150px;\n}\n\n.dojoRemoteTab.current div {\n\tpadding-bottom : 5px;\n\tmargin-bottom : -1px;\n\tbackground-position : 100% -150px;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/RemoteTabControl.css"), templateString:"<div dojoAttachPoint=\"domNode\" wairole=\"tablist\"></div>", "class":"dojoRemoteTabController", tabContainer:"", postMixInProperties:function () {
this.containerId = this.tabContainer;
dojo.widget.RemoteTabController.superclass.postMixInProperties.apply(this, arguments);
}, fillInTemplate:function () {
dojo.html.addClass(this.domNode, this["class"]);
if (this.tabContainer) {
dojo.addOnLoad(dojo.lang.hitch(this, "setupTabs"));
}
dojo.widget.RemoteTabController.superclass.fillInTemplate.apply(this, arguments);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/TaskBar.js
New file
0,0 → 1,47
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TaskBar");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.FloatingPane");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.event.*");
dojo.require("dojo.html.selection");
dojo.widget.defineWidget("dojo.widget.TaskBarItem", dojo.widget.HtmlWidget, {iconSrc:"", caption:"Untitled", templateString:"<div class=\"dojoTaskBarItem\" dojoAttachEvent=\"onClick\">\n</div>\n", templateCssString:".dojoTaskBarItem {\n\tdisplay: inline-block;\n\tbackground-color: ThreeDFace;\n\tborder: outset 2px;\n\tmargin-right: 5px;\n\tcursor: pointer;\n\theight: 35px;\n\twidth: 100px;\n\tfont-size: 10pt;\n\twhite-space: nowrap;\n\ttext-align: center;\n\tfloat: left;\n\toverflow: hidden;\n}\n\n.dojoTaskBarItem img {\n\tvertical-align: middle;\n\tmargin-right: 5px;\n\tmargin-left: 5px;\t\n\theight: 32px;\n\twidth: 32px;\n}\n\n.dojoTaskBarItem a {\n\t color: black;\n\ttext-decoration: none;\n}\n\n\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/TaskBar.css"), fillInTemplate:function () {
if (this.iconSrc) {
var img = document.createElement("img");
img.src = this.iconSrc;
this.domNode.appendChild(img);
}
this.domNode.appendChild(document.createTextNode(this.caption));
dojo.html.disableSelection(this.domNode);
}, postCreate:function () {
this.window = dojo.widget.getWidgetById(this.windowId);
this.window.explodeSrc = this.domNode;
dojo.event.connect(this.window, "destroy", this, "destroy");
}, onClick:function () {
this.window.toggleDisplay();
}});
dojo.widget.defineWidget("dojo.widget.TaskBar", dojo.widget.FloatingPane, function () {
this._addChildStack = [];
}, {resizable:false, titleBarDisplay:false, addChild:function (child) {
if (!this.containerNode) {
this._addChildStack.push(child);
} else {
if (this._addChildStack.length > 0) {
var oarr = this._addChildStack;
this._addChildStack = [];
dojo.lang.forEach(oarr, this.addChild, this);
}
}
var tbi = dojo.widget.createWidget("TaskBarItem", {windowId:child.widgetId, caption:child.title, iconSrc:child.iconSrc});
dojo.widget.TaskBar.superclass.addChild.call(this, tbi);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/TreeDeselectOnDblselect.js
New file
0,0 → 1,21
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeDeselectOnDblselect");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.TreeSelectorV3");
dojo.deprecated("Does anyone still need this extension? (TreeDeselectOnDblselect)");
dojo.widget.defineWidget("dojo.widget.TreeDeselectOnDblselect", [dojo.widget.HtmlWidget], {selector:"", initialize:function () {
this.selector = dojo.widget.byId(this.selector);
dojo.event.topic.subscribe(this.selector.eventNames.dblselect, this, "onDblselect");
}, onDblselect:function (message) {
this.selector.deselect(message.node);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/RichText.js
New file
0,0 → 1,1165
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.RichText");
dojo.require("dojo.widget.*");
dojo.require("dojo.html.*");
dojo.require("dojo.html.layout");
dojo.require("dojo.html.selection");
dojo.require("dojo.event.*");
dojo.require("dojo.string.extras");
dojo.require("dojo.uri.Uri");
dojo.require("dojo.Deferred");
if (!djConfig["useXDomain"] || djConfig["allowXdRichTextSave"]) {
if (dojo.hostenv.post_load_) {
(function () {
var savetextarea = dojo.doc().createElement("textarea");
savetextarea.id = "dojo.widget.RichText.savedContent";
savetextarea.style = "display:none;position:absolute;top:-100px;left:-100px;height:3px;width:3px;overflow:hidden;";
dojo.body().appendChild(savetextarea);
})();
} else {
try {
dojo.doc().write("<textarea id=\"dojo.widget.RichText.savedContent\" " + "style=\"display:none;position:absolute;top:-100px;left:-100px;height:3px;width:3px;overflow:hidden;\"></textarea>");
}
catch (e) {
}
}
}
dojo.widget.defineWidget("dojo.widget.RichText", dojo.widget.HtmlWidget, function () {
this.contentPreFilters = [];
this.contentPostFilters = [];
this.contentDomPreFilters = [];
this.contentDomPostFilters = [];
this.editingAreaStyleSheets = [];
if (dojo.render.html.moz) {
this.contentPreFilters.push(this._fixContentForMoz);
}
this._keyHandlers = {};
if (dojo.Deferred) {
this.onLoadDeferred = new dojo.Deferred();
}
}, {inheritWidth:false, focusOnLoad:false, saveName:"", styleSheets:"", _content:"", height:"", minHeight:"1em", isClosed:true, isLoaded:false, useActiveX:false, relativeImageUrls:false, _SEPARATOR:"@@**%%__RICHTEXTBOUNDRY__%%**@@", onLoadDeferred:null, fillInTemplate:function () {
dojo.event.topic.publish("dojo.widget.RichText::init", this);
this.open();
dojo.event.connect(this, "onKeyPressed", this, "afterKeyPress");
dojo.event.connect(this, "onKeyPress", this, "keyPress");
dojo.event.connect(this, "onKeyDown", this, "keyDown");
dojo.event.connect(this, "onKeyUp", this, "keyUp");
this.setupDefaultShortcuts();
}, setupDefaultShortcuts:function () {
var ctrl = this.KEY_CTRL;
var exec = function (cmd, arg) {
return arguments.length == 1 ? function () {
this.execCommand(cmd);
} : function () {
this.execCommand(cmd, arg);
};
};
this.addKeyHandler("b", ctrl, exec("bold"));
this.addKeyHandler("i", ctrl, exec("italic"));
this.addKeyHandler("u", ctrl, exec("underline"));
this.addKeyHandler("a", ctrl, exec("selectall"));
this.addKeyHandler("s", ctrl, function () {
this.save(true);
});
this.addKeyHandler("1", ctrl, exec("formatblock", "h1"));
this.addKeyHandler("2", ctrl, exec("formatblock", "h2"));
this.addKeyHandler("3", ctrl, exec("formatblock", "h3"));
this.addKeyHandler("4", ctrl, exec("formatblock", "h4"));
this.addKeyHandler("\\", ctrl, exec("insertunorderedlist"));
if (!dojo.render.html.ie) {
this.addKeyHandler("Z", ctrl, exec("redo"));
}
}, events:["onBlur", "onFocus", "onKeyPress", "onKeyDown", "onKeyUp", "onClick"], open:function (element) {
if (this.onLoadDeferred.fired >= 0) {
this.onLoadDeferred = new dojo.Deferred();
}
var h = dojo.render.html;
if (!this.isClosed) {
this.close();
}
dojo.event.topic.publish("dojo.widget.RichText::open", this);
this._content = "";
if ((arguments.length == 1) && (element["nodeName"])) {
this.domNode = element;
}
if ((this.domNode["nodeName"]) && (this.domNode.nodeName.toLowerCase() == "textarea")) {
this.textarea = this.domNode;
var html = this._preFilterContent(this.textarea.value);
this.domNode = dojo.doc().createElement("div");
dojo.html.copyStyle(this.domNode, this.textarea);
var tmpFunc = dojo.lang.hitch(this, function () {
with (this.textarea.style) {
display = "block";
position = "absolute";
left = top = "-1000px";
if (h.ie) {
this.__overflow = overflow;
overflow = "hidden";
}
}
});
if (h.ie) {
setTimeout(tmpFunc, 10);
} else {
tmpFunc();
}
if (!h.safari) {
dojo.html.insertBefore(this.domNode, this.textarea);
}
if (this.textarea.form) {
dojo.event.connect("before", this.textarea.form, "onsubmit", dojo.lang.hitch(this, function () {
this.textarea.value = this.getEditorContent();
}));
}
var editor = this;
dojo.event.connect(this, "postCreate", function () {
dojo.html.insertAfter(editor.textarea, editor.domNode);
});
} else {
var html = this._preFilterContent(dojo.string.trim(this.domNode.innerHTML));
}
if (html == "") {
html = "&nbsp;";
}
var content = dojo.html.getContentBox(this.domNode);
this._oldHeight = content.height;
this._oldWidth = content.width;
this._firstChildContributingMargin = this._getContributingMargin(this.domNode, "top");
this._lastChildContributingMargin = this._getContributingMargin(this.domNode, "bottom");
this.savedContent = html;
this.domNode.innerHTML = "";
this.editingArea = dojo.doc().createElement("div");
this.domNode.appendChild(this.editingArea);
if ((this.domNode["nodeName"]) && (this.domNode.nodeName == "LI")) {
this.domNode.innerHTML = " <br>";
}
if (this.saveName != "" && (!djConfig["useXDomain"] || djConfig["allowXdRichTextSave"])) {
var saveTextarea = dojo.doc().getElementById("dojo.widget.RichText.savedContent");
if (saveTextarea.value != "") {
var datas = saveTextarea.value.split(this._SEPARATOR);
for (var i = 0; i < datas.length; i++) {
var data = datas[i].split(":");
if (data[0] == this.saveName) {
html = data[1];
datas.splice(i, 1);
break;
}
}
}
dojo.event.connect("before", window, "onunload", this, "_saveContent");
}
if (h.ie70 && this.useActiveX) {
dojo.debug("activeX in ie70 is not currently supported, useActiveX is ignored for now.");
this.useActiveX = false;
}
if (this.useActiveX && h.ie) {
var self = this;
setTimeout(function () {
self._drawObject(html);
}, 0);
} else {
if (h.ie || this._safariIsLeopard() || h.opera) {
this.iframe = dojo.doc().createElement("iframe");
this.iframe.src = "javascript:void(0)";
this.editorObject = this.iframe;
with (this.iframe.style) {
border = "0";
width = "100%";
}
this.iframe.frameBorder = 0;
this.editingArea.appendChild(this.iframe);
this.window = this.iframe.contentWindow;
this.document = this.window.document;
this.document.open();
this.document.write("<html><head><style>body{margin:0;padding:0;border:0;overflow:hidden;}</style></head><body><div></div></body></html>");
this.document.close();
this.editNode = this.document.body.firstChild;
this.editNode.contentEditable = true;
with (this.iframe.style) {
if (h.ie70) {
if (this.height) {
height = this.height;
}
if (this.minHeight) {
minHeight = this.minHeight;
}
} else {
height = this.height ? this.height : this.minHeight;
}
}
var formats = ["p", "pre", "address", "h1", "h2", "h3", "h4", "h5", "h6", "ol", "div", "ul"];
var localhtml = "";
for (var i in formats) {
if (formats[i].charAt(1) != "l") {
localhtml += "<" + formats[i] + "><span>content</span></" + formats[i] + ">";
} else {
localhtml += "<" + formats[i] + "><li>content</li></" + formats[i] + ">";
}
}
with (this.editNode.style) {
position = "absolute";
left = "-2000px";
top = "-2000px";
}
this.editNode.innerHTML = localhtml;
var node = this.editNode.firstChild;
while (node) {
dojo.withGlobal(this.window, "selectElement", dojo.html.selection, [node.firstChild]);
var nativename = node.tagName.toLowerCase();
this._local2NativeFormatNames[nativename] = this.queryCommandValue("formatblock");
this._native2LocalFormatNames[this._local2NativeFormatNames[nativename]] = nativename;
node = node.nextSibling;
}
with (this.editNode.style) {
position = "";
left = "";
top = "";
}
this.editNode.innerHTML = html;
if (this.height) {
this.document.body.style.overflowY = "scroll";
}
dojo.lang.forEach(this.events, function (e) {
dojo.event.connect(this.editNode, e.toLowerCase(), this, e);
}, this);
this.onLoad();
} else {
this._drawIframe(html);
this.editorObject = this.iframe;
}
}
if (this.domNode.nodeName == "LI") {
this.domNode.lastChild.style.marginTop = "-1.2em";
}
dojo.html.addClass(this.domNode, "RichTextEditable");
this.isClosed = false;
}, _hasCollapseableMargin:function (element, side) {
if (dojo.html.getPixelValue(element, "border-" + side + "-width", false)) {
return false;
} else {
if (dojo.html.getPixelValue(element, "padding-" + side, false)) {
return false;
} else {
return true;
}
}
}, _getContributingMargin:function (element, topOrBottom) {
if (topOrBottom == "top") {
var siblingAttr = "previousSibling";
var childSiblingAttr = "nextSibling";
var childAttr = "firstChild";
var marginProp = "margin-top";
var siblingMarginProp = "margin-bottom";
} else {
var siblingAttr = "nextSibling";
var childSiblingAttr = "previousSibling";
var childAttr = "lastChild";
var marginProp = "margin-bottom";
var siblingMarginProp = "margin-top";
}
var elementMargin = dojo.html.getPixelValue(element, marginProp, false);
function isSignificantNode(element) {
return !(element.nodeType == 3 && dojo.string.isBlank(element.data)) && dojo.html.getStyle(element, "display") != "none" && !dojo.html.isPositionAbsolute(element);
}
var childMargin = 0;
var child = element[childAttr];
while (child) {
while ((!isSignificantNode(child)) && child[childSiblingAttr]) {
child = child[childSiblingAttr];
}
childMargin = Math.max(childMargin, dojo.html.getPixelValue(child, marginProp, false));
if (!this._hasCollapseableMargin(child, topOrBottom)) {
break;
}
child = child[childAttr];
}
if (!this._hasCollapseableMargin(element, topOrBottom)) {
return parseInt(childMargin);
}
var contextMargin = 0;
var sibling = element[siblingAttr];
while (sibling) {
if (isSignificantNode(sibling)) {
contextMargin = dojo.html.getPixelValue(sibling, siblingMarginProp, false);
break;
}
sibling = sibling[siblingAttr];
}
if (!sibling) {
contextMargin = dojo.html.getPixelValue(element.parentNode, marginProp, false);
}
if (childMargin > elementMargin) {
return parseInt(Math.max((childMargin - elementMargin) - contextMargin, 0));
} else {
return 0;
}
}, _drawIframe:function (html) {
var oldMoz = Boolean(dojo.render.html.moz && (typeof window.XML == "undefined"));
if (!this.iframe) {
var currentDomain = (new dojo.uri.Uri(dojo.doc().location)).host;
this.iframe = dojo.doc().createElement("iframe");
with (this.iframe) {
style.border = "none";
style.lineHeight = "0";
style.verticalAlign = "bottom";
scrolling = this.height ? "auto" : "no";
}
}
if (djConfig["useXDomain"] && !djConfig["dojoRichTextFrameUrl"]) {
dojo.debug("dojo.widget.RichText: When using cross-domain Dojo builds," + " please save src/widget/templates/richtextframe.html to your domain and set djConfig.dojoRichTextFrameUrl" + " to the path on your domain to richtextframe.html");
}
this.iframe.src = (djConfig["dojoRichTextFrameUrl"] || dojo.uri.moduleUri("dojo.widget", "templates/richtextframe.html")) + ((dojo.doc().domain != currentDomain) ? ("#" + dojo.doc().domain) : "");
this.iframe.width = this.inheritWidth ? this._oldWidth : "100%";
if (this.height) {
this.iframe.style.height = this.height;
} else {
var height = this._oldHeight;
if (this._hasCollapseableMargin(this.domNode, "top")) {
height += this._firstChildContributingMargin;
}
if (this._hasCollapseableMargin(this.domNode, "bottom")) {
height += this._lastChildContributingMargin;
}
this.iframe.height = height;
}
var tmpContent = dojo.doc().createElement("div");
tmpContent.innerHTML = html;
this.editingArea.appendChild(tmpContent);
if (this.relativeImageUrls) {
var imgs = tmpContent.getElementsByTagName("img");
for (var i = 0; i < imgs.length; i++) {
imgs[i].src = (new dojo.uri.Uri(dojo.global().location, imgs[i].src)).toString();
}
html = tmpContent.innerHTML;
}
var firstChild = dojo.html.firstElement(tmpContent);
var lastChild = dojo.html.lastElement(tmpContent);
if (firstChild) {
firstChild.style.marginTop = this._firstChildContributingMargin + "px";
}
if (lastChild) {
lastChild.style.marginBottom = this._lastChildContributingMargin + "px";
}
this.editingArea.appendChild(this.iframe);
if (dojo.render.html.safari) {
this.iframe.src = this.iframe.src;
}
var _iframeInitialized = false;
var ifrFunc = dojo.lang.hitch(this, function () {
if (!_iframeInitialized) {
_iframeInitialized = true;
} else {
return;
}
if (!this.editNode) {
if (this.iframe.contentWindow) {
this.window = this.iframe.contentWindow;
this.document = this.iframe.contentWindow.document;
} else {
if (this.iframe.contentDocument) {
this.window = this.iframe.contentDocument.window;
this.document = this.iframe.contentDocument;
}
}
var getStyle = (function (domNode) {
return function (style) {
return dojo.html.getStyle(domNode, style);
};
})(this.domNode);
var font = getStyle("font-weight") + " " + getStyle("font-size") + " " + getStyle("font-family");
var lineHeight = "1.0";
var lineHeightStyle = dojo.html.getUnitValue(this.domNode, "line-height");
if (lineHeightStyle.value && lineHeightStyle.units == "") {
lineHeight = lineHeightStyle.value;
}
dojo.html.insertCssText("body,html{background:transparent;padding:0;margin:0;}" + "body{top:0;left:0;right:0;" + (((this.height) || (dojo.render.html.opera)) ? "" : "position:fixed;") + "font:" + font + ";" + "min-height:" + this.minHeight + ";" + "line-height:" + lineHeight + "}" + "p{margin: 1em 0 !important;}" + "body > *:first-child{padding-top:0 !important;margin-top:" + this._firstChildContributingMargin + "px !important;}" + "body > *:last-child{padding-bottom:0 !important;margin-bottom:" + this._lastChildContributingMargin + "px !important;}" + "li > ul:-moz-first-node, li > ol:-moz-first-node{padding-top:1.2em;}\n" + "li{min-height:1.2em;}" + "", this.document);
dojo.html.removeNode(tmpContent);
this.document.body.innerHTML = html;
if (oldMoz || dojo.render.html.safari) {
this.document.designMode = "on";
}
this.onLoad();
} else {
dojo.html.removeNode(tmpContent);
this.editNode.innerHTML = html;
this.onDisplayChanged();
}
});
if (this.editNode) {
ifrFunc();
} else {
if (dojo.render.html.moz) {
this.iframe.onload = function () {
setTimeout(ifrFunc, 250);
};
} else {
this.iframe.onload = ifrFunc;
}
}
}, _applyEditingAreaStyleSheets:function () {
var files = [];
if (this.styleSheets) {
files = this.styleSheets.split(";");
this.styleSheets = "";
}
files = files.concat(this.editingAreaStyleSheets);
this.editingAreaStyleSheets = [];
if (files.length > 0) {
for (var i = 0; i < files.length; i++) {
var url = files[i];
if (url) {
this.addStyleSheet(dojo.uri.dojoUri(url));
}
}
}
}, addStyleSheet:function (uri) {
var url = uri.toString();
if (dojo.lang.find(this.editingAreaStyleSheets, url) > -1) {
dojo.debug("dojo.widget.RichText.addStyleSheet: Style sheet " + url + " is already applied to the editing area!");
return;
}
if (url.charAt(0) == "." || (url.charAt(0) != "/" && !uri.host)) {
url = (new dojo.uri.Uri(dojo.global().location, url)).toString();
}
this.editingAreaStyleSheets.push(url);
if (this.document.createStyleSheet) {
this.document.createStyleSheet(url);
} else {
var head = this.document.getElementsByTagName("head")[0];
var stylesheet = this.document.createElement("link");
with (stylesheet) {
rel = "stylesheet";
type = "text/css";
href = url;
}
head.appendChild(stylesheet);
}
}, removeStyleSheet:function (uri) {
var url = uri.toString();
if (url.charAt(0) == "." || (url.charAt(0) != "/" && !uri.host)) {
url = (new dojo.uri.Uri(dojo.global().location, url)).toString();
}
var index = dojo.lang.find(this.editingAreaStyleSheets, url);
if (index == -1) {
dojo.debug("dojo.widget.RichText.removeStyleSheet: Style sheet " + url + " is not applied to the editing area so it can not be removed!");
return;
}
delete this.editingAreaStyleSheets[index];
var links = this.document.getElementsByTagName("link");
for (var i = 0; i < links.length; i++) {
if (links[i].href == url) {
if (dojo.render.html.ie) {
links[i].href = "";
}
dojo.html.removeNode(links[i]);
break;
}
}
}, _drawObject:function (html) {
this.object = dojo.html.createExternalElement(dojo.doc(), "object");
with (this.object) {
classid = "clsid:2D360201-FFF5-11D1-8D03-00A0C959BC0A";
width = this.inheritWidth ? this._oldWidth : "100%";
style.height = this.height ? this.height : (this._oldHeight + "px");
Scrollbars = this.height ? true : false;
Appearance = this._activeX.appearance.flat;
}
this.editorObject = this.object;
this.editingArea.appendChild(this.object);
this.object.attachEvent("DocumentComplete", dojo.lang.hitch(this, "onLoad"));
dojo.lang.forEach(this.events, function (e) {
this.object.attachEvent(e.toLowerCase(), dojo.lang.hitch(this, e));
}, this);
this.object.DocumentHTML = "<!doctype HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">" + "<html><title></title>" + "<style type=\"text/css\">" + " body,html { padding: 0; margin: 0; }" + (this.height ? "" : " body, { overflow: hidden; }") + "</style>" + "<body><div>" + html + "<div></body></html>";
this._cacheLocalBlockFormatNames();
}, _local2NativeFormatNames:{}, _native2LocalFormatNames:{}, _cacheLocalBlockFormatNames:function () {
if (!this._native2LocalFormatNames["p"]) {
var obj = this.object;
var error = false;
if (!obj) {
try {
obj = dojo.html.createExternalElement(dojo.doc(), "object");
obj.classid = "clsid:2D360201-FFF5-11D1-8D03-00A0C959BC0A";
dojo.body().appendChild(obj);
obj.DocumentHTML = "<html><head></head><body></body></html>";
}
catch (e) {
error = true;
}
}
try {
var oNamesParm = new ActiveXObject("DEGetBlockFmtNamesParam.DEGetBlockFmtNamesParam");
obj.ExecCommand(this._activeX.command["getblockformatnames"], 0, oNamesParm);
var vbNamesArray = new VBArray(oNamesParm.Names);
var localFormats = vbNamesArray.toArray();
var nativeFormats = ["p", "pre", "address", "h1", "h2", "h3", "h4", "h5", "h6", "ol", "ul", "", "", "", "", "div"];
for (var i = 0; i < nativeFormats.length; ++i) {
if (nativeFormats[i].length > 0) {
this._local2NativeFormatNames[localFormats[i]] = nativeFormats[i];
this._native2LocalFormatNames[nativeFormats[i]] = localFormats[i];
}
}
}
catch (e) {
error = true;
}
if (obj && !this.object) {
dojo.body().removeChild(obj);
}
}
return !error;
}, _isResized:function () {
return false;
}, onLoad:function (e) {
this.isLoaded = true;
if (this.object) {
this.document = this.object.DOM;
this.window = this.document.parentWindow;
this.editNode = this.document.body.firstChild;
this.editingArea.style.height = this.height ? this.height : this.minHeight;
if (!this.height) {
this.connect(this, "onDisplayChanged", "_updateHeight");
}
this.window._frameElement = this.object;
} else {
if (this.iframe && !dojo.render.html.ie) {
this.editNode = this.document.body;
if (!this.height) {
this.connect(this, "onDisplayChanged", "_updateHeight");
}
try {
this.document.execCommand("useCSS", false, true);
this.document.execCommand("styleWithCSS", false, false);
}
catch (e2) {
}
if (dojo.render.html.safari) {
this.connect(this.editNode, "onblur", "onBlur");
this.connect(this.editNode, "onfocus", "onFocus");
this.connect(this.editNode, "onclick", "onFocus");
this.interval = setInterval(dojo.lang.hitch(this, "onDisplayChanged"), 750);
} else {
if (dojo.render.html.mozilla || dojo.render.html.opera) {
var doc = this.document;
var addListener = dojo.event.browser.addListener;
var self = this;
dojo.lang.forEach(this.events, function (e) {
var l = addListener(self.document, e.substr(2).toLowerCase(), dojo.lang.hitch(self, e));
if (e == "onBlur") {
var unBlur = {unBlur:function (e) {
dojo.event.browser.removeListener(doc, "blur", l);
}};
dojo.event.connect("before", self, "close", unBlur, "unBlur");
}
});
}
}
} else {
if (dojo.render.html.ie) {
if (!this.height) {
this.connect(this, "onDisplayChanged", "_updateHeight");
}
this.editNode.style.zoom = 1;
}
}
}
this._applyEditingAreaStyleSheets();
if (this.focusOnLoad) {
this.focus();
}
this.onDisplayChanged(e);
if (this.onLoadDeferred) {
this.onLoadDeferred.callback(true);
}
}, onKeyDown:function (e) {
if ((!e) && (this.object)) {
e = dojo.event.browser.fixEvent(this.window.event);
}
if ((dojo.render.html.ie) && (e.keyCode == e.KEY_TAB)) {
e.preventDefault();
e.stopPropagation();
this.execCommand((e.shiftKey ? "outdent" : "indent"));
} else {
if (dojo.render.html.ie) {
if ((65 <= e.keyCode) && (e.keyCode <= 90)) {
e.charCode = e.keyCode;
this.onKeyPress(e);
}
}
}
}, onKeyUp:function (e) {
return;
}, KEY_CTRL:1, onKeyPress:function (e) {
if ((!e) && (this.object)) {
e = dojo.event.browser.fixEvent(this.window.event);
}
var modifiers = e.ctrlKey ? this.KEY_CTRL : 0;
if (this._keyHandlers[e.key]) {
var handlers = this._keyHandlers[e.key], i = 0, handler;
while (handler = handlers[i++]) {
if (modifiers == handler.modifiers) {
e.preventDefault();
handler.handler.call(this);
break;
}
}
}
dojo.lang.setTimeout(this, this.onKeyPressed, 1, e);
}, addKeyHandler:function (key, modifiers, handler) {
if (!(this._keyHandlers[key] instanceof Array)) {
this._keyHandlers[key] = [];
}
this._keyHandlers[key].push({modifiers:modifiers || 0, handler:handler});
}, onKeyPressed:function (e) {
this.onDisplayChanged();
}, onClick:function (e) {
this.onDisplayChanged(e);
}, onBlur:function (e) {
}, _initialFocus:true, onFocus:function (e) {
if ((dojo.render.html.mozilla) && (this._initialFocus)) {
this._initialFocus = false;
if (dojo.string.trim(this.editNode.innerHTML) == "&nbsp;") {
this.placeCursorAtStart();
}
}
}, blur:function () {
if (this.iframe) {
this.window.blur();
} else {
if (this.object) {
this.document.body.blur();
} else {
if (this.editNode) {
this.editNode.blur();
}
}
}
}, focus:function () {
if (this.iframe && !dojo.render.html.ie) {
this.window.focus();
} else {
if (this.object) {
this.document.focus();
} else {
if (this.editNode && this.editNode.focus) {
this.editNode.focus();
} else {
dojo.debug("Have no idea how to focus into the editor!");
}
}
}
}, onDisplayChanged:function (e) {
}, _activeX:{command:{bold:5000, italic:5023, underline:5048, justifycenter:5024, justifyleft:5025, justifyright:5026, cut:5003, copy:5002, paste:5032, "delete":5004, undo:5049, redo:5033, removeformat:5034, selectall:5035, unlink:5050, indent:5018, outdent:5031, insertorderedlist:5030, insertunorderedlist:5051, inserttable:5022, insertcell:5019, insertcol:5020, insertrow:5021, deletecells:5005, deletecols:5006, deleterows:5007, mergecells:5029, splitcell:5047, setblockformat:5043, getblockformat:5011, getblockformatnames:5012, setfontname:5044, getfontname:5013, setfontsize:5045, getfontsize:5014, setbackcolor:5042, getbackcolor:5010, setforecolor:5046, getforecolor:5015, findtext:5008, font:5009, hyperlink:5016, image:5017, lockelement:5027, makeabsolute:5028, sendbackward:5036, bringforward:5037, sendbelowtext:5038, bringabovetext:5039, sendtoback:5040, bringtofront:5041, properties:5052}, ui:{"default":0, prompt:1, noprompt:2}, status:{notsupported:0, disabled:1, enabled:3, latched:7, ninched:11}, appearance:{flat:0, inset:1}, state:{unchecked:0, checked:1, gray:2}}, _normalizeCommand:function (cmd) {
var drh = dojo.render.html;
var command = cmd.toLowerCase();
if (command == "formatblock") {
if (drh.safari) {
command = "heading";
}
} else {
if (this.object) {
switch (command) {
case "createlink":
command = "hyperlink";
break;
case "insertimage":
command = "image";
break;
}
} else {
if (command == "hilitecolor" && !drh.mozilla) {
command = "backcolor";
}
}
}
return command;
}, _safariIsLeopard:function () {
var gt420 = false;
if (dojo.render.html.safari) {
var tmp = dojo.render.html.UA.split("AppleWebKit/")[1];
var ver = parseFloat(tmp.split(" ")[0]);
if (ver >= 420) {
gt420 = true;
}
}
return gt420;
}, queryCommandAvailable:function (command) {
var ie = 1;
var mozilla = 1 << 1;
var safari = 1 << 2;
var opera = 1 << 3;
var safari420 = 1 << 4;
var gt420 = this._safariIsLeopard();
function isSupportedBy(browsers) {
return {ie:Boolean(browsers & ie), mozilla:Boolean(browsers & mozilla), safari:Boolean(browsers & safari), safari420:Boolean(browsers & safari420), opera:Boolean(browsers & opera)};
}
var supportedBy = null;
switch (command.toLowerCase()) {
case "bold":
case "italic":
case "underline":
case "subscript":
case "superscript":
case "fontname":
case "fontsize":
case "forecolor":
case "hilitecolor":
case "justifycenter":
case "justifyfull":
case "justifyleft":
case "justifyright":
case "delete":
case "selectall":
supportedBy = isSupportedBy(mozilla | ie | safari | opera);
break;
case "createlink":
case "unlink":
case "removeformat":
case "inserthorizontalrule":
case "insertimage":
case "insertorderedlist":
case "insertunorderedlist":
case "indent":
case "outdent":
case "formatblock":
case "inserthtml":
case "undo":
case "redo":
case "strikethrough":
supportedBy = isSupportedBy(mozilla | ie | opera | safari420);
break;
case "blockdirltr":
case "blockdirrtl":
case "dirltr":
case "dirrtl":
case "inlinedirltr":
case "inlinedirrtl":
supportedBy = isSupportedBy(ie);
break;
case "cut":
case "copy":
case "paste":
supportedBy = isSupportedBy(ie | mozilla | safari420);
break;
case "inserttable":
supportedBy = isSupportedBy(mozilla | (this.object ? ie : 0));
break;
case "insertcell":
case "insertcol":
case "insertrow":
case "deletecells":
case "deletecols":
case "deleterows":
case "mergecells":
case "splitcell":
supportedBy = isSupportedBy(this.object ? ie : 0);
break;
default:
return false;
}
return (dojo.render.html.ie && supportedBy.ie) || (dojo.render.html.mozilla && supportedBy.mozilla) || (dojo.render.html.safari && supportedBy.safari) || (gt420 && supportedBy.safari420) || (dojo.render.html.opera && supportedBy.opera);
}, execCommand:function (command, argument) {
var returnValue;
this.focus();
command = this._normalizeCommand(command);
if (argument != undefined) {
if (command == "heading") {
throw new Error("unimplemented");
} else {
if (command == "formatblock") {
if (this.object) {
argument = this._native2LocalFormatNames[argument];
} else {
if (dojo.render.html.ie) {
argument = "<" + argument + ">";
}
}
}
}
}
if (this.object) {
switch (command) {
case "hilitecolor":
command = "setbackcolor";
break;
case "forecolor":
case "backcolor":
case "fontsize":
case "fontname":
command = "set" + command;
break;
case "formatblock":
command = "setblockformat";
}
if (command == "strikethrough") {
command = "inserthtml";
var range = this.document.selection.createRange();
if (!range.htmlText) {
return;
}
argument = range.htmlText.strike();
} else {
if (command == "inserthorizontalrule") {
command = "inserthtml";
argument = "<hr>";
}
}
if (command == "inserthtml") {
var range = this.document.selection.createRange();
if (this.document.selection.type.toUpperCase() == "CONTROL") {
for (var i = 0; i < range.length; i++) {
range.item(i).outerHTML = argument;
}
} else {
range.pasteHTML(argument);
range.select();
}
returnValue = true;
} else {
if (arguments.length == 1) {
returnValue = this.object.ExecCommand(this._activeX.command[command], this._activeX.ui.noprompt);
} else {
returnValue = this.object.ExecCommand(this._activeX.command[command], this._activeX.ui.noprompt, argument);
}
}
} else {
if (command == "inserthtml") {
if (dojo.render.html.ie) {
var insertRange = this.document.selection.createRange();
insertRange.pasteHTML(argument);
insertRange.select();
return true;
} else {
return this.document.execCommand(command, false, argument);
}
} else {
if ((command == "unlink") && (this.queryCommandEnabled("unlink")) && (dojo.render.html.mozilla)) {
var selection = this.window.getSelection();
var selectionRange = selection.getRangeAt(0);
var selectionStartContainer = selectionRange.startContainer;
var selectionStartOffset = selectionRange.startOffset;
var selectionEndContainer = selectionRange.endContainer;
var selectionEndOffset = selectionRange.endOffset;
var a = dojo.withGlobal(this.window, "getAncestorElement", dojo.html.selection, ["a"]);
dojo.withGlobal(this.window, "selectElement", dojo.html.selection, [a]);
returnValue = this.document.execCommand("unlink", false, null);
var selectionRange = this.document.createRange();
selectionRange.setStart(selectionStartContainer, selectionStartOffset);
selectionRange.setEnd(selectionEndContainer, selectionEndOffset);
selection.removeAllRanges();
selection.addRange(selectionRange);
return returnValue;
} else {
if ((command == "hilitecolor") && (dojo.render.html.mozilla)) {
this.document.execCommand("useCSS", false, false);
returnValue = this.document.execCommand(command, false, argument);
this.document.execCommand("useCSS", false, true);
} else {
if ((dojo.render.html.ie) && ((command == "backcolor") || (command == "forecolor"))) {
argument = arguments.length > 1 ? argument : null;
returnValue = this.document.execCommand(command, false, argument);
} else {
argument = arguments.length > 1 ? argument : null;
if (argument || command != "createlink") {
returnValue = this.document.execCommand(command, false, argument);
}
}
}
}
}
}
this.onDisplayChanged();
return returnValue;
}, queryCommandEnabled:function (command) {
command = this._normalizeCommand(command);
if (this.object) {
switch (command) {
case "hilitecolor":
command = "setbackcolor";
break;
case "forecolor":
case "backcolor":
case "fontsize":
case "fontname":
command = "set" + command;
break;
case "formatblock":
command = "setblockformat";
break;
case "strikethrough":
command = "bold";
break;
case "inserthorizontalrule":
return true;
}
if (typeof this._activeX.command[command] == "undefined") {
return false;
}
var status = this.object.QueryStatus(this._activeX.command[command]);
return ((status != this._activeX.status.notsupported) && (status != this._activeX.status.disabled));
} else {
if (dojo.render.html.mozilla) {
if (command == "unlink") {
return dojo.withGlobal(this.window, "hasAncestorElement", dojo.html.selection, ["a"]);
} else {
if (command == "inserttable") {
return true;
}
}
}
var elem = (dojo.render.html.ie) ? this.document.selection.createRange() : this.document;
return elem.queryCommandEnabled(command);
}
}, queryCommandState:function (command) {
command = this._normalizeCommand(command);
if (this.object) {
if (command == "forecolor") {
command = "setforecolor";
} else {
if (command == "backcolor") {
command = "setbackcolor";
} else {
if (command == "strikethrough") {
return dojo.withGlobal(this.window, "hasAncestorElement", dojo.html.selection, ["strike"]);
} else {
if (command == "inserthorizontalrule") {
return false;
}
}
}
}
if (typeof this._activeX.command[command] == "undefined") {
return null;
}
var status = this.object.QueryStatus(this._activeX.command[command]);
return ((status == this._activeX.status.latched) || (status == this._activeX.status.ninched));
} else {
return this.document.queryCommandState(command);
}
}, queryCommandValue:function (command) {
command = this._normalizeCommand(command);
if (this.object) {
switch (command) {
case "forecolor":
case "backcolor":
case "fontsize":
case "fontname":
command = "get" + command;
return this.object.execCommand(this._activeX.command[command], this._activeX.ui.noprompt);
case "formatblock":
var retvalue = this.object.execCommand(this._activeX.command["getblockformat"], this._activeX.ui.noprompt);
if (retvalue) {
return this._local2NativeFormatNames[retvalue];
}
}
} else {
if (dojo.render.html.ie && command == "formatblock") {
return this._local2NativeFormatNames[this.document.queryCommandValue(command)] || this.document.queryCommandValue(command);
}
return this.document.queryCommandValue(command);
}
}, placeCursorAtStart:function () {
this.focus();
if (dojo.render.html.moz && this.editNode.firstChild && this.editNode.firstChild.nodeType != dojo.dom.TEXT_NODE) {
dojo.withGlobal(this.window, "selectElementChildren", dojo.html.selection, [this.editNode.firstChild]);
} else {
dojo.withGlobal(this.window, "selectElementChildren", dojo.html.selection, [this.editNode]);
}
dojo.withGlobal(this.window, "collapse", dojo.html.selection, [true]);
}, placeCursorAtEnd:function () {
this.focus();
if (dojo.render.html.moz && this.editNode.lastChild && this.editNode.lastChild.nodeType != dojo.dom.TEXT_NODE) {
dojo.withGlobal(this.window, "selectElementChildren", dojo.html.selection, [this.editNode.lastChild]);
} else {
dojo.withGlobal(this.window, "selectElementChildren", dojo.html.selection, [this.editNode]);
}
dojo.withGlobal(this.window, "collapse", dojo.html.selection, [false]);
}, replaceEditorContent:function (html) {
html = this._preFilterContent(html);
if (this.isClosed) {
this.domNode.innerHTML = html;
} else {
if (this.window && this.window.getSelection && !dojo.render.html.moz) {
this.editNode.innerHTML = html;
} else {
if ((this.window && this.window.getSelection) || (this.document && this.document.selection)) {
this.execCommand("selectall");
if (dojo.render.html.moz && !html) {
html = "&nbsp;";
}
this.execCommand("inserthtml", html);
}
}
}
}, _preFilterContent:function (html) {
var ec = html;
dojo.lang.forEach(this.contentPreFilters, function (ef) {
ec = ef(ec);
});
if (this.contentDomPreFilters.length > 0) {
var dom = dojo.doc().createElement("div");
dom.style.display = "none";
dojo.body().appendChild(dom);
dom.innerHTML = ec;
dojo.lang.forEach(this.contentDomPreFilters, function (ef) {
dom = ef(dom);
});
ec = dom.innerHTML;
dojo.body().removeChild(dom);
}
return ec;
}, _postFilterContent:function (html) {
var ec = html;
if (this.contentDomPostFilters.length > 0) {
var dom = this.document.createElement("div");
dom.innerHTML = ec;
dojo.lang.forEach(this.contentDomPostFilters, function (ef) {
dom = ef(dom);
});
ec = dom.innerHTML;
}
dojo.lang.forEach(this.contentPostFilters, function (ef) {
ec = ef(ec);
});
return ec;
}, _lastHeight:0, _updateHeight:function () {
if (!this.isLoaded) {
return;
}
if (this.height) {
return;
}
var height = dojo.html.getBorderBox(this.editNode).height;
if (!height) {
height = dojo.html.getBorderBox(this.document.body).height;
}
if (height == 0) {
dojo.debug("Can not figure out the height of the editing area!");
return;
}
this._lastHeight = height;
this.editorObject.style.height = this._lastHeight + "px";
this.window.scrollTo(0, 0);
}, _saveContent:function (e) {
var saveTextarea = dojo.doc().getElementById("dojo.widget.RichText.savedContent");
saveTextarea.value += this._SEPARATOR + this.saveName + ":" + this.getEditorContent();
}, getEditorContent:function () {
var ec = "";
try {
ec = (this._content.length > 0) ? this._content : this.editNode.innerHTML;
if (dojo.string.trim(ec) == "&nbsp;") {
ec = "";
}
}
catch (e) {
}
if (dojo.render.html.ie && !this.object) {
var re = new RegExp("(?:<p>&nbsp;</p>[\n\r]*)+$", "i");
ec = ec.replace(re, "");
}
ec = this._postFilterContent(ec);
if (this.relativeImageUrls) {
var siteBase = dojo.global().location.protocol + "//" + dojo.global().location.host;
var pathBase = dojo.global().location.pathname;
if (pathBase.match(/\/$/)) {
} else {
var pathParts = pathBase.split("/");
if (pathParts.length) {
pathParts.pop();
}
pathBase = pathParts.join("/") + "/";
}
var sameSite = new RegExp("(<img[^>]* src=[\"'])(" + siteBase + "(" + pathBase + ")?)", "ig");
ec = ec.replace(sameSite, "$1");
}
return ec;
}, close:function (save, force) {
if (this.isClosed) {
return false;
}
if (arguments.length == 0) {
save = true;
}
this._content = this._postFilterContent(this.editNode.innerHTML);
var changed = (this.savedContent != this._content);
if (this.interval) {
clearInterval(this.interval);
}
if (dojo.render.html.ie && !this.object) {
dojo.event.browser.clean(this.editNode);
}
if (this.iframe) {
delete this.iframe;
}
if (this.textarea) {
with (this.textarea.style) {
position = "";
left = top = "";
if (dojo.render.html.ie) {
overflow = this.__overflow;
this.__overflow = null;
}
}
if (save) {
this.textarea.value = this._content;
} else {
this.textarea.value = this.savedContent;
}
dojo.html.removeNode(this.domNode);
this.domNode = this.textarea;
} else {
if (save) {
if (dojo.render.html.moz) {
var nc = dojo.doc().createElement("span");
this.domNode.appendChild(nc);
nc.innerHTML = this.editNode.innerHTML;
} else {
this.domNode.innerHTML = this._content;
}
} else {
this.domNode.innerHTML = this.savedContent;
}
}
dojo.html.removeClass(this.domNode, "RichTextEditable");
this.isClosed = true;
this.isLoaded = false;
delete this.editNode;
if (this.window._frameElement) {
this.window._frameElement = null;
}
this.window = null;
this.document = null;
this.object = null;
this.editingArea = null;
this.editorObject = null;
return changed;
}, destroyRendering:function () {
}, destroy:function () {
this.destroyRendering();
if (!this.isClosed) {
this.close(false);
}
dojo.widget.RichText.superclass.destroy.call(this);
}, connect:function (targetObj, targetFunc, thisFunc) {
dojo.event.connect(targetObj, targetFunc, this, thisFunc);
}, disconnect:function (targetObj, targetFunc, thisFunc) {
dojo.event.disconnect(targetObj, targetFunc, this, thisFunc);
}, disconnectAllWithRoot:function (targetObj) {
dojo.deprecated("disconnectAllWithRoot", "is deprecated. No need to disconnect manually", "0.5");
}, _fixContentForMoz:function (html) {
html = html.replace(/<strong([ \>])/gi, "<b$1");
html = html.replace(/<\/strong>/gi, "</b>");
html = html.replace(/<em([ \>])/gi, "<i$1");
html = html.replace(/<\/em>/gi, "</i>");
return html;
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Tooltip.js
New file
0,0 → 1,105
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Tooltip");
dojo.require("dojo.widget.ContentPane");
dojo.require("dojo.widget.PopupContainer");
dojo.require("dojo.uri.Uri");
dojo.require("dojo.widget.*");
dojo.require("dojo.event.*");
dojo.require("dojo.html.style");
dojo.require("dojo.html.util");
dojo.widget.defineWidget("dojo.widget.Tooltip", [dojo.widget.ContentPane, dojo.widget.PopupContainerBase], {caption:"", showDelay:500, hideDelay:100, connectId:"", templateCssString:".dojoTooltip {\n\tborder: solid black 1px;\n\tbackground: beige;\n\tcolor: black;\n\tposition: absolute;\n\tfont-size: small;\n\tpadding: 2px 2px 2px 2px;\n\tz-index: 10;\n\tdisplay: block;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/TooltipTemplate.css"), fillInTemplate:function (args, frag) {
if (this.caption != "") {
this.domNode.appendChild(document.createTextNode(this.caption));
}
this._connectNode = dojo.byId(this.connectId);
dojo.widget.Tooltip.superclass.fillInTemplate.call(this, args, frag);
this.addOnLoad(this, "_loadedContent");
dojo.html.addClass(this.domNode, "dojoTooltip");
var source = this.getFragNodeRef(frag);
dojo.html.copyStyle(this.domNode, source);
this.applyPopupBasicStyle();
}, postCreate:function (args, frag) {
dojo.event.connect(this._connectNode, "onmouseover", this, "_onMouseOver");
dojo.widget.Tooltip.superclass.postCreate.call(this, args, frag);
}, _onMouseOver:function (e) {
this._mouse = {x:e.pageX, y:e.pageY};
if (!this._tracking) {
dojo.event.connect(document.documentElement, "onmousemove", this, "_onMouseMove");
this._tracking = true;
}
this._onHover(e);
}, _onMouseMove:function (e) {
this._mouse = {x:e.pageX, y:e.pageY};
if (dojo.html.overElement(this._connectNode, e) || dojo.html.overElement(this.domNode, e)) {
this._onHover(e);
} else {
this._onUnHover(e);
}
}, _onHover:function (e) {
if (this._hover) {
return;
}
this._hover = true;
if (this._hideTimer) {
clearTimeout(this._hideTimer);
delete this._hideTimer;
}
if (!this.isShowingNow && !this._showTimer) {
this._showTimer = setTimeout(dojo.lang.hitch(this, "open"), this.showDelay);
}
}, _onUnHover:function (e) {
if (!this._hover) {
return;
}
this._hover = false;
if (this._showTimer) {
clearTimeout(this._showTimer);
delete this._showTimer;
}
if (this.isShowingNow && !this._hideTimer) {
this._hideTimer = setTimeout(dojo.lang.hitch(this, "close"), this.hideDelay);
}
if (!this.isShowingNow) {
dojo.event.disconnect(document.documentElement, "onmousemove", this, "_onMouseMove");
this._tracking = false;
}
}, open:function () {
if (this.isShowingNow) {
return;
}
dojo.widget.PopupContainerBase.prototype.open.call(this, this._mouse.x, this._mouse.y, null, [this._mouse.x, this._mouse.y], "TL,TR,BL,BR", [10, 15]);
}, close:function () {
if (this.isShowingNow) {
if (this._showTimer) {
clearTimeout(this._showTimer);
delete this._showTimer;
}
if (this._hideTimer) {
clearTimeout(this._hideTimer);
delete this._hideTimer;
}
dojo.event.disconnect(document.documentElement, "onmousemove", this, "_onMouseMove");
this._tracking = false;
dojo.widget.PopupContainerBase.prototype.close.call(this);
}
}, _position:function () {
this.move(this._mouse.x, this._mouse.y, [10, 15], "TL,TR,BL,BR");
}, _loadedContent:function () {
if (this.isShowingNow) {
this._position();
}
}, checkSize:function () {
}, uninitialize:function () {
this.close();
dojo.event.disconnect(this._connectNode, "onmouseover", this, "_onMouseOver");
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/SvgButton.js
New file
0,0 → 1,98
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.SvgButton");
dojo.require("dojo.experimental");
dojo.experimental("dojo.widget.SvgButton");
dojo.widget.SvgButton = function () {
dojo.widget.DomButton.call(this);
dojo.widget.SvgWidget.call(this);
this.onFoo = function () {
alert("bar");
};
this.label = "huzzah!";
this.setLabel = function (x, y, textSize, label, shape) {
var coords = dojo.widget.SvgButton.prototype.coordinates(x, y, textSize, label, shape);
var textString = "";
switch (shape) {
case "ellipse":
textString = "<text x='" + coords[6] + "' y='" + coords[7] + "'>" + label + "</text>";
break;
case "rectangle":
textString = "";
break;
case "circle":
textString = "";
break;
}
return textString;
};
this.fillInTemplate = function (x, y, textSize, label, shape) {
this.textSize = textSize || 12;
this.label = label;
var textWidth = this.label.length * this.textSize;
};
};
dojo.inherits(dojo.widget.SvgButton, dojo.widget.DomButton);
dojo.widget.SvgButton.prototype.shapeString = function (x, y, textSize, label, shape) {
switch (shape) {
case "ellipse":
var coords = dojo.widget.SvgButton.prototype.coordinates(x, y, textSize, label, shape);
return "<ellipse cx='" + coords[4] + "' cy='" + coords[5] + "' rx='" + coords[2] + "' ry='" + coords[3] + "'/>";
break;
case "rect":
return "";
break;
case "circle":
return "";
break;
}
};
dojo.widget.SvgButton.prototype.coordinates = function (x, y, textSize, label, shape) {
switch (shape) {
case "ellipse":
var buttonWidth = label.length * textSize;
var buttonHeight = textSize * 2.5;
var rx = buttonWidth / 2;
var ry = buttonHeight / 2;
var cx = rx + x;
var cy = ry + y;
var textX = cx - rx * textSize / 25;
var textY = cy * 1.1;
return [buttonWidth, buttonHeight, rx, ry, cx, cy, textX, textY];
break;
case "rectangle":
return "";
break;
case "circle":
return "";
break;
}
};
dojo.widget.SvgButton.prototype.labelString = function (x, y, textSize, label, shape) {
var textString = "";
var coords = dojo.widget.SvgButton.prototype.coordinates(x, y, textSize, label, shape);
switch (shape) {
case "ellipse":
textString = "<text x='" + coords[6] + "' y='" + coords[7] + "'>" + label + "</text>";
break;
case "rectangle":
textString = "";
break;
case "circle":
textString = "";
break;
}
return textString;
};
dojo.widget.SvgButton.prototype.templateString = function (x, y, textSize, label, shape) {
return "<g class='dojoButton' dojoAttachEvent='onClick; onMouseMove: onFoo;' dojoAttachPoint='labelNode'>" + dojo.widgets.SVGButton.prototype.shapeString(x, y, textSize, label, shape) + dojo.widget.SVGButton.prototype.labelString(x, y, textSize, label, shape) + "</g>";
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/demoEngine/DemoContainer.js
New file
0,0 → 1,73
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.demoEngine.DemoContainer");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.demoEngine.DemoPane");
dojo.require("dojo.widget.demoEngine.SourcePane");
dojo.require("dojo.widget.TabContainer");
dojo.widget.defineWidget("my.widget.demoEngine.DemoContainer", dojo.widget.HtmlWidget, {templateString:"<div dojoAttachPoint=\"domNode\">\n\t<table width=\"100%\" cellspacing=\"0\" cellpadding=\"5\">\n\t\t<tbody>\n\t\t\t<tr dojoAttachPoint=\"headerNode\">\n\t\t\t\t<td dojoAttachPoint=\"returnNode\" valign=\"middle\" width=\"1%\">\n\t\t\t\t\t<img dojoAttachPoint=\"returnImageNode\" dojoAttachEvent=\"onclick: returnToDemos\"/>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<h1 dojoAttachPoint=\"demoNameNode\"></h1>\n\t\t\t\t\t<p dojoAttachPoint=\"summaryNode\"></p>\n\t\t\t\t</td>\n\t\t\t\t<td dojoAttachPoint=\"tabControlNode\" valign=\"middle\" align=\"right\" nowrap>\n\t\t\t\t\t<span dojoAttachPoint=\"sourceButtonNode\" dojoAttachEvent=\"onclick: showSource\">source</span>\n\t\t\t\t\t<span dojoAttachPoint=\"demoButtonNode\" dojoAttachEvent=\"onclick: showDemo\">demo</span>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td colspan=\"3\">\n\t\t\t\t\t<div dojoAttachPoint=\"tabNode\">\n\t\t\t\t\t</div>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</tbody>\n\t</table>\n</div>\n", templateCssString:".demoContainer{\n\twidth: 100%;\n\theight: 100%;\n\tpadding: 0px;\n\tmargin: 0px;\n}\n\n.demoContainer .return {\n\tcursor: pointer;\n}\n\n.demoContainer span {\n\tmargin-right: 10px;\n\tcursor: pointer;\n}\n\n.demoContainer .selected {\n\tborder-bottom: 5px solid #95bfff;\n}\n\n.demoContainer table {\n\tbackground: #f5f5f5;\n\twidth: 100%;\n\theight: 100%;\n}\n\n.demoContainerTabs {\n\twidth: 100%;\n\theight: 400px;\n}\n\n.demoContainerTabs .dojoTabLabels-top {\n\tdisplay: none;\n}\n\n.demoContainerTabs .dojoTabPaneWrapper {\n\tborder: 0px;\n}\n\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "demoEngine/templates/DemoContainer.css"), postCreate:function () {
dojo.html.addClass(this.domNode, this.domNodeClass);
dojo.html.addClass(this.tabNode, this.tabClass);
dojo.html.addClass(this.returnImageNode, this.returnClass);
this.returnImageNode.src = this.returnImage;
this.tabContainer = dojo.widget.createWidget("TabContainer", {}, this.tabNode);
this.demoTab = dojo.widget.createWidget("DemoPane", {});
this.tabContainer.addChild(this.demoTab);
this.sourceTab = dojo.widget.createWidget("SourcePane", {});
this.tabContainer.addChild(this.sourceTab);
dojo.html.setOpacity(this.domNode, 0);
dojo.html.hide(this.domNode);
}, loadDemo:function (url) {
this.demoTab.setHref(url);
this.sourceTab.setHref(url);
this.showDemo();
}, setName:function (name) {
dojo.html.removeChildren(this.demoNameNode);
this.demoNameNode.appendChild(document.createTextNode(name));
}, setSummary:function (summary) {
dojo.html.removeChildren(this.summaryNode);
this.summaryNode.appendChild(document.createTextNode(summary));
}, showSource:function () {
dojo.html.removeClass(this.demoButtonNode, this.selectedButtonClass);
dojo.html.addClass(this.sourceButtonNode, this.selectedButtonClass);
this.tabContainer.selectTab(this.sourceTab);
}, showDemo:function () {
dojo.html.removeClass(this.sourceButtonNode, this.selectedButtonClass);
dojo.html.addClass(this.demoButtonNode, this.selectedButtonClass);
this.tabContainer.selectTab(this.demoTab);
}, returnToDemos:function () {
dojo.debug("Return To Demos");
}, show:function () {
dojo.html.setOpacity(this.domNode, 1);
dojo.html.show(this.domNode);
this.tabContainer.checkSize();
}}, "", function () {
dojo.debug("DemoPane Init");
this.domNodeClass = "demoContainer";
this.tabContainer = "";
this.sourceTab = "";
this.demoTab = "";
this.headerNode = "";
this.returnNode = "";
this.returnImageNode = "";
this.returnImage = "images/dojoDemos.gif";
this.returnClass = "return";
this.summaryNode = "";
this.demoNameNode = "";
this.tabControlNode = "";
this.tabNode = "";
this.tabClass = "demoContainerTabs";
this.sourceButtonNode = "";
this.demoButtonNode = "";
this.selectedButtonClass = "selected";
});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/demoEngine/__package__.js
New file
0,0 → 1,13
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.kwCompoundRequire({browser:["dojo.widget.demoEngine.DemoItem", "dojo.widget.demoEngine.DemoNavigator", "dojo.widget.demoEngine.DemoPane", "dojo.widget.demoEngine.SourcePane", "dojo.widget.demoEngine.DemoContainer"]});
dojo.provide("dojo.widget.demoEngine.*");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/demoEngine/DemoPane.js
New file
0,0 → 1,31
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.demoEngine.DemoPane");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.widget.defineWidget("my.widget.demoEngine.DemoPane", dojo.widget.HtmlWidget, {templateString:"<div dojoAttachPoint=\"domNode\">\n\t<iframe dojoAttachPoint=\"demoNode\"></iframe>\n</div>\n", templateCssString:".demoPane {\n\twidth: 100%;\n\theight: 100%;\n\tpadding: 0px;\n\tmargin: 0px;\n\toverflow: hidden;\n}\n\n.demoPane iframe {\n\twidth: 100%;\n\theight: 100%;\n\tborder: 0px;\n\tborder: none;\n\toverflow: auto;\n\tpadding: 0px;\n\tmargin:0px;\n\tbackground: #ffffff;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "demoEngine/templates/DemoPane.css"), postCreate:function () {
dojo.html.addClass(this.domNode, this.domNodeClass);
dojo.debug("PostCreate");
this._launchDemo();
}, _launchDemo:function () {
dojo.debug("Launching Demo");
dojo.debug(this.demoNode);
this.demoNode.src = this.href;
}, setHref:function (url) {
this.href = url;
this._launchDemo();
}}, "", function () {
dojo.debug("DemoPane Init");
this.domNodeClass = "demoPane";
this.demoNode = "";
this.href = "";
});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/demoEngine/DemoNavigator.js
New file
0,0 → 1,132
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.demoEngine.DemoNavigator");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.Button");
dojo.require("dojo.widget.demoEngine.DemoItem");
dojo.require("dojo.io.*");
dojo.require("dojo.lfx.*");
dojo.require("dojo.lang.common");
dojo.widget.defineWidget("my.widget.demoEngine.DemoNavigator", dojo.widget.HtmlWidget, {templateString:"<div dojoAttachPoint=\"domNode\">\n\t<table width=\"100%\" cellspacing=\"0\" cellpadding=\"5\">\n\t\t<tbody>\n\t\t\t<tr dojoAttachPoint=\"navigationContainer\">\n\t\t\t\t<td dojoAttachPoint=\"categoriesNode\" valign=\"top\" width=\"1%\">\n\t\t\t\t\t<h1>Categories</h1>\n\t\t\t\t\t<div dojoAttachPoint=\"categoriesButtonsNode\"></div>\n\t\t\t\t</td>\n\n\t\t\t\t<td dojoAttachPoint=\"demoListNode\" valign=\"top\">\n\t\t\t\t\t<div dojoAttachPoint=\"demoListWrapperNode\">\n\t\t\t\t\t\t<div dojoAttachPoint=\"demoListContainerNode\">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td colspan=\"2\">\n\t\t\t\t\t<div dojoAttachPoint=\"demoNode\"></div>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</tbody>\n\t</table>\n</div>\n", templateCssString:".demoNavigatorListWrapper {\n\tborder:1px solid #dcdbdb;\n\tbackground-color:#f8f8f8;\n\tpadding:2px;\n}\n\n.demoNavigatorListContainer {\n\tborder:1px solid #f0f0f0;\n\tbackground-color:#fff;\n\tpadding:1em;\n}\n\n.demoNavigator h1 {\n\tmargin-top: 0px;\n\tmargin-bottom: 10px;\n\tfont-size: 1.2em;\n\tborder-bottom:1px dotted #a9ccf5;\n}\n\n.demoNavigator .dojoButton {\n\tmargin-bottom: 5px;\n}\n\n.demoNavigator .dojoButton .dojoButtonContents {\n\tfont-size: 1.1em;\n\twidth: 100px;\n\tcolor: black;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "demoEngine/templates/DemoNavigator.css"), postCreate:function () {
dojo.html.addClass(this.domNode, this.domNodeClass);
dojo.html.addClass(this.demoListWrapperNode, this.demoListWrapperClass);
dojo.html.addClass(this.demoListContainerNode, this.demoListContainerClass);
if (dojo.render.html.ie) {
dojo.debug("render ie");
dojo.html.hide(this.demoListWrapperNode);
} else {
dojo.debug("render non-ie");
dojo.lfx.html.fadeHide(this.demoListWrapperNode, 0).play();
}
this.getRegistry(this.demoRegistryUrl);
this.demoContainer = dojo.widget.createWidget("DemoContainer", {returnImage:this.returnImage}, this.demoNode);
dojo.event.connect(this.demoContainer, "returnToDemos", this, "returnToDemos");
this.demoContainer.hide();
}, returnToDemos:function () {
this.demoContainer.hide();
if (dojo.render.html.ie) {
dojo.debug("render ie");
dojo.html.show(this.navigationContainer);
} else {
dojo.debug("render non-ie");
dojo.lfx.html.fadeShow(this.navigationContainer, 250).play();
}
dojo.lang.forEach(this.categoriesChildren, dojo.lang.hitch(this, function (child) {
child.checkSize();
}));
dojo.lang.forEach(this.demoListChildren, dojo.lang.hitch(this, function (child) {
child.checkSize();
}));
}, show:function () {
dojo.html.show(this.domNode);
dojo.html.setOpacity(this.domNode, 1);
dojo.html.setOpacity(this.navigationContainer, 1);
dojo.lang.forEach(this.categoriesChildren, dojo.lang.hitch(this, function (child) {
child.checkSize();
}));
dojo.lang.forEach(this.demoListChildren, dojo.lang.hitch(this, function (child) {
child.checkSize();
}));
}, getRegistry:function (url) {
dojo.io.bind({url:url, load:dojo.lang.hitch(this, this.processRegistry), mimetype:"text/json"});
}, processRegistry:function (type, registry, e) {
dojo.debug("Processing Registry");
this.registry = registry;
dojo.lang.forEach(this.registry.navigation, dojo.lang.hitch(this, this.addCategory));
}, addCategory:function (category) {
var newCat = dojo.widget.createWidget("Button", {caption:category.name});
if (!dojo.lang.isObject(this.registry.categories)) {
this.registry.categories = function () {
};
}
this.registry.categories[category.name] = category;
this.categoriesChildren.push(newCat);
this.categoriesButtonsNode.appendChild(newCat.domNode);
newCat.domNode.categoryName = category.name;
dojo.event.connect(newCat, "onClick", this, "onSelectCategory");
}, addDemo:function (demoName) {
var demo = this.registry.definitions[demoName];
if (dojo.render.html.ie) {
dojo.html.show(this.demoListWrapperNode);
} else {
dojo.lfx.html.fadeShow(this.demoListWrapperNode, 250).play();
}
var newDemo = dojo.widget.createWidget("DemoItem", {viewDemoImage:this.viewDemoImage, name:demoName, description:demo.description, thumbnail:demo.thumbnail});
this.demoListChildren.push(newDemo);
this.demoListContainerNode.appendChild(newDemo.domNode);
dojo.event.connect(newDemo, "onSelectDemo", this, "onSelectDemo");
}, onSelectCategory:function (e) {
catName = e.currentTarget.categoryName;
dojo.debug("Selected Category: " + catName);
dojo.lang.forEach(this.demoListChildren, function (child) {
child.destroy();
});
this.demoListChildren = [];
dojo.lang.forEach(this.registry.categories[catName].demos, dojo.lang.hitch(this, function (demoName) {
this.addDemo(demoName);
}));
}, onSelectDemo:function (e) {
dojo.debug("Demo Selected: " + e.target.name);
if (dojo.render.html.ie) {
dojo.debug("render ie");
dojo.html.hide(this.navigationContainer);
this.demoContainer.show();
this.demoContainer.showDemo();
} else {
dojo.debug("render non-ie");
dojo.lfx.html.fadeHide(this.navigationContainer, 250, null, dojo.lang.hitch(this, function () {
this.demoContainer.show();
this.demoContainer.showDemo();
})).play();
}
this.demoContainer.loadDemo(this.registry.definitions[e.target.name].url);
this.demoContainer.setName(e.target.name);
this.demoContainer.setSummary(this.registry.definitions[e.target.name].description);
}}, "", function () {
this.demoRegistryUrl = "demoRegistry.json";
this.registry = function () {
};
this.categoriesNode = "";
this.categoriesButtonsNode = "";
this.navigationContainer = "";
this.domNodeClass = "demoNavigator";
this.demoNode = "";
this.demoContainer = "";
this.demoListWrapperNode = "";
this.demoListWrapperClass = "demoNavigatorListWrapper";
this.demoListContainerClass = "demoNavigatorListContainer";
this.returnImage = "images/dojoDemos.gif";
this.viewDemoImage = "images/viewDemo.png";
this.demoListChildren = [];
this.categoriesChildren = [];
});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/demoEngine/DemoItem.js
New file
0,0 → 1,50
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.demoEngine.DemoItem");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.widget.defineWidget("my.widget.demoEngine.DemoItem", dojo.widget.HtmlWidget, {templateString:"<div dojoAttachPoint=\"domNode\">\n\t<div dojoAttachPoint=\"summaryBoxNode\">\n\t\t<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n\t\t\t<tbody>\n\t\t\t\t<tr>\n\t\t\t\t\t<td dojoAttachPoint=\"screenshotTdNode\" valign=\"top\" width=\"1%\">\n\t\t\t\t\t\t<img dojoAttachPoint=\"thumbnailImageNode\" dojoAttachEvent=\"onclick: onSelectDemo\" />\n\t\t\t\t\t</td>\n\t\t\t\t\t<td dojoAttachPoint=\"summaryContainerNode\" valign=\"top\">\n\t\t\t\t\t\t<h1 dojoAttachPoint=\"nameNode\">\n\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t<div dojoAttachPoint=\"summaryNode\">\n\t\t\t\t\t\t\t<p dojoAttachPoint=\"descriptionNode\"></p>\n\t\t\t\t\t\t\t<div dojoAttachPoint=\"viewDemoLinkNode\"><img dojoAttachPoint=\"viewDemoImageNode\"/ dojoAttachEvent=\"onclick: onSelectDemo\"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t</div>\n</div>\n", templateCssString:".demoItemSummaryBox {\n\tbackground: #efefef;\n\tborder:1px solid #dae3ee;\n}\n\n.demoItemScreenshot {\n\tpadding:0.65em;\n\twidth:175px;\n\tborder-right:1px solid #fafafa;\n\ttext-align:center;\n\tcursor: pointer;\n}\n\n.demoItemWrapper{\n\tmargin-bottom:1em;\n}\n\n.demoItemWrapper a:link, .demoItemWrapper a:visited {\n\tcolor:#a6238f;\n\ttext-decoration:none;\n}\n\n.demoItemSummaryContainer {\n\tborder-left:1px solid #ddd;\n}\n\n.demoItemSummaryContainer h1 {\n\tbackground-color:#e8e8e8;\n\tborder-bottom: 1px solid #e6e6e6;\n\tcolor:#738fb9;\n\tmargin:1px;\n\tpadding:0.5em;\n\tfont-family:\"Lucida Grande\", \"Tahoma\", serif;\n\tfont-size:1.25em;\n\tfont-weight:normal;\n}\n\n.demoItemSummaryContainer h1 .packageSummary {\n\tdisplay:block;\n\tcolor:#000;\n\tfont-size:10px;\n\tmargin-top:2px;\n}\n\n.demoItemSummaryContainer .demoItemSummary{\n\tpadding:1em;\n}\n\n.demoItemSummaryContainer .demoItemSummary p {\n\tfont-size:0.85em;\n\tpadding:0;\n\tmargin:0;\n}\n\n.demoItemView {\n\ttext-align:right;\n\tcursor: pointer;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "demoEngine/templates/DemoItem.css"), postCreate:function () {
dojo.html.addClass(this.domNode, this.domNodeClass);
dojo.html.addClass(this.summaryBoxNode, this.summaryBoxClass);
dojo.html.addClass(this.screenshotTdNode, this.screenshotTdClass);
dojo.html.addClass(this.summaryContainerNode, this.summaryContainerClass);
dojo.html.addClass(this.summaryNode, this.summaryClass);
dojo.html.addClass(this.viewDemoLinkNode, this.viewDemoLinkClass);
this.nameNode.appendChild(document.createTextNode(this.name));
this.descriptionNode.appendChild(document.createTextNode(this.description));
this.thumbnailImageNode.src = this.thumbnail;
this.thumbnailImageNode.name = this.name;
this.viewDemoImageNode.src = this.viewDemoImage;
this.viewDemoImageNode.name = this.name;
}, onSelectDemo:function () {
}}, "", function () {
this.demo = "";
this.domNodeClass = "demoItemWrapper";
this.summaryBoxNode = "";
this.summaryBoxClass = "demoItemSummaryBox";
this.nameNode = "";
this.thumbnailImageNode = "";
this.viewDemoImageNode = "";
this.screenshotTdNode = "";
this.screenshotTdClass = "demoItemScreenshot";
this.summaryContainerNode = "";
this.summaryContainerClass = "demoItemSummaryContainer";
this.summaryNode = "";
this.summaryClass = "demoItemSummary";
this.viewDemoLinkNode = "";
this.viewDemoLinkClass = "demoItemView";
this.descriptionNode = "";
this.name = "Some Demo";
this.description = "This is the description of this demo.";
this.thumbnail = "images/test_thumb.gif";
this.viewDemoImage = "images/viewDemo.png";
});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/demoEngine/templates/SourcePane.html
New file
0,0 → 1,3
<div dojoAttachPoint="domNode">
<textarea dojoAttachPoint="sourceNode" rows="100%"></textarea>
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/demoEngine/templates/DemoContainer.html
New file
0,0 → 1,25
<div dojoAttachPoint="domNode">
<table width="100%" cellspacing="0" cellpadding="5">
<tbody>
<tr dojoAttachPoint="headerNode">
<td dojoAttachPoint="returnNode" valign="middle" width="1%">
<img dojoAttachPoint="returnImageNode" dojoAttachEvent="onclick: returnToDemos"/>
</td>
<td>
<h1 dojoAttachPoint="demoNameNode"></h1>
<p dojoAttachPoint="summaryNode"></p>
</td>
<td dojoAttachPoint="tabControlNode" valign="middle" align="right" nowrap>
<span dojoAttachPoint="sourceButtonNode" dojoAttachEvent="onclick: showSource">source</span>
<span dojoAttachPoint="demoButtonNode" dojoAttachEvent="onclick: showDemo">demo</span>
</td>
</tr>
<tr>
<td colspan="3">
<div dojoAttachPoint="tabNode">
</div>
</td>
</tr>
</tbody>
</table>
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/demoEngine/templates/DemoItem.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/demoEngine/templates/DemoItem.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/demoEngine/templates/DemoPane.html
New file
0,0 → 1,3
<div dojoAttachPoint="domNode">
<iframe dojoAttachPoint="demoNode"></iframe>
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/demoEngine/templates/SourcePane.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/demoEngine/templates/SourcePane.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/demoEngine/templates/DemoContainer.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/demoEngine/templates/DemoContainer.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/demoEngine/templates/DemoPane.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/demoEngine/templates/DemoPane.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/demoEngine/templates/DemoNavigator.html
New file
0,0 → 1,24
<div dojoAttachPoint="domNode">
<table width="100%" cellspacing="0" cellpadding="5">
<tbody>
<tr dojoAttachPoint="navigationContainer">
<td dojoAttachPoint="categoriesNode" valign="top" width="1%">
<h1>Categories</h1>
<div dojoAttachPoint="categoriesButtonsNode"></div>
</td>
 
<td dojoAttachPoint="demoListNode" valign="top">
<div dojoAttachPoint="demoListWrapperNode">
<div dojoAttachPoint="demoListContainerNode">
</div>
</div>
</td>
</tr>
<tr>
<td colspan="2">
<div dojoAttachPoint="demoNode"></div>
</td>
</tr>
</tbody>
</table>
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/demoEngine/templates/general.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/demoEngine/templates/general.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/demoEngine/templates/images/test_thumb.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/demoEngine/templates/images/test_thumb.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/demoEngine/templates/images/viewDemo.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/demoEngine/templates/images/viewDemo.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/demoEngine/templates/DemoItem.html
New file
0,0 → 1,21
<div dojoAttachPoint="domNode">
<div dojoAttachPoint="summaryBoxNode">
<table width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td dojoAttachPoint="screenshotTdNode" valign="top" width="1%">
<img dojoAttachPoint="thumbnailImageNode" dojoAttachEvent="onclick: onSelectDemo" />
</td>
<td dojoAttachPoint="summaryContainerNode" valign="top">
<h1 dojoAttachPoint="nameNode">
</h1>
<div dojoAttachPoint="summaryNode">
<p dojoAttachPoint="descriptionNode"></p>
<div dojoAttachPoint="viewDemoLinkNode"><img dojoAttachPoint="viewDemoImageNode"/ dojoAttachEvent="onclick: onSelectDemo"></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/demoEngine/templates/DemoNavigator.css
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/demoEngine/templates/DemoNavigator.css
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/demoEngine/SourcePane.js
New file
0,0 → 1,33
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.demoEngine.SourcePane");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.io.*");
dojo.widget.defineWidget("my.widget.demoEngine.SourcePane", dojo.widget.HtmlWidget, {templateString:"<div dojoAttachPoint=\"domNode\">\n\t<textarea dojoAttachPoint=\"sourceNode\" rows=\"100%\"></textarea>\n</div>\n", templateCssString:".sourcePane {\n\twidth: 100%;\n\theight: 100%;\n\tpadding: 0px;\n\tmargin: 0px;\n\toverflow: hidden;\n}\n\n.sourcePane textarea{\n\twidth: 100%;\n\theight: 100%;\n\tborder: 0px;\n\toverflow: auto;\n\tpadding: 0px;\n\tmargin:0px;\n}\n\n* html .sourcePane {\n\toverflow: auto;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "demoEngine/templates/SourcePane.css"), postCreate:function () {
dojo.html.addClass(this.domNode, this.domNodeClass);
dojo.debug("PostCreate");
}, getSource:function () {
if (this.href) {
dojo.io.bind({url:this.href, load:dojo.lang.hitch(this, "fillInSource"), mimetype:"text/plain"});
}
}, fillInSource:function (type, source, e) {
this.sourceNode.value = source;
}, setHref:function (url) {
this.href = url;
this.getSource();
}}, "", function () {
dojo.debug("SourcePane Init");
this.domNodeClass = "sourcePane";
this.sourceNode = "";
this.href = "";
});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/TreeWithNode.js
New file
0,0 → 1,113
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.require("dojo.lang.declare");
dojo.provide("dojo.widget.TreeWithNode");
dojo.declare("dojo.widget.TreeWithNode", null, function () {
}, {loadStates:{UNCHECKED:"UNCHECKED", LOADING:"LOADING", LOADED:"LOADED"}, state:"UNCHECKED", objectId:"", isContainer:true, lockLevel:0, lock:function () {
this.lockLevel++;
}, unlock:function () {
if (!this.lockLevel) {
dojo.raise(this.widgetType + " unlock: not locked");
}
this.lockLevel--;
}, expandLevel:0, loadLevel:0, hasLock:function () {
return this.lockLevel > 0;
}, isLocked:function () {
var node = this;
while (true) {
if (node.lockLevel) {
return true;
}
if (!node.parent || node.isTree) {
break;
}
node = node.parent;
}
return false;
}, flushLock:function () {
this.lockLevel = 0;
}, actionIsDisabled:function (action) {
var disabled = false;
if (dojo.lang.inArray(this.actionsDisabled, action)) {
disabled = true;
}
if (this.isTreeNode) {
if (!this.tree.allowAddChildToLeaf && action == this.actions.ADDCHILD && !this.isFolder) {
disabled = true;
}
}
return disabled;
}, actionIsDisabledNow:function (action) {
return this.actionIsDisabled(action) || this.isLocked();
}, setChildren:function (childrenArray) {
if (this.isTreeNode && !this.isFolder) {
this.setFolder();
} else {
if (this.isTreeNode) {
this.state = this.loadStates.LOADED;
}
}
var hadChildren = this.children.length > 0;
if (hadChildren && childrenArray) {
this.destroyChildren();
}
if (childrenArray) {
this.children = childrenArray;
}
var hasChildren = this.children.length > 0;
if (this.isTreeNode && hasChildren != hadChildren) {
this.viewSetHasChildren();
}
for (var i = 0; i < this.children.length; i++) {
var child = this.children[i];
if (!(child instanceof dojo.widget.Widget)) {
child = this.children[i] = this.tree.createNode(child);
var childWidgetCreated = true;
} else {
var childWidgetCreated = false;
}
if (!child.parent) {
child.parent = this;
if (this.tree !== child.tree) {
child.updateTree(this.tree);
}
child.viewAddLayout();
this.containerNode.appendChild(child.domNode);
var message = {child:child, index:i, parent:this, childWidgetCreated:childWidgetCreated};
delete dojo.widget.manager.topWidgets[child.widgetId];
dojo.event.topic.publish(this.tree.eventNames.afterAddChild, message);
}
if (this.tree.eagerWidgetInstantiation) {
dojo.lang.forEach(this.children, function (child) {
child.setChildren();
});
}
}
}, doAddChild:function (child, index) {
return this.addChild(child, index, true);
}, addChild:function (child, index, dontPublishEvent) {
if (dojo.lang.isUndefined(index)) {
index = this.children.length;
}
if (!child.isTreeNode) {
dojo.raise("You can only add TreeNode widgets to a " + this.widgetType + " widget!");
return;
}
this.children.splice(index, 0, child);
child.parent = this;
child.addedTo(this, index, dontPublishEvent);
delete dojo.widget.manager.topWidgets[child.widgetId];
}, onShow:function () {
this.animationInProgress = false;
}, onHide:function () {
this.animationInProgress = false;
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/TreeContextMenuV3.js
New file
0,0 → 1,72
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeContextMenuV3");
dojo.require("dojo.event.*");
dojo.require("dojo.io.*");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.Menu2");
dojo.require("dojo.widget.TreeCommon");
dojo.widget.defineWidget("dojo.widget.TreeContextMenuV3", [dojo.widget.PopupMenu2, dojo.widget.TreeCommon], function () {
this.listenedTrees = {};
}, {listenTreeEvents:["afterTreeCreate", "beforeTreeDestroy"], listenNodeFilter:function (elem) {
return elem instanceof dojo.widget.Widget;
}, onAfterTreeCreate:function (message) {
var tree = message.source;
this.bindDomNode(tree.domNode);
}, onBeforeTreeDestroy:function (message) {
this.unBindDomNode(message.source.domNode);
}, getTreeNode:function () {
var source = this.getTopOpenEvent().target;
var treeNode = this.domElement2TreeNode(source);
return treeNode;
}, open:function () {
var result = dojo.widget.PopupMenu2.prototype.open.apply(this, arguments);
for (var i = 0; i < this.children.length; i++) {
if (this.children[i].menuOpen) {
this.children[i].menuOpen(this.getTreeNode());
}
}
return result;
}, close:function () {
for (var i = 0; i < this.children.length; i++) {
if (this.children[i].menuClose) {
this.children[i].menuClose(this.getTreeNode());
}
}
var result = dojo.widget.PopupMenu2.prototype.close.apply(this, arguments);
return result;
}});
dojo.widget.defineWidget("dojo.widget.TreeMenuItemV3", [dojo.widget.MenuItem2, dojo.widget.TreeCommon], function () {
this.treeActions = [];
}, {treeActions:"", initialize:function (args, frag) {
for (var i = 0; i < this.treeActions.length; i++) {
this.treeActions[i] = this.treeActions[i].toUpperCase();
}
}, getTreeNode:function () {
var menu = this;
while (!(menu instanceof dojo.widget.TreeContextMenuV3)) {
menu = menu.parent;
}
var treeNode = menu.getTreeNode();
return treeNode;
}, menuOpen:function (treeNode) {
treeNode.viewEmphasize();
this.setDisabled(false);
var _this = this;
dojo.lang.forEach(_this.treeActions, function (action) {
_this.setDisabled(treeNode.actionIsDisabledNow(action));
});
}, menuClose:function (treeNode) {
treeNode.viewUnemphasize();
}, toString:function () {
return "[" + this.widgetType + " node " + this.getTreeNode() + "]";
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/TreeDndControllerV3.js
New file
0,0 → 1,69
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeDndControllerV3");
dojo.require("dojo.dnd.TreeDragAndDropV3");
dojo.require("dojo.experimental");
dojo.experimental("Tree drag'n'drop' has lots of problems/bugs, it requires dojo drag'n'drop overhaul to work, probably in 0.5");
dojo.widget.defineWidget("dojo.widget.TreeDndControllerV3", [dojo.widget.HtmlWidget, dojo.widget.TreeCommon], function () {
this.dragSources = {};
this.dropTargets = {};
this.listenedTrees = {};
}, {listenTreeEvents:["afterChangeTree", "beforeTreeDestroy", "afterAddChild"], listenNodeFilter:function (elem) {
return elem instanceof dojo.widget.Widget;
}, initialize:function (args) {
this.treeController = dojo.lang.isString(args.controller) ? dojo.widget.byId(args.controller) : args.controller;
if (!this.treeController) {
dojo.raise("treeController must be declared");
}
}, onBeforeTreeDestroy:function (message) {
this.unlistenTree(message.source);
}, onAfterAddChild:function (message) {
this.listenNode(message.child);
}, onAfterChangeTree:function (message) {
if (!message.oldTree) {
return;
}
if (!message.newTree || !this.listenedTrees[message.newTree.widgetId]) {
this.processDescendants(message.node, this.listenNodeFilter, this.unlistenNode);
}
if (!this.listenedTrees[message.oldTree.widgetId]) {
this.processDescendants(message.node, this.listenNodeFilter, this.listenNode);
}
}, listenNode:function (node) {
if (!node.tree.DndMode) {
return;
}
if (this.dragSources[node.widgetId] || this.dropTargets[node.widgetId]) {
return;
}
var source = null;
var target = null;
if (!node.actionIsDisabled(node.actions.MOVE)) {
var source = this.makeDragSource(node);
this.dragSources[node.widgetId] = source;
}
var target = this.makeDropTarget(node);
this.dropTargets[node.widgetId] = target;
}, makeDragSource:function (node) {
return new dojo.dnd.TreeDragSourceV3(node.contentNode, this, node.tree.widgetId, node);
}, makeDropTarget:function (node) {
return new dojo.dnd.TreeDropTargetV3(node.contentNode, this.treeController, node.tree.DndAcceptTypes, node);
}, unlistenNode:function (node) {
if (this.dragSources[node.widgetId]) {
dojo.dnd.dragManager.unregisterDragSource(this.dragSources[node.widgetId]);
delete this.dragSources[node.widgetId];
}
if (this.dropTargets[node.widgetId]) {
dojo.dnd.dragManager.unregisterDropTarget(this.dropTargets[node.widgetId]);
delete this.dropTargets[node.widgetId];
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/SvgWidget.js
New file
0,0 → 1,69
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.require("dojo.widget.DomWidget");
dojo.provide("dojo.widget.SvgWidget");
dojo.provide("dojo.widget.SVGWidget");
dojo.require("dojo.dom");
dojo.require("dojo.experimental");
dojo.experimental("dojo.widget.SvgWidget");
dojo.widget.declare("dojo.widget.SvgWidget", dojo.widget.DomWidget, {createNodesFromText:function (txt, wrap) {
return dojo.svg.createNodesFromText(txt, wrap);
}});
dojo.widget.SVGWidget = dojo.widget.SvgWidget;
try {
(function () {
var tf = function () {
var rw = new function () {
dojo.widget.SvgWidget.call(this);
this.buildRendering = function () {
return;
};
this.destroyRendering = function () {
return;
};
this.postInitialize = function () {
return;
};
this.widgetType = "SVGRootWidget";
this.domNode = document.documentElement;
};
var wm = dojo.widget.manager;
wm.root = rw;
wm.add(rw);
wm.getWidgetFromNode = function (node) {
var filter = function (x) {
if (x.domNode == node) {
return true;
}
};
var widgets = [];
while ((node) && (widgets.length < 1)) {
widgets = this.getWidgetsByFilter(filter);
node = node.parentNode;
}
if (widgets.length > 0) {
return widgets[0];
} else {
return null;
}
};
wm.getWidgetFromEvent = function (domEvt) {
return this.getWidgetFromNode(domEvt.target);
};
wm.getWidgetFromPrimitive = wm.getWidgetFromNode;
};
dojo.event.connect(dojo.hostenv, "loaded", tf);
})();
}
catch (e) {
alert(e);
}
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/TreeDemo.js
New file
0,0 → 1,83
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeDemo");
dojo.require("dojo.Deferred");
dojo.widget.TreeDemo = {reportIfDefered:function (res) {
if (res instanceof dojo.Deferred) {
res.addCallbacks(function (res) {
return res;
}, function (err) {
dojo.debug("Error");
dojo.debugShallow(err);
});
}
}, resetRandomChildren:function (maxCount) {
this.randomChildrenMaxCount = maxCount;
this.randomChildrenCount = 0;
this.randomChildrenDepth = 0;
}, makeRandomChildren:function (title) {
this.randomChildrenDepth++;
var children = [];
for (var i = 1; i <= 5; i++) {
var t = title + (this.randomChildrenDepth == 1 ? "" : ".") + i;
var node = {title:t};
children.push(node);
this.randomChildrenCount++;
if (this.randomChildrenCount >= this.randomChildrenMaxCount) {
break;
}
}
var i = 1;
var _this = this;
dojo.lang.forEach(children, function (child) {
var t = title + (_this.randomChildrenDepth == 1 ? "" : ".") + i;
i++;
if (_this.randomChildrenCount < _this.randomChildrenMaxCount && (_this.randomChildrenDepth == 1 && child === children[0] || _this.randomChildrenDepth < 5 && Math.random() > 0.3)) {
child.children = _this.makeRandomChildren(t);
}
});
this.randomChildrenDepth--;
return children;
}, bindDemoMenu:function (controller) {
var _t = this;
dojo.event.topic.subscribe("treeContextMenuDestroy/engage", function (menuItem) {
var node = menuItem.getTreeNode();
_t.reportIfDefered(controller.destroyChild(node));
});
dojo.event.topic.subscribe("treeContextMenuRefresh/engage", function (menuItem) {
var node = menuItem.getTreeNode();
_t.reportIfDefered(controller.refreshChildren(node));
});
dojo.event.topic.subscribe("treeContextMenuCreate/engage", function (menuItem) {
var node = menuItem.getTreeNode();
var d = controller.createAndEdit(node, 0);
_t.reportIfDefered(d);
});
dojo.event.topic.subscribe("treeContextMenuUp/engage", function (menuItem) {
var node = menuItem.getTreeNode();
if (node.isFirstChild()) {
return;
}
_t.reportIfDefered(controller.move(node, node.parent, node.getParentIndex() - 1));
});
dojo.event.topic.subscribe("treeContextMenuDown/engage", function (menuItem) {
var node = menuItem.getTreeNode();
if (node.isLastChild()) {
return;
}
_t.reportIfDefered(controller.move(node, node.parent, node.getParentIndex() + 1));
});
dojo.event.topic.subscribe("treeContextMenuEdit/engage", function (menuItem) {
var node = menuItem.getTreeNode();
_t.reportIfDefered(controller.editLabelStart(node));
});
}};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/TreeNode.js
New file
0,0 → 1,244
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeNode");
dojo.require("dojo.html.*");
dojo.require("dojo.event.*");
dojo.require("dojo.io.*");
dojo.widget.defineWidget("dojo.widget.TreeNode", dojo.widget.HtmlWidget, function () {
this.actionsDisabled = [];
}, {widgetType:"TreeNode", loadStates:{UNCHECKED:"UNCHECKED", LOADING:"LOADING", LOADED:"LOADED"}, actions:{MOVE:"MOVE", REMOVE:"REMOVE", EDIT:"EDIT", ADDCHILD:"ADDCHILD"}, isContainer:true, lockLevel:0, templateString:("<div class=\"dojoTreeNode\"> " + "<span treeNode=\"${this.widgetId}\" class=\"dojoTreeNodeLabel\" dojoAttachPoint=\"labelNode\"> " + "\t\t<span dojoAttachPoint=\"titleNode\" dojoAttachEvent=\"onClick: onTitleClick\" class=\"dojoTreeNodeLabelTitle\">${this.title}</span> " + "</span> " + "<span class=\"dojoTreeNodeAfterLabel\" dojoAttachPoint=\"afterLabelNode\">${this.afterLabel}</span> " + "<div dojoAttachPoint=\"containerNode\" style=\"display:none\"></div> " + "</div>").replace(/(>|<)\s+/g, "$1"), childIconSrc:"", childIconFolderSrc:dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/closed.gif"), childIconDocumentSrc:dojo.uri.moduleUri("dojo.widget", "templates/images/Tree/document.gif"), childIcon:null, isTreeNode:true, objectId:"", afterLabel:"", afterLabelNode:null, expandIcon:null, title:"", object:"", isFolder:false, labelNode:null, titleNode:null, imgs:null, expandLevel:"", tree:null, depth:0, isExpanded:false, state:null, domNodeInitialized:false, isFirstChild:function () {
return this.getParentIndex() == 0 ? true : false;
}, isLastChild:function () {
return this.getParentIndex() == this.parent.children.length - 1 ? true : false;
}, lock:function () {
return this.tree.lock.apply(this, arguments);
}, unlock:function () {
return this.tree.unlock.apply(this, arguments);
}, isLocked:function () {
return this.tree.isLocked.apply(this, arguments);
}, cleanLock:function () {
return this.tree.cleanLock.apply(this, arguments);
}, actionIsDisabled:function (action) {
var _this = this;
var disabled = false;
if (this.tree.strictFolders && action == this.actions.ADDCHILD && !this.isFolder) {
disabled = true;
}
if (dojo.lang.inArray(_this.actionsDisabled, action)) {
disabled = true;
}
if (this.isLocked()) {
disabled = true;
}
return disabled;
}, getInfo:function () {
var info = {widgetId:this.widgetId, objectId:this.objectId, index:this.getParentIndex(), isFolder:this.isFolder};
return info;
}, initialize:function (args, frag) {
this.state = this.loadStates.UNCHECKED;
for (var i = 0; i < this.actionsDisabled.length; i++) {
this.actionsDisabled[i] = this.actionsDisabled[i].toUpperCase();
}
this.expandLevel = parseInt(this.expandLevel);
}, adjustDepth:function (depthDiff) {
for (var i = 0; i < this.children.length; i++) {
this.children[i].adjustDepth(depthDiff);
}
this.depth += depthDiff;
if (depthDiff > 0) {
for (var i = 0; i < depthDiff; i++) {
var img = this.tree.makeBlankImg();
this.imgs.unshift(img);
dojo.html.insertBefore(this.imgs[0], this.domNode.firstChild);
}
}
if (depthDiff < 0) {
for (var i = 0; i < -depthDiff; i++) {
this.imgs.shift();
dojo.html.removeNode(this.domNode.firstChild);
}
}
}, markLoading:function () {
this._markLoadingSavedIcon = this.expandIcon.src;
this.expandIcon.src = this.tree.expandIconSrcLoading;
}, unMarkLoading:function () {
if (!this._markLoadingSavedIcon) {
return;
}
var im = new Image();
im.src = this.tree.expandIconSrcLoading;
if (this.expandIcon.src == im.src) {
this.expandIcon.src = this._markLoadingSavedIcon;
}
this._markLoadingSavedIcon = null;
}, setFolder:function () {
dojo.event.connect(this.expandIcon, "onclick", this, "onTreeClick");
this.expandIcon.src = this.isExpanded ? this.tree.expandIconSrcMinus : this.tree.expandIconSrcPlus;
this.isFolder = true;
}, createDOMNode:function (tree, depth) {
this.tree = tree;
this.depth = depth;
this.imgs = [];
for (var i = 0; i < this.depth + 1; i++) {
var img = this.tree.makeBlankImg();
this.domNode.insertBefore(img, this.labelNode);
this.imgs.push(img);
}
this.expandIcon = this.imgs[this.imgs.length - 1];
this.childIcon = this.tree.makeBlankImg();
this.imgs.push(this.childIcon);
dojo.html.insertBefore(this.childIcon, this.titleNode);
if (this.children.length || this.isFolder) {
this.setFolder();
} else {
this.state = this.loadStates.LOADED;
}
dojo.event.connect(this.childIcon, "onclick", this, "onIconClick");
for (var i = 0; i < this.children.length; i++) {
this.children[i].parent = this;
var node = this.children[i].createDOMNode(this.tree, this.depth + 1);
this.containerNode.appendChild(node);
}
if (this.children.length) {
this.state = this.loadStates.LOADED;
}
this.updateIcons();
this.domNodeInitialized = true;
dojo.event.topic.publish(this.tree.eventNames.createDOMNode, {source:this});
return this.domNode;
}, onTreeClick:function (e) {
dojo.event.topic.publish(this.tree.eventNames.treeClick, {source:this, event:e});
}, onIconClick:function (e) {
dojo.event.topic.publish(this.tree.eventNames.iconClick, {source:this, event:e});
}, onTitleClick:function (e) {
dojo.event.topic.publish(this.tree.eventNames.titleClick, {source:this, event:e});
}, markSelected:function () {
dojo.html.addClass(this.titleNode, "dojoTreeNodeLabelSelected");
}, unMarkSelected:function () {
dojo.html.removeClass(this.titleNode, "dojoTreeNodeLabelSelected");
}, updateExpandIcon:function () {
if (this.isFolder) {
this.expandIcon.src = this.isExpanded ? this.tree.expandIconSrcMinus : this.tree.expandIconSrcPlus;
} else {
this.expandIcon.src = this.tree.blankIconSrc;
}
}, updateExpandGrid:function () {
if (this.tree.showGrid) {
if (this.depth) {
this.setGridImage(-2, this.isLastChild() ? this.tree.gridIconSrcL : this.tree.gridIconSrcT);
} else {
if (this.isFirstChild()) {
this.setGridImage(-2, this.isLastChild() ? this.tree.gridIconSrcX : this.tree.gridIconSrcY);
} else {
this.setGridImage(-2, this.isLastChild() ? this.tree.gridIconSrcL : this.tree.gridIconSrcT);
}
}
} else {
this.setGridImage(-2, this.tree.blankIconSrc);
}
}, updateChildGrid:function () {
if ((this.depth || this.tree.showRootGrid) && this.tree.showGrid) {
this.setGridImage(-1, (this.children.length && this.isExpanded) ? this.tree.gridIconSrcP : this.tree.gridIconSrcC);
} else {
if (this.tree.showGrid && !this.tree.showRootGrid) {
this.setGridImage(-1, (this.children.length && this.isExpanded) ? this.tree.gridIconSrcZ : this.tree.blankIconSrc);
} else {
this.setGridImage(-1, this.tree.blankIconSrc);
}
}
}, updateParentGrid:function () {
var parent = this.parent;
for (var i = 0; i < this.depth; i++) {
var idx = this.imgs.length - (3 + i);
var img = (this.tree.showGrid && !parent.isLastChild()) ? this.tree.gridIconSrcV : this.tree.blankIconSrc;
this.setGridImage(idx, img);
parent = parent.parent;
}
}, updateExpandGridColumn:function () {
if (!this.tree.showGrid) {
return;
}
var _this = this;
var icon = this.isLastChild() ? this.tree.blankIconSrc : this.tree.gridIconSrcV;
dojo.lang.forEach(_this.getDescendants(), function (node) {
node.setGridImage(_this.depth, icon);
});
this.updateExpandGrid();
}, updateIcons:function () {
this.imgs[0].style.display = this.tree.showRootGrid ? "inline" : "none";
this.buildChildIcon();
this.updateExpandGrid();
this.updateChildGrid();
this.updateParentGrid();
dojo.profile.stop("updateIcons");
}, buildChildIcon:function () {
if (this.childIconSrc) {
this.childIcon.src = this.childIconSrc;
}
this.childIcon.style.display = this.childIconSrc ? "inline" : "none";
}, setGridImage:function (idx, src) {
if (idx < 0) {
idx = this.imgs.length + idx;
}
this.imgs[idx].style.backgroundImage = "url(" + src + ")";
}, updateIconTree:function () {
this.tree.updateIconTree.call(this);
}, expand:function () {
if (this.isExpanded) {
return;
}
if (this.children.length) {
this.showChildren();
}
this.isExpanded = true;
this.updateExpandIcon();
dojo.event.topic.publish(this.tree.eventNames.expand, {source:this});
}, collapse:function () {
if (!this.isExpanded) {
return;
}
this.hideChildren();
this.isExpanded = false;
this.updateExpandIcon();
dojo.event.topic.publish(this.tree.eventNames.collapse, {source:this});
}, hideChildren:function () {
this.tree.toggleObj.hide(this.containerNode, this.toggleDuration, this.explodeSrc, dojo.lang.hitch(this, "onHide"));
if (dojo.exists(dojo, "dnd.dragManager.dragObjects") && dojo.dnd.dragManager.dragObjects.length) {
dojo.dnd.dragManager.cacheTargetLocations();
}
}, showChildren:function () {
this.tree.toggleObj.show(this.containerNode, this.toggleDuration, this.explodeSrc, dojo.lang.hitch(this, "onShow"));
if (dojo.exists(dojo, "dnd.dragManager.dragObjects") && dojo.dnd.dragManager.dragObjects.length) {
dojo.dnd.dragManager.cacheTargetLocations();
}
}, addChild:function () {
return this.tree.addChild.apply(this, arguments);
}, doAddChild:function () {
return this.tree.doAddChild.apply(this, arguments);
}, edit:function (props) {
dojo.lang.mixin(this, props);
if (props.title) {
this.titleNode.innerHTML = this.title;
}
if (props.afterLabel) {
this.afterLabelNode.innerHTML = this.afterLabel;
}
if (props.childIconSrc) {
this.buildChildIcon();
}
}, removeNode:function () {
return this.tree.removeNode.apply(this, arguments);
}, doRemoveNode:function () {
return this.tree.doRemoveNode.apply(this, arguments);
}, toString:function () {
return "[" + this.widgetType + " Tree:" + this.tree + " ID:" + this.widgetId + " Title:" + this.title + "]";
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/TreeExpandToNodeOnSelect.js
New file
0,0 → 1,20
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeExpandToNodeOnSelect");
dojo.require("dojo.widget.HtmlWidget");
dojo.widget.defineWidget("dojo.widget.TreeExpandToNodeOnSelect", dojo.widget.HtmlWidget, {selector:"", controller:"", withSelected:false, initialize:function () {
this.selector = dojo.widget.byId(this.selector);
this.controller = dojo.widget.byId(this.controller);
dojo.event.topic.subscribe(this.selector.eventNames.select, this, "onSelect");
}, onSelectEvent:function (message) {
this.controller.expandToNode(message.node, this.withSelected);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/PopupContainer.js
New file
0,0 → 1,295
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.PopupContainer");
dojo.require("dojo.html.style");
dojo.require("dojo.html.layout");
dojo.require("dojo.html.selection");
dojo.require("dojo.html.iframe");
dojo.require("dojo.event.*");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.declare("dojo.widget.PopupContainerBase", null, function () {
this.queueOnAnimationFinish = [];
}, {isShowingNow:false, currentSubpopup:null, beginZIndex:1000, parentPopup:null, parent:null, popupIndex:0, aroundBox:dojo.html.boxSizing.BORDER_BOX, openedForWindow:null, processKey:function (evt) {
return false;
}, applyPopupBasicStyle:function () {
with (this.domNode.style) {
display = "none";
position = "absolute";
}
}, aboutToShow:function () {
}, open:function (x, y, parent, explodeSrc, orient, padding) {
if (this.isShowingNow) {
return;
}
if (this.animationInProgress) {
this.queueOnAnimationFinish.push(this.open, arguments);
return;
}
this.aboutToShow();
var around = false, node, aroundOrient;
if (typeof x == "object") {
node = x;
aroundOrient = explodeSrc;
explodeSrc = parent;
parent = y;
around = true;
}
this.parent = parent;
dojo.body().appendChild(this.domNode);
explodeSrc = explodeSrc || parent["domNode"] || [];
var parentPopup = null;
this.isTopLevel = true;
while (parent) {
if (parent !== this && (parent.setOpenedSubpopup != undefined && parent.applyPopupBasicStyle != undefined)) {
parentPopup = parent;
this.isTopLevel = false;
parentPopup.setOpenedSubpopup(this);
break;
}
parent = parent.parent;
}
this.parentPopup = parentPopup;
this.popupIndex = parentPopup ? parentPopup.popupIndex + 1 : 1;
if (this.isTopLevel) {
var button = dojo.html.isNode(explodeSrc) ? explodeSrc : null;
dojo.widget.PopupManager.opened(this, button);
}
if (this.isTopLevel && !dojo.withGlobal(this.openedForWindow || dojo.global(), dojo.html.selection.isCollapsed)) {
this._bookmark = dojo.withGlobal(this.openedForWindow || dojo.global(), dojo.html.selection.getBookmark);
} else {
this._bookmark = null;
}
if (explodeSrc instanceof Array) {
explodeSrc = {left:explodeSrc[0], top:explodeSrc[1], width:0, height:0};
}
with (this.domNode.style) {
display = "";
zIndex = this.beginZIndex + this.popupIndex;
}
if (around) {
this.move(node, padding, aroundOrient);
} else {
this.move(x, y, padding, orient);
}
this.domNode.style.display = "none";
this.explodeSrc = explodeSrc;
this.show();
this.isShowingNow = true;
}, move:function (x, y, padding, orient) {
var around = (typeof x == "object");
if (around) {
var aroundOrient = padding;
var node = x;
padding = y;
if (!aroundOrient) {
aroundOrient = {"BL":"TL", "TL":"BL"};
}
dojo.html.placeOnScreenAroundElement(this.domNode, node, padding, this.aroundBox, aroundOrient);
} else {
if (!orient) {
orient = "TL,TR,BL,BR";
}
dojo.html.placeOnScreen(this.domNode, x, y, padding, true, orient);
}
}, close:function (force) {
if (force) {
this.domNode.style.display = "none";
}
if (this.animationInProgress) {
this.queueOnAnimationFinish.push(this.close, []);
return;
}
this.closeSubpopup(force);
this.hide();
if (this.bgIframe) {
this.bgIframe.hide();
this.bgIframe.size({left:0, top:0, width:0, height:0});
}
if (this.isTopLevel) {
dojo.widget.PopupManager.closed(this);
}
this.isShowingNow = false;
if (this.parent) {
setTimeout(dojo.lang.hitch(this, function () {
try {
if (this.parent["focus"]) {
this.parent.focus();
} else {
this.parent.domNode.focus();
}
}
catch (e) {
dojo.debug("No idea how to focus to parent", e);
}
}), 10);
}
if (this._bookmark && dojo.withGlobal(this.openedForWindow || dojo.global(), dojo.html.selection.isCollapsed)) {
if (this.openedForWindow) {
this.openedForWindow.focus();
}
try {
dojo.withGlobal(this.openedForWindow || dojo.global(), "moveToBookmark", dojo.html.selection, [this._bookmark]);
}
catch (e) {
}
}
this._bookmark = null;
}, closeAll:function (force) {
if (this.parentPopup) {
this.parentPopup.closeAll(force);
} else {
this.close(force);
}
}, setOpenedSubpopup:function (popup) {
this.currentSubpopup = popup;
}, closeSubpopup:function (force) {
if (this.currentSubpopup == null) {
return;
}
this.currentSubpopup.close(force);
this.currentSubpopup = null;
}, onShow:function () {
dojo.widget.PopupContainer.superclass.onShow.apply(this, arguments);
this.openedSize = {w:this.domNode.style.width, h:this.domNode.style.height};
if (dojo.render.html.ie) {
if (!this.bgIframe) {
this.bgIframe = new dojo.html.BackgroundIframe();
this.bgIframe.setZIndex(this.domNode);
}
this.bgIframe.size(this.domNode);
this.bgIframe.show();
}
this.processQueue();
}, processQueue:function () {
if (!this.queueOnAnimationFinish.length) {
return;
}
var func = this.queueOnAnimationFinish.shift();
var args = this.queueOnAnimationFinish.shift();
func.apply(this, args);
}, onHide:function () {
dojo.widget.HtmlWidget.prototype.onHide.call(this);
if (this.openedSize) {
with (this.domNode.style) {
width = this.openedSize.w;
height = this.openedSize.h;
}
}
this.processQueue();
}});
dojo.widget.defineWidget("dojo.widget.PopupContainer", [dojo.widget.HtmlWidget, dojo.widget.PopupContainerBase], {isContainer:true, fillInTemplate:function () {
this.applyPopupBasicStyle();
dojo.widget.PopupContainer.superclass.fillInTemplate.apply(this, arguments);
}});
dojo.widget.PopupManager = new function () {
this.currentMenu = null;
this.currentButton = null;
this.currentFocusMenu = null;
this.focusNode = null;
this.registeredWindows = [];
this.registerWin = function (win) {
if (!win.__PopupManagerRegistered) {
dojo.event.connect(win.document, "onmousedown", this, "onClick");
dojo.event.connect(win, "onscroll", this, "onClick");
dojo.event.connect(win.document, "onkey", this, "onKey");
win.__PopupManagerRegistered = true;
this.registeredWindows.push(win);
}
};
this.registerAllWindows = function (targetWindow) {
if (!targetWindow) {
targetWindow = dojo.html.getDocumentWindow(window.top && window.top.document || window.document);
}
this.registerWin(targetWindow);
for (var i = 0; i < targetWindow.frames.length; i++) {
try {
var win = dojo.html.getDocumentWindow(targetWindow.frames[i].document);
if (win) {
this.registerAllWindows(win);
}
}
catch (e) {
}
}
};
this.unRegisterWin = function (win) {
if (win.__PopupManagerRegistered) {
dojo.event.disconnect(win.document, "onmousedown", this, "onClick");
dojo.event.disconnect(win, "onscroll", this, "onClick");
dojo.event.disconnect(win.document, "onkey", this, "onKey");
win.__PopupManagerRegistered = false;
}
};
this.unRegisterAllWindows = function () {
for (var i = 0; i < this.registeredWindows.length; ++i) {
this.unRegisterWin(this.registeredWindows[i]);
}
this.registeredWindows = [];
};
dojo.addOnLoad(this, "registerAllWindows");
dojo.addOnUnload(this, "unRegisterAllWindows");
this.closed = function (menu) {
if (this.currentMenu == menu) {
this.currentMenu = null;
this.currentButton = null;
this.currentFocusMenu = null;
}
};
this.opened = function (menu, button) {
if (menu == this.currentMenu) {
return;
}
if (this.currentMenu) {
this.currentMenu.close();
}
this.currentMenu = menu;
this.currentFocusMenu = menu;
this.currentButton = button;
};
this.setFocusedMenu = function (menu) {
this.currentFocusMenu = menu;
};
this.onKey = function (e) {
if (!e.key) {
return;
}
if (!this.currentMenu || !this.currentMenu.isShowingNow) {
return;
}
var m = this.currentFocusMenu;
while (m) {
if (m.processKey(e)) {
e.preventDefault();
e.stopPropagation();
break;
}
m = m.parentPopup || m.parentMenu;
}
}, this.onClick = function (e) {
if (!this.currentMenu) {
return;
}
var scrolloffset = dojo.html.getScroll().offset;
var m = this.currentMenu;
while (m) {
if (dojo.html.overElement(m.domNode, e) || dojo.html.isDescendantOf(e.target, m.domNode)) {
return;
}
m = m.currentSubpopup;
}
if (this.currentButton && dojo.html.overElement(this.currentButton, e)) {
return;
}
this.currentMenu.closeAll(true);
};
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/ComboBox.js
New file
0,0 → 1,556
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.ComboBox");
dojo.require("dojo.widget.*");
dojo.require("dojo.event.*");
dojo.require("dojo.io.*");
dojo.require("dojo.html.*");
dojo.require("dojo.string");
dojo.require("dojo.widget.html.stabile");
dojo.require("dojo.widget.PopupContainer");
dojo.declare("dojo.widget.incrementalComboBoxDataProvider", null, function (options) {
this.searchUrl = options.dataUrl;
this._cache = {};
this._inFlight = false;
this._lastRequest = null;
this.allowCache = false;
}, {_addToCache:function (keyword, data) {
if (this.allowCache) {
this._cache[keyword] = data;
}
}, startSearch:function (searchStr, callback) {
if (this._inFlight) {
}
var tss = encodeURIComponent(searchStr);
var realUrl = dojo.string.substituteParams(this.searchUrl, {"searchString":tss});
var _this = this;
var request = this._lastRequest = dojo.io.bind({url:realUrl, method:"get", mimetype:"text/json", load:function (type, data, evt) {
_this._inFlight = false;
if (!dojo.lang.isArray(data)) {
var arrData = [];
for (var key in data) {
arrData.push([data[key], key]);
}
data = arrData;
}
_this._addToCache(searchStr, data);
if (request == _this._lastRequest) {
callback(data);
}
}});
this._inFlight = true;
}});
dojo.declare("dojo.widget.basicComboBoxDataProvider", null, function (options, node) {
this._data = [];
this.searchLimit = 30;
this.searchType = "STARTSTRING";
this.caseSensitive = false;
if (!dj_undef("dataUrl", options) && !dojo.string.isBlank(options.dataUrl)) {
this._getData(options.dataUrl);
} else {
if ((node) && (node.nodeName.toLowerCase() == "select")) {
var opts = node.getElementsByTagName("option");
var ol = opts.length;
var data = [];
for (var x = 0; x < ol; x++) {
var text = opts[x].textContent || opts[x].innerText || opts[x].innerHTML;
var keyValArr = [String(text), String(opts[x].value)];
data.push(keyValArr);
if (opts[x].selected) {
options.setAllValues(keyValArr[0], keyValArr[1]);
}
}
this.setData(data);
}
}
}, {_getData:function (url) {
dojo.io.bind({url:url, load:dojo.lang.hitch(this, function (type, data, evt) {
if (!dojo.lang.isArray(data)) {
var arrData = [];
for (var key in data) {
arrData.push([data[key], key]);
}
data = arrData;
}
this.setData(data);
}), mimetype:"text/json"});
}, startSearch:function (searchStr, callback) {
this._performSearch(searchStr, callback);
}, _performSearch:function (searchStr, callback) {
var st = this.searchType;
var ret = [];
if (!this.caseSensitive) {
searchStr = searchStr.toLowerCase();
}
for (var x = 0; x < this._data.length; x++) {
if ((this.searchLimit > 0) && (ret.length >= this.searchLimit)) {
break;
}
var dataLabel = new String((!this.caseSensitive) ? this._data[x][0].toLowerCase() : this._data[x][0]);
if (dataLabel.length < searchStr.length) {
continue;
}
if (st == "STARTSTRING") {
if (searchStr == dataLabel.substr(0, searchStr.length)) {
ret.push(this._data[x]);
}
} else {
if (st == "SUBSTRING") {
if (dataLabel.indexOf(searchStr) >= 0) {
ret.push(this._data[x]);
}
} else {
if (st == "STARTWORD") {
var idx = dataLabel.indexOf(searchStr);
if (idx == 0) {
ret.push(this._data[x]);
}
if (idx <= 0) {
continue;
}
var matches = false;
while (idx != -1) {
if (" ,/(".indexOf(dataLabel.charAt(idx - 1)) != -1) {
matches = true;
break;
}
idx = dataLabel.indexOf(searchStr, idx + 1);
}
if (!matches) {
continue;
} else {
ret.push(this._data[x]);
}
}
}
}
}
callback(ret);
}, setData:function (pdata) {
this._data = pdata;
}});
dojo.widget.defineWidget("dojo.widget.ComboBox", dojo.widget.HtmlWidget, {forceValidOption:false, searchType:"stringstart", dataProvider:null, autoComplete:true, searchDelay:100, dataUrl:"", fadeTime:200, maxListLength:8, mode:"local", selectedResult:null, dataProviderClass:"", buttonSrc:dojo.uri.moduleUri("dojo.widget", "templates/images/combo_box_arrow.png"), dropdownToggle:"fade", templateString:"<span _=\"whitespace and CR's between tags adds &nbsp; in FF\"\n\tclass=\"dojoComboBoxOuter\"\n\t><input style=\"display:none\" tabindex=\"-1\" name=\"\" value=\"\" \n\t\tdojoAttachPoint=\"comboBoxValue\"\n\t><input style=\"display:none\" tabindex=\"-1\" name=\"\" value=\"\" \n\t\tdojoAttachPoint=\"comboBoxSelectionValue\"\n\t><input type=\"text\" autocomplete=\"off\" class=\"dojoComboBox\"\n\t\tdojoAttachEvent=\"key:_handleKeyEvents; keyUp: onKeyUp; compositionEnd; onResize;\"\n\t\tdojoAttachPoint=\"textInputNode\"\n\t><img hspace=\"0\"\n\t\tvspace=\"0\"\n\t\tclass=\"dojoComboBox\"\n\t\tdojoAttachPoint=\"downArrowNode\"\n\t\tdojoAttachEvent=\"onMouseUp: handleArrowClick; onResize;\"\n\t\tsrc=\"${this.buttonSrc}\"\n></span>\n", templateCssString:".dojoComboBoxOuter {\n\tborder: 0px !important;\n\tmargin: 0px !important;\n\tpadding: 0px !important;\n\tbackground: transparent !important;\n\twhite-space: nowrap !important;\n}\n\n.dojoComboBox {\n\tborder: 1px inset #afafaf;\n\tmargin: 0px;\n\tpadding: 0px;\n\tvertical-align: middle !important;\n\tfloat: none !important;\n\tposition: static !important;\n\tdisplay: inline !important;\n}\n\n/* the input box */\ninput.dojoComboBox {\n\tborder-right-width: 0px !important; \n\tmargin-right: 0px !important;\n\tpadding-right: 0px !important;\n}\n\n/* the down arrow */\nimg.dojoComboBox {\n\tborder-left-width: 0px !important;\n\tpadding-left: 0px !important;\n\tmargin-left: 0px !important;\n}\n\n/* IE vertical-alignment calculations can be off by +-1 but these margins are collapsed away */\n.dj_ie img.dojoComboBox {\n\tmargin-top: 1px; \n\tmargin-bottom: 1px; \n}\n\n/* the drop down */\n.dojoComboBoxOptions {\n\tfont-family: Verdana, Helvetica, Garamond, sans-serif;\n\t/* font-size: 0.7em; */\n\tbackground-color: white;\n\tborder: 1px solid #afafaf;\n\tposition: absolute;\n\tz-index: 1000; \n\toverflow: auto;\n\tcursor: default;\n}\n\n.dojoComboBoxItem {\n\tpadding-left: 2px;\n\tpadding-top: 2px;\n\tmargin: 0px;\n}\n\n.dojoComboBoxItemEven {\n\tbackground-color: #f4f4f4;\n}\n\n.dojoComboBoxItemOdd {\n\tbackground-color: white;\n}\n\n.dojoComboBoxItemHighlight {\n\tbackground-color: #63709A;\n\tcolor: white;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/ComboBox.css"), setValue:function (value) {
this.comboBoxValue.value = value;
if (this.textInputNode.value != value) {
this.textInputNode.value = value;
dojo.widget.html.stabile.setState(this.widgetId, this.getState(), true);
this.onValueChanged(value);
}
}, onValueChanged:function (value) {
}, getValue:function () {
return this.comboBoxValue.value;
}, getState:function () {
return {value:this.getValue()};
}, setState:function (state) {
this.setValue(state.value);
}, enable:function () {
this.disabled = false;
this.textInputNode.removeAttribute("disabled");
}, disable:function () {
this.disabled = true;
this.textInputNode.setAttribute("disabled", true);
}, _getCaretPos:function (element) {
if (dojo.lang.isNumber(element.selectionStart)) {
return element.selectionStart;
} else {
if (dojo.render.html.ie) {
var tr = document.selection.createRange().duplicate();
var ntr = element.createTextRange();
tr.move("character", 0);
ntr.move("character", 0);
try {
ntr.setEndPoint("EndToEnd", tr);
return String(ntr.text).replace(/\r/g, "").length;
}
catch (e) {
return 0;
}
}
}
}, _setCaretPos:function (element, location) {
location = parseInt(location);
this._setSelectedRange(element, location, location);
}, _setSelectedRange:function (element, start, end) {
if (!end) {
end = element.value.length;
}
if (element.setSelectionRange) {
element.focus();
element.setSelectionRange(start, end);
} else {
if (element.createTextRange) {
var range = element.createTextRange();
with (range) {
collapse(true);
moveEnd("character", end);
moveStart("character", start);
select();
}
} else {
element.value = element.value;
element.blur();
element.focus();
var dist = parseInt(element.value.length) - end;
var tchar = String.fromCharCode(37);
var tcc = tchar.charCodeAt(0);
for (var x = 0; x < dist; x++) {
var te = document.createEvent("KeyEvents");
te.initKeyEvent("keypress", true, true, null, false, false, false, false, tcc, tcc);
element.dispatchEvent(te);
}
}
}
}, _handleKeyEvents:function (evt) {
if (evt.ctrlKey || evt.altKey || !evt.key) {
return;
}
this._prev_key_backspace = false;
this._prev_key_esc = false;
var k = dojo.event.browser.keys;
var doSearch = true;
switch (evt.key) {
case k.KEY_DOWN_ARROW:
if (!this.popupWidget.isShowingNow) {
this._startSearchFromInput();
}
this._highlightNextOption();
dojo.event.browser.stopEvent(evt);
return;
case k.KEY_UP_ARROW:
this._highlightPrevOption();
dojo.event.browser.stopEvent(evt);
return;
case k.KEY_TAB:
if (!this.autoComplete && this.popupWidget.isShowingNow && this._highlighted_option) {
dojo.event.browser.stopEvent(evt);
this._selectOption({"target":this._highlighted_option, "noHide":false});
this._setSelectedRange(this.textInputNode, this.textInputNode.value.length, null);
} else {
this._selectOption();
return;
}
break;
case k.KEY_ENTER:
if (this.popupWidget.isShowingNow) {
dojo.event.browser.stopEvent(evt);
}
if (this.autoComplete) {
this._selectOption();
return;
}
case " ":
if (this.popupWidget.isShowingNow && this._highlighted_option) {
dojo.event.browser.stopEvent(evt);
this._selectOption();
this._hideResultList();
return;
}
break;
case k.KEY_ESCAPE:
this._hideResultList();
this._prev_key_esc = true;
return;
case k.KEY_BACKSPACE:
this._prev_key_backspace = true;
if (!this.textInputNode.value.length) {
this.setAllValues("", "");
this._hideResultList();
doSearch = false;
}
break;
case k.KEY_RIGHT_ARROW:
case k.KEY_LEFT_ARROW:
doSearch = false;
break;
default:
if (evt.charCode == 0) {
doSearch = false;
}
}
if (this.searchTimer) {
clearTimeout(this.searchTimer);
}
if (doSearch) {
this._blurOptionNode();
this.searchTimer = setTimeout(dojo.lang.hitch(this, this._startSearchFromInput), this.searchDelay);
}
}, compositionEnd:function (evt) {
evt.key = evt.keyCode;
this._handleKeyEvents(evt);
}, onKeyUp:function (evt) {
this.setValue(this.textInputNode.value);
}, setSelectedValue:function (value) {
this.comboBoxSelectionValue.value = value;
}, setAllValues:function (value1, value2) {
this.setSelectedValue(value2);
this.setValue(value1);
}, _focusOptionNode:function (node) {
if (this._highlighted_option != node) {
this._blurOptionNode();
this._highlighted_option = node;
dojo.html.addClass(this._highlighted_option, "dojoComboBoxItemHighlight");
}
}, _blurOptionNode:function () {
if (this._highlighted_option) {
dojo.html.removeClass(this._highlighted_option, "dojoComboBoxItemHighlight");
this._highlighted_option = null;
}
}, _highlightNextOption:function () {
if ((!this._highlighted_option) || !this._highlighted_option.parentNode) {
this._focusOptionNode(this.optionsListNode.firstChild);
} else {
if (this._highlighted_option.nextSibling) {
this._focusOptionNode(this._highlighted_option.nextSibling);
}
}
dojo.html.scrollIntoView(this._highlighted_option);
}, _highlightPrevOption:function () {
if (this._highlighted_option && this._highlighted_option.previousSibling) {
this._focusOptionNode(this._highlighted_option.previousSibling);
} else {
this._highlighted_option = null;
this._hideResultList();
return;
}
dojo.html.scrollIntoView(this._highlighted_option);
}, _itemMouseOver:function (evt) {
if (evt.target === this.optionsListNode) {
return;
}
this._focusOptionNode(evt.target);
dojo.html.addClass(this._highlighted_option, "dojoComboBoxItemHighlight");
}, _itemMouseOut:function (evt) {
if (evt.target === this.optionsListNode) {
return;
}
this._blurOptionNode();
}, onResize:function () {
var inputSize = dojo.html.getContentBox(this.textInputNode);
if (inputSize.height <= 0) {
dojo.lang.setTimeout(this, "onResize", 100);
return;
}
var buttonSize = {width:inputSize.height, height:inputSize.height};
dojo.html.setContentBox(this.downArrowNode, buttonSize);
}, fillInTemplate:function (args, frag) {
dojo.html.applyBrowserClass(this.domNode);
var source = this.getFragNodeRef(frag);
if (!this.name && source.name) {
this.name = source.name;
}
this.comboBoxValue.name = this.name;
this.comboBoxSelectionValue.name = this.name + "_selected";
dojo.html.copyStyle(this.domNode, source);
dojo.html.copyStyle(this.textInputNode, source);
dojo.html.copyStyle(this.downArrowNode, source);
with (this.downArrowNode.style) {
width = "0px";
height = "0px";
}
var dpClass;
if (this.dataProviderClass) {
if (typeof this.dataProviderClass == "string") {
dpClass = dojo.evalObjPath(this.dataProviderClass);
} else {
dpClass = this.dataProviderClass;
}
} else {
if (this.mode == "remote") {
dpClass = dojo.widget.incrementalComboBoxDataProvider;
} else {
dpClass = dojo.widget.basicComboBoxDataProvider;
}
}
this.dataProvider = new dpClass(this, this.getFragNodeRef(frag));
this.popupWidget = new dojo.widget.createWidget("PopupContainer", {toggle:this.dropdownToggle, toggleDuration:this.toggleDuration});
dojo.event.connect(this, "destroy", this.popupWidget, "destroy");
this.optionsListNode = this.popupWidget.domNode;
this.domNode.appendChild(this.optionsListNode);
dojo.html.addClass(this.optionsListNode, "dojoComboBoxOptions");
dojo.event.connect(this.optionsListNode, "onclick", this, "_selectOption");
dojo.event.connect(this.optionsListNode, "onmouseover", this, "_onMouseOver");
dojo.event.connect(this.optionsListNode, "onmouseout", this, "_onMouseOut");
dojo.event.connect(this.optionsListNode, "onmouseover", this, "_itemMouseOver");
dojo.event.connect(this.optionsListNode, "onmouseout", this, "_itemMouseOut");
}, _openResultList:function (results) {
if (this.disabled) {
return;
}
this._clearResultList();
if (!results.length) {
this._hideResultList();
}
if ((this.autoComplete) && (results.length) && (!this._prev_key_backspace) && (this.textInputNode.value.length > 0)) {
var cpos = this._getCaretPos(this.textInputNode);
if ((cpos + 1) > this.textInputNode.value.length) {
this.textInputNode.value += results[0][0].substr(cpos);
this._setSelectedRange(this.textInputNode, cpos, this.textInputNode.value.length);
}
}
var even = true;
while (results.length) {
var tr = results.shift();
if (tr) {
var td = document.createElement("div");
td.appendChild(document.createTextNode(tr[0]));
td.setAttribute("resultName", tr[0]);
td.setAttribute("resultValue", tr[1]);
td.className = "dojoComboBoxItem " + ((even) ? "dojoComboBoxItemEven" : "dojoComboBoxItemOdd");
even = (!even);
this.optionsListNode.appendChild(td);
}
}
this._showResultList();
}, _onFocusInput:function () {
this._hasFocus = true;
}, _onBlurInput:function () {
this._hasFocus = false;
this._handleBlurTimer(true, 500);
}, _handleBlurTimer:function (clear, millisec) {
if (this.blurTimer && (clear || millisec)) {
clearTimeout(this.blurTimer);
}
if (millisec) {
this.blurTimer = dojo.lang.setTimeout(this, "_checkBlurred", millisec);
}
}, _onMouseOver:function (evt) {
if (!this._mouseover_list) {
this._handleBlurTimer(true, 0);
this._mouseover_list = true;
}
}, _onMouseOut:function (evt) {
var relTarget = evt.relatedTarget;
try {
if (!relTarget || relTarget.parentNode != this.optionsListNode) {
this._mouseover_list = false;
this._handleBlurTimer(true, 100);
this._tryFocus();
}
}
catch (e) {
}
}, _isInputEqualToResult:function (result) {
var input = this.textInputNode.value;
if (!this.dataProvider.caseSensitive) {
input = input.toLowerCase();
result = result.toLowerCase();
}
return (input == result);
}, _isValidOption:function () {
var tgt = dojo.html.firstElement(this.optionsListNode);
var isValidOption = false;
while (!isValidOption && tgt) {
if (this._isInputEqualToResult(tgt.getAttribute("resultName"))) {
isValidOption = true;
} else {
tgt = dojo.html.nextElement(tgt);
}
}
return isValidOption;
}, _checkBlurred:function () {
if (!this._hasFocus && !this._mouseover_list) {
this._hideResultList();
if (!this.textInputNode.value.length) {
this.setAllValues("", "");
return;
}
var isValidOption = this._isValidOption();
if (this.forceValidOption && !isValidOption) {
this.setAllValues("", "");
return;
}
if (!isValidOption) {
this.setSelectedValue("");
}
}
}, _selectOption:function (evt) {
var tgt = null;
if (!evt) {
evt = {target:this._highlighted_option};
}
if (!dojo.html.isDescendantOf(evt.target, this.optionsListNode)) {
if (!this.textInputNode.value.length) {
return;
}
tgt = dojo.html.firstElement(this.optionsListNode);
if (!tgt || !this._isInputEqualToResult(tgt.getAttribute("resultName"))) {
return;
}
} else {
tgt = evt.target;
}
while ((tgt.nodeType != 1) || (!tgt.getAttribute("resultName"))) {
tgt = tgt.parentNode;
if (tgt === dojo.body()) {
return false;
}
}
this.selectedResult = [tgt.getAttribute("resultName"), tgt.getAttribute("resultValue")];
this.setAllValues(tgt.getAttribute("resultName"), tgt.getAttribute("resultValue"));
if (!evt.noHide) {
this._hideResultList();
this._setSelectedRange(this.textInputNode, 0, null);
}
this._tryFocus();
}, _clearResultList:function () {
if (this.optionsListNode.innerHTML) {
this.optionsListNode.innerHTML = "";
}
}, _hideResultList:function () {
this.popupWidget.close();
}, _showResultList:function () {
var childs = this.optionsListNode.childNodes;
if (childs.length) {
var visibleCount = Math.min(childs.length, this.maxListLength);
with (this.optionsListNode.style) {
display = "";
if (visibleCount == childs.length) {
height = "";
} else {
height = visibleCount * dojo.html.getMarginBox(childs[0]).height + "px";
}
width = (dojo.html.getMarginBox(this.domNode).width - 2) + "px";
}
this.popupWidget.open(this.domNode, this, this.downArrowNode);
} else {
this._hideResultList();
}
}, handleArrowClick:function () {
this._handleBlurTimer(true, 0);
this._tryFocus();
if (this.popupWidget.isShowingNow) {
this._hideResultList();
} else {
this._startSearch("");
}
}, _tryFocus:function () {
try {
this.textInputNode.focus();
}
catch (e) {
}
}, _startSearchFromInput:function () {
this._startSearch(this.textInputNode.value);
}, _startSearch:function (key) {
this.dataProvider.startSearch(key, dojo.lang.hitch(this, "_openResultList"));
}, postCreate:function () {
this.onResize();
dojo.event.connect(this.textInputNode, "onblur", this, "_onBlurInput");
dojo.event.connect(this.textInputNode, "onfocus", this, "_onFocusInput");
if (this.disabled) {
this.disable();
}
var s = dojo.widget.html.stabile.getState(this.widgetId);
if (s) {
this.setState(s);
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/CurrencyTextbox.js
New file
0,0 → 1,38
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.CurrencyTextbox");
dojo.require("dojo.widget.IntegerTextbox");
dojo.require("dojo.validate.common");
dojo.widget.defineWidget("dojo.widget.CurrencyTextbox", dojo.widget.IntegerTextbox, {mixInProperties:function (localProperties, frag) {
dojo.widget.CurrencyTextbox.superclass.mixInProperties.apply(this, arguments);
if (localProperties.fractional) {
this.flags.fractional = (localProperties.fractional == "true");
} else {
if (localProperties.cents) {
dojo.deprecated("dojo.widget.IntegerTextbox", "use fractional attr instead of cents", "0.5");
this.flags.fractional = (localProperties.cents == "true");
}
}
if (localProperties.symbol) {
this.flags.symbol = localProperties.symbol;
}
if (localProperties.min) {
this.flags.min = parseFloat(localProperties.min);
}
if (localProperties.max) {
this.flags.max = parseFloat(localProperties.max);
}
}, isValid:function () {
return dojo.validate.isCurrency(this.textbox.value, this.flags);
}, isInRange:function () {
return dojo.validate.isInRange(this.textbox.value, this.flags);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/TreeRPCController.js
New file
0,0 → 1,70
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeRPCController");
dojo.require("dojo.event.*");
dojo.require("dojo.json");
dojo.require("dojo.io.*");
dojo.require("dojo.widget.TreeLoadingController");
dojo.widget.defineWidget("dojo.widget.TreeRPCController", dojo.widget.TreeLoadingController, {doMove:function (child, newParent, index) {
var params = {child:this.getInfo(child), childTree:this.getInfo(child.tree), newParent:this.getInfo(newParent), newParentTree:this.getInfo(newParent.tree), newIndex:index};
var success;
this.runRPC({url:this.getRPCUrl("move"), load:function (response) {
success = this.doMoveProcessResponse(response, child, newParent, index);
}, sync:true, lock:[child, newParent], params:params});
return success;
}, doMoveProcessResponse:function (response, child, newParent, index) {
if (!dojo.lang.isUndefined(response.error)) {
this.RPCErrorHandler("server", response.error);
return false;
}
var args = [child, newParent, index];
return dojo.widget.TreeLoadingController.prototype.doMove.apply(this, args);
}, doRemoveNode:function (node, callObj, callFunc) {
var params = {node:this.getInfo(node), tree:this.getInfo(node.tree)};
this.runRPC({url:this.getRPCUrl("removeNode"), load:function (response) {
this.doRemoveNodeProcessResponse(response, node, callObj, callFunc);
}, params:params, lock:[node]});
}, doRemoveNodeProcessResponse:function (response, node, callObj, callFunc) {
if (!dojo.lang.isUndefined(response.error)) {
this.RPCErrorHandler("server", response.error);
return false;
}
if (!response) {
return false;
}
if (response == true) {
var args = [node, callObj, callFunc];
dojo.widget.TreeLoadingController.prototype.doRemoveNode.apply(this, args);
return;
} else {
if (dojo.lang.isObject(response)) {
dojo.raise(response.error);
} else {
dojo.raise("Invalid response " + response);
}
}
}, doCreateChild:function (parent, index, output, callObj, callFunc) {
var params = {tree:this.getInfo(parent.tree), parent:this.getInfo(parent), index:index, data:output};
this.runRPC({url:this.getRPCUrl("createChild"), load:function (response) {
this.doCreateChildProcessResponse(response, parent, index, callObj, callFunc);
}, params:params, lock:[parent]});
}, doCreateChildProcessResponse:function (response, parent, index, callObj, callFunc) {
if (!dojo.lang.isUndefined(response.error)) {
this.RPCErrorHandler("server", response.error);
return false;
}
if (!dojo.lang.isObject(response)) {
dojo.raise("Invalid result " + response);
}
var args = [parent, index, response, callObj, callFunc];
dojo.widget.TreeLoadingController.prototype.doCreateChild.apply(this, args);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Parse.js
New file
0,0 → 1,225
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Parse");
dojo.require("dojo.widget.Manager");
dojo.require("dojo.dom");
dojo.widget.Parse = function (fragment) {
this.propertySetsList = [];
this.fragment = fragment;
this.createComponents = function (frag, parentComp) {
var comps = [];
var built = false;
try {
if (frag && frag.tagName && (frag != frag.nodeRef)) {
var djTags = dojo.widget.tags;
var tna = String(frag.tagName).split(";");
for (var x = 0; x < tna.length; x++) {
var ltn = tna[x].replace(/^\s+|\s+$/g, "").toLowerCase();
frag.tagName = ltn;
var ret;
if (djTags[ltn]) {
built = true;
ret = djTags[ltn](frag, this, parentComp, frag.index);
comps.push(ret);
} else {
if (ltn.indexOf(":") == -1) {
ltn = "dojo:" + ltn;
}
ret = dojo.widget.buildWidgetFromParseTree(ltn, frag, this, parentComp, frag.index);
if (ret) {
built = true;
comps.push(ret);
}
}
}
}
}
catch (e) {
dojo.debug("dojo.widget.Parse: error:", e);
}
if (!built) {
comps = comps.concat(this.createSubComponents(frag, parentComp));
}
return comps;
};
this.createSubComponents = function (fragment, parentComp) {
var frag, comps = [];
for (var item in fragment) {
frag = fragment[item];
if (frag && typeof frag == "object" && (frag != fragment.nodeRef) && (frag != fragment.tagName) && (!dojo.dom.isNode(frag))) {
comps = comps.concat(this.createComponents(frag, parentComp));
}
}
return comps;
};
this.parsePropertySets = function (fragment) {
return [];
};
this.parseProperties = function (fragment) {
var properties = {};
for (var item in fragment) {
if ((fragment[item] == fragment.tagName) || (fragment[item] == fragment.nodeRef)) {
} else {
var frag = fragment[item];
if (frag.tagName && dojo.widget.tags[frag.tagName.toLowerCase()]) {
} else {
if (frag[0] && frag[0].value != "" && frag[0].value != null) {
try {
if (item.toLowerCase() == "dataprovider") {
var _this = this;
this.getDataProvider(_this, frag[0].value);
properties.dataProvider = this.dataProvider;
}
properties[item] = frag[0].value;
var nestedProperties = this.parseProperties(frag);
for (var property in nestedProperties) {
properties[property] = nestedProperties[property];
}
}
catch (e) {
dojo.debug(e);
}
}
}
switch (item.toLowerCase()) {
case "checked":
case "disabled":
if (typeof properties[item] != "boolean") {
properties[item] = true;
}
break;
}
}
}
return properties;
};
this.getDataProvider = function (objRef, dataUrl) {
dojo.io.bind({url:dataUrl, load:function (type, evaldObj) {
if (type == "load") {
objRef.dataProvider = evaldObj;
}
}, mimetype:"text/javascript", sync:true});
};
this.getPropertySetById = function (propertySetId) {
for (var x = 0; x < this.propertySetsList.length; x++) {
if (propertySetId == this.propertySetsList[x]["id"][0].value) {
return this.propertySetsList[x];
}
}
return "";
};
this.getPropertySetsByType = function (componentType) {
var propertySets = [];
for (var x = 0; x < this.propertySetsList.length; x++) {
var cpl = this.propertySetsList[x];
var cpcc = cpl.componentClass || cpl.componentType || null;
var propertySetId = this.propertySetsList[x]["id"][0].value;
if (cpcc && (propertySetId == cpcc[0].value)) {
propertySets.push(cpl);
}
}
return propertySets;
};
this.getPropertySets = function (fragment) {
var ppl = "dojo:propertyproviderlist";
var propertySets = [];
var tagname = fragment.tagName;
if (fragment[ppl]) {
var propertyProviderIds = fragment[ppl].value.split(" ");
for (var propertySetId in propertyProviderIds) {
if ((propertySetId.indexOf("..") == -1) && (propertySetId.indexOf("://") == -1)) {
var propertySet = this.getPropertySetById(propertySetId);
if (propertySet != "") {
propertySets.push(propertySet);
}
} else {
}
}
}
return this.getPropertySetsByType(tagname).concat(propertySets);
};
this.createComponentFromScript = function (nodeRef, componentName, properties, ns) {
properties.fastMixIn = true;
var ltn = (ns || "dojo") + ":" + componentName.toLowerCase();
if (dojo.widget.tags[ltn]) {
return [dojo.widget.tags[ltn](properties, this, null, null, properties)];
}
return [dojo.widget.buildWidgetFromParseTree(ltn, properties, this, null, null, properties)];
};
};
dojo.widget._parser_collection = {"dojo":new dojo.widget.Parse()};
dojo.widget.getParser = function (name) {
if (!name) {
name = "dojo";
}
if (!this._parser_collection[name]) {
this._parser_collection[name] = new dojo.widget.Parse();
}
return this._parser_collection[name];
};
dojo.widget.createWidget = function (name, props, refNode, position) {
var isNode = false;
var isNameStr = (typeof name == "string");
if (isNameStr) {
var pos = name.indexOf(":");
var ns = (pos > -1) ? name.substring(0, pos) : "dojo";
if (pos > -1) {
name = name.substring(pos + 1);
}
var lowerCaseName = name.toLowerCase();
var namespacedName = ns + ":" + lowerCaseName;
isNode = (dojo.byId(name) && !dojo.widget.tags[namespacedName]);
}
if ((arguments.length == 1) && (isNode || !isNameStr)) {
var xp = new dojo.xml.Parse();
var tn = isNode ? dojo.byId(name) : name;
return dojo.widget.getParser().createComponents(xp.parseElement(tn, null, true))[0];
}
function fromScript(placeKeeperNode, name, props, ns) {
props[namespacedName] = {dojotype:[{value:lowerCaseName}], nodeRef:placeKeeperNode, fastMixIn:true};
props.ns = ns;
return dojo.widget.getParser().createComponentFromScript(placeKeeperNode, name, props, ns);
}
props = props || {};
var notRef = false;
var tn = null;
var h = dojo.render.html.capable;
if (h) {
tn = document.createElement("span");
}
if (!refNode) {
notRef = true;
refNode = tn;
if (h) {
dojo.body().appendChild(refNode);
}
} else {
if (position) {
dojo.dom.insertAtPosition(tn, refNode, position);
} else {
tn = refNode;
}
}
var widgetArray = fromScript(tn, name.toLowerCase(), props, ns);
if ((!widgetArray) || (!widgetArray[0]) || (typeof widgetArray[0].widgetType == "undefined")) {
throw new Error("createWidget: Creation of \"" + name + "\" widget failed.");
}
try {
if (notRef && widgetArray[0].domNode.parentNode) {
widgetArray[0].domNode.parentNode.removeChild(widgetArray[0].domNode);
}
}
catch (e) {
dojo.debug(e);
}
return widgetArray[0];
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/IntegerTextbox.js
New file
0,0 → 1,40
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.IntegerTextbox");
dojo.require("dojo.widget.ValidationTextbox");
dojo.require("dojo.validate.common");
dojo.widget.defineWidget("dojo.widget.IntegerTextbox", dojo.widget.ValidationTextbox, {mixInProperties:function (localProperties, frag) {
dojo.widget.IntegerTextbox.superclass.mixInProperties.apply(this, arguments);
if ((localProperties.signed == "true") || (localProperties.signed == "always")) {
this.flags.signed = true;
} else {
if ((localProperties.signed == "false") || (localProperties.signed == "never")) {
this.flags.signed = false;
this.flags.min = 0;
} else {
this.flags.signed = [true, false];
}
}
if (localProperties.separator) {
this.flags.separator = localProperties.separator;
}
if (localProperties.min) {
this.flags.min = parseInt(localProperties.min);
}
if (localProperties.max) {
this.flags.max = parseInt(localProperties.max);
}
}, isValid:function () {
return dojo.validate.isInteger(this.textbox.value, this.flags);
}, isInRange:function () {
return dojo.validate.isInRange(this.textbox.value, this.flags);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/YahooMap.js
New file
0,0 → 1,143
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.YahooMap");
dojo.require("dojo.event.*");
dojo.require("dojo.math");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
(function () {
var yappid = djConfig["yAppId"] || djConfig["yahooAppId"] || "dojotoolkit";
if (!dojo.hostenv.post_load_) {
if (yappid == "dojotoolkit") {
dojo.debug("please provide a unique Yahoo App ID in djConfig.yahooAppId when using the map widget");
}
var tag = "<scr" + "ipt src='http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=" + yappid + "'></scri" + "pt>";
if (!dj_global["YMap"]) {
document.write(tag);
}
} else {
dojo.debug("cannot initialize map system after the page has been loaded! Please either manually include the script block provided by Yahoo in your page or require() the YahooMap widget before onload has fired");
}
})();
dojo.widget.defineWidget("dojo.widget.YahooMap", dojo.widget.HtmlWidget, function () {
this.map = null;
this.datasrc = "";
this.data = [];
this.width = 0;
this.height = 0;
this.controls = ["zoomlong", "maptype", "pan"];
}, {isContainer:false, templatePath:null, templateCssPath:null, findCenter:function (aPts) {
var start = new YGeoPoint(37, -90);
if (aPts.length == 0) {
return start;
}
var minLat, maxLat, minLon, maxLon, cLat, cLon;
minLat = maxLat = aPts[0].Lat;
minLon = maxLon = aPts[0].Lon;
for (var i = 0; i < aPts.length; i++) {
minLat = Math.min(minLat, aPts[i].Lat);
maxLat = Math.max(maxLat, aPts[i].Lat);
minLon = Math.min(minLon, aPts[i].Lon);
maxLon = Math.max(maxLon, aPts[i].Lon);
}
cLat = dojo.math.round((minLat + maxLat) / 2, 6);
cLon = dojo.math.round((minLon + maxLon) / 2, 6);
return new YGeoPoint(cLat, cLon);
}, setControls:function () {
var methodmap = {maptype:"addTypeControl", pan:"addPanControl", zoomlong:"addZoomLong", zoomshort:"addZoomShort"};
var c = this.controls;
for (var i = 0; i < c.length; i++) {
var controlMethod = methodmap[c[i].toLowerCase()];
if (this.map[controlMethod]) {
this.map[controlMethod]();
}
}
}, parse:function (table) {
this.data = [];
var h = table.getElementsByTagName("thead")[0];
if (!h) {
return;
}
var a = [];
var cols = h.getElementsByTagName("td");
if (cols.length == 0) {
cols = h.getElementsByTagName("th");
}
for (var i = 0; i < cols.length; i++) {
var c = cols[i].innerHTML.toLowerCase();
if (c == "long") {
c = "lng";
}
a.push(c);
}
var b = table.getElementsByTagName("tbody")[0];
if (!b) {
return;
}
for (var i = 0; i < b.childNodes.length; i++) {
if (!(b.childNodes[i].nodeName && b.childNodes[i].nodeName.toLowerCase() == "tr")) {
continue;
}
var cells = b.childNodes[i].getElementsByTagName("td");
var o = {};
for (var j = 0; j < a.length; j++) {
var col = a[j];
if (col == "lat" || col == "lng") {
o[col] = parseFloat(cells[j].innerHTML);
} else {
o[col] = cells[j].innerHTML;
}
}
this.data.push(o);
}
}, render:function () {
var pts = [];
var d = this.data;
for (var i = 0; i < d.length; i++) {
var pt = new YGeoPoint(d[i].lat, d[i].lng);
pts.push(pt);
var icon = d[i].icon || null;
if (icon) {
icon = new YImage(icon);
}
var m = new YMarker(pt, icon);
if (d[i].description) {
m.addAutoExpand("<div>" + d[i].description + "</div>");
}
this.map.addOverlay(m);
}
var c = this.findCenter(pts);
var z = this.map.getZoomLevel(pts);
this.map.drawZoomAndCenter(c, z);
}, initialize:function (args, frag) {
if (!YMap || !YGeoPoint) {
dojo.raise("dojo.widget.YahooMap: The Yahoo Map script must be included in order to use this widget.");
}
if (this.datasrc) {
this.parse(dojo.byId(this.datasrc));
} else {
if (this.domNode.getElementsByTagName("table")[0]) {
this.parse(this.domNode.getElementsByTagName("table")[0]);
}
}
}, postCreate:function () {
while (this.domNode.childNodes.length > 0) {
this.domNode.removeChild(this.domNode.childNodes[0]);
}
if (this.width > 0 && this.height > 0) {
this.map = new YMap(this.domNode, YAHOO_MAP_REG, new YSize(this.width, this.height));
} else {
this.map = new YMap(this.domNode);
}
this.setControls();
this.render();
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/ContentPane.js
New file
0,0 → 1,439
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.ContentPane");
dojo.require("dojo.widget.*");
dojo.require("dojo.io.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.string");
dojo.require("dojo.string.extras");
dojo.require("dojo.html.style");
dojo.widget.defineWidget("dojo.widget.ContentPane", dojo.widget.HtmlWidget, function () {
this._styleNodes = [];
this._onLoadStack = [];
this._onUnloadStack = [];
this._callOnUnload = false;
this._ioBindObj;
this.scriptScope;
this.bindArgs = {};
}, {isContainer:true, adjustPaths:true, href:"", extractContent:true, parseContent:true, cacheContent:true, preload:false, refreshOnShow:false, handler:"", executeScripts:false, scriptSeparation:true, loadingMessage:"Loading...", isLoaded:false, postCreate:function (args, frag, parentComp) {
if (this.handler !== "") {
this.setHandler(this.handler);
}
if (this.isShowing() || this.preload) {
this.loadContents();
}
}, show:function () {
if (this.refreshOnShow) {
this.refresh();
} else {
this.loadContents();
}
dojo.widget.ContentPane.superclass.show.call(this);
}, refresh:function () {
this.isLoaded = false;
this.loadContents();
}, loadContents:function () {
if (this.isLoaded) {
return;
}
if (dojo.lang.isFunction(this.handler)) {
this._runHandler();
} else {
if (this.href != "") {
this._downloadExternalContent(this.href, this.cacheContent && !this.refreshOnShow);
}
}
}, setUrl:function (url) {
this.href = url;
this.isLoaded = false;
if (this.preload || this.isShowing()) {
this.loadContents();
}
}, abort:function () {
var bind = this._ioBindObj;
if (!bind || !bind.abort) {
return;
}
bind.abort();
delete this._ioBindObj;
}, _downloadExternalContent:function (url, useCache) {
this.abort();
this._handleDefaults(this.loadingMessage, "onDownloadStart");
var self = this;
this._ioBindObj = dojo.io.bind(this._cacheSetting({url:url, mimetype:"text/html", handler:function (type, data, xhr) {
delete self._ioBindObj;
if (type == "load") {
self.onDownloadEnd.call(self, url, data);
} else {
var e = {responseText:xhr.responseText, status:xhr.status, statusText:xhr.statusText, responseHeaders:xhr.getAllResponseHeaders(), text:"Error loading '" + url + "' (" + xhr.status + " " + xhr.statusText + ")"};
self._handleDefaults.call(self, e, "onDownloadError");
self.onLoad();
}
}}, useCache));
}, _cacheSetting:function (bindObj, useCache) {
for (var x in this.bindArgs) {
if (dojo.lang.isUndefined(bindObj[x])) {
bindObj[x] = this.bindArgs[x];
}
}
if (dojo.lang.isUndefined(bindObj.useCache)) {
bindObj.useCache = useCache;
}
if (dojo.lang.isUndefined(bindObj.preventCache)) {
bindObj.preventCache = !useCache;
}
if (dojo.lang.isUndefined(bindObj.mimetype)) {
bindObj.mimetype = "text/html";
}
return bindObj;
}, onLoad:function (e) {
this._runStack("_onLoadStack");
this.isLoaded = true;
}, onUnLoad:function (e) {
dojo.deprecated(this.widgetType + ".onUnLoad, use .onUnload (lowercased load)", 0.5);
}, onUnload:function (e) {
this._runStack("_onUnloadStack");
delete this.scriptScope;
if (this.onUnLoad !== dojo.widget.ContentPane.prototype.onUnLoad) {
this.onUnLoad.apply(this, arguments);
}
}, _runStack:function (stName) {
var st = this[stName];
var err = "";
var scope = this.scriptScope || window;
for (var i = 0; i < st.length; i++) {
try {
st[i].call(scope);
}
catch (e) {
err += "\n" + st[i] + " failed: " + e.description;
}
}
this[stName] = [];
if (err.length) {
var name = (stName == "_onLoadStack") ? "addOnLoad" : "addOnUnLoad";
this._handleDefaults(name + " failure\n " + err, "onExecError", "debug");
}
}, addOnLoad:function (obj, func) {
this._pushOnStack(this._onLoadStack, obj, func);
}, addOnUnload:function (obj, func) {
this._pushOnStack(this._onUnloadStack, obj, func);
}, addOnUnLoad:function () {
dojo.deprecated(this.widgetType + ".addOnUnLoad, use addOnUnload instead. (lowercased Load)", 0.5);
this.addOnUnload.apply(this, arguments);
}, _pushOnStack:function (stack, obj, func) {
if (typeof func == "undefined") {
stack.push(obj);
} else {
stack.push(function () {
obj[func]();
});
}
}, destroy:function () {
this.onUnload();
dojo.widget.ContentPane.superclass.destroy.call(this);
}, onExecError:function (e) {
}, onContentError:function (e) {
}, onDownloadError:function (e) {
}, onDownloadStart:function (e) {
}, onDownloadEnd:function (url, data) {
data = this.splitAndFixPaths(data, url);
this.setContent(data);
}, _handleDefaults:function (e, handler, messType) {
if (!handler) {
handler = "onContentError";
}
if (dojo.lang.isString(e)) {
e = {text:e};
}
if (!e.text) {
e.text = e.toString();
}
e.toString = function () {
return this.text;
};
if (typeof e.returnValue != "boolean") {
e.returnValue = true;
}
if (typeof e.preventDefault != "function") {
e.preventDefault = function () {
this.returnValue = false;
};
}
this[handler](e);
if (e.returnValue) {
switch (messType) {
case true:
case "alert":
alert(e.toString());
break;
case "debug":
dojo.debug(e.toString());
break;
default:
if (this._callOnUnload) {
this.onUnload();
}
this._callOnUnload = false;
if (arguments.callee._loopStop) {
dojo.debug(e.toString());
} else {
arguments.callee._loopStop = true;
this._setContent(e.toString());
}
}
}
arguments.callee._loopStop = false;
}, splitAndFixPaths:function (s, url) {
var titles = [], scripts = [], tmp = [];
var match = [], requires = [], attr = [], styles = [];
var str = "", path = "", fix = "", tagFix = "", tag = "", origPath = "";
if (!url) {
url = "./";
}
if (s) {
var regex = /<title[^>]*>([\s\S]*?)<\/title>/i;
while (match = regex.exec(s)) {
titles.push(match[1]);
s = s.substring(0, match.index) + s.substr(match.index + match[0].length);
}
if (this.adjustPaths) {
var regexFindTag = /<[a-z][a-z0-9]*[^>]*\s(?:(?:src|href|style)=[^>])+[^>]*>/i;
var regexFindAttr = /\s(src|href|style)=(['"]?)([\w()\[\]\/.,\\'"-:;#=&?\s@]+?)\2/i;
var regexProtocols = /^(?:[#]|(?:(?:https?|ftps?|file|javascript|mailto|news):))/;
while (tag = regexFindTag.exec(s)) {
str += s.substring(0, tag.index);
s = s.substring((tag.index + tag[0].length), s.length);
tag = tag[0];
tagFix = "";
while (attr = regexFindAttr.exec(tag)) {
path = "";
origPath = attr[3];
switch (attr[1].toLowerCase()) {
case "src":
case "href":
if (regexProtocols.exec(origPath)) {
path = origPath;
} else {
path = (new dojo.uri.Uri(url, origPath).toString());
}
break;
case "style":
path = dojo.html.fixPathsInCssText(origPath, url);
break;
default:
path = origPath;
}
fix = " " + attr[1] + "=" + attr[2] + path + attr[2];
tagFix += tag.substring(0, attr.index) + fix;
tag = tag.substring((attr.index + attr[0].length), tag.length);
}
str += tagFix + tag;
}
s = str + s;
}
regex = /(?:<(style)[^>]*>([\s\S]*?)<\/style>|<link ([^>]*rel=['"]?stylesheet['"]?[^>]*)>)/i;
while (match = regex.exec(s)) {
if (match[1] && match[1].toLowerCase() == "style") {
styles.push(dojo.html.fixPathsInCssText(match[2], url));
} else {
if (attr = match[3].match(/href=(['"]?)([^'">]*)\1/i)) {
styles.push({path:attr[2]});
}
}
s = s.substring(0, match.index) + s.substr(match.index + match[0].length);
}
var regex = /<script([^>]*)>([\s\S]*?)<\/script>/i;
var regexSrc = /src=(['"]?)([^"']*)\1/i;
var regexDojoJs = /.*(\bdojo\b\.js(?:\.uncompressed\.js)?)$/;
var regexInvalid = /(?:var )?\bdjConfig\b(?:[\s]*=[\s]*\{[^}]+\}|\.[\w]*[\s]*=[\s]*[^;\n]*)?;?|dojo\.hostenv\.writeIncludes\(\s*\);?/g;
var regexRequires = /dojo\.(?:(?:require(?:After)?(?:If)?)|(?:widget\.(?:manager\.)?registerWidgetPackage)|(?:(?:hostenv\.)?setModulePrefix|registerModulePath)|defineNamespace)\((['"]).*?\1\)\s*;?/;
while (match = regex.exec(s)) {
if (this.executeScripts && match[1]) {
if (attr = regexSrc.exec(match[1])) {
if (regexDojoJs.exec(attr[2])) {
dojo.debug("Security note! inhibit:" + attr[2] + " from being loaded again.");
} else {
scripts.push({path:attr[2]});
}
}
}
if (match[2]) {
var sc = match[2].replace(regexInvalid, "");
if (!sc) {
continue;
}
while (tmp = regexRequires.exec(sc)) {
requires.push(tmp[0]);
sc = sc.substring(0, tmp.index) + sc.substr(tmp.index + tmp[0].length);
}
if (this.executeScripts) {
scripts.push(sc);
}
}
s = s.substr(0, match.index) + s.substr(match.index + match[0].length);
}
if (this.extractContent) {
match = s.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);
if (match) {
s = match[1];
}
}
if (this.executeScripts && this.scriptSeparation) {
var regex = /(<[a-zA-Z][a-zA-Z0-9]*\s[^>]*?\S=)((['"])[^>]*scriptScope[^>]*>)/;
var regexAttr = /([\s'";:\(])scriptScope(.*)/;
str = "";
while (tag = regex.exec(s)) {
tmp = ((tag[3] == "'") ? "\"" : "'");
fix = "";
str += s.substring(0, tag.index) + tag[1];
while (attr = regexAttr.exec(tag[2])) {
tag[2] = tag[2].substring(0, attr.index) + attr[1] + "dojo.widget.byId(" + tmp + this.widgetId + tmp + ").scriptScope" + attr[2];
}
str += tag[2];
s = s.substr(tag.index + tag[0].length);
}
s = str + s;
}
}
return {"xml":s, "styles":styles, "titles":titles, "requires":requires, "scripts":scripts, "url":url};
}, _setContent:function (cont) {
this.destroyChildren();
for (var i = 0; i < this._styleNodes.length; i++) {
if (this._styleNodes[i] && this._styleNodes[i].parentNode) {
this._styleNodes[i].parentNode.removeChild(this._styleNodes[i]);
}
}
this._styleNodes = [];
try {
var node = this.containerNode || this.domNode;
while (node.firstChild) {
dojo.html.destroyNode(node.firstChild);
}
if (typeof cont != "string") {
node.appendChild(cont);
} else {
node.innerHTML = cont;
}
}
catch (e) {
e.text = "Couldn't load content:" + e.description;
this._handleDefaults(e, "onContentError");
}
}, setContent:function (data) {
this.abort();
if (this._callOnUnload) {
this.onUnload();
}
this._callOnUnload = true;
if (!data || dojo.html.isNode(data)) {
this._setContent(data);
this.onResized();
this.onLoad();
} else {
if (typeof data.xml != "string") {
this.href = "";
data = this.splitAndFixPaths(data);
}
this._setContent(data.xml);
for (var i = 0; i < data.styles.length; i++) {
if (data.styles[i].path) {
this._styleNodes.push(dojo.html.insertCssFile(data.styles[i].path, dojo.doc(), false, true));
} else {
this._styleNodes.push(dojo.html.insertCssText(data.styles[i]));
}
}
if (this.parseContent) {
for (var i = 0; i < data.requires.length; i++) {
try {
eval(data.requires[i]);
}
catch (e) {
e.text = "ContentPane: error in package loading calls, " + (e.description || e);
this._handleDefaults(e, "onContentError", "debug");
}
}
}
var _self = this;
function asyncParse() {
if (_self.executeScripts) {
_self._executeScripts(data.scripts);
}
if (_self.parseContent) {
var node = _self.containerNode || _self.domNode;
var parser = new dojo.xml.Parse();
var frag = parser.parseElement(node, null, true);
dojo.widget.getParser().createSubComponents(frag, _self);
}
_self.onResized();
_self.onLoad();
}
if (dojo.hostenv.isXDomain && data.requires.length) {
dojo.addOnLoad(asyncParse);
} else {
asyncParse();
}
}
}, setHandler:function (handler) {
var fcn = dojo.lang.isFunction(handler) ? handler : window[handler];
if (!dojo.lang.isFunction(fcn)) {
this._handleDefaults("Unable to set handler, '" + handler + "' not a function.", "onExecError", true);
return;
}
this.handler = function () {
return fcn.apply(this, arguments);
};
}, _runHandler:function () {
var ret = true;
if (dojo.lang.isFunction(this.handler)) {
this.handler(this, this.domNode);
ret = false;
}
this.onLoad();
return ret;
}, _executeScripts:function (scripts) {
var self = this;
var tmp = "", code = "";
for (var i = 0; i < scripts.length; i++) {
if (scripts[i].path) {
dojo.io.bind(this._cacheSetting({"url":scripts[i].path, "load":function (type, scriptStr) {
dojo.lang.hitch(self, tmp = ";" + scriptStr);
}, "error":function (type, error) {
error.text = type + " downloading remote script";
self._handleDefaults.call(self, error, "onExecError", "debug");
}, "mimetype":"text/plain", "sync":true}, this.cacheContent));
code += tmp;
} else {
code += scripts[i];
}
}
try {
if (this.scriptSeparation) {
delete this.scriptScope;
this.scriptScope = new (new Function("_container_", code + "; return this;"))(self);
} else {
var djg = dojo.global();
if (djg.execScript) {
djg.execScript(code);
} else {
var djd = dojo.doc();
var sc = djd.createElement("script");
sc.appendChild(djd.createTextNode(code));
(this.containerNode || this.domNode).appendChild(sc);
}
}
}
catch (e) {
e.text = "Error running scripts from content:\n" + e.description;
this._handleDefaults(e, "onExecError", "debug");
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Spinner.js
New file
0,0 → 1,524
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Spinner");
dojo.require("dojo.io.*");
dojo.require("dojo.lfx.*");
dojo.require("dojo.html.*");
dojo.require("dojo.html.layout");
dojo.require("dojo.string");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.IntegerTextbox");
dojo.require("dojo.widget.RealNumberTextbox");
dojo.require("dojo.widget.DateTextbox");
dojo.require("dojo.experimental");
dojo.declare("dojo.widget.Spinner", null, {_typamaticTimer:null, _typamaticFunction:null, _currentTimeout:this.defaultTimeout, _eventCount:0, defaultTimeout:500, timeoutChangeRate:0.9, templateString:"<span _=\"weird end tag formatting is to prevent whitespace from becoming &nbsp;\"\n\tstyle='float:${this.htmlfloat};'\n\t><table cellpadding=0 cellspacing=0 class=\"dojoSpinner\">\n\t\t<tr>\n\t\t\t<td\n\t\t\t\t><input\n\t\t\t\t\tdojoAttachPoint='textbox' type='${this.type}'\n\t\t\t\t\tdojoAttachEvent='onblur;onfocus;onkey:_handleKeyEvents;onKeyUp:_onSpinnerKeyUp;onresize:_resize'\n\t\t\t\t\tid='${this.widgetId}' name='${this.name}' size='${this.size}' maxlength='${this.maxlength}'\n\t\t\t\t\tvalue='${this.value}' class='${this.className}' autocomplete=\"off\"\n\t\t\t></td>\n\t\t\t<td\n\t\t\t\t><img dojoAttachPoint=\"upArrowNode\"\n\t\t\t\t\tdojoAttachEvent=\"onDblClick: _upArrowDoubleClicked; onMouseDown: _upArrowPressed; onMouseUp: _arrowReleased; onMouseOut: _arrowReleased; onMouseMove: _discardEvent;\"\n\t\t\t\t\tsrc=\"${this.incrementSrc}\" style=\"width: ${this.buttonSize.width}px; height: ${this.buttonSize.height}px;\"\n\t\t\t\t><img dojoAttachPoint=\"downArrowNode\"\n\t\t\t\t\tdojoAttachEvent=\"onDblClick: _downArrowDoubleClicked; onMouseDown: _downArrowPressed; onMouseUp: _arrowReleased; onMouseOut: _arrowReleased; onMouseMove: _discardEvent;\"\n\t\t\t\t\tsrc=\"${this.decrementSrc}\" style=\"width: ${this.buttonSize.width}px; height: ${this.buttonSize.height}px;\"\n\t\t\t></td>\n\t\t</tr>\n\t</table\n\t><span dojoAttachPoint='invalidSpan' class='${this.invalidClass}'>${this.messages.invalidMessage}</span\n\t><span dojoAttachPoint='missingSpan' class='${this.missingClass}'>${this.messages.missingMessage}</span\n\t><span dojoAttachPoint='rangeSpan' class='${this.rangeClass}'>${this.messages.rangeMessage}</span\n></span>\n", templateCssString:"/* inline the table holding the <input> and buttons (method varies by browser) */\n.ie .dojoSpinner, .safari .dojoSpinner {\n\tdisplay: inline;\n}\n\n.moz .dojoSpinner {\n\tdisplay: -moz-inline-box;\n}\n\n.opera .dojoSpinner {\n\tdisplay: inline-table;\n}\n\n/* generic stuff for the table */\n.dojoSpinner td {\n\tpadding:0px;\n\tmargin:0px;\n\tvertical-align: middle;\n}\ntable.dojoSpinner {\n\tborder:0px;\n\tborder-spacing:0px;\n\tline-height:0px;\n\tpadding:0px;\n\tmargin: 0px;\n\tvertical-align: middle;\n}\n\n/* the buttons */\n.dojoSpinner img {\n\tdisplay: block;\n\tborder-width:0px 1px 1px 0px;\n\tborder-style:outset;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/Spinner.css"), incrementSrc:dojo.uri.moduleUri("dojo.widget", "templates/images/spinnerIncrement.gif"), decrementSrc:dojo.uri.moduleUri("dojo.widget", "templates/images/spinnerDecrement.gif"), _handleKeyEvents:function (evt) {
if (!evt.key) {
return;
}
if (!evt.ctrlKey && !evt.altKey) {
switch (evt.key) {
case evt.KEY_DOWN_ARROW:
dojo.event.browser.stopEvent(evt);
this._downArrowPressed(evt);
return;
case evt.KEY_UP_ARROW:
dojo.event.browser.stopEvent(evt);
this._upArrowPressed(evt);
return;
}
}
this._eventCount++;
}, _onSpinnerKeyUp:function (evt) {
this._arrowReleased(evt);
this.onkeyup(evt);
}, _resize:function () {
var inputSize = dojo.html.getBorderBox(this.textbox);
this.buttonSize = {width:inputSize.height / 2, height:inputSize.height / 2};
if (this.upArrowNode) {
dojo.html.setMarginBox(this.upArrowNode, this.buttonSize);
dojo.html.setMarginBox(this.downArrowNode, this.buttonSize);
}
}, _pressButton:function (node) {
node.style.borderWidth = "1px 0px 0px 1px";
node.style.borderStyle = "inset";
}, _releaseButton:function (node) {
node.style.borderWidth = "0px 1px 1px 0px";
node.style.borderStyle = "outset";
}, _arrowPressed:function (evt, direction) {
var nodePressed = (direction == -1) ? this.downArrowNode : this.upArrowNode;
var nodeReleased = (direction == +1) ? this.downArrowNode : this.upArrowNode;
if (typeof evt != "number") {
if (this._typamaticTimer != null) {
if (this._typamaticNode == nodePressed) {
return;
}
dojo.lang.clearTimeout(this._typamaticTimer);
}
this._releaseButton(nodeReleased);
this._eventCount++;
this._typamaticTimer = null;
this._currentTimeout = this.defaultTimeout;
} else {
if (evt != this._eventCount) {
this._releaseButton(nodePressed);
return;
}
}
this._pressButton(nodePressed);
this._setCursorX(this.adjustValue(direction, this._getCursorX()));
this._typamaticNode = nodePressed;
this._typamaticTimer = dojo.lang.setTimeout(this, "_arrowPressed", this._currentTimeout, this._eventCount, direction);
this._currentTimeout = Math.round(this._currentTimeout * this.timeoutChangeRate);
}, _downArrowPressed:function (evt) {
return this._arrowPressed(evt, -1);
}, _downArrowDoubleClicked:function (evt) {
var rc = this._downArrowPressed(evt);
dojo.lang.setTimeout(this, "_arrowReleased", 50, null);
return rc;
}, _upArrowPressed:function (evt) {
return this._arrowPressed(evt, +1);
}, _upArrowDoubleClicked:function (evt) {
var rc = this._upArrowPressed(evt);
dojo.lang.setTimeout(this, "_arrowReleased", 50, null);
return rc;
}, _arrowReleased:function (evt) {
this.textbox.focus();
if (evt != null && typeof evt == "object" && evt.keyCode && evt.keyCode != null) {
var keyCode = evt.keyCode;
var k = dojo.event.browser.keys;
switch (keyCode) {
case k.KEY_DOWN_ARROW:
case k.KEY_UP_ARROW:
dojo.event.browser.stopEvent(evt);
break;
}
}
this._releaseButton(this.upArrowNode);
this._releaseButton(this.downArrowNode);
this._eventCount++;
if (this._typamaticTimer != null) {
dojo.lang.clearTimeout(this._typamaticTimer);
}
this._typamaticTimer = null;
this._currentTimeout = this.defaultTimeout;
}, _mouseWheeled:function (evt) {
var scrollAmount = 0;
if (typeof evt.wheelDelta == "number") {
scrollAmount = evt.wheelDelta;
} else {
if (typeof evt.detail == "number") {
scrollAmount = -evt.detail;
}
}
if (scrollAmount > 0) {
this._upArrowPressed(evt);
this._arrowReleased(evt);
} else {
if (scrollAmount < 0) {
this._downArrowPressed(evt);
this._arrowReleased(evt);
}
}
}, _discardEvent:function (evt) {
dojo.event.browser.stopEvent(evt);
}, _getCursorX:function () {
var x = -1;
try {
this.textbox.focus();
if (typeof this.textbox.selectionEnd == "number") {
x = this.textbox.selectionEnd;
} else {
if (document.selection && document.selection.createRange) {
var range = document.selection.createRange().duplicate();
if (range.parentElement() == this.textbox) {
range.moveStart("textedit", -1);
x = range.text.length;
}
}
}
}
catch (e) {
}
return x;
}, _setCursorX:function (x) {
try {
this.textbox.focus();
if (!x) {
x = 0;
}
if (typeof this.textbox.selectionEnd == "number") {
this.textbox.selectionEnd = x;
} else {
if (this.textbox.createTextRange) {
var range = this.textbox.createTextRange();
range.collapse(true);
range.moveEnd("character", x);
range.moveStart("character", x);
range.select();
}
}
}
catch (e) {
}
}, _spinnerPostMixInProperties:function (args, frag) {
var inputNode = this.getFragNodeRef(frag);
var inputSize = dojo.html.getBorderBox(inputNode);
this.buttonSize = {width:inputSize.height / 2 - 1, height:inputSize.height / 2 - 1};
}, _spinnerPostCreate:function (args, frag) {
if (this.textbox.addEventListener) {
this.textbox.addEventListener("DOMMouseScroll", dojo.lang.hitch(this, "_mouseWheeled"), false);
} else {
dojo.event.connect(this.textbox, "onmousewheel", this, "_mouseWheeled");
}
}});
dojo.widget.defineWidget("dojo.widget.IntegerSpinner", [dojo.widget.IntegerTextbox, dojo.widget.Spinner], {delta:"1", postMixInProperties:function (args, frag) {
dojo.widget.IntegerSpinner.superclass.postMixInProperties.apply(this, arguments);
this._spinnerPostMixInProperties(args, frag);
}, postCreate:function (args, frag) {
dojo.widget.IntegerSpinner.superclass.postCreate.apply(this, arguments);
this._spinnerPostCreate(args, frag);
}, adjustValue:function (direction, x) {
var val = this.getValue().replace(/[^\-+\d]/g, "");
if (val.length == 0) {
return;
}
var num = Math.min(Math.max((parseInt(val) + (parseInt(this.delta) * direction)), (this.flags.min ? this.flags.min : -Infinity)), (this.flags.max ? this.flags.max : +Infinity));
val = num.toString();
if (num >= 0) {
val = ((this.flags.signed == true) ? "+" : " ") + val;
}
if (this.flags.separator.length > 0) {
for (var i = val.length - 3; i > 1; i -= 3) {
val = val.substr(0, i) + this.flags.separator + val.substr(i);
}
}
if (val.substr(0, 1) == " ") {
val = val.substr(1);
}
this.setValue(val);
return val.length;
}});
dojo.widget.defineWidget("dojo.widget.RealNumberSpinner", [dojo.widget.RealNumberTextbox, dojo.widget.Spinner], function () {
dojo.experimental("dojo.widget.RealNumberSpinner");
}, {delta:"1e1", postMixInProperties:function (args, frag) {
dojo.widget.RealNumberSpinner.superclass.postMixInProperties.apply(this, arguments);
this._spinnerPostMixInProperties(args, frag);
}, postCreate:function (args, frag) {
dojo.widget.RealNumberSpinner.superclass.postCreate.apply(this, arguments);
this._spinnerPostCreate(args, frag);
}, adjustValue:function (direction, x) {
var val = this.getValue().replace(/[^\-+\.eE\d]/g, "");
if (!val.length) {
return;
}
var num = parseFloat(val);
if (isNaN(num)) {
return;
}
var delta = this.delta.split(/[eE]/);
if (!delta.length) {
delta = [1, 1];
} else {
delta[0] = parseFloat(delta[0].replace(/[^\-+\.\d]/g, ""));
if (isNaN(delta[0])) {
delta[0] = 1;
}
if (delta.length > 1) {
delta[1] = parseInt(delta[1]);
}
if (isNaN(delta[1])) {
delta[1] = 1;
}
}
val = this.getValue().split(/[eE]/);
if (!val.length) {
return;
}
var numBase = parseFloat(val[0].replace(/[^\-+\.\d]/g, ""));
if (val.length == 1) {
var numExp = 0;
} else {
var numExp = parseInt(val[1].replace(/[^\-+\d]/g, ""));
}
if (x <= val[0].length) {
x = 0;
numBase += delta[0] * direction;
} else {
x = Number.MAX_VALUE;
numExp += delta[1] * direction;
if (this.flags.eSigned == false && numExp < 0) {
numExp = 0;
}
}
num = Math.min(Math.max((numBase * Math.pow(10, numExp)), (this.flags.min ? this.flags.min : -Infinity)), (this.flags.max ? this.flags.max : +Infinity));
if ((this.flags.exponent == true || (this.flags.exponent != false && x != 0)) && num.toExponential) {
if (isNaN(this.flags.places) || this.flags.places == Infinity) {
val = num.toExponential();
} else {
val = num.toExponential(this.flags.places);
}
} else {
if (num.toFixed && num.toPrecision) {
if (isNaN(this.flags.places) || this.flags.places == Infinity) {
val = num.toPrecision((1 / 3).toString().length - 1);
} else {
val = num.toFixed(this.flags.places);
}
} else {
val = num.toString();
}
}
if (num >= 0) {
if (this.flags.signed == true) {
val = "+" + val;
}
}
val = val.split(/[eE]/);
if (this.flags.separator.length > 0) {
if (num >= 0 && val[0].substr(0, 1) != "+") {
val[0] = " " + val[0];
}
var i = val[0].lastIndexOf(".");
if (i >= 0) {
i -= 3;
} else {
i = val[0].length - 3;
}
for (; i > 1; i -= 3) {
val[0] = val[0].substr(0, i) + this.flags.separator + val[0].substr(i);
}
if (val[0].substr(0, 1) == " ") {
val[0] = val[0].substr(1);
}
}
if (val.length > 1) {
if ((this.flags.eSigned == true) && (val[1].substr(0, 1) != "+")) {
val[1] = "+" + val[1];
} else {
if ((!this.flags.eSigned) && (val[1].substr(0, 1) == "+")) {
val[1] = val[1].substr(1);
} else {
if ((!this.flags.eSigned) && (val[1].substr(0, 1) == "-") && (num.toFixed && num.toPrecision)) {
if (isNaN(this.flags.places)) {
val[0] = num.toPrecision((1 / 3).toString().length - 1);
} else {
val[0] = num.toFixed(this.flags.places).toString();
}
val[1] = "0";
}
}
}
val[0] += "e" + val[1];
}
this.setValue(val[0]);
if (x > val[0].length) {
x = val[0].length;
}
return x;
}});
dojo.widget.defineWidget("dojo.widget.TimeSpinner", [dojo.widget.TimeTextbox, dojo.widget.Spinner], function () {
dojo.experimental("dojo.widget.TimeSpinner");
}, {postMixInProperties:function (args, frag) {
dojo.widget.TimeSpinner.superclass.postMixInProperties.apply(this, arguments);
this._spinnerPostMixInProperties(args, frag);
}, postCreate:function (args, frag) {
dojo.widget.TimeSpinner.superclass.postCreate.apply(this, arguments);
this._spinnerPostCreate(args, frag);
}, adjustValue:function (direction, x) {
var val = this.getValue();
var format = (this.flags.format && this.flags.format.search(/[Hhmst]/) >= 0) ? this.flags.format : "hh:mm:ss t";
if (direction == 0 || !val.length || !this.isValid()) {
return;
}
if (!this.flags.amSymbol) {
this.flags.amSymbol = "AM";
}
if (!this.flags.pmSymbol) {
this.flags.pmSymbol = "PM";
}
var re = dojo.regexp.time(this.flags);
var qualifiers = format.replace(/H/g, "h").replace(/[^hmst]/g, "").replace(/([hmst])\1/g, "$1");
var hourPos = qualifiers.indexOf("h") + 1;
var minPos = qualifiers.indexOf("m") + 1;
var secPos = qualifiers.indexOf("s") + 1;
var ampmPos = qualifiers.indexOf("t") + 1;
var cursorFormat = format;
var ampm = "";
if (ampmPos > 0) {
ampm = val.replace(new RegExp(re), "$" + ampmPos);
cursorFormat = cursorFormat.replace(/t+/, ampm.replace(/./g, "t"));
}
var hour = 0;
var deltaHour = 1;
if (hourPos > 0) {
hour = val.replace(new RegExp(re), "$" + hourPos);
if (dojo.lang.isString(this.delta)) {
deltaHour = this.delta.replace(new RegExp(re), "$" + hourPos);
}
if (isNaN(deltaHour)) {
deltaHour = 1;
} else {
deltaHour = parseInt(deltaHour);
}
if (hour.length == 2) {
cursorFormat = cursorFormat.replace(/([Hh])+/, "$1$1");
} else {
cursorFormat = cursorFormat.replace(/([Hh])+/, "$1");
}
if (isNaN(hour)) {
hour = 0;
} else {
hour = parseInt(hour.replace(/^0(\d)/, "$1"));
}
}
var min = 0;
var deltaMin = 1;
if (minPos > 0) {
min = val.replace(new RegExp(re), "$" + minPos);
if (dojo.lang.isString(this.delta)) {
deltaMin = this.delta.replace(new RegExp(re), "$" + minPos);
}
if (isNaN(deltaMin)) {
deltaMin = 1;
} else {
deltaMin = parseInt(deltaMin);
}
cursorFormat = cursorFormat.replace(/m+/, min.replace(/./g, "m"));
if (isNaN(min)) {
min = 0;
} else {
min = parseInt(min.replace(/^0(\d)/, "$1"));
}
}
var sec = 0;
var deltaSec = 1;
if (secPos > 0) {
sec = val.replace(new RegExp(re), "$" + secPos);
if (dojo.lang.isString(this.delta)) {
deltaSec = this.delta.replace(new RegExp(re), "$" + secPos);
}
if (isNaN(deltaSec)) {
deltaSec = 1;
} else {
deltaSec = parseInt(deltaSec);
}
cursorFormat = cursorFormat.replace(/s+/, sec.replace(/./g, "s"));
if (isNaN(sec)) {
sec = 0;
} else {
sec = parseInt(sec.replace(/^0(\d)/, "$1"));
}
}
if (isNaN(x) || x >= cursorFormat.length) {
x = cursorFormat.length - 1;
}
var cursorToken = cursorFormat.charAt(x);
switch (cursorToken) {
case "t":
if (ampm == this.flags.amSymbol) {
ampm = this.flags.pmSymbol;
} else {
if (ampm == this.flags.pmSymbol) {
ampm = this.flags.amSymbol;
}
}
break;
default:
if (hour >= 1 && hour < 12 && ampm == this.flags.pmSymbol) {
hour += 12;
}
if (hour == 12 && ampm == this.flags.amSymbol) {
hour = 0;
}
switch (cursorToken) {
case "s":
sec += deltaSec * direction;
while (sec < 0) {
min--;
sec += 60;
}
while (sec >= 60) {
min++;
sec -= 60;
}
case "m":
if (cursorToken == "m") {
min += deltaMin * direction;
}
while (min < 0) {
hour--;
min += 60;
}
while (min >= 60) {
hour++;
min -= 60;
}
case "h":
case "H":
if (cursorToken == "h" || cursorToken == "H") {
hour += deltaHour * direction;
}
while (hour < 0) {
hour += 24;
}
while (hour >= 24) {
hour -= 24;
}
break;
default:
return;
}
if (hour >= 12) {
ampm = this.flags.pmSymbol;
if (format.indexOf("h") >= 0 && hour >= 13) {
hour -= 12;
}
} else {
ampm = this.flags.amSymbol;
if (format.indexOf("h") >= 0 && hour == 0) {
hour = 12;
}
}
}
cursorFormat = format;
if (hour >= 0 && hour < 10 && format.search(/[hH]{2}/) >= 0) {
hour = "0" + hour.toString();
}
if (hour >= 10 && cursorFormat.search(/[hH]{2}/) < 0) {
cursorFormat = cursorFormat.replace(/(h|H)/, "$1$1");
}
if (min >= 0 && min < 10 && cursorFormat.search(/mm/) >= 0) {
min = "0" + min.toString();
}
if (min >= 10 && cursorFormat.search(/mm/) < 0) {
cursorFormat = cursorFormat.replace(/m/, "$1$1");
}
if (sec >= 0 && sec < 10 && cursorFormat.search(/ss/) >= 0) {
sec = "0" + sec.toString();
}
if (sec >= 10 && cursorFormat.search(/ss/) < 0) {
cursorFormat = cursorFormat.replace(/s/, "$1$1");
}
x = cursorFormat.indexOf(cursorToken);
if (x == -1) {
x = format.length;
}
format = format.replace(/[hH]+/, hour);
format = format.replace(/m+/, min);
format = format.replace(/s+/, sec);
format = format.replace(/t/, ampm);
this.setValue(format);
if (x > format.length) {
x = format.length;
}
return x;
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/ResizableTextarea.js
New file
0,0 → 1,33
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.ResizableTextarea");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.LayoutContainer");
dojo.require("dojo.widget.ResizeHandle");
dojo.widget.defineWidget("dojo.widget.ResizableTextarea", dojo.widget.HtmlWidget, {templateString:"<div>\n\t<div style=\"border: 2px solid black; width: 90%; height: 200px;\"\n\t\tdojoAttachPoint=\"rootLayoutNode\">\n\t\t<div dojoAttachPoint=\"textAreaContainerNode\" \n\t\t\tstyle=\"border: 0px; margin: 0px; overflow: hidden;\">\n\t\t</div>\n\t\t<div dojoAttachPoint=\"statusBarContainerNode\" class=\"statusBar\">\n\t\t\t<div dojoAttachPoint=\"statusLabelNode\" \n\t\t\t\tclass=\"statusPanel\"\n\t\t\t\tstyle=\"padding-right: 0px; z-index: 1;\">drag to resize</div>\n\t\t\t<div dojoAttachPoint=\"resizeHandleNode\"></div>\n\t\t</div>\n\t</div>\n</div>\n", templateCssString:"div.statusBar {\n\tbackground-color: ThreeDFace;\n\theight: 28px;\n\tpadding: 1px;\n\toverflow: hidden;\n\tfont-size: 12px;\n}\n\ndiv.statusPanel {\n\tbackground-color: ThreeDFace;\n\tborder: 1px solid;\n\tborder-color: ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow;\n\tmargin: 1px;\n\tpadding: 2px 6px;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/ResizableTextarea.css"), fillInTemplate:function (args, frag) {
this.textAreaNode = this.getFragNodeRef(frag).cloneNode(true);
dojo.body().appendChild(this.domNode);
this.rootLayout = dojo.widget.createWidget("LayoutContainer", {minHeight:50, minWidth:100}, this.rootLayoutNode);
this.textAreaContainer = dojo.widget.createWidget("LayoutContainer", {layoutAlign:"client"}, this.textAreaContainerNode);
this.rootLayout.addChild(this.textAreaContainer);
this.textAreaContainer.domNode.appendChild(this.textAreaNode);
with (this.textAreaNode.style) {
width = "100%";
height = "100%";
}
this.statusBar = dojo.widget.createWidget("LayoutContainer", {layoutAlign:"bottom", minHeight:28}, this.statusBarContainerNode);
this.rootLayout.addChild(this.statusBar);
this.statusLabel = dojo.widget.createWidget("LayoutContainer", {layoutAlign:"client", minWidth:50}, this.statusLabelNode);
this.statusBar.addChild(this.statusLabel);
this.resizeHandle = dojo.widget.createWidget("ResizeHandle", {targetElmId:this.rootLayout.widgetId}, this.resizeHandleNode);
this.statusBar.addChild(this.resizeHandle);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/TreeBasicControllerV3.js
New file
0,0 → 1,459
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeBasicControllerV3");
dojo.require("dojo.event.*");
dojo.require("dojo.json");
dojo.require("dojo.io.*");
dojo.require("dojo.widget.TreeCommon");
dojo.require("dojo.widget.TreeNodeV3");
dojo.require("dojo.widget.TreeV3");
dojo.widget.defineWidget("dojo.widget.TreeBasicControllerV3", [dojo.widget.HtmlWidget, dojo.widget.TreeCommon], function () {
this.listenedTrees = {};
}, {listenTreeEvents:["afterSetFolder", "afterTreeCreate", "beforeTreeDestroy"], listenNodeFilter:function (elem) {
return elem instanceof dojo.widget.Widget;
}, editor:null, initialize:function (args) {
if (args.editor) {
this.editor = dojo.widget.byId(args.editor);
this.editor.controller = this;
}
}, getInfo:function (elem) {
return elem.getInfo();
}, onBeforeTreeDestroy:function (message) {
this.unlistenTree(message.source);
}, onAfterSetFolder:function (message) {
if (message.source.expandLevel > 0) {
this.expandToLevel(message.source, message.source.expandLevel);
}
if (message.source.loadLevel > 0) {
this.loadToLevel(message.source, message.source.loadLevel);
}
}, _focusNextVisible:function (nodeWidget) {
if (nodeWidget.isFolder && nodeWidget.isExpanded && nodeWidget.children.length > 0) {
returnWidget = nodeWidget.children[0];
} else {
while (nodeWidget.isTreeNode && nodeWidget.isLastChild()) {
nodeWidget = nodeWidget.parent;
}
if (nodeWidget.isTreeNode) {
var returnWidget = nodeWidget.parent.children[nodeWidget.getParentIndex() + 1];
}
}
if (returnWidget && returnWidget.isTreeNode) {
this._focusLabel(returnWidget);
return returnWidget;
}
}, _focusPreviousVisible:function (nodeWidget) {
var returnWidget = nodeWidget;
if (!nodeWidget.isFirstChild()) {
var previousSibling = nodeWidget.parent.children[nodeWidget.getParentIndex() - 1];
nodeWidget = previousSibling;
while (nodeWidget.isFolder && nodeWidget.isExpanded && nodeWidget.children.length > 0) {
returnWidget = nodeWidget;
nodeWidget = nodeWidget.children[nodeWidget.children.length - 1];
}
} else {
nodeWidget = nodeWidget.parent;
}
if (nodeWidget && nodeWidget.isTreeNode) {
returnWidget = nodeWidget;
}
if (returnWidget && returnWidget.isTreeNode) {
this._focusLabel(returnWidget);
return returnWidget;
}
}, _focusZoomIn:function (nodeWidget) {
var returnWidget = nodeWidget;
if (nodeWidget.isFolder && !nodeWidget.isExpanded) {
this.expand(nodeWidget);
} else {
if (nodeWidget.children.length > 0) {
nodeWidget = nodeWidget.children[0];
}
}
if (nodeWidget && nodeWidget.isTreeNode) {
returnWidget = nodeWidget;
}
if (returnWidget && returnWidget.isTreeNode) {
this._focusLabel(returnWidget);
return returnWidget;
}
}, _focusZoomOut:function (node) {
var returnWidget = node;
if (node.isFolder && node.isExpanded) {
this.collapse(node);
} else {
node = node.parent;
}
if (node && node.isTreeNode) {
returnWidget = node;
}
if (returnWidget && returnWidget.isTreeNode) {
this._focusLabel(returnWidget);
return returnWidget;
}
}, onFocusNode:function (e) {
var node = this.domElement2TreeNode(e.target);
if (node) {
node.viewFocus();
dojo.event.browser.stopEvent(e);
}
}, onBlurNode:function (e) {
var node = this.domElement2TreeNode(e.target);
if (!node) {
return;
}
var labelNode = node.labelNode;
labelNode.setAttribute("tabIndex", "-1");
node.viewUnfocus();
dojo.event.browser.stopEvent(e);
node.tree.domNode.setAttribute("tabIndex", "0");
}, _focusLabel:function (node) {
var lastFocused = node.tree.lastFocused;
var labelNode;
if (lastFocused && lastFocused.labelNode) {
labelNode = lastFocused.labelNode;
dojo.event.disconnect(labelNode, "onblur", this, "onBlurNode");
labelNode.setAttribute("tabIndex", "-1");
dojo.html.removeClass(labelNode, "TreeLabelFocused");
}
labelNode = node.labelNode;
labelNode.setAttribute("tabIndex", "0");
node.tree.lastFocused = node;
dojo.html.addClass(labelNode, "TreeLabelFocused");
dojo.event.connectOnce(labelNode, "onblur", this, "onBlurNode");
dojo.event.connectOnce(labelNode, "onfocus", this, "onFocusNode");
labelNode.focus();
}, onKey:function (e) {
if (!e.key || e.ctrkKey || e.altKey) {
return;
}
var nodeWidget = this.domElement2TreeNode(e.target);
if (!nodeWidget) {
return;
}
var treeWidget = nodeWidget.tree;
if (treeWidget.lastFocused && treeWidget.lastFocused.labelNode) {
nodeWidget = treeWidget.lastFocused;
}
switch (e.key) {
case e.KEY_TAB:
if (e.shiftKey) {
treeWidget.domNode.setAttribute("tabIndex", "-1");
}
break;
case e.KEY_RIGHT_ARROW:
this._focusZoomIn(nodeWidget);
dojo.event.browser.stopEvent(e);
break;
case e.KEY_LEFT_ARROW:
this._focusZoomOut(nodeWidget);
dojo.event.browser.stopEvent(e);
break;
case e.KEY_UP_ARROW:
this._focusPreviousVisible(nodeWidget);
dojo.event.browser.stopEvent(e);
break;
case e.KEY_DOWN_ARROW:
this._focusNextVisible(nodeWidget);
dojo.event.browser.stopEvent(e);
break;
}
}, onFocusTree:function (e) {
if (!e.currentTarget) {
return;
}
try {
var treeWidget = this.getWidgetByNode(e.currentTarget);
if (!treeWidget || !treeWidget.isTree) {
return;
}
var nodeWidget = this.getWidgetByNode(treeWidget.domNode.firstChild);
if (nodeWidget && nodeWidget.isTreeNode) {
if (treeWidget.lastFocused && treeWidget.lastFocused.isTreeNode) {
nodeWidget = treeWidget.lastFocused;
}
this._focusLabel(nodeWidget);
}
}
catch (e) {
}
}, onAfterTreeCreate:function (message) {
var tree = message.source;
dojo.event.browser.addListener(tree.domNode, "onKey", dojo.lang.hitch(this, this.onKey));
dojo.event.browser.addListener(tree.domNode, "onmousedown", dojo.lang.hitch(this, this.onTreeMouseDown));
dojo.event.browser.addListener(tree.domNode, "onclick", dojo.lang.hitch(this, this.onTreeClick));
dojo.event.browser.addListener(tree.domNode, "onfocus", dojo.lang.hitch(this, this.onFocusTree));
tree.domNode.setAttribute("tabIndex", "0");
if (tree.expandLevel) {
this.expandToLevel(tree, tree.expandLevel);
}
if (tree.loadLevel) {
this.loadToLevel(tree, tree.loadLevel);
}
}, onTreeMouseDown:function (e) {
}, onTreeClick:function (e) {
var domElement = e.target;
var node = this.domElement2TreeNode(domElement);
if (!node || !node.isTreeNode) {
return;
}
var checkExpandClick = function (el) {
return el === node.expandNode;
};
if (this.checkPathCondition(domElement, checkExpandClick)) {
this.processExpandClick(node);
}
this._focusLabel(node);
}, processExpandClick:function (node) {
if (node.isExpanded) {
this.collapse(node);
} else {
this.expand(node);
}
}, batchExpandTimeout:20, expandAll:function (nodeOrTree) {
return this.expandToLevel(nodeOrTree, Number.POSITIVE_INFINITY);
}, collapseAll:function (nodeOrTree) {
var _this = this;
var filter = function (elem) {
return (elem instanceof dojo.widget.Widget) && elem.isFolder && elem.isExpanded;
};
if (nodeOrTree.isTreeNode) {
this.processDescendants(nodeOrTree, filter, this.collapse);
} else {
if (nodeOrTree.isTree) {
dojo.lang.forEach(nodeOrTree.children, function (c) {
_this.processDescendants(c, filter, _this.collapse);
});
}
}
}, expandToNode:function (node, withSelected) {
n = withSelected ? node : node.parent;
s = [];
while (!n.isExpanded) {
s.push(n);
n = n.parent;
}
dojo.lang.forEach(s, function (n) {
n.expand();
});
}, expandToLevel:function (nodeOrTree, level) {
dojo.require("dojo.widget.TreeTimeoutIterator");
var _this = this;
var filterFunc = function (elem) {
var res = elem.isFolder || elem.children && elem.children.length;
return res;
};
var callFunc = function (node, iterator) {
_this.expand(node, true);
iterator.forward();
};
var iterator = new dojo.widget.TreeTimeoutIterator(nodeOrTree, callFunc, this);
iterator.setFilter(filterFunc);
iterator.timeout = this.batchExpandTimeout;
iterator.setMaxLevel(nodeOrTree.isTreeNode ? level - 1 : level);
return iterator.start(nodeOrTree.isTreeNode);
}, getWidgetByNode:function (node) {
var widgetId;
var newNode = node;
while (!(widgetId = newNode.widgetId)) {
newNode = newNode.parentNode;
if (newNode == null) {
break;
}
}
if (widgetId) {
return dojo.widget.byId(widgetId);
} else {
if (node == null) {
return null;
} else {
return dojo.widget.manager.byNode(node);
}
}
}, expand:function (node) {
if (node.isFolder) {
node.expand();
}
}, collapse:function (node) {
if (node.isFolder) {
node.collapse();
}
}, canEditLabel:function (node) {
if (node.actionIsDisabledNow(node.actions.EDIT)) {
return false;
}
return true;
}, editLabelStart:function (node) {
if (!this.canEditLabel(node)) {
return false;
}
if (!this.editor.isClosed()) {
this.editLabelFinish(this.editor.saveOnBlur);
}
this.doEditLabelStart(node);
}, editLabelFinish:function (save) {
this.doEditLabelFinish(save);
}, doEditLabelStart:function (node) {
if (!this.editor) {
dojo.raise(this.widgetType + ": no editor specified");
}
this.editor.open(node);
}, doEditLabelFinish:function (save, server_data) {
if (!this.editor) {
dojo.raise(this.widgetType + ": no editor specified");
}
var node = this.editor.node;
var editorTitle = this.editor.getContents();
this.editor.close(save);
if (save) {
var data = {title:editorTitle};
if (server_data) {
dojo.lang.mixin(data, server_data);
}
if (node.isPhantom) {
var parent = node.parent;
var index = node.getParentIndex();
node.destroy();
dojo.widget.TreeBasicControllerV3.prototype.doCreateChild.call(this, parent, index, data);
} else {
var title = server_data && server_data.title ? server_data.title : editorTitle;
node.setTitle(title);
}
} else {
if (node.isPhantom) {
node.destroy();
}
}
}, makeDefaultNode:function (parent, index) {
var data = {title:parent.tree.defaultChildTitle};
return dojo.widget.TreeBasicControllerV3.prototype.doCreateChild.call(this, parent, index, data);
}, runStages:function (check, prepare, make, finalize, expose, args) {
if (check && !check.apply(this, args)) {
return false;
}
if (prepare && !prepare.apply(this, args)) {
return false;
}
var result = make.apply(this, args);
if (finalize) {
finalize.apply(this, args);
}
if (!result) {
return result;
}
if (expose) {
expose.apply(this, args);
}
return result;
}});
dojo.lang.extend(dojo.widget.TreeBasicControllerV3, {createAndEdit:function (parent, index) {
var data = {title:parent.tree.defaultChildTitle};
if (!this.canCreateChild(parent, index, data)) {
return false;
}
var child = this.doCreateChild(parent, index, data);
if (!child) {
return false;
}
this.exposeCreateChild(parent, index, data);
child.isPhantom = true;
if (!this.editor.isClosed()) {
this.editLabelFinish(this.editor.saveOnBlur);
}
this.doEditLabelStart(child);
}});
dojo.lang.extend(dojo.widget.TreeBasicControllerV3, {canClone:function (child, newParent, index, deep) {
return true;
}, clone:function (child, newParent, index, deep) {
return this.runStages(this.canClone, this.prepareClone, this.doClone, this.finalizeClone, this.exposeClone, arguments);
}, exposeClone:function (child, newParent) {
if (newParent.isTreeNode) {
this.expand(newParent);
}
}, doClone:function (child, newParent, index, deep) {
var cloned = child.clone(deep);
newParent.addChild(cloned, index);
return cloned;
}});
dojo.lang.extend(dojo.widget.TreeBasicControllerV3, {canDetach:function (child) {
if (child.actionIsDisabledNow(child.actions.DETACH)) {
return false;
}
return true;
}, detach:function (node) {
return this.runStages(this.canDetach, this.prepareDetach, this.doDetach, this.finalizeDetach, this.exposeDetach, arguments);
}, doDetach:function (node, callObj, callFunc) {
node.detach();
}});
dojo.lang.extend(dojo.widget.TreeBasicControllerV3, {canDestroyChild:function (child) {
if (child.parent && !this.canDetach(child)) {
return false;
}
return true;
}, destroyChild:function (node) {
return this.runStages(this.canDestroyChild, this.prepareDestroyChild, this.doDestroyChild, this.finalizeDestroyChild, this.exposeDestroyChild, arguments);
}, doDestroyChild:function (node) {
node.destroy();
}});
dojo.lang.extend(dojo.widget.TreeBasicControllerV3, {canMoveNotANode:function (child, parent) {
if (child.treeCanMove) {
return child.treeCanMove(parent);
}
return true;
}, canMove:function (child, newParent) {
if (!child.isTreeNode) {
return this.canMoveNotANode(child, newParent);
}
if (child.actionIsDisabledNow(child.actions.MOVE)) {
return false;
}
if (child.parent !== newParent && newParent.actionIsDisabledNow(newParent.actions.ADDCHILD)) {
return false;
}
var node = newParent;
while (node.isTreeNode) {
if (node === child) {
return false;
}
node = node.parent;
}
return true;
}, move:function (child, newParent, index) {
return this.runStages(this.canMove, this.prepareMove, this.doMove, this.finalizeMove, this.exposeMove, arguments);
}, doMove:function (child, newParent, index) {
child.tree.move(child, newParent, index);
return true;
}, exposeMove:function (child, newParent) {
if (newParent.isTreeNode) {
this.expand(newParent);
}
}});
dojo.lang.extend(dojo.widget.TreeBasicControllerV3, {canCreateChild:function (parent, index, data) {
if (parent.actionIsDisabledNow(parent.actions.ADDCHILD)) {
return false;
}
return true;
}, createChild:function (parent, index, data) {
if (!data) {
data = {title:parent.tree.defaultChildTitle};
}
return this.runStages(this.canCreateChild, this.prepareCreateChild, this.doCreateChild, this.finalizeCreateChild, this.exposeCreateChild, [parent, index, data]);
}, prepareCreateChild:function () {
return true;
}, finalizeCreateChild:function () {
}, doCreateChild:function (parent, index, data) {
var newChild = parent.tree.createNode(data);
parent.addChild(newChild, index);
return newChild;
}, exposeCreateChild:function (parent) {
return this.expand(parent);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Show.js
New file
0,0 → 1,209
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Show");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.uri.Uri");
dojo.require("dojo.event.*");
dojo.require("dojo.lfx.*");
dojo.require("dojo.math.curves");
dojo.require("dojo.lang.common");
dojo.require("dojo.lang.func");
dojo.widget.defineWidget("dojo.widget.Show", dojo.widget.HtmlWidget, function () {
this._slides = [];
}, {isContainer:true, _slide:-1, body:null, nav:null, hider:null, select:null, option:null, inNav:false, debugPane:null, noClick:false, templateString:"<div class=\"dojoShow\">\n\t<div dojoAttachPoint=\"contentNode\"></div>\n\t<div class=\"dojoShowNav\" dojoAttachPoint=\"nav\">\n\t\t<div class=\"dojoShowHider\" dojoAttachPoint=\"hider\"></div>\n\t\t<span unselectable=\"on\" style=\"cursor: default;\" dojoAttachEvent=\"onClick:previousSlide\">&lt;</span>\n\t\t<select dojoAttachEvent=\"onClick:gotoSlideByEvent\" dojoAttachPoint=\"select\">\n\t\t\t<option dojoAttachPoint=\"option\">Title</option>\n\t\t</select>\n\t\t<span unselectable=\"on\" style=\"cursor: default;\" dojoAttachEvent=\"onClick:nextSlide\">&gt;</span>\n\t</div>\n</div>\n", templateCssString:"@media screen {\n\thtml, body {\n\t\tmargin: 0px;\n\t\tpadding: 0px;\n\t\twidth: 100%;\n\t}\n\th1 {\n\t\tfont-size: 50px;\n\t}\n\tp, li {\n\t\tfont-size: 30px;\n\t}\n\t.dojoShowNav {\n\t\tbackground: #369;\n\t\toverflow: hidden;\n\t\tposition: absolute;\n\t\theight: 5px;\n\t\tbottom: 0px;\n\t\tleft: 0px;\n\t\twidth: 100%;\n\t\ttext-align: center;\n\t}\n\t.dojoShowNav input {\n\t\tmargin: 0px;\n\t}\n\t.dojoShowHider {\n\t\theight: 5px;\n\t\toverflow: hidden;\n\t\twidth: 100%;\n\t}\n\t.dojoShowPrint {\n\t\tposition: absolute;\n\t\tleft: 5px;\n\t\ttop: 0px;\n\t}\n\t.dojoShow {\n\t\tdisplay: none;\n\t}\n}\n@media print {\n\t.dojoShow {\n\t\tdisplay: none !important;\n\t}\n\t.dojoShowPrint {\n\t\tdisplay: block !important;\n\t}\n\t.dojoShowPrintSlide {\n\t\tborder: 1px solid #aaa;\n\t\tpadding: 10px;\n\t\tmargin-bottom: 15px;\n\t}\n\t.dojoShowPrintSlide, ul {\n\tpage-break-inside: avoid;\n\t}\n\th1 {\n\t\tmargin-top: 0;\n\t\tpage-break-after: avoid;\n\t}\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/Show.css"), fillInTemplate:function (args, frag) {
if (args.debugPane) {
var dp = this.debugPane = dojo.widget.byId(args.debugPane);
dp.hide();
dojo.event.connect(dp, "closeWindow", dojo.lang.hitch(this, function () {
this.debugPane = false;
}));
}
var source = this.getFragNodeRef(frag);
this.sourceNode = dojo.body().appendChild(source.cloneNode(true));
for (var i = 0, child; child = this.sourceNode.childNodes[i]; i++) {
if (child.tagName && child.getAttribute("dojotype").toLowerCase() == "showslide") {
child.className = "dojoShowPrintSlide";
child.innerHTML = "<h1>" + child.title + "</h1>" + child.innerHTML;
}
}
this.sourceNode.className = "dojoShowPrint";
this.sourceNode.style.display = "none";
dojo.event.connect(document, "onclick", this, "gotoSlideByEvent");
if (dojo.render.html.ie) {
dojo.event.connect(document, "onkeydown", this, "gotoSlideByEvent");
} else {
dojo.event.connect(document, "onkeypress", this, "gotoSlideByEvent");
}
dojo.event.connect(window, "onresize", this, "resizeWindow");
dojo.event.connect(this.nav, "onmousemove", this, "popUpNav");
}, postCreate:function () {
this._slides = [];
for (var i = 0, child; child = this.children[i]; i++) {
if (child.widgetType == "ShowSlide") {
this._slides.push(child);
this.option.text = child.title + " (" + (i + 1) + ")";
this.option.parentNode.insertBefore(this.option.cloneNode(true), this.option);
}
}
this.option.parentNode.removeChild(this.option);
this.domNode.style.display = "block";
this.resizeWindow();
this.gotoSlide(0, true);
dojo.addOnLoad(dojo.lang.hitch(this, function () {
var th = window.location.hash;
if (th.length) {
var parts = ("" + window.location).split(this.widgetId + "_SlideNo_");
if (parts.length > 1) {
setTimeout(dojo.lang.hitch(this, function () {
this.gotoSlide(parseInt(parts[1]), true);
}), 300);
}
}
}));
}, gotoSlide:function (slide, preventSetHash) {
if (slide == this._slide) {
return;
}
if (!this._slides[slide]) {
for (var i = 0, child; child = this._slides[i]; i++) {
if (child.title == slide) {
slide = i;
break;
}
}
}
if (!this._slides[slide]) {
return;
}
if (this.debugPane) {
if (this._slides[slide].debug) {
this.debugPane.show();
} else {
this.debugPane.hide();
}
}
if (this._slide != -1) {
while (this._slides[this._slide].previousAction()) {
}
}
if (!preventSetHash) {
window.location.href = "#" + this.widgetId + "_SlideNo_" + slide;
}
if (this._slides[this._slide]) {
this._slides[this._slide].hide();
}
this._slide = slide;
this.select.selectedIndex = slide;
var cn = this.contentNode;
while (cn.firstChild) {
cn.removeChild(cn.firstChild);
}
cn.appendChild(this._slides[slide].domNode);
this._slides[slide].show();
}, gotoSlideByEvent:function (event) {
var node = event.target;
var type = event.type;
if (type == "click") {
if (node.tagName == "OPTION" && node.parentNode == this.select) {
this.gotoSlide(node.index);
} else {
if (node == this.select) {
this.gotoSlide(node.selectedIndex);
} else {
this.nextSlide(event);
}
}
} else {
if (type == "keydown" || type == "keypress") {
var key = event.keyCode;
var ch = event.charCode;
if (key == 63234 || key == 37) {
this.previousSlide(event);
} else {
if (key == 63235 || key == 39 || ch == 32) {
this.nextSlide(event);
}
}
}
}
}, nextSlide:function (event) {
if (!this.stopEvent(event)) {
return false;
}
if (!this._slides[this._slide].nextAction(event)) {
if ((this._slide + 1) != this._slides.length) {
this.gotoSlide(this._slide + 1);
return true;
}
return false;
}
}, previousSlide:function (event) {
if (!this.stopEvent(event)) {
return false;
}
if (!this._slides[this._slide].previousAction(event)) {
if ((this._slide - 1) != -1) {
this.gotoSlide(this._slide - 1);
return true;
}
return false;
}
}, stopEvent:function (ev) {
if (!ev) {
return true;
}
if (ev.type == "click" && (this._slides[this._slide].noClick || this.noClick)) {
return false;
}
var target = ev.target;
while (target != null) {
if (target == this.domNode) {
target = ev.target;
break;
}
target = target.parentNode;
}
if (!dojo.dom.isDescendantOf(target, this.nav)) {
while (target && target != this.domNode) {
if (target.tagName == "A" || target.tagName == "INPUT" || target.tagName == "TEXTAREA" || target.tagName == "SELECT") {
return false;
}
if (typeof target.onclick == "function" || typeof target.onkeypress == "function") {
return false;
}
target = target.parentNode;
}
}
if (window.event) {
ev.returnValue = false;
ev.cancelBubble = true;
} else {
ev.preventDefault();
ev.stopPropagation();
}
return true;
}, popUpNav:function () {
if (!this.inNav) {
dojo.lfx.propertyAnimation(this.nav, {"height":{start:5, end:30}}, 250).play();
}
clearTimeout(this.inNav);
this.inNav = setTimeout(dojo.lang.hitch(this, "hideNav"), 2000);
}, hideNav:function () {
clearTimeout(this.inNav);
this.inNav = false;
dojo.lfx.propertyAnimation(this.nav, {"height":{start:30, end:5}}, 250).play();
}, resizeWindow:function (ev) {
dojo.body().style.height = "auto";
var h = Math.max(document.documentElement.scrollHeight || dojo.body().scrollHeight, dojo.html.getViewport().height);
dojo.body().style.height = h + "px";
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/LayoutContainer.js
New file
0,0 → 1,32
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.LayoutContainer");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.html.layout");
dojo.widget.defineWidget("dojo.widget.LayoutContainer", dojo.widget.HtmlWidget, {isContainer:true, layoutChildPriority:"top-bottom", postCreate:function () {
dojo.widget.html.layout(this.domNode, this.children, this.layoutChildPriority);
}, addChild:function (child, overrideContainerNode, pos, ref, insertIndex) {
dojo.widget.LayoutContainer.superclass.addChild.call(this, child, overrideContainerNode, pos, ref, insertIndex);
dojo.widget.html.layout(this.domNode, this.children, this.layoutChildPriority);
}, removeChild:function (pane) {
dojo.widget.LayoutContainer.superclass.removeChild.call(this, pane);
dojo.widget.html.layout(this.domNode, this.children, this.layoutChildPriority);
}, onResized:function () {
dojo.widget.html.layout(this.domNode, this.children, this.layoutChildPriority);
}, show:function () {
this.domNode.style.display = "";
this.checkSize();
this.domNode.style.display = "none";
this.domNode.style.visibility = "";
dojo.widget.LayoutContainer.superclass.show.call(this);
}});
dojo.lang.extend(dojo.widget.Widget, {layoutAlign:"none"});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/nls/zh-cn/validate.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"rangeMessage":"* \u8f93\u5165\u6570\u636e\u8d85\u51fa\u503c\u57df\u3002", "invalidMessage":"* \u975e\u6cd5\u7684\u8f93\u5165\u503c\u3002", "missingMessage":"* \u6b64\u503c\u662f\u5fc5\u987b\u7684\u3002"})
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/nls/DropdownDatePicker.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"selectDate":"Select a date"})
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/nls/DropdownTimePicker.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"selectTime":"Select time"})
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/nls/validate.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"rangeMessage":"* This value is out of range.", "invalidMessage":"* The value entered is not valid.", "missingMessage":"* This value is required."})
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/nls/TimePicker.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"any":"any"})
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/nls/fr/validate.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"rangeMessage":"* Cette valeur est hors limites.", "invalidMessage":"* La valeur saisie est incorrecte.", "missingMessage":"* Cette valeur est obligatoire."})
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/nls/ja/validate.js
New file
0,0 → 1,11
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
({"rangeMessage":"* \u5165\u529b\u3057\u305f\u6570\u5024\u306f\u9078\u629e\u7bc4\u56f2\u5916\u3067\u3059\u3002", "invalidMessage":"* \u5165\u529b\u3057\u305f\u30c7\u30fc\u30bf\u306b\u8a72\u5f53\u3059\u308b\u3082\u306e\u304c\u3042\u308a\u307e\u305b\u3093\u3002", "missingMessage":"* \u5165\u529b\u304c\u5fc5\u9808\u3067\u3059\u3002"})
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/svg/Chart.js
New file
0,0 → 1,470
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.svg.Chart");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.Chart");
dojo.require("dojo.html.layout");
dojo.require("dojo.math");
dojo.require("dojo.svg");
dojo.require("dojo.gfx.color");
dojo.require("dojo.json");
dojo.widget.defineWidget("dojo.widget.svg.Chart", [dojo.widget.HtmlWidget, dojo.widget.Chart], function () {
this.templatePath = null;
this.templateCssPath = null;
this._isInitialize = false;
this.hasData = false;
this.vectorNode = null;
this.plotArea = null;
this.dataGroup = null;
this.axisGroup = null;
this.properties = {height:0, width:0, defaultWidth:600, defaultHeight:400, plotType:null, padding:{top:10, bottom:2, left:60, right:30}, axes:{x:{plotAt:0, label:"", unitLabel:"", unitType:Number, nUnitsToShow:10, range:{min:0, max:200}}, y:{plotAt:0, label:"", unitLabel:"", unitType:Number, nUnitsToShow:10, range:{min:0, max:200}}}};
}, {parseProperties:function (node) {
var bRangeX = false;
var bRangeY = false;
if (node.getAttribute("width")) {
this.properties.width = node.getAttribute("width");
}
if (node.getAttribute("height")) {
this.properties.height = node.getAttribute("height");
}
if (node.getAttribute("plotType")) {
this.properties.plotType = node.getAttribute("plotType");
}
if (node.getAttribute("padding")) {
if (node.getAttribute("padding").indexOf(",") > -1) {
var p = node.getAttribute("padding").split(",");
} else {
var p = node.getAttribute("padding").split(" ");
}
if (p.length == 1) {
var pad = parseFloat(p[0]);
this.properties.padding.top = pad;
this.properties.padding.right = pad;
this.properties.padding.bottom = pad;
this.properties.padding.left = pad;
} else {
if (p.length == 2) {
var padV = parseFloat(p[0]);
var padH = parseFloat(p[1]);
this.properties.padding.top = padV;
this.properties.padding.right = padH;
this.properties.padding.bottom = padV;
this.properties.padding.left = padH;
} else {
if (p.length == 4) {
this.properties.padding.top = parseFloat(p[0]);
this.properties.padding.right = parseFloat(p[1]);
this.properties.padding.bottom = parseFloat(p[2]);
this.properties.padding.left = parseFloat(p[3]);
}
}
}
}
if (node.getAttribute("rangeX")) {
var p = node.getAttribute("rangeX");
if (p.indexOf(",") > -1) {
p = p.split(",");
} else {
p = p.split(" ");
}
this.properties.axes.x.range.min = parseFloat(p[0]);
this.properties.axes.x.range.max = parseFloat(p[1]);
bRangeX = true;
}
if (node.getAttribute("rangeY")) {
var p = node.getAttribute("rangeY");
if (p.indexOf(",") > -1) {
p = p.split(",");
} else {
p = p.split(" ");
}
this.properties.axes.y.range.min = parseFloat(p[0]);
this.properties.axes.y.range.max = parseFloat(p[1]);
bRangeY = true;
}
return {rangeX:bRangeX, rangeY:bRangeY};
}, setAxesPlot:function (table) {
if (table.getAttribute("axisAt")) {
var p = table.getAttribute("axisAt");
if (p.indexOf(",") > -1) {
p = p.split(",");
} else {
p = p.split(" ");
}
if (!isNaN(parseFloat(p[0]))) {
this.properties.axes.x.plotAt = parseFloat(p[0]);
} else {
if (p[0].toLowerCase() == "ymin") {
this.properties.axes.x.plotAt = this.properties.axes.y.range.min;
} else {
if (p[0].toLowerCase() == "ymax") {
this.properties.axes.x.plotAt = this.properties.axes.y.range.max;
}
}
}
if (!isNaN(parseFloat(p[1]))) {
this.properties.axes.y.plotAt = parseFloat(p[1]);
} else {
if (p[1].toLowerCase() == "xmin") {
this.properties.axes.y.plotAt = this.properties.axes.x.range.min;
} else {
if (p[1].toLowerCase() == "xmax") {
this.properties.axes.y.plotAt = this.properties.axes.x.range.max;
}
}
}
} else {
this.properties.axes.x.plotAt = this.properties.axes.y.range.min;
this.properties.axes.y.plotAt = this.properties.axes.x.range.min;
}
}, drawVectorNode:function () {
dojo.svg.g.suspend();
if (this.vectorNode) {
this.destroy();
}
this.vectorNode = document.createElementNS(dojo.svg.xmlns.svg, "svg");
this.vectorNode.setAttribute("width", this.properties.width);
this.vectorNode.setAttribute("height", this.properties.height);
dojo.svg.g.resume();
}, drawPlotArea:function () {
dojo.svg.g.suspend();
if (this.plotArea) {
this.plotArea.parentNode.removeChild(this.plotArea);
this.plotArea = null;
}
var defs = document.createElementNS(dojo.svg.xmlns.svg, "defs");
var clip = document.createElementNS(dojo.svg.xmlns.svg, "clipPath");
clip.setAttribute("id", "plotClip" + this.widgetId);
var rect = document.createElementNS(dojo.svg.xmlns.svg, "rect");
rect.setAttribute("x", this.properties.padding.left);
rect.setAttribute("y", this.properties.padding.top);
rect.setAttribute("width", this.properties.width - this.properties.padding.left - this.properties.padding.right);
rect.setAttribute("height", this.properties.height - this.properties.padding.top - this.properties.padding.bottom);
clip.appendChild(rect);
defs.appendChild(clip);
this.vectorNode.appendChild(defs);
this.plotArea = document.createElementNS(dojo.svg.xmlns.svg, "g");
this.vectorNode.appendChild(this.plotArea);
var rect = document.createElementNS(dojo.svg.xmlns.svg, "rect");
rect.setAttribute("x", this.properties.padding.left);
rect.setAttribute("y", this.properties.padding.top);
rect.setAttribute("width", this.properties.width - this.properties.padding.left - this.properties.padding.right);
rect.setAttribute("height", this.properties.height - this.properties.padding.top - this.properties.padding.bottom);
rect.setAttribute("fill", "#fff");
this.plotArea.appendChild(rect);
dojo.svg.g.resume();
}, drawDataGroup:function () {
dojo.svg.g.suspend();
if (this.dataGroup) {
this.dataGroup.parentNode.removeChild(this.dataGroup);
this.dataGroup = null;
}
this.dataGroup = document.createElementNS(dojo.svg.xmlns.svg, "g");
this.dataGroup.setAttribute("style", "clip-path:url(#plotClip" + this.widgetId + ");");
this.plotArea.appendChild(this.dataGroup);
dojo.svg.g.resume();
}, drawAxes:function () {
dojo.svg.g.suspend();
if (this.axisGroup) {
this.axisGroup.parentNode.removeChild(this.axisGroup);
this.axisGroup = null;
}
this.axisGroup = document.createElementNS(dojo.svg.xmlns.svg, "g");
this.plotArea.appendChild(this.axisGroup);
var stroke = 1;
var line = document.createElementNS(dojo.svg.xmlns.svg, "line");
var y = dojo.widget.svg.Chart.Plotter.getY(this.properties.axes.x.plotAt, this);
line.setAttribute("y1", y);
line.setAttribute("y2", y);
line.setAttribute("x1", this.properties.padding.left - stroke);
line.setAttribute("x2", this.properties.width - this.properties.padding.right);
line.setAttribute("style", "stroke:#000;stroke-width:" + stroke + ";");
this.axisGroup.appendChild(line);
var textSize = 10;
var text = document.createElementNS(dojo.svg.xmlns.svg, "text");
text.setAttribute("x", this.properties.padding.left);
text.setAttribute("y", this.properties.height - this.properties.padding.bottom + textSize + 2);
text.setAttribute("style", "text-anchor:middle;font-size:" + textSize + "px;fill:#000;");
text.appendChild(document.createTextNode(dojo.math.round(parseFloat(this.properties.axes.x.range.min), 2)));
this.axisGroup.appendChild(text);
var text = document.createElementNS(dojo.svg.xmlns.svg, "text");
text.setAttribute("x", this.properties.width - this.properties.padding.right - (textSize / 2));
text.setAttribute("y", this.properties.height - this.properties.padding.bottom + textSize + 2);
text.setAttribute("style", "text-anchor:middle;font-size:" + textSize + "px;fill:#000;");
text.appendChild(document.createTextNode(dojo.math.round(parseFloat(this.properties.axes.x.range.max), 2)));
this.axisGroup.appendChild(text);
var line = document.createElementNS(dojo.svg.xmlns.svg, "line");
var x = dojo.widget.svg.Chart.Plotter.getX(this.properties.axes.y.plotAt, this);
line.setAttribute("x1", x);
line.setAttribute("x2", x);
line.setAttribute("y1", this.properties.padding.top);
line.setAttribute("y2", this.properties.height - this.properties.padding.bottom);
line.setAttribute("style", "stroke:#000;stroke-width:" + stroke + ";");
this.axisGroup.appendChild(line);
var text = document.createElementNS(dojo.svg.xmlns.svg, "text");
text.setAttribute("x", this.properties.padding.left - 4);
text.setAttribute("y", this.properties.height - this.properties.padding.bottom);
text.setAttribute("style", "text-anchor:end;font-size:" + textSize + "px;fill:#000;");
text.appendChild(document.createTextNode(dojo.math.round(parseFloat(this.properties.axes.y.range.min), 2)));
this.axisGroup.appendChild(text);
var text = document.createElementNS(dojo.svg.xmlns.svg, "text");
text.setAttribute("x", this.properties.padding.left - 4);
text.setAttribute("y", this.properties.padding.top + (textSize / 2));
text.setAttribute("style", "text-anchor:end;font-size:" + textSize + "px;fill:#000;");
text.appendChild(document.createTextNode(dojo.math.round(parseFloat(this.properties.axes.y.range.max), 2)));
this.axisGroup.appendChild(text);
dojo.svg.g.resume();
}, init:function () {
if (!this.properties.width || !this.properties.height) {
var box = dojo.html.getContentBox(this.domNode);
if (!this.properties.width) {
this.properties.width = (box.width < 32) ? this.properties.defaultWidth : box.width;
}
if (!this.properties.height) {
this.properties.height = (box.height < 32) ? this.properties.defaultHeight : box.height;
}
}
this.drawVectorNode();
this.drawPlotArea();
this.drawDataGroup();
this.drawAxes();
this.domNode.appendChild(this.vectorNode);
this.assignColors();
this._isInitialized = true;
}, destroy:function () {
while (this.domNode.childNodes.length > 0) {
this.domNode.removeChild(this.domNode.childNodes.item(0));
}
this.vectorNode = this.plotArea = this.dataGroup = this.axisGroup = null;
}, render:function () {
dojo.svg.g.suspend();
if (this.dataGroup) {
while (this.dataGroup.childNodes.length > 0) {
this.dataGroup.removeChild(this.dataGroup.childNodes.item(0));
}
} else {
this.init();
}
for (var i = 0; i < this.series.length; i++) {
dojo.widget.svg.Chart.Plotter.plot(this.series[i], this);
}
dojo.svg.g.resume();
}, postCreate:function () {
var table = this.domNode.getElementsByTagName("table")[0];
if (table) {
var ranges = this.parseProperties(table);
var bRangeX = false;
var bRangeY = false;
var axisValues = this.parseData(table);
if (!bRangeX) {
this.properties.axes.x.range = {min:axisValues.x.min, max:axisValues.x.max};
}
if (!bRangeY) {
this.properties.axes.y.range = {min:axisValues.y.min, max:axisValues.y.max};
}
this.setAxesPlot(table);
this.domNode.removeChild(table);
}
if (this.series.length > 0) {
this.render();
}
}});
dojo.widget.svg.Chart.Plotter = new function () {
var self = this;
var plotters = {};
var types = dojo.widget.Chart.PlotTypes;
this.getX = function (value, chart) {
var v = parseFloat(value);
var min = chart.properties.axes.x.range.min;
var max = chart.properties.axes.x.range.max;
var ofst = 0 - min;
min += ofst;
max += ofst;
v += ofst;
var xmin = chart.properties.padding.left;
var xmax = chart.properties.width - chart.properties.padding.right;
var x = (v * ((xmax - xmin) / max)) + xmin;
return x;
};
this.getY = function (value, chart) {
var v = parseFloat(value);
var max = chart.properties.axes.y.range.max;
var min = chart.properties.axes.y.range.min;
var ofst = 0;
if (min < 0) {
ofst += Math.abs(min);
}
min += ofst;
max += ofst;
v += ofst;
var ymin = chart.properties.height - chart.properties.padding.bottom;
var ymax = chart.properties.padding.top;
var y = (((ymin - ymax) / (max - min)) * (max - v)) + ymax;
return y;
};
this.addPlotter = function (name, func) {
plotters[name] = func;
};
this.plot = function (series, chart) {
if (series.values.length == 0) {
return;
}
if (series.plotType && plotters[series.plotType]) {
return plotters[series.plotType](series, chart);
} else {
if (chart.plotType && plotters[chart.plotType]) {
return plotters[chart.plotType](series, chart);
}
}
};
plotters["bar"] = function (series, chart) {
var space = 1;
var lastW = 0;
for (var i = 0; i < series.values.length; i++) {
var x = self.getX(series.values[i].x, chart);
var w;
if (i == series.values.length - 1) {
w = lastW;
} else {
w = self.getX(series.values[i + 1].x, chart) - x - space;
lastW = w;
}
x -= (w / 2);
var yA = self.getY(chart.properties.axes.x.plotAt, chart);
var y = self.getY(series.values[i].value, chart);
var h = Math.abs(yA - y);
if (parseFloat(series.values[i].value) < chart.properties.axes.x.plotAt) {
var oy = yA;
yA = y;
y = oy;
}
var bar = document.createElementNS(dojo.svg.xmlns.svg, "rect");
bar.setAttribute("fill", series.color);
bar.setAttribute("title", series.label + ": " + series.values[i].value);
bar.setAttribute("stroke-width", "0");
bar.setAttribute("x", x);
bar.setAttribute("y", y);
bar.setAttribute("width", w);
bar.setAttribute("height", h);
bar.setAttribute("fill-opacity", "0.9");
chart.dataGroup.appendChild(bar);
}
};
plotters["line"] = function (series, chart) {
var tension = 1.5;
var line = document.createElementNS(dojo.svg.xmlns.svg, "path");
line.setAttribute("fill", "none");
line.setAttribute("stroke", series.color);
line.setAttribute("stroke-width", "2");
line.setAttribute("stroke-opacity", "0.85");
line.setAttribute("title", series.label);
chart.dataGroup.appendChild(line);
var path = [];
for (var i = 0; i < series.values.length; i++) {
var x = self.getX(series.values[i].x, chart);
var y = self.getY(series.values[i].value, chart);
var dx = chart.properties.padding.left + 1;
var dy = chart.properties.height - chart.properties.padding.bottom;
if (i > 0) {
dx = x - self.getX(series.values[i - 1].x, chart);
dy = self.getY(series.values[i - 1].value, chart);
}
if (i == 0) {
path.push("M");
} else {
path.push("C");
var cx = x - (tension - 1) * (dx / tension);
path.push(cx + "," + dy);
cx = x - (dx / tension);
path.push(cx + "," + y);
}
path.push(x + "," + y);
}
line.setAttribute("d", path.join(" "));
};
plotters["area"] = function (series, chart) {
var tension = 1.5;
var line = document.createElementNS(dojo.svg.xmlns.svg, "path");
line.setAttribute("fill", series.color);
line.setAttribute("fill-opacity", "0.4");
line.setAttribute("stroke", series.color);
line.setAttribute("stroke-width", "1");
line.setAttribute("stroke-opacity", "0.8");
line.setAttribute("title", series.label);
chart.dataGroup.appendChild(line);
var path = [];
for (var i = 0; i < series.values.length; i++) {
var x = self.getX(series.values[i].x, chart);
var y = self.getY(series.values[i].value, chart);
var dx = chart.properties.padding.left + 1;
var dy = chart.properties.height - chart.properties.padding.bottom;
if (i > 0) {
dx = x - self.getX(series.values[i - 1].x, chart);
dy = self.getY(series.values[i - 1].value, chart);
}
if (i == 0) {
path.push("M");
} else {
path.push("C");
var cx = x - (tension - 1) * (dx / tension);
path.push(cx + "," + dy);
cx = x - (dx / tension);
path.push(cx + "," + y);
}
path.push(x + "," + y);
}
path.push("L");
path.push(x + "," + self.getY(0, chart));
path.push("L");
path.push(self.getX(0, chart) + "," + self.getY(0, chart));
path.push("Z");
line.setAttribute("d", path.join(" "));
}, plotters["scatter"] = function (series, chart) {
var r = 7;
for (var i = 0; i < series.values.length; i++) {
var x = self.getX(series.values[i].x, chart);
var y = self.getY(series.values[i].value, chart);
var point = document.createElementNS(dojo.svg.xmlns.svg, "path");
point.setAttribute("fill", series.color);
point.setAttribute("stroke-width", "0");
point.setAttribute("title", series.label + ": " + series.values[i].value);
point.setAttribute("d", "M " + x + "," + (y - r) + " " + "Q " + x + "," + y + " " + (x + r) + "," + y + " " + "Q " + x + "," + y + " " + x + "," + (y + r) + " " + "Q " + x + "," + y + " " + (x - r) + "," + y + " " + "Q " + x + "," + y + " " + x + "," + (y - r) + " " + "Z");
chart.dataGroup.appendChild(point);
}
};
plotters["bubble"] = function (series, chart) {
var minR = 1;
var min = chart.properties.axes.x.range.min;
var max = chart.properties.axes.x.range.max;
var ofst = 0 - min;
min += ofst;
max += ofst;
var xmin = chart.properties.padding.left;
var xmax = chart.properties.width - chart.properties.padding.right;
var factor = (max - min) / (xmax - xmin) * 25;
for (var i = 0; i < series.values.length; i++) {
var size = series.values[i].size;
if (isNaN(parseFloat(size))) {
size = minR;
}
var point = document.createElementNS(dojo.svg.xmlns.svg, "circle");
point.setAttribute("stroke-width", 0);
point.setAttribute("fill", series.color);
point.setAttribute("fill-opacity", "0.8");
point.setAttribute("r", (parseFloat(size) * factor) / 2);
point.setAttribute("cx", self.getX(series.values[i].x, chart));
point.setAttribute("cy", self.getY(series.values[i].value, chart));
point.setAttribute("title", series.label + ": " + series.values[i].value + " (" + size + ")");
chart.dataGroup.appendChild(point);
}
};
}();
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Checkbox.js
New file
0,0 → 1,101
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Checkbox");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.event.*");
dojo.require("dojo.html.style");
dojo.require("dojo.html.selection");
dojo.widget.defineWidget("dojo.widget.Checkbox", dojo.widget.HtmlWidget, {templateString:"<span style=\"display: inline-block;\" tabIndex=\"${this.tabIndex}\" waiRole=\"checkbox\" id=\"${this.id}\">\n\t<img dojoAttachPoint=\"imageNode\" class=\"dojoHtmlCheckbox\" src=\"${dojoWidgetModuleUri}templates/images/blank.gif\" alt=\"\" />\n\t<input type=\"checkbox\" name=\"${this.name}\" style=\"display: none\" value=\"${this.value}\"\n\t\tdojoAttachPoint=\"inputNode\">\n</span>\n", templateCssString:".dojoHtmlCheckbox {\n\tborder: 0px;\n\twidth: 16px;\n\theight: 16px;\n\tmargin: 2px;\n\tvertical-align: middle;\n}\n\n.dojoHtmlCheckboxOn {\n\tbackground: url(check.gif) 0px 0px;\n}\n.dojoHtmlCheckboxOff {\n\tbackground: url(check.gif) -16px 0px;\n}\n.dojoHtmlCheckboxDisabledOn {\n\tbackground: url(check.gif) -32px 0px;\n}\n.dojoHtmlCheckboxDisabledOff {\n\tbackground: url(check.gif) -48px 0px;\n}\n.dojoHtmlCheckboxOnHover {\n\tbackground: url(check.gif) -64px 0px;\n}\n.dojoHtmlCheckboxOffHover {\n\tbackground: url(check.gif) -80px 0px;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/Checkbox.css"), name:"", id:"", checked:false, tabIndex:"", value:"on", postMixInProperties:function () {
dojo.widget.Checkbox.superclass.postMixInProperties.apply(this, arguments);
if (!this.disabled && this.tabIndex == "") {
this.tabIndex = "0";
}
}, fillInTemplate:function () {
this._setInfo();
}, postCreate:function () {
var notcon = true;
this.id = this.id != "" ? this.id : this.widgetId;
if (this.id != "") {
var labels = document.getElementsByTagName("label");
if (labels != null && labels.length > 0) {
for (var i = 0; i < labels.length; i++) {
if (labels[i].htmlFor == this.id) {
labels[i].id = (labels[i].htmlFor + "label");
this._connectEvents(labels[i]);
dojo.widget.wai.setAttr(this.domNode, "waiState", "labelledby", labels[i].id);
break;
}
}
}
}
this._connectEvents(this.domNode);
this.inputNode.checked = this.checked;
}, _connectEvents:function (node) {
dojo.event.connect(node, "onmouseover", this, "mouseOver");
dojo.event.connect(node, "onmouseout", this, "mouseOut");
dojo.event.connect(node, "onkey", this, "onKey");
dojo.event.connect(node, "onclick", this, "_onClick");
dojo.html.disableSelection(node);
}, _onClick:function (e) {
if (this.disabled == false) {
this.checked = !this.checked;
this._setInfo();
}
e.preventDefault();
e.stopPropagation();
this.onClick();
}, setValue:function (bool) {
if (this.disabled == false) {
this.checked = bool;
this._setInfo();
}
}, onClick:function () {
}, onKey:function (e) {
var k = dojo.event.browser.keys;
if (e.key == " ") {
this._onClick(e);
}
}, mouseOver:function (e) {
this._hover(e, true);
}, mouseOut:function (e) {
this._hover(e, false);
}, _hover:function (e, isOver) {
if (this.disabled == false) {
var state = this.checked ? "On" : "Off";
var style = "dojoHtmlCheckbox" + state + "Hover";
if (isOver) {
dojo.html.addClass(this.imageNode, style);
} else {
dojo.html.removeClass(this.imageNode, style);
}
}
}, _setInfo:function () {
var state = "dojoHtmlCheckbox" + (this.disabled ? "Disabled" : "") + (this.checked ? "On" : "Off");
dojo.html.setClass(this.imageNode, "dojoHtmlCheckbox " + state);
this.inputNode.checked = this.checked;
if (this.disabled) {
this.inputNode.setAttribute("disabled", true);
} else {
this.inputNode.removeAttribute("disabled");
}
dojo.widget.wai.setAttr(this.domNode, "waiState", "checked", this.checked);
}});
dojo.widget.defineWidget("dojo.widget.a11y.Checkbox", dojo.widget.Checkbox, {templateString:"<span class='dojoHtmlCheckbox'>\n\t<input type=\"checkbox\" name=\"${this.name}\" tabIndex=\"${this.tabIndex}\" id=\"${this.id}\" value=\"${this.value}\"\n\t\t dojoAttachEvent=\"onClick: _onClick;\" dojoAttachPoint=\"inputNode\"> \n</span>\n", fillInTemplate:function () {
}, postCreate:function (args, frag) {
this.inputNode.checked = this.checked;
if (this.disabled) {
this.inputNode.setAttribute("disabled", true);
}
}, _onClick:function () {
this.onClick();
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Menu2.js
New file
0,0 → 1,453
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Menu2");
dojo.require("dojo.widget.PopupContainer");
dojo.declare("dojo.widget.MenuBase", null, function () {
this.eventNames = {open:""};
}, {isContainer:true, isMenu:true, eventNaming:"default", templateCssString:"\n.dojoPopupMenu2 {\n\tposition: absolute;\n\tborder: 1px solid #7298d0;\n\tbackground:#85aeec url(images/soriaMenuBg.gif) repeat-x bottom left !important;\n\tpadding: 1px;\n\tmargin-top: 1px;\n\tmargin-bottom: 1px;\n}\n\n.dojoMenuItem2{\n\twhite-space: nowrap;\n\tfont: menu;\n\tmargin: 0;\n}\n\n.dojoMenuItem2Hover {\n\tbackground-color: #D2E4FD;\n\tcursor:pointer;\n\tcursor:hand;\n}\n\n.dojoMenuItem2Icon {\n\tposition: relative;\n\tbackground-position: center center;\n\tbackground-repeat: no-repeat;\n\twidth: 16px;\n\theight: 16px;\n\tpadding-right: 3px;\n}\n\n.dojoMenuItem2Label {\n\tposition: relative;\n\tvertical-align: middle;\n}\n\n/* main label text */\n.dojoMenuItem2Label {\n\tposition: relative;\n\tvertical-align: middle;\n}\n\n.dojoMenuItem2Accel {\n\tposition: relative;\n\tvertical-align: middle;\n\tpadding-left: 3px;\n}\n\n.dojoMenuItem2Disabled .dojoMenuItem2Label,\n.dojoMenuItem2Disabled .dojoMenuItem2Accel {\n\tcolor: #607a9e;\n}\n\n.dojoMenuItem2Submenu {\n\tposition: relative;\n\tbackground-position: center center;\n\tbackground-repeat: no-repeat;\n\tbackground-image: url(images/submenu_off.gif);\n\twidth: 5px;\n\theight: 9px;\n\tpadding-left: 3px;\n}\n.dojoMenuItem2Hover .dojoMenuItem2Submenu {\n\tbackground-image: url(images/submenu_on.gif);\n}\n\n.dojoMenuItem2Disabled .dojoMenuItem2Submenu {\n\tbackground-image: url(images/submenu_disabled.gif);\n}\n\n.dojoMenuSeparator2 {\n\tfont-size: 1px;\n\tmargin: 0;\n}\n\n.dojoMenuSeparator2Top {\n\theight: 50%;\n\tborder-bottom: 1px solid #7a98c4;\n\tmargin: 0px 2px;\n\tfont-size: 1px;\n}\n\n.dojoMenuSeparator2Bottom {\n\theight: 50%;\n\tborder-top: 1px solid #c9deff;\n\tmargin: 0px 2px;\n\tfont-size: 1px;\n}\n\n.dojoMenuBar2 {\n\tbackground:#85aeec url(images/soriaBarBg.gif) repeat-x top left;\n\t/*border-bottom:1px solid #6b9fec;*/\n\tpadding: 1px;\n}\n\n.dojoMenuBar2 .dojoMenuItem2 {\n\twhite-space: nowrap;\n\tfont: menu;\n\tmargin: 0;\n\tposition: relative;\n\tvertical-align: middle;\n\tz-index: 1;\n\tpadding: 3px 8px;\n\tdisplay: inline;/* needed in khtml to display correctly */\n\tdisplay: -moz-inline-box;/* needed in firefox */\n\tcursor:pointer;\n\tcursor:hand;\n}\n\n.dojoMenuBar2 .dojoMenuItem2Hover {\n\tbackground-color:#d2e4fd;\n}\n\n.dojoMenuBar2 .dojoMenuItem2Disabled span {\n\tcolor: #4f6582;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/Menu2.css"), submenuDelay:500, initialize:function (args, frag) {
if (this.eventNaming == "default") {
for (var eventName in this.eventNames) {
this.eventNames[eventName] = this.widgetId + "/" + eventName;
}
}
}, _moveToNext:function (evt) {
this._highlightOption(1);
return true;
}, _moveToPrevious:function (evt) {
this._highlightOption(-1);
return true;
}, _moveToParentMenu:function (evt) {
if (this._highlighted_option && this.parentMenu) {
if (evt._menu2UpKeyProcessed) {
return true;
} else {
this._highlighted_option.onUnhover();
this.closeSubmenu();
evt._menu2UpKeyProcessed = true;
}
}
return false;
}, _moveToChildMenu:function (evt) {
if (this._highlighted_option && this._highlighted_option.submenuId) {
this._highlighted_option._onClick(true);
return true;
}
return false;
}, _selectCurrentItem:function (evt) {
if (this._highlighted_option) {
this._highlighted_option._onClick();
return true;
}
return false;
}, processKey:function (evt) {
if (evt.ctrlKey || evt.altKey || !evt.key) {
return false;
}
var rval = false;
switch (evt.key) {
case evt.KEY_DOWN_ARROW:
rval = this._moveToNext(evt);
break;
case evt.KEY_UP_ARROW:
rval = this._moveToPrevious(evt);
break;
case evt.KEY_RIGHT_ARROW:
rval = this._moveToChildMenu(evt);
break;
case evt.KEY_LEFT_ARROW:
rval = this._moveToParentMenu(evt);
break;
case " ":
case evt.KEY_ENTER:
if (rval = this._selectCurrentItem(evt)) {
break;
}
case evt.KEY_ESCAPE:
case evt.KEY_TAB:
this.close(true);
rval = true;
break;
}
return rval;
}, _findValidItem:function (dir, curItem) {
if (curItem) {
curItem = dir > 0 ? curItem.getNextSibling() : curItem.getPreviousSibling();
}
for (var i = 0; i < this.children.length; ++i) {
if (!curItem) {
curItem = dir > 0 ? this.children[0] : this.children[this.children.length - 1];
}
if (curItem.onHover && curItem.isShowing()) {
return curItem;
}
curItem = dir > 0 ? curItem.getNextSibling() : curItem.getPreviousSibling();
}
}, _highlightOption:function (dir) {
var item;
if ((!this._highlighted_option)) {
item = this._findValidItem(dir);
} else {
item = this._findValidItem(dir, this._highlighted_option);
}
if (item) {
if (this._highlighted_option) {
this._highlighted_option.onUnhover();
}
item.onHover();
dojo.html.scrollIntoView(item.domNode);
try {
var node = dojo.html.getElementsByClass("dojoMenuItem2Label", item.domNode)[0];
node.focus();
}
catch (e) {
}
}
}, onItemClick:function (item) {
}, closeSubmenu:function (force) {
if (this.currentSubmenu == null) {
return;
}
this.currentSubmenu.close(force);
this.currentSubmenu = null;
this.currentSubmenuTrigger.is_open = false;
this.currentSubmenuTrigger._closedSubmenu(force);
this.currentSubmenuTrigger = null;
}});
dojo.widget.defineWidget("dojo.widget.PopupMenu2", [dojo.widget.HtmlWidget, dojo.widget.PopupContainerBase, dojo.widget.MenuBase], function () {
this.targetNodeIds = [];
}, {templateString:"<table class=\"dojoPopupMenu2\" border=0 cellspacing=0 cellpadding=0 style=\"display: none; position: absolute;\">" + "<tbody dojoAttachPoint=\"containerNode\"></tbody>" + "</table>", submenuOverlap:5, contextMenuForWindow:false, parentMenu:null, postCreate:function () {
if (this.contextMenuForWindow) {
var doc = dojo.body();
this.bindDomNode(doc);
} else {
if (this.targetNodeIds.length > 0) {
dojo.lang.forEach(this.targetNodeIds, this.bindDomNode, this);
}
}
this._subscribeSubitemsOnOpen();
}, _subscribeSubitemsOnOpen:function () {
var subItems = this.getChildrenOfType(dojo.widget.MenuItem2);
for (var i = 0; i < subItems.length; i++) {
dojo.event.topic.subscribe(this.eventNames.open, subItems[i], "menuOpen");
}
}, getTopOpenEvent:function () {
var menu = this;
while (menu.parentMenu) {
menu = menu.parentMenu;
}
return menu.openEvent;
}, bindDomNode:function (node) {
node = dojo.byId(node);
var win = dojo.html.getElementWindow(node);
if (dojo.html.isTag(node, "iframe") == "iframe") {
win = dojo.html.iframeContentWindow(node);
node = dojo.withGlobal(win, dojo.body);
}
dojo.widget.Menu2.OperaAndKonqFixer.fixNode(node);
dojo.event.kwConnect({srcObj:node, srcFunc:"oncontextmenu", targetObj:this, targetFunc:"onOpen", once:true});
if (dojo.render.html.moz && win.document.designMode.toLowerCase() == "on") {
dojo.event.browser.addListener(node, "contextmenu", dojo.lang.hitch(this, "onOpen"));
}
dojo.widget.PopupManager.registerWin(win);
}, unBindDomNode:function (nodeName) {
var node = dojo.byId(nodeName);
dojo.event.kwDisconnect({srcObj:node, srcFunc:"oncontextmenu", targetObj:this, targetFunc:"onOpen", once:true});
dojo.widget.Menu2.OperaAndKonqFixer.cleanNode(node);
}, _openAsSubmenu:function (parent, explodeSrc, orient) {
if (this.isShowingNow) {
return;
}
this.parentMenu = parent;
this.open(explodeSrc, parent, explodeSrc, orient);
}, close:function (force) {
if (this.animationInProgress) {
dojo.widget.PopupContainerBase.prototype.close.call(this, force);
return;
}
if (this._highlighted_option) {
this._highlighted_option.onUnhover();
}
dojo.widget.PopupContainerBase.prototype.close.call(this, force);
this.parentMenu = null;
}, closeAll:function (force) {
if (this.parentMenu) {
this.parentMenu.closeAll(force);
} else {
this.close(force);
}
}, _openSubmenu:function (submenu, from_item) {
submenu._openAsSubmenu(this, from_item.arrow, {"TR":"TL", "TL":"TR"});
this.currentSubmenu = submenu;
this.currentSubmenuTrigger = from_item;
this.currentSubmenuTrigger.is_open = true;
}, focus:function () {
if (this.currentSubmenuTrigger) {
if (this.currentSubmenuTrigger.caption) {
try {
this.currentSubmenuTrigger.caption.focus();
}
catch (e) {
}
} else {
try {
this.currentSubmenuTrigger.domNode.focus();
}
catch (e) {
}
}
}
}, onOpen:function (e) {
this.openEvent = e;
if (e["target"]) {
this.openedForWindow = dojo.html.getElementWindow(e.target);
} else {
this.openedForWindow = null;
}
var x = e.pageX, y = e.pageY;
var win = dojo.html.getElementWindow(e.target);
var iframe = win._frameElement || win.frameElement;
if (iframe) {
var cood = dojo.html.abs(iframe, true);
x += cood.x - dojo.withGlobal(win, dojo.html.getScroll).left;
y += cood.y - dojo.withGlobal(win, dojo.html.getScroll).top;
}
this.open(x, y, null, [x, y]);
dojo.event.browser.stopEvent(e);
}});
dojo.widget.defineWidget("dojo.widget.MenuItem2", dojo.widget.HtmlWidget, function () {
this.eventNames = {engage:""};
}, {templateString:"<tr class=\"dojoMenuItem2\" dojoAttachEvent=\"onMouseOver: onHover; onMouseOut: onUnhover; onClick: _onClick; onKey:onKey;\">" + "<td><div class=\"${this.iconClass}\" style=\"${this.iconStyle}\"></div></td>" + "<td tabIndex=\"-1\" class=\"dojoMenuItem2Label\" dojoAttachPoint=\"caption\">${this.caption}</td>" + "<td class=\"dojoMenuItem2Accel\">${this.accelKey}</td>" + "<td><div class=\"dojoMenuItem2Submenu\" style=\"display:${this.arrowDisplay};\" dojoAttachPoint=\"arrow\"></div></td>" + "</tr>", is_hovering:false, hover_timer:null, is_open:false, topPosition:0, caption:"Untitled", accelKey:"", iconSrc:"", disabledClass:"dojoMenuItem2Disabled", iconClass:"dojoMenuItem2Icon", submenuId:"", eventNaming:"default", highlightClass:"dojoMenuItem2Hover", postMixInProperties:function () {
this.iconStyle = "";
if (this.iconSrc) {
if ((this.iconSrc.toLowerCase().substring(this.iconSrc.length - 4) == ".png") && (dojo.render.html.ie55 || dojo.render.html.ie60)) {
this.iconStyle = "filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.iconSrc + "', sizingMethod='image')";
} else {
this.iconStyle = "background-image: url(" + this.iconSrc + ")";
}
}
this.arrowDisplay = this.submenuId ? "block" : "none";
dojo.widget.MenuItem2.superclass.postMixInProperties.apply(this, arguments);
}, fillInTemplate:function () {
dojo.html.disableSelection(this.domNode);
if (this.disabled) {
this.setDisabled(true);
}
if (this.eventNaming == "default") {
for (var eventName in this.eventNames) {
this.eventNames[eventName] = this.widgetId + "/" + eventName;
}
}
}, onHover:function () {
this.onUnhover();
if (this.is_hovering) {
return;
}
if (this.is_open) {
return;
}
if (this.parent._highlighted_option) {
this.parent._highlighted_option.onUnhover();
}
this.parent.closeSubmenu();
this.parent._highlighted_option = this;
dojo.widget.PopupManager.setFocusedMenu(this.parent);
this._highlightItem();
if (this.is_hovering) {
this._stopSubmenuTimer();
}
this.is_hovering = true;
this._startSubmenuTimer();
}, onUnhover:function () {
if (!this.is_open) {
this._unhighlightItem();
}
this.is_hovering = false;
this.parent._highlighted_option = null;
if (this.parent.parentMenu) {
dojo.widget.PopupManager.setFocusedMenu(this.parent.parentMenu);
}
this._stopSubmenuTimer();
}, _onClick:function (focus) {
var displayingSubMenu = false;
if (this.disabled) {
return false;
}
if (this.submenuId) {
if (!this.is_open) {
this._stopSubmenuTimer();
this._openSubmenu();
}
displayingSubMenu = true;
} else {
this.onUnhover();
this.parent.closeAll(true);
}
this.onClick();
dojo.event.topic.publish(this.eventNames.engage, this);
if (displayingSubMenu && focus) {
dojo.widget.getWidgetById(this.submenuId)._highlightOption(1);
}
return;
}, onClick:function () {
this.parent.onItemClick(this);
}, _highlightItem:function () {
dojo.html.addClass(this.domNode, this.highlightClass);
}, _unhighlightItem:function () {
dojo.html.removeClass(this.domNode, this.highlightClass);
}, _startSubmenuTimer:function () {
this._stopSubmenuTimer();
if (this.disabled) {
return;
}
var self = this;
var closure = function () {
return function () {
self._openSubmenu();
};
}();
this.hover_timer = dojo.lang.setTimeout(closure, this.parent.submenuDelay);
}, _stopSubmenuTimer:function () {
if (this.hover_timer) {
dojo.lang.clearTimeout(this.hover_timer);
this.hover_timer = null;
}
}, _openSubmenu:function () {
if (this.disabled) {
return;
}
this.parent.closeSubmenu();
var submenu = dojo.widget.getWidgetById(this.submenuId);
if (submenu) {
this.parent._openSubmenu(submenu, this);
}
}, _closedSubmenu:function () {
this.onUnhover();
}, setDisabled:function (value) {
this.disabled = value;
if (this.disabled) {
dojo.html.addClass(this.domNode, this.disabledClass);
} else {
dojo.html.removeClass(this.domNode, this.disabledClass);
}
}, enable:function () {
this.setDisabled(false);
}, disable:function () {
this.setDisabled(true);
}, menuOpen:function (message) {
}});
dojo.widget.defineWidget("dojo.widget.MenuSeparator2", dojo.widget.HtmlWidget, {templateString:"<tr class=\"dojoMenuSeparator2\"><td colspan=4>" + "<div class=\"dojoMenuSeparator2Top\"></div>" + "<div class=\"dojoMenuSeparator2Bottom\"></div>" + "</td></tr>", postCreate:function () {
dojo.html.disableSelection(this.domNode);
}});
dojo.widget.defineWidget("dojo.widget.MenuBar2", [dojo.widget.HtmlWidget, dojo.widget.MenuBase], {menuOverlap:2, templateString:"<div class=\"dojoMenuBar2\" dojoAttachPoint=\"containerNode\" tabIndex=\"0\"></div>", close:function (force) {
if (this._highlighted_option) {
this._highlighted_option.onUnhover();
}
this.closeSubmenu(force);
}, closeAll:function (force) {
this.close(force);
}, processKey:function (evt) {
if (evt.ctrlKey || evt.altKey) {
return false;
}
var rval = false;
switch (evt.key) {
case evt.KEY_DOWN_ARROW:
rval = this._moveToChildMenu(evt);
break;
case evt.KEY_UP_ARROW:
rval = this._moveToParentMenu(evt);
break;
case evt.KEY_RIGHT_ARROW:
rval = this._moveToNext(evt);
break;
case evt.KEY_LEFT_ARROW:
rval = this._moveToPrevious(evt);
break;
default:
rval = dojo.widget.MenuBar2.superclass.processKey.apply(this, arguments);
break;
}
return rval;
}, postCreate:function () {
dojo.widget.MenuBar2.superclass.postCreate.apply(this, arguments);
this.isShowingNow = true;
}, _openSubmenu:function (submenu, from_item) {
submenu._openAsSubmenu(this, from_item.domNode, {"BL":"TL", "TL":"BL"});
this.currentSubmenu = submenu;
this.currentSubmenuTrigger = from_item;
this.currentSubmenuTrigger.is_open = true;
}});
dojo.widget.defineWidget("dojo.widget.MenuBarItem2", dojo.widget.MenuItem2, {templateString:"<span class=\"dojoMenuItem2\" dojoAttachEvent=\"onMouseOver: onHover; onMouseOut: onUnhover; onClick: _onClick;\">${this.caption}</span>"});
dojo.widget.Menu2.OperaAndKonqFixer = new function () {
var implement = true;
var delfunc = false;
if (!dojo.lang.isFunction(dojo.doc().oncontextmenu)) {
dojo.doc().oncontextmenu = function () {
implement = false;
delfunc = true;
};
}
if (dojo.doc().createEvent) {
try {
var e = dojo.doc().createEvent("MouseEvents");
e.initMouseEvent("contextmenu", 1, 1, dojo.global(), 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, null);
dojo.doc().dispatchEvent(e);
}
catch (e) {
}
} else {
implement = false;
}
if (delfunc) {
delete dojo.doc().oncontextmenu;
}
this.fixNode = function (node) {
if (implement) {
if (!dojo.lang.isFunction(node.oncontextmenu)) {
node.oncontextmenu = function (e) {
};
}
if (dojo.render.html.opera) {
node._menufixer_opera = function (e) {
if (e.ctrlKey) {
this.oncontextmenu(e);
}
};
dojo.event.connect(node, "onclick", node, "_menufixer_opera");
} else {
node._menufixer_konq = function (e) {
if (e.button == 2) {
e.preventDefault();
this.oncontextmenu(e);
}
};
dojo.event.connect(node, "onmousedown", node, "_menufixer_konq");
}
}
};
this.cleanNode = function (node) {
if (implement) {
if (node._menufixer_opera) {
dojo.event.disconnect(node, "onclick", node, "_menufixer_opera");
delete node._menufixer_opera;
} else {
if (node._menufixer_konq) {
dojo.event.disconnect(node, "onmousedown", node, "_menufixer_konq");
delete node._menufixer_konq;
}
}
if (node.oncontextmenu) {
delete node.oncontextmenu;
}
}
};
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/AnimatedPng.js
New file
0,0 → 1,45
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.AnimatedPng");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.widget.defineWidget("dojo.widget.AnimatedPng", dojo.widget.HtmlWidget, {isContainer:false, width:0, height:0, aniSrc:"", interval:100, _blankSrc:dojo.uri.moduleUri("dojo.widget", "templates/images/blank.gif"), templateString:"<img class=\"dojoAnimatedPng\" />", postCreate:function () {
this.cellWidth = this.width;
this.cellHeight = this.height;
var img = new Image();
var self = this;
img.onload = function () {
self._initAni(img.width, img.height);
};
img.src = this.aniSrc;
}, _initAni:function (w, h) {
this.domNode.src = this._blankSrc;
this.domNode.width = this.cellWidth;
this.domNode.height = this.cellHeight;
this.domNode.style.backgroundImage = "url(" + this.aniSrc + ")";
this.domNode.style.backgroundRepeat = "no-repeat";
this.aniCols = Math.floor(w / this.cellWidth);
this.aniRows = Math.floor(h / this.cellHeight);
this.aniCells = this.aniCols * this.aniRows;
this.aniFrame = 0;
window.setInterval(dojo.lang.hitch(this, "_tick"), this.interval);
}, _tick:function () {
this.aniFrame++;
if (this.aniFrame == this.aniCells) {
this.aniFrame = 0;
}
var col = this.aniFrame % this.aniCols;
var row = Math.floor(this.aniFrame / this.aniCols);
var bx = -1 * col * this.cellWidth;
var by = -1 * row * this.cellHeight;
this.domNode.style.backgroundPosition = bx + "px " + by + "px";
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/__package__.js
New file
0,0 → 1,13
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.kwCompoundRequire({common:["dojo.xml.Parse", "dojo.widget.Widget", "dojo.widget.Parse", "dojo.widget.Manager"], browser:["dojo.widget.DomWidget", "dojo.widget.HtmlWidget"], dashboard:["dojo.widget.DomWidget", "dojo.widget.HtmlWidget"], svg:["dojo.widget.SvgWidget"], rhino:["dojo.widget.SwtWidget"]});
dojo.provide("dojo.widget.*");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/TreeContextMenu.js
New file
0,0 → 1,108
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeContextMenu");
dojo.require("dojo.event.*");
dojo.require("dojo.io.*");
dojo.require("dojo.widget.Menu2");
dojo.widget.defineWidget("dojo.widget.TreeContextMenu", dojo.widget.PopupMenu2, function () {
this.listenedTrees = [];
}, {open:function (x, y, parentMenu, explodeSrc) {
var result = dojo.widget.PopupMenu2.prototype.open.apply(this, arguments);
dojo.event.topic.publish(this.eventNames.open, {menu:this});
return result;
}, listenTree:function (tree) {
var nodes = tree.getDescendants();
for (var i = 0; i < nodes.length; i++) {
if (!nodes[i].isTreeNode) {
continue;
}
this.bindDomNode(nodes[i].labelNode);
}
var _this = this;
dojo.event.topic.subscribe(tree.eventNames.createDOMNode, this, "onCreateDOMNode");
dojo.event.topic.subscribe(tree.eventNames.moveFrom, this, "onMoveFrom");
dojo.event.topic.subscribe(tree.eventNames.moveTo, this, "onMoveTo");
dojo.event.topic.subscribe(tree.eventNames.removeNode, this, "onRemoveNode");
dojo.event.topic.subscribe(tree.eventNames.addChild, this, "onAddChild");
dojo.event.topic.subscribe(tree.eventNames.treeDestroy, this, "onTreeDestroy");
this.listenedTrees.push(tree);
}, unlistenTree:function (tree) {
dojo.event.topic.unsubscribe(tree.eventNames.createDOMNode, this, "onCreateDOMNode");
dojo.event.topic.unsubscribe(tree.eventNames.moveFrom, this, "onMoveFrom");
dojo.event.topic.unsubscribe(tree.eventNames.moveTo, this, "onMoveTo");
dojo.event.topic.unsubscribe(tree.eventNames.removeNode, this, "onRemoveNode");
dojo.event.topic.unsubscribe(tree.eventNames.addChild, this, "onAddChild");
dojo.event.topic.unsubscribe(tree.eventNames.treeDestroy, this, "onTreeDestroy");
for (var i = 0; i < this.listenedTrees.length; i++) {
if (this.listenedTrees[i] === tree) {
this.listenedTrees.splice(i, 1);
break;
}
}
}, onTreeDestroy:function (message) {
this.unlistenTree(message.source);
}, bindTreeNode:function (node) {
var _this = this;
dojo.lang.forEach(node.getDescendants(), function (e) {
_this.bindDomNode(e.labelNode);
});
}, unBindTreeNode:function (node) {
var _this = this;
dojo.lang.forEach(node.getDescendants(), function (e) {
_this.unBindDomNode(e.labelNode);
});
}, onCreateDOMNode:function (message) {
this.bindTreeNode(message.source);
}, onMoveFrom:function (message) {
if (!dojo.lang.inArray(this.listenedTrees, message.newTree)) {
this.unBindTreeNode(message.child);
}
}, onMoveTo:function (message) {
if (dojo.lang.inArray(this.listenedTrees, message.newTree)) {
this.bindTreeNode(message.child);
}
}, onRemoveNode:function (message) {
this.unBindTreeNode(message.child);
}, onAddChild:function (message) {
if (message.domNodeInitialized) {
this.bindTreeNode(message.child);
}
}});
dojo.widget.defineWidget("dojo.widget.TreeMenuItem", dojo.widget.MenuItem2, {treeActions:"", initialize:function (args, frag) {
this.treeActions = this.treeActions.split(",");
for (var i = 0; i < this.treeActions.length; i++) {
this.treeActions[i] = this.treeActions[i].toUpperCase();
}
}, getTreeNode:function () {
var menu = this;
while (!(menu instanceof dojo.widget.TreeContextMenu)) {
menu = menu.parent;
}
var source = menu.getTopOpenEvent().target;
while (!source.getAttribute("treeNode") && source.tagName != "body") {
source = source.parentNode;
}
if (source.tagName == "body") {
dojo.raise("treeNode not detected");
}
var treeNode = dojo.widget.manager.getWidgetById(source.getAttribute("treeNode"));
return treeNode;
}, menuOpen:function (message) {
var treeNode = this.getTreeNode();
this.setDisabled(false);
var _this = this;
dojo.lang.forEach(_this.treeActions, function (action) {
_this.setDisabled(treeNode.actionIsDisabled(action));
});
}, toString:function () {
return "[" + this.widgetType + " node " + this.getTreeNode() + "]";
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Textbox.js
New file
0,0 → 1,50
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Textbox");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.Manager");
dojo.require("dojo.widget.Parse");
dojo.require("dojo.xml.Parse");
dojo.require("dojo.lang.array");
dojo.require("dojo.lang.common");
dojo.require("dojo.i18n.common");
dojo.requireLocalization("dojo.widget", "validate", null, "fr,ja,zh-cn,ROOT");
dojo.widget.defineWidget("dojo.widget.Textbox", dojo.widget.HtmlWidget, {className:"", name:"", value:"", type:"", trim:false, uppercase:false, lowercase:false, ucFirst:false, digit:false, htmlfloat:"none", templateString:"<span style='float:${this.htmlfloat};'>\n\t<input dojoAttachPoint='textbox' dojoAttachEvent='onblur;onfocus'\n\t\tid='${this.widgetId}' name='${this.name}'\n\t\tclass='${this.className}' type='${this.type}' >\n</span>\n", textbox:null, fillInTemplate:function () {
this.textbox.value = this.value;
}, filter:function () {
if (this.trim) {
this.textbox.value = this.textbox.value.replace(/(^\s*|\s*$)/g, "");
}
if (this.uppercase) {
this.textbox.value = this.textbox.value.toUpperCase();
}
if (this.lowercase) {
this.textbox.value = this.textbox.value.toLowerCase();
}
if (this.ucFirst) {
this.textbox.value = this.textbox.value.replace(/\b\w+\b/g, function (word) {
return word.substring(0, 1).toUpperCase() + word.substring(1).toLowerCase();
});
}
if (this.digit) {
this.textbox.value = this.textbox.value.replace(/\D/g, "");
}
}, onfocus:function () {
}, onblur:function () {
this.filter();
}, mixInProperties:function (localProperties, frag) {
dojo.widget.Textbox.superclass.mixInProperties.apply(this, arguments);
if (localProperties["class"]) {
this.className = localProperties["class"];
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/TreeToggleOnSelect.js
New file
0,0 → 1,21
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeToggleOnSelect");
dojo.require("dojo.widget.HtmlWidget");
dojo.widget.defineWidget("dojo.widget.TreeToggleOnSelect", dojo.widget.HtmlWidget, {selector:"", controller:"", selectEvent:"select", initialize:function () {
this.selector = dojo.widget.byId(this.selector);
this.controller = dojo.widget.byId(this.controller);
dojo.event.topic.subscribe(this.selector.eventNames[this.selectEvent], this, "onSelectEvent");
}, onSelectEvent:function (message) {
var node = message.node;
node.isExpanded ? this.controller.collapse(node) : this.controller.expand(node);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/AccordionContainer.js
New file
0,0 → 1,126
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.AccordionContainer");
dojo.require("dojo.widget.*");
dojo.require("dojo.html.*");
dojo.require("dojo.lfx.html");
dojo.require("dojo.html.selection");
dojo.require("dojo.widget.html.layout");
dojo.require("dojo.widget.PageContainer");
dojo.widget.defineWidget("dojo.widget.AccordionContainer", dojo.widget.HtmlWidget, {isContainer:true, labelNodeClass:"label", containerNodeClass:"accBody", duration:250, fillInTemplate:function () {
with (this.domNode.style) {
if (position != "absolute") {
position = "relative";
}
overflow = "hidden";
}
}, addChild:function (widget) {
var child = this._addChild(widget);
this._setSizes();
return child;
}, _addChild:function (widget) {
if (widget.open) {
dojo.deprecated("open parameter deprecated, use 'selected=true' instead will be removed in ", "0.5");
dojo.debug(widget.widgetId + ": open == " + widget.open);
widget.selected = true;
}
if (widget.widgetType != "AccordionPane") {
var wrapper = dojo.widget.createWidget("AccordionPane", {label:widget.label, selected:widget.selected, labelNodeClass:this.labelNodeClass, containerNodeClass:this.containerNodeClass, allowCollapse:this.allowCollapse});
wrapper.addChild(widget);
this.addWidgetAsDirectChild(wrapper);
this.registerChild(wrapper, this.children.length);
return wrapper;
} else {
dojo.html.addClass(widget.containerNode, this.containerNodeClass);
dojo.html.addClass(widget.labelNode, this.labelNodeClass);
this.addWidgetAsDirectChild(widget);
this.registerChild(widget, this.children.length);
return widget;
}
}, postCreate:function () {
var tmpChildren = this.children;
this.children = [];
dojo.html.removeChildren(this.domNode);
dojo.lang.forEach(tmpChildren, dojo.lang.hitch(this, "_addChild"));
this._setSizes();
}, removeChild:function (widget) {
dojo.widget.AccordionContainer.superclass.removeChild.call(this, widget);
this._setSizes();
}, onResized:function () {
this._setSizes();
}, _setSizes:function () {
var totalCollapsedHeight = 0;
var openIdx = 0;
dojo.lang.forEach(this.children, function (child, idx) {
totalCollapsedHeight += child.getLabelHeight();
if (child.selected) {
openIdx = idx;
}
});
var mySize = dojo.html.getContentBox(this.domNode);
var y = 0;
dojo.lang.forEach(this.children, function (child, idx) {
var childCollapsedHeight = child.getLabelHeight();
child.resizeTo(mySize.width, mySize.height - totalCollapsedHeight + childCollapsedHeight);
child.domNode.style.zIndex = idx + 1;
child.domNode.style.position = "absolute";
child.domNode.style.top = y + "px";
y += (idx == openIdx) ? dojo.html.getBorderBox(child.domNode).height : childCollapsedHeight;
});
}, selectChild:function (page) {
dojo.lang.forEach(this.children, function (child) {
child.setSelected(child == page);
});
var y = 0;
var anims = [];
dojo.lang.forEach(this.children, function (child, idx) {
if (child.domNode.style.top != (y + "px")) {
anims.push(dojo.lfx.html.slideTo(child.domNode, {top:y, left:0}, this.duration));
}
y += child.selected ? dojo.html.getBorderBox(child.domNode).height : child.getLabelHeight();
}, this);
dojo.lfx.combine(anims).play();
}});
dojo.widget.defineWidget("dojo.widget.AccordionPane", dojo.widget.HtmlWidget, {label:"", "class":"dojoAccordionPane", labelNodeClass:"label", containerNodeClass:"accBody", selected:false, templateString:"<div dojoAttachPoint=\"domNode\">\n<div dojoAttachPoint=\"labelNode\" dojoAttachEvent=\"onclick: onLabelClick\" class=\"${this.labelNodeClass}\">${this.label}</div>\n<div dojoAttachPoint=\"containerNode\" style=\"overflow: hidden;\" class=\"${this.containerNodeClass}\"></div>\n</div>\n", templateCssString:".dojoAccordionPane .label {\n\tcolor: #000;\n\tfont-weight: bold;\n\tbackground: url(\"images/soriaAccordionOff.gif\") repeat-x top left #85aeec;\n\tborder:1px solid #d9d9d9;\n\tfont-size:0.9em;\n}\n\n.dojoAccordionPane-selected .label {\n\tbackground: url(\"images/soriaAccordionSelected.gif\") repeat-x top left #85aeec;\n\tborder:1px solid #84a3d1;\n}\n\n.dojoAccordionPane .label:hover {\n\tcursor: pointer;\n}\n\n.dojoAccordionPane .accBody {\n\tbackground: #fff;\n\toverflow: auto;\n\tborder:1px solid #84a3d1;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/AccordionPane.css"), isContainer:true, fillInTemplate:function () {
dojo.html.addClass(this.domNode, this["class"]);
dojo.widget.AccordionPane.superclass.fillInTemplate.call(this);
dojo.html.disableSelection(this.labelNode);
this.setSelected(this.selected);
}, setLabel:function (label) {
this.labelNode.innerHTML = label;
}, resizeTo:function (width, height) {
dojo.html.setMarginBox(this.domNode, {width:width, height:height});
var children = [{domNode:this.labelNode, layoutAlign:"top"}, {domNode:this.containerNode, layoutAlign:"client"}];
dojo.widget.html.layout(this.domNode, children);
var childSize = dojo.html.getContentBox(this.containerNode);
this.children[0].resizeTo(childSize.width, childSize.height);
}, getLabelHeight:function () {
return dojo.html.getMarginBox(this.labelNode).height;
}, onLabelClick:function () {
this.parent.selectChild(this);
}, setSelected:function (isSelected) {
this.selected = isSelected;
(isSelected ? dojo.html.addClass : dojo.html.removeClass)(this.domNode, this["class"] + "-selected");
var child = this.children[0];
if (child) {
if (isSelected) {
if (!child.isShowing()) {
child.show();
} else {
child.onShow();
}
} else {
child.onHide();
}
}
}});
dojo.lang.extend(dojo.widget.Widget, {open:false});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/TreeBasicController.js
New file
0,0 → 1,152
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeBasicController");
dojo.require("dojo.event.*");
dojo.require("dojo.json");
dojo.require("dojo.io.*");
dojo.widget.defineWidget("dojo.widget.TreeBasicController", dojo.widget.HtmlWidget, {widgetType:"TreeBasicController", DNDController:"", dieWithTree:false, initialize:function (args, frag) {
if (this.DNDController == "create") {
dojo.require("dojo.dnd.TreeDragAndDrop");
this.DNDController = new dojo.dnd.TreeDNDController(this);
}
}, listenTree:function (tree) {
dojo.event.topic.subscribe(tree.eventNames.createDOMNode, this, "onCreateDOMNode");
dojo.event.topic.subscribe(tree.eventNames.treeClick, this, "onTreeClick");
dojo.event.topic.subscribe(tree.eventNames.treeCreate, this, "onTreeCreate");
dojo.event.topic.subscribe(tree.eventNames.treeDestroy, this, "onTreeDestroy");
if (this.DNDController) {
this.DNDController.listenTree(tree);
}
}, unlistenTree:function (tree) {
dojo.event.topic.unsubscribe(tree.eventNames.createDOMNode, this, "onCreateDOMNode");
dojo.event.topic.unsubscribe(tree.eventNames.treeClick, this, "onTreeClick");
dojo.event.topic.unsubscribe(tree.eventNames.treeCreate, this, "onTreeCreate");
dojo.event.topic.unsubscribe(tree.eventNames.treeDestroy, this, "onTreeDestroy");
}, onTreeDestroy:function (message) {
var tree = message.source;
this.unlistenTree(tree);
if (this.dieWithTree) {
this.destroy();
}
}, onCreateDOMNode:function (message) {
var node = message.source;
if (node.expandLevel > 0) {
this.expandToLevel(node, node.expandLevel);
}
}, onTreeCreate:function (message) {
var tree = message.source;
var _this = this;
if (tree.expandLevel) {
dojo.lang.forEach(tree.children, function (child) {
_this.expandToLevel(child, tree.expandLevel - 1);
});
}
}, expandToLevel:function (node, level) {
if (level == 0) {
return;
}
var children = node.children;
var _this = this;
var handler = function (node, expandLevel) {
this.node = node;
this.expandLevel = expandLevel;
this.process = function () {
for (var i = 0; i < this.node.children.length; i++) {
var child = node.children[i];
_this.expandToLevel(child, this.expandLevel);
}
};
};
var h = new handler(node, level - 1);
this.expand(node, false, h, h.process);
}, onTreeClick:function (message) {
var node = message.source;
if (node.isLocked()) {
return false;
}
if (node.isExpanded) {
this.collapse(node);
} else {
this.expand(node);
}
}, expand:function (node, sync, callObj, callFunc) {
node.expand();
if (callFunc) {
callFunc.apply(callObj, [node]);
}
}, collapse:function (node) {
node.collapse();
}, canMove:function (child, newParent) {
if (child.actionIsDisabled(child.actions.MOVE)) {
return false;
}
if (child.parent !== newParent && newParent.actionIsDisabled(newParent.actions.ADDCHILD)) {
return false;
}
var node = newParent;
while (node.isTreeNode) {
if (node === child) {
return false;
}
node = node.parent;
}
return true;
}, move:function (child, newParent, index) {
if (!this.canMove(child, newParent)) {
return false;
}
var result = this.doMove(child, newParent, index);
if (!result) {
return result;
}
if (newParent.isTreeNode) {
this.expand(newParent);
}
return result;
}, doMove:function (child, newParent, index) {
child.tree.move(child, newParent, index);
return true;
}, canRemoveNode:function (child) {
if (child.actionIsDisabled(child.actions.REMOVE)) {
return false;
}
return true;
}, removeNode:function (node, callObj, callFunc) {
if (!this.canRemoveNode(node)) {
return false;
}
return this.doRemoveNode(node, callObj, callFunc);
}, doRemoveNode:function (node, callObj, callFunc) {
node.tree.removeNode(node);
if (callFunc) {
callFunc.apply(dojo.lang.isUndefined(callObj) ? this : callObj, [node]);
}
}, canCreateChild:function (parent, index, data) {
if (parent.actionIsDisabled(parent.actions.ADDCHILD)) {
return false;
}
return true;
}, createChild:function (parent, index, data, callObj, callFunc) {
if (!this.canCreateChild(parent, index, data)) {
return false;
}
return this.doCreateChild.apply(this, arguments);
}, doCreateChild:function (parent, index, data, callObj, callFunc) {
var widgetType = data.widgetType ? data.widgetType : "TreeNode";
var newChild = dojo.widget.createWidget(widgetType, data);
parent.addChild(newChild, index);
this.expand(parent);
if (callFunc) {
callFunc.apply(callObj, [newChild]);
}
return newChild;
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/Editor2.js
New file
0,0 → 1,410
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.Editor2");
dojo.require("dojo.io.*");
dojo.require("dojo.widget.RichText");
dojo.require("dojo.widget.Editor2Toolbar");
dojo.require("dojo.uri.cache");
dojo.widget.Editor2Manager = new dojo.widget.HandlerManager;
dojo.lang.mixin(dojo.widget.Editor2Manager, {_currentInstance:null, commandState:{Disabled:0, Latched:1, Enabled:2}, getCurrentInstance:function () {
return this._currentInstance;
}, setCurrentInstance:function (inst) {
this._currentInstance = inst;
}, getCommand:function (editor, name) {
var oCommand;
name = name.toLowerCase();
for (var i = 0; i < this._registeredHandlers.length; i++) {
oCommand = this._registeredHandlers[i](editor, name);
if (oCommand) {
return oCommand;
}
}
switch (name) {
case "htmltoggle":
oCommand = new dojo.widget.Editor2BrowserCommand(editor, name);
break;
case "formatblock":
oCommand = new dojo.widget.Editor2FormatBlockCommand(editor, name);
break;
case "anchor":
oCommand = new dojo.widget.Editor2Command(editor, name);
break;
case "createlink":
oCommand = new dojo.widget.Editor2DialogCommand(editor, name, {contentFile:"dojo.widget.Editor2Plugin.CreateLinkDialog", contentClass:"Editor2CreateLinkDialog", title:"Insert/Edit Link", width:"300px", height:"200px"});
break;
case "insertimage":
oCommand = new dojo.widget.Editor2DialogCommand(editor, name, {contentFile:"dojo.widget.Editor2Plugin.InsertImageDialog", contentClass:"Editor2InsertImageDialog", title:"Insert/Edit Image", width:"400px", height:"270px"});
break;
default:
var curtInst = this.getCurrentInstance();
if ((curtInst && curtInst.queryCommandAvailable(name)) || (!curtInst && dojo.widget.Editor2.prototype.queryCommandAvailable(name))) {
oCommand = new dojo.widget.Editor2BrowserCommand(editor, name);
} else {
dojo.debug("dojo.widget.Editor2Manager.getCommand: Unknown command " + name);
return;
}
}
return oCommand;
}, destroy:function () {
this._currentInstance = null;
dojo.widget.HandlerManager.prototype.destroy.call(this);
}});
dojo.addOnUnload(dojo.widget.Editor2Manager, "destroy");
dojo.lang.declare("dojo.widget.Editor2Command", null, function (editor, name) {
this._editor = editor;
this._updateTime = 0;
this._name = name;
}, {_text:"Unknown", execute:function (para) {
dojo.unimplemented("dojo.widget.Editor2Command.execute");
}, getText:function () {
return this._text;
}, getState:function () {
return dojo.widget.Editor2Manager.commandState.Enabled;
}, destroy:function () {
}});
dojo.widget.Editor2BrowserCommandNames = {"bold":"Bold", "copy":"Copy", "cut":"Cut", "Delete":"Delete", "indent":"Indent", "inserthorizontalrule":"Horizental Rule", "insertorderedlist":"Numbered List", "insertunorderedlist":"Bullet List", "italic":"Italic", "justifycenter":"Align Center", "justifyfull":"Justify", "justifyleft":"Align Left", "justifyright":"Align Right", "outdent":"Outdent", "paste":"Paste", "redo":"Redo", "removeformat":"Remove Format", "selectall":"Select All", "strikethrough":"Strikethrough", "subscript":"Subscript", "superscript":"Superscript", "underline":"Underline", "undo":"Undo", "unlink":"Remove Link", "createlink":"Create Link", "insertimage":"Insert Image", "htmltoggle":"HTML Source", "forecolor":"Foreground Color", "hilitecolor":"Background Color", "plainformatblock":"Paragraph Style", "formatblock":"Paragraph Style", "fontsize":"Font Size", "fontname":"Font Name"};
dojo.lang.declare("dojo.widget.Editor2BrowserCommand", dojo.widget.Editor2Command, function (editor, name) {
var text = dojo.widget.Editor2BrowserCommandNames[name.toLowerCase()];
if (text) {
this._text = text;
}
}, {execute:function (para) {
this._editor.execCommand(this._name, para);
}, getState:function () {
if (this._editor._lastStateTimestamp > this._updateTime || this._state == undefined) {
this._updateTime = this._editor._lastStateTimestamp;
try {
if (this._editor.queryCommandEnabled(this._name)) {
if (this._editor.queryCommandState(this._name)) {
this._state = dojo.widget.Editor2Manager.commandState.Latched;
} else {
this._state = dojo.widget.Editor2Manager.commandState.Enabled;
}
} else {
this._state = dojo.widget.Editor2Manager.commandState.Disabled;
}
}
catch (e) {
this._state = dojo.widget.Editor2Manager.commandState.Enabled;
}
}
return this._state;
}, getValue:function () {
try {
return this._editor.queryCommandValue(this._name);
}
catch (e) {
}
}});
dojo.lang.declare("dojo.widget.Editor2FormatBlockCommand", dojo.widget.Editor2BrowserCommand, {});
dojo.require("dojo.widget.FloatingPane");
dojo.widget.defineWidget("dojo.widget.Editor2Dialog", [dojo.widget.HtmlWidget, dojo.widget.FloatingPaneBase, dojo.widget.ModalDialogBase], {templateString:"<div id=\"${this.widgetId}\" class=\"dojoFloatingPane\">\n\t<span dojoattachpoint=\"tabStartOuter\" dojoonfocus=\"trapTabs\" dojoonblur=\"clearTrap\"\ttabindex=\"0\"></span>\n\t<span dojoattachpoint=\"tabStart\" dojoonfocus=\"trapTabs\" dojoonblur=\"clearTrap\" tabindex=\"0\"></span>\n\t<div dojoAttachPoint=\"titleBar\" class=\"dojoFloatingPaneTitleBar\" style=\"display:none\">\n\t \t<img dojoAttachPoint=\"titleBarIcon\" class=\"dojoFloatingPaneTitleBarIcon\">\n\t\t<div dojoAttachPoint=\"closeAction\" dojoAttachEvent=\"onClick:hide\"\n \t \t\tclass=\"dojoFloatingPaneCloseIcon\"></div>\n\t\t<div dojoAttachPoint=\"restoreAction\" dojoAttachEvent=\"onClick:restoreWindow\"\n \t \t\tclass=\"dojoFloatingPaneRestoreIcon\"></div>\n\t\t<div dojoAttachPoint=\"maximizeAction\" dojoAttachEvent=\"onClick:maximizeWindow\"\n \t \t\tclass=\"dojoFloatingPaneMaximizeIcon\"></div>\n\t\t<div dojoAttachPoint=\"minimizeAction\" dojoAttachEvent=\"onClick:minimizeWindow\"\n \t \t\tclass=\"dojoFloatingPaneMinimizeIcon\"></div>\n\t \t<div dojoAttachPoint=\"titleBarText\" class=\"dojoFloatingPaneTitleText\">${this.title}</div>\n\t</div>\n\n\t<div id=\"${this.widgetId}_container\" dojoAttachPoint=\"containerNode\" class=\"dojoFloatingPaneClient\"></div>\n\t<span dojoattachpoint=\"tabEnd\" dojoonfocus=\"trapTabs\" dojoonblur=\"clearTrap\" tabindex=\"0\"></span>\n\t<span dojoattachpoint=\"tabEndOuter\" dojoonfocus=\"trapTabs\" dojoonblur=\"clearTrap\" tabindex=\"0\"></span>\n\t<div dojoAttachPoint=\"resizeBar\" class=\"dojoFloatingPaneResizebar\" style=\"display:none\"></div>\n</div>\n", modal:true, width:"", height:"", windowState:"minimized", displayCloseAction:true, contentFile:"", contentClass:"", fillInTemplate:function (args, frag) {
this.fillInFloatingPaneTemplate(args, frag);
dojo.widget.Editor2Dialog.superclass.fillInTemplate.call(this, args, frag);
}, postCreate:function () {
if (this.contentFile) {
dojo.require(this.contentFile);
}
if (this.modal) {
dojo.widget.ModalDialogBase.prototype.postCreate.call(this);
} else {
with (this.domNode.style) {
zIndex = 999;
display = "none";
}
}
dojo.widget.FloatingPaneBase.prototype.postCreate.apply(this, arguments);
dojo.widget.Editor2Dialog.superclass.postCreate.call(this);
if (this.width && this.height) {
with (this.domNode.style) {
width = this.width;
height = this.height;
}
}
}, createContent:function () {
if (!this.contentWidget && this.contentClass) {
this.contentWidget = dojo.widget.createWidget(this.contentClass);
this.addChild(this.contentWidget);
}
}, show:function () {
if (!this.contentWidget) {
dojo.widget.Editor2Dialog.superclass.show.apply(this, arguments);
this.createContent();
dojo.widget.Editor2Dialog.superclass.hide.call(this);
}
if (!this.contentWidget || !this.contentWidget.loadContent()) {
return;
}
this.showFloatingPane();
dojo.widget.Editor2Dialog.superclass.show.apply(this, arguments);
if (this.modal) {
this.showModalDialog();
}
if (this.modal) {
this.bg.style.zIndex = this.domNode.style.zIndex - 1;
}
}, onShow:function () {
dojo.widget.Editor2Dialog.superclass.onShow.call(this);
this.onFloatingPaneShow();
}, closeWindow:function () {
this.hide();
dojo.widget.Editor2Dialog.superclass.closeWindow.apply(this, arguments);
}, hide:function () {
if (this.modal) {
this.hideModalDialog();
}
dojo.widget.Editor2Dialog.superclass.hide.call(this);
}, checkSize:function () {
if (this.isShowing()) {
if (this.modal) {
this._sizeBackground();
}
this.placeModalDialog();
this.onResized();
}
}});
dojo.widget.defineWidget("dojo.widget.Editor2DialogContent", dojo.widget.HtmlWidget, {widgetsInTemplate:true, loadContent:function () {
return true;
}, cancel:function () {
this.parent.hide();
}});
dojo.lang.declare("dojo.widget.Editor2DialogCommand", dojo.widget.Editor2BrowserCommand, function (editor, name, dialogParas) {
this.dialogParas = dialogParas;
}, {execute:function () {
if (!this.dialog) {
if (!this.dialogParas.contentFile || !this.dialogParas.contentClass) {
alert("contentFile and contentClass should be set for dojo.widget.Editor2DialogCommand.dialogParas!");
return;
}
this.dialog = dojo.widget.createWidget("Editor2Dialog", this.dialogParas);
dojo.body().appendChild(this.dialog.domNode);
dojo.event.connect(this, "destroy", this.dialog, "destroy");
}
this.dialog.show();
}, getText:function () {
return this.dialogParas.title || dojo.widget.Editor2DialogCommand.superclass.getText.call(this);
}});
dojo.widget.Editor2ToolbarGroups = {};
dojo.widget.defineWidget("dojo.widget.Editor2", dojo.widget.RichText, function () {
this._loadedCommands = {};
}, {toolbarAlwaysVisible:false, toolbarWidget:null, scrollInterval:null, toolbarTemplatePath:dojo.uri.cache.set(dojo.uri.moduleUri("dojo.widget", "templates/EditorToolbarOneline.html"), "<div class=\"EditorToolbarDomNode EditorToolbarSmallBg\">\n\t<table cellpadding=\"1\" cellspacing=\"0\" border=\"0\">\n\t\t<tbody>\n\t\t\t<tr valign=\"top\" align=\"left\">\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"htmltoggle\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon\" \n\t\t\t\t\t\tstyle=\"background-image: none; width: 30px;\" >&lt;h&gt;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"copy\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Copy\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"paste\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Paste\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"undo\">\n\t\t\t\t\t\t<!-- FIXME: should we have the text \"undo\" here? -->\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Undo\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"redo\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Redo\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td isSpacer=\"true\">\n\t\t\t\t\t<span class=\"iconContainer\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Sep\"\tstyle=\"width: 5px; min-width: 5px;\"></span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"createlink\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Link\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"insertimage\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Image\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"inserthorizontalrule\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_HorizontalLine \">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"bold\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Bold\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"italic\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Italic\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"underline\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Underline\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"strikethrough\">\n\t\t\t\t\t\t<span \n\t\t\t\t\t\t\tclass=\"dojoE2TBIcon dojoE2TBIcon_StrikeThrough\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td isSpacer=\"true\">\n\t\t\t\t\t<span class=\"iconContainer\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Sep\" \n\t\t\t\t\t\t\tstyle=\"width: 5px; min-width: 5px;\"></span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"insertunorderedlist\">\n\t\t\t\t\t\t<span \n\t\t\t\t\t\t\tclass=\"dojoE2TBIcon dojoE2TBIcon_BulletedList\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"insertorderedlist\">\n\t\t\t\t\t\t<span \n\t\t\t\t\t\t\tclass=\"dojoE2TBIcon dojoE2TBIcon_NumberedList\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td isSpacer=\"true\">\n\t\t\t\t\t<span class=\"iconContainer\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Sep\" style=\"width: 5px; min-width: 5px;\"></span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"indent\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Indent\" \n\t\t\t\t\t\t\tunselectable=\"on\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"outdent\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Outdent\" \n\t\t\t\t\t\t\tunselectable=\"on\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td isSpacer=\"true\">\n\t\t\t\t\t<span class=\"iconContainer\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Sep\" style=\"width: 5px; min-width: 5px;\"></span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"forecolor\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_TextColor\" \n\t\t\t\t\t\t\tunselectable=\"on\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"hilitecolor\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_BackgroundColor\" \n\t\t\t\t\t\t\tunselectable=\"on\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td isSpacer=\"true\">\n\t\t\t\t\t<span class=\"iconContainer\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Sep\" style=\"width: 5px; min-width: 5px;\"></span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"justifyleft\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_LeftJustify\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"justifycenter\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_CenterJustify\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"justifyright\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_RightJustify\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"justifyfull\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_BlockJustify\">&nbsp;</span>\n\t\t\t\t\t</span>\n\t\t\t\t</td>\t\n\t\t\t\t<td>\n\t\t\t\t\t<select class=\"dojoEditorToolbarItem\" dojoETItemName=\"plainformatblock\">\n\t\t\t\t\t\t<!-- FIXME: using \"p\" here inserts a paragraph in most cases! -->\n\t\t\t\t\t\t<option value=\"\">-- format --</option>\n\t\t\t\t\t\t<option value=\"p\">Normal</option>\n\t\t\t\t\t\t<option value=\"pre\">Fixed Font</option>\n\t\t\t\t\t\t<option value=\"h1\">Main Heading</option>\n\t\t\t\t\t\t<option value=\"h2\">Section Heading</option>\n\t\t\t\t\t\t<option value=\"h3\">Sub-Heading</option>\n\t\t\t\t\t\t<!-- <option value=\"blockquote\">Block Quote</option> -->\n\t\t\t\t\t</select>\n\t\t\t\t</td>\n\t\t\t\t<td><!-- uncomment to enable save button -->\n\t\t\t\t\t<!-- save -->\n\t\t\t\t\t<!--span class=\"iconContainer dojoEditorToolbarItem\" dojoETItemName=\"save\">\n\t\t\t\t\t\t<span class=\"dojoE2TBIcon dojoE2TBIcon_Save\">&nbsp;</span>\n\t\t\t\t\t</span-->\n\t\t\t\t</td>\n\t\t\t\t<td width=\"*\">&nbsp;</td>\n\t\t\t</tr>\n\t\t</tbody>\n\t</table>\n</div>\n"), toolbarTemplateCssPath:null, toolbarPlaceHolder:"", _inSourceMode:false, _htmlEditNode:null, toolbarGroup:"", shareToolbar:false, contextMenuGroupSet:"", editorOnLoad:function () {
dojo.event.topic.publish("dojo.widget.Editor2::preLoadingToolbar", this);
if (this.toolbarAlwaysVisible) {
dojo.require("dojo.widget.Editor2Plugin.AlwaysShowToolbar");
}
if (this.toolbarWidget) {
this.toolbarWidget.show();
dojo.html.insertBefore(this.toolbarWidget.domNode, this.domNode.firstChild);
} else {
if (this.shareToolbar) {
dojo.deprecated("Editor2:shareToolbar is deprecated in favor of toolbarGroup", "0.5");
this.toolbarGroup = "defaultDojoToolbarGroup";
}
if (this.toolbarGroup) {
if (dojo.widget.Editor2ToolbarGroups[this.toolbarGroup]) {
this.toolbarWidget = dojo.widget.Editor2ToolbarGroups[this.toolbarGroup];
}
}
if (!this.toolbarWidget) {
var tbOpts = {shareGroup:this.toolbarGroup, parent:this};
tbOpts.templateString = dojo.uri.cache.get(this.toolbarTemplatePath);
if (this.toolbarTemplateCssPath) {
tbOpts.templateCssPath = this.toolbarTemplateCssPath;
tbOpts.templateCssString = dojo.uri.cache.get(this.toolbarTemplateCssPath);
}
if (this.toolbarPlaceHolder) {
this.toolbarWidget = dojo.widget.createWidget("Editor2Toolbar", tbOpts, dojo.byId(this.toolbarPlaceHolder), "after");
} else {
this.toolbarWidget = dojo.widget.createWidget("Editor2Toolbar", tbOpts, this.domNode.firstChild, "before");
}
if (this.toolbarGroup) {
dojo.widget.Editor2ToolbarGroups[this.toolbarGroup] = this.toolbarWidget;
}
dojo.event.connect(this, "close", this.toolbarWidget, "hide");
this.toolbarLoaded();
}
}
dojo.event.topic.registerPublisher("Editor2.clobberFocus", this, "clobberFocus");
dojo.event.topic.subscribe("Editor2.clobberFocus", this, "setBlur");
dojo.event.topic.publish("dojo.widget.Editor2::onLoad", this);
}, toolbarLoaded:function () {
}, registerLoadedPlugin:function (obj) {
if (!this.loadedPlugins) {
this.loadedPlugins = [];
}
this.loadedPlugins.push(obj);
}, unregisterLoadedPlugin:function (obj) {
for (var i in this.loadedPlugins) {
if (this.loadedPlugins[i] === obj) {
delete this.loadedPlugins[i];
return;
}
}
dojo.debug("dojo.widget.Editor2.unregisterLoadedPlugin: unknow plugin object: " + obj);
}, execCommand:function (command, argument) {
switch (command.toLowerCase()) {
case "htmltoggle":
this.toggleHtmlEditing();
break;
default:
dojo.widget.Editor2.superclass.execCommand.apply(this, arguments);
}
}, queryCommandEnabled:function (command, argument) {
switch (command.toLowerCase()) {
case "htmltoggle":
return true;
default:
if (this._inSourceMode) {
return false;
}
return dojo.widget.Editor2.superclass.queryCommandEnabled.apply(this, arguments);
}
}, queryCommandState:function (command, argument) {
switch (command.toLowerCase()) {
case "htmltoggle":
return this._inSourceMode;
default:
return dojo.widget.Editor2.superclass.queryCommandState.apply(this, arguments);
}
}, onClick:function (e) {
dojo.widget.Editor2.superclass.onClick.call(this, e);
if (dojo.widget.PopupManager) {
if (!e) {
e = this.window.event;
}
dojo.widget.PopupManager.onClick(e);
}
}, clobberFocus:function () {
}, toggleHtmlEditing:function () {
if (this === dojo.widget.Editor2Manager.getCurrentInstance()) {
if (!this._inSourceMode) {
var html = this.getEditorContent();
this._inSourceMode = true;
if (!this._htmlEditNode) {
this._htmlEditNode = dojo.doc().createElement("textarea");
dojo.html.insertAfter(this._htmlEditNode, this.editorObject);
}
this._htmlEditNode.style.display = "";
this._htmlEditNode.style.width = "100%";
this._htmlEditNode.style.height = dojo.html.getBorderBox(this.editNode).height + "px";
this._htmlEditNode.value = html;
with (this.editorObject.style) {
position = "absolute";
left = "-2000px";
top = "-2000px";
}
} else {
this._inSourceMode = false;
this._htmlEditNode.blur();
with (this.editorObject.style) {
position = "";
left = "";
top = "";
}
var html = this._htmlEditNode.value;
dojo.lang.setTimeout(this, "replaceEditorContent", 1, html);
this._htmlEditNode.style.display = "none";
this.focus();
}
this.onDisplayChanged(null, true);
}
}, setFocus:function () {
if (dojo.widget.Editor2Manager.getCurrentInstance() === this) {
return;
}
this.clobberFocus();
dojo.widget.Editor2Manager.setCurrentInstance(this);
}, setBlur:function () {
}, saveSelection:function () {
this._bookmark = null;
this._bookmark = dojo.withGlobal(this.window, dojo.html.selection.getBookmark);
}, restoreSelection:function () {
if (this._bookmark) {
this.focus();
dojo.withGlobal(this.window, "moveToBookmark", dojo.html.selection, [this._bookmark]);
this._bookmark = null;
} else {
dojo.debug("restoreSelection: no saved selection is found!");
}
}, _updateToolbarLastRan:null, _updateToolbarTimer:null, _updateToolbarFrequency:500, updateToolbar:function (force) {
if ((!this.isLoaded) || (!this.toolbarWidget)) {
return;
}
var diff = new Date() - this._updateToolbarLastRan;
if ((!force) && (this._updateToolbarLastRan) && ((diff < this._updateToolbarFrequency))) {
clearTimeout(this._updateToolbarTimer);
var _this = this;
this._updateToolbarTimer = setTimeout(function () {
_this.updateToolbar();
}, this._updateToolbarFrequency / 2);
return;
} else {
this._updateToolbarLastRan = new Date();
}
if (dojo.widget.Editor2Manager.getCurrentInstance() !== this) {
return;
}
this.toolbarWidget.update();
}, destroy:function (finalize) {
this._htmlEditNode = null;
dojo.event.disconnect(this, "close", this.toolbarWidget, "hide");
if (!finalize) {
this.toolbarWidget.destroy();
}
dojo.widget.Editor2.superclass.destroy.call(this);
}, _lastStateTimestamp:0, onDisplayChanged:function (e, forceUpdate) {
this._lastStateTimestamp = (new Date()).getTime();
dojo.widget.Editor2.superclass.onDisplayChanged.call(this, e);
this.updateToolbar(forceUpdate);
}, onLoad:function () {
try {
dojo.widget.Editor2.superclass.onLoad.call(this);
}
catch (e) {
dojo.debug(e);
}
this.editorOnLoad();
}, onFocus:function () {
dojo.widget.Editor2.superclass.onFocus.call(this);
this.setFocus();
}, getEditorContent:function () {
if (this._inSourceMode) {
return this._htmlEditNode.value;
}
return dojo.widget.Editor2.superclass.getEditorContent.call(this);
}, replaceEditorContent:function (html) {
if (this._inSourceMode) {
this._htmlEditNode.value = html;
return;
}
dojo.widget.Editor2.superclass.replaceEditorContent.apply(this, arguments);
}, getCommand:function (name) {
if (this._loadedCommands[name]) {
return this._loadedCommands[name];
}
var cmd = dojo.widget.Editor2Manager.getCommand(this, name);
this._loadedCommands[name] = cmd;
return cmd;
}, shortcuts:[["bold"], ["italic"], ["underline"], ["selectall", "a"], ["insertunorderedlist", "\\"]], setupDefaultShortcuts:function () {
var exec = function (cmd) {
return function () {
cmd.execute();
};
};
var self = this;
dojo.lang.forEach(this.shortcuts, function (item) {
var cmd = self.getCommand(item[0]);
if (cmd) {
self.addKeyHandler(item[1] ? item[1] : item[0].charAt(0), item[2] == undefined ? self.KEY_CTRL : item[2], exec(cmd));
}
});
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/TreeV3.js
New file
0,0 → 1,133
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeV3");
dojo.require("dojo.widget.TreeWithNode");
dojo.require("dojo.widget.*");
dojo.require("dojo.event.*");
dojo.require("dojo.io.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.TreeNodeV3");
dojo.widget.defineWidget("dojo.widget.TreeV3", [dojo.widget.HtmlWidget, dojo.widget.TreeWithNode], function () {
this.eventNames = {};
this.DndAcceptTypes = [];
this.actionsDisabled = [];
this.listeners = [];
this.tree = this;
}, {DndMode:"", defaultChildWidget:null, defaultChildTitle:"New Node", eagerWidgetInstantiation:false, eventNamesDefault:{afterTreeCreate:"afterTreeCreate", beforeTreeDestroy:"beforeTreeDestroy", beforeNodeDestroy:"beforeNodeDestroy", afterChangeTree:"afterChangeTree", afterSetFolder:"afterSetFolder", afterUnsetFolder:"afterUnsetFolder", beforeMoveFrom:"beforeMoveFrom", beforeMoveTo:"beforeMoveTo", afterMoveFrom:"afterMoveFrom", afterMoveTo:"afterMoveTo", afterAddChild:"afterAddChild", afterDetach:"afterDetach", afterExpand:"afterExpand", beforeExpand:"beforeExpand", afterSetTitle:"afterSetTitle", afterCollapse:"afterCollapse", beforeCollapse:"beforeCollapse"}, classPrefix:"Tree", style:"", allowAddChildToLeaf:true, unsetFolderOnEmpty:true, DndModes:{BETWEEN:1, ONTO:2}, DndAcceptTypes:"", templateCssString:"/* indent for all tree children excepts root */\n.TreeNode {\n background-image : url('../templates/images/TreeV3/i.gif');\n background-position : top left;\n background-repeat : repeat-y;\n margin-left: 19px;\n zoom: 1;\n}\n.TreeIsRoot {\n margin-left: 0;\n}\n \n/* left vertical line (grid) for all nodes */\n.TreeIsLast {\n background-image: url('../templates/images/TreeV3/i_half.gif');\n background-repeat : no-repeat;\n}\n \n.TreeExpandOpen .TreeExpand {\n background-image: url('../templates/images/TreeV3/expand_minus.gif');\n}\n \n/* closed is higher priority than open */\n.TreeExpandClosed .TreeExpand {\n background-image: url('../templates/images/TreeV3/expand_plus.gif');\n}\n \n/* highest priority */\n.TreeExpandLeaf .TreeExpand {\n background-image: url('../templates/images/TreeV3/expand_leaf.gif');\n}\n\n/* \nshould always override any expand setting, but do not touch children.\nif I add .TreeExpand .TreeExpandLoading same time and put it to top/bottom, then it will take precedence over +- for all descendants or always fail\nso I have to remove TreeExpand and process this one specifically\n*/\n\n.TreeExpandLoading {\n width: 18px;\n height: 18px;\n float: left;\n display: inline;\n background-repeat : no-repeat;\n background-image: url('../templates/images/TreeV3/expand_loading.gif');\n}\n \n.TreeContent {\n min-height: 18px;\n min-width: 18px;\n margin-left:18px;\n cursor: default;\n /* can't make inline - multiline bugs */\n}\n\n.TreeIEContent {\n\theight: 18px;\n}\n \n.TreeExpand {\n width: 18px;\n height: 18px;\n float: left;\n display: inline;\n background-repeat : no-repeat;\n}\n \n/* same style as IE selection */\n.TreeNodeEmphasized {\n background-color: Highlight;\n color: HighlightText;\n}\n \n.TreeContent .RichTextEditable, .TreeContent .RichTextEditable iframe {\n background-color: #ffc;\n color: black;\n}\n\n/* don't use :focus due to opera's lack of support on div's */\n.TreeLabelFocused {\n outline: 1px invert dotted;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/TreeV3.css"), templateString:"<div style=\"${this.style}\">\n</div>", isExpanded:true, isTree:true, createNode:function (data) {
data.tree = this.widgetId;
if (data.widgetName) {
return dojo.widget.createWidget(data.widgetName, data);
} else {
if (this.defaultChildWidget.prototype.createSimple) {
return this.defaultChildWidget.prototype.createSimple(data);
} else {
var ns = this.defaultChildWidget.prototype.ns;
var wt = this.defaultChildWidget.prototype.widgetType;
return dojo.widget.createWidget(ns + ":" + wt, data);
}
}
}, makeNodeTemplate:function () {
var domNode = document.createElement("div");
dojo.html.setClass(domNode, this.classPrefix + "Node " + this.classPrefix + "ExpandLeaf " + this.classPrefix + "ChildrenNo");
this.nodeTemplate = domNode;
var expandNode = document.createElement("div");
var clazz = this.classPrefix + "Expand";
if (dojo.render.html.ie) {
clazz = clazz + " " + this.classPrefix + "IEExpand";
}
dojo.html.setClass(expandNode, clazz);
this.expandNodeTemplate = expandNode;
var labelNode = document.createElement("span");
dojo.html.setClass(labelNode, this.classPrefix + "Label");
this.labelNodeTemplate = labelNode;
var contentNode = document.createElement("div");
var clazz = this.classPrefix + "Content";
if (dojo.render.html.ie && !dojo.render.html.ie70) {
clazz = clazz + " " + this.classPrefix + "IEContent";
}
dojo.html.setClass(contentNode, clazz);
this.contentNodeTemplate = contentNode;
domNode.appendChild(expandNode);
domNode.appendChild(contentNode);
contentNode.appendChild(labelNode);
}, makeContainerNodeTemplate:function () {
var div = document.createElement("div");
div.style.display = "none";
dojo.html.setClass(div, this.classPrefix + "Container");
this.containerNodeTemplate = div;
}, actions:{ADDCHILD:"ADDCHILD"}, getInfo:function () {
var info = {widgetId:this.widgetId, objectId:this.objectId};
return info;
}, adjustEventNames:function () {
for (var name in this.eventNamesDefault) {
if (dojo.lang.isUndefined(this.eventNames[name])) {
this.eventNames[name] = this.widgetId + "/" + this.eventNamesDefault[name];
}
}
}, adjustDndMode:function () {
var _this = this;
var DndMode = 0;
dojo.lang.forEach(this.DndMode.split(";"), function (elem) {
var mode = _this.DndModes[dojo.string.trim(elem).toUpperCase()];
if (mode) {
DndMode = DndMode | mode;
}
});
this.DndMode = DndMode;
}, destroy:function () {
dojo.event.topic.publish(this.tree.eventNames.beforeTreeDestroy, {source:this});
return dojo.widget.HtmlWidget.prototype.destroy.apply(this, arguments);
}, initialize:function (args) {
this.domNode.widgetId = this.widgetId;
for (var i = 0; i < this.actionsDisabled.length; i++) {
this.actionsDisabled[i] = this.actionsDisabled[i].toUpperCase();
}
if (!args.defaultChildWidget) {
this.defaultChildWidget = dojo.widget.TreeNodeV3;
} else {
this.defaultChildWidget = dojo.lang.getObjPathValue(args.defaultChildWidget);
}
this.adjustEventNames();
this.adjustDndMode();
this.makeNodeTemplate();
this.makeContainerNodeTemplate();
this.containerNode = this.domNode;
dojo.html.setClass(this.domNode, this.classPrefix + "Container");
var _this = this;
dojo.lang.forEach(this.listeners, function (elem) {
var t = dojo.lang.isString(elem) ? dojo.widget.byId(elem) : elem;
t.listenTree(_this);
});
}, postCreate:function () {
dojo.event.topic.publish(this.eventNames.afterTreeCreate, {source:this});
}, move:function (child, newParent, index) {
if (!child.parent) {
dojo.raise(this.widgetType + ": child can be moved only while it's attached");
}
var oldParent = child.parent;
var oldTree = child.tree;
var oldIndex = child.getParentIndex();
var newTree = newParent.tree;
var newParent = newParent;
var newIndex = index;
var message = {oldParent:oldParent, oldTree:oldTree, oldIndex:oldIndex, newParent:newParent, newTree:newTree, newIndex:newIndex, child:child};
dojo.event.topic.publish(oldTree.eventNames.beforeMoveFrom, message);
dojo.event.topic.publish(newTree.eventNames.beforeMoveTo, message);
this.doMove.apply(this, arguments);
dojo.event.topic.publish(oldTree.eventNames.afterMoveFrom, message);
dojo.event.topic.publish(newTree.eventNames.afterMoveTo, message);
}, doMove:function (child, newParent, index) {
child.doDetach();
newParent.doAddChild(child, index);
}, toString:function () {
return "[" + this.widgetType + " ID:" + this.widgetId + "]";
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/TreeCommon.js
New file
0,0 → 1,80
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TreeCommon");
dojo.require("dojo.widget.*");
dojo.declare("dojo.widget.TreeCommon", null, {listenTreeEvents:[], listenedTrees:{}, listenNodeFilter:null, listenTree:function (tree) {
var _this = this;
if (this.listenedTrees[tree.widgetId]) {
return;
}
dojo.lang.forEach(this.listenTreeEvents, function (event) {
var eventHandler = "on" + event.charAt(0).toUpperCase() + event.substr(1);
dojo.event.topic.subscribe(tree.eventNames[event], _this, eventHandler);
});
var filter;
if (this.listenNodeFilter) {
this.processDescendants(tree, this.listenNodeFilter, this.listenNode, true);
}
this.listenedTrees[tree.widgetId] = true;
}, listenNode:function () {
}, unlistenNode:function () {
}, unlistenTree:function (tree, nodeFilter) {
var _this = this;
if (!this.listenedTrees[tree.widgetId]) {
return;
}
dojo.lang.forEach(this.listenTreeEvents, function (event) {
var eventHandler = "on" + event.charAt(0).toUpperCase() + event.substr(1);
dojo.event.topic.unsubscribe(tree.eventNames[event], _this, eventHandler);
});
if (this.listenNodeFilter) {
this.processDescendants(tree, this.listenNodeFilter, this.unlistenNode, true);
}
delete this.listenedTrees[tree.widgetId];
}, checkPathCondition:function (domElement, condition) {
while (domElement && !domElement.widgetId) {
if (condition.call(null, domElement)) {
return true;
}
domElement = domElement.parentNode;
}
return false;
}, domElement2TreeNode:function (domElement) {
while (domElement && !domElement.widgetId) {
domElement = domElement.parentNode;
}
if (!domElement) {
return null;
}
var widget = dojo.widget.byId(domElement.widgetId);
if (!widget.isTreeNode) {
return null;
}
return widget;
}, processDescendants:function (elem, filter, func, skipFirst) {
var _this = this;
if (!skipFirst) {
if (!filter.call(_this, elem)) {
return;
}
func.call(_this, elem);
}
var stack = [elem];
while (elem = stack.pop()) {
dojo.lang.forEach(elem.children, function (elem) {
if (filter.call(_this, elem)) {
func.call(_this, elem);
stack.push(elem);
}
});
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/RegexpTextbox.js
New file
0,0 → 1,25
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.RegexpTextbox");
dojo.require("dojo.widget.ValidationTextbox");
dojo.widget.defineWidget("dojo.widget.RegexpTextbox", dojo.widget.ValidationTextbox, {mixInProperties:function (localProperties, frag) {
dojo.widget.RegexpTextbox.superclass.mixInProperties.apply(this, arguments);
if (localProperties.regexp) {
this.flags.regexp = localProperties.regexp;
}
if (localProperties.flags) {
this.flags.flags = localProperties.flags;
}
}, isValid:function () {
var regexp = new RegExp(this.flags.regexp, this.flags.flags);
return regexp.test(this.textbox.value);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/DocPane.js
New file
0,0 → 1,260
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.DocPane");
dojo.require("dojo.widget.*");
dojo.require("dojo.io.*");
dojo.require("dojo.event.*");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.Editor2");
dojo.require("dojo.widget.Dialog");
dojo.require("dojo.html.common");
dojo.require("dojo.html.display");
dojo.widget.DocPane = function () {
dojo.event.topic.subscribe("/docs/function/results", this, "onDocResults");
dojo.event.topic.subscribe("/docs/package/results", this, "onPkgResults");
dojo.event.topic.subscribe("/docs/function/detail", this, "onDocSelectFunction");
};
dojo.widget.defineWidget("dojo.widget.DocPane", dojo.widget.HtmlWidget, {dialog:null, dialogBg:null, dialogFg:null, logIn:null, edit:null, save:null, cancel:null, detail:null, result:null, packag:null, fn:null, fnLink:null, count:null, row:null, summary:null, description:null, variables:null, vRow:null, vLink:null, vDesc:null, methods:null, mRow:null, mLink:null, mDesc:null, requires:null, rRow:null, rRow2:null, rH3:null, rLink:null, parameters:null, pRow:null, pLink:null, pDesc:null, pOpt:null, pType:null, sType:null, sName:null, sParams:null, sPType:null, sPTypeSave:null, sPName:null, sPNameSave:null, pkgDescription:null, _appends:[], templateString:"<div class=\"dojoDocPane\">\n\t<div dojoAttachPoint=\"containerNode\" class=\"container\"></div>\n\n\t<div dojoAttachPoint=\"dialog\" class=\"dialog\">\n\t\t<div class=\"container\" dojoAttachPoint=\"dialogBg\">\n\t\t\t<div class=\"docDialog\" dojoAttachPoint=\"dialogFg\">\n\t\t\t\t<h2>Log In</h2>\n\t\t\t\t<p><input id=\"dojoDocUserName\" dojoAttachPoint=\"userName\"><label for=\"dojoDocUserName\">User Name:</label></p>\n\t\t\t\t<p><input id=\"dojoDocPassword\" dojoAttachPoint=\"password\" type=\"password\"><label for=\"dojoDocPassword\">Password:</label></p>\n\t\t\t\t<p><input type=\"button\" dojoAttachPoint=\"cancel\" value=\"cancel\"> <input type=\"button\" dojoAttachPoint=\"logIn\" value=\"Log In\"></p>\n\t\t\t\t<p></p>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\n\t<div dojoAttachPoint=\"nav\" class=\"nav\"><span>Detail</span> | <span>Source</span> | <span>Examples</span> | <span>Walkthrough</span></div>\n\n\t<div dojoAttachPoint=\"detail\" class=\"detail\">\n\t\t<h1>Detail: <span class=\"fn\" dojoAttachPoint=\"fn\">dojo.select</span></h1>\n\t\t<div class=\"description\" dojoAttachPoint=\"description\">Description</div>\n\t\t<div class=\"params\" dojoAttachPoint=\"parameters\">\n\t\t\t<h2>Parameters</h2>\n\t\t\t<div class=\"row\" dojoAttachPoint=\"pRow\">\n\t\t\t\t<span dojoAttachPoint=\"pOpt\"><em>optional</em> </span>\n\t\t\t\t<span><span dojoAttachPoint=\"pType\">type</span> </span>\n\t\t\t\t<a href=\"#\" dojoAttachPoint=\"pLink\">variable</a>\n\t\t\t\t<span> - <span dojoAttachPoint=\"pDesc\"></span></span>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"variables\" dojoAttachPoint=\"variables\">\n\t\t\t<h2>Variables</h2>\n\t\t\t<div class\"row\" dojoAttachPoint=\"vRow\">\n\t\t\t\t<a href=\"#\" dojoAttachPoint=\"vLink\">variable</a><span> - <span dojoAttachPoint=\"vDesc\"></span></span>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"signature\">\n\t\t\t<h2>Signature</h2>\n\t\t\t<div class=\"source\">\n\t\t\t\t<span class=\"return\" dojoAttachPoint=\"sType\">returnType</span> \n\t\t\t\t<span class=\"function\" dojoAttachPoint=\"sName\">foo</span>\n\t\t\t\t(<span class=\"params\" dojoAttachPoint=\"sParams\">\n\t\t\t\t\t<span class=\"type\" dojoAttachPoint=\"sPType\">type </span>\n\t\t\t\t\t<span class=\"name\" dojoAttachPoint=\"sPName\">paramName</span>\n\t\t\t\t</span>)\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t\n\t<div dojoAttachPoint=\"result\" class=\"result\">\n\t\t<h1>Search Results: <span dojoAttachPoint=\"count\">0</span> matches</h1>\n\t\t<div class=\"row\" dojoAttachPoint=\"row\">\n\t\t\t<a href=\"#\" dojoAttachPoint=\"fnLink\">dojo.fnLink</a>\n\t\t\t<span> - <span class=\"summary\" dojoAttachPoint=\"summary\">summary</span></span>\n\t\t</div>\n\t</div>\n\n\t<div dojoAttachPoint=\"packag\" class=\"package\">\n\t\t<h1>Package: \n\t\t\t<span class=\"pkg\" dojoAttachPoint=\"pkg\">dojo.package</span> \n\t\t\t<span class=\"edit\" dojoAttachPoint=\"edit\">[edit]</span> \n\t\t\t<span class=\"save\" dojoAttachPoint=\"save\">[save]</span>\n\t\t</h1>\n\t\t<div dojoAttachPoint=\"pkgDescription\" class=\"description\">Description</div>\n\t\t<div class=\"methods\" dojoAttachPoint=\"methods\">\n\t\t\t<h2>Methods</h2>\n\t\t\t<div class=\"row\" dojoAttachPoint=\"mRow\">\n\t\t\t\t<a href=\"#\" dojoAttachPoint=\"mLink\">method</a>\n\t\t\t\t<span> - <span class=\"description\" dojoAttachPoint=\"mDesc\"></span></span>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"requires\" dojoAttachPoint=\"requires\">\n\t\t\t<h2>Requires</h2>\n\t\t\t<div class=\"row\" dojoAttachPoint=\"rRow\">\n\t\t\t\t<h3 dojoAttachPoint=\"rH3\">Environment</h3>\n\t\t\t\t<div dojoAttachPoint=\"rRow2\"><a href=\"#\" dojoAttachPoint=\"rLink\" class=\"package\">require</a></div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n", templateCssString:".dojoDocPane { padding:1em; font: 1em Georgia,Times,\"Times New Roman\",serif; }\n\n.dojoDocPane .container{ }\n\n.dojoDocPane .dialog{ }\n.dojoDocPane .dialog .container{ padding: 0.5em; background: #fff; border: 2px solid #333; }\n.dojoDocPane .dialog .docDialog{ background: transparent; width: 20em; }\n.dojoDocPane .dialog .docDialog h2{ margin-top: 0; padding-top: 0; }\n.dojoDocPane .dialog .docDialog input { float: right; margin-right: 1em; }\n.dojoDocPane .dialog .docDialog p{ clear: both; }\n#dojoDocUserName, #dojoDocPassword { width: 10em; }\n\n.dojoDocPane .nav{ }\n.dojoDocPane .nav span{ }\n\n.dojoDocPane .detail{ }\n.dojoDocPane .detail h1{ }\n.dojoDocPane .detail h1 span.fn{ }\n.dojoDocPane .detail .description{ }\n.dojoDocPane .detail .params{ }\n.dojoDocPane .detail .params .row{ }\n.dojoDocPane .detail .params .row span{ }\n.dojoDocPane .detail .variables{ }\n.dojoDocPane .detail .variables .row{ }\n.dojoDocPane .detail .signature{ }\n.dojoDocPane .detail .signature .source{ white-space: pre; font: 0.8em Monaco, Courier, \"Courier New\", monospace; }\n.dojoDocPane .detail .signature .source .return{ color:#369; }\n.dojoDocPane .detail .signature .source .function{ color: #98543F; font-weight: bold; }\n.dojoDocPane .detail .signature .source .params{ }\n.dojoDocPane .detail .signature .source .params .type{ font-style: italic; color: #d17575; }\n.dojoDocPane .detail .signature .source .params .name{ color: #d14040; }\n\n.dojoDocPane .result{ }\n.dojoDocPane .result h1{ }\n.dojoDocPane .result .row{ }\n.dojoDocPane .result .row .summary{ }\n\n.dojoDocPane .package{ }\n.dojoDocPane .package h1{ }\n.dojoDocPane .package .row{ }\n.dojoDocPane .package .row .summary{ }\n.dojoDocPane .package .description{ }\n.dojoDocPane .package .methods{ }\n.dojoDocPane .package .methods h2{ }\n.dojoDocPane .package .methods .row{ }\n.dojoDocPane .package .methods .row .description{ }\n.dojoDocPane .package .requires{ }\n.dojoDocPane .package .requires h2{ }\n.dojoDocPane .package .requires .row{ }\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/DocPane.css"), isContainer:true, fillInTemplate:function () {
this.requires = dojo.html.removeNode(this.requires);
this.rRow.style.display = "none";
this.rRow2.style.display = "none";
this.methods = dojo.html.removeNode(this.methods);
this.mRow.style.display = "none";
this.dialog = dojo.widget.createWidget("dialog", {}, this.dialog);
this.dialog.setCloseControl(this.cancel);
dojo.html.setOpacity(this.dialogBg, 0.8);
dojo.html.setOpacity(this.dialogFg, 1);
dojo.event.connect(this.edit, "onclick", dojo.lang.hitch(this, function () {
if (!this._isLoggedIn) {
this.dialog.show();
}
}));
dojo.event.connect(this.logIn, "onclick", this, "_logIn");
dojo.event.connect(this.save, "onclick", this, "_save");
dojo.event.connect(dojo.docs, "logInSuccess", this, "_loggedIn");
this.homeSave = this.containerNode.cloneNode(true);
this.detailSave = dojo.html.removeNode(this.detail);
this.resultSave = dojo.html.removeNode(this.result);
this.packageSave = dojo.html.removeNode(this.packag);
this.results = dojo.html.removeNode(this.results);
this.rowParent = this.row.parentNode;
this.rowSave = dojo.html.removeNode(this.row);
this.vParent = this.vRow.parentNode;
this.vSave = dojo.html.removeNode(this.vRow);
this.pParent = this.pRow.parentNode;
this.pSave = dojo.html.removeNode(this.pRow);
this.sPTypeSave = dojo.html.removeNode(this.sPType);
this.sPNameSave = dojo.html.removeNode(this.sPName);
this.navSave = dojo.html.removeNode(this.nav);
}, _logIn:function () {
dojo.docs.setUserName(this.userName.value);
dojo.docs.setPassword(this.password.value);
}, _loggedIn:function () {
this._isLoggedIn = true;
this.dialog.hide();
this.pkgEditor = dojo.widget.createWidget("editor2", {toolbarAlwaysVisible:true}, this.pkgDescription);
}, _save:function () {
if (this.pkgEditor) {
dojo.docs.savePackage(this._pkgPath, {description:this.pkgEditor.getEditorContent()});
}
}, onDocSelectFunction:function (message) {
dojo.debug("onDocSelectFunction()");
for (var key in message) {
dojo.debug(key + ": " + dojo.json.serialize(message[key]));
}
var meta = message.meta;
if (meta) {
var variables = meta.variables;
var this_variables = meta.this_variables;
var child_variables = meta.child_variables;
var parameters = meta.parameters;
}
var doc = message.doc;
dojo.debug(dojo.json.serialize(doc));
var appends = this._appends;
dojo.html.removeChildren(this.domNode);
this.fn.innerHTML = message.name;
this.variables.style.display = "block";
var all = [];
if (variables) {
all = variables;
}
if (this_variables) {
all = all.concat(this_variables);
}
if (child_variables) {
all = all.concat(child_variables);
}
if (!all.length) {
this.variables.style.display = "none";
} else {
for (var i = 0, one; one = all[i]; i++) {
this.vLink.innerHTML = one;
this.vDesc.parentNode.style.display = "none";
appends.push(this.vParent.appendChild(this.vSave.cloneNode(true)));
}
}
this.sParams.innerHTML = "";
var first = true;
for (var param in parameters) {
var paramType = parameters[param].type;
var paramSummary = parameters[param].summary;
var paramName = param;
this.parameters.style.display = "block";
this.pLink.innerHTML = paramName;
this.pOpt.style.display = "none";
if (parameters[param].opt) {
this.pOpt.style.display = "inline";
}
this.pType.parentNode.style.display = "none";
if (parameters[param][0]) {
this.pType.parentNode.style.display = "inline";
this.pType.innerHTML = paramType;
}
this.pDesc.parentNode.style.display = "none";
if (paramSummary) {
this.pDesc.parentNode.style.display = "inline";
this.pDesc.innerHTML = paramSummary;
}
appends.push(this.pParent.appendChild(this.pSave.cloneNode(true)));
if (!first) {
this.sParams.appendChild(document.createTextNode(", "));
}
first = false;
if (paramType) {
dojo.debug(this.sPTypeSave);
this.sPTypeSave.innerHTML = paramType;
this.sParams.appendChild(this.sPTypeSave.cloneNode(true));
this.sParams.appendChild(document.createTextNode(" "));
}
dojo.debug(this.sPNameSave);
this.sPNameSave.innerHTML = paramName;
this.sParams.appendChild(this.sPNameSave.cloneNode(true));
}
if (message.returns) {
this.sType.innerHTML = message.returns;
} else {
this.sType.innerHTML = "void";
}
this.sName.innerHTML = message.name;
this.domNode.appendChild(this.navSave);
this.domNode.appendChild(this.detailSave.cloneNode(true));
for (var i = 0, append; append = appends[i]; i++) {
dojo.html.removeNode(append);
}
}, onPkgResult:function (results) {
if (this.pkgEditor) {
this.pkgEditor.close(true);
dojo.debug(this.pkgDescription);
}
var methods = results.methods;
var requires = results.requires;
var description = results.description;
this._pkgPath = results.path;
var requireLinks = [];
var appends = this._appends;
while (appends.length) {
dojo.html.removeNode(appends.shift());
}
dojo.html.removeChildren(this.domNode);
this.pkg.innerHTML = results.pkg;
var hasRequires = false;
for (var env in requires) {
hasRequires = true;
this.rH3.style.display = "none";
if (env != "common") {
this.rH3.style.display = "";
this.rH3.innerHTML = env;
}
for (var i = 0, require; require = requires[env][i]; i++) {
requireLinks.push({name:require});
this.rLink.innerHTML = require;
this.rLink.href = "#" + require;
var rRow2 = this.rRow2.parentNode.insertBefore(this.rRow2.cloneNode(true), this.rRow2);
rRow2.style.display = "";
appends.push(rRow2);
}
var rRow = this.rRow.parentNode.insertBefore(this.rRow.cloneNode(true), this.rRow);
rRow.style.display = "";
appends.push(rRow);
}
if (hasRequires) {
appends.push(this.packageSave.appendChild(this.requires.cloneNode(true)));
}
if (results.size) {
for (var i = 0, method; method = methods[i]; i++) {
this.mLink.innerHTML = method.name;
this.mLink.href = "#" + method.name;
this.mDesc.parentNode.style.display = "none";
if (method.summary) {
this.mDesc.parentNode.style.display = "inline";
this.mDesc.innerHTML = method.summary;
}
var mRow = this.mRow.parentNode.insertBefore(this.mRow.cloneNode(true), this.mRow);
mRow.style.display = "";
appends.push(mRow);
}
appends.push(this.packageSave.appendChild(this.methods.cloneNode(true)));
}
this.domNode.appendChild(this.packageSave);
this.pkgDescription.innerHTML = description;
function makeSelect(fOrP, x) {
return function (e) {
dojo.event.topic.publish("/docs/" + fOrP + "/select", x);
};
}
var as = this.domNode.getElementsByTagName("a");
for (var i = 0, a; a = as[i]; i++) {
if (a.className == "docMLink") {
dojo.event.connect(a, "onclick", makeSelect("function", methods[i]));
} else {
if (a.className == "docRLink") {
dojo.event.connect(a, "onclick", makeSelect("package", requireLinks[i]));
}
}
}
}, onDocResults:function (fns) {
dojo.debug("onDocResults(): called");
if (fns.length == 1) {
dojo.event.topic.publish("/docs/function/select", fns[0]);
return;
}
dojo.html.removeChildren(this.domNode);
this.count.innerHTML = fns.length;
var appends = [];
for (var i = 0, fn; fn = fns[i]; i++) {
this.fnLink.innerHTML = fn.name;
this.fnLink.href = "#" + fn.name;
if (fn.id) {
this.fnLink.href = this.fnLink.href + "," + fn.id;
}
this.summary.parentNode.style.display = "none";
if (fn.summary) {
this.summary.parentNode.style.display = "inline";
this.summary.innerHTML = fn.summary;
}
appends.push(this.rowParent.appendChild(this.rowSave.cloneNode(true)));
}
function makeSelect(x) {
return function (e) {
dojo.event.topic.publish("/docs/function/select", x);
};
}
this.domNode.appendChild(this.resultSave.cloneNode(true));
var as = this.domNode.getElementsByTagName("a");
for (var i = 0, a; a = as[i]; i++) {
dojo.event.connect(a, "onclick", makeSelect(fns[i]));
}
for (var i = 0, append; append = appends[i]; i++) {
this.rowParent.removeChild(append);
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/DropdownTimePicker.js
New file
0,0 → 1,154
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.DropdownTimePicker");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.DropdownContainer");
dojo.require("dojo.widget.TimePicker");
dojo.require("dojo.event.*");
dojo.require("dojo.html.*");
dojo.require("dojo.date.format");
dojo.require("dojo.date.serialize");
dojo.require("dojo.i18n.common");
dojo.requireLocalization("dojo.widget", "DropdownTimePicker", null, "ROOT");
dojo.widget.defineWidget("dojo.widget.DropdownTimePicker", dojo.widget.DropdownContainer, {iconURL:dojo.uri.moduleUri("dojo.widget", "templates/images/timeIcon.gif"), formatLength:"short", displayFormat:"", timeFormat:"", saveFormat:"", value:"", name:"", postMixInProperties:function () {
dojo.widget.DropdownTimePicker.superclass.postMixInProperties.apply(this, arguments);
var messages = dojo.i18n.getLocalization("dojo.widget", "DropdownTimePicker", this.lang);
this.iconAlt = messages.selectTime;
if (typeof (this.value) == "string" && this.value.toLowerCase() == "today") {
this.value = new Date();
}
if (this.value && isNaN(this.value)) {
var orig = this.value;
this.value = dojo.date.fromRfc3339(this.value);
if (!this.value) {
var d = dojo.date.format(new Date(), {selector:"dateOnly", datePattern:"yyyy-MM-dd"});
var c = orig.split(":");
for (var i = 0; i < c.length; ++i) {
if (c[i].length == 1) {
c[i] = "0" + c[i];
}
}
orig = c.join(":");
this.value = dojo.date.fromRfc3339(d + "T" + orig);
dojo.deprecated("dojo.widget.DropdownTimePicker", "time attributes must be passed in Rfc3339 format", "0.5");
}
}
if (this.value && !isNaN(this.value)) {
this.value = new Date(this.value);
}
}, fillInTemplate:function () {
dojo.widget.DropdownTimePicker.superclass.fillInTemplate.apply(this, arguments);
var value = "";
if (this.value instanceof Date) {
value = this.value;
} else {
if (this.value) {
var orig = this.value;
var d = dojo.date.format(new Date(), {selector:"dateOnly", datePattern:"yyyy-MM-dd"});
var c = orig.split(":");
for (var i = 0; i < c.length; ++i) {
if (c[i].length == 1) {
c[i] = "0" + c[i];
}
}
orig = c.join(":");
value = dojo.date.fromRfc3339(d + "T" + orig);
}
}
var tpArgs = {widgetContainerId:this.widgetId, lang:this.lang, value:value};
this.timePicker = dojo.widget.createWidget("TimePicker", tpArgs, this.containerNode, "child");
dojo.event.connect(this.timePicker, "onValueChanged", this, "_updateText");
if (this.value) {
this._updateText();
}
this.containerNode.style.zIndex = this.zIndex;
this.containerNode.explodeClassName = "timeContainer";
this.valueNode.name = this.name;
}, getValue:function () {
return this.valueNode.value;
}, getTime:function () {
return this.timePicker.storedTime;
}, setValue:function (rfcDate) {
this.setTime(rfcDate);
}, setTime:function (dateObj) {
var value = "";
if (dateObj instanceof Date) {
value = dateObj;
} else {
if (this.value) {
var orig = this.value;
var d = dojo.date.format(new Date(), {selector:"dateOnly", datePattern:"yyyy-MM-dd"});
var c = orig.split(":");
for (var i = 0; i < c.length; ++i) {
if (c[i].length == 1) {
c[i] = "0" + c[i];
}
}
orig = c.join(":");
value = dojo.date.fromRfc3339(d + "T" + orig);
}
}
this.timePicker.setTime(value);
this._syncValueNode();
}, _updateText:function () {
if (this.timePicker.selectedTime.anyTime) {
this.inputNode.value = "";
} else {
if (this.timeFormat) {
dojo.deprecated("dojo.widget.DropdownTimePicker", "Must use displayFormat attribute instead of timeFormat. See dojo.date.format for specification.", "0.5");
this.inputNode.value = dojo.date.strftime(this.timePicker.time, this.timeFormat, this.lang);
} else {
this.inputNode.value = dojo.date.format(this.timePicker.time, {formatLength:this.formatLength, timePattern:this.displayFormat, selector:"timeOnly", locale:this.lang});
}
}
this._syncValueNode();
this.onValueChanged(this.getTime());
this.hideContainer();
}, onValueChanged:function (dateObj) {
}, onInputChange:function () {
if (this.dateFormat) {
dojo.deprecated("dojo.widget.DropdownTimePicker", "Cannot parse user input. Must use displayFormat attribute instead of dateFormat. See dojo.date.format for specification.", "0.5");
} else {
var input = dojo.string.trim(this.inputNode.value);
if (input) {
var inputTime = dojo.date.parse(input, {formatLength:this.formatLength, timePattern:this.displayFormat, selector:"timeOnly", locale:this.lang});
if (inputTime) {
this.setTime(inputTime);
}
} else {
this.valueNode.value = input;
}
}
if (input) {
this._updateText();
}
}, _syncValueNode:function () {
var time = this.timePicker.time;
var value;
switch (this.saveFormat.toLowerCase()) {
case "rfc":
case "iso":
case "":
value = dojo.date.toRfc3339(time, "timeOnly");
break;
case "posix":
case "unix":
value = Number(time);
break;
default:
value = dojo.date.format(time, {datePattern:this.saveFormat, selector:"timeOnly", locale:this.lang});
}
this.valueNode.value = value;
}, destroy:function (finalize) {
this.timePicker.destroy(finalize);
dojo.widget.DropdownTimePicker.superclass.destroy.apply(this, arguments);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/TabContainer.js
New file
0,0 → 1,87
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.TabContainer");
dojo.require("dojo.lang.func");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.PageContainer");
dojo.require("dojo.event.*");
dojo.require("dojo.html.selection");
dojo.require("dojo.widget.html.layout");
dojo.widget.defineWidget("dojo.widget.TabContainer", dojo.widget.PageContainer, {labelPosition:"top", closeButton:"none", templateString:null, templateString:"<div id=\"${this.widgetId}\" class=\"dojoTabContainer\">\n\t<div dojoAttachPoint=\"tablistNode\"></div>\n\t<div class=\"dojoTabPaneWrapper\" dojoAttachPoint=\"containerNode\" dojoAttachEvent=\"onKey\" waiRole=\"tabpanel\"></div>\n</div>\n", templateCssString:".dojoTabContainer {\n\tposition : relative;\n}\n\n.dojoTabPaneWrapper {\n\tborder : 1px solid #6290d2;\n\t_zoom: 1; /* force IE6 layout mode so top border doesnt disappear */\n\tdisplay: block;\n\tclear: both;\n\toverflow: hidden;\n}\n\n.dojoTabLabels-top {\n\tposition : relative;\n\ttop : 0px;\n\tleft : 0px;\n\toverflow : visible;\n\tmargin-bottom : -1px;\n\twidth : 100%;\n\tz-index: 2;\t/* so the bottom of the tab label will cover up the border of dojoTabPaneWrapper */\n}\n\n.dojoTabNoLayout.dojoTabLabels-top .dojoTab {\n\tmargin-bottom: -1px;\n\t_margin-bottom: 0px; /* IE filter so top border lines up correctly */\n}\n\n.dojoTab {\n\tposition : relative;\n\tfloat : left;\n\tpadding-left : 9px;\n\tborder-bottom : 1px solid #6290d2;\n\tbackground : url(images/tab_left.gif) no-repeat left top;\n\tcursor: pointer;\n\twhite-space: nowrap;\n\tz-index: 3;\n}\n\n.dojoTab div {\n\tdisplay : block;\n\tpadding : 4px 15px 4px 6px;\n\tbackground : url(images/tab_top_right.gif) no-repeat right top;\n\tcolor : #333;\n\tfont-size : 90%;\n}\n\n.dojoTab .close {\n\tdisplay : inline-block;\n\theight : 12px;\n\twidth : 12px;\n\tpadding : 0 12px 0 0;\n\tmargin : 0 -10px 0 10px;\n\tcursor : default;\n\tfont-size: small;\n}\n\n.dojoTab .closeImage {\n\tbackground : url(images/tab_close.gif) no-repeat right top;\n}\n\n.dojoTab .closeHover {\n\tbackground-image : url(images/tab_close_h.gif);\n}\n\n.dojoTab.current {\n\tpadding-bottom : 1px;\n\tborder-bottom : 0;\n\tbackground-position : 0 -150px;\n}\n\n.dojoTab.current div {\n\tpadding-bottom : 5px;\n\tmargin-bottom : -1px;\n\tbackground-position : 100% -150px;\n}\n\n/* bottom tabs */\n\n.dojoTabLabels-bottom {\n\tposition : relative;\n\tbottom : 0px;\n\tleft : 0px;\n\toverflow : visible;\n\tmargin-top : -1px;\n\twidth : 100%;\n\tz-index: 2;\n}\n\n.dojoTabNoLayout.dojoTabLabels-bottom {\n\tposition : relative;\n}\n\n.dojoTabLabels-bottom .dojoTab {\n\tborder-top : 1px solid #6290d2;\n\tborder-bottom : 0;\n\tbackground : url(images/tab_bot_left.gif) no-repeat left bottom;\n}\n\n.dojoTabLabels-bottom .dojoTab div {\n\tbackground : url(images/tab_bot_right.gif) no-repeat right bottom;\n}\n\n.dojoTabLabels-bottom .dojoTab.current {\n\tborder-top : 0;\n\tbackground : url(images/tab_bot_left_curr.gif) no-repeat left bottom;\n}\n\n.dojoTabLabels-bottom .dojoTab.current div {\n\tpadding-top : 4px;\n\tbackground : url(images/tab_bot_right_curr.gif) no-repeat right bottom;\n}\n\n/* right-h tabs */\n\n.dojoTabLabels-right-h {\n\toverflow : visible;\n\tmargin-left : -1px;\n\tz-index: 2;\n}\n\n.dojoTabLabels-right-h .dojoTab {\n\tpadding-left : 0;\n\tborder-left : 1px solid #6290d2;\n\tborder-bottom : 0;\n\tbackground : url(images/tab_bot_right.gif) no-repeat right bottom;\n\tfloat : none;\n}\n\n.dojoTabLabels-right-h .dojoTab div {\n\tpadding : 4px 15px 4px 15px;\n}\n\n.dojoTabLabels-right-h .dojoTab.current {\n\tborder-left : 0;\n\tborder-bottom : 1px solid #6290d2;\n}\n\n/* left-h tabs */\n\n.dojoTabLabels-left-h {\n\toverflow : visible;\n\tmargin-right : -1px;\n\tz-index: 2;\n}\n\n.dojoTabLabels-left-h .dojoTab {\n\tborder-right : 1px solid #6290d2;\n\tborder-bottom : 0;\n\tfloat : none;\n\tbackground : url(images/tab_top_left.gif) no-repeat left top;\n}\n\n.dojoTabLabels-left-h .dojoTab.current {\n\tborder-right : 0;\n\tborder-bottom : 1px solid #6290d2;\n\tpadding-bottom : 0;\n\tbackground : url(images/tab_top_left.gif) no-repeat 0 -150px;\n}\n\n.dojoTabLabels-left-h .dojoTab div {\n\tbackground : 0;\n\tborder-bottom : 1px solid #6290d2;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/TabContainer.css"), selectedTab:"", postMixInProperties:function () {
if (this.selectedTab) {
dojo.deprecated("selectedTab deprecated, use selectedChild instead, will be removed in", "0.5");
this.selectedChild = this.selectedTab;
}
if (this.closeButton != "none") {
dojo.deprecated("closeButton deprecated, use closable='true' on each child instead, will be removed in", "0.5");
}
dojo.widget.TabContainer.superclass.postMixInProperties.apply(this, arguments);
}, fillInTemplate:function () {
this.tablist = dojo.widget.createWidget("TabController", {id:this.widgetId + "_tablist", labelPosition:this.labelPosition, doLayout:this.doLayout, containerId:this.widgetId}, this.tablistNode);
dojo.widget.TabContainer.superclass.fillInTemplate.apply(this, arguments);
}, postCreate:function (args, frag) {
dojo.widget.TabContainer.superclass.postCreate.apply(this, arguments);
this.onResized();
}, _setupChild:function (tab) {
if (this.closeButton == "tab" || this.closeButton == "pane") {
tab.closable = true;
}
dojo.html.addClass(tab.domNode, "dojoTabPane");
dojo.widget.TabContainer.superclass._setupChild.apply(this, arguments);
}, onResized:function () {
if (!this.doLayout) {
return;
}
var labelAlign = this.labelPosition.replace(/-h/, "");
var children = [{domNode:this.tablist.domNode, layoutAlign:labelAlign}, {domNode:this.containerNode, layoutAlign:"client"}];
dojo.widget.html.layout(this.domNode, children);
if (this.selectedChildWidget) {
var containerSize = dojo.html.getContentBox(this.containerNode);
this.selectedChildWidget.resizeTo(containerSize.width, containerSize.height);
}
}, selectTab:function (tab, callingWidget) {
dojo.deprecated("use selectChild() rather than selectTab(), selectTab() will be removed in", "0.5");
this.selectChild(tab, callingWidget);
}, onKey:function (e) {
if (e.keyCode == e.KEY_UP_ARROW && e.ctrlKey) {
var button = this.correspondingTabButton || this.selectedTabWidget.tabButton;
button.focus();
dojo.event.browser.stopEvent(e);
} else {
if (e.keyCode == e.KEY_DELETE && e.altKey) {
if (this.selectedChildWidget.closable) {
this.closeChild(this.selectedChildWidget);
dojo.event.browser.stopEvent(e);
}
}
}
}, destroy:function () {
this.tablist.destroy();
dojo.widget.TabContainer.superclass.destroy.apply(this, arguments);
}});
dojo.widget.defineWidget("dojo.widget.TabController", dojo.widget.PageController, {templateString:"<div wairole='tablist' dojoAttachEvent='onKey'></div>", labelPosition:"top", doLayout:true, "class":"", buttonWidget:"TabButton", postMixInProperties:function () {
if (!this["class"]) {
this["class"] = "dojoTabLabels-" + this.labelPosition + (this.doLayout ? "" : " dojoTabNoLayout");
}
dojo.widget.TabController.superclass.postMixInProperties.apply(this, arguments);
}});
dojo.widget.defineWidget("dojo.widget.TabButton", dojo.widget.PageButton, {templateString:"<div class='dojoTab' dojoAttachEvent='onClick'>" + "<div dojoAttachPoint='innerDiv'>" + "<span dojoAttachPoint='titleNode' tabIndex='-1' waiRole='tab'>${this.label}</span>" + "<span dojoAttachPoint='closeButtonNode' class='close closeImage' style='${this.closeButtonStyle}'" + " dojoAttachEvent='onMouseOver:onCloseButtonMouseOver; onMouseOut:onCloseButtonMouseOut; onClick:onCloseButtonClick'></span>" + "</div>" + "</div>", postMixInProperties:function () {
this.closeButtonStyle = this.closeButton ? "" : "display: none";
dojo.widget.TabButton.superclass.postMixInProperties.apply(this, arguments);
}, fillInTemplate:function () {
dojo.html.disableSelection(this.titleNode);
dojo.widget.TabButton.superclass.fillInTemplate.apply(this, arguments);
}, onCloseButtonClick:function (evt) {
evt.stopPropagation();
dojo.widget.TabButton.superclass.onCloseButtonClick.apply(this, arguments);
}});
dojo.widget.defineWidget("dojo.widget.a11y.TabButton", dojo.widget.TabButton, {imgPath:dojo.uri.moduleUri("dojo.widget", "templates/images/tab_close.gif"), templateString:"<div class='dojoTab' dojoAttachEvent='onClick;onKey'>" + "<div dojoAttachPoint='innerDiv'>" + "<span dojoAttachPoint='titleNode' tabIndex='-1' waiRole='tab'>${this.label}</span>" + "<img class='close' src='${this.imgPath}' alt='[x]' style='${this.closeButtonStyle}'" + " dojoAttachEvent='onClick:onCloseButtonClick'>" + "</div>" + "</div>"});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/widget/DebugConsole.js
New file
0,0 → 1,21
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.widget.DebugConsole");
dojo.require("dojo.widget.Widget");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.FloatingPane");
dojo.widget.defineWidget("dojo.widget.DebugConsole", dojo.widget.FloatingPane, {fillInTemplate:function () {
dojo.widget.DebugConsole.superclass.fillInTemplate.apply(this, arguments);
this.containerNode.id = "debugConsoleClientPane";
djConfig.isDebug = true;
djConfig.debugContainerId = this.containerNode.id;
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/text/__package__.js
New file
0,0 → 1,13
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.kwCompoundRequire({common:["dojo.text.String", "dojo.text.Builder"]});
dojo.deprecated("dojo.text", "textDirectory moved to cal, text.String and text.Builder havne't been here for awhile", "0.5");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/text/textDirectory.js
New file
0,0 → 1,13
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.require("dojo.cal.textDirectory");
dojo.deprecate("dojo.text.textDirectory", "use dojo.cal.textDirectory", "0.5");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/data.js
New file
0,0 → 1,13
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.data");
dojo.data = {};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/AdapterRegistry.js
New file
0,0 → 1,42
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.AdapterRegistry");
dojo.require("dojo.lang.func");
dojo.AdapterRegistry = function (returnWrappers) {
this.pairs = [];
this.returnWrappers = returnWrappers || false;
};
dojo.lang.extend(dojo.AdapterRegistry, {register:function (name, check, wrap, directReturn, override) {
var type = (override) ? "unshift" : "push";
this.pairs[type]([name, check, wrap, directReturn]);
}, match:function () {
for (var i = 0; i < this.pairs.length; i++) {
var pair = this.pairs[i];
if (pair[1].apply(this, arguments)) {
if ((pair[3]) || (this.returnWrappers)) {
return pair[2];
} else {
return pair[2].apply(this, arguments);
}
}
}
throw new Error("No match found");
}, unregister:function (name) {
for (var i = 0; i < this.pairs.length; i++) {
var pair = this.pairs[i];
if (pair[0] == name) {
this.pairs.splice(i, 1);
return true;
}
}
return false;
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/logging/ConsoleLogger.js
New file
0,0 → 1,84
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.logging.ConsoleLogger");
dojo.require("dojo.logging.Logger");
dojo.lang.extend(dojo.logging.MemoryLogHandler, {debug:function () {
dojo.hostenv.println.apply(this, arguments);
}, info:function () {
dojo.hostenv.println.apply(this, arguments);
}, warn:function () {
dojo.hostenv.println.apply(this, arguments);
}, error:function () {
dojo.hostenv.println.apply(this, arguments);
}, critical:function () {
dojo.hostenv.println.apply(this, arguments);
}, emit:function (record) {
if (!djConfig.isDebug) {
return;
}
var funcName = null;
switch (record.level) {
case 1:
funcName = "debug";
break;
case 2:
funcName = "info";
break;
case 3:
funcName = "warn";
break;
case 4:
funcName = "error";
break;
case 5:
funcName = "critical";
break;
default:
funcName = "debug";
}
var logStr = String(dojo.log.getLevelName(record.level) + ": " + record.time.toLocaleTimeString()) + ": " + record.message;
if (record.msgArgs && record.msgArgs.length > 0) {
this[funcName].call(this, logStr, record.msgArgs);
} else {
this[funcName].call(this, logStr);
}
this.data.push(record);
if (this.numRecords != -1) {
while (this.data.length > this.numRecords) {
this.data.shift();
}
}
}});
if (!dj_undef("console") && !dj_undef("info", console)) {
dojo.lang.extend(dojo.logging.MemoryLogHandler, {debug:function () {
console.debug.apply(this, arguments);
}, info:function () {
console.info.apply(this, arguments);
}, warn:function () {
console.warn.apply(this, arguments);
}, error:function () {
console.error.apply(this, arguments);
}, critical:function () {
console.error.apply(this, arguments);
}});
dojo.lang.extend(dojo.logging.Logger, {exception:function (msg, e, squelch) {
var args = [msg];
if (e) {
msg += " : " + e.name + " " + (e.description || e.message);
args.push(e);
}
this.logType("ERROR", args);
if (!squelch) {
throw e;
}
}});
}
 
/tags/Racine_livraison_narmer/api/js/dojo/src/logging/__package__.js
New file
0,0 → 1,13
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.kwCompoundRequire({common:[["dojo.logging.Logger", false, false]], rhino:["dojo.logging.RhinoLogger"]});
dojo.provide("dojo.logging.*");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/logging/Logger.js
New file
0,0 → 1,214
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.logging.Logger");
dojo.provide("dojo.logging.LogFilter");
dojo.provide("dojo.logging.Record");
dojo.provide("dojo.log");
dojo.require("dojo.lang.common");
dojo.require("dojo.lang.declare");
dojo.logging.Record = function (logLevel, message) {
this.level = logLevel;
this.message = "";
this.msgArgs = [];
this.time = new Date();
if (dojo.lang.isArray(message)) {
if (message.length > 0 && dojo.lang.isString(message[0])) {
this.message = message.shift();
}
this.msgArgs = message;
} else {
this.message = message;
}
};
dojo.logging.LogFilter = function (loggerChain) {
this.passChain = loggerChain || "";
this.filter = function (record) {
return true;
};
};
dojo.logging.Logger = function () {
this.cutOffLevel = 0;
this.propagate = true;
this.parent = null;
this.data = [];
this.filters = [];
this.handlers = [];
};
dojo.extend(dojo.logging.Logger, {_argsToArr:function (args) {
var ret = [];
for (var x = 0; x < args.length; x++) {
ret.push(args[x]);
}
return ret;
}, setLevel:function (lvl) {
this.cutOffLevel = parseInt(lvl);
}, isEnabledFor:function (lvl) {
return parseInt(lvl) >= this.cutOffLevel;
}, getEffectiveLevel:function () {
if ((this.cutOffLevel == 0) && (this.parent)) {
return this.parent.getEffectiveLevel();
}
return this.cutOffLevel;
}, addFilter:function (flt) {
this.filters.push(flt);
return this.filters.length - 1;
}, removeFilterByIndex:function (fltIndex) {
if (this.filters[fltIndex]) {
delete this.filters[fltIndex];
return true;
}
return false;
}, removeFilter:function (fltRef) {
for (var x = 0; x < this.filters.length; x++) {
if (this.filters[x] === fltRef) {
delete this.filters[x];
return true;
}
}
return false;
}, removeAllFilters:function () {
this.filters = [];
}, filter:function (rec) {
for (var x = 0; x < this.filters.length; x++) {
if ((this.filters[x]["filter"]) && (!this.filters[x].filter(rec)) || (rec.level < this.cutOffLevel)) {
return false;
}
}
return true;
}, addHandler:function (hdlr) {
this.handlers.push(hdlr);
return this.handlers.length - 1;
}, handle:function (rec) {
if ((!this.filter(rec)) || (rec.level < this.cutOffLevel)) {
return false;
}
for (var x = 0; x < this.handlers.length; x++) {
if (this.handlers[x]["handle"]) {
this.handlers[x].handle(rec);
}
}
return true;
}, log:function (lvl, msg) {
if ((this.propagate) && (this.parent) && (this.parent.rec.level >= this.cutOffLevel)) {
this.parent.log(lvl, msg);
return false;
}
this.handle(new dojo.logging.Record(lvl, msg));
return true;
}, debug:function (msg) {
return this.logType("DEBUG", this._argsToArr(arguments));
}, info:function (msg) {
return this.logType("INFO", this._argsToArr(arguments));
}, warning:function (msg) {
return this.logType("WARNING", this._argsToArr(arguments));
}, error:function (msg) {
return this.logType("ERROR", this._argsToArr(arguments));
}, critical:function (msg) {
return this.logType("CRITICAL", this._argsToArr(arguments));
}, exception:function (msg, e, squelch) {
if (e) {
var eparts = [e.name, (e.description || e.message)];
if (e.fileName) {
eparts.push(e.fileName);
eparts.push("line " + e.lineNumber);
}
msg += " " + eparts.join(" : ");
}
this.logType("ERROR", msg);
if (!squelch) {
throw e;
}
}, logType:function (type, args) {
return this.log.apply(this, [dojo.logging.log.getLevel(type), args]);
}, warn:function () {
this.warning.apply(this, arguments);
}, err:function () {
this.error.apply(this, arguments);
}, crit:function () {
this.critical.apply(this, arguments);
}});
dojo.logging.LogHandler = function (level) {
this.cutOffLevel = (level) ? level : 0;
this.formatter = null;
this.data = [];
this.filters = [];
};
dojo.lang.extend(dojo.logging.LogHandler, {setFormatter:function (formatter) {
dojo.unimplemented("setFormatter");
}, flush:function () {
}, close:function () {
}, handleError:function () {
dojo.deprecated("dojo.logging.LogHandler.handleError", "use handle()", "0.6");
}, handle:function (record) {
if ((this.filter(record)) && (record.level >= this.cutOffLevel)) {
this.emit(record);
}
}, emit:function (record) {
dojo.unimplemented("emit");
}});
void (function () {
var names = ["setLevel", "addFilter", "removeFilterByIndex", "removeFilter", "removeAllFilters", "filter"];
var tgt = dojo.logging.LogHandler.prototype;
var src = dojo.logging.Logger.prototype;
for (var x = 0; x < names.length; x++) {
tgt[names[x]] = src[names[x]];
}
})();
dojo.logging.log = new dojo.logging.Logger();
dojo.logging.log.levels = [{"name":"DEBUG", "level":1}, {"name":"INFO", "level":2}, {"name":"WARNING", "level":3}, {"name":"ERROR", "level":4}, {"name":"CRITICAL", "level":5}];
dojo.logging.log.loggers = {};
dojo.logging.log.getLogger = function (name) {
if (!this.loggers[name]) {
this.loggers[name] = new dojo.logging.Logger();
this.loggers[name].parent = this;
}
return this.loggers[name];
};
dojo.logging.log.getLevelName = function (lvl) {
for (var x = 0; x < this.levels.length; x++) {
if (this.levels[x].level == lvl) {
return this.levels[x].name;
}
}
return null;
};
dojo.logging.log.getLevel = function (name) {
for (var x = 0; x < this.levels.length; x++) {
if (this.levels[x].name.toUpperCase() == name.toUpperCase()) {
return this.levels[x].level;
}
}
return null;
};
dojo.declare("dojo.logging.MemoryLogHandler", dojo.logging.LogHandler, {initializer:function (level, recordsToKeep, postType, postInterval) {
dojo.logging.LogHandler.call(this, level);
this.numRecords = (typeof djConfig["loggingNumRecords"] != "undefined") ? djConfig["loggingNumRecords"] : ((recordsToKeep) ? recordsToKeep : -1);
this.postType = (typeof djConfig["loggingPostType"] != "undefined") ? djConfig["loggingPostType"] : (postType || -1);
this.postInterval = (typeof djConfig["loggingPostInterval"] != "undefined") ? djConfig["loggingPostInterval"] : (postType || -1);
}, emit:function (record) {
if (!djConfig.isDebug) {
return;
}
var logStr = String(dojo.log.getLevelName(record.level) + ": " + record.time.toLocaleTimeString()) + ": " + record.message;
if (!dj_undef("println", dojo.hostenv)) {
dojo.hostenv.println(logStr, record.msgArgs);
}
this.data.push(record);
if (this.numRecords != -1) {
while (this.data.length > this.numRecords) {
this.data.shift();
}
}
}});
dojo.logging.logQueueHandler = new dojo.logging.MemoryLogHandler(0, 50, 0, 10000);
dojo.logging.log.addHandler(dojo.logging.logQueueHandler);
dojo.log = dojo.logging.log;
 
/tags/Racine_livraison_narmer/api/js/dojo/src/DeferredList.js
New file
0,0 → 1,75
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.require("dojo.Deferred");
dojo.provide("dojo.DeferredList");
dojo.DeferredList = function (list, fireOnOneCallback, fireOnOneErrback, consumeErrors, canceller) {
this.list = list;
this.resultList = new Array(this.list.length);
this.chain = [];
this.id = this._nextId();
this.fired = -1;
this.paused = 0;
this.results = [null, null];
this.canceller = canceller;
this.silentlyCancelled = false;
if (this.list.length === 0 && !fireOnOneCallback) {
this.callback(this.resultList);
}
this.finishedCount = 0;
this.fireOnOneCallback = fireOnOneCallback;
this.fireOnOneErrback = fireOnOneErrback;
this.consumeErrors = consumeErrors;
var index = 0;
var _this = this;
dojo.lang.forEach(this.list, function (d) {
var _index = index;
d.addCallback(function (r) {
_this._cbDeferred(_index, true, r);
});
d.addErrback(function (r) {
_this._cbDeferred(_index, false, r);
});
index++;
});
};
dojo.inherits(dojo.DeferredList, dojo.Deferred);
dojo.lang.extend(dojo.DeferredList, {_cbDeferred:function (index, succeeded, result) {
this.resultList[index] = [succeeded, result];
this.finishedCount += 1;
if (this.fired !== 0) {
if (succeeded && this.fireOnOneCallback) {
this.callback([index, result]);
} else {
if (!succeeded && this.fireOnOneErrback) {
this.errback(result);
} else {
if (this.finishedCount == this.list.length) {
this.callback(this.resultList);
}
}
}
}
if (!succeeded && this.consumeErrors) {
result = null;
}
return result;
}, gatherResults:function (deferredList) {
var d = new dojo.DeferredList(deferredList, false, true, false);
d.addCallback(function (results) {
var ret = [];
for (var i = 0; i < results.length; i++) {
ret.push(results[i][1]);
}
return ret;
});
return d;
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/date.js
New file
0,0 → 1,13
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.date");
dojo.deprecated("dojo.date", "use one of the modules in dojo.date.* instead", "0.5");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/validate/common.js
New file
0,0 → 1,94
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.validate.common");
dojo.require("dojo.regexp");
dojo.validate.isText = function (value, flags) {
flags = (typeof flags == "object") ? flags : {};
if (/^\s*$/.test(value)) {
return false;
}
if (typeof flags.length == "number" && flags.length != value.length) {
return false;
}
if (typeof flags.minlength == "number" && flags.minlength > value.length) {
return false;
}
if (typeof flags.maxlength == "number" && flags.maxlength < value.length) {
return false;
}
return true;
};
dojo.validate.isInteger = function (value, flags) {
var re = new RegExp("^" + dojo.regexp.integer(flags) + "$");
return re.test(value);
};
dojo.validate.isRealNumber = function (value, flags) {
var re = new RegExp("^" + dojo.regexp.realNumber(flags) + "$");
return re.test(value);
};
dojo.validate.isCurrency = function (value, flags) {
var re = new RegExp("^" + dojo.regexp.currency(flags) + "$");
return re.test(value);
};
dojo.validate._isInRangeCache = {};
dojo.validate.isInRange = function (value, flags) {
value = value.replace(dojo.lang.has(flags, "separator") ? flags.separator : ",", "", "g").replace(dojo.lang.has(flags, "symbol") ? flags.symbol : "$", "");
if (isNaN(value)) {
return false;
}
flags = (typeof flags == "object") ? flags : {};
var max = (typeof flags.max == "number") ? flags.max : Infinity;
var min = (typeof flags.min == "number") ? flags.min : -Infinity;
var dec = (typeof flags.decimal == "string") ? flags.decimal : ".";
var cache = dojo.validate._isInRangeCache;
var cacheIdx = value + "max" + max + "min" + min + "dec" + dec;
if (typeof cache[cacheIdx] != "undefined") {
return cache[cacheIdx];
}
var pattern = "[^" + dec + "\\deE+-]";
value = value.replace(RegExp(pattern, "g"), "");
value = value.replace(/^([+-]?)(\D*)/, "$1");
value = value.replace(/(\D*)$/, "");
pattern = "(\\d)[" + dec + "](\\d)";
value = value.replace(RegExp(pattern, "g"), "$1.$2");
value = Number(value);
if (value < min || value > max) {
cache[cacheIdx] = false;
return false;
}
cache[cacheIdx] = true;
return true;
};
dojo.validate.isNumberFormat = function (value, flags) {
var re = new RegExp("^" + dojo.regexp.numberFormat(flags) + "$", "i");
return re.test(value);
};
dojo.validate.isValidLuhn = function (value) {
var sum, parity, curDigit;
if (typeof value != "string") {
value = String(value);
}
value = value.replace(/[- ]/g, "");
parity = value.length % 2;
sum = 0;
for (var i = 0; i < value.length; i++) {
curDigit = parseInt(value.charAt(i));
if (i % 2 == parity) {
curDigit *= 2;
}
if (curDigit > 9) {
curDigit -= 9;
}
sum += curDigit;
}
return !(sum % 10);
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/validate/de.js
New file
0,0 → 1,17
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.validate.de");
dojo.require("dojo.validate.common");
dojo.validate.isGermanCurrency = function (value) {
var flags = {symbol:"\u20ac", placement:"after", signPlacement:"begin", decimal:",", separator:"."};
return dojo.validate.isCurrency(value, flags);
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/validate/jp.js
New file
0,0 → 1,17
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.validate.jp");
dojo.require("dojo.validate.common");
dojo.validate.isJapaneseCurrency = function (value) {
var flags = {symbol:"\xa5", fractional:false};
return dojo.validate.isCurrency(value, flags);
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/validate/datetime.js
New file
0,0 → 1,90
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.validate.datetime");
dojo.require("dojo.validate.common");
dojo.validate.isValidTime = function (value, flags) {
dojo.deprecated("dojo.validate.datetime", "use dojo.date.parse instead", "0.5");
var re = new RegExp("^" + dojo.regexp.time(flags) + "$", "i");
return re.test(value);
};
dojo.validate.is12HourTime = function (value) {
dojo.deprecated("dojo.validate.datetime", "use dojo.date.parse instead", "0.5");
return dojo.validate.isValidTime(value, {format:["h:mm:ss t", "h:mm t"]});
};
dojo.validate.is24HourTime = function (value) {
dojo.deprecated("dojo.validate.datetime", "use dojo.date.parse instead", "0.5");
return dojo.validate.isValidTime(value, {format:["HH:mm:ss", "HH:mm"]});
};
dojo.validate.isValidDate = function (dateValue, format) {
dojo.deprecated("dojo.validate.datetime", "use dojo.date.parse instead", "0.5");
if (typeof format == "object" && typeof format.format == "string") {
format = format.format;
}
if (typeof format != "string") {
format = "MM/DD/YYYY";
}
var reLiteral = format.replace(/([$^.*+?=!:|\/\\\(\)\[\]\{\}])/g, "\\$1");
reLiteral = reLiteral.replace("YYYY", "([0-9]{4})");
reLiteral = reLiteral.replace("MM", "(0[1-9]|10|11|12)");
reLiteral = reLiteral.replace("M", "([1-9]|10|11|12)");
reLiteral = reLiteral.replace("DDD", "(00[1-9]|0[1-9][0-9]|[12][0-9][0-9]|3[0-5][0-9]|36[0-6])");
reLiteral = reLiteral.replace("DD", "(0[1-9]|[12][0-9]|30|31)");
reLiteral = reLiteral.replace("D", "([1-9]|[12][0-9]|30|31)");
reLiteral = reLiteral.replace("ww", "(0[1-9]|[1-4][0-9]|5[0-3])");
reLiteral = reLiteral.replace("d", "([1-7])");
reLiteral = "^" + reLiteral + "$";
var re = new RegExp(reLiteral);
if (!re.test(dateValue)) {
return false;
}
var year = 0, month = 1, date = 1, dayofyear = 1, week = 1, day = 1;
var tokens = format.match(/(YYYY|MM|M|DDD|DD|D|ww|d)/g);
var values = re.exec(dateValue);
for (var i = 0; i < tokens.length; i++) {
switch (tokens[i]) {
case "YYYY":
year = Number(values[i + 1]);
break;
case "M":
case "MM":
month = Number(values[i + 1]);
break;
case "D":
case "DD":
date = Number(values[i + 1]);
break;
case "DDD":
dayofyear = Number(values[i + 1]);
break;
case "ww":
week = Number(values[i + 1]);
break;
case "d":
day = Number(values[i + 1]);
break;
}
}
var leapyear = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
if (date == 31 && (month == 4 || month == 6 || month == 9 || month == 11)) {
return false;
}
if (date >= 30 && month == 2) {
return false;
}
if (date == 29 && month == 2 && !leapyear) {
return false;
}
if (dayofyear == 366 && !leapyear) {
return false;
}
return true;
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/validate/check.js
New file
0,0 → 1,232
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.validate.check");
dojo.require("dojo.validate.common");
dojo.require("dojo.lang.common");
dojo.validate.check = function (form, profile) {
var missing = [];
var invalid = [];
var results = {isSuccessful:function () {
return (!this.hasInvalid() && !this.hasMissing());
}, hasMissing:function () {
return (missing.length > 0);
}, getMissing:function () {
return missing;
}, isMissing:function (elemname) {
for (var i = 0; i < missing.length; i++) {
if (elemname == missing[i]) {
return true;
}
}
return false;
}, hasInvalid:function () {
return (invalid.length > 0);
}, getInvalid:function () {
return invalid;
}, isInvalid:function (elemname) {
for (var i = 0; i < invalid.length; i++) {
if (elemname == invalid[i]) {
return true;
}
}
return false;
}};
if (profile.trim instanceof Array) {
for (var i = 0; i < profile.trim.length; i++) {
var elem = form[profile.trim[i]];
if (dj_undef("type", elem) || elem.type != "text" && elem.type != "textarea" && elem.type != "password") {
continue;
}
elem.value = elem.value.replace(/(^\s*|\s*$)/g, "");
}
}
if (profile.uppercase instanceof Array) {
for (var i = 0; i < profile.uppercase.length; i++) {
var elem = form[profile.uppercase[i]];
if (dj_undef("type", elem) || elem.type != "text" && elem.type != "textarea" && elem.type != "password") {
continue;
}
elem.value = elem.value.toUpperCase();
}
}
if (profile.lowercase instanceof Array) {
for (var i = 0; i < profile.lowercase.length; i++) {
var elem = form[profile.lowercase[i]];
if (dj_undef("type", elem) || elem.type != "text" && elem.type != "textarea" && elem.type != "password") {
continue;
}
elem.value = elem.value.toLowerCase();
}
}
if (profile.ucfirst instanceof Array) {
for (var i = 0; i < profile.ucfirst.length; i++) {
var elem = form[profile.ucfirst[i]];
if (dj_undef("type", elem) || elem.type != "text" && elem.type != "textarea" && elem.type != "password") {
continue;
}
elem.value = elem.value.replace(/\b\w+\b/g, function (word) {
return word.substring(0, 1).toUpperCase() + word.substring(1).toLowerCase();
});
}
}
if (profile.digit instanceof Array) {
for (var i = 0; i < profile.digit.length; i++) {
var elem = form[profile.digit[i]];
if (dj_undef("type", elem) || elem.type != "text" && elem.type != "textarea" && elem.type != "password") {
continue;
}
elem.value = elem.value.replace(/\D/g, "");
}
}
if (profile.required instanceof Array) {
for (var i = 0; i < profile.required.length; i++) {
if (!dojo.lang.isString(profile.required[i])) {
continue;
}
var elem = form[profile.required[i]];
if (!dj_undef("type", elem) && (elem.type == "text" || elem.type == "textarea" || elem.type == "password") && /^\s*$/.test(elem.value)) {
missing[missing.length] = elem.name;
} else {
if (!dj_undef("type", elem) && (elem.type == "select-one" || elem.type == "select-multiple") && (elem.selectedIndex == -1 || /^\s*$/.test(elem.options[elem.selectedIndex].value))) {
missing[missing.length] = elem.name;
} else {
if (elem instanceof Array) {
var checked = false;
for (var j = 0; j < elem.length; j++) {
if (elem[j].checked) {
checked = true;
}
}
if (!checked) {
missing[missing.length] = elem[0].name;
}
}
}
}
}
}
if (profile.required instanceof Array) {
for (var i = 0; i < profile.required.length; i++) {
if (!dojo.lang.isObject(profile.required[i])) {
continue;
}
var elem, numRequired;
for (var name in profile.required[i]) {
elem = form[name];
numRequired = profile.required[i][name];
}
if (elem instanceof Array) {
var checked = 0;
for (var j = 0; j < elem.length; j++) {
if (elem[j].checked) {
checked++;
}
}
if (checked < numRequired) {
missing[missing.length] = elem[0].name;
}
} else {
if (!dj_undef("type", elem) && elem.type == "select-multiple") {
var selected = 0;
for (var j = 0; j < elem.options.length; j++) {
if (elem.options[j].selected && !/^\s*$/.test(elem.options[j].value)) {
selected++;
}
}
if (selected < numRequired) {
missing[missing.length] = elem.name;
}
}
}
}
}
if (dojo.lang.isObject(profile.dependencies) || dojo.lang.isObject(profile.dependancies)) {
if (profile["dependancies"]) {
dojo.deprecated("dojo.validate.check", "profile 'dependancies' is deprecated, please use " + "'dependencies'", "0.5");
profile.dependencies = profile.dependancies;
}
for (name in profile.dependencies) {
var elem = form[name];
if (dj_undef("type", elem)) {
continue;
}
if (elem.type != "text" && elem.type != "textarea" && elem.type != "password") {
continue;
}
if (/\S+/.test(elem.value)) {
continue;
}
if (results.isMissing(elem.name)) {
continue;
}
var target = form[profile.dependencies[name]];
if (target.type != "text" && target.type != "textarea" && target.type != "password") {
continue;
}
if (/^\s*$/.test(target.value)) {
continue;
}
missing[missing.length] = elem.name;
}
}
if (dojo.lang.isObject(profile.constraints)) {
for (name in profile.constraints) {
var elem = form[name];
if (!elem) {
continue;
}
if (!dj_undef("tagName", elem) && (elem.tagName.toLowerCase().indexOf("input") >= 0 || elem.tagName.toLowerCase().indexOf("textarea") >= 0) && /^\s*$/.test(elem.value)) {
continue;
}
var isValid = true;
if (dojo.lang.isFunction(profile.constraints[name])) {
isValid = profile.constraints[name](elem.value);
} else {
if (dojo.lang.isArray(profile.constraints[name])) {
if (dojo.lang.isArray(profile.constraints[name][0])) {
for (var i = 0; i < profile.constraints[name].length; i++) {
isValid = dojo.validate.evaluateConstraint(profile, profile.constraints[name][i], name, elem);
if (!isValid) {
break;
}
}
} else {
isValid = dojo.validate.evaluateConstraint(profile, profile.constraints[name], name, elem);
}
}
}
if (!isValid) {
invalid[invalid.length] = elem.name;
}
}
}
if (dojo.lang.isObject(profile.confirm)) {
for (name in profile.confirm) {
var elem = form[name];
var target = form[profile.confirm[name]];
if (dj_undef("type", elem) || dj_undef("type", target) || (elem.type != "text" && elem.type != "textarea" && elem.type != "password") || (target.type != elem.type) || (target.value == elem.value) || (results.isInvalid(elem.name)) || (/^\s*$/.test(target.value))) {
continue;
}
invalid[invalid.length] = elem.name;
}
}
return results;
};
dojo.validate.evaluateConstraint = function (profile, constraint, fieldName, elem) {
var isValidSomething = constraint[0];
var params = constraint.slice(1);
params.unshift(elem.value);
if (typeof isValidSomething != "undefined") {
return isValidSomething.apply(null, params);
}
return false;
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/validate/web.js
New file
0,0 → 1,41
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.validate.web");
dojo.require("dojo.validate.common");
dojo.validate.isIpAddress = function (value, flags) {
var re = new RegExp("^" + dojo.regexp.ipAddress(flags) + "$", "i");
return re.test(value);
};
dojo.validate.isUrl = function (value, flags) {
var re = new RegExp("^" + dojo.regexp.url(flags) + "$", "i");
return re.test(value);
};
dojo.validate.isEmailAddress = function (value, flags) {
var re = new RegExp("^" + dojo.regexp.emailAddress(flags) + "$", "i");
return re.test(value);
};
dojo.validate.isEmailAddressList = function (value, flags) {
var re = new RegExp("^" + dojo.regexp.emailAddressList(flags) + "$", "i");
return re.test(value);
};
dojo.validate.getEmailAddressList = function (value, flags) {
if (!flags) {
flags = {};
}
if (!flags.listSeparator) {
flags.listSeparator = "\\s;,";
}
if (dojo.validate.isEmailAddressList(value, flags)) {
return value.split(new RegExp("\\s*[" + flags.listSeparator + "]\\s*"));
}
return [];
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/validate/creditCard.js
New file
0,0 → 1,62
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.validate.creditCard");
dojo.require("dojo.lang.common");
dojo.require("dojo.validate.common");
dojo.validate.isValidCreditCard = function (value, ccType) {
if (value && ccType && ((ccType.toLowerCase() == "er" || dojo.validate.isValidLuhn(value)) && (dojo.validate.isValidCreditCardNumber(value, ccType.toLowerCase())))) {
return true;
}
return false;
};
dojo.validate.isValidCreditCardNumber = function (value, ccType) {
if (typeof value != "string") {
value = String(value);
}
value = value.replace(/[- ]/g, "");
var results = [];
var cardinfo = {"mc":"5[1-5][0-9]{14}", "ec":"5[1-5][0-9]{14}", "vi":"4([0-9]{12}|[0-9]{15})", "ax":"3[47][0-9]{13}", "dc":"3(0[0-5][0-9]{11}|[68][0-9]{12})", "bl":"3(0[0-5][0-9]{11}|[68][0-9]{12})", "di":"6011[0-9]{12}", "jcb":"(3[0-9]{15}|(2131|1800)[0-9]{11})", "er":"2(014|149)[0-9]{11}"};
if (ccType && dojo.lang.has(cardinfo, ccType.toLowerCase())) {
return Boolean(value.match(cardinfo[ccType.toLowerCase()]));
} else {
for (var p in cardinfo) {
if (value.match("^" + cardinfo[p] + "$") != null) {
results.push(p);
}
}
return (results.length) ? results.join("|") : false;
}
};
dojo.validate.isValidCvv = function (value, ccType) {
if (typeof value != "string") {
value = String(value);
}
var format;
switch (ccType.toLowerCase()) {
case "mc":
case "ec":
case "vi":
case "di":
format = "###";
break;
case "ax":
format = "####";
break;
default:
return false;
}
var flags = {format:format};
if ((value.length == format.length) && (dojo.validate.isNumberFormat(value, flags))) {
return true;
}
return false;
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/validate/__package__.js
New file
0,0 → 1,14
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.require("dojo.validate");
dojo.kwCompoundRequire({common:["dojo.validate.check", "dojo.validate.datetime", "dojo.validate.de", "dojo.validate.jp", "dojo.validate.us", "dojo.validate.web"]});
dojo.provide("dojo.validate.*");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/validate/us.js
New file
0,0 → 1,32
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.validate.us");
dojo.require("dojo.validate.common");
dojo.validate.us.isCurrency = function (value, flags) {
return dojo.validate.isCurrency(value, flags);
};
dojo.validate.us.isState = function (value, flags) {
var re = new RegExp("^" + dojo.regexp.us.state(flags) + "$", "i");
return re.test(value);
};
dojo.validate.us.isPhoneNumber = function (value) {
var flags = {format:["###-###-####", "(###) ###-####", "(###) ### ####", "###.###.####", "###/###-####", "### ### ####", "###-###-#### x#???", "(###) ###-#### x#???", "(###) ### #### x#???", "###.###.#### x#???", "###/###-#### x#???", "### ### #### x#???", "##########"]};
return dojo.validate.isNumberFormat(value, flags);
};
dojo.validate.us.isSocialSecurityNumber = function (value) {
var flags = {format:["###-##-####", "### ## ####", "#########"]};
return dojo.validate.isNumberFormat(value, flags);
};
dojo.validate.us.isZipCode = function (value) {
var flags = {format:["#####-####", "##### ####", "#########", "#####"]};
return dojo.validate.isNumberFormat(value, flags);
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/hostenv_spidermonkey.js
New file
0,0 → 1,48
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.hostenv.name_ = "spidermonkey";
dojo.hostenv.println = print;
dojo.hostenv.exit = function (exitcode) {
quit(exitcode);
};
dojo.hostenv.getVersion = function () {
return version();
};
if (typeof line2pc == "undefined") {
dojo.raise("attempt to use SpiderMonkey host environment when no 'line2pc' global");
}
function dj_spidermonkey_current_file(depth) {
var s = "";
try {
throw Error("whatever");
}
catch (e) {
s = e.stack;
}
var matches = s.match(/[^@]*\.js/gi);
if (!matches) {
dojo.raise("could not parse stack string: '" + s + "'");
}
var fname = (typeof depth != "undefined" && depth) ? matches[depth + 1] : matches[matches.length - 1];
if (!fname) {
dojo.raise("could not find file name in stack string '" + s + "'");
}
return fname;
}
if (!dojo.hostenv.library_script_uri_) {
dojo.hostenv.library_script_uri_ = dj_spidermonkey_current_file(0);
}
dojo.hostenv.loadUri = function (uri) {
var ok = load(uri);
return 1;
};
dojo.requireIf((djConfig["isDebug"] || djConfig["debugAtAllCosts"]), "dojo.debug");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/flash/flash6/flash6_gateway.fla
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/flash/flash6/flash6_gateway.fla
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/flash/flash6/DojoExternalInterface.as
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/flash/flash6/DojoExternalInterface.as
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/flash/flash8/DojoExternalInterface.as
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/flash/flash8/DojoExternalInterface.as
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/flash/flash8/ExpressInstall.as
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/flash/flash8/ExpressInstall.as
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/browser_debug_xd.js
New file
0,0 → 1,36
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.browser_debug_xd");
dojo.nonDebugProvide = dojo.provide;
dojo.provide = function (resourceName) {
var dbgQueue = dojo.hostenv["xdDebugQueue"];
if (dbgQueue && dbgQueue.length > 0 && resourceName == dbgQueue["currentResourceName"]) {
window.setTimeout("dojo.hostenv.xdDebugFileLoaded('" + resourceName + "')", 1);
}
dojo.nonDebugProvide.apply(dojo, arguments);
};
dojo.hostenv.xdDebugFileLoaded = function (resourceName) {
var dbgQueue = this.xdDebugQueue;
if (resourceName && resourceName == dbgQueue.currentResourceName) {
dbgQueue.shift();
}
if (dbgQueue.length == 0) {
dbgQueue.currentResourceName = null;
this.xdNotifyLoaded();
} else {
dbgQueue.currentResourceName = dbgQueue[0].resourceName;
var element = document.createElement("script");
element.type = "text/javascript";
element.src = dbgQueue[0].resourcePath;
document.getElementsByTagName("head")[0].appendChild(element);
}
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/charting/Series.js
New file
0,0 → 1,192
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.charting.Series");
dojo.require("dojo.lang.common");
dojo.require("dojo.charting.Plotters");
dojo.charting.Series = function (kwArgs) {
var args = kwArgs || {length:1};
this.dataSource = args.dataSource || null;
this.bindings = {};
this.color = args.color;
this.label = args.label;
if (args.bindings) {
for (var p in args.bindings) {
this.addBinding(p, args.bindings[p]);
}
}
};
dojo.extend(dojo.charting.Series, {bind:function (src, bindings) {
this.dataSource = src;
this.bindings = bindings;
}, addBinding:function (name, binding) {
this.bindings[name] = binding;
}, evaluate:function (kwArgs) {
var ret = [];
var a = this.dataSource.getData();
var l = a.length;
var start = 0;
var end = l;
if (kwArgs) {
if (kwArgs.between) {
for (var i = 0; i < l; i++) {
var fld = this.dataSource.getField(a[i], kwArgs.between.field);
if (fld >= kwArgs.between.low && fld <= kwArgs.between.high) {
var o = {src:a[i], series:this};
for (var p in this.bindings) {
o[p] = this.dataSource.getField(a[i], this.bindings[p]);
}
ret.push(o);
}
}
} else {
if (kwArgs.from || kwArgs.length) {
if (kwArgs.from) {
start = Math.max(kwArgs.from, 0);
if (kwArgs.to) {
end = Math.min(kwArgs.to, end);
}
} else {
if (kwArgs.length < 0) {
start = Math.max((end + length), 0);
} else {
end = Math.min((start + length), end);
}
}
for (var i = start; i < end; i++) {
var o = {src:a[i], series:this};
for (var p in this.bindings) {
o[p] = this.dataSource.getField(a[i], this.bindings[p]);
}
ret.push(o);
}
}
}
} else {
for (var i = start; i < end; i++) {
var o = {src:a[i], series:this};
for (var p in this.bindings) {
o[p] = this.dataSource.getField(a[i], this.bindings[p]);
}
ret.push(o);
}
}
if (ret.length > 0 && typeof (ret[0].x) != "undefined") {
ret.sort(function (a, b) {
if (a.x > b.x) {
return 1;
}
if (a.x < b.x) {
return -1;
}
return 0;
});
}
return ret;
}, trends:{createRange:function (values, len) {
var idx = values.length - 1;
var length = (len || values.length);
return {"index":idx, "length":length, "start":Math.max(idx - length, 0)};
}, mean:function (values, len) {
var range = this.createRange(values, len);
if (range.index < 0) {
return 0;
}
var total = 0;
var count = 0;
for (var i = range.index; i >= range.start; i--) {
total += values[i].y;
count++;
}
total /= Math.max(count, 1);
return total;
}, variance:function (values, len) {
var range = this.createRange(values, len);
if (range.index < 0) {
return 0;
}
var total = 0;
var square = 0;
var count = 0;
for (var i = range.index; i >= range.start; i--) {
total += values[i].y;
square += Math.pow(values[i].y, 2);
count++;
}
return (square / count) - Math.pow(total / count, 2);
}, standardDeviation:function (values, len) {
return Math.sqrt(this.getVariance(values, len));
}, max:function (values, len) {
var range = this.createRange(values, len);
if (range.index < 0) {
return 0;
}
var max = Number.MIN_VALUE;
for (var i = range.index; i >= range.start; i--) {
max = Math.max(values[i].y, max);
}
return max;
}, min:function (values, len) {
var range = this.createRange(values, len);
if (range.index < 0) {
return 0;
}
var min = Number.MAX_VALUE;
for (var i = range.index; i >= range.start; i--) {
min = Math.min(values[i].y, min);
}
return min;
}, median:function (values, len) {
var range = this.createRange(values, len);
if (range.index < 0) {
return 0;
}
var a = [];
for (var i = range.index; i >= range.start; i--) {
var b = false;
for (var j = 0; j < a.length; j++) {
if (values[i].y == a[j]) {
b = true;
break;
}
}
if (!b) {
a.push(values[i].y);
}
}
a.sort();
if (a.length > 0) {
return a[Math.ceil(a.length / 2)];
}
return 0;
}, mode:function (values, len) {
var range = this.createRange(values, len);
if (range.index < 0) {
return 0;
}
var o = {};
var ret = 0;
var median = Number.MIN_VALUE;
for (var i = range.index; i >= range.start; i--) {
if (!o[values[i].y]) {
o[values[i].y] = 1;
} else {
o[values[i].y]++;
}
}
for (var p in o) {
if (median < o[p]) {
median = o[p];
ret = p;
}
}
return ret;
}}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/charting/Plotters.js
New file
0,0 → 1,14
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.charting.Plotters");
dojo.requireIf(dojo.render.svg.capable, "dojo.charting.svg.Plotters");
dojo.requireIf(dojo.render.vml.capable, "dojo.charting.vml.Plotters");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/charting/Plot.js
New file
0,0 → 1,80
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.charting.Plot");
dojo.require("dojo.lang.common");
dojo.require("dojo.charting.Axis");
dojo.require("dojo.charting.Series");
dojo.charting.RenderPlotSeries = {Singly:"single", Grouped:"grouped"};
dojo.charting.Plot = function (xaxis, yaxis, series) {
var id = "dojo-charting-plot-" + dojo.charting.Plot.count++;
this.getId = function () {
return id;
};
this.setId = function (key) {
id = key;
};
this.axisX = null;
this.axisY = null;
this.series = [];
this.dataNode = null;
this.renderType = dojo.charting.RenderPlotSeries.Singly;
if (xaxis) {
this.setAxis(xaxis, "x");
}
if (yaxis) {
this.setAxis(yaxis, "y");
}
if (series) {
for (var i = 0; i < series.length; i++) {
this.addSeries(series[i]);
}
}
};
dojo.charting.Plot.count = 0;
dojo.extend(dojo.charting.Plot, {addSeries:function (series, plotter) {
if (series.plotter) {
this.series.push(series);
} else {
this.series.push({data:series, plotter:plotter || dojo.charting.Plotters["Default"]});
}
}, setAxis:function (axis, which) {
if (which.toLowerCase() == "x") {
this.axisX = axis;
} else {
if (which.toLowerCase() == "y") {
this.axisY = axis;
}
}
}, getRanges:function () {
var xmin, xmax, ymin, ymax;
xmin = ymin = Number.MAX_VALUE;
xmax = ymax = Number.MIN_VALUE;
for (var i = 0; i < this.series.length; i++) {
var values = this.series[i].data.evaluate();
for (var j = 0; j < values.length; j++) {
var comp = values[j];
xmin = Math.min(comp.x, xmin);
ymin = Math.min(comp.y, ymin);
xmax = Math.max(comp.x, xmax);
ymax = Math.max(comp.y, ymax);
}
}
return {x:{upper:xmax, lower:xmin}, y:{upper:ymax, lower:ymin}, toString:function () {
return "[ x:" + xmax + " - " + xmin + ", y:" + ymax + " - " + ymin + "]";
}};
}, destroy:function () {
var node = this.dataNode;
while (node && node.childNodes && node.childNodes.length > 0) {
node.removeChild(node.childNodes[0]);
}
this.dataNode = null;
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/charting/README.txt
New file
0,0 → 1,46
Dojo Charting Engine
=========================================================================
The Dojo Charting Engine is a (fairly) complex object structure, designed
to provide as much flexibility as possible in terms of chart construction.
To this end, the engine details the following structure:
 
Chart
---PlotArea[]
------Plot[]
---------Axis (axisX)
---------Axis (axisY)
---------Series[]
 
 
A Chart object is the main entity; it is the entire graphic. A Chart may
have any number of PlotArea objects, which are the basic canvas against
which data is plotted. A PlotArea may have any number of Plot objects,
which is a container representing up to 2 axes and any number of series
to be plotted against those axes; a Series represents a binding against
two fields from a data source (initial rev, this data source is always of
type dojo.collections.Store but this will probably change once dojo.data
is in production).
 
The point of this structure is to allow for as much flexibility as possible
in terms of what kinds of charts can be represented by the engine. The
current plan is to accomodate up to analytical financial charts, which tend
to have 3 plot areas and any number of different types of axes on each one.
 
The main exception to this is the pie chart, which will have it's own
custom codebase. Also, 3D charts are not accounted for at this time,
although the only thing that will probably need to be altered to make
that work would be Plot and Series (to accomodate the additional Z axis).
 
Finally, a Plot will render its series[] through the use of Plotters, which
are custom methods to render specific types of charts.
-------------------------------------------------------------------------
In terms of widgets, the basic concept is that there is a central, super-
flexible Chart widget (Chart, oddly enough), and then any number of preset
chart type widgets, that are basically built to serve a simple, easy
purpose. For instance, if someone just needs to plot a series of lines,
they would be better off using the LineChart widget; but if someone needed
to plot a combo chart, that has 2 Y Axes (one linear, one log) against the
same X Axis, using lines and areas, then they will want to use a Chart widget.
Note also that unlike other widgets, the Charting engine *can* be called
directly from script *without* the need for the actual widget engine to be
loaded; the Chart widgets are thin wrappers around the charting engine.
/tags/Racine_livraison_narmer/api/js/dojo/src/charting/Chart.js
New file
0,0 → 1,62
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.charting.Chart");
dojo.require("dojo.lang.common");
dojo.require("dojo.charting.PlotArea");
dojo.charting.Chart = function (node, title, description) {
this.node = node || null;
this.title = title || "Chart";
this.description = description || "";
this.plotAreas = [];
};
dojo.extend(dojo.charting.Chart, {addPlotArea:function (obj, doRender) {
if (obj.x != null && obj.left == null) {
obj.left = obj.x;
}
if (obj.y != null && obj.top == null) {
obj.top = obj.y;
}
this.plotAreas.push(obj);
if (doRender) {
this.render();
}
}, onInitialize:function (chart) {
}, onRender:function (chart) {
}, onDestroy:function (chart) {
}, initialize:function () {
if (!this.node) {
dojo.raise("dojo.charting.Chart.initialize: there must be a root node defined for the Chart.");
}
this.destroy();
this.render();
this.onInitialize(this);
}, render:function () {
if (this.node.style.position != "absolute") {
this.node.style.position = "relative";
}
for (var i = 0; i < this.plotAreas.length; i++) {
var area = this.plotAreas[i].plotArea;
var node = area.initialize();
node.style.position = "absolute";
node.style.top = this.plotAreas[i].top + "px";
node.style.left = this.plotAreas[i].left + "px";
this.node.appendChild(node);
area.render();
}
}, destroy:function () {
for (var i = 0; i < this.plotAreas.length; i++) {
this.plotAreas[i].plotArea.destroy();
}
while (this.node && this.node.childNodes && this.node.childNodes.length > 0) {
this.node.removeChild(this.node.childNodes[0]);
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/charting/vml/Axis.js
New file
0,0 → 1,237
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.charting.vml.Axis");
dojo.require("dojo.lang.common");
if (dojo.render.vml.capable) {
dojo.extend(dojo.charting.Axis, {renderLines:function (plotArea, plot, plane) {
if (this.nodes.lines) {
while (this.nodes.lines.childNodes.length > 0) {
this.nodes.lines.removeChild(this.nodes.lines.childNodes[0]);
}
if (this.nodes.lines.parentNode) {
this.nodes.lines.parentNode.removeChild(this.nodes.lines);
this.nodes.lines = null;
}
}
var area = plotArea.getArea();
var g = this.nodes.lines = document.createElement("div");
g.setAttribute("id", this.getId() + "-lines");
for (var i = 0; i < this._labels.length; i++) {
if (this._labels[i].value == this.origin) {
continue;
}
var v = this.getCoord(this._labels[i].value, plotArea, plot);
var l = document.createElement("v:line");
var str = document.createElement("v:stroke");
str.dashstyle = "dot";
l.appendChild(str);
l.setAttribute("strokecolor", "#666");
l.setAttribute("strokeweight", "1px");
var s = l.style;
s.position = "absolute";
s.top = "0px";
s.left = "0px";
s.antialias = "false";
if (plane == "x") {
l.setAttribute("from", v + "px," + area.top + "px");
l.setAttribute("to", v + "px," + area.bottom + "px");
} else {
if (plane == "y") {
l.setAttribute("from", area.left + "px," + v + "px");
l.setAttribute("to", area.right + "px," + v + "px");
}
}
g.appendChild(l);
}
return g;
}, renderTicks:function (plotArea, plot, plane, coord) {
if (this.nodes.ticks) {
while (this.nodes.ticks.childNodes.length > 0) {
this.nodes.ticks.removeChild(this.nodes.ticks.childNodes[0]);
}
if (this.nodes.ticks.parentNode) {
this.nodes.ticks.parentNode.removeChild(this.nodes.ticks);
this.nodes.ticks = null;
}
}
var g = this.nodes.ticks = document.createElement("div");
g.setAttribute("id", this.getId() + "-ticks");
for (var i = 0; i < this._labels.length; i++) {
var v = this.getCoord(this._labels[i].value, plotArea, plot);
var l = document.createElement("v:line");
l.setAttribute("strokecolor", "#000");
l.setAttribute("strokeweight", "1px");
var s = l.style;
s.position = "absolute";
s.top = "0px";
s.left = "0px";
s.antialias = "false";
if (plane == "x") {
l.setAttribute("from", v + "px," + coord + "px");
l.setAttribute("to", v + "px," + (coord + 3) + "px");
} else {
if (plane == "y") {
l.setAttribute("from", (coord - 2) + "px," + v + "px");
l.setAttribute("to", (coord + 2) + "px," + v + "px");
}
}
g.appendChild(l);
}
return g;
}, renderLabels:function (plotArea, plot, plane, coord, textSize, anchor) {
function createLabel(label, x, y, textSize, anchor) {
var text = document.createElement("div");
var s = text.style;
text.innerHTML = label;
s.fontSize = textSize + "px";
s.fontFamily = "sans-serif";
s.position = "absolute";
s.top = y + "px";
if (anchor == "center") {
s.left = x + "px";
s.textAlign = "center";
} else {
if (anchor == "left") {
s.left = x + "px";
s.textAlign = "left";
} else {
if (anchor == "right") {
s.right = x + "px";
s.textAlign = "right";
}
}
}
return text;
}
if (this.nodes.labels) {
while (this.nodes.labels.childNodes.length > 0) {
this.nodes.labels.removeChild(this.nodes.labels.childNodes[0]);
}
if (this.nodes.labels.parentNode) {
this.nodes.labels.parentNode.removeChild(this.nodes.labels);
this.nodes.labels = null;
}
}
var g = this.nodes.labels = document.createElement("div");
g.setAttribute("id", this.getId() + "-labels");
for (var i = 0; i < this._labels.length; i++) {
var v = this.getCoord(this._labels[i].value, plotArea, plot);
if (plane == "x") {
var node = createLabel(this._labels[i].label, v, coord, textSize, anchor);
document.body.appendChild(node);
node.style.left = v - (node.offsetWidth / 2) + "px";
g.appendChild(node);
} else {
if (plane == "y") {
var node = createLabel(this._labels[i].label, coord, v, textSize, anchor);
document.body.appendChild(node);
node.style.top = v - (node.offsetHeight / 2) + "px";
g.appendChild(node);
}
}
}
return g;
}, render:function (plotArea, plot, drawAgainst, plane) {
if (!this._rerender && this.nodes.main) {
return this.nodes.main;
}
this._rerender = false;
var area = plotArea.getArea();
var stroke = 1;
var style = "stroke:#000;stroke-width:" + stroke + "px;";
var textSize = 10;
var coord = drawAgainst.getCoord(this.origin, plotArea, plot);
var g = this.nodes.main = document.createElement("div");
g.setAttribute("id", this.getId());
var line = this.nodes.axis = document.createElement("v:line");
line.setAttribute("strokecolor", "#000");
line.setAttribute("strokeweight", stroke + "px");
var s = line.style;
s.position = "absolute";
s.top = "0px";
s.left = "0px";
s.antialias = "false";
if (plane == "x") {
line.setAttribute("from", area.left + "px," + coord + "px");
line.setAttribute("to", area.right + "px," + coord + "px");
var y = coord + Math.floor(textSize / 2);
if (this.showLines) {
g.appendChild(this.renderLines(plotArea, plot, plane, y));
}
if (this.showTicks) {
g.appendChild(this.renderTicks(plotArea, plot, plane, coord));
}
if (this.showLabels) {
g.appendChild(this.renderLabels(plotArea, plot, plane, y, textSize, "center"));
}
if (this.showLabel && this.label) {
var x = plotArea.size.width / 2;
var y = coord + Math.round(textSize * 1.5);
var text = document.createElement("div");
var s = text.style;
text.innerHTML = this.label;
s.fontSize = (textSize + 2) + "px";
s.fontFamily = "sans-serif";
s.fontWeight = "bold";
s.position = "absolute";
s.top = y + "px";
s.left = x + "px";
s.textAlign = "center";
document.body.appendChild(text);
text.style.left = x - (text.offsetWidth / 2) + "px";
g.appendChild(text);
}
} else {
line.setAttribute("from", coord + "px," + area.top + "px");
line.setAttribute("to", coord + "px," + area.bottom + "px");
var isMax = this.origin == drawAgainst.range.upper;
var x = coord + 4;
var anchor = "left";
if (!isMax) {
x = area.right - coord + textSize + 4;
anchor = "right";
if (coord == area.left) {
x += (textSize * 2) - (textSize / 2);
}
}
if (this.showLines) {
g.appendChild(this.renderLines(plotArea, plot, plane, x));
}
if (this.showTicks) {
g.appendChild(this.renderTicks(plotArea, plot, plane, coord));
}
if (this.showLabels) {
g.appendChild(this.renderLabels(plotArea, plot, plane, x, textSize, anchor));
}
if (this.showLabel && this.label) {
x += (textSize * 2) - 2;
var y = plotArea.size.height / 2;
var text = document.createElement("div");
var s = text.style;
text.innerHTML = this.label;
s.fontSize = (textSize + 2) + "px";
s.fontFamily = "sans-serif";
s.fontWeight = "bold";
s.position = "absolute";
s.height = plotArea.size.height + "px";
s.writingMode = "tb-rl";
s.textAlign = "center";
s[anchor] = x + "px";
document.body.appendChild(text);
s.top = y - (text.offsetHeight / 2) + "px";
g.appendChild(text);
}
}
g.appendChild(line);
return g;
}});
}
 
/tags/Racine_livraison_narmer/api/js/dojo/src/charting/vml/PlotArea.js
New file
0,0 → 1,67
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.charting.vml.PlotArea");
dojo.require("dojo.lang.common");
if (dojo.render.vml.capable) {
dojo.extend(dojo.charting.PlotArea, {resize:function () {
var a = this.getArea();
this.nodes.area.style.width = this.size.width + "px";
this.nodes.area.style.height = this.size.height + "px";
this.nodes.background.style.width = this.size.width + "px";
this.nodes.background.style.height = this.size.height + "px";
this.nodes.plots.width = this.size.width + "px";
this.nodes.plots.height = this.size.height + "px";
this.nodes.plots.style.clip = "rect(" + a.top + " " + a.right + " " + a.bottom + " " + a.left + ")";
if (this.nodes.axes) {
this.nodes.area.removeChild(this.nodes.axes);
}
var axes = this.nodes.axes = document.createElement("div");
axes.id = this.getId() + "-axes";
this.nodes.area.appendChild(axes);
var ax = this.getAxes();
for (var p in ax) {
var obj = ax[p];
axes.appendChild(obj.axis.initialize(this, obj.plot, obj.drawAgainst, obj.plane));
}
}, initializePlot:function (plot) {
plot.destroy();
plot.dataNode = document.createElement("div");
plot.dataNode.id = plot.getId();
return plot.dataNode;
}, initialize:function () {
this.destroy();
var main = this.nodes.main = document.createElement("div");
var area = this.nodes.area = document.createElement("div");
area.id = this.getId();
area.style.position = "absolute";
main.appendChild(area);
var bg = this.nodes.background = document.createElement("div");
bg.id = this.getId() + "-background";
bg.style.position = "absolute";
bg.style.top = "0px";
bg.style.left = "0px";
bg.style.backgroundColor = "#fff";
area.appendChild(bg);
var a = this.getArea();
var plots = this.nodes.plots = document.createElement("div");
plots.id = this.getId() + "-plots";
plots.style.position = "absolute";
plots.style.top = "0px";
plots.style.left = "0px";
area.appendChild(plots);
for (var i = 0; i < this.plots.length; i++) {
plots.appendChild(this.initializePlot(this.plots[i]));
}
this.resize();
return main;
}});
}
 
/tags/Racine_livraison_narmer/api/js/dojo/src/charting/vml/Plotters.js
New file
0,0 → 1,887
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.charting.vml.Plotters");
dojo.require("dojo.lang.common");
if (dojo.render.vml.capable) {
dojo.mixin(dojo.charting.Plotters, {_group:function (plotarea) {
var group = document.createElement("div");
group.style.position = "absolute";
group.style.top = "0px";
group.style.left = "0px";
group.style.width = plotarea.size.width + "px";
group.style.height = plotarea.size.height + "px";
return group;
}, Bar:function (plotarea, plot, kwArgs, applyTo) {
var area = plotarea.getArea();
var group = dojo.charting.Plotters._group(plotarea);
var n = plot.series.length;
var data = [];
for (var i = 0; i < n; i++) {
var tmp = plot.series[i].data.evaluate(kwArgs);
data.push(tmp);
}
var space = 8;
var nPoints = data[0].length;
if (nPoints == 0) {
return group;
}
var width = ((area.right - area.left) - (space * (nPoints - 1))) / nPoints;
var barWidth = Math.round(width / n);
var yOrigin = plot.axisY.getCoord(plot.axisX.origin, plotarea, plot);
for (var i = 0; i < nPoints; i++) {
var xStart = area.left + (width * i) + (space * i);
for (var j = 0; j < n; j++) {
var value = data[j][i].y;
var yA = yOrigin;
var x = xStart + (barWidth * j);
var y = plot.axisY.getCoord(value, plotarea, plot);
var h = Math.abs(yA - y);
if (value < plot.axisX.origin) {
yA = y;
y = yOrigin;
}
var bar = document.createElement("v:rect");
bar.style.position = "absolute";
bar.style.top = y + 1 + "px";
bar.style.left = x + "px";
bar.style.width = barWidth + "px";
bar.style.height = h + "px";
bar.setAttribute("fillColor", data[j][i].series.color);
bar.setAttribute("stroked", "false");
bar.style.antialias = "false";
var fill = document.createElement("v:fill");
fill.setAttribute("opacity", "0.6");
bar.appendChild(fill);
if (applyTo) {
applyTo(bar, data[j][i].src);
}
group.appendChild(bar);
}
}
return group;
}, HorizontalBar:function (plotarea, plot, kwArgs, applyTo) {
var area = plotarea.getArea();
var group = dojo.charting.Plotters._group(plotarea);
var n = plot.series.length;
var data = [];
for (var i = 0; i < n; i++) {
var tmp = plot.series[i].data.evaluate(kwArgs);
data.push(tmp);
}
var space = 6;
var nPoints = data[0].length;
if (nPoints == 0) {
return group;
}
var h = ((area.bottom - area.top) - (space * (nPoints - 1))) / nPoints;
var barH = h / n;
var xOrigin = plot.axisX.getCoord(0, plotarea, plot);
for (var i = 0; i < nPoints; i++) {
var yStart = area.top + (h * i) + (space * i);
for (var j = 0; j < n; j++) {
var value = data[j][i].y;
var y = yStart + (barH * j);
var xA = xOrigin;
var x = plot.axisX.getCoord(value, plotarea, plot);
var w = Math.abs(x - xA);
if (value > 0) {
x = xOrigin;
}
var bar = document.createElement("v:rect");
bar.style.position = "absolute";
bar.style.top = y + 1 + "px";
bar.style.left = xA + "px";
bar.style.width = w + "px";
bar.style.height = barH + "px";
bar.setAttribute("fillColor", data[j][i].series.color);
bar.setAttribute("stroked", "false");
bar.style.antialias = "false";
var fill = document.createElement("v:fill");
fill.setAttribute("opacity", "0.6");
bar.appendChild(fill);
if (applyTo) {
applyTo(bar, data[j][i].src);
}
group.appendChild(bar);
}
}
var space = 4;
var n = plot.series.length;
var h = ((area.bottom - area.top) - (space * (n - 1))) / n;
var xOrigin = plot.axisX.getCoord(0, plotarea, plot);
for (var i = 0; i < n; i++) {
var series = plot.series[i];
var data = series.data.evaluate(kwArgs);
var y = area.top + (h * i) + (space * i);
var value = data[data.length - 1].y;
var xA = xOrigin;
var x = plot.axisX.getCoord(value, plotarea, plot);
var w = Math.abs(xA - x);
if (value > 0) {
xA = x;
x = xOrigin;
}
}
return group;
}, Gantt:function (plotarea, plot, kwArgs, applyTo) {
var area = plotarea.getArea();
var group = dojo.charting.Plotters._group(plotarea);
var n = plot.series.length;
var data = [];
for (var i = 0; i < n; i++) {
var tmp = plot.series[i].data.evaluate(kwArgs);
data.push(tmp);
}
var space = 2;
var nPoints = data[0].length;
if (nPoints == 0) {
return group;
}
var h = ((area.bottom - area.top) - (space * (nPoints - 1))) / nPoints;
var barH = h / n;
for (var i = 0; i < nPoints; i++) {
var yStart = area.top + (h * i) + (space * i);
for (var j = 0; j < n; j++) {
var high = data[j][i].high;
var low = data[j][i].low;
if (low > high) {
var t = high;
high = low;
low = t;
}
var x = plot.axisX.getCoord(low, plotarea, plot);
var w = plot.axisX.getCoord(high, plotarea, plot) - x;
var y = yStart + (barH * j);
var bar = document.createElement("v:rect");
bar.style.position = "absolute";
bar.style.top = y + 1 + "px";
bar.style.left = x + "px";
bar.style.width = w + "px";
bar.style.height = barH + "px";
bar.setAttribute("fillColor", data[j][i].series.color);
bar.setAttribute("stroked", "false");
bar.style.antialias = "false";
var fill = document.createElement("v:fill");
fill.setAttribute("opacity", "0.6");
bar.appendChild(fill);
if (applyTo) {
applyTo(bar, data[j][i].src);
}
group.appendChild(bar);
}
}
return group;
}, StackedArea:function (plotarea, plot, kwArgs, applyTo) {
var area = plotarea.getArea();
var group = dojo.charting.Plotters._group(plotarea);
var n = plot.series.length;
var data = [];
var totals = [];
for (var i = 0; i < n; i++) {
var tmp = plot.series[i].data.evaluate(kwArgs);
for (var j = 0; j < tmp.length; j++) {
if (i == 0) {
totals.push(tmp[j].y);
} else {
totals[j] += tmp[j].y;
}
tmp[j].y = totals[j];
}
data.push(tmp);
}
for (var i = n - 1; i >= 0; i--) {
var path = document.createElement("v:shape");
path.setAttribute("strokeweight", "1px");
path.setAttribute("strokecolor", data[i][0].series.color);
path.setAttribute("fillcolor", data[i][0].series.color);
path.setAttribute("coordsize", (area.right - area.left) + "," + (area.bottom - area.top));
path.style.position = "absolute";
path.style.top = "0px";
path.style.left = "0px";
path.style.width = area.right - area.left + "px";
path.style.height = area.bottom - area.top + "px";
var stroke = document.createElement("v:stroke");
stroke.setAttribute("opacity", "0.8");
path.appendChild(stroke);
var fill = document.createElement("v:fill");
fill.setAttribute("opacity", "0.4");
path.appendChild(fill);
var cmd = [];
var r = 3;
for (var j = 0; j < data[i].length; j++) {
var values = data[i];
var x = Math.round(plot.axisX.getCoord(values[j].x, plotarea, plot));
var y = Math.round(plot.axisY.getCoord(values[j].y, plotarea, plot));
if (j == 0) {
cmd.push("m");
cmd.push(x + "," + y);
} else {
cmd.push("l");
cmd.push(x + "," + y);
}
var c = document.createElement("v:oval");
c.setAttribute("strokeweight", "1px");
c.setAttribute("strokecolor", values[j].series.color);
c.setAttribute("fillcolor", values[j].series.color);
var str = document.createElement("v:stroke");
str.setAttribute("opacity", "0.8");
c.appendChild(str);
str = document.createElement("v:fill");
str.setAttribute("opacity", "0.6");
c.appendChild(str);
var s = c.style;
s.position = "absolute";
s.top = (y - r) + "px";
s.left = (x - r) + "px";
s.width = (r * 2) + "px";
s.height = (r * 2) + "px";
group.appendChild(c);
if (applyTo) {
applyTo(c, data[j].src);
}
}
if (i == 0) {
cmd.push("l");
cmd.push(x + "," + Math.round(plot.axisY.getCoord(plot.axisX.origin, plotarea, plot)));
cmd.push("l");
cmd.push(Math.round(plot.axisX.getCoord(data[0][0].x, plotarea, plot)) + "," + Math.round(plot.axisY.getCoord(plot.axisX.origin, plotarea, plot)));
} else {
var values = data[i - 1];
cmd.push("l");
cmd.push(x + "," + Math.round(plot.axisY.getCoord(values[values.length - 1].y, plotarea, plot)));
for (var j = values.length - 2; j >= 0; j--) {
var x = Math.round(plot.axisX.getCoord(values[j].x, plotarea, plot));
var y = Math.round(plot.axisY.getCoord(values[j].y, plotarea, plot));
cmd.push("l");
cmd.push(x + "," + y);
}
}
path.setAttribute("path", cmd.join(" ") + " x e");
group.appendChild(path);
}
return group;
}, StackedCurvedArea:function (plotarea, plot, kwArgs, applyTo) {
var tension = 3;
var area = plotarea.getArea();
var group = dojo.charting.Plotters._group(plotarea);
var n = plot.series.length;
var data = [];
var totals = [];
for (var i = 0; i < n; i++) {
var tmp = plot.series[i].data.evaluate(kwArgs);
for (var j = 0; j < tmp.length; j++) {
if (i == 0) {
totals.push(tmp[j].y);
} else {
totals[j] += tmp[j].y;
}
tmp[j].y = totals[j];
}
data.push(tmp);
}
for (var i = n - 1; i >= 0; i--) {
var path = document.createElement("v:shape");
path.setAttribute("strokeweight", "1px");
path.setAttribute("strokecolor", data[i][0].series.color);
path.setAttribute("fillcolor", data[i][0].series.color);
path.setAttribute("coordsize", (area.right - area.left) + "," + (area.bottom - area.top));
path.style.position = "absolute";
path.style.top = "0px";
path.style.left = "0px";
path.style.width = area.right - area.left + "px";
path.style.height = area.bottom - area.top + "px";
var stroke = document.createElement("v:stroke");
stroke.setAttribute("opacity", "0.8");
path.appendChild(stroke);
var fill = document.createElement("v:fill");
fill.setAttribute("opacity", "0.4");
path.appendChild(fill);
var cmd = [];
var r = 3;
for (var j = 0; j < data[i].length; j++) {
var values = data[i];
var x = Math.round(plot.axisX.getCoord(values[j].x, plotarea, plot));
var y = Math.round(plot.axisY.getCoord(values[j].y, plotarea, plot));
if (j == 0) {
cmd.push("m");
cmd.push(x + "," + y);
} else {
var lastx = Math.round(plot.axisX.getCoord(values[j - 1].x, plotarea, plot));
var lasty = Math.round(plot.axisY.getCoord(values[j - 1].y, plotarea, plot));
var dx = x - lastx;
var dy = y - lasty;
cmd.push("c");
var cx = Math.round((x - (tension - 1) * (dx / tension)));
cmd.push(cx + "," + lasty);
cx = Math.round((x - (dx / tension)));
cmd.push(cx + "," + y);
cmd.push(x + "," + y);
}
var c = document.createElement("v:oval");
c.setAttribute("strokeweight", "1px");
c.setAttribute("strokecolor", values[j].series.color);
c.setAttribute("fillcolor", values[j].series.color);
var str = document.createElement("v:stroke");
str.setAttribute("opacity", "0.8");
c.appendChild(str);
str = document.createElement("v:fill");
str.setAttribute("opacity", "0.6");
c.appendChild(str);
var s = c.style;
s.position = "absolute";
s.top = (y - r) + "px";
s.left = (x - r) + "px";
s.width = (r * 2) + "px";
s.height = (r * 2) + "px";
group.appendChild(c);
if (applyTo) {
applyTo(c, data[j].src);
}
}
if (i == 0) {
cmd.push("l");
cmd.push(x + "," + Math.round(plot.axisY.getCoord(plot.axisX.origin, plotarea, plot)));
cmd.push("l");
cmd.push(Math.round(plot.axisX.getCoord(data[0][0].x, plotarea, plot)) + "," + Math.round(plot.axisY.getCoord(plot.axisX.origin, plotarea, plot)));
} else {
var values = data[i - 1];
cmd.push("l");
cmd.push(x + "," + Math.round(plot.axisY.getCoord(values[values.length - 1].y, plotarea, plot)));
for (var j = values.length - 2; j >= 0; j--) {
var x = Math.round(plot.axisX.getCoord(values[j].x, plotarea, plot));
var y = Math.round(plot.axisY.getCoord(values[j].y, plotarea, plot));
var lastx = Math.round(plot.axisX.getCoord(values[j + 1].x, plotarea, plot));
var lasty = Math.round(plot.axisY.getCoord(values[j + 1].y, plotarea, plot));
var dx = x - lastx;
var dy = y - lasty;
cmd.push("c");
var cx = Math.round((x - (tension - 1) * (dx / tension)));
cmd.push(cx + "," + lasty);
cx = Math.round((x - (dx / tension)));
cmd.push(cx + "," + y);
cmd.push(x + "," + y);
}
}
path.setAttribute("path", cmd.join(" ") + " x e");
group.appendChild(path);
}
return group;
}, DataBar:function (data, plotarea, plot, applyTo) {
var area = plotarea.getArea();
var group = dojo.charting.Plotters._group(plotarea);
var n = data.length;
var w = (area.right - area.left) / (plot.axisX.range.upper - plot.axisX.range.lower);
var yOrigin = plot.axisY.getCoord(plot.axisX.origin, plotarea, plot);
for (var i = 0; i < n; i++) {
var value = data[i].y;
var yA = yOrigin;
var x = plot.axisX.getCoord(data[i].x, plotarea, plot) - (w / 2) + 1;
var y = plot.axisY.getCoord(value, plotarea, plot);
var h = Math.abs(yA - y);
if (value < plot.axisX.origin) {
yA = y;
y = yOrigin;
}
var bar = document.createElement("v:rect");
bar.style.position = "absolute";
bar.style.top = y + 1 + "px";
bar.style.left = x + "px";
bar.style.width = w + "px";
bar.style.height = h + "px";
bar.setAttribute("fillColor", data[i].series.color);
bar.setAttribute("stroked", "false");
bar.style.antialias = "false";
var fill = document.createElement("v:fill");
fill.setAttribute("opacity", "0.6");
bar.appendChild(fill);
if (applyTo) {
applyTo(bar, data[i].src);
}
group.appendChild(bar);
}
return group;
}, Line:function (data, plotarea, plot, applyTo) {
var area = plotarea.getArea();
var group = dojo.charting.Plotters._group(plotarea);
if (data.length == 0) {
return group;
}
var path = document.createElement("v:shape");
path.setAttribute("strokeweight", "2px");
path.setAttribute("strokecolor", data[0].series.color);
path.setAttribute("fillcolor", "none");
path.setAttribute("filled", "false");
path.setAttribute("coordsize", (area.right - area.left) + "," + (area.bottom - area.top));
path.style.position = "absolute";
path.style.top = "0px";
path.style.left = "0px";
path.style.width = area.right - area.left + "px";
path.style.height = area.bottom - area.top + "px";
var stroke = document.createElement("v:stroke");
stroke.setAttribute("opacity", "0.8");
path.appendChild(stroke);
var cmd = [];
var r = 3;
for (var i = 0; i < data.length; i++) {
var x = Math.round(plot.axisX.getCoord(data[i].x, plotarea, plot));
var y = Math.round(plot.axisY.getCoord(data[i].y, plotarea, plot));
if (i == 0) {
cmd.push("m");
cmd.push(x + "," + y);
} else {
cmd.push("l");
cmd.push(x + "," + y);
}
var c = document.createElement("v:oval");
c.setAttribute("strokeweight", "1px");
c.setAttribute("strokecolor", data[i].series.color);
c.setAttribute("fillcolor", data[i].series.color);
var str = document.createElement("v:stroke");
str.setAttribute("opacity", "0.8");
c.appendChild(str);
str = document.createElement("v:fill");
str.setAttribute("opacity", "0.6");
c.appendChild(str);
var s = c.style;
s.position = "absolute";
s.top = (y - r) + "px";
s.left = (x - r) + "px";
s.width = (r * 2) + "px";
s.height = (r * 2) + "px";
group.appendChild(c);
if (applyTo) {
applyTo(c, data[i].src);
}
}
path.setAttribute("path", cmd.join(" ") + " e");
group.appendChild(path);
return group;
}, CurvedLine:function (data, plotarea, plot, applyTo) {
var tension = 3;
var area = plotarea.getArea();
var group = dojo.charting.Plotters._group(plotarea);
if (data.length == 0) {
return group;
}
var path = document.createElement("v:shape");
path.setAttribute("strokeweight", "2px");
path.setAttribute("strokecolor", data[0].series.color);
path.setAttribute("fillcolor", "none");
path.setAttribute("filled", "false");
path.setAttribute("coordsize", (area.right - area.left) + "," + (area.bottom - area.top));
path.style.position = "absolute";
path.style.top = "0px";
path.style.left = "0px";
path.style.width = area.right - area.left + "px";
path.style.height = area.bottom - area.top + "px";
var stroke = document.createElement("v:stroke");
stroke.setAttribute("opacity", "0.8");
path.appendChild(stroke);
var cmd = [];
var r = 3;
for (var i = 0; i < data.length; i++) {
var x = Math.round(plot.axisX.getCoord(data[i].x, plotarea, plot));
var y = Math.round(plot.axisY.getCoord(data[i].y, plotarea, plot));
if (i == 0) {
cmd.push("m");
cmd.push(x + "," + y);
} else {
var lastx = Math.round(plot.axisX.getCoord(data[i - 1].x, plotarea, plot));
var lasty = Math.round(plot.axisY.getCoord(data[i - 1].y, plotarea, plot));
var dx = x - lastx;
var dy = y - lasty;
cmd.push("c");
var cx = Math.round((x - (tension - 1) * (dx / tension)));
cmd.push(cx + "," + lasty);
cx = Math.round((x - (dx / tension)));
cmd.push(cx + "," + y);
cmd.push(x + "," + y);
}
var c = document.createElement("v:oval");
c.setAttribute("strokeweight", "1px");
c.setAttribute("strokecolor", data[i].series.color);
c.setAttribute("fillcolor", data[i].series.color);
var str = document.createElement("v:stroke");
str.setAttribute("opacity", "0.8");
c.appendChild(str);
str = document.createElement("v:fill");
str.setAttribute("opacity", "0.6");
c.appendChild(str);
var s = c.style;
s.position = "absolute";
s.top = (y - r) + "px";
s.left = (x - r) + "px";
s.width = (r * 2) + "px";
s.height = (r * 2) + "px";
group.appendChild(c);
if (applyTo) {
applyTo(c, data[i].src);
}
}
path.setAttribute("path", cmd.join(" ") + " e");
group.appendChild(path);
return group;
}, Area:function (data, plotarea, plot, applyTo) {
var area = plotarea.getArea();
var group = dojo.charting.Plotters._group(plotarea);
if (data.length == 0) {
return group;
}
var path = document.createElement("v:shape");
path.setAttribute("strokeweight", "1px");
path.setAttribute("strokecolor", data[0].series.color);
path.setAttribute("fillcolor", data[0].series.color);
path.setAttribute("coordsize", (area.right - area.left) + "," + (area.bottom - area.top));
path.style.position = "absolute";
path.style.top = "0px";
path.style.left = "0px";
path.style.width = area.right - area.left + "px";
path.style.height = area.bottom - area.top + "px";
var stroke = document.createElement("v:stroke");
stroke.setAttribute("opacity", "0.8");
path.appendChild(stroke);
var fill = document.createElement("v:fill");
fill.setAttribute("opacity", "0.4");
path.appendChild(fill);
var cmd = [];
var r = 3;
for (var i = 0; i < data.length; i++) {
var x = Math.round(plot.axisX.getCoord(data[i].x, plotarea, plot));
var y = Math.round(plot.axisY.getCoord(data[i].y, plotarea, plot));
if (i == 0) {
cmd.push("m");
cmd.push(x + "," + y);
} else {
cmd.push("l");
cmd.push(x + "," + y);
}
var c = document.createElement("v:oval");
c.setAttribute("strokeweight", "1px");
c.setAttribute("strokecolor", data[i].series.color);
c.setAttribute("fillcolor", data[i].series.color);
var str = document.createElement("v:stroke");
str.setAttribute("opacity", "0.8");
c.appendChild(str);
str = document.createElement("v:fill");
str.setAttribute("opacity", "0.6");
c.appendChild(str);
var s = c.style;
s.position = "absolute";
s.top = (y - r) + "px";
s.left = (x - r) + "px";
s.width = (r * 2) + "px";
s.height = (r * 2) + "px";
group.appendChild(c);
if (applyTo) {
applyTo(c, data[i].src);
}
}
cmd.push("l");
cmd.push(x + "," + Math.round(plot.axisY.getCoord(plot.axisX.origin, plotarea, plot)));
cmd.push("l");
cmd.push(Math.round(plot.axisX.getCoord(data[0].x, plotarea, plot)) + "," + Math.round(plot.axisY.getCoord(plot.axisX.origin, plotarea, plot)));
path.setAttribute("path", cmd.join(" ") + " x e");
group.appendChild(path);
return group;
}, CurvedArea:function (data, plotarea, plot, applyTo) {
var tension = 3;
var area = plotarea.getArea();
var group = dojo.charting.Plotters._group(plotarea);
if (data.length == 0) {
return group;
}
var path = document.createElement("v:shape");
path.setAttribute("strokeweight", "1px");
path.setAttribute("strokecolor", data[0].series.color);
path.setAttribute("fillcolor", data[0].series.color);
path.setAttribute("coordsize", (area.right - area.left) + "," + (area.bottom - area.top));
path.style.position = "absolute";
path.style.top = "0px";
path.style.left = "0px";
path.style.width = area.right - area.left + "px";
path.style.height = area.bottom - area.top + "px";
var stroke = document.createElement("v:stroke");
stroke.setAttribute("opacity", "0.8");
path.appendChild(stroke);
var fill = document.createElement("v:fill");
fill.setAttribute("opacity", "0.4");
path.appendChild(fill);
var cmd = [];
var r = 3;
for (var i = 0; i < data.length; i++) {
var x = Math.round(plot.axisX.getCoord(data[i].x, plotarea, plot));
var y = Math.round(plot.axisY.getCoord(data[i].y, plotarea, plot));
if (i == 0) {
cmd.push("m");
cmd.push(x + "," + y);
} else {
var lastx = Math.round(plot.axisX.getCoord(data[i - 1].x, plotarea, plot));
var lasty = Math.round(plot.axisY.getCoord(data[i - 1].y, plotarea, plot));
var dx = x - lastx;
var dy = y - lasty;
cmd.push("c");
var cx = Math.round((x - (tension - 1) * (dx / tension)));
cmd.push(cx + "," + lasty);
cx = Math.round((x - (dx / tension)));
cmd.push(cx + "," + y);
cmd.push(x + "," + y);
}
var c = document.createElement("v:oval");
c.setAttribute("strokeweight", "1px");
c.setAttribute("strokecolor", data[i].series.color);
c.setAttribute("fillcolor", data[i].series.color);
var str = document.createElement("v:stroke");
str.setAttribute("opacity", "0.8");
c.appendChild(str);
str = document.createElement("v:fill");
str.setAttribute("opacity", "0.6");
c.appendChild(str);
var s = c.style;
s.position = "absolute";
s.top = (y - r) + "px";
s.left = (x - r) + "px";
s.width = (r * 2) + "px";
s.height = (r * 2) + "px";
group.appendChild(c);
if (applyTo) {
applyTo(c, data[i].src);
}
}
cmd.push("l");
cmd.push(x + "," + Math.round(plot.axisY.getCoord(plot.axisX.origin, plotarea, plot)));
cmd.push("l");
cmd.push(Math.round(plot.axisX.getCoord(data[0].x, plotarea, plot)) + "," + Math.round(plot.axisY.getCoord(plot.axisX.origin, plotarea, plot)));
path.setAttribute("path", cmd.join(" ") + " x e");
group.appendChild(path);
return group;
}, HighLow:function (data, plotarea, plot, applyTo) {
var area = plotarea.getArea();
var group = dojo.charting.Plotters._group(plotarea);
var n = data.length;
var part = ((area.right - area.left) / (plot.axisX.range.upper - plot.axisX.range.lower)) / 4;
var w = part * 2;
for (var i = 0; i < n; i++) {
var high = data[i].high;
var low = data[i].low;
if (low > high) {
var t = low;
low = high;
high = t;
}
var x = plot.axisX.getCoord(data[i].x, plotarea, plot) - (w / 2);
var y = plot.axisY.getCoord(high, plotarea, plot);
var h = plot.axisY.getCoord(low, plotarea, plot) - y;
var bar = document.createElement("v:rect");
bar.style.position = "absolute";
bar.style.top = y + 1 + "px";
bar.style.left = x + "px";
bar.style.width = w + "px";
bar.style.height = h + "px";
bar.setAttribute("fillColor", data[i].series.color);
bar.setAttribute("stroked", "false");
bar.style.antialias = "false";
var fill = document.createElement("v:fill");
fill.setAttribute("opacity", "0.6");
bar.appendChild(fill);
if (applyTo) {
applyTo(bar, data[i].src);
}
group.appendChild(bar);
}
return group;
}, HighLowClose:function (data, plotarea, plot, applyTo) {
var area = plotarea.getArea();
var group = dojo.charting.Plotters._group(plotarea);
var n = data.length;
var part = ((area.right - area.left) / (plot.axisX.range.upper - plot.axisX.range.lower)) / 4;
var w = part * 2;
for (var i = 0; i < n; i++) {
var high = data[i].high;
var low = data[i].low;
if (low > high) {
var t = low;
low = high;
high = t;
}
var c = data[i].close;
var x = plot.axisX.getCoord(data[i].x, plotarea, plot) - (w / 2);
var y = plot.axisY.getCoord(high, plotarea, plot);
var h = plot.axisY.getCoord(low, plotarea, plot) - y;
var close = plot.axisY.getCoord(c, plotarea, plot);
var g = document.createElement("div");
var bar = document.createElement("v:rect");
bar.style.position = "absolute";
bar.style.top = y + 1 + "px";
bar.style.left = x + "px";
bar.style.width = w + "px";
bar.style.height = h + "px";
bar.setAttribute("fillColor", data[i].series.color);
bar.setAttribute("stroked", "false");
bar.style.antialias = "false";
var fill = document.createElement("v:fill");
fill.setAttribute("opacity", "0.6");
bar.appendChild(fill);
g.appendChild(bar);
var line = document.createElement("v:line");
line.setAttribute("strokecolor", data[i].series.color);
line.setAttribute("strokeweight", "1px");
line.setAttribute("from", x + "px," + close + "px");
line.setAttribute("to", (x + w + (part * 2) - 2) + "px," + close + "px");
var s = line.style;
s.position = "absolute";
s.top = "0px";
s.left = "0px";
s.antialias = "false";
var str = document.createElement("v:stroke");
str.setAttribute("opacity", "0.6");
line.appendChild(str);
g.appendChild(line);
if (applyTo) {
applyTo(g, data[i].src);
}
group.appendChild(g);
}
return group;
}, HighLowOpenClose:function (data, plotarea, plot, applyTo) {
var area = plotarea.getArea();
var group = dojo.charting.Plotters._group(plotarea);
var n = data.length;
var part = ((area.right - area.left) / (plot.axisX.range.upper - plot.axisX.range.lower)) / 4;
var w = part * 2;
for (var i = 0; i < n; i++) {
var high = data[i].high;
var low = data[i].low;
if (low > high) {
var t = low;
low = high;
high = t;
}
var o = data[i].open;
var c = data[i].close;
var x = plot.axisX.getCoord(data[i].x, plotarea, plot) - (w / 2);
var y = plot.axisY.getCoord(high, plotarea, plot);
var h = plot.axisY.getCoord(low, plotarea, plot) - y;
var open = plot.axisY.getCoord(o, plotarea, plot);
var close = plot.axisY.getCoord(c, plotarea, plot);
var g = document.createElement("div");
var bar = document.createElement("v:rect");
bar.style.position = "absolute";
bar.style.top = y + 1 + "px";
bar.style.left = x + "px";
bar.style.width = w + "px";
bar.style.height = h + "px";
bar.setAttribute("fillColor", data[i].series.color);
bar.setAttribute("stroked", "false");
bar.style.antialias = "false";
var fill = document.createElement("v:fill");
fill.setAttribute("opacity", "0.6");
bar.appendChild(fill);
g.appendChild(bar);
var line = document.createElement("v:line");
line.setAttribute("strokecolor", data[i].series.color);
line.setAttribute("strokeweight", "1px");
line.setAttribute("from", (x - (part * 2)) + "px," + open + "px");
line.setAttribute("to", (x + w - 2) + "px," + open + "px");
var s = line.style;
s.position = "absolute";
s.top = "0px";
s.left = "0px";
s.antialias = "false";
var str = document.createElement("v:stroke");
str.setAttribute("opacity", "0.6");
line.appendChild(str);
g.appendChild(line);
var line = document.createElement("v:line");
line.setAttribute("strokecolor", data[i].series.color);
line.setAttribute("strokeweight", "1px");
line.setAttribute("from", x + "px," + close + "px");
line.setAttribute("to", (x + w + (part * 2) - 2) + "px," + close + "px");
var s = line.style;
s.position = "absolute";
s.top = "0px";
s.left = "0px";
s.antialias = "false";
var str = document.createElement("v:stroke");
str.setAttribute("opacity", "0.6");
line.appendChild(str);
g.appendChild(line);
if (applyTo) {
applyTo(g, data[i].src);
}
group.appendChild(g);
}
return group;
}, Scatter:function (data, plotarea, plot, applyTo) {
var r = 6;
var mod = r / 2;
var area = plotarea.getArea();
var group = dojo.charting.Plotters._group(plotarea);
for (var i = 0; i < data.length; i++) {
var x = Math.round(plot.axisX.getCoord(data[i].x, plotarea, plot));
var y = Math.round(plot.axisY.getCoord(data[i].y, plotarea, plot));
var point = document.createElement("v:rect");
point.setAttribute("strokecolor", data[i].series.color);
point.setAttribute("fillcolor", data[i].series.color);
var fill = document.createElement("v:fill");
fill.setAttribute("opacity", "0.6");
point.appendChild(fill);
var s = point.style;
s.position = "absolute";
s.rotation = "45";
s.top = (y - mod) + "px";
s.left = (x - mod) + "px";
s.width = r + "px";
s.height = r + "px";
group.appendChild(point);
if (applyTo) {
applyTo(point, data[i].src);
}
}
return group;
}, Bubble:function (data, plotarea, plot, applyTo) {
var sizeFactor = 1;
var area = plotarea.getArea();
var group = dojo.charting.Plotters._group(plotarea);
for (var i = 0; i < data.length; i++) {
var x = Math.round(plot.axisX.getCoord(data[i].x, plotarea, plot));
var y = Math.round(plot.axisY.getCoord(data[i].y, plotarea, plot));
if (i == 0) {
var raw = data[i].size;
var dy = plot.axisY.getCoord(data[i].y + raw, plotarea, plot) - y;
sizeFactor = dy / raw;
}
if (sizeFactor < 1) {
sizeFactor = 1;
}
var r = (data[i].size / 2) * sizeFactor;
var point = document.createElement("v:oval");
point.setAttribute("strokecolor", data[i].series.color);
point.setAttribute("fillcolor", data[i].series.color);
var fill = document.createElement("v:fill");
fill.setAttribute("opacity", "0.6");
point.appendChild(fill);
var s = point.style;
s.position = "absolute";
s.rotation = "45";
s.top = (y - r) + "px";
s.left = (x - r) + "px";
s.width = (r * 2) + "px";
s.height = (r * 2) + "px";
group.appendChild(point);
if (applyTo) {
applyTo(point, data[i].src);
}
}
return group;
}});
dojo.charting.Plotters["Default"] = dojo.charting.Plotters.Line;
}
 
/tags/Racine_livraison_narmer/api/js/dojo/src/charting/Axis.js
New file
0,0 → 1,130
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.charting.Axis");
dojo.require("dojo.lang.common");
dojo.charting.Axis = function (label, scale, labels) {
var id = "dojo-charting-axis-" + dojo.charting.Axis.count++;
this.getId = function () {
return id;
};
this.setId = function (key) {
id = key;
};
this.scale = scale || "linear";
this.label = label || "";
this.showLabel = true;
this.showLabels = true;
this.showLines = false;
this.showTicks = false;
this.range = {upper:100, lower:0};
this.origin = "min";
this._origin = null;
this.labels = labels || [];
this._labels = [];
this.nodes = {main:null, axis:null, label:null, labels:null, lines:null, ticks:null};
this._rerender = false;
};
dojo.charting.Axis.count = 0;
dojo.extend(dojo.charting.Axis, {getCoord:function (val, plotArea, plot) {
val = parseFloat(val, 10);
var area = plotArea.getArea();
if (plot.axisX == this) {
var offset = 0 - this.range.lower;
var min = this.range.lower + offset;
var max = this.range.upper + offset;
val += offset;
return (val * ((area.right - area.left) / max)) + area.left;
} else {
var max = this.range.upper;
var min = this.range.lower;
var offset = 0;
if (min < 0) {
offset += Math.abs(min);
}
max += offset;
min += offset;
val += offset;
var pmin = area.bottom;
var pmax = area.top;
return (((pmin - pmax) / (max - min)) * (max - val)) + pmax;
}
}, initializeOrigin:function (drawAgainst, plane) {
if (this._origin == null) {
this._origin = this.origin;
}
if (isNaN(this._origin)) {
if (this._origin.toLowerCase() == "max") {
this.origin = drawAgainst.range[(plane == "y") ? "upper" : "lower"];
} else {
if (this._origin.toLowerCase() == "min") {
this.origin = drawAgainst.range[(plane == "y") ? "lower" : "upper"];
} else {
this.origin = 0;
}
}
}
}, initializeLabels:function () {
this._labels = [];
if (this.labels.length == 0) {
this.showLabels = false;
this.showLines = false;
this.showTicks = false;
} else {
if (this.labels[0].label && this.labels[0].value != null) {
for (var i = 0; i < this.labels.length; i++) {
this._labels.push(this.labels[i]);
}
} else {
if (!isNaN(this.labels[0])) {
for (var i = 0; i < this.labels.length; i++) {
this._labels.push({label:this.labels[i], value:this.labels[i]});
}
} else {
var a = [];
for (var i = 0; i < this.labels.length; i++) {
a.push(this.labels[i]);
}
var s = a.shift();
this._labels.push({label:s, value:this.range.lower});
if (a.length > 0) {
var s = a.pop();
this._labels.push({label:s, value:this.range.upper});
}
if (a.length > 0) {
var range = this.range.upper - this.range.lower;
var step = range / (this.labels.length - 1);
for (var i = 1; i <= a.length; i++) {
this._labels.push({label:a[i - 1], value:this.range.lower + (step * i)});
}
}
}
}
}
}, initialize:function (plotArea, plot, drawAgainst, plane) {
this.destroy();
this.initializeOrigin(drawAgainst, plane);
this.initializeLabels();
var node = this.render(plotArea, plot, drawAgainst, plane);
return node;
}, destroy:function () {
for (var p in this.nodes) {
while (this.nodes[p] && this.nodes[p].childNodes.length > 0) {
this.nodes[p].removeChild(this.nodes[p].childNodes[0]);
}
if (this.nodes[p] && this.nodes[p].parentNode) {
this.nodes[p].parentNode.removeChild(this.nodes[p]);
}
this.nodes[p] = null;
}
}});
dojo.requireIf(dojo.render.svg.capable, "dojo.charting.svg.Axis");
dojo.requireIf(dojo.render.vml.capable, "dojo.charting.vml.Axis");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/charting/svg/PlotArea.js
New file
0,0 → 1,75
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.charting.svg.PlotArea");
dojo.require("dojo.lang.common");
if (dojo.render.svg.capable) {
dojo.require("dojo.svg");
dojo.extend(dojo.charting.PlotArea, {resize:function () {
var area = this.getArea();
this.nodes.area.setAttribute("width", this.size.width);
this.nodes.area.setAttribute("height", this.size.height);
var rect = this.nodes.area.getElementsByTagName("rect")[0];
rect.setAttribute("x", area.left);
rect.setAttribute("y", area.top);
rect.setAttribute("width", area.right - area.left);
rect.setAttribute("height", area.bottom - area.top);
this.nodes.background.setAttribute("width", this.size.width);
this.nodes.background.setAttribute("height", this.size.height);
if (this.nodes.plots) {
this.nodes.area.removeChild(this.nodes.plots);
this.nodes.plots = null;
}
this.nodes.plots = document.createElementNS(dojo.svg.xmlns.svg, "g");
this.nodes.plots.setAttribute("id", this.getId() + "-plots");
this.nodes.plots.setAttribute("style", "clip-path:url(#" + this.getId() + "-clip);");
this.nodes.area.appendChild(this.nodes.plots);
for (var i = 0; i < this.plots.length; i++) {
this.nodes.plots.appendChild(this.initializePlot(this.plots[i]));
}
if (this.nodes.axes) {
this.nodes.area.removeChild(this.nodes.axes);
this.nodes.axes = null;
}
this.nodes.axes = document.createElementNS(dojo.svg.xmlns.svg, "g");
this.nodes.axes.setAttribute("id", this.getId() + "-axes");
this.nodes.area.appendChild(this.nodes.axes);
var axes = this.getAxes();
for (var p in axes) {
var obj = axes[p];
this.nodes.axes.appendChild(obj.axis.initialize(this, obj.plot, obj.drawAgainst, obj.plane));
}
}, initializePlot:function (plot) {
plot.destroy();
plot.dataNode = document.createElementNS(dojo.svg.xmlns.svg, "g");
plot.dataNode.setAttribute("id", plot.getId());
return plot.dataNode;
}, initialize:function () {
this.destroy();
this.nodes.main = document.createElement("div");
this.nodes.area = document.createElementNS(dojo.svg.xmlns.svg, "svg");
this.nodes.area.setAttribute("id", this.getId());
this.nodes.main.appendChild(this.nodes.area);
var defs = document.createElementNS(dojo.svg.xmlns.svg, "defs");
var clip = document.createElementNS(dojo.svg.xmlns.svg, "clipPath");
clip.setAttribute("id", this.getId() + "-clip");
var rect = document.createElementNS(dojo.svg.xmlns.svg, "rect");
clip.appendChild(rect);
defs.appendChild(clip);
this.nodes.area.appendChild(defs);
this.nodes.background = document.createElementNS(dojo.svg.xmlns.svg, "rect");
this.nodes.background.setAttribute("id", this.getId() + "-background");
this.nodes.background.setAttribute("fill", "#fff");
this.nodes.area.appendChild(this.nodes.background);
this.resize();
return this.nodes.main;
}});
}
 
/tags/Racine_livraison_narmer/api/js/dojo/src/charting/svg/Plotters.js
New file
0,0 → 1,700
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.charting.svg.Plotters");
dojo.require("dojo.lang.common");
if (dojo.render.svg.capable) {
dojo.require("dojo.svg");
dojo.mixin(dojo.charting.Plotters, {Bar:function (plotarea, plot, kwArgs, applyTo) {
var area = plotarea.getArea();
var group = document.createElementNS(dojo.svg.xmlns.svg, "g");
var n = plot.series.length;
var data = [];
for (var i = 0; i < n; i++) {
var tmp = plot.series[i].data.evaluate(kwArgs);
data.push(tmp);
}
var space = 8;
var nPoints = data[0].length;
if (nPoints == 0) {
return group;
}
var width = ((area.right - area.left) - (space * (nPoints - 1))) / nPoints;
var barWidth = width / n;
var yOrigin = plot.axisY.getCoord(plot.axisX.origin, plotarea, plot);
for (var i = 0; i < nPoints; i++) {
var xStart = area.left + (width * i) + (space * i);
for (var j = 0; j < n; j++) {
var value = data[j][i].y;
var yA = yOrigin;
var x = xStart + (barWidth * j);
var y = plot.axisY.getCoord(value, plotarea, plot);
var h = Math.abs(yA - y);
if (value < plot.axisX.origin) {
yA = y;
y = yOrigin;
}
var bar = document.createElementNS(dojo.svg.xmlns.svg, "rect");
bar.setAttribute("fill", data[j][i].series.color);
bar.setAttribute("stroke-width", "0");
bar.setAttribute("x", x);
bar.setAttribute("y", y);
bar.setAttribute("width", barWidth);
bar.setAttribute("height", h);
bar.setAttribute("fill-opacity", "0.6");
if (applyTo) {
applyTo(bar, data[j][i].src);
}
group.appendChild(bar);
}
}
return group;
}, HorizontalBar:function (plotarea, plot, kwArgs, applyTo) {
var area = plotarea.getArea();
var group = document.createElementNS(dojo.svg.xmlns.svg, "g");
var n = plot.series.length;
var data = [];
for (var i = 0; i < n; i++) {
var tmp = plot.series[i].data.evaluate(kwArgs);
data.push(tmp);
}
var space = 6;
var nPoints = data[0].length;
if (nPoints == 0) {
return group;
}
var h = ((area.bottom - area.top) - (space * (nPoints - 1))) / nPoints;
var barH = h / n;
var xOrigin = plot.axisX.getCoord(0, plotarea, plot);
for (var i = 0; i < nPoints; i++) {
var yStart = area.top + (h * i) + (space * i);
for (var j = 0; j < n; j++) {
var value = data[j][i].y;
var y = yStart + (barH * j);
var xA = xOrigin;
var x = plot.axisX.getCoord(value, plotarea, plot);
var w = Math.abs(x - xA);
if (value > 0) {
x = xOrigin;
}
var bar = document.createElementNS(dojo.svg.xmlns.svg, "rect");
bar.setAttribute("fill", data[j][i].series.color);
bar.setAttribute("stroke-width", "0");
bar.setAttribute("x", xA);
bar.setAttribute("y", y);
bar.setAttribute("width", w);
bar.setAttribute("height", barH);
bar.setAttribute("fill-opacity", "0.6");
if (applyTo) {
applyTo(bar, data[j][i].src);
}
group.appendChild(bar);
}
}
return group;
}, Gantt:function (plotarea, plot, kwArgs, applyTo) {
var area = plotarea.getArea();
var group = document.createElementNS(dojo.svg.xmlns.svg, "g");
var n = plot.series.length;
var data = [];
for (var i = 0; i < n; i++) {
var tmp = plot.series[i].data.evaluate(kwArgs);
data.push(tmp);
}
var space = 2;
var nPoints = data[0].length;
if (nPoints == 0) {
return group;
}
var h = ((area.bottom - area.top) - (space * (nPoints - 1))) / nPoints;
var barH = h / n;
for (var i = 0; i < nPoints; i++) {
var yStart = area.top + (h * i) + (space * i);
for (var j = 0; j < n; j++) {
var high = data[j][i].high;
var low = data[j][i].low;
if (low > high) {
var t = high;
high = low;
low = t;
}
var x = plot.axisX.getCoord(low, plotarea, plot);
var w = plot.axisX.getCoord(high, plotarea, plot) - x;
var y = yStart + (barH * j);
var bar = document.createElementNS(dojo.svg.xmlns.svg, "rect");
bar.setAttribute("fill", data[j][i].series.color);
bar.setAttribute("stroke-width", "0");
bar.setAttribute("x", x);
bar.setAttribute("y", y);
bar.setAttribute("width", w);
bar.setAttribute("height", barH);
bar.setAttribute("fill-opacity", "0.6");
if (applyTo) {
applyTo(bar, data[j][i].src);
}
group.appendChild(bar);
}
}
return group;
}, StackedArea:function (plotarea, plot, kwArgs, applyTo) {
var area = plotarea.getArea();
var group = document.createElementNS(dojo.svg.xmlns.svg, "g");
var n = plot.series.length;
var data = [];
var totals = [];
for (var i = 0; i < n; i++) {
var tmp = plot.series[i].data.evaluate(kwArgs);
for (var j = 0; j < tmp.length; j++) {
if (i == 0) {
totals.push(tmp[j].y);
} else {
totals[j] += tmp[j].y;
}
tmp[j].y = totals[j];
}
data.push(tmp);
}
for (var i = n - 1; i >= 0; i--) {
var path = document.createElementNS(dojo.svg.xmlns.svg, "path");
path.setAttribute("fill", data[i][0].series.color);
path.setAttribute("fill-opacity", "0.4");
path.setAttribute("stroke", data[i][0].series.color);
path.setAttribute("stroke-width", "1");
path.setAttribute("stroke-opacity", "0.85");
var cmd = [];
var r = 3;
for (var j = 0; j < data[i].length; j++) {
var values = data[i];
var x = plot.axisX.getCoord(values[j].x, plotarea, plot);
var y = plot.axisY.getCoord(values[j].y, plotarea, plot);
if (j == 0) {
cmd.push("M");
} else {
cmd.push("L");
}
cmd.push(x + "," + y);
var c = document.createElementNS(dojo.svg.xmlns.svg, "circle");
c.setAttribute("cx", x);
c.setAttribute("cy", y);
c.setAttribute("r", "3");
c.setAttribute("fill", values[j].series.color);
c.setAttribute("fill-opacity", "0.6");
c.setAttribute("stroke-width", "1");
c.setAttribute("stroke-opacity", "0.85");
group.appendChild(c);
if (applyTo) {
applyTo(c, data[i].src);
}
}
if (i == 0) {
cmd.push("L");
cmd.push(x + "," + plot.axisY.getCoord(plot.axisX.origin, plotarea, plot));
cmd.push("L");
cmd.push(plot.axisX.getCoord(data[0][0].x, plotarea, plot) + "," + plot.axisY.getCoord(plot.axisX.origin, plotarea, plot));
cmd.push("Z");
} else {
var values = data[i - 1];
cmd.push("L");
cmd.push(x + "," + Math.round(plot.axisY.getCoord(values[values.length - 1].y, plotarea, plot)));
for (var j = values.length - 2; j >= 0; j--) {
var x = plot.axisX.getCoord(values[j].x, plotarea, plot);
var y = plot.axisY.getCoord(values[j].y, plotarea, plot);
cmd.push("L");
cmd.push(x + "," + y);
}
}
path.setAttribute("d", cmd.join(" ") + " Z");
group.appendChild(path);
}
return group;
}, StackedCurvedArea:function (plotarea, plot, kwArgs, applyTo) {
var tension = 3;
var area = plotarea.getArea();
var group = document.createElementNS(dojo.svg.xmlns.svg, "g");
var n = plot.series.length;
var data = [];
var totals = [];
for (var i = 0; i < n; i++) {
var tmp = plot.series[i].data.evaluate(kwArgs);
for (var j = 0; j < tmp.length; j++) {
if (i == 0) {
totals.push(tmp[j].y);
} else {
totals[j] += tmp[j].y;
}
tmp[j].y = totals[j];
}
data.push(tmp);
}
for (var i = n - 1; i >= 0; i--) {
var path = document.createElementNS(dojo.svg.xmlns.svg, "path");
path.setAttribute("fill", data[i][0].series.color);
path.setAttribute("fill-opacity", "0.4");
path.setAttribute("stroke", data[i][0].series.color);
path.setAttribute("stroke-width", "1");
path.setAttribute("stroke-opacity", "0.85");
var cmd = [];
var r = 3;
for (var j = 0; j < data[i].length; j++) {
var values = data[i];
var x = plot.axisX.getCoord(values[j].x, plotarea, plot);
var y = plot.axisY.getCoord(values[j].y, plotarea, plot);
var dx = area.left + 1;
var dy = area.bottom;
if (j > 0) {
dx = x - plot.axisX.getCoord(values[j - 1].x, plotarea, plot);
dy = plot.axisY.getCoord(values[j - 1].y, plotarea, plot);
}
if (j == 0) {
cmd.push("M");
} else {
cmd.push("C");
var cx = x - (tension - 1) * (dx / tension);
cmd.push(cx + "," + dy);
cx = x - (dx / tension);
cmd.push(cx + "," + y);
}
cmd.push(x + "," + y);
var c = document.createElementNS(dojo.svg.xmlns.svg, "circle");
c.setAttribute("cx", x);
c.setAttribute("cy", y);
c.setAttribute("r", "3");
c.setAttribute("fill", values[j].series.color);
c.setAttribute("fill-opacity", "0.6");
c.setAttribute("stroke-width", "1");
c.setAttribute("stroke-opacity", "0.85");
group.appendChild(c);
if (applyTo) {
applyTo(c, data[i].src);
}
}
if (i == 0) {
cmd.push("L");
cmd.push(x + "," + plot.axisY.getCoord(plot.axisX.origin, plotarea, plot));
cmd.push("L");
cmd.push(plot.axisX.getCoord(data[0][0].x, plotarea, plot) + "," + plot.axisY.getCoord(plot.axisX.origin, plotarea, plot));
cmd.push("Z");
} else {
var values = data[i - 1];
cmd.push("L");
cmd.push(x + "," + Math.round(plot.axisY.getCoord(values[values.length - 1].y, plotarea, plot)));
for (var j = values.length - 2; j >= 0; j--) {
var x = plot.axisX.getCoord(values[j].x, plotarea, plot);
var y = plot.axisY.getCoord(values[j].y, plotarea, plot);
var dx = x - plot.axisX.getCoord(values[j + 1].x, plotarea, plot);
var dy = plot.axisY.getCoord(values[j + 1].y, plotarea, plot);
cmd.push("C");
var cx = x - (tension - 1) * (dx / tension);
cmd.push(cx + "," + dy);
cx = x - (dx / tension);
cmd.push(cx + "," + y);
cmd.push(x + "," + y);
}
}
path.setAttribute("d", cmd.join(" ") + " Z");
group.appendChild(path);
}
return group;
}, DataBar:function (data, plotarea, plot, applyTo) {
var area = plotarea.getArea();
var group = document.createElementNS(dojo.svg.xmlns.svg, "g");
var n = data.length;
var w = (area.right - area.left) / (plot.axisX.range.upper - plot.axisX.range.lower);
var yOrigin = plot.axisY.getCoord(plot.axisX.origin, plotarea, plot);
for (var i = 0; i < n; i++) {
var value = data[i].y;
var yA = yOrigin;
var x = plot.axisX.getCoord(data[i].x, plotarea, plot) - (w / 2);
var y = plot.axisY.getCoord(value, plotarea, plot);
var h = Math.abs(yA - y);
if (value < plot.axisX.origin) {
yA = y;
y = yOrigin;
}
var bar = document.createElementNS(dojo.svg.xmlns.svg, "rect");
bar.setAttribute("fill", data[i].series.color);
bar.setAttribute("stroke-width", "0");
bar.setAttribute("x", x);
bar.setAttribute("y", y);
bar.setAttribute("width", w);
bar.setAttribute("height", h);
bar.setAttribute("fill-opacity", "0.6");
if (applyTo) {
applyTo(bar, data[i].src);
}
group.appendChild(bar);
}
return group;
}, Line:function (data, plotarea, plot, applyTo) {
var area = plotarea.getArea();
var line = document.createElementNS(dojo.svg.xmlns.svg, "g");
if (data.length == 0) {
return line;
}
var path = document.createElementNS(dojo.svg.xmlns.svg, "path");
line.appendChild(path);
path.setAttribute("fill", "none");
path.setAttribute("stroke", data[0].series.color);
path.setAttribute("stroke-width", "2");
path.setAttribute("stroke-opacity", "0.85");
if (data[0].series.label != null) {
path.setAttribute("title", data[0].series.label);
}
var cmd = [];
for (var i = 0; i < data.length; i++) {
var x = plot.axisX.getCoord(data[i].x, plotarea, plot);
var y = plot.axisY.getCoord(data[i].y, plotarea, plot);
if (i == 0) {
cmd.push("M");
} else {
cmd.push("L");
}
cmd.push(x + "," + y);
var c = document.createElementNS(dojo.svg.xmlns.svg, "circle");
c.setAttribute("cx", x);
c.setAttribute("cy", y);
c.setAttribute("r", "3");
c.setAttribute("fill", data[i].series.color);
c.setAttribute("fill-opacity", "0.6");
c.setAttribute("stroke-width", "1");
c.setAttribute("stroke-opacity", "0.85");
line.appendChild(c);
if (applyTo) {
applyTo(c, data[i].src);
}
}
path.setAttribute("d", cmd.join(" "));
return line;
}, CurvedLine:function (data, plotarea, plot, applyTo) {
var tension = 3;
var area = plotarea.getArea();
var line = document.createElementNS(dojo.svg.xmlns.svg, "g");
if (data.length == 0) {
return line;
}
var path = document.createElementNS(dojo.svg.xmlns.svg, "path");
line.appendChild(path);
path.setAttribute("fill", "none");
path.setAttribute("stroke", data[0].series.color);
path.setAttribute("stroke-width", "2");
path.setAttribute("stroke-opacity", "0.85");
if (data[0].series.label != null) {
path.setAttribute("title", data[0].series.label);
}
var cmd = [];
for (var i = 0; i < data.length; i++) {
var x = plot.axisX.getCoord(data[i].x, plotarea, plot);
var y = plot.axisY.getCoord(data[i].y, plotarea, plot);
var dx = area.left + 1;
var dy = area.bottom;
if (i > 0) {
dx = x - plot.axisX.getCoord(data[i - 1].x, plotarea, plot);
dy = plot.axisY.getCoord(data[i - 1].y, plotarea, plot);
}
if (i == 0) {
cmd.push("M");
} else {
cmd.push("C");
var cx = x - (tension - 1) * (dx / tension);
cmd.push(cx + "," + dy);
cx = x - (dx / tension);
cmd.push(cx + "," + y);
}
cmd.push(x + "," + y);
var c = document.createElementNS(dojo.svg.xmlns.svg, "circle");
c.setAttribute("cx", x);
c.setAttribute("cy", y);
c.setAttribute("r", "3");
c.setAttribute("fill", data[i].series.color);
c.setAttribute("fill-opacity", "0.6");
c.setAttribute("stroke-width", "1");
c.setAttribute("stroke-opacity", "0.85");
line.appendChild(c);
if (applyTo) {
applyTo(c, data[i].src);
}
}
path.setAttribute("d", cmd.join(" "));
return line;
}, Area:function (data, plotarea, plot, applyTo) {
var area = plotarea.getArea();
var line = document.createElementNS(dojo.svg.xmlns.svg, "g");
if (data.length == 0) {
return line;
}
var path = document.createElementNS(dojo.svg.xmlns.svg, "path");
line.appendChild(path);
path.setAttribute("fill", data[0].series.color);
path.setAttribute("fill-opacity", "0.4");
path.setAttribute("stroke", data[0].series.color);
path.setAttribute("stroke-width", "1");
path.setAttribute("stroke-opacity", "0.85");
if (data[0].series.label != null) {
path.setAttribute("title", data[0].series.label);
}
var cmd = [];
for (var i = 0; i < data.length; i++) {
var x = plot.axisX.getCoord(data[i].x, plotarea, plot);
var y = plot.axisY.getCoord(data[i].y, plotarea, plot);
if (i == 0) {
cmd.push("M");
} else {
cmd.push("L");
}
cmd.push(x + "," + y);
var c = document.createElementNS(dojo.svg.xmlns.svg, "circle");
c.setAttribute("cx", x);
c.setAttribute("cy", y);
c.setAttribute("r", "3");
c.setAttribute("fill", data[i].series.color);
c.setAttribute("fill-opacity", "0.6");
c.setAttribute("stroke-width", "1");
c.setAttribute("stroke-opacity", "0.85");
line.appendChild(c);
if (applyTo) {
applyTo(c, data[i].src);
}
}
cmd.push("L");
cmd.push(x + "," + plot.axisY.getCoord(plot.axisX.origin, plotarea, plot));
cmd.push("L");
cmd.push(plot.axisX.getCoord(data[0].x, plotarea, plot) + "," + plot.axisY.getCoord(plot.axisX.origin, plotarea, plot));
cmd.push("Z");
path.setAttribute("d", cmd.join(" "));
return line;
}, CurvedArea:function (data, plotarea, plot, applyTo) {
var tension = 3;
var area = plotarea.getArea();
var line = document.createElementNS(dojo.svg.xmlns.svg, "g");
if (data.length == 0) {
return line;
}
var path = document.createElementNS(dojo.svg.xmlns.svg, "path");
line.appendChild(path);
path.setAttribute("fill", data[0].series.color);
path.setAttribute("fill-opacity", "0.4");
path.setAttribute("stroke", data[0].series.color);
path.setAttribute("stroke-width", "1");
path.setAttribute("stroke-opacity", "0.85");
if (data[0].series.label != null) {
path.setAttribute("title", data[0].series.label);
}
var cmd = [];
for (var i = 0; i < data.length; i++) {
var x = plot.axisX.getCoord(data[i].x, plotarea, plot);
var y = plot.axisY.getCoord(data[i].y, plotarea, plot);
var dx = area.left + 1;
var dy = area.bottom;
if (i > 0) {
dx = x - plot.axisX.getCoord(data[i - 1].x, plotarea, plot);
dy = plot.axisY.getCoord(data[i - 1].y, plotarea, plot);
}
if (i == 0) {
cmd.push("M");
} else {
cmd.push("C");
var cx = x - (tension - 1) * (dx / tension);
cmd.push(cx + "," + dy);
cx = x - (dx / tension);
cmd.push(cx + "," + y);
}
cmd.push(x + "," + y);
var c = document.createElementNS(dojo.svg.xmlns.svg, "circle");
c.setAttribute("cx", x);
c.setAttribute("cy", y);
c.setAttribute("r", "3");
c.setAttribute("fill", data[i].series.color);
c.setAttribute("fill-opacity", "0.6");
c.setAttribute("stroke-width", "1");
c.setAttribute("stroke-opacity", "0.85");
line.appendChild(c);
if (applyTo) {
applyTo(c, data[i].src);
}
}
cmd.push("L");
cmd.push(x + "," + plot.axisY.getCoord(plot.axisX.origin, plotarea, plot));
cmd.push("L");
cmd.push(plot.axisX.getCoord(data[0].x, plotarea, plot) + "," + plot.axisY.getCoord(plot.axisX.origin, plotarea, plot));
cmd.push("Z");
path.setAttribute("d", cmd.join(" "));
return line;
}, HighLow:function (data, plotarea, plot, applyTo) {
var area = plotarea.getArea();
var group = document.createElementNS(dojo.svg.xmlns.svg, "g");
var n = data.length;
var part = ((area.right - area.left) / (plot.axisX.range.upper - plot.axisX.range.lower)) / 4;
var w = part * 2;
for (var i = 0; i < n; i++) {
var high = data[i].high;
var low = data[i].low;
if (low > high) {
var t = low;
low = high;
high = t;
}
var x = plot.axisX.getCoord(data[i].x, plotarea, plot) - (w / 2);
var y = plot.axisY.getCoord(high, plotarea, plot);
var h = plot.axisY.getCoord(low, plotarea, plot) - y;
var bar = document.createElementNS(dojo.svg.xmlns.svg, "rect");
bar.setAttribute("fill", data[i].series.color);
bar.setAttribute("stroke-width", "0");
bar.setAttribute("x", x);
bar.setAttribute("y", y);
bar.setAttribute("width", w);
bar.setAttribute("height", h);
bar.setAttribute("fill-opacity", "0.6");
if (applyTo) {
applyTo(bar, data[i].src);
}
group.appendChild(bar);
}
return group;
}, HighLowClose:function (data, plotarea, plot, applyTo) {
var area = plotarea.getArea();
var group = document.createElementNS(dojo.svg.xmlns.svg, "g");
var n = data.length;
var part = ((area.right - area.left) / (plot.axisX.range.upper - plot.axisX.range.lower)) / 4;
var w = part * 2;
for (var i = 0; i < n; i++) {
var high = data[i].high;
var low = data[i].low;
if (low > high) {
var t = low;
low = high;
high = t;
}
var c = data[i].close;
var x = plot.axisX.getCoord(data[i].x, plotarea, plot) - (w / 2);
var y = plot.axisY.getCoord(high, plotarea, plot);
var h = plot.axisY.getCoord(low, plotarea, plot) - y;
var close = plot.axisY.getCoord(c, plotarea, plot);
var g = document.createElementNS(dojo.svg.xmlns.svg, "g");
var bar = document.createElementNS(dojo.svg.xmlns.svg, "rect");
bar.setAttribute("fill", data[i].series.color);
bar.setAttribute("stroke-width", "0");
bar.setAttribute("x", x);
bar.setAttribute("y", y);
bar.setAttribute("width", w);
bar.setAttribute("height", h);
bar.setAttribute("fill-opacity", "0.6");
g.appendChild(bar);
var line = document.createElementNS(dojo.svg.xmlns.svg, "line");
line.setAttribute("x1", x);
line.setAttribute("x2", x + w + (part * 2));
line.setAttribute("y1", close);
line.setAttribute("y2", close);
line.setAttribute("style", "stroke:" + data[i].series.color + ";stroke-width:1px;stroke-opacity:0.6;");
g.appendChild(line);
if (applyTo) {
applyTo(g, data[i].src);
}
group.appendChild(g);
}
return group;
}, HighLowOpenClose:function (data, plotarea, plot, applyTo) {
var area = plotarea.getArea();
var group = document.createElementNS(dojo.svg.xmlns.svg, "g");
var n = data.length;
var part = ((area.right - area.left) / (plot.axisX.range.upper - plot.axisX.range.lower)) / 4;
var w = part * 2;
for (var i = 0; i < n; i++) {
var high = data[i].high;
var low = data[i].low;
if (low > high) {
var t = low;
low = high;
high = t;
}
var o = data[i].open;
var c = data[i].close;
var x = plot.axisX.getCoord(data[i].x, plotarea, plot) - (w / 2);
var y = plot.axisY.getCoord(high, plotarea, plot);
var h = plot.axisY.getCoord(low, plotarea, plot) - y;
var open = plot.axisY.getCoord(o, plotarea, plot);
var close = plot.axisY.getCoord(c, plotarea, plot);
var g = document.createElementNS(dojo.svg.xmlns.svg, "g");
var bar = document.createElementNS(dojo.svg.xmlns.svg, "rect");
bar.setAttribute("fill", data[i].series.color);
bar.setAttribute("stroke-width", "0");
bar.setAttribute("x", x);
bar.setAttribute("y", y);
bar.setAttribute("width", w);
bar.setAttribute("height", h);
bar.setAttribute("fill-opacity", "0.6");
g.appendChild(bar);
var line = document.createElementNS(dojo.svg.xmlns.svg, "line");
line.setAttribute("x1", x - (part * 2));
line.setAttribute("x2", x + w);
line.setAttribute("y1", open);
line.setAttribute("y2", open);
line.setAttribute("style", "stroke:" + data[i].series.color + ";stroke-width:1px;stroke-opacity:0.6;");
g.appendChild(line);
var line = document.createElementNS(dojo.svg.xmlns.svg, "line");
line.setAttribute("x1", x);
line.setAttribute("x2", x + w + (part * 2));
line.setAttribute("y1", close);
line.setAttribute("y2", close);
line.setAttribute("style", "stroke:" + data[i].series.color + ";stroke-width:1px;stroke-opacity:0.6;");
g.appendChild(line);
if (applyTo) {
applyTo(g, data[i].src);
}
group.appendChild(g);
}
return group;
}, Scatter:function (data, plotarea, plot, applyTo) {
var r = 7;
var group = document.createElementNS(dojo.svg.xmlns.svg, "g");
for (var i = 0; i < data.length; i++) {
var x = plot.axisX.getCoord(data[i].x, plotarea, plot);
var y = plot.axisY.getCoord(data[i].y, plotarea, plot);
var point = document.createElementNS(dojo.svg.xmlns.svg, "path");
point.setAttribute("fill", data[i].series.color);
point.setAttribute("stroke-width", "0");
point.setAttribute("d", "M " + x + "," + (y - r) + " " + "Q " + x + "," + y + " " + (x + r) + "," + y + " " + "Q " + x + "," + y + " " + x + "," + (y + r) + " " + "Q " + x + "," + y + " " + (x - r) + "," + y + " " + "Q " + x + "," + y + " " + x + "," + (y - r) + " " + "Z");
if (applyTo) {
applyTo(point, data[i].src);
}
group.appendChild(point);
}
return group;
}, Bubble:function (data, plotarea, plot, applyTo) {
var group = document.createElementNS(dojo.svg.xmlns.svg, "g");
var sizeFactor = 1;
for (var i = 0; i < data.length; i++) {
var x = plot.axisX.getCoord(data[i].x, plotarea, plot);
var y = plot.axisY.getCoord(data[i].y, plotarea, plot);
if (i == 0) {
var raw = data[i].size;
var dy = plot.axisY.getCoord(data[i].y + raw, plotarea, plot) - y;
sizeFactor = dy / raw;
}
if (sizeFactor < 1) {
sizeFactor = 1;
}
var point = document.createElementNS(dojo.svg.xmlns.svg, "circle");
point.setAttribute("fill", data[i].series.color);
point.setAttribute("fill-opacity", "0.8");
point.setAttribute("stroke", data[i].series.color);
point.setAttribute("stroke-width", "1");
point.setAttribute("cx", x);
point.setAttribute("cy", y);
point.setAttribute("r", (data[i].size / 2) * sizeFactor);
if (applyTo) {
applyTo(point, data[i].src);
}
group.appendChild(point);
}
return group;
}});
dojo.charting.Plotters["Default"] = dojo.charting.Plotters.Line;
}
 
/tags/Racine_livraison_narmer/api/js/dojo/src/charting/svg/Axis.js
New file
0,0 → 1,186
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.charting.svg.Axis");
dojo.require("dojo.lang.common");
if (dojo.render.svg.capable) {
dojo.extend(dojo.charting.Axis, {renderLines:function (plotArea, plot, plane) {
if (this.nodes.lines) {
while (this.nodes.lines.childNodes.length > 0) {
this.nodes.lines.removeChild(this.nodes.lines.childNodes[0]);
}
if (this.nodes.lines.parentNode) {
this.nodes.lines.parentNode.removeChild(this.nodes.lines);
this.nodes.lines = null;
}
}
var area = plotArea.getArea();
var g = this.nodes.lines = document.createElementNS(dojo.svg.xmlns.svg, "g");
g.setAttribute("id", this.getId() + "-lines");
for (var i = 0; i < this._labels.length; i++) {
if (this._labels[i].value == this.origin) {
continue;
}
var v = this.getCoord(this._labels[i].value, plotArea, plot);
var l = document.createElementNS(dojo.svg.xmlns.svg, "line");
l.setAttribute("style", "stroke:#999;stroke-width:1px;stroke-dasharray:1,4;");
if (plane == "x") {
l.setAttribute("y1", area.top);
l.setAttribute("y2", area.bottom);
l.setAttribute("x1", v);
l.setAttribute("x2", v);
} else {
if (plane == "y") {
l.setAttribute("y1", v);
l.setAttribute("y2", v);
l.setAttribute("x1", area.left);
l.setAttribute("x2", area.right);
}
}
g.appendChild(l);
}
return g;
}, renderTicks:function (plotArea, plot, plane, coord) {
if (this.nodes.ticks) {
while (this.nodes.ticks.childNodes.length > 0) {
this.nodes.ticks.removeChild(this.nodes.ticks.childNodes[0]);
}
if (this.nodes.ticks.parentNode) {
this.nodes.ticks.parentNode.removeChild(this.nodes.ticks);
this.nodes.ticks = null;
}
}
var g = this.nodes.ticks = document.createElementNS(dojo.svg.xmlns.svg, "g");
g.setAttribute("id", this.getId() + "-ticks");
for (var i = 0; i < this._labels.length; i++) {
var v = this.getCoord(this._labels[i].value, plotArea, plot);
var l = document.createElementNS(dojo.svg.xmlns.svg, "line");
l.setAttribute("style", "stroke:#000;stroke-width:1pt;");
if (plane == "x") {
l.setAttribute("y1", coord);
l.setAttribute("y2", coord + 3);
l.setAttribute("x1", v);
l.setAttribute("x2", v);
} else {
if (plane == "y") {
l.setAttribute("y1", v);
l.setAttribute("y2", v);
l.setAttribute("x1", coord - 2);
l.setAttribute("x2", coord + 2);
}
}
g.appendChild(l);
}
return g;
}, renderLabels:function (plotArea, plot, plane, coord, textSize, anchor) {
function createLabel(label, x, y, textSize, anchor) {
var text = document.createElementNS(dojo.svg.xmlns.svg, "text");
text.setAttribute("x", x);
text.setAttribute("y", (plane == "x" ? y : y + 2));
text.setAttribute("style", "text-anchor:" + anchor + ";font-family:sans-serif;font-size:" + textSize + "px;fill:#000;");
text.appendChild(document.createTextNode(label));
return text;
}
if (this.nodes.labels) {
while (this.nodes.labels.childNodes.length > 0) {
this.nodes.labels.removeChild(this.nodes.labels.childNodes[0]);
}
if (this.nodes.labels.parentNode) {
this.nodes.labels.parentNode.removeChild(this.nodes.labels);
this.nodes.labels = null;
}
}
var g = this.nodes.labels = document.createElementNS(dojo.svg.xmlns.svg, "g");
g.setAttribute("id", this.getId() + "-labels");
for (var i = 0; i < this._labels.length; i++) {
var v = this.getCoord(this._labels[i].value, plotArea, plot);
if (plane == "x") {
g.appendChild(createLabel(this._labels[i].label, v, coord, textSize, anchor));
} else {
if (plane == "y") {
g.appendChild(createLabel(this._labels[i].label, coord, v, textSize, anchor));
}
}
}
return g;
}, render:function (plotArea, plot, drawAgainst, plane) {
if (!this._rerender && this.nodes.main) {
return this.nodes.main;
}
this._rerender = false;
var area = plotArea.getArea();
var stroke = 1;
var style = "stroke:#000;stroke-width:" + stroke + "px;";
var textSize = 10;
var coord = drawAgainst.getCoord(this.origin, plotArea, plot);
this.nodes.main = document.createElementNS(dojo.svg.xmlns.svg, "g");
var g = this.nodes.main;
g.setAttribute("id", this.getId());
var line = this.nodes.axis = document.createElementNS(dojo.svg.xmlns.svg, "line");
if (plane == "x") {
line.setAttribute("y1", coord);
line.setAttribute("y2", coord);
line.setAttribute("x1", area.left - stroke);
line.setAttribute("x2", area.right + stroke);
line.setAttribute("style", style);
var y = coord + textSize + 2;
if (this.showLines) {
g.appendChild(this.renderLines(plotArea, plot, plane, y));
}
if (this.showTicks) {
g.appendChild(this.renderTicks(plotArea, plot, plane, coord));
}
if (this.showLabels) {
g.appendChild(this.renderLabels(plotArea, plot, plane, y, textSize, "middle"));
}
if (this.showLabel && this.label) {
var x = plotArea.size.width / 2;
var text = document.createElementNS(dojo.svg.xmlns.svg, "text");
text.setAttribute("x", x);
text.setAttribute("y", (coord + (textSize * 2) + (textSize / 2)));
text.setAttribute("style", "text-anchor:middle;font-family:sans-serif;font-weight:bold;font-size:" + (textSize + 2) + "px;fill:#000;");
text.appendChild(document.createTextNode(this.label));
g.appendChild(text);
}
} else {
line.setAttribute("x1", coord);
line.setAttribute("x2", coord);
line.setAttribute("y1", area.top);
line.setAttribute("y2", area.bottom);
line.setAttribute("style", style);
var isMax = this.origin == drawAgainst.range.upper;
var x = coord + (isMax ? 4 : -4);
var anchor = isMax ? "start" : "end";
if (this.showLines) {
g.appendChild(this.renderLines(plotArea, plot, plane, x));
}
if (this.showTicks) {
g.appendChild(this.renderTicks(plotArea, plot, plane, coord));
}
if (this.showLabels) {
g.appendChild(this.renderLabels(plotArea, plot, plane, x, textSize, anchor));
}
if (this.showLabel && this.label) {
var x = isMax ? (coord + (textSize * 2) + (textSize / 2)) : (coord - (textSize * 4));
var y = plotArea.size.height / 2;
var text = document.createElementNS(dojo.svg.xmlns.svg, "text");
text.setAttribute("x", x);
text.setAttribute("y", y);
text.setAttribute("transform", "rotate(90, " + x + ", " + y + ")");
text.setAttribute("style", "text-anchor:middle;font-family:sans-serif;font-weight:bold;font-size:" + (textSize + 2) + "px;fill:#000;");
text.appendChild(document.createTextNode(this.label));
g.appendChild(text);
}
}
g.appendChild(line);
return g;
}});
}
 
/tags/Racine_livraison_narmer/api/js/dojo/src/charting/PlotArea.js
New file
0,0 → 1,135
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.charting.PlotArea");
dojo.require("dojo.lang.common");
dojo.require("dojo.gfx.color");
dojo.require("dojo.gfx.color.hsl");
dojo.require("dojo.charting.Plot");
dojo.charting.PlotArea = function () {
var id = "dojo-charting-plotarea-" + dojo.charting.PlotArea.count++;
this.getId = function () {
return id;
};
this.setId = function (key) {
id = key;
};
this.areaType = "standard";
this.plots = [];
this.size = {width:600, height:400};
this.padding = {top:10, right:10, bottom:20, left:20};
this.nodes = {main:null, area:null, background:null, axes:null, plots:null};
this._color = {h:140, s:120, l:120, step:27};
};
dojo.charting.PlotArea.count = 0;
dojo.extend(dojo.charting.PlotArea, {nextColor:function () {
var rgb = dojo.gfx.color.hsl2rgb(this._color.h, this._color.s, this._color.l);
this._color.h = (this._color.h + this._color.step) % 360;
while (this._color.h < 140) {
this._color.h += this._color.step;
}
return dojo.gfx.color.rgb2hex(rgb[0], rgb[1], rgb[2]);
}, getArea:function () {
return {left:this.padding.left, right:this.size.width - this.padding.right, top:this.padding.top, bottom:this.size.height - this.padding.bottom, toString:function () {
var a = [this.top, this.right, this.bottom, this.left];
return "[" + a.join() + "]";
}};
}, getAxes:function () {
var axes = {};
for (var i = 0; i < this.plots.length; i++) {
var plot = this.plots[i];
axes[plot.axisX.getId()] = {axis:plot.axisX, drawAgainst:plot.axisY, plot:plot, plane:"x"};
axes[plot.axisY.getId()] = {axis:plot.axisY, drawAgainst:plot.axisX, plot:plot, plane:"y"};
}
return axes;
}, getLegendInfo:function () {
var a = [];
for (var i = 0; i < this.plots.length; i++) {
for (var j = 0; j < this.plots[i].series.length; j++) {
var data = this.plots[i].series[j].data;
a.push({label:data.label, color:data.color});
}
}
return a;
}, setAxesRanges:function () {
var ranges = {};
var axes = {};
for (var i = 0; i < this.plots.length; i++) {
var plot = this.plots[i];
var ranges = plot.getRanges();
var x = ranges.x;
var y = ranges.y;
var ax, ay;
if (!axes[plot.axisX.getId()]) {
axes[plot.axisX.getId()] = plot.axisX;
ranges[plot.axisX.getId()] = {upper:x.upper, lower:x.lower};
}
ax = ranges[plot.axisX.getId()];
ax.upper = Math.max(ax.upper, x.upper);
ax.lower = Math.min(ax.lower, x.lower);
if (!axes[plot.axisY.getId()]) {
axes[plot.axisY.getId()] = plot.axisY;
ranges[plot.axisY.getId()] = {upper:y.upper, lower:y.lower};
}
ay = ranges[plot.axisY.getId()];
ay.upper = Math.max(ay.upper, y.upper);
ay.lower = Math.min(ay.lower, y.lower);
}
for (var p in axes) {
axes[p].range = ranges[p];
}
}, render:function (kwArgs, applyToData) {
if (!this.nodes.main || !this.nodes.area || !this.nodes.background || !this.nodes.plots || !this.nodes.axes) {
this.initialize();
}
this.resize();
for (var i = 0; i < this.plots.length; i++) {
var plot = this.plots[i];
if (plot.dataNode) {
this.nodes.plots.removeChild(plot.dataNode);
}
var target = this.initializePlot(plot);
switch (plot.renderType) {
case dojo.charting.RenderPlotSeries.Grouped:
if (plot.series[0]) {
target.appendChild(plot.series[0].plotter(this, plot, kwArgs, applyToData));
}
break;
case dojo.charting.RenderPlotSeries.Singly:
default:
for (var j = 0; j < plot.series.length; j++) {
var series = plot.series[j];
var data = series.data.evaluate(kwArgs);
target.appendChild(series.plotter(data, this, plot, applyToData));
}
}
this.nodes.plots.appendChild(target);
}
}, destroy:function () {
for (var i = 0; i < this.plots.length; i++) {
this.plots[i].destroy();
}
for (var p in this.nodes) {
var node = this.nodes[p];
if (!node) {
continue;
}
if (!node.childNodes) {
continue;
}
while (node.childNodes.length > 0) {
node.removeChild(node.childNodes[0]);
}
this.nodes[p] = null;
}
}});
dojo.requireIf(dojo.render.svg.capable, "dojo.charting.svg.PlotArea");
dojo.requireIf(dojo.render.vml.capable, "dojo.charting.vml.PlotArea");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/charting/__package__.js
New file
0,0 → 1,12
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.charting.*");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/xml/XslTransform.js
New file
0,0 → 1,157
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.xml.XslTransform");
dojo.xml.XslTransform = function (xsltUri) {
dojo.debug("XslTransform is supported by Internet Explorer and Mozilla, with limited support in Opera 9 (no document function support).");
var IS_IE = dojo.render.html.ie;
var ACTIVEX_DOMS = ["Msxml2.DOMDocument.5.0", "Msxml2.DOMDocument.4.0", "Msxml2.DOMDocument.3.0", "MSXML2.DOMDocument", "MSXML.DOMDocument", "Microsoft.XMLDOM"];
var ACTIVEX_FT_DOMS = ["Msxml2.FreeThreadedDOMDocument.5.0", "MSXML2.FreeThreadedDOMDocument.4.0", "MSXML2.FreeThreadedDOMDocument.3.0"];
var ACTIVEX_TEMPLATES = ["Msxml2.XSLTemplate.5.0", "Msxml2.XSLTemplate.4.0", "MSXML2.XSLTemplate.3.0"];
function getActiveXImpl(activeXArray) {
for (var i = 0; i < activeXArray.length; i++) {
try {
var testObj = new ActiveXObject(activeXArray[i]);
if (testObj) {
return activeXArray[i];
}
}
catch (e) {
}
}
dojo.raise("Could not find an ActiveX implementation in:\n\n " + activeXArray);
}
if (xsltUri == null || xsltUri == undefined) {
dojo.raise("You must pass the URI String for the XSL file to be used!");
return false;
}
var xsltDocument = null;
var xsltProcessor = null;
if (IS_IE) {
xsltDocument = new ActiveXObject(getActiveXImpl(ACTIVEX_FT_DOMS));
xsltDocument.async = false;
} else {
xsltProcessor = new XSLTProcessor();
xsltDocument = document.implementation.createDocument("", "", null);
xsltDocument.addEventListener("load", onXslLoad, false);
}
xsltDocument.load(xsltUri);
if (IS_IE) {
var xslt = new ActiveXObject(getActiveXImpl(ACTIVEX_TEMPLATES));
xslt.stylesheet = xsltDocument;
xsltProcessor = xslt.createProcessor();
}
function onXslLoad() {
xsltProcessor.importStylesheet(xsltDocument);
}
function getResultDom(xmlDoc, params) {
if (IS_IE) {
addIeParams(params);
var result = getIeResultDom(xmlDoc);
removeIeParams(params);
return result;
} else {
return getMozillaResultDom(xmlDoc, params);
}
}
function addIeParams(params) {
if (!params) {
return;
}
for (var i = 0; i < params.length; i++) {
xsltProcessor.addParameter(params[i][0], params[i][1]);
}
}
function removeIeParams(params) {
if (!params) {
return;
}
for (var i = 0; i < params.length; i++) {
xsltProcessor.addParameter(params[i][0], "");
}
}
function getIeResultDom(xmlDoc) {
xsltProcessor.input = xmlDoc;
var outDoc = new ActiveXObject(getActiveXImpl(ACTIVEX_DOMS));
outDoc.async = false;
outDoc.validateOnParse = false;
xsltProcessor.output = outDoc;
xsltProcessor.transform();
if (outDoc.parseError.errorCode != 0) {
var err = outDoc.parseError;
dojo.raise("err.errorCode: " + err.errorCode + "\n\nerr.reason: " + err.reason + "\n\nerr.url: " + err.url + "\n\nerr.srcText: " + err.srcText);
}
return outDoc;
}
function getIeResultStr(xmlDoc, params) {
xsltProcessor.input = xmlDoc;
xsltProcessor.transform();
return xsltProcessor.output;
}
function addMozillaParams(params) {
if (!params) {
return;
}
for (var i = 0; i < params.length; i++) {
xsltProcessor.setParameter(null, params[i][0], params[i][1]);
}
}
function getMozillaResultDom(xmlDoc, params) {
addMozillaParams(params);
var resultDoc = xsltProcessor.transformToDocument(xmlDoc);
xsltProcessor.clearParameters();
return resultDoc;
}
function getMozillaResultStr(xmlDoc, params, parentDoc) {
addMozillaParams(params);
var resultDoc = xsltProcessor.transformToFragment(xmlDoc, parentDoc);
var serializer = new XMLSerializer();
xsltProcessor.clearParameters();
return serializer.serializeToString(resultDoc);
}
this.getResultString = function (xmlDoc, params, parentDoc) {
var content = null;
if (IS_IE) {
addIeParams(params);
content = getIeResultStr(xmlDoc, params);
removeIeParams(params);
} else {
content = getMozillaResultStr(xmlDoc, params, parentDoc);
}
return content;
};
this.transformToContentPane = function (xmlDoc, params, contentPane, parentDoc) {
var content = this.getResultString(xmlDoc, params, parentDoc);
contentPane.setContent(content);
};
this.transformToRegion = function (xmlDoc, params, region, parentDoc) {
try {
var content = this.getResultString(xmlDoc, params, parentDoc);
region.innerHTML = content;
}
catch (e) {
dojo.raise(e.message + "\n\n xsltUri: " + xsltUri);
}
};
this.transformToDocument = function (xmlDoc, params) {
return getResultDom(xmlDoc, params);
};
this.transformToWindow = function (xmlDoc, params, windowDoc, parentDoc) {
try {
windowDoc.open();
windowDoc.write(this.getResultString(xmlDoc, params, parentDoc));
windowDoc.close();
}
catch (e) {
dojo.raise(e.message + "\n\n xsltUri: " + xsltUri);
}
};
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/xml/__package__.js
New file
0,0 → 1,14
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.require("dojo.xml.Parse");
dojo.kwCompoundRequire({common:["dojo.dom"], browser:["dojo.html.*"], dashboard:["dojo.html.*"]});
dojo.provide("dojo.xml.*");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/xml/Parse.js
New file
0,0 → 1,163
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.xml.Parse");
dojo.require("dojo.dom");
dojo.xml.Parse = function () {
var isIE = ((dojo.render.html.capable) && (dojo.render.html.ie));
function getTagName(node) {
try {
return node.tagName.toLowerCase();
}
catch (e) {
return "";
}
}
function getDojoTagName(node) {
var tagName = getTagName(node);
if (!tagName) {
return "";
}
if ((dojo.widget) && (dojo.widget.tags[tagName])) {
return tagName;
}
var p = tagName.indexOf(":");
if (p >= 0) {
return tagName;
}
if (tagName.substr(0, 5) == "dojo:") {
return tagName;
}
if (dojo.render.html.capable && dojo.render.html.ie && node.scopeName != "HTML") {
return node.scopeName.toLowerCase() + ":" + tagName;
}
if (tagName.substr(0, 4) == "dojo") {
return "dojo:" + tagName.substring(4);
}
var djt = node.getAttribute("dojoType") || node.getAttribute("dojotype");
if (djt) {
if (djt.indexOf(":") < 0) {
djt = "dojo:" + djt;
}
return djt.toLowerCase();
}
djt = node.getAttributeNS && node.getAttributeNS(dojo.dom.dojoml, "type");
if (djt) {
return "dojo:" + djt.toLowerCase();
}
try {
djt = node.getAttribute("dojo:type");
}
catch (e) {
}
if (djt) {
return "dojo:" + djt.toLowerCase();
}
if ((dj_global["djConfig"]) && (!djConfig["ignoreClassNames"])) {
var classes = node.className || node.getAttribute("class");
if ((classes) && (classes.indexOf) && (classes.indexOf("dojo-") != -1)) {
var aclasses = classes.split(" ");
for (var x = 0, c = aclasses.length; x < c; x++) {
if (aclasses[x].slice(0, 5) == "dojo-") {
return "dojo:" + aclasses[x].substr(5).toLowerCase();
}
}
}
}
return "";
}
this.parseElement = function (node, hasParentNodeSet, optimizeForDojoML, thisIdx) {
var tagName = getTagName(node);
if (isIE && tagName.indexOf("/") == 0) {
return null;
}
try {
var attr = node.getAttribute("parseWidgets");
if (attr && attr.toLowerCase() == "false") {
return {};
}
}
catch (e) {
}
var process = true;
if (optimizeForDojoML) {
var dojoTagName = getDojoTagName(node);
tagName = dojoTagName || tagName;
process = Boolean(dojoTagName);
}
var parsedNodeSet = {};
parsedNodeSet[tagName] = [];
var pos = tagName.indexOf(":");
if (pos > 0) {
var ns = tagName.substring(0, pos);
parsedNodeSet["ns"] = ns;
if ((dojo.ns) && (!dojo.ns.allow(ns))) {
process = false;
}
}
if (process) {
var attributeSet = this.parseAttributes(node);
for (var attr in attributeSet) {
if ((!parsedNodeSet[tagName][attr]) || (typeof parsedNodeSet[tagName][attr] != "array")) {
parsedNodeSet[tagName][attr] = [];
}
parsedNodeSet[tagName][attr].push(attributeSet[attr]);
}
parsedNodeSet[tagName].nodeRef = node;
parsedNodeSet.tagName = tagName;
parsedNodeSet.index = thisIdx || 0;
}
var count = 0;
for (var i = 0; i < node.childNodes.length; i++) {
var tcn = node.childNodes.item(i);
switch (tcn.nodeType) {
case dojo.dom.ELEMENT_NODE:
var ctn = getDojoTagName(tcn) || getTagName(tcn);
if (!parsedNodeSet[ctn]) {
parsedNodeSet[ctn] = [];
}
parsedNodeSet[ctn].push(this.parseElement(tcn, true, optimizeForDojoML, count));
if ((tcn.childNodes.length == 1) && (tcn.childNodes.item(0).nodeType == dojo.dom.TEXT_NODE)) {
parsedNodeSet[ctn][parsedNodeSet[ctn].length - 1].value = tcn.childNodes.item(0).nodeValue;
}
count++;
break;
case dojo.dom.TEXT_NODE:
if (node.childNodes.length == 1) {
parsedNodeSet[tagName].push({value:node.childNodes.item(0).nodeValue});
}
break;
default:
break;
}
}
return parsedNodeSet;
};
this.parseAttributes = function (node) {
var parsedAttributeSet = {};
var atts = node.attributes;
var attnode, i = 0;
while ((attnode = atts[i++])) {
if (isIE) {
if (!attnode) {
continue;
}
if ((typeof attnode == "object") && (typeof attnode.nodeValue == "undefined") || (attnode.nodeValue == null) || (attnode.nodeValue == "")) {
continue;
}
}
var nn = attnode.nodeName.split(":");
nn = (nn.length == 2) ? nn[1] : attnode.nodeName;
parsedAttributeSet[nn] = {value:attnode.nodeValue};
}
return parsedAttributeSet;
};
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/hostenv_rhino.js
New file
0,0 → 1,161
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.hostenv.println = function (line) {
if (arguments.length > 0) {
print(arguments[0]);
for (var i = 1; i < arguments.length; i++) {
var valid = false;
for (var p in arguments[i]) {
valid = true;
break;
}
if (valid) {
dojo.debugShallow(arguments[i]);
}
}
} else {
print(line);
}
};
dojo.locale = dojo.locale || java.util.Locale.getDefault().toString().replace("_", "-").toLowerCase();
dojo.render.name = dojo.hostenv.name_ = "rhino";
dojo.hostenv.getVersion = function () {
return version();
};
if (dj_undef("byId")) {
dojo.byId = function (id, doc) {
if (id && (typeof id == "string" || id instanceof String)) {
if (!doc) {
doc = document;
}
return doc.getElementById(id);
}
return id;
};
}
dojo.hostenv.loadUri = function (uri, cb) {
try {
var local = (new java.io.File(uri)).exists();
if (!local) {
try {
var stream = (new java.net.URL(uri)).openStream();
stream.close();
}
catch (e) {
return false;
}
}
if (cb) {
var contents = (local ? readText : readUri)(uri, "UTF-8");
cb(eval("(" + contents + ")"));
} else {
load(uri);
}
return true;
}
catch (e) {
dojo.debug("rhino load('" + uri + "') failed. Exception: " + e);
return false;
}
};
dojo.hostenv.exit = function (exitcode) {
quit(exitcode);
};
function dj_rhino_current_script_via_java(depth) {
var optLevel = Packages.org.mozilla.javascript.Context.getCurrentContext().getOptimizationLevel();
var caw = new java.io.CharArrayWriter();
var pw = new java.io.PrintWriter(caw);
var exc = new java.lang.Exception();
var s = caw.toString();
var matches = s.match(/[^\(]*\.js\)/gi);
if (!matches) {
throw Error("cannot parse printStackTrace output: " + s);
}
var fname = ((typeof depth != "undefined") && (depth)) ? matches[depth + 1] : matches[matches.length - 1];
var fname = matches[3];
if (!fname) {
fname = matches[1];
}
if (!fname) {
throw Error("could not find js file in printStackTrace output: " + s);
}
return fname;
}
function readText(path, encoding) {
encoding = encoding || "utf-8";
var jf = new java.io.File(path);
var is = new java.io.FileInputStream(jf);
return dj_readInputStream(is, encoding);
}
function readUri(uri, encoding) {
var conn = (new java.net.URL(uri)).openConnection();
encoding = encoding || conn.getContentEncoding() || "utf-8";
var is = conn.getInputStream();
return dj_readInputStream(is, encoding);
}
function dj_readInputStream(is, encoding) {
var input = new java.io.BufferedReader(new java.io.InputStreamReader(is, encoding));
try {
var sb = new java.lang.StringBuffer();
var line = "";
while ((line = input.readLine()) !== null) {
sb.append(line);
sb.append(java.lang.System.getProperty("line.separator"));
}
return sb.toString();
}
finally {
input.close();
}
}
if (!djConfig.libraryScriptUri.length) {
try {
djConfig.libraryScriptUri = dj_rhino_current_script_via_java(1);
}
catch (e) {
if (djConfig["isDebug"]) {
print("\n");
print("we have no idea where Dojo is located.");
print("Please try loading rhino in a non-interpreted mode or set a");
print("\n\tdjConfig.libraryScriptUri\n");
print("Setting the dojo path to './'");
print("This is probably wrong!");
print("\n");
print("Dojo will try to load anyway");
}
djConfig.libraryScriptUri = "./";
}
}
dojo.doc = function () {
return document;
};
dojo.body = function () {
return document.body;
};
function setTimeout(func, delay) {
var def = {sleepTime:delay, hasSlept:false, run:function () {
if (!this.hasSlept) {
this.hasSlept = true;
java.lang.Thread.currentThread().sleep(this.sleepTime);
}
try {
func();
}
catch (e) {
dojo.debug("Error running setTimeout thread:" + e);
}
}};
var runnable = new java.lang.Runnable(def);
var thread = new java.lang.Thread(runnable);
thread.start();
}
dojo.requireIf((djConfig["isDebug"] || djConfig["debugAtAllCosts"]), "dojo.debug");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/docs.js
New file
0,0 → 1,671
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.docs");
dojo.require("dojo.io.*");
dojo.require("dojo.event.topic");
dojo.require("dojo.rpc.JotService");
dojo.require("dojo.dom");
dojo.require("dojo.uri.Uri");
dojo.require("dojo.Deferred");
dojo.require("dojo.DeferredList");
 
/*
* TODO:
*
* Package summary needs to compensate for "is"
* Handle host environments
* Deal with dojo.widget weirdness
* Parse parameters
* Limit function parameters to only the valid ones (Involves packing parameters onto meta during rewriting)
*
*/
 
dojo.docs = new function() {
this._url = dojo.uri.dojoUri("docscripts");
this._rpc = new dojo.rpc.JotService;
this._rpc.serviceUrl = dojo.uri.dojoUri("docscripts/jsonrpc.php");
};
dojo.lang.mixin(dojo.docs, {
_count: 0,
_callbacks: {function_names: []},
_cache: {}, // Saves the JSON objects in cache
require: function(/*String*/ require, /*bool*/ sync) {
dojo.debug("require(): " + require);
var parts = require.split("/");
var size = parts.length;
var deferred = new dojo.Deferred;
var args = {
mimetype: "text/json",
load: function(type, data){
dojo.debug("require(): loaded for " + require);
if(parts[0] != "function_names") {
for(var i = 0, part; part = parts[i]; i++){
data = data[part];
}
}
deferred.callback(data);
},
error: function(){
deferred.errback();
}
};
 
if(location.protocol == "file:"){
if(size){
if(parts[parts.length - 1] == "documentation"){
parts[parts.length - 1] = "meta";
}
if(parts[0] == "function_names"){
args.url = [this._url, "local_json", "function_names"].join("/");
}else{
var dirs = parts[0].split(".");
args.url = [this._url, "local_json", dirs[0]].join("/");
if(dirs.length > 1){
args.url = [args.url, dirs[1]].join(".");
}
}
}
}
dojo.io.bind(args);
return deferred;
},
getFunctionNames: function(){
return this.require("function_names"); // dojo.Deferred
},
unFormat: function(/*String*/ string){
var fString = string;
if(string.charAt(string.length - 1) == "_"){
fString = [string.substring(0, string.length - 1), "*"].join("");
}
return fString;
},
getMeta: function(/*String*/ pkg, /*String*/ name, /*Function*/ callback, /*String?*/ id){
// summary: Gets information about a function in regards to its meta data
if(typeof name == "function"){
// pId: a
// pkg: ignore
id = callback;
callback = name;
name = pkg;
pkg = null;
dojo.debug("getMeta(" + name + ")");
}else{
dojo.debug("getMeta(" + pkg + "/" + name + ")");
}
if(!id){
id = "_";
}
},
_withPkg: function(/*String*/ type, /*Object*/ data, /*Object*/ evt, /*Object*/ input, /*String*/ newType){
dojo.debug("_withPkg(" + evt.name + ") has package: " + data[0]);
evt.pkg = data[0];
if("load" == type && evt.pkg){
evt.type = newType;
}else{
if(evt.callbacks && evt.callbacks.length){
evt.callbacks.shift()("error", {}, evt, evt.input);
}
}
},
_gotMeta: function(/*String*/ type, /*Object*/ data, /*Object*/ evt){
dojo.debug("_gotMeta(" + evt.name + ")");
 
var cached = dojo.docs._getCache(evt.pkg, evt.name, "meta", "functions", evt.id);
if(cached.summary){
data.summary = cached.summary;
}
if(evt.callbacks && evt.callbacks.length){
evt.callbacks.shift()(type, data, evt, evt.input);
}
},
getSrc: function(/*String*/ name, /*Function*/ callback, /*String?*/ id){
// summary: Gets src file (created by the doc parser)
dojo.debug("getSrc(" + name + ")");
if(!id){
id = "_";
}
},
getDoc: function(/*String*/ name, /*Function*/ callback, /*String?*/ id){
// summary: Gets external documentation stored on Jot for a given function
dojo.debug("getDoc(" + name + ")");
 
if(!id){
id = "_";
}
 
var input = {};
 
input.type = "doc";
input.name = name;
input.callbacks = [callback];
},
_gotDoc: function(/*String*/ type, /*Array*/ data, /*Object*/ evt, /*Object*/ input){
dojo.debug("_gotDoc(" + evt.type + ")");
evt[evt.type] = data;
if(evt.expects && evt.expects.doc){
for(var i = 0, expect; expect = evt.expects.doc[i]; i++){
if(!(expect in evt)){
dojo.debug("_gotDoc() waiting for more data");
return;
}
}
}
var cache = dojo.docs._getCache(evt.pkg, "meta", "functions", evt.name, evt.id, "meta");
 
var description = evt.fn.description;
cache.description = description;
data = {
returns: evt.fn.returns,
id: evt.id,
variables: []
}
if(!cache.parameters){
cache.parameters = {};
}
for(var i = 0, param; param = evt.param[i]; i++){
var fName = param["DocParamForm/name"];
if(!cache.parameters[fName]){
cache.parameters[fName] = {};
}
cache.parameters[fName].description = param["DocParamForm/desc"]
}
 
data.description = cache.description;
data.parameters = cache.parameters;
evt.type = "doc";
if(evt.callbacks && evt.callbacks.length){
evt.callbacks.shift()("load", data, evt, input);
}
},
getPkgDoc: function(/*String*/ name, /*Function*/ callback){
// summary: Gets external documentation stored on Jot for a given package
dojo.debug("getPkgDoc(" + name + ")");
var input = {};
},
getPkgInfo: function(/*String*/ name, /*Function*/ callback){
// summary: Gets a combination of the metadata and external documentation for a given package
dojo.debug("getPkgInfo(" + name + ")");
 
var input = {
expects: {
pkginfo: ["pkgmeta", "pkgdoc"]
},
callback: callback
};
dojo.docs.getPkgMeta(input, name, dojo.docs._getPkgInfo);
dojo.docs.getPkgDoc(input, name, dojo.docs._getPkgInfo);
},
_getPkgInfo: function(/*String*/ type, /*Object*/ data, /*Object*/ evt){
dojo.debug("_getPkgInfo() for " + evt.type);
var input = {};
var results = {};
if(typeof key == "object"){
input = key;
input[evt.type] = data;
if(input.expects && input.expects.pkginfo){
for(var i = 0, expect; expect = input.expects.pkginfo[i]; i++){
if(!(expect in input)){
dojo.debug("_getPkgInfo() waiting for more data");
return;
}
}
}
results = input.pkgmeta;
results.description = input.pkgdoc;
}
 
if(input.callback){
input.callback("load", results, evt);
}
},
getInfo: function(/*String*/ name, /*Function*/ callback){
dojo.debug("getInfo(" + name + ")");
var input = {
expects: {
"info": ["meta", "doc"]
},
callback: callback
}
dojo.docs.getMeta(input, name, dojo.docs._getInfo);
dojo.docs.getDoc(input, name, dojo.docs._getInfo);
},
_getInfo: function(/*String*/ type, /*String*/ data, /*Object*/ evt, /*Object*/ input){
dojo.debug("_getInfo(" + evt.type + ")");
if(input && input.expects && input.expects.info){
input[evt.type] = data;
for(var i = 0, expect; expect = input.expects.info[i]; i++){
if(!(expect in input)){
dojo.debug("_getInfo() waiting for more data");
return;
}
}
}
 
if(input.callback){
input.callback("load", dojo.docs._getCache(evt.pkg, "meta", "functions", evt.name, evt.id, "meta"), evt, input);
}
},
_getMainText: function(/*String*/ text){
// summary: Grabs the innerHTML from a Jot Rech Text node
dojo.debug("_getMainText()");
return text.replace(/^<html[^<]*>/, "").replace(/<\/html>$/, "").replace(/<\w+\s*\/>/g, "");
},
getPackageMeta: function(/*Object*/ input){
dojo.debug("getPackageMeta(): " + input.package);
return this.require(input.package + "/meta", input.sync);
},
getFunctionMeta: function(/*Object*/ input){
var package = input.package || "";
var name = input.name;
var id = input.id || "_";
dojo.debug("getFunctionMeta(): " + name);
 
if(!name) return;
 
if(package){
return this.require(package + "/meta/functions/" + name + "/" + id + "/meta");
}else{
this.getFunctionNames();
}
},
getFunctionDocumentation: function(/*Object*/ input){
var package = input.package || "";
var name = input.name;
var id = input.id || "_";
dojo.debug("getFunctionDocumentation(): " + name);
if(!name) return;
if(package){
return this.require(package + "/meta/functions/" + name + "/" + id + "/documentation");
}
},
_onDocSearch: function(/*Object*/ input){
var _this = this;
var name = input.name.toLowerCase();
if(!name) return;
 
this.getFunctionNames().addCallback(function(data){
dojo.debug("_onDocSearch(): function names loaded for " + name);
 
var output = [];
var list = [];
var closure = function(pkg, fn) {
return function(data){
dojo.debug("_onDocSearch(): package meta loaded for: " + pkg);
if(data.functions){
var functions = data.functions;
for(var key in functions){
if(fn == key){
var ids = functions[key];
for(var id in ids){
var fnMeta = ids[id];
output.push({
package: pkg,
name: fn,
id: id,
summary: fnMeta.summary
});
}
}
}
}
return output;
}
}
 
pkgLoop:
for(var pkg in data){
if(pkg.toLowerCase() == name){
name = pkg;
dojo.debug("_onDocSearch found a package");
//dojo.docs._onDocSelectPackage(input);
return;
}
for(var i = 0, fn; fn = data[pkg][i]; i++){
if(fn.toLowerCase().indexOf(name) != -1){
dojo.debug("_onDocSearch(): Search matched " + fn);
var meta = _this.getPackageMeta({package: pkg});
meta.addCallback(closure(pkg, fn));
list.push(meta);
 
// Build a list of all packages that need to be loaded and their loaded state.
continue pkgLoop;
}
}
}
list = new dojo.DeferredList(list);
list.addCallback(function(results){
dojo.debug("_onDocSearch(): All packages loaded");
_this._printFunctionResults(results[0][1]);
});
});
},
_onDocSearchFn: function(/*String*/ type, /*Array*/ data, /*Object*/ evt){
dojo.debug("_onDocSearchFn(" + evt.name + ")");
 
var name = evt.name || evt.pkg;
 
dojo.debug("_onDocSearchFn found a function");
 
evt.pkgs = packages;
evt.pkg = name;
evt.loaded = 0;
for(var i = 0, pkg; pkg = packages[i]; i++){
dojo.docs.getPkgMeta(evt, pkg, dojo.docs._onDocResults);
}
},
_onPkgResults: function(/*String*/ type, /*Object*/ data, /*Object*/ evt, /*Object*/ input){
dojo.debug("_onPkgResults(" + evt.type + ")");
var description = "";
var path = "";
var methods = {};
var requires = {};
if(input){
input[evt.type] = data;
if(input.expects && input.expects.pkgresults){
for(var i = 0, expect; expect = input.expects.pkgresults[i]; i++){
if(!(expect in input)){
dojo.debug("_onPkgResults() waiting for more data");
return;
}
}
}
path = input.pkgdoc.path;
description = input.pkgdoc.description;
methods = input.pkgmeta.methods;
requires = input.pkgmeta.requires;
}
var pkg = evt.name.replace("_", "*");
var results = {
path: path,
description: description,
size: 0,
methods: [],
pkg: pkg,
requires: requires
}
var rePrivate = /_[^.]+$/;
for(var method in methods){
if(!rePrivate.test(method)){
for(var pId in methods[method]){
results.methods.push({
pkg: pkg,
name: method,
id: pId,
summary: methods[method][pId].summary
})
}
}
}
results.size = results.methods.length;
dojo.docs._printPkgResult(results);
},
_onDocResults: function(/*String*/ type, /*Object*/ data, /*Object*/ evt, /*Object*/ input){
dojo.debug("_onDocResults(" + evt.name + "/" + input.pkg + ") " + type);
++input.loaded;
 
if(input.loaded == input.pkgs.length){
var pkgs = input.pkgs;
var name = input.pkg;
var results = {methods: []};
var rePrivate = /_[^.]+$/;
data = dojo.docs._cache;
 
for(var i = 0, pkg; pkg = pkgs[i]; i++){
var methods = dojo.docs._getCache(pkg, "meta", "methods");
for(var fn in methods){
if(fn.toLowerCase().indexOf(name) == -1){
continue;
}
if(fn != "requires" && !rePrivate.test(fn)){
for(var pId in methods[fn]){
var result = {
pkg: pkg,
name: fn,
id: "_",
summary: ""
}
if(methods[fn][pId].summary){
result.summary = methods[fn][pId].summary;
}
results.methods.push(result);
}
}
}
}
 
dojo.debug("Publishing docResults");
dojo.docs._printFnResults(results);
}
},
_printFunctionResults: function(results){
dojo.debug("_printFnResults(): called");
// summary: Call this function to send the /docs/function/results topic
},
_printPkgResult: function(results){
dojo.debug("_printPkgResult(): called");
},
_onDocSelectFunction: function(/*Object*/ input){
// summary: Get doc, meta, and src
var name = input.name;
var package = input.package || "";
var id = input.id || "_";
dojo.debug("_onDocSelectFunction(" + name + ")");
if(!name || !package) return false;
 
var pkgMeta = this.getPackageMeta({package: package});
var meta = this.getFunctionMeta({package: package, name: name, id: id});
var doc = this.getFunctionDocumentation({package: package, name: name, id: id});
var list = new dojo.DeferredList([pkgMeta, meta, doc]);
list.addCallback(function(results){
dojo.debug("_onDocSelectFunction() loaded");
for(var i = 0, result; result = results[i]; i++){
dojo.debugShallow(result[1]);
}
});
return list;
},
_onDocSelectPackage: function(/*Object*/ input){
dojo.debug("_onDocSelectPackage(" + input.name + ")")
input.expects = {
"pkgresults": ["pkgmeta", "pkgdoc"]
};
dojo.docs.getPkgMeta(input, input.name, dojo.docs._onPkgResults);
dojo.docs.getPkgDoc(input, input.name, dojo.docs._onPkgResults);
},
_onDocSelectResults: function(/*String*/ type, /*Object*/ data, /*Object*/ evt, /*Object*/ input){
dojo.debug("_onDocSelectResults(" + evt.type + ", " + evt.name + ")");
if(evt.type == "meta"){
dojo.docs.getPkgMeta(input, evt.pkg, dojo.docs._onDocSelectResults);
}
if(input){
input[evt.type] = data;
if(input.expects && input.expects.docresults){
for(var i = 0, expect; expect = input.expects.docresults[i]; i++){
if(!(expect in input)){
dojo.debug("_onDocSelectResults() waiting for more data");
return;
}
}
}
}
 
dojo.docs._printFunctionDetail(input);
},
_printFunctionDetail: function(results) {
// summary: Call this function to send the /docs/function/detail topic event
},
 
selectFunction: function(/*String*/ name, /*String?*/ id){
// summary: The combined information
},
savePackage: function(/*Object*/ callbackObject, /*String*/ callback, /*Object*/ parameters){
dojo.event.kwConnect({
srcObj: dojo.docs,
srcFunc: "_savedPkgRpc",
targetObj: callbackObject,
targetFunc: callback,
once: true
});
var props = {};
var cache = dojo.docs._getCache(parameters.pkg, "meta");
 
var i = 1;
 
if(!cache.path){
var path = "id";
props[["pname", i].join("")] = "DocPkgForm/require";
props[["pvalue", i++].join("")] = parameters.pkg;
}else{
var path = cache.path;
}
 
props.form = "//DocPkgForm";
props.path = ["/WikiHome/DojoDotDoc/", path].join("");
 
if(parameters.description){
props[["pname", i].join("")] = "main/text";
props[["pvalue", i++].join("")] = parameters.description;
}
dojo.docs._rpc.callRemote("saveForm", props).addCallbacks(dojo.docs._pkgRpc, dojo.docs._pkgRpc);
},
_pkgRpc: function(data){
if(data.name){
dojo.docs._getCache(data["DocPkgForm/require"], "meta").path = data.name;
dojo.docs._savedPkgRpc("load");
}else{
dojo.docs._savedPkgRpc("error");
}
},
_savedPkgRpc: function(type){
},
functionPackages: function(/*String*/ name, /*Function*/ callback, /*Object*/ input){
// summary: Gets the package associated with a function and stores it in the .pkg value of input
dojo.debug("functionPackages() name: " + name);
 
if(!input){
input = {};
}
if(!input.callbacks){
input.callbacks = [];
}
 
input.type = "function_names";
input.name = name;
input.callbacks.unshift(callback);
input.callbacks.unshift(dojo.docs._functionPackages);
},
_functionPackages: function(/*String*/ type, /*Array*/ data, /*Object*/ evt){
dojo.debug("_functionPackages() name: " + evt.name);
evt.pkg = '';
 
var results = [];
var data = dojo.docs._cache['function_names'];
for(var key in data){
if(dojo.lang.inArray(data[key], evt.name)){
dojo.debug("_functionPackages() package: " + key);
results.push(key);
}
}
 
if(evt.callbacks && evt.callbacks.length){
evt.callbacks.shift()(type, results, evt, evt.input);
}
},
setUserName: function(/*String*/ name){
dojo.docs._userName = name;
if(name && dojo.docs._password){
dojo.docs._logIn();
}
},
setPassword: function(/*String*/ password){
dojo.docs._password = password;
if(password && dojo.docs._userName){
dojo.docs._logIn();
}
},
_logIn: function(){
dojo.io.bind({
url: dojo.docs._rpc.serviceUrl.toString(),
method: "post",
mimetype: "text/json",
content: {
username: dojo.docs._userName,
password: dojo.docs._password
},
load: function(type, data){
if(data.error){
dojo.docs.logInSuccess();
}else{
dojo.docs.logInFailure();
}
},
error: function(){
dojo.docs.logInFailure();
}
});
},
logInSuccess: function(){},
logInFailure: function(){},
_set: function(/*Object*/ base, /*String...*/ keys, /*String*/ value){
var args = [];
for(var i = 0, arg; arg = arguments[i]; i++){
args.push(arg);
}
 
if(args.length < 3) return;
base = args.shift();
value = args.pop();
var key = args.pop();
for(var i = 0, arg; arg = args[i]; i++){
if(typeof base[arg] != "object"){
base[arg] = {};
}
base = base[arg];
}
base[key] = value;
},
_getCache: function(/*String...*/ keys){
var obj = dojo.docs._cache;
for(var i = 0; i < arguments.length; i++){
var arg = arguments[i];
if(!obj[arg]){
obj[arg] = {};
}
obj = obj[arg];
}
return obj;
}
});
 
dojo.event.topic.subscribe("/docs/search", dojo.docs, "_onDocSearch");
dojo.event.topic.subscribe("/docs/function/select", dojo.docs, "_onDocSelectFunction");
dojo.event.topic.subscribe("/docs/package/select", dojo.docs, "_onDocSelectPackage");
 
dojo.event.topic.registerPublisher("/docs/function/results", dojo.docs, "_printFunctionResults");
dojo.event.topic.registerPublisher("/docs/function/detail", dojo.docs, "_printFunctionDetail");
dojo.event.topic.registerPublisher("/docs/package/detail", dojo.docs, "_printPkgResult");
/tags/Racine_livraison_narmer/api/js/dojo/src/browser_debug.js
New file
0,0 → 1,133
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.browser_debug");
dojo.hostenv.loadedUris.push("../src/bootstrap1.js");
dojo.hostenv.loadedUris.push("../src/loader.js");
dojo.hostenv.loadedUris.push("../src/hostenv_browser.js");
dojo.hostenv._loadedUrisListStart = dojo.hostenv.loadedUris.length;
function removeComments(contents) {
contents = new String((!contents) ? "" : contents);
contents = contents.replace(/^(.*?)\/\/(.*)$/mg, "$1");
contents = contents.replace(/(\n)/mg, "__DOJONEWLINE");
contents = contents.replace(/\/\*(.*?)\*\//g, "");
return contents.replace(/__DOJONEWLINE/mg, "\n");
}
dojo.hostenv.getRequiresAndProvides = function (contents) {
if (!contents) {
return [];
}
var deps = [];
var tmp;
RegExp.lastIndex = 0;
var testExp = /dojo.(hostenv.loadModule|hostenv.require|require|requireIf|kwCompoundRequire|hostenv.conditionalLoadModule|hostenv.startPackage|provide)\([\w\W]*?\)/mg;
while ((tmp = testExp.exec(contents)) != null) {
deps.push(tmp[0]);
}
return deps;
};
dojo.hostenv.getDelayRequiresAndProvides = function (contents) {
if (!contents) {
return [];
}
var deps = [];
var tmp;
RegExp.lastIndex = 0;
var testExp = /dojo.(requireAfterIf)\([\w\W]*?\)/mg;
while ((tmp = testExp.exec(contents)) != null) {
deps.push(tmp[0]);
}
return deps;
};
dojo.clobberLastObject = function (objpath) {
if (objpath.indexOf(".") == -1) {
if (!dj_undef(objpath, dj_global)) {
delete dj_global[objpath];
}
return true;
}
var syms = objpath.split(/\./);
var base = dojo.evalObjPath(syms.slice(0, -1).join("."), false);
var child = syms[syms.length - 1];
if (!dj_undef(child, base)) {
delete base[child];
return true;
}
return false;
};
var removals = [];
function zip(arr) {
var ret = [];
var seen = {};
for (var x = 0; x < arr.length; x++) {
if (!seen[arr[x]]) {
ret.push(arr[x]);
seen[arr[x]] = true;
}
}
return ret;
}
var old_dj_eval = dj_eval;
dj_eval = function () {
return true;
};
dojo.hostenv.oldLoadUri = dojo.hostenv.loadUri;
dojo.hostenv.loadUri = function (uri, cb) {
if (dojo.hostenv.loadedUris[uri]) {
return true;
}
try {
var text = this.getText(uri, null, true);
if (!text) {
return false;
}
if (cb) {
var expr = old_dj_eval("(" + text + ")");
cb(expr);
} else {
var requires = dojo.hostenv.getRequiresAndProvides(text);
eval(requires.join(";"));
dojo.hostenv.loadedUris.push(uri);
dojo.hostenv.loadedUris[uri] = true;
var delayRequires = dojo.hostenv.getDelayRequiresAndProvides(text);
eval(delayRequires.join(";"));
}
}
catch (e) {
alert(e);
}
return true;
};
dojo.hostenv._writtenIncludes = {};
dojo.hostenv.writeIncludes = function (willCallAgain) {
for (var x = removals.length - 1; x >= 0; x--) {
dojo.clobberLastObject(removals[x]);
}
var depList = [];
var seen = dojo.hostenv._writtenIncludes;
for (var x = 0; x < dojo.hostenv.loadedUris.length; x++) {
var curi = dojo.hostenv.loadedUris[x];
if (!seen[curi]) {
seen[curi] = true;
depList.push(curi);
}
}
dojo.hostenv._global_omit_module_check = true;
for (var x = dojo.hostenv._loadedUrisListStart; x < depList.length; x++) {
document.write("<script type='text/javascript' src='" + depList[x] + "'></script>");
}
document.write("<script type='text/javascript'>dojo.hostenv._global_omit_module_check = false;</script>");
dojo.hostenv._loadedUrisListStart = 0;
if (!willCallAgain) {
dj_eval = old_dj_eval;
dojo.hostenv.loadUri = dojo.hostenv.oldLoadUri;
}
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/undo/browser.js
New file
0,0 → 1,201
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.undo.browser");
dojo.require("dojo.io.common");
try {
if ((!djConfig["preventBackButtonFix"]) && (!dojo.hostenv.post_load_)) {
document.write("<iframe style='border: 0px; width: 1px; height: 1px; position: absolute; bottom: 0px; right: 0px; visibility: visible;' name='djhistory' id='djhistory' src='" + (djConfig["dojoIframeHistoryUrl"] || dojo.hostenv.getBaseScriptUri() + "iframe_history.html") + "'></iframe>");
}
}
catch (e) {
}
if (dojo.render.html.opera) {
dojo.debug("Opera is not supported with dojo.undo.browser, so back/forward detection will not work.");
}
dojo.undo.browser = {initialHref:(!dj_undef("window")) ? window.location.href : "", initialHash:(!dj_undef("window")) ? window.location.hash : "", moveForward:false, historyStack:[], forwardStack:[], historyIframe:null, bookmarkAnchor:null, locationTimer:null, setInitialState:function (args) {
this.initialState = this._createState(this.initialHref, args, this.initialHash);
}, addToHistory:function (args) {
this.forwardStack = [];
var hash = null;
var url = null;
if (!this.historyIframe) {
if (djConfig["useXDomain"] && !djConfig["dojoIframeHistoryUrl"]) {
dojo.debug("dojo.undo.browser: When using cross-domain Dojo builds," + " please save iframe_history.html to your domain and set djConfig.dojoIframeHistoryUrl" + " to the path on your domain to iframe_history.html");
}
this.historyIframe = window.frames["djhistory"];
}
if (!this.bookmarkAnchor) {
this.bookmarkAnchor = document.createElement("a");
dojo.body().appendChild(this.bookmarkAnchor);
this.bookmarkAnchor.style.display = "none";
}
if (args["changeUrl"]) {
hash = "#" + ((args["changeUrl"] !== true) ? args["changeUrl"] : (new Date()).getTime());
if (this.historyStack.length == 0 && this.initialState.urlHash == hash) {
this.initialState = this._createState(url, args, hash);
return;
} else {
if (this.historyStack.length > 0 && this.historyStack[this.historyStack.length - 1].urlHash == hash) {
this.historyStack[this.historyStack.length - 1] = this._createState(url, args, hash);
return;
}
}
this.changingUrl = true;
setTimeout("window.location.href = '" + hash + "'; dojo.undo.browser.changingUrl = false;", 1);
this.bookmarkAnchor.href = hash;
if (dojo.render.html.ie) {
url = this._loadIframeHistory();
var oldCB = args["back"] || args["backButton"] || args["handle"];
var tcb = function (handleName) {
if (window.location.hash != "") {
setTimeout("window.location.href = '" + hash + "';", 1);
}
oldCB.apply(this, [handleName]);
};
if (args["back"]) {
args.back = tcb;
} else {
if (args["backButton"]) {
args.backButton = tcb;
} else {
if (args["handle"]) {
args.handle = tcb;
}
}
}
var oldFW = args["forward"] || args["forwardButton"] || args["handle"];
var tfw = function (handleName) {
if (window.location.hash != "") {
window.location.href = hash;
}
if (oldFW) {
oldFW.apply(this, [handleName]);
}
};
if (args["forward"]) {
args.forward = tfw;
} else {
if (args["forwardButton"]) {
args.forwardButton = tfw;
} else {
if (args["handle"]) {
args.handle = tfw;
}
}
}
} else {
if (dojo.render.html.moz) {
if (!this.locationTimer) {
this.locationTimer = setInterval("dojo.undo.browser.checkLocation();", 200);
}
}
}
} else {
url = this._loadIframeHistory();
}
this.historyStack.push(this._createState(url, args, hash));
}, checkLocation:function () {
if (!this.changingUrl) {
var hsl = this.historyStack.length;
if ((window.location.hash == this.initialHash || window.location.href == this.initialHref) && (hsl == 1)) {
this.handleBackButton();
return;
}
if (this.forwardStack.length > 0) {
if (this.forwardStack[this.forwardStack.length - 1].urlHash == window.location.hash) {
this.handleForwardButton();
return;
}
}
if ((hsl >= 2) && (this.historyStack[hsl - 2])) {
if (this.historyStack[hsl - 2].urlHash == window.location.hash) {
this.handleBackButton();
return;
}
}
}
}, iframeLoaded:function (evt, ifrLoc) {
if (!dojo.render.html.opera) {
var query = this._getUrlQuery(ifrLoc.href);
if (query == null) {
if (this.historyStack.length == 1) {
this.handleBackButton();
}
return;
}
if (this.moveForward) {
this.moveForward = false;
return;
}
if (this.historyStack.length >= 2 && query == this._getUrlQuery(this.historyStack[this.historyStack.length - 2].url)) {
this.handleBackButton();
} else {
if (this.forwardStack.length > 0 && query == this._getUrlQuery(this.forwardStack[this.forwardStack.length - 1].url)) {
this.handleForwardButton();
}
}
}
}, handleBackButton:function () {
var current = this.historyStack.pop();
if (!current) {
return;
}
var last = this.historyStack[this.historyStack.length - 1];
if (!last && this.historyStack.length == 0) {
last = this.initialState;
}
if (last) {
if (last.kwArgs["back"]) {
last.kwArgs["back"]();
} else {
if (last.kwArgs["backButton"]) {
last.kwArgs["backButton"]();
} else {
if (last.kwArgs["handle"]) {
last.kwArgs.handle("back");
}
}
}
}
this.forwardStack.push(current);
}, handleForwardButton:function () {
var last = this.forwardStack.pop();
if (!last) {
return;
}
if (last.kwArgs["forward"]) {
last.kwArgs.forward();
} else {
if (last.kwArgs["forwardButton"]) {
last.kwArgs.forwardButton();
} else {
if (last.kwArgs["handle"]) {
last.kwArgs.handle("forward");
}
}
}
this.historyStack.push(last);
}, _createState:function (url, args, hash) {
return {"url":url, "kwArgs":args, "urlHash":hash};
}, _getUrlQuery:function (url) {
var segments = url.split("?");
if (segments.length < 2) {
return null;
} else {
return segments[1];
}
}, _loadIframeHistory:function () {
var url = (djConfig["dojoIframeHistoryUrl"] || dojo.hostenv.getBaseScriptUri() + "iframe_history.html") + "?" + (new Date()).getTime();
this.moveForward = true;
dojo.io.setIFrameSrc(this.historyIframe, url, false);
return url;
}};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/undo/__package__.js
New file
0,0 → 1,13
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.require("dojo.undo.Manager");
dojo.provide("dojo.undo.*");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/undo/Manager.js
New file
0,0 → 1,148
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.undo.Manager");
dojo.require("dojo.lang.common");
dojo.undo.Manager = function (parent) {
this.clear();
this._parent = parent;
};
dojo.extend(dojo.undo.Manager, {_parent:null, _undoStack:null, _redoStack:null, _currentManager:null, canUndo:false, canRedo:false, isUndoing:false, isRedoing:false, onUndo:function (manager, item) {
}, onRedo:function (manager, item) {
}, onUndoAny:function (manager, item) {
}, onRedoAny:function (manager, item) {
}, _updateStatus:function () {
this.canUndo = this._undoStack.length > 0;
this.canRedo = this._redoStack.length > 0;
}, clear:function () {
this._undoStack = [];
this._redoStack = [];
this._currentManager = this;
this.isUndoing = false;
this.isRedoing = false;
this._updateStatus();
}, undo:function () {
if (!this.canUndo) {
return false;
}
this.endAllTransactions();
this.isUndoing = true;
var top = this._undoStack.pop();
if (top instanceof dojo.undo.Manager) {
top.undoAll();
} else {
top.undo();
}
if (top.redo) {
this._redoStack.push(top);
}
this.isUndoing = false;
this._updateStatus();
this.onUndo(this, top);
if (!(top instanceof dojo.undo.Manager)) {
this.getTop().onUndoAny(this, top);
}
return true;
}, redo:function () {
if (!this.canRedo) {
return false;
}
this.isRedoing = true;
var top = this._redoStack.pop();
if (top instanceof dojo.undo.Manager) {
top.redoAll();
} else {
top.redo();
}
this._undoStack.push(top);
this.isRedoing = false;
this._updateStatus();
this.onRedo(this, top);
if (!(top instanceof dojo.undo.Manager)) {
this.getTop().onRedoAny(this, top);
}
return true;
}, undoAll:function () {
while (this._undoStack.length > 0) {
this.undo();
}
}, redoAll:function () {
while (this._redoStack.length > 0) {
this.redo();
}
}, push:function (undo, redo, description) {
if (!undo) {
return;
}
if (this._currentManager == this) {
this._undoStack.push({undo:undo, redo:redo, description:description});
} else {
this._currentManager.push.apply(this._currentManager, arguments);
}
this._redoStack = [];
this._updateStatus();
}, concat:function (manager) {
if (!manager) {
return;
}
if (this._currentManager == this) {
for (var x = 0; x < manager._undoStack.length; x++) {
this._undoStack.push(manager._undoStack[x]);
}
if (manager._undoStack.length > 0) {
this._redoStack = [];
}
this._updateStatus();
} else {
this._currentManager.concat.apply(this._currentManager, arguments);
}
}, beginTransaction:function (description) {
if (this._currentManager == this) {
var mgr = new dojo.undo.Manager(this);
mgr.description = description ? description : "";
this._undoStack.push(mgr);
this._currentManager = mgr;
return mgr;
} else {
this._currentManager = this._currentManager.beginTransaction.apply(this._currentManager, arguments);
}
}, endTransaction:function (flatten) {
if (this._currentManager == this) {
if (this._parent) {
this._parent._currentManager = this._parent;
if (this._undoStack.length == 0 || flatten) {
var idx = dojo.lang.find(this._parent._undoStack, this);
if (idx >= 0) {
this._parent._undoStack.splice(idx, 1);
if (flatten) {
for (var x = 0; x < this._undoStack.length; x++) {
this._parent._undoStack.splice(idx++, 0, this._undoStack[x]);
}
this._updateStatus();
}
}
}
return this._parent;
}
} else {
this._currentManager = this._currentManager.endTransaction.apply(this._currentManager, arguments);
}
}, endAllTransactions:function () {
while (this._currentManager != this) {
this.endTransaction();
}
}, getTop:function () {
if (this._parent) {
return this._parent.getTop();
} else {
return this;
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/dnd/HtmlDragMove.js
New file
0,0 → 1,52
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.dnd.HtmlDragMove");
dojo.require("dojo.dnd.*");
dojo.declare("dojo.dnd.HtmlDragMoveSource", dojo.dnd.HtmlDragSource, {onDragStart:function () {
var dragObj = new dojo.dnd.HtmlDragMoveObject(this.dragObject, this.type);
if (this.constrainToContainer) {
dragObj.constrainTo(this.constrainingContainer);
}
return dragObj;
}, onSelected:function () {
for (var i = 0; i < this.dragObjects.length; i++) {
dojo.dnd.dragManager.selectedSources.push(new dojo.dnd.HtmlDragMoveSource(this.dragObjects[i]));
}
}});
dojo.declare("dojo.dnd.HtmlDragMoveObject", dojo.dnd.HtmlDragObject, {onDragStart:function (e) {
dojo.html.clearSelection();
this.dragClone = this.domNode;
if (dojo.html.getComputedStyle(this.domNode, "position") != "absolute") {
this.domNode.style.position = "relative";
}
var left = parseInt(dojo.html.getComputedStyle(this.domNode, "left"));
var top = parseInt(dojo.html.getComputedStyle(this.domNode, "top"));
this.dragStartPosition = {x:isNaN(left) ? 0 : left, y:isNaN(top) ? 0 : top};
this.scrollOffset = dojo.html.getScroll().offset;
this.dragOffset = {y:this.dragStartPosition.y - e.pageY, x:this.dragStartPosition.x - e.pageX};
this.containingBlockPosition = {x:0, y:0};
if (this.constrainToContainer) {
this.constraints = this.getConstraints();
}
dojo.event.connect(this.domNode, "onclick", this, "_squelchOnClick");
}, onDragEnd:function (e) {
}, setAbsolutePosition:function (x, y) {
if (!this.disableY) {
this.domNode.style.top = y + "px";
}
if (!this.disableX) {
this.domNode.style.left = x + "px";
}
}, _squelchOnClick:function (e) {
dojo.event.browser.stopEvent(e);
dojo.event.disconnect(this.domNode, "onclick", this, "_squelchOnClick");
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/dnd/HtmlDragAndDrop.js
New file
0,0 → 1,367
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.dnd.HtmlDragAndDrop");
dojo.require("dojo.dnd.HtmlDragManager");
dojo.require("dojo.dnd.DragAndDrop");
dojo.require("dojo.html.*");
dojo.require("dojo.html.display");
dojo.require("dojo.html.util");
dojo.require("dojo.html.selection");
dojo.require("dojo.html.iframe");
dojo.require("dojo.lang.extras");
dojo.require("dojo.lfx.*");
dojo.require("dojo.event.*");
dojo.declare("dojo.dnd.HtmlDragSource", dojo.dnd.DragSource, {dragClass:"", onDragStart:function () {
var dragObj = new dojo.dnd.HtmlDragObject(this.dragObject, this.type);
if (this.dragClass) {
dragObj.dragClass = this.dragClass;
}
if (this.constrainToContainer) {
dragObj.constrainTo(this.constrainingContainer || this.domNode.parentNode);
}
return dragObj;
}, setDragHandle:function (node) {
node = dojo.byId(node);
dojo.dnd.dragManager.unregisterDragSource(this);
this.domNode = node;
dojo.dnd.dragManager.registerDragSource(this);
}, setDragTarget:function (node) {
this.dragObject = node;
}, constrainTo:function (container) {
this.constrainToContainer = true;
if (container) {
this.constrainingContainer = container;
}
}, onSelected:function () {
for (var i = 0; i < this.dragObjects.length; i++) {
dojo.dnd.dragManager.selectedSources.push(new dojo.dnd.HtmlDragSource(this.dragObjects[i]));
}
}, addDragObjects:function (el) {
for (var i = 0; i < arguments.length; i++) {
this.dragObjects.push(dojo.byId(arguments[i]));
}
}}, function (node, type) {
node = dojo.byId(node);
this.dragObjects = [];
this.constrainToContainer = false;
if (node) {
this.domNode = node;
this.dragObject = node;
this.type = (type) || (this.domNode.nodeName.toLowerCase());
dojo.dnd.DragSource.prototype.reregister.call(this);
}
});
dojo.declare("dojo.dnd.HtmlDragObject", dojo.dnd.DragObject, {dragClass:"", opacity:0.5, createIframe:true, disableX:false, disableY:false, createDragNode:function () {
var node = this.domNode.cloneNode(true);
if (this.dragClass) {
dojo.html.addClass(node, this.dragClass);
}
if (this.opacity < 1) {
dojo.html.setOpacity(node, this.opacity);
}
var ltn = node.tagName.toLowerCase();
var isTr = (ltn == "tr");
if ((isTr) || (ltn == "tbody")) {
var doc = this.domNode.ownerDocument;
var table = doc.createElement("table");
if (isTr) {
var tbody = doc.createElement("tbody");
table.appendChild(tbody);
tbody.appendChild(node);
} else {
table.appendChild(node);
}
var tmpSrcTr = ((isTr) ? this.domNode : this.domNode.firstChild);
var tmpDstTr = ((isTr) ? node : node.firstChild);
var domTds = tmpSrcTr.childNodes;
var cloneTds = tmpDstTr.childNodes;
for (var i = 0; i < domTds.length; i++) {
if ((cloneTds[i]) && (cloneTds[i].style)) {
cloneTds[i].style.width = dojo.html.getContentBox(domTds[i]).width + "px";
}
}
node = table;
}
if ((dojo.render.html.ie55 || dojo.render.html.ie60) && this.createIframe) {
with (node.style) {
top = "0px";
left = "0px";
}
var outer = document.createElement("div");
outer.appendChild(node);
this.bgIframe = new dojo.html.BackgroundIframe(outer);
outer.appendChild(this.bgIframe.iframe);
node = outer;
}
node.style.zIndex = 999;
return node;
}, onDragStart:function (e) {
dojo.html.clearSelection();
this.scrollOffset = dojo.html.getScroll().offset;
this.dragStartPosition = dojo.html.getAbsolutePosition(this.domNode, true);
this.dragOffset = {y:this.dragStartPosition.y - e.pageY, x:this.dragStartPosition.x - e.pageX};
this.dragClone = this.createDragNode();
this.containingBlockPosition = this.domNode.offsetParent ? dojo.html.getAbsolutePosition(this.domNode.offsetParent, true) : {x:0, y:0};
if (this.constrainToContainer) {
this.constraints = this.getConstraints();
}
with (this.dragClone.style) {
position = "absolute";
top = this.dragOffset.y + e.pageY + "px";
left = this.dragOffset.x + e.pageX + "px";
}
dojo.body().appendChild(this.dragClone);
dojo.event.topic.publish("dragStart", {source:this});
}, getConstraints:function () {
if (this.constrainingContainer.nodeName.toLowerCase() == "body") {
var viewport = dojo.html.getViewport();
var width = viewport.width;
var height = viewport.height;
var scroll = dojo.html.getScroll().offset;
var x = scroll.x;
var y = scroll.y;
} else {
var content = dojo.html.getContentBox(this.constrainingContainer);
width = content.width;
height = content.height;
x = this.containingBlockPosition.x + dojo.html.getPixelValue(this.constrainingContainer, "padding-left", true) + dojo.html.getBorderExtent(this.constrainingContainer, "left");
y = this.containingBlockPosition.y + dojo.html.getPixelValue(this.constrainingContainer, "padding-top", true) + dojo.html.getBorderExtent(this.constrainingContainer, "top");
}
var mb = dojo.html.getMarginBox(this.domNode);
return {minX:x, minY:y, maxX:x + width - mb.width, maxY:y + height - mb.height};
}, updateDragOffset:function () {
var scroll = dojo.html.getScroll().offset;
if (scroll.y != this.scrollOffset.y) {
var diff = scroll.y - this.scrollOffset.y;
this.dragOffset.y += diff;
this.scrollOffset.y = scroll.y;
}
if (scroll.x != this.scrollOffset.x) {
var diff = scroll.x - this.scrollOffset.x;
this.dragOffset.x += diff;
this.scrollOffset.x = scroll.x;
}
}, onDragMove:function (e) {
this.updateDragOffset();
var x = this.dragOffset.x + e.pageX;
var y = this.dragOffset.y + e.pageY;
if (this.constrainToContainer) {
if (x < this.constraints.minX) {
x = this.constraints.minX;
}
if (y < this.constraints.minY) {
y = this.constraints.minY;
}
if (x > this.constraints.maxX) {
x = this.constraints.maxX;
}
if (y > this.constraints.maxY) {
y = this.constraints.maxY;
}
}
this.setAbsolutePosition(x, y);
dojo.event.topic.publish("dragMove", {source:this});
}, setAbsolutePosition:function (x, y) {
if (!this.disableY) {
this.dragClone.style.top = y + "px";
}
if (!this.disableX) {
this.dragClone.style.left = x + "px";
}
}, onDragEnd:function (e) {
switch (e.dragStatus) {
case "dropSuccess":
dojo.html.removeNode(this.dragClone);
this.dragClone = null;
break;
case "dropFailure":
var startCoords = dojo.html.getAbsolutePosition(this.dragClone, true);
var endCoords = {left:this.dragStartPosition.x + 1, top:this.dragStartPosition.y + 1};
var anim = dojo.lfx.slideTo(this.dragClone, endCoords, 300);
var dragObject = this;
dojo.event.connect(anim, "onEnd", function (e) {
dojo.html.removeNode(dragObject.dragClone);
dragObject.dragClone = null;
});
anim.play();
break;
}
dojo.event.topic.publish("dragEnd", {source:this});
}, constrainTo:function (container) {
this.constrainToContainer = true;
if (container) {
this.constrainingContainer = container;
} else {
this.constrainingContainer = this.domNode.parentNode;
}
}}, function (node, type) {
this.domNode = dojo.byId(node);
this.type = type;
this.constrainToContainer = false;
this.dragSource = null;
dojo.dnd.DragObject.prototype.register.call(this);
});
dojo.declare("dojo.dnd.HtmlDropTarget", dojo.dnd.DropTarget, {vertical:false, onDragOver:function (e) {
if (!this.accepts(e.dragObjects)) {
return false;
}
this.childBoxes = [];
for (var i = 0, child; i < this.domNode.childNodes.length; i++) {
child = this.domNode.childNodes[i];
if (child.nodeType != dojo.html.ELEMENT_NODE) {
continue;
}
var pos = dojo.html.getAbsolutePosition(child, true);
var inner = dojo.html.getBorderBox(child);
this.childBoxes.push({top:pos.y, bottom:pos.y + inner.height, left:pos.x, right:pos.x + inner.width, height:inner.height, width:inner.width, node:child});
}
return true;
}, _getNodeUnderMouse:function (e) {
for (var i = 0, child; i < this.childBoxes.length; i++) {
with (this.childBoxes[i]) {
if (e.pageX >= left && e.pageX <= right && e.pageY >= top && e.pageY <= bottom) {
return i;
}
}
}
return -1;
}, createDropIndicator:function () {
this.dropIndicator = document.createElement("div");
with (this.dropIndicator.style) {
position = "absolute";
zIndex = 999;
if (this.vertical) {
borderLeftWidth = "1px";
borderLeftColor = "black";
borderLeftStyle = "solid";
height = dojo.html.getBorderBox(this.domNode).height + "px";
top = dojo.html.getAbsolutePosition(this.domNode, true).y + "px";
} else {
borderTopWidth = "1px";
borderTopColor = "black";
borderTopStyle = "solid";
width = dojo.html.getBorderBox(this.domNode).width + "px";
left = dojo.html.getAbsolutePosition(this.domNode, true).x + "px";
}
}
}, onDragMove:function (e, dragObjects) {
var i = this._getNodeUnderMouse(e);
if (!this.dropIndicator) {
this.createDropIndicator();
}
var gravity = this.vertical ? dojo.html.gravity.WEST : dojo.html.gravity.NORTH;
var hide = false;
if (i < 0) {
if (this.childBoxes.length) {
var before = (dojo.html.gravity(this.childBoxes[0].node, e) & gravity);
if (before) {
hide = true;
}
} else {
var before = true;
}
} else {
var child = this.childBoxes[i];
var before = (dojo.html.gravity(child.node, e) & gravity);
if (child.node === dragObjects[0].dragSource.domNode) {
hide = true;
} else {
var currentPosChild = before ? (i > 0 ? this.childBoxes[i - 1] : child) : (i < this.childBoxes.length - 1 ? this.childBoxes[i + 1] : child);
if (currentPosChild.node === dragObjects[0].dragSource.domNode) {
hide = true;
}
}
}
if (hide) {
this.dropIndicator.style.display = "none";
return;
} else {
this.dropIndicator.style.display = "";
}
this.placeIndicator(e, dragObjects, i, before);
if (!dojo.html.hasParent(this.dropIndicator)) {
dojo.body().appendChild(this.dropIndicator);
}
}, placeIndicator:function (e, dragObjects, boxIndex, before) {
var targetProperty = this.vertical ? "left" : "top";
var child;
if (boxIndex < 0) {
if (this.childBoxes.length) {
child = before ? this.childBoxes[0] : this.childBoxes[this.childBoxes.length - 1];
} else {
this.dropIndicator.style[targetProperty] = dojo.html.getAbsolutePosition(this.domNode, true)[this.vertical ? "x" : "y"] + "px";
}
} else {
child = this.childBoxes[boxIndex];
}
if (child) {
this.dropIndicator.style[targetProperty] = (before ? child[targetProperty] : child[this.vertical ? "right" : "bottom"]) + "px";
if (this.vertical) {
this.dropIndicator.style.height = child.height + "px";
this.dropIndicator.style.top = child.top + "px";
} else {
this.dropIndicator.style.width = child.width + "px";
this.dropIndicator.style.left = child.left + "px";
}
}
}, onDragOut:function (e) {
if (this.dropIndicator) {
dojo.html.removeNode(this.dropIndicator);
delete this.dropIndicator;
}
}, onDrop:function (e) {
this.onDragOut(e);
var i = this._getNodeUnderMouse(e);
var gravity = this.vertical ? dojo.html.gravity.WEST : dojo.html.gravity.NORTH;
if (i < 0) {
if (this.childBoxes.length) {
if (dojo.html.gravity(this.childBoxes[0].node, e) & gravity) {
return this.insert(e, this.childBoxes[0].node, "before");
} else {
return this.insert(e, this.childBoxes[this.childBoxes.length - 1].node, "after");
}
}
return this.insert(e, this.domNode, "append");
}
var child = this.childBoxes[i];
if (dojo.html.gravity(child.node, e) & gravity) {
return this.insert(e, child.node, "before");
} else {
return this.insert(e, child.node, "after");
}
}, insert:function (e, refNode, position) {
var node = e.dragObject.domNode;
if (position == "before") {
return dojo.html.insertBefore(node, refNode);
} else {
if (position == "after") {
return dojo.html.insertAfter(node, refNode);
} else {
if (position == "append") {
refNode.appendChild(node);
return true;
}
}
}
return false;
}}, function (node, types) {
if (arguments.length == 0) {
return;
}
this.domNode = dojo.byId(node);
dojo.dnd.DropTarget.call(this);
if (types && dojo.lang.isString(types)) {
types = [types];
}
this.acceptedTypes = types || [];
dojo.dnd.dragManager.registerDropTarget(this);
});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/dnd/Sortable.js
New file
0,0 → 1,22
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.dnd.Sortable");
dojo.require("dojo.dnd.*");
dojo.dnd.Sortable = function () {
};
dojo.lang.extend(dojo.dnd.Sortable, {ondragstart:function (e) {
var dragObject = e.target;
while (dragObject.parentNode && dragObject.parentNode != this) {
dragObject = dragObject.parentNode;
}
return dragObject;
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/dnd/HtmlDragCopy.js
New file
0,0 → 1,68
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.dnd.HtmlDragCopy");
dojo.require("dojo.dnd.*");
dojo.declare("dojo.dnd.HtmlDragCopySource", dojo.dnd.HtmlDragSource, function (node, type, copyOnce) {
this.copyOnce = copyOnce;
this.makeCopy = true;
}, {onDragStart:function () {
var dragObj = new dojo.dnd.HtmlDragCopyObject(this.dragObject, this.type, this);
if (this.dragClass) {
dragObj.dragClass = this.dragClass;
}
if (this.constrainToContainer) {
dragObj.constrainTo(this.constrainingContainer || this.domNode.parentNode);
}
return dragObj;
}, onSelected:function () {
for (var i = 0; i < this.dragObjects.length; i++) {
dojo.dnd.dragManager.selectedSources.push(new dojo.dnd.HtmlDragCopySource(this.dragObjects[i]));
}
}});
dojo.declare("dojo.dnd.HtmlDragCopyObject", dojo.dnd.HtmlDragObject, function (dragObject, type, source) {
this.copySource = source;
}, {onDragStart:function (e) {
dojo.dnd.HtmlDragCopyObject.superclass.onDragStart.apply(this, arguments);
if (this.copySource.makeCopy) {
this.sourceNode = this.domNode;
this.domNode = this.domNode.cloneNode(true);
}
}, onDragEnd:function (e) {
switch (e.dragStatus) {
case "dropFailure":
var startCoords = dojo.html.getAbsolutePosition(this.dragClone, true);
var endCoords = {left:this.dragStartPosition.x + 1, top:this.dragStartPosition.y + 1};
var anim = dojo.lfx.slideTo(this.dragClone, endCoords, 500, dojo.lfx.easeOut);
var dragObject = this;
dojo.event.connect(anim, "onEnd", function (e) {
dojo.lang.setTimeout(function () {
dojo.html.removeNode(dragObject.dragClone);
dragObject.dragClone = null;
if (dragObject.copySource.makeCopy) {
dojo.html.removeNode(dragObject.domNode);
dragObject.domNode = dragObject.sourceNode;
dragObject.sourceNode = null;
}
}, 200);
});
anim.play();
dojo.event.topic.publish("dragEnd", {source:this});
return;
}
dojo.dnd.HtmlDragCopyObject.superclass.onDragEnd.apply(this, arguments);
this.copySource.dragObject = this.domNode;
if (this.copySource.copyOnce) {
this.copySource.makeCopy = false;
}
new dojo.dnd.HtmlDragCopySource(this.sourceNode, this.type, this.copySource.copyOnce);
this.sourceNode = null;
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/dnd/HtmlDragManager.js
New file
0,0 → 1,293
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.dnd.HtmlDragManager");
dojo.require("dojo.dnd.DragAndDrop");
dojo.require("dojo.event.*");
dojo.require("dojo.lang.array");
dojo.require("dojo.html.common");
dojo.require("dojo.html.layout");
dojo.declare("dojo.dnd.HtmlDragManager", dojo.dnd.DragManager, {disabled:false, nestedTargets:false, mouseDownTimer:null, dsCounter:0, dsPrefix:"dojoDragSource", dropTargetDimensions:[], currentDropTarget:null, previousDropTarget:null, _dragTriggered:false, selectedSources:[], dragObjects:[], dragSources:[], dropTargets:[], currentX:null, currentY:null, lastX:null, lastY:null, mouseDownX:null, mouseDownY:null, threshold:7, dropAcceptable:false, cancelEvent:function (e) {
e.stopPropagation();
e.preventDefault();
}, registerDragSource:function (ds) {
if (ds["domNode"]) {
var dp = this.dsPrefix;
var dpIdx = dp + "Idx_" + (this.dsCounter++);
ds.dragSourceId = dpIdx;
this.dragSources[dpIdx] = ds;
ds.domNode.setAttribute(dp, dpIdx);
if (dojo.render.html.ie) {
dojo.event.browser.addListener(ds.domNode, "ondragstart", this.cancelEvent);
}
}
}, unregisterDragSource:function (ds) {
if (ds["domNode"]) {
var dp = this.dsPrefix;
var dpIdx = ds.dragSourceId;
delete ds.dragSourceId;
delete this.dragSources[dpIdx];
ds.domNode.setAttribute(dp, null);
if (dojo.render.html.ie) {
dojo.event.browser.removeListener(ds.domNode, "ondragstart", this.cancelEvent);
}
}
}, registerDropTarget:function (dt) {
this.dropTargets.push(dt);
}, unregisterDropTarget:function (dt) {
var index = dojo.lang.find(this.dropTargets, dt, true);
if (index >= 0) {
this.dropTargets.splice(index, 1);
}
}, getDragSource:function (e) {
var tn = e.target;
if (tn === dojo.body()) {
return;
}
var ta = dojo.html.getAttribute(tn, this.dsPrefix);
while ((!ta) && (tn)) {
tn = tn.parentNode;
if ((!tn) || (tn === dojo.body())) {
return;
}
ta = dojo.html.getAttribute(tn, this.dsPrefix);
}
return this.dragSources[ta];
}, onKeyDown:function (e) {
}, onMouseDown:function (e) {
if (this.disabled) {
return;
}
if (dojo.render.html.ie) {
if (e.button != 1) {
return;
}
} else {
if (e.which != 1) {
return;
}
}
var target = e.target.nodeType == dojo.html.TEXT_NODE ? e.target.parentNode : e.target;
if (dojo.html.isTag(target, "button", "textarea", "input", "select", "option")) {
return;
}
var ds = this.getDragSource(e);
if (!ds) {
return;
}
if (!dojo.lang.inArray(this.selectedSources, ds)) {
this.selectedSources.push(ds);
ds.onSelected();
}
this.mouseDownX = e.pageX;
this.mouseDownY = e.pageY;
e.preventDefault();
dojo.event.connect(document, "onmousemove", this, "onMouseMove");
}, onMouseUp:function (e, cancel) {
if (this.selectedSources.length == 0) {
return;
}
this.mouseDownX = null;
this.mouseDownY = null;
this._dragTriggered = false;
e.dragSource = this.dragSource;
if ((!e.shiftKey) && (!e.ctrlKey)) {
if (this.currentDropTarget) {
this.currentDropTarget.onDropStart();
}
dojo.lang.forEach(this.dragObjects, function (tempDragObj) {
var ret = null;
if (!tempDragObj) {
return;
}
if (this.currentDropTarget) {
e.dragObject = tempDragObj;
var ce = this.currentDropTarget.domNode.childNodes;
if (ce.length > 0) {
e.dropTarget = ce[0];
while (e.dropTarget == tempDragObj.domNode) {
e.dropTarget = e.dropTarget.nextSibling;
}
} else {
e.dropTarget = this.currentDropTarget.domNode;
}
if (this.dropAcceptable) {
ret = this.currentDropTarget.onDrop(e);
} else {
this.currentDropTarget.onDragOut(e);
}
}
e.dragStatus = this.dropAcceptable && ret ? "dropSuccess" : "dropFailure";
dojo.lang.delayThese([function () {
try {
tempDragObj.dragSource.onDragEnd(e);
}
catch (err) {
var ecopy = {};
for (var i in e) {
if (i == "type") {
ecopy.type = "mouseup";
continue;
}
ecopy[i] = e[i];
}
tempDragObj.dragSource.onDragEnd(ecopy);
}
}, function () {
tempDragObj.onDragEnd(e);
}]);
}, this);
this.selectedSources = [];
this.dragObjects = [];
this.dragSource = null;
if (this.currentDropTarget) {
this.currentDropTarget.onDropEnd();
}
} else {
}
dojo.event.disconnect(document, "onmousemove", this, "onMouseMove");
this.currentDropTarget = null;
}, onScroll:function () {
for (var i = 0; i < this.dragObjects.length; i++) {
if (this.dragObjects[i].updateDragOffset) {
this.dragObjects[i].updateDragOffset();
}
}
if (this.dragObjects.length) {
this.cacheTargetLocations();
}
}, _dragStartDistance:function (x, y) {
if ((!this.mouseDownX) || (!this.mouseDownX)) {
return;
}
var dx = Math.abs(x - this.mouseDownX);
var dx2 = dx * dx;
var dy = Math.abs(y - this.mouseDownY);
var dy2 = dy * dy;
return parseInt(Math.sqrt(dx2 + dy2), 10);
}, cacheTargetLocations:function () {
dojo.profile.start("cacheTargetLocations");
this.dropTargetDimensions = [];
dojo.lang.forEach(this.dropTargets, function (tempTarget) {
var tn = tempTarget.domNode;
if (!tn || !tempTarget.accepts([this.dragSource])) {
return;
}
var abs = dojo.html.getAbsolutePosition(tn, true);
var bb = dojo.html.getBorderBox(tn);
this.dropTargetDimensions.push([[abs.x, abs.y], [abs.x + bb.width, abs.y + bb.height], tempTarget]);
}, this);
dojo.profile.end("cacheTargetLocations");
}, onMouseMove:function (e) {
if ((dojo.render.html.ie) && (e.button != 1)) {
this.currentDropTarget = null;
this.onMouseUp(e, true);
return;
}
if ((this.selectedSources.length) && (!this.dragObjects.length)) {
var dx;
var dy;
if (!this._dragTriggered) {
this._dragTriggered = (this._dragStartDistance(e.pageX, e.pageY) > this.threshold);
if (!this._dragTriggered) {
return;
}
dx = e.pageX - this.mouseDownX;
dy = e.pageY - this.mouseDownY;
}
this.dragSource = this.selectedSources[0];
dojo.lang.forEach(this.selectedSources, function (tempSource) {
if (!tempSource) {
return;
}
var tdo = tempSource.onDragStart(e);
if (tdo) {
tdo.onDragStart(e);
tdo.dragOffset.y += dy;
tdo.dragOffset.x += dx;
tdo.dragSource = tempSource;
this.dragObjects.push(tdo);
}
}, this);
this.previousDropTarget = null;
this.cacheTargetLocations();
}
dojo.lang.forEach(this.dragObjects, function (dragObj) {
if (dragObj) {
dragObj.onDragMove(e);
}
});
if (this.currentDropTarget) {
var c = dojo.html.toCoordinateObject(this.currentDropTarget.domNode, true);
var dtp = [[c.x, c.y], [c.x + c.width, c.y + c.height]];
}
if ((!this.nestedTargets) && (dtp) && (this.isInsideBox(e, dtp))) {
if (this.dropAcceptable) {
this.currentDropTarget.onDragMove(e, this.dragObjects);
}
} else {
var bestBox = this.findBestTarget(e);
if (bestBox.target === null) {
if (this.currentDropTarget) {
this.currentDropTarget.onDragOut(e);
this.previousDropTarget = this.currentDropTarget;
this.currentDropTarget = null;
}
this.dropAcceptable = false;
return;
}
if (this.currentDropTarget !== bestBox.target) {
if (this.currentDropTarget) {
this.previousDropTarget = this.currentDropTarget;
this.currentDropTarget.onDragOut(e);
}
this.currentDropTarget = bestBox.target;
e.dragObjects = this.dragObjects;
this.dropAcceptable = this.currentDropTarget.onDragOver(e);
} else {
if (this.dropAcceptable) {
this.currentDropTarget.onDragMove(e, this.dragObjects);
}
}
}
}, findBestTarget:function (e) {
var _this = this;
var bestBox = new Object();
bestBox.target = null;
bestBox.points = null;
dojo.lang.every(this.dropTargetDimensions, function (tmpDA) {
if (!_this.isInsideBox(e, tmpDA)) {
return true;
}
bestBox.target = tmpDA[2];
bestBox.points = tmpDA;
return Boolean(_this.nestedTargets);
});
return bestBox;
}, isInsideBox:function (e, coords) {
if ((e.pageX > coords[0][0]) && (e.pageX < coords[1][0]) && (e.pageY > coords[0][1]) && (e.pageY < coords[1][1])) {
return true;
}
return false;
}, onMouseOver:function (e) {
}, onMouseOut:function (e) {
}});
dojo.dnd.dragManager = new dojo.dnd.HtmlDragManager();
(function () {
var d = document;
var dm = dojo.dnd.dragManager;
dojo.event.connect(d, "onkeydown", dm, "onKeyDown");
dojo.event.connect(d, "onmouseover", dm, "onMouseOver");
dojo.event.connect(d, "onmouseout", dm, "onMouseOut");
dojo.event.connect(d, "onmousedown", dm, "onMouseDown");
dojo.event.connect(d, "onmouseup", dm, "onMouseUp");
dojo.event.connect(window, "onscroll", dm, "onScroll");
})();
 
/tags/Racine_livraison_narmer/api/js/dojo/src/dnd/TreeDragAndDropV3.js
New file
0,0 → 1,216
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.dnd.TreeDragAndDropV3");
dojo.require("dojo.dnd.HtmlDragAndDrop");
dojo.require("dojo.lang.func");
dojo.require("dojo.lang.array");
dojo.require("dojo.lang.extras");
dojo.require("dojo.Deferred");
dojo.require("dojo.html.layout");
dojo.dnd.TreeDragSourceV3 = function (node, syncController, type, treeNode) {
this.controller = syncController;
this.treeNode = treeNode;
dojo.dnd.HtmlDragSource.call(this, node, type);
};
dojo.inherits(dojo.dnd.TreeDragSourceV3, dojo.dnd.HtmlDragSource);
dojo.dnd.TreeDropTargetV3 = function (domNode, controller, type, treeNode) {
this.treeNode = treeNode;
this.controller = controller;
dojo.dnd.HtmlDropTarget.call(this, domNode, type);
};
dojo.inherits(dojo.dnd.TreeDropTargetV3, dojo.dnd.HtmlDropTarget);
dojo.lang.extend(dojo.dnd.TreeDropTargetV3, {autoExpandDelay:1500, autoExpandTimer:null, position:null, indicatorStyle:"2px black groove", showIndicator:function (position) {
if (this.position == position) {
return;
}
this.hideIndicator();
this.position = position;
var node = this.treeNode;
node.contentNode.style.width = dojo.html.getBorderBox(node.labelNode).width + "px";
if (position == "onto") {
node.contentNode.style.border = this.indicatorStyle;
} else {
if (position == "before") {
node.contentNode.style.borderTop = this.indicatorStyle;
} else {
if (position == "after") {
node.contentNode.style.borderBottom = this.indicatorStyle;
}
}
}
}, hideIndicator:function () {
this.treeNode.contentNode.style.borderBottom = "";
this.treeNode.contentNode.style.borderTop = "";
this.treeNode.contentNode.style.border = "";
this.treeNode.contentNode.style.width = "";
this.position = null;
}, onDragOver:function (e) {
var accepts = dojo.dnd.HtmlDropTarget.prototype.onDragOver.apply(this, arguments);
if (accepts && this.treeNode.isFolder && !this.treeNode.isExpanded) {
this.setAutoExpandTimer();
}
if (accepts) {
this.cacheNodeCoords();
}
return accepts;
}, accepts:function (dragObjects) {
var accepts = dojo.dnd.HtmlDropTarget.prototype.accepts.apply(this, arguments);
if (!accepts) {
return false;
}
for (var i = 0; i < dragObjects.length; i++) {
var sourceTreeNode = dragObjects[i].treeNode;
if (sourceTreeNode === this.treeNode) {
return false;
}
}
return true;
}, setAutoExpandTimer:function () {
var _this = this;
var autoExpand = function () {
if (dojo.dnd.dragManager.currentDropTarget === _this) {
_this.controller.expand(_this.treeNode);
dojo.dnd.dragManager.cacheTargetLocations();
}
};
this.autoExpandTimer = dojo.lang.setTimeout(autoExpand, _this.autoExpandDelay);
}, getAcceptPosition:function (e, dragObjects) {
var DndMode = this.treeNode.tree.DndMode;
if (DndMode & dojo.widget.TreeV3.prototype.DndModes.ONTO && this.treeNode.actionIsDisabledNow(this.treeNode.actions.ADDCHILD)) {
DndMode &= ~dojo.widget.TreeV3.prototype.DndModes.ONTO;
}
var position = this.getPosition(e, DndMode);
if (position == "onto") {
return position;
}
for (var i = 0; i < dragObjects.length; i++) {
var source = dragObjects[i].dragSource;
if (source.treeNode && this.isAdjacentNode(source.treeNode, position)) {
continue;
}
if (!this.controller.canMove(source.treeNode ? source.treeNode : source, this.treeNode.parent)) {
return false;
}
}
return position;
}, onDropEnd:function (e) {
this.clearAutoExpandTimer();
this.hideIndicator();
}, onDragOut:function (e) {
this.clearAutoExpandTimer();
this.hideIndicator();
}, clearAutoExpandTimer:function () {
if (this.autoExpandTimer) {
clearTimeout(this.autoExpandTimer);
this.autoExpandTimer = null;
}
}, onDragMove:function (e, dragObjects) {
var position = this.getAcceptPosition(e, dragObjects);
if (position) {
this.showIndicator(position);
}
}, isAdjacentNode:function (sourceNode, position) {
if (sourceNode === this.treeNode) {
return true;
}
if (sourceNode.getNextSibling() === this.treeNode && position == "before") {
return true;
}
if (sourceNode.getPreviousSibling() === this.treeNode && position == "after") {
return true;
}
return false;
}, cacheNodeCoords:function () {
var node = this.treeNode.contentNode;
this.cachedNodeY = dojo.html.getAbsolutePosition(node).y;
this.cachedNodeHeight = dojo.html.getBorderBox(node).height;
}, getPosition:function (e, DndMode) {
var mousey = e.pageY || e.clientY + dojo.body().scrollTop;
var relY = mousey - this.cachedNodeY;
var p = relY / this.cachedNodeHeight;
var position = "";
if (DndMode & dojo.widget.TreeV3.prototype.DndModes.ONTO && DndMode & dojo.widget.TreeV3.prototype.DndModes.BETWEEN) {
if (p <= 0.33) {
position = "before";
} else {
if (p <= 0.66 || this.treeNode.isExpanded && this.treeNode.children.length && !this.treeNode.isLastChild()) {
position = "onto";
} else {
position = "after";
}
}
} else {
if (DndMode & dojo.widget.TreeV3.prototype.DndModes.BETWEEN) {
if (p <= 0.5 || this.treeNode.isExpanded && this.treeNode.children.length && !this.treeNode.isLastChild()) {
position = "before";
} else {
position = "after";
}
} else {
if (DndMode & dojo.widget.TreeV3.prototype.DndModes.ONTO) {
position = "onto";
}
}
}
return position;
}, getTargetParentIndex:function (source, position) {
var index = position == "before" ? this.treeNode.getParentIndex() : this.treeNode.getParentIndex() + 1;
if (source.treeNode && this.treeNode.parent === source.treeNode.parent && this.treeNode.getParentIndex() > source.treeNode.getParentIndex()) {
index--;
}
return index;
}, onDrop:function (e) {
var position = this.position;
var source = e.dragObject.dragSource;
var targetParent, targetIndex;
if (position == "onto") {
targetParent = this.treeNode;
targetIndex = 0;
} else {
targetIndex = this.getTargetParentIndex(source, position);
targetParent = this.treeNode.parent;
}
var r = this.getDropHandler(e, source, targetParent, targetIndex)();
return r;
}, getDropHandler:function (e, source, targetParent, targetIndex) {
var handler;
var _this = this;
handler = function () {
var result;
if (source.treeNode) {
result = _this.controller.move(source.treeNode, targetParent, targetIndex, true);
} else {
if (dojo.lang.isFunction(source.onDrop)) {
source.onDrop(targetParent, targetIndex);
}
var treeNode = source.getTreeNode();
if (treeNode) {
result = _this.controller.createChild(targetParent, targetIndex, treeNode, true);
} else {
result = true;
}
}
if (result instanceof dojo.Deferred) {
var isSuccess = result.fired == 0;
if (!isSuccess) {
_this.handleDropError(source, targetParent, targetIndex, result);
}
return isSuccess;
} else {
return result;
}
};
return handler;
}, handleDropError:function (source, parent, index, result) {
dojo.debug("TreeDropTargetV3.handleDropError: DND error occured");
dojo.debugShallow(result);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/dnd/DragAndDrop.js
New file
0,0 → 1,74
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.require("dojo.lang.common");
dojo.require("dojo.lang.func");
dojo.require("dojo.lang.declare");
dojo.provide("dojo.dnd.DragAndDrop");
dojo.declare("dojo.dnd.DragSource", null, {type:"", onDragEnd:function (evt) {
}, onDragStart:function (evt) {
}, onSelected:function (evt) {
}, unregister:function () {
dojo.dnd.dragManager.unregisterDragSource(this);
}, reregister:function () {
dojo.dnd.dragManager.registerDragSource(this);
}});
dojo.declare("dojo.dnd.DragObject", null, {type:"", register:function () {
var dm = dojo.dnd.dragManager;
if (dm["registerDragObject"]) {
dm.registerDragObject(this);
}
}, onDragStart:function (evt) {
}, onDragMove:function (evt) {
}, onDragOver:function (evt) {
}, onDragOut:function (evt) {
}, onDragEnd:function (evt) {
}, onDragLeave:dojo.lang.forward("onDragOut"), onDragEnter:dojo.lang.forward("onDragOver"), ondragout:dojo.lang.forward("onDragOut"), ondragover:dojo.lang.forward("onDragOver")});
dojo.declare("dojo.dnd.DropTarget", null, {acceptsType:function (type) {
if (!dojo.lang.inArray(this.acceptedTypes, "*")) {
if (!dojo.lang.inArray(this.acceptedTypes, type)) {
return false;
}
}
return true;
}, accepts:function (dragObjects) {
if (!dojo.lang.inArray(this.acceptedTypes, "*")) {
for (var i = 0; i < dragObjects.length; i++) {
if (!dojo.lang.inArray(this.acceptedTypes, dragObjects[i].type)) {
return false;
}
}
}
return true;
}, unregister:function () {
dojo.dnd.dragManager.unregisterDropTarget(this);
}, onDragOver:function (evt) {
}, onDragOut:function (evt) {
}, onDragMove:function (evt) {
}, onDropStart:function (evt) {
}, onDrop:function (evt) {
}, onDropEnd:function () {
}}, function () {
this.acceptedTypes = [];
});
dojo.dnd.DragEvent = function () {
this.dragSource = null;
this.dragObject = null;
this.target = null;
this.eventStatus = "success";
};
dojo.declare("dojo.dnd.DragManager", null, {selectedSources:[], dragObjects:[], dragSources:[], registerDragSource:function (source) {
}, dropTargets:[], registerDropTarget:function (target) {
}, lastDragTarget:null, currentDragTarget:null, onKeyDown:function () {
}, onMouseOut:function () {
}, onMouseMove:function () {
}, onMouseUp:function () {
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/dnd/TreeDragAndDrop.js
New file
0,0 → 1,251
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.dnd.TreeDragAndDrop");
dojo.require("dojo.dnd.HtmlDragAndDrop");
dojo.require("dojo.lang.func");
dojo.require("dojo.lang.array");
dojo.require("dojo.lang.extras");
dojo.require("dojo.html.layout");
dojo.dnd.TreeDragSource = function (node, syncController, type, treeNode) {
this.controller = syncController;
this.treeNode = treeNode;
dojo.dnd.HtmlDragSource.call(this, node, type);
};
dojo.inherits(dojo.dnd.TreeDragSource, dojo.dnd.HtmlDragSource);
dojo.lang.extend(dojo.dnd.TreeDragSource, {onDragStart:function () {
var dragObject = dojo.dnd.HtmlDragSource.prototype.onDragStart.call(this);
dragObject.treeNode = this.treeNode;
dragObject.onDragStart = dojo.lang.hitch(dragObject, function (e) {
this.savedSelectedNode = this.treeNode.tree.selector.selectedNode;
if (this.savedSelectedNode) {
this.savedSelectedNode.unMarkSelected();
}
var result = dojo.dnd.HtmlDragObject.prototype.onDragStart.apply(this, arguments);
var cloneGrid = this.dragClone.getElementsByTagName("img");
for (var i = 0; i < cloneGrid.length; i++) {
cloneGrid.item(i).style.backgroundImage = "url()";
}
return result;
});
dragObject.onDragEnd = function (e) {
if (this.savedSelectedNode) {
this.savedSelectedNode.markSelected();
}
return dojo.dnd.HtmlDragObject.prototype.onDragEnd.apply(this, arguments);
};
return dragObject;
}, onDragEnd:function (e) {
var res = dojo.dnd.HtmlDragSource.prototype.onDragEnd.call(this, e);
return res;
}});
dojo.dnd.TreeDropTarget = function (domNode, controller, type, treeNode) {
this.treeNode = treeNode;
this.controller = controller;
dojo.dnd.HtmlDropTarget.apply(this, [domNode, type]);
};
dojo.inherits(dojo.dnd.TreeDropTarget, dojo.dnd.HtmlDropTarget);
dojo.lang.extend(dojo.dnd.TreeDropTarget, {autoExpandDelay:1500, autoExpandTimer:null, position:null, indicatorStyle:"2px black solid", showIndicator:function (position) {
if (this.position == position) {
return;
}
this.hideIndicator();
this.position = position;
if (position == "before") {
this.treeNode.labelNode.style.borderTop = this.indicatorStyle;
} else {
if (position == "after") {
this.treeNode.labelNode.style.borderBottom = this.indicatorStyle;
} else {
if (position == "onto") {
this.treeNode.markSelected();
}
}
}
}, hideIndicator:function () {
this.treeNode.labelNode.style.borderBottom = "";
this.treeNode.labelNode.style.borderTop = "";
this.treeNode.unMarkSelected();
this.position = null;
}, onDragOver:function (e) {
var accepts = dojo.dnd.HtmlDropTarget.prototype.onDragOver.apply(this, arguments);
if (accepts && this.treeNode.isFolder && !this.treeNode.isExpanded) {
this.setAutoExpandTimer();
}
return accepts;
}, accepts:function (dragObjects) {
var accepts = dojo.dnd.HtmlDropTarget.prototype.accepts.apply(this, arguments);
if (!accepts) {
return false;
}
var sourceTreeNode = dragObjects[0].treeNode;
if (dojo.lang.isUndefined(sourceTreeNode) || !sourceTreeNode || !sourceTreeNode.isTreeNode) {
dojo.raise("Source is not TreeNode or not found");
}
if (sourceTreeNode === this.treeNode) {
return false;
}
return true;
}, setAutoExpandTimer:function () {
var _this = this;
var autoExpand = function () {
if (dojo.dnd.dragManager.currentDropTarget === _this) {
_this.controller.expand(_this.treeNode);
}
};
this.autoExpandTimer = dojo.lang.setTimeout(autoExpand, _this.autoExpandDelay);
}, getDNDMode:function () {
return this.treeNode.tree.DNDMode;
}, getAcceptPosition:function (e, sourceTreeNode) {
var DNDMode = this.getDNDMode();
if (DNDMode & dojo.widget.Tree.prototype.DNDModes.ONTO && !(!this.treeNode.actionIsDisabled(dojo.widget.TreeNode.prototype.actions.ADDCHILD) && sourceTreeNode.parent !== this.treeNode && this.controller.canMove(sourceTreeNode, this.treeNode))) {
DNDMode &= ~dojo.widget.Tree.prototype.DNDModes.ONTO;
}
var position = this.getPosition(e, DNDMode);
if (position == "onto" || (!this.isAdjacentNode(sourceTreeNode, position) && this.controller.canMove(sourceTreeNode, this.treeNode.parent))) {
return position;
} else {
return false;
}
}, onDragOut:function (e) {
this.clearAutoExpandTimer();
this.hideIndicator();
}, clearAutoExpandTimer:function () {
if (this.autoExpandTimer) {
clearTimeout(this.autoExpandTimer);
this.autoExpandTimer = null;
}
}, onDragMove:function (e, dragObjects) {
var sourceTreeNode = dragObjects[0].treeNode;
var position = this.getAcceptPosition(e, sourceTreeNode);
if (position) {
this.showIndicator(position);
}
}, isAdjacentNode:function (sourceNode, position) {
if (sourceNode === this.treeNode) {
return true;
}
if (sourceNode.getNextSibling() === this.treeNode && position == "before") {
return true;
}
if (sourceNode.getPreviousSibling() === this.treeNode && position == "after") {
return true;
}
return false;
}, getPosition:function (e, DNDMode) {
var node = dojo.byId(this.treeNode.labelNode);
var mousey = e.pageY || e.clientY + dojo.body().scrollTop;
var nodey = dojo.html.getAbsolutePosition(node).y;
var height = dojo.html.getBorderBox(node).height;
var relY = mousey - nodey;
var p = relY / height;
var position = "";
if (DNDMode & dojo.widget.Tree.prototype.DNDModes.ONTO && DNDMode & dojo.widget.Tree.prototype.DNDModes.BETWEEN) {
if (p <= 0.3) {
position = "before";
} else {
if (p <= 0.7) {
position = "onto";
} else {
position = "after";
}
}
} else {
if (DNDMode & dojo.widget.Tree.prototype.DNDModes.BETWEEN) {
if (p <= 0.5) {
position = "before";
} else {
position = "after";
}
} else {
if (DNDMode & dojo.widget.Tree.prototype.DNDModes.ONTO) {
position = "onto";
}
}
}
return position;
}, getTargetParentIndex:function (sourceTreeNode, position) {
var index = position == "before" ? this.treeNode.getParentIndex() : this.treeNode.getParentIndex() + 1;
if (this.treeNode.parent === sourceTreeNode.parent && this.treeNode.getParentIndex() > sourceTreeNode.getParentIndex()) {
index--;
}
return index;
}, onDrop:function (e) {
var position = this.position;
this.onDragOut(e);
var sourceTreeNode = e.dragObject.treeNode;
if (!dojo.lang.isObject(sourceTreeNode)) {
dojo.raise("TreeNode not found in dragObject");
}
if (position == "onto") {
return this.controller.move(sourceTreeNode, this.treeNode, 0);
} else {
var index = this.getTargetParentIndex(sourceTreeNode, position);
return this.controller.move(sourceTreeNode, this.treeNode.parent, index);
}
}});
dojo.dnd.TreeDNDController = function (treeController) {
this.treeController = treeController;
this.dragSources = {};
this.dropTargets = {};
};
dojo.lang.extend(dojo.dnd.TreeDNDController, {listenTree:function (tree) {
dojo.event.topic.subscribe(tree.eventNames.createDOMNode, this, "onCreateDOMNode");
dojo.event.topic.subscribe(tree.eventNames.moveFrom, this, "onMoveFrom");
dojo.event.topic.subscribe(tree.eventNames.moveTo, this, "onMoveTo");
dojo.event.topic.subscribe(tree.eventNames.addChild, this, "onAddChild");
dojo.event.topic.subscribe(tree.eventNames.removeNode, this, "onRemoveNode");
dojo.event.topic.subscribe(tree.eventNames.treeDestroy, this, "onTreeDestroy");
}, unlistenTree:function (tree) {
dojo.event.topic.unsubscribe(tree.eventNames.createDOMNode, this, "onCreateDOMNode");
dojo.event.topic.unsubscribe(tree.eventNames.moveFrom, this, "onMoveFrom");
dojo.event.topic.unsubscribe(tree.eventNames.moveTo, this, "onMoveTo");
dojo.event.topic.unsubscribe(tree.eventNames.addChild, this, "onAddChild");
dojo.event.topic.unsubscribe(tree.eventNames.removeNode, this, "onRemoveNode");
dojo.event.topic.unsubscribe(tree.eventNames.treeDestroy, this, "onTreeDestroy");
}, onTreeDestroy:function (message) {
this.unlistenTree(message.source);
}, onCreateDOMNode:function (message) {
this.registerDNDNode(message.source);
}, onAddChild:function (message) {
this.registerDNDNode(message.child);
}, onMoveFrom:function (message) {
var _this = this;
dojo.lang.forEach(message.child.getDescendants(), function (node) {
_this.unregisterDNDNode(node);
});
}, onMoveTo:function (message) {
var _this = this;
dojo.lang.forEach(message.child.getDescendants(), function (node) {
_this.registerDNDNode(node);
});
}, registerDNDNode:function (node) {
if (!node.tree.DNDMode) {
return;
}
var source = null;
var target = null;
if (!node.actionIsDisabled(node.actions.MOVE)) {
var source = new dojo.dnd.TreeDragSource(node.labelNode, this, node.tree.widgetId, node);
this.dragSources[node.widgetId] = source;
}
var target = new dojo.dnd.TreeDropTarget(node.labelNode, this.treeController, node.tree.DNDAcceptTypes, node);
this.dropTargets[node.widgetId] = target;
}, unregisterDNDNode:function (node) {
if (this.dragSources[node.widgetId]) {
dojo.dnd.dragManager.unregisterDragSource(this.dragSources[node.widgetId]);
delete this.dragSources[node.widgetId];
}
if (this.dropTargets[node.widgetId]) {
dojo.dnd.dragManager.unregisterDropTarget(this.dropTargets[node.widgetId]);
delete this.dropTargets[node.widgetId];
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/dnd/__package__.js
New file
0,0 → 1,13
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.kwCompoundRequire({common:["dojo.dnd.DragAndDrop"], browser:["dojo.dnd.HtmlDragAndDrop"], dashboard:["dojo.dnd.HtmlDragAndDrop"]});
dojo.provide("dojo.dnd.*");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/experimental.js
New file
0,0 → 1,20
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.experimental");
dojo.experimental = function (moduleName, extra) {
var message = "EXPERIMENTAL: " + moduleName;
message += " -- Not yet ready for use. APIs subject to change without notice.";
if (extra) {
message += " " + extra;
}
dojo.debug(message);
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/bootstrap1.js
New file
0,0 → 1,158
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
var dj_global = this;
var dj_currentContext = this;
function dj_undef(name, object) {
return (typeof (object || dj_currentContext)[name] == "undefined");
}
if (dj_undef("djConfig", this)) {
var djConfig = {};
}
if (dj_undef("dojo", this)) {
var dojo = {};
}
dojo.global = function () {
return dj_currentContext;
};
dojo.locale = djConfig.locale;
dojo.version = {major:0, minor:4, patch:2, flag:"", revision:Number("$Rev: 7616 $".match(/[0-9]+/)[0]), toString:function () {
with (dojo.version) {
return major + "." + minor + "." + patch + flag + " (" + revision + ")";
}
}};
dojo.evalProp = function (name, object, create) {
if ((!object) || (!name)) {
return undefined;
}
if (!dj_undef(name, object)) {
return object[name];
}
return (create ? (object[name] = {}) : undefined);
};
dojo.parseObjPath = function (path, context, create) {
var object = (context || dojo.global());
var names = path.split(".");
var prop = names.pop();
for (var i = 0, l = names.length; i < l && object; i++) {
object = dojo.evalProp(names[i], object, create);
}
return {obj:object, prop:prop};
};
dojo.evalObjPath = function (path, create) {
if (typeof path != "string") {
return dojo.global();
}
if (path.indexOf(".") == -1) {
return dojo.evalProp(path, dojo.global(), create);
}
var ref = dojo.parseObjPath(path, dojo.global(), create);
if (ref) {
return dojo.evalProp(ref.prop, ref.obj, create);
}
return null;
};
dojo.errorToString = function (exception) {
if (!dj_undef("message", exception)) {
return exception.message;
} else {
if (!dj_undef("description", exception)) {
return exception.description;
} else {
return exception;
}
}
};
dojo.raise = function (message, exception) {
if (exception) {
message = message + ": " + dojo.errorToString(exception);
} else {
message = dojo.errorToString(message);
}
try {
if (djConfig.isDebug) {
dojo.hostenv.println("FATAL exception raised: " + message);
}
}
catch (e) {
}
throw exception || Error(message);
};
dojo.debug = function () {
};
dojo.debugShallow = function (obj) {
};
dojo.profile = {start:function () {
}, end:function () {
}, stop:function () {
}, dump:function () {
}};
function dj_eval(scriptFragment) {
return dj_global.eval ? dj_global.eval(scriptFragment) : eval(scriptFragment);
}
dojo.unimplemented = function (funcname, extra) {
var message = "'" + funcname + "' not implemented";
if (extra != null) {
message += " " + extra;
}
dojo.raise(message);
};
dojo.deprecated = function (behaviour, extra, removal) {
var message = "DEPRECATED: " + behaviour;
if (extra) {
message += " " + extra;
}
if (removal) {
message += " -- will be removed in version: " + removal;
}
dojo.debug(message);
};
dojo.render = (function () {
function vscaffold(prefs, names) {
var tmp = {capable:false, support:{builtin:false, plugin:false}, prefixes:prefs};
for (var i = 0; i < names.length; i++) {
tmp[names[i]] = false;
}
return tmp;
}
return {name:"", ver:dojo.version, os:{win:false, linux:false, osx:false}, html:vscaffold(["html"], ["ie", "opera", "khtml", "safari", "moz"]), svg:vscaffold(["svg"], ["corel", "adobe", "batik"]), vml:vscaffold(["vml"], ["ie"]), swf:vscaffold(["Swf", "Flash", "Mm"], ["mm"]), swt:vscaffold(["Swt"], ["ibm"])};
})();
dojo.hostenv = (function () {
var config = {isDebug:false, allowQueryConfig:false, baseScriptUri:"", baseRelativePath:"", libraryScriptUri:"", iePreventClobber:false, ieClobberMinimal:true, preventBackButtonFix:true, delayMozLoadingFix:false, searchIds:[], parseWidgets:true};
if (typeof djConfig == "undefined") {
djConfig = config;
} else {
for (var option in config) {
if (typeof djConfig[option] == "undefined") {
djConfig[option] = config[option];
}
}
}
return {name_:"(unset)", version_:"(unset)", getName:function () {
return this.name_;
}, getVersion:function () {
return this.version_;
}, getText:function (uri) {
dojo.unimplemented("getText", "uri=" + uri);
}};
})();
dojo.hostenv.getBaseScriptUri = function () {
if (djConfig.baseScriptUri.length) {
return djConfig.baseScriptUri;
}
var uri = new String(djConfig.libraryScriptUri || djConfig.baseRelativePath);
if (!uri) {
dojo.raise("Nothing returned by getLibraryScriptUri(): " + uri);
}
var lastslash = uri.lastIndexOf("/");
djConfig.baseScriptUri = djConfig.baseRelativePath;
return djConfig.baseScriptUri;
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/behavior.js
New file
0,0 → 1,148
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.behavior");
dojo.require("dojo.event.*");
dojo.require("dojo.experimental");
dojo.experimental("dojo.behavior");
dojo.behavior = new function () {
function arrIn(obj, name) {
if (!obj[name]) {
obj[name] = [];
}
return obj[name];
}
function forIn(obj, scope, func) {
var tmpObj = {};
for (var x in obj) {
if (typeof tmpObj[x] == "undefined") {
if (!func) {
scope(obj[x], x);
} else {
func.call(scope, obj[x], x);
}
}
}
}
this.behaviors = {};
this.add = function (behaviorObj) {
var tmpObj = {};
forIn(behaviorObj, this, function (behavior, name) {
var tBehavior = arrIn(this.behaviors, name);
if ((dojo.lang.isString(behavior)) || (dojo.lang.isFunction(behavior))) {
behavior = {found:behavior};
}
forIn(behavior, function (rule, ruleName) {
arrIn(tBehavior, ruleName).push(rule);
});
});
};
this.apply = function () {
dojo.profile.start("dojo.behavior.apply");
var r = dojo.render.html;
var safariGoodEnough = (!r.safari);
if (r.safari) {
var uas = r.UA.split("AppleWebKit/")[1];
if (parseInt(uas.match(/[0-9.]{3,}/)) >= 420) {
safariGoodEnough = true;
}
}
if ((dj_undef("behaviorFastParse", djConfig) ? (safariGoodEnough) : djConfig["behaviorFastParse"])) {
this.applyFast();
} else {
this.applySlow();
}
dojo.profile.end("dojo.behavior.apply");
};
this.matchCache = {};
this.elementsById = function (id, handleRemoved) {
var removed = [];
var added = [];
arrIn(this.matchCache, id);
if (handleRemoved) {
var nodes = this.matchCache[id];
for (var x = 0; x < nodes.length; x++) {
if (nodes[x].id != "") {
removed.push(nodes[x]);
nodes.splice(x, 1);
x--;
}
}
}
var tElem = dojo.byId(id);
while (tElem) {
if (!tElem["idcached"]) {
added.push(tElem);
}
tElem.id = "";
tElem = dojo.byId(id);
}
this.matchCache[id] = this.matchCache[id].concat(added);
dojo.lang.forEach(this.matchCache[id], function (node) {
node.id = id;
node.idcached = true;
});
return {"removed":removed, "added":added, "match":this.matchCache[id]};
};
this.applyToNode = function (node, action, ruleSetName) {
if (typeof action == "string") {
dojo.event.topic.registerPublisher(action, node, ruleSetName);
} else {
if (typeof action == "function") {
if (ruleSetName == "found") {
action(node);
} else {
dojo.event.connect(node, ruleSetName, action);
}
} else {
action.srcObj = node;
action.srcFunc = ruleSetName;
dojo.event.kwConnect(action);
}
}
};
this.applyFast = function () {
dojo.profile.start("dojo.behavior.applyFast");
forIn(this.behaviors, function (tBehavior, id) {
var elems = dojo.behavior.elementsById(id);
dojo.lang.forEach(elems.added, function (elem) {
forIn(tBehavior, function (ruleSet, ruleSetName) {
if (dojo.lang.isArray(ruleSet)) {
dojo.lang.forEach(ruleSet, function (action) {
dojo.behavior.applyToNode(elem, action, ruleSetName);
});
}
});
});
});
dojo.profile.end("dojo.behavior.applyFast");
};
this.applySlow = function () {
dojo.profile.start("dojo.behavior.applySlow");
var all = document.getElementsByTagName("*");
var allLen = all.length;
for (var x = 0; x < allLen; x++) {
var elem = all[x];
if ((elem.id) && (!elem["behaviorAdded"]) && (this.behaviors[elem.id])) {
elem["behaviorAdded"] = true;
forIn(this.behaviors[elem.id], function (ruleSet, ruleSetName) {
if (dojo.lang.isArray(ruleSet)) {
dojo.lang.forEach(ruleSet, function (action) {
dojo.behavior.applyToNode(elem, action, ruleSetName);
});
}
});
}
}
dojo.profile.end("dojo.behavior.applySlow");
};
};
dojo.addOnLoad(dojo.behavior, "apply");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/style.js
New file
0,0 → 1,16
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.style");
dojo.require("dojo.lang.common");
dojo.kwCompoundRequire({browser:["dojo.html.style"]});
dojo.deprecated("dojo.style", "replaced by dojo.html.style", "0.5");
dojo.lang.mixin(dojo.style, dojo.html);
 
/tags/Racine_livraison_narmer/api/js/dojo/src/profile.js
New file
0,0 → 1,102
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.profile");
dojo.profile = {_profiles:{}, _pns:[], start:function (name) {
if (!this._profiles[name]) {
this._profiles[name] = {iters:0, total:0};
this._pns[this._pns.length] = name;
} else {
if (this._profiles[name]["start"]) {
this.end(name);
}
}
this._profiles[name].end = null;
this._profiles[name].start = new Date();
}, end:function (name) {
var ed = new Date();
if ((this._profiles[name]) && (this._profiles[name]["start"])) {
with (this._profiles[name]) {
end = ed;
total += (end - start);
start = null;
iters++;
}
} else {
return true;
}
}, dump:function (appendToDoc) {
var tbl = document.createElement("table");
with (tbl.style) {
border = "1px solid black";
borderCollapse = "collapse";
}
var hdr = tbl.createTHead();
var hdrtr = hdr.insertRow(0);
var cols = ["Identifier", "Calls", "Total", "Avg"];
for (var x = 0; x < cols.length; x++) {
var ntd = hdrtr.insertCell(x);
with (ntd.style) {
backgroundColor = "#225d94";
color = "white";
borderBottom = "1px solid black";
borderRight = "1px solid black";
fontFamily = "tahoma";
fontWeight = "bolder";
paddingLeft = paddingRight = "5px";
}
ntd.appendChild(document.createTextNode(cols[x]));
}
for (var x = 0; x < this._pns.length; x++) {
var prf = this._profiles[this._pns[x]];
this.end(this._pns[x]);
if (prf.iters > 0) {
var bdytr = tbl.insertRow(true);
var vals = [this._pns[x], prf.iters, prf.total, parseInt(prf.total / prf.iters)];
for (var y = 0; y < vals.length; y++) {
var cc = bdytr.insertCell(y);
cc.appendChild(document.createTextNode(vals[y]));
with (cc.style) {
borderBottom = "1px solid gray";
paddingLeft = paddingRight = "5px";
if (x % 2) {
backgroundColor = "#e1f1ff";
}
if (y > 0) {
textAlign = "right";
borderRight = "1px solid gray";
} else {
borderRight = "1px solid black";
}
}
}
}
}
if (appendToDoc) {
var ne = document.createElement("div");
ne.id = "profileOutputTable";
with (ne.style) {
fontFamily = "Courier New, monospace";
fontSize = "12px";
lineHeight = "16px";
borderTop = "1px solid black";
padding = "10px";
}
if (document.getElementById("profileOutputTable")) {
dojo.body().replaceChild(ne, document.getElementById("profileOutputTable"));
} else {
dojo.body().appendChild(ne);
}
ne.appendChild(tbl);
}
return tbl;
}};
dojo.profile.stop = dojo.profile.end;
 
/tags/Racine_livraison_narmer/api/js/dojo/src/loader_xd.js
New file
0,0 → 1,401
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.hostenv.resetXd = function () {
this.isXDomain = djConfig.useXDomain || false;
this.xdTimer = 0;
this.xdInFlight = {};
this.xdOrderedReqs = [];
this.xdDepMap = {};
this.xdContents = [];
this.xdDefList = [];
};
dojo.hostenv.resetXd();
dojo.hostenv.createXdPackage = function (contents, resourceName, resourcePath) {
var deps = [];
var depRegExp = /dojo.(require|requireIf|requireAll|provide|requireAfterIf|requireAfter|kwCompoundRequire|conditionalRequire|hostenv\.conditionalLoadModule|.hostenv\.loadModule|hostenv\.moduleLoaded)\(([\w\W]*?)\)/mg;
var match;
while ((match = depRegExp.exec(contents)) != null) {
deps.push("\"" + match[1] + "\", " + match[2]);
}
var output = [];
output.push("dojo.hostenv.packageLoaded({\n");
if (deps.length > 0) {
output.push("depends: [");
for (var i = 0; i < deps.length; i++) {
if (i > 0) {
output.push(",\n");
}
output.push("[" + deps[i] + "]");
}
output.push("],");
}
output.push("\ndefinePackage: function(dojo){");
output.push(contents);
output.push("\n}, resourceName: '" + resourceName + "', resourcePath: '" + resourcePath + "'});");
return output.join("");
};
dojo.hostenv.loadPath = function (relpath, module, cb) {
var colonIndex = relpath.indexOf(":");
var slashIndex = relpath.indexOf("/");
var uri;
var currentIsXDomain = false;
if (colonIndex > 0 && colonIndex < slashIndex) {
uri = relpath;
this.isXDomain = currentIsXDomain = true;
} else {
uri = this.getBaseScriptUri() + relpath;
colonIndex = uri.indexOf(":");
slashIndex = uri.indexOf("/");
if (colonIndex > 0 && colonIndex < slashIndex && (!location.host || uri.indexOf("http://" + location.host) != 0)) {
this.isXDomain = currentIsXDomain = true;
}
}
if (djConfig.cacheBust && dojo.render.html.capable) {
uri += "?" + String(djConfig.cacheBust).replace(/\W+/g, "");
}
try {
return ((!module || this.isXDomain) ? this.loadUri(uri, cb, currentIsXDomain, module) : this.loadUriAndCheck(uri, module, cb));
}
catch (e) {
dojo.debug(e);
return false;
}
};
dojo.hostenv.loadUri = function (uri, cb, currentIsXDomain, module) {
if (this.loadedUris[uri]) {
return 1;
}
if (this.isXDomain) {
if (uri.indexOf("__package__") != -1) {
module += ".*";
}
this.xdOrderedReqs.push(module);
if (currentIsXDomain) {
this.xdInFlight[module] = true;
this.inFlightCount++;
}
if (!this.xdTimer) {
this.xdTimer = setInterval("dojo.hostenv.watchInFlightXDomain();", 100);
}
this.xdStartTime = (new Date()).getTime();
}
if (currentIsXDomain) {
var lastIndex = uri.lastIndexOf(".");
if (lastIndex <= 0) {
lastIndex = uri.length - 1;
}
var xdUri = uri.substring(0, lastIndex) + ".xd";
if (lastIndex != uri.length - 1) {
xdUri += uri.substring(lastIndex, uri.length);
}
var element = document.createElement("script");
element.type = "text/javascript";
element.src = xdUri;
if (!this.headElement) {
this.headElement = document.getElementsByTagName("head")[0];
if (!this.headElement) {
this.headElement = document.getElementsByTagName("html")[0];
}
}
this.headElement.appendChild(element);
} else {
var contents = this.getText(uri, null, true);
if (contents == null) {
return 0;
}
if (this.isXDomain && uri.indexOf("/nls/") == -1) {
var pkg = this.createXdPackage(contents, module, uri);
dj_eval(pkg);
} else {
if (cb) {
contents = "(" + contents + ")";
}
var value = dj_eval(contents);
if (cb) {
cb(value);
}
}
}
this.loadedUris[uri] = true;
return 1;
};
dojo.hostenv.packageLoaded = function (pkg) {
var deps = pkg.depends;
var requireList = null;
var requireAfterList = null;
var provideList = [];
if (deps && deps.length > 0) {
var dep = null;
var insertHint = 0;
var attachedPackage = false;
for (var i = 0; i < deps.length; i++) {
dep = deps[i];
if (dep[0] == "provide" || dep[0] == "hostenv.moduleLoaded") {
provideList.push(dep[1]);
} else {
if (!requireList) {
requireList = [];
}
if (!requireAfterList) {
requireAfterList = [];
}
var unpackedDeps = this.unpackXdDependency(dep);
if (unpackedDeps.requires) {
requireList = requireList.concat(unpackedDeps.requires);
}
if (unpackedDeps.requiresAfter) {
requireAfterList = requireAfterList.concat(unpackedDeps.requiresAfter);
}
}
var depType = dep[0];
var objPath = depType.split(".");
if (objPath.length == 2) {
dojo[objPath[0]][objPath[1]].apply(dojo[objPath[0]], dep.slice(1));
} else {
dojo[depType].apply(dojo, dep.slice(1));
}
}
var contentIndex = this.xdContents.push({content:pkg.definePackage, resourceName:pkg["resourceName"], resourcePath:pkg["resourcePath"], isDefined:false}) - 1;
for (var i = 0; i < provideList.length; i++) {
this.xdDepMap[provideList[i]] = {requires:requireList, requiresAfter:requireAfterList, contentIndex:contentIndex};
}
for (var i = 0; i < provideList.length; i++) {
this.xdInFlight[provideList[i]] = false;
}
}
};
dojo.hostenv.xdLoadFlattenedBundle = function (moduleName, bundleName, locale, bundleData) {
locale = locale || "root";
var jsLoc = dojo.hostenv.normalizeLocale(locale).replace("-", "_");
var bundlePackage = [moduleName, "nls", bundleName].join(".");
var bundle = dojo.hostenv.startPackage(bundlePackage);
bundle[jsLoc] = bundleData;
var mapName = [moduleName, jsLoc, bundleName].join(".");
var bundleMap = dojo.hostenv.xdBundleMap[mapName];
if (bundleMap) {
for (var param in bundleMap) {
bundle[param] = bundleData;
}
}
};
dojo.hostenv.xdBundleMap = {};
dojo.xdRequireLocalization = function (moduleName, bundleName, locale, availableFlatLocales) {
var locales = availableFlatLocales.split(",");
var jsLoc = dojo.hostenv.normalizeLocale(locale);
var bestLocale = "";
for (var i = 0; i < locales.length; i++) {
if (jsLoc.indexOf(locales[i]) == 0) {
if (locales[i].length > bestLocale.length) {
bestLocale = locales[i];
}
}
}
var fixedBestLocale = bestLocale.replace("-", "_");
var bundlePackage = dojo.evalObjPath([moduleName, "nls", bundleName].join("."));
if (bundlePackage && bundlePackage[fixedBestLocale]) {
bundle[jsLoc.replace("-", "_")] = bundlePackage[fixedBestLocale];
} else {
var mapName = [moduleName, (fixedBestLocale || "root"), bundleName].join(".");
var bundleMap = dojo.hostenv.xdBundleMap[mapName];
if (!bundleMap) {
bundleMap = dojo.hostenv.xdBundleMap[mapName] = {};
}
bundleMap[jsLoc.replace("-", "_")] = true;
dojo.require(moduleName + ".nls" + (bestLocale ? "." + bestLocale : "") + "." + bundleName);
}
};
(function () {
var extra = djConfig.extraLocale;
if (extra) {
if (!extra instanceof Array) {
extra = [extra];
}
dojo._xdReqLoc = dojo.xdRequireLocalization;
dojo.xdRequireLocalization = function (m, b, locale, fLocales) {
dojo._xdReqLoc(m, b, locale, fLocales);
if (locale) {
return;
}
for (var i = 0; i < extra.length; i++) {
dojo._xdReqLoc(m, b, extra[i], fLocales);
}
};
}
})();
dojo.hostenv.unpackXdDependency = function (dep) {
var newDeps = null;
var newAfterDeps = null;
switch (dep[0]) {
case "requireIf":
case "requireAfterIf":
case "conditionalRequire":
if ((dep[1] === true) || (dep[1] == "common") || (dep[1] && dojo.render[dep[1]].capable)) {
newDeps = [{name:dep[2], content:null}];
}
break;
case "requireAll":
dep.shift();
newDeps = dep;
dojo.hostenv.flattenRequireArray(newDeps);
break;
case "kwCompoundRequire":
case "hostenv.conditionalLoadModule":
var modMap = dep[1];
var common = modMap["common"] || [];
var newDeps = (modMap[dojo.hostenv.name_]) ? common.concat(modMap[dojo.hostenv.name_] || []) : common.concat(modMap["default"] || []);
dojo.hostenv.flattenRequireArray(newDeps);
break;
case "require":
case "requireAfter":
case "hostenv.loadModule":
newDeps = [{name:dep[1], content:null}];
break;
}
if (dep[0] == "requireAfterIf" || dep[0] == "requireIf") {
newAfterDeps = newDeps;
newDeps = null;
}
return {requires:newDeps, requiresAfter:newAfterDeps};
};
dojo.hostenv.xdWalkReqs = function () {
var reqChain = null;
var req;
for (var i = 0; i < this.xdOrderedReqs.length; i++) {
req = this.xdOrderedReqs[i];
if (this.xdDepMap[req]) {
reqChain = [req];
reqChain[req] = true;
this.xdEvalReqs(reqChain);
}
}
};
dojo.hostenv.xdEvalReqs = function (reqChain) {
while (reqChain.length > 0) {
var req = reqChain[reqChain.length - 1];
var pkg = this.xdDepMap[req];
if (pkg) {
var reqs = pkg.requires;
if (reqs && reqs.length > 0) {
var nextReq;
for (var i = 0; i < reqs.length; i++) {
nextReq = reqs[i].name;
if (nextReq && !reqChain[nextReq]) {
reqChain.push(nextReq);
reqChain[nextReq] = true;
this.xdEvalReqs(reqChain);
}
}
}
var contents = this.xdContents[pkg.contentIndex];
if (!contents.isDefined) {
var content = contents.content;
content["resourceName"] = contents["resourceName"];
content["resourcePath"] = contents["resourcePath"];
this.xdDefList.push(content);
contents.isDefined = true;
}
this.xdDepMap[req] = null;
var reqs = pkg.requiresAfter;
if (reqs && reqs.length > 0) {
var nextReq;
for (var i = 0; i < reqs.length; i++) {
nextReq = reqs[i].name;
if (nextReq && !reqChain[nextReq]) {
reqChain.push(nextReq);
reqChain[nextReq] = true;
this.xdEvalReqs(reqChain);
}
}
}
}
reqChain.pop();
}
};
dojo.hostenv.clearXdInterval = function () {
clearInterval(this.xdTimer);
this.xdTimer = 0;
};
dojo.hostenv.watchInFlightXDomain = function () {
var waitInterval = (djConfig.xdWaitSeconds || 15) * 1000;
if (this.xdStartTime + waitInterval < (new Date()).getTime()) {
this.clearXdInterval();
var noLoads = "";
for (var param in this.xdInFlight) {
if (this.xdInFlight[param]) {
noLoads += param + " ";
}
}
dojo.raise("Could not load cross-domain packages: " + noLoads);
}
for (var param in this.xdInFlight) {
if (this.xdInFlight[param]) {
return;
}
}
this.clearXdInterval();
this.xdWalkReqs();
var defLength = this.xdDefList.length;
for (var i = 0; i < defLength; i++) {
var content = dojo.hostenv.xdDefList[i];
if (djConfig["debugAtAllCosts"] && content["resourceName"]) {
if (!this["xdDebugQueue"]) {
this.xdDebugQueue = [];
}
this.xdDebugQueue.push({resourceName:content.resourceName, resourcePath:content.resourcePath});
} else {
content(dojo);
}
}
for (var i = 0; i < this.xdContents.length; i++) {
var current = this.xdContents[i];
if (current.content && !current.isDefined) {
current.content(dojo);
}
}
this.resetXd();
if (this["xdDebugQueue"] && this.xdDebugQueue.length > 0) {
this.xdDebugFileLoaded();
} else {
this.xdNotifyLoaded();
}
};
dojo.hostenv.xdNotifyLoaded = function () {
this.inFlightCount = 0;
this.callLoaded();
};
dojo.hostenv.flattenRequireArray = function (target) {
if (target) {
for (var i = 0; i < target.length; i++) {
if (target[i] instanceof Array) {
target[i] = {name:target[i][0], content:null};
} else {
target[i] = {name:target[i], content:null};
}
}
}
};
dojo.hostenv.xdHasCalledPreload = false;
dojo.hostenv.xdRealCallLoaded = dojo.hostenv.callLoaded;
dojo.hostenv.callLoaded = function () {
if (this.xdHasCalledPreload || dojo.hostenv.getModulePrefix("dojo") == "src" || !this.localesGenerated) {
this.xdRealCallLoaded();
this.xdHasCalledPreload = true;
} else {
if (this.localesGenerated) {
this.registerNlsPrefix = function () {
dojo.registerModulePath("nls", dojo.hostenv.getModulePrefix("dojo") + "/../nls");
};
this.preloadLocalizations();
}
this.xdHasCalledPreload = true;
}
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/html.js
New file
0,0 → 1,14
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.html");
dojo.require("dojo.html.*");
dojo.deprecated("dojo.html", "replaced by dojo.html.*", "0.5");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/crypto/SHA1.js
New file
0,0 → 1,171
/*
* A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
* in FIPS PUB 180-1
*
* Version 2.1a Copyright Paul Johnston 2000 - 2002.
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distributed under the BSD License
* See http://pajhome.org.uk/crypt/md5 for details.
*
* Dojo port by Tom Trenka
*/
 
dojo.require("dojo.crypto");
dojo.provide("dojo.crypto.SHA1");
dojo.require("dojo.experimental");
dojo.experimental("dojo.crypto.SHA1");
dojo.crypto.SHA1 = new function () {
var chrsz = 8;
var mask = (1 << chrsz) - 1;
function toWord(s) {
var wa = [];
for (var i = 0; i < s.length * chrsz; i += chrsz) {
wa[i >> 5] |= (s.charCodeAt(i / chrsz) & mask) << (i % 32);
}
return wa;
}
function toString(wa) {
var s = [];
for (var i = 0; i < wa.length * 32; i += chrsz) {
s.push(String.fromCharCode((wa[i >> 5] >>> (i % 32)) & mask));
}
return s.join("");
}
function toHex(wa) {
var h = "0123456789abcdef";
var s = [];
for (var i = 0; i < wa.length * 4; i++) {
s.push(h.charAt((wa[i >> 2] >> ((i % 4) * 8 + 4)) & 15) + h.charAt((wa[i >> 2] >> ((i % 4) * 8)) & 15));
}
return s.join("");
}
function toBase64(wa) {
var p = "=";
var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var s = [];
for (var i = 0; i < wa.length * 4; i += 3) {
var t = (((wa[i >> 2] >> 8 * (i % 4)) & 255) << 16) | (((wa[i + 1 >> 2] >> 8 * ((i + 1) % 4)) & 255) << 8) | ((wa[i + 2 >> 2] >> 8 * ((i + 2) % 4)) & 255);
for (var j = 0; j < 4; j++) {
if (i * 8 + j * 6 > wa.length * 32) {
s.push(p);
} else {
s.push(tab.charAt((t >> 6 * (3 - j)) & 63));
}
}
}
return s.join("");
}
function add(x, y) {
var l = (x & 65535) + (y & 65535);
var m = (x >> 16) + (y >> 16) + (l >> 16);
return (m << 16) | (l & 65535);
}
function r(x, n) {
return (x << n) | (x >>> (32 - n));
}
function f(u, v, w) {
return ((u & v) | (~u & w));
}
function g(u, v, w) {
return ((u & v) | (u & w) | (v & w));
}
function h(u, v, w) {
return (u ^ v ^ w);
}
function fn(i, u, v, w) {
if (i < 20) {
return f(u, v, w);
}
if (i < 40) {
return h(u, v, w);
}
if (i < 60) {
return g(u, v, w);
}
return h(u, v, w);
}
function cnst(i) {
if (i < 20) {
return 1518500249;
}
if (i < 40) {
return 1859775393;
}
if (i < 60) {
return -1894007588;
}
return -899497514;
}
function core(x, len) {
x[len >> 5] |= 128 << (24 - len % 32);
x[((len + 64 >> 9) << 4) + 15] = len;
var w = [];
var a = 1732584193;
var b = -271733879;
var c = -1732584194;
var d = 271733878;
var e = -1009589776;
for (var i = 0; i < x.length; i += 16) {
var olda = a;
var oldb = b;
var oldc = c;
var oldd = d;
var olde = e;
for (var j = 0; j < 80; j++) {
if (j < 16) {
w[j] = x[i + j];
} else {
w[j] = r(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1);
}
var t = add(add(r(a, 5), fn(j, b, c, d)), add(add(e, w[j]), cnst(j)));
e = d;
d = c;
c = r(b, 30);
b = a;
a = t;
}
a = add(a, olda);
b = add(b, oldb);
c = add(c, oldc);
d = add(d, oldd);
e = add(e, olde);
}
return [a, b, c, d, e];
}
function hmac(data, key) {
var wa = toWord(key);
if (wa.length > 16) {
wa = core(wa, key.length * chrsz);
}
var l = [], r = [];
for (var i = 0; i < 16; i++) {
l[i] = wa[i] ^ 909522486;
r[i] = wa[i] ^ 1549556828;
}
var h = core(l.concat(toWord(data)), 512 + data.length * chrsz);
return core(r.concat(h), 640);
}
this.compute = function (data, outputType) {
var out = outputType || dojo.crypto.outputTypes.Base64;
switch (out) {
case dojo.crypto.outputTypes.Hex:
return toHex(core(toWord(data), data.length * chrsz));
case dojo.crypto.outputTypes.String:
return toString(core(toWord(data), data.length * chrsz));
default:
return toBase64(core(toWord(data), data.length * chrsz));
}
};
this.getHMAC = function (data, key, outputType) {
var out = outputType || dojo.crypto.outputTypes.Base64;
switch (out) {
case dojo.crypto.outputTypes.Hex:
return toHex(hmac(data, key));
case dojo.crypto.outputTypes.String:
return toString(hmac(data, key));
default:
return toBase64(hmac(data, key));
}
};
}();
 
/tags/Racine_livraison_narmer/api/js/dojo/src/crypto/Blowfish.js
New file
0,0 → 1,382
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.require("dojo.crypto");
dojo.provide("dojo.crypto.Blowfish");
dojo.crypto.Blowfish = new function () {
var POW2 = Math.pow(2, 2);
var POW3 = Math.pow(2, 3);
var POW4 = Math.pow(2, 4);
var POW8 = Math.pow(2, 8);
var POW16 = Math.pow(2, 16);
var POW24 = Math.pow(2, 24);
var iv = null;
var boxes = {p:[608135816, 2242054355, 320440878, 57701188, 2752067618, 698298832, 137296536, 3964562569, 1160258022, 953160567, 3193202383, 887688300, 3232508343, 3380367581, 1065670069, 3041331479, 2450970073, 2306472731], s0:[3509652390, 2564797868, 805139163, 3491422135, 3101798381, 1780907670, 3128725573, 4046225305, 614570311, 3012652279, 134345442, 2240740374, 1667834072, 1901547113, 2757295779, 4103290238, 227898511, 1921955416, 1904987480, 2182433518, 2069144605, 3260701109, 2620446009, 720527379, 3318853667, 677414384, 3393288472, 3101374703, 2390351024, 1614419982, 1822297739, 2954791486, 3608508353, 3174124327, 2024746970, 1432378464, 3864339955, 2857741204, 1464375394, 1676153920, 1439316330, 715854006, 3033291828, 289532110, 2706671279, 2087905683, 3018724369, 1668267050, 732546397, 1947742710, 3462151702, 2609353502, 2950085171, 1814351708, 2050118529, 680887927, 999245976, 1800124847, 3300911131, 1713906067, 1641548236, 4213287313, 1216130144, 1575780402, 4018429277, 3917837745, 3693486850, 3949271944, 596196993, 3549867205, 258830323, 2213823033, 772490370, 2760122372, 1774776394, 2652871518, 566650946, 4142492826, 1728879713, 2882767088, 1783734482, 3629395816, 2517608232, 2874225571, 1861159788, 326777828, 3124490320, 2130389656, 2716951837, 967770486, 1724537150, 2185432712, 2364442137, 1164943284, 2105845187, 998989502, 3765401048, 2244026483, 1075463327, 1455516326, 1322494562, 910128902, 469688178, 1117454909, 936433444, 3490320968, 3675253459, 1240580251, 122909385, 2157517691, 634681816, 4142456567, 3825094682, 3061402683, 2540495037, 79693498, 3249098678, 1084186820, 1583128258, 426386531, 1761308591, 1047286709, 322548459, 995290223, 1845252383, 2603652396, 3431023940, 2942221577, 3202600964, 3727903485, 1712269319, 422464435, 3234572375, 1170764815, 3523960633, 3117677531, 1434042557, 442511882, 3600875718, 1076654713, 1738483198, 4213154764, 2393238008, 3677496056, 1014306527, 4251020053, 793779912, 2902807211, 842905082, 4246964064, 1395751752, 1040244610, 2656851899, 3396308128, 445077038, 3742853595, 3577915638, 679411651, 2892444358, 2354009459, 1767581616, 3150600392, 3791627101, 3102740896, 284835224, 4246832056, 1258075500, 768725851, 2589189241, 3069724005, 3532540348, 1274779536, 3789419226, 2764799539, 1660621633, 3471099624, 4011903706, 913787905, 3497959166, 737222580, 2514213453, 2928710040, 3937242737, 1804850592, 3499020752, 2949064160, 2386320175, 2390070455, 2415321851, 4061277028, 2290661394, 2416832540, 1336762016, 1754252060, 3520065937, 3014181293, 791618072, 3188594551, 3933548030, 2332172193, 3852520463, 3043980520, 413987798, 3465142937, 3030929376, 4245938359, 2093235073, 3534596313, 375366246, 2157278981, 2479649556, 555357303, 3870105701, 2008414854, 3344188149, 4221384143, 3956125452, 2067696032, 3594591187, 2921233993, 2428461, 544322398, 577241275, 1471733935, 610547355, 4027169054, 1432588573, 1507829418, 2025931657, 3646575487, 545086370, 48609733, 2200306550, 1653985193, 298326376, 1316178497, 3007786442, 2064951626, 458293330, 2589141269, 3591329599, 3164325604, 727753846, 2179363840, 146436021, 1461446943, 4069977195, 705550613, 3059967265, 3887724982, 4281599278, 3313849956, 1404054877, 2845806497, 146425753, 1854211946], s1:[1266315497, 3048417604, 3681880366, 3289982499, 2909710000, 1235738493, 2632868024, 2414719590, 3970600049, 1771706367, 1449415276, 3266420449, 422970021, 1963543593, 2690192192, 3826793022, 1062508698, 1531092325, 1804592342, 2583117782, 2714934279, 4024971509, 1294809318, 4028980673, 1289560198, 2221992742, 1669523910, 35572830, 157838143, 1052438473, 1016535060, 1802137761, 1753167236, 1386275462, 3080475397, 2857371447, 1040679964, 2145300060, 2390574316, 1461121720, 2956646967, 4031777805, 4028374788, 33600511, 2920084762, 1018524850, 629373528, 3691585981, 3515945977, 2091462646, 2486323059, 586499841, 988145025, 935516892, 3367335476, 2599673255, 2839830854, 265290510, 3972581182, 2759138881, 3795373465, 1005194799, 847297441, 406762289, 1314163512, 1332590856, 1866599683, 4127851711, 750260880, 613907577, 1450815602, 3165620655, 3734664991, 3650291728, 3012275730, 3704569646, 1427272223, 778793252, 1343938022, 2676280711, 2052605720, 1946737175, 3164576444, 3914038668, 3967478842, 3682934266, 1661551462, 3294938066, 4011595847, 840292616, 3712170807, 616741398, 312560963, 711312465, 1351876610, 322626781, 1910503582, 271666773, 2175563734, 1594956187, 70604529, 3617834859, 1007753275, 1495573769, 4069517037, 2549218298, 2663038764, 504708206, 2263041392, 3941167025, 2249088522, 1514023603, 1998579484, 1312622330, 694541497, 2582060303, 2151582166, 1382467621, 776784248, 2618340202, 3323268794, 2497899128, 2784771155, 503983604, 4076293799, 907881277, 423175695, 432175456, 1378068232, 4145222326, 3954048622, 3938656102, 3820766613, 2793130115, 2977904593, 26017576, 3274890735, 3194772133, 1700274565, 1756076034, 4006520079, 3677328699, 720338349, 1533947780, 354530856, 688349552, 3973924725, 1637815568, 332179504, 3949051286, 53804574, 2852348879, 3044236432, 1282449977, 3583942155, 3416972820, 4006381244, 1617046695, 2628476075, 3002303598, 1686838959, 431878346, 2686675385, 1700445008, 1080580658, 1009431731, 832498133, 3223435511, 2605976345, 2271191193, 2516031870, 1648197032, 4164389018, 2548247927, 300782431, 375919233, 238389289, 3353747414, 2531188641, 2019080857, 1475708069, 455242339, 2609103871, 448939670, 3451063019, 1395535956, 2413381860, 1841049896, 1491858159, 885456874, 4264095073, 4001119347, 1565136089, 3898914787, 1108368660, 540939232, 1173283510, 2745871338, 3681308437, 4207628240, 3343053890, 4016749493, 1699691293, 1103962373, 3625875870, 2256883143, 3830138730, 1031889488, 3479347698, 1535977030, 4236805024, 3251091107, 2132092099, 1774941330, 1199868427, 1452454533, 157007616, 2904115357, 342012276, 595725824, 1480756522, 206960106, 497939518, 591360097, 863170706, 2375253569, 3596610801, 1814182875, 2094937945, 3421402208, 1082520231, 3463918190, 2785509508, 435703966, 3908032597, 1641649973, 2842273706, 3305899714, 1510255612, 2148256476, 2655287854, 3276092548, 4258621189, 236887753, 3681803219, 274041037, 1734335097, 3815195456, 3317970021, 1899903192, 1026095262, 4050517792, 356393447, 2410691914, 3873677099, 3682840055], s2:[3913112168, 2491498743, 4132185628, 2489919796, 1091903735, 1979897079, 3170134830, 3567386728, 3557303409, 857797738, 1136121015, 1342202287, 507115054, 2535736646, 337727348, 3213592640, 1301675037, 2528481711, 1895095763, 1721773893, 3216771564, 62756741, 2142006736, 835421444, 2531993523, 1442658625, 3659876326, 2882144922, 676362277, 1392781812, 170690266, 3921047035, 1759253602, 3611846912, 1745797284, 664899054, 1329594018, 3901205900, 3045908486, 2062866102, 2865634940, 3543621612, 3464012697, 1080764994, 553557557, 3656615353, 3996768171, 991055499, 499776247, 1265440854, 648242737, 3940784050, 980351604, 3713745714, 1749149687, 3396870395, 4211799374, 3640570775, 1161844396, 3125318951, 1431517754, 545492359, 4268468663, 3499529547, 1437099964, 2702547544, 3433638243, 2581715763, 2787789398, 1060185593, 1593081372, 2418618748, 4260947970, 69676912, 2159744348, 86519011, 2512459080, 3838209314, 1220612927, 3339683548, 133810670, 1090789135, 1078426020, 1569222167, 845107691, 3583754449, 4072456591, 1091646820, 628848692, 1613405280, 3757631651, 526609435, 236106946, 48312990, 2942717905, 3402727701, 1797494240, 859738849, 992217954, 4005476642, 2243076622, 3870952857, 3732016268, 765654824, 3490871365, 2511836413, 1685915746, 3888969200, 1414112111, 2273134842, 3281911079, 4080962846, 172450625, 2569994100, 980381355, 4109958455, 2819808352, 2716589560, 2568741196, 3681446669, 3329971472, 1835478071, 660984891, 3704678404, 4045999559, 3422617507, 3040415634, 1762651403, 1719377915, 3470491036, 2693910283, 3642056355, 3138596744, 1364962596, 2073328063, 1983633131, 926494387, 3423689081, 2150032023, 4096667949, 1749200295, 3328846651, 309677260, 2016342300, 1779581495, 3079819751, 111262694, 1274766160, 443224088, 298511866, 1025883608, 3806446537, 1145181785, 168956806, 3641502830, 3584813610, 1689216846, 3666258015, 3200248200, 1692713982, 2646376535, 4042768518, 1618508792, 1610833997, 3523052358, 4130873264, 2001055236, 3610705100, 2202168115, 4028541809, 2961195399, 1006657119, 2006996926, 3186142756, 1430667929, 3210227297, 1314452623, 4074634658, 4101304120, 2273951170, 1399257539, 3367210612, 3027628629, 1190975929, 2062231137, 2333990788, 2221543033, 2438960610, 1181637006, 548689776, 2362791313, 3372408396, 3104550113, 3145860560, 296247880, 1970579870, 3078560182, 3769228297, 1714227617, 3291629107, 3898220290, 166772364, 1251581989, 493813264, 448347421, 195405023, 2709975567, 677966185, 3703036547, 1463355134, 2715995803, 1338867538, 1343315457, 2802222074, 2684532164, 233230375, 2599980071, 2000651841, 3277868038, 1638401717, 4028070440, 3237316320, 6314154, 819756386, 300326615, 590932579, 1405279636, 3267499572, 3150704214, 2428286686, 3959192993, 3461946742, 1862657033, 1266418056, 963775037, 2089974820, 2263052895, 1917689273, 448879540, 3550394620, 3981727096, 150775221, 3627908307, 1303187396, 508620638, 2975983352, 2726630617, 1817252668, 1876281319, 1457606340, 908771278, 3720792119, 3617206836, 2455994898, 1729034894, 1080033504], s3:[976866871, 3556439503, 2881648439, 1522871579, 1555064734, 1336096578, 3548522304, 2579274686, 3574697629, 3205460757, 3593280638, 3338716283, 3079412587, 564236357, 2993598910, 1781952180, 1464380207, 3163844217, 3332601554, 1699332808, 1393555694, 1183702653, 3581086237, 1288719814, 691649499, 2847557200, 2895455976, 3193889540, 2717570544, 1781354906, 1676643554, 2592534050, 3230253752, 1126444790, 2770207658, 2633158820, 2210423226, 2615765581, 2414155088, 3127139286, 673620729, 2805611233, 1269405062, 4015350505, 3341807571, 4149409754, 1057255273, 2012875353, 2162469141, 2276492801, 2601117357, 993977747, 3918593370, 2654263191, 753973209, 36408145, 2530585658, 25011837, 3520020182, 2088578344, 530523599, 2918365339, 1524020338, 1518925132, 3760827505, 3759777254, 1202760957, 3985898139, 3906192525, 674977740, 4174734889, 2031300136, 2019492241, 3983892565, 4153806404, 3822280332, 352677332, 2297720250, 60907813, 90501309, 3286998549, 1016092578, 2535922412, 2839152426, 457141659, 509813237, 4120667899, 652014361, 1966332200, 2975202805, 55981186, 2327461051, 676427537, 3255491064, 2882294119, 3433927263, 1307055953, 942726286, 933058658, 2468411793, 3933900994, 4215176142, 1361170020, 2001714738, 2830558078, 3274259782, 1222529897, 1679025792, 2729314320, 3714953764, 1770335741, 151462246, 3013232138, 1682292957, 1483529935, 471910574, 1539241949, 458788160, 3436315007, 1807016891, 3718408830, 978976581, 1043663428, 3165965781, 1927990952, 4200891579, 2372276910, 3208408903, 3533431907, 1412390302, 2931980059, 4132332400, 1947078029, 3881505623, 4168226417, 2941484381, 1077988104, 1320477388, 886195818, 18198404, 3786409000, 2509781533, 112762804, 3463356488, 1866414978, 891333506, 18488651, 661792760, 1628790961, 3885187036, 3141171499, 876946877, 2693282273, 1372485963, 791857591, 2686433993, 3759982718, 3167212022, 3472953795, 2716379847, 445679433, 3561995674, 3504004811, 3574258232, 54117162, 3331405415, 2381918588, 3769707343, 4154350007, 1140177722, 4074052095, 668550556, 3214352940, 367459370, 261225585, 2610173221, 4209349473, 3468074219, 3265815641, 314222801, 3066103646, 3808782860, 282218597, 3406013506, 3773591054, 379116347, 1285071038, 846784868, 2669647154, 3771962079, 3550491691, 2305946142, 453669953, 1268987020, 3317592352, 3279303384, 3744833421, 2610507566, 3859509063, 266596637, 3847019092, 517658769, 3462560207, 3443424879, 370717030, 4247526661, 2224018117, 4143653529, 4112773975, 2788324899, 2477274417, 1456262402, 2901442914, 1517677493, 1846949527, 2295493580, 3734397586, 2176403920, 1280348187, 1908823572, 3871786941, 846861322, 1172426758, 3287448474, 3383383037, 1655181056, 3139813346, 901632758, 1897031941, 2986607138, 3066810236, 3447102507, 1393639104, 373351379, 950779232, 625454576, 3124240540, 4148612726, 2007998917, 544563296, 2244738638, 2330496472, 2058025392, 1291430526, 424198748, 50039436, 29584100, 3605783033, 2429876329, 2791104160, 1057563949, 3255363231, 3075367218, 3463963227, 1469046755, 985887462]};
function add(x, y) {
var sum = (x + y) & 4294967295;
if (sum < 0) {
sum = -sum;
return (65536 * ((sum >> 16) ^ 65535)) + (((sum & 65535) ^ 65535) + 1);
}
return sum;
}
function split(x) {
var r = x & 4294967295;
if (r < 0) {
r = -r;
return [((r & 65535) ^ 65535) + 1, (r >> 16) ^ 65535];
}
return [r & 65535, (r >> 16)];
}
function xor(x, y) {
var xs = split(x);
var ys = split(y);
return (65536 * (xs[1] ^ ys[1])) + (xs[0] ^ ys[0]);
}
function $(v, box) {
var d = v & 255;
v >>= 8;
var c = v & 255;
v >>= 8;
var b = v & 255;
v >>= 8;
var a = v & 255;
var r = add(box.s0[a], box.s1[b]);
r = xor(r, box.s2[c]);
return add(r, box.s3[d]);
}
function eb(o, box) {
var l = o.left;
var r = o.right;
l = xor(l, box.p[0]);
r = xor(r, xor($(l, box), box.p[1]));
l = xor(l, xor($(r, box), box.p[2]));
r = xor(r, xor($(l, box), box.p[3]));
l = xor(l, xor($(r, box), box.p[4]));
r = xor(r, xor($(l, box), box.p[5]));
l = xor(l, xor($(r, box), box.p[6]));
r = xor(r, xor($(l, box), box.p[7]));
l = xor(l, xor($(r, box), box.p[8]));
r = xor(r, xor($(l, box), box.p[9]));
l = xor(l, xor($(r, box), box.p[10]));
r = xor(r, xor($(l, box), box.p[11]));
l = xor(l, xor($(r, box), box.p[12]));
r = xor(r, xor($(l, box), box.p[13]));
l = xor(l, xor($(r, box), box.p[14]));
r = xor(r, xor($(l, box), box.p[15]));
l = xor(l, xor($(r, box), box.p[16]));
o.right = l;
o.left = xor(r, box.p[17]);
}
function db(o, box) {
var l = o.left;
var r = o.right;
l = xor(l, box.p[17]);
r = xor(r, xor($(l, box), box.p[16]));
l = xor(l, xor($(r, box), box.p[15]));
r = xor(r, xor($(l, box), box.p[14]));
l = xor(l, xor($(r, box), box.p[13]));
r = xor(r, xor($(l, box), box.p[12]));
l = xor(l, xor($(r, box), box.p[11]));
r = xor(r, xor($(l, box), box.p[10]));
l = xor(l, xor($(r, box), box.p[9]));
r = xor(r, xor($(l, box), box.p[8]));
l = xor(l, xor($(r, box), box.p[7]));
r = xor(r, xor($(l, box), box.p[6]));
l = xor(l, xor($(r, box), box.p[5]));
r = xor(r, xor($(l, box), box.p[4]));
l = xor(l, xor($(r, box), box.p[3]));
r = xor(r, xor($(l, box), box.p[2]));
l = xor(l, xor($(r, box), box.p[1]));
o.right = l;
o.left = xor(r, box.p[0]);
}
function init(key) {
var k = key;
if (typeof (k) == "string") {
var a = [];
for (var i = 0; i < k.length; i++) {
a.push(k.charCodeAt(i) & 255);
}
k = a;
}
var box = {p:[], s0:[], s1:[], s2:[], s3:[]};
for (var i = 0; i < boxes.p.length; i++) {
box.p.push(boxes.p[i]);
}
for (var i = 0; i < boxes.s0.length; i++) {
box.s0.push(boxes.s0[i]);
}
for (var i = 0; i < boxes.s1.length; i++) {
box.s1.push(boxes.s1[i]);
}
for (var i = 0; i < boxes.s2.length; i++) {
box.s2.push(boxes.s2[i]);
}
for (var i = 0; i < boxes.s3.length; i++) {
box.s3.push(boxes.s3[i]);
}
var pos = 0;
var data = 0;
for (var i = 0; i < box.p.length; i++) {
for (var j = 0; j < 4; j++) {
data = (data * POW8) | k[pos];
if (++pos == k.length) {
pos = 0;
}
}
box.p[i] = xor(box.p[i], data);
}
var res = {left:0, right:0};
for (var i = 0; i < box.p.length; ) {
eb(res, box);
box.p[i++] = res.left;
box.p[i++] = res.right;
}
for (var i = 0; i < 4; i++) {
for (var j = 0; j < box["s" + i].length; ) {
eb(res, box);
box["s" + i][j++] = res.left;
box["s" + i][j++] = res.right;
}
}
return box;
}
function toBase64(ba) {
var p = "=";
var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var s = [];
var l = ba.length;
var rm = l % 3;
var x = l - rm;
for (var i = 0; i < x; ) {
var t = ba[i++] << 16 | ba[i++] << 8 | ba[i++];
s.push(tab.charAt((t >>> 18) & 63));
s.push(tab.charAt((t >>> 12) & 63));
s.push(tab.charAt((t >>> 6) & 63));
s.push(tab.charAt(t & 63));
}
switch (rm) {
case 2:
var t = ba[i++] << 16 | ba[i++] << 8;
s.push(tab.charAt((t >>> 18) & 63));
s.push(tab.charAt((t >>> 12) & 63));
s.push(tab.charAt((t >>> 6) & 63));
s.push(p);
break;
case 1:
var t = ba[i++] << 16;
s.push(tab.charAt((t >>> 18) & 63));
s.push(tab.charAt((t >>> 12) & 63));
s.push(p);
s.push(p);
break;
}
return s.join("");
}
function fromBase64(str) {
var s = str.split("");
var p = "=";
var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var out = [];
var l = s.length;
while (s[--l] == p) {
}
for (var i = 0; i < l; ) {
var t = tab.indexOf(s[i++]) << 18 | tab.indexOf(s[i++]) << 12 | tab.indexOf(s[i++]) << 6 | tab.indexOf(s[i++]);
out.push((t >>> 16) & 255);
out.push((t >>> 8) & 255);
out.push(t & 255);
}
return out;
}
this.getIV = function (outputType) {
var out = outputType || dojo.crypto.outputTypes.Base64;
switch (out) {
case dojo.crypto.outputTypes.Hex:
var s = [];
for (var i = 0; i < iv.length; i++) {
s.push((iv[i]).toString(16));
}
return s.join("");
case dojo.crypto.outputTypes.String:
return iv.join("");
case dojo.crypto.outputTypes.Raw:
return iv;
default:
return toBase64(iv);
}
};
this.setIV = function (data, inputType) {
var ip = inputType || dojo.crypto.outputTypes.Base64;
var ba = null;
switch (ip) {
case dojo.crypto.outputTypes.String:
ba = [];
for (var i = 0; i < data.length; i++) {
ba.push(data.charCodeAt(i));
}
break;
case dojo.crypto.outputTypes.Hex:
ba = [];
var i = 0;
while (i + 1 < data.length) {
ba.push(parseInt(data.substr(i, 2), 16));
i += 2;
}
break;
case dojo.crypto.outputTypes.Raw:
ba = data;
break;
default:
ba = fromBase64(data);
break;
}
iv = {};
iv.left = ba[0] * POW24 | ba[1] * POW16 | ba[2] * POW8 | ba[3];
iv.right = ba[4] * POW24 | ba[5] * POW16 | ba[6] * POW8 | ba[7];
};
this.encrypt = function (plaintext, key, ao) {
var out = dojo.crypto.outputTypes.Base64;
var mode = dojo.crypto.cipherModes.EBC;
if (ao) {
if (ao.outputType) {
out = ao.outputType;
}
if (ao.cipherMode) {
mode = ao.cipherMode;
}
}
var bx = init(key);
var padding = 8 - (plaintext.length & 7);
for (var i = 0; i < padding; i++) {
plaintext += String.fromCharCode(padding);
}
var cipher = [];
var count = plaintext.length >> 3;
var pos = 0;
var o = {};
var isCBC = (mode == dojo.crypto.cipherModes.CBC);
var vector = {left:iv.left || null, right:iv.right || null};
for (var i = 0; i < count; i++) {
o.left = plaintext.charCodeAt(pos) * POW24 | plaintext.charCodeAt(pos + 1) * POW16 | plaintext.charCodeAt(pos + 2) * POW8 | plaintext.charCodeAt(pos + 3);
o.right = plaintext.charCodeAt(pos + 4) * POW24 | plaintext.charCodeAt(pos + 5) * POW16 | plaintext.charCodeAt(pos + 6) * POW8 | plaintext.charCodeAt(pos + 7);
if (isCBC) {
o.left = xor(o.left, vector.left);
o.right = xor(o.right, vector.right);
}
eb(o, bx);
if (isCBC) {
vector.left = o.left;
vector.right = o.right;
dojo.crypto.outputTypes.Hex;
}
cipher.push((o.left >> 24) & 255);
cipher.push((o.left >> 16) & 255);
cipher.push((o.left >> 8) & 255);
cipher.push(o.left & 255);
cipher.push((o.right >> 24) & 255);
cipher.push((o.right >> 16) & 255);
cipher.push((o.right >> 8) & 255);
cipher.push(o.right & 255);
pos += 8;
}
switch (out) {
case dojo.crypto.outputTypes.Hex:
var s = [];
for (var i = 0; i < cipher.length; i++) {
s.push((cipher[i]).toString(16));
}
return s.join("");
case dojo.crypto.outputTypes.String:
return cipher.join("");
case dojo.crypto.outputTypes.Raw:
return cipher;
default:
return toBase64(cipher);
}
};
this.decrypt = function (ciphertext, key, ao) {
var ip = dojo.crypto.outputTypes.Base64;
var mode = dojo.crypto.cipherModes.EBC;
if (ao) {
if (ao.outputType) {
ip = ao.outputType;
}
if (ao.cipherMode) {
mode = ao.cipherMode;
}
}
var bx = init(key);
var pt = [];
var c = null;
switch (ip) {
case dojo.crypto.outputTypes.Hex:
c = [];
var i = 0;
while (i + 1 < ciphertext.length) {
c.push(parseInt(ciphertext.substr(i, 2), 16));
i += 2;
}
break;
case dojo.crypto.outputTypes.String:
c = [];
for (var i = 0; i < ciphertext.length; i++) {
c.push(ciphertext.charCodeAt(i));
}
break;
case dojo.crypto.outputTypes.Raw:
c = ciphertext;
break;
default:
c = fromBase64(ciphertext);
break;
}
var count = c.length >> 3;
var pos = 0;
var o = {};
var isCBC = (mode == dojo.crypto.cipherModes.CBC);
var vector = {left:iv.left || null, right:iv.right || null};
for (var i = 0; i < count; i++) {
o.left = c[pos] * POW24 | c[pos + 1] * POW16 | c[pos + 2] * POW8 | c[pos + 3];
o.right = c[pos + 4] * POW24 | c[pos + 5] * POW16 | c[pos + 6] * POW8 | c[pos + 7];
if (isCBC) {
var left = o.left;
var right = o.right;
}
db(o, bx);
if (isCBC) {
o.left = xor(o.left, vector.left);
o.right = xor(o.right, vector.right);
vector.left = left;
vector.right = right;
}
pt.push((o.left >> 24) & 255);
pt.push((o.left >> 16) & 255);
pt.push((o.left >> 8) & 255);
pt.push(o.left & 255);
pt.push((o.right >> 24) & 255);
pt.push((o.right >> 16) & 255);
pt.push((o.right >> 8) & 255);
pt.push(o.right & 255);
pos += 8;
}
if (pt[pt.length - 1] == pt[pt.length - 2] || pt[pt.length - 1] == 1) {
var n = pt[pt.length - 1];
pt.splice(pt.length - n, n);
}
for (var i = 0; i < pt.length; i++) {
pt[i] = String.fromCharCode(pt[i]);
}
return pt.join("");
};
this.setIV("0000000000000000", dojo.crypto.outputTypes.Hex);
}();
 
/tags/Racine_livraison_narmer/api/js/dojo/src/crypto/MD5.js
New file
0,0 → 1,200
/* Return to a port of Paul Johnstone's MD5 implementation
* http://pajhome.org.uk/crypt/md5/index.html
*
* Copyright (C) Paul Johnston 1999 - 2002.
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distributed under the BSD License
*
* Dojo port by Tom Trenka
*
* 2005-12-7
* All conversions are internalized (no dependencies)
* implemented getHMAC for message digest auth.
*/
 
dojo.require("dojo.crypto");
dojo.provide("dojo.crypto.MD5");
dojo.crypto.MD5 = new function () {
var chrsz = 8;
var mask = (1 << chrsz) - 1;
function toWord(s) {
var wa = [];
for (var i = 0; i < s.length * chrsz; i += chrsz) {
wa[i >> 5] |= (s.charCodeAt(i / chrsz) & mask) << (i % 32);
}
return wa;
}
function toString(wa) {
var s = [];
for (var i = 0; i < wa.length * 32; i += chrsz) {
s.push(String.fromCharCode((wa[i >> 5] >>> (i % 32)) & mask));
}
return s.join("");
}
function toHex(wa) {
var h = "0123456789abcdef";
var s = [];
for (var i = 0; i < wa.length * 4; i++) {
s.push(h.charAt((wa[i >> 2] >> ((i % 4) * 8 + 4)) & 15) + h.charAt((wa[i >> 2] >> ((i % 4) * 8)) & 15));
}
return s.join("");
}
function toBase64(wa) {
var p = "=";
var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var s = [];
for (var i = 0; i < wa.length * 4; i += 3) {
var t = (((wa[i >> 2] >> 8 * (i % 4)) & 255) << 16) | (((wa[i + 1 >> 2] >> 8 * ((i + 1) % 4)) & 255) << 8) | ((wa[i + 2 >> 2] >> 8 * ((i + 2) % 4)) & 255);
for (var j = 0; j < 4; j++) {
if (i * 8 + j * 6 > wa.length * 32) {
s.push(p);
} else {
s.push(tab.charAt((t >> 6 * (3 - j)) & 63));
}
}
}
return s.join("");
}
function add(x, y) {
var l = (x & 65535) + (y & 65535);
var m = (x >> 16) + (y >> 16) + (l >> 16);
return (m << 16) | (l & 65535);
}
function R(n, c) {
return (n << c) | (n >>> (32 - c));
}
function C(q, a, b, x, s, t) {
return add(R(add(add(a, q), add(x, t)), s), b);
}
function FF(a, b, c, d, x, s, t) {
return C((b & c) | ((~b) & d), a, b, x, s, t);
}
function GG(a, b, c, d, x, s, t) {
return C((b & d) | (c & (~d)), a, b, x, s, t);
}
function HH(a, b, c, d, x, s, t) {
return C(b ^ c ^ d, a, b, x, s, t);
}
function II(a, b, c, d, x, s, t) {
return C(c ^ (b | (~d)), a, b, x, s, t);
}
function core(x, len) {
x[len >> 5] |= 128 << ((len) % 32);
x[(((len + 64) >>> 9) << 4) + 14] = len;
var a = 1732584193;
var b = -271733879;
var c = -1732584194;
var d = 271733878;
for (var i = 0; i < x.length; i += 16) {
var olda = a;
var oldb = b;
var oldc = c;
var oldd = d;
a = FF(a, b, c, d, x[i + 0], 7, -680876936);
d = FF(d, a, b, c, x[i + 1], 12, -389564586);
c = FF(c, d, a, b, x[i + 2], 17, 606105819);
b = FF(b, c, d, a, x[i + 3], 22, -1044525330);
a = FF(a, b, c, d, x[i + 4], 7, -176418897);
d = FF(d, a, b, c, x[i + 5], 12, 1200080426);
c = FF(c, d, a, b, x[i + 6], 17, -1473231341);
b = FF(b, c, d, a, x[i + 7], 22, -45705983);
a = FF(a, b, c, d, x[i + 8], 7, 1770035416);
d = FF(d, a, b, c, x[i + 9], 12, -1958414417);
c = FF(c, d, a, b, x[i + 10], 17, -42063);
b = FF(b, c, d, a, x[i + 11], 22, -1990404162);
a = FF(a, b, c, d, x[i + 12], 7, 1804603682);
d = FF(d, a, b, c, x[i + 13], 12, -40341101);
c = FF(c, d, a, b, x[i + 14], 17, -1502002290);
b = FF(b, c, d, a, x[i + 15], 22, 1236535329);
a = GG(a, b, c, d, x[i + 1], 5, -165796510);
d = GG(d, a, b, c, x[i + 6], 9, -1069501632);
c = GG(c, d, a, b, x[i + 11], 14, 643717713);
b = GG(b, c, d, a, x[i + 0], 20, -373897302);
a = GG(a, b, c, d, x[i + 5], 5, -701558691);
d = GG(d, a, b, c, x[i + 10], 9, 38016083);
c = GG(c, d, a, b, x[i + 15], 14, -660478335);
b = GG(b, c, d, a, x[i + 4], 20, -405537848);
a = GG(a, b, c, d, x[i + 9], 5, 568446438);
d = GG(d, a, b, c, x[i + 14], 9, -1019803690);
c = GG(c, d, a, b, x[i + 3], 14, -187363961);
b = GG(b, c, d, a, x[i + 8], 20, 1163531501);
a = GG(a, b, c, d, x[i + 13], 5, -1444681467);
d = GG(d, a, b, c, x[i + 2], 9, -51403784);
c = GG(c, d, a, b, x[i + 7], 14, 1735328473);
b = GG(b, c, d, a, x[i + 12], 20, -1926607734);
a = HH(a, b, c, d, x[i + 5], 4, -378558);
d = HH(d, a, b, c, x[i + 8], 11, -2022574463);
c = HH(c, d, a, b, x[i + 11], 16, 1839030562);
b = HH(b, c, d, a, x[i + 14], 23, -35309556);
a = HH(a, b, c, d, x[i + 1], 4, -1530992060);
d = HH(d, a, b, c, x[i + 4], 11, 1272893353);
c = HH(c, d, a, b, x[i + 7], 16, -155497632);
b = HH(b, c, d, a, x[i + 10], 23, -1094730640);
a = HH(a, b, c, d, x[i + 13], 4, 681279174);
d = HH(d, a, b, c, x[i + 0], 11, -358537222);
c = HH(c, d, a, b, x[i + 3], 16, -722521979);
b = HH(b, c, d, a, x[i + 6], 23, 76029189);
a = HH(a, b, c, d, x[i + 9], 4, -640364487);
d = HH(d, a, b, c, x[i + 12], 11, -421815835);
c = HH(c, d, a, b, x[i + 15], 16, 530742520);
b = HH(b, c, d, a, x[i + 2], 23, -995338651);
a = II(a, b, c, d, x[i + 0], 6, -198630844);
d = II(d, a, b, c, x[i + 7], 10, 1126891415);
c = II(c, d, a, b, x[i + 14], 15, -1416354905);
b = II(b, c, d, a, x[i + 5], 21, -57434055);
a = II(a, b, c, d, x[i + 12], 6, 1700485571);
d = II(d, a, b, c, x[i + 3], 10, -1894986606);
c = II(c, d, a, b, x[i + 10], 15, -1051523);
b = II(b, c, d, a, x[i + 1], 21, -2054922799);
a = II(a, b, c, d, x[i + 8], 6, 1873313359);
d = II(d, a, b, c, x[i + 15], 10, -30611744);
c = II(c, d, a, b, x[i + 6], 15, -1560198380);
b = II(b, c, d, a, x[i + 13], 21, 1309151649);
a = II(a, b, c, d, x[i + 4], 6, -145523070);
d = II(d, a, b, c, x[i + 11], 10, -1120210379);
c = II(c, d, a, b, x[i + 2], 15, 718787259);
b = II(b, c, d, a, x[i + 9], 21, -343485551);
a = add(a, olda);
b = add(b, oldb);
c = add(c, oldc);
d = add(d, oldd);
}
return [a, b, c, d];
}
function hmac(data, key) {
var wa = toWord(key);
if (wa.length > 16) {
wa = core(wa, key.length * chrsz);
}
var l = [], r = [];
for (var i = 0; i < 16; i++) {
l[i] = wa[i] ^ 909522486;
r[i] = wa[i] ^ 1549556828;
}
var h = core(l.concat(toWord(data)), 512 + data.length * chrsz);
return core(r.concat(h), 640);
}
this.compute = function (data, outputType) {
var out = outputType || dojo.crypto.outputTypes.Base64;
switch (out) {
case dojo.crypto.outputTypes.Hex:
return toHex(core(toWord(data), data.length * chrsz));
case dojo.crypto.outputTypes.String:
return toString(core(toWord(data), data.length * chrsz));
default:
return toBase64(core(toWord(data), data.length * chrsz));
}
};
this.getHMAC = function (data, key, outputType) {
var out = outputType || dojo.crypto.outputTypes.Base64;
switch (out) {
case dojo.crypto.outputTypes.Hex:
return toHex(hmac(data, key));
case dojo.crypto.outputTypes.String:
return toString(hmac(data, key));
default:
return toBase64(hmac(data, key));
}
};
}();
 
/tags/Racine_livraison_narmer/api/js/dojo/src/crypto/LICENSE
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/crypto/LICENSE
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/crypto/__package__.js
New file
0,0 → 1,13
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.kwCompoundRequire({common:["dojo.crypto", "dojo.crypto.MD5"]});
dojo.provide("dojo.crypto.*");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/crypto/Rijndael.js
New file
0,0 → 1,21
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.crypto.Rijndael");
dojo.require("dojo.crypto");
dojo.require("dojo.experimental");
dojo.experimental("dojo.crypto.Rijndael");
dojo.crypto.Rijndael = new function () {
this.encrypt = function (plaintext, key) {
};
this.decrypt = function (ciphertext, key) {
};
}();
 
/tags/Racine_livraison_narmer/api/js/dojo/src/crypto/SHA256.js
New file
0,0 → 1,19
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.crypto.SHA256");
dojo.require("dojo.crypto");
dojo.require("dojo.experimental");
dojo.experimental("dojo.crypto.SHA256");
dojo.crypto.SHA256 = new function () {
this.compute = function (s) {
};
}();
 
/tags/Racine_livraison_narmer/api/js/dojo/src/lang/extras.js
New file
0,0 → 1,94
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.lang.extras");
dojo.require("dojo.lang.common");
dojo.lang.setTimeout = function (func, delay) {
var context = window, argsStart = 2;
if (!dojo.lang.isFunction(func)) {
context = func;
func = delay;
delay = arguments[2];
argsStart++;
}
if (dojo.lang.isString(func)) {
func = context[func];
}
var args = [];
for (var i = argsStart; i < arguments.length; i++) {
args.push(arguments[i]);
}
return dojo.global().setTimeout(function () {
func.apply(context, args);
}, delay);
};
dojo.lang.clearTimeout = function (timer) {
dojo.global().clearTimeout(timer);
};
dojo.lang.getNameInObj = function (ns, item) {
if (!ns) {
ns = dj_global;
}
for (var x in ns) {
if (ns[x] === item) {
return new String(x);
}
}
return null;
};
dojo.lang.shallowCopy = function (obj, deep) {
var i, ret;
if (obj === null) {
return null;
}
if (dojo.lang.isObject(obj)) {
ret = new obj.constructor();
for (i in obj) {
if (dojo.lang.isUndefined(ret[i])) {
ret[i] = deep ? dojo.lang.shallowCopy(obj[i], deep) : obj[i];
}
}
} else {
if (dojo.lang.isArray(obj)) {
ret = [];
for (i = 0; i < obj.length; i++) {
ret[i] = deep ? dojo.lang.shallowCopy(obj[i], deep) : obj[i];
}
} else {
ret = obj;
}
}
return ret;
};
dojo.lang.firstValued = function () {
for (var i = 0; i < arguments.length; i++) {
if (typeof arguments[i] != "undefined") {
return arguments[i];
}
}
return undefined;
};
dojo.lang.getObjPathValue = function (objpath, context, create) {
with (dojo.parseObjPath(objpath, context, create)) {
return dojo.evalProp(prop, obj, create);
}
};
dojo.lang.setObjPathValue = function (objpath, value, context, create) {
dojo.deprecated("dojo.lang.setObjPathValue", "use dojo.parseObjPath and the '=' operator", "0.6");
if (arguments.length < 4) {
create = true;
}
with (dojo.parseObjPath(objpath, context, create)) {
if (obj && (create || (prop in obj))) {
obj[prop] = value;
}
}
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/lang/__package__.js
New file
0,0 → 1,13
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.kwCompoundRequire({common:["dojo.lang.common", "dojo.lang.assert", "dojo.lang.array", "dojo.lang.type", "dojo.lang.func", "dojo.lang.extras", "dojo.lang.repr", "dojo.lang.declare"]});
dojo.provide("dojo.lang.*");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/lang/common.js
New file
0,0 → 1,154
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.lang.common");
dojo.lang.inherits = function (subclass, superclass) {
if (!dojo.lang.isFunction(superclass)) {
dojo.raise("dojo.inherits: superclass argument [" + superclass + "] must be a function (subclass: [" + subclass + "']");
}
subclass.prototype = new superclass();
subclass.prototype.constructor = subclass;
subclass.superclass = superclass.prototype;
subclass["super"] = superclass.prototype;
};
dojo.lang._mixin = function (obj, props) {
var tobj = {};
for (var x in props) {
if ((typeof tobj[x] == "undefined") || (tobj[x] != props[x])) {
obj[x] = props[x];
}
}
if (dojo.render.html.ie && (typeof (props["toString"]) == "function") && (props["toString"] != obj["toString"]) && (props["toString"] != tobj["toString"])) {
obj.toString = props.toString;
}
return obj;
};
dojo.lang.mixin = function (obj, props) {
for (var i = 1, l = arguments.length; i < l; i++) {
dojo.lang._mixin(obj, arguments[i]);
}
return obj;
};
dojo.lang.extend = function (constructor, props) {
for (var i = 1, l = arguments.length; i < l; i++) {
dojo.lang._mixin(constructor.prototype, arguments[i]);
}
return constructor;
};
dojo.inherits = dojo.lang.inherits;
dojo.mixin = dojo.lang.mixin;
dojo.extend = dojo.lang.extend;
dojo.lang.find = function (array, value, identity, findLast) {
if (!dojo.lang.isArrayLike(array) && dojo.lang.isArrayLike(value)) {
dojo.deprecated("dojo.lang.find(value, array)", "use dojo.lang.find(array, value) instead", "0.5");
var temp = array;
array = value;
value = temp;
}
var isString = dojo.lang.isString(array);
if (isString) {
array = array.split("");
}
if (findLast) {
var step = -1;
var i = array.length - 1;
var end = -1;
} else {
var step = 1;
var i = 0;
var end = array.length;
}
if (identity) {
while (i != end) {
if (array[i] === value) {
return i;
}
i += step;
}
} else {
while (i != end) {
if (array[i] == value) {
return i;
}
i += step;
}
}
return -1;
};
dojo.lang.indexOf = dojo.lang.find;
dojo.lang.findLast = function (array, value, identity) {
return dojo.lang.find(array, value, identity, true);
};
dojo.lang.lastIndexOf = dojo.lang.findLast;
dojo.lang.inArray = function (array, value) {
return dojo.lang.find(array, value) > -1;
};
dojo.lang.isObject = function (it) {
if (typeof it == "undefined") {
return false;
}
return (typeof it == "object" || it === null || dojo.lang.isArray(it) || dojo.lang.isFunction(it));
};
dojo.lang.isArray = function (it) {
return (it && it instanceof Array || typeof it == "array");
};
dojo.lang.isArrayLike = function (it) {
if ((!it) || (dojo.lang.isUndefined(it))) {
return false;
}
if (dojo.lang.isString(it)) {
return false;
}
if (dojo.lang.isFunction(it)) {
return false;
}
if (dojo.lang.isArray(it)) {
return true;
}
if ((it.tagName) && (it.tagName.toLowerCase() == "form")) {
return false;
}
if (dojo.lang.isNumber(it.length) && isFinite(it.length)) {
return true;
}
return false;
};
dojo.lang.isFunction = function (it) {
return (it instanceof Function || typeof it == "function");
};
(function () {
if ((dojo.render.html.capable) && (dojo.render.html["safari"])) {
dojo.lang.isFunction = function (it) {
if ((typeof (it) == "function") && (it == "[object NodeList]")) {
return false;
}
return (it instanceof Function || typeof it == "function");
};
}
})();
dojo.lang.isString = function (it) {
return (typeof it == "string" || it instanceof String);
};
dojo.lang.isAlien = function (it) {
if (!it) {
return false;
}
return !dojo.lang.isFunction(it) && /\{\s*\[native code\]\s*\}/.test(String(it));
};
dojo.lang.isBoolean = function (it) {
return (it instanceof Boolean || typeof it == "boolean");
};
dojo.lang.isNumber = function (it) {
return (it instanceof Number || typeof it == "number");
};
dojo.lang.isUndefined = function (it) {
return ((typeof (it) == "undefined") && (it == undefined));
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/lang/repr.js
New file
0,0 → 1,66
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.lang.repr");
dojo.require("dojo.lang.common");
dojo.require("dojo.AdapterRegistry");
dojo.require("dojo.string.extras");
dojo.lang.reprRegistry = new dojo.AdapterRegistry();
dojo.lang.registerRepr = function (name, check, wrap, override) {
dojo.lang.reprRegistry.register(name, check, wrap, override);
};
dojo.lang.repr = function (obj) {
if (typeof (obj) == "undefined") {
return "undefined";
} else {
if (obj === null) {
return "null";
}
}
try {
if (typeof (obj["__repr__"]) == "function") {
return obj["__repr__"]();
} else {
if ((typeof (obj["repr"]) == "function") && (obj.repr != arguments.callee)) {
return obj["repr"]();
}
}
return dojo.lang.reprRegistry.match(obj);
}
catch (e) {
if (typeof (obj.NAME) == "string" && (obj.toString == Function.prototype.toString || obj.toString == Object.prototype.toString)) {
return obj.NAME;
}
}
if (typeof (obj) == "function") {
obj = (obj + "").replace(/^\s+/, "");
var idx = obj.indexOf("{");
if (idx != -1) {
obj = obj.substr(0, idx) + "{...}";
}
}
return obj + "";
};
dojo.lang.reprArrayLike = function (arr) {
try {
var na = dojo.lang.map(arr, dojo.lang.repr);
return "[" + na.join(", ") + "]";
}
catch (e) {
}
};
(function () {
var m = dojo.lang;
m.registerRepr("arrayLike", m.isArrayLike, m.reprArrayLike);
m.registerRepr("string", m.isString, m.reprString);
m.registerRepr("numbers", m.isNumber, m.reprNumber);
m.registerRepr("boolean", m.isBoolean, m.reprNumber);
})();
 
/tags/Racine_livraison_narmer/api/js/dojo/src/lang/func.js
New file
0,0 → 1,125
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.lang.func");
dojo.require("dojo.lang.common");
dojo.lang.hitch = function (thisObject, method) {
var fcn = (dojo.lang.isString(method) ? thisObject[method] : method) || function () {
};
return function () {
return fcn.apply(thisObject, arguments);
};
};
dojo.lang.anonCtr = 0;
dojo.lang.anon = {};
dojo.lang.nameAnonFunc = function (anonFuncPtr, thisObj, searchForNames) {
var nso = (thisObj || dojo.lang.anon);
if ((searchForNames) || ((dj_global["djConfig"]) && (djConfig["slowAnonFuncLookups"] == true))) {
for (var x in nso) {
try {
if (nso[x] === anonFuncPtr) {
return x;
}
}
catch (e) {
}
}
}
var ret = "__" + dojo.lang.anonCtr++;
while (typeof nso[ret] != "undefined") {
ret = "__" + dojo.lang.anonCtr++;
}
nso[ret] = anonFuncPtr;
return ret;
};
dojo.lang.forward = function (funcName) {
return function () {
return this[funcName].apply(this, arguments);
};
};
dojo.lang.curry = function (thisObj, func) {
var outerArgs = [];
thisObj = thisObj || dj_global;
if (dojo.lang.isString(func)) {
func = thisObj[func];
}
for (var x = 2; x < arguments.length; x++) {
outerArgs.push(arguments[x]);
}
var ecount = (func["__preJoinArity"] || func.length) - outerArgs.length;
function gather(nextArgs, innerArgs, expected) {
var texpected = expected;
var totalArgs = innerArgs.slice(0);
for (var x = 0; x < nextArgs.length; x++) {
totalArgs.push(nextArgs[x]);
}
expected = expected - nextArgs.length;
if (expected <= 0) {
var res = func.apply(thisObj, totalArgs);
expected = texpected;
return res;
} else {
return function () {
return gather(arguments, totalArgs, expected);
};
}
}
return gather([], outerArgs, ecount);
};
dojo.lang.curryArguments = function (thisObj, func, args, offset) {
var targs = [];
var x = offset || 0;
for (x = offset; x < args.length; x++) {
targs.push(args[x]);
}
return dojo.lang.curry.apply(dojo.lang, [thisObj, func].concat(targs));
};
dojo.lang.tryThese = function () {
for (var x = 0; x < arguments.length; x++) {
try {
if (typeof arguments[x] == "function") {
var ret = (arguments[x]());
if (ret) {
return ret;
}
}
}
catch (e) {
dojo.debug(e);
}
}
};
dojo.lang.delayThese = function (farr, cb, delay, onend) {
if (!farr.length) {
if (typeof onend == "function") {
onend();
}
return;
}
if ((typeof delay == "undefined") && (typeof cb == "number")) {
delay = cb;
cb = function () {
};
} else {
if (!cb) {
cb = function () {
};
if (!delay) {
delay = 0;
}
}
}
setTimeout(function () {
(farr.shift())();
cb();
dojo.lang.delayThese(farr, cb, delay, onend);
}, delay);
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/lang/timing/Timer.js
New file
0,0 → 1,42
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.lang.timing.Timer");
dojo.require("dojo.lang.func");
dojo.lang.timing.Timer = function (interval) {
this.timer = null;
this.isRunning = false;
this.interval = interval;
this.onStart = null;
this.onStop = null;
};
dojo.extend(dojo.lang.timing.Timer, {onTick:function () {
}, setInterval:function (interval) {
if (this.isRunning) {
dj_global.clearInterval(this.timer);
}
this.interval = interval;
if (this.isRunning) {
this.timer = dj_global.setInterval(dojo.lang.hitch(this, "onTick"), this.interval);
}
}, start:function () {
if (typeof this.onStart == "function") {
this.onStart();
}
this.isRunning = true;
this.timer = dj_global.setInterval(dojo.lang.hitch(this, "onTick"), this.interval);
}, stop:function () {
if (typeof this.onStop == "function") {
this.onStop();
}
this.isRunning = false;
dj_global.clearInterval(this.timer);
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/lang/timing/Streamer.js
New file
0,0 → 1,65
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.lang.timing.Streamer");
dojo.require("dojo.lang.timing.Timer");
dojo.lang.timing.Streamer = function (input, output, interval, minimum, initialData) {
var self = this;
var queue = [];
this.interval = interval || 1000;
this.minimumSize = minimum || 10;
this.inputFunction = input || function (q) {
};
this.outputFunction = output || function (point) {
};
var timer = new dojo.lang.timing.Timer(this.interval);
var tick = function () {
self.onTick(self);
if (queue.length < self.minimumSize) {
self.inputFunction(queue);
}
var obj = queue.shift();
while (typeof (obj) == "undefined" && queue.length > 0) {
obj = queue.shift();
}
if (typeof (obj) == "undefined") {
self.stop();
return;
}
self.outputFunction(obj);
};
this.setInterval = function (ms) {
this.interval = ms;
timer.setInterval(ms);
};
this.onTick = function (obj) {
};
this.start = function () {
if (typeof (this.inputFunction) == "function" && typeof (this.outputFunction) == "function") {
timer.start();
return;
}
dojo.raise("You cannot start a Streamer without an input and an output function.");
};
this.onStart = function () {
};
this.stop = function () {
timer.stop();
};
this.onStop = function () {
};
timer.onTick = this.tick;
timer.onStart = this.onStart;
timer.onStop = this.onStop;
if (initialData) {
queue.concat(initialData);
}
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/lang/timing/__package__.js
New file
0,0 → 1,12
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.lang.timing.*");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/lang/array.js
New file
0,0 → 1,174
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.lang.array");
dojo.require("dojo.lang.common");
dojo.lang.mixin(dojo.lang, {has:function (obj, name) {
try {
return typeof obj[name] != "undefined";
}
catch (e) {
return false;
}
}, isEmpty:function (obj) {
if (dojo.lang.isObject(obj)) {
var tmp = {};
var count = 0;
for (var x in obj) {
if (obj[x] && (!tmp[x])) {
count++;
break;
}
}
return count == 0;
} else {
if (dojo.lang.isArrayLike(obj) || dojo.lang.isString(obj)) {
return obj.length == 0;
}
}
}, map:function (arr, obj, unary_func) {
var isString = dojo.lang.isString(arr);
if (isString) {
arr = arr.split("");
}
if (dojo.lang.isFunction(obj) && (!unary_func)) {
unary_func = obj;
obj = dj_global;
} else {
if (dojo.lang.isFunction(obj) && unary_func) {
var tmpObj = obj;
obj = unary_func;
unary_func = tmpObj;
}
}
if (Array.map) {
var outArr = Array.map(arr, unary_func, obj);
} else {
var outArr = [];
for (var i = 0; i < arr.length; ++i) {
outArr.push(unary_func.call(obj, arr[i]));
}
}
if (isString) {
return outArr.join("");
} else {
return outArr;
}
}, reduce:function (arr, initialValue, obj, binary_func) {
var reducedValue = initialValue;
if (arguments.length == 2) {
binary_func = initialValue;
reducedValue = arr[0];
arr = arr.slice(1);
} else {
if (arguments.length == 3) {
if (dojo.lang.isFunction(obj)) {
binary_func = obj;
obj = null;
}
} else {
if (dojo.lang.isFunction(obj)) {
var tmp = binary_func;
binary_func = obj;
obj = tmp;
}
}
}
var ob = obj || dj_global;
dojo.lang.map(arr, function (val) {
reducedValue = binary_func.call(ob, reducedValue, val);
});
return reducedValue;
}, forEach:function (anArray, callback, thisObject) {
if (dojo.lang.isString(anArray)) {
anArray = anArray.split("");
}
if (Array.forEach) {
Array.forEach(anArray, callback, thisObject);
} else {
if (!thisObject) {
thisObject = dj_global;
}
for (var i = 0, l = anArray.length; i < l; i++) {
callback.call(thisObject, anArray[i], i, anArray);
}
}
}, _everyOrSome:function (every, arr, callback, thisObject) {
if (dojo.lang.isString(arr)) {
arr = arr.split("");
}
if (Array.every) {
return Array[every ? "every" : "some"](arr, callback, thisObject);
} else {
if (!thisObject) {
thisObject = dj_global;
}
for (var i = 0, l = arr.length; i < l; i++) {
var result = callback.call(thisObject, arr[i], i, arr);
if (every && !result) {
return false;
} else {
if ((!every) && (result)) {
return true;
}
}
}
return Boolean(every);
}
}, every:function (arr, callback, thisObject) {
return this._everyOrSome(true, arr, callback, thisObject);
}, some:function (arr, callback, thisObject) {
return this._everyOrSome(false, arr, callback, thisObject);
}, filter:function (arr, callback, thisObject) {
var isString = dojo.lang.isString(arr);
if (isString) {
arr = arr.split("");
}
var outArr;
if (Array.filter) {
outArr = Array.filter(arr, callback, thisObject);
} else {
if (!thisObject) {
if (arguments.length >= 3) {
dojo.raise("thisObject doesn't exist!");
}
thisObject = dj_global;
}
outArr = [];
for (var i = 0; i < arr.length; i++) {
if (callback.call(thisObject, arr[i], i, arr)) {
outArr.push(arr[i]);
}
}
}
if (isString) {
return outArr.join("");
} else {
return outArr;
}
}, unnest:function () {
var out = [];
for (var i = 0; i < arguments.length; i++) {
if (dojo.lang.isArrayLike(arguments[i])) {
var add = dojo.lang.unnest.apply(this, arguments[i]);
out = out.concat(add);
} else {
out.push(arguments[i]);
}
}
return out;
}, toArray:function (arrayLike, startOffset) {
var array = [];
for (var i = startOffset || 0; i < arrayLike.length; i++) {
array.push(arrayLike[i]);
}
return array;
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/lang/declare.js
New file
0,0 → 1,107
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.lang.declare");
dojo.require("dojo.lang.common");
dojo.require("dojo.lang.extras");
dojo.lang.declare = function (className, superclass, init, props) {
if ((dojo.lang.isFunction(props)) || ((!props) && (!dojo.lang.isFunction(init)))) {
var temp = props;
props = init;
init = temp;
}
var mixins = [];
if (dojo.lang.isArray(superclass)) {
mixins = superclass;
superclass = mixins.shift();
}
if (!init) {
init = dojo.evalObjPath(className, false);
if ((init) && (!dojo.lang.isFunction(init))) {
init = null;
}
}
var ctor = dojo.lang.declare._makeConstructor();
var scp = (superclass ? superclass.prototype : null);
if (scp) {
scp.prototyping = true;
ctor.prototype = new superclass();
scp.prototyping = false;
}
ctor.superclass = scp;
ctor.mixins = mixins;
for (var i = 0, l = mixins.length; i < l; i++) {
dojo.lang.extend(ctor, mixins[i].prototype);
}
ctor.prototype.initializer = null;
ctor.prototype.declaredClass = className;
if (dojo.lang.isArray(props)) {
dojo.lang.extend.apply(dojo.lang, [ctor].concat(props));
} else {
dojo.lang.extend(ctor, (props) || {});
}
dojo.lang.extend(ctor, dojo.lang.declare._common);
ctor.prototype.constructor = ctor;
ctor.prototype.initializer = (ctor.prototype.initializer) || (init) || (function () {
});
var created = dojo.parseObjPath(className, null, true);
created.obj[created.prop] = ctor;
return ctor;
};
dojo.lang.declare._makeConstructor = function () {
return function () {
var self = this._getPropContext();
var s = self.constructor.superclass;
if ((s) && (s.constructor)) {
if (s.constructor == arguments.callee) {
this._inherited("constructor", arguments);
} else {
this._contextMethod(s, "constructor", arguments);
}
}
var ms = (self.constructor.mixins) || ([]);
for (var i = 0, m; (m = ms[i]); i++) {
(((m.prototype) && (m.prototype.initializer)) || (m)).apply(this, arguments);
}
if ((!this.prototyping) && (self.initializer)) {
self.initializer.apply(this, arguments);
}
};
};
dojo.lang.declare._common = {_getPropContext:function () {
return (this.___proto || this);
}, _contextMethod:function (ptype, method, args) {
var result, stack = this.___proto;
this.___proto = ptype;
try {
result = ptype[method].apply(this, (args || []));
}
catch (e) {
throw e;
}
finally {
this.___proto = stack;
}
return result;
}, _inherited:function (prop, args) {
var p = this._getPropContext();
do {
if ((!p.constructor) || (!p.constructor.superclass)) {
return;
}
p = p.constructor.superclass;
} while (!(prop in p));
return (dojo.lang.isFunction(p[prop]) ? this._contextMethod(p, prop, args) : p[prop]);
}, inherited:function (prop, args) {
dojo.deprecated("'inherited' method is dangerous, do not up-call! 'inherited' is slated for removal in 0.5; name your super class (or use superclass property) instead.", "0.5");
this._inherited(prop, args);
}};
dojo.declare = dojo.lang.declare;
 
/tags/Racine_livraison_narmer/api/js/dojo/src/lang/assert.js
New file
0,0 → 1,57
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.lang.assert");
dojo.require("dojo.lang.common");
dojo.require("dojo.lang.array");
dojo.require("dojo.lang.type");
dojo.lang.assert = function (booleanValue, message) {
if (!booleanValue) {
var errorMessage = "An assert statement failed.\n" + "The method dojo.lang.assert() was called with a 'false' value.\n";
if (message) {
errorMessage += "Here's the assert message:\n" + message + "\n";
}
throw new Error(errorMessage);
}
};
dojo.lang.assertType = function (value, type, keywordParameters) {
if (dojo.lang.isString(keywordParameters)) {
dojo.deprecated("dojo.lang.assertType(value, type, \"message\")", "use dojo.lang.assertType(value, type) instead", "0.5");
}
if (!dojo.lang.isOfType(value, type, keywordParameters)) {
if (!dojo.lang.assertType._errorMessage) {
dojo.lang.assertType._errorMessage = "Type mismatch: dojo.lang.assertType() failed.";
}
dojo.lang.assert(false, dojo.lang.assertType._errorMessage);
}
};
dojo.lang.assertValidKeywords = function (object, expectedProperties, message) {
var key;
if (!message) {
if (!dojo.lang.assertValidKeywords._errorMessage) {
dojo.lang.assertValidKeywords._errorMessage = "In dojo.lang.assertValidKeywords(), found invalid keyword:";
}
message = dojo.lang.assertValidKeywords._errorMessage;
}
if (dojo.lang.isArray(expectedProperties)) {
for (key in object) {
if (!dojo.lang.inArray(expectedProperties, key)) {
dojo.lang.assert(false, message + " " + key);
}
}
} else {
for (key in object) {
if (!(key in expectedProperties)) {
dojo.lang.assert(false, message + " " + key);
}
}
}
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/lang/type.js
New file
0,0 → 1,143
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.lang.type");
dojo.require("dojo.lang.common");
dojo.lang.whatAmI = function (value) {
dojo.deprecated("dojo.lang.whatAmI", "use dojo.lang.getType instead", "0.5");
return dojo.lang.getType(value);
};
dojo.lang.whatAmI.custom = {};
dojo.lang.getType = function (value) {
try {
if (dojo.lang.isArray(value)) {
return "array";
}
if (dojo.lang.isFunction(value)) {
return "function";
}
if (dojo.lang.isString(value)) {
return "string";
}
if (dojo.lang.isNumber(value)) {
return "number";
}
if (dojo.lang.isBoolean(value)) {
return "boolean";
}
if (dojo.lang.isAlien(value)) {
return "alien";
}
if (dojo.lang.isUndefined(value)) {
return "undefined";
}
for (var name in dojo.lang.whatAmI.custom) {
if (dojo.lang.whatAmI.custom[name](value)) {
return name;
}
}
if (dojo.lang.isObject(value)) {
return "object";
}
}
catch (e) {
}
return "unknown";
};
dojo.lang.isNumeric = function (value) {
return (!isNaN(value) && isFinite(value) && (value != null) && !dojo.lang.isBoolean(value) && !dojo.lang.isArray(value) && !/^\s*$/.test(value));
};
dojo.lang.isBuiltIn = function (value) {
return (dojo.lang.isArray(value) || dojo.lang.isFunction(value) || dojo.lang.isString(value) || dojo.lang.isNumber(value) || dojo.lang.isBoolean(value) || (value == null) || (value instanceof Error) || (typeof value == "error"));
};
dojo.lang.isPureObject = function (value) {
return ((value != null) && dojo.lang.isObject(value) && value.constructor == Object);
};
dojo.lang.isOfType = function (value, type, keywordParameters) {
var optional = false;
if (keywordParameters) {
optional = keywordParameters["optional"];
}
if (optional && ((value === null) || dojo.lang.isUndefined(value))) {
return true;
}
if (dojo.lang.isArray(type)) {
var arrayOfTypes = type;
for (var i in arrayOfTypes) {
var aType = arrayOfTypes[i];
if (dojo.lang.isOfType(value, aType)) {
return true;
}
}
return false;
} else {
if (dojo.lang.isString(type)) {
type = type.toLowerCase();
}
switch (type) {
case Array:
case "array":
return dojo.lang.isArray(value);
case Function:
case "function":
return dojo.lang.isFunction(value);
case String:
case "string":
return dojo.lang.isString(value);
case Number:
case "number":
return dojo.lang.isNumber(value);
case "numeric":
return dojo.lang.isNumeric(value);
case Boolean:
case "boolean":
return dojo.lang.isBoolean(value);
case Object:
case "object":
return dojo.lang.isObject(value);
case "pureobject":
return dojo.lang.isPureObject(value);
case "builtin":
return dojo.lang.isBuiltIn(value);
case "alien":
return dojo.lang.isAlien(value);
case "undefined":
return dojo.lang.isUndefined(value);
case null:
case "null":
return (value === null);
case "optional":
dojo.deprecated("dojo.lang.isOfType(value, [type, \"optional\"])", "use dojo.lang.isOfType(value, type, {optional: true} ) instead", "0.5");
return ((value === null) || dojo.lang.isUndefined(value));
default:
if (dojo.lang.isFunction(type)) {
return (value instanceof type);
} else {
dojo.raise("dojo.lang.isOfType() was passed an invalid type");
}
}
}
dojo.raise("If we get here, it means a bug was introduced above.");
};
dojo.lang.getObject = function (str) {
var parts = str.split("."), i = 0, obj = dj_global;
do {
obj = obj[parts[i++]];
} while (i < parts.length && obj);
return (obj != dj_global) ? obj : null;
};
dojo.lang.doesObjectExist = function (str) {
var parts = str.split("."), i = 0, obj = dj_global;
do {
obj = obj[parts[i++]];
} while (i < parts.length && obj);
return (obj && obj != dj_global);
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/io.js
New file
0,0 → 1,14
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.io");
dojo.require("dojo.io.*");
dojo.deprecated("dojo.io", "replaced by dojo.io.*", "0.5");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/lfx/Animation.js
New file
0,0 → 1,402
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.lfx.Animation");
dojo.require("dojo.lang.func");
dojo.lfx.Line = function (start, end) {
this.start = start;
this.end = end;
if (dojo.lang.isArray(start)) {
var diff = [];
dojo.lang.forEach(this.start, function (s, i) {
diff[i] = this.end[i] - s;
}, this);
this.getValue = function (n) {
var res = [];
dojo.lang.forEach(this.start, function (s, i) {
res[i] = (diff[i] * n) + s;
}, this);
return res;
};
} else {
var diff = end - start;
this.getValue = function (n) {
return (diff * n) + this.start;
};
}
};
if ((dojo.render.html.khtml) && (!dojo.render.html.safari)) {
dojo.lfx.easeDefault = function (n) {
return (parseFloat("0.5") + ((Math.sin((n + parseFloat("1.5")) * Math.PI)) / 2));
};
} else {
dojo.lfx.easeDefault = function (n) {
return (0.5 + ((Math.sin((n + 1.5) * Math.PI)) / 2));
};
}
dojo.lfx.easeIn = function (n) {
return Math.pow(n, 3);
};
dojo.lfx.easeOut = function (n) {
return (1 - Math.pow(1 - n, 3));
};
dojo.lfx.easeInOut = function (n) {
return ((3 * Math.pow(n, 2)) - (2 * Math.pow(n, 3)));
};
dojo.lfx.IAnimation = function () {
};
dojo.lang.extend(dojo.lfx.IAnimation, {curve:null, duration:1000, easing:null, repeatCount:0, rate:10, handler:null, beforeBegin:null, onBegin:null, onAnimate:null, onEnd:null, onPlay:null, onPause:null, onStop:null, play:null, pause:null, stop:null, connect:function (evt, scope, newFunc) {
if (!newFunc) {
newFunc = scope;
scope = this;
}
newFunc = dojo.lang.hitch(scope, newFunc);
var oldFunc = this[evt] || function () {
};
this[evt] = function () {
var ret = oldFunc.apply(this, arguments);
newFunc.apply(this, arguments);
return ret;
};
return this;
}, fire:function (evt, args) {
if (this[evt]) {
this[evt].apply(this, (args || []));
}
return this;
}, repeat:function (count) {
this.repeatCount = count;
return this;
}, _active:false, _paused:false});
dojo.lfx.Animation = function (handlers, duration, curve, easing, repeatCount, rate) {
dojo.lfx.IAnimation.call(this);
if (dojo.lang.isNumber(handlers) || (!handlers && duration.getValue)) {
rate = repeatCount;
repeatCount = easing;
easing = curve;
curve = duration;
duration = handlers;
handlers = null;
} else {
if (handlers.getValue || dojo.lang.isArray(handlers)) {
rate = easing;
repeatCount = curve;
easing = duration;
curve = handlers;
duration = null;
handlers = null;
}
}
if (dojo.lang.isArray(curve)) {
this.curve = new dojo.lfx.Line(curve[0], curve[1]);
} else {
this.curve = curve;
}
if (duration != null && duration > 0) {
this.duration = duration;
}
if (repeatCount) {
this.repeatCount = repeatCount;
}
if (rate) {
this.rate = rate;
}
if (handlers) {
dojo.lang.forEach(["handler", "beforeBegin", "onBegin", "onEnd", "onPlay", "onStop", "onAnimate"], function (item) {
if (handlers[item]) {
this.connect(item, handlers[item]);
}
}, this);
}
if (easing && dojo.lang.isFunction(easing)) {
this.easing = easing;
}
};
dojo.inherits(dojo.lfx.Animation, dojo.lfx.IAnimation);
dojo.lang.extend(dojo.lfx.Animation, {_startTime:null, _endTime:null, _timer:null, _percent:0, _startRepeatCount:0, play:function (delay, gotoStart) {
if (gotoStart) {
clearTimeout(this._timer);
this._active = false;
this._paused = false;
this._percent = 0;
} else {
if (this._active && !this._paused) {
return this;
}
}
this.fire("handler", ["beforeBegin"]);
this.fire("beforeBegin");
if (delay > 0) {
setTimeout(dojo.lang.hitch(this, function () {
this.play(null, gotoStart);
}), delay);
return this;
}
this._startTime = new Date().valueOf();
if (this._paused) {
this._startTime -= (this.duration * this._percent / 100);
}
this._endTime = this._startTime + this.duration;
this._active = true;
this._paused = false;
var step = this._percent / 100;
var value = this.curve.getValue(step);
if (this._percent == 0) {
if (!this._startRepeatCount) {
this._startRepeatCount = this.repeatCount;
}
this.fire("handler", ["begin", value]);
this.fire("onBegin", [value]);
}
this.fire("handler", ["play", value]);
this.fire("onPlay", [value]);
this._cycle();
return this;
}, pause:function () {
clearTimeout(this._timer);
if (!this._active) {
return this;
}
this._paused = true;
var value = this.curve.getValue(this._percent / 100);
this.fire("handler", ["pause", value]);
this.fire("onPause", [value]);
return this;
}, gotoPercent:function (pct, andPlay) {
clearTimeout(this._timer);
this._active = true;
this._paused = true;
this._percent = pct;
if (andPlay) {
this.play();
}
return this;
}, stop:function (gotoEnd) {
clearTimeout(this._timer);
var step = this._percent / 100;
if (gotoEnd) {
step = 1;
}
var value = this.curve.getValue(step);
this.fire("handler", ["stop", value]);
this.fire("onStop", [value]);
this._active = false;
this._paused = false;
return this;
}, status:function () {
if (this._active) {
return this._paused ? "paused" : "playing";
} else {
return "stopped";
}
return this;
}, _cycle:function () {
clearTimeout(this._timer);
if (this._active) {
var curr = new Date().valueOf();
var step = (curr - this._startTime) / (this._endTime - this._startTime);
if (step >= 1) {
step = 1;
this._percent = 100;
} else {
this._percent = step * 100;
}
if ((this.easing) && (dojo.lang.isFunction(this.easing))) {
step = this.easing(step);
}
var value = this.curve.getValue(step);
this.fire("handler", ["animate", value]);
this.fire("onAnimate", [value]);
if (step < 1) {
this._timer = setTimeout(dojo.lang.hitch(this, "_cycle"), this.rate);
} else {
this._active = false;
this.fire("handler", ["end"]);
this.fire("onEnd");
if (this.repeatCount > 0) {
this.repeatCount--;
this.play(null, true);
} else {
if (this.repeatCount == -1) {
this.play(null, true);
} else {
if (this._startRepeatCount) {
this.repeatCount = this._startRepeatCount;
this._startRepeatCount = 0;
}
}
}
}
}
return this;
}});
dojo.lfx.Combine = function (animations) {
dojo.lfx.IAnimation.call(this);
this._anims = [];
this._animsEnded = 0;
var anims = arguments;
if (anims.length == 1 && (dojo.lang.isArray(anims[0]) || dojo.lang.isArrayLike(anims[0]))) {
anims = anims[0];
}
dojo.lang.forEach(anims, function (anim) {
this._anims.push(anim);
anim.connect("onEnd", dojo.lang.hitch(this, "_onAnimsEnded"));
}, this);
};
dojo.inherits(dojo.lfx.Combine, dojo.lfx.IAnimation);
dojo.lang.extend(dojo.lfx.Combine, {_animsEnded:0, play:function (delay, gotoStart) {
if (!this._anims.length) {
return this;
}
this.fire("beforeBegin");
if (delay > 0) {
setTimeout(dojo.lang.hitch(this, function () {
this.play(null, gotoStart);
}), delay);
return this;
}
if (gotoStart || this._anims[0].percent == 0) {
this.fire("onBegin");
}
this.fire("onPlay");
this._animsCall("play", null, gotoStart);
return this;
}, pause:function () {
this.fire("onPause");
this._animsCall("pause");
return this;
}, stop:function (gotoEnd) {
this.fire("onStop");
this._animsCall("stop", gotoEnd);
return this;
}, _onAnimsEnded:function () {
this._animsEnded++;
if (this._animsEnded >= this._anims.length) {
this.fire("onEnd");
}
return this;
}, _animsCall:function (funcName) {
var args = [];
if (arguments.length > 1) {
for (var i = 1; i < arguments.length; i++) {
args.push(arguments[i]);
}
}
var _this = this;
dojo.lang.forEach(this._anims, function (anim) {
anim[funcName](args);
}, _this);
return this;
}});
dojo.lfx.Chain = function (animations) {
dojo.lfx.IAnimation.call(this);
this._anims = [];
this._currAnim = -1;
var anims = arguments;
if (anims.length == 1 && (dojo.lang.isArray(anims[0]) || dojo.lang.isArrayLike(anims[0]))) {
anims = anims[0];
}
var _this = this;
dojo.lang.forEach(anims, function (anim, i, anims_arr) {
this._anims.push(anim);
if (i < anims_arr.length - 1) {
anim.connect("onEnd", dojo.lang.hitch(this, "_playNext"));
} else {
anim.connect("onEnd", dojo.lang.hitch(this, function () {
this.fire("onEnd");
}));
}
}, this);
};
dojo.inherits(dojo.lfx.Chain, dojo.lfx.IAnimation);
dojo.lang.extend(dojo.lfx.Chain, {_currAnim:-1, play:function (delay, gotoStart) {
if (!this._anims.length) {
return this;
}
if (gotoStart || !this._anims[this._currAnim]) {
this._currAnim = 0;
}
var currentAnimation = this._anims[this._currAnim];
this.fire("beforeBegin");
if (delay > 0) {
setTimeout(dojo.lang.hitch(this, function () {
this.play(null, gotoStart);
}), delay);
return this;
}
if (currentAnimation) {
if (this._currAnim == 0) {
this.fire("handler", ["begin", this._currAnim]);
this.fire("onBegin", [this._currAnim]);
}
this.fire("onPlay", [this._currAnim]);
currentAnimation.play(null, gotoStart);
}
return this;
}, pause:function () {
if (this._anims[this._currAnim]) {
this._anims[this._currAnim].pause();
this.fire("onPause", [this._currAnim]);
}
return this;
}, playPause:function () {
if (this._anims.length == 0) {
return this;
}
if (this._currAnim == -1) {
this._currAnim = 0;
}
var currAnim = this._anims[this._currAnim];
if (currAnim) {
if (!currAnim._active || currAnim._paused) {
this.play();
} else {
this.pause();
}
}
return this;
}, stop:function () {
var currAnim = this._anims[this._currAnim];
if (currAnim) {
currAnim.stop();
this.fire("onStop", [this._currAnim]);
}
return currAnim;
}, _playNext:function () {
if (this._currAnim == -1 || this._anims.length == 0) {
return this;
}
this._currAnim++;
if (this._anims[this._currAnim]) {
this._anims[this._currAnim].play(null, true);
}
return this;
}});
dojo.lfx.combine = function (animations) {
var anims = arguments;
if (dojo.lang.isArray(arguments[0])) {
anims = arguments[0];
}
if (anims.length == 1) {
return anims[0];
}
return new dojo.lfx.Combine(anims);
};
dojo.lfx.chain = function (animations) {
var anims = arguments;
if (dojo.lang.isArray(arguments[0])) {
anims = arguments[0];
}
if (anims.length == 1) {
return anims[0];
}
return new dojo.lfx.Chain(anims);
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/lfx/rounded.js
New file
0,0 → 1,442
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.lfx.rounded");
dojo.require("dojo.lang.common");
dojo.require("dojo.html.common");
dojo.require("dojo.html.style");
dojo.require("dojo.html.display");
dojo.require("dojo.html.layout");
dojo.lfx.rounded = function (settings) {
var options = {validTags:settings.validTags || ["div"], autoPad:settings.autoPad != null ? settings.autoPad : true, antiAlias:settings.antiAlias != null ? settings.antiAlias : true, radii:{tl:(settings.tl && settings.tl.radius != null) ? settings.tl.radius : 5, tr:(settings.tr && settings.tr.radius != null) ? settings.tr.radius : 5, bl:(settings.bl && settings.bl.radius != null) ? settings.bl.radius : 5, br:(settings.br && settings.br.radius != null) ? settings.br.radius : 5}};
var nodes;
if (typeof (arguments[1]) == "string") {
nodes = dojo.html.getElementsByClass(arguments[1]);
} else {
if (dojo.lang.isArrayLike(arguments[1])) {
nodes = arguments[1];
for (var i = 0; i < nodes.length; i++) {
nodes[i] = dojo.byId(nodes[i]);
}
}
}
if (nodes.length == 0) {
return;
}
for (var i = 0; i < nodes.length; i++) {
dojo.lfx.rounded.applyCorners(options, nodes[i]);
}
};
dojo.lfx.rounded.applyCorners = function (options, node) {
var top = null;
var bottom = null;
var contentNode = null;
var fns = dojo.lfx.rounded._fns;
var width = node.offsetWidth;
var height = node.offsetHeight;
var borderWidth = parseInt(dojo.html.getComputedStyle(node, "border-top-width"));
var borderColor = dojo.html.getComputedStyle(node, "border-top-color");
var color = dojo.html.getComputedStyle(node, "background-color");
var bgImage = dojo.html.getComputedStyle(node, "background-image");
var position = dojo.html.getComputedStyle(node, "position");
var padding = parseInt(dojo.html.getComputedStyle(node, "padding-top"));
var format = {height:height, width:width, borderWidth:borderWidth, color:fns.getRGB(color), padding:padding, borderColor:fns.getRGB(borderColor), borderString:borderWidth + "px" + " solid " + fns.getRGB(borderColor), bgImage:((bgImage != "none") ? bgImage : ""), content:node.innerHTML};
if (!dojo.html.isPositionAbsolute(node)) {
node.style.position = "relative";
}
node.style.padding = "0px";
if (dojo.render.html.ie && width == "auto" && height == "auto") {
node.style.width = "100%";
}
if (options.autoPad && format.padding > 0) {
node.innerHTML = "";
}
var topHeight = Math.max(options.radii.tl, options.radii.tr);
var bottomHeight = Math.max(options.radii.bl, options.radii.br);
if (options.radii.tl || options.radii.tr) {
top = document.createElement("div");
top.style.width = "100%";
top.style.fontSize = "1px";
top.style.overflow = "hidden";
top.style.position = "absolute";
top.style.paddingLeft = format.borderWidth + "px";
top.style.paddingRight = format.borderWidth + "px";
top.style.height = topHeight + "px";
top.style.top = (0 - topHeight) + "px";
top.style.left = (0 - format.borderWidth) + "px";
node.appendChild(top);
}
if (options.radii.bl || options.radii.br) {
bottom = document.createElement("div");
bottom.style.width = "100%";
bottom.style.fontSize = "1px";
bottom.style.overflow = "hidden";
bottom.style.position = "absolute";
bottom.style.paddingLeft = format.borderWidth + "px";
bottom.style.paddingRight = format.borderWidth + "px";
bottom.style.height = bottomHeight + "px";
bottom.style.bottom = (0 - bottomHeight) + "px";
bottom.style.left = (0 - format.borderWidth) + "px";
node.appendChild(bottom);
}
if (top) {
node.style.borderTopWidth = "0px";
}
if (bottom) {
node.style.borderBottomWidth = "0px";
}
var corners = ["tr", "tl", "br", "bl"];
for (var i = 0; i < corners.length; i++) {
var cc = corners[i];
if (options.radii[cc] == 0) {
if ((cc.charAt(0) == "t" && top) || (cc.charAt(0) == "b" && bottom)) {
var corner = document.createElement("div");
corner.style.position = "relative";
corner.style.fontSize = "1px;";
corner.style.overflow = "hidden";
if (format.bgImage == "") {
corner.style.backgroundColor = format.color;
} else {
corner.style.backgroundImage = format.bgImage;
}
switch (cc) {
case "tl":
corner.style.height = topHeight - format.borderWidth + "px";
corner.style.marginRight = options.radii[cc] - (format.borderWidth * 2) + "px";
corner.style.borderLeft = format.borderString;
corner.style.borderTop = format.borderString;
corner.style.left = -format.borderWidth + "px";
break;
case "tr":
corner.style.height = topHeight - format.borderWidth + "px";
corner.style.marginLeft = options.radii[cc] - (format.borderWidth * 2) + "px";
corner.style.borderRight = format.borderString;
corner.style.borderTop = format.borderString;
corner.style.backgroundPosition = "-" + (topHeight - format.borderWidth) + "px 0px";
corner.style.left = format.borderWidth + "px";
break;
case "bl":
corner.style.height = bottomHeight - format.borderWidth + "px";
corner.style.marginRight = options.radii[cc] - (format.borderWidth * 2) + "px";
corner.style.borderLeft = format.borderString;
corner.style.borderBottom = format.borderString;
corner.style.left = format.borderWidth + "px";
corner.style.backgroundPosition = "-" + format.borderWidth + "px -" + (format.height + (bottomHeight + format.borderWidth)) + "px";
break;
case "br":
corner.style.height = bottomHeight - format.borderWidth + "px";
corner.style.marginLeft = options.radii[cc] - (format.borderWidth * 2) + "px";
corner.style.borderRight = format.borderString;
corner.style.borderBottom = format.borderString;
corner.style.left = format.borderWidth + "px";
corner.style.backgroundPosition = "-" + (bottomHeight + format.borderWidth) + "px -" + (format.height + (bottomHeight + format.borderWidth)) + "px";
break;
}
}
} else {
var corner = document.createElement("div");
corner.style.height = options.radii[cc] + "px";
corner.style.width = options.radii[cc] + "px";
corner.style.position = "absolute";
corner.style.fontSize = "1px";
corner.style.overflow = "hidden";
var borderRadius = Math.floor(options.radii[cc] - format.borderWidth);
for (var x = 0, j = options.radii[cc]; x < j; x++) {
var y1 = Math.floor(Math.sqrt(Math.pow(borderRadius, 2) - Math.pow((x + 1), 2))) - 1;
if ((x + 1) >= borderRadius) {
var y1 = -1;
}
var y2 = Math.ceil(Math.sqrt(Math.pow(borderRadius, 2) - Math.pow(x, 2)));
if (x >= borderRadius) {
y2 = -1;
}
var y3 = Math.floor(Math.sqrt(Math.pow(j, 2) - Math.pow((x + 1), 2))) - 1;
if ((x + 1) >= j) {
y3 = -1;
}
var y4 = Math.ceil(Math.sqrt(Math.pow(j, 2) - Math.pow(x, 2)));
if (x >= j) {
y4 = -1;
}
if (y1 > -1) {
fns.draw(x, 0, format.color, 100, (y1 + 1), corner, -1, j, topHeight, format);
}
for (var y = (y1 + 1); y < y2; y++) {
if (options.antiAlias) {
if (format.bgImage != "") {
var fract = fns.fraction(x, y, borderRadius) * 100;
if (fract < 30) {
fns.draw(x, y, format.borderColor, 100, 1, corner, 0, options.radii[cc], topHeight, format);
} else {
fns.draw(x, y, format.borderColor, 100, 1, corner, -1, options.radii[cc], topHeight, format);
}
} else {
var clr = fns.blend(format.color, format.borderColor, fns.fraction(x, y, borderRadius));
fns.draw(x, y, clr, 100, 1, corner, 0, options.radii[cc], topHeight, format);
}
}
}
if (options.antiAlias) {
if (y3 >= y2) {
if (y2 == -1) {
y2 = 0;
}
fns.draw(x, y2, format.borderColor, 100, (y3 - y2 + 1), corner, 0, 0, topHeight, format);
} else {
if (y3 >= y1) {
fns.draw(x, (y1 + 1), format.borderColor, 100, (y3 - y1), corner, 0, 0, topHeight, format);
}
}
for (var y = (y3 + 1); y < y4; y++) {
fns.draw(x, y, format.borderColor, (fns.fraction(x, y, j) * 100), 1, corner, (format.borderWidth > 0 ? 0 : -1), options.radii[cc], topHeight, format);
}
} else {
y3 = y1;
}
}
if (cc != "br") {
for (var t = 0, k = corner.childNodes.length; t < k; t++) {
var bar = corner.childNodes[t];
var barTop = parseInt(dojo.html.getComputedStyle(bar, "top"));
var barLeft = parseInt(dojo.html.getComputedStyle(bar, "left"));
var barHeight = parseInt(dojo.html.getComputedStyle(bar, "height"));
if (cc.charAt(1) == "l") {
bar.style.left = (options.radii[cc] - barLeft - 1) + "px";
}
if (cc == "tr") {
bar.style.top = (options.radii[cc] - barHeight - barTop) + "px";
bar.style.backgroundPosition = "-" + Math.abs((format.width - options.radii[cc] + format.borderWidth) + barLeft) + "px -" + Math.abs(options.radii[cc] - barHeight - barTop - format.borderWidth) + "px";
} else {
if (cc == "tl") {
bar.style.top = (options.radii[cc] - barHeight - barTop) + "px";
bar.style.backgroundPosition = "-" + Math.abs((options.radii[cc] - barLeft - 1) - format.borderWidth) + "px -" + Math.abs(options.radii[cc] - barHeight - barTop - format.borderWidth) + "px";
} else {
bar.style.backgroundPosition = "-" + Math.abs((options.radii[cc] + barLeft) + format.borderWidth) + "px -" + Math.abs((format.height + options.radii[cc] + barTop) - format.borderWidth) + "px";
}
}
}
}
}
if (corner) {
var psn = [];
if (cc.charAt(0) == "t") {
psn.push("top");
} else {
psn.push("bottom");
}
if (cc.charAt(1) == "l") {
psn.push("left");
} else {
psn.push("right");
}
if (corner.style.position == "absolute") {
for (var z = 0; z < psn.length; z++) {
corner.style[psn[z]] = "0px";
}
}
if (psn[0] == "top") {
if (top) {
top.appendChild(corner);
}
} else {
if (bottom) {
bottom.appendChild(corner);
}
}
}
}
var diff = {t:Math.abs(options.radii.tl - options.radii.tr), b:Math.abs(options.radii.bl - options.radii.br)};
for (var z in diff) {
var smaller = (options.radii[z + "l"] < options.radii[z + "r"] ? z + "l" : z + "r");
var filler = document.createElement("div");
filler.style.height = diff[z] + "px";
filler.style.width = options.radii[smaller] + "px";
filler.style.position = "absolute";
filler.style.fontSize = "1px";
filler.style.overflow = "hidden";
filler.style.backgroundColor = format.color;
switch (smaller) {
case "tl":
filler.style.bottom = "0px";
filler.style.left = "0px";
filler.style.borderLeft = format.borderString;
top.appendChild(filler);
break;
case "tr":
filler.style.bottom = "0px";
filler.style.right = "0px";
filler.style.borderRight = format.borderString;
top.appendChild(filler);
break;
case "bl":
filler.style.top = "0px";
filler.style.left = "0px";
filler.style.borderLeft = format.borderString;
bottom.appendChild(filler);
break;
case "br":
filler.style.top = "0px";
filler.style.right = "0px";
filler.style.borderRight = format.borderString;
bottom.appendChild(filler);
break;
}
var fillBar = document.createElement("div");
fillBar.style.position = "relative";
fillBar.style.fontSize = "1px";
fillBar.style.overflow = "hidden";
fillBar.style.backgroundColor = format.color;
fillBar.style.backgroundImage = format.bgImage;
if (z == "t") {
if (top) {
if (options.radii.tl && options.radii.tr) {
fillBar.style.height = (topHeight - format.borderWidth) + "px";
fillBar.style.marginLeft = (options.radii.tl - format.borderWidth) + "px";
fillBar.style.marginRight = (options.radii.tr - format.borderWidth) + "px";
fillBar.style.borderTop = format.borderString;
if (format.bgImage != "") {
fillBar.style.backgroundPosition = "-" + (topHeight + format.borderWidth) + "px 0px";
}
}
top.appendChild(fillBar);
}
} else {
if (bottom) {
if (options.radii.bl && options.radii.br) {
fillBar.style.height = (bottomHeight - format.borderWidth) + "px";
fillBar.style.marginLeft = (options.radii.bl - format.borderWidth) + "px";
fillBar.style.marginRight = (options.radii.br - format.borderWidth) + "px";
fillBar.style.borderBottom = format.borderString;
if (format.bgImage != "") {
fillBar.style.backgroundPosition = "-" + (bottomHeight + format.borderWidth) + "px -" + (format.height + (topHeight + format.borderWidth)) + "px";
}
}
bottom.appendChild(fillBar);
}
}
}
if (options.autoPad && format.padding > 0) {
var content = document.createElement("div");
content.style.position = "relative";
content.innerHTML = format.content;
content.className = "autoPadDiv";
if (topHeight < format.padding) {
content.style.paddingTop = Math.abs(topHeight - format.padding) + "px";
}
if (bottomHeight < format.padding) {
content.style.paddingBottom = Math.abs(bottomHeight - format.padding) + "px";
}
content.style.paddingLeft = format.padding + "px";
content.style.paddingRight = format.padding + "px";
node.appendChild(content);
}
};
var count = 0;
dojo.lfx.rounded._fns = {blend:function (clr1, clr2, frac) {
var c1 = {r:parseInt(clr1.substr(1, 2), 16), g:parseInt(clr1.substr(3, 2), 16), b:parseInt(clr1.substr(5, 2), 16)};
var c2 = {r:parseInt(clr2.substr(1, 2), 16), g:parseInt(clr2.substr(3, 2), 16), b:parseInt(clr2.substr(5, 2), 16)};
if (frac > 1 || frac < 0) {
frac = 1;
}
var ret = [Math.min(Math.max(Math.round((c1.r * frac) + (c2.r * (1 - frac))), 0), 255), Math.min(Math.max(Math.round((c1.g * frac) + (c2.g * (1 - frac))), 0), 255), Math.min(Math.max(Math.round((c1.b * frac) + (c2.b * (1 - frac))), 0), 255)];
for (var i = 0; i < ret.length; i++) {
var n = ret[i].toString(16);
if (n.length < 2) {
n = "0" + n;
}
ret[i] = n;
}
return "#" + ret.join("");
}, fraction:function (x, y, r) {
var frac = 0;
var xval = [];
var yval = [];
var point = 0;
var whatsides = "";
var intersect = Math.sqrt((Math.pow(r, 2) - Math.pow(x, 2)));
if (intersect >= y && intersect < (y + 1)) {
whatsides = "Left";
xval[point] = 0;
yval[point++] = intersect - y;
}
intersect = Math.sqrt((Math.pow(r, 2) - Math.pow(y + 1, 2)));
if (intersect >= x && intersect < (x + 1)) {
whatsides += "Top";
xval[point] = intersect - x;
yval[point++] = 1;
}
intersect = Math.sqrt((Math.pow(r, 2) - Math.pow(x + 1, 2)));
if (intersect >= y && intersect < (y + 1)) {
whatsides += "Right";
xval[point] = 1;
yval[point++] = intersect - y;
}
intersect = Math.sqrt((Math.pow(r, 2) - Math.pow(y, 2)));
if (intersect >= x && intersect < (x + 1)) {
whatsides += "Bottom";
xval[point] = intersect - x;
yval[point] = 1;
}
switch (whatsides) {
case "LeftRight":
return Math.min(yval[0], yval[1]) + ((Math.max(yval[0], yval[1]) - Math.min(yval[0], yval[1])) / 2);
case "TopRight":
return 1 - (((1 - xval[0]) * (1 - yval[1])) / 2);
case "TopBottom":
return Math.min(xval[0], xval[1]) + ((Math.max(xval[0], xval[1]) - Math.min(xval[0], xval[1])) / 2);
case "LeftBottom":
return (yval[0] * xval[1]) / 2;
default:
return 1;
}
}, draw:function (x, y, color, opac, height, corner, image, radius, top, format) {
var px = document.createElement("div");
px.style.height = height + "px";
px.style.width = "1px";
px.style.position = "absolute";
px.style.fontSize = "1px";
px.style.overflow = "hidden";
if (image == -1 && format.bgImage != "") {
px.style.backgroundImage = format.bgImage;
px.style.backgroundPosition = "-" + (format.width - (radius - x) + format.borderWidth) + "px -" + ((format.height + top + y) - format.borderWidth) + "px";
} else {
px.style.backgroundColor = color;
}
if (opac != 100) {
dojo.html.setOpacity(px, (opac / 100));
}
px.style.top = y + "px";
px.style.left = x + "px";
corner.appendChild(px);
}, getRGB:function (clr) {
var ret = "#ffffff";
if (clr != "" && clr != "transparent") {
if (clr.substr(0, 3) == "rgb") {
var t = clr.substring(4, clr.indexOf(")"));
t = t.split(",");
for (var i = 0; i < t.length; i++) {
var n = parseInt(t[i]).toString(16);
if (n.length < 2) {
n = "0" + n;
}
t[i] = n;
}
ret = "#" + t.join("");
} else {
if (clr.length == 4) {
ret = "#" + clr.substring(1, 2) + clr.substring(1, 2) + clr.substring(2, 3) + clr.substring(2, 3) + clr.substring(3, 4) + clr.substring(3, 4);
} else {
ret = clr;
}
}
}
return ret;
}};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/lfx/toggle.js
New file
0,0 → 1,39
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.lfx.toggle");
dojo.require("dojo.lfx.*");
dojo.lfx.toggle.plain = {show:function (node, duration, easing, callback) {
dojo.html.show(node);
if (dojo.lang.isFunction(callback)) {
callback();
}
}, hide:function (node, duration, easing, callback) {
dojo.html.hide(node);
if (dojo.lang.isFunction(callback)) {
callback();
}
}};
dojo.lfx.toggle.fade = {show:function (node, duration, easing, callback) {
dojo.lfx.fadeShow(node, duration, easing, callback).play();
}, hide:function (node, duration, easing, callback) {
dojo.lfx.fadeHide(node, duration, easing, callback).play();
}};
dojo.lfx.toggle.wipe = {show:function (node, duration, easing, callback) {
dojo.lfx.wipeIn(node, duration, easing, callback).play();
}, hide:function (node, duration, easing, callback) {
dojo.lfx.wipeOut(node, duration, easing, callback).play();
}};
dojo.lfx.toggle.explode = {show:function (node, duration, easing, callback, explodeSrc) {
dojo.lfx.explode(explodeSrc || {x:0, y:0, width:0, height:0}, node, duration, easing, callback).play();
}, hide:function (node, duration, easing, callback, explodeSrc) {
dojo.lfx.implode(node, explodeSrc || {x:0, y:0, width:0, height:0}, duration, easing, callback).play();
}};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/lfx/html.js
New file
0,0 → 1,507
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.lfx.html");
dojo.require("dojo.gfx.color");
dojo.require("dojo.lfx.Animation");
dojo.require("dojo.lang.array");
dojo.require("dojo.html.display");
dojo.require("dojo.html.color");
dojo.require("dojo.html.layout");
dojo.lfx.html._byId = function (nodes) {
if (!nodes) {
return [];
}
if (dojo.lang.isArrayLike(nodes)) {
if (!nodes.alreadyChecked) {
var n = [];
dojo.lang.forEach(nodes, function (node) {
n.push(dojo.byId(node));
});
n.alreadyChecked = true;
return n;
} else {
return nodes;
}
} else {
var n = [];
n.push(dojo.byId(nodes));
n.alreadyChecked = true;
return n;
}
};
dojo.lfx.html.propertyAnimation = function (nodes, propertyMap, duration, easing, handlers) {
nodes = dojo.lfx.html._byId(nodes);
var targs = {"propertyMap":propertyMap, "nodes":nodes, "duration":duration, "easing":easing || dojo.lfx.easeDefault};
var setEmUp = function (args) {
if (args.nodes.length == 1) {
var pm = args.propertyMap;
if (!dojo.lang.isArray(args.propertyMap)) {
var parr = [];
for (var pname in pm) {
pm[pname].property = pname;
parr.push(pm[pname]);
}
pm = args.propertyMap = parr;
}
dojo.lang.forEach(pm, function (prop) {
if (dj_undef("start", prop)) {
if (prop.property != "opacity") {
prop.start = parseInt(dojo.html.getComputedStyle(args.nodes[0], prop.property));
} else {
prop.start = dojo.html.getOpacity(args.nodes[0]);
}
}
});
}
};
var coordsAsInts = function (coords) {
var cints = [];
dojo.lang.forEach(coords, function (c) {
cints.push(Math.round(c));
});
return cints;
};
var setStyle = function (n, style) {
n = dojo.byId(n);
if (!n || !n.style) {
return;
}
for (var s in style) {
try {
if (s == "opacity") {
dojo.html.setOpacity(n, style[s]);
} else {
n.style[s] = style[s];
}
}
catch (e) {
dojo.debug(e);
}
}
};
var propLine = function (properties) {
this._properties = properties;
this.diffs = new Array(properties.length);
dojo.lang.forEach(properties, function (prop, i) {
if (dojo.lang.isFunction(prop.start)) {
prop.start = prop.start(prop, i);
}
if (dojo.lang.isFunction(prop.end)) {
prop.end = prop.end(prop, i);
}
if (dojo.lang.isArray(prop.start)) {
this.diffs[i] = null;
} else {
if (prop.start instanceof dojo.gfx.color.Color) {
prop.startRgb = prop.start.toRgb();
prop.endRgb = prop.end.toRgb();
} else {
this.diffs[i] = prop.end - prop.start;
}
}
}, this);
this.getValue = function (n) {
var ret = {};
dojo.lang.forEach(this._properties, function (prop, i) {
var value = null;
if (dojo.lang.isArray(prop.start)) {
} else {
if (prop.start instanceof dojo.gfx.color.Color) {
value = (prop.units || "rgb") + "(";
for (var j = 0; j < prop.startRgb.length; j++) {
value += Math.round(((prop.endRgb[j] - prop.startRgb[j]) * n) + prop.startRgb[j]) + (j < prop.startRgb.length - 1 ? "," : "");
}
value += ")";
} else {
value = ((this.diffs[i]) * n) + prop.start + (prop.property != "opacity" ? prop.units || "px" : "");
}
}
ret[dojo.html.toCamelCase(prop.property)] = value;
}, this);
return ret;
};
};
var anim = new dojo.lfx.Animation({beforeBegin:function () {
setEmUp(targs);
anim.curve = new propLine(targs.propertyMap);
}, onAnimate:function (propValues) {
dojo.lang.forEach(targs.nodes, function (node) {
setStyle(node, propValues);
});
}}, targs.duration, null, targs.easing);
if (handlers) {
for (var x in handlers) {
if (dojo.lang.isFunction(handlers[x])) {
anim.connect(x, anim, handlers[x]);
}
}
}
return anim;
};
dojo.lfx.html._makeFadeable = function (nodes) {
var makeFade = function (node) {
if (dojo.render.html.ie) {
if ((node.style.zoom.length == 0) && (dojo.html.getStyle(node, "zoom") == "normal")) {
node.style.zoom = "1";
}
if ((node.style.width.length == 0) && (dojo.html.getStyle(node, "width") == "auto")) {
node.style.width = "auto";
}
}
};
if (dojo.lang.isArrayLike(nodes)) {
dojo.lang.forEach(nodes, makeFade);
} else {
makeFade(nodes);
}
};
dojo.lfx.html.fade = function (nodes, values, duration, easing, callback) {
nodes = dojo.lfx.html._byId(nodes);
var props = {property:"opacity"};
if (!dj_undef("start", values)) {
props.start = values.start;
} else {
props.start = function () {
return dojo.html.getOpacity(nodes[0]);
};
}
if (!dj_undef("end", values)) {
props.end = values.end;
} else {
dojo.raise("dojo.lfx.html.fade needs an end value");
}
var anim = dojo.lfx.propertyAnimation(nodes, [props], duration, easing);
anim.connect("beforeBegin", function () {
dojo.lfx.html._makeFadeable(nodes);
});
if (callback) {
anim.connect("onEnd", function () {
callback(nodes, anim);
});
}
return anim;
};
dojo.lfx.html.fadeIn = function (nodes, duration, easing, callback) {
return dojo.lfx.html.fade(nodes, {end:1}, duration, easing, callback);
};
dojo.lfx.html.fadeOut = function (nodes, duration, easing, callback) {
return dojo.lfx.html.fade(nodes, {end:0}, duration, easing, callback);
};
dojo.lfx.html.fadeShow = function (nodes, duration, easing, callback) {
nodes = dojo.lfx.html._byId(nodes);
dojo.lang.forEach(nodes, function (node) {
dojo.html.setOpacity(node, 0);
});
var anim = dojo.lfx.html.fadeIn(nodes, duration, easing, callback);
anim.connect("beforeBegin", function () {
if (dojo.lang.isArrayLike(nodes)) {
dojo.lang.forEach(nodes, dojo.html.show);
} else {
dojo.html.show(nodes);
}
});
return anim;
};
dojo.lfx.html.fadeHide = function (nodes, duration, easing, callback) {
var anim = dojo.lfx.html.fadeOut(nodes, duration, easing, function () {
if (dojo.lang.isArrayLike(nodes)) {
dojo.lang.forEach(nodes, dojo.html.hide);
} else {
dojo.html.hide(nodes);
}
if (callback) {
callback(nodes, anim);
}
});
return anim;
};
dojo.lfx.html.wipeIn = function (nodes, duration, easing, callback) {
nodes = dojo.lfx.html._byId(nodes);
var anims = [];
dojo.lang.forEach(nodes, function (node) {
var oprop = {};
var origTop, origLeft, origPosition;
with (node.style) {
origTop = top;
origLeft = left;
origPosition = position;
top = "-9999px";
left = "-9999px";
position = "absolute";
display = "";
}
var nodeHeight = dojo.html.getBorderBox(node).height;
with (node.style) {
top = origTop;
left = origLeft;
position = origPosition;
display = "none";
}
var anim = dojo.lfx.propertyAnimation(node, {"height":{start:1, end:function () {
return nodeHeight;
}}}, duration, easing);
anim.connect("beforeBegin", function () {
oprop.overflow = node.style.overflow;
oprop.height = node.style.height;
with (node.style) {
overflow = "hidden";
height = "1px";
}
dojo.html.show(node);
});
anim.connect("onEnd", function () {
with (node.style) {
overflow = oprop.overflow;
height = oprop.height;
}
if (callback) {
callback(node, anim);
}
});
anims.push(anim);
});
return dojo.lfx.combine(anims);
};
dojo.lfx.html.wipeOut = function (nodes, duration, easing, callback) {
nodes = dojo.lfx.html._byId(nodes);
var anims = [];
dojo.lang.forEach(nodes, function (node) {
var oprop = {};
var anim = dojo.lfx.propertyAnimation(node, {"height":{start:function () {
return dojo.html.getContentBox(node).height;
}, end:1}}, duration, easing, {"beforeBegin":function () {
oprop.overflow = node.style.overflow;
oprop.height = node.style.height;
with (node.style) {
overflow = "hidden";
}
dojo.html.show(node);
}, "onEnd":function () {
dojo.html.hide(node);
with (node.style) {
overflow = oprop.overflow;
height = oprop.height;
}
if (callback) {
callback(node, anim);
}
}});
anims.push(anim);
});
return dojo.lfx.combine(anims);
};
dojo.lfx.html.slideTo = function (nodes, coords, duration, easing, callback) {
nodes = dojo.lfx.html._byId(nodes);
var anims = [];
var compute = dojo.html.getComputedStyle;
if (dojo.lang.isArray(coords)) {
dojo.deprecated("dojo.lfx.html.slideTo(node, array)", "use dojo.lfx.html.slideTo(node, {top: value, left: value});", "0.5");
coords = {top:coords[0], left:coords[1]};
}
dojo.lang.forEach(nodes, function (node) {
var top = null;
var left = null;
var init = (function () {
var innerNode = node;
return function () {
var pos = compute(innerNode, "position");
top = (pos == "absolute" ? node.offsetTop : parseInt(compute(node, "top")) || 0);
left = (pos == "absolute" ? node.offsetLeft : parseInt(compute(node, "left")) || 0);
if (!dojo.lang.inArray(["absolute", "relative"], pos)) {
var ret = dojo.html.abs(innerNode, true);
dojo.html.setStyleAttributes(innerNode, "position:absolute;top:" + ret.y + "px;left:" + ret.x + "px;");
top = ret.y;
left = ret.x;
}
};
})();
init();
var anim = dojo.lfx.propertyAnimation(node, {"top":{start:top, end:(coords.top || 0)}, "left":{start:left, end:(coords.left || 0)}}, duration, easing, {"beforeBegin":init});
if (callback) {
anim.connect("onEnd", function () {
callback(nodes, anim);
});
}
anims.push(anim);
});
return dojo.lfx.combine(anims);
};
dojo.lfx.html.slideBy = function (nodes, coords, duration, easing, callback) {
nodes = dojo.lfx.html._byId(nodes);
var anims = [];
var compute = dojo.html.getComputedStyle;
if (dojo.lang.isArray(coords)) {
dojo.deprecated("dojo.lfx.html.slideBy(node, array)", "use dojo.lfx.html.slideBy(node, {top: value, left: value});", "0.5");
coords = {top:coords[0], left:coords[1]};
}
dojo.lang.forEach(nodes, function (node) {
var top = null;
var left = null;
var init = (function () {
var innerNode = node;
return function () {
var pos = compute(innerNode, "position");
top = (pos == "absolute" ? node.offsetTop : parseInt(compute(node, "top")) || 0);
left = (pos == "absolute" ? node.offsetLeft : parseInt(compute(node, "left")) || 0);
if (!dojo.lang.inArray(["absolute", "relative"], pos)) {
var ret = dojo.html.abs(innerNode, true);
dojo.html.setStyleAttributes(innerNode, "position:absolute;top:" + ret.y + "px;left:" + ret.x + "px;");
top = ret.y;
left = ret.x;
}
};
})();
init();
var anim = dojo.lfx.propertyAnimation(node, {"top":{start:top, end:top + (coords.top || 0)}, "left":{start:left, end:left + (coords.left || 0)}}, duration, easing).connect("beforeBegin", init);
if (callback) {
anim.connect("onEnd", function () {
callback(nodes, anim);
});
}
anims.push(anim);
});
return dojo.lfx.combine(anims);
};
dojo.lfx.html.explode = function (start, endNode, duration, easing, callback) {
var h = dojo.html;
start = dojo.byId(start);
endNode = dojo.byId(endNode);
var startCoords = h.toCoordinateObject(start, true);
var outline = document.createElement("div");
h.copyStyle(outline, endNode);
if (endNode.explodeClassName) {
outline.className = endNode.explodeClassName;
}
with (outline.style) {
position = "absolute";
display = "none";
var backgroundStyle = h.getStyle(start, "background-color");
backgroundColor = backgroundStyle ? backgroundStyle.toLowerCase() : "transparent";
backgroundColor = (backgroundColor == "transparent") ? "rgb(221, 221, 221)" : backgroundColor;
}
dojo.body().appendChild(outline);
with (endNode.style) {
visibility = "hidden";
display = "block";
}
var endCoords = h.toCoordinateObject(endNode, true);
with (endNode.style) {
display = "none";
visibility = "visible";
}
var props = {opacity:{start:0.5, end:1}};
dojo.lang.forEach(["height", "width", "top", "left"], function (type) {
props[type] = {start:startCoords[type], end:endCoords[type]};
});
var anim = new dojo.lfx.propertyAnimation(outline, props, duration, easing, {"beforeBegin":function () {
h.setDisplay(outline, "block");
}, "onEnd":function () {
h.setDisplay(endNode, "block");
outline.parentNode.removeChild(outline);
}});
if (callback) {
anim.connect("onEnd", function () {
callback(endNode, anim);
});
}
return anim;
};
dojo.lfx.html.implode = function (startNode, end, duration, easing, callback) {
var h = dojo.html;
startNode = dojo.byId(startNode);
end = dojo.byId(end);
var startCoords = dojo.html.toCoordinateObject(startNode, true);
var endCoords = dojo.html.toCoordinateObject(end, true);
var outline = document.createElement("div");
dojo.html.copyStyle(outline, startNode);
if (startNode.explodeClassName) {
outline.className = startNode.explodeClassName;
}
dojo.html.setOpacity(outline, 0.3);
with (outline.style) {
position = "absolute";
display = "none";
backgroundColor = h.getStyle(startNode, "background-color").toLowerCase();
}
dojo.body().appendChild(outline);
var props = {opacity:{start:1, end:0.5}};
dojo.lang.forEach(["height", "width", "top", "left"], function (type) {
props[type] = {start:startCoords[type], end:endCoords[type]};
});
var anim = new dojo.lfx.propertyAnimation(outline, props, duration, easing, {"beforeBegin":function () {
dojo.html.hide(startNode);
dojo.html.show(outline);
}, "onEnd":function () {
outline.parentNode.removeChild(outline);
}});
if (callback) {
anim.connect("onEnd", function () {
callback(startNode, anim);
});
}
return anim;
};
dojo.lfx.html.highlight = function (nodes, startColor, duration, easing, callback) {
nodes = dojo.lfx.html._byId(nodes);
var anims = [];
dojo.lang.forEach(nodes, function (node) {
var color = dojo.html.getBackgroundColor(node);
var bg = dojo.html.getStyle(node, "background-color").toLowerCase();
var bgImage = dojo.html.getStyle(node, "background-image");
var wasTransparent = (bg == "transparent" || bg == "rgba(0, 0, 0, 0)");
while (color.length > 3) {
color.pop();
}
var rgb = new dojo.gfx.color.Color(startColor);
var endRgb = new dojo.gfx.color.Color(color);
var anim = dojo.lfx.propertyAnimation(node, {"background-color":{start:rgb, end:endRgb}}, duration, easing, {"beforeBegin":function () {
if (bgImage) {
node.style.backgroundImage = "none";
}
node.style.backgroundColor = "rgb(" + rgb.toRgb().join(",") + ")";
}, "onEnd":function () {
if (bgImage) {
node.style.backgroundImage = bgImage;
}
if (wasTransparent) {
node.style.backgroundColor = "transparent";
}
if (callback) {
callback(node, anim);
}
}});
anims.push(anim);
});
return dojo.lfx.combine(anims);
};
dojo.lfx.html.unhighlight = function (nodes, endColor, duration, easing, callback) {
nodes = dojo.lfx.html._byId(nodes);
var anims = [];
dojo.lang.forEach(nodes, function (node) {
var color = new dojo.gfx.color.Color(dojo.html.getBackgroundColor(node));
var rgb = new dojo.gfx.color.Color(endColor);
var bgImage = dojo.html.getStyle(node, "background-image");
var anim = dojo.lfx.propertyAnimation(node, {"background-color":{start:color, end:rgb}}, duration, easing, {"beforeBegin":function () {
if (bgImage) {
node.style.backgroundImage = "none";
}
node.style.backgroundColor = "rgb(" + color.toRgb().join(",") + ")";
}, "onEnd":function () {
if (callback) {
callback(node, anim);
}
}});
anims.push(anim);
});
return dojo.lfx.combine(anims);
};
dojo.lang.mixin(dojo.lfx, dojo.lfx.html);
 
/tags/Racine_livraison_narmer/api/js/dojo/src/lfx/shadow.js
New file
0,0 → 1,73
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.lfx.shadow");
dojo.require("dojo.lang.common");
dojo.require("dojo.uri.Uri");
dojo.lfx.shadow = function (node) {
this.shadowPng = dojo.uri.moduleUri("dojo.html", "images/shadow");
this.shadowThickness = 8;
this.shadowOffset = 15;
this.init(node);
};
dojo.extend(dojo.lfx.shadow, {init:function (node) {
this.node = node;
this.pieces = {};
var x1 = -1 * this.shadowThickness;
var y0 = this.shadowOffset;
var y1 = this.shadowOffset + this.shadowThickness;
this._makePiece("tl", "top", y0, "left", x1);
this._makePiece("l", "top", y1, "left", x1, "scale");
this._makePiece("tr", "top", y0, "left", 0);
this._makePiece("r", "top", y1, "left", 0, "scale");
this._makePiece("bl", "top", 0, "left", x1);
this._makePiece("b", "top", 0, "left", 0, "crop");
this._makePiece("br", "top", 0, "left", 0);
}, _makePiece:function (name, vertAttach, vertCoord, horzAttach, horzCoord, sizing) {
var img;
var url = this.shadowPng + name.toUpperCase() + ".png";
if (dojo.render.html.ie55 || dojo.render.html.ie60) {
img = dojo.doc().createElement("div");
img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + url + "'" + (sizing ? ", sizingMethod='" + sizing + "'" : "") + ")";
} else {
img = dojo.doc().createElement("img");
img.src = url;
}
img.style.position = "absolute";
img.style[vertAttach] = vertCoord + "px";
img.style[horzAttach] = horzCoord + "px";
img.style.width = this.shadowThickness + "px";
img.style.height = this.shadowThickness + "px";
this.pieces[name] = img;
this.node.appendChild(img);
}, size:function (width, height) {
var sideHeight = height - (this.shadowOffset + this.shadowThickness + 1);
if (sideHeight < 0) {
sideHeight = 0;
}
if (height < 1) {
height = 1;
}
if (width < 1) {
width = 1;
}
with (this.pieces) {
l.style.height = sideHeight + "px";
r.style.height = sideHeight + "px";
b.style.width = (width - 1) + "px";
bl.style.top = (height - 1) + "px";
b.style.top = (height - 1) + "px";
br.style.top = (height - 1) + "px";
tr.style.left = (width - 1) + "px";
r.style.left = (width - 1) + "px";
br.style.left = (width - 1) + "px";
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/lfx/extras.js
New file
0,0 → 1,78
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.lfx.extras");
dojo.require("dojo.lfx.html");
dojo.require("dojo.lfx.Animation");
dojo.lfx.html.fadeWipeIn = function (nodes, duration, easing, callback) {
nodes = dojo.lfx.html._byId(nodes);
var anim = dojo.lfx.combine(dojo.lfx.fadeIn(nodes, duration, easing), dojo.lfx.wipeIn(nodes, duration, easing));
if (callback) {
anim.connect("onEnd", function () {
callback(nodes, anim);
});
}
return anim;
};
dojo.lfx.html.fadeWipeOut = function (nodes, duration, easing, callback) {
nodes = dojo.lfx.html._byId(nodes);
var anim = dojo.lfx.combine(dojo.lfx.fadeOut(nodes, duration, easing), dojo.lfx.wipeOut(nodes, duration, easing));
if (callback) {
anim.connect("onEnd", function () {
callback(nodes, anim);
});
}
return anim;
};
dojo.lfx.html.scale = function (nodes, percentage, scaleContent, fromCenter, duration, easing, callback) {
nodes = dojo.lfx.html._byId(nodes);
var anims = [];
dojo.lang.forEach(nodes, function (node) {
var outer = dojo.html.getMarginBox(node);
var actualPct = percentage / 100;
var props = [{property:"width", start:outer.width, end:outer.width * actualPct}, {property:"height", start:outer.height, end:outer.height * actualPct}];
if (scaleContent) {
var fontSize = dojo.html.getStyle(node, "font-size");
var fontSizeType = null;
if (!fontSize) {
fontSize = parseFloat("100%");
fontSizeType = "%";
} else {
dojo.lang.some(["em", "px", "%"], function (item, index, arr) {
if (fontSize.indexOf(item) > 0) {
fontSize = parseFloat(fontSize);
fontSizeType = item;
return true;
}
});
}
props.push({property:"font-size", start:fontSize, end:fontSize * actualPct, units:fontSizeType});
}
if (fromCenter) {
var positioning = dojo.html.getStyle(node, "position");
var originalTop = node.offsetTop;
var originalLeft = node.offsetLeft;
var endTop = ((outer.height * actualPct) - outer.height) / 2;
var endLeft = ((outer.width * actualPct) - outer.width) / 2;
props.push({property:"top", start:originalTop, end:(positioning == "absolute" ? originalTop - endTop : (-1 * endTop))});
props.push({property:"left", start:originalLeft, end:(positioning == "absolute" ? originalLeft - endLeft : (-1 * endLeft))});
}
var anim = dojo.lfx.propertyAnimation(node, props, duration, easing);
if (callback) {
anim.connect("onEnd", function () {
callback(node, anim);
});
}
anims.push(anim);
});
return dojo.lfx.combine(anims);
};
dojo.lang.mixin(dojo.lfx, dojo.lfx.html);
 
/tags/Racine_livraison_narmer/api/js/dojo/src/lfx/__package__.js
New file
0,0 → 1,13
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.kwCompoundRequire({browser:["dojo.lfx.html"], dashboard:["dojo.lfx.html"]});
dojo.provide("dojo.lfx.*");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/dom.js
New file
0,0 → 1,379
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.dom");
dojo.dom.ELEMENT_NODE = 1;
dojo.dom.ATTRIBUTE_NODE = 2;
dojo.dom.TEXT_NODE = 3;
dojo.dom.CDATA_SECTION_NODE = 4;
dojo.dom.ENTITY_REFERENCE_NODE = 5;
dojo.dom.ENTITY_NODE = 6;
dojo.dom.PROCESSING_INSTRUCTION_NODE = 7;
dojo.dom.COMMENT_NODE = 8;
dojo.dom.DOCUMENT_NODE = 9;
dojo.dom.DOCUMENT_TYPE_NODE = 10;
dojo.dom.DOCUMENT_FRAGMENT_NODE = 11;
dojo.dom.NOTATION_NODE = 12;
dojo.dom.dojoml = "http://www.dojotoolkit.org/2004/dojoml";
dojo.dom.xmlns = {svg:"http://www.w3.org/2000/svg", smil:"http://www.w3.org/2001/SMIL20/", mml:"http://www.w3.org/1998/Math/MathML", cml:"http://www.xml-cml.org", xlink:"http://www.w3.org/1999/xlink", xhtml:"http://www.w3.org/1999/xhtml", xul:"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", xbl:"http://www.mozilla.org/xbl", fo:"http://www.w3.org/1999/XSL/Format", xsl:"http://www.w3.org/1999/XSL/Transform", xslt:"http://www.w3.org/1999/XSL/Transform", xi:"http://www.w3.org/2001/XInclude", xforms:"http://www.w3.org/2002/01/xforms", saxon:"http://icl.com/saxon", xalan:"http://xml.apache.org/xslt", xsd:"http://www.w3.org/2001/XMLSchema", dt:"http://www.w3.org/2001/XMLSchema-datatypes", xsi:"http://www.w3.org/2001/XMLSchema-instance", rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#", rdfs:"http://www.w3.org/2000/01/rdf-schema#", dc:"http://purl.org/dc/elements/1.1/", dcq:"http://purl.org/dc/qualifiers/1.0", "soap-env":"http://schemas.xmlsoap.org/soap/envelope/", wsdl:"http://schemas.xmlsoap.org/wsdl/", AdobeExtensions:"http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"};
dojo.dom.isNode = function (wh) {
if (typeof Element == "function") {
try {
return wh instanceof Element;
}
catch (e) {
}
} else {
return wh && !isNaN(wh.nodeType);
}
};
dojo.dom.getUniqueId = function () {
var _document = dojo.doc();
do {
var id = "dj_unique_" + (++arguments.callee._idIncrement);
} while (_document.getElementById(id));
return id;
};
dojo.dom.getUniqueId._idIncrement = 0;
dojo.dom.firstElement = dojo.dom.getFirstChildElement = function (parentNode, tagName) {
var node = parentNode.firstChild;
while (node && node.nodeType != dojo.dom.ELEMENT_NODE) {
node = node.nextSibling;
}
if (tagName && node && node.tagName && node.tagName.toLowerCase() != tagName.toLowerCase()) {
node = dojo.dom.nextElement(node, tagName);
}
return node;
};
dojo.dom.lastElement = dojo.dom.getLastChildElement = function (parentNode, tagName) {
var node = parentNode.lastChild;
while (node && node.nodeType != dojo.dom.ELEMENT_NODE) {
node = node.previousSibling;
}
if (tagName && node && node.tagName && node.tagName.toLowerCase() != tagName.toLowerCase()) {
node = dojo.dom.prevElement(node, tagName);
}
return node;
};
dojo.dom.nextElement = dojo.dom.getNextSiblingElement = function (node, tagName) {
if (!node) {
return null;
}
do {
node = node.nextSibling;
} while (node && node.nodeType != dojo.dom.ELEMENT_NODE);
if (node && tagName && tagName.toLowerCase() != node.tagName.toLowerCase()) {
return dojo.dom.nextElement(node, tagName);
}
return node;
};
dojo.dom.prevElement = dojo.dom.getPreviousSiblingElement = function (node, tagName) {
if (!node) {
return null;
}
if (tagName) {
tagName = tagName.toLowerCase();
}
do {
node = node.previousSibling;
} while (node && node.nodeType != dojo.dom.ELEMENT_NODE);
if (node && tagName && tagName.toLowerCase() != node.tagName.toLowerCase()) {
return dojo.dom.prevElement(node, tagName);
}
return node;
};
dojo.dom.moveChildren = function (srcNode, destNode, trim) {
var count = 0;
if (trim) {
while (srcNode.hasChildNodes() && srcNode.firstChild.nodeType == dojo.dom.TEXT_NODE) {
srcNode.removeChild(srcNode.firstChild);
}
while (srcNode.hasChildNodes() && srcNode.lastChild.nodeType == dojo.dom.TEXT_NODE) {
srcNode.removeChild(srcNode.lastChild);
}
}
while (srcNode.hasChildNodes()) {
destNode.appendChild(srcNode.firstChild);
count++;
}
return count;
};
dojo.dom.copyChildren = function (srcNode, destNode, trim) {
var clonedNode = srcNode.cloneNode(true);
return this.moveChildren(clonedNode, destNode, trim);
};
dojo.dom.replaceChildren = function (node, newChild) {
var nodes = [];
if (dojo.render.html.ie) {
for (var i = 0; i < node.childNodes.length; i++) {
nodes.push(node.childNodes[i]);
}
}
dojo.dom.removeChildren(node);
node.appendChild(newChild);
for (var i = 0; i < nodes.length; i++) {
dojo.dom.destroyNode(nodes[i]);
}
};
dojo.dom.removeChildren = function (node) {
var count = node.childNodes.length;
while (node.hasChildNodes()) {
dojo.dom.removeNode(node.firstChild);
}
return count;
};
dojo.dom.replaceNode = function (node, newNode) {
return node.parentNode.replaceChild(newNode, node);
};
dojo.dom.destroyNode = function (node) {
if (node.parentNode) {
node = dojo.dom.removeNode(node);
}
if (node.nodeType != 3) {
if (dojo.evalObjPath("dojo.event.browser.clean", false)) {
dojo.event.browser.clean(node);
}
if (dojo.render.html.ie) {
node.outerHTML = "";
}
}
};
dojo.dom.removeNode = function (node) {
if (node && node.parentNode) {
return node.parentNode.removeChild(node);
}
};
dojo.dom.getAncestors = function (node, filterFunction, returnFirstHit) {
var ancestors = [];
var isFunction = (filterFunction && (filterFunction instanceof Function || typeof filterFunction == "function"));
while (node) {
if (!isFunction || filterFunction(node)) {
ancestors.push(node);
}
if (returnFirstHit && ancestors.length > 0) {
return ancestors[0];
}
node = node.parentNode;
}
if (returnFirstHit) {
return null;
}
return ancestors;
};
dojo.dom.getAncestorsByTag = function (node, tag, returnFirstHit) {
tag = tag.toLowerCase();
return dojo.dom.getAncestors(node, function (el) {
return ((el.tagName) && (el.tagName.toLowerCase() == tag));
}, returnFirstHit);
};
dojo.dom.getFirstAncestorByTag = function (node, tag) {
return dojo.dom.getAncestorsByTag(node, tag, true);
};
dojo.dom.isDescendantOf = function (node, ancestor, guaranteeDescendant) {
if (guaranteeDescendant && node) {
node = node.parentNode;
}
while (node) {
if (node == ancestor) {
return true;
}
node = node.parentNode;
}
return false;
};
dojo.dom.innerXML = function (node) {
if (node.innerXML) {
return node.innerXML;
} else {
if (node.xml) {
return node.xml;
} else {
if (typeof XMLSerializer != "undefined") {
return (new XMLSerializer()).serializeToString(node);
}
}
}
};
dojo.dom.createDocument = function () {
var doc = null;
var _document = dojo.doc();
if (!dj_undef("ActiveXObject")) {
var prefixes = ["MSXML2", "Microsoft", "MSXML", "MSXML3"];
for (var i = 0; i < prefixes.length; i++) {
try {
doc = new ActiveXObject(prefixes[i] + ".XMLDOM");
}
catch (e) {
}
if (doc) {
break;
}
}
} else {
if ((_document.implementation) && (_document.implementation.createDocument)) {
doc = _document.implementation.createDocument("", "", null);
}
}
return doc;
};
dojo.dom.createDocumentFromText = function (str, mimetype) {
if (!mimetype) {
mimetype = "text/xml";
}
if (!dj_undef("DOMParser")) {
var parser = new DOMParser();
return parser.parseFromString(str, mimetype);
} else {
if (!dj_undef("ActiveXObject")) {
var domDoc = dojo.dom.createDocument();
if (domDoc) {
domDoc.async = false;
domDoc.loadXML(str);
return domDoc;
} else {
dojo.debug("toXml didn't work?");
}
} else {
var _document = dojo.doc();
if (_document.createElement) {
var tmp = _document.createElement("xml");
tmp.innerHTML = str;
if (_document.implementation && _document.implementation.createDocument) {
var xmlDoc = _document.implementation.createDocument("foo", "", null);
for (var i = 0; i < tmp.childNodes.length; i++) {
xmlDoc.importNode(tmp.childNodes.item(i), true);
}
return xmlDoc;
}
return ((tmp.document) && (tmp.document.firstChild ? tmp.document.firstChild : tmp));
}
}
}
return null;
};
dojo.dom.prependChild = function (node, parent) {
if (parent.firstChild) {
parent.insertBefore(node, parent.firstChild);
} else {
parent.appendChild(node);
}
return true;
};
dojo.dom.insertBefore = function (node, ref, force) {
if ((force != true) && (node === ref || node.nextSibling === ref)) {
return false;
}
var parent = ref.parentNode;
parent.insertBefore(node, ref);
return true;
};
dojo.dom.insertAfter = function (node, ref, force) {
var pn = ref.parentNode;
if (ref == pn.lastChild) {
if ((force != true) && (node === ref)) {
return false;
}
pn.appendChild(node);
} else {
return this.insertBefore(node, ref.nextSibling, force);
}
return true;
};
dojo.dom.insertAtPosition = function (node, ref, position) {
if ((!node) || (!ref) || (!position)) {
return false;
}
switch (position.toLowerCase()) {
case "before":
return dojo.dom.insertBefore(node, ref);
case "after":
return dojo.dom.insertAfter(node, ref);
case "first":
if (ref.firstChild) {
return dojo.dom.insertBefore(node, ref.firstChild);
} else {
ref.appendChild(node);
return true;
}
break;
default:
ref.appendChild(node);
return true;
}
};
dojo.dom.insertAtIndex = function (node, containingNode, insertionIndex) {
var siblingNodes = containingNode.childNodes;
if (!siblingNodes.length || siblingNodes.length == insertionIndex) {
containingNode.appendChild(node);
return true;
}
if (insertionIndex == 0) {
return dojo.dom.prependChild(node, containingNode);
}
return dojo.dom.insertAfter(node, siblingNodes[insertionIndex - 1]);
};
dojo.dom.textContent = function (node, text) {
if (arguments.length > 1) {
var _document = dojo.doc();
dojo.dom.replaceChildren(node, _document.createTextNode(text));
return text;
} else {
if (node.textContent != undefined) {
return node.textContent;
}
var _result = "";
if (node == null) {
return _result;
}
for (var i = 0; i < node.childNodes.length; i++) {
switch (node.childNodes[i].nodeType) {
case 1:
case 5:
_result += dojo.dom.textContent(node.childNodes[i]);
break;
case 3:
case 2:
case 4:
_result += node.childNodes[i].nodeValue;
break;
default:
break;
}
}
return _result;
}
};
dojo.dom.hasParent = function (node) {
return Boolean(node && node.parentNode && dojo.dom.isNode(node.parentNode));
};
dojo.dom.isTag = function (node) {
if (node && node.tagName) {
for (var i = 1; i < arguments.length; i++) {
if (node.tagName == String(arguments[i])) {
return String(arguments[i]);
}
}
}
return "";
};
dojo.dom.setAttributeNS = function (elem, namespaceURI, attrName, attrValue) {
if (elem == null || ((elem == undefined) && (typeof elem == "undefined"))) {
dojo.raise("No element given to dojo.dom.setAttributeNS");
}
if (!((elem.setAttributeNS == undefined) && (typeof elem.setAttributeNS == "undefined"))) {
elem.setAttributeNS(namespaceURI, attrName, attrValue);
} else {
var ownerDoc = elem.ownerDocument;
var attribute = ownerDoc.createNode(2, attrName, namespaceURI);
attribute.nodeValue = attrValue;
elem.setAttributeNode(attribute);
}
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/ns.js
New file
0,0 → 1,98
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.ns");
dojo.ns = {namespaces:{}, failed:{}, loading:{}, loaded:{}, register:function (name, module, resolver, noOverride) {
if (!noOverride || !this.namespaces[name]) {
this.namespaces[name] = new dojo.ns.Ns(name, module, resolver);
}
}, allow:function (name) {
if (this.failed[name]) {
return false;
}
if ((djConfig.excludeNamespace) && (dojo.lang.inArray(djConfig.excludeNamespace, name))) {
return false;
}
return ((name == this.dojo) || (!djConfig.includeNamespace) || (dojo.lang.inArray(djConfig.includeNamespace, name)));
}, get:function (name) {
return this.namespaces[name];
}, require:function (name) {
var ns = this.namespaces[name];
if ((ns) && (this.loaded[name])) {
return ns;
}
if (!this.allow(name)) {
return false;
}
if (this.loading[name]) {
dojo.debug("dojo.namespace.require: re-entrant request to load namespace \"" + name + "\" must fail.");
return false;
}
var req = dojo.require;
this.loading[name] = true;
try {
if (name == "dojo") {
req("dojo.namespaces.dojo");
} else {
if (!dojo.hostenv.moduleHasPrefix(name)) {
dojo.registerModulePath(name, "../" + name);
}
req([name, "manifest"].join("."), false, true);
}
if (!this.namespaces[name]) {
this.failed[name] = true;
}
}
finally {
this.loading[name] = false;
}
return this.namespaces[name];
}};
dojo.ns.Ns = function (name, module, resolver) {
this.name = name;
this.module = module;
this.resolver = resolver;
this._loaded = [];
this._failed = [];
};
dojo.ns.Ns.prototype.resolve = function (name, domain, omitModuleCheck) {
if (!this.resolver || djConfig["skipAutoRequire"]) {
return false;
}
var fullName = this.resolver(name, domain);
if ((fullName) && (!this._loaded[fullName]) && (!this._failed[fullName])) {
var req = dojo.require;
req(fullName, false, true);
if (dojo.hostenv.findModule(fullName, false)) {
this._loaded[fullName] = true;
} else {
if (!omitModuleCheck) {
dojo.raise("dojo.ns.Ns.resolve: module '" + fullName + "' not found after loading via namespace '" + this.name + "'");
}
this._failed[fullName] = true;
}
}
return Boolean(this._loaded[fullName]);
};
dojo.registerNamespace = function (name, module, resolver) {
dojo.ns.register.apply(dojo.ns, arguments);
};
dojo.registerNamespaceResolver = function (name, resolver) {
var n = dojo.ns.namespaces[name];
if (n) {
n.resolver = resolver;
}
};
dojo.registerNamespaceManifest = function (module, path, name, widgetModule, resolver) {
dojo.registerModulePath(name, path);
dojo.registerNamespace(name, widgetModule, resolver);
};
dojo.registerNamespace("dojo", "dojo.widget");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/iCalendar.js
New file
0,0 → 1,13
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.require("dojo.cal.iCalendar");
dojo.deprecated("dojo.icalendar", "use dojo.cal.iCalendar isntead", "0.5");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/cal/iCalendar.js
New file
0,0 → 1,565
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.cal.iCalendar");
dojo.require("dojo.lang.common");
dojo.require("dojo.cal.textDirectory");
dojo.require("dojo.date.common");
dojo.require("dojo.date.serialize");
dojo.cal.iCalendar.fromText = function (text) {
var properties = dojo.cal.textDirectory.tokenise(text);
var calendars = [];
for (var i = 0, begun = false; i < properties.length; i++) {
var prop = properties[i];
if (!begun) {
if (prop.name == "BEGIN" && prop.value == "VCALENDAR") {
begun = true;
var calbody = [];
}
} else {
if (prop.name == "END" && prop.value == "VCALENDAR") {
calendars.push(new dojo.cal.iCalendar.VCalendar(calbody));
begun = false;
} else {
calbody.push(prop);
}
}
}
return calendars;
};
dojo.cal.iCalendar.Component = function (body) {
if (!this.name) {
this.name = "COMPONENT";
}
this.properties = [];
this.components = [];
if (body) {
for (var i = 0, context = ""; i < body.length; i++) {
if (context == "") {
if (body[i].name == "BEGIN") {
context = body[i].value;
var childprops = [];
} else {
this.addProperty(new dojo.cal.iCalendar.Property(body[i]));
}
} else {
if (body[i].name == "END" && body[i].value == context) {
if (context == "VEVENT") {
this.addComponent(new dojo.cal.iCalendar.VEvent(childprops));
} else {
if (context == "VTIMEZONE") {
this.addComponent(new dojo.cal.iCalendar.VTimeZone(childprops));
} else {
if (context == "VTODO") {
this.addComponent(new dojo.cal.iCalendar.VTodo(childprops));
} else {
if (context == "VJOURNAL") {
this.addComponent(new dojo.cal.iCalendar.VJournal(childprops));
} else {
if (context == "VFREEBUSY") {
this.addComponent(new dojo.cal.iCalendar.VFreeBusy(childprops));
} else {
if (context == "STANDARD") {
this.addComponent(new dojo.cal.iCalendar.Standard(childprops));
} else {
if (context == "DAYLIGHT") {
this.addComponent(new dojo.cal.iCalendar.Daylight(childprops));
} else {
if (context == "VALARM") {
this.addComponent(new dojo.cal.iCalendar.VAlarm(childprops));
} else {
dojo.unimplemented("dojo.cal.iCalendar." + context);
}
}
}
}
}
}
}
}
context = "";
} else {
childprops.push(body[i]);
}
}
}
if (this._ValidProperties) {
this.postCreate();
}
}
};
dojo.extend(dojo.cal.iCalendar.Component, {addProperty:function (prop) {
this.properties.push(prop);
this[prop.name.toLowerCase()] = prop;
}, addComponent:function (prop) {
this.components.push(prop);
}, postCreate:function () {
for (var x = 0; x < this._ValidProperties.length; x++) {
var evtProperty = this._ValidProperties[x];
var found = false;
for (var y = 0; y < this.properties.length; y++) {
var prop = this.properties[y];
var propName = prop.name.toLowerCase();
if (dojo.lang.isArray(evtProperty)) {
var alreadySet = false;
for (var z = 0; z < evtProperty.length; z++) {
var evtPropertyName = evtProperty[z].name.toLowerCase();
if ((this[evtPropertyName]) && (evtPropertyName != propName)) {
alreadySet = true;
}
}
if (!alreadySet) {
this[propName] = prop;
}
} else {
if (propName == evtProperty.name.toLowerCase()) {
found = true;
if (evtProperty.occurance == 1) {
this[propName] = prop;
} else {
found = true;
if (!dojo.lang.isArray(this[propName])) {
this[propName] = [];
}
this[propName].push(prop);
}
}
}
}
if (evtProperty.required && !found) {
dojo.debug("iCalendar - " + this.name + ": Required Property not found: " + evtProperty.name);
}
}
if (dojo.lang.isArray(this.rrule)) {
for (var x = 0; x < this.rrule.length; x++) {
var rule = this.rrule[x].value;
this.rrule[x].cache = function () {
};
var temp = rule.split(";");
for (var y = 0; y < temp.length; y++) {
var pair = temp[y].split("=");
var key = pair[0].toLowerCase();
var val = pair[1];
if ((key == "freq") || (key == "interval") || (key == "until")) {
this.rrule[x][key] = val;
} else {
var valArray = val.split(",");
this.rrule[x][key] = valArray;
}
}
}
this.recurring = true;
}
}, toString:function () {
return "[iCalendar.Component; " + this.name + ", " + this.properties.length + " properties, " + this.components.length + " components]";
}});
dojo.cal.iCalendar.Property = function (prop) {
this.name = prop.name;
this.group = prop.group;
this.params = prop.params;
this.value = prop.value;
};
dojo.extend(dojo.cal.iCalendar.Property, {toString:function () {
return "[iCalenday.Property; " + this.name + ": " + this.value + "]";
}});
var _P = function (n, oc, req) {
return {name:n, required:(req) ? true : false, occurance:(oc == "*" || !oc) ? -1 : oc};
};
dojo.cal.iCalendar.VCalendar = function (calbody) {
this.name = "VCALENDAR";
this.recurring = [];
this.nonRecurringEvents = function () {
};
dojo.cal.iCalendar.Component.call(this, calbody);
};
dojo.inherits(dojo.cal.iCalendar.VCalendar, dojo.cal.iCalendar.Component);
dojo.extend(dojo.cal.iCalendar.VCalendar, {addComponent:function (prop) {
this.components.push(prop);
if (prop.name.toLowerCase() == "vevent") {
if (prop.rrule) {
this.recurring.push(prop);
} else {
var startDate = prop.getDate();
var month = startDate.getMonth() + 1;
var dateString = month + "-" + startDate.getDate() + "-" + startDate.getFullYear();
if (!dojo.lang.isArray(this[dateString])) {
this.nonRecurringEvents[dateString] = [];
}
this.nonRecurringEvents[dateString].push(prop);
}
}
}, preComputeRecurringEvents:function (until) {
var calculatedEvents = function () {
};
for (var x = 0; x < this.recurring.length; x++) {
var dates = this.recurring[x].getDates(until);
for (var y = 0; y < dates.length; y++) {
var month = dates[y].getMonth() + 1;
var dateStr = month + "-" + dates[y].getDate() + "-" + dates[y].getFullYear();
if (!dojo.lang.isArray(calculatedEvents[dateStr])) {
calculatedEvents[dateStr] = [];
}
if (!dojo.lang.inArray(calculatedEvents[dateStr], this.recurring[x])) {
calculatedEvents[dateStr].push(this.recurring[x]);
}
}
}
this.recurringEvents = calculatedEvents;
}, getEvents:function (date) {
var events = [];
var recur = [];
var nonRecur = [];
var month = date.getMonth() + 1;
var dateStr = month + "-" + date.getDate() + "-" + date.getFullYear();
if (dojo.lang.isArray(this.nonRecurringEvents[dateStr])) {
nonRecur = this.nonRecurringEvents[dateStr];
dojo.debug("Number of nonRecurring Events: " + nonRecur.length);
}
if (dojo.lang.isArray(this.recurringEvents[dateStr])) {
recur = this.recurringEvents[dateStr];
}
events = recur.concat(nonRecur);
if (events.length > 0) {
return events;
}
return null;
}});
var StandardProperties = [_P("dtstart", 1, true), _P("tzoffsetto", 1, true), _P("tzoffsetfrom", 1, true), _P("comment"), _P("rdate"), _P("rrule"), _P("tzname")];
dojo.cal.iCalendar.Standard = function (body) {
this.name = "STANDARD";
this._ValidProperties = StandardProperties;
dojo.cal.iCalendar.Component.call(this, body);
};
dojo.inherits(dojo.cal.iCalendar.Standard, dojo.cal.iCalendar.Component);
var DaylightProperties = [_P("dtstart", 1, true), _P("tzoffsetto", 1, true), _P("tzoffsetfrom", 1, true), _P("comment"), _P("rdate"), _P("rrule"), _P("tzname")];
dojo.cal.iCalendar.Daylight = function (body) {
this.name = "DAYLIGHT";
this._ValidProperties = DaylightProperties;
dojo.cal.iCalendar.Component.call(this, body);
};
dojo.inherits(dojo.cal.iCalendar.Daylight, dojo.cal.iCalendar.Component);
var VEventProperties = [_P("class", 1), _P("created", 1), _P("description", 1), _P("dtstart", 1), _P("geo", 1), _P("last-mod", 1), _P("location", 1), _P("organizer", 1), _P("priority", 1), _P("dtstamp", 1), _P("seq", 1), _P("status", 1), _P("summary", 1), _P("transp", 1), _P("uid", 1), _P("url", 1), _P("recurid", 1), [_P("dtend", 1), _P("duration", 1)], _P("attach"), _P("attendee"), _P("categories"), _P("comment"), _P("contact"), _P("exdate"), _P("exrule"), _P("rstatus"), _P("related"), _P("resources"), _P("rdate"), _P("rrule")];
dojo.cal.iCalendar.VEvent = function (body) {
this._ValidProperties = VEventProperties;
this.name = "VEVENT";
dojo.cal.iCalendar.Component.call(this, body);
this.recurring = false;
this.startDate = dojo.date.fromIso8601(this.dtstart.value);
};
dojo.inherits(dojo.cal.iCalendar.VEvent, dojo.cal.iCalendar.Component);
dojo.extend(dojo.cal.iCalendar.VEvent, {getDates:function (until) {
var dtstart = this.getDate();
var recurranceSet = [];
var weekdays = ["su", "mo", "tu", "we", "th", "fr", "sa"];
var order = {"daily":1, "weekly":2, "monthly":3, "yearly":4, "byday":1, "bymonthday":1, "byweekno":2, "bymonth":3, "byyearday":4};
for (var x = 0; x < this.rrule.length; x++) {
var rrule = this.rrule[x];
var freq = rrule.freq.toLowerCase();
var interval = 1;
if (rrule.interval > interval) {
interval = rrule.interval;
}
var set = [];
var freqInt = order[freq];
if (rrule.until) {
var tmpUntil = dojo.date.fromIso8601(rrule.until);
} else {
var tmpUntil = until;
}
if (tmpUntil > until) {
tmpUntil = until;
}
if (dtstart < tmpUntil) {
var expandingRules = function () {
};
var cullingRules = function () {
};
expandingRules.length = 0;
cullingRules.length = 0;
switch (freq) {
case "yearly":
var nextDate = new Date(dtstart);
set.push(nextDate);
while (nextDate < tmpUntil) {
nextDate.setYear(nextDate.getFullYear() + interval);
tmpDate = new Date(nextDate);
if (tmpDate < tmpUntil) {
set.push(tmpDate);
}
}
break;
case "monthly":
nextDate = new Date(dtstart);
set.push(nextDate);
while (nextDate < tmpUntil) {
nextDate.setMonth(nextDate.getMonth() + interval);
var tmpDate = new Date(nextDate);
if (tmpDate < tmpUntil) {
set.push(tmpDate);
}
}
break;
case "weekly":
nextDate = new Date(dtstart);
set.push(nextDate);
while (nextDate < tmpUntil) {
nextDate.setDate(nextDate.getDate() + (7 * interval));
var tmpDate = new Date(nextDate);
if (tmpDate < tmpUntil) {
set.push(tmpDate);
}
}
break;
case "daily":
nextDate = new Date(dtstart);
set.push(nextDate);
while (nextDate < tmpUntil) {
nextDate.setDate(nextDate.getDate() + interval);
var tmpDate = new Date(nextDate);
if (tmpDate < tmpUntil) {
set.push(tmpDate);
}
}
break;
}
if ((rrule["bymonth"]) && (order["bymonth"] < freqInt)) {
for (var z = 0; z < rrule["bymonth"].length; z++) {
if (z == 0) {
for (var zz = 0; zz < set.length; zz++) {
set[zz].setMonth(rrule["bymonth"][z] - 1);
}
} else {
var subset = [];
for (var zz = 0; zz < set.length; zz++) {
var newDate = new Date(set[zz]);
newDate.setMonth(rrule[z]);
subset.push(newDate);
}
tmp = set.concat(subset);
set = tmp;
}
}
}
if (rrule["byweekno"] && !rrule["bymonth"]) {
dojo.debug("TODO: no support for byweekno yet");
}
if (rrule["byyearday"] && !rrule["bymonth"] && !rrule["byweekno"]) {
if (rrule["byyearday"].length > 1) {
var regex = "([+-]?)([0-9]{1,3})";
for (var z = 1; x < rrule["byyearday"].length; z++) {
var regexResult = rrule["byyearday"][z].match(regex);
if (z == 1) {
for (var zz = 0; zz < set.length; zz++) {
if (regexResult[1] == "-") {
dojo.date.setDayOfYear(set[zz], 366 - regexResult[2]);
} else {
dojo.date.setDayOfYear(set[zz], regexResult[2]);
}
}
} else {
var subset = [];
for (var zz = 0; zz < set.length; zz++) {
var newDate = new Date(set[zz]);
if (regexResult[1] == "-") {
dojo.date.setDayOfYear(newDate, 366 - regexResult[2]);
} else {
dojo.date.setDayOfYear(newDate, regexResult[2]);
}
subset.push(newDate);
}
tmp = set.concat(subset);
set = tmp;
}
}
}
}
if (rrule["bymonthday"] && (order["bymonthday"] < freqInt)) {
if (rrule["bymonthday"].length > 0) {
var regex = "([+-]?)([0-9]{1,3})";
for (var z = 0; z < rrule["bymonthday"].length; z++) {
var regexResult = rrule["bymonthday"][z].match(regex);
if (z == 0) {
for (var zz = 0; zz < set.length; zz++) {
if (regexResult[1] == "-") {
if (regexResult[2] < dojo.date.getDaysInMonth(set[zz])) {
set[zz].setDate(dojo.date.getDaysInMonth(set[zz]) - regexResult[2]);
}
} else {
if (regexResult[2] < dojo.date.getDaysInMonth(set[zz])) {
set[zz].setDate(regexResult[2]);
}
}
}
} else {
var subset = [];
for (var zz = 0; zz < set.length; zz++) {
var newDate = new Date(set[zz]);
if (regexResult[1] == "-") {
if (regexResult[2] < dojo.date.getDaysInMonth(set[zz])) {
newDate.setDate(dojo.date.getDaysInMonth(set[zz]) - regexResult[2]);
}
} else {
if (regexResult[2] < dojo.date.getDaysInMonth(set[zz])) {
newDate.setDate(regexResult[2]);
}
}
subset.push(newDate);
}
tmp = set.concat(subset);
set = tmp;
}
}
}
}
if (rrule["byday"] && (order["byday"] < freqInt)) {
if (rrule["bymonth"]) {
if (rrule["byday"].length > 0) {
var regex = "([+-]?)([0-9]{0,1}?)([A-Za-z]{1,2})";
for (var z = 0; z < rrule["byday"].length; z++) {
var regexResult = rrule["byday"][z].match(regex);
var occurance = regexResult[2];
var day = regexResult[3].toLowerCase();
if (z == 0) {
for (var zz = 0; zz < set.length; zz++) {
if (regexResult[1] == "-") {
var numDaysFound = 0;
var lastDayOfMonth = dojo.date.getDaysInMonth(set[zz]);
var daysToSubtract = 1;
set[zz].setDate(lastDayOfMonth);
if (weekdays[set[zz].getDay()] == day) {
numDaysFound++;
daysToSubtract = 7;
}
daysToSubtract = 1;
while (numDaysFound < occurance) {
set[zz].setDate(set[zz].getDate() - daysToSubtract);
if (weekdays[set[zz].getDay()] == day) {
numDaysFound++;
daysToSubtract = 7;
}
}
} else {
if (occurance) {
var numDaysFound = 0;
set[zz].setDate(1);
var daysToAdd = 1;
if (weekdays[set[zz].getDay()] == day) {
numDaysFound++;
daysToAdd = 7;
}
while (numDaysFound < occurance) {
set[zz].setDate(set[zz].getDate() + daysToAdd);
if (weekdays[set[zz].getDay()] == day) {
numDaysFound++;
daysToAdd = 7;
}
}
} else {
var numDaysFound = 0;
var subset = [];
lastDayOfMonth = new Date(set[zz]);
var daysInMonth = dojo.date.getDaysInMonth(set[zz]);
lastDayOfMonth.setDate(daysInMonth);
set[zz].setDate(1);
if (weekdays[set[zz].getDay()] == day) {
numDaysFound++;
}
var tmpDate = new Date(set[zz]);
daysToAdd = 1;
while (tmpDate.getDate() < lastDayOfMonth) {
if (weekdays[tmpDate.getDay()] == day) {
numDaysFound++;
if (numDaysFound == 1) {
set[zz] = tmpDate;
} else {
subset.push(tmpDate);
tmpDate = new Date(tmpDate);
daysToAdd = 7;
tmpDate.setDate(tmpDate.getDate() + daysToAdd);
}
} else {
tmpDate.setDate(tmpDate.getDate() + daysToAdd);
}
}
var t = set.concat(subset);
set = t;
}
}
}
} else {
var subset = [];
for (var zz = 0; zz < set.length; zz++) {
var newDate = new Date(set[zz]);
if (regexResult[1] == "-") {
if (regexResult[2] < dojo.date.getDaysInMonth(set[zz])) {
newDate.setDate(dojo.date.getDaysInMonth(set[zz]) - regexResult[2]);
}
} else {
if (regexResult[2] < dojo.date.getDaysInMonth(set[zz])) {
newDate.setDate(regexResult[2]);
}
}
subset.push(newDate);
}
tmp = set.concat(subset);
set = tmp;
}
}
}
} else {
dojo.debug("TODO: byday within a yearly rule without a bymonth");
}
}
dojo.debug("TODO: Process BYrules for units larger than frequency");
var tmp = recurranceSet.concat(set);
recurranceSet = tmp;
}
}
recurranceSet.push(dtstart);
return recurranceSet;
}, getDate:function () {
return dojo.date.fromIso8601(this.dtstart.value);
}});
var VTimeZoneProperties = [_P("tzid", 1, true), _P("last-mod", 1), _P("tzurl", 1)];
dojo.cal.iCalendar.VTimeZone = function (body) {
this.name = "VTIMEZONE";
this._ValidProperties = VTimeZoneProperties;
dojo.cal.iCalendar.Component.call(this, body);
};
dojo.inherits(dojo.cal.iCalendar.VTimeZone, dojo.cal.iCalendar.Component);
var VTodoProperties = [_P("class", 1), _P("completed", 1), _P("created", 1), _P("description", 1), _P("dtstart", 1), _P("geo", 1), _P("last-mod", 1), _P("location", 1), _P("organizer", 1), _P("percent", 1), _P("priority", 1), _P("dtstamp", 1), _P("seq", 1), _P("status", 1), _P("summary", 1), _P("uid", 1), _P("url", 1), _P("recurid", 1), [_P("due", 1), _P("duration", 1)], _P("attach"), _P("attendee"), _P("categories"), _P("comment"), _P("contact"), _P("exdate"), _P("exrule"), _P("rstatus"), _P("related"), _P("resources"), _P("rdate"), _P("rrule")];
dojo.cal.iCalendar.VTodo = function (body) {
this.name = "VTODO";
this._ValidProperties = VTodoProperties;
dojo.cal.iCalendar.Component.call(this, body);
};
dojo.inherits(dojo.cal.iCalendar.VTodo, dojo.cal.iCalendar.Component);
var VJournalProperties = [_P("class", 1), _P("created", 1), _P("description", 1), _P("dtstart", 1), _P("last-mod", 1), _P("organizer", 1), _P("dtstamp", 1), _P("seq", 1), _P("status", 1), _P("summary", 1), _P("uid", 1), _P("url", 1), _P("recurid", 1), _P("attach"), _P("attendee"), _P("categories"), _P("comment"), _P("contact"), _P("exdate"), _P("exrule"), _P("related"), _P("rstatus"), _P("rdate"), _P("rrule")];
dojo.cal.iCalendar.VJournal = function (body) {
this.name = "VJOURNAL";
this._ValidProperties = VJournalProperties;
dojo.cal.iCalendar.Component.call(this, body);
};
dojo.inherits(dojo.cal.iCalendar.VJournal, dojo.cal.iCalendar.Component);
var VFreeBusyProperties = [_P("contact"), _P("dtstart", 1), _P("dtend"), _P("duration"), _P("organizer", 1), _P("dtstamp", 1), _P("uid", 1), _P("url", 1), _P("attendee"), _P("comment"), _P("freebusy"), _P("rstatus")];
dojo.cal.iCalendar.VFreeBusy = function (body) {
this.name = "VFREEBUSY";
this._ValidProperties = VFreeBusyProperties;
dojo.cal.iCalendar.Component.call(this, body);
};
dojo.inherits(dojo.cal.iCalendar.VFreeBusy, dojo.cal.iCalendar.Component);
var VAlarmProperties = [[_P("action", 1, true), _P("trigger", 1, true), [_P("duration", 1), _P("repeat", 1)], _P("attach", 1)], [_P("action", 1, true), _P("description", 1, true), _P("trigger", 1, true), [_P("duration", 1), _P("repeat", 1)]], [_P("action", 1, true), _P("description", 1, true), _P("trigger", 1, true), _P("summary", 1, true), _P("attendee", "*", true), [_P("duration", 1), _P("repeat", 1)], _P("attach", 1)], [_P("action", 1, true), _P("attach", 1, true), _P("trigger", 1, true), [_P("duration", 1), _P("repeat", 1)], _P("description", 1)]];
dojo.cal.iCalendar.VAlarm = function (body) {
this.name = "VALARM";
this._ValidProperties = VAlarmProperties;
dojo.cal.iCalendar.Component.call(this, body);
};
dojo.inherits(dojo.cal.iCalendar.VAlarm, dojo.cal.iCalendar.Component);
 
/tags/Racine_livraison_narmer/api/js/dojo/src/cal/textDirectory.js
New file
0,0 → 1,55
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.cal.textDirectory");
dojo.require("dojo.string");
dojo.cal.textDirectory.Property = function (line) {
var left = dojo.string.trim(line.substring(0, line.indexOf(":")));
var right = dojo.string.trim(line.substr(line.indexOf(":") + 1));
var parameters = dojo.string.splitEscaped(left, ";");
this.name = parameters[0];
parameters.splice(0, 1);
this.params = [];
var arr;
for (var i = 0; i < parameters.length; i++) {
arr = parameters[i].split("=");
var key = dojo.string.trim(arr[0].toUpperCase());
if (arr.length == 1) {
this.params.push([key]);
continue;
}
var values = dojo.string.splitEscaped(arr[1], ",");
for (var j = 0; j < values.length; j++) {
if (dojo.string.trim(values[j]) != "") {
this.params.push([key, dojo.string.trim(values[j])]);
}
}
}
if (this.name.indexOf(".") > 0) {
arr = this.name.split(".");
this.group = arr[0];
this.name = arr[1];
}
this.value = right;
};
dojo.cal.textDirectory.tokenise = function (text) {
var nText = dojo.string.normalizeNewlines(text, "\n").replace(/\n[ \t]/g, "").replace(/\x00/g, "");
var lines = nText.split("\n");
var properties = [];
for (var i = 0; i < lines.length; i++) {
if (dojo.string.trim(lines[i]) == "") {
continue;
}
var prop = new dojo.cal.textDirectory.Property(lines[i]);
properties.push(prop);
}
return properties;
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/graphics/color/hsl.js
New file
0,0 → 1,30
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.graphics.color.hsl");
dojo.require("dojo.gfx.color.hsl");
dojo.deprecated("dojo.graphics.color.hsl has been replaced with dojo.gfx.color.hsl", "0.5");
dojo.graphics.color.rgb2hsl = function (r, g, b) {
dojo.deprecated("dojo.graphics.color.rgb2hsl has been replaced with dojo.gfx.color.rgb2hsl", "0.5");
return dojo.gfx.color.rgb2hsl(r, g, b);
};
dojo.graphics.color.hsl2rgb = function (h, s, l) {
dojo.deprecated("dojo.graphics.color.hsl2rgb has been replaced with dojo.gfx.color.hsl2rgb", "0.5");
return dojo.gfx.color.hsl2rgb(h, s, l);
};
dojo.graphics.color.hsl2hex = function (h, s, l) {
dojo.deprecated("dojo.graphics.color.hsl2hex has been replaced with dojo.gfx.color.hsl2hex", "0.5");
return dojo.gfx.color.hsl2hex(h, s, l);
};
dojo.graphics.color.hex2hsl = function (hex) {
dojo.deprecated("dojo.graphics.color.hex2hsl has been replaced with dojo.gfx.color.hex2hsl", "0.5");
return dojo.gfx.color.hex2hsl(hex);
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/graphics/color/hsv.js
New file
0,0 → 1,22
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.graphics.color.hsv");
dojo.require("dojo.gfx.color.hsv");
dojo.deprecated("dojo.graphics.color.hsv has been replaced by dojo.gfx.color.hsv", "0.5");
dojo.graphics.color.rgb2hsv = function (r, g, b) {
dojo.deprecated("dojo.graphics.color.rgb2hsv has been replaced by dojo.gfx.color.rgb2hsv", "0.5");
return dojo.gfx.color.rgb2hsv(r, g, b);
};
dojo.graphics.color.hsv2rgb = function (h, s, v) {
dojo.deprecated("dojo.graphics.color.hsv2rgb has been replaced by dojo.gfx.color.hsv2rgb", "0.5");
return dojo.gfx.color.hsv2rgb(h, s, v);
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/graphics/__package__.js
New file
0,0 → 1,12
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.graphics.*");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/graphics/Colorspace.js
New file
0,0 → 1,15
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.graphics.Colorspace");
dojo.require("dojo.gfx.Colorspace");
dojo.deprecated("dojo.graphics.Colorspace: use dojo.gfx.Colorspace instead.", "0.5");
dojo.graphics.Colorspace = dojo.gfx.Colorspace;
 
/tags/Racine_livraison_narmer/api/js/dojo/src/graphics/color.js
New file
0,0 → 1,36
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.graphics.color");
dojo.require("dojo.gfx.color");
dojo.deprecated("dojo.graphics.color.Color is now dojo.gfx.color.Color.", "0.5");
dojo.graphics.color.Color = dojo.gfx.color.Color;
dojo.graphics.color.named = dojo.gfx.color.named;
dojo.graphics.color.blend = function (a, b, weight) {
dojo.deprecated("dojo.graphics.color.blend is now dojo.gfx.color.blend", "0.5");
return dojo.gfx.color.blend(a, b, weight);
};
dojo.graphics.color.blendHex = function (a, b, weight) {
dojo.deprecated("dojo.graphics.color.blendHex is now dojo.gfx.color.blendHex", "0.5");
return dojo.gfx.color.rgb2hex(dojo.gfx.color.blend(dojo.gfx.color.hex2rgb(a), dojo.gfx.color.hex2rgb(b), weight));
};
dojo.graphics.color.extractRGB = function (color) {
dojo.deprecated("dojo.graphics.color.extractRGB is now dojo.gfx.color.extractRGB", "0.5");
return dojo.gfx.color.extractRGB(color);
};
dojo.graphics.color.hex2rgb = function (hex) {
dojo.deprecated("dojo.graphics.color.hex2rgb is now dojo.gfx.color.hex2rgb", "0.5");
return dojo.gfx.color.hex2rgb(hex);
};
dojo.graphics.color.rgb2hex = function (r, g, b) {
dojo.deprecated("dojo.graphics.color.rgb2hex is now dojo.gfx.color.rgb2hex", "0.5");
return dojo.gfx.color.rgb2hex;
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/validate.js
New file
0,0 → 1,13
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.validate");
dojo.require("dojo.validate.common");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/storage/browser.js
New file
0,0 → 1,548
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.storage.browser");
dojo.require("dojo.storage");
dojo.require("dojo.flash");
dojo.require("dojo.json");
dojo.require("dojo.uri.*");
dojo.storage.browser.FileStorageProvider = function () {
};
dojo.inherits(dojo.storage.browser.FileStorageProvider, dojo.storage);
dojo.storage.browser.FileStorageProvider._KEY_INDEX_FILENAME = "__dojoAllKeys";
dojo.storage.browser.FileStorageProvider._APPLET_ID = "__dojoFileJavaObj";
dojo.lang.extend(dojo.storage.browser.FileStorageProvider, {namespace:"default", initialized:false, _available:null, _statusHandler:null, _keyIndex:new Array(), initialize:function () {
if (djConfig["disableFileStorage"] == true) {
return;
}
this._loadKeyIndex();
this.initialized = true;
dojo.storage.manager.loaded();
}, isAvailable:function () {
this._available = false;
var protocol = window.location.protocol;
if (protocol.indexOf("file") != -1 || protocol.indexOf("chrome") != -1) {
this._available = this._isAvailableXPCOM();
if (this._available == false) {
this._available = this._isAvailableActiveX();
}
}
return this._available;
}, put:function (key, value, resultsHandler) {
if (this.isValidKey(key) == false) {
dojo.raise("Invalid key given: " + key);
}
this._statusHandler = resultsHandler;
try {
this._save(key, value);
resultsHandler.call(null, dojo.storage.SUCCESS, key);
}
catch (e) {
this._statusHandler.call(null, dojo.storage.FAILED, key, e.toString());
}
}, get:function (key) {
if (this.isValidKey(key) == false) {
dojo.raise("Invalid key given: " + key);
}
var results = this._load(key);
return results;
}, getKeys:function () {
return this._keyIndex;
}, hasKey:function (key) {
if (this.isValidKey(key) == false) {
dojo.raise("Invalid key given: " + key);
}
this._loadKeyIndex();
var exists = false;
for (var i = 0; i < this._keyIndex.length; i++) {
if (this._keyIndex[i] == key) {
exists = true;
}
}
return exists;
}, clear:function () {
this._loadKeyIndex();
var keyIndex = new Array();
for (var i = 0; i < this._keyIndex.length; i++) {
keyIndex[keyIndex.length] = new String(this._keyIndex[i]);
}
for (var i = 0; i < keyIndex.length; i++) {
this.remove(keyIndex[i]);
}
}, remove:function (key) {
if (this.isValidKey(key) == false) {
dojo.raise("Invalid key given: " + key);
}
this._loadKeyIndex();
for (var i = 0; i < this._keyIndex.length; i++) {
if (this._keyIndex[i] == key) {
this._keyIndex.splice(i, 1);
break;
}
}
this._save(dojo.storage.browser.FileStorageProvider._KEY_INDEX_FILENAME, this._keyIndex, false);
var fullPath = this._getPagePath() + key + ".txt";
if (this._isAvailableXPCOM()) {
this._removeXPCOM(fullPath);
} else {
if (this._isAvailableActiveX()) {
this._removeActiveX(fullPath);
}
}
}, isPermanent:function () {
return true;
}, getMaximumSize:function () {
return dojo.storage.SIZE_NO_LIMIT;
}, hasSettingsUI:function () {
return false;
}, showSettingsUI:function () {
dojo.raise(this.getType() + " does not support a storage settings user-interface");
}, hideSettingsUI:function () {
dojo.raise(this.getType() + " does not support a storage settings user-interface");
}, getType:function () {
return "dojo.storage.browser.FileStorageProvider";
}, _save:function (key, value, updateKeyIndex) {
if (typeof updateKeyIndex == "undefined") {
updateKeyIndex = true;
}
if (dojo.lang.isString(value) == false) {
value = dojo.json.serialize(value);
value = "/* JavaScript */\n" + value + "\n\n";
}
var fullPath = this._getPagePath() + key + ".txt";
if (this._isAvailableXPCOM()) {
this._saveFileXPCOM(fullPath, value);
} else {
if (this._isAvailableActiveX()) {
this._saveFileActiveX(fullPath, value);
}
}
if (updateKeyIndex) {
this._updateKeyIndex(key);
}
}, _load:function (key) {
var fullPath = this._getPagePath() + key + ".txt";
var results = null;
if (this._isAvailableXPCOM()) {
results = this._loadFileXPCOM(fullPath);
} else {
if (this._isAvailableActiveX()) {
results = this._loadFileActiveX(fullPath);
} else {
if (this._isAvailableJava()) {
results = this._loadFileJava(fullPath);
}
}
}
if (results == null) {
return null;
}
if (!dojo.lang.isUndefined(results) && results != null && /^\/\* JavaScript \*\//.test(results)) {
results = dojo.json.evalJson(results);
}
return results;
}, _updateKeyIndex:function (key) {
this._loadKeyIndex();
var alreadyAdded = false;
for (var i = 0; i < this._keyIndex.length; i++) {
if (this._keyIndex[i] == key) {
alreadyAdded = true;
break;
}
}
if (alreadyAdded == false) {
this._keyIndex[this._keyIndex.length] = key;
}
this._save(dojo.storage.browser.FileStorageProvider._KEY_INDEX_FILENAME, this._keyIndex, false);
}, _loadKeyIndex:function () {
var indexContents = this._load(dojo.storage.browser.FileStorageProvider._KEY_INDEX_FILENAME);
if (indexContents == null) {
this._keyIndex = new Array();
} else {
this._keyIndex = indexContents;
}
}, _saveFileXPCOM:function (filename, value) {
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var f = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
f.initWithPath(filename);
var ouputStream = Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream);
ouputStream.init(f, 32 | 4 | 8, 256 + 128, null);
ouputStream.write(value, value.length);
ouputStream.close();
}
catch (e) {
var msg = e.toString();
if (e.name && e.message) {
msg = e.name + ": " + e.message;
}
dojo.raise("dojo.storage.browser.FileStorageProvider._saveFileXPCOM(): " + msg);
}
}, _loadFileXPCOM:function (filename) {
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var f = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
f.initWithPath(filename);
if (f.exists() == false) {
return null;
}
var inp = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream);
inp.init(f, 1, 4, null);
var inputStream = Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance(Components.interfaces.nsIScriptableInputStream);
inputStream.init(inp);
var results = inputStream.read(inputStream.available());
return results;
}
catch (e) {
var msg = e.toString();
if (e.name && e.message) {
msg = e.name + ": " + e.message;
}
dojo.raise("dojo.storage.browser.FileStorageProvider._loadFileXPCOM(): " + msg);
}
return null;
}, _saveFileActiveX:function (filename, value) {
try {
var fileSystem = new ActiveXObject("Scripting.FileSystemObject");
var f = fileSystem.OpenTextFile(filename, 2, true);
f.Write(value);
f.Close();
}
catch (e) {
var msg = e.toString();
if (e.name && e.message) {
msg = e.name + ": " + e.message;
}
dojo.raise("dojo.storage.browser.FileStorageProvider._saveFileActiveX(): " + msg);
}
}, _loadFileActiveX:function (filename) {
try {
var fileSystem = new ActiveXObject("Scripting.FileSystemObject");
if (fileSystem.FileExists(filename) == false) {
return null;
}
var f = fileSystem.OpenTextFile(filename, 1);
var results = f.ReadAll();
f.Close();
return results;
}
catch (e) {
var msg = e.toString();
if (e.name && e.message) {
msg = e.name + ": " + e.message;
}
dojo.raise("dojo.storage.browser.FileStorageProvider._loadFileActiveX(): " + msg);
}
}, _saveFileJava:function (filename, value) {
try {
var applet = dojo.byId(dojo.storage.browser.FileStorageProvider._APPLET_ID);
applet.save(filename, value);
}
catch (e) {
var msg = e.toString();
if (e.name && e.message) {
msg = e.name + ": " + e.message;
}
dojo.raise("dojo.storage.browser.FileStorageProvider._saveFileJava(): " + msg);
}
}, _loadFileJava:function (filename) {
try {
var applet = dojo.byId(dojo.storage.browser.FileStorageProvider._APPLET_ID);
var results = applet.load(filename);
return results;
}
catch (e) {
var msg = e.toString();
if (e.name && e.message) {
msg = e.name + ": " + e.message;
}
dojo.raise("dojo.storage.browser.FileStorageProvider._loadFileJava(): " + msg);
}
}, _isAvailableActiveX:function () {
try {
if (window.ActiveXObject) {
var fileSystem = new window.ActiveXObject("Scripting.FileSystemObject");
return true;
}
}
catch (e) {
dojo.debug(e);
}
return false;
}, _isAvailableXPCOM:function () {
try {
if (window.Components) {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
return true;
}
}
catch (e) {
dojo.debug(e);
}
return false;
}, _isAvailableJava:function () {
try {
if (dojo.render.html.safari == true || dojo.render.html.opera == true()) {
if (navigator.javaEnabled() == true) {
return true;
}
}
}
catch (e) {
dojo.debug(e);
}
return false;
}, _getPagePath:function () {
var path = window.location.pathname;
if (/\.html?$/i.test(path)) {
path = path.replace(/(?:\/|\\)?[^\.\/\\]*\.html?$/, "");
}
if (/^\/?[a-z]+\:/i.test(path)) {
path = path.replace(/^\/?/, "");
path = path.replace(/\//g, "\\");
} else {
if (/^[\/\\]{2,3}[^\/]/.test(path)) {
path = path.replace(/^[\/\\]{2,3}/, "");
path = path.replace(/\//g, "\\");
path = "\\\\" + path;
}
}
if (/\/$/.test(path) == false && /\\$/.test(path) == false) {
if (/\//.test(path)) {
path += "/";
} else {
path += "\\";
}
}
path = unescape(path);
return path;
}, _removeXPCOM:function (filename) {
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var f = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
f.initWithPath(filename);
if (f.exists() == false || f.isDirectory()) {
return;
}
if (f.isFile()) {
f.remove(false);
}
}
catch (e) {
dojo.raise("dojo.storage.browser.FileStorageProvider.remove(): " + e.toString());
}
}, _removeActiveX:function (filename) {
try {
var fileSystem = new ActiveXObject("Scripting.FileSystemObject");
fileSystem.DeleteFile(filename);
}
catch (e) {
dojo.raise("dojo.storage.browser.FileStorageProvider.remove(): " + e.toString());
}
}, _removeJava:function (filename) {
try {
var applet = dojo.byId(dojo.storage.browser.FileStorageProvider._APPLET_ID);
applet.remove(filename);
}
catch (e) {
var msg = e.toString();
if (e.name && e.message) {
msg = e.name + ": " + e.message;
}
dojo.raise("dojo.storage.browser.FileStorageProvider._removeJava(): " + msg);
}
}, _writeApplet:function () {
var archive = dojo.uri.moduleUri("dojo", "../DojoFileStorageProvider.jar").toString();
var tag = "<applet " + "id='" + dojo.storage.browser.FileStorageProvider._APPLET_ID + "' " + "style='position: absolute; top: -500px; left: -500px; width: 1px; height: 1px;' " + "code='DojoFileStorageProvider.class' " + "archive='" + archive + "' " + "width='1' " + "height='1' " + ">" + "</applet>";
document.writeln(tag);
}});
dojo.storage.browser.WhatWGStorageProvider = function () {
};
dojo.inherits(dojo.storage.browser.WhatWGStorageProvider, dojo.storage);
dojo.lang.extend(dojo.storage.browser.WhatWGStorageProvider, {namespace:"default", initialized:false, _domain:null, _available:null, _statusHandler:null, initialize:function () {
if (djConfig["disableWhatWGStorage"] == true) {
return;
}
this._domain = location.hostname;
this.initialized = true;
dojo.storage.manager.loaded();
}, isAvailable:function () {
try {
var myStorage = globalStorage[location.hostname];
}
catch (e) {
this._available = false;
return this._available;
}
this._available = true;
return this._available;
}, put:function (key, value, resultsHandler) {
if (this.isValidKey(key) == false) {
dojo.raise("Invalid key given: " + key);
}
this._statusHandler = resultsHandler;
if (dojo.lang.isString(value)) {
value = "string:" + value;
} else {
value = dojo.json.serialize(value);
}
window.addEventListener("storage", function (evt) {
resultsHandler.call(null, dojo.storage.SUCCESS, key);
}, false);
try {
var myStorage = globalStorage[this._domain];
myStorage.setItem(key, value);
}
catch (e) {
this._statusHandler.call(null, dojo.storage.FAILED, key, e.toString());
}
}, get:function (key) {
if (this.isValidKey(key) == false) {
dojo.raise("Invalid key given: " + key);
}
var myStorage = globalStorage[this._domain];
var results = myStorage.getItem(key);
if (results == null) {
return null;
}
results = results.value;
if (!dojo.lang.isUndefined(results) && results != null && /^string:/.test(results)) {
results = results.substring("string:".length);
} else {
results = dojo.json.evalJson(results);
}
return results;
}, getKeys:function () {
var myStorage = globalStorage[this._domain];
var keysArray = new Array();
for (i = 0; i < myStorage.length; i++) {
keysArray[i] = myStorage.key(i);
}
return keysArray;
}, clear:function () {
var myStorage = globalStorage[this._domain];
var keys = new Array();
for (var i = 0; i < myStorage.length; i++) {
keys[keys.length] = myStorage.key(i);
}
for (var i = 0; i < keys.length; i++) {
myStorage.removeItem(keys[i]);
}
}, remove:function (key) {
var myStorage = globalStorage[this._domain];
myStorage.removeItem(key);
}, isPermanent:function () {
return true;
}, getMaximumSize:function () {
return dojo.storage.SIZE_NO_LIMIT;
}, hasSettingsUI:function () {
return false;
}, showSettingsUI:function () {
dojo.raise(this.getType() + " does not support a storage settings user-interface");
}, hideSettingsUI:function () {
dojo.raise(this.getType() + " does not support a storage settings user-interface");
}, getType:function () {
return "dojo.storage.browser.WhatWGProvider";
}});
dojo.storage.browser.FlashStorageProvider = function () {
};
dojo.inherits(dojo.storage.browser.FlashStorageProvider, dojo.storage);
dojo.lang.extend(dojo.storage.browser.FlashStorageProvider, {namespace:"default", initialized:false, _available:null, _statusHandler:null, initialize:function () {
if (djConfig["disableFlashStorage"] == true) {
return;
}
var loadedListener = function () {
dojo.storage._flashLoaded();
};
dojo.flash.addLoadedListener(loadedListener);
var swfloc6 = dojo.uri.moduleUri("dojo", "../Storage_version6.swf").toString();
var swfloc8 = dojo.uri.moduleUri("dojo", "../Storage_version8.swf").toString();
dojo.flash.setSwf({flash6:swfloc6, flash8:swfloc8, visible:false});
}, isAvailable:function () {
if (djConfig["disableFlashStorage"] == true) {
this._available = false;
} else {
this._available = true;
}
return this._available;
}, put:function (key, value, resultsHandler) {
if (this.isValidKey(key) == false) {
dojo.raise("Invalid key given: " + key);
}
this._statusHandler = resultsHandler;
if (dojo.lang.isString(value)) {
value = "string:" + value;
} else {
value = dojo.json.serialize(value);
}
dojo.flash.comm.put(key, value, this.namespace);
}, get:function (key) {
if (this.isValidKey(key) == false) {
dojo.raise("Invalid key given: " + key);
}
var results = dojo.flash.comm.get(key, this.namespace);
if (results == "") {
return null;
}
if (!dojo.lang.isUndefined(results) && results != null && /^string:/.test(results)) {
results = results.substring("string:".length);
} else {
results = dojo.json.evalJson(results);
}
return results;
}, getKeys:function () {
var results = dojo.flash.comm.getKeys(this.namespace);
if (results == "") {
return [];
}
return results.split(",");
}, clear:function () {
dojo.flash.comm.clear(this.namespace);
}, remove:function (key) {
dojo.unimplemented("dojo.storage.browser.FlashStorageProvider.remove");
}, isPermanent:function () {
return true;
}, getMaximumSize:function () {
return dojo.storage.SIZE_NO_LIMIT;
}, hasSettingsUI:function () {
return true;
}, showSettingsUI:function () {
dojo.flash.comm.showSettings();
dojo.flash.obj.setVisible(true);
dojo.flash.obj.center();
}, hideSettingsUI:function () {
dojo.flash.obj.setVisible(false);
if (dojo.storage.onHideSettingsUI != null && !dojo.lang.isUndefined(dojo.storage.onHideSettingsUI)) {
dojo.storage.onHideSettingsUI.call(null);
}
}, getType:function () {
return "dojo.storage.browser.FlashStorageProvider";
}, _flashLoaded:function () {
this._initialized = true;
dojo.storage.manager.loaded();
}, _onStatus:function (statusResult, key) {
var ds = dojo.storage;
var dfo = dojo.flash.obj;
if (statusResult == ds.PENDING) {
dfo.center();
dfo.setVisible(true);
} else {
dfo.setVisible(false);
}
if ((!dj_undef("_statusHandler", ds)) && (ds._statusHandler != null)) {
ds._statusHandler.call(null, statusResult, key);
}
}});
dojo.storage.manager.register("dojo.storage.browser.FileStorageProvider", new dojo.storage.browser.FileStorageProvider());
dojo.storage.manager.register("dojo.storage.browser.WhatWGStorageProvider", new dojo.storage.browser.WhatWGStorageProvider());
dojo.storage.manager.register("dojo.storage.browser.FlashStorageProvider", new dojo.storage.browser.FlashStorageProvider());
dojo.storage.manager.initialize();
 
/tags/Racine_livraison_narmer/api/js/dojo/src/storage/java/DojoFileStorageProvider.class
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/storage/java/DojoFileStorageProvider.class
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/storage/java/DojoFileStorageProvider.java
New file
0,0 → 1,54
/**
This is a simple class that can load, save, and remove
files from the native file system. It is needed by Safari and Opera
for the dojo.storage.browser.FileStorageProvider, since both of
these platforms have no native way to talk to the file system
for file:// URLs. Safari supports LiveConnect, but only for talking
to an applet, not for generic scripting by JavaScript, so we must
have an applet.
 
@author Brad Neuberg, bkn3@columbia.edu
*/
 
import java.io.*;
import java.util.*;
 
public class DojoFileStorageProvider{
public String load(String filePath)
throws IOException, FileNotFoundException{
StringBuffer results = new StringBuffer();
BufferedReader reader = new BufferedReader(
new FileReader(filePath));
String line = null;
while((line = reader.readLine()) != null){
results.append(line);
}
 
reader.close();
 
return results.toString();
}
 
public void save(String filePath, String content)
throws IOException, FileNotFoundException{
PrintWriter writer = new PrintWriter(
new BufferedWriter(
new FileWriter(filePath, false)));
writer.print(content);
 
writer.close();
}
 
public void remove(String filePath)
throws IOException, FileNotFoundException{
File f = new File(filePath);
 
if(f.exists() == false || f.isDirectory()){
return;
}
 
if(f.exists() && f.isFile()){
f.delete();
}
}
}
/tags/Racine_livraison_narmer/api/js/dojo/src/storage/__package__.js
New file
0,0 → 1,13
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.kwCompoundRequire({common:["dojo.storage"], browser:["dojo.storage.browser"]});
dojo.provide("dojo.storage.*");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/storage/storage_dialog.fla
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/storage/storage_dialog.fla
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/storage/Storage.as
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/src/storage/Storage.as
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/src/io/xip_client.html
New file
0,0 → 1,261
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
<script type="text/javascript">
// <!--
/*
This file is really focused on just sending one message to the server, and
receiving one response. The code does not expect to be re-used for multiple messages.
This might be reworked later if performance indicates a need for it.
xip fragment identifier/hash values have the form:
#id:cmd:realEncodedMessage
 
id: some ID that should be unique among messages. No inherent meaning,
just something to make sure the hash value is unique so the message
receiver knows a new message is available.
cmd: command to the receiver. Valid values are:
- init: message used to init the frame. Sent as the first URL when loading
the page. Contains some config parameters.
- loaded: the remote frame is loaded. Only sent from server to client.
- ok: the message that this page sent was received OK. The next message may
now be sent.
- start: the start message of a block of messages (a complete message may
need to be segmented into many messages to get around the limitiations
of the size of an URL that a browser accepts.
- part: indicates this is a part of a message.
- end: the end message of a block of messages. The message can now be acted upon.
If the message is small enough that it doesn't need to be segmented, then
just one hash value message can be sent with "end" as the command.
To reassemble a segmented message, the realEncodedMessage parts just have to be concatenated
together.
*/
 
//MSIE has the lowest limit for URLs with fragment identifiers,
//at around 4K. Choosing a slightly smaller number for good measure.
xipUrlLimit = 4000;
xipIdCounter = 1;
 
function xipInit(){
xipStateId = "";
xipIsSending = false;
xipServerUrl = null;
xipStateId = null;
xipRequestData = null;
xipCurrentHash = "";
xipResponseMessage = "";
xipRequestParts = [];
xipPartIndex = 0;
xipServerWindow = null;
xipUseFrameRecursion = false;
}
xipInit();
function send(encodedData){
if(xipUseFrameRecursion == "true"){
var clientEndPoint = window.open(xipStateId + "_clientEndPoint");
clientEndPoint.send(encodedData);
}else{
if(!xipIsSending){
xipIsSending = true;
xipRequestData = encodedData || "";
 
//Get a handle to the server iframe.
xipServerWindow = frames[xipStateId + "_frame"];
if (!xipServerWindow){
xipServerWindow = document.getElementById(xipStateId + "_frame").contentWindow;
}
sendRequestStart();
}
}
}
 
//Modify the server URL if it is a local path and
//This is done for local/same domain testing.
function fixServerUrl(ifpServerUrl){
if(ifpServerUrl.indexOf("..") == 0){
var parts = ifpServerUrl.split("/");
ifpServerUrl = parts[parts.length - 1];
}
return ifpServerUrl;
}
function pollHash(){
//Can't use location.hash because at least Firefox does a decodeURIComponent on it.
var urlParts = window.location.href.split("#");
if(urlParts.length == 2){
var newHash = urlParts[1];
if(newHash != xipCurrentHash){
try{
messageReceived(newHash);
}catch(e){
//Make sure to not keep processing the error hash value.
xipCurrentHash = newHash;
throw e;
}
xipCurrentHash = newHash;
}
}
}
 
function messageReceived(encodedData){
var msg = unpackMessage(encodedData);
 
switch(msg.command){
case "loaded":
xipMasterFrame.dojo.io.XhrIframeProxy.clientFrameLoaded(xipStateId);
break;
case "ok":
sendRequestPart();
break;
case "start":
xipResponseMessage = "";
xipResponseMessage += msg.message;
setServerUrl("ok");
break;
case "part":
xipResponseMessage += msg.message;
setServerUrl("ok");
break;
case "end":
setServerUrl("ok");
xipResponseMessage += msg.message;
xipMasterFrame.dojo.io.XhrIframeProxy.receive(xipStateId, xipResponseMessage);
break;
}
}
function sendRequestStart(){
//Break the message into parts, if necessary.
xipRequestParts = [];
var reqData = xipRequestData;
var urlLength = xipServerUrl.length;
var partLength = xipUrlLimit - urlLength;
var reqIndex = 0;
 
while((reqData.length - reqIndex) + urlLength > xipUrlLimit){
var part = reqData.substring(reqIndex, reqIndex + partLength);
//Safari will do some extra hex escaping unless we keep the original hex
//escaping complete.
var percentIndex = part.lastIndexOf("%");
if(percentIndex == part.length - 1 || percentIndex == part.length - 2){
part = part.substring(0, percentIndex);
}
xipRequestParts.push(part);
reqIndex += part.length;
}
xipRequestParts.push(reqData.substring(reqIndex, reqData.length));
xipPartIndex = 0;
sendRequestPart();
}
function sendRequestPart(){
if(xipPartIndex < xipRequestParts.length){
//Get the message part.
var partData = xipRequestParts[xipPartIndex];
 
//Get the command.
var cmd = "part";
if(xipPartIndex + 1 == xipRequestParts.length){
cmd = "end";
}else if (xipPartIndex == 0){
cmd = "start";
}
setServerUrl(cmd, partData);
xipPartIndex++;
}
}
function setServerUrl(cmd, message){
var serverUrl = makeServerUrl(cmd, message);
 
//Safari won't let us replace across domains.
if(navigator.userAgent.indexOf("Safari") == -1){
xipServerWindow.location.replace(serverUrl);
}else{
xipServerWindow.location = serverUrl;
}
}
function makeServerUrl(cmd, message){
var serverUrl = xipServerUrl + "#" + (xipIdCounter++) + ":" + cmd;
if(message){
serverUrl += ":" + message;
}
return serverUrl;
}
 
function unpackMessage(encodedMessage){
var parts = encodedMessage.split(":");
var command = parts[1];
encodedMessage = parts[2] || "";
 
var config = null;
if(command == "init"){
var configParts = encodedMessage.split("&");
config = {};
for(var i = 0; i < configParts.length; i++){
var nameValue = configParts[i].split("=");
config[decodeURIComponent(nameValue[0])] = decodeURIComponent(nameValue[1]);
}
}
return {command: command, message: encodedMessage, config: config};
}
 
function onClientLoad(){
//Decode the init params
var config = unpackMessage(window.location.href.split("#")[1]).config;
 
xipStateId = config.id;
 
//Remove the query param for the IE7 recursive case.
xipServerUrl = fixServerUrl(config.server).replace(/(\?|\&)dojo\.fr\=1/, "");
xipUseFrameRecursion = config["fr"];
if(xipUseFrameRecursion == "endpoint"){
xipMasterFrame = parent.parent;
}else{
xipMasterFrame = parent;
}
//Start counter to inspect hash value.
setInterval(pollHash, 10);
 
var clientUrl = window.location.href.split("#")[0];
document.getElementById("iframeHolder").innerHTML = '<iframe src="'
+ makeServerUrl("init", 'id=' + xipStateId + '&client=' + encodeURIComponent(clientUrl)
+ '&fr=' + xipUseFrameRecursion) + '" id="' + xipStateId + '_frame"></iframe>';
}
 
if(typeof(window.addEventListener) == "undefined"){
window.attachEvent("onload", onClientLoad);
}else{
window.addEventListener('load', onClientLoad, false);
}
// -->
</script>
</head>
<body>
<h4>The Dojo Toolkit -- xip_client.html</h4>
 
<p>This file is used for Dojo's XMLHttpRequest Iframe Proxy. This is the "client" file used
internally by dojo.io.XhrIframeProxy.</p>
<span id="iframeHolder"></span>
</body>
</html>
/tags/Racine_livraison_narmer/api/js/dojo/src/io/RhinoIO.js
New file
0,0 → 1,114
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.io.RhinoIO");
dojo.require("dojo.io.common");
dojo.require("dojo.lang.func");
dojo.require("dojo.lang.array");
dojo.require("dojo.string.extras");
dojo.io.RhinoHTTPTransport = new function () {
this.canHandle = function (req) {
if (dojo.lang.find(["text/plain", "text/html", "text/xml", "text/javascript", "text/json", "application/json"], (req.mimetype.toLowerCase() || "")) < 0) {
return false;
}
if (req.url.substr(0, 7) != "http://") {
return false;
}
return true;
};
function doLoad(req, conn) {
var ret;
if (req.method.toLowerCase() == "head") {
} else {
var stream = conn.getContent();
var reader = new java.io.BufferedReader(new java.io.InputStreamReader(stream));
var text = "";
var line = null;
while ((line = reader.readLine()) != null) {
text += line;
}
if (req.mimetype == "text/javascript") {
try {
ret = dj_eval(text);
}
catch (e) {
dojo.debug(e);
dojo.debug(text);
ret = null;
}
} else {
if (req.mimetype == "text/json" || req.mimetype == "application/json") {
try {
ret = dj_eval("(" + text + ")");
}
catch (e) {
dojo.debug(e);
dojo.debug(text);
ret = false;
}
} else {
ret = text;
}
}
}
req.load("load", ret, req);
}
function connect(req) {
var content = req.content || {};
var query;
if (req.sendTransport) {
content["dojo.transport"] = "rhinohttp";
}
if (req.postContent) {
query = req.postContent;
} else {
query = dojo.io.argsFromMap(content, req.encoding);
}
var url_text = req.url;
if (req.method.toLowerCase() == "get" && query != "") {
url_text = url_text + "?" + query;
}
var url = new java.net.URL(url_text);
var conn = url.openConnection();
conn.setRequestMethod(req.method.toUpperCase());
if (req.headers) {
for (var header in req.headers) {
if (header.toLowerCase() == "content-type" && !req.contentType) {
req.contentType = req.headers[header];
} else {
conn.setRequestProperty(header, req.headers[header]);
}
}
}
if (req.contentType) {
conn.setRequestProperty("Content-Type", req.contentType);
}
if (req.method.toLowerCase() == "post") {
conn.setDoOutput(true);
var output_stream = conn.getOutputStream();
var byte_array = (new java.lang.String(query)).getBytes();
output_stream.write(byte_array, 0, byte_array.length);
}
conn.connect();
doLoad(req, conn);
}
this.bind = function (req) {
var async = req["sync"] ? false : true;
if (async) {
setTimeout(dojo.lang.hitch(this, function () {
connect(req);
}), 1);
} else {
connect(req);
}
};
dojo.io.transports.addTransport("RhinoHTTPTransport");
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/io/XhrIframeProxy.js
New file
0,0 → 1,150
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.io.XhrIframeProxy");
dojo.require("dojo.experimental");
dojo.experimental("dojo.io.XhrIframeProxy");
dojo.require("dojo.io.IframeIO");
dojo.require("dojo.dom");
dojo.require("dojo.uri.Uri");
dojo.io.XhrIframeProxy = {xipClientUrl:djConfig["xipClientUrl"] || dojo.uri.moduleUri("dojo.io", "xip_client.html"), _state:{}, _stateIdCounter:0, needFrameRecursion:function () {
return (true == dojo.render.html.ie70);
}, send:function (facade) {
var stateId = "XhrIframeProxy" + (this._stateIdCounter++);
facade._stateId = stateId;
var frameUrl = this.xipClientUrl + "#0:init:id=" + stateId + "&server=" + encodeURIComponent(facade._ifpServerUrl) + "&fr=false";
if (this.needFrameRecursion()) {
var fullClientUrl = window.location.href;
if ((this.xipClientUrl + "").charAt(0) == "/") {
var endIndex = fullClientUrl.indexOf("://");
endIndex = fullClientUrl.indexOf("/", endIndex + 1);
fullClientUrl = fullClientUrl.substring(0, endIndex);
} else {
fullClientUrl = fullClientUrl.substring(0, fullClientUrl.lastIndexOf("/") + 1);
}
fullClientUrl += this.xipClientUrl;
var serverUrl = facade._ifpServerUrl + (facade._ifpServerUrl.indexOf("?") == -1 ? "?" : "&") + "dojo.fr=1";
frameUrl = serverUrl + "#0:init:id=" + stateId + "&client=" + encodeURIComponent(fullClientUrl) + "&fr=" + this.needFrameRecursion();
}
this._state[stateId] = {facade:facade, stateId:stateId, clientFrame:dojo.io.createIFrame(stateId, "", frameUrl)};
return stateId;
}, receive:function (stateId, urlEncodedData) {
var response = {};
var nvPairs = urlEncodedData.split("&");
for (var i = 0; i < nvPairs.length; i++) {
if (nvPairs[i]) {
var nameValue = nvPairs[i].split("=");
response[decodeURIComponent(nameValue[0])] = decodeURIComponent(nameValue[1]);
}
}
var state = this._state[stateId];
var facade = state.facade;
facade._setResponseHeaders(response.responseHeaders);
if (response.status == 0 || response.status) {
facade.status = parseInt(response.status, 10);
}
if (response.statusText) {
facade.statusText = response.statusText;
}
if (response.responseText) {
facade.responseText = response.responseText;
var contentType = facade.getResponseHeader("Content-Type");
if (contentType && (contentType == "application/xml" || contentType == "text/xml")) {
facade.responseXML = dojo.dom.createDocumentFromText(response.responseText, contentType);
}
}
facade.readyState = 4;
this.destroyState(stateId);
}, clientFrameLoaded:function (stateId) {
var state = this._state[stateId];
var facade = state.facade;
if (this.needFrameRecursion()) {
var clientWindow = window.open("", state.stateId + "_clientEndPoint");
} else {
var clientWindow = state.clientFrame.contentWindow;
}
var reqHeaders = [];
for (var param in facade._requestHeaders) {
reqHeaders.push(param + ": " + facade._requestHeaders[param]);
}
var requestData = {uri:facade._uri};
if (reqHeaders.length > 0) {
requestData.requestHeaders = reqHeaders.join("\r\n");
}
if (facade._method) {
requestData.method = facade._method;
}
if (facade._bodyData) {
requestData.data = facade._bodyData;
}
clientWindow.send(dojo.io.argsFromMap(requestData, "utf8"));
}, destroyState:function (stateId) {
var state = this._state[stateId];
if (state) {
delete this._state[stateId];
var parentNode = state.clientFrame.parentNode;
parentNode.removeChild(state.clientFrame);
state.clientFrame = null;
state = null;
}
}, createFacade:function () {
if (arguments && arguments[0] && arguments[0]["iframeProxyUrl"]) {
return new dojo.io.XhrIframeFacade(arguments[0]["iframeProxyUrl"]);
} else {
return dojo.io.XhrIframeProxy.oldGetXmlhttpObject.apply(dojo.hostenv, arguments);
}
}};
dojo.io.XhrIframeProxy.oldGetXmlhttpObject = dojo.hostenv.getXmlhttpObject;
dojo.hostenv.getXmlhttpObject = dojo.io.XhrIframeProxy.createFacade;
dojo.io.XhrIframeFacade = function (ifpServerUrl) {
this._requestHeaders = {};
this._allResponseHeaders = null;
this._responseHeaders = {};
this._method = null;
this._uri = null;
this._bodyData = null;
this.responseText = null;
this.responseXML = null;
this.status = null;
this.statusText = null;
this.readyState = 0;
this._ifpServerUrl = ifpServerUrl;
this._stateId = null;
};
dojo.lang.extend(dojo.io.XhrIframeFacade, {open:function (method, uri) {
this._method = method;
this._uri = uri;
this.readyState = 1;
}, setRequestHeader:function (header, value) {
this._requestHeaders[header] = value;
}, send:function (stringData) {
this._bodyData = stringData;
this._stateId = dojo.io.XhrIframeProxy.send(this);
this.readyState = 2;
}, abort:function () {
dojo.io.XhrIframeProxy.destroyState(this._stateId);
}, getAllResponseHeaders:function () {
return this._allResponseHeaders;
}, getResponseHeader:function (header) {
return this._responseHeaders[header];
}, _setResponseHeaders:function (allHeaders) {
if (allHeaders) {
this._allResponseHeaders = allHeaders;
allHeaders = allHeaders.replace(/\r/g, "");
var nvPairs = allHeaders.split("\n");
for (var i = 0; i < nvPairs.length; i++) {
if (nvPairs[i]) {
var nameValue = nvPairs[i].split(": ");
this._responseHeaders[nameValue[0]] = nameValue[1];
}
}
}
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/io/__package__.js
New file
0,0 → 1,13
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.kwCompoundRequire({common:["dojo.io.common"], rhino:["dojo.io.RhinoIO"], browser:["dojo.io.BrowserIO", "dojo.io.cookie"], dashboard:["dojo.io.BrowserIO", "dojo.io.cookie"]});
dojo.provide("dojo.io.*");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/io/common.js
New file
0,0 → 1,218
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.io.common");
dojo.require("dojo.string");
dojo.require("dojo.lang.extras");
dojo.io.transports = [];
dojo.io.hdlrFuncNames = ["load", "error", "timeout"];
dojo.io.Request = function (url, mimetype, transport, changeUrl) {
if ((arguments.length == 1) && (arguments[0].constructor == Object)) {
this.fromKwArgs(arguments[0]);
} else {
this.url = url;
if (mimetype) {
this.mimetype = mimetype;
}
if (transport) {
this.transport = transport;
}
if (arguments.length >= 4) {
this.changeUrl = changeUrl;
}
}
};
dojo.lang.extend(dojo.io.Request, {url:"", mimetype:"text/plain", method:"GET", content:undefined, transport:undefined, changeUrl:undefined, formNode:undefined, sync:false, bindSuccess:false, useCache:false, preventCache:false, load:function (type, data, transportImplementation, kwArgs) {
}, error:function (type, error, transportImplementation, kwArgs) {
}, timeout:function (type, empty, transportImplementation, kwArgs) {
}, handle:function (type, data, transportImplementation, kwArgs) {
}, timeoutSeconds:0, abort:function () {
}, fromKwArgs:function (kwArgs) {
if (kwArgs["url"]) {
kwArgs.url = kwArgs.url.toString();
}
if (kwArgs["formNode"]) {
kwArgs.formNode = dojo.byId(kwArgs.formNode);
}
if (!kwArgs["method"] && kwArgs["formNode"] && kwArgs["formNode"].method) {
kwArgs.method = kwArgs["formNode"].method;
}
if (!kwArgs["handle"] && kwArgs["handler"]) {
kwArgs.handle = kwArgs.handler;
}
if (!kwArgs["load"] && kwArgs["loaded"]) {
kwArgs.load = kwArgs.loaded;
}
if (!kwArgs["changeUrl"] && kwArgs["changeURL"]) {
kwArgs.changeUrl = kwArgs.changeURL;
}
kwArgs.encoding = dojo.lang.firstValued(kwArgs["encoding"], djConfig["bindEncoding"], "");
kwArgs.sendTransport = dojo.lang.firstValued(kwArgs["sendTransport"], djConfig["ioSendTransport"], false);
var isFunction = dojo.lang.isFunction;
for (var x = 0; x < dojo.io.hdlrFuncNames.length; x++) {
var fn = dojo.io.hdlrFuncNames[x];
if (kwArgs[fn] && isFunction(kwArgs[fn])) {
continue;
}
if (kwArgs["handle"] && isFunction(kwArgs["handle"])) {
kwArgs[fn] = kwArgs.handle;
}
}
dojo.lang.mixin(this, kwArgs);
}});
dojo.io.Error = function (msg, type, num) {
this.message = msg;
this.type = type || "unknown";
this.number = num || 0;
};
dojo.io.transports.addTransport = function (name) {
this.push(name);
this[name] = dojo.io[name];
};
dojo.io.bind = function (request) {
if (!(request instanceof dojo.io.Request)) {
try {
request = new dojo.io.Request(request);
}
catch (e) {
dojo.debug(e);
}
}
var tsName = "";
if (request["transport"]) {
tsName = request["transport"];
if (!this[tsName]) {
dojo.io.sendBindError(request, "No dojo.io.bind() transport with name '" + request["transport"] + "'.");
return request;
}
if (!this[tsName].canHandle(request)) {
dojo.io.sendBindError(request, "dojo.io.bind() transport with name '" + request["transport"] + "' cannot handle this type of request.");
return request;
}
} else {
for (var x = 0; x < dojo.io.transports.length; x++) {
var tmp = dojo.io.transports[x];
if ((this[tmp]) && (this[tmp].canHandle(request))) {
tsName = tmp;
break;
}
}
if (tsName == "") {
dojo.io.sendBindError(request, "None of the loaded transports for dojo.io.bind()" + " can handle the request.");
return request;
}
}
this[tsName].bind(request);
request.bindSuccess = true;
return request;
};
dojo.io.sendBindError = function (request, message) {
if ((typeof request.error == "function" || typeof request.handle == "function") && (typeof setTimeout == "function" || typeof setTimeout == "object")) {
var errorObject = new dojo.io.Error(message);
setTimeout(function () {
request[(typeof request.error == "function") ? "error" : "handle"]("error", errorObject, null, request);
}, 50);
} else {
dojo.raise(message);
}
};
dojo.io.queueBind = function (request) {
if (!(request instanceof dojo.io.Request)) {
try {
request = new dojo.io.Request(request);
}
catch (e) {
dojo.debug(e);
}
}
var oldLoad = request.load;
request.load = function () {
dojo.io._queueBindInFlight = false;
var ret = oldLoad.apply(this, arguments);
dojo.io._dispatchNextQueueBind();
return ret;
};
var oldErr = request.error;
request.error = function () {
dojo.io._queueBindInFlight = false;
var ret = oldErr.apply(this, arguments);
dojo.io._dispatchNextQueueBind();
return ret;
};
dojo.io._bindQueue.push(request);
dojo.io._dispatchNextQueueBind();
return request;
};
dojo.io._dispatchNextQueueBind = function () {
if (!dojo.io._queueBindInFlight) {
dojo.io._queueBindInFlight = true;
if (dojo.io._bindQueue.length > 0) {
dojo.io.bind(dojo.io._bindQueue.shift());
} else {
dojo.io._queueBindInFlight = false;
}
}
};
dojo.io._bindQueue = [];
dojo.io._queueBindInFlight = false;
dojo.io.argsFromMap = function (map, encoding, last) {
var enc = /utf/i.test(encoding || "") ? encodeURIComponent : dojo.string.encodeAscii;
var mapped = [];
var control = new Object();
for (var name in map) {
var domap = function (elt) {
var val = enc(name) + "=" + enc(elt);
mapped[(last == name) ? "push" : "unshift"](val);
};
if (!control[name]) {
var value = map[name];
if (dojo.lang.isArray(value)) {
dojo.lang.forEach(value, domap);
} else {
domap(value);
}
}
}
return mapped.join("&");
};
dojo.io.setIFrameSrc = function (iframe, src, replace) {
try {
var r = dojo.render.html;
if (!replace) {
if (r.safari) {
iframe.location = src;
} else {
frames[iframe.name].location = src;
}
} else {
var idoc;
if (r.ie) {
idoc = iframe.contentWindow.document;
} else {
if (r.safari) {
idoc = iframe.document;
} else {
idoc = iframe.contentWindow;
}
}
if (!idoc) {
iframe.location = src;
return;
} else {
idoc.location.replace(src);
}
}
}
catch (e) {
dojo.debug(e);
dojo.debug("setIFrameSrc: " + e);
}
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/io/cookie.js
New file
0,0 → 1,102
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.io.cookie");
dojo.io.cookie.setCookie = function (name, value, days, path, domain, secure) {
var expires = -1;
if ((typeof days == "number") && (days >= 0)) {
var d = new Date();
d.setTime(d.getTime() + (days * 24 * 60 * 60 * 1000));
expires = d.toGMTString();
}
value = escape(value);
document.cookie = name + "=" + value + ";" + (expires != -1 ? " expires=" + expires + ";" : "") + (path ? "path=" + path : "") + (domain ? "; domain=" + domain : "") + (secure ? "; secure" : "");
};
dojo.io.cookie.set = dojo.io.cookie.setCookie;
dojo.io.cookie.getCookie = function (name) {
var idx = document.cookie.lastIndexOf(name + "=");
if (idx == -1) {
return null;
}
var value = document.cookie.substring(idx + name.length + 1);
var end = value.indexOf(";");
if (end == -1) {
end = value.length;
}
value = value.substring(0, end);
value = unescape(value);
return value;
};
dojo.io.cookie.get = dojo.io.cookie.getCookie;
dojo.io.cookie.deleteCookie = function (name) {
dojo.io.cookie.setCookie(name, "-", 0);
};
dojo.io.cookie.setObjectCookie = function (name, obj, days, path, domain, secure, clearCurrent) {
if (arguments.length == 5) {
clearCurrent = domain;
domain = null;
secure = null;
}
var pairs = [], cookie, value = "";
if (!clearCurrent) {
cookie = dojo.io.cookie.getObjectCookie(name);
}
if (days >= 0) {
if (!cookie) {
cookie = {};
}
for (var prop in obj) {
if (obj[prop] == null) {
delete cookie[prop];
} else {
if ((typeof obj[prop] == "string") || (typeof obj[prop] == "number")) {
cookie[prop] = obj[prop];
}
}
}
prop = null;
for (var prop in cookie) {
pairs.push(escape(prop) + "=" + escape(cookie[prop]));
}
value = pairs.join("&");
}
dojo.io.cookie.setCookie(name, value, days, path, domain, secure);
};
dojo.io.cookie.getObjectCookie = function (name) {
var values = null, cookie = dojo.io.cookie.getCookie(name);
if (cookie) {
values = {};
var pairs = cookie.split("&");
for (var i = 0; i < pairs.length; i++) {
var pair = pairs[i].split("=");
var value = pair[1];
if (isNaN(value)) {
value = unescape(pair[1]);
}
values[unescape(pair[0])] = value;
}
}
return values;
};
dojo.io.cookie.isSupported = function () {
if (typeof navigator.cookieEnabled != "boolean") {
dojo.io.cookie.setCookie("__TestingYourBrowserForCookieSupport__", "CookiesAllowed", 90, null);
var cookieVal = dojo.io.cookie.getCookie("__TestingYourBrowserForCookieSupport__");
navigator.cookieEnabled = (cookieVal == "CookiesAllowed");
if (navigator.cookieEnabled) {
this.deleteCookie("__TestingYourBrowserForCookieSupport__");
}
}
return navigator.cookieEnabled;
};
if (!dojo.io.cookies) {
dojo.io.cookies = dojo.io.cookie;
}
 
/tags/Racine_livraison_narmer/api/js/dojo/src/io/BrowserIO.js
New file
0,0 → 1,492
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.io.BrowserIO");
dojo.require("dojo.io.common");
dojo.require("dojo.lang.array");
dojo.require("dojo.lang.func");
dojo.require("dojo.string.extras");
dojo.require("dojo.dom");
dojo.require("dojo.undo.browser");
if (!dj_undef("window")) {
dojo.io.checkChildrenForFile = function (node) {
var hasFile = false;
var inputs = node.getElementsByTagName("input");
dojo.lang.forEach(inputs, function (input) {
if (hasFile) {
return;
}
if (input.getAttribute("type") == "file") {
hasFile = true;
}
});
return hasFile;
};
dojo.io.formHasFile = function (formNode) {
return dojo.io.checkChildrenForFile(formNode);
};
dojo.io.updateNode = function (node, urlOrArgs) {
node = dojo.byId(node);
var args = urlOrArgs;
if (dojo.lang.isString(urlOrArgs)) {
args = {url:urlOrArgs};
}
args.mimetype = "text/html";
args.load = function (t, d, e) {
while (node.firstChild) {
dojo.dom.destroyNode(node.firstChild);
}
node.innerHTML = d;
};
dojo.io.bind(args);
};
dojo.io.formFilter = function (node) {
var type = (node.type || "").toLowerCase();
return !node.disabled && node.name && !dojo.lang.inArray(["file", "submit", "image", "reset", "button"], type);
};
dojo.io.encodeForm = function (formNode, encoding, formFilter) {
if ((!formNode) || (!formNode.tagName) || (!formNode.tagName.toLowerCase() == "form")) {
dojo.raise("Attempted to encode a non-form element.");
}
if (!formFilter) {
formFilter = dojo.io.formFilter;
}
var enc = /utf/i.test(encoding || "") ? encodeURIComponent : dojo.string.encodeAscii;
var values = [];
for (var i = 0; i < formNode.elements.length; i++) {
var elm = formNode.elements[i];
if (!elm || elm.tagName.toLowerCase() == "fieldset" || !formFilter(elm)) {
continue;
}
var name = enc(elm.name);
var type = elm.type.toLowerCase();
if (type == "select-multiple") {
for (var j = 0; j < elm.options.length; j++) {
if (elm.options[j].selected) {
values.push(name + "=" + enc(elm.options[j].value));
}
}
} else {
if (dojo.lang.inArray(["radio", "checkbox"], type)) {
if (elm.checked) {
values.push(name + "=" + enc(elm.value));
}
} else {
values.push(name + "=" + enc(elm.value));
}
}
}
var inputs = formNode.getElementsByTagName("input");
for (var i = 0; i < inputs.length; i++) {
var input = inputs[i];
if (input.type.toLowerCase() == "image" && input.form == formNode && formFilter(input)) {
var name = enc(input.name);
values.push(name + "=" + enc(input.value));
values.push(name + ".x=0");
values.push(name + ".y=0");
}
}
return values.join("&") + "&";
};
dojo.io.FormBind = function (args) {
this.bindArgs = {};
if (args && args.formNode) {
this.init(args);
} else {
if (args) {
this.init({formNode:args});
}
}
};
dojo.lang.extend(dojo.io.FormBind, {form:null, bindArgs:null, clickedButton:null, init:function (args) {
var form = dojo.byId(args.formNode);
if (!form || !form.tagName || form.tagName.toLowerCase() != "form") {
throw new Error("FormBind: Couldn't apply, invalid form");
} else {
if (this.form == form) {
return;
} else {
if (this.form) {
throw new Error("FormBind: Already applied to a form");
}
}
}
dojo.lang.mixin(this.bindArgs, args);
this.form = form;
this.connect(form, "onsubmit", "submit");
for (var i = 0; i < form.elements.length; i++) {
var node = form.elements[i];
if (node && node.type && dojo.lang.inArray(["submit", "button"], node.type.toLowerCase())) {
this.connect(node, "onclick", "click");
}
}
var inputs = form.getElementsByTagName("input");
for (var i = 0; i < inputs.length; i++) {
var input = inputs[i];
if (input.type.toLowerCase() == "image" && input.form == form) {
this.connect(input, "onclick", "click");
}
}
}, onSubmit:function (form) {
return true;
}, submit:function (e) {
e.preventDefault();
if (this.onSubmit(this.form)) {
dojo.io.bind(dojo.lang.mixin(this.bindArgs, {formFilter:dojo.lang.hitch(this, "formFilter")}));
}
}, click:function (e) {
var node = e.currentTarget;
if (node.disabled) {
return;
}
this.clickedButton = node;
}, formFilter:function (node) {
var type = (node.type || "").toLowerCase();
var accept = false;
if (node.disabled || !node.name) {
accept = false;
} else {
if (dojo.lang.inArray(["submit", "button", "image"], type)) {
if (!this.clickedButton) {
this.clickedButton = node;
}
accept = node == this.clickedButton;
} else {
accept = !dojo.lang.inArray(["file", "submit", "reset", "button"], type);
}
}
return accept;
}, connect:function (srcObj, srcFcn, targetFcn) {
if (dojo.evalObjPath("dojo.event.connect")) {
dojo.event.connect(srcObj, srcFcn, this, targetFcn);
} else {
var fcn = dojo.lang.hitch(this, targetFcn);
srcObj[srcFcn] = function (e) {
if (!e) {
e = window.event;
}
if (!e.currentTarget) {
e.currentTarget = e.srcElement;
}
if (!e.preventDefault) {
e.preventDefault = function () {
window.event.returnValue = false;
};
}
fcn(e);
};
}
}});
dojo.io.XMLHTTPTransport = new function () {
var _this = this;
var _cache = {};
this.useCache = false;
this.preventCache = false;
function getCacheKey(url, query, method) {
return url + "|" + query + "|" + method.toLowerCase();
}
function addToCache(url, query, method, http) {
_cache[getCacheKey(url, query, method)] = http;
}
function getFromCache(url, query, method) {
return _cache[getCacheKey(url, query, method)];
}
this.clearCache = function () {
_cache = {};
};
function doLoad(kwArgs, http, url, query, useCache) {
if (((http.status >= 200) && (http.status < 300)) || (http.status == 304) || (location.protocol == "file:" && (http.status == 0 || http.status == undefined)) || (location.protocol == "chrome:" && (http.status == 0 || http.status == undefined))) {
var ret;
if (kwArgs.method.toLowerCase() == "head") {
var headers = http.getAllResponseHeaders();
ret = {};
ret.toString = function () {
return headers;
};
var values = headers.split(/[\r\n]+/g);
for (var i = 0; i < values.length; i++) {
var pair = values[i].match(/^([^:]+)\s*:\s*(.+)$/i);
if (pair) {
ret[pair[1]] = pair[2];
}
}
} else {
if (kwArgs.mimetype == "text/javascript") {
try {
ret = dj_eval(http.responseText);
}
catch (e) {
dojo.debug(e);
dojo.debug(http.responseText);
ret = null;
}
} else {
if (kwArgs.mimetype == "text/json" || kwArgs.mimetype == "application/json") {
try {
ret = dj_eval("(" + http.responseText + ")");
}
catch (e) {
dojo.debug(e);
dojo.debug(http.responseText);
ret = false;
}
} else {
if ((kwArgs.mimetype == "application/xml") || (kwArgs.mimetype == "text/xml")) {
ret = http.responseXML;
if (!ret || typeof ret == "string" || !http.getResponseHeader("Content-Type")) {
ret = dojo.dom.createDocumentFromText(http.responseText);
}
} else {
ret = http.responseText;
}
}
}
}
if (useCache) {
addToCache(url, query, kwArgs.method, http);
}
kwArgs[(typeof kwArgs.load == "function") ? "load" : "handle"]("load", ret, http, kwArgs);
} else {
var errObj = new dojo.io.Error("XMLHttpTransport Error: " + http.status + " " + http.statusText);
kwArgs[(typeof kwArgs.error == "function") ? "error" : "handle"]("error", errObj, http, kwArgs);
}
}
function setHeaders(http, kwArgs) {
if (kwArgs["headers"]) {
for (var header in kwArgs["headers"]) {
if (header.toLowerCase() == "content-type" && !kwArgs["contentType"]) {
kwArgs["contentType"] = kwArgs["headers"][header];
} else {
http.setRequestHeader(header, kwArgs["headers"][header]);
}
}
}
}
this.inFlight = [];
this.inFlightTimer = null;
this.startWatchingInFlight = function () {
if (!this.inFlightTimer) {
this.inFlightTimer = setTimeout("dojo.io.XMLHTTPTransport.watchInFlight();", 10);
}
};
this.watchInFlight = function () {
var now = null;
if (!dojo.hostenv._blockAsync && !_this._blockAsync) {
for (var x = this.inFlight.length - 1; x >= 0; x--) {
try {
var tif = this.inFlight[x];
if (!tif || tif.http._aborted || !tif.http.readyState) {
this.inFlight.splice(x, 1);
continue;
}
if (4 == tif.http.readyState) {
this.inFlight.splice(x, 1);
doLoad(tif.req, tif.http, tif.url, tif.query, tif.useCache);
} else {
if (tif.startTime) {
if (!now) {
now = (new Date()).getTime();
}
if (tif.startTime + (tif.req.timeoutSeconds * 1000) < now) {
if (typeof tif.http.abort == "function") {
tif.http.abort();
}
this.inFlight.splice(x, 1);
tif.req[(typeof tif.req.timeout == "function") ? "timeout" : "handle"]("timeout", null, tif.http, tif.req);
}
}
}
}
catch (e) {
try {
var errObj = new dojo.io.Error("XMLHttpTransport.watchInFlight Error: " + e);
tif.req[(typeof tif.req.error == "function") ? "error" : "handle"]("error", errObj, tif.http, tif.req);
}
catch (e2) {
dojo.debug("XMLHttpTransport error callback failed: " + e2);
}
}
}
}
clearTimeout(this.inFlightTimer);
if (this.inFlight.length == 0) {
this.inFlightTimer = null;
return;
}
this.inFlightTimer = setTimeout("dojo.io.XMLHTTPTransport.watchInFlight();", 10);
};
var hasXmlHttp = dojo.hostenv.getXmlhttpObject() ? true : false;
this.canHandle = function (kwArgs) {
return hasXmlHttp && dojo.lang.inArray(["text/plain", "text/html", "application/xml", "text/xml", "text/javascript", "text/json", "application/json"], (kwArgs["mimetype"].toLowerCase() || "")) && !(kwArgs["formNode"] && dojo.io.formHasFile(kwArgs["formNode"]));
};
this.multipartBoundary = "45309FFF-BD65-4d50-99C9-36986896A96F";
this.bind = function (kwArgs) {
if (!kwArgs["url"]) {
if (!kwArgs["formNode"] && (kwArgs["backButton"] || kwArgs["back"] || kwArgs["changeUrl"] || kwArgs["watchForURL"]) && (!djConfig.preventBackButtonFix)) {
dojo.deprecated("Using dojo.io.XMLHTTPTransport.bind() to add to browser history without doing an IO request", "Use dojo.undo.browser.addToHistory() instead.", "0.4");
dojo.undo.browser.addToHistory(kwArgs);
return true;
}
}
var url = kwArgs.url;
var query = "";
if (kwArgs["formNode"]) {
var ta = kwArgs.formNode.getAttribute("action");
if ((ta) && (!kwArgs["url"])) {
url = ta;
}
var tp = kwArgs.formNode.getAttribute("method");
if ((tp) && (!kwArgs["method"])) {
kwArgs.method = tp;
}
query += dojo.io.encodeForm(kwArgs.formNode, kwArgs.encoding, kwArgs["formFilter"]);
}
if (url.indexOf("#") > -1) {
dojo.debug("Warning: dojo.io.bind: stripping hash values from url:", url);
url = url.split("#")[0];
}
if (kwArgs["file"]) {
kwArgs.method = "post";
}
if (!kwArgs["method"]) {
kwArgs.method = "get";
}
if (kwArgs.method.toLowerCase() == "get") {
kwArgs.multipart = false;
} else {
if (kwArgs["file"]) {
kwArgs.multipart = true;
} else {
if (!kwArgs["multipart"]) {
kwArgs.multipart = false;
}
}
}
if (kwArgs["backButton"] || kwArgs["back"] || kwArgs["changeUrl"]) {
dojo.undo.browser.addToHistory(kwArgs);
}
var content = kwArgs["content"] || {};
if (kwArgs.sendTransport) {
content["dojo.transport"] = "xmlhttp";
}
do {
if (kwArgs.postContent) {
query = kwArgs.postContent;
break;
}
if (content) {
query += dojo.io.argsFromMap(content, kwArgs.encoding);
}
if (kwArgs.method.toLowerCase() == "get" || !kwArgs.multipart) {
break;
}
var t = [];
if (query.length) {
var q = query.split("&");
for (var i = 0; i < q.length; ++i) {
if (q[i].length) {
var p = q[i].split("=");
t.push("--" + this.multipartBoundary, "Content-Disposition: form-data; name=\"" + p[0] + "\"", "", p[1]);
}
}
}
if (kwArgs.file) {
if (dojo.lang.isArray(kwArgs.file)) {
for (var i = 0; i < kwArgs.file.length; ++i) {
var o = kwArgs.file[i];
t.push("--" + this.multipartBoundary, "Content-Disposition: form-data; name=\"" + o.name + "\"; filename=\"" + ("fileName" in o ? o.fileName : o.name) + "\"", "Content-Type: " + ("contentType" in o ? o.contentType : "application/octet-stream"), "", o.content);
}
} else {
var o = kwArgs.file;
t.push("--" + this.multipartBoundary, "Content-Disposition: form-data; name=\"" + o.name + "\"; filename=\"" + ("fileName" in o ? o.fileName : o.name) + "\"", "Content-Type: " + ("contentType" in o ? o.contentType : "application/octet-stream"), "", o.content);
}
}
if (t.length) {
t.push("--" + this.multipartBoundary + "--", "");
query = t.join("\r\n");
}
} while (false);
var async = kwArgs["sync"] ? false : true;
var preventCache = kwArgs["preventCache"] || (this.preventCache == true && kwArgs["preventCache"] != false);
var useCache = kwArgs["useCache"] == true || (this.useCache == true && kwArgs["useCache"] != false);
if (!preventCache && useCache) {
var cachedHttp = getFromCache(url, query, kwArgs.method);
if (cachedHttp) {
doLoad(kwArgs, cachedHttp, url, query, false);
return;
}
}
var http = dojo.hostenv.getXmlhttpObject(kwArgs);
var received = false;
if (async) {
var startTime = this.inFlight.push({"req":kwArgs, "http":http, "url":url, "query":query, "useCache":useCache, "startTime":kwArgs.timeoutSeconds ? (new Date()).getTime() : 0});
this.startWatchingInFlight();
} else {
_this._blockAsync = true;
}
if (kwArgs.method.toLowerCase() == "post") {
if (!kwArgs.user) {
http.open("POST", url, async);
} else {
http.open("POST", url, async, kwArgs.user, kwArgs.password);
}
setHeaders(http, kwArgs);
http.setRequestHeader("Content-Type", kwArgs.multipart ? ("multipart/form-data; boundary=" + this.multipartBoundary) : (kwArgs.contentType || "application/x-www-form-urlencoded"));
try {
http.send(query);
}
catch (e) {
if (typeof http.abort == "function") {
http.abort();
}
doLoad(kwArgs, {status:404}, url, query, useCache);
}
} else {
var tmpUrl = url;
if (query != "") {
tmpUrl += (tmpUrl.indexOf("?") > -1 ? "&" : "?") + query;
}
if (preventCache) {
tmpUrl += (dojo.string.endsWithAny(tmpUrl, "?", "&") ? "" : (tmpUrl.indexOf("?") > -1 ? "&" : "?")) + "dojo.preventCache=" + new Date().valueOf();
}
if (!kwArgs.user) {
http.open(kwArgs.method.toUpperCase(), tmpUrl, async);
} else {
http.open(kwArgs.method.toUpperCase(), tmpUrl, async, kwArgs.user, kwArgs.password);
}
setHeaders(http, kwArgs);
try {
http.send(null);
}
catch (e) {
if (typeof http.abort == "function") {
http.abort();
}
doLoad(kwArgs, {status:404}, url, query, useCache);
}
}
if (!async) {
doLoad(kwArgs, http, url, query, useCache);
_this._blockAsync = false;
}
kwArgs.abort = function () {
try {
http._aborted = true;
}
catch (e) {
}
return http.abort();
};
return;
};
dojo.io.transports.addTransport("XMLHTTPTransport");
};
}
 
/tags/Racine_livraison_narmer/api/js/dojo/src/io/IframeIO.js
New file
0,0 → 1,212
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.io.IframeIO");
dojo.require("dojo.io.BrowserIO");
dojo.require("dojo.uri.*");
dojo.io.createIFrame = function (fname, onloadstr, uri) {
if (window[fname]) {
return window[fname];
}
if (window.frames[fname]) {
return window.frames[fname];
}
var r = dojo.render.html;
var cframe = null;
var turi = uri;
if (!turi) {
if (djConfig["useXDomain"] && !djConfig["dojoIframeHistoryUrl"]) {
dojo.debug("dojo.io.createIFrame: When using cross-domain Dojo builds," + " please save iframe_history.html to your domain and set djConfig.dojoIframeHistoryUrl" + " to the path on your domain to iframe_history.html");
}
turi = (djConfig["dojoIframeHistoryUrl"] || dojo.uri.moduleUri("dojo", "../iframe_history.html")) + "#noInit=true";
}
var ifrstr = ((r.ie) && (dojo.render.os.win)) ? "<iframe name=\"" + fname + "\" src=\"" + turi + "\" onload=\"" + onloadstr + "\">" : "iframe";
cframe = document.createElement(ifrstr);
with (cframe) {
name = fname;
setAttribute("name", fname);
id = fname;
}
dojo.body().appendChild(cframe);
window[fname] = cframe;
with (cframe.style) {
if (!r.safari) {
position = "absolute";
}
left = top = "0px";
height = width = "1px";
visibility = "hidden";
}
if (!r.ie) {
dojo.io.setIFrameSrc(cframe, turi, true);
cframe.onload = new Function(onloadstr);
}
return cframe;
};
dojo.io.IframeTransport = new function () {
var _this = this;
this.currentRequest = null;
this.requestQueue = [];
this.iframeName = "dojoIoIframe";
this.fireNextRequest = function () {
try {
if ((this.currentRequest) || (this.requestQueue.length == 0)) {
return;
}
var cr = this.currentRequest = this.requestQueue.shift();
cr._contentToClean = [];
var fn = cr["formNode"];
var content = cr["content"] || {};
if (cr.sendTransport) {
content["dojo.transport"] = "iframe";
}
if (fn) {
if (content) {
for (var x in content) {
if (!fn[x]) {
var tn;
if (dojo.render.html.ie) {
tn = document.createElement("<input type='hidden' name='" + x + "' value='" + content[x] + "'>");
fn.appendChild(tn);
} else {
tn = document.createElement("input");
fn.appendChild(tn);
tn.type = "hidden";
tn.name = x;
tn.value = content[x];
}
cr._contentToClean.push(x);
} else {
fn[x].value = content[x];
}
}
}
if (cr["url"]) {
cr._originalAction = fn.getAttribute("action");
fn.setAttribute("action", cr.url);
}
if (!fn.getAttribute("method")) {
fn.setAttribute("method", (cr["method"]) ? cr["method"] : "post");
}
cr._originalTarget = fn.getAttribute("target");
fn.setAttribute("target", this.iframeName);
fn.target = this.iframeName;
fn.submit();
} else {
var query = dojo.io.argsFromMap(this.currentRequest.content);
var tmpUrl = cr.url + (cr.url.indexOf("?") > -1 ? "&" : "?") + query;
dojo.io.setIFrameSrc(this.iframe, tmpUrl, true);
}
}
catch (e) {
this.iframeOnload(e);
}
};
this.canHandle = function (kwArgs) {
return ((dojo.lang.inArray(["text/plain", "text/html", "text/javascript", "text/json", "application/json"], kwArgs["mimetype"])) && (dojo.lang.inArray(["post", "get"], kwArgs["method"].toLowerCase())) && (!((kwArgs["sync"]) && (kwArgs["sync"] == true))));
};
this.bind = function (kwArgs) {
if (!this["iframe"]) {
this.setUpIframe();
}
this.requestQueue.push(kwArgs);
this.fireNextRequest();
return;
};
this.setUpIframe = function () {
this.iframe = dojo.io.createIFrame(this.iframeName, "dojo.io.IframeTransport.iframeOnload();");
};
this.iframeOnload = function (errorObject) {
if (!_this.currentRequest) {
_this.fireNextRequest();
return;
}
var req = _this.currentRequest;
if (req.formNode) {
var toClean = req._contentToClean;
for (var i = 0; i < toClean.length; i++) {
var key = toClean[i];
if (dojo.render.html.safari) {
var fNode = req.formNode;
for (var j = 0; j < fNode.childNodes.length; j++) {
var chNode = fNode.childNodes[j];
if (chNode.name == key) {
var pNode = chNode.parentNode;
pNode.removeChild(chNode);
break;
}
}
} else {
var input = req.formNode[key];
req.formNode.removeChild(input);
req.formNode[key] = null;
}
}
if (req["_originalAction"]) {
req.formNode.setAttribute("action", req._originalAction);
}
if (req["_originalTarget"]) {
req.formNode.setAttribute("target", req._originalTarget);
req.formNode.target = req._originalTarget;
}
}
var contentDoc = function (iframe_el) {
var doc = iframe_el.contentDocument || ((iframe_el.contentWindow) && (iframe_el.contentWindow.document)) || ((iframe_el.name) && (document.frames[iframe_el.name]) && (document.frames[iframe_el.name].document)) || null;
return doc;
};
var value;
var success = false;
if (errorObject) {
this._callError(req, "IframeTransport Request Error: " + errorObject);
} else {
var ifd = contentDoc(_this.iframe);
try {
var cmt = req.mimetype;
if ((cmt == "text/javascript") || (cmt == "text/json") || (cmt == "application/json")) {
var js = ifd.getElementsByTagName("textarea")[0].value;
if (cmt == "text/json" || cmt == "application/json") {
js = "(" + js + ")";
}
value = dj_eval(js);
} else {
if (cmt == "text/html") {
value = ifd;
} else {
value = ifd.getElementsByTagName("textarea")[0].value;
}
}
success = true;
}
catch (e) {
this._callError(req, "IframeTransport Error: " + e);
}
}
try {
if (success && dojo.lang.isFunction(req["load"])) {
req.load("load", value, req);
}
}
catch (e) {
throw e;
}
finally {
_this.currentRequest = null;
_this.fireNextRequest();
}
};
this._callError = function (req, message) {
var errObj = new dojo.io.Error(message);
if (dojo.lang.isFunction(req["error"])) {
req.error("error", errObj, req);
}
};
dojo.io.transports.addTransport("IframeTransport");
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/io/cometd.js
New file
0,0 → 1,528
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.require("dojo.io.common");
dojo.provide("dojo.io.cometd");
dojo.require("dojo.AdapterRegistry");
dojo.require("dojo.json");
dojo.require("dojo.io.BrowserIO");
dojo.require("dojo.io.IframeIO");
dojo.require("dojo.io.ScriptSrcIO");
dojo.require("dojo.io.cookie");
dojo.require("dojo.event.*");
dojo.require("dojo.lang.common");
dojo.require("dojo.lang.func");
cometd = new function () {
this.initialized = false;
this.connected = false;
this.connectionTypes = new dojo.AdapterRegistry(true);
this.version = 0.1;
this.minimumVersion = 0.1;
this.clientId = null;
this._isXD = false;
this.handshakeReturn = null;
this.currentTransport = null;
this.url = null;
this.lastMessage = null;
this.globalTopicChannels = {};
this.backlog = [];
this.tunnelInit = function (childLocation, childDomain) {
};
this.tunnelCollapse = function () {
dojo.debug("tunnel collapsed!");
};
this.init = function (props, root, bargs) {
props = props || {};
props.version = this.version;
props.minimumVersion = this.minimumVersion;
props.channel = "/meta/handshake";
this.url = root || djConfig["cometdRoot"];
if (!this.url) {
dojo.debug("no cometd root specified in djConfig and no root passed");
return;
}
var bindArgs = {url:this.url, method:"POST", mimetype:"text/json", load:dojo.lang.hitch(this, "finishInit"), content:{"message":dojo.json.serialize([props])}};
var regexp = "^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$";
var r = ("" + window.location).match(new RegExp(regexp));
if (r[4]) {
var tmp = r[4].split(":");
var thisHost = tmp[0];
var thisPort = tmp[1] || "80";
r = this.url.match(new RegExp(regexp));
if (r[4]) {
tmp = r[4].split(":");
var urlHost = tmp[0];
var urlPort = tmp[1] || "80";
if ((urlHost != thisHost) || (urlPort != thisPort)) {
dojo.debug(thisHost, urlHost);
dojo.debug(thisPort, urlPort);
this._isXD = true;
bindArgs.transport = "ScriptSrcTransport";
bindArgs.jsonParamName = "jsonp";
bindArgs.method = "GET";
}
}
}
if (bargs) {
dojo.lang.mixin(bindArgs, bargs);
}
return dojo.io.bind(bindArgs);
};
this.finishInit = function (type, data, evt, request) {
data = data[0];
this.handshakeReturn = data;
if (data["authSuccessful"] == false) {
dojo.debug("cometd authentication failed");
return;
}
if (data.version < this.minimumVersion) {
dojo.debug("cometd protocol version mismatch. We wanted", this.minimumVersion, "but got", data.version);
return;
}
this.currentTransport = this.connectionTypes.match(data.supportedConnectionTypes, data.version, this._isXD);
this.currentTransport.version = data.version;
this.clientId = data.clientId;
this.tunnelInit = dojo.lang.hitch(this.currentTransport, "tunnelInit");
this.tunnelCollapse = dojo.lang.hitch(this.currentTransport, "tunnelCollapse");
this.initialized = true;
this.currentTransport.startup(data);
while (this.backlog.length != 0) {
var cur = this.backlog.shift();
var fn = cur.shift();
this[fn].apply(this, cur);
}
};
this._getRandStr = function () {
return Math.random().toString().substring(2, 10);
};
this.deliver = function (messages) {
dojo.lang.forEach(messages, this._deliver, this);
};
this._deliver = function (message) {
if (!message["channel"]) {
dojo.debug("cometd error: no channel for message!");
return;
}
if (!this.currentTransport) {
this.backlog.push(["deliver", message]);
return;
}
this.lastMessage = message;
if ((message.channel.length > 5) && (message.channel.substr(0, 5) == "/meta")) {
switch (message.channel) {
case "/meta/subscribe":
if (!message.successful) {
dojo.debug("cometd subscription error for channel", message.channel, ":", message.error);
return;
}
this.subscribed(message.subscription, message);
break;
case "/meta/unsubscribe":
if (!message.successful) {
dojo.debug("cometd unsubscription error for channel", message.channel, ":", message.error);
return;
}
this.unsubscribed(message.subscription, message);
break;
}
}
this.currentTransport.deliver(message);
if (message.data) {
var tname = (this.globalTopicChannels[message.channel]) ? message.channel : "/cometd" + message.channel;
dojo.event.topic.publish(tname, message);
}
};
this.disconnect = function () {
if (!this.currentTransport) {
dojo.debug("no current transport to disconnect from");
return;
}
this.currentTransport.disconnect();
};
this.publish = function (channel, data, properties) {
if (!this.currentTransport) {
this.backlog.push(["publish", channel, data, properties]);
return;
}
var message = {data:data, channel:channel};
if (properties) {
dojo.lang.mixin(message, properties);
}
return this.currentTransport.sendMessage(message);
};
this.subscribe = function (channel, useLocalTopics, objOrFunc, funcName) {
if (!this.currentTransport) {
this.backlog.push(["subscribe", channel, useLocalTopics, objOrFunc, funcName]);
return;
}
if (objOrFunc) {
var tname = (useLocalTopics) ? channel : "/cometd" + channel;
if (useLocalTopics) {
this.globalTopicChannels[channel] = true;
}
dojo.event.topic.subscribe(tname, objOrFunc, funcName);
}
return this.currentTransport.sendMessage({channel:"/meta/subscribe", subscription:channel});
};
this.subscribed = function (channel, message) {
dojo.debug(channel);
dojo.debugShallow(message);
};
this.unsubscribe = function (channel, useLocalTopics, objOrFunc, funcName) {
if (!this.currentTransport) {
this.backlog.push(["unsubscribe", channel, useLocalTopics, objOrFunc, funcName]);
return;
}
if (objOrFunc) {
var tname = (useLocalTopics) ? channel : "/cometd" + channel;
dojo.event.topic.unsubscribe(tname, objOrFunc, funcName);
}
return this.currentTransport.sendMessage({channel:"/meta/unsubscribe", subscription:channel});
};
this.unsubscribed = function (channel, message) {
dojo.debug(channel);
dojo.debugShallow(message);
};
};
cometd.iframeTransport = new function () {
this.connected = false;
this.connectionId = null;
this.rcvNode = null;
this.rcvNodeName = "";
this.phonyForm = null;
this.authToken = null;
this.lastTimestamp = null;
this.lastId = null;
this.backlog = [];
this.check = function (types, version, xdomain) {
return ((!xdomain) && (!dojo.render.html.safari) && (dojo.lang.inArray(types, "iframe")));
};
this.tunnelInit = function () {
this.postToIframe({message:dojo.json.serialize([{channel:"/meta/connect", clientId:cometd.clientId, connectionType:"iframe"}])});
};
this.tunnelCollapse = function () {
if (this.connected) {
this.connected = false;
this.postToIframe({message:dojo.json.serialize([{channel:"/meta/reconnect", clientId:cometd.clientId, connectionId:this.connectionId, timestamp:this.lastTimestamp, id:this.lastId}])});
}
};
this.deliver = function (message) {
if (message["timestamp"]) {
this.lastTimestamp = message.timestamp;
}
if (message["id"]) {
this.lastId = message.id;
}
if ((message.channel.length > 5) && (message.channel.substr(0, 5) == "/meta")) {
switch (message.channel) {
case "/meta/connect":
if (!message.successful) {
dojo.debug("cometd connection error:", message.error);
return;
}
this.connectionId = message.connectionId;
this.connected = true;
this.processBacklog();
break;
case "/meta/reconnect":
if (!message.successful) {
dojo.debug("cometd reconnection error:", message.error);
return;
}
this.connected = true;
break;
case "/meta/subscribe":
if (!message.successful) {
dojo.debug("cometd subscription error for channel", message.channel, ":", message.error);
return;
}
dojo.debug(message.channel);
break;
}
}
};
this.widenDomain = function (domainStr) {
var cd = domainStr || document.domain;
if (cd.indexOf(".") == -1) {
return;
}
var dps = cd.split(".");
if (dps.length <= 2) {
return;
}
dps = dps.slice(dps.length - 2);
document.domain = dps.join(".");
return document.domain;
};
this.postToIframe = function (content, url) {
if (!this.phonyForm) {
if (dojo.render.html.ie) {
this.phonyForm = document.createElement("<form enctype='application/x-www-form-urlencoded' method='POST' style='display: none;'>");
dojo.body().appendChild(this.phonyForm);
} else {
this.phonyForm = document.createElement("form");
this.phonyForm.style.display = "none";
dojo.body().appendChild(this.phonyForm);
this.phonyForm.enctype = "application/x-www-form-urlencoded";
this.phonyForm.method = "POST";
}
}
this.phonyForm.action = url || cometd.url;
this.phonyForm.target = this.rcvNodeName;
this.phonyForm.setAttribute("target", this.rcvNodeName);
while (this.phonyForm.firstChild) {
this.phonyForm.removeChild(this.phonyForm.firstChild);
}
for (var x in content) {
var tn;
if (dojo.render.html.ie) {
tn = document.createElement("<input type='hidden' name='" + x + "' value='" + content[x] + "'>");
this.phonyForm.appendChild(tn);
} else {
tn = document.createElement("input");
this.phonyForm.appendChild(tn);
tn.type = "hidden";
tn.name = x;
tn.value = content[x];
}
}
this.phonyForm.submit();
};
this.processBacklog = function () {
while (this.backlog.length > 0) {
this.sendMessage(this.backlog.shift(), true);
}
};
this.sendMessage = function (message, bypassBacklog) {
if ((bypassBacklog) || (this.connected)) {
message.connectionId = this.connectionId;
message.clientId = cometd.clientId;
var bindArgs = {url:cometd.url || djConfig["cometdRoot"], method:"POST", mimetype:"text/json", content:{message:dojo.json.serialize([message])}};
return dojo.io.bind(bindArgs);
} else {
this.backlog.push(message);
}
};
this.startup = function (handshakeData) {
dojo.debug("startup!");
dojo.debug(dojo.json.serialize(handshakeData));
if (this.connected) {
return;
}
this.rcvNodeName = "cometdRcv_" + cometd._getRandStr();
var initUrl = cometd.url + "/?tunnelInit=iframe";
if (false && dojo.render.html.ie) {
this.rcvNode = new ActiveXObject("htmlfile");
this.rcvNode.open();
this.rcvNode.write("<html>");
this.rcvNode.write("<script>document.domain = '" + document.domain + "'");
this.rcvNode.write("</html>");
this.rcvNode.close();
var ifrDiv = this.rcvNode.createElement("div");
this.rcvNode.appendChild(ifrDiv);
this.rcvNode.parentWindow.dojo = dojo;
ifrDiv.innerHTML = "<iframe src='" + initUrl + "'></iframe>";
} else {
this.rcvNode = dojo.io.createIFrame(this.rcvNodeName, "", initUrl);
}
};
};
cometd.mimeReplaceTransport = new function () {
this.connected = false;
this.connectionId = null;
this.xhr = null;
this.authToken = null;
this.lastTimestamp = null;
this.lastId = null;
this.backlog = [];
this.check = function (types, version, xdomain) {
return ((!xdomain) && (dojo.render.html.mozilla) && (dojo.lang.inArray(types, "mime-message-block")));
};
this.tunnelInit = function () {
if (this.connected) {
return;
}
this.openTunnelWith({message:dojo.json.serialize([{channel:"/meta/connect", clientId:cometd.clientId, connectionType:"mime-message-block"}])});
this.connected = true;
};
this.tunnelCollapse = function () {
if (this.connected) {
this.connected = false;
this.openTunnelWith({message:dojo.json.serialize([{channel:"/meta/reconnect", clientId:cometd.clientId, connectionId:this.connectionId, timestamp:this.lastTimestamp, id:this.lastId}])});
}
};
this.deliver = cometd.iframeTransport.deliver;
this.handleOnLoad = function (resp) {
cometd.deliver(dojo.json.evalJson(this.xhr.responseText));
};
this.openTunnelWith = function (content, url) {
this.xhr = dojo.hostenv.getXmlhttpObject();
this.xhr.multipart = true;
if (dojo.render.html.mozilla) {
this.xhr.addEventListener("load", dojo.lang.hitch(this, "handleOnLoad"), false);
} else {
if (dojo.render.html.safari) {
dojo.debug("Webkit is broken with multipart responses over XHR = (");
this.xhr.onreadystatechange = dojo.lang.hitch(this, "handleOnLoad");
} else {
this.xhr.onload = dojo.lang.hitch(this, "handleOnLoad");
}
}
this.xhr.open("POST", (url || cometd.url), true);
this.xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
dojo.debug(dojo.json.serialize(content));
this.xhr.send(dojo.io.argsFromMap(content, "utf8"));
};
this.processBacklog = function () {
while (this.backlog.length > 0) {
this.sendMessage(this.backlog.shift(), true);
}
};
this.sendMessage = function (message, bypassBacklog) {
if ((bypassBacklog) || (this.connected)) {
message.connectionId = this.connectionId;
message.clientId = cometd.clientId;
var bindArgs = {url:cometd.url || djConfig["cometdRoot"], method:"POST", mimetype:"text/json", content:{message:dojo.json.serialize([message])}};
return dojo.io.bind(bindArgs);
} else {
this.backlog.push(message);
}
};
this.startup = function (handshakeData) {
dojo.debugShallow(handshakeData);
if (this.connected) {
return;
}
this.tunnelInit();
};
};
cometd.longPollTransport = new function () {
this.connected = false;
this.connectionId = null;
this.authToken = null;
this.lastTimestamp = null;
this.lastId = null;
this.backlog = [];
this.check = function (types, version, xdomain) {
return ((!xdomain) && (dojo.lang.inArray(types, "long-polling")));
};
this.tunnelInit = function () {
if (this.connected) {
return;
}
this.openTunnelWith({message:dojo.json.serialize([{channel:"/meta/connect", clientId:cometd.clientId, connectionType:"long-polling"}])});
this.connected = true;
};
this.tunnelCollapse = function () {
if (!this.connected) {
this.connected = false;
dojo.debug("clientId:", cometd.clientId);
this.openTunnelWith({message:dojo.json.serialize([{channel:"/meta/reconnect", connectionType:"long-polling", clientId:cometd.clientId, connectionId:this.connectionId, timestamp:this.lastTimestamp, id:this.lastId}])});
}
};
this.deliver = cometd.iframeTransport.deliver;
this.openTunnelWith = function (content, url) {
dojo.io.bind({url:(url || cometd.url), method:"post", content:content, mimetype:"text/json", load:dojo.lang.hitch(this, function (type, data, evt, args) {
cometd.deliver(data);
this.connected = false;
this.tunnelCollapse();
}), error:function () {
dojo.debug("tunnel opening failed");
}});
this.connected = true;
};
this.processBacklog = function () {
while (this.backlog.length > 0) {
this.sendMessage(this.backlog.shift(), true);
}
};
this.sendMessage = function (message, bypassBacklog) {
if ((bypassBacklog) || (this.connected)) {
message.connectionId = this.connectionId;
message.clientId = cometd.clientId;
var bindArgs = {url:cometd.url || djConfig["cometdRoot"], method:"post", mimetype:"text/json", content:{message:dojo.json.serialize([message])}, load:dojo.lang.hitch(this, function (type, data, evt, args) {
cometd.deliver(data);
})};
return dojo.io.bind(bindArgs);
} else {
this.backlog.push(message);
}
};
this.startup = function (handshakeData) {
if (this.connected) {
return;
}
this.tunnelInit();
};
};
cometd.callbackPollTransport = new function () {
this.connected = false;
this.connectionId = null;
this.authToken = null;
this.lastTimestamp = null;
this.lastId = null;
this.backlog = [];
this.check = function (types, version, xdomain) {
return dojo.lang.inArray(types, "callback-polling");
};
this.tunnelInit = function () {
if (this.connected) {
return;
}
this.openTunnelWith({message:dojo.json.serialize([{channel:"/meta/connect", clientId:cometd.clientId, connectionType:"callback-polling"}])});
this.connected = true;
};
this.tunnelCollapse = function () {
if (!this.connected) {
this.connected = false;
this.openTunnelWith({message:dojo.json.serialize([{channel:"/meta/reconnect", connectionType:"long-polling", clientId:cometd.clientId, connectionId:this.connectionId, timestamp:this.lastTimestamp, id:this.lastId}])});
}
};
this.deliver = cometd.iframeTransport.deliver;
this.openTunnelWith = function (content, url) {
var req = dojo.io.bind({url:(url || cometd.url), content:content, mimetype:"text/json", transport:"ScriptSrcTransport", jsonParamName:"jsonp", load:dojo.lang.hitch(this, function (type, data, evt, args) {
cometd.deliver(data);
this.connected = false;
this.tunnelCollapse();
}), error:function () {
dojo.debug("tunnel opening failed");
}});
this.connected = true;
};
this.processBacklog = function () {
while (this.backlog.length > 0) {
this.sendMessage(this.backlog.shift(), true);
}
};
this.sendMessage = function (message, bypassBacklog) {
if ((bypassBacklog) || (this.connected)) {
message.connectionId = this.connectionId;
message.clientId = cometd.clientId;
var bindArgs = {url:cometd.url || djConfig["cometdRoot"], mimetype:"text/json", transport:"ScriptSrcTransport", jsonParamName:"jsonp", content:{message:dojo.json.serialize([message])}, load:dojo.lang.hitch(this, function (type, data, evt, args) {
cometd.deliver(data);
}), };
return dojo.io.bind(bindArgs);
} else {
this.backlog.push(message);
}
};
this.startup = function (handshakeData) {
if (this.connected) {
return;
}
this.tunnelInit();
};
};
cometd.connectionTypes.register("mime-message-block", cometd.mimeReplaceTransport.check, cometd.mimeReplaceTransport);
cometd.connectionTypes.register("long-polling", cometd.longPollTransport.check, cometd.longPollTransport);
cometd.connectionTypes.register("callback-polling", cometd.callbackPollTransport.check, cometd.callbackPollTransport);
cometd.connectionTypes.register("iframe", cometd.iframeTransport.check, cometd.iframeTransport);
dojo.io.cometd = cometd;
 
/tags/Racine_livraison_narmer/api/js/dojo/src/io/xip_server.html
New file
0,0 → 1,378
<!--
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
http://dojotoolkit.org/community/licensing.shtml
*/
Pieces taken from Dojo source to make this file stand-alone
-->
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
<script type="text/javascript" src="isAllowed.js"></script>
<!--
BY DEFAULT THIS FILE DOES NOT WORK SO THAT YOU DON'T ACCIDENTALLY EXPOSE
ALL OF YOUR XHR-ENABLED SERVICES ON YOUR SITE.
In order for this file to work, you should define a function with the following signature:
function isAllowedRequest(request){
return false;
}
Return true out of the function if you want to allow the cross-domain request.
DON'T DEFINE THIS FUNCTION IN THIS FILE! Define it in a separate file called isAllowed.js
and include it in this page with a script tag that has a src attribute pointing to the file.
See the very first script tag in this file for an example. You do not have to place the
script file in the same directory as this file, just update the path above if you move it
somewhere else.
Customize the isAllowedRequest function to restrict what types of requests are allowed
for this server. The request object has the following properties:
- requestHeaders: an object with the request headers that are to be added to
the XHR request.
- method: the HTTP method (GET, POST, etc...)
- uri: The URI for the request.
- data: The URL-encoded data for the request. For a GET request, this would
be the querystring parameters. For a POST request, it wll be the
body data.
See xip_client.html for more info on the xip fragment identifier protocol.
-->
<script type="text/javascript">
// <!--
djConfig = {
parseWidgets: false,
baseScriptUri: "./"
}
// -->
</script>
<script type="text/javascript">
// <!--
//Core XHR handling taken from Dojo IO code.
dojo = {};
dojo.hostenv = {};
// These are in order of decreasing likelihood; this will change in time.
dojo.hostenv._XMLHTTP_PROGIDS = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'];
dojo.hostenv.getXmlhttpObject = function(){
var http = null;
var last_e = null;
try{ http = new XMLHttpRequest(); }catch(e){}
if(!http){
for(var i=0; i<3; ++i){
var progid = dojo.hostenv._XMLHTTP_PROGIDS[i];
try{
http = new ActiveXObject(progid);
}catch(e){
last_e = e;
}
if(http){
dojo.hostenv._XMLHTTP_PROGIDS = [progid]; // so faster next time
break;
}
}
/*if(http && !http.toString) {
http.toString = function() { "[object XMLHttpRequest]"; }
}*/
}
if(!http){
throw "xip_server.html: XMLHTTP not available: " + last_e;
}
return http;
}
 
dojo.setHeaders = function(http, headers){
if(headers) {
for(var header in headers) {
var headerValue = headers[header];
http.setRequestHeader(header, headerValue);
}
}
}
 
//MSIE has the lowest limit for URLs with fragment identifiers,
//at around 4K. Choosing a slightly smaller number for good measure.
xipUrlLimit = 4000;
xipIdCounter = 1;
 
function xipServerInit(){
xipStateId = "";
xipCurrentHash = "";
xipRequestMessage = "";
xipResponseParts = [];
xipPartIndex = 0;
}
 
function pollHash(){
//Can't use location.hash because at least Firefox does a decodeURIComponent on it.
var urlParts = window.location.href.split("#");
if(urlParts.length == 2){
var newHash = urlParts[1];
if(newHash != xipCurrentHash){
try{
messageReceived(newHash);
}catch(e){
//Make sure to not keep processing the error hash value.
xipCurrentHash = newHash;
throw e;
}
xipCurrentHash = newHash;
}
}
}
 
function messageReceived(encodedData){
var msg = unpackMessage(encodedData);
switch(msg.command){
case "ok":
sendResponsePart();
break;
case "start":
xipRequestMessage = "";
xipRequestMessage += msg.message;
setClientUrl("ok");
break;
case "part":
xipRequestMessage += msg.message;
setClientUrl("ok");
break;
case "end":
setClientUrl("ok");
xipRequestMessage += msg.message;
sendXhr();
break;
}
}
 
function sendResponse(encodedData){
//Break the message into parts, if necessary.
xipResponseParts = [];
var resData = encodedData;
var urlLength = xipClientUrl.length;
var partLength = xipUrlLimit - urlLength;
var resIndex = 0;
 
while((resData.length - resIndex) + urlLength > xipUrlLimit){
var part = resData.substring(resIndex, resIndex + partLength);
//Safari will do some extra hex escaping unless we keep the original hex
//escaping complete.
var percentIndex = part.lastIndexOf("%");
if(percentIndex == part.length - 1 || percentIndex == part.length - 2){
part = part.substring(0, percentIndex);
}
xipResponseParts.push(part);
resIndex += part.length;
}
xipResponseParts.push(resData.substring(resIndex, resData.length));
xipPartIndex = 0;
sendResponsePart();
}
function sendResponsePart(){
if(xipPartIndex < xipResponseParts.length){
//Get the message part.
var partData = xipResponseParts[xipPartIndex];
//Get the command.
var cmd = "part";
if(xipPartIndex + 1 == xipResponseParts.length){
cmd = "end";
}else if (xipPartIndex == 0){
cmd = "start";
}
 
setClientUrl(cmd, partData);
xipPartIndex++;
}else{
xipServerInit();
}
}
 
function setClientUrl(cmd, message){
var clientUrl = makeClientUrl(cmd, message);
//Safari won't let us replace across domains.
if(navigator.userAgent.indexOf("Safari") == -1){
parent.location.replace(clientUrl);
}else{
parent.location = clientUrl;
}
}
 
function makeClientUrl(cmd, message){
var clientUrl = xipClientUrl + "#" + (xipIdCounter++) + ":" + cmd;
if(message){
clientUrl += ":" + message;
}
return clientUrl
}
 
function xhrDone(xhr){
/* Need to pull off and return the following data:
- responseHeaders
- status
- statusText
- responseText
*/
var response = {};
if(typeof(xhr.getAllResponseHeaders) != "undefined"){
var allHeaders = xhr.getAllResponseHeaders();
if(allHeaders){
response.responseHeaders = allHeaders;
}
}
if(xhr.status == 0 || xhr.status){
response.status = xhr.status;
}
if(xhr.statusText){
response.statusText = xhr.statusText;
}
if(xhr.responseText){
response.responseText = xhr.responseText;
}
//Build a string of the response object.
var result = "";
var isFirst = true;
for (var param in response){
if(isFirst){
isFirst = false;
}else{
result += "&";
}
result += param + "=" + encodeURIComponent(response[param]);
}
sendResponse(result);
}
 
function sendXhr(){
var request = {};
var nvPairs = xipRequestMessage.split("&");
var i = 0;
var nameValue = null;
for(i = 0; i < nvPairs.length; i++){
if(nvPairs[i]){
var nameValue = nvPairs[i].split("=");
request[decodeURIComponent(nameValue[0])] = decodeURIComponent(nameValue[1]);
}
}
 
//Split up the request headers, if any.
var headers = {};
if(request.requestHeaders){
nvPairs = request.requestHeaders.split("\r\n");
for(i = 0; i < nvPairs.length; i++){
if(nvPairs[i]){
nameValue = nvPairs[i].split(": ");
headers[decodeURIComponent(nameValue[0])] = decodeURIComponent(nameValue[1]);
}
}
 
request.requestHeaders = headers;
}
if(isAllowedRequest(request)){
//The request is allowed, so set up the XHR object.
var xhr = dojo.hostenv.getXmlhttpObject();
//Start timer to look for readyState.
var xhrIntervalId = setInterval(function(){
if(xhr.readyState == 4){
clearInterval(xhrIntervalId);
xhrDone(xhr);
}
}, 10);
 
//Actually start up the XHR request.
xhr.open(request.method, request.uri, true);
dojo.setHeaders(xhr, request.requestHeaders);
var content = "";
if(request.data){
content = request.data;
}
 
try{
xhr.send(content);
}catch(e){
if(typeof xhr.abort == "function"){
xhr.abort();
xhrDone({status: 404, statusText: "xip_server.html error: " + e});
}
}
}
}
 
function unpackMessage(encodedMessage){
var parts = encodedMessage.split(":");
var command = parts[1];
encodedMessage = parts[2] || "";
 
var config = null;
if(command == "init"){
var configParts = encodedMessage.split("&");
config = {};
for(var i = 0; i < configParts.length; i++){
var nameValue = configParts[i].split("=");
config[decodeURIComponent(nameValue[0])] = decodeURIComponent(nameValue[1]);
}
}
return {command: command, message: encodedMessage, config: config};
}
 
function onServerLoad(){
xipServerInit();
 
//Decode the init params
var config = unpackMessage(window.location.href.split("#")[1]).config;
 
xipStateId = config.id;
xipClientUrl = config.client;
xipUseFrameRecursion = config["fr"];
 
setInterval(pollHash, 10);
if(xipUseFrameRecursion == "true"){
var serverUrl = window.location.href.split("#")[0];
document.getElementById("iframeHolder").innerHTML = '<iframe src="'
+ makeClientUrl("init", 'id=' + xipStateId + '&server=' + encodeURIComponent(serverUrl)
+ '&fr=endpoint') + '" name="' + xipStateId + '_clientEndPoint"></iframe>';
}else{
setClientUrl("loaded");
}
}
 
if(typeof(window.addEventListener) == "undefined"){
window.attachEvent("onload", onServerLoad);
}else{
window.addEventListener('load', onServerLoad, false);
}
// -->
</script>
</head>
<body>
<h4>The Dojo Toolkit -- xip_server.html</h4>
 
<p>This file is used for Dojo's XMLHttpRequest Iframe Proxy. This is the the file
that should go on the server that will actually be doing the XHR request.</p>
<div id="iframeHolder"></div>
</body>
</html>
/tags/Racine_livraison_narmer/api/js/dojo/src/io/RepubsubIO.js
New file
0,0 → 1,337
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
 
 
dojo.require("dojo.event.*");
dojo.require("dojo.io.BrowserIO");
dojo.provide("dojo.io.RepubsubIO");
dojo.io.repubsubTranport = new function () {
var rps = dojo.io.repubsub;
this.canHandle = function (kwArgs) {
if ((kwArgs["mimetype"] == "text/javascript") && (kwArgs["method"] == "repubsub")) {
return true;
}
return false;
};
this.bind = function (kwArgs) {
if (!rps.isInitialized) {
rps.init();
}
if (!rps.topics[kwArgs.url]) {
kwArgs.rpsLoad = function (evt) {
kwArgs.load("load", evt);
};
rps.subscribe(kwArgs.url, kwArgs, "rpsLoad");
}
if (kwArgs["content"]) {
var cEvt = dojo.io.repubsubEvent.initFromProperties(kwArgs.content);
rps.publish(kwArgs.url, cEvt);
}
};
dojo.io.transports.addTransport("repubsubTranport");
};
dojo.io.repubsub = new function () {
this.initDoc = "init.html";
this.isInitialized = false;
this.subscriptionBacklog = [];
this.debug = true;
this.rcvNodeName = null;
this.sndNodeName = null;
this.rcvNode = null;
this.sndNode = null;
this.canRcv = false;
this.canSnd = false;
this.canLog = false;
this.sndTimer = null;
this.windowRef = window;
this.backlog = [];
this.tunnelInitCount = 0;
this.tunnelFrameKey = "tunnel_frame";
this.serverBaseURL = location.protocol + "//" + location.host + location.pathname;
this.logBacklog = [];
this.getRandStr = function () {
return Math.random().toString().substring(2, 10);
};
this.userid = "guest";
this.tunnelID = this.getRandStr();
this.attachPathList = [];
this.topics = [];
this.parseGetStr = function () {
var baseUrl = document.location.toString();
var params = baseUrl.split("?", 2);
if (params.length > 1) {
var paramStr = params[1];
var pairs = paramStr.split("&");
var opts = [];
for (var x in pairs) {
var sp = pairs[x].split("=");
try {
opts[sp[0]] = eval(sp[1]);
}
catch (e) {
opts[sp[0]] = sp[1];
}
}
return opts;
} else {
return [];
}
};
var getOpts = this.parseGetStr();
for (var x in getOpts) {
this[x] = getOpts[x];
}
if (!this["tunnelURI"]) {
this.tunnelURI = ["/who/", escape(this.userid), "/s/", this.getRandStr(), "/kn_journal"].join("");
}
if (window["repubsubOpts"] || window["rpsOpts"]) {
var optObj = window["repubsubOpts"] || window["rpsOpts"];
for (var x in optObj) {
this[x] = optObj[x];
}
}
this.tunnelCloseCallback = function () {
dojo.io.setIFrameSrc(this.rcvNode, this.initDoc + "?callback=repubsub.rcvNodeReady&domain=" + document.domain);
};
this.receiveEventFromTunnel = function (evt, srcWindow) {
if (!evt["elements"]) {
this.log("bailing! event received without elements!", "error");
return;
}
var e = {};
for (var i = 0; i < evt.elements.length; i++) {
var ee = evt.elements[i];
e[ee.name || ee.nameU] = (ee.value || ee.valueU);
this.log("[event]: " + (ee.name || ee.nameU) + ": " + e[ee.name || ee.nameU]);
}
this.dispatch(e);
};
this.widenDomain = function (domainStr) {
var cd = domainStr || document.domain;
if (cd.indexOf(".") == -1) {
return;
}
var dps = cd.split(".");
if (dps.length <= 2) {
return;
}
dps = dps.slice(dps.length - 2);
document.domain = dps.join(".");
};
this.parseCookie = function () {
var cs = document.cookie;
var keypairs = cs.split(";");
for (var x = 0; x < keypairs.length; x++) {
keypairs[x] = keypairs[x].split("=");
if (x != keypairs.length - 1) {
cs += ";";
}
}
return keypairs;
};
this.setCookie = function (keypairs, clobber) {
if ((clobber) && (clobber == true)) {
document.cookie = "";
}
var cs = "";
for (var x = 0; x < keypairs.length; x++) {
cs += keypairs[x][0] + "=" + keypairs[x][1];
if (x != keypairs.length - 1) {
cs += ";";
}
}
document.cookie = cs;
};
this.log = function (str, lvl) {
if (!this.debug) {
return;
}
while (this.logBacklog.length > 0) {
if (!this.canLog) {
break;
}
var blo = this.logBacklog.shift();
this.writeLog("[" + blo[0] + "]: " + blo[1], blo[2]);
}
this.writeLog(str, lvl);
};
this.writeLog = function (str, lvl) {
dojo.debug(((new Date()).toLocaleTimeString()) + ": " + str);
};
this.init = function () {
this.widenDomain();
this.openTunnel();
this.isInitialized = true;
while (this.subscriptionBacklog.length) {
this.subscribe.apply(this, this.subscriptionBacklog.shift());
}
};
this.clobber = function () {
if (this.rcvNode) {
this.setCookie([[this.tunnelFrameKey, "closed"], ["path", "/"]], false);
}
};
this.openTunnel = function () {
this.rcvNodeName = "rcvIFrame_" + this.getRandStr();
this.setCookie([[this.tunnelFrameKey, this.rcvNodeName], ["path", "/"]], false);
this.rcvNode = dojo.io.createIFrame(this.rcvNodeName);
dojo.io.setIFrameSrc(this.rcvNode, this.initDoc + "?callback=repubsub.rcvNodeReady&domain=" + document.domain);
this.sndNodeName = "sndIFrame_" + this.getRandStr();
this.sndNode = dojo.io.createIFrame(this.sndNodeName);
dojo.io.setIFrameSrc(this.sndNode, this.initDoc + "?callback=repubsub.sndNodeReady&domain=" + document.domain);
};
this.rcvNodeReady = function () {
var statusURI = [this.tunnelURI, "/kn_status/", this.getRandStr(), "_", String(this.tunnelInitCount++)].join("");
this.log("rcvNodeReady");
var initURIArr = [this.serverBaseURL, "/kn?kn_from=", escape(this.tunnelURI), "&kn_id=", escape(this.tunnelID), "&kn_status_from=", escape(statusURI)];
dojo.io.setIFrameSrc(this.rcvNode, initURIArr.join(""));
this.subscribe(statusURI, this, "statusListener", true);
this.log(initURIArr.join(""));
};
this.sndNodeReady = function () {
this.canSnd = true;
this.log("sndNodeReady");
this.log(this.backlog.length);
if (this.backlog.length > 0) {
this.dequeueEvent();
}
};
this.statusListener = function (evt) {
this.log("status listener called");
this.log(evt.status, "info");
};
this.dispatch = function (evt) {
if (evt["to"] || evt["kn_routed_from"]) {
var rf = evt["to"] || evt["kn_routed_from"];
var topic = rf.split(this.serverBaseURL, 2)[1];
if (!topic) {
topic = rf;
}
this.log("[topic] " + topic);
if (topic.length > 3) {
if (topic.slice(0, 3) == "/kn") {
topic = topic.slice(3);
}
}
if (this.attachPathList[topic]) {
this.attachPathList[topic](evt);
}
}
};
this.subscribe = function (topic, toObj, toFunc, dontTellServer) {
if (!this.isInitialized) {
this.subscriptionBacklog.push([topic, toObj, toFunc, dontTellServer]);
return;
}
if (!this.attachPathList[topic]) {
this.attachPathList[topic] = function () {
return true;
};
this.log("subscribing to: " + topic);
this.topics.push(topic);
}
var revt = new dojo.io.repubsubEvent(this.tunnelURI, topic, "route");
var rstr = [this.serverBaseURL + "/kn", revt.toGetString()].join("");
dojo.event.kwConnect({once:true, srcObj:this.attachPathList, srcFunc:topic, adviceObj:toObj, adviceFunc:toFunc});
if (!this.rcvNode) {
}
if (dontTellServer) {
return;
}
this.log("sending subscription to: " + topic);
this.sendTopicSubToServer(topic, rstr);
};
this.sendTopicSubToServer = function (topic, str) {
if (!this.attachPathList[topic]["subscriptions"]) {
this.enqueueEventStr(str);
this.attachPathList[topic].subscriptions = 0;
}
this.attachPathList[topic].subscriptions++;
};
this.unSubscribe = function (topic, toObj, toFunc) {
dojo.event.kwDisconnect({srcObj:this.attachPathList, srcFunc:topic, adviceObj:toObj, adviceFunc:toFunc});
};
this.publish = function (topic, event) {
var evt = dojo.io.repubsubEvent.initFromProperties(event);
evt.to = topic;
var evtURLParts = [];
evtURLParts.push(this.serverBaseURL + "/kn");
evtURLParts.push(evt.toGetString());
this.enqueueEventStr(evtURLParts.join(""));
};
this.enqueueEventStr = function (evtStr) {
this.log("enqueueEventStr");
this.backlog.push(evtStr);
this.dequeueEvent();
};
this.dequeueEvent = function (force) {
this.log("dequeueEvent");
if (this.backlog.length <= 0) {
return;
}
if ((this.canSnd) || (force)) {
dojo.io.setIFrameSrc(this.sndNode, this.backlog.shift() + "&callback=repubsub.sndNodeReady");
this.canSnd = false;
} else {
this.log("sndNode not available yet!", "debug");
}
};
};
dojo.io.repubsubEvent = function (to, from, method, id, routeURI, payload, dispname, uid) {
this.to = to;
this.from = from;
this.method = method || "route";
this.id = id || repubsub.getRandStr();
this.uri = routeURI;
this.displayname = dispname || repubsub.displayname;
this.userid = uid || repubsub.userid;
this.payload = payload || "";
this.flushChars = 4096;
this.initFromProperties = function (evt) {
if (evt.constructor = dojo.io.repubsubEvent) {
for (var x in evt) {
this[x] = evt[x];
}
} else {
for (var x in evt) {
if (typeof this.forwardPropertiesMap[x] == "string") {
this[this.forwardPropertiesMap[x]] = evt[x];
} else {
this[x] = evt[x];
}
}
}
};
this.toGetString = function (noQmark) {
var qs = [((noQmark) ? "" : "?")];
for (var x = 0; x < this.properties.length; x++) {
var tp = this.properties[x];
if (this[tp[0]]) {
qs.push(tp[1] + "=" + encodeURIComponent(String(this[tp[0]])));
}
}
return qs.join("&");
};
};
dojo.io.repubsubEvent.prototype.properties = [["from", "kn_from"], ["to", "kn_to"], ["method", "do_method"], ["id", "kn_id"], ["uri", "kn_uri"], ["displayname", "kn_displayname"], ["userid", "kn_userid"], ["payload", "kn_payload"], ["flushChars", "kn_response_flush"], ["responseFormat", "kn_response_format"]];
dojo.io.repubsubEvent.prototype.forwardPropertiesMap = {};
dojo.io.repubsubEvent.prototype.reversePropertiesMap = {};
for (var x = 0; x < dojo.io.repubsubEvent.prototype.properties.length; x++) {
var tp = dojo.io.repubsubEvent.prototype.properties[x];
dojo.io.repubsubEvent.prototype.reversePropertiesMap[tp[0]] = tp[1];
dojo.io.repubsubEvent.prototype.forwardPropertiesMap[tp[1]] = tp[0];
}
dojo.io.repubsubEvent.initFromProperties = function (evt) {
var eventObj = new dojo.io.repubsubEvent();
eventObj.initFromProperties(evt);
return eventObj;
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/io/ScriptSrcIO.js
New file
0,0 → 1,315
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.io.ScriptSrcIO");
dojo.require("dojo.io.BrowserIO");
dojo.require("dojo.undo.browser");
dojo.io.ScriptSrcTransport = new function () {
this.preventCache = false;
this.maxUrlLength = 1000;
this.inFlightTimer = null;
this.DsrStatusCodes = {Continue:100, Ok:200, Error:500};
this.startWatchingInFlight = function () {
if (!this.inFlightTimer) {
this.inFlightTimer = setInterval("dojo.io.ScriptSrcTransport.watchInFlight();", 100);
}
};
this.watchInFlight = function () {
var totalCount = 0;
var doneCount = 0;
for (var param in this._state) {
totalCount++;
var currentState = this._state[param];
if (currentState.isDone) {
doneCount++;
delete this._state[param];
} else {
if (!currentState.isFinishing) {
var listener = currentState.kwArgs;
try {
if (currentState.checkString && eval("typeof(" + currentState.checkString + ") != 'undefined'")) {
currentState.isFinishing = true;
this._finish(currentState, "load");
doneCount++;
delete this._state[param];
} else {
if (listener.timeoutSeconds && listener.timeout) {
if (currentState.startTime + (listener.timeoutSeconds * 1000) < (new Date()).getTime()) {
currentState.isFinishing = true;
this._finish(currentState, "timeout");
doneCount++;
delete this._state[param];
}
} else {
if (!listener.timeoutSeconds) {
doneCount++;
}
}
}
}
catch (e) {
currentState.isFinishing = true;
this._finish(currentState, "error", {status:this.DsrStatusCodes.Error, response:e});
}
}
}
}
if (doneCount >= totalCount) {
clearInterval(this.inFlightTimer);
this.inFlightTimer = null;
}
};
this.canHandle = function (kwArgs) {
return dojo.lang.inArray(["text/javascript", "text/json", "application/json"], (kwArgs["mimetype"].toLowerCase())) && (kwArgs["method"].toLowerCase() == "get") && !(kwArgs["formNode"] && dojo.io.formHasFile(kwArgs["formNode"])) && (!kwArgs["sync"] || kwArgs["sync"] == false) && !kwArgs["file"] && !kwArgs["multipart"];
};
this.removeScripts = function () {
var scripts = document.getElementsByTagName("script");
for (var i = 0; scripts && i < scripts.length; i++) {
var scriptTag = scripts[i];
if (scriptTag.className == "ScriptSrcTransport") {
var parent = scriptTag.parentNode;
parent.removeChild(scriptTag);
i--;
}
}
};
this.bind = function (kwArgs) {
var url = kwArgs.url;
var query = "";
if (kwArgs["formNode"]) {
var ta = kwArgs.formNode.getAttribute("action");
if ((ta) && (!kwArgs["url"])) {
url = ta;
}
var tp = kwArgs.formNode.getAttribute("method");
if ((tp) && (!kwArgs["method"])) {
kwArgs.method = tp;
}
query += dojo.io.encodeForm(kwArgs.formNode, kwArgs.encoding, kwArgs["formFilter"]);
}
if (url.indexOf("#") > -1) {
dojo.debug("Warning: dojo.io.bind: stripping hash values from url:", url);
url = url.split("#")[0];
}
var urlParts = url.split("?");
if (urlParts && urlParts.length == 2) {
url = urlParts[0];
query += (query ? "&" : "") + urlParts[1];
}
if (kwArgs["backButton"] || kwArgs["back"] || kwArgs["changeUrl"]) {
dojo.undo.browser.addToHistory(kwArgs);
}
var id = kwArgs["apiId"] ? kwArgs["apiId"] : "id" + this._counter++;
var content = kwArgs["content"];
var jsonpName = kwArgs.jsonParamName;
if (kwArgs.sendTransport || jsonpName) {
if (!content) {
content = {};
}
if (kwArgs.sendTransport) {
content["dojo.transport"] = "scriptsrc";
}
if (jsonpName) {
content[jsonpName] = "dojo.io.ScriptSrcTransport._state." + id + ".jsonpCall";
}
}
if (kwArgs.postContent) {
query = kwArgs.postContent;
} else {
if (content) {
query += ((query) ? "&" : "") + dojo.io.argsFromMap(content, kwArgs.encoding, jsonpName);
}
}
if (kwArgs["apiId"]) {
kwArgs["useRequestId"] = true;
}
var state = {"id":id, "idParam":"_dsrid=" + id, "url":url, "query":query, "kwArgs":kwArgs, "startTime":(new Date()).getTime(), "isFinishing":false};
if (!url) {
this._finish(state, "error", {status:this.DsrStatusCodes.Error, statusText:"url.none"});
return;
}
if (content && content[jsonpName]) {
state.jsonp = content[jsonpName];
state.jsonpCall = function (data) {
if (data["Error"] || data["error"]) {
if (dojo["json"] && dojo["json"]["serialize"]) {
dojo.debug(dojo.json.serialize(data));
}
dojo.io.ScriptSrcTransport._finish(this, "error", data);
} else {
dojo.io.ScriptSrcTransport._finish(this, "load", data);
}
};
}
if (kwArgs["useRequestId"] || kwArgs["checkString"] || state["jsonp"]) {
this._state[id] = state;
}
if (kwArgs["checkString"]) {
state.checkString = kwArgs["checkString"];
}
state.constantParams = (kwArgs["constantParams"] == null ? "" : kwArgs["constantParams"]);
if (kwArgs["preventCache"] || (this.preventCache == true && kwArgs["preventCache"] != false)) {
state.nocacheParam = "dojo.preventCache=" + new Date().valueOf();
} else {
state.nocacheParam = "";
}
var urlLength = state.url.length + state.query.length + state.constantParams.length + state.nocacheParam.length + this._extraPaddingLength;
if (kwArgs["useRequestId"]) {
urlLength += state.idParam.length;
}
if (!kwArgs["checkString"] && kwArgs["useRequestId"] && !state["jsonp"] && !kwArgs["forceSingleRequest"] && urlLength > this.maxUrlLength) {
if (url > this.maxUrlLength) {
this._finish(state, "error", {status:this.DsrStatusCodes.Error, statusText:"url.tooBig"});
return;
} else {
this._multiAttach(state, 1);
}
} else {
var queryParams = [state.constantParams, state.nocacheParam, state.query];
if (kwArgs["useRequestId"] && !state["jsonp"]) {
queryParams.unshift(state.idParam);
}
var finalUrl = this._buildUrl(state.url, queryParams);
state.finalUrl = finalUrl;
this._attach(state.id, finalUrl);
}
this.startWatchingInFlight();
};
this._counter = 1;
this._state = {};
this._extraPaddingLength = 16;
this._buildUrl = function (url, nameValueArray) {
var finalUrl = url;
var joiner = "?";
for (var i = 0; i < nameValueArray.length; i++) {
if (nameValueArray[i]) {
finalUrl += joiner + nameValueArray[i];
joiner = "&";
}
}
return finalUrl;
};
this._attach = function (id, url) {
var element = document.createElement("script");
element.type = "text/javascript";
element.src = url;
element.id = id;
element.className = "ScriptSrcTransport";
document.getElementsByTagName("head")[0].appendChild(element);
};
this._multiAttach = function (state, part) {
if (state.query == null) {
this._finish(state, "error", {status:this.DsrStatusCodes.Error, statusText:"query.null"});
return;
}
if (!state.constantParams) {
state.constantParams = "";
}
var queryMax = this.maxUrlLength - state.idParam.length - state.constantParams.length - state.url.length - state.nocacheParam.length - this._extraPaddingLength;
var isDone = state.query.length < queryMax;
var currentQuery;
if (isDone) {
currentQuery = state.query;
state.query = null;
} else {
var ampEnd = state.query.lastIndexOf("&", queryMax - 1);
var eqEnd = state.query.lastIndexOf("=", queryMax - 1);
if (ampEnd > eqEnd || eqEnd == queryMax - 1) {
currentQuery = state.query.substring(0, ampEnd);
state.query = state.query.substring(ampEnd + 1, state.query.length);
} else {
currentQuery = state.query.substring(0, queryMax);
var queryName = currentQuery.substring((ampEnd == -1 ? 0 : ampEnd + 1), eqEnd);
state.query = queryName + "=" + state.query.substring(queryMax, state.query.length);
}
}
var queryParams = [currentQuery, state.idParam, state.constantParams, state.nocacheParam];
if (!isDone) {
queryParams.push("_part=" + part);
}
var url = this._buildUrl(state.url, queryParams);
this._attach(state.id + "_" + part, url);
};
this._finish = function (state, callback, event) {
if (callback != "partOk" && !state.kwArgs[callback] && !state.kwArgs["handle"]) {
if (callback == "error") {
state.isDone = true;
throw event;
}
} else {
switch (callback) {
case "load":
var response = event ? event.response : null;
if (!response) {
response = event;
}
state.kwArgs[(typeof state.kwArgs.load == "function") ? "load" : "handle"]("load", response, event, state.kwArgs);
state.isDone = true;
break;
case "partOk":
var part = parseInt(event.response.part, 10) + 1;
if (event.response.constantParams) {
state.constantParams = event.response.constantParams;
}
this._multiAttach(state, part);
state.isDone = false;
break;
case "error":
state.kwArgs[(typeof state.kwArgs.error == "function") ? "error" : "handle"]("error", event.response, event, state.kwArgs);
state.isDone = true;
break;
default:
state.kwArgs[(typeof state.kwArgs[callback] == "function") ? callback : "handle"](callback, event, event, state.kwArgs);
state.isDone = true;
}
}
};
dojo.io.transports.addTransport("ScriptSrcTransport");
};
window.onscriptload = function (event) {
var state = null;
var transport = dojo.io.ScriptSrcTransport;
if (transport._state[event.id]) {
state = transport._state[event.id];
} else {
var tempState;
for (var param in transport._state) {
tempState = transport._state[param];
if (tempState.finalUrl && tempState.finalUrl == event.id) {
state = tempState;
break;
}
}
if (state == null) {
var scripts = document.getElementsByTagName("script");
for (var i = 0; scripts && i < scripts.length; i++) {
var scriptTag = scripts[i];
if (scriptTag.getAttribute("class") == "ScriptSrcTransport" && scriptTag.src == event.id) {
state = transport._state[scriptTag.id];
break;
}
}
}
if (state == null) {
throw "No matching state for onscriptload event.id: " + event.id;
}
}
var callbackName = "error";
switch (event.status) {
case dojo.io.ScriptSrcTransport.DsrStatusCodes.Continue:
callbackName = "partOk";
break;
case dojo.io.ScriptSrcTransport.DsrStatusCodes.Ok:
callbackName = "load";
break;
}
transport._finish(state, callbackName, event);
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/flash.js
New file
0,0 → 1,444
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.flash");
dojo.require("dojo.string.*");
dojo.require("dojo.uri.*");
dojo.require("dojo.html.common");
dojo.flash = function () {
};
dojo.flash = {flash6_version:null, flash8_version:null, ready:false, _visible:true, _loadedListeners:new Array(), _installingListeners:new Array(), setSwf:function (fileInfo) {
if (fileInfo == null || dojo.lang.isUndefined(fileInfo)) {
return;
}
if (fileInfo.flash6 != null && !dojo.lang.isUndefined(fileInfo.flash6)) {
this.flash6_version = fileInfo.flash6;
}
if (fileInfo.flash8 != null && !dojo.lang.isUndefined(fileInfo.flash8)) {
this.flash8_version = fileInfo.flash8;
}
if (!dojo.lang.isUndefined(fileInfo.visible)) {
this._visible = fileInfo.visible;
}
this._initialize();
}, useFlash6:function () {
if (this.flash6_version == null) {
return false;
} else {
if (this.flash6_version != null && dojo.flash.info.commVersion == 6) {
return true;
} else {
return false;
}
}
}, useFlash8:function () {
if (this.flash8_version == null) {
return false;
} else {
if (this.flash8_version != null && dojo.flash.info.commVersion == 8) {
return true;
} else {
return false;
}
}
}, addLoadedListener:function (listener) {
this._loadedListeners.push(listener);
}, addInstallingListener:function (listener) {
this._installingListeners.push(listener);
}, loaded:function () {
dojo.flash.ready = true;
if (dojo.flash._loadedListeners.length > 0) {
for (var i = 0; i < dojo.flash._loadedListeners.length; i++) {
dojo.flash._loadedListeners[i].call(null);
}
}
}, installing:function () {
if (dojo.flash._installingListeners.length > 0) {
for (var i = 0; i < dojo.flash._installingListeners.length; i++) {
dojo.flash._installingListeners[i].call(null);
}
}
}, _initialize:function () {
var installer = new dojo.flash.Install();
dojo.flash.installer = installer;
if (installer.needed() == true) {
installer.install();
} else {
dojo.flash.obj = new dojo.flash.Embed(this._visible);
dojo.flash.obj.write(dojo.flash.info.commVersion);
dojo.flash.comm = new dojo.flash.Communicator();
}
}};
dojo.flash.Info = function () {
if (dojo.render.html.ie) {
document.writeln("<script language=\"VBScript\" type=\"text/vbscript\">");
document.writeln("Function VBGetSwfVer(i)");
document.writeln(" on error resume next");
document.writeln(" Dim swControl, swVersion");
document.writeln(" swVersion = 0");
document.writeln(" set swControl = CreateObject(\"ShockwaveFlash.ShockwaveFlash.\" + CStr(i))");
document.writeln(" if (IsObject(swControl)) then");
document.writeln(" swVersion = swControl.GetVariable(\"$version\")");
document.writeln(" end if");
document.writeln(" VBGetSwfVer = swVersion");
document.writeln("End Function");
document.writeln("</script>");
}
this._detectVersion();
this._detectCommunicationVersion();
};
dojo.flash.Info.prototype = {version:-1, versionMajor:-1, versionMinor:-1, versionRevision:-1, capable:false, commVersion:6, installing:false, isVersionOrAbove:function (reqMajorVer, reqMinorVer, reqVer) {
reqVer = parseFloat("." + reqVer);
if (this.versionMajor >= reqMajorVer && this.versionMinor >= reqMinorVer && this.versionRevision >= reqVer) {
return true;
} else {
return false;
}
}, _detectVersion:function () {
var versionStr;
for (var testVersion = 25; testVersion > 0; testVersion--) {
if (dojo.render.html.ie) {
versionStr = VBGetSwfVer(testVersion);
} else {
versionStr = this._JSFlashInfo(testVersion);
}
if (versionStr == -1) {
this.capable = false;
return;
} else {
if (versionStr != 0) {
var versionArray;
if (dojo.render.html.ie) {
var tempArray = versionStr.split(" ");
var tempString = tempArray[1];
versionArray = tempString.split(",");
} else {
versionArray = versionStr.split(".");
}
this.versionMajor = versionArray[0];
this.versionMinor = versionArray[1];
this.versionRevision = versionArray[2];
var versionString = this.versionMajor + "." + this.versionRevision;
this.version = parseFloat(versionString);
this.capable = true;
break;
}
}
}
}, _JSFlashInfo:function (testVersion) {
if (navigator.plugins != null && navigator.plugins.length > 0) {
if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
var descArray = flashDescription.split(" ");
var tempArrayMajor = descArray[2].split(".");
var versionMajor = tempArrayMajor[0];
var versionMinor = tempArrayMajor[1];
if (descArray[3] != "") {
var tempArrayMinor = descArray[3].split("r");
} else {
var tempArrayMinor = descArray[4].split("r");
}
var versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
var version = versionMajor + "." + versionMinor + "." + versionRevision;
return version;
}
}
return -1;
}, _detectCommunicationVersion:function () {
if (this.capable == false) {
this.commVersion = null;
return;
}
if (typeof djConfig["forceFlashComm"] != "undefined" && typeof djConfig["forceFlashComm"] != null) {
this.commVersion = djConfig["forceFlashComm"];
return;
}
if (dojo.render.html.safari == true || dojo.render.html.opera == true) {
this.commVersion = 8;
} else {
this.commVersion = 6;
}
}};
dojo.flash.Embed = function (visible) {
this._visible = visible;
};
dojo.flash.Embed.prototype = {width:215, height:138, id:"flashObject", _visible:true, protocol:function () {
switch (window.location.protocol) {
case "https:":
return "https";
break;
default:
return "http";
break;
}
}, write:function (flashVer, doExpressInstall) {
if (dojo.lang.isUndefined(doExpressInstall)) {
doExpressInstall = false;
}
var containerStyle = new dojo.string.Builder();
containerStyle.append("width: " + this.width + "px; ");
containerStyle.append("height: " + this.height + "px; ");
if (this._visible == false) {
containerStyle.append("position: absolute; ");
containerStyle.append("z-index: 10000; ");
containerStyle.append("top: -1000px; ");
containerStyle.append("left: -1000px; ");
}
containerStyle = containerStyle.toString();
var objectHTML;
var swfloc;
if (flashVer == 6) {
swfloc = dojo.flash.flash6_version;
var dojoPath = djConfig.baseRelativePath;
swfloc = swfloc + "?baseRelativePath=" + escape(dojoPath);
objectHTML = "<embed id=\"" + this.id + "\" src=\"" + swfloc + "\" " + " quality=\"high\" bgcolor=\"#ffffff\" " + " width=\"" + this.width + "\" height=\"" + this.height + "\" " + " name=\"" + this.id + "\" " + " align=\"middle\" allowScriptAccess=\"sameDomain\" " + " type=\"application/x-shockwave-flash\" swLiveConnect=\"true\" " + " pluginspage=\"" + this.protocol() + "://www.macromedia.com/go/getflashplayer\">";
} else {
swfloc = dojo.flash.flash8_version;
var swflocObject = swfloc;
var swflocEmbed = swfloc;
var dojoPath = djConfig.baseRelativePath;
if (doExpressInstall) {
var redirectURL = escape(window.location);
document.title = document.title.slice(0, 47) + " - Flash Player Installation";
var docTitle = escape(document.title);
swflocObject += "?MMredirectURL=" + redirectURL + "&MMplayerType=ActiveX" + "&MMdoctitle=" + docTitle + "&baseRelativePath=" + escape(dojoPath);
swflocEmbed += "?MMredirectURL=" + redirectURL + "&MMplayerType=PlugIn" + "&baseRelativePath=" + escape(dojoPath);
}
if (swflocEmbed.indexOf("?") == -1) {
swflocEmbed += "?baseRelativePath=" + escape(dojoPath) + "' ";
}
objectHTML = "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" " + "codebase=\"" + this.protocol() + "://fpdownload.macromedia.com/pub/shockwave/cabs/flash/" + "swflash.cab#version=8,0,0,0\" " + "width=\"" + this.width + "\" " + "height=\"" + this.height + "\" " + "id=\"" + this.id + "\" " + "align=\"middle\"> " + "<param name=\"allowScriptAccess\" value=\"sameDomain\" /> " + "<param name=\"movie\" value=\"" + swflocObject + "\" /> " + "<param name=\"quality\" value=\"high\" /> " + "<param name=\"bgcolor\" value=\"#ffffff\" /> " + "<embed src=\"" + swflocEmbed + "' " + "quality=\"high\" " + "bgcolor=\"#ffffff\" " + "width=\"" + this.width + "\" " + "height=\"" + this.height + "\" " + "id=\"" + this.id + "\" " + "name=\"" + this.id + "\" " + "swLiveConnect=\"true\" " + "align=\"middle\" " + "allowScriptAccess=\"sameDomain\" " + "type=\"application/x-shockwave-flash\" " + "pluginspage=\"" + this.protocol() + "://www.macromedia.com/go/getflashplayer\" />" + "</object>";
}
objectHTML = "<div id=\"" + this.id + "Container\" style=\"" + containerStyle + "\"> " + objectHTML + "</div>";
document.writeln(objectHTML);
}, get:function () {
return document.getElementById(this.id);
}, setVisible:function (visible) {
var container = dojo.byId(this.id + "Container");
if (visible == true) {
container.style.visibility = "visible";
} else {
container.style.position = "absolute";
container.style.x = "-1000px";
container.style.y = "-1000px";
container.style.visibility = "hidden";
}
}, center:function () {
var elementWidth = this.width;
var elementHeight = this.height;
var scroll_offset = dojo.html.getScroll().offset;
var viewport_size = dojo.html.getViewport();
var x = scroll_offset.x + (viewport_size.width - elementWidth) / 2;
var y = scroll_offset.y + (viewport_size.height - elementHeight) / 2;
var container = dojo.byId(this.id + "Container");
container.style.top = y + "px";
container.style.left = x + "px";
}};
dojo.flash.Communicator = function () {
if (dojo.flash.useFlash6()) {
this._writeFlash6();
} else {
if (dojo.flash.useFlash8()) {
this._writeFlash8();
}
}
};
dojo.flash.Communicator.prototype = {_writeFlash6:function () {
var id = dojo.flash.obj.id;
document.writeln("<script language=\"JavaScript\">");
document.writeln(" function " + id + "_DoFSCommand(command, args){ ");
document.writeln(" dojo.flash.comm._handleFSCommand(command, args); ");
document.writeln("}");
document.writeln("</script>");
if (dojo.render.html.ie) {
document.writeln("<SCRIPT LANGUAGE=VBScript> ");
document.writeln("on error resume next ");
document.writeln("Sub " + id + "_FSCommand(ByVal command, ByVal args)");
document.writeln(" call " + id + "_DoFSCommand(command, args)");
document.writeln("end sub");
document.writeln("</SCRIPT> ");
}
}, _writeFlash8:function () {
}, _handleFSCommand:function (command, args) {
if (command != null && !dojo.lang.isUndefined(command) && /^FSCommand:(.*)/.test(command) == true) {
command = command.match(/^FSCommand:(.*)/)[1];
}
if (command == "addCallback") {
this._fscommandAddCallback(command, args);
} else {
if (command == "call") {
this._fscommandCall(command, args);
} else {
if (command == "fscommandReady") {
this._fscommandReady();
}
}
}
}, _fscommandAddCallback:function (command, args) {
var functionName = args;
var callFunc = function () {
return dojo.flash.comm._call(functionName, arguments);
};
dojo.flash.comm[functionName] = callFunc;
dojo.flash.obj.get().SetVariable("_succeeded", true);
}, _fscommandCall:function (command, args) {
var plugin = dojo.flash.obj.get();
var functionName = args;
var numArgs = parseInt(plugin.GetVariable("_numArgs"));
var flashArgs = new Array();
for (var i = 0; i < numArgs; i++) {
var currentArg = plugin.GetVariable("_" + i);
flashArgs.push(currentArg);
}
var runMe;
if (functionName.indexOf(".") == -1) {
runMe = window[functionName];
} else {
runMe = eval(functionName);
}
var results = null;
if (!dojo.lang.isUndefined(runMe) && runMe != null) {
results = runMe.apply(null, flashArgs);
}
plugin.SetVariable("_returnResult", results);
}, _fscommandReady:function () {
var plugin = dojo.flash.obj.get();
plugin.SetVariable("fscommandReady", "true");
}, _call:function (functionName, args) {
var plugin = dojo.flash.obj.get();
plugin.SetVariable("_functionName", functionName);
plugin.SetVariable("_numArgs", args.length);
for (var i = 0; i < args.length; i++) {
var value = args[i];
value = value.replace(/\0/g, "\\0");
plugin.SetVariable("_" + i, value);
}
plugin.TCallLabel("/_flashRunner", "execute");
var results = plugin.GetVariable("_returnResult");
results = results.replace(/\\0/g, "\x00");
return results;
}, _addExternalInterfaceCallback:function (methodName) {
var wrapperCall = function () {
var methodArgs = new Array(arguments.length);
for (var i = 0; i < arguments.length; i++) {
methodArgs[i] = arguments[i];
}
return dojo.flash.comm._execFlash(methodName, methodArgs);
};
dojo.flash.comm[methodName] = wrapperCall;
}, _encodeData:function (data) {
var entityRE = /\&([^;]*)\;/g;
data = data.replace(entityRE, "&amp;$1;");
data = data.replace(/</g, "&lt;");
data = data.replace(/>/g, "&gt;");
data = data.replace("\\", "&custom_backslash;&custom_backslash;");
data = data.replace(/\n/g, "\\n");
data = data.replace(/\r/g, "\\r");
data = data.replace(/\f/g, "\\f");
data = data.replace(/\0/g, "\\0");
data = data.replace(/\'/g, "\\'");
data = data.replace(/\"/g, "\\\"");
return data;
}, _decodeData:function (data) {
if (data == null || typeof data == "undefined") {
return data;
}
data = data.replace(/\&custom_lt\;/g, "<");
data = data.replace(/\&custom_gt\;/g, ">");
data = eval("\"" + data + "\"");
return data;
}, _chunkArgumentData:function (value, argIndex) {
var plugin = dojo.flash.obj.get();
var numSegments = Math.ceil(value.length / 1024);
for (var i = 0; i < numSegments; i++) {
var startCut = i * 1024;
var endCut = i * 1024 + 1024;
if (i == (numSegments - 1)) {
endCut = i * 1024 + value.length;
}
var piece = value.substring(startCut, endCut);
piece = this._encodeData(piece);
plugin.CallFunction("<invoke name=\"chunkArgumentData\" " + "returntype=\"javascript\">" + "<arguments>" + "<string>" + piece + "</string>" + "<number>" + argIndex + "</number>" + "</arguments>" + "</invoke>");
}
}, _chunkReturnData:function () {
var plugin = dojo.flash.obj.get();
var numSegments = plugin.getReturnLength();
var resultsArray = new Array();
for (var i = 0; i < numSegments; i++) {
var piece = plugin.CallFunction("<invoke name=\"chunkReturnData\" " + "returntype=\"javascript\">" + "<arguments>" + "<number>" + i + "</number>" + "</arguments>" + "</invoke>");
if (piece == "\"\"" || piece == "''") {
piece = "";
} else {
piece = piece.substring(1, piece.length - 1);
}
resultsArray.push(piece);
}
var results = resultsArray.join("");
return results;
}, _execFlash:function (methodName, methodArgs) {
var plugin = dojo.flash.obj.get();
plugin.startExec();
plugin.setNumberArguments(methodArgs.length);
for (var i = 0; i < methodArgs.length; i++) {
this._chunkArgumentData(methodArgs[i], i);
}
plugin.exec(methodName);
var results = this._chunkReturnData();
results = this._decodeData(results);
plugin.endExec();
return results;
}};
dojo.flash.Install = function () {
};
dojo.flash.Install.prototype = {needed:function () {
if (dojo.flash.info.capable == false) {
return true;
}
if (dojo.render.os.mac == true && !dojo.flash.info.isVersionOrAbove(8, 0, 0)) {
return true;
}
if (!dojo.flash.info.isVersionOrAbove(6, 0, 0)) {
return true;
}
return false;
}, install:function () {
dojo.flash.info.installing = true;
dojo.flash.installing();
if (dojo.flash.info.capable == false) {
var installObj = new dojo.flash.Embed(false);
installObj.write(8);
} else {
if (dojo.flash.info.isVersionOrAbove(6, 0, 65)) {
var installObj = new dojo.flash.Embed(false);
installObj.write(8, true);
installObj.setVisible(true);
installObj.center();
} else {
alert("This content requires a more recent version of the Macromedia " + " Flash Player.");
window.location.href = +dojo.flash.Embed.protocol() + "://www.macromedia.com/go/getflashplayer";
}
}
}, _onInstallStatus:function (msg) {
if (msg == "Download.Complete") {
dojo.flash._initialize();
} else {
if (msg == "Download.Cancelled") {
alert("This content requires a more recent version of the Macromedia " + " Flash Player.");
window.location.href = dojo.flash.Embed.protocol() + "://www.macromedia.com/go/getflashplayer";
} else {
if (msg == "Download.Failed") {
alert("There was an error downloading the Flash Player update. " + "Please try again later, or visit macromedia.com to download " + "the latest version of the Flash plugin.");
}
}
}
}};
dojo.flash.info = new dojo.flash.Info();
 
/tags/Racine_livraison_narmer/api/js/dojo/src/event/browser.js
New file
0,0 → 1,489
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.event.browser");
dojo.require("dojo.event.common");
dojo._ie_clobber = new function () {
this.clobberNodes = [];
function nukeProp(node, prop) {
try {
node[prop] = null;
}
catch (e) {
}
try {
delete node[prop];
}
catch (e) {
}
try {
node.removeAttribute(prop);
}
catch (e) {
}
}
this.clobber = function (nodeRef) {
var na;
var tna;
if (nodeRef) {
tna = nodeRef.all || nodeRef.getElementsByTagName("*");
na = [nodeRef];
for (var x = 0; x < tna.length; x++) {
if (tna[x]["__doClobber__"]) {
na.push(tna[x]);
}
}
} else {
try {
window.onload = null;
}
catch (e) {
}
na = (this.clobberNodes.length) ? this.clobberNodes : document.all;
}
tna = null;
var basis = {};
for (var i = na.length - 1; i >= 0; i = i - 1) {
var el = na[i];
try {
if (el && el["__clobberAttrs__"]) {
for (var j = 0; j < el.__clobberAttrs__.length; j++) {
nukeProp(el, el.__clobberAttrs__[j]);
}
nukeProp(el, "__clobberAttrs__");
nukeProp(el, "__doClobber__");
}
}
catch (e) {
}
}
na = null;
};
};
if (dojo.render.html.ie) {
dojo.addOnUnload(function () {
dojo._ie_clobber.clobber();
try {
if ((dojo["widget"]) && (dojo.widget["manager"])) {
dojo.widget.manager.destroyAll();
}
}
catch (e) {
}
if (dojo.widget) {
for (var name in dojo.widget._templateCache) {
if (dojo.widget._templateCache[name].node) {
dojo.dom.destroyNode(dojo.widget._templateCache[name].node);
dojo.widget._templateCache[name].node = null;
delete dojo.widget._templateCache[name].node;
}
}
}
try {
window.onload = null;
}
catch (e) {
}
try {
window.onunload = null;
}
catch (e) {
}
dojo._ie_clobber.clobberNodes = [];
});
}
dojo.event.browser = new function () {
var clobberIdx = 0;
this.normalizedEventName = function (eventName) {
switch (eventName) {
case "CheckboxStateChange":
case "DOMAttrModified":
case "DOMMenuItemActive":
case "DOMMenuItemInactive":
case "DOMMouseScroll":
case "DOMNodeInserted":
case "DOMNodeRemoved":
case "RadioStateChange":
return eventName;
break;
default:
var lcn = eventName.toLowerCase();
return (lcn.indexOf("on") == 0) ? lcn.substr(2) : lcn;
break;
}
};
this.clean = function (node) {
if (dojo.render.html.ie) {
dojo._ie_clobber.clobber(node);
}
};
this.addClobberNode = function (node) {
if (!dojo.render.html.ie) {
return;
}
if (!node["__doClobber__"]) {
node.__doClobber__ = true;
dojo._ie_clobber.clobberNodes.push(node);
node.__clobberAttrs__ = [];
}
};
this.addClobberNodeAttrs = function (node, props) {
if (!dojo.render.html.ie) {
return;
}
this.addClobberNode(node);
for (var x = 0; x < props.length; x++) {
node.__clobberAttrs__.push(props[x]);
}
};
this.removeListener = function (node, evtName, fp, capture) {
if (!capture) {
var capture = false;
}
evtName = dojo.event.browser.normalizedEventName(evtName);
if (evtName == "key") {
if (dojo.render.html.ie) {
this.removeListener(node, "onkeydown", fp, capture);
}
evtName = "keypress";
}
if (node.removeEventListener) {
node.removeEventListener(evtName, fp, capture);
}
};
this.addListener = function (node, evtName, fp, capture, dontFix) {
if (!node) {
return;
}
if (!capture) {
var capture = false;
}
evtName = dojo.event.browser.normalizedEventName(evtName);
if (evtName == "key") {
if (dojo.render.html.ie) {
this.addListener(node, "onkeydown", fp, capture, dontFix);
}
evtName = "keypress";
}
if (!dontFix) {
var newfp = function (evt) {
if (!evt) {
evt = window.event;
}
var ret = fp(dojo.event.browser.fixEvent(evt, this));
if (capture) {
dojo.event.browser.stopEvent(evt);
}
return ret;
};
} else {
newfp = fp;
}
if (node.addEventListener) {
node.addEventListener(evtName, newfp, capture);
return newfp;
} else {
evtName = "on" + evtName;
if (typeof node[evtName] == "function") {
var oldEvt = node[evtName];
node[evtName] = function (e) {
oldEvt(e);
return newfp(e);
};
} else {
node[evtName] = newfp;
}
if (dojo.render.html.ie) {
this.addClobberNodeAttrs(node, [evtName]);
}
return newfp;
}
};
this.isEvent = function (obj) {
return (typeof obj != "undefined") && (obj) && (typeof Event != "undefined") && (obj.eventPhase);
};
this.currentEvent = null;
this.callListener = function (listener, curTarget) {
if (typeof listener != "function") {
dojo.raise("listener not a function: " + listener);
}
dojo.event.browser.currentEvent.currentTarget = curTarget;
return listener.call(curTarget, dojo.event.browser.currentEvent);
};
this._stopPropagation = function () {
dojo.event.browser.currentEvent.cancelBubble = true;
};
this._preventDefault = function () {
dojo.event.browser.currentEvent.returnValue = false;
};
this.keys = {KEY_BACKSPACE:8, KEY_TAB:9, KEY_CLEAR:12, KEY_ENTER:13, KEY_SHIFT:16, KEY_CTRL:17, KEY_ALT:18, KEY_PAUSE:19, KEY_CAPS_LOCK:20, KEY_ESCAPE:27, KEY_SPACE:32, KEY_PAGE_UP:33, KEY_PAGE_DOWN:34, KEY_END:35, KEY_HOME:36, KEY_LEFT_ARROW:37, KEY_UP_ARROW:38, KEY_RIGHT_ARROW:39, KEY_DOWN_ARROW:40, KEY_INSERT:45, KEY_DELETE:46, KEY_HELP:47, KEY_LEFT_WINDOW:91, KEY_RIGHT_WINDOW:92, KEY_SELECT:93, KEY_NUMPAD_0:96, KEY_NUMPAD_1:97, KEY_NUMPAD_2:98, KEY_NUMPAD_3:99, KEY_NUMPAD_4:100, KEY_NUMPAD_5:101, KEY_NUMPAD_6:102, KEY_NUMPAD_7:103, KEY_NUMPAD_8:104, KEY_NUMPAD_9:105, KEY_NUMPAD_MULTIPLY:106, KEY_NUMPAD_PLUS:107, KEY_NUMPAD_ENTER:108, KEY_NUMPAD_MINUS:109, KEY_NUMPAD_PERIOD:110, KEY_NUMPAD_DIVIDE:111, KEY_F1:112, KEY_F2:113, KEY_F3:114, KEY_F4:115, KEY_F5:116, KEY_F6:117, KEY_F7:118, KEY_F8:119, KEY_F9:120, KEY_F10:121, KEY_F11:122, KEY_F12:123, KEY_F13:124, KEY_F14:125, KEY_F15:126, KEY_NUM_LOCK:144, KEY_SCROLL_LOCK:145};
this.revKeys = [];
for (var key in this.keys) {
this.revKeys[this.keys[key]] = key;
}
this.fixEvent = function (evt, sender) {
if (!evt) {
if (window["event"]) {
evt = window.event;
}
}
if ((evt["type"]) && (evt["type"].indexOf("key") == 0)) {
evt.keys = this.revKeys;
for (var key in this.keys) {
evt[key] = this.keys[key];
}
if (evt["type"] == "keydown" && dojo.render.html.ie) {
switch (evt.keyCode) {
case evt.KEY_SHIFT:
case evt.KEY_CTRL:
case evt.KEY_ALT:
case evt.KEY_CAPS_LOCK:
case evt.KEY_LEFT_WINDOW:
case evt.KEY_RIGHT_WINDOW:
case evt.KEY_SELECT:
case evt.KEY_NUM_LOCK:
case evt.KEY_SCROLL_LOCK:
case evt.KEY_NUMPAD_0:
case evt.KEY_NUMPAD_1:
case evt.KEY_NUMPAD_2:
case evt.KEY_NUMPAD_3:
case evt.KEY_NUMPAD_4:
case evt.KEY_NUMPAD_5:
case evt.KEY_NUMPAD_6:
case evt.KEY_NUMPAD_7:
case evt.KEY_NUMPAD_8:
case evt.KEY_NUMPAD_9:
case evt.KEY_NUMPAD_PERIOD:
break;
case evt.KEY_NUMPAD_MULTIPLY:
case evt.KEY_NUMPAD_PLUS:
case evt.KEY_NUMPAD_ENTER:
case evt.KEY_NUMPAD_MINUS:
case evt.KEY_NUMPAD_DIVIDE:
break;
case evt.KEY_PAUSE:
case evt.KEY_TAB:
case evt.KEY_BACKSPACE:
case evt.KEY_ENTER:
case evt.KEY_ESCAPE:
case evt.KEY_PAGE_UP:
case evt.KEY_PAGE_DOWN:
case evt.KEY_END:
case evt.KEY_HOME:
case evt.KEY_LEFT_ARROW:
case evt.KEY_UP_ARROW:
case evt.KEY_RIGHT_ARROW:
case evt.KEY_DOWN_ARROW:
case evt.KEY_INSERT:
case evt.KEY_DELETE:
case evt.KEY_F1:
case evt.KEY_F2:
case evt.KEY_F3:
case evt.KEY_F4:
case evt.KEY_F5:
case evt.KEY_F6:
case evt.KEY_F7:
case evt.KEY_F8:
case evt.KEY_F9:
case evt.KEY_F10:
case evt.KEY_F11:
case evt.KEY_F12:
case evt.KEY_F12:
case evt.KEY_F13:
case evt.KEY_F14:
case evt.KEY_F15:
case evt.KEY_CLEAR:
case evt.KEY_HELP:
evt.key = evt.keyCode;
break;
default:
if (evt.ctrlKey || evt.altKey) {
var unifiedCharCode = evt.keyCode;
if (unifiedCharCode >= 65 && unifiedCharCode <= 90 && evt.shiftKey == false) {
unifiedCharCode += 32;
}
if (unifiedCharCode >= 1 && unifiedCharCode <= 26 && evt.ctrlKey) {
unifiedCharCode += 96;
}
evt.key = String.fromCharCode(unifiedCharCode);
}
}
} else {
if (evt["type"] == "keypress") {
if (dojo.render.html.opera) {
if (evt.which == 0) {
evt.key = evt.keyCode;
} else {
if (evt.which > 0) {
switch (evt.which) {
case evt.KEY_SHIFT:
case evt.KEY_CTRL:
case evt.KEY_ALT:
case evt.KEY_CAPS_LOCK:
case evt.KEY_NUM_LOCK:
case evt.KEY_SCROLL_LOCK:
break;
case evt.KEY_PAUSE:
case evt.KEY_TAB:
case evt.KEY_BACKSPACE:
case evt.KEY_ENTER:
case evt.KEY_ESCAPE:
evt.key = evt.which;
break;
default:
var unifiedCharCode = evt.which;
if ((evt.ctrlKey || evt.altKey || evt.metaKey) && (evt.which >= 65 && evt.which <= 90 && evt.shiftKey == false)) {
unifiedCharCode += 32;
}
evt.key = String.fromCharCode(unifiedCharCode);
}
}
}
} else {
if (dojo.render.html.ie) {
if (!evt.ctrlKey && !evt.altKey && evt.keyCode >= evt.KEY_SPACE) {
evt.key = String.fromCharCode(evt.keyCode);
}
} else {
if (dojo.render.html.safari) {
switch (evt.keyCode) {
case 25:
evt.key = evt.KEY_TAB;
evt.shift = true;
break;
case 63232:
evt.key = evt.KEY_UP_ARROW;
break;
case 63233:
evt.key = evt.KEY_DOWN_ARROW;
break;
case 63234:
evt.key = evt.KEY_LEFT_ARROW;
break;
case 63235:
evt.key = evt.KEY_RIGHT_ARROW;
break;
case 63236:
evt.key = evt.KEY_F1;
break;
case 63237:
evt.key = evt.KEY_F2;
break;
case 63238:
evt.key = evt.KEY_F3;
break;
case 63239:
evt.key = evt.KEY_F4;
break;
case 63240:
evt.key = evt.KEY_F5;
break;
case 63241:
evt.key = evt.KEY_F6;
break;
case 63242:
evt.key = evt.KEY_F7;
break;
case 63243:
evt.key = evt.KEY_F8;
break;
case 63244:
evt.key = evt.KEY_F9;
break;
case 63245:
evt.key = evt.KEY_F10;
break;
case 63246:
evt.key = evt.KEY_F11;
break;
case 63247:
evt.key = evt.KEY_F12;
break;
case 63250:
evt.key = evt.KEY_PAUSE;
break;
case 63272:
evt.key = evt.KEY_DELETE;
break;
case 63273:
evt.key = evt.KEY_HOME;
break;
case 63275:
evt.key = evt.KEY_END;
break;
case 63276:
evt.key = evt.KEY_PAGE_UP;
break;
case 63277:
evt.key = evt.KEY_PAGE_DOWN;
break;
case 63302:
evt.key = evt.KEY_INSERT;
break;
case 63248:
case 63249:
case 63289:
break;
default:
evt.key = evt.charCode >= evt.KEY_SPACE ? String.fromCharCode(evt.charCode) : evt.keyCode;
}
} else {
evt.key = evt.charCode > 0 ? String.fromCharCode(evt.charCode) : evt.keyCode;
}
}
}
}
}
}
if (dojo.render.html.ie) {
if (!evt.target) {
evt.target = evt.srcElement;
}
if (!evt.currentTarget) {
evt.currentTarget = (sender ? sender : evt.srcElement);
}
if (!evt.layerX) {
evt.layerX = evt.offsetX;
}
if (!evt.layerY) {
evt.layerY = evt.offsetY;
}
var doc = (evt.srcElement && evt.srcElement.ownerDocument) ? evt.srcElement.ownerDocument : document;
var docBody = ((dojo.render.html.ie55) || (doc["compatMode"] == "BackCompat")) ? doc.body : doc.documentElement;
if (!evt.pageX) {
evt.pageX = evt.clientX + (docBody.scrollLeft || 0);
}
if (!evt.pageY) {
evt.pageY = evt.clientY + (docBody.scrollTop || 0);
}
if (evt.type == "mouseover") {
evt.relatedTarget = evt.fromElement;
}
if (evt.type == "mouseout") {
evt.relatedTarget = evt.toElement;
}
this.currentEvent = evt;
evt.callListener = this.callListener;
evt.stopPropagation = this._stopPropagation;
evt.preventDefault = this._preventDefault;
}
return evt;
};
this.stopEvent = function (evt) {
if (window.event) {
evt.cancelBubble = true;
evt.returnValue = false;
} else {
evt.preventDefault();
evt.stopPropagation();
}
};
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/event/__package__.js
New file
0,0 → 1,13
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.kwCompoundRequire({common:["dojo.event.common", "dojo.event.topic"], browser:["dojo.event.browser"], dashboard:["dojo.event.browser"]});
dojo.provide("dojo.event.*");
 
/tags/Racine_livraison_narmer/api/js/dojo/src/event/common.js
New file
0,0 → 1,551
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.provide("dojo.event.common");
dojo.require("dojo.lang.array");
dojo.require("dojo.lang.extras");
dojo.require("dojo.lang.func");
dojo.event = new function () {
this._canTimeout = dojo.lang.isFunction(dj_global["setTimeout"]) || dojo.lang.isAlien(dj_global["setTimeout"]);
function interpolateArgs(args, searchForNames) {
var dl = dojo.lang;
var ao = {srcObj:dj_global, srcFunc:null, adviceObj:dj_global, adviceFunc:null, aroundObj:null, aroundFunc:null, adviceType:(args.length > 2) ? args[0] : "after", precedence:"last", once:false, delay:null, rate:0, adviceMsg:false, maxCalls:-1};
switch (args.length) {
case 0:
return;
case 1:
return;
case 2:
ao.srcFunc = args[0];
ao.adviceFunc = args[1];
break;
case 3:
if ((dl.isObject(args[0])) && (dl.isString(args[1])) && (dl.isString(args[2]))) {
ao.adviceType = "after";
ao.srcObj = args[0];
ao.srcFunc = args[1];
ao.adviceFunc = args[2];
} else {
if ((dl.isString(args[1])) && (dl.isString(args[2]))) {
ao.srcFunc = args[1];
ao.adviceFunc = args[2];
} else {
if ((dl.isObject(args[0])) && (dl.isString(args[1])) && (dl.isFunction(args[2]))) {
ao.adviceType = "after";
ao.srcObj = args[0];
ao.srcFunc = args[1];
var tmpName = dl.nameAnonFunc(args[2], ao.adviceObj, searchForNames);
ao.adviceFunc = tmpName;
} else {
if ((dl.isFunction(args[0])) && (dl.isObject(args[1])) && (dl.isString(args[2]))) {
ao.adviceType = "after";
ao.srcObj = dj_global;
var tmpName = dl.nameAnonFunc(args[0], ao.srcObj, searchForNames);
ao.srcFunc = tmpName;
ao.adviceObj = args[1];
ao.adviceFunc = args[2];
}
}
}
}
break;
case 4:
if ((dl.isObject(args[0])) && (dl.isObject(args[2]))) {
ao.adviceType = "after";
ao.srcObj = args[0];
ao.srcFunc = args[1];
ao.adviceObj = args[2];
ao.adviceFunc = args[3];
} else {
if ((dl.isString(args[0])) && (dl.isString(args[1])) && (dl.isObject(args[2]))) {
ao.adviceType = args[0];
ao.srcObj = dj_global;
ao.srcFunc = args[1];
ao.adviceObj = args[2];
ao.adviceFunc = args[3];
} else {
if ((dl.isString(args[0])) && (dl.isFunction(args[1])) && (dl.isObject(args[2]))) {
ao.adviceType = args[0];
ao.srcObj = dj_global;
var tmpName = dl.nameAnonFunc(args[1], dj_global, searchForNames);
ao.srcFunc = tmpName;
ao.adviceObj = args[2];
ao.adviceFunc = args[3];
} else {
if ((dl.isString(args[0])) && (dl.isObject(args[1])) && (dl.isString(args[2])) && (dl.isFunction(args[3]))) {
ao.srcObj = args[1];
ao.srcFunc = args[2];
var tmpName = dl.nameAnonFunc(args[3], dj_global, searchForNames);
ao.adviceObj = dj_global;
ao.adviceFunc = tmpName;
} else {
if (dl.isObject(args[1])) {
ao.srcObj = args[1];
ao.srcFunc = args[2];
ao.adviceObj = dj_global;
ao.adviceFunc = args[3];
} else {
if (dl.isObject(args[2])) {
ao.srcObj = dj_global;
ao.srcFunc = args[1];
ao.adviceObj = args[2];
ao.adviceFunc = args[3];
} else {
ao.srcObj = ao.adviceObj = ao.aroundObj = dj_global;
ao.srcFunc = args[1];
ao.adviceFunc = args[2];
ao.aroundFunc = args[3];
}
}
}
}
}
}
break;
case 6:
ao.srcObj = args[1];
ao.srcFunc = args[2];
ao.adviceObj = args[3];
ao.adviceFunc = args[4];
ao.aroundFunc = args[5];
ao.aroundObj = dj_global;
break;
default:
ao.srcObj = args[1];
ao.srcFunc = args[2];
ao.adviceObj = args[3];
ao.adviceFunc = args[4];
ao.aroundObj = args[5];
ao.aroundFunc = args[6];
ao.once = args[7];
ao.delay = args[8];
ao.rate = args[9];
ao.adviceMsg = args[10];
ao.maxCalls = (!isNaN(parseInt(args[11]))) ? args[11] : -1;
break;
}
if (dl.isFunction(ao.aroundFunc)) {
var tmpName = dl.nameAnonFunc(ao.aroundFunc, ao.aroundObj, searchForNames);
ao.aroundFunc = tmpName;
}
if (dl.isFunction(ao.srcFunc)) {
ao.srcFunc = dl.getNameInObj(ao.srcObj, ao.srcFunc);
}
if (dl.isFunction(ao.adviceFunc)) {
ao.adviceFunc = dl.getNameInObj(ao.adviceObj, ao.adviceFunc);
}
if ((ao.aroundObj) && (dl.isFunction(ao.aroundFunc))) {
ao.aroundFunc = dl.getNameInObj(ao.aroundObj, ao.aroundFunc);
}
if (!ao.srcObj) {
dojo.raise("bad srcObj for srcFunc: " + ao.srcFunc);
}
if (!ao.adviceObj) {
dojo.raise("bad adviceObj for adviceFunc: " + ao.adviceFunc);
}
if (!ao.adviceFunc) {
dojo.debug("bad adviceFunc for srcFunc: " + ao.srcFunc);
dojo.debugShallow(ao);
}
return ao;
}
this.connect = function () {
if (arguments.length == 1) {
var ao = arguments[0];
} else {
var ao = interpolateArgs(arguments, true);
}
if (dojo.lang.isArray(ao.srcObj) && ao.srcObj != "") {
var tmpAO = {};
for (var x in ao) {
tmpAO[x] = ao[x];
}
var mjps = [];
dojo.lang.forEach(ao.srcObj, function (src) {
if ((dojo.render.html.capable) && (dojo.lang.isString(src))) {
src = dojo.byId(src);
}
tmpAO.srcObj = src;
mjps.push(dojo.event.connect.call(dojo.event, tmpAO));
});
return mjps;
}
var mjp = dojo.event.MethodJoinPoint.getForMethod(ao.srcObj, ao.srcFunc);
if (ao.adviceFunc) {
var mjp2 = dojo.event.MethodJoinPoint.getForMethod(ao.adviceObj, ao.adviceFunc);
}
mjp.kwAddAdvice(ao);
return mjp;
};
this.log = function (a1, a2) {
var kwArgs;
if ((arguments.length == 1) && (typeof a1 == "object")) {
kwArgs = a1;
} else {
kwArgs = {srcObj:a1, srcFunc:a2};
}
kwArgs.adviceFunc = function () {
var argsStr = [];
for (var x = 0; x < arguments.length; x++) {
argsStr.push(arguments[x]);
}
dojo.debug("(" + kwArgs.srcObj + ")." + kwArgs.srcFunc, ":", argsStr.join(", "));
};
this.kwConnect(kwArgs);
};
this.connectBefore = function () {
var args = ["before"];
for (var i = 0; i < arguments.length; i++) {
args.push(arguments[i]);
}
return this.connect.apply(this, args);
};
this.connectAround = function () {
var args = ["around"];
for (var i = 0; i < arguments.length; i++) {
args.push(arguments[i]);
}
return this.connect.apply(this, args);
};
this.connectOnce = function () {
var ao = interpolateArgs(arguments, true);
ao.once = true;
return this.connect(ao);
};
this.connectRunOnce = function () {
var ao = interpolateArgs(arguments, true);
ao.maxCalls = 1;
return this.connect(ao);
};
this._kwConnectImpl = function (kwArgs, disconnect) {
var fn = (disconnect) ? "disconnect" : "connect";
if (typeof kwArgs["srcFunc"] == "function") {
kwArgs.srcObj = kwArgs["srcObj"] || dj_global;
var tmpName = dojo.lang.nameAnonFunc(kwArgs.srcFunc, kwArgs.srcObj, true);
kwArgs.srcFunc = tmpName;
}
if (typeof kwArgs["adviceFunc"] == "function") {
kwArgs.adviceObj = kwArgs["adviceObj"] || dj_global;
var tmpName = dojo.lang.nameAnonFunc(kwArgs.adviceFunc, kwArgs.adviceObj, true);
kwArgs.adviceFunc = tmpName;
}
kwArgs.srcObj = kwArgs["srcObj"] || dj_global;
kwArgs.adviceObj = kwArgs["adviceObj"] || kwArgs["targetObj"] || dj_global;
kwArgs.adviceFunc = kwArgs["adviceFunc"] || kwArgs["targetFunc"];
return dojo.event[fn](kwArgs);
};
this.kwConnect = function (kwArgs) {
return this._kwConnectImpl(kwArgs, false);
};
this.disconnect = function () {
if (arguments.length == 1) {
var ao = arguments[0];
} else {
var ao = interpolateArgs(arguments, true);
}
if (!ao.adviceFunc) {
return;
}
if (dojo.lang.isString(ao.srcFunc) && (ao.srcFunc.toLowerCase() == "onkey")) {
if (dojo.render.html.ie) {
ao.srcFunc = "onkeydown";
this.disconnect(ao);
}
ao.srcFunc = "onkeypress";
}
if (!ao.srcObj[ao.srcFunc]) {
return null;
}
var mjp = dojo.event.MethodJoinPoint.getForMethod(ao.srcObj, ao.srcFunc, true);
mjp.removeAdvice(ao.adviceObj, ao.adviceFunc, ao.adviceType, ao.once);
return mjp;
};
this.kwDisconnect = function (kwArgs) {
return this._kwConnectImpl(kwArgs, true);
};
};
dojo.event.MethodInvocation = function (join_point, obj, args) {
this.jp_ = join_point;
this.object = obj;
this.args = [];
for (var x = 0; x < args.length; x++) {
this.args[x] = args[x];
}
this.around_index = -1;
};
dojo.event.MethodInvocation.prototype.proceed = function () {
this.around_index++;
if (this.around_index >= this.jp_.around.length) {
return this.jp_.object[this.jp_.methodname].apply(this.jp_.object, this.args);
} else {
var ti = this.jp_.around[this.around_index];
var mobj = ti[0] || dj_global;
var meth = ti[1];
return mobj[meth].call(mobj, this);
}
};
dojo.event.MethodJoinPoint = function (obj, funcName) {
this.object = obj || dj_global;
this.methodname = funcName;
this.methodfunc = this.object[funcName];
this.squelch = false;
};
dojo.event.MethodJoinPoint.getForMethod = function (obj, funcName) {
if (!obj) {
obj = dj_global;
}
var ofn = obj[funcName];
if (!ofn) {
ofn = obj[funcName] = function () {
};
if (!obj[funcName]) {
dojo.raise("Cannot set do-nothing method on that object " + funcName);
}
} else {
if ((typeof ofn != "function") && (!dojo.lang.isFunction(ofn)) && (!dojo.lang.isAlien(ofn))) {
return null;
}
}
var jpname = funcName + "$joinpoint";
var jpfuncname = funcName + "$joinpoint$method";
var joinpoint = obj[jpname];
if (!joinpoint) {
var isNode = false;
if (dojo.event["browser"]) {
if ((obj["attachEvent"]) || (obj["nodeType"]) || (obj["addEventListener"])) {
isNode = true;
dojo.event.browser.addClobberNodeAttrs(obj, [jpname, jpfuncname, funcName]);
}
}
var origArity = ofn.length;
obj[jpfuncname] = ofn;
joinpoint = obj[jpname] = new dojo.event.MethodJoinPoint(obj, jpfuncname);
if (!isNode) {
obj[funcName] = function () {
return joinpoint.run.apply(joinpoint, arguments);
};
} else {
obj[funcName] = function () {
var args = [];
if (!arguments.length) {
var evt = null;
try {
if (obj.ownerDocument) {
evt = obj.ownerDocument.parentWindow.event;
} else {
if (obj.documentElement) {
evt = obj.documentElement.ownerDocument.parentWindow.event;
} else {
if (obj.event) {
evt = obj.event;
} else {
evt = window.event;
}
}
}
}
catch (e) {
evt = window.event;
}
if (evt) {
args.push(dojo.event.browser.fixEvent(evt, this));
}
} else {
for (var x = 0; x < arguments.length; x++) {
if ((x == 0) && (dojo.event.browser.isEvent(arguments[x]))) {
args.push(dojo.event.browser.fixEvent(arguments[x], this));
} else {
args.push(arguments[x]);
}
}
}
return joinpoint.run.apply(joinpoint, args);
};
}
obj[funcName].__preJoinArity = origArity;
}
return joinpoint;
};
dojo.lang.extend(dojo.event.MethodJoinPoint, {squelch:false, unintercept:function () {
this.object[this.methodname] = this.methodfunc;
this.before = [];
this.after = [];
this.around = [];
}, disconnect:dojo.lang.forward("unintercept"), run:function () {
var obj = this.object || dj_global;
var args = arguments;
var aargs = [];
for (var x = 0; x < args.length; x++) {
aargs[x] = args[x];
}
var unrollAdvice = function (marr) {
if (!marr) {
dojo.debug("Null argument to unrollAdvice()");
return;
}
var callObj = marr[0] || dj_global;
var callFunc = marr[1];
if (!callObj[callFunc]) {
dojo.raise("function \"" + callFunc + "\" does not exist on \"" + callObj + "\"");
}
var aroundObj = marr[2] || dj_global;
var aroundFunc = marr[3];
var msg = marr[6];
var maxCount = marr[7];
if (maxCount > -1) {
if (maxCount == 0) {
return;
}
marr[7]--;
}
var undef;
var to = {args:[], jp_:this, object:obj, proceed:function () {
return callObj[callFunc].apply(callObj, to.args);
}};
to.args = aargs;
var delay = parseInt(marr[4]);
var hasDelay = ((!isNaN(delay)) && (marr[4] !== null) && (typeof marr[4] != "undefined"));
if (marr[5]) {
var rate = parseInt(marr[5]);
var cur = new Date();
var timerSet = false;
if ((marr["last"]) && ((cur - marr.last) <= rate)) {
if (dojo.event._canTimeout) {
if (marr["delayTimer"]) {
clearTimeout(marr.delayTimer);
}
var tod = parseInt(rate * 2);
var mcpy = dojo.lang.shallowCopy(marr);
marr.delayTimer = setTimeout(function () {
mcpy[5] = 0;
unrollAdvice(mcpy);
}, tod);
}
return;
} else {
marr.last = cur;
}
}
if (aroundFunc) {
aroundObj[aroundFunc].call(aroundObj, to);
} else {
if ((hasDelay) && ((dojo.render.html) || (dojo.render.svg))) {
dj_global["setTimeout"](function () {
if (msg) {
callObj[callFunc].call(callObj, to);
} else {
callObj[callFunc].apply(callObj, args);
}
}, delay);
} else {
if (msg) {
callObj[callFunc].call(callObj, to);
} else {
callObj[callFunc].apply(callObj, args);
}
}
}
};
var unRollSquelch = function () {
if (this.squelch) {
try {
return unrollAdvice.apply(this, arguments);
}
catch (e) {
dojo.debug(e);
}
} else {
return unrollAdvice.apply(this, arguments);
}
};
if ((this["before"]) && (this.before.length > 0)) {
dojo.lang.forEach(this.before.concat(new Array()), unRollSquelch);
}
var result;
try {
if ((this["around"]) && (this.around.length > 0)) {
var mi = new dojo.event.MethodInvocation(this, obj, args);
result = mi.proceed();
} else {
if (this.methodfunc) {
result = this.object[this.methodname].apply(this.object, args);
}
}
}
catch (e) {
if (!this.squelch) {
dojo.debug(e, "when calling", this.methodname, "on", this.object, "with arguments", args);
dojo.raise(e);
}
}
if ((this["after"]) && (this.after.length > 0)) {
dojo.lang.forEach(this.after.concat(new Array()), unRollSquelch);
}
return (this.methodfunc) ? result : null;
}, getArr:function (kind) {
var type = "after";
if ((typeof kind == "string") && (kind.indexOf("before") != -1)) {
type = "before";
} else {
if (kind == "around") {
type = "around";
}
}
if (!this[type]) {
this[type] = [];
}
return this[type];
}, kwAddAdvice:function (args) {
this.addAdvice(args["adviceObj"], args["adviceFunc"], args["aroundObj"], args["aroundFunc"], args["adviceType"], args["precedence"], args["once"], args["delay"], args["rate"], args["adviceMsg"], args["maxCalls"]);
}, addAdvice:function (thisAdviceObj, thisAdvice, thisAroundObj, thisAround, adviceType, precedence, once, delay, rate, asMessage, maxCalls) {
var arr = this.getArr(adviceType);
if (!arr) {
dojo.raise("bad this: " + this);
}
var ao = [thisAdviceObj, thisAdvice, thisAroundObj, thisAround, delay, rate, asMessage, maxCalls];
if (once) {
if (this.hasAdvice(thisAdviceObj, thisAdvice, adviceType, arr) >= 0) {
return;
}
}
if (precedence == "first") {
arr.unshift(ao);
} else {
arr.push(ao);
}
}, hasAdvice:function (thisAdviceObj, thisAdvice, adviceType, arr) {
if (!arr) {
arr = this.getArr(adviceType);
}
var ind = -1;
for (var x = 0; x < arr.length; x++) {
var aao = (typeof thisAdvice == "object") ? (new String(thisAdvice)).toString() : thisAdvice;
var a1o = (typeof arr[x][1] == "object") ? (new String(arr[x][1])).toString() : arr[x][1];
if ((arr[x][0] == thisAdviceObj) && (a1o == aao)) {
ind = x;
}
}
return ind;
}, removeAdvice:function (thisAdviceObj, thisAdvice, adviceType, once) {
var arr = this.getArr(adviceType);
var ind = this.hasAdvice(thisAdviceObj, thisAdvice, adviceType, arr);
if (ind == -1) {
return false;
}
while (ind != -1) {
arr.splice(ind, 1);
if (once) {
break;
}
ind = this.hasAdvice(thisAdviceObj, thisAdvice, adviceType, arr);
}
return true;
}});
 
/tags/Racine_livraison_narmer/api/js/dojo/src/event/topic.js
New file
0,0 → 1,77
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
dojo.require("dojo.event.common");
dojo.provide("dojo.event.topic");
dojo.event.topic = new function () {
this.topics = {};
this.getTopic = function (topic) {
if (!this.topics[topic]) {
this.topics[topic] = new this.TopicImpl(topic);
}
return this.topics[topic];
};
this.registerPublisher = function (topic, obj, funcName) {
var topic = this.getTopic(topic);
topic.registerPublisher(obj, funcName);
};
this.subscribe = function (topic, obj, funcName) {
var topic = this.getTopic(topic);
topic.subscribe(obj, funcName);
};
this.unsubscribe = function (topic, obj, funcName) {
var topic = this.getTopic(topic);
topic.unsubscribe(obj, funcName);
};
this.destroy = function (topic) {
this.getTopic(topic).destroy();
delete this.topics[topic];
};
this.publishApply = function (topic, args) {
var topic = this.getTopic(topic);
topic.sendMessage.apply(topic, args);
};
this.publish = function (topic, message) {
var topic = this.getTopic(topic);
var args = [];
for (var x = 1; x < arguments.length; x++) {
args.push(arguments[x]);
}
topic.sendMessage.apply(topic, args);
};
};
dojo.event.topic.TopicImpl = function (topicName) {
this.topicName = topicName;
this.subscribe = function (listenerObject, listenerMethod) {
var tf = listenerMethod || listenerObject;
var to = (!listenerMethod) ? dj_global : listenerObject;
return dojo.event.kwConnect({srcObj:this, srcFunc:"sendMessage", adviceObj:to, adviceFunc:tf});
};
this.unsubscribe = function (listenerObject, listenerMethod) {
var tf = (!listenerMethod) ? listenerObject : listenerMethod;
var to = (!listenerMethod) ? null : listenerObject;
return dojo.event.kwDisconnect({srcObj:this, srcFunc:"sendMessage", adviceObj:to, adviceFunc:tf});
};
this._getJoinPoint = function () {
return dojo.event.MethodJoinPoint.getForMethod(this, "sendMessage");
};
this.setSquelch = function (shouldSquelch) {
this._getJoinPoint().squelch = shouldSquelch;
};
this.destroy = function () {
this._getJoinPoint().disconnect();
};
this.registerPublisher = function (publisherObject, publisherMethod) {
dojo.event.connect(publisherObject, publisherMethod, this, "sendMessage");
};
this.sendMessage = function (message) {
};
};
 
/tags/Racine_livraison_narmer/api/js/dojo/src/loader.js
New file
0,0 → 1,446
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
 
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
 
http://dojotoolkit.org/community/licensing.shtml
*/
 
(function () {
var _addHostEnv = {pkgFileName:"__package__", loading_modules_:{}, loaded_modules_:{}, addedToLoadingCount:[], removedFromLoadingCount:[], inFlightCount:0, modulePrefixes_:{dojo:{name:"dojo", value:"src"}}, setModulePrefix:function (module, prefix) {
this.modulePrefixes_[module] = {name:module, value:prefix};
}, moduleHasPrefix:function (module) {
var mp = this.modulePrefixes_;
return Boolean(mp[module] && mp[module].value);
}, getModulePrefix:function (module) {
if (this.moduleHasPrefix(module)) {
return this.modulePrefixes_[module].value;
}
return module;
}, getTextStack:[], loadUriStack:[], loadedUris:[], post_load_:false, modulesLoadedListeners:[], unloadListeners:[], loadNotifying:false};
for (var param in _addHostEnv) {
dojo.hostenv[param] = _addHostEnv[param];
}
})();
dojo.hostenv.loadPath = function (relpath, module, cb) {
var uri;
if (relpath.charAt(0) == "/" || relpath.match(/^\w+:/)) {
uri = relpath;
} else {
uri = this.getBaseScriptUri() + relpath;
}
if (djConfig.cacheBust && dojo.render.html.capable) {
uri += "?" + String(djConfig.cacheBust).replace(/\W+/g, "");
}
try {
return !module ? this.loadUri(uri, cb) : this.loadUriAndCheck(uri, module, cb);
}
catch (e) {
dojo.debug(e);
return false;
}
};
dojo.hostenv.loadUri = function (uri, cb) {
if (this.loadedUris[uri]) {
return true;
}
var contents = this.getText(uri, null, true);
if (!contents) {
return false;
}
this.loadedUris[uri] = true;
if (cb) {
contents = "(" + contents + ")";
}
var value = dj_eval(contents);
if (cb) {
cb(value);
}
return true;
};
dojo.hostenv.loadUriAndCheck = function (uri, moduleName, cb) {
var ok = true;
try {
ok = this.loadUri(uri, cb);
}
catch (e) {
dojo.debug("failed loading ", uri, " with error: ", e);
}
return Boolean(ok && this.findModule(moduleName, false));
};
dojo.loaded = function () {
};
dojo.unloaded = function () {
};
dojo.hostenv.loaded = function () {
this.loadNotifying = true;
this.post_load_ = true;
var mll = this.modulesLoadedListeners;
for (var x = 0; x < mll.length; x++) {
mll[x]();
}
this.modulesLoadedListeners = [];
this.loadNotifying = false;
dojo.loaded();
};
dojo.hostenv.unloaded = function () {
var mll = this.unloadListeners;
while (mll.length) {
(mll.pop())();
}
dojo.unloaded();
};
dojo.addOnLoad = function (obj, functionName) {
var dh = dojo.hostenv;
if (arguments.length == 1) {
dh.modulesLoadedListeners.push(obj);
} else {
if (arguments.length > 1) {
dh.modulesLoadedListeners.push(function () {
obj[functionName]();
});
}
}
if (dh.post_load_ && dh.inFlightCount == 0 && !dh.loadNotifying) {
dh.callLoaded();
}
};
dojo.addOnUnload = function (obj, functionName) {
var dh = dojo.hostenv;
if (arguments.length == 1) {
dh.unloadListeners.push(obj);
} else {
if (arguments.length > 1) {
dh.unloadListeners.push(function () {
obj[functionName]();
});
}
}
};
dojo.hostenv.modulesLoaded = function () {
if (this.post_load_) {
return;
}
if (this.loadUriStack.length == 0 && this.getTextStack.length == 0) {
if (this.inFlightCount > 0) {
dojo.debug("files still in flight!");
return;
}
dojo.hostenv.callLoaded();
}
};
dojo.hostenv.callLoaded = function () {
if (typeof setTimeout == "object" || (djConfig["useXDomain"] && dojo.render.html.opera)) {
setTimeout("dojo.hostenv.loaded();", 0);
} else {
dojo.hostenv.loaded();
}
};
dojo.hostenv.getModuleSymbols = function (modulename) {
var syms = modulename.split(".");
for (var i = syms.length; i > 0; i--) {
var parentModule = syms.slice(0, i).join(".");
if ((i == 1) && !this.moduleHasPrefix(parentModule)) {
syms[0] = "../" + syms[0];
} else {
var parentModulePath = this.getModulePrefix(parentModule);
if (parentModulePath != parentModule) {
syms.splice(0, i, parentModulePath);
break;
}
}
}
return syms;
};
dojo.hostenv._global_omit_module_check = false;
dojo.hostenv.loadModule = function (moduleName, exactOnly, omitModuleCheck) {
if (!moduleName) {
return;
}
omitModuleCheck = this._global_omit_module_check || omitModuleCheck;
var module = this.findModule(moduleName, false);
if (module) {
return module;
}
if (dj_undef(moduleName, this.loading_modules_)) {
this.addedToLoadingCount.push(moduleName);
}
this.loading_modules_[moduleName] = 1;
var relpath = moduleName.replace(/\./g, "/") + ".js";
var nsyms = moduleName.split(".");
var syms = this.getModuleSymbols(moduleName);
var startedRelative = ((syms[0].charAt(0) != "/") && !syms[0].match(/^\w+:/));
var last = syms[syms.length - 1];
var ok;
if (last == "*") {
moduleName = nsyms.slice(0, -1).join(".");
while (syms.length) {
syms.pop();
syms.push(this.pkgFileName);
relpath = syms.join("/") + ".js";
if (startedRelative && relpath.charAt(0) == "/") {
relpath = relpath.slice(1);
}
ok = this.loadPath(relpath, !omitModuleCheck ? moduleName : null);
if (ok) {
break;
}
syms.pop();
}
} else {
relpath = syms.join("/") + ".js";
moduleName = nsyms.join(".");
var modArg = !omitModuleCheck ? moduleName : null;
ok = this.loadPath(relpath, modArg);
if (!ok && !exactOnly) {
syms.pop();
while (syms.length) {
relpath = syms.join("/") + ".js";
ok = this.loadPath(relpath, modArg);
if (ok) {
break;
}
syms.pop();
relpath = syms.join("/") + "/" + this.pkgFileName + ".js";
if (startedRelative && relpath.charAt(0) == "/") {
relpath = relpath.slice(1);
}
ok = this.loadPath(relpath, modArg);
if (ok) {
break;
}
}
}
if (!ok && !omitModuleCheck) {
dojo.raise("Could not load '" + moduleName + "'; last tried '" + relpath + "'");
}
}
if (!omitModuleCheck && !this["isXDomain"]) {
module = this.findModule(moduleName, false);
if (!module) {
dojo.raise("symbol '" + moduleName + "' is not defined after loading '" + relpath + "'");
}
}
return module;
};
dojo.hostenv.startPackage = function (packageName) {
var fullPkgName = String(packageName);
var strippedPkgName = fullPkgName;
var syms = packageName.split(/\./);
if (syms[syms.length - 1] == "*") {
syms.pop();
strippedPkgName = syms.join(".");
}
var evaledPkg = dojo.evalObjPath(strippedPkgName, true);
this.loaded_modules_[fullPkgName] = evaledPkg;
this.loaded_modules_[strippedPkgName] = evaledPkg;
return evaledPkg;
};
dojo.hostenv.findModule = function (moduleName, mustExist) {
var lmn = String(moduleName);
if (this.loaded_modules_[lmn]) {
return this.loaded_modules_[lmn];
}
if (mustExist) {
dojo.raise("no loaded module named '" + moduleName + "'");
}
return null;
};
dojo.kwCompoundRequire = function (modMap) {
var common = modMap["common"] || [];
var result = modMap[dojo.hostenv.name_] ? common.concat(modMap[dojo.hostenv.name_] || []) : common.concat(modMap["default"] || []);
for (var x = 0; x < result.length; x++) {
var curr = result[x];
if (curr.constructor == Array) {
dojo.hostenv.loadModule.apply(dojo.hostenv, curr);
} else {
dojo.hostenv.loadModule(curr);
}
}
};
dojo.require = function (resourceName) {
dojo.hostenv.loadModule.apply(dojo.hostenv, arguments);
};
dojo.requireIf = function (condition, resourceName) {
var arg0 = arguments[0];
if ((arg0 === true) || (arg0 == "common") || (arg0 && dojo.render[arg0].capable)) {
var args = [];
for (var i = 1; i < arguments.length; i++) {
args.push(arguments[i]);
}
dojo.require.apply(dojo, args);
}
};
dojo.requireAfterIf = dojo.requireIf;
dojo.provide = function (resourceName) {
return dojo.hostenv.startPackage.apply(dojo.hostenv, arguments);
};
dojo.registerModulePath = function (module, prefix) {
return dojo.hostenv.setModulePrefix(module, prefix);
};
if (djConfig["modulePaths"]) {
for (var param in djConfig["modulePaths"]) {
dojo.registerModulePath(param, djConfig["modulePaths"][param]);
}
}
dojo.setModulePrefix = function (module, prefix) {
dojo.deprecated("dojo.setModulePrefix(\"" + module + "\", \"" + prefix + "\")", "replaced by dojo.registerModulePath", "0.5");
return dojo.registerModulePath(module, prefix);
};
dojo.exists = function (obj, name) {
var p = name.split(".");
for (var i = 0; i < p.length; i++) {
if (!obj[p[i]]) {
return false;
}
obj = obj[p[i]];
}
return true;
};
dojo.hostenv.normalizeLocale = function (locale) {
var result = locale ? locale.toLowerCase() : dojo.locale;
if (result == "root") {
result = "ROOT";
}
return result;
};
dojo.hostenv.searchLocalePath = function (locale, down, searchFunc) {
locale = dojo.hostenv.normalizeLocale(locale);
var elements = locale.split("-");
var searchlist = [];
for (var i = elements.length; i > 0; i--) {
searchlist.push(elements.slice(0, i).join("-"));
}
searchlist.push(false);
if (down) {
searchlist.reverse();
}
for (var j = searchlist.length - 1; j >= 0; j--) {
var loc = searchlist[j] || "ROOT";
var stop = searchFunc(loc);
if (stop) {
break;
}
}
};
dojo.hostenv.localesGenerated;
dojo.hostenv.registerNlsPrefix = function () {
dojo.registerModulePath("nls", "nls");
};
dojo.hostenv.preloadLocalizations = function () {
if (dojo.hostenv.localesGenerated) {
dojo.hostenv.registerNlsPrefix();
function preload(locale) {
locale = dojo.hostenv.normalizeLocale(locale);
dojo.hostenv.searchLocalePath(locale, true, function (loc) {
for (var i = 0; i < dojo.hostenv.localesGenerated.length; i++) {
if (dojo.hostenv.localesGenerated[i] == loc) {
dojo["require"]("nls.dojo_" + loc);
return true;
}
}
return false;
});
}
preload();
var extra = djConfig.extraLocale || [];
for (var i = 0; i < extra.length; i++) {
preload(extra[i]);
}
}
dojo.hostenv.preloadLocalizations = function () {
};
};
dojo.requireLocalization = function (moduleName, bundleName, locale, availableFlatLocales) {
dojo.hostenv.preloadLocalizations();
var targetLocale = dojo.hostenv.normalizeLocale(locale);
var bundlePackage = [moduleName, "nls", bundleName].join(".");
var bestLocale = "";
if (availableFlatLocales) {
var flatLocales = availableFlatLocales.split(",");
for (var i = 0; i < flatLocales.length; i++) {
if (targetLocale.indexOf(flatLocales[i]) == 0) {
if (flatLocales[i].length > bestLocale.length) {
bestLocale = flatLocales[i];
}
}
}
if (!bestLocale) {
bestLocale = "ROOT";
}
}
var tempLocale = availableFlatLocales ? bestLocale : targetLocale;
var bundle = dojo.hostenv.findModule(bundlePackage);
var localizedBundle = null;
if (bundle) {
if (djConfig.localizationComplete && bundle._built) {
return;
}
var jsLoc = tempLocale.replace("-", "_");
var translationPackage = bundlePackage + "." + jsLoc;
localizedBundle = dojo.hostenv.findModule(translationPackage);
}
if (!localizedBundle) {
bundle = dojo.hostenv.startPackage(bundlePackage);
var syms = dojo.hostenv.getModuleSymbols(moduleName);
var modpath = syms.concat("nls").join("/");
var parent;
dojo.hostenv.searchLocalePath(tempLocale, availableFlatLocales, function (loc) {
var jsLoc = loc.replace("-", "_");
var translationPackage = bundlePackage + "." + jsLoc;
var loaded = false;
if (!dojo.hostenv.findModule(translationPackage)) {
dojo.hostenv.startPackage(translationPackage);
var module = [modpath];
if (loc != "ROOT") {
module.push(loc);
}
module.push(bundleName);
var filespec = module.join("/") + ".js";
loaded = dojo.hostenv.loadPath(filespec, null, function (hash) {
var clazz = function () {
};
clazz.prototype = parent;
bundle[jsLoc] = new clazz();
for (var j in hash) {
bundle[jsLoc][j] = hash[j];
}
});
} else {
loaded = true;
}
if (loaded && bundle[jsLoc]) {
parent = bundle[jsLoc];
} else {
bundle[jsLoc] = parent;
}
if (availableFlatLocales) {
return true;
}
});
}
if (availableFlatLocales && targetLocale != bestLocale) {
bundle[targetLocale.replace("-", "_")] = bundle[bestLocale.replace("-", "_")];
}
};
(function () {
var extra = djConfig.extraLocale;
if (extra) {
if (!extra instanceof Array) {
extra = [extra];
}
var req = dojo.requireLocalization;
dojo.requireLocalization = function (m, b, locale, availableFlatLocales) {
req(m, b, locale, availableFlatLocales);
if (locale) {
return;
}
for (var i = 0; i < extra.length; i++) {
req(m, b, extra[i], availableFlatLocales);
}
};
}
})();
 
/tags/Racine_livraison_narmer/api/js/dojo/README
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/README
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/Storage_version6.swf
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/Racine_livraison_narmer/api/js/dojo/Storage_version6.swf
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/Racine_livraison_narmer/api/js/dojo/build.txt
New file
0,0 → 1,33
Files baked into this build:
dojoGuardStart.js
../src/bootstrap1.js
../src/loader.js
dojoGuardEnd.js
../src/hostenv_browser.js
../src/string/common.js
../src/string.js
../src/lang/common.js
../src/lang/extras.js
../src/io/common.js
../src/lang/array.js
../src/lang/func.js
../src/string/extras.js
../src/dom.js
../src/undo/browser.js
../src/io/BrowserIO.js
../src/io/cookie.js
../src/io/__package__.js
../src/event/common.js
../src/event/topic.js
../src/event/browser.js
../src/event/__package__.js
../src/gfx/color.js
../src/lfx/Animation.js
../src/html/common.js
../src/uri/Uri.js
../src/html/style.js
../src/html/display.js
../src/html/color.js
../src/html/layout.js
../src/lfx/html.js
../src/lfx/__package__.js
/tags/Racine_livraison_narmer/api/debogage/BOG_sql.fonct.php
New file
0,0 → 1,105
<?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: BOG_sql.fonct.php,v 1.2 2005-02-28 11:14:45 jpm Exp $
/**
*Paquetage : BOG - bibliothèque de fonctions de débogage.
*
* Ce paquetage contient des fonctions de débogage pour différent besoin:
* - erreur de requête
*
*@package Debogage
//Auteur original :
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
//Autres auteurs :
*@author Alexandre GRANIER <alex@tela-botanica.org>
*@author Laurent COUDOUNEAU <lc@gsite.org>
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.2 $ $Date: 2005-02-28 11:14:45 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +-------------------------------------------------------------------------+
// | Liste des fonctions |
// +-------------------------------------------------------------------------+
 
/**Fonction BOG_afficherErreurSql() - Permet d'afficher un message d'erreur sql complet.
*
* Cette fonction permet d'afficher un ensemble de données suite à une erreur de reqête sql
* permettant de trouver plus rapidement la source de l'erreur.
*
* @param string le nom du fichier d'où provient la requête erronée (utiliser __FILE__ lors de l'apple de cette fonction).
* @param integer le numéro de la ligne de la requête (utiliser __LINE__ lors de l'apple de cette fonction).
* @param string le message d'erreur fourni par le programmeur.
* @param string la requête sql erronée.
* @param string un éventuel commentaire complémentaire
*
* @return string l'ensemble des messages d'erreur et des informations collectées.
*/
function BOG_afficherErreurSql ($nom_fichier_courant, $numero_ligne_courante, $message_erreur, $requete = '', $autre = '')
{
$retour_erreur = "\n";
$retour_erreur .= '<div id="zone_erreur">'."\n";
$retour_erreur .= '<h1 > ERREUR SQL </h1><br />'."\n";
$retour_erreur .= '<p>'."\n";
$retour_erreur .= '<span class="champ_intitule" > Fichier : </span> ';
$retour_erreur .= '<span class="champ_valeur" > '.$nom_fichier_courant.'</span><br />'."\n";
$retour_erreur .= '<span class="champ_intitule" > Ligne n° : </span> ';
$retour_erreur .= '<span class="champ_valeur" > '.$numero_ligne_courante.'</span><br />'."\n";
$retour_erreur .= '<span class="champ_intitule" > Message erreur : </span> ';
$retour_erreur .= '<span class="champ_valeur" > '.$message_erreur.'</span><br />'."\n";
if ($requete != '') {
$retour_erreur .= '<span class="champ_intitule" > Requete : </span> ';
$retour_erreur .= '<span class="champ_valeur" > '.$requete.' </span><br />'."\n";
}
if ($autre != '') {
$retour_erreur .= '<span class="champ_intitule" > Autres infos : </span> ';
$retour_erreur .= '<span class="champ_valeur" > '.$autre.' </span><br />'."\n";
}
$retour_erreur .= '</p>'."\n";
$retour_erreur .= '</div>'."\n";
return $retour_erreur;
}
 
/* +--Fin du code ---------------------------------------------------------------------------------------+
* $Log: not supported by cvs2svn $
* Revision 1.1 2004/06/15 10:13:07 jpm
* Intégration dans Papyrus.
*
* Revision 1.4 2004/04/21 07:49:31 jpm
* Modification des commentaires.
*
* Revision 1.3 2004/03/22 16:23:29 jpm
* Correction point-virgule en trop.
*
* Revision 1.2 2004/03/22 12:17:06 jpm
* Utilisation de class et id CSS à la place des attributs styles.
*
*
* +--Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/tags/Racine_livraison_narmer/api/debogage/BOG_Gestionnaire_Erreur.class.php
New file
0,0 → 1,242
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.3 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This file is part of Papyrus. |
// | |
// | Foobar is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or |
// | (at your option) any later version. |
// | |
// | Foobar is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with Foobar; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: BOG_Gestionnaire_Erreur.class.php,v 1.6 2007-03-01 11:07:43 jp_milcent Exp $
/**
* Classe permettant de créer un gestionnaire d'erreur PHP
*
* La classe permet de créer un gestionnaire d'erreur PHP et de le configurer.
*
*@package Debogage
//Auteur original :
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.6 $ $Date: 2007-03-01 11:07:43 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
class BOG_Gestionnaire_Erreur {
// Attributs
var $tab_erreurs = array();
var $erreur_txt_tete = '';
var $erreur_txt_pied = '';
var $bln_contexte = false;
var $langue = 'fr';
var $aso_trad = array( 'niveau'=> 'Niveau d\'erreur : ', 'fichier' => 'Nom du fichier : ',
'ligne' => 'N° de ligne : ', 'contexte' => 'Contexte d\'erreur : ');
var $class = 'erreur';
var $active = 1;
// Constructeur
function BOG_Gestionnaire_Erreur($bln_contexte, $class = '', $langue = 'fr', $txt_tete = '', $txt_pied = '', $aso_trad = array())
{
$this->ecrireContexte($bln_contexte);
$this->ecrireLangue($langue);
$this->ecrireTxtTete($txt_tete);
$this->ecrireTxtPied($txt_pied);
if (count($aso_trad) != 0) {
$this->ecrireTraduction($aso_trad);
}
if (! empty($class)) {
$this->ecrireClass($class);
}
set_error_handler(array(&$this, 'gererErreur'));
}
// Accesseurs
function setActive($active)
{
$this->active=$active;
}
function ecrireErreur($aso_erreur)
{
array_push($this->tab_erreurs, $aso_erreur);
}
function lireTableauErreurs()
{
return $this->tab_erreurs;
}
function lireTxtTete()
{
return $this->erreur_txt_tete;
}
function ecrireTxtTete($txt_tete)
{
$this->erreur_txt_tete = $txt_tete;
}
function lireTxtPied()
{
return $this->erreur_txt_pied;
}
function ecrireTxtPied($txt_pied)
{
$this->erreur_txt_pied = $txt_pied;
}
function lireContexte()
{
return $this->bln_contexte;
}
function ecrireContexte($bln)
{
$this->bln_contexte = $bln;
}
function lireTraduction($cle)
{
return $this->aso_trad[$cle];
}
function ecrireTraduction($tab_trad)
{
$aso_trad['niveau'] = $tab_trad[0];
$aso_trad['fichier'] = $tab_trad[1];
$aso_trad['ligne'] = $tab_trad[2];
$aso_trad['contexte'] = $tab_trad[3];
$this->aso_trad = $aso_trad;
}
function lireClass()
{
return $this->class;
}
function ecrireClass($class)
{
$this->class = $class;
}
function lireLangue()
{
return $this->langue;
}
function ecrireLangue($langue)
{
$this->langue = $langue;
}
// Méthode
function gererErreur($niveau, $message, $fichier, $ligne, $contexte)
{
if ($this->active) {
// Ouais bof le test, mais php5 renvoie vraiment trop de message d'erreur sur Deprecated ... et
// ca concerne essentiellement les classes pear !
if (!defined('E_STRICT')) {
define("E_STRICT", 2048);
}
if ($niveau < E_STRICT) {
$aso_erreur = array();
$aso_erreur['niveau'] = $niveau;
$aso_erreur['message'] = $message;
$aso_erreur['fichier'] = $fichier;
$aso_erreur['ligne'] = $ligne;
if ($this->lireContexte()) {
$aso_erreur['contexte'] = $contexte;
}
$this->ecrireErreur($aso_erreur);
}
}
}
function retournerErreurs()
{
$contenu = '';
foreach($this->lireTableauErreurs() as $aso_erreur) {
switch (PAP_DEBOGAGE_TYPE) {
case 'FIREBUG':
$contenu .= "console.info(\"[Buggy] - ".
"Niveau : ".$aso_erreur['niveau']." - ".
"Fichier : ".$aso_erreur['fichier']." - ".
"Ligne :".$aso_erreur['ligne']." - ".
"Message : ".$aso_erreur['message']." - ".
"\");\n";
break;
case 'HTML':
default:
$contenu .= '<p class="'.$this->lireClass().'">'."\n";
$contenu .= '<strong>'.$this->lireTxtTete().$aso_erreur['message'].$this->lireTxtPied().'</strong><br />'."\n";
$contenu .= '<strong>'.$this->lireTraduction('niveau').'</strong>'.$aso_erreur['niveau'].'<br />'."\n";
$contenu .= '<strong>'.$this->lireTraduction('fichier').'</strong>'.$aso_erreur['fichier'].'<br />'."\n";
$contenu .= '<strong>'.$this->lireTraduction('ligne').'</strong>'.$aso_erreur['ligne'].'<br />'."\n";
if ($this->lireContexte()) {
$contenu .= '<pre>'."\n";
$contenu .= '<stong>'.$this->lireTraduction('contexte').'</stong>'.print_r($aso_erreur['contexte'], true)."\n";
$contenu .= '</pre>'."\n";
}
$contenu .= '</p>'."\n";
}
}
switch (PAP_DEBOGAGE_TYPE) {
case 'FIREBUG':
$retour = '<script>'."\n".$contenu.'</script>'."\n";
break;
case 'HTML':
default:
$retour = $contenu;
}
return $retour;
}
}
 
 
// +------------------------------------------------------------------------------------------------------+
// | PIED du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.5 2005/09/20 20:25:39 ddelon
* php5 et bugs divers
*
* Revision 1.4 2005/09/20 17:01:22 ddelon
* php5 et bugs divers
*
* Revision 1.3 2004/11/29 15:56:23 jpm
* Correction bogue.
*
* Revision 1.2 2004/11/29 15:54:16 jpm
* Changement de nom de variable et légère correction.
*
* Revision 1.1 2004/11/15 17:12:46 jpm
* Classe de gestion d'erreur pour PHP 4.3
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/tags/Racine_livraison_narmer/api/debogage/BOG_chrono.fonct.php
New file
0,0 → 1,129
<?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: BOG_chrono.fonct.php,v 1.3 2005-02-28 11:14:45 jpm Exp $
/**
* Bibliothèque de fonctions permettant de mesure le temps d'execution d'un script.
*
* Contient des fonctions permettant d'évaluer un script.
*
*@package Debogage
//Auteur original :
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.3 $ $Date: 2005-02-28 11:14:45 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE de FONCTIONS |
// +------------------------------------------------------------------------------------------------------+
/**Fonction BOG_afficherChrono() - Permet d'afficher les temps d'éxécution de différentes parties d'un script.
*
* Cette fonction permet d'afficher un ensemble de mesure de temps prises à différents endroits d'un script.
* Ces mesures sont affichées au sein d'un tableau XHTML dont on peut controler l'indentation des balises.
* Pour un site en production, il suffit d'ajouter un style #chrono {display:none;} dans la css. De cette façon,
* le tableau ne s'affichera pas. Le webmaster lui pourra rajouter sa propre feuille de style affichant le tableau.
* Le développeur initial de cette fonction est Loic d'Anterroches. Elle a été modifiée par Jean-Pascal Milcent.
* Elle utilise une variable gobale : $_CHRONO_
*
* @author Loic d'Anterroches
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @param int l'indentation de base pour le code html du tableau.
* @param int le pas d'indentation pour le code html du tableau.
* @return string la chaine XHTML de mesure des temps.
*/
function BOG_afficherChrono($indentation_origine = 8, $indentation = 4)
{
$sortie = str_repeat(' ', $indentation_origine).
'<table id="chrono" lang="fr" summary="Résultat du chronométrage du programme affichant la page actuelle.">'."\n";
$sortie .= str_repeat(' ', ($indentation_origine + ($indentation * 1))).
'<caption>Chronométrage</caption>'."\n";
$sortie .= str_repeat(' ', ($indentation_origine + ($indentation * 1))).
'<thead>'."\n";
$sortie .= str_repeat(' ', ($indentation_origine + ($indentation * 2))).
'<tr><th>Action</th><th>Temps écoulé (en s.)</th><th>Cumul du temps écoulé (en s.)</th></tr>'."\n";
$sortie .= str_repeat(' ', ($indentation_origine + ($indentation * 1))).
'</thead>'."\n";
$tbody = str_repeat(' ', ($indentation_origine + ($indentation * 1))).
'<tbody>'."\n";
$total_tps_ecoule = 0;
// Récupération de la première mesure
list($usec, $sec) = explode(' ', $GLOBALS['_CHRONO_']['depart']);
// Ce temps correspond à tps_fin
$tps_fin = ((float)$usec + (float)$sec);
foreach ($GLOBALS['_CHRONO_'] as $cle => $valeur) {
list($usec, $sec) = explode(' ',$valeur);
$tps_debut = ((float)$usec + (float)$sec);
$tps_ecoule = abs($tps_fin - $tps_debut);
$total_tps_ecoule += $tps_ecoule;
$tbody .= str_repeat(' ', ($indentation_origine + ($indentation * 2))).
'<tr>'.
'<th>'.$cle.'</th>'.
'<td>'.number_format($tps_ecoule,3).'</td>'.
'<td>'.number_format($total_tps_ecoule,3).'</td>'.
'</tr>'."\n";
$tps_fin = $tps_debut;
}
$tbody .= str_repeat(' ', ($indentation_origine + ($indentation * 1))).
'</tbody>'."\n";
$sortie .= str_repeat(' ', ($indentation_origine + ($indentation * 1))).
'<tfoot>'."\n";
$sortie .= str_repeat(' ', ($indentation_origine + ($indentation * 2))).
'<tr>'.
'<th>'.'Total du temps écoulé (en s.)'.'</th>'.
'<td colspan="2">'.number_format($total_tps_ecoule,3).'</td>'.
'</tr>'."\n";
$sortie .= str_repeat(' ', ($indentation_origine + ($indentation * 1))).
'</tfoot>'."\n";
$sortie .= $tbody;
$sortie .= str_repeat(' ', $indentation_origine).
'</table>'."\n";
return $sortie;
}
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.2 2004/11/29 15:54:16 jpm
* Changement de nom de variable et légère correction.
*
* Revision 1.1 2004/06/15 10:13:07 jpm
* Intégration dans Papyrus.
*
* Revision 1.2 2004/04/22 09:01:55 jpm
* Ajout de l'attribut lang au tableau.
*
* Revision 1.1 2004/04/21 07:49:13 jpm
* Ajout d'une bibliothèque de fonction pour le chronométrage des scripts.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/tags/Racine_livraison_narmer/api/sql/SQL_manipulation.fonct.php
New file
0,0 → 1,76
<?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: SQL_manipulation.fonct.php,v 1.2 2004-10-21 15:17:19 alex Exp $
/**
* Bibliothèque de fonctions liées au SQL
*
* Contient des fonctions permettant d'automatiser certaine requête SQL.
*
*@package SQL
//Auteur original :
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.2 $ $Date: 2004-10-21 15:17:19 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE de FONCTIONS |
// +------------------------------------------------------------------------------------------------------+
/** Fonction SQL_obtenirNouveauId()- Retourne le prochain identifiant numérique libre d'une table.
*
* On passe en paramètre le nom de la table, le nom du champ cotnenant la clé et l'objet PEAR DB
*
* @param mixed handler de connexion
* @param string Nom de la table
* @param string Nom du champ identifiant.
* @return mixed la nouvelle valeur de clé pouvant être utilisé ou false en cas d'erreur sql.
*/
 
function SQL_obtenirNouveauId(&$db, $table, $colonne_identifiant)
{
$requete = 'SELECT MAX('.$colonne_identifiant.') AS maxi FROM '.$table;
$resultat = $db->query($requete);
if (DB::isError($resultat) || $resultat->numRows() > 1) {
return false;
}
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT);
return $ligne->maxi + 1;
}
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.1 2004/06/15 10:13:26 jpm
* Intégration dans Papyrus.
*
* Revision 1.1 2004/04/28 11:38:54 jpm
* Ajout d'un fichier de fonctions de manipulation sql.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>